* info/dir: Add htmlfontify.
-2012-12-29 Andreas Schwab <schwab@linux-m68k.org>
+2013-01-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2013-01-04 stdio: remove now-unnecessary stdio.c
+ 2013-01-04 fprintftime: depend on stdio, not ignore-value
+ 2013-01-04 fwrite: silence __wur only for older glibc versions
+ 2013-01-04 fwrite: silence __wur without using inline
+ * lib/stdio.c: Remove.
+ * lib/stdio.in.h, lib/strftime.c: Update from gnulib.
+ * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
+
+2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating copyright-date changes and:
+ 2012-12-31 dup2: work around cygwin bug
+
+2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
+
+ * configure.ac: Check for GtkHandlebox.
+ Check for GtkTearoffMenuItem.
+ New enable: --enable-gtk-deprecation-warnings, default off.
+ (HAVE_GTK3): If above enable is off, add
+ -DGDK_DISABLE_DEPRECATION_WARNINGS to GTK_CFLAGS.
+
+2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
* configure.ac (TEMACS_LDFLAGS2): Don't define.
(LIBS_GNUSTEP): Set for GNUstep and substitute.
(LD_SWITCH_SYSTEM_TEMACS): Don't set for GNUstep.
-2012-12-24 Andreas Schwab <schwab@linux-m68k.org>
+2012-12-27 Glenn Morris <rgm@gnu.org>
+
+ * configure.ac (emacs_config_options): New.
+ Use $@ rather than undocumented $ac_configure_args.
+ Replace any embedded double quotes. (Bug#13274)
+
+2012-12-27 Andreas Schwab <schwab@linux-m68k.org>
* configure.ac (SIGNALS_VIA_CHARACTERS): Also define for darwin.
(Bug#13222)
-2012-12-20 Akinori MUSHA <knu@iDaemons.org> (tiny change)
+2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Revert static checking of stack smashing.
+ * configure.ac (WARN_CFLAGS): Omit -Wstack-protector when
+ configured with --enable-gcc-warnings. -Wstack-protector causes
+ diagnostics to be issued on Ubuntu 12.10 x86-64.
+
+2012-12-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2012-12-21 AC_PROG_MKDIR_P: port workaround to pre-2.62 Autoconf
+ 2012-12-20 AC_PROG_MKDIR_P: don't workaround if not buggy
+ 2012-12-17 filemode, sys_stat: Handle MPX files a la AIX.
+
+2012-12-21 Akinori MUSHA <knu@iDaemons.org> (tiny change)
* Makefile.in (install-arch-dep): Ignore chmod errors. (Bug#13233)
+2012-12-16 Romain Francoise <romain@orebokech.com>
+
+ * configure.ac (acl): New option.
+ (HAVE_POSIX_ACL): Test for POSIX ACL support. This is typically
+ provided by libacl on GNU/Linux.
+
+2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix permissions bugs with setgid directories etc. (Bug#13125)
+ * configure.ac (BSD4_2): Remove; no longer needed.
+
2012-12-13 Glenn Morris <rgm@gnu.org>
- * info/dir: Add bovine, wisent.
+ * info/dir: Add bovine, srecode, wisent.
-2012-12-12 Andreas Schwab <schwab@suse.de>
+2012-12-13 Andreas Schwab <schwab@suse.de>
* Makefile.in (install-info): Use `${MAKE} -s' for echo-info.
- (uninstall): Likewise.
+ (uninstall): Likewise. (Bug#13143)
+
+2012-12-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib for 'inline' (Bug#13040), incorporating:
+ 2012-12-11 extern-inline: avoid incompatibility with Darwin Libc
+ * m4/extern-inline.m4: Update from gnulib.
+
+2012-12-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * lib/makefile.w32-in (SIG2STR_H): New macro.
+ ($(BLD)/sig2str.$(O)): Update dependencies.
+
+2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * configure.ac (HAVE_INOTIFY): Speed up configure-time test.
+ There's no need to test for any of three inotify functions,
+ since we use all three. Check for just the first one.
+
+2012-12-10 Daniel Colascione <dancol@dancol.org>
+
+ * .bzrignore: add src/emacs.res.
-2012-12-12 Glenn Morris <rgm@gnu.org>
+ * configure.ac (W32_RES, W32_RES_LINK, WINDRES): Teach the cygw32
+ build how to compile Windows resource files; use these variables
+ to tell src/Makefile.in how and whether to compile resources.
- * info/dir: Add srecode.
+2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
-2012-12-11 Nicolas Richard <theonewiththeevillook@yahoo.fr> (tiny change)
+ * configure.ac (inotify): New option.
+ (HAVE_INOTIFY): Test for inotify.
+
+2012-12-09 Andreas Schwab <schwab@linux-m68k.org>
+
+ * configure.ac: Fix source command in .gdbinit.
+ Don't quote $MAKEINFO.
+
+2012-12-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ Allow spaces in some configuration vars (Bug#13078).
+ * configure.ac (srcdir): Don't assume $PWD lacks spaces.
+ (srcdir, MAKEINFO, PKG_CONFIG, PKG_CONFIG_MIN_VERSION):
+ All uses quoted, to allow spaces in these vars.
+
+2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
+ * lib/putenv.c, lib/unsetenv.c, m4/putenv.m4, m4/setenv.m4:
+ New files, copied automatically from gnulib.
+ * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
- * Makefile.in (install-info, uninstall): Ensure make's messages
- about changing directories are in English. (Bug#13143)
+2012-12-08 Eli Zaretskii <eliz@gnu.org>
-2012-12-05 Glenn Morris <rgm@gnu.org>
+ * lib/makefile.w32-in ($(BLD)/sig2str.$(O)): New dependency.
+ Remove a stray character at the beginning of the file.
+ (Bug#13026)
+
+2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify get_lim_data.
+ * configure.ac (ULIMIT_BREAK_VALUE): Remove.
+
+ Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
+ * configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
+ Use SIGCHLD rather than SIGCLD.
+ * lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
+ * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
+ * lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
+
+2012-12-06 Glenn Morris <rgm@gnu.org>
* configure.ac: Handle info/ files with or without ".info" extension.
-2012-11-24 Eli Zaretskii <eliz@gnu.org>
+2012-11-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib for 'inline' (Bug#13040), incorporating:
+ 2012-11-29 snippet/warn-on-use: no 'static inline'
+ 2012-11-29 ftruncate, fts, lstat, openat, raise: no 'static inline'
+ 2012-11-29 arctwo, md4, md5, sha1, sha256, sha512: no 'static inline'
+ 2012-11-29 fflush, stat: no 'static inline'
+ 2012-11-29 stdio: better 'inline'
+ 2012-11-29 sys_stat: no 'static inline'
+ 2012-11-29 unistd: better 'inline'
+ 2012-11-29 c-strtod, memcoll, readutmp: no 'static inline'
+ 2012-11-29 extern-inline: no 'static inline'
+ 2012-11-29 sys_socket: better 'inline'
+ * lib/stdio.c, lib/unistd.c: New files, from gnulib.
+ * build-aux/snippet/warn-on-use.h, lib/gnulib.mk, lib/lstat.c:
+ * lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c, lib/stat.c:
+ * lib/stdio.in.h, lib/sys_stat.in.h, lib/unistd.in.h, m4/c-strtod.m4:
+ * m4/extern-inline.m4, m4/gnulib-comp.m4, m4/lstat.m4, m4/md5.m4:
+ * m4/sha1.m4, m4/sha256.m4, m4/sha512.m4, m4/stat.m4, m4/stdio_h.m4:
+ * m4/sys_socket_h.m4, m4/sys_stat_h.m4, m4/unistd_h.m4:
+ Update from gnulib.
+
+2012-11-27 Eli Zaretskii <eliz@gnu.org>
* make-dist (nt): Adjust to changes in names of the *.manifest files.
+2012-11-24 Ken Brown <kbrown@cornell.edu>
+
+ * configure.ac (HAVE_MOUSE): Remove.
+
+2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
+ * configure.ac: Do not check for dirent.h or closdir.
+
+2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
+ * configure.ac: Do not check for getcwd or getwd.
+
2012-11-21 Glenn Morris <rgm@gnu.org>
* configure.ac (--enable-profiling): Doc fix.
+2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ Improve static checking of integer overflow and stack smashing.
+ * configure.ac (WARN_CFLAGS): Add -Wstack-protector
+ if using GCC 4.7.2 or later on a platform with
+ at least 64-bit long int. This improves static checking on these
+ platforms, when configured with --enable-gcc-warnings.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
+ * configure.ac: Do not check for fcntl.h.
+ * lib/gnulib.mk: Regenerate.
+
+2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ Remove no-longer-used pty_max_bytes variable.
+ * configure.ac (fpathconf): Remove unnecessary check.
+
+2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use faccessat, not access, when checking file permissions (Bug#12632).
+ * .bzrignore: Add lib/fcntl.h.
+ * configure.ac (euidaccess): Remove check; gnulib does this for us now.
+ (gl_FCNTL_O_FLAGS): Define a dummy version.
+ * lib/at-func.c, lib/euidaccess.c, lib/faccessat.c, lib/fcntl.in.h:
+ * lib/getgroups.c, lib/group-member.c, lib/root-uid.h:
+ * lib/xalloc-oversized.h, m4/euidaccess.m4, m4/faccessat.m4:
+ * m4/fcntl_h.m4, m4/getgroups.m4, m4/group-member.m4:
+ New files, from gnulib.
+ * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
+
+2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
+ * configure.ac (setpgid, setsid): Assume their existence.
+ (AC_FUNC_GETPGRP, SETPGRP_RELEASES_CTTY): Remove; obsolete.
+
+ Simplify by assuming __fpending.
+ Now that Emacs is using the gnulib fpending module,
+ there's no need for Emacs to have a separate implementation.
+ * configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks.
+ (PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove.
+
+2012-11-03 Eli Zaretskii <eliz@gnu.org>
+
+ * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/fpending.$(O) and
+ $(BLD)/close-stream.$(O).
+ ($(BLD)/close-stream.$(O)):
+ ($(BLD)/fpending.$(O)): New dependencies.
+
+2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix data-loss with --batch (Bug#9574).
+ * lib/close-stream.c, lib/close-stream.h, lib/fpending.c
+ * lib/fpending.h, m4/close-stream.m4, m4/fpending.m4:
+ New files, from gnulib.
+ * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
+
2012-11-03 Eli Zaretskii <eliz@gnu.org>
* config.bat: Copy lib/execinfo.in.h to lib/execinfo.in-h if needed.
+2012-11-02 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (EMACS_ICON): New variable.
+ (install-etc): Use EMACS_ICON to allow choice of icon.
+
2012-10-26 Glenn Morris <rgm@gnu.org>
* Makefile.in (EMACS_NAME): New variable.
done
## Install those items from etc/ that need to end up elsewhere.
+
+## If you prefer, choose "emacs22" at installation time.
+## Note: emacs22 does not have all the resolutions.
+EMACS_ICON=emacs
+
install-etc:
umask 022; ${MKDIR_P} $(DESTDIR)${desktopdir}
tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \
for dir in */*/apps */*/mimetypes; do \
[ -d $${dir} ] || continue ; \
( cd $${thisdir}; ${MKDIR_P} $(DESTDIR)${icondir}/$${dir} ) ; \
- for icon in $${dir}/emacs[.-]*; do \
+ for icon in $${dir}/${EMACS_ICON}[.-]*; do \
[ -r $${icon} ] || continue ; \
ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \
- dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\.$${ext}$$||" -e '$(TRANSFORM)'`.$${ext} ; \
+ dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\.$${ext}$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \
( cd $${thisdir}; \
${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${dir}/$${dest} ) \
|| exit 1; \
See the end of the file for license conditions.
-This directory tree holds version 24.2.91 of GNU Emacs, the extensible,
+This directory tree holds version 24.3.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
AIX
_AIX
-BSD4_2
BSD_SYSTEM
CYGWIN Compiling the Cygwin port.
__CYGWIN__ Ditto
AMPERSAND_FULL_NAME
BROKEN_DATAGRAM_SOCKETS
BROKEN_FIONREAD
-BROKEN_GETWD
BROKEN_GET_CURRENT_DIR_NAME
BROKEN_NON_BLOCKING_CONNECT
BROKEN_PTY_READ_AFTER_EAGAIN
HAVE_CFSETSPEED
HAVE_CLOCK_GETTIME
HAVE_CLOCK_SETTIME
-HAVE_CLOSEDIR
HAVE_COFF_H
HAVE_COM_ERR_H
HAVE_COPYSIGN
HAVE_DEV_PTMX
HAVE_DIALOGS
HAVE_DIFFTIME
-HAVE_DIRENT_H
HAVE_DUP2
HAVE_ENDGRENT
HAVE_ENDPWENT
HAVE_ENVIRON_DECL
HAVE_EUIDACCESS
-HAVE_FCNTL_H
HAVE_FORK
-HAVE_FPATHCONF
HAVE_FREEIFADDRS
HAVE_FREETYPE
HAVE_FSEEKO
HAVE_GAI_STRERROR
HAVE_GCONF
HAVE_GETADDRINFO
-HAVE_GETCWD
HAVE_GETDELIM
HAVE_GETGRENT
HAVE_GETHOSTNAME
HAVE_GETRUSAGE
HAVE_GETSOCKNAME
HAVE_GETTIMEOFDAY
-HAVE_GETWD
HAVE_GET_CURRENT_DIR_NAME
HAVE_GHOSTSCRIPT
HAVE_GIF
HAVE_MENUS
HAVE_MKSTEMP
HAVE_MMAP
-HAVE_MOUSE
HAVE_MULTILINGUAL_MENU
HAVE_NANOTIME
HAVE_NET_IF_DL_H
HAVE_SEQPACKET
HAVE_SETITIMER
HAVE_SETLOCALE
-HAVE_SETPGID
HAVE_SETRLIMIT
-HAVE_SETSID
HAVE_SHARED_GAME_DIR
HAVE_SHUTDOWN
HAVE_SIGNED_${GLTYPE}
HAVE_SIGNED_WCHAR_T
HAVE_SIGNED_WINT_T
HAVE_SIGSET_T
-HAVE_SIZE_T
HAVE_SNPRINTF
HAVE_SOCKETS
HAVE_SOUND
HAVE_TOUCHLOCK
HAVE_TZNAME
HAVE_TZSET
-HAVE_UNISTD_H
HAVE_UNSIGNED_LONG_LONG_INT
HAVE_UTIL_H
HAVE_UTIMENSAT
NSIG_MINIMUM
NULL_DEVICE
ORDINARY_LINK
-O_RDONLY
-O_RDWR
PAGESIZE
-PENDING_OUTPUT_COUNT
PREFER_VSUSP
PTY_ITERATION
PTY_NAME_SPRINTF
PTY_TTY_NAME_SPRINTF
PURESIZE
RUN_TIME_REMAP
-SETPGRP_RELEASES_CTTY
SETUP_SLAVE_PTY
-SIGALRM
-SIGCHLD
-SIGHUP
-SIGKILL
SIGNALS_VIA_CHARACTERS
-SIGPIPE
-SIGQUIT
-SIGTRAP
STDC_HEADERS
SYSTEM_PURESIZE_EXTRA
SYSTEM_MALLOC
TIME_WITH_SYS_TIME
TIOCSIGSEND
TM_IN_SYS_TIME
-ULIMIT_BREAK_VALUE
UNIX98_PTYS
USE_TOOLKIT_SCROLL_BARS
USG_SUBTTY_WORKS
+2013-01-03 Glenn Morris <rgm@gnu.org>
+
+ * check-doc-strings: Update for CVS->bzr, moved lispref/ directory.
+
+ * emacs-pretesters, make-announcement, make-changelog-diff:
+ Remove files.
+
+2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix permissions bugs with setgid directories etc. (Bug#13125)
+ * CPP-DEFINES (BSD4_2): Remove.
+
+2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
+ * merge-gnulib (GNULIB_MODULES): Add putenv, unsetenv.
+
+ Simplify get_lim_data.
+ * CPP-DEFINES (ULIMIT_BREAK_VALUE): Remove.
+
+2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
+ * CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
+ Remove.
+ (SIGTRAP): Remove this one too, as config.h no longer defines it.
+ * merge-gnulib (GNULIB_MODULES): Add sig2str.
+
+2012-11-24 Ken Brown <kbrown@cornell.edu>
+
+ * CPP-DEFINES (HAVE_MOUSE): Remove.
+
+2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
+ * CPP-DEFINES (HAVE_CLOSEDIR, HAVE_DIRENT_H): Remove.
+ * notes/copyright: Adjust to src/ndir.h -> nt/inc/dirent.h renaming.
+
+2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
+ * CPP-DEFINES (BROKEN_GETWD, HAVE_GETCWD, HAVE_GETWD, HAVE_SIZE_T)
+ (HAVE_UNISTD_H): Remove.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
+ * CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove.
+ * merge-gnulib (GNULIB_MODULES): Add fcntl-h.
+
+2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ Remove no-longer-used pty_max_bytes variable.
+ * CPP-DEFINES (HAVE_FPATHCONF): Remove.
+
+2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use faccessat, not access, when checking file permissions (Bug#12632).
+ * merge-gnulib (GNULIB_MODULES): Add faccessat.
+ (GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix,
+ openat-die, openat-h, save-cwd. Do not avoid fcntl-h.
+ Omit gnulib's m4/fcntl-o.m4.
+
+2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
+ * CPP-DEFINES (HAVE_SETPGID, HAVE_SETSID, SETPGRP_RELEASES_CTTY):
+ Remove; obsolete.
+
+ Simplify by assuming __fpending.
+ * CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove.
+
+2012-11-03 Glenn Morris <rgm@gnu.org>
+
+ * admin.el (set-copyright): Add msdos/sed2v2.inp.
+
+2012-11-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix data-loss with --batch (Bug#9574).
+ * merge-gnulib (GNULIB_MODULES): Add close-stream.
+
2012-10-12 Kenichi Handa <handa@gnu.org>
* charsets/Makefile (JISC6226.map): Add missing mappings.
1.
==============================================================================
-Richard Stallman
- ???
-
Jason Rumney
W32
etc/calccard.tex
doc/misc/calc.texi
-Michael Olson
- ERC
- lisp/erc/*
- etc/ERC-NEWS
- doc/misc/erc.texi
- lisp/emacs-lisp/tq.el
-
Bastien Guerry
Org
lisp/org/*
2.
==============================================================================
-Steven Tamm
- MacOS
-
Eli Zaretskii
doc/*
lispref/*
Utilities for setting version numbers and alike.
-** make-announcement, make-changelog-diff
-
-Scripts used to prepare release announcements.
-
* Scripts that can be used to build and test Emacs.
(set-version-in-file root "configure.ac" copyright
(rx (and bol "copyright" (0+ (not (in ?\")))
?\" (submatch (1+ (not (in ?\")))) ?\")))
+ (set-version-in-file root "msdos/sed2v2.inp" copyright
+ (rx (and bol "/^#undef " (1+ not-newline)
+ "define COPYRIGHT" (1+ space)
+ ?\" (submatch (1+ (not (in ?\")))) ?\")))
(set-version-in-file root "nt/config.nt" copyright
(rx (and bol "#" (0+ blank) "define" (1+ blank)
"COPYRIGHT" (1+ blank)
This program is in the public domain.\n";
die $usage if @ARGV;
-die $usage unless -r "src/alloc.c" && -d "CVS" && -d "lisp";
+die $usage unless -r "src/alloc.c" && -d ".bzr" && -d "lisp";
my %texi_funtype;
my %texi_arglist;
Show_details $show_details, $function, "@parms", $docstring;
}
-my $lisprefdir;
-if (-d "man/lispref") { $lisprefdir = "man/lispref"; }
-elsif (-d "lispref") { $lisprefdir = "lispref"; }
-else { die "Can't find lispref texi directory.\n"; }
+my $lisprefdir = "doc/lispref";
+die "Can't find lispref texi directory.\n" unless -d $lisprefdir;
open (FIND, "find $lisprefdir -name '*.texi' -print |") or die;
while (my $file = <FIND>) {
+++ /dev/null
-Here are the guidelines for being an Emacs pretester.
-If you would like to do this, say so, and I'll add you to
-the pretest list.
-
-
- Information for Emacs Pretesters
-
-The purpose of Emacs pretesting is to verify that the new Emacs
-distribution, about to be released, works properly on your system *with
-no change whatever*, when installed following the precise
-recommendations that come with the Emacs distribution.
-
-Here are some guidelines on how to do pretesting so as to make it
-helpful. All of them follow from common sense together with the
-nature of the purpose and the situation.
-
-Please save this file, and reread it when a new series of pretests
-starts.
-
-* Get the pretest from gnu/emacs/pretest/emacs-MM.0.NN.tar.gz
-on alpha.gnu.org.
-
-* After a few days of testing, if there are no problems, please report
-that Emacs works for you and what configuration you are testing it on.
-
-* If you want to communicate with other pretesters, send mail to
-emacs-pretesters@gnu.org. I don't use that mailing list when I send
-to you because I've found that mailing lists tend to amplify random
-noise into long discussions or even arguments, and that can waste a
-lot of time. But when you have a reason to ask other pretesters for
-help, you can do it that way.
-
-* It is absolutely vital that you report even the smallest change or
-departure from the standard sources and procedure.
-
-Otherwise, you are not testing the same program that we asked you to
-test. Testing a different program is usually of no use whatever. It
-can even cause trouble, if you fail to tell us that you tested some
-other program instead of what we are about to release. We might think
-that Emacs works, when in fact it has not even been tried, and might
-have a glaring fault.
-
-* Don't use a site-load.el file or a site-init.el file when you pretest.
-Using either of those files means you are not testing Emacs as a typical
-site would use it.
-
-Actually, it does no harm to test Emacs with such customizations *as
-well as* testing it "out of the box". Anything you do that could find
-a bug is useful, as long as you make sure we know exactly what you
-did. The important point is that testing with local changes is no
-substitute for testing Emacs exactly as it is distributed.
-
-* Even changing the compilation options counts as a change in the
-program. The Emacs sources specify which compilation options to use.
-Some of them are specified in makefiles, and some in machine-specific
-configuration files. They also give you ways to override this--but if
-you do, then you are not testing what ordinary users will do.
-Therefore, when pretesting, it is vital to test with the default
-compilation options.
-
-(Testing with a different set of options can be useful *in addition*,
-but not *instead of* the default options.)
-
-* The machine and system configuration files of Emacs are parts of
-Emacs. So when you test Emacs, you need to do it with the
-configuration files that come with Emacs.
-
-If Emacs does not come with configuration files for a certain machine,
-and you test it with configuration files that don't come with Emacs,
-this is effectively changing Emacs. Because the crucial fact about
-the planned release is that, without changes, it doesn't work on that
-machine.
-
-To make Emacs work on that machine, we would need to install new
-configuration files. That is not out of the question, since it is
-safe--it certainly won't break any other machines that already work.
-But you will have to rush in the legal papers to give the FSF
-permission to use such a large piece of text.
-
-* Look in the etc/MACHINES file.
-
-The etc/MACHINES file says which configuration files to use for your
-machine, so use the ones that are recommended. If you guess, you might
-guess wrong and encounter spurious difficulties. What's more, if you
-don't follow etc/MACHINES then you aren't helping to test that its
-recommendations are valid.
-
-The etc/MACHINES file may describe other things that you need to do
-to make Emacs work on your machine. If so, you should follow these
-recommendations also, for the same reason.
-
-* Send your problem reports to bug-gnu-emacs@gnu.org.
-
-Sometimes we won't know what to do about a system-dependent issue, and
-we may need people to say what happens if you try a certain thing on a
-certain system. When this happens, we'll send out a query.
-
-* Don't delay sending information.
-
-When you test on a system and encounter no problems, please report it
-right away. That way, we will know that someone has tested Emacs on
-that kind of system.
-
-Please don't wait for several days "to see if it really works before
-you say anything." Tell us right away that Emacs seems basically to
-work; then, if you notice a problem a few days later, tell us
-immediately about that when you see it.
-
-It is okay if you double check things before reporting a problem, such
-as to see if you can easily fix it. But don't wait very long. A good
-rule to use in pretesting is always to report every problem on the
-same day you encounter it, even if that means you can't find a
-solution before you report the problem.
-
-I'd much rather hear about a problem today and a solution tomorrow
-than get both of them tomorrow at the same time.
-
-* Make each bug report self-contained.
-
-If you refer back to another message, whether from you or from someone
-else, then it will be necessary for anyone who wants to investigate
-the bug to find the other message. This may be difficult, it is
-probably time-consuming.
-
-To help save our time, simply copy the relevant parts of any previous
-messages into your own bug report.
-
-In particular, if we ask you for more information because a bug report
-was incomplete, it is best to send me the *entire* collection of
-relevant information, all together. If you send just the additional
-information, that makes extra work for us. There is even a risk that
-we won't remember what question you are sending the answer to.
-
-* When you encounter a bug that manifests itself as a Lisp error,
-try setting debug-on-error to t and making the bug happen again.
-Then you will get a Lisp backtrace. Including that in your bug report
-is very useful.
-
-* For advice on debugging, see etc/DEBUG.
-
-* Debugging optimized code is possible, if you compile with GCC, but
-in some cases the optimized code can be confusing. If you are not
-accustomed to that, recompile Emacs without -O. One way to do this is
-
- make clean
- make CFLAGS=-g
-
-* Configure tries to figure out what kind of system you have by
-compiling and linking programs which calls various functions and looks
-at whether that succeeds. The file config.log contains any messages
-produced by compilers while running configure, to aid debugging if
-configure makes a mistake. But note that config.cache reads:
-
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-
-or more simply,
-
-rm config.cache
-./configure
-
-* Don't try changing Emacs *in any way* during pretest unless it fails
-to work unchanged.
-
-* Always be precise when talking about changes you have made. Show
-things rather than describing them. Use exact filenames (relative to
-the main directory of the distribution), not partial ones. For
-example, say "I changed Makefile" rather than "I changed the
-makefile". Instead of saying "I defined the MUMBLE macro", send a
-diff.
-
-* Always use `diff -c' to make diffs. If you don't include context, it
-may be hard for us to figure out where you propose to make the
-changes. So we might ignore your patch.
-
-* When you write a fix, keep in mind that we can't install a change
-that *might* break other systems without the risk that it will fail to
-work and therefore require an additional cycle of pretesting.
-
-People often suggest fixing a problem by changing config.h or
-src/Makefile to do something special that a particular system needs.
-Sometimes it is totally obvious that such changes would break Emacs
-for almost all users. We can't possibly make a change like that. All
-we can do is ask you to find a fix that is safe to install.
-
-Sometimes people send fixes that *might* be an improvement in
-general--but it is hard to be sure of this. I can install such
-changes some of the time, but not during pretest, when I am trying to
-get a new version to work reliably as quickly as possible.
-
-The safest changes for us to install are changes to the s- and m-
-files. At least those can't break other systems.
-
-Another safe kind of change is one that uses a conditional to make
-sure it will apply only to a particular kind of system. Ordinarily,
-that is a bad way to solve a problem, and I would want to find a
-cleaner alternative. But the virtue of safety can make it superior at
-pretest time.
-
-* Don't suggest changes during pretest to add features or make
-something cleaner. Every change risks introducing a bug, so I won't
-install a change during pretest unless it is *necessary*.
-
-* If you would like to suggest changes for purposes other than fixing
-user-visible bugs, don't wait till pretest time. Instead, send them
-after we have made a release that proves to be stable. That is the
-easiest time to consider such suggestions. If you send them at
-pretest time, we will have to defer them till later, and that might
-mean we forget all about them.
-
-* In some cases, if you don't follow these guidelines, your
-information might still be useful, but we would have to do more work
-to make use of it. That might cause it to fall by the wayside.
-\f
-Local Variables:
-mode: text
-End:
-
+++ /dev/null
-#! /bin/bash
-
-## Copyright (C) 2002-2013 Free Software Foundation, Inc.
-
-## Author: Francesco Potorti` <pot@gnu.org>
-
-## This file is part of GNU Emacs.
-
-## GNU Emacs is free software: you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation, either version 3 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/>.
-
-
-### Code:
-
-if [ $# -ne 2 ]; then
- echo "usage: $0 <old version number> <new version number>" >&2
- exit 1
-fi
-
-if [ ! -f INSTALL -o ! -f configure -o ! -d lib-src ]; then
- echo "this script should be run in the emacs root directory" >&2
- exit 2
-fi
-
-OLD=$1
-NEW=$2
-outfile=emacs-$NEW.announce
-oldtag=EMACS_PRETEST_$(echo $OLD|tr . _)
-newtag=EMACS_PRETEST_$(echo $NEW|tr . _)
-
-if [ -f $outfile ]; then
- echo "$outfile exists"
- echo -n "interrupt to abort, ENTER to overwrite "; read answer
-fi
-
-echo -n "tag name for OLD emacs version $OLD [$oldtag]: "; read answer
-if [ "$answer" ]; then oldtag=$answer; fi
-
-echo -n "tag name for NEW emacs version $NEW [$newtag]: "; read answer
-if [ "$answer" ]; then newtag=$answer; fi
-
-exec > $outfile
-
-cat <<EOF
-
-There is a new pretest available in
-
- <ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-$NEW.tar.gz>
-
-Please report results from compiling and running the pretest to
-<bug-gnu-emacs@gnu.org>. Your feedback is necessary for us
-to know on which platforms the pretest has been tried.
-
-If you have the tars from the previous pretest, and you have the
-\`xdelta' utility, you can instead download the much smaller
-
- <ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-$OLD-$NEW.xdelta>
-
-You can use a command like
-
- $ xdelta patch XDELTA PREVIOUS-TAR CURRENT-TAR
-
-to generate the new tar from the old one, where XDELTA is the xdelta
-file you downloaded, PREVIOUS-TAR is the tar file from the previous
-pretest, and CURRENT-TAR is the name of the tar file you downloaded.
-
-Information about xdelta can be found on the GNU ftp site, in
-/non-gnu/xdelta.README.
-
-Changes since $OLD
-
-EOF
-
-make-changelog-diff $oldtag $newtag
-
-echo " announcement created in $outfile" >&2
-
+++ /dev/null
-#! /bin/bash
-
-## Author: Francesco Potorti` <pot@gnu.org>
-
-if [ $# -ne 2 ]; then
- echo "usage: $0 TAG1 TAG2" >&2
- exit 1
-fi
-
-if [ ! -f INSTALL -o ! -f configure -o ! -d lib-src ]; then
- echo "this script should be run in the emacs root directory" >&2
- exit 2
-fi
-
-cvs -q diff -b -r $1 -r $2 $(find -name ChangeLog|sort) |
- sed -n -e 's/^=\+/======/p' -e 's/^> //p' -e 's/^diff.*//p' \
- -e 's/^RCS file: .cvsroot.emacs.emacs.\(.*\),v/\1/p' |
- sed -n -e "/^======$/ {
- N
- N
- h
- d
- }
- H
- s/.*//
- x
- s/^\n//
- p"
-
For each step, check for possible errors.
+0. Decide on versions of automake and autoconf, and ensure you will
+ have them available for the duration of the release process.
+
1. `bzr update' (for a bound branch), or `bzr pull'.
bzr status # check for locally modified files
make sure that the later tagged version will bootstrap, should it be
necessary to check it out.
-3. Regenerate Emacs' etc/AUTHORS file (M-x load-file RET
- lisp/emacs-lisp/authors.el RET, then M-x authors RET, then save
- the *Authors* buffer). This may require fixing syntactically
- incorrect ChangeLog entries beforehand.
+3. Regenerate the etc/AUTHORS file:
+ M-: (require 'authors) RET, M-x authors RET, save the *Authors* buffer.
+ If there are errors that relate to syntactically incorrect
+ ChangeLog entries, consider fixing them and repeating.
4. Set the version number (M-x load-file RET admin/admin.el RET, then
- M-x set-version RET). For a release, add released change log
+ M-x set-version RET). For a release, add released ChangeLog
entries (M-x add-release-logs RET).
For a pretest, start at version .90. After .99, use .990 (so that
something like `find . | sort' in a clean bzr tree, and compare the
results against the new tar contents.
-8. xdelta delta emacs-OLD.tar.gz emacs-NEW.tar.gz emacs-OLD-NEW.xdelta
-
-9. tar -zxf emacs-NEW.tar.gz; cd emacs-NEW
+8. tar -zxf emacs-NEW.tar.gz; cd emacs-NEW
./configure && make && make -n install
Use `script' or M-x compile to save the compilation log in
compile-NEW.log and compare it against an old one. The easiest way
number of the old Emacs to __, do the same with the new log and do
M-x ediff. Especially check that Info files aren't built.
-10. cd EMACS_ROOT_DIR; bzr tag TAG
+9. cd EMACS_ROOT_DIR; bzr tag TAG
TAG is emacs-XX.Y.ZZ for a pretest, emacs-XX.Y for a release.
Shortly before the release, cut the version branch also, and open
be sent to the emacs-diffs mailing list (by default, the list
normally only gets commits to the trunk).
-11. Now you should upload the files to the GNU ftp server. In order to
+10. Now you should upload the files to the GNU ftp server. In order to
do that, you must be registered as an Emacs maintainer and have your
- GPG key acknowledged by the ftp people. Mail <ftp-upload@gnu.org>
- for instructions.
-
- You can use the gnupload script to upload each FILE, like this:
+ GPG key acknowledged by the ftp people. For instructions, see
+ http://www.gnu.org/prep/maintain/html_node/Automated-Upload-Registration.html
+ You can use the gnulib script "gnupload" to upload each FILE, like this:
gnupload --to alpha.gnu.org:emacs/pretest FILE (for a pretest)
gnupload --to ftp.gnu.org:emacs FILE (for a release)
For a pretest, place the files in /incoming/alpha instead, so that
they appear on ftp://alpha.gnu.org/.
- For a release, upload a bz2 tarfile as well; this can save a lot
+ For a release, upload xz and bz2 tarfiles as well; this can save a lot
of bandwidth.
-12. After five minutes, verify that the files are visible at
+11. After five minutes, verify that the files are visible at
ftp://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, at
ftp://ftp.gnu.org/gnu/emacs/ for a release.
-13. For a pretest, announce it on emacs-devel and BCC the pretesters.
- For a release, announce it on info-gnu@gnu.org,
- info-gnu-emacs@gnu.org, and emacs-devel.
+12. For a pretest, announce it on emacs-devel and info-gnu-emacs@gnu.org.
+ For a release, also announce it on info-gnu@gnu.org. (Probably
+ bcc the info- addresses to make it less likely that people will
+ followup on those lists.)
-14. For a release, update the Emacs homepage in the web repository.
+13. For a release, update the Emacs homepage in the web repository.
Also add the new NEWS file as NEWS.xx.y.
GNULIB_MODULES='
alloca-opt c-ctype c-strcase
- careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512
- dtoastr dtotimespec dup2 environ execinfo
- filemode getloadavg getopt-gnu gettime gettimeofday
+ careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512
+ dtoastr dtotimespec dup2 environ execinfo faccessat
+ fcntl-h filemode getloadavg getopt-gnu gettime gettimeofday
ignore-value intprops largefile lstat
- manywarnings mktime pselect pthread_sigmask readlink
- socklen stat-time stdalign stdarg stdbool stdio
+ manywarnings mktime pselect pthread_sigmask putenv readlink
+ sig2str socklen stat-time stdalign stdarg stdbool stdio
strftime strtoimax strtoumax symlink sys_stat
- sys_time time timer-time timespec-add timespec-sub utimens
+ sys_time time timer-time timespec-add timespec-sub unsetenv utimens
warnings
'
GNULIB_TOOL_FLAGS='
- --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat
- --avoid=msvc-inval --avoid=msvc-nothrow
- --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types
+ --avoid=at-internal
+ --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat
+ --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow
+ --avoid=openat-die --avoid=openat-h
+ --avoid=raise
+ --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types
--avoid=threadlib
--conditional-dependencies --import --no-changelog --no-vc-files
--makefile-name=gnulib.mk
}
"$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS $GNULIB_MODULES &&
-rm -- "$src"m4/gnulib-cache.m4 "$src"m4/warn-on-use.m4 &&
+rm -- "$src"m4/fcntl-o.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"}
You could also try `bzr add --file-ids-from', if you have a copy of
another branch where file still exists.
+* Undoing a commit (uncommitting)
+
+It is possible to undo/remove a bzr commit (ie, to uncommit).
+Only do this if you really, really, need to. For example, if you
+somehow made a commit that triggers a bug in bzr itself.
+Don't do it because you made a typo in a commit or the log.
+
+If you do need to do this, do it as soon as possible, because the
+longer you leave it, the more work is involved.
+
+0. First, tell emacs-devel that you are going to do this, and suggest
+people not commit anything to the affected branch for the duration.
+
+In the following, replace USER with your Savannah username, and
+BRANCH with the name of the branch.
+Let's assume that revno 100 is the bad commit, and that there have
+been two more commits after that (because nothing is ever easy).
+
+1. Ensure your copy of the branch is up-to-date (for a bound
+branch, bzr up; for an unbound branch, bzr pull) and has no local
+changes (bzr st).
+
+2. Make a record of the commits you are going to undo:
+bzr diff -c 102 > /tmp/102.diff
+etc
+
+Also record the commit message, author, and any --fixes information.
+
+3. Most Emacs branches are set up to prevent just this kind of thing.
+So we need to disable that protection:
+
+bzr config append_revisions_only=False \
+ -d bzr+ssh://USER@bzr.savannah.gnu.org/emacs/BRANCH/
+
+4. Undo the commits:
+bzr uncommit -r -4
+
+This will show the commits it is going to undo, and prompt you to confirm.
+
+5. If using an unbound branch:
+bzr push --overwrite
+
+6. Now, replay the commits you just undid (obviously, fix whatever it
+was in the bad commit that caused the problem):
+
+patch -p0 < /tmp/100.diff
+bzr commit --author ... --fixes ... -F /tmp/100.log
+etc
+
+7. If using an unbound branch:
+bzr push
+
+8. Finally, re-enable the branch protection:
+bzr config append_revisions_only=True \
+ -d bzr+ssh://USER@bzr.savannah.gnu.org/emacs/BRANCH/
+
+9. Tell emacs-devel that it is ok to use the branch again.
+Anyone with local changes should back them up before doing anything.
+
+For a bound branch, bzr up will convert any of the undone commits to a
+pending merge. Just bzr revert these away.
+
+For an unbound branch, bzr pull will complain about diverged branches
+and refuse to do anything. Use bzr pull --overwrite.
+
* Loggerhead
Loggerhead is the bzr tool for viewing a repository over http (similar
src/gmalloc.c
- contains numerous copyrights from the GNU C library. Leave them alone.
-src/ndir.h
+nt/inc/dirent.h
- see comments below. This file is OK to be released with Emacs
22, but we may want to revisit it afterwards.
File says it's in the public domain, but that might not make it so.
etc/e/eterm-color.ti
-src/ndir.h
+nt/inc/dirent.h
On legal advice from Matt Norwood, the following comment was added
to these files in Feb/Mar 2007:
@SET_MAKE@
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub 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=at-internal --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=openat-h --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask putenv readlink sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/c-strtod.m4 \
- $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/dup2.m4 \
- $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/execinfo.m4 \
- $(top_srcdir)/m4/extensions.m4 \
- $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/filemode.m4 \
- $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \
- $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+ $(top_srcdir)/m4/clock_time.m4 \
+ $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/dup2.m4 \
+ $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/euidaccess.m4 \
+ $(top_srcdir)/m4/execinfo.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 \
+ $(top_srcdir)/m4/faccessat.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/fpending.m4 \
+ $(top_srcdir)/m4/getgroups.m4 $(top_srcdir)/m4/getloadavg.m4 \
+ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettime.m4 \
+ $(top_srcdir)/m4/gettimeofday.m4 \
$(top_srcdir)/m4/gnulib-common.m4 \
$(top_srcdir)/m4/gnulib-comp.m4 \
+ $(top_srcdir)/m4/group-member.m4 \
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \
$(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/longlong.m4 \
$(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/manywarnings.m4 \
$(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \
$(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/pathmax.m4 \
$(top_srcdir)/m4/pselect.m4 \
- $(top_srcdir)/m4/pthread_sigmask.m4 \
- $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/sha1.m4 \
- $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \
+ $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/setenv.m4 \
+ $(top_srcdir)/m4/sha1.m4 $(top_srcdir)/m4/sha256.m4 \
+ $(top_srcdir)/m4/sha512.m4 $(top_srcdir)/m4/sig2str.m4 \
$(top_srcdir)/m4/signal_h.m4 $(top_srcdir)/m4/socklen.m4 \
$(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \
$(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
am__DEPENDENCIES_1 =
am__libgnu_a_SOURCES_DIST = allocator.c c-ctype.h c-ctype.c \
c-strcase.h c-strcasecmp.c c-strncasecmp.c careadlinkat.c \
- md5.c sha1.c sha256.c sha512.c dtoastr.c dtotimespec.c \
- filemode.c gettext.h gettime.c stat-time.c strftime.c \
- timespec.c timespec-add.c timespec-sub.c u64.c utimens.c
+ close-stream.c md5.c sha1.c sha256.c sha512.c dtoastr.c \
+ dtotimespec.c filemode.c gettext.h gettime.c stat-time.c \
+ strftime.c timespec.c timespec-add.c timespec-sub.c u64.c \
+ unistd.c utimens.c
am__objects_1 =
am_libgnu_a_OBJECTS = allocator.$(OBJEXT) c-ctype.$(OBJEXT) \
c-strcasecmp.$(OBJEXT) c-strncasecmp.$(OBJEXT) \
- careadlinkat.$(OBJEXT) md5.$(OBJEXT) sha1.$(OBJEXT) \
- sha256.$(OBJEXT) sha512.$(OBJEXT) dtoastr.$(OBJEXT) \
- dtotimespec.$(OBJEXT) filemode.$(OBJEXT) $(am__objects_1) \
- gettime.$(OBJEXT) stat-time.$(OBJEXT) strftime.$(OBJEXT) \
- timespec.$(OBJEXT) timespec-add.$(OBJEXT) \
- timespec-sub.$(OBJEXT) u64.$(OBJEXT) utimens.$(OBJEXT)
+ careadlinkat.$(OBJEXT) close-stream.$(OBJEXT) md5.$(OBJEXT) \
+ sha1.$(OBJEXT) sha256.$(OBJEXT) sha512.$(OBJEXT) \
+ dtoastr.$(OBJEXT) dtotimespec.$(OBJEXT) filemode.$(OBJEXT) \
+ $(am__objects_1) gettime.$(OBJEXT) stat-time.$(OBJEXT) \
+ strftime.$(OBJEXT) timespec.$(OBJEXT) timespec-add.$(OBJEXT) \
+ timespec-sub.$(OBJEXT) u64.$(OBJEXT) unistd.$(OBJEXT) \
+ utimens.$(OBJEXT)
libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
GNULIB_FDOPEN = @GNULIB_FDOPEN@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
GNULIB_MKTIME = @GNULIB_MKTIME@
GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
GNULIB_PCLOSE = @GNULIB_PCLOSE@
GNULIB_PERROR = @GNULIB_PERROR@
GNULIB_PIPE = @GNULIB_PIPE@
HAVE_FCHDIR = @HAVE_FCHDIR@
HAVE_FCHMODAT = @HAVE_FCHMODAT@
HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
HAVE_FDATASYNC = @HAVE_FDATASYNC@
HAVE_FSEEKO = @HAVE_FSEEKO@
HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
HAVE_PCLOSE = @HAVE_PCLOSE@
HAVE_PIPE = @HAVE_PIPE@
LD_SWITCH_SYSTEM_TEMACS = @LD_SWITCH_SYSTEM_TEMACS@
LD_SWITCH_X_SITE = @LD_SWITCH_X_SITE@
LD_SWITCH_X_SITE_RPATH = @LD_SWITCH_X_SITE_RPATH@
+LIBACL_LIBS = @LIBACL_LIBS@
LIBGIF = @LIBGIF@
LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
LIBXT_OTHER = @LIBXT_OTHER@
LIBX_OTHER = @LIBX_OTHER@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_EACCESS = @LIB_EACCESS@
LIB_EXECINFO = @LIB_EXECINFO@
LIB_GCC = @LIB_GCC@
LIB_MATH = @LIB_MATH@
MAKEINFO = @MAKEINFO@
MKDEPDIR = @MKDEPDIR@
MKDIR_P = @MKDIR_P@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
NEXT_GETOPT_H = @NEXT_GETOPT_H@
NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
REPLACE_DUP2 = @REPLACE_DUP2@
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
REPLACE_FDOPEN = @REPLACE_FDOPEN@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FOPEN = @REPLACE_FOPEN@
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
REPLACE_PERROR = @REPLACE_PERROR@
REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
VMLIMIT_OBJ = @VMLIMIT_OBJ@
W32_LIBS = @W32_LIBS@
W32_OBJ = @W32_OBJ@
+W32_RES = @W32_RES@
+W32_RES_LINK = @W32_RES_LINK@
WARN_CFLAGS = @WARN_CFLAGS@
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
WERROR_CFLAGS = @WERROR_CFLAGS@
WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
WINDOW_SYSTEM_OBJ = @WINDOW_SYSTEM_OBJ@
+WINDRES = @WINDRES@
WINT_T_SUFFIX = @WINT_T_SUFFIX@
XFT_CFLAGS = @XFT_CFLAGS@
XFT_LIBS = @XFT_LIBS@
# statements but through direct file reference. Therefore this snippet must be
# present in all Makefile.am that need it. This is ensured by the applicability
# 'all' defined above.
-BUILT_SOURCES = $(ALLOCA_H) $(EXECINFO_H) $(GETOPT_H) inttypes.h \
- signal.h arg-nonnull.h c++defs.h warn-on-use.h $(STDALIGN_H) \
- $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \
- stdlib.h sys/select.h sys/stat.h sys/time.h time.h unistd.h
-EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h md5.h sha1.h \
- sha256.h sha512.h dosname.h ftoastr.c ftoastr.h dup2.c \
- execinfo.c execinfo.in.h filemode.h getloadavg.c getopt.c \
- getopt.in.h getopt1.c getopt_int.h gettimeofday.c \
- ignore-value.h intprops.h inttypes.in.h lstat.c \
- mktime-internal.h mktime.c pathmax.h pselect.c \
- pthread_sigmask.c readlink.c signal.in.h \
+BUILT_SOURCES = $(ALLOCA_H) $(EXECINFO_H) fcntl.h $(GETOPT_H) \
+ inttypes.h signal.h arg-nonnull.h c++defs.h warn-on-use.h \
+ $(STDALIGN_H) $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \
+ stdio.h stdlib.h sys/select.h sys/stat.h sys/time.h time.h \
+ unistd.h
+EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h close-stream.h \
+ md5.h sha1.h sha256.h sha512.h dosname.h ftoastr.c ftoastr.h \
+ dup2.c euidaccess.c execinfo.c execinfo.in.h at-func.c \
+ faccessat.c fcntl.in.h filemode.h fpending.c fpending.h \
+ getgroups.c getloadavg.c getopt.c getopt.in.h getopt1.c \
+ getopt_int.h gettimeofday.c group-member.c ignore-value.h \
+ intprops.h inttypes.in.h lstat.c mktime-internal.h mktime.c \
+ pathmax.h pselect.c pthread_sigmask.c putenv.c readlink.c \
+ root-uid.h sig2str.c sig2str.h signal.in.h \
$(top_srcdir)/build-aux/snippet/_Noreturn.h \
$(top_srcdir)/build-aux/snippet/arg-nonnull.h \
$(top_srcdir)/build-aux/snippet/c++defs.h \
strtol.c strtoll.c strtol.c strtoul.c strtoull.c strtoimax.c \
strtoumax.c symlink.c sys_select.in.h sys_stat.in.h \
sys_time.in.h time.in.h time_r.c timespec.h u64.h unistd.in.h \
- utimens.h verify.h
+ unsetenv.c utimens.h verify.h xalloc-oversized.h
MOSTLYCLEANDIRS = sys sys
MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t execinfo.h \
- execinfo.h-t getopt.h getopt.h-t inttypes.h inttypes.h-t \
- signal.h signal.h-t arg-nonnull.h arg-nonnull.h-t c++defs.h \
- c++defs.h-t warn-on-use.h warn-on-use.h-t stdalign.h \
+ execinfo.h-t fcntl.h fcntl.h-t getopt.h getopt.h-t inttypes.h \
+ inttypes.h-t signal.h signal.h-t arg-nonnull.h arg-nonnull.h-t \
+ c++defs.h c++defs.h-t warn-on-use.h warn-on-use.h-t stdalign.h \
stdalign.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \
stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \
stdlib.h stdlib.h-t sys/select.h sys/select.h-t sys/stat.h \
AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src
libgnu_a_SOURCES = allocator.c c-ctype.h c-ctype.c c-strcase.h \
- c-strcasecmp.c c-strncasecmp.c careadlinkat.c md5.c sha1.c \
- sha256.c sha512.c dtoastr.c dtotimespec.c filemode.c \
- $(am__append_1) gettime.c stat-time.c strftime.c timespec.c \
- timespec-add.c timespec-sub.c u64.c utimens.c
+ c-strcasecmp.c c-strncasecmp.c careadlinkat.c close-stream.c \
+ md5.c sha1.c sha256.c sha512.c dtoastr.c dtotimespec.c \
+ filemode.c $(am__append_1) gettime.c stat-time.c strftime.c \
+ timespec.c timespec-add.c timespec-sub.c u64.c unistd.c \
+ utimens.c
libgnu_a_LIBADD = $(gl_LIBOBJS)
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
-EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c execinfo.c getloadavg.c \
- getopt.c getopt1.c gettimeofday.c lstat.c mktime.c pselect.c \
- pthread_sigmask.c readlink.c stat.c strtoimax.c strtol.c \
- strtoll.c strtol.c strtoul.c strtoull.c strtoimax.c \
- strtoumax.c symlink.c time_r.c
+EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c euidaccess.c execinfo.c \
+ at-func.c faccessat.c fpending.c getgroups.c getloadavg.c \
+ getopt.c getopt1.c gettimeofday.c group-member.c lstat.c \
+ mktime.c pselect.c pthread_sigmask.c putenv.c readlink.c \
+ sig2str.c stat.c strtoimax.c strtol.c strtoll.c strtol.c \
+ strtoul.c strtoull.c strtoimax.c strtoumax.c symlink.c \
+ time_r.c unsetenv.c
# Because this Makefile snippet defines a variable used by other
# gnulib Makefile snippets, it must be present in all Makefile.am that
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/at-func.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strcasecmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strncasecmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/careadlinkat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-stream.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtotimespec.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/euidaccess.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execinfo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpending.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftoastr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group-member.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_sigmask.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putenv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha256.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha512.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig2str.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-time.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespec-sub.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespec.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u64.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimens.Po@am__quote@
.c.o:
@GL_GENERATE_EXECINFO_H_FALSE@execinfo.h: $(top_builddir)/config.status
@GL_GENERATE_EXECINFO_H_FALSE@ rm -f $@
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(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_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
+ -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
+ -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/fcntl.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+
# We need the following in order to create <getopt.h> when the system
# doesn't have one that works with the given compiler.
getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
m4_include([m4/alloca.m4])
m4_include([m4/c-strtod.m4])
m4_include([m4/clock_time.m4])
+m4_include([m4/close-stream.m4])
m4_include([m4/dup2.m4])
m4_include([m4/environ.m4])
+m4_include([m4/euidaccess.m4])
m4_include([m4/execinfo.m4])
m4_include([m4/extensions.m4])
m4_include([m4/extern-inline.m4])
+m4_include([m4/faccessat.m4])
+m4_include([m4/fcntl_h.m4])
m4_include([m4/filemode.m4])
+m4_include([m4/fpending.m4])
+m4_include([m4/getgroups.m4])
m4_include([m4/getloadavg.m4])
m4_include([m4/getopt.m4])
m4_include([m4/gettime.m4])
m4_include([m4/gettimeofday.m4])
m4_include([m4/gnulib-common.m4])
m4_include([m4/gnulib-comp.m4])
+m4_include([m4/group-member.m4])
m4_include([m4/include_next.m4])
m4_include([m4/inttypes.m4])
m4_include([m4/largefile.m4])
m4_include([m4/pathmax.m4])
m4_include([m4/pselect.m4])
m4_include([m4/pthread_sigmask.m4])
+m4_include([m4/putenv.m4])
m4_include([m4/readlink.m4])
+m4_include([m4/setenv.m4])
m4_include([m4/sha1.m4])
m4_include([m4/sha256.m4])
m4_include([m4/sha512.m4])
+m4_include([m4/sig2str.m4])
m4_include([m4/signal_h.m4])
m4_include([m4/socklen.m4])
m4_include([m4/ssize_t.m4])
/* Define to the number of bits in type 'wint_t'. */
#undef BITSIZEOF_WINT_T
-/* Define if getwd should not be used. */
-#undef BROKEN_GETWD
-
/* Define if get_current_dir_name should not be used. */
#undef BROKEN_GET_CURRENT_DIR_NAME
/* Define on FreeBSD to work around an issue when reading from a PTY. */
#undef BROKEN_PTY_READ_AFTER_EAGAIN
-/* Define if the system is compatible with BSD 4.2. */
-#undef BSD4_2
-
/* Define if the system is compatible with BSD 4.2. */
#undef BSD_SYSTEM
/* Character that separates directories in a file name. */
#undef DIRECTORY_SEP
-/* Define if dispnew.c should include stdio_ext.h. */
-#undef DISPNEW_NEEDS_STDIO_EXT
-
/* Define if process.c does not need to close a pty to make it a controlling
terminal (it is already a controlling terminal of the subprocess, because
we did ioctl TIOCSCTTY). */
garbage collection in the jmp_buf. */
#undef GC_SETJMP_WORKS
-/* Define to 1 if the `getpgrp' function requires zero arguments. */
-#undef GETPGRP_VOID
+/* Define to the type of elements in the array set by `getgroups'. Usually
+ this is either `int' or `gid_t'. */
+#undef GETGROUPS_T
+
+/* Define this to 1 if getgroups(0,NULL) does not return the number of groups.
+ */
+#undef GETGROUPS_ZERO_BUG
/* Define if gettimeofday clobbers the localtime buffer. */
#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
/* Define this to enable glyphs debugging code. */
#undef GLYPH_DEBUG
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module close-stream shall be considered present. */
+#undef GNULIB_CLOSE_STREAM
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module faccessat shall be considered present. */
+#undef GNULIB_FACCESSAT
+
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module fscanf shall be considered present. */
#undef GNULIB_FSCANF
startup, if using GTK. */
#undef G_SLICE_ALWAYS_MALLOC
+/* Define to 1 if you have the `access' function. */
+#undef HAVE_ACCESS
+
/* Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists. */
#undef HAVE_AIX_SMT_EXP
/* Define to 1 if you have the `clock_settime' function. */
#undef HAVE_CLOCK_SETTIME
-/* Define to 1 if you have the `closedir' function. */
-#undef HAVE_CLOSEDIR
-
/* Define to 1 if you have the <coff.h> header file. */
#undef HAVE_COFF_H
*/
#undef HAVE_DECL_TZNAME
+/* Define to 1 if you have the declaration of `unsetenv', and to 0 if you
+ don't. */
+#undef HAVE_DECL_UNSETENV
+
+/* Define to 1 if you have the declaration of `__fpending', and to 0 if you
+ don't. */
+#undef HAVE_DECL___FPENDING
+
/* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you
don't. */
#undef HAVE_DECL___SYS_SIGLIST
/* Define to 1 if you have the `difftime' function. */
#undef HAVE_DIFFTIME
-/* Define to 1 if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
-
/* Define to 1 if you have the 'dup2' function. */
#undef HAVE_DUP2
+/* Define to 1 if you have the `eaccess' function. */
+#undef HAVE_EACCESS
+
/* Define to 1 if you have the `endgrent' function. */
#undef HAVE_ENDGRENT
/* Define to 1 if you have the <execinfo.h> header file. */
#undef HAVE_EXECINFO_H
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
+/* Define to 1 if you have the `faccessat' function. */
+#undef HAVE_FACCESSAT
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
-/* Define to 1 if you have the `fpathconf' function. */
-#undef HAVE_FPATHCONF
-
/* Define to 1 if you have the `freeifaddrs' function. */
#undef HAVE_FREEIFADDRS
/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
-/* Define to 1 if you have the `getcwd' function. */
-#undef HAVE_GETCWD
-
/* Define to 1 if you have the `getdelim' function. */
#undef HAVE_GETDELIM
/* Define to 1 if you have the `getgrent' function. */
#undef HAVE_GETGRENT
+/* Define to 1 if your system has a working `getgroups' function. */
+#undef HAVE_GETGROUPS
+
/* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
-/* Define to 1 if you have the `getwd' function. */
-#undef HAVE_GETWD
-
/* Define to 1 if you have the `get_current_dir_name' function. */
#undef HAVE_GET_CURRENT_DIR_NAME
/* Define to 1 if you have the `gtk_file_selection_new' function. */
#undef HAVE_GTK_FILE_SELECTION_NEW
+/* Define to 1 if you have the `gtk_handle_box_new' function. */
+#undef HAVE_GTK_HANDLE_BOX_NEW
+
/* Define to 1 if you have the `gtk_main' function. */
#undef HAVE_GTK_MAIN
/* Define to 1 if you have the `gtk_orientable_set_orientation' function. */
#undef HAVE_GTK_ORIENTABLE_SET_ORIENTATION
+/* Define to 1 if you have the `gtk_tearoff_menu_item_new' function. */
+#undef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
+
/* Define to 1 if you have the `gtk_widget_get_mapped' function. */
#undef HAVE_GTK_WIDGET_GET_MAPPED
/* Define to 1 if you have inet sockets. */
#undef HAVE_INET_SOCKETS
+/* Define to 1 to use inotify. */
+#undef HAVE_INOTIFY
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `dnet' library (-ldnet). */
#undef HAVE_LIBDNET
+/* Define to 1 if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_H
+
/* Define to 1 if you have the hesiod library (-lhesiod). */
#undef HAVE_LIBHESIOD
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
-/* Define if you have mouse support. */
-#undef HAVE_MOUSE
-
/* Define to 1 if you have the `nanotime' function. */
#undef HAVE_NANOTIME
/* Define to 1 if you have the <png.h> header file. */
#undef HAVE_PNG_H
+/* Define to 1 if using POSIX ACL support. */
+#undef HAVE_POSIX_ACL
+
/* Define to 1 if you have the `posix_memalign' function. */
#undef HAVE_POSIX_MEMALIGN
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
-/* Define to 1 if you have the `setpgid' function. */
-#undef HAVE_SETPGID
-
/* Define to 1 if you have the `setrlimit' function. */
#undef HAVE_SETRLIMIT
-/* Define to 1 if you have the `setsid' function. */
-#undef HAVE_SETSID
-
/* Define to 1 if you have the `shutdown' function. */
#undef HAVE_SHUTDOWN
+/* Define to 1 if you have the `sig2str' function. */
+#undef HAVE_SIG2STR
+
/* Define to 1 if 'sig_atomic_t' is a signed integer type. */
#undef HAVE_SIGNED_SIG_ATOMIC_T
/* Define to 1 if you have the <sys/bitypes.h> header file. */
#undef HAVE_SYS_BITYPES_H
+/* Define to 1 if you have the <sys/inotify.h> header file. */
+#undef HAVE_SYS_INOTIFY_H
+
/* Define to 1 if you have the <sys/inttypes.h> header file. */
#undef HAVE_SYS_INTTYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
/* Define to 1 if the system has the type 'unsigned long long int'. */
#undef HAVE_UNSIGNED_LONG_LONG_INT
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Number of chars of output in the buffer of a stdio stream. */
-#undef PENDING_OUTPUT_COUNT
+/* the number of pending output bytes on stream 'fp' */
+#undef PENDING_OUTPUT_N_BYTES
/* Define to empty to suppress deprecation warnings when building with
--enable-gcc-warnings and with libpng versions before 1.5, which lack
/* Character that separates PATH elements. */
#undef SEPCHAR
-/* Define if process.c:child_setup should not call setpgrp. */
-#undef SETPGRP_RELEASES_CTTY
-
/* How to set up a slave PTY, if needed. */
#undef SETUP_SLAVE_PTY
timespec. */
#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
-/* Undocumented. */
-#undef ULIMIT_BREAK_VALUE
-
/* Define to 1 for Encore UMAX. */
#undef UMAX
/* Version number of package */
#undef VERSION
+/* Define to 1 if unsetenv returns void instead of int. */
+#undef VOID_UNSETENV
+
/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
'wchar_t'. */
#undef WCHAR_T_SUFFIX
when FOO is an inline function in the header; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
_GL_INLINE_HEADER_END contains useful stuff to put
- in the same include file, after uses of _GL_INLINE. */
-#if (__GNUC__ \
- ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
- : 199901L <= __STDC_VERSION__)
+ in the same include file, after uses of _GL_INLINE.
+
+ Suppress the use of extern inline on Apple's platforms,
+ as Libc-825.25 (2012-09-19) is incompatible with it; see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+ Perhaps Apple will fix this some day. */
+#if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : 199901L <= __STDC_VERSION__) \
+ && !defined __APPLE__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
-#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
# if __GNUC_GNU_INLINE__
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
# endif
# define _GL_EXTERN_INLINE extern
#else
-# define _GL_INLINE static inline
-# define _GL_EXTERN_INLINE static inline
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
#endif
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
/* Define to rpl_gmtime if the replacement function should be used. */
#undef gmtime
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#undef inline
-#endif
-
/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for emacs 24.2.91.
+# Generated by GNU Autoconf 2.65 for emacs 24.3.50.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# Identity of this package.
PACKAGE_NAME='emacs'
PACKAGE_TARNAME='emacs'
-PACKAGE_VERSION='24.2.91'
-PACKAGE_STRING='emacs 24.2.91'
+PACKAGE_VERSION='24.3.50'
+PACKAGE_STRING='emacs 24.3.50'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
LIBGNU_LTLIBDEPS
LIBGNU_LIBDEPS
gltests_WITNESS
+gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_FALSE
+gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_TRUE
gl_GNULIB_ENABLED_verify_FALSE
gl_GNULIB_ENABLED_verify_TRUE
gl_GNULIB_ENABLED_strtoull_FALSE
gl_GNULIB_ENABLED_strtoll_TRUE
gl_GNULIB_ENABLED_stat_FALSE
gl_GNULIB_ENABLED_stat_TRUE
+gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_FALSE
+gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_TRUE
gl_GNULIB_ENABLED_pathmax_FALSE
gl_GNULIB_ENABLED_pathmax_TRUE
+gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_FALSE
+gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_TRUE
gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE
gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE
+gl_GNULIB_ENABLED_getgroups_FALSE
+gl_GNULIB_ENABLED_getgroups_TRUE
+gl_GNULIB_ENABLED_euidaccess_FALSE
+gl_GNULIB_ENABLED_euidaccess_TRUE
gl_GNULIB_ENABLED_dosname_FALSE
gl_GNULIB_ENABLED_dosname_TRUE
LTLIBINTL
LIBINTL
+LIB_EACCESS
WINDOWS_64_BIT_OFF_T
HAVE_UNISTD_H
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
HAVE_GETOPT_H
NEXT_AS_FIRST_DIRECTIVE_GETOPT_H
NEXT_GETOPT_H
-PRAGMA_COLUMNS
-PRAGMA_SYSTEM_HEADER
-INCLUDE_NEXT_AS_FIRST_DIRECTIVE
-INCLUDE_NEXT
GETLOADAVG_LIBS
REPLACE_WCTOMB
REPLACE_UNSETENV
GNULIB_CALLOC_POSIX
GNULIB_ATOLL
GNULIB__EXIT
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
+NEXT_FCNTL_H
+PRAGMA_COLUMNS
+PRAGMA_SYSTEM_HEADER
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE
+INCLUDE_NEXT
+REPLACE_OPENAT
+REPLACE_OPEN
+REPLACE_FCNTL
+HAVE_OPENAT
+HAVE_FCNTL
+GNULIB_OPENAT
+GNULIB_OPEN
+GNULIB_NONBLOCKING
+GNULIB_FCNTL
GL_GENERATE_EXECINFO_H_FALSE
GL_GENERATE_EXECINFO_H_TRUE
LIB_EXECINFO
FONTCONFIG_CFLAGS
LIBXMU
LIBXTR6
+LIBACL_LIBS
LIBGNUTLS_LIBS
LIBGNUTLS_CFLAGS
LIBSELINUX_LIBS
VMLIMIT_OBJ
GMALLOC_OBJ
HAVE_XSERVER
+W32_RES_LINK
+W32_RES
W32_LIBS
W32_OBJ
+WINDRES
LIB_STANDARD
NS_OBJC_OBJ
NS_OBJ
with_gconf
with_gsettings
with_selinux
+with_acl
with_gnutls
+with_inotify
with_makeinfo
with_compress_info
with_pkg_config_prog
enable_check_lisp_object_type
enable_profiling
enable_autodepend
+enable_gtk_deprecation_warnings
enable_dependency_tracking
enable_largefile
enable_gcc_warnings
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures emacs 24.2.91 to adapt to many kinds of systems.
+\`configure' configures emacs 24.3.50 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of emacs 24.2.91:";;
+ short | recursive ) echo "Configuration of emacs 24.3.50:";;
esac
cat <<\_ACEOF
--enable-autodepend automatically generate dependencies to .h-files.
Requires GNU Make and Gcc. Enabled if GNU Make and
Gcc is found
+ --enable-gtk-deprecation-warnings
+ Show Gtk+/Gdk deprecation warnings for Gtk+ >= 3.0
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-largefile omit support for large files
--without-gconf don't compile with GConf support
--without-gsettings don't compile with GSettings support
--without-selinux don't compile with SELinux support
+ --without-acl don't compile with ACL support
--without-gnutls don't use -lgnutls for SSL/TLS support
+ --without-inotify don't compile with inotify (file-watch) support
--without-makeinfo don't require makeinfo for building manuals
--without-compress-info don't compress the installed Info pages
- --with-pkg-config-prog=PATH
- path to pkg-config for finding GTK and librsvg
+ --with-pkg-config-prog=FILENAME
+ file name of pkg-config for finding GTK and librsvg
--with-crt-dir=DIR directory containing crtn.o etc. The default is
/usr/lib, or /usr/lib64 on some platforms.
--with-gameuser=USER user for shared game score files
- --with-gnustep-conf=PATH
- path to GNUstep.conf; default $GNUSTEP_CONFIG_FILE,
+ --with-gnustep-conf=FILENAME
+ name of GNUstep.conf; default $GNUSTEP_CONFIG_FILE,
or /etc/GNUstep/GNUstep.conf
--with-x use the X Window System
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-emacs configure 24.2.91
+emacs configure 24.3.50
generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by emacs $as_me 24.2.91, which was
+It was created by emacs $as_me 24.3.50, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
as_fn_append ac_header_list " linux/version.h"
as_fn_append ac_header_list " sys/systeminfo.h"
-as_fn_append ac_header_list " stdio_ext.h"
-as_fn_append ac_header_list " fcntl.h"
as_fn_append ac_header_list " coff.h"
as_fn_append ac_header_list " pty.h"
as_fn_append ac_header_list " sys/vlimit.h"
as_fn_append ac_header_list " sys/utsname.h"
as_fn_append ac_header_list " pwd.h"
as_fn_append ac_header_list " utmp.h"
-as_fn_append ac_header_list " dirent.h"
as_fn_append ac_header_list " util.h"
as_fn_append ac_header_list " sys/socket.h"
as_fn_append ac_header_list " stdlib.h"
as_fn_append ac_func_list " tzset"
as_fn_append ac_func_list " readlinkat"
as_fn_append ac_header_list " execinfo.h"
+as_fn_append ac_func_list " faccessat"
+as_fn_append ac_header_list " stdio_ext.h"
+as_fn_append ac_func_list " __fpending"
gl_getopt_required=GNU
as_fn_append ac_header_list " getopt.h"
as_fn_append ac_func_list " gettimeofday"
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+emacs_config_options="$@"
ac_config_headers="$ac_config_headers src/config.h:src/config.in"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
-
mkdir_p="$MKDIR_P"
case $mkdir_p in
[\\/$]* | ?:[\\/]*) ;;
# Define the identity of the package.
PACKAGE='emacs'
- VERSION='24.2.91'
+ VERSION='24.3.50'
cat >>confdefs.h <<_ACEOF
fi
+# Check whether --with-acl was given.
+if test "${with_acl+set}" = set; then :
+ withval=$with_acl;
+else
+ with_acl=$with_features
+fi
+
+
# Check whether --with-gnutls was given.
if test "${with_gnutls+set}" = set; then :
withval=$with_gnutls;
fi
+# Check whether --with-inotify was given.
+if test "${with_inotify+set}" = set; then :
+ withval=$with_inotify;
+else
+ with_inotify=$with_features
+fi
+
+
## For the times when you want to build Emacs but don't have
## a suitable makeinfo, and can live without the manuals.
fi
+# Check whether --enable-gtk-deprecation-warnings was given.
+if test "${enable_gtk_deprecation_warnings+set}" = set; then :
+ enableval=$enable_gtk_deprecation_warnings; ac_enable_gtk_deprecation_warnings="${enableval}"
+fi
+
+
#### Make srcdir absolute, if it isn't already. It's important to
-#### avoid running the path through pwd unnecessarily, since pwd can
+#### avoid running the file name through pwd unnecessarily, since pwd can
#### give you automounter prefixes, which can go away. We do all this
#### so Emacs can find its files when run uninstalled.
## Make sure CDPATH doesn't affect cd (in case PWD is relative).
. )
## We may be able to use the $PWD environment variable to make this
## absolute. But sometimes PWD is inaccurate.
- ## Note: we used to use ${PWD} at the end instead of `pwd`,
+ ## Note: we used to use $PWD at the end instead of `pwd`,
## but that tested only for a well-formed and valid PWD,
## it did not object when PWD was well-formed and valid but just wrong.
- if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".`pwd`" ;
+ if test ".$PWD" != "." && test ".`(cd "$PWD" ; sh -c pwd)`" = ".`pwd`" ;
then
srcdir="$PWD"
else
- srcdir="`(cd ${srcdir}; pwd)`"
+ srcdir=`(cd "$srcdir"; pwd)`
fi
;;
- * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
+ * ) srcdir=`(cd "$srcdir"; pwd)` ;;
esac
### Canonicalize the configuration name.
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
+# Avoid gnulib's tests for O_NOATIME and O_NOFOLLOW, as we don't use them.
+
# Avoid gnulib's threadlib module, as we do threads our own way.
# Code from module c-strcase:
# Code from module careadlinkat:
# Code from module clock-time:
+ # Code from module close-stream:
# Code from module crypto/md5:
# Code from module crypto/sha1:
# Code from module crypto/sha256:
# Code from module dtotimespec:
# Code from module dup2:
# Code from module environ:
+ # Code from module euidaccess:
# Code from module execinfo:
# Code from module extensions:
# Code from module extern-inline:
+ # Code from module faccessat:
+ # Code from module fcntl-h:
# Code from module filemode:
+ # Code from module fpending:
+ # Code from module getgroups:
# Code from module getloadavg:
# Code from module getopt-gnu:
# Code from module getopt-posix:
# Code from module gettext-h:
# Code from module gettime:
# Code from module gettimeofday:
+ # Code from module group-member:
# Code from module ignore-value:
# Code from module include_next:
# Code from module intprops:
# Code from module pathmax:
# Code from module pselect:
# Code from module pthread_sigmask:
+ # Code from module putenv:
# Code from module readlink:
+ # Code from module root-uid:
+ # Code from module sig2str:
# Code from module signal-h:
# Code from module snippet/_Noreturn:
# Code from module snippet/arg-nonnull:
# Code from module timespec-sub:
# Code from module u64:
# Code from module unistd:
+ # Code from module unsetenv:
# Code from module utimens:
# Code from module verify:
# Code from module warnings:
+ # Code from module xalloc-oversized:
# It's helpful to have C macros available to GDB, so prefer -g3 to -g
nw="$nw -Wfloat-equal" # warns about high-quality code
nw="$nw -Winline" # OK to ignore 'inline'
nw="$nw -Wjump-misses-init" # We sometimes safely jump over init.
+ nw="$nw -Wstrict-overflow" # OK to optimize assuming that
+ # signed overflow has undefined behavior
nw="$nw -Wsync-nand" # irrelevant here, and provokes ObjC warning
nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations
# <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
nw="$nw -Wshadow"
- # The following lines should be removable at some point.
+ # Emacs's use of alloca inhibits protecting the stack.
nw="$nw -Wstack-protector"
- nw="$nw -Wstrict-overflow"
+
+ # The following line should be removable at some point.
nw="$nw -Wsuggest-attribute=pure"
fi
-if test "$MAKEINFO" != "no" && \
- test x"`$MAKEINFO --version 2> /dev/null | $EGREP 'texinfo[^0-9]*([1-4][0-9]+|[5-9]|4\.[7-9]|4\.[1-6][0-9]+)'`" = x; then
- MAKEINFO=no
+if test "$MAKEINFO" != "no"; then
+ case `
+ $MAKEINFO --version 2> /dev/null |
+ $EGREP 'texinfo[^0-9]*([1-4][0-9]+|[5-9]|4\.[7-9]|4\.[1-6][0-9]+)'
+ ` in
+ '') MAKEINFO=no;;
+ esac
fi
## Makeinfo is unusual. For a released Emacs, the manuals are
MAKEINFO=makeinfo
if test "x${with_makeinfo}" = "xno"; then
HAVE_MAKEINFO=no
- elif test ! -e $srcdir/info/emacs && test ! -e $srcdir/info/emacs.info; then
+ elif test ! -e "$srcdir/info/emacs" && test ! -e "$srcdir/info/emacs.info"; then
as_fn_error "You do not seem to have makeinfo >= 4.7, and your
source tree does not seem to have pre-built manuals in the \`info' directory.
Either install a suitable version of makeinfo, or re-run configure
HAVE_ALSA=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ALSA_MODULES" >&5
$as_echo_n "checking for $ALSA_MODULES... " >&6; }
- if $PKG_CONFIG --exists "$ALSA_MODULES" 2>&5 &&
- ALSA_CFLAGS=`$PKG_CONFIG --cflags "$ALSA_MODULES" 2>&5` &&
- ALSA_LIBS=`$PKG_CONFIG --libs "$ALSA_MODULES" 2>&5`; then
+ if "$PKG_CONFIG" --exists "$ALSA_MODULES" 2>&5 &&
+ ALSA_CFLAGS=`"$PKG_CONFIG" --cflags "$ALSA_MODULES" 2>&5` &&
+ ALSA_LIBS=`"$PKG_CONFIG" --libs "$ALSA_MODULES" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- ALSA_PKG_ERRORS=`($PKG_CONFIG --print-errors "$ALSA_MODULES") 2>&1`
+ ALSA_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "$ALSA_MODULES") 2>&1`
fi
-
-
-
-
-
-
HAVE_W32=no
W32_OBJ=
W32_LIBS=
+W32_RES=
+W32_RES_LINK=
if test "${with_w32}" != no; then
if test "${opsys}" != "cygwin"; then
as_fn_error "Using w32 with an autotools build is only supported for Cygwin." "$LINENO" 5
$as_echo "#define HAVE_NTGUI 1" >>confdefs.h
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_WINDRES+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$WINDRES"; then
+ ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
+$as_echo "$WINDRES" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_WINDRES"; then
+ ac_ct_WINDRES=$WINDRES
+ # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_WINDRES"; then
+ ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_WINDRES="windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
+if test -n "$ac_ct_WINDRES"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
+$as_echo "$ac_ct_WINDRES" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_WINDRES" = x; then
+ WINDRES="as_fn_error "No resource compiler found." "$LINENO" 5"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ WINDRES=$ac_ct_WINDRES
+ fi
+else
+ WINDRES="$ac_cv_prog_WINDRES"
+fi
+
W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
+ W32_RES="emacs.res"
+ # Tell the linker that emacs.res is an object (which we compile from
+ # the rc file), not a linker script.
+ W32_RES_LINK="-Wl,-bpe-i386 -Wl,emacs.res"
fi
+
+
if test "${HAVE_W32}" = "yes"; then
window_system=w32
with_xft=no
:
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $RSVG_MODULE" >&5
$as_echo_n "checking for $RSVG_MODULE... " >&6; }
- if $PKG_CONFIG --exists "$RSVG_MODULE" 2>&5 &&
- RSVG_CFLAGS=`$PKG_CONFIG --cflags "$RSVG_MODULE" 2>&5` &&
- RSVG_LIBS=`$PKG_CONFIG --libs "$RSVG_MODULE" 2>&5`; then
+ if "$PKG_CONFIG" --exists "$RSVG_MODULE" 2>&5 &&
+ RSVG_CFLAGS=`"$PKG_CONFIG" --cflags "$RSVG_MODULE" 2>&5` &&
+ RSVG_LIBS=`"$PKG_CONFIG" --libs "$RSVG_MODULE" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- RSVG_PKG_ERRORS=`($PKG_CONFIG --print-errors "$RSVG_MODULE") 2>&1`
+ RSVG_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "$RSVG_MODULE") 2>&1`
fi
:
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $IMAGEMAGICK_MODULE" >&5
$as_echo_n "checking for $IMAGEMAGICK_MODULE... " >&6; }
- if $PKG_CONFIG --exists "$IMAGEMAGICK_MODULE" 2>&5 &&
- IMAGEMAGICK_CFLAGS=`$PKG_CONFIG --cflags "$IMAGEMAGICK_MODULE" 2>&5` &&
- IMAGEMAGICK_LIBS=`$PKG_CONFIG --libs "$IMAGEMAGICK_MODULE" 2>&5`; then
+ if "$PKG_CONFIG" --exists "$IMAGEMAGICK_MODULE" 2>&5 &&
+ IMAGEMAGICK_CFLAGS=`"$PKG_CONFIG" --cflags "$IMAGEMAGICK_MODULE" 2>&5` &&
+ IMAGEMAGICK_LIBS=`"$PKG_CONFIG" --libs "$IMAGEMAGICK_MODULE" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- IMAGEMAGICK_PKG_ERRORS=`($PKG_CONFIG --print-errors "$IMAGEMAGICK_MODULE") 2>&1`
+ IMAGEMAGICK_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "$IMAGEMAGICK_MODULE") 2>&1`
fi
pkg_check_gtk=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $GTK_MODULES" >&5
$as_echo_n "checking for $GTK_MODULES... " >&6; }
- if $PKG_CONFIG --exists "$GTK_MODULES" 2>&5 &&
- GTK_CFLAGS=`$PKG_CONFIG --cflags "$GTK_MODULES" 2>&5` &&
- GTK_LIBS=`$PKG_CONFIG --libs "$GTK_MODULES" 2>&5`; then
+ if "$PKG_CONFIG" --exists "$GTK_MODULES" 2>&5 &&
+ GTK_CFLAGS=`"$PKG_CONFIG" --cflags "$GTK_MODULES" 2>&5` &&
+ GTK_LIBS=`"$PKG_CONFIG" --libs "$GTK_MODULES" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- GTK_PKG_ERRORS=`($PKG_CONFIG --print-errors "$GTK_MODULES") 2>&1`
+ GTK_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "$GTK_MODULES") 2>&1`
fi
GTK_OBJ=emacsgtkfixed.o
term_header=gtkutil.h
USE_GTK_TOOLKIT="GTK3"
+ if test "x$ac_enable_gtk_deprecation_warnings" = x; then
+ GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS"
+ fi
else
check_gtk2=yes
gtk3_pkg_errors="$GTK_PKG_ERRORS "
pkg_check_gtk=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $GTK_MODULES" >&5
$as_echo_n "checking for $GTK_MODULES... " >&6; }
- if $PKG_CONFIG --exists "$GTK_MODULES" 2>&5 &&
- GTK_CFLAGS=`$PKG_CONFIG --cflags "$GTK_MODULES" 2>&5` &&
- GTK_LIBS=`$PKG_CONFIG --libs "$GTK_MODULES" 2>&5`; then
+ if "$PKG_CONFIG" --exists "$GTK_MODULES" 2>&5 &&
+ GTK_CFLAGS=`"$PKG_CONFIG" --cflags "$GTK_MODULES" 2>&5` &&
+ GTK_LIBS=`"$PKG_CONFIG" --libs "$GTK_MODULES" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- GTK_PKG_ERRORS=`($PKG_CONFIG --print-errors "$GTK_MODULES") 2>&1`
+ GTK_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "$GTK_MODULES") 2>&1`
fi
GTK_OBJ="gtkutil.o $GTK_OBJ"
USE_X_TOOLKIT=none
- if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
+ if "$PKG_CONFIG" --atleast-version=2.10 gtk+-2.0; then
:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your version of Gtk+ will have problems with
fi
+ HAVE_GTK_HANDLE_BOX=no
+ ac_fn_c_check_decl "$LINENO" "GTK_TYPE_HANDLE_BOX" "ac_cv_have_decl_GTK_TYPE_HANDLE_BOX" "$ac_includes_default
+#include <gtk/gtk.h>
+"
+if test "x$ac_cv_have_decl_GTK_TYPE_HANDLE_BOX" = x""yes; then :
+ HAVE_GTK_HANDLE_BOX=yes
+else
+ HAVE_GTK_HANDLE_BOX=no
+fi
+
+ if test "$HAVE_GTK_HANDLE_BOX" = yes; then
+ for ac_func in gtk_handle_box_new
+do :
+ ac_fn_c_check_func "$LINENO" "gtk_handle_box_new" "ac_cv_func_gtk_handle_box_new"
+if test "x$ac_cv_func_gtk_handle_box_new" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GTK_HANDLE_BOX_NEW 1
+_ACEOF
+
+fi
+done
+
+ fi
+
+ HAVE_GTK_TEAROFF_MENU_ITEM=no
+ ac_fn_c_check_decl "$LINENO" "GTK_TYPE_TEAROFF_MENU_ITEM" "ac_cv_have_decl_GTK_TYPE_TEAROFF_MENU_ITEM" "$ac_includes_default
+#include <gtk/gtk.h>
+"
+if test "x$ac_cv_have_decl_GTK_TYPE_TEAROFF_MENU_ITEM" = x""yes; then :
+ HAVE_GTK_TEAROFF_MENU_ITEM=yes
+else
+ HAVE_GTK_TEAROFF_MENU_ITEM=no
+fi
+
+ if test "$HAVE_GTK_TEAROFF_MENU_ITEM" = yes; then
+ for ac_func in gtk_tearoff_menu_item_new
+do :
+ ac_fn_c_check_func "$LINENO" "gtk_tearoff_menu_item_new" "ac_cv_func_gtk_tearoff_menu_item_new"
+if test "x$ac_cv_func_gtk_tearoff_menu_item_new" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GTK_TEAROFF_MENU_ITEM_NEW 1
+_ACEOF
+
+fi
+done
+
+ fi
for ac_func in gtk_widget_get_window gtk_widget_set_has_window \
gtk_dialog_get_action_area gtk_widget_get_sensitive \
HAVE_DBUS=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus-1 >= 1.0" >&5
$as_echo_n "checking for dbus-1 >= 1.0... " >&6; }
- if $PKG_CONFIG --exists "dbus-1 >= 1.0" 2>&5 &&
- DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.0" 2>&5` &&
- DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.0" 2>&5`; then
+ if "$PKG_CONFIG" --exists "dbus-1 >= 1.0" 2>&5 &&
+ DBUS_CFLAGS=`"$PKG_CONFIG" --cflags "dbus-1 >= 1.0" 2>&5` &&
+ DBUS_LIBS=`"$PKG_CONFIG" --libs "dbus-1 >= 1.0" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- DBUS_PKG_ERRORS=`($PKG_CONFIG --print-errors "dbus-1 >= 1.0") 2>&1`
+ DBUS_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "dbus-1 >= 1.0") 2>&1`
fi
HAVE_GSETTINGS=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-2.0 >= 2.26" >&5
$as_echo_n "checking for gio-2.0 >= 2.26... " >&6; }
- if $PKG_CONFIG --exists "gio-2.0 >= 2.26" 2>&5 &&
- GSETTINGS_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= 2.26" 2>&5` &&
- GSETTINGS_LIBS=`$PKG_CONFIG --libs "gio-2.0 >= 2.26" 2>&5`; then
+ if "$PKG_CONFIG" --exists "gio-2.0 >= 2.26" 2>&5 &&
+ GSETTINGS_CFLAGS=`"$PKG_CONFIG" --cflags "gio-2.0 >= 2.26" 2>&5` &&
+ GSETTINGS_LIBS=`"$PKG_CONFIG" --libs "gio-2.0 >= 2.26" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- GSETTINGS_PKG_ERRORS=`($PKG_CONFIG --print-errors "gio-2.0 >= 2.26") 2>&1`
+ GSETTINGS_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "gio-2.0 >= 2.26") 2>&1`
fi
HAVE_GCONF=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gconf-2.0 >= 2.13" >&5
$as_echo_n "checking for gconf-2.0 >= 2.13... " >&6; }
- if $PKG_CONFIG --exists "gconf-2.0 >= 2.13" 2>&5 &&
- GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 >= 2.13" 2>&5` &&
- GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 >= 2.13" 2>&5`; then
+ if "$PKG_CONFIG" --exists "gconf-2.0 >= 2.13" 2>&5 &&
+ GCONF_CFLAGS=`"$PKG_CONFIG" --cflags "gconf-2.0 >= 2.13" 2>&5` &&
+ GCONF_LIBS=`"$PKG_CONFIG" --libs "gconf-2.0 >= 2.13" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- GCONF_PKG_ERRORS=`($PKG_CONFIG --print-errors "gconf-2.0 >= 2.13") 2>&1`
+ GCONF_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "gconf-2.0 >= 2.13") 2>&1`
fi
HAVE_GOBJECT=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-2.0 >= 2.0" >&5
$as_echo_n "checking for gobject-2.0 >= 2.0... " >&6; }
- if $PKG_CONFIG --exists "gobject-2.0 >= 2.0" 2>&5 &&
- GOBJECT_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0 >= 2.0" 2>&5` &&
- GOBJECT_LIBS=`$PKG_CONFIG --libs "gobject-2.0 >= 2.0" 2>&5`; then
+ if "$PKG_CONFIG" --exists "gobject-2.0 >= 2.0" 2>&5 &&
+ GOBJECT_CFLAGS=`"$PKG_CONFIG" --cflags "gobject-2.0 >= 2.0" 2>&5` &&
+ GOBJECT_LIBS=`"$PKG_CONFIG" --libs "gobject-2.0 >= 2.0" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- GOBJECT_PKG_ERRORS=`($PKG_CONFIG --print-errors "gobject-2.0 >= 2.0") 2>&1`
+ GOBJECT_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "gobject-2.0 >= 2.0") 2>&1`
fi
HAVE_GNUTLS=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls >= 2.6.6" >&5
$as_echo_n "checking for gnutls >= 2.6.6... " >&6; }
- if $PKG_CONFIG --exists "gnutls >= 2.6.6" 2>&5 &&
- LIBGNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 2.6.6" 2>&5` &&
- LIBGNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 2.6.6" 2>&5`; then
+ if "$PKG_CONFIG" --exists "gnutls >= 2.6.6" 2>&5 &&
+ LIBGNUTLS_CFLAGS=`"$PKG_CONFIG" --cflags "gnutls >= 2.6.6" 2>&5` &&
+ LIBGNUTLS_LIBS=`"$PKG_CONFIG" --libs "gnutls >= 2.6.6" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- LIBGNUTLS_PKG_ERRORS=`($PKG_CONFIG --print-errors "gnutls >= 2.6.6") 2>&1`
+ LIBGNUTLS_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "gnutls >= 2.6.6") 2>&1`
fi
+if test "${with_inotify}" = "yes"; then
+ for ac_header in sys/inotify.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_inotify_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_INOTIFY_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test "$ac_cv_header_sys_inotify_h" = yes ; then
+ ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1"
+if test "x$ac_cv_func_inotify_init1" = x""yes; then :
+
+fi
+
+ fi
+fi
+if test "$ac_cv_func_inotify_init1" = yes; then
+
+$as_echo "#define HAVE_INOTIFY 1" >>confdefs.h
+
+fi
+
+HAVE_POSIX_ACL=no
+LIBACL_LIBS=
+if test "${with_acl}" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_set_file in -lacl" >&5
+$as_echo_n "checking for acl_set_file in -lacl... " >&6; }
+if test "${ac_cv_lib_acl_acl_set_file+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lacl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char acl_set_file ();
+int
+main ()
+{
+return acl_set_file ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_acl_acl_set_file=yes
+else
+ ac_cv_lib_acl_acl_set_file=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_set_file" >&5
+$as_echo "$ac_cv_lib_acl_acl_set_file" >&6; }
+if test "x$ac_cv_lib_acl_acl_set_file" = x""yes; then :
+ HAVE_POSIX_ACL=yes
+else
+ HAVE_POSIX_ACL=no
+fi
+
+ if test "$HAVE_POSIX_ACL" = yes; then
+
+$as_echo "#define HAVE_POSIX_ACL 1" >>confdefs.h
+
+ LIBACL_LIBS=-lacl
+ else
+ ac_fn_c_check_func "$LINENO" "acl_set_file" "ac_cv_func_acl_set_file"
+if test "x$ac_cv_func_acl_set_file" = x""yes; then :
+ HAVE_POSIX_ACL=yes
+else
+ HAVE_POSIX_ACL=no
+fi
+
+ if test "$HAVE_POSIX_ACL" = yes; then
+
+$as_echo "#define HAVE_POSIX_ACL 1" >>confdefs.h
+
+ fi
+ fi
+fi
+
+
HAVE_XAW3D=no
LUCID_LIBW=
if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
HAVE_FC=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig >= 2.2.0" >&5
$as_echo_n "checking for fontconfig >= 2.2.0... " >&6; }
- if $PKG_CONFIG --exists "fontconfig >= 2.2.0" 2>&5 &&
- FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags "fontconfig >= 2.2.0" 2>&5` &&
- FONTCONFIG_LIBS=`$PKG_CONFIG --libs "fontconfig >= 2.2.0" 2>&5`; then
+ if "$PKG_CONFIG" --exists "fontconfig >= 2.2.0" 2>&5 &&
+ FONTCONFIG_CFLAGS=`"$PKG_CONFIG" --cflags "fontconfig >= 2.2.0" 2>&5` &&
+ FONTCONFIG_LIBS=`"$PKG_CONFIG" --libs "fontconfig >= 2.2.0" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- FONTCONFIG_PKG_ERRORS=`($PKG_CONFIG --print-errors "fontconfig >= 2.2.0") 2>&1`
+ FONTCONFIG_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "fontconfig >= 2.2.0") 2>&1`
fi
HAVE_XFT=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xft >= 0.13.0" >&5
$as_echo_n "checking for xft >= 0.13.0... " >&6; }
- if $PKG_CONFIG --exists "xft >= 0.13.0" 2>&5 &&
- XFT_CFLAGS=`$PKG_CONFIG --cflags "xft >= 0.13.0" 2>&5` &&
- XFT_LIBS=`$PKG_CONFIG --libs "xft >= 0.13.0" 2>&5`; then
+ if "$PKG_CONFIG" --exists "xft >= 0.13.0" 2>&5 &&
+ XFT_CFLAGS=`"$PKG_CONFIG" --cflags "xft >= 0.13.0" 2>&5` &&
+ XFT_LIBS=`"$PKG_CONFIG" --libs "xft >= 0.13.0" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- XFT_PKG_ERRORS=`($PKG_CONFIG --print-errors "xft >= 0.13.0") 2>&1`
+ XFT_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "xft >= 0.13.0") 2>&1`
fi
HAVE_FREETYPE=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2" >&5
$as_echo_n "checking for freetype2... " >&6; }
- if $PKG_CONFIG --exists "freetype2" 2>&5 &&
- FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>&5` &&
- FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2" 2>&5`; then
+ if "$PKG_CONFIG" --exists "freetype2" 2>&5 &&
+ FREETYPE_CFLAGS=`"$PKG_CONFIG" --cflags "freetype2" 2>&5` &&
+ FREETYPE_LIBS=`"$PKG_CONFIG" --libs "freetype2" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- FREETYPE_PKG_ERRORS=`($PKG_CONFIG --print-errors "freetype2") 2>&1`
+ FREETYPE_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "freetype2") 2>&1`
fi
HAVE_LIBOTF=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotf" >&5
$as_echo_n "checking for libotf... " >&6; }
- if $PKG_CONFIG --exists "libotf" 2>&5 &&
- LIBOTF_CFLAGS=`$PKG_CONFIG --cflags "libotf" 2>&5` &&
- LIBOTF_LIBS=`$PKG_CONFIG --libs "libotf" 2>&5`; then
+ if "$PKG_CONFIG" --exists "libotf" 2>&5 &&
+ LIBOTF_CFLAGS=`"$PKG_CONFIG" --cflags "libotf" 2>&5` &&
+ LIBOTF_LIBS=`"$PKG_CONFIG" --libs "libotf" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- LIBOTF_PKG_ERRORS=`($PKG_CONFIG --print-errors "libotf") 2>&1`
+ LIBOTF_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "libotf") 2>&1`
fi
HAVE_M17N_FLT=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for m17n-flt" >&5
$as_echo_n "checking for m17n-flt... " >&6; }
- if $PKG_CONFIG --exists "m17n-flt" 2>&5 &&
- M17N_FLT_CFLAGS=`$PKG_CONFIG --cflags "m17n-flt" 2>&5` &&
- M17N_FLT_LIBS=`$PKG_CONFIG --libs "m17n-flt" 2>&5`; then
+ if "$PKG_CONFIG" --exists "m17n-flt" 2>&5 &&
+ M17N_FLT_CFLAGS=`"$PKG_CONFIG" --cflags "m17n-flt" 2>&5` &&
+ M17N_FLT_LIBS=`"$PKG_CONFIG" --libs "m17n-flt" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- M17N_FLT_PKG_ERRORS=`($PKG_CONFIG --print-errors "m17n-flt") 2>&1`
+ M17N_FLT_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "m17n-flt") 2>&1`
fi
HAVE_LIBXML2=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml-2.0 > 2.6.17" >&5
$as_echo_n "checking for libxml-2.0 > 2.6.17... " >&6; }
- if $PKG_CONFIG --exists "libxml-2.0 > 2.6.17" 2>&5 &&
- LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 > 2.6.17" 2>&5` &&
- LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0 > 2.6.17" 2>&5`; then
+ if "$PKG_CONFIG" --exists "libxml-2.0 > 2.6.17" 2>&5 &&
+ LIBXML2_CFLAGS=`"$PKG_CONFIG" --cflags "libxml-2.0 > 2.6.17" 2>&5` &&
+ LIBXML2_LIBS=`"$PKG_CONFIG" --libs "libxml-2.0 > 2.6.17" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
## 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.
- LIBXML2_PKG_ERRORS=`($PKG_CONFIG --print-errors "libxml-2.0 > 2.6.17") 2>&1`
+ LIBXML2_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "libxml-2.0 > 2.6.17") 2>&1`
fi
for ac_func in gethostname \
-closedir getrusage get_current_dir_name \
-lrand48 setsid \
-fpathconf select euidaccess getpagesize setlocale \
-utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
-__fpending strsignal setitimer \
+getrusage get_current_dir_name \
+lrand48 \
+select getpagesize setlocale \
+utimes getrlimit setrlimit shutdown getaddrinfo \
+strsignal setitimer \
sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
gai_strerror mkstemp getline getdelim fsync sync \
difftime posix_memalign \
done
-if test $opsys = unixware; then
-
-$as_echo "#define BROKEN_GETWD 1" >>confdefs.h
-
-else
- for ac_func in getwd
-do :
- ac_fn_c_check_func "$LINENO" "getwd" "ac_cv_func_getwd"
-if test "x$ac_cv_func_getwd" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETWD 1
-_ACEOF
-
-fi
-done
-
-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.
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpgrp requires zero arguments" >&5
-$as_echo_n "checking whether getpgrp requires zero arguments... " >&6; }
-if test "${ac_cv_func_getpgrp_void+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- # Use it with a single arg.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-getpgrp (0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_func_getpgrp_void=no
-else
- ac_cv_func_getpgrp_void=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getpgrp_void" >&5
-$as_echo "$ac_cv_func_getpgrp_void" >&6; }
-if test $ac_cv_func_getpgrp_void = yes; then
-
-$as_echo "#define GETPGRP_VOID 1" >>confdefs.h
-
-fi
-
-
# UNIX98 PTYs.
for ac_func in grantpt
do :
$as_echo "#define FIRST_PTY_LETTER 'q'" >>confdefs.h
- $as_echo "#define PTY_OPEN { struct sigaction ocstat, cstat; struct stat stb; char * name; sigemptyset(&cstat.sa_mask); cstat.sa_handler = SIG_DFL; cstat.sa_flags = 0; sigaction(SIGCLD, &cstat, &ocstat); name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); sigaction(SIGCLD, &ocstat, (struct sigaction *)0); if (name == 0) return -1; if (fd < 0) return -1; if (fstat (fd, &stb) < 0) return -1; strcpy (pty_name, name); }" >>confdefs.h
+ $as_echo "#define PTY_OPEN { struct sigaction ocstat, cstat; struct stat stb; char * name; sigemptyset(&cstat.sa_mask); cstat.sa_handler = SIG_DFL; cstat.sa_flags = 0; sigaction(SIGCHLD, &cstat, &ocstat); name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); sigaction(SIGCHLD, &ocstat, (struct sigaction *)0); if (name == 0) return -1; if (fd < 0) return -1; if (fstat (fd, &stb) < 0) return -1; strcpy (pty_name, name); }" >>confdefs.h
$as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h
;;
sol2* )
- $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h
+ $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h
;;
unixware )
- $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal(\"could not grant slave pty\"); if (unlockpt(fd) == -1) fatal(\"could not unlock slave pty\"); if (!(ptyname = ptsname(fd))) fatal (\"could not enable slave pty\"); snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h
+ $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal(\"could not grant slave pty\"); if (unlockpt(fd) == -1) fatal(\"could not unlock slave pty\"); if (!(ptyname = ptsname(fd))) fatal (\"could not enable slave pty\"); snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C library" >&5
-$as_echo_n "checking whether we are using the GNU C library... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <features.h>
-#ifndef __GNU_LIBRARY__
-# error "this is not the GNU C library"
-#endif
+case $opsys in
+ gnu)
+ $as_echo "#define DATA_START ({ extern int data_start; (char *) &data_start; })" >>confdefs.h
-int
-main ()
-{
+ ;;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- emacs_glibc=yes
-else
- emacs_glibc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_glibc" >&5
-$as_echo "$emacs_glibc" >&6; }
+ hpux*)
+ $as_echo "#define DATA_START 0x40000000" >>confdefs.h
-if test $emacs_glibc = yes; then
+ $as_echo "#define DATA_SEG_BITS 0x40000000" >>confdefs.h
- emacs_pending_output=unknown
+ ;;
+ irix6-5)
+ $as_echo "#define DATA_START 0x10000000" >>confdefs.h
- case $opsys in
- gnu | gnu-linux | gnu-kfreebsd )
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of pending output formalism" >&5
-$as_echo_n "checking for style of pending output formalism... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#if !defined (_IO_STDIO_H) && !defined (_STDIO_USES_IOSTREAM)
-# error "stdio definitions not found"
-#endif
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- emacs_pending_output=new
-fi
-rm -f conftest.err conftest.$ac_ext
-
- if test $emacs_pending_output = unknown; then
- case $opsys in
- gnu-linux | gnu-kfreebsd)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#ifndef __UCLIBC__
-# error "not using uclibc"
-#endif
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- emacs_pending_output=uclibc
-else
- emacs_pending_output=old
-fi
-rm -f conftest.err conftest.$ac_ext
- ;;
- esac
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_pending_output" >&5
-$as_echo "$emacs_pending_output" >&6; }
-
- case $emacs_pending_output in
- new)
- $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)" >>confdefs.h
-
- ;;
- uclibc)
- $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufpos - (FILE)->__bufstart)" >>confdefs.h
-
- ;;
- old)
- $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_pptr - (FILE)->_pbase)" >>confdefs.h
-
- ;;
- esac
- ;;
- esac
- if test $emacs_pending_output = unknown; then
- $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufp - (FILE)->__buffer)" >>confdefs.h
-
- fi
-
-else
- case $opsys in
- cygwin | darwin | freebsd | netbsd | openbsd )
- $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)" >>confdefs.h
-
- ;;
-
- unixware)
- $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__ptr - (FILE)->__base)" >>confdefs.h
-
- ;;
-
- *)
- if test x$ac_cv_header_stdio_ext_h = xyes && \
- test x$ac_cv_func___fpending = xyes; then
- $as_echo "#define PENDING_OUTPUT_COUNT(FILE) __fpending (FILE)" >>confdefs.h
-
-
-$as_echo "#define DISPNEW_NEEDS_STDIO_EXT 1" >>confdefs.h
-
- else
- $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)" >>confdefs.h
-
- fi
- ;;
- esac
-fi
-
-
-
-
-case $opsys in
- gnu)
- $as_echo "#define DATA_START ({ extern int data_start; (char *) &data_start; })" >>confdefs.h
-
- ;;
-
- hpux*)
- $as_echo "#define DATA_START 0x40000000" >>confdefs.h
-
- $as_echo "#define DATA_SEG_BITS 0x40000000" >>confdefs.h
-
- ;;
- irix6-5)
- $as_echo "#define DATA_START 0x10000000" >>confdefs.h
-
- $as_echo "#define DATA_SEG_BITS 0x10000000" >>confdefs.h
-
- ;;
-esac
+ $as_echo "#define DATA_SEG_BITS 0x10000000" >>confdefs.h
+ ;;
+esac
;;
gnu-linux | gnu-kfreebsd )
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#ifndef __i386__
-# error "not i386"
-#endif
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- $as_echo "#define ULIMIT_BREAK_VALUE (32*1024*1024)" >>confdefs.h
-
-fi
-rm -f conftest.err conftest.$ac_ext
-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$as_echo "#define RUN_TIME_REMAP 1" >>confdefs.h
;;
-
- irix6-5)
- $as_echo "#define ULIMIT_BREAK_VALUE 0x14000000" >>confdefs.h
-
- ;;
esac
-
case $opsys in
aix4-2)
$as_echo "#define USG /**/" >>confdefs.h
;;
darwin)
- $as_echo "#define BSD4_2 /**/" >>confdefs.h
-
- $as_echo "#define BSD_SYSTEM /**/" >>confdefs.h
+ $as_echo "#define BSD_SYSTEM /**/" >>confdefs.h
$as_echo "#define DARWIN_OS /**/" >>confdefs.h
;;
freebsd)
- $as_echo "#define BSD4_2 /**/" >>confdefs.h
-
$as_echo "#define BSD_SYSTEM_AHB 1" >>confdefs.h
;;
gnu | netbsd | openbsd )
- $as_echo "#define BSD4_2 /**/" >>confdefs.h
-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$as_echo "#define PREFER_VSUSP 1" >>confdefs.h
-
-$as_echo "#define SETPGRP_RELEASES_CTTY 1" >>confdefs.h
-
;;
sol2-10)
#define EMACS_CONFIGURATION "${canonical}"
_ACEOF
+emacs_config_options=`echo "$emacs_config_options" | sed -e "s/\"/'/g"`
cat >>confdefs.h <<_ACEOF
-#define EMACS_CONFIG_OPTIONS "${ac_configure_args}"
+#define EMACS_CONFIG_OPTIONS "${emacs_config_options}"
_ACEOF
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtold conforms to C99" >&5
$as_echo_n "checking whether strtold conforms to C99... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5
-$as_echo_n "checking for st_dm_mode in struct stat... " >&6; }
-if test "${ac_cv_struct_st_dm_mode+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat s; s.st_dm_mode;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_struct_st_dm_mode=yes
-else
- ac_cv_struct_st_dm_mode=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_dm_mode" >&5
-$as_echo "$ac_cv_struct_st_dm_mode" >&6; }
-
- if test $ac_cv_struct_st_dm_mode = yes; then
-
-$as_echo "#define HAVE_ST_DM_MODE 1" >>confdefs.h
-
- fi
-
-
-ac_fn_c_check_decl "$LINENO" "strmode" "ac_cv_have_decl_strmode" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strmode" = x""yes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRMODE $ac_have_decl
-_ACEOF
+ GNULIB_FCNTL=0;
+ GNULIB_NONBLOCKING=0;
+ GNULIB_OPEN=0;
+ GNULIB_OPENAT=0;
+ HAVE_FCNTL=1;
+ HAVE_OPENAT=1;
+ REPLACE_FCNTL=0;
+ REPLACE_OPEN=0;
+ REPLACE_OPENAT=0;
- GNULIB__EXIT=0;
- GNULIB_ATOLL=0;
- GNULIB_CALLOC_POSIX=0;
- GNULIB_CANONICALIZE_FILE_NAME=0;
- GNULIB_GETLOADAVG=0;
- GNULIB_GETSUBOPT=0;
- GNULIB_GRANTPT=0;
- GNULIB_MALLOC_POSIX=0;
- GNULIB_MBTOWC=0;
- GNULIB_MKDTEMP=0;
- GNULIB_MKOSTEMP=0;
- GNULIB_MKOSTEMPS=0;
- GNULIB_MKSTEMP=0;
- GNULIB_MKSTEMPS=0;
- GNULIB_POSIX_OPENPT=0;
- GNULIB_PTSNAME=0;
- GNULIB_PTSNAME_R=0;
- GNULIB_PUTENV=0;
- GNULIB_RANDOM=0;
- GNULIB_RANDOM_R=0;
- GNULIB_REALLOC_POSIX=0;
- GNULIB_REALPATH=0;
- GNULIB_RPMATCH=0;
- GNULIB_SETENV=0;
- GNULIB_STRTOD=0;
- GNULIB_STRTOLL=0;
- GNULIB_STRTOULL=0;
- GNULIB_SYSTEM_POSIX=0;
- GNULIB_UNLOCKPT=0;
- GNULIB_UNSETENV=0;
- GNULIB_WCTOMB=0;
- HAVE__EXIT=1;
- HAVE_ATOLL=1;
- HAVE_CANONICALIZE_FILE_NAME=1;
- HAVE_DECL_GETLOADAVG=1;
- HAVE_GETSUBOPT=1;
- HAVE_GRANTPT=1;
- HAVE_MKDTEMP=1;
- HAVE_MKOSTEMP=1;
- HAVE_MKOSTEMPS=1;
- HAVE_MKSTEMP=1;
- HAVE_MKSTEMPS=1;
- HAVE_POSIX_OPENPT=1;
- HAVE_PTSNAME=1;
- HAVE_PTSNAME_R=1;
- HAVE_RANDOM=1;
- HAVE_RANDOM_H=1;
- HAVE_RANDOM_R=1;
- HAVE_REALPATH=1;
- HAVE_RPMATCH=1;
- HAVE_SETENV=1;
- HAVE_DECL_SETENV=1;
- HAVE_STRTOD=1;
- HAVE_STRTOLL=1;
- HAVE_STRTOULL=1;
- HAVE_STRUCT_RANDOM_DATA=1;
- HAVE_SYS_LOADAVG_H=0;
- HAVE_UNLOCKPT=1;
- HAVE_DECL_UNSETENV=1;
- REPLACE_CALLOC=0;
- REPLACE_CANONICALIZE_FILE_NAME=0;
- REPLACE_MALLOC=0;
- REPLACE_MBTOWC=0;
- REPLACE_MKSTEMP=0;
- REPLACE_PTSNAME=0;
- REPLACE_PTSNAME_R=0;
- REPLACE_PUTENV=0;
- REPLACE_RANDOM_R=0;
- REPLACE_REALLOC=0;
- REPLACE_REALPATH=0;
- REPLACE_SETENV=0;
- REPLACE_STRTOD=0;
- REPLACE_UNSETENV=0;
- REPLACE_WCTOMB=0;
fi
+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
+if test "x$ac_cv_type_mode_t" = x""yes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5
+$as_echo_n "checking for st_dm_mode in struct stat... " >&6; }
+if test "${ac_cv_struct_st_dm_mode+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat s; s.st_dm_mode;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_struct_st_dm_mode=yes
+else
+ ac_cv_struct_st_dm_mode=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_dm_mode" >&5
+$as_echo "$ac_cv_struct_st_dm_mode" >&6; }
+
+ if test $ac_cv_struct_st_dm_mode = yes; then
+
+$as_echo "#define HAVE_ST_DM_MODE 1" >>confdefs.h
+
+ fi
+
+
+ac_fn_c_check_decl "$LINENO" "strmode" "ac_cv_have_decl_strmode" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strmode" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRMODE $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+ GNULIB__EXIT=0;
+ GNULIB_ATOLL=0;
+ GNULIB_CALLOC_POSIX=0;
+ GNULIB_CANONICALIZE_FILE_NAME=0;
+ GNULIB_GETLOADAVG=0;
+ GNULIB_GETSUBOPT=0;
+ GNULIB_GRANTPT=0;
+ GNULIB_MALLOC_POSIX=0;
+ GNULIB_MBTOWC=0;
+ GNULIB_MKDTEMP=0;
+ GNULIB_MKOSTEMP=0;
+ GNULIB_MKOSTEMPS=0;
+ GNULIB_MKSTEMP=0;
+ GNULIB_MKSTEMPS=0;
+ GNULIB_POSIX_OPENPT=0;
+ GNULIB_PTSNAME=0;
+ GNULIB_PTSNAME_R=0;
+ GNULIB_PUTENV=0;
+ GNULIB_RANDOM=0;
+ GNULIB_RANDOM_R=0;
+ GNULIB_REALLOC_POSIX=0;
+ GNULIB_REALPATH=0;
+ GNULIB_RPMATCH=0;
+ GNULIB_SETENV=0;
+ GNULIB_STRTOD=0;
+ GNULIB_STRTOLL=0;
+ GNULIB_STRTOULL=0;
+ GNULIB_SYSTEM_POSIX=0;
+ GNULIB_UNLOCKPT=0;
+ GNULIB_UNSETENV=0;
+ GNULIB_WCTOMB=0;
+ HAVE__EXIT=1;
+ HAVE_ATOLL=1;
+ HAVE_CANONICALIZE_FILE_NAME=1;
+ HAVE_DECL_GETLOADAVG=1;
+ HAVE_GETSUBOPT=1;
+ HAVE_GRANTPT=1;
+ HAVE_MKDTEMP=1;
+ HAVE_MKOSTEMP=1;
+ HAVE_MKOSTEMPS=1;
+ HAVE_MKSTEMP=1;
+ HAVE_MKSTEMPS=1;
+ HAVE_POSIX_OPENPT=1;
+ HAVE_PTSNAME=1;
+ HAVE_PTSNAME_R=1;
+ HAVE_RANDOM=1;
+ HAVE_RANDOM_H=1;
+ HAVE_RANDOM_R=1;
+ HAVE_REALPATH=1;
+ HAVE_RPMATCH=1;
+ HAVE_SETENV=1;
+ HAVE_DECL_SETENV=1;
+ HAVE_STRTOD=1;
+ HAVE_STRTOLL=1;
+ HAVE_STRTOULL=1;
+ HAVE_STRUCT_RANDOM_DATA=1;
+ HAVE_SYS_LOADAVG_H=0;
+ HAVE_UNLOCKPT=1;
+ HAVE_DECL_UNSETENV=1;
+ REPLACE_CALLOC=0;
+ REPLACE_CANONICALIZE_FILE_NAME=0;
+ REPLACE_MALLOC=0;
+ REPLACE_MBTOWC=0;
+ REPLACE_MKSTEMP=0;
+ REPLACE_PTSNAME=0;
+ REPLACE_PTSNAME_R=0;
+ REPLACE_PUTENV=0;
+ REPLACE_RANDOM_R=0;
+ REPLACE_REALLOC=0;
+ REPLACE_REALPATH=0;
+ REPLACE_SETENV=0;
+ REPLACE_STRTOD=0;
+ REPLACE_UNSETENV=0;
+ REPLACE_WCTOMB=0;
+
+
+
-
-
-ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
-if test "x$ac_cv_type_mode_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define mode_t int
-_ACEOF
-
-fi
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
+ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_unsetenv" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_UNSETENV $ac_have_decl
+_ACEOF
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the utimes function works" >&5
$as_echo_n "checking whether the utimes function works... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5
+$as_echo_n "checking type of array argument to getgroups... " >&6; }
+if test "${ac_cv_type_getgroups+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_type_getgroups=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Thanks to Mike Rendell for this test. */
+$ac_includes_default
+#define NGID 256
+#undef MAX
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+
+int
+main ()
+{
+ gid_t gidset[NGID];
+ int i, n;
+ union { gid_t gval; long int lval; } val;
+
+ val.lval = -1;
+ for (i = 0; i < NGID; i++)
+ gidset[i] = val.gval;
+ n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
+ gidset);
+ /* Exit non-zero if getgroups seems to require an array of ints. This
+ happens when gid_t is short int but getgroups modifies an array
+ of ints. */
+ return n > 0 && gidset[n] != val.gval;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_type_getgroups=gid_t
+else
+ ac_cv_type_getgroups=int
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+if test $ac_cv_type_getgroups = cross; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then :
+ ac_cv_type_getgroups=gid_t
+else
+ ac_cv_type_getgroups=int
+fi
+rm -f conftest*
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5
+$as_echo "$ac_cv_type_getgroups" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define GETGROUPS_T $ac_cv_type_getgroups
+_ACEOF
+
+
+
if false; then
GL_COND_LIBTOOL_TRUE=
LIBS=$gl_saved_libs
+ :
+
- :
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_CLOSE_STREAM 1
+_ACEOF
+ :
+
/* Many gnulib modules require POSIX conformance of EBADF. */
if (dup2 (2, 1000000) == -1 && errno != EBADF)
result |= 16;
+ /* Flush out a cygwin core dump. */
+ if (dup2 (2, -1) != -1 || errno != EBADF)
+ result |= 32;
return result;
;
-# Persuade glibc <stdlib.h> to declare getloadavg().
+ if test $ac_cv_func_faccessat = no; then
+ HAVE_FACCESSAT=0
+ fi
+ if test $HAVE_FACCESSAT = 0; then
-gl_save_LIBS=$LIBS
-# getloadvg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
-# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
-HAVE_GETLOADAVG=1
-ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg"
-if test "x$ac_cv_func_getloadavg" = x""yes; then :
-else
- gl_func_getloadavg_done=no
- # Some systems with -lutil have (and need) -lkvm as well, some do not.
- # On Solaris, -lkvm requires nlist from -lelf, so check that first
- # to get the right answer into the cache.
- # For kstat on solaris, we need to test for libelf and libkvm to force the
- # definition of SVR4 below.
- if test $gl_func_getloadavg_done = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_begin in -lelf" >&5
-$as_echo_n "checking for elf_begin in -lelf... " >&6; }
-if test "${ac_cv_lib_elf_elf_begin+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lelf $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char elf_begin ();
-int
-main ()
-{
-return elf_begin ();
- ;
- return 0;
-}
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS faccessat.$ac_objext"
+
+
+ for ac_func in access
+do :
+ ac_fn_c_check_func "$LINENO" "access" "ac_cv_func_access"
+if test "x$ac_cv_func_access" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ACCESS 1
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_elf_elf_begin=yes
-else
- ac_cv_lib_elf_elf_begin=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+fi
+done
+
+
+ fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FACCESSAT 1
+_ACEOF
+
+
+
+
+
+
+
+ GNULIB_FACCESSAT=1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_fcntl_h='<'fcntl.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
+$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
+if test "${gl_cv_next_fcntl_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+ gl_header_literal_regex=`echo 'fcntl.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+ gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
+$as_echo "$gl_cv_next_fcntl_h" >&6; }
+ fi
+ NEXT_FCNTL_H=$gl_cv_next_fcntl_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'fcntl.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_fcntl_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ fp_headers='
+# include <stdio.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
+'
+ ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers
+"
+if test "x$ac_cv_have_decl___fpending" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL___FPENDING $ac_have_decl
+_ACEOF
+
+
+ if test $ac_cv_func___fpending = no; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext"
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5
+$as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; }
+if test "${ac_cv_sys_pending_output_n_bytes+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for ac_expr in \
+ \
+ '# glibc2' \
+ 'fp->_IO_write_ptr - fp->_IO_write_base' \
+ \
+ '# traditional Unix' \
+ 'fp->_ptr - fp->_base' \
+ \
+ '# BSD' \
+ 'fp->_p - fp->_bf._base' \
+ \
+ '# SCO, Unixware' \
+ '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \
+ \
+ '# QNX' \
+ '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \
+ \
+ '# old glibc?' \
+ 'fp->__bufp - fp->__buffer' \
+ \
+ '# old glibc iostream?' \
+ 'fp->_pptr - fp->_pbase' \
+ \
+ '# emx+gcc' \
+ 'fp->_ptr - fp->_buffer' \
+ \
+ '# Minix' \
+ 'fp->_ptr - fp->_buf' \
+ \
+ '# Plan9' \
+ 'fp->wp - fp->buf' \
+ \
+ '# VMS' \
+ '(*fp)->_ptr - (*fp)->_base' \
+ \
+ '# e.g., DGUX R4.11; the info is not available' \
+ 1 \
+ ; do
+
+ # Skip each embedded comment.
+ case "$ac_expr" in '#'*) continue;; esac
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *fp = stdin; (void) ($ac_expr);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ fp_done=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$fp_done" = yes && break
+ done
+
+ ac_cv_sys_pending_output_n_bytes=$ac_expr
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_pending_output_n_bytes" >&5
+$as_echo "$ac_cv_sys_pending_output_n_bytes" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define PENDING_OUTPUT_N_BYTES $ac_cv_sys_pending_output_n_bytes
+_ACEOF
+
+
+ fi
+
+
+# Persuade glibc <stdlib.h> to declare getloadavg().
+
+
+gl_save_LIBS=$LIBS
+
+# getloadvg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
+# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
+HAVE_GETLOADAVG=1
+ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg"
+if test "x$ac_cv_func_getloadavg" = x""yes; then :
+
+else
+ gl_func_getloadavg_done=no
+
+ # Some systems with -lutil have (and need) -lkvm as well, some do not.
+ # On Solaris, -lkvm requires nlist from -lelf, so check that first
+ # to get the right answer into the cache.
+ # For kstat on solaris, we need to test for libelf and libkvm to force the
+ # definition of SVR4 below.
+ if test $gl_func_getloadavg_done = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_begin in -lelf" >&5
+$as_echo_n "checking for elf_begin in -lelf... " >&6; }
+if test "${ac_cv_lib_elf_elf_begin+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lelf $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char elf_begin ();
+int
+main ()
+{
+return elf_begin ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_elf_elf_begin=yes
+else
+ ac_cv_lib_elf_elf_begin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf_begin" >&5
$as_echo "$ac_cv_lib_elf_elf_begin" >&6; }
gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
-
-
- :
-
+ :
fi
-
- if test $ac_cv_func_readlink = no; then
- HAVE_READLINK=0
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
-$as_echo_n "checking whether readlink signature is correct... " >&6; }
-if test "${gl_cv_decl_readlink_works+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5
+$as_echo_n "checking for putenv compatible with GNU and SVID... " >&6; }
+if test "${gl_cv_func_svid_putenv+set}" = set; then :
$as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_svid_putenv="guessing no" ;;
+ esac
+
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <unistd.h>
- /* Cause compilation failure if original declaration has wrong type. */
- ssize_t readlink (const char *, char *, size_t);
+$ac_includes_default
int
main ()
{
+ /* Put it in env. */
+ if (putenv ("CONFTEST_putenv=val"))
+ return 1;
+
+ /* Try to remove it. */
+ if (putenv ("CONFTEST_putenv"))
+ return 2;
+
+ /* Make sure it was deleted. */
+ if (getenv ("CONFTEST_putenv") != 0)
+ return 3;
+
+ return 0;
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_decl_readlink_works=yes
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_svid_putenv=yes
else
- gl_cv_decl_readlink_works=no
+ gl_cv_func_svid_putenv=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
-$as_echo "$gl_cv_decl_readlink_works" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
-$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
-if test "${gl_cv_func_readlink_works+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- # We have readlink, so assume ln -s works.
- ln -s conftest.no-such conftest.link
- ln -s conftest.link conftest.lnk2
- if test "$cross_compiling" = yes; then :
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_readlink_works="guessing no" ;;
- esac
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <unistd.h>
-int
-main ()
-{
-char buf[20];
- return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5
+$as_echo "$gl_cv_func_svid_putenv" >&6; }
+ case "$gl_cv_func_svid_putenv" in
+ *yes) ;;
+ *)
+ REPLACE_PUTENV=1
+ ;;
+ esac
+
+ if test $REPLACE_PUTENV = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS putenv.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_PUTENV=1
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_readlink = no; then
+ HAVE_READLINK=0
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
+$as_echo_n "checking whether readlink signature is correct... " >&6; }
+if test "${gl_cv_decl_readlink_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+ /* Cause compilation failure if original declaration has wrong type. */
+ ssize_t readlink (const char *, char *, size_t);
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_decl_readlink_works=yes
+else
+ gl_cv_decl_readlink_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
+$as_echo "$gl_cv_decl_readlink_works" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
+$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
+if test "${gl_cv_func_readlink_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ # We have readlink, so assume ln -s works.
+ ln -s conftest.no-such conftest.link
+ ln -s conftest.link conftest.lnk2
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_readlink_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+
+int
+main ()
+{
+char buf[20];
+ return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
;
return 0;
}
+ for ac_func in sig2str
+do :
+ ac_fn_c_check_func "$LINENO" "sig2str" "ac_cv_func_sig2str"
+if test "x$ac_cv_func_sig2str" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SIG2STR 1
+_ACEOF
+
+fi
+done
+
+
+ if test $ac_cv_func_sig2str = no; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS sig2str.$ac_objext"
+
+
+ :
+
+ fi
+
-
if test $gl_cv_have_include_next = yes; then
gl_cv_next_stdio_h='<'stdio.h'>'
else
-
-
if test $gl_cv_have_include_next = yes; then
-
if test $gl_cv_have_include_next = yes; then
gl_cv_next_unistd_h='<'unistd.h'>'
else
+ if test $ac_cv_have_decl_unsetenv = no; then
+ HAVE_DECL_UNSETENV=0
+ fi
+ for ac_func in unsetenv
+do :
+ ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
+if test "x$ac_cv_func_unsetenv" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UNSETENV 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
+ else
+ HAVE_UNSETENV=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
+$as_echo_n "checking for unsetenv() return type... " >&6; }
+if test "${gt_cv_func_unsetenv_ret+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#undef _BSD
+#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
+#include <stdlib.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int unsetenv (const char *name);
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_func_unsetenv_ret='int'
+else
+ gt_cv_func_unsetenv_ret='void'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
+$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
+ if test $gt_cv_func_unsetenv_ret = 'void'; then
+
+$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
+
+ REPLACE_UNSETENV=1
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
+$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
+if test "${gl_cv_func_unsetenv_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_unsetenv_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdlib.h>
+ #include <errno.h>
+ extern char **environ;
+
+int
+main ()
+{
+
+ char entry1[] = "a=1";
+ char entry2[] = "b=2";
+ char *env[] = { entry1, entry2, NULL };
+ if (putenv ((char *) "a=1")) return 1;
+ if (putenv (entry2)) return 2;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 3;
+ if (!unsetenv ("") || errno != EINVAL) return 4;
+ entry2[0] = 'b';
+ environ = env;
+ if (!getenv ("a")) return 5;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 6;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_unsetenv_works=yes
+else
+ gl_cv_func_unsetenv_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
+$as_echo "$gl_cv_func_unsetenv_works" >&6; }
+ case "$gl_cv_func_unsetenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_UNSETENV=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
+
+
+
+
+
+ fi
+
+
+
+
+
+ GNULIB_UNSETENV=1
+
+
+
+
+
+
+
+
fi
gl_gnulib_enabled_dosname=false
+ gl_gnulib_enabled_euidaccess=false
+ gl_gnulib_enabled_getgroups=false
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
+ gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false
gl_gnulib_enabled_pathmax=false
+ gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
gl_gnulib_enabled_stat=false
gl_gnulib_enabled_strtoll=false
gl_gnulib_enabled_strtoull=false
gl_gnulib_enabled_verify=false
+ gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
func_gl_gnulib_m4code_dosname ()
{
if ! $gl_gnulib_enabled_dosname; then
gl_gnulib_enabled_dosname=true
fi
}
- func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 ()
+ func_gl_gnulib_m4code_euidaccess ()
{
- if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then
+ if ! $gl_gnulib_enabled_euidaccess; then
- gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
- fi
- }
- func_gl_gnulib_m4code_pathmax ()
- {
- if ! $gl_gnulib_enabled_pathmax; then
- gl_gnulib_enabled_pathmax=true
- fi
- }
- func_gl_gnulib_m4code_stat ()
- {
- if ! $gl_gnulib_enabled_stat; then
+ for ac_func in euidaccess
+do :
+ ac_fn_c_check_func "$LINENO" "euidaccess" "ac_cv_func_euidaccess"
+if test "x$ac_cv_func_euidaccess" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_EUIDACCESS 1
+_ACEOF
+fi
+done
+ if test $ac_cv_func_euidaccess = no; then
+ HAVE_EUIDACCESS=0
+ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5
-$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; }
-if test "${gl_cv_func_stat_dir_slash+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- case $host_os in
- mingw*) gl_cv_func_stat_dir_slash="guessing no";;
- *) gl_cv_func_stat_dir_slash="guessing yes";;
- esac
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/stat.h>
+ if test $HAVE_EUIDACCESS = 0; then
-int
-main ()
-{
-struct stat st; return stat (".", &st) != stat ("./", &st);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_stat_dir_slash=yes
-else
- gl_cv_func_stat_dir_slash=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS euidaccess.$ac_objext"
+
+
+
+ for ac_header in libgen.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default"
+if test "x$ac_cv_header_libgen_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGEN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ ac_fn_c_check_func "$LINENO" "getgroups" "ac_cv_func_getgroups"
+if test "x$ac_cv_func_getgroups" = x""yes; then :
+
+fi
+
+
+ # If we don't yet have getgroups, see if it's in -lbsd.
+ # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
+ ac_save_LIBS=$LIBS
+ if test $ac_cv_func_getgroups = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgroups in -lbsd" >&5
+$as_echo_n "checking for getgroups in -lbsd... " >&6; }
+if test "${ac_cv_lib_bsd_getgroups+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getgroups ();
+int
+main ()
+{
+return getgroups ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bsd_getgroups=yes
+else
+ ac_cv_lib_bsd_getgroups=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_getgroups" >&5
+$as_echo "$ac_cv_lib_bsd_getgroups" >&6; }
+if test "x$ac_cv_lib_bsd_getgroups" = x""yes; then :
+ GETGROUPS_LIB=-lbsd
+fi
+
+ fi
+
+ # Run the program to test the functionality of the system-supplied
+ # getgroups function only if there is such a function.
+ if test $ac_cv_func_getgroups = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getgroups" >&5
+$as_echo_n "checking for working getgroups... " >&6; }
+if test "${ac_cv_func_getgroups_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in # ((
+ # Guess yes on glibc systems.
+ *-gnu*) ac_cv_func_getgroups_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) ac_cv_func_getgroups_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+/* On Ultrix 4.3, getgroups (0, 0) always fails. */
+ return getgroups (0, 0) == -1;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_getgroups_works=yes
+else
+ ac_cv_func_getgroups_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getgroups_works" >&5
+$as_echo "$ac_cv_func_getgroups_works" >&6; }
+ else
+ ac_cv_func_getgroups_works=no
+ fi
+ case "$ac_cv_func_getgroups_works" in
+ *yes)
+
+$as_echo "#define HAVE_GETGROUPS 1" >>confdefs.h
+
+ ;;
+ esac
+ LIBS=$ac_save_LIBS
+
+
+ # Solaris 9 and 10 need -lgen to get the eaccess function.
+ # Save and restore LIBS so -lgen isn't added to it. Otherwise, *all*
+ # programs in the package would end up linked with that potentially-shared
+ # library, inducing unnecessary run-time overhead.
+ LIB_EACCESS=
+
+ gl_saved_libs=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing eaccess" >&5
+$as_echo_n "checking for library containing eaccess... " >&6; }
+if test "${ac_cv_search_eaccess+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char eaccess ();
+int
+main ()
+{
+return eaccess ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' gen; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_eaccess=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test "${ac_cv_search_eaccess+set}" = set; then :
+ break
+fi
+done
+if test "${ac_cv_search_eaccess+set}" = set; then :
+
+else
+ ac_cv_search_eaccess=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_eaccess" >&5
+$as_echo "$ac_cv_search_eaccess" >&6; }
+ac_res=$ac_cv_search_eaccess
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ test "$ac_cv_search_eaccess" = "none required" ||
+ LIB_EACCESS=$ac_cv_search_eaccess
+fi
+
+ for ac_func in eaccess
+do :
+ ac_fn_c_check_func "$LINENO" "eaccess" "ac_cv_func_eaccess"
+if test "x$ac_cv_func_eaccess" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_EACCESS 1
+_ACEOF
+
+fi
+done
+
+ LIBS=$gl_saved_libs
+
+ fi
+
+
+
+
+
+ GNULIB_EUIDACCESS=1
+
+
+
+
+
+ gl_gnulib_enabled_euidaccess=true
+ if test $HAVE_EUIDACCESS = 0; then
+ func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1
+ fi
+ func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c
+ if test $HAVE_EUIDACCESS = 0; then
+ func_gl_gnulib_m4code_stat
+ fi
+ fi
+ }
+ func_gl_gnulib_m4code_getgroups ()
+ {
+ if ! $gl_gnulib_enabled_getgroups; then
+
+
+
+
+
+ ac_fn_c_check_func "$LINENO" "getgroups" "ac_cv_func_getgroups"
+if test "x$ac_cv_func_getgroups" = x""yes; then :
+
+fi
+
+
+ # If we don't yet have getgroups, see if it's in -lbsd.
+ # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
+ ac_save_LIBS=$LIBS
+ if test $ac_cv_func_getgroups = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgroups in -lbsd" >&5
+$as_echo_n "checking for getgroups in -lbsd... " >&6; }
+if test "${ac_cv_lib_bsd_getgroups+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getgroups ();
+int
+main ()
+{
+return getgroups ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bsd_getgroups=yes
+else
+ ac_cv_lib_bsd_getgroups=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_getgroups" >&5
+$as_echo "$ac_cv_lib_bsd_getgroups" >&6; }
+if test "x$ac_cv_lib_bsd_getgroups" = x""yes; then :
+ GETGROUPS_LIB=-lbsd
+fi
+
+ fi
+
+ # Run the program to test the functionality of the system-supplied
+ # getgroups function only if there is such a function.
+ if test $ac_cv_func_getgroups = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getgroups" >&5
+$as_echo_n "checking for working getgroups... " >&6; }
+if test "${ac_cv_func_getgroups_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in # ((
+ # Guess yes on glibc systems.
+ *-gnu*) ac_cv_func_getgroups_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) ac_cv_func_getgroups_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+/* On Ultrix 4.3, getgroups (0, 0) always fails. */
+ return getgroups (0, 0) == -1;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_getgroups_works=yes
+else
+ ac_cv_func_getgroups_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getgroups_works" >&5
+$as_echo "$ac_cv_func_getgroups_works" >&6; }
+ else
+ ac_cv_func_getgroups_works=no
+ fi
+ case "$ac_cv_func_getgroups_works" in
+ *yes)
+
+$as_echo "#define HAVE_GETGROUPS 1" >>confdefs.h
+
+ ;;
+ esac
+ LIBS=$ac_save_LIBS
+
+ if test $ac_cv_func_getgroups != yes; then
+ HAVE_GETGROUPS=0
+ else
+ if test "$ac_cv_type_getgroups" != gid_t \
+ || { case "$ac_cv_func_getgroups_works" in
+ *yes) false;;
+ *) true;;
+ esac
+ }; then
+ REPLACE_GETGROUPS=1
+
+$as_echo "#define GETGROUPS_ZERO_BUG 1" >>confdefs.h
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getgroups handles negative values" >&5
+$as_echo_n "checking whether getgroups handles negative values... " >&6; }
+if test "${gl_cv_func_getgroups_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_getgroups_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_getgroups_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+int size = getgroups (0, 0);
+ gid_t *list = malloc (size * sizeof *list);
+ return getgroups (-1, list) != -1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getgroups_works=yes
+else
+ gl_cv_func_getgroups_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getgroups_works" >&5
+$as_echo "$gl_cv_func_getgroups_works" >&6; }
+ case "$gl_cv_func_getgroups_works" in
+ *yes) ;;
+ *) REPLACE_GETGROUPS=1 ;;
+ esac
+ fi
+ fi
+ test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
+
+ if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS getgroups.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_GETGROUPS=1
+
+
+
+
+
+ gl_gnulib_enabled_getgroups=true
+ fi
+ }
+ func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 ()
+ {
+ if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then
+
+
+ gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
+ fi
+ }
+ func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1 ()
+ {
+ if ! $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then
+
+
+
+
+
+ ac_fn_c_check_func "$LINENO" "group_member" "ac_cv_func_group_member"
+if test "x$ac_cv_func_group_member" = x""yes; then :
+
+else
+
+ HAVE_GROUP_MEMBER=0
+
+fi
+
+
+ if test $HAVE_GROUP_MEMBER = 0; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS group-member.$ac_objext"
+
+
+
+
+ fi
+
+
+
+
+
+ GNULIB_GROUP_MEMBER=1
+
+
+
+
+
+ gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=true
+ if test $HAVE_GROUP_MEMBER = 0; then
+ func_gl_gnulib_m4code_getgroups
+ fi
+ if test $HAVE_GROUP_MEMBER = 0; then
+ func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec
+ fi
+ fi
+ }
+ func_gl_gnulib_m4code_pathmax ()
+ {
+ if ! $gl_gnulib_enabled_pathmax; then
+
+
+
+ gl_gnulib_enabled_pathmax=true
+ fi
+ }
+ func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c ()
+ {
+ if ! $gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c; then
+ gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true
+ fi
+ }
+ func_gl_gnulib_m4code_stat ()
+ {
+ if ! $gl_gnulib_enabled_stat; then
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5
+$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; }
+if test "${gl_cv_func_stat_dir_slash+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case $host_os in
+ mingw*) gl_cv_func_stat_dir_slash="guessing no";;
+ *) gl_cv_func_stat_dir_slash="guessing yes";;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+
+int
+main ()
+{
+struct stat st; return stat (".", &st) != stat ("./", &st);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_stat_dir_slash=yes
+else
+ gl_cv_func_stat_dir_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5
gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
-
-
- :
-
+ :
fi
gl_gnulib_enabled_verify=true
fi
}
+ func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec ()
+ {
+ if ! $gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec; then
+ gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=true
+ fi
+ }
+ if test $HAVE_FACCESSAT = 0; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $HAVE_FACCESSAT = 0; then
+ func_gl_gnulib_m4code_euidaccess
+ fi
if test $REPLACE_GETOPT = 1; then
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
fi
gl_GNULIB_ENABLED_dosname_FALSE=
fi
+ if $gl_gnulib_enabled_euidaccess; then
+ gl_GNULIB_ENABLED_euidaccess_TRUE=
+ gl_GNULIB_ENABLED_euidaccess_FALSE='#'
+else
+ gl_GNULIB_ENABLED_euidaccess_TRUE='#'
+ gl_GNULIB_ENABLED_euidaccess_FALSE=
+fi
+
+ if $gl_gnulib_enabled_getgroups; then
+ gl_GNULIB_ENABLED_getgroups_TRUE=
+ gl_GNULIB_ENABLED_getgroups_FALSE='#'
+else
+ gl_GNULIB_ENABLED_getgroups_TRUE='#'
+ gl_GNULIB_ENABLED_getgroups_FALSE=
+fi
+
if $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then
gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE=
gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE='#'
gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE=
fi
+ if $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then
+ gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_TRUE=
+ gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_FALSE='#'
+else
+ gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_TRUE='#'
+ gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_FALSE=
+fi
+
if $gl_gnulib_enabled_pathmax; then
gl_GNULIB_ENABLED_pathmax_TRUE=
gl_GNULIB_ENABLED_pathmax_FALSE='#'
gl_GNULIB_ENABLED_pathmax_FALSE=
fi
+ if $gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c; then
+ gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_TRUE=
+ gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_FALSE='#'
+else
+ gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_TRUE='#'
+ gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_FALSE=
+fi
+
if $gl_gnulib_enabled_stat; then
gl_GNULIB_ENABLED_stat_TRUE=
gl_GNULIB_ENABLED_stat_FALSE='#'
gl_GNULIB_ENABLED_verify_FALSE=
fi
+ if $gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec; then
+ gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_TRUE=
+ gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_FALSE='#'
+else
+ gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_TRUE='#'
+ gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_FALSE=
+fi
+
# End of code from modules
$as_echo "#define HAVE_WINDOW_SYSTEM 1" >>confdefs.h
-
-$as_echo "#define HAVE_MOUSE 1" >>confdefs.h
-
WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o"
fi
opt_makefile=test/automated/Makefile
-if test -f $srcdir/${opt_makefile}.in; then
+if test -f "$srcdir/$opt_makefile.in"; then
SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
ac_config_files="$ac_config_files test/automated/Makefile"
opt_makefile=admin/unidata/Makefile
-if test -f $srcdir/${opt_makefile}.in; then
+if test -f "$srcdir/$opt_makefile.in"; then
SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
ac_config_files="$ac_config_files admin/unidata/Makefile"
as_fn_error "conditional \"gl_GNULIB_ENABLED_dosname\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${gl_GNULIB_ENABLED_euidaccess_TRUE}" && test -z "${gl_GNULIB_ENABLED_euidaccess_FALSE}"; then
+ as_fn_error "conditional \"gl_GNULIB_ENABLED_euidaccess\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${gl_GNULIB_ENABLED_getgroups_TRUE}" && test -z "${gl_GNULIB_ENABLED_getgroups_FALSE}"; then
+ as_fn_error "conditional \"gl_GNULIB_ENABLED_getgroups\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE}" && test -z "${gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE}"; then
as_fn_error "conditional \"gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_TRUE}" && test -z "${gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_FALSE}"; then
+ as_fn_error "conditional \"gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${gl_GNULIB_ENABLED_pathmax_TRUE}" && test -z "${gl_GNULIB_ENABLED_pathmax_FALSE}"; then
as_fn_error "conditional \"gl_GNULIB_ENABLED_pathmax\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_TRUE}" && test -z "${gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_FALSE}"; then
+ as_fn_error "conditional \"gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${gl_GNULIB_ENABLED_stat_TRUE}" && test -z "${gl_GNULIB_ENABLED_stat_FALSE}"; then
as_fn_error "conditional \"gl_GNULIB_ENABLED_stat\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
if test -z "${gl_GNULIB_ENABLED_verify_TRUE}" && test -z "${gl_GNULIB_ENABLED_verify_FALSE}"; then
as_fn_error "conditional \"gl_GNULIB_ENABLED_verify\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_TRUE}" && test -z "${gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_FALSE}"; then
+ as_fn_error "conditional \"gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
gl_libobjs=
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by emacs $as_me 24.2.91, which was
+This file was extended by emacs $as_me 24.3.50, which was
generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-emacs config.status 24.2.91
+emacs config.status 24.3.50
configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"
${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force
;;
"gdbinit":C)
-if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
+if test ! -f src/.gdbinit && test -f "$srcdir/src/.gdbinit"; then
echo creating src/.gdbinit
- echo source $srcdir/src/.gdbinit > src/.gdbinit
+ echo "source $srcdir/src/.gdbinit" > src/.gdbinit
fi
;;
/* A C macro for emitting warnings if a function is used.
- Copyright (C) 2010-2012 Free Software Foundation, Inc.
+ Copyright (C) 2010-2013 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
rather than issue the nice warning, but the end result of informing
the developer about their portability problem is still achieved):
#if HAVE_RAW_DECL_ENVIRON
- static inline char ***rpl_environ (void) { return &environ; }
+ static char ***rpl_environ (void) { return &environ; }
_GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
# undef environ
# define environ (*rpl_environ ())
dnl along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.65)
-AC_INIT(emacs, 24.2.91)
+AC_INIT(emacs, 24.3.50)
+dnl This is the documented way to record the args passed to configure,
+dnl rather than $ac_configure_args.
+emacs_config_options="$@"
AC_CONFIG_HEADER(src/config.h:src/config.in)
AC_CONFIG_SRCDIR(src/lisp.h)
AC_CONFIG_AUX_DIR(build-aux)
dnl FIXME currently it is not the last.
dnl This should be the last --with option, because --with-x is
-dnl added later on when we find the path of X, and it's best to
+dnl added later on when we find the file name of X, and it's best to
dnl keep them together visually.
AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT],
[use an X toolkit (KIT one of: yes or gtk, gtk2, gtk3, lucid or athena, motif, no)])],
OPTION_DEFAULT_ON([gconf],[don't compile with GConf support])
OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support])
OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support])
+OPTION_DEFAULT_ON([acl],[don't compile with ACL support])
OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support])
+OPTION_DEFAULT_ON([inotify],[don't compile with inotify (file-watch) support])
## For the times when you want to build Emacs but don't have
## a suitable makeinfo, and can live without the manuals.
AC_SUBST(GZIP_INFO)
AC_ARG_WITH([pkg-config-prog],dnl
-[AS_HELP_STRING([--with-pkg-config-prog=PATH],
- [path to pkg-config for finding GTK and librsvg])])
+[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}"
test "X$gameuser" = X && gameuser=games
AC_ARG_WITH([gnustep-conf],dnl
-[AS_HELP_STRING([--with-gnustep-conf=PATH],[path to GNUstep.conf; default $GNUSTEP_CONFIG_FILE, or /etc/GNUstep/GNUstep.conf])])
+[AS_HELP_STRING([--with-gnustep-conf=FILENAME],
+ [name of GNUstep.conf; default $GNUSTEP_CONFIG_FILE, or /etc/GNUstep/GNUstep.conf])])
test "X${with_gnustep_conf}" != X && test "${with_gnustep_conf}" != yes && \
GNUSTEP_CONFIG_FILE="${with_gnustep_conf}"
test "X$GNUSTEP_CONFIG_FILE" = "X" && \
found])],
[ac_enable_autodepend="${enableval}"],[ac_enable_autodepend=yes])
+AC_ARG_ENABLE(gtk-deprecation-warnings,
+[AS_HELP_STRING([--enable-gtk-deprecation-warnings],
+ [Show Gtk+/Gdk deprecation warnings for Gtk+ >= 3.0])],
+[ac_enable_gtk_deprecation_warnings="${enableval}"],[])
+
#### Make srcdir absolute, if it isn't already. It's important to
-#### avoid running the path through pwd unnecessarily, since pwd can
+#### avoid running the file name through pwd unnecessarily, since pwd can
#### give you automounter prefixes, which can go away. We do all this
#### so Emacs can find its files when run uninstalled.
## Make sure CDPATH doesn't affect cd (in case PWD is relative).
. )
## We may be able to use the $PWD environment variable to make this
## absolute. But sometimes PWD is inaccurate.
- ## Note: we used to use ${PWD} at the end instead of `pwd`,
+ ## Note: we used to use $PWD at the end instead of `pwd`,
## but that tested only for a well-formed and valid PWD,
## it did not object when PWD was well-formed and valid but just wrong.
- if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".`pwd`" ;
+ if test ".$PWD" != "." && test ".`(cd "$PWD" ; sh -c pwd)`" = ".`pwd`" ;
then
srcdir="$PWD"
else
- srcdir="`(cd ${srcdir}; pwd)`"
+ srcdir=`(cd "$srcdir"; pwd)`
fi
;;
- * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
+ * ) srcdir=`(cd "$srcdir"; pwd)` ;;
esac
### Canonicalize the configuration name.
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
+# Avoid gnulib's tests for O_NOATIME and 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])
nw="$nw -Wfloat-equal" # warns about high-quality code
nw="$nw -Winline" # OK to ignore 'inline'
nw="$nw -Wjump-misses-init" # We sometimes safely jump over init.
+ nw="$nw -Wstrict-overflow" # OK to optimize assuming that
+ # signed overflow has undefined behavior
nw="$nw -Wsync-nand" # irrelevant here, and provokes ObjC warning
nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations
# <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
nw="$nw -Wshadow"
- # The following lines should be removable at some point.
+ # Emacs's use of alloca inhibits protecting the stack.
nw="$nw -Wstack-protector"
- nw="$nw -Wstrict-overflow"
+
+ # The following line should be removable at some point.
nw="$nw -Wsuggest-attribute=pure"
gl_MANYWARN_ALL_GCC([ws])
AC_PATH_PROG(MAKEINFO, makeinfo, no)
dnl By this stage, configure has already checked for egrep and set EGREP,
dnl or exited with an error if no egrep was found.
-if test "$MAKEINFO" != "no" && \
- test x"`$MAKEINFO --version 2> /dev/null | $EGREP 'texinfo[[^0-9]]*([[1-4]][[0-9]]+|[[5-9]]|4\.[[7-9]]|4\.[[1-6]][[0-9]]+)'`" = x; then
- MAKEINFO=no
+if test "$MAKEINFO" != "no"; then
+ case `
+ $MAKEINFO --version 2> /dev/null |
+ $EGREP 'texinfo[[^0-9]]*([[1-4]][[0-9]]+|[[5-9]]|4\.[[7-9]]|4\.[[1-6]][[0-9]]+)'
+ ` in
+ '') MAKEINFO=no;;
+ esac
fi
## Makeinfo is unusual. For a released Emacs, the manuals are
MAKEINFO=makeinfo
if test "x${with_makeinfo}" = "xno"; then
HAVE_MAKEINFO=no
- elif test ! -e $srcdir/info/emacs && test ! -e $srcdir/info/emacs.info; then
+ elif test ! -e "$srcdir/info/emacs" && test ! -e "$srcdir/info/emacs.info"; then
AC_MSG_ERROR( [You do not seem to have makeinfo >= 4.7, and your
source tree does not seem to have pre-built manuals in the `info' directory.
Either install a suitable version of makeinfo, or re-run configure
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 path to 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])
+ *** 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
+ 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
+ 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
edit_cflags="
s,///*,/,g
s/^/ /
## 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`
+ $1_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "$2") 2>&1`
ifelse([$4], ,echo "$$1_PKG_ERRORS",)
fi
dnl checks for header files
AC_CHECK_HEADERS_ONCE(
linux/version.h sys/systeminfo.h
- stdio_ext.h fcntl.h coff.h pty.h
+ coff.h pty.h
sys/vlimit.h sys/resource.h
- sys/utsname.h pwd.h utmp.h dirent.h util.h)
+ sys/utsname.h pwd.h utmp.h util.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/personality.h>]], [[personality (PER_LINUX32)]])],
HAVE_W32=no
W32_OBJ=
W32_LIBS=
+W32_RES=
+W32_RES_LINK=
if test "${with_w32}" != no; then
if test "${opsys}" != "cygwin"; then
AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.])
[AC_MSG_ERROR([`--with-w32' was specified, but windows.h
cannot be found.])])
AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
+ AC_CHECK_TOOL(WINDRES, [windres],
+ [AC_MSG_ERROR([No resource compiler found.])])
W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
+ W32_RES="emacs.res"
+ # Tell the linker that emacs.res is an object (which we compile from
+ # the rc file), not a linker script.
+ W32_RES_LINK="-Wl,-bpe-i386 -Wl,emacs.res"
fi
AC_SUBST(W32_OBJ)
AC_SUBST(W32_LIBS)
+AC_SUBST(W32_RES)
+AC_SUBST(W32_RES_LINK)
if test "${HAVE_W32}" = "yes"; then
window_system=w32
GTK_OBJ=emacsgtkfixed.o
term_header=gtkutil.h
USE_GTK_TOOLKIT="GTK3"
+ if test "x$ac_enable_gtk_deprecation_warnings" = x; then
+ GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS"
+ fi
else
check_gtk2=yes
gtk3_pkg_errors="$GTK_PKG_ERRORS "
AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
GTK_OBJ="gtkutil.o $GTK_OBJ"
USE_X_TOOLKIT=none
- if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
+ if "$PKG_CONFIG" --atleast-version=2.10 gtk+-2.0; then
:
else
AC_MSG_WARN([[Your version of Gtk+ will have problems with
AC_CHECK_FUNCS(gtk_file_selection_new)
fi
+ dnl Same as above for gtk_handle_box.
+ HAVE_GTK_HANDLE_BOX=no
+ AC_CHECK_DECL(GTK_TYPE_HANDLE_BOX, HAVE_GTK_HANDLE_BOX=yes,
+ HAVE_GTK_HANDLE_BOX=no, [AC_INCLUDES_DEFAULT
+#include <gtk/gtk.h>])
+ if test "$HAVE_GTK_HANDLE_BOX" = yes; then
+ AC_CHECK_FUNCS(gtk_handle_box_new)
+ fi
+
+ dnl Same as above for gtk_tearoff_menu_item.
+ HAVE_GTK_TEAROFF_MENU_ITEM=no
+ AC_CHECK_DECL(GTK_TYPE_TEAROFF_MENU_ITEM, HAVE_GTK_TEAROFF_MENU_ITEM=yes,
+ HAVE_GTK_TEAROFF_MENU_ITEM=no, [AC_INCLUDES_DEFAULT
+#include <gtk/gtk.h>])
+ if test "$HAVE_GTK_TEAROFF_MENU_ITEM" = yes; then
+ AC_CHECK_FUNCS(gtk_tearoff_menu_item_new)
+ fi
dnl Check for functions introduced in 2.14 and later.
AC_CHECK_FUNCS(gtk_widget_get_window gtk_widget_set_has_window \
AC_SUBST(LIBGNUTLS_LIBS)
AC_SUBST(LIBGNUTLS_CFLAGS)
+dnl inotify is only available on GNU/Linux.
+if test "${with_inotify}" = "yes"; then
+ AC_CHECK_HEADERS(sys/inotify.h)
+ if test "$ac_cv_header_sys_inotify_h" = yes ; then
+ AC_CHECK_FUNC(inotify_init1)
+ fi
+fi
+if test "$ac_cv_func_inotify_init1" = yes; then
+ AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.])
+fi
+
+dnl POSIX ACL support: provided by libacl on GNU/Linux, by libc on FreeBSD.
+HAVE_POSIX_ACL=no
+LIBACL_LIBS=
+if test "${with_acl}" = "yes"; then
+ AC_CHECK_LIB([acl], [acl_set_file], HAVE_POSIX_ACL=yes, HAVE_POSIX_ACL=no)
+ if test "$HAVE_POSIX_ACL" = yes; then
+ AC_DEFINE(HAVE_POSIX_ACL, 1, [Define to 1 if using POSIX ACL support.])
+ LIBACL_LIBS=-lacl
+ else
+ AC_CHECK_FUNC(acl_set_file, HAVE_POSIX_ACL=yes, HAVE_POSIX_ACL=no)
+ if test "$HAVE_POSIX_ACL" = yes; then
+ AC_DEFINE(HAVE_POSIX_ACL, 1, [Define to 1 if using POSIX ACL support.])
+ fi
+ fi
+fi
+AC_SUBST(LIBACL_LIBS)
+
dnl Do not put whitespace before the #include statements below.
dnl Older compilers (eg sunos4 cc) choke on it.
HAVE_XAW3D=no
AC_CHECK_FUNCS(gethostname \
-closedir getrusage get_current_dir_name \
-lrand48 setsid \
-fpathconf select euidaccess getpagesize setlocale \
-utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
-__fpending strsignal setitimer \
+getrusage get_current_dir_name \
+lrand48 \
+select getpagesize setlocale \
+utimes getrlimit setrlimit shutdown getaddrinfo \
+strsignal setitimer \
sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
gai_strerror mkstemp getline getdelim fsync sync \
difftime posix_memalign \
touchlock \
cfmakeraw cfsetspeed copysign __executable_start)
-dnl getwd appears to be buggy on SVR4.2, so we don't use it.
-if test $opsys = unixware; then
- dnl In case some other test ends up checking for getwd.
- AC_DEFINE(BROKEN_GETWD, 1, [Define if getwd should not be used.])
-else
- AC_CHECK_FUNCS(getwd)
-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.
AC_FUNC_FSEEKO
-AC_FUNC_GETPGRP
-
# UNIX98 PTYs.
AC_CHECK_FUNCS(grantpt)
AC_DEFINE(PTY_ITERATION, [])
dnl Not used, because PTY_ITERATION is defined.
AC_DEFINE(FIRST_PTY_LETTER, ['q'])
- AC_DEFINE(PTY_OPEN, [ { struct sigaction ocstat, cstat; struct stat stb; char * name; sigemptyset(&cstat.sa_mask); cstat.sa_handler = SIG_DFL; cstat.sa_flags = 0; sigaction(SIGCLD, &cstat, &ocstat); name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); sigaction(SIGCLD, &ocstat, (struct sigaction *)0); if (name == 0) return -1; if (fd < 0) return -1; if (fstat (fd, &stb) < 0) return -1; strcpy (pty_name, name); }])
+ AC_DEFINE(PTY_OPEN, [ { struct sigaction ocstat, cstat; struct stat stb; char * name; sigemptyset(&cstat.sa_mask); cstat.sa_handler = SIG_DFL; cstat.sa_flags = 0; sigaction(SIGCHLD, &cstat, &ocstat); name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); sigaction(SIGCHLD, &ocstat, (struct sigaction *)0); if (name == 0) return -1; if (fd < 0) return -1; if (fstat (fd, &stb) < 0) return -1; strcpy (pty_name, name); }])
dnl No need to get the pty name at all.
AC_DEFINE(PTY_NAME_SPRINTF, [])
dnl No need to use sprintf to get the tty name--we get that from _getpty.
dnl On SysVr4, grantpt(3) forks a subprocess, so keep sigchld_handler()
dnl from intercepting that death. If any child but grantpt's should die
dnl within, it should be caught after sigrelse(2).
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); }])
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); }])
;;
unixware )
dnl Comments are as per sol2*.
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, sizeof pty_name, "%s", ptyname); }])
+ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, sizeof pty_name, "%s", ptyname); }])
;;
esac
esac
-dnl Used in dispnew.c
-AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the
- buffer of a stdio stream.])
-
-AC_MSG_CHECKING([whether we are using the GNU C library])
-AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
-#include <features.h>
-#ifndef __GNU_LIBRARY__
-# error "this is not the GNU C library"
-#endif
- ]], [[]])], emacs_glibc=yes, emacs_glibc=no)
-AC_MSG_RESULT([$emacs_glibc])
-
-if test $emacs_glibc = yes; then
-
- emacs_pending_output=unknown
-
- case $opsys in
- gnu | gnu-linux | gnu-kfreebsd )
- AC_MSG_CHECKING([for style of pending output formalism])
- dnl In autoconf 2.67 and later, we could use a single test
- dnl since the preprocessed output is accessible in "conftest.i".
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#if !defined (_IO_STDIO_H) && !defined (_STDIO_USES_IOSTREAM)
-# error "stdio definitions not found"
-#endif
- ]], [[]])], emacs_pending_output=new, [])
-
- if test $emacs_pending_output = unknown; then
- case $opsys in
- gnu-linux | gnu-kfreebsd)
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#ifndef __UCLIBC__
-# error "not using uclibc"
-#endif
- ]], [[]])], emacs_pending_output=uclibc, emacs_pending_output=old)
- ;;
- esac
- fi
-
- AC_MSG_RESULT([$emacs_pending_output])
-
- case $emacs_pending_output in
- new)
- dnl New C libio names.
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
- [((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)])
- ;;
- uclibc)
- dnl Using the uClibc library.
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
- [((FILE)->__bufpos - (FILE)->__bufstart)])
- ;;
- old)
- dnl Old C++ iostream names.
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
- [((FILE)->_pptr - (FILE)->_pbase)])
- ;;
- esac
- ;;
- esac dnl opsys
-
- if test $emacs_pending_output = unknown; then
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__bufp - (FILE)->__buffer)])
- fi
-
-else dnl !emacs_glibc
-
- case $opsys in
- cygwin | darwin | freebsd | netbsd | openbsd )
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)])
- ;;
-
- unixware)
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)])
- ;;
-
- *)
- dnl HAVE_STDIO_EXT_H && HAVE___FPENDING
- if test x$ac_cv_header_stdio_ext_h = xyes && \
- test x$ac_cv_func___fpending = xyes; then
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [__fpending (FILE)])
- AC_DEFINE(DISPNEW_NEEDS_STDIO_EXT, 1,
- [Define if dispnew.c should include stdio_ext.h.])
- else
- AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_ptr - (FILE)->_base)])
- fi
- ;;
- esac
-fi dnl emacs_glibc
-
-
dnl Used in vm-limit.c
AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
dnl Used in lisp.h, emacs.c, mem-limits.h
esac
-AH_TEMPLATE(ULIMIT_BREAK_VALUE, [Undocumented.])
AH_TEMPLATE(TAB3, [Undocumented.])
case $opsys in
;;
gnu-linux | gnu-kfreebsd )
- dnl libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared
- dnl library, we cannot get the maximum address for brk.
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
-#ifndef __i386__
-# error "not i386"
-#endif
- ]], [[]])], AC_DEFINE(ULIMIT_BREAK_VALUE, [(32*1024*1024)]), [])
-
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#ifndef __ia64__
# error "not ia64"
AC_DEFINE(RUN_TIME_REMAP, 1, [Define if emacs.c needs to call
run_time_remap; for HPUX.])
;;
-
- irix6-5)
- dnl Ulimit(UL_GMEMLIM) is busted...
- AC_DEFINE(ULIMIT_BREAK_VALUE, [0x14000000])
- ;;
esac
dnl Define symbols to identify the version of Unix this is.
dnl Define all the symbols that apply correctly.
-AH_TEMPLATE(BSD4_2, [Define if the system is compatible with BSD 4.2.])
AH_TEMPLATE(BSD_SYSTEM, [Define if the system is compatible with BSD 4.2.])
AH_TEMPLATE(DOS_NT, [Define if the system is MS DOS or MS Windows.])
AH_TEMPLATE(MSDOS, [Define if the system is MS DOS.])
darwin)
dnl BSD4_3 and BSD4_4 are already defined in sys/param.h.
- AC_DEFINE(BSD4_2, [])
AC_DEFINE(BSD_SYSTEM, [])
dnl More specific than the above two. We cannot use __APPLE__ as this
dnl may not be defined on non-OSX Darwin, and we cannot define DARWIN
;;
freebsd)
- AC_DEFINE(BSD4_2, [])
dnl Hack to avoid calling AC_PREPROC_IFELSE multiple times.
dnl Would not be needed with autoconf >= 2.67, where the
dnl preprocessed output is accessible in "conftest.i".
;;
gnu | netbsd | openbsd )
- AC_DEFINE(BSD4_2, [])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#ifndef BSD_SYSTEM
# error "BSD_SYSTEM not defined"
irix6-5)
AC_DEFINE(PREFER_VSUSP, 1, [Define if process_send_signal should
use VSUSP instead of VSWTCH.])
- AC_DEFINE(SETPGRP_RELEASES_CTTY, 1, [Define if process.c:child_setup
- should not call setpgrp.])
;;
sol2-10)
AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
[Define to the canonical Emacs configuration name.])
-AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
+dnl Replace any embedded " characters (bug#13274).
+emacs_config_options=`echo "$emacs_config_options" | sed -e "s/\"/'/g"`
+AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}",
[Define to the options passed to configure.])
AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure
define this to include extra configuration information.])
## 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(HAVE_MOUSE, 1, [Define if you have mouse support.])
WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o"
fi
dnl test/ is not present in release tarfiles.
opt_makefile=test/automated/Makefile
-if test -f $srcdir/${opt_makefile}.in; then
+if test -f "$srcdir/$opt_makefile.in"; then
SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
dnl Again, it's best not to use a variable. Though you can add
dnl ", [], [opt_makefile='$opt_makefile']" and it should work.
dnl admin/ may or may not be present.
opt_makefile=admin/unidata/Makefile
-if test -f $srcdir/${opt_makefile}.in; then
+if test -f "$srcdir/$opt_makefile.in"; then
SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
AC_CONFIG_FILES([admin/unidata/Makefile])
fi
], [GCC="$GCC" CPPFLAGS="$CPPFLAGS"])
AC_CONFIG_COMMANDS([gdbinit], [
-if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
+if test ! -f src/.gdbinit && test -f "$srcdir/src/.gdbinit"; then
echo creating src/.gdbinit
- echo source $srcdir/src/.gdbinit > src/.gdbinit
+ echo "source $srcdir/src/.gdbinit" > src/.gdbinit
fi
])
+2013-01-07 Bastien Guerry <bzg@gnu.org>
+
+ * help.texi (Apropos): Document `apropos-user-option' and update
+ the doc for `apropos-variable'.
+
2013-01-05 Glenn Morris <rgm@gnu.org>
* text.texi (HTML Mode): Remove deleted nxml C-RET binding.
* frames.texi (Mouse Commands): Fix description of the effect of
mouse dragging (Bug#13049).
-2012-12-08 Dani Moncayo <dmoncayo@gmail.com>
+2012-12-15 Juri Linkov <juri@jurta.org>
+
+ * misc.texi (Recursive Edit): Add a link to "Query Replace".
+ (Bug#13181)
+
+2012-12-10 Dani Moncayo <dmoncayo@gmail.com>
* killing.texi (Deletion): Doc fix (Bug#12748).
-2012-12-03 Juanma Barranquero <lekktu@gmail.com>
+2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doclicense.texi, gpl.texi: Update to latest version from FSF.
+ These are just minor editorial changes.
+
+2012-12-06 Juanma Barranquero <lekktu@gmail.com>
* vc1-xtra.texi (General VC Options): Remove obsolete reference
to `vc-path'.
-2012-12-02 Chong Yidong <cyd@gnu.org>
+2012-12-03 Chong Yidong <cyd@gnu.org>
* custom.texi (Init Rebinding): kbd is now a function (Bug#13052).
-2012-11-18 Dani Moncayo <dmoncayo@gmail.com>
+2012-12-02 Kevin Ryde <user42@zip.com.au>
+
+ * maintaining.texi (Tag Syntax): Mention (defvar foo) handling.
+
+2012-12-01 Kevin Ryde <user42@zip.com.au>
+
+ * maintaining.texi (Tag Syntax): Mention Perl's "use constant".
+
+2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doclicense.texi, gpl.texi: Update to latest version from FSF.
+ These are just minor editorial changes.
+
+2012-11-21 Dani Moncayo <dmoncayo@gmail.com>
* display.texi (Auto Scrolling): Fix some inaccuracies, plus
clarifications (Bug#12865).
(Horizontal Scrolling): Clarifications.
-2012-11-17 Dani Moncayo <dmoncayo@gmail.com>
+2012-11-18 Dani Moncayo <dmoncayo@gmail.com>
* mark.texi (Disabled Transient Mark): Doc fixes (Bug#12746).
-2012-11-12 Chong Yidong <cyd@gnu.org>
+2012-11-16 Eli Zaretskii <eliz@gnu.org>
+
+ * trouble.texi (Crashing): Add information about MS-Windows and
+ the emacs_backtrace.txt file. (Bug#12908)
+
+2012-11-13 Chong Yidong <cyd@gnu.org>
* building.texi (Multithreaded Debugging): gdb-stopped-hooks is
actually named gdb-stopped-functions.
-2012-11-12 Glenn Morris <rgm@gnu.org>
+2012-11-13 Glenn Morris <rgm@gnu.org>
* misc.texi (Single Shell): Mention async-shell-command-buffer.
* misc.texi (Terminal emulator): Rename `term-face' to `term'.
-2012-11-09 Glenn Morris <rgm@gnu.org>
-
* emacs.texi (Acknowledgments): Add profiler author.
* ack.texi (Acknowledgments): Add some recent contributions.
-2012-11-08 Chong Yidong <cyd@gnu.org>
+2012-11-10 Chong Yidong <cyd@gnu.org>
* files.texi (Diff Mode): Doc fixes for
diff-delete-trailing-whitespace (Bug#12831).
* trouble.texi (Crashing): Copyedits.
-2012-11-08 Glenn Morris <rgm@gnu.org>
+2012-11-10 Glenn Morris <rgm@gnu.org>
* files.texi (Diff Mode): Trailing whitespace updates.
-2012-11-07 Chong Yidong <cyd@gnu.org>
+2012-11-10 Chong Yidong <cyd@gnu.org>
* misc.texi (Terminal emulator): Document Term mode faces.
* trouble.texi (Memory Full): Capitalize Buffer Menu.
-2012-11-05 Eli Zaretskii <eliz@gnu.org>
+2012-11-10 Eli Zaretskii <eliz@gnu.org>
* display.texi (Auto Scrolling): Clarify that scroll-step is
ignored when scroll-conservatively is set to a non-zero value.
(Bug#12801)
-2012-11-05 Chong Yidong <cyd@gnu.org>
+2012-11-10 Chong Yidong <cyd@gnu.org>
* dired.texi (Dired Updating): Doc fix (Bug#11744).
-@c -*-texinfo-*-
@c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008
@c hence no sectioning command or @node.
@display
-Copyright @copyright{} 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
-@sc{ascii} without markup, Texinfo input format, La@TeX{} input
-format, @acronym{SGML} or @acronym{XML} using a publicly available
-@acronym{DTD}, and standard-conforming simple @acronym{HTML},
-PostScript or @acronym{PDF} designed for human modification. Examples
-of transparent image formats include @acronym{PNG}, @acronym{XCF} and
-@acronym{JPG}. Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, @acronym{SGML} or
-@acronym{XML} for which the @acronym{DTD} and/or processing tools are
-not generally available, and the machine-generated @acronym{HTML},
-PostScript or @acronym{PDF} produced by some word processors for
+ASCII without markup, Texinfo input format, La@TeX{} input
+format, SGML or XML using a publicly available
+DTD, and standard-conforming simple HTML,
+PostScript or PDF designed for human modification. Examples
+of transparent image formats include PNG, XCF and
+JPG@. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, SGML or
+XML for which the DTD and/or processing tools are
+not generally available, and the machine-generated HTML,
+PostScript or PDF produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with@dots{}Texts.'' line with this:
+replace the ``with@dots{}Texts.''@: line with this:
@smallexample
@group
free software license, such as the GNU General Public License,
to permit their use in free software.
-
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
-
@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.2.91
+@set EMACSVER 24.3.50
@center Version 3, 29 June 2007
@c This file is intended to be included within another document,
-@c hence no sectioning command or @node.
+@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
conditions:
@enumerate a
-@item
+@item
The work must carry prominent notices stating that you modified it,
and giving a relevant date.
@item Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+APPLICABLE LAW@. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+A PARTICULAR PURPOSE@. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
the ``copyright'' line and a pointer to where the full notice is found.
@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
+@var{one line to give the program's name and a brief idea of what it does.}
Copyright (C) @var{year} @var{name of author}
This program is free software: you can redistribute it and/or modify
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
+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
notice like this when it starts in an interactive mode:
@smallexample
-@var{program} Copyright (C) @var{year} @var{name of author}
+@var{program} Copyright (C) @var{year} @var{name of author}
This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
This is free software, and you are welcome to redistribute it
under certain conditions; type @samp{show c} for details.
Search for functions and variables. Both interactive functions
(commands) and noninteractive functions can be found by this.
-@item M-x apropos-variable
-@findex apropos-variable
+@item M-x apropos-user-option
+@findex apropos-user-option
Search for user-customizable variables. With a prefix argument,
search for non-customizable variables too.
+@item M-x apropos-variable
+@findex apropos-variable
+Search for variables. With a prefix argument, search for
+customizable variables only.
+
@item M-x apropos-value
@findex apropos-value
Search for variables whose values match the specified pattern. With a
@item
In Lisp code, any function defined with @code{defun}, any variable
-defined with @code{defvar} or @code{defconst}, and in general the first
-argument of any expression that starts with @samp{(def} in column zero is
-a tag.
+defined with @code{defvar} or @code{defconst}, and in general the
+first argument of any expression that starts with @samp{(def} in
+column zero is a tag. As an exception, expressions of the form
+@code{(defvar @var{foo})} are treated as declarations, and are only
+tagged if the @samp{--declarations} option is given.
@item
In Scheme code, tags include anything defined with @code{def} or with a
@item
In Perl code, the tags are the packages, subroutines and variables
-defined by the @code{package}, @code{sub}, @code{my} and @code{local}
-keywords. Use @samp{--globals} if you want to tag global variables.
-Tags for subroutines are named @samp{@var{package}::@var{sub}}. The
-name for subroutines defined in the default package is
-@samp{main::@var{sub}}.
+defined by the @code{package}, @code{sub}, @code{use constant},
+@code{my}, and @code{local} keywords. Use @samp{--globals} if you
+want to tag global variables. Tags for subroutines are named
+@samp{@var{package}::@var{sub}}. The name for subroutines defined in
+the default package is @samp{main::@var{sub}}.
@item
In PHP code, tags are functions, classes and defines. Vars are tags
Emacs command. For example, when you type @kbd{C-r} inside of a
@code{query-replace}, you enter a recursive edit in which you can change
the current buffer. On exiting from the recursive edit, you go back to
-the @code{query-replace}.
+the @code{query-replace}. @xref{Query Replace}.
@kindex C-M-c
@findex exit-recursive-edit
@subsection When Emacs Crashes
@cindex crash report
+@cindex backtrace
+@cindex @file{emacs_backtrace.txt} file, MS-Windows
Emacs is not supposed to crash, but if it does, it produces a
@dfn{crash report} prior to exiting. The crash report is printed to
the standard error stream. If Emacs was started from a graphical
-desktop, the standard error stream is commonly redirected to a file
-such as @file{~/.xsession-errors}, so you can look for the crash
-report there.
+desktop on a GNU or Unix system, the standard error stream is commonly
+redirected to a file such as @file{~/.xsession-errors}, so you can
+look for the crash report there. On MS-Windows, the crash report is
+written to a file named @file{emacs_backtrace.txt} in the current
+directory of the Emacs process, in addition to the standard error
+stream.
The format of the crash report depends on the platform. On some
platforms, such as those using the GNU C Library, the crash report
includes a @dfn{backtrace} describing the execution state prior to
crashing, which can be used to help debug the crash. Here is an
-example:
+example for a GNU system:
@example
Fatal error 11: Segmentation fault
@example
sed -n 's/.*\[\(.*\)]$/\1/p' @var{backtrace} |
- addr2line -Cfip -e @var{bindir}/emacs
+ addr2line -Cfip -e @var{bindir}/@var{emacs-binary}
@end example
@noindent
Here, @var{backtrace} is the name of a text file containing a copy of
-the backtrace, and @var{bindir} is the name of the directory that
-contains the Emacs executable.
+the backtrace, @var{bindir} is the name of the directory that
+contains the Emacs executable, and @var{emacs-binary} is the name of
+the Emacs executable file, normally @file{emacs} on GNU and Unix
+systems and @file{emacs.exe} on MS-Windows and MS-DOS.
@cindex core dump
- Optionally, Emacs can generate a @dfn{core dump} when it crashes. A
-core dump is a file containing voluminous data about the state of the
-program prior to the crash, usually examined by loading it into a
-debugger such as GDB@. On many platforms, core dumps are disabled by
-default, and you must explicitly enable them by running the shell
-command @samp{ulimit -c unlimited} (e.g., in your shell startup
-script).
+ Optionally, Emacs can generate a @dfn{core dump} when it crashes, on
+systems that support core files. A core dump is a file containing
+voluminous data about the state of the program prior to the crash,
+usually examined by loading it into a debugger such as GDB@. On many
+platforms, core dumps are disabled by default, and you must explicitly
+enable them by running the shell command @samp{ulimit -c unlimited}
+(e.g., in your shell startup script).
@node After a Crash
@subsection Recovery After a Crash
(emacs-lisp-intro.pdf, emacs-lisp-intro.html):
Use $srcs for dependencies.
+2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix permissions bugs with setgid directories etc. (Bug#13125)
+ * emacs-lisp-intro.texi (Files List):
+ directory-files-and-attributes now outputs t for attribute that's
+ now a placeholder.
+
+2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doclicense.texi: Update to latest version from FSF.
+ These are just minor editorial changes.
+
+2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doclicense.texi: Update to latest version from FSF.
+ These are just minor editorial changes.
+
2012-10-24 Paul Eggert <eggert@penguin.cs.ucla.edu>
* emacs-lisp-intro.texi (Files List):
-@c -*-texinfo-*-
@c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008
@c hence no sectioning command or @node.
@display
-Copyright @copyright{} 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
-@sc{ascii} without markup, Texinfo input format, La@TeX{} input
-format, @acronym{SGML} or @acronym{XML} using a publicly available
-@acronym{DTD}, and standard-conforming simple @acronym{HTML},
-PostScript or @acronym{PDF} designed for human modification. Examples
-of transparent image formats include @acronym{PNG}, @acronym{XCF} and
-@acronym{JPG}. Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, @acronym{SGML} or
-@acronym{XML} for which the @acronym{DTD} and/or processing tools are
-not generally available, and the machine-generated @acronym{HTML},
-PostScript or @acronym{PDF} produced by some word processors for
+ASCII without markup, Texinfo input format, La@TeX{} input
+format, SGML or XML using a publicly available
+DTD, and standard-conforming simple HTML,
+PostScript or PDF designed for human modification. Examples
+of transparent image formats include PNG, XCF and
+JPG@. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, SGML or
+XML for which the DTD and/or processing tools are
+not generally available, and the machine-generated HTML,
+PostScript or PDF produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with@dots{}Texts.'' line with this:
+replace the ``with@dots{}Texts.''@: line with this:
@smallexample
@group
free software license, such as the GNU General Public License,
to permit their use in free software.
-
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
-
"-rw-r--r--"
@end group
@group
-nil
+t
2971624
773)
@end group
* keymaps.texi (Key Sequences): Remove obsolete sentence
(Bug#13356).
-2013-01-03 Ari Roponen <ari.roponen@gmail.com> (tiny change)
+2013-01-04 Ari Roponen <ari.roponen@gmail.com> (tiny change)
* hash.texi (Defining Hash): Fix typo. (Bug#13345)
+2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * files.texi (File Attributes): Undocument return format of file-acl.
+
2013-01-03 Glenn Morris <rgm@gnu.org>
* processes.texi (System Processes):
* elisp.texi (DATE): Bump to Jan 2013.
-2012-12-31 Glenn Morris <rgm@gnu.org>
+2013-01-02 Glenn Morris <rgm@gnu.org>
* customize.texi (Common Keywords, Type Keywords):
Replace "active field" with "button". (Bug#13310)
* customize.texi (Common Keywords): Add xref. (Bug#13311)
* tips.texi (Library Headers): Add cindex.
-2012-12-29 Wolfgang Jenkner <wjenkner@inode.at>
+2012-12-30 Wolfgang Jenkner <wjenkner@inode.at>
* functions.texi (Declare Form):
* intro.texi (A Sample Function Description):
* variables.texi (Using Lexical Binding): Don't use @var or CAPS
in @def.. commands. (Bug#13292)
+2012-12-29 Eli Zaretskii <eliz@gnu.org>
+
+ * files.texi (Changing Files): Document the return values of
+ set-file-selinux-context and set-file-acl.
+
2012-12-27 Glenn Morris <rgm@gnu.org>
* files.texi (File Names): Mention Cygwin conversion functions.
* windows.texi (Selecting Windows): Reword description of
select-window (Bug#13248).
+2012-12-22 Eli Zaretskii <eliz@gnu.org>
+
+ * files.texi (File Attributes, Changing Files): Remove the details
+ about the text returned by file-acl. Instead, just document that
+ it is an opaque string meant to be used by set-file-acl.
+
2012-12-21 Chong Yidong <cyd@gnu.org>
* modes.texi (Auto Major Mode): Fix typo (Bug#13230).
* customize.texi (Simple Types): Document key-sequence type
(Bug#13048).
-2012-12-15 Chong Yidong <cyd@gnu.org>
-
* strings.texi (Text Comparison): Doc fix for compare-strings.
-2012-12-09 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-12-19 Michael Albinus <michael.albinus@gmx.de>
- * control.texi (Pattern matching case statement): New node.
+ * files.texi (Magic File Names): Add `file-acl',
+ `file-selinux-context', `set-file-acl' and
+ `set-file-selinux-context'. Make the list consistent.
+
+2012-12-19 Jonas Bernoulli <jonas@bernoul.li>
+
+ * tips.texi (Library Headers): New header keyword `Homepage'.
+ Make continuation lines syntax more precise.
+
+2012-12-17 Eli Zaretskii <eliz@gnu.org>
+
+ * files.texi (File Attributes, Changing Files): Update to include
+ MS-Windows support for ACLs.
-2012-12-06 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-12-16 Romain Francoise <romain@orebokech.com>
+
+ * files.texi (File Attributes): Document ACL support and new
+ `file-acl' function.
+ (Changing Files): Mention argument name change of `copy-file' and
+ document new function `set-file-acl'.
+
+2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix permissions bugs with setgid directories etc. (Bug#13125)
+ * files.texi (Testing Accessibility): Document GROUP arg
+ of file-ownership-preserved-p.
+ (File Attributes): Document that 9th element is now
+ just a placeholder.
+ * os.texi (User Identification): Document new functions group-gid,
+ group-real-gid.
+
+2012-12-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * internals.texi (C Integer Types): New section.
+ This follows up and records an email in
+ <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00496.html>.
+
+2012-12-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * control.texi (Pattern matching case statement): New node.
* customize.texi (Variable Definitions): Mention the default :group
for defcustoms (bug#13093).
-2012-12-05 Chong Yidong <cyd@gnu.org>
+2012-12-09 Glenn Morris <rgm@gnu.org>
+
+ * customize.texi (Variable Definitions): Mention eval-defun
+ on a defcustom calls the :set function when appropriate.
+
+2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doclicense.texi, gpl.texi: Update to latest version from FSF.
+ These are just minor editorial changes.
+
+2012-12-06 Chong Yidong <cyd@gnu.org>
* lists.texi (Plist Access): Move put example to Symbol Plists.
* symbols.texi (Standard Properties): Fix typo.
-2012-12-02 Chong Yidong <cyd@gnu.org>
+2012-12-03 Chong Yidong <cyd@gnu.org>
* symbols.texi (Symbol Properties): New node.
(Symbol Plists): Make it a subsection under Symbol Properties.
* commands.texi (Using Interactive): Fix index entry.
-2012-11-23 Martin Rudalics <rudalics@gmx.at>
+2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doclicense.texi: Update to latest version from FSF.
+ These are just minor editorial changes.
+ * elisp.texi (GNU Free Documentation License)
+ (GNU General Public Licens):
+ Provide sectioning, since doclicense.texi no longer does that.
+
+ * loading.texi (Named Features): @ -> @@ to fix typo.
+
+2012-11-24 Martin Rudalics <rudalics@gmx.at>
* windows.texi (Basic Windows): Fix typo.
(Windows and Frames): Fix example. Move description of
dedicatedness affects functions removing buffers or windows.
* buffers.texi (The Buffer List): Fix description of bury-buffer.
-2012-11-23 Chong Yidong <cyd@gnu.org>
+2012-11-24 Chong Yidong <cyd@gnu.org>
* modes.texi (%-Constructs): Fix statement about mode construct
padding (Bug#12866).
-2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-24 Stefan Monnier <monnier@iro.umontreal.ca>
* debugging.texi (Profiling): Make it more clear
that --enable-profiling is about profiling the C code.
2012-11-21 Glenn Morris <rgm@gnu.org>
- * debugging.texi (Profiling): Mention --enable-profiling (if !tex).
- Add some basic information about the profile report buffer.
- (Debugging): Mention profiling in the introduction.
-
-2012-11-20 Glenn Morris <rgm@gnu.org>
+ * display.texi (Attribute Functions):
+ Update for set-face-* name changes.
+ Add new "inherit" argument for face-bold-p etc.
+ Move description of this argument to a common section, like "frame".
- * debugging.texi (Profiling): New section, in progress.
+ * debugging.texi (Profiling): New section.
+ (Debugging): Mention profiling in the introduction.
* tips.texi (Compilation Tips): Move profiling to separate section.
* elisp.texi: Add Profiling to detailed menu.
-2012-11-18 Martin Rudalics <rudalics@gmx.at>
+2012-11-21 Martin Rudalics <rudalics@gmx.at>
* windows.texi (Display Action Functions): Fix recently added
example. Suggested by Michael Heerdegen.
-2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
+2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
Minor cleanup for times as lists of four integers.
* os.texi (Time Parsing): Time values can now be four integers.
* loading.texi (How Programs Do Loading): Add eager macro expansion.
* macros.texi (Expansion): Mention eager macro expansion.
-2012-11-17 Glenn Morris <rgm@gnu.org>
-
* minibuf.texi (Basic Completion): Mention misc completion-table funcs.
-2012-11-17 Leo Liu <sdl.web@gmail.com>
+2012-11-18 Leo Liu <sdl.web@gmail.com>
* minibuf.texi (Programmed Completion): Doc fix for metadata
request (Bug#12850).
-2012-11-17 Glenn Morris <rgm@gnu.org>
+2012-11-18 Glenn Morris <rgm@gnu.org>
* display.texi (Temporary Displays): Document with-temp-buffer-window.
Fix description of display-buffer-below-selected. Reorder actions.
Add example (Bug#12848).
-2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
-
- * keymaps.texi (Translation Keymaps): Add a subsection "Interaction
- with normal keymaps" (bug#12868).
-
-2012-11-15 Glenn Morris <rgm@gnu.org>
+2012-11-16 Glenn Morris <rgm@gnu.org>
* display.texi (Face Attributes): Fix :underline COLOR description.
(Attribute Functions): Update for set-face-underline rename.
Tweak descriptions of face-underline-p, face-inverse-video-p.
-2012-11-14 Glenn Morris <rgm@gnu.org>
-
* keymaps.texi (Searching Keymaps, Tool Bar): Untabify examples,
so they align better in info.
(Active Keymaps, Searching Keymaps, Controlling Active Maps):
Document set-temporary-overlay-map.
-2012-11-12 Glenn Morris <rgm@gnu.org>
+2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * keymaps.texi (Translation Keymaps): Add a subsection "Interaction
+ with normal keymaps".
+
+2012-11-15 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * internals.texi (Garbage Collection): Update descriptions
+ of vectorlike_header, garbage-collect and gc-cons-threshold.
+ (Object Internals): Explain Lisp_Object layout and the basics
+ of an internal type system.
+ (Buffer Internals): Update description of struct buffer.
+
+2012-11-13 Glenn Morris <rgm@gnu.org>
* variables.texi (Adding Generalized Variables):
At least mention gv-define-expander and gv-letplace.
-2012-11-11 Glenn Morris <rgm@gnu.org>
-
* debugging.texi (Error Debugging): Mention debug-on-message.
(Using Debugger): Mention debugger-bury-or-kill.
* variables.texi (Adding Generalized Variables):
Use standard formatting for common lisp note about setf functions.
-2012-11-07 Martin Rudalics <rudalics@gmx.at>
+2012-11-10 Martin Rudalics <rudalics@gmx.at>
* elisp.texi (Top): Add Recombining Windows to menu.
* windows.texi (Recombining Windows): New subsection.
(Splitting Windows): Rewrite text on handling of window
combinations and move it to new subsection.
-2012-11-07 Chong Yidong <cyd@gnu.org>
+2012-11-10 Chong Yidong <cyd@gnu.org>
* searching.texi (Replacing Match): Document \? in replace-match.
* edebug.texi (Specification List): setf is no longer CL-only.
-2012-11-07 Glenn Morris <rgm@gnu.org>
+2012-11-10 Glenn Morris <rgm@gnu.org>
* variables.texi (Adding Generalized Variables):
Update description of FIX-RETURN expansion.
-2012-11-06 Glenn Morris <rgm@gnu.org>
-
* variables.texi (Setting Generalized Variables):
Split most of previous contents into this subsection.
(Adding Generalized Variables): New subsection.
* elisp.texi: Add Generalized Variables subsections to detailed menu.
-2012-11-05 Chong Yidong <cyd@gnu.org>
+2012-11-10 Chong Yidong <cyd@gnu.org>
* frames.texi (Initial Parameters): Doc fix (Bug#12144).
+2012-11-08 Michael Albinus <michael.albinus@gmx.de>
+
+ * os.texi (Notifications): Update descriptions of
+ notifications-notify, notifications-close-notification and
+ notifications-get-capabilities according to latest code changes.
+ Add notifications-get-server-information.
+
2012-11-03 Chong Yidong <cyd@gnu.org>
* objects.texi (General Escape Syntax): Clarify the explanation of
When you evaluate a @code{defcustom} form with @kbd{C-M-x} in Emacs Lisp
mode (@code{eval-defun}), a special feature of @code{eval-defun}
arranges to set the variable unconditionally, without testing whether
-its value is void. (The same feature applies to @code{defvar}.)
-@xref{Defining Variables}.
+its value is void. (The same feature applies to @code{defvar},
+@pxref{Defining Variables}.) Using @code{eval-defun} on a defcustom
+that is already defined calls the @code{:set} function (see below),
+if there is one.
If you put a @code{defcustom} in a pre-loaded Emacs Lisp file
(@pxref{Building Emacs}), the standard value installed at dump time
This sets the @code{:font} attribute of @var{face} to @var{font}.
@end deffn
-@defun set-face-bold-p face bold-p &optional frame
+@defun set-face-bold face bold-p &optional frame
This sets the @code{:weight} attribute of @var{face} to @var{normal}
if @var{bold-p} is @code{nil}, and to @var{bold} otherwise.
@end defun
-@defun set-face-italic-p face italic-p &optional frame
+@defun set-face-italic face italic-p &optional frame
This sets the @code{:slant} attribute of @var{face} to @var{normal} if
@var{italic-p} is @code{nil}, and to @var{italic} otherwise.
@end defun
@var{underline}.
@end defun
-@defun set-face-inverse-video-p face inverse-video-p &optional frame
+@defun set-face-inverse-video face inverse-video-p &optional frame
This sets the @code{:inverse-video} attribute of @var{face} to
@var{inverse-video-p}.
@end defun
don't specify @var{frame}, they refer to the selected frame; @code{t}
refers to the default data for new frames. They return the symbol
@code{unspecified} if the face doesn't define any value for that
-attribute.
+attribute. If @var{inherit} is @code{nil}, only an attribute directly
+defined by the face is returned. If @var{inherit} is non-@code{nil},
+any faces specified by its @code{:inherit} attribute are considered as
+well, and if @var{inherit} is a face or a list of faces, then they are
+also considered, until a specified attribute is found. To ensure that
+the return value is always specified, use a value of @code{default} for
+@var{inherit}.
+
+@defun face-font face &optional frame
+This function returns the name of the font of face @var{face}.
+@end defun
@defun face-foreground face &optional frame inherit
@defunx face-background face &optional frame inherit
These functions return the foreground color (or background color,
respectively) of face @var{face}, as a string.
-
-If @var{inherit} is @code{nil}, only a color directly defined by the face is
-returned. If @var{inherit} is non-@code{nil}, any faces specified by its
-@code{:inherit} attribute are considered as well, and if @var{inherit}
-is a face or a list of faces, then they are also considered, until a
-specified color is found. To ensure that the return value is always
-specified, use a value of @code{default} for @var{inherit}.
@end defun
@defun face-stipple face &optional frame inherit
This function returns the name of the background stipple pattern of face
@var{face}, or @code{nil} if it doesn't have one.
-
-If @var{inherit} is @code{nil}, only a stipple directly defined by the
-face is returned. If @var{inherit} is non-@code{nil}, any faces
-specified by its @code{:inherit} attribute are considered as well, and
-if @var{inherit} is a face or a list of faces, then they are also
-considered, until a specified stipple is found. To ensure that the
-return value is always specified, use a value of @code{default} for
-@var{inherit}.
-@end defun
-
-@defun face-font face &optional frame
-This function returns the name of the font of face @var{face}.
@end defun
-@defun face-bold-p face &optional frame
+@defun face-bold-p face &optional frame inherit
This function returns a non-@code{nil} value if the @code{:weight}
attribute of @var{face} is bolder than normal (i.e., one of
@code{semi-bold}, @code{bold}, @code{extra-bold}, or
@code{ultra-bold}). Otherwise, it returns @code{nil}.
@end defun
-@defun face-italic-p face &optional frame
+@defun face-italic-p face &optional frame inherit
This function returns a non-@code{nil} value if the @code{:slant}
attribute of @var{face} is @code{italic} or @code{oblique}, and
@code{nil} otherwise.
@end defun
-@c Note the weasel words. A face that inherits from an underlined
-@c face but does not specify :underline will return nil.
-@defun face-underline-p face &optional frame
+@defun face-underline-p face &optional frame inherit
This function returns non-@code{nil} if face @var{face} specifies
a non-@code{nil} @code{:underline} attribute.
@end defun
-@defun face-inverse-video-p face &optional frame
+@defun face-inverse-video-p face &optional frame inherit
This function returns non-@code{nil} if face @var{face} specifies
a non-@code{nil} @code{:inverse-video} attribute.
@end defun
-@c -*-texinfo-*-
@c The GNU Free Documentation License.
-@node GNU Free Documentation License
-
-@appendix GNU Free Documentation License
@center Version 1.3, 3 November 2008
@c This file is intended to be included within another document,
@c hence no sectioning command or @node.
@display
-Copyright @copyright{} 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
-@sc{ascii} without markup, Texinfo input format, La@TeX{} input
-format, @acronym{SGML} or @acronym{XML} using a publicly available
-@acronym{DTD}, and standard-conforming simple @acronym{HTML},
-PostScript or @acronym{PDF} designed for human modification. Examples
-of transparent image formats include @acronym{PNG}, @acronym{XCF} and
-@acronym{JPG}. Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, @acronym{SGML} or
-@acronym{XML} for which the @acronym{DTD} and/or processing tools are
-not generally available, and the machine-generated @acronym{HTML},
-PostScript or @acronym{PDF} produced by some word processors for
+ASCII without markup, Texinfo input format, La@TeX{} input
+format, SGML or XML using a publicly available
+DTD, and standard-conforming simple HTML,
+PostScript or PDF designed for human modification. Examples
+of transparent image formats include PNG, XCF and
+JPG@. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, SGML or
+XML for which the DTD and/or processing tools are
+not generally available, and the machine-generated HTML,
+PostScript or PDF produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with@dots{}Texts.'' line with this:
+replace the ``with@dots{}Texts.''@: line with this:
@smallexample
@group
free software license, such as the GNU General Public License,
to permit their use in free software.
-
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
@c appendices
@include anti.texi
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
@include doclicense.texi
+@node GPL
+@appendix GNU General Public License
@include gpl.texi
@include tips.texi
@include internals.texi
using @var{string} as the error message text.
@end defun
-@defun file-ownership-preserved-p filename
+@defun file-ownership-preserved-p filename &optional group
This function returns @code{t} if deleting the file @var{filename} and
then creating it anew would keep the file's owner unchanged. It also
returns @code{t} for nonexistent files.
+If the optional argument @var{group} is non-@code{nil}, this function
+also checks that the file's group would be unchanged.
+
If @var{filename} is a symbolic link, then, unlike the other functions
discussed here, @code{file-ownership-preserved-p} does @emph{not}
replace @var{filename} with its target. However, it does recursively
as in @samp{ls -l}.
@item
-@code{t} if the file's @acronym{GID} would change if file were
-deleted and recreated; @code{nil} otherwise.
+An unspecified value, present for backward compatibility.
@item
The file's inode number. If possible, this is an integer. If the
(20000 23 0 0)
(20614 64555 902289 872000)
122295 "-rw-rw-rw-"
- nil (5888 2 . 43978)
+ t (5888 2 . 43978)
(15479 . 46724))
@end group
@end example
@item "-rw-rw-rw-"
has a mode of read and write access for the owner, group, and world.
-@item nil
-would retain the same @acronym{GID} if it were recreated.
+@item t
+is merely a placeholder; it carries no information.
@item (5888 2 . 43978)
has an inode number of 6473924464520138.
support, then the return value is @code{(nil nil nil nil)}.
@end defun
+@cindex access control list
+@cindex ACL entries
+ If Emacs has been compiled with @dfn{ACL} (access control list)
+support, you can use the function @code{file-acl} to retrieve a file's
+ACL entries. The interface implementation is platform-specific; on
+GNU/Linux and BSD, Emacs uses the POSIX ACL interface, while on
+MS-Windows Emacs emulates the POSIX ACL interface with native file
+security APIs.
+
+@defun file-acl filename
+This function returns the ACL entries of the file @var{filename}. The
+return value is a platform-dependent object containing some
+representation of the ACL entries. Don't use it for anything except
+passing it to the @code{set-file-acl} function (@pxref{Changing Files,
+set-file-acl}).
+
+If the file does not exist or is inaccessible, or if Emacs was unable to
+determine the ACL entries, then the return value is @code{nil}. The
+latter can happen for local files if Emacs was not compiled with ACL
+support, or for remote files if the file handler returns nil for the
+file's ACL entries.
+@end defun
+
@node Locating Files
@subsection How to Locate Files in Standard Places
@cindex locate file in path
file. This works only on some operating systems, and only if you have
the correct permissions to do so.
-If the optional argument @var{preserve-selinux} is non-@code{nil}, and
-Emacs has been compiled with SELinux support, this function attempts
-to copy the file's SELinux context (@pxref{File Attributes}).
+If the optional argument @var{preserve-extended-attributes} is
+non-@code{nil}, and Emacs has been built with the appropriate support,
+this function attempts to copy the file's extended attributes, such as
+its SELinux context and ACL entries (@pxref{File Attributes}).
@end deffn
@deffn Command make-symbolic-link filename newname &optional ok-if-exists
@var{filename} to @var{context}. @xref{File Attributes}, for a brief
description of SELinux contexts. The @var{context} argument should be
a list @code{(@var{user} @var{role} @var{type} @var{range})}, like the
-return value of @code{file-selinux-context}. The function does
-nothing if SELinux is disabled, or if Emacs was compiled without
-SELinux support.
+return value of @code{file-selinux-context}. The function returns
+@code{t} if it succeeds to set the SELinux security context of
+@var{filename}, @code{nil} otherwise. The function does nothing and
+returns @code{nil} if SELinux is disabled, or if Emacs was compiled
+without SELinux support.
+@end defun
+
+@defun set-file-acl filename acl-string
+This function sets the ACL entries of the file @var{filename} to
+@var{acl-string}. @xref{File Attributes}, for a brief description of
+ACLs. The @var{acl-string} argument should be a string containing the
+textual representation of the desired ACL entries as returned by
+@code{file-acl} (@pxref{File Attributes, file-acl}). The function
+returns @code{t} if it succeeds to set the ACL entries of
+@var{filename}, @code{nil} otherwise.
@end defun
@node File Names
@code{dired-compress-file}, @code{dired-uncache},@*
@code{expand-file-name},
@code{file-accessible-directory-p},
+@code{file-acl},
@code{file-attributes},
@code{file-directory-p},
+@code{file-equal-p},
@code{file-executable-p}, @code{file-exists-p},
+@code{file-in-directory-p},
@code{file-local-copy}, @code{file-remote-p},
@code{file-modes}, @code{file-name-all-completions},
@code{file-name-as-directory},
@code{file-name-nondirectory},
@code{file-name-sans-versions}, @code{file-newer-than-file-p},
@code{file-ownership-preserved-p},
-@code{file-readable-p}, @code{file-regular-p}, @code{file-in-directory-p},
+@code{file-readable-p}, @code{file-regular-p},
+@code{file-selinux-context},
@code{file-symlink-p}, @code{file-truename}, @code{file-writable-p},
-@code{file-equal-p}, @code{find-backup-file-name},
+@code{find-backup-file-name},
@c Not sure why it was here: @code{find-file-noselect},@*
@code{get-file-buffer},
@code{insert-directory},
@code{make-directory-internal},
@code{make-symbolic-link},@*
@code{process-file},
-@code{rename-file}, @code{set-file-modes}, @code{set-file-times},
+@code{rename-file}, @code{set-file-acl}, @code{set-file-modes},
+@code{set-file-selinux-context}, @code{set-file-times},
@code{set-visited-file-modtime}, @code{shell-command},
@code{start-file-process},
@code{substitute-in-file-name},@*
@code{dired-compress-file}, @code{dired-uncache},
@code{expand-file-name},
@code{file-accessible-direc@discretionary{}{}{}tory-p},
+@code{file-acl},
@code{file-attributes},
@code{file-direct@discretionary{}{}{}ory-p},
+@code{file-equal-p},
@code{file-executable-p}, @code{file-exists-p},
+@code{file-in-directory-p},
@code{file-local-copy}, @code{file-remote-p},
@code{file-modes}, @code{file-name-all-completions},
@code{file-name-as-directory},
@code{file-name-nondirec@discretionary{}{}{}tory},
@code{file-name-sans-versions}, @code{file-newer-than-file-p},
@code{file-ownership-pre@discretionary{}{}{}served-p},
-@code{file-readable-p}, @code{file-regular-p}, @code{file-symlink-p},
-@code{file-truename}, @code{file-writable-p},
+@code{file-readable-p}, @code{file-regular-p},
+@code{file-selinux-context},
+@code{file-symlink-p}, @code{file-truename}, @code{file-writable-p},
@code{find-backup-file-name},
@c Not sure why it was here: @code{find-file-noselect},
@code{get-file-buffer},
@code{insert-directory},
@code{insert-file-contents},
-@code{load}, @code{make-direc@discretionary{}{}{}tory},
+@code{load},
+@code{make-auto-save-file-name},
+@code{make-direc@discretionary{}{}{}tory},
@code{make-direc@discretionary{}{}{}tory-internal},
@code{make-symbolic-link},
@code{process-file},
-@code{rename-file}, @code{set-file-modes},
+@code{rename-file}, @code{set-file-acl}, @code{set-file-modes},
+@code{set-file-selinux-context}, @code{set-file-times},
@code{set-visited-file-modtime}, @code{shell-command},
@code{start-file-process},
@code{substitute-in-file-name},
-@c -*-texinfo-*-
-
-@node GPL
-@appendix GNU General Public License
@c The GNU General Public License.
@center Version 3, 29 June 2007
@c This file is intended to be included within another document,
-@c hence no sectioning command or @node.
+@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
conditions:
@enumerate a
-@item
+@item
The work must carry prominent notices stating that you modified it,
and giving a relevant date.
@item Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+APPLICABLE LAW@. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+A PARTICULAR PURPOSE@. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
the ``copyright'' line and a pointer to where the full notice is found.
@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
+@var{one line to give the program's name and a brief idea of what it does.}
Copyright (C) @var{year} @var{name of author}
This program is free software: you can redistribute it and/or modify
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
+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
notice like this when it starts in an interactive mode:
@smallexample
-@var{program} Copyright (C) @var{year} @var{name of author}
+@var{program} Copyright (C) @var{year} @var{name of author}
This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
This is free software, and you are welcome to redistribute it
under certain conditions; type @samp{show c} for details.
* Memory Usage:: Info about total size of Lisp objects made so far.
* Writing Emacs Primitives:: Writing C code for Emacs.
* Object Internals:: Data formats of buffers, windows, processes.
+* C Integer Types:: How C integer types are used inside Emacs.
@end menu
@node Building Emacs
Beyond the basic vector, a lot of objects like window, buffer, and
frame are managed as if they were vectors. The corresponding C data
structures include the @code{struct vectorlike_header} field whose
-@code{next} field points to the next object in the chain:
-@code{header.next.buffer} points to the next buffer (which could be
-a killed buffer), and @code{header.next.vector} points to the next
-vector in a free list. If a vector is small (smaller than or equal to
-@code{VBLOCK_BYTES_MAX} bytes, see @file{alloc.c}), then
-@code{header.next.nbytes} contains the vector size in bytes.
+@code{size} member contains the subtype enumerated by @code{enum pvec_type}
+and an information about how many @code{Lisp_Object} fields this structure
+contains and what the size of the rest data is. This information is
+needed to calculate the memory footprint of an object, and used
+by the vector allocation code while iterating over the vector blocks.
@cindex garbage collection
It is quite common to use some storage for a while, then release it
spontaneously if you use more than @code{gc-cons-threshold} bytes of
Lisp data since the previous garbage collection.)
-@code{garbage-collect} returns a list containing the following
-information:
+@code{garbage-collect} returns a list with information on amount of space in
+use, where each entry has the form @samp{(@var{name} @var{size} @var{used})}
+or @samp{(@var{name} @var{size} @var{used} @var{free})}. In the entry,
+@var{name} is a symbol describing the kind of objects this entry represents,
+@var{size} is the number of bytes used by each one, @var{used} is the number
+of those objects that were found live in the heap, and optional @var{free} is
+the number of those objects that are not live but that Emacs keeps around for
+future allocations. So an overall result is:
@example
-@group
-((@var{used-conses} . @var{free-conses})
- (@var{used-syms} . @var{free-syms})
-@end group
- (@var{used-miscs} . @var{free-miscs})
- @var{used-string-chars}
- @var{used-vector-slots}
- (@var{used-floats} . @var{free-floats})
- (@var{used-intervals} . @var{free-intervals})
- (@var{used-strings} . @var{free-strings}))
+((@code{conses} @var{cons-size} @var{used-conses} @var{free-conses})
+ (@code{symbols} @var{symbol-size} @var{used-symbols} @var{free-symbols})
+ (@code{miscs} @var{misc-size} @var{used-miscs} @var{free-miscs})
+ (@code{strings} @var{string-size} @var{used-strings} @var{free-strings})
+ (@code{string-bytes} @var{byte-size} @var{used-bytes})
+ (@code{vectors} @var{vector-size} @var{used-vectors})
+ (@code{vector-slots} @var{slot-size} @var{used-slots} @var{free-slots})
+ (@code{floats} @var{float-size} @var{used-floats} @var{free-floats})
+ (@code{intervals} @var{interval-size} @var{used-intervals} @var{free-intervals})
+ (@code{buffers} @var{buffer-size} @var{used-buffers})
+ (@code{heap} @var{unit-size} @var{total-size} @var{free-size}))
@end example
Here is an example:
@example
-@group
(garbage-collect)
- @result{} ((106886 . 13184) (9769 . 0)
- (7731 . 4651) 347543 121628
- (31 . 94) (1273 . 168)
- (25474 . 3569))
-@end group
+ @result{} ((conses 16 49126 8058) (symbols 48 14607 0)
+ (miscs 40 34 56) (strings 32 2942 2607)
+ (string-bytes 1 78607) (vectors 16 7247)
+ (vector-slots 8 341609 29474) (floats 8 71 102)
+ (intervals 56 27 26) (buffers 944 8)
+ (heap 1024 11715 2678))
@end example
-Here is a table explaining each element:
+Below is a table explaining each element. Note that last @code{heap} entry
+is optional and present only if an underlying @code{malloc} implementation
+provides @code{mallinfo} function.
@table @var
+@item cons-size
+Internal size of a cons cell, i.e., @code{sizeof (struct Lisp_Cons)}.
+
@item used-conses
The number of cons cells in use.
@item free-conses
-The number of cons cells for which space has been obtained from the
-operating system, but that are not currently being used.
+The number of cons cells for which space has been obtained from
+the operating system, but that are not currently being used.
-@item used-syms
+@item symbol-size
+Internal size of a symbol, i.e., @code{sizeof (struct Lisp_Symbol)}.
+
+@item used-symbols
The number of symbols in use.
-@item free-syms
-The number of symbols for which space has been obtained from the
-operating system, but that are not currently being used.
+@item free-symbols
+The number of symbols for which space has been obtained from
+the operating system, but that are not currently being used.
+
+@item misc-size
+Internal size of a miscellaneous entity, i.e.,
+@code{sizeof (union Lisp_Misc)}, which is a size of the
+largest type enumerated in @code{enum Lisp_Misc_Type}.
@item used-miscs
-The number of miscellaneous objects in use. These include markers and
-overlays, plus certain objects not visible to users.
+The number of miscellaneous objects in use. These include markers
+and overlays, plus certain objects not visible to users.
@item free-miscs
The number of miscellaneous objects for which space has been obtained
from the operating system, but that are not currently being used.
-@item used-string-chars
-The total size of all strings, in characters.
+@item string-size
+Internal size of a string header, i.e., @code{sizeof (struct Lisp_String)}.
+
+@item used-strings
+The number of string headers in use.
+
+@item free-strings
+The number of string headers for which space has been obtained
+from the operating system, but that are not currently being used.
+
+@item byte-size
+This is used for convenience and equals to @code{sizeof (char)}.
+
+@item used-bytes
+The total size of all string data in bytes.
+
+@item vector-size
+Internal size of a vector header, i.e., @code{sizeof (struct Lisp_Vector)}.
+
+@item used-vectors
+The number of vector headers allocated from the vector blocks.
+
+@item slot-size
+Internal size of a vector slot, always equal to @code{sizeof (Lisp_Object)}.
-@item used-vector-slots
-The total number of elements of existing vectors.
+@item used-slots
+The number of slots in all used vectors.
+
+@item free-slots
+The number of free slots in all vector blocks.
+
+@item float-size
+Internal size of a float object, i.e., @code{sizeof (struct Lisp_Float)}.
+(Do not confuse it with the native platform @code{float} or @code{double}.)
@item used-floats
The number of floats in use.
@item free-floats
-The number of floats for which space has been obtained from the
-operating system, but that are not currently being used.
+The number of floats for which space has been obtained from
+the operating system, but that are not currently being used.
+
+@item interval-size
+Internal size of an interval object, i.e., @code{sizeof (struct interval)}.
@item used-intervals
-The number of intervals in use. Intervals are an internal
-data structure used for representing text properties.
+The number of intervals in use.
@item free-intervals
-The number of intervals for which space has been obtained
-from the operating system, but that are not currently being used.
+The number of intervals for which space has been obtained from
+the operating system, but that are not currently being used.
-@item used-strings
-The number of strings in use.
+@item buffer-size
+Internal size of a buffer, i.e., @code{sizeof (struct buffer)}.
+(Do not confuse with the value returned by @code{buffer-size} function.)
-@item free-strings
-The number of string headers for which the space was obtained from the
-operating system, but which are currently not in use. (A string
-object consists of a header and the storage for the string text
-itself; the latter is only allocated when the string is created.)
+@item used-buffers
+The number of buffer objects in use. This includes killed buffers
+invisible to users, i.e., all buffers in @code{all_buffers} list.
+
+@item unit-size
+The unit of heap space measurement, always equal to 1024 bytes.
+
+@item total-size
+Total heap size, in @var{unit-size} units.
+
+@item free-size
+Heap space which is not currently used, in @var{unit-size} units.
@end table
If there was overflow in pure space (@pxref{Pure Storage}),
@defopt gc-cons-threshold
The value of this variable is the number of bytes of storage that must
be allocated for Lisp objects after one garbage collection in order to
-trigger another garbage collection. A cons cell counts as eight bytes,
-a string as one byte per character plus a few bytes of overhead, and so
-on; space allocated to the contents of buffers does not count. Note
-that the subsequent garbage collection does not happen immediately when
-the threshold is exhausted, but only the next time the Lisp evaluator is
-called.
-
-The initial threshold value is 800,000. If you specify a larger
-value, garbage collection will happen less often. This reduces the
-amount of time spent garbage collecting, but increases total memory use.
-You may want to do this when running a program that creates lots of
-Lisp data.
-
-You can make collections more frequent by specifying a smaller value,
-down to 10,000. A value less than 10,000 will remain in effect only
-until the subsequent garbage collection, at which time
-@code{garbage-collect} will set the threshold back to 10,000.
+trigger another garbage collection. You can use the result returned by
+@code{garbage-collect} to get an information about size of the particular
+object type; space allocated to the contents of buffers does not count.
+Note that the subsequent garbage collection does not happen immediately
+when the threshold is exhausted, but only the next time the Lisp interpreter
+is called.
+
+The initial threshold value is @code{GC_DEFAULT_THRESHOLD}, defined in
+@file{alloc.c}. Since it's defined in @code{word_size} units, the value
+is 400,000 for the default 32-bit configuration and 800,000 for the 64-bit
+one. If you specify a larger value, garbage collection will happen less
+often. This reduces the amount of time spent garbage collecting, but
+increases total memory use. You may want to do this when running a program
+that creates lots of Lisp data.
+
+You can make collections more frequent by specifying a smaller value, down
+to 1/10th of @code{GC_DEFAULT_THRESHOLD}. A value less than this minimum
+will remain in effect only until the subsequent garbage collection, at which
+time @code{garbage-collect} will set the threshold back to the minimum.
@end defopt
@defopt gc-cons-percentage
the number of Lisp arguments, it must have exactly two C arguments:
the first is the number of Lisp arguments, and the second is the
address of a block containing their values. These have types
-@code{int} and @w{@code{Lisp_Object *}} respectively.
+@code{int} and @w{@code{Lisp_Object *}} respectively. Since
+@code{Lisp_Object} can hold any Lisp object of any data type, you
+can determine the actual data type only at run time; so if you want
+a primitive to accept only a certain type of argument, you must check
+the type explicitly using a suitable predicate (@pxref{Type Predicates}).
+@cindex type checking internals
@cindex @code{GCPRO} and @code{UNGCPRO}
@cindex protect C variables from garbage collection
@section Object Internals
@cindex object internals
-@c FIXME Is this still true? Does --with-wide-int affect anything?
- GNU Emacs Lisp manipulates many different types of data. The actual
-data are stored in a heap and the only access that programs have to it
-is through pointers. Each pointer is 32 bits wide on 32-bit machines,
-and 64 bits wide on 64-bit machines; three of these bits are used for
-the tag that identifies the object's type, and the remainder are used
-to address the object.
-
- Because Lisp objects are represented as tagged pointers, it is always
-possible to determine the Lisp data type of any object. The C data type
-@code{Lisp_Object} can hold any Lisp object of any data type. Ordinary
-variables have type @code{Lisp_Object}, which means they can hold any
-type of Lisp value; you can determine the actual data type only at run
-time. The same is true for function arguments; if you want a function
-to accept only a certain type of argument, you must check the type
-explicitly using a suitable predicate (@pxref{Type Predicates}).
-@cindex type checking internals
+ Emacs Lisp provides a rich set of the data types. Some of them, like cons
+cells, integers and strings, are common to nearly all Lisp dialects. Some
+others, like markers and buffers, are quite special and needed to provide
+the basic support to write editor commands in Lisp. To implement such
+a variety of object types and provide an efficient way to pass objects between
+the subsystems of an interpreter, there is a set of C data structures and
+a special type to represent the pointers to all of them, which is known as
+@dfn{tagged pointer}.
+
+ In C, the tagged pointer is an object of type @code{Lisp_Object}. Any
+initialized variable of such a type always holds the value of one of the
+following basic data types: integer, symbol, string, cons cell, float,
+vectorlike or miscellaneous object. Each of these data types has the
+corresponding tag value. All tags are enumerated by @code{enum Lisp_Type}
+and placed into a 3-bit bitfield of the @code{Lisp_Object}. The rest of the
+bits is the value itself. Integer values are immediate, i.e., directly
+represented by those @dfn{value bits}, and all other objects are represented
+by the C pointers to a corresponding object allocated from the heap. Width
+of the @code{Lisp_Object} is platform- and configuration-dependent: usually
+it's equal to the width of an underlying platform pointer (i.e., 32-bit on
+a 32-bit machine and 64-bit on a 64-bit one), but also there is a special
+configuration where @code{Lisp_Object} is 64-bit but all pointers are 32-bit.
+The latter trick was designed to overcome the limited range of values for
+Lisp integers on a 32-bit system by using 64-bit @code{long long} type for
+@code{Lisp_Object}.
+
+ The following C data structures are defined in @file{lisp.h} to represent
+the basic data types beyond integers:
+
+@table @code
+@item struct Lisp_Cons
+Cons cell, an object used to construct lists.
+
+@item struct Lisp_String
+String, the basic object to represent a sequence of characters.
+
+@item struct Lisp_Vector
+Array, a fixed-size set of Lisp objects which may be accessed by an index.
+
+@item struct Lisp_Symbol
+Symbol, the unique-named entity commonly used as an identifier.
+
+@item struct Lisp_Float
+Floating point value.
+
+@item union Lisp_Misc
+Miscellaneous kinds of objects which don't fit into any of the above.
+@end table
+
+ These types are the first-class citizens of an internal type system.
+Since the tag space is limited, all other types are the subtypes of either
+@code{Lisp_Vectorlike} or @code{Lisp_Misc}. Vector subtypes are enumerated
+by @code{enum pvec_type}, and nearly all complex objects like windows, buffers,
+frames, and processes fall into this category. The rest of special types,
+including markers and overlays, are enumerated by @code{enum Lisp_Misc_Type}
+and form the set of subtypes of @code{Lisp_Misc}.
+
+ Below there is a description of a few subtypes of @code{Lisp_Vectorlike}.
+Buffer object represents the text to display and edit. Window is the part
+of display structure which shows the buffer or used as a container to
+recursively place other windows on the same frame. (Do not confuse Emacs Lisp
+window object with the window as an entity managed by the user interface
+system like X; in Emacs terminology, the latter is called frame.) Finally,
+process object is used to manage the subprocesses.
@menu
* Buffer Internals:: Components of a buffer structure.
@table @code
@item header
-A @code{struct vectorlike_header} structure where @code{header.next}
-points to the next buffer, in the chain of all buffers (including
-killed buffers). This chain is used only for garbage collection, in
-order to collect killed buffers properly. Note that vectors, and most
-kinds of objects allocated as vectors, are all on one chain, but
-buffers are on a separate chain of their own.
+A header of type @code{struct vectorlike_header} is common to all
+vectorlike objects.
@item own_text
A @code{struct buffer_text} structure that ordinarily holds the buffer
ordinary buffer, this is the @code{own_text} field above. In an
indirect buffer, this is the @code{own_text} field of the base buffer.
+@item next
+A pointer to the next buffer, in the chain of all buffers, including
+killed buffers. This chain is used only for allocation and garbage
+collection, in order to collect killed buffers properly.
+
@item pt
@itemx pt_byte
The character and byte positions of point in a buffer.
@end table
+@node C Integer Types
+@section C Integer Types
+@cindex integer types (C programming language)
+
+Here are some guidelines for use of integer types in the Emacs C
+source code. These guidelines sometimes give competing advice; common
+sense is advised.
+
+@itemize @bullet
+@item
+Avoid arbitrary limits. For example, avoid @code{int len = strlen
+(s);} unless the length of @code{s} is required for other reasons to
+fit in @code{int} range.
+
+@item
+Do not assume that signed integer arithmetic wraps around on overflow.
+This is no longer true of Emacs porting targets: signed integer
+overflow has undefined behavior in practice, and can dump core or
+even cause earlier or later code to behave ``illogically''. Unsigned
+overflow does wrap around reliably, modulo a power of two.
+
+@item
+Prefer signed types to unsigned, as code gets confusing when signed
+and unsigned types are combined. Many other guidelines assume that
+types are signed; in the rarer cases where unsigned types are needed,
+similar advice may apply to the unsigned counterparts (e.g.,
+@code{size_t} instead of @code{ptrdiff_t}, or @code{uintptr_t} instead
+of @code{intptr_t}).
+
+@item
+Prefer @code{int} for Emacs character codes, in the range 0 ..@: 0x3FFFFF.
+
+@item
+Prefer @code{ptrdiff_t} for sizes, i.e., for integers bounded by the
+maximum size of any individual C object or by the maximum number of
+elements in any C array. This is part of Emacs's general preference
+for signed types. Using @code{ptrdiff_t} limits objects to
+@code{PTRDIFF_MAX} bytes, but larger objects would cause trouble
+anyway since they would break pointer subtraction, so this does not
+impose an arbitrary limit.
+
+@item
+Prefer @code{intptr_t} for internal representations of pointers, or
+for integers bounded only by the number of objects that can exist at
+any given time or by the total number of bytes that can be allocated.
+Currently Emacs sometimes uses other types when @code{intptr_t} would
+be better; fixing this is lower priority, as the code works as-is on
+Emacs's current porting targets.
+
+@item
+Prefer the Emacs-defined type @code{EMACS_INT} for representing values
+converted to or from Emacs Lisp fixnums, as fixnum arithmetic is based
+on @code{EMACS_INT}.
+
+@item
+When representing a system value (such as a file size or a count of
+seconds since the Epoch), prefer the corresponding system type (e.g.,
+@code{off_t}, @code{time_t}). Do not assume that a system type is
+signed, unless this assumption is known to be safe. For example,
+although @code{off_t} is always signed, @code{time_t} need not be.
+
+@item
+Prefer the Emacs-defined type @code{printmax_t} for representing
+values that might be any signed integer value that can be printed,
+using a @code{printf}-family function.
+
+@item
+Prefer @code{intmax_t} for representing values that might be any
+signed integer value.
+
+@item
+In bitfields, prefer @code{unsigned int} or @code{signed int} to
+@code{int}, as @code{int} is less portable: it might be signed, and
+might not be. Single-bit bit fields are invariably @code{unsigned
+int} so that their values are 0 and 1.
+
+@item
+In C, Emacs commonly uses @code{bool}, 1, and 0 for boolean values.
+Using @code{bool} for booleans can make programs easier to read and a
+bit faster than using @code{int}. Although it is also OK to use
+@code{int}, this older style is gradually being phased out. When
+using @code{bool}, respect the limitations of the replacement
+implementation of @code{bool}, as documented in the source file
+@file{lib/stdbool.in.h}, so that Emacs remains portable to pre-C99
+platforms.
+@end itemize
+
@c FIXME Mention src/globals.h somewhere in this file?
(defun idlwave-complete-filename ()
"Use the comint stuff to complete a file name."
(require 'comint)
- (let* ((comint-file-name-chars "~/A-Za-z0-9+@:_.$#%=@{@}\\-")
+ (let* ((comint-file-name-chars "~/A-Za-z0-9+@@:_.$#%=@{@}\\-")
(comint-completion-addsuffix nil)
...)
(comint-dynamic-complete-filename)))
The value may be a floating point number.
@end defun
+@defun group-gid
+This function returns the effective @acronym{GID} of the Emacs process.
+The value may be a floating point number.
+@end defun
+
+@defun group-real-gid
+This function returns the real @acronym{GID} of the Emacs process.
+The value may be a floating point number.
+@end defun
+
@defun system-users
This function returns a list of strings, listing the user names on the
system. If Emacs cannot retrieve this information, the return value
The supported keywords and values are as follows:
@table @code
+@item :bus @var{bus}
+The D-Bus bus. This argument is needed only if a bus other than
+@code{:session} shall be used.
+
@item :title @var{title}
The notification title.
@item :body @var{text}
The notification body text. Depending on the implementation of the
notification server, the text could contain HTML markups, like
-@samp{"<b>bold text</b>"}, hyperlinks, or images.
+@samp{"<b>bold text</b>"}, hyperlinks, or images. Special HTML
+characters must be encoded, as @samp{"Contact
+<postmaster@@localhost>!"}.
@item :app-name @var{name}
The name of the application sending the notification. The default is
interpreted as icon name.
@item :category @var{category}
-The type of notification this is, a string.
+The type of notification this is, a string. See the
+@uref{http://developer.gnome.org/notification-spec/#categories,
+Desktop Notifications Specification} for a list of standard
+categories.
@item :desktop-entry @var{filename}
This specifies the name of the desktop filename representing the
@end example
@end defun
-@defun notifications-close-notification id
+@defun notifications-close-notification id &optional bus
This function closes a notification with identifier @var{id}.
+@var{bus} can be a string denoting a D-Bus connection, the default is
+@code{:session}.
@end defun
-@defun notifications-get-capabilities
-Returns the capabilities of the notification server, a list of strings.
-The following capabilities can be expected:
+@defun notifications-get-capabilities &optional bus
+Returns the capabilities of the notification server, a list of
+symbols. @var{bus} can be a string denoting a D-Bus connection, the
+default is @code{:session}. The following capabilities can be
+expected:
@table @code
@item :actions
@code{:x-gnome-foo-cap}.
@end defun
+@defun notifications-get-server-information &optional bus
+Return information on the notification server, a list of strings.
+@var{bus} can be a string denoting a D-Bus connection, the default is
+@code{:session}. The returned list is @code{(@var{name} @var{vendor}
+@var{version} @var{spec-version})}.
+
+@table @var
+@item name
+The product name of the server.
+
+@item vendor
+The vendor name. For example, @samp{"KDE"}, @samp{"GNOME"}.
+
+@item version
+The server's version number.
+
+@item spec-version
+The specification version the server is compliant with.
+@end table
+
+If @var{SPEC_VERSION} is @code{nil}, the server supports a
+specification prior to @samp{"1.0"}.
+@end defun
+
@node Dynamic Libraries
@section Dynamically Loaded Libraries
Safety}) as well as for byte compiler optimizations. Do not set it.
@item variable-documentation
-If non-@code{nil}, this specifies the named vaariable's documentation
+If non-@code{nil}, this specifies the named variable's documentation
string. This is set automatically by @code{defvar} and related
functions. @xref{Defining Faces}.
@end table
;; Created: 14 Jul 2010
@group
;; Keywords: languages
+;; Homepage: http://example.com/foo
;; This file is not part of GNU Emacs.
@item Author
This line states the name and email address of at least the principal
author of the library. If there are multiple authors, list them on
-continuation lines led by @code{;;} and whitespace (this is easier
-for tools to parse than having more than one author on one line).
+continuation lines led by @code{;;} and a tab or at least two spaces.
We recommend including a contact email address, of the form
@samp{<@dots{}>}. For example:
the place to write arbitrary keywords that describe their package,
rather than just the relevant Finder keywords.
+@item Homepage
+This line states the homepage of the library.
+
@item Package-Version
If @samp{Version} is not suitable for use by the package manager, then
a package can define @samp{Package-Version}; it will be used instead.
@end smallexample
@noindent
-This can be counterintutive, in particular if @var{W4} were used for
+This can be counterintuitive, in particular if @var{W4} were used for
displaying a buffer only temporarily (@pxref{Temporary Displays}), and
you want to continue working with the initial layout.
@code{switch-to-prev-buffer} (@pxref{Window History}) to show some other
buffer instead.
-The optional argument @var{bury-or-kill} specifes how to deal with
+The optional argument @var{bury-or-kill} specifies how to deal with
@var{window}'s buffer. The following values are handled:
@table @code
+2012-12-02 Kevin Ryde <user42@zip.com.au>
+
+ * etags.1: Mention effect of --declarations in Lisp.
+
2012-06-03 Glenn Morris <rgm@gnu.org>
* rcs-checkin.1: Remove.
.\" See section COPYING for copyright and redistribution information.
-.TH EMACS 1 "2007 April 13" "GNU Emacs 24.2.91"
+.TH EMACS 1 "2007 April 13" "GNU Emacs 24.3.50"
.
.
.SH NAME
.B \-\-declarations
In C and derived languages, create tags for function declarations,
and create tags for extern variables unless \-\-no\-globals is used.
+In Lisp, create tags for (defvar foo) declarations.
.TP
.B \-D, \-\-no\-defines
Do not create tag entries for C preprocessor constant definitions
-2013-01-08 Bastien Guerry <bzg@gnu.org>
+2013-01-09 Bastien Guerry <bzg@gnu.org>
* org.texi (Pushing to MobileOrg): Add footnote about using
symbolic links in `org-directory'.
`org-mark-subtree'.
(Tag inheritance): Document `org-agenda-use-tag-inheritance'.
+2013-01-08 Juri Linkov <juri@jurta.org>
+
+ * info.texi (Go to node): Mention the abbreviated format
+ `(FILENAME)' equal to `(FILENAME)Top'. (Bug#13365)
+
2013-01-06 Andreas Schwab <schwab@linux-m68k.org>
* autotype.texi: Remove undefined command @subtitlefont.
* htmlfontify.texi: New file.
-2012-12-22 Glenn Morris <rgm@gnu.org>
+2013-01-02 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc.texi (Free-Form Dates): Expand on the date reading
+ algorithm.
+
+2012-12-27 Glenn Morris <rgm@gnu.org>
* viper.texi (Rudimentary Changes, Key Bindings, Key Bindings):
Avoid some overfull lines.
* Makefile.in (gfdl): New variable. Use throughout where
appropriate so that targets depend on doclicense.texi.
+2012-12-25 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnus.texi (Customizing the IMAP Connection): Mention the other
+ authenticators.
+
+2012-12-24 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnus.texi (Browse Foreign Server): Document
+ `gnus-browse-delete-group'.
+
+2012-12-22 Glenn Morris <rgm@gnu.org>
+
+ * ada-mode.texi, ebrowse.texi, ediff.texi, ert.texi, eshell.texi:
+ * eudc.texi, idlwave.texi, pcl-cvs.texi, rcirc.texi, reftex.texi:
+ * remember.texi, ses.texi, speedbar.texi, vip.texi, viper.texi:
+ * widget.texi, wisent.texi: Nuke hand-written node pointers.
+
+ * Makefile.in (gfdl): New variable. Use throughout where
+ appropriate so that targets depend on doclicense.texi.
+
2012-12-22 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in ($(INFO_TARGETS), $(DVI_TARGETS)): Depend on
doclicense.texi. Remove doclicense.texi from all targets that
mentioned it explicitly.
+ ($(infodir)/woman$(INFO_EXT), woman.dvi): Depend on
+ $(emacsdir)/emacsver.texi.
+ ($(infodir)/erc$(INFO_EXT), erc.dvi): Don't depend on gpl.texi.
2012-12-21 Glenn Morris <rgm@gnu.org>
+ * woman.texi (UPDATED, VERSION): Remove in favor of EMACSVER.
+ Include emacsver.texi. Nuke hand-written node pointers.
+ * Makefile.in ($(buildinfodir)/woman$(INFO_EXT), woman.dvi, woman.pdf):
+ Depend on emacsver.texi.
+
* auth.texi, emacs-gnutls.texi, epa.texi, ert.texi:
* gnus-coding.texi, info.texi, nxml-mode.texi, sasl.texi:
May as well just include doclicense.texi in everything.
* erc.texi: No need to include gpl in this small manual.
-2012-12-14 Glenn Morris <rgm@gnu.org>
-
* org.texi (copying): Include a copy of the GFDL.
(GNU Free Documentation License): New section.
-2012-12-13 Bastien Guerry <bzg@gnu.org>
+2012-12-21 Bastien Guerry <bzg@gnu.org>
* org.texi: Fix typos.
+2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * calc.texi (ISO 8601): Rename from ISO-8601,
+ as it's typically spelled without a hyphen.
+
+2012-12-16 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc.texi (ISO-8601): New section.
+ (Date Formatting Codes): Mention new codes.
+ (Standard Date Formats): Mention new formats.
+
+2012-12-14 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (External methods): Move `adb' method here.
+
2012-12-13 Glenn Morris <rgm@gnu.org>
+ * cl.texi (Modify Macros, Obsolete Macros): Now letf == cl-letf.
+
* wisent.texi: Small edits. Set copyright to FSF, update license to
GFDL 1.3+.
* Makefile.in (INFO_TARGETS, DVI_TARGETS, PDF_TARGETS): Add wisent.
* bovine.texi, wisent.texi: New files, imported from CEDET trunk.
-2012-12-12 Glenn Morris <rgm@gnu.org>
+2012-12-13 Glenn Morris <rgm@gnu.org>
* flymake.texi (Customizable variables, Locating the buildfile):
Remove refs to flymake-buildfile-dirs, removed 2007-07-20. (Bug#13148)
* makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add srecode.
($(infodir)/srecode$(INFO_EXT), srecode.dvi): New targets.
-2012-12-12 Eric Ludlam <zappo@gnu.org>
+2012-12-13 Eric Ludlam <zappo@gnu.org>
* srecode.texi: New file, imported from CEDET trunk.
-2012-12-12 Bastien Guerry <bzg@gnu.org>
+2012-12-13 Bastien Guerry <bzg@gnu.org>
* org.texi (Summary, Code block specific header arguments)
(Code block specific header arguments)
(Header arguments in function calls, var, noweb)
- (Results of evaluation, Code evaluation security): Small
- reformatting: add a blank line before some example.
+ (Results of evaluation, Code evaluation security):
+ Small reformatting: add a blank line before some example.
* org.texi (System-wide header arguments)
(Header arguments in Org mode properties, Conflicts)
- (Dynamic blocks, Using the mapping API): Fix indendation of
- Elisp code examples.
+ (Dynamic blocks, Using the mapping API):
+ Fix indentation of Elisp code examples.
* org.texi (Comment lines): Fix description of the comment syntax.
- * org.texi (Installation): Mention "make test" in the correct
- section.
+ * org.texi (Installation): Mention "make test" in the correct section.
+
+2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
-2012-12-02 Michael Albinus <michael.albinus@gmx.de>
+ * doclicense.texi, gpl.texi: Update to latest version from FSF.
+ These are just minor editorial changes.
+
+2012-12-04 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (History): Mention ADB.
+ (Inline methods): Add `adb' method.
+
+2012-12-03 Michael Albinus <michael.albinus@gmx.de>
* tramp.texi (Top, Obtaining Tramp): Replace CVS by Git.
(External methods): Fix typo.
-2012-11-30 Glenn Morris <rgm@gnu.org>
+2012-12-03 Glenn Morris <rgm@gnu.org>
* rcirc.texi (Notices): Fix typo.
-2012-11-20 Michael Albinus <michael.albinus@gmx.de>
+2012-11-25 Bill Wohler <wohler@newt.com>
+
+ Release MH-E manual version 8.4.
+
+ * mh-e.texi: (VERSION, EDITION, UPDATED, UPDATE-MONTH, Preface):
+ Update for release 8.4.
+
+ * mh-e.texi (Sequences): Add mh-whitelist-preserves-sequences-flag.
+ (Junk): Add mh-whitelist-preserves-sequences-flag,
+ mh-blacklist-msg-hook, mh-whitelist-msg-hook,
+ mh-folder-blacklisted, mh-folder-whitelisted (closes SF #2945712).
+
+2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * mh-e.texi (Procmail): Fix two @ typos.
+
+2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doclicense.texi, gpl.texi: Update to latest version from FSF.
+ These are just minor editorial changes.
+
+2012-11-23 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc.texi (Date Formatting Codes): Mention the new beginning of
+ the date numbering system.
+
+2012-11-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * calc.texi: Fix TeX issues with capitals followed by ".", "?", "!".
+ (Date Forms): Correct off-by-one error in explanation of
+ Julian day numbers. Give Gregorian equivalent of its origin.
+
+2012-11-22 Jay Belanger <jay.p.belanger@gmail.com>
- * trampver.texi: Downgrade version to 2.2.6-24.3, in order to
- distinguish from trunk.
+ * doc/misc/calc.texi (Date Forms): Mention the customizable
+ Gregorian-Julian switch.
+ (Customizing Calc): Mention the variable `calc-gregorian-switch'.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Calc now uses the Gregorian calendar for all dates (Bug#12633).
+ It also uses January 1, 1 AD as its day number 1.
+ * calc.texi (Date Forms): Document this.
2012-11-16 Glenn Morris <rgm@gnu.org>
* cl.texi (Function Bindings): Clarify that cl-flet is lexical.
(Obsolete Macros): Move example here from Function Bindings.
-2012-11-13 Glenn Morris <rgm@gnu.org>
-
* erc.texi: Use @code{nil} rather than just "nil".
(Modules): Undocument obsolete "hecomplete".
Add "notifications".
(Connecting): Add brief section on passwords.
(Options): Make a start by adding erc-hide-list, erc-lurker-hide-list.
-2012-11-12 Glenn Morris <rgm@gnu.org>
+2012-11-13 Glenn Morris <rgm@gnu.org>
* flymake.texi (Customizable variables)
(Highlighting erroneous lines): Mention flymake-error-bitmap,
flymake-warning-bitmap, and flymake-fringe-indicator-position.
-2012-11-09 Chong Yidong <cyd@gnu.org>
+2012-11-12 Vincent Belaïche <vincentb1@users.sourceforge.net>
+
+ * ses.texi: Doc for ses-rename-cell, ses-repair-cell-reference-all & ses-range.
+ In all file place SES into @acronym{...}.
+ (Advanced Features): Add key index and function index for
+ ses-set-header-row. Add description for function
+ ses-rename-cell. Add description for function
+ ses-repair-cell-reference-all.
+ (Ranges in formulas): Add description for ses-range flags.
+
+2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * texinfo.tex: Merge from gnulib.
+
+2012-11-10 Chong Yidong <cyd@gnu.org>
* url.texi (Introduction): Move url-configuration-directory to
Customization node.
Improve docs for url-queue-*.
(Supported URL Types): Copyedits. Delete empty subnodes.
-2012-11-08 Chong Yidong <cyd@gnu.org>
-
* url.texi (Introduction): Rename from Getting Started. Rewrite
the introduction.
(URI Parsing): Rewrite. Omit the obsolete attributes slot.
-2012-11-07 Glenn Morris <rgm@gnu.org>
+2012-11-10 Glenn Morris <rgm@gnu.org>
* cl.texi (Obsolete Setf Customization):
Revert defsetf example to the more correct let rather than prog1.
Give define-modify-macro, defsetf, and define-setf-method
gv.el replacements.
-2012-11-06 Glenn Morris <rgm@gnu.org>
-
* cl.texi (Overview): Mention EIEIO here, as well as the appendix.
(Setf Extensions): Remove obsolete reference.
(Obsolete Setf Customization):
(Compiler Optimizations): Rename from "Optimizing Compiler"; reword.
(Creating Symbols, Random Numbers): De-emphasize internal
variables cl--gensym-counter and cl--random-state. (Bug#12788)
+ (Naming Conventions, Type Predicates, Macros)
+ (Predicates on Numbers): No longer mention cl-floatp-safe.
-2012-11-02 Glenn Morris <rgm@gnu.org>
+2012-11-02 Katsumi Yamaoka <yamaoka@jpl.org>
- * cl.texi (Naming Conventions, Type Predicates, Macros)
- (Predicates on Numbers): No longer mention cl-floatp-safe.
+ * gnus.texi (Mail Source Specifiers):
+ Document :leave keyword used for pop mail source.
2012-11-01 Glenn Morris <rgm@gnu.org>
## Where the output files go.
buildinfodir = $(srcdir)/../../info
## Directory with emacsver.texi.
-## Currently only used by efaq and calc.
emacsdir = $(srcdir)/../emacs
MKDIR_P = @MKDIR_P@
$(ENVADD) $(TEXI2PDF) ${srcdir}/wisent.texi
woman : $(buildinfodir)/woman$(INFO_EXT)
-$(buildinfodir)/woman$(INFO_EXT): ${srcdir}/woman.texi ${gfdl}
+$(buildinfodir)/woman$(INFO_EXT): ${srcdir}/woman.texi $(emacsdir)/emacsver.texi ${gfdl}
$(mkinfodir)
$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/woman.texi
-woman.dvi: ${srcdir}/woman.texi ${gfdl}
+woman.dvi: ${srcdir}/woman.texi $(emacsdir)/emacsver.texi ${gfdl}
$(ENVADD) $(TEXI2DVI) ${srcdir}/woman.texi
-woman.pdf: ${srcdir}/woman.texi ${gfdl}
+woman.pdf: ${srcdir}/woman.texi $(emacsdir)/emacsver.texi ${gfdl}
$(ENVADD) $(TEXI2PDF) ${srcdir}/woman.texi
@contents
-@node Top, Overview, (dir), (dir)
+@node Top
@top Ada Mode
@ifnottex
@end menu
-@node Overview, Installation, Top, Top
+@node Overview
@chapter Overview
The Emacs mode for programming in Ada helps the user in understanding
See the Emacs info manual, section 'Running Debuggers Under Emacs',
for general information on debugging.
-@node Installation, Customization, Overview, Top
+@node Installation
@chapter Installation
Ada mode is part of the standard Emacs distribution; if you use that,
@end itemize
-@node Customization, Compiling Executing, Installation, Top
+@node Customization
@chapter Customizing Ada mode
Here we assume you are familiar with setting variables in Emacs,
* Other customization::
@end menu
-@node Non-standard file names, Other compiler, Customization, Customization
+@node Non-standard file names
@section Non-standard file names
By default, Ada mode is configured to use the GNAT file naming
is beyond the scope of this manual; see the current definitions in
@file{ada-mode.el} and @file{ada-xref.el} for examples.
-@node Other compiler, Other customization, Non-standard file names, Customization
+@node Other compiler
@section Other compiler
By default, Ada mode is configured to use the Gnu Ada compiler GNAT.
Ada mode project files. See @ref{Project file variables} for the list
of project variables, and the corresponding lisp variables.
-@node Other customization, , Other compiler, Customization
+@node Other customization
@section Other customization
All user-settable Ada mode variables can be set via the menu
(setq variable-name value)
@end example
-@node Compiling Executing, Project files, Customization, Top
+@node Compiling Executing
@chapter Compiling Executing
Ada projects can be compiled, linked, and executed using commands on
* Compiler errors::
@end menu
-@node Compile commands, Compiler errors, Compiling Executing, Compiling Executing
+@node Compile commands
@section Compile commands
Here are the commands for building and using an Ada project, as
@end enumerate
-@node Compiler errors, , Compile commands, Compiling Executing
+@node Compiler errors
@section Compiler errors
The @code{Check file}, @code{Compile file}, and @code{Build} commands
references are also clickable in the same way, or put point after the
line number and press @key{RET}.
-@node Project files, Compiling Examples, Compiling Executing, Top
+@node Project files
@chapter Project files
An Emacs Ada mode project file specifies what directories hold sources
* Project file variables::
@end menu
-@node Project File Overview, GUI Editor, Project files, Project files
+@node Project File Overview
@section Project File Overview
Project files have a simple syntax; they may be edited directly. Each
project file. Any other extension is treated as an Emacs Ada mode
project file.
-@node GUI Editor, Project file variables, Project File Overview, Project files
+@node GUI Editor
@section GUI Editor
The project file editor is invoked with the menu @samp{Ada | Projects
buffer, or the @kbd{C-x C-s} binding. To cancel your modifications,
kill the buffer or click on the @samp{[cancel]} button.
-@node Project file variables, , GUI Editor, Project files
+@node Project file variables
@section Project file variables
The following variables can be defined in a project file; some can
@end table
-@node Compiling Examples, Moving Through Ada Code, Project files, Top
+@node Compiling Examples
@chapter Compiling Examples
We present several small projects, and walk thru the process of
* Use multiple GNAT project files::
@end menu
-@node No project files, Set compiler options, Compiling Examples, Compiling Examples
+@node No project files
@section No project files
This example uses no project files.
@end enumerate
-@node Set compiler options, Set source search path, No project files, Compiling Examples
+@node Set compiler options
@section Set compiler options
This example illustrates using an Emacs Ada mode project file to set a
Fixing the error, linking and running the code proceed as in @ref{No
project files}.
-@node Set source search path, Use GNAT project file, Set compiler options, Compiling Examples
+@node Set source search path
@section Set source search path
In this example, we show how to deal with files in more than one
Fixing the error, linking and running the code proceed as in @ref{No
project files}.
-@node Use GNAT project file, Use multiple GNAT project files, Set source search path, Compiling Examples
+@node Use GNAT project file
@section Use GNAT project file
In this example, we show how to use a GNAT project file, with no Ada
Fixing the error, linking and running the code proceed as in @ref{No
project files}.
-@node Use multiple GNAT project files, , Use GNAT project file, Compiling Examples
+@node Use multiple GNAT project files
@section Use multiple GNAT project files
In this example, we show how to use multiple GNAT project files,
demonstrating that @file{hello_5.gpr} and @file{hello_4.gpr} are being
used to set the compilation search path.
-@node Moving Through Ada Code, Identifier completion, Compiling Examples, Top
+@node Moving Through Ada Code
@chapter Moving Through Ada Code
There are several easy to use commands to navigate through Ada code. All
will try to run GNAT for you whenever cross-reference information is
needed, and is older than the current source file.
-@node Identifier completion, Automatic Smart Indentation, Moving Through Ada Code, Top
+@node Identifier completion
@chapter Identifier completion
Emacs and Ada mode provide two general ways for the completion of
Complete identifier using buffer information (not Ada-specific).
@end table
-@node Automatic Smart Indentation, Formatting Parameter Lists, Identifier completion, Top
+@node Automatic Smart Indentation
@chapter Automatic Smart Indentation
Ada mode comes with a full set of rules for automatic indentation. You
indentation.
@end table
-@node Formatting Parameter Lists, Automatic Casing, Automatic Smart Indentation, Top
+@node Formatting Parameter Lists
@chapter Formatting Parameter Lists
@table @kbd
argument names and argument types, and aligns the @code{in},
@code{out} and @code{in out} keywords.
-@node Automatic Casing, Statement Templates, Formatting Parameter Lists, Top
+@node Automatic Casing
@chapter Automatic Casing
Casing of identifiers, attributes and keywords is automatically
@code{ada-case-exception-file} (@code{ada-case-read-exceptions}).
@end table
-@node Statement Templates, Comment Handling, Automatic Casing, Top
+@node Statement Templates
@chapter Statement Templates
Templates are defined for most Ada statements, using the Emacs
type (@code{ada-type}).
@end table
-@node Comment Handling, GNU Free Documentation License, Statement Templates, Top
+@node Comment Handling
@chapter Comment Handling
By default, comment lines get indented like Ada code. There are a few
autofill the current comment.
@end table
-@node GNU Free Documentation License, Index, Comment Handling, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Index, , GNU Free Documentation License, Top
+@node Index
@unnumbered Index
@printindex fn
Friday the 13th? @xref{Types Answer 5, 5}. (@bullet{})
(@bullet{}) @strong{Exercise 6.} How many leap years will there be
-between now and the year 10001 A.D.? @xref{Types Answer 6, 6}. (@bullet{})
+between now and the year 10001 AD@? @xref{Types Answer 6, 6}. (@bullet{})
@cindex Slope and angle of a line
@cindex Angle and slope of a line
apply to any product-of-sum it encounters---this rule may surprise
you if you put it into @code{EvalRules}!
-In the second rule, the sum of two O's is changed to the smaller O.
+In the second rule, the sum of two O's is changed to the smaller O@.
The optional constant coefficients are there mostly so that
@samp{O(x^2) - O(x^3)} and @samp{O(x^3) - O(x^2)} are handled
as well as @samp{O(x^2) + O(x^3)}.
notations for dates and times. @xref{Date Formats}.
Date forms are stored internally as numbers, specifically the number
-of days since midnight on the morning of January 1 of the year 1 AD.
+of days since midnight on the morning of December 31 of the year 1 BC@.
If the internal number is an integer, the form represents a date only;
if the internal number is a fraction or float, the form represents
-a date and time. For example, @samp{<6:00am Wed Jan 9, 1991>}
+a date and time. For example, @samp{<6:00am Thu Jan 10, 1991>}
is represented by the number 726842.25. The standard precision of
12 decimal digits is enough to ensure that a (reasonable) date and
time can be stored without roundoff error.
of a date form. @xref{Packing and Unpacking}.
Date forms can go arbitrarily far into the future or past. Negative
-year numbers represent years BC@. Calc uses a combination of the
-Gregorian and Julian calendars, following the history of Great
-Britain and the British colonies. This is the same calendar that
-is used by the @code{cal} program in most Unix implementations.
+year numbers represent years BC@. There is no ``year 0''; the day
+before @samp{<Mon Jan 1, +1>} is @samp{<Sun Dec 31, -1>}. These are
+days 1 and 0 respectively in Calc's internal numbering scheme. The
+Gregorian calendar is used for all dates, including dates before the
+Gregorian calendar was invented (although that can be configured; see
+below). Thus Calc's use of the day number @mathit{-10000} to
+represent August 15, 28 BC should be taken with a grain of salt.
@cindex Julian calendar
@cindex Gregorian calendar
Some historical background: The Julian calendar was created by
-Julius Caesar in the year 46 BC as an attempt to fix the gradual
-drift caused by the lack of leap years in the calendar used
-until that time. The Julian calendar introduced an extra day in
-all years divisible by four. After some initial confusion, the
-calendar was adopted around the year we call 8 AD@. Some centuries
-later it became apparent that the Julian year of 365.25 days was
-itself not quite right. In 1582 Pope Gregory XIII introduced the
-Gregorian calendar, which added the new rule that years divisible
-by 100, but not by 400, were not to be considered leap years
-despite being divisible by four. Many countries delayed adoption
-of the Gregorian calendar because of religious differences;
-in Britain it was put off until the year 1752, by which time
-the Julian calendar had fallen eleven days behind the true
-seasons. So the switch to the Gregorian calendar in early
-September 1752 introduced a discontinuity: The day after
-Sep 2, 1752 is Sep 14, 1752. Calc follows this convention.
-To take another example, Russia waited until 1918 before
-adopting the new calendar, and thus needed to remove thirteen
-days (between Feb 1, 1918 and Feb 14, 1918). This means that
-Calc's reckoning will be inconsistent with Russian history between
-1752 and 1918, and similarly for various other countries.
-
-Today's timekeepers introduce an occasional ``leap second'' as
-well, but Calc does not take these minor effects into account.
-(If it did, it would have to report a non-integer number of days
-between, say, @samp{<12:00am Mon Jan 1, 1900>} and
+Julius Caesar in the year 46 BC as an attempt to fix the confusion
+caused by the irregular Roman calendar that was used before that time.
+The Julian calendar introduced an extra day in all years divisible by
+four. After some initial confusion, the calendar was adopted around
+the year we call 8 AD@. Some centuries later it became
+apparent that the Julian year of 365.25 days was itself not quite
+right. In 1582 Pope Gregory XIII introduced the Gregorian calendar,
+which added the new rule that years divisible by 100, but not by 400,
+were not to be considered leap years despite being divisible by four.
+Many countries delayed adoption of the Gregorian calendar
+because of religious differences. For example, Great Britain and the
+British colonies switched to the Gregorian calendar in September
+1752, when the Julian calendar was eleven days behind the
+Gregorian calendar. That year in Britain, the day after September 2
+was September 14. To take another example, Russia did not adopt the
+Gregorian calendar until 1918, and that year in Russia the day after
+January 31 was February 14. Calc's reckoning therefore matches English
+practice starting in 1752 and Russian practice starting in 1918, but
+disagrees with earlier dates in both countries.
+
+When the Julian calendar was introduced, it had January 1 as the first
+day of the year. By the Middle Ages, many European countries
+had changed the beginning of a new year to a different date, often to
+a religious festival. Almost all countries reverted to using January 1
+as the beginning of the year by the time they adopted the Gregorian
+calendar.
+
+Some calendars attempt to mimic the historical situation by using the
+Gregorian calendar for recent dates and the Julian calendar for older
+dates. The @code{cal} program in most Unix implementations does this,
+for example. While January 1 wasn't always the beginning of a calendar
+year, these hybrid calendars still use January 1 as the beginning of
+the year even for older dates. The customizable variable
+@code{calc-gregorian-switch} (@pxref{Customizing Calc}) can be set to
+have Calc's date forms switch from the Julian to Gregorian calendar at
+any specified date.
+
+Today's timekeepers introduce an occasional ``leap second''.
+These do not occur regularly and Calc does not take these minor
+effects into account. (If it did, it would have to report a
+non-integer number of days between, say,
+@samp{<12:00am Mon Jan 1, 1900>} and
@samp{<12:00am Sat Jan 1, 2000>}.)
-Calc uses the Julian calendar for all dates before the year 1752,
-including dates BC when the Julian calendar technically had not
-yet been invented. Thus the claim that day number @mathit{-10000} is
-called ``August 16, 28 BC'' should be taken with a grain of salt.
-
-Please note that there is no ``year 0''; the day before
-@samp{<Sat Jan 1, +1>} is @samp{<Fri Dec 31, -1>}. These are
-days 0 and @mathit{-1} respectively in Calc's internal numbering scheme.
-
@cindex Julian day counting
Another day counting system in common use is, confusingly, also called
-``Julian.'' The Julian day number is the numbers of days since
-12:00 noon (GMT) on Jan 1, 4713 BC, which in Calc's scheme (in GMT)
-is @mathit{-1721423.5} (recall that Calc starts at midnight instead
-of noon). Thus to convert a Calc date code obtained by unpacking a
-date form into a Julian day number, simply add 1721423.5 after
+``Julian.'' Julian days go from noon to noon. The Julian day number
+is the numbers of days since 12:00 noon (GMT) on November 24, 4714 BC
+in the Gregorian calendar (i.e., January 1, 4713 BC in the Julian
+calendar). In Calc's scheme (in GMT) the Julian day origin is
+@mathit{-1721422.5}, because Calc starts at midnight instead of noon.
+Thus to convert a Calc date code obtained by unpacking a
+date form into a Julian day number, simply add 1721422.5 after
compensating for the time zone difference. The built-in @kbd{t J}
command performs this conversion for you.
up by other astronomers. (At the time, noon was the start of the
astronomical day. Herschel originally suggested counting the days
since Jan 1, 4713 BC at noon Alexandria time; this was later amended to
-noon GMT.) Julian day numbering is largely used in astronomy.
+noon GMT@.) Julian day numbering is largely used in astronomy.
@cindex Unix time format
The Unix operating system measures time as an integer number of
functions, your date formats should avoid using the @samp{#} character.
@menu
+* ISO 8601::
* Date Formatting Codes::
* Free-Form Dates::
* Standard Date Formats::
@end menu
-@node Date Formatting Codes, Free-Form Dates, Date Formats, Date Formats
+@node ISO 8601, Date Formatting Codes, Date Formats, Date Formats
+@subsubsection ISO 8601
+
+@noindent
+@cindex ISO 8601
+The same date can be written down in different formats and Calc tries
+to allow you to choose your preferred format. Some common formats are
+ambiguous, however; for example, 10/11/2012 means October 11,
+2012 in the United States but it means November 10, 2012 in
+Europe. To help avoid such ambiguities, the International Organization
+for Standardization (ISO) provides the ISO 8601 standard, which
+provides three different but easily distinguishable and unambiguous
+ways to represent a date.
+
+The ISO 8601 calendar date representation is
+
+@example
+ @var{YYYY}-@var{MM}-@var{DD}
+@end example
+
+@noindent
+where @var{YYYY} is the four digit year, @var{MM} is the two-digit month
+number (01 for January to 12 for December), and @var{DD} is the
+two-digit day of the month (01 to 31). (Note that @var{YYYY} does not
+correspond to Calc's date formatting code, which will be introduced
+later.) The year, which should be padded with zeros to ensure it has at
+least four digits, is the Gregorian year, except that the year before
+0001 (1 AD) is the year 0000 (1 BC). The date October 11, 2012 is
+written 2012-10-11 in this representation and November 10, 2012 is
+written 2012-11-10.
+
+The ISO 8601 ordinal date representation is
+
+@example
+ @var{YYYY}-@var{DDD}
+@end example
+
+@noindent
+where @var{YYYY} is the year, as above, and @var{DDD} is the day of the year.
+The date December 31, 2011 is written 2011-365 in this representation
+and January 1, 2012 is written 2012-001.
+
+The ISO 8601 week date representation is
+
+@example
+ @var{YYYY}-W@var{ww}-@var{D}
+@end example
+
+@noindent
+where @var{YYYY} is the ISO week-numbering year, @var{ww} is the two
+digit week number (preceded by a literal ``W''), and @var{D} is the day
+of the week (1 for Monday through 7 for Sunday). The ISO week-numbering
+year is based on the Gregorian year but can differ slightly. The first
+week of an ISO week-numbering year is the week with the Gregorian year's
+first Thursday in it (equivalently, the week containing January 4);
+any day of that week (Monday through Sunday) is part of the same ISO
+week-numbering year, any day from the previous week is part of the
+previous year. For example, January 4, 2013 is on a Friday, and so
+the first week for the ISO week-numbering year 2013 starts on
+Monday, December 31, 2012. The day December 31, 2012 is then part of the
+Gregorian year 2012 but ISO week-numbering year 2013. In the week
+date representation, this week goes from 2013-W01-1 (December 31,
+2012) to 2013-W01-7 (January 6, 2013).
+
+All three ISO 8601 representations arrange the numbers from most
+significant to least significant; as well as being unambiguous
+representations, they are easy to sort since chronological order in
+this formats corresponds to lexicographical order. The hyphens are
+sometimes omitted.
+
+The ISO 8601 standard uses a 24 hour clock; a particular time is
+represented by @var{hh}:@var{mm}:@var{ss} where @var{hh} is the
+two-digit hour (from 00 to 24), @var{mm} is the two-digit minute (from
+00 to 59) and @var{ss} is the two-digit second. The seconds or minutes
+and seconds can be omitted, and decimals can be added. If a date with a
+time is represented, they should be separated by a literal ``T'', so noon
+on December 13, 2012 can be represented as 2012-12-13T12:00.
+
+@node Date Formatting Codes, Free-Form Dates, ISO 8601, Date Formats
@subsubsection Date Formatting Codes
@noindent
match exactly; letter fields must correspond to suitable text in
the input. If this doesn't work, Calc checks if the input is a
simple number; if so, the number is interpreted as a number of days
-since Jan 1, 1 AD@. Otherwise, Calc tries a much more relaxed and
+since Dec 31, 1 BC@. Otherwise, Calc tries a much more relaxed and
flexible algorithm which is described in the next section.
Weekday names are ignored during reading.
Year: ``1991'' for 1991, ``23'' for 23 AD.
@item YYYY
Year: ``1991'' for 1991, ``+23'' for 23 AD.
+@item ZYYY
+Year: ``1991'' for 1991, ``0023'' for 23 AD, ``0000'' for 1 BC.
+@item IYYY
+Year: ISO 8601 week-numbering year.
@item aa
Year: ``ad'' or blank.
@item AA
Day: `` 7'' for 7th day of month.
@item W
Weekday: ``0'' for Sunday, ``6'' for Saturday.
+@item w
+Weekday: ``1'' for Monday, ``7'' for Sunday.
@item WWW
Weekday: ``SUN'' for Sunday.
@item Www
Weekday: ``SUNDAY'' for Sunday.
@item Wwww
Weekday: ``Sunday'' for Sunday.
+@item Iww
+Week number: ISO 8601 week number, ``W01'' for week 1.
@item d
Day of year: ``34'' for Feb. 3.
@item ddd
Day of year: ``034'' for Feb. 3.
@item bdd
Day of year: `` 34'' for Feb. 3.
+@item T
+Letter: Literal ``T''.
@item h
Hour: ``5'' for 5 AM; ``17'' for 5 PM.
@item hh
@samp{p.m.}, and @samp{mid} are also understood. Obviously
@samp{noon} and @samp{midnight} are allowed only on 12:00:00.
The words @samp{noon}, @samp{mid}, and @samp{midnight} are also
-recognized with no number attached.
+recognized with no number attached. Midnight will represent the
+beginning of a day.
If there is no AM/PM indicator, the time is interpreted in 24-hour
format.
-To read the date portion, all words and numbers are isolated
-from the string; other characters are ignored. All words must
-be either month names or day-of-week names (the latter of which
-are ignored). Names can be written in full or as three-letter
+When reading the date portion, Calc first checks to see if it is an
+ISO 8601 week-numbering date; if the string contains an integer
+representing the year, a ``W'' followed by two digits for the week
+number, and an integer from 1 to 7 representing the weekday (in that
+order), then all other characters are ignored and this information
+determines the date. Otherwise, all words and numbers are isolated
+from the string; other characters are ignored. All words must be
+either month names or day-of-week names (the latter of which are
+ignored). Names can be written in full or as three-letter
abbreviations.
Large numbers, or numbers with @samp{+} or @samp{-} signs,
@samp{j<, h:mm:ss>} (Julian day plus time)
@item 9
@samp{YYddd< hh:mm:ss>} (Year-day format)
+@item 10
+@samp{ZYYY-MM-DD Www< hh:mm>} (Org mode format)
+@item 11
+@samp{IYYY-Iww-w<Thh:mm:ss>} (ISO 8601 week numbering format)
@end table
@node Truncating the Stack, Justification, Date Formats, Display Modes
be preserved. The default value of @code{calc-undo-length} is @expr{100}.
@end defvar
+@defvar calc-gregorian-switch
+See @ref{Date Forms}.@*
+The variable @code{calc-gregorian-switch} is either a list of integers
+@code{(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}.
+If it is @code{nil}, then Calc's date forms always represent Gregorian dates.
+Otherwise, @code{calc-gregorian-switch} represents the date that the
+calendar switches from Julian dates to Gregorian dates;
+@code{(@var{YEAR} @var{MONTH} @var{DAY})} will be the first Gregorian
+date. The customization buffer will offer several standard dates to
+choose from, or the user can enter their own date.
+
+The default value of @code{calc-gregorian-switch} is @code{nil}.
+@end defvar
+
@node Reporting Bugs, Summary, Customizing Calc, Top
@appendix Reporting Bugs
bound on entry, it is simply made unbound by @code{makunbound} or
@code{fmakunbound} on exit.
@end ignore
-
-Note that the @file{cl.el} version of this macro behaves slightly
-differently. @xref{Obsolete Macros}.
@end defmac
@defmac cl-letf* (bindings@dots{}) forms@dots{}
lexical binding that @code{cl-labels} uses.
@end defmac
-@defmac letf (bindings@dots{}) forms@dots{}
-This macro is almost exactly the same as @code{cl-letf}, which
-replaces it (@pxref{Modify Macros}). The only difference is in
-details that relate to some deprecated usage of @code{symbol-function}
-in place forms.
-@end defmac
-
@node Obsolete Setf Customization
@appendixsec Obsolete Ways to Customize Setf
-@c -*-texinfo-*-
@c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008
@c hence no sectioning command or @node.
@display
-Copyright @copyright{} 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
-@sc{ascii} without markup, Texinfo input format, La@TeX{} input
-format, @acronym{SGML} or @acronym{XML} using a publicly available
-@acronym{DTD}, and standard-conforming simple @acronym{HTML},
-PostScript or @acronym{PDF} designed for human modification. Examples
-of transparent image formats include @acronym{PNG}, @acronym{XCF} and
-@acronym{JPG}. Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, @acronym{SGML} or
-@acronym{XML} for which the @acronym{DTD} and/or processing tools are
-not generally available, and the machine-generated @acronym{HTML},
-PostScript or @acronym{PDF} produced by some word processors for
+ASCII without markup, Texinfo input format, La@TeX{} input
+format, SGML or XML using a publicly available
+DTD, and standard-conforming simple HTML,
+PostScript or PDF designed for human modification. Examples
+of transparent image formats include PNG, XCF and
+JPG@. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, SGML or
+XML for which the DTD and/or processing tools are
+not generally available, and the machine-generated HTML,
+PostScript or PDF produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with@dots{}Texts.'' line with this:
+replace the ``with@dots{}Texts.''@: line with this:
@smallexample
@group
free software license, such as the GNU General Public License,
to permit their use in free software.
-
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
@contents
@ifnottex
-@node Top, Overview, (dir), (dir)
+@node Top
@top Ebrowse
You can browse C++ class hierarchies from within Emacs by using
-@node Overview, Generating browser files, Top, Top
+@node Overview
@chapter Introduction
When working in software projects using C++, I frequently missed
-@node Generating browser files, Loading a Tree, Overview, Top
-@comment node-name, next, previous, up
+@node Generating browser files
@chapter Processing Source Files
@cindex @command{ebrowse}, the program
@comment name, next, prev, up
-@node Input files, Output file, Generating browser files, Generating browser files
+@node Input files
@section Specifying Input Files
@table @samp
@comment name, next, prev, up
-@node Output file, Structs and unions, Input files, Generating browser files
+@node Output file
@section Changing the Output File Name
@table @samp
@comment name, next, prev, up
-@node Structs and unions, Matching, Output file, Generating browser files
+@node Structs and unions
@section Structs and Unions
@cindex structs
@cindex unions
@comment name, next, prev, up
-@node Matching, Verbosity, Structs and unions, Generating browser files
+@node Matching
@section Regular Expressions
@cindex regular expressions, recording
-@node Verbosity, , Matching, Generating browser files
-@comment node-name, next, previous, up
+@node Verbosity
@section Verbose Mode
@cindex verbose operation
-@node Loading a Tree, Tree Buffers, Generating browser files, Top
-@comment node-name, next, previous, up
+@node Loading a Tree
@chapter Starting to Browse
@cindex loading
@cindex browsing
@comment ***
@comment ****************************************************************
-@node Tree Buffers, Member Buffers, Loading a Tree, Top
-@comment node-name, next, previous, up
+@node Tree Buffers
@chapter Tree Buffers
@cindex tree buffer mode
@cindex class trees
-@node Source Display, Member Display, Tree Buffers, Tree Buffers
-@comment node-name, next, previous, up
+@node Source Display
@section Viewing and Finding Class Declarations
@cindex viewing, class
@cindex finding a class
-@node Member Display, Go to Class, Source Display, Tree Buffers
-@comment node-name, next, previous, up
+@node Member Display
@section Displaying Members
@cindex @samp{*Members*} buffer
@cindex @samp{*Globals*}
-@node Go to Class, Quitting, Member Display, Tree Buffers
-@comment node-name, next, previous, up
+@node Go to Class
@section Finding a Class
@cindex locate class
@cindex expanding branches
-@node Quitting, File Name Display, Go to Class, Tree Buffers
-@comment node-name, next, previous, up
+@node Quitting
@section Burying a Tree Buffer
@cindex burying tree buffer
-@node File Name Display, Expanding and Collapsing, Quitting, Tree Buffers
-@comment node-name, next, previous, up
+@node File Name Display
@section Displaying File Names
@table @kbd
@end example
-@node Expanding and Collapsing, Tree Indentation, File Name Display, Tree Buffers
-@comment node-name, next, previous, up
+@node Expanding and Collapsing
@section Expanding and Collapsing a Tree
@cindex expand tree branch
@cindex collapse tree branch
-@node Tree Indentation, Killing Classes, Expanding and Collapsing, Tree Buffers
-@comment node-name, next, previous, up
+@node Tree Indentation
@section Changing the Tree Indentation
@cindex tree indentation
@cindex indentation of the tree
-@node Killing Classes, Saving a Tree, Tree Indentation, Tree Buffers
-@comment node-name, next, previous, up
+@node Killing Classes
@section Removing Classes from the Tree
@cindex killing classes
@cindex class, remove from tree
-@node Saving a Tree, Statistics, Killing Classes, Tree Buffers
-@comment node-name, next, previous, up
-@comment node-name, next, previous, up
+@node Saving a Tree
@section Saving a Tree
@cindex save tree to a file
@cindex tree, save to a file
-@node Statistics, Marking Classes, Saving a Tree, Tree Buffers
-@comment node-name, next, previous, up
+@node Statistics
+@section Statistics
@cindex statistics for a tree
@cindex tree statistics
@cindex class statistics
-@node Marking Classes, , Statistics, Tree Buffers
-@comment node-name, next, previous, up
+@node Marking Classes
+@section Marking Classes
@cindex marking classes
@cindex operations on marked classes
@c ***
@c ****************************************************************
-@node Member Buffers, Tags-like Functions, Tree Buffers, Top
-@comment node-name, next, previous, up
+@node Member Buffers
@chapter Member Buffers
@cindex members
@cindex member buffer mode
-@node Switching Member Lists, Finding/Viewing, Member Buffers, Member Buffers
-@comment node-name, next, previous, up
+@node Switching Member Lists
@section Switching Member Lists
@cindex member lists, in member buffers
@cindex static members
-@node Finding/Viewing, Inherited Members, Switching Member Lists, Member Buffers
-@comment node-name, next, previous, up
+@node Finding/Viewing
@section Finding and Viewing Member Source
@cindex finding members, in member buffers
@cindex viewing members, in member buffers
-@node Inherited Members, Searching Members, Finding/Viewing, Member Buffers
-@comment node-name, next, previous, up
+@node Inherited Members
@section Display of Inherited Members
@cindex superclasses, members
@cindex base classes, members
-@node Searching Members, Switching to Tree, Inherited Members, Member Buffers
-@comment node-name, next, previous, up
+@node Searching Members
@section Searching Members
@cindex searching members
-@node Switching to Tree, Filters, Searching Members, Member Buffers
-@comment node-name, next, previous, up
+@node Switching to Tree
@section Switching to Tree Buffer
@cindex tree buffer, switch to
@cindex buffer switching
-@node Filters, Attributes, Switching to Tree, Member Buffers
-@comment node-name, next, previous, up
+@node Filters
@section Filters
@cindex filters
-@node Attributes, Long and Short Display, Filters, Member Buffers
-@comment node-name, next, previous, up
+@node Attributes
@section Displaying Member Attributes
@cindex attributes
@cindex member attribute display
-@node Long and Short Display, Regexp Display, Attributes, Member Buffers
-@comment node-name, next, previous, up
+@node Long and Short Display
@section Long and Short Member Display
@cindex display form
@cindex long display
-@node Regexp Display, Switching Classes, Long and Short Display, Member Buffers
-@comment node-name, next, previous, up
+@node Regexp Display
@section Display of Regular Expressions
@cindex regular expression display
-@node Switching Classes, Killing/Burying, Regexp Display, Member Buffers
-@comment node-name, next, previous, up
+@node Switching Classes
@section Displaying Another Class
@cindex base class, display
@cindex derived class, display
-@node Killing/Burying, Column Width, Switching Classes, Member Buffers
-@comment node-name, next, previous, up
+@node Killing/Burying
@section Burying a Member Buffer
@cindex burying member buffers
-@node Column Width, Redisplay, Killing/Burying, Member Buffers
-@comment node-name, next, previous, up
+@node Column Width
@section Setting the Column Width
@cindex column width
@cindex member indentation
-@node Redisplay, Getting Help, Column Width, Member Buffers
-@comment node-name, next, previous, up
+@node Redisplay
@section Forced Redisplay
@cindex redisplay of member buffers
-@node Getting Help, , Redisplay, Member Buffers
-@comment node-name, next, previous, up
+@node Getting Help
+@section Getting Help
@cindex help
@table @kbd
@comment *** TAGS LIKE FUNCTIONS
@comment **************************************************************
-@node Tags-like Functions, GNU Free Documentation License, Member Buffers, Top
-@comment node-name, next, previous, up
+@node Tags-like Functions
@chapter Tags-like Functions
Ebrowse provides tags functions similar to those of the standard
-@node Finding and Viewing, Position Stack, Tags-like Functions, Tags-like Functions
-@comment node-name, next, previous, up
+@node Finding and Viewing
@section Finding and Viewing Members
@cindex finding class member, in C++ source
@cindex viewing class member, in C++ source
-@node Position Stack, Search & Replace, Finding and Viewing, Tags-like Functions
-@comment node-name, next, previous, up
+@node Position Stack
@section The Position Stack
@cindex position stack
-@node Search & Replace, Members in Files, Position Stack, Tags-like Functions
-@comment node-name, next, previous, up
+@node Search & Replace
@section Searching and Replacing
@cindex searching multiple C++ files
@cindex replacing in multiple C++ files
-@node Members in Files, Apropos, Search & Replace, Tags-like Functions
-@comment node-name, next, previous, up
+@node Members in Files
@section Members in Files
@cindex files
@cindex members in file, listing
-@node Apropos, Symbol Completion, Members in Files, Tags-like Functions
-@comment node-name, next, previous, up
+@node Apropos
@section Member Apropos
@cindex apropos on class members
@cindex members, matching regexp
-@node Symbol Completion, Member Buffer Display, Apropos, Tags-like Functions
-@comment node-name, next, previous, up
+@node Symbol Completion
@section Symbol Completion
@cindex completion
@cindex symbol completion
-@node Member Buffer Display, , Symbol Completion, Tags-like Functions
+@node Member Buffer Display
@section Quick Member Display
@cindex member buffer, for member at point
in on with the command @kbd{C-c C-m m}.
-@node GNU Free Documentation License, Concept Index, Tags-like Functions, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Concept Index, , GNU Free Documentation License, Top
+@node Concept Index
@unnumbered Concept Index
@printindex cp
@contents
-@node Top, Introduction, (dir), (dir)
+@node Top
@top Ediff
@insertcopying
* Index::
@end menu
-@node Introduction, Major Entry Points, Top, Top
+@node Introduction
@chapter Introduction
@cindex Comparing files and buffers
extends Emerge, much of the functionality in Ediff is influenced by Emerge.
The architecture and the interface are, of course, drastically different.
-@node Major Entry Points, Session Commands, Introduction, Top
+@node Major Entry Points
@chapter Major Entry Points
When Ediff starts up, it displays a small control window, which accepts the
related Ediff sessions by taking a directory and comparing (or merging)
versions of files in that directory.
-@node Session Commands, Registry of Ediff Sessions, Major Entry Points, Top
+@node Session Commands
@chapter Session Commands
All Ediff commands are displayed in a Quick Help window, unless you type
* Other Session Commands:: Commands that are not bound to keys.
@end menu
-@node Quick Help Commands,Other Session Commands,,Session Commands
+@node Quick Help Commands
@section Quick Help Commands
@cindex command help
@cindex important commands
@end table
-@node Other Session Commands,,Quick Help Commands,Session Commands
+@node Other Session Commands
@section Other Session Commands
The following commands can be invoked from within any Ediff session,
profiling of ediff commands.
@end table
-@node Registry of Ediff Sessions, Session Groups, Session Commands, Top
+@node Registry of Ediff Sessions
@chapter Registry of Ediff Sessions
Ediff maintains a registry of all its invocations that are
but you don't need to memorize them, since they are listed at the top of
the registry buffer.
-@node Session Groups, Remote and Compressed Files, Registry of Ediff Sessions, Top
+@node Session Groups
@chapter Session Groups
Several major entries of Ediff perform comparison and merging on
-@node Remote and Compressed Files, Customization, Session Groups, Top
+@node Remote and Compressed Files
@chapter Remote and Compressed Files
Ediff works with remote, compressed, and encrypted files. Ediff
of the patch is placed into the file source-name (@file{_orig} is used
on systems like DOS, etc.)
-@node Customization, Credits, Remote and Compressed Files, Top
+@node Customization
@chapter Customization
Ediff has a rather self-explanatory interface, and in most cases you
* Notes on Heavy-duty Customization:: Customization for the gurus.
@end menu
-@node Hooks, Quick Help Customization, Customization, Customization
+@node Hooks
@section Hooks
The bulk of customization can be done via the following hooks:
bindings for different kinds of meta buffers.
@end table
-@node Quick Help Customization, Window and Frame Configuration, Hooks, Customization
+@node Quick Help Customization
@section Quick Help Customization
@vindex ediff-use-long-help-message
@vindex ediff-control-buffer
the variable @code{ediff-help-message}, which is local to
@code{ediff-control-buffer}.
-@node Window and Frame Configuration, Selective Browsing, Quick Help Customization, Customization
+@node Window and Frame Configuration
@section Window and Frame Configuration
On a non-windowing display, Ediff sets things up in one frame, splitting
to another control panel. (Different control panel buffers are
distinguished by a numerical suffix, e.g., @samp{Ediff Control Panel<3>}.)
-@node Selective Browsing, Highlighting Difference Regions, Window and Frame Configuration, Customization
+@node Selective Browsing
@section Selective Browsing
Sometimes it is convenient to be able to step through only some difference
When case sensitivity is toggled, all difference
regions are recomputed.
-@node Highlighting Difference Regions, Narrowing, Selective Browsing, Customization
+@node Highlighting Difference Regions
@section Highlighting Difference Regions
The following variables control the way Ediff highlights difference
or @code{set/make-face-@dots{}} as shown above. Emacs's low-level
face-manipulation functions should be avoided.
-@node Narrowing, Refinement of Difference Regions, Highlighting Difference Regions, Customization
+@node Narrowing
@section Narrowing
If buffers being compared are narrowed at the time of invocation of
that existed before the current invocation.
@end table
-@node Refinement of Difference Regions, Patch and Diff Programs, Narrowing, Customization
+@node Refinement of Difference Regions
@section Refinement of Difference Regions
Ediff has variables to control the way fine differences are
different states: auto-refining, no-auto-refining, and no-highlighting
of fine differences.
-@node Patch and Diff Programs, Merging and diff3, Refinement of Difference Regions, Customization
+@node Patch and Diff Programs
@section Patch and Diff Programs
This section describes variables that specify the programs to be used for
@code{diff}. Instead, make sure you are using some implementation of POSIX
@code{diff}, such as @code{gnudiff}.
-@node Merging and diff3, Support for Version Control, Patch and Diff Programs, Customization
+@node Merging and diff3
@section Merging and diff3
Ediff supports three-way comparison via the functions @code{ediff-files3} and
specified by the variable @code{ediff-merge-filename-prefix}. The default
is @code{merge_}, but this can be changed by the user.
-@node Support for Version Control, Customizing the Mode Line, Merging and diff3, Customization
+@node Support for Version Control
@section Support for Version Control
@code{run-ediff-from-cvs-buffer}---see the documentation string for this
function.
-@node Customizing the Mode Line, Miscellaneous, Support for Version Control, Customization
+@node Customizing the Mode Line
@section Customizing the Mode Line
When Ediff is running, the mode line of @samp{Ediff Control Panel}
@pindex @file{uniquify.el}
@pindex @file{mode-line.el}
-@node Miscellaneous, Notes on Heavy-duty Customization, Customizing the Mode Line, Customization
+@node Miscellaneous
@section Miscellaneous
Here are a few other variables for customizing Ediff:
@end table
-@node Notes on Heavy-duty Customization, , Miscellaneous, Customization
+@node Notes on Heavy-duty Customization
@section Notes on Heavy-duty Customization
Some users need to customize Ediff in rather sophisticated ways, which
the control buffer is in its own frame.
@end table
-@node Credits, GNU Free Documentation License, Customization, Top
+@node Credits
@chapter Credits
Ediff was written by Michael Kifer <kifer@@cs.stonybrook.edu>. It was inspired
Eli Zaretskii (eliz at is.elta.co.il)
@end example
-@node GNU Free Documentation License, Index, Credits, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Index, , GNU Free Documentation License, Top
+@node Index
@unnumbered Index
@printindex cp
@defopt erc-lurker-hide-list
Like @code{erc-hide-list}, but only applies to messages sent by
lurkers. The function @code{erc-lurker-p} determines whether a given
-nickname is considerd a lurker.
+nickname is considered a lurker.
@end defopt
@end quotation
@end copying
-@node Top, Introduction, (dir), (dir)
+@node Top
@top ERT: Emacs Lisp Regression Testing
ERT is a tool for automated testing in Emacs Lisp. Its main features
@end detailmenu
@end menu
-@node Introduction, How to Run Tests, Top, Top
+@node Introduction
@chapter Introduction
ERT allows you to define @emph{tests} in addition to functions,
Environment}.
-@node How to Run Tests, How to Write Tests, Introduction, Top
+@node How to Run Tests
@chapter How to Run Tests
You can run tests either in the Emacs you are working in, or on the
@end menu
-@node Running Tests Interactively, Running Tests in Batch Mode, How to Run Tests, How to Run Tests
+@node Running Tests Interactively
@section Running Tests Interactively
You can run the tests that are currently defined in your Emacs with
of the expression.
-@node Running Tests in Batch Mode, Test Selectors, Running Tests Interactively, How to Run Tests
+@node Running Tests in Batch Mode
@section Running Tests in Batch Mode
ERT supports automated invocations from the command line or from
files that it requires are on your @code{load-path}.
-@node Test Selectors, , Running Tests in Batch Mode, How to Run Tests
+@node Test Selectors
@section Test Selectors
Functions like @code{ert} accept a @emph{test selector}, a Lisp
@code{:causes-redisplay}.
-@node How to Write Tests, How to Debug Tests, How to Run Tests, Top
+@node How to Write Tests
@chapter How to Write Tests
ERT lets you define tests in the same way you define functions. You
* Useful Techniques:: Some examples.
@end menu
-@node The @code{should} Macro, Expected Failures, How to Write Tests, How to Write Tests
+@node The @code{should} Macro
@section The @code{should} Macro
Test bodies can include arbitrary code; but to be useful, they need to
@code{should} reports.
-@node Expected Failures, Tests and Their Environment, The @code{should} Macro, How to Write Tests
+@node Expected Failures
@section Expected Failures
Some bugs are complicated to fix, or not very important, and are left as
@end lisp
-@node Tests and Their Environment, Useful Techniques, Expected Failures, How to Write Tests
+@node Tests and Their Environment
@section Tests and Their Environment
The outcome of running a test should not depend on the current state
hook variables to nil. This avoids the above problems.
-@node Useful Techniques, , Tests and Their Environment, How to Write Tests
+@node Useful Techniques
@section Useful Techniques when Writing Tests
Testing simple functions that have no side effects and no dependencies
well.
-@node How to Debug Tests, Extending ERT, How to Write Tests, Top
+@node How to Debug Tests
@chapter How to Debug Tests
This section describes how to use ERT's features to understand why
@end menu
-@node Understanding Explanations, Interactive Debugging, How to Debug Tests, How to Debug Tests
+@node Understanding Explanations
@section Understanding Explanations
Failed @code{should} forms are reported like this:
function registered. @xref{Defining Explanation Functions}.
-@node Interactive Debugging, , Understanding Explanations, How to Debug Tests
+@node Interactive Debugging
@section Interactive Debugging
Debugging failed tests essentially works the same way as debugging any
@end itemize
-@node Extending ERT, Other Testing Concepts, How to Debug Tests, Top
+@node Extending ERT
@chapter Extending ERT
There are several ways to add functionality to ERT.
@end menu
-@node Defining Explanation Functions, Low-Level Functions for Working with Tests, Extending ERT, Extending ERT
+@node Defining Explanation Functions
@section Defining Explanation Functions
The explanation function for a predicate is a function that takes the
explanation function.
-@node Low-Level Functions for Working with Tests, , Defining Explanation Functions, Extending ERT
+@node Low-Level Functions for Working with Tests
@section Low-Level Functions for Working with Tests
Both @code{ert-run-tests-interactively} and @code{ert-run-tests-batch}
Contributions to ERT are welcome.
-@node Other Testing Concepts, GNU Free Documentation License , Extending ERT, Top
+@node Other Testing Concepts
@chapter Other Testing Concepts
For information on mocks, stubs, fixtures, or test suites, see below.
* Fixtures and Test Suites:: How ERT differs from tools for other languages.
@end menu
-@node Mocks and Stubs, Fixtures and Test Suites, Other Testing Concepts, Other Testing Concepts
+@node Mocks and Stubs
@section Other Tools for Emacs Lisp
Stubbing out functions or using so-called @emph{mocks} can make it
offers mocks for Emacs Lisp and can be used in conjunction with ERT.
-@node Fixtures and Test Suites, , Mocks and Stubs, Other Testing Concepts
+@node Fixtures and Test Suites
@section Fixtures and Test Suites
In many ways, ERT is similar to frameworks for other languages like
often. This can be achieved with the @code{:tag} argument to
@code{ert-deftest} and @code{tag} test selectors.
-@node GNU Free Documentation License, , Other Testing Concepts, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
@c ================================================================
@ifnottex
-@node Top, What is Eshell?, (dir), (dir)
+@node Top
@top Eshell
Eshell is a shell-like command interpreter
@contents
@ifnottex
-@node Top, Overview, (dir), (dir)
+@node Top
@top Emacs Unified Directory Client
-@comment node-name, next, previous, up
@insertcopying
@end ifnottex
-@node Overview, Installation, Top, Top
-@comment node-name, next, previous, up
+@node Overview
@chapter Overview
EUDC, the @dfn{Emacs Unified Directory Client}, provides a common user
-@node LDAP, CCSO PH/QI, Overview, Overview
-@comment node-name, next, previous, up
+@node LDAP
@section LDAP
LDAP, @dfn{the Lightweight Directory Access Protocol}, is a communication
(@pxref{LDAP Requirements})
-@node CCSO PH/QI, BBDB, LDAP, Overview
-@comment node-name, next, previous, up
+@node CCSO PH/QI
@section CCSO PH/QI
The Central Computing Services Office (CCSO) of the University of
EUDC.
-@node BBDB, , CCSO PH/QI, Overview
-@comment node-name, next, previous, up
+@node BBDB
@section BBDB
BBDB is the @dfn{Big Brother's Insidious Database}, a package for Emacs
EUDC also offers a means to insert results from directory queries into
your own local BBDB (@pxref{Creating BBDB Records})
-@node Installation, Usage, Overview, Top
-@comment node-name, next, previous, up
+@node Installation
@chapter Installation
Add the following to your @file{.emacs} init file:
* LDAP Requirements:: EUDC needs external support for LDAP
@end menu
-@node LDAP Requirements, , Installation, Installation
-@comment node-name, next, previous, up
+@node LDAP Requirements
@section LDAP Requirements
LDAP support is added by means of @file{ldap.el}, which is part of Emacs.
(@url{http://www.openldap.org/}).
-@node Usage, Credits, Installation, Top
-@comment node-name, next, previous, up
+@node Usage
@chapter Usage
This chapter describes the usage of EUDC@. Most functions and
@end menu
-@node Querying Servers, Query Form, Usage, Usage
-@comment node-name, next, previous, up
+@node Querying Servers
@section Querying Servers
EUDC's basic functionality is to let you query a directory server and
* Duplicate Attributes:: What to do when records have duplicate attributes
@end menu
-@node Selecting a Server, Return Attributes, Querying Servers, Querying Servers
+@node Selecting a Server
@subsection Selecting a Server
Before doing any query you will need to set the directory server. You
new directory server and protocol.
@end deffn
-@node Return Attributes, Duplicate Attributes, Selecting a Server, Querying Servers
+@node Return Attributes
@subsection Return Attributes
Directory servers may be configured to return a default set of
attributes are ignored. Default is @code{t}.
@end defopt
-@node Duplicate Attributes, , Return Attributes, Querying Servers
+@node Duplicate Attributes
@subsection Duplicate Attributes
Directory standards may authorize different instances of the same
-@node Query Form, Display of Query Results, Querying Servers, Usage
-@comment node-name, next, previous, up
+@node Query Form
@section Query Form
The simplest way to query your directory server is to use the query
names defined in @code{eudc-user-attribute-names-alist}.
@end defvar
-@node Display of Query Results, Inline Query Expansion, Query Form, Usage
-@comment node-name, next, previous, up
+@node Display of Query Results
@section Display of Query Results
Upon successful completion of a form query, EUDC will display a buffer
@end defvar
-@node Inline Query Expansion, The Server Hotlist, Display of Query Results, Usage
-@comment node-name, next, previous, up
+@node Inline Query Expansion
@section Inline Query Expansion
Inline query expansion is a powerful method to get completion from your
-@node The Server Hotlist, Multi-server Queries, Inline Query Expansion, Usage
-@comment node-name, next, previous, up
+@node The Server Hotlist
@section The Server Hotlist
EUDC lets you maintain a list of frequently used servers so that you
* The Hotlist Edit Buffer:: An interactive hotlist editing facility
@end menu
-@node The Hotlist Edit Buffer, , The Server Hotlist, The Server Hotlist
-@comment node-name, next, previous, up
+@node The Hotlist Edit Buffer
@subsection The Hotlist Edit Buffer
The hotlist edit buffer offers a means to manage a list of frequently
@end deffn
-@node Multi-server Queries, Creating BBDB Records, The Server Hotlist, Usage
-@comment node-name, next, previous, up
+@node Multi-server Queries
@section Multi-server Queries
When using inline query expansion (@pxref{Inline Query Expansion}), EUDC
-@node Creating BBDB Records, Server/Protocol Locals, Multi-server Queries, Usage
-@comment node-name, next, previous, up
+@node Creating BBDB Records
@section Creating BBDB Records
@findex eudc-insert-record-at-point-into-bbdb
actually be inserted as part of the newly created BBDB record.
-@node Server/Protocol Locals, , Creating BBDB Records, Usage
-@comment node-name, next, previous, up
+@node Server/Protocol Locals
@section Server/Protocol Locals
EUDC can be customized independently for each server or directory
* Manipulating local bindings:: Functions to set and query local bindings
@end menu
-@node Manipulating local bindings, , Server/Protocol Locals, Server/Protocol Locals
-@comment node-name, next, previous, up
+@node Manipulating local bindings
@subsection Manipulating local bindings
EUDC offers functions that let you set and query variables on a per
-@node Credits, GNU Free Documentation License, Usage, Top
-@comment node-name, next, previous, up
+@node Credits
@chapter Credits
EUDC was written by Oscar Figueiredo based on @file{ph.el} by the
Thanks to Soren Dayton for his suggestions, his enthusiasm and his help
in testing and proofreading the code and docs of @file{ph.el}.
-@node GNU Free Documentation License, Command and Function Index, Credits, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Command and Function Index, Variables Index, GNU Free Documentation License, Top
-@comment node-name, next, previous, up
+@node Command and Function Index
@unnumbered Command and Function Index
@printindex fn
-@node Variables Index, , Command and Function Index, Top
-@comment node-name, next, previous, up
+@node Variables Index
@unnumbered Variables Index
@printindex vr
@vindex gnus-before-startup-hook
A hook called as the first thing when Gnus is started.
+@item gnus-before-resume-hook
+@vindex gnus-before-resume-hook
+A hook called as the first thing when Gnus is resumed after a suspend.
+
@item gnus-startup-hook
@vindex gnus-startup-hook
A hook run as the very last thing after starting up Gnus
@findex gnus-browse-describe-briefly
Describe browse mode briefly (well, there's not much to describe, is
there) (@code{gnus-browse-describe-briefly}).
+
+@item DEL
+@kindex DEL (Browse)
+@findex gnus-browse-delete-group
+This function will delete the current group
+(@code{gnus-browse-delete-group}). If given a prefix, this function
+will actually delete all the articles in the group, and forcibly
+remove the group itself from the face of the Earth. Use a prefix only
+if you are absolutely sure of what you are doing.
@end table
@item nnimap-authenticator
Some @acronym{IMAP} servers allow anonymous logins. In that case,
-this should be set to @code{anonymous}.
+this should be set to @code{anonymous}. If this variable isn't set,
+the normal login methods will be used. If you wish to specify a
+specific login method to be used, you can set this variable to either
+@code{login} (the traditional @acronym{IMAP} login method),
+@code{plain} or @code{cram-md5}.
@item nnimap-expunge
If non-@code{nil}, expunge articles after deleting them. This is always done
and says what authentication scheme to use. The default is
@code{password}.
+@item :leave
+Non-@code{nil} if the mail is to be left on the @acronym{POP} server
+after fetching. Mails once fetched will never be fetched again by the
+@acronym{UIDL} control. Only the built-in @code{pop3-movemail} program
+(the default) supports this keyword.
+
+If this is neither @code{nil} nor a number, all mails will be left on
+the server. If this is a number, leave mails on the server for this
+many days since you first checked new mails. If this is @code{nil}
+(the default), mails will be deleted on the server right after fetching.
+
+@vindex pop3-uidl-file
+The @code{pop3-uidl-file} variable specifies the file to which the
+@acronym{UIDL} data are locally stored. The default value is
+@file{~/.pop3-uidl}.
+
+Note that @acronym{POP} servers maintain no state information between
+sessions, so what the client believes is there and what is actually
+there may not match up. If they do not, then you may get duplicate
+mails or the whole thing can fall apart and leave you with a corrupt
+mailbox.
+
@end table
-@vindex pop3-movemail
+@findex pop3-movemail
@vindex pop3-leave-mail-on-server
If the @code{:program} and @code{:function} keywords aren't specified,
-@code{pop3-movemail} will be used. If @code{pop3-leave-mail-on-server}
-is non-@code{nil} the mail is to be left on the @acronym{POP} server
-after fetching when using @code{pop3-movemail}. Note that POP servers
-maintain no state information between sessions, so what the client
-believes is there and what is actually there may not match up. If they
-do not, then you may get duplicate mails or the whole thing can fall
-apart and leave you with a corrupt mailbox.
+@code{pop3-movemail} will be used.
Here are some examples for getting mail from a @acronym{POP} server.
+
Fetch from the default @acronym{POP} server, using the default user
name, and default fetcher:
:user "user-name" :password "secret")
@end lisp
+Leave mails on the server for 14 days:
+
+@lisp
+(pop :server "my.pop.server"
+ :user "user-name" :password "secret"
+ :leave 14)
+@end lisp
+
Use @samp{movemail} to move the mail:
@lisp
@center Version 3, 29 June 2007
@c This file is intended to be included within another document,
-@c hence no sectioning command or @node.
+@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
conditions:
@enumerate a
-@item
+@item
The work must carry prominent notices stating that you modified it,
and giving a relevant date.
@item Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+APPLICABLE LAW@. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+A PARTICULAR PURPOSE@. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
the ``copyright'' line and a pointer to where the full notice is found.
@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
+@var{one line to give the program's name and a brief idea of what it does.}
Copyright (C) @var{year} @var{name of author}
This program is free software: you can redistribute it and/or modify
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
+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
notice like this when it starts in an interactive mode:
@smallexample
-@var{program} Copyright (C) @var{year} @var{name of author}
+@var{program} Copyright (C) @var{year} @var{name of author}
This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
This is free software, and you are welcome to redistribute it
under certain conditions; type @samp{show c} for details.
@contents
@ifnottex
-@node Top, Introduction, (dir), (dir)
+@node Top
@top IDLWAVE
IDLWAVE is a package which supports editing source code written in the
@end detailmenu
@end menu
-@node Introduction, IDLWAVE in a Nutshell, Top, Top
+@node Introduction
@chapter Introduction
@cindex Introduction
@cindex CORBA (Common Object Request Broker Architecture)
with @kbd{C-h v}). Some configuration examples are also given in the
appendix.
-@node IDLWAVE in a Nutshell, Getting Started, Introduction, Top
+@node IDLWAVE in a Nutshell
@chapter IDLWAVE in a Nutshell
@cindex Summary of important commands
@cindex IDLWAVE in a Nutshell
<A NAME="TUTORIAL"></A>
@end html
-@node Getting Started, The IDLWAVE Major Mode, IDLWAVE in a Nutshell, Top
+@node Getting Started
@chapter Getting Started (Tutorial)
@cindex Quick-Start
@cindex Tutorial
* Lesson III---User Catalog::
@end menu
-@node Lesson I---Development Cycle, Lesson II---Customization, Getting Started, Getting Started
+@node Lesson I---Development Cycle
@section Lesson I: Development Cycle
The purpose of this tutorial is to guide you through a very basic
Change the code to plot 100 years and see that every 28 years, the
sequence of weekdays repeats.
-@node Lesson II---Customization, Lesson III---User Catalog, Lesson I---Development Cycle, Getting Started
+@node Lesson II---Customization
@section Lesson II: Customization
Emacs is probably the most customizable piece of software ever written,
(local-set-key [f8] 'idlwave-shell-clear-all-bp)))
@end lisp
-@node Lesson III---User Catalog, , Lesson II---Customization, Getting Started
+@node Lesson III---User Catalog
@section Lesson III: User and Library Catalogs
We have already used the routine info display in the first part of this
(with @kbd{C-h v idlwave<-variable-name> @key{RET}}) and ask the
remaining questions on the newsgroup @code{comp.lang.idl-pvwave}.
-@node The IDLWAVE Major Mode, The IDLWAVE Shell, Getting Started, Top
+@node The IDLWAVE Major Mode
@chapter The IDLWAVE Major Mode
@cindex IDLWAVE major mode
@cindex Major mode, @code{idlwave-mode}
* Misc Options:: Things that fit nowhere else
@end menu
-@node Code Formatting, Routine Info, The IDLWAVE Major Mode, The IDLWAVE Major Mode
+@node Code Formatting
@section Code Formatting
@cindex Code formatting
@cindex Formatting, of code
rely on it to help keep your code neat and organized.
-@node Code Indentation, Continued Statement Indentation, Code Formatting, Code Formatting
+@node Code Indentation
@subsection Code Indentation
@cindex Code indentation
@cindex Indentation
BEGIN lines.
@end defopt
-@node Continued Statement Indentation, Comment Indentation, Code Indentation, Code Formatting
+@node Continued Statement Indentation
@subsection Continued Statement Indentation
@cindex Indentation, continued statement
@cindex Continued statement indentation
@code{idlwave-max-extra-continuation-indent} limit is satisfied.
@end defopt
-@node Comment Indentation, Continuation Lines, Continued Statement Indentation, Code Formatting
+@node Comment Indentation
@subsection Comment Indentation
@cindex Comment indentation
@cindex Hanging paragraphs
IDL code.
@end defopt
-@node Continuation Lines, Syntax Highlighting, Comment Indentation, Code Formatting
+@node Continuation Lines
@subsection Continuation Lines and Filling
@cindex Continuation lines
@cindex Line splitting
@code{idlwave-indent-regexp}.
@end defopt
-@node Syntax Highlighting, Octals and Highlighting, Continuation Lines, Code Formatting
+@node Syntax Highlighting
@subsection Syntax Highlighting
@cindex Syntax highlighting
@cindex Highlighting of syntax
2.
@end defopt
-@node Octals and Highlighting, , Syntax Highlighting, Code Formatting
+@node Octals and Highlighting
@subsection Octals and Highlighting
@cindex Syntax highlighting, Octals
@cindex Highlighting of syntax, Octals
@noindent This simultaneously solves the font-lock problem and is more
consistent with the notation for hexadecimal numbers, e.g., @code{'C5'XB}.
-@node Routine Info, Online Help, Code Formatting, The IDLWAVE Major Mode
+@node Routine Info
@section Routine Info
@cindex Routine info
@cindex Updating routine info
@html
<A NAME="ONLINE_HELP"></A>
@end html
-@node Online Help, Completion, Routine Info, The IDLWAVE Major Mode
+@node Online Help
@section Online Help
@cindex Online Help
* Help with Source::
@end menu
-@node Help with HTML Documentation, Help with Source, Online Help, Online Help
+@node Help with HTML Documentation
@subsection Help with HTML Documentation
@cindex HTML Help
@cindex Help using HTML manuals
The face for links to IDLWAVE online help.
@end defopt
-@node Help with Source, , Help with HTML Documentation, Online Help
+@node Help with Source
@subsection Help with Source
@cindex Help using routine source
@end defopt
-@node Completion, Routine Source, Online Help, The IDLWAVE Major Mode
+@node Completion
@section Completion
@cindex Completion
@cindex Keyword completion
* Structure Tag Completion:: Completing state.Tag
@end menu
-@node Case of Completed Words, Object Method Completion and Class Ambiguity, Completion, Completion
+@node Case of Completed Words
@subsection Case of Completed Words
@cindex Case of completed words
@cindex Mixed case completion
completion.
@end defopt
-@node Object Method Completion and Class Ambiguity, Object Method Completion in the Shell, Case of Completed Words, Completion
+@node Object Method Completion and Class Ambiguity
@subsection Object Method Completion and Class Ambiguity
@cindex Object methods
@cindex Class ambiguity
class text property.
@end defopt
-@node Object Method Completion in the Shell, Class and Keyword Inheritance, Object Method Completion and Class Ambiguity, Completion
+@node Object Method Completion in the Shell
@subsection Object Method Completion in the Shell
@cindex Method Completion in Shell
In the IDLWAVE Shell (@pxref{The IDLWAVE Shell}), objects on which
info, or help. If unsuccessful, information from all known classes will
be used (as in the buffer).
-@node Class and Keyword Inheritance, Structure Tag Completion, Object Method Completion in the Shell, Completion
+@node Class and Keyword Inheritance
@subsection Class and Keyword Inheritance
@cindex Inheritance, class
@cindex Keyword inheritance
class-driven keyword inheritance will be used for Completion.
@end defopt
-@node Structure Tag Completion, , Class and Keyword Inheritance, Completion
+@node Structure Tag Completion
@subsection Structure Tag Completion
@cindex Completion, structure tag
@cindex Structure tag completion
@noindent will complete with all structure fields of the structure
@code{st}.
-@node Routine Source, Resolving Routines, Completion, The IDLWAVE Major Mode
+@node Routine Source
@section Routine Source
@cindex Routine source file
@cindex Module source file
(@code{idlwave-kill-autoloaded-buffers}) can be used to easily remove
these buffers.
-@node Resolving Routines, Code Templates, Routine Source, The IDLWAVE Major Mode
+@node Resolving Routines
@section Resolving Routines
@cindex @code{RESOLVE_ROUTINE}
@cindex Compiling library modules
@xref{Sources of Routine Info}, for more information on the ways IDLWAVE
collects data about routines, and how to update this information.
-@node Code Templates, Abbreviations, Resolving Routines, The IDLWAVE Major Mode
+@node Code Templates
@section Code Templates
@cindex Code templates
@cindex Templates
All code templates are also available as abbreviations
(@pxref{Abbreviations}).
-@node Abbreviations, Actions, Code Templates, The IDLWAVE Major Mode
+@node Abbreviations
@section Abbreviations
@cindex Abbreviations
between the parentheses of a function call.
@end defopt
-@node Actions, Doc Header, Abbreviations, The IDLWAVE Major Mode
+@node Actions
@section Actions
@cindex Actions
@cindex Coding standards, enforcing
* Case Changes:: Enforcing upper case keywords
@end menu
-@node Block Boundary Check, Padding Operators, Actions, Actions
+@node Block Boundary Check
@subsection Block Boundary Check
@cindex Block boundary check
@cindex @code{END} type checking
Non-@code{nil} means re-indent line after END was typed.
@end defopt
-@node Padding Operators, Case Changes, Block Boundary Check, Actions
+@node Padding Operators
@subsection Padding Operators
@cindex Padding operators with spaces
@cindex Operators, padding with spaces
Non-@code{nil} means space-pad the @samp{=} in keyword assignments.
@end defopt
-@node Case Changes, , Padding Operators, Actions
+@node Case Changes
@subsection Case Changes
@cindex Case changes
@cindex Upcase, enforcing for reserved words
@end defopt
-@node Doc Header, Motion Commands, Actions, The IDLWAVE Major Mode
+@node Doc Header
@section Documentation Header
@cindex Documentation header
@cindex DocLib header
Regexp matching the start of a document library header.
@end defopt
-@node Motion Commands, Misc Options, Doc Header, The IDLWAVE Major Mode
+@node Motion Commands
@section Motion Commands
@cindex Motion commands
@cindex Program structure, moving through
@end multitable
-@node Misc Options, , Motion Commands, The IDLWAVE Major Mode
+@node Misc Options
@section Miscellaneous Options
@cindex Hooks
Normal hook. Executed when @file{idlwave.el} is loaded.
@end defopt
-@node The IDLWAVE Shell, Acknowledgments, The IDLWAVE Major Mode, Top
+@node The IDLWAVE Shell
@chapter The IDLWAVE Shell
@cindex IDLWAVE shell
@cindex Major mode, @code{idlwave-shell-mode}
* Custom Expression Examination::
@end menu
-@node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell
+@node Starting the Shell
@section Starting the Shell
@cindex Starting the shell
@cindex Shell, starting
Hook for customizing @code{idlwave-shell-mode}.
@end defopt
-@node Using the Shell, Commands Sent to the Shell, Starting the Shell, The IDLWAVE Shell
+@node Using the Shell
@section Using the Shell
@cindex Comint
@cindex Shell, basic commands
modes.
@end defopt
-@node Commands Sent to the Shell, Debugging IDL Programs, Using the Shell, The IDLWAVE Shell
+@node Commands Sent to the Shell
@section Commands Sent to the Shell
@cindex Commands in shell, showing
@cindex Showing commands in shell
(e.g., stepping to an error).
@end defopt
-@node Debugging IDL Programs, Examining Variables, Commands Sent to the Shell, The IDLWAVE Shell
+@node Debugging IDL Programs
@section Debugging IDL Programs
@cindex Debugging
@cindex Keybindings for debugging
@end menu
-@node A Tale of Two Modes, Debug Key Bindings, Debugging IDL Programs, Debugging IDL Programs
+@node A Tale of Two Modes
@subsection A Tale of Two Modes
@cindex Electric Debug Mode
@cindex Debugging Interface
prevented from activating automatically by customizing the variable
@code{idlwave-shell-automatic-electric-debug}.
-@node Debug Key Bindings, Breakpoints and Stepping, A Tale of Two Modes, Debugging IDL Programs
+@node Debug Key Bindings
@subsection Debug Key Bindings
@kindex C-c C-d
@cindex Key bindings
@code{alt}, and @code{shift}.
@end defopt
-@node Breakpoints and Stepping, Compiling Programs, Debug Key Bindings, Debugging IDL Programs
+@node Breakpoints and Stepping
@subsection Breakpoints and Stepping
@cindex Breakpoints
@cindex Stepping
@end defopt
-@node Compiling Programs, Walking the Calling Stack, Breakpoints and Stepping, Debugging IDL Programs
+@node Compiling Programs
@subsection Compiling Programs
@cindex Compiling programs
@cindex Programs, compiling
very useful. A temporary file is created holding the contents of the
current region (with @code{END} appended), and run from the shell.
-@node Walking the Calling Stack, Electric Debug Mode, Compiling Programs, Debugging IDL Programs
+@node Walking the Calling Stack
@subsection Walking the Calling Stack
@cindex Calling stack, walking
@html
<A NAME="EDEBUG"></A>
@end html
-@node Electric Debug Mode, , Walking the Calling Stack, Debugging IDL Programs
+@node Electric Debug Mode
@subsection Electric Debug Mode
@cindex Electric Debug Mode
@cindex @samp{*Debugging*}
@html
<A NAME="EXAMINE"></A>
@end html
-@node Examining Variables, Custom Expression Examination, Debugging IDL Programs, The IDLWAVE Shell
+@node Examining Variables
@section Examining Variables
@cindex @code{PRINT} expressions
@cindex @code{HELP}, on expressions
array expressions.
@end defopt
-@node Custom Expression Examination, , Examining Variables, The IDLWAVE Shell
+@node Custom Expression Examination
@section Custom Expression Examination
@cindex Expressions, custom examination
@cindex Custom expression examination
(three underscores) are replaced by the indicated expression.
@end defopt
-@node Acknowledgments, Sources of Routine Info, The IDLWAVE Shell, Top
+@node Acknowledgments
@chapter Acknowledgments
@cindex Acknowledgments
@cindex Maintainer, of IDLWAVE
@noindent
Thanks to everyone!
-@node Sources of Routine Info, HTML Help Browser Tips, Acknowledgments, Top
+@node Sources of Routine Info
@appendix Sources of Routine Info
@cindex Sources of routine information
* Documentation Scan:: Scanning the IDL Manuals
@end menu
-@node Routine Definitions, Routine Information Sources, Sources of Routine Info, Sources of Routine Info
+@node Routine Definitions
@appendixsec Routine Definitions
@cindex Routine definitions
@cindex IDL variable @code{!PATH}
except by querying the Shell for calling information (DLMs only).
@end enumerate
-@node Routine Information Sources, Catalogs, Routine Definitions, Sources of Routine Info
+@node Routine Information Sources
@appendixsec Routine Information Sources
@cindex Routine info sources
@cindex Builtin list of routines
@html
<A NAME="CATALOGS"></A>
@end html
-@node Catalogs, Load-Path Shadows, Routine Information Sources, Sources of Routine Info
+@node Catalogs
@appendixsec Catalogs
@cindex Catalogs
@html
<A NAME="LIBRARY_CATALOGS"></A>
@end html
-@node Library Catalogs, User Catalog, Catalogs, Catalogs
+@node Library Catalogs
@appendixsubsec Library Catalogs
@cindex @file{.idlwave_catalog}
@cindex Library catalogs
performance is a problem and/or the catalogs are not needed.
@end defopt
-@node User Catalog, , Library Catalogs, Catalogs
+@node User Catalog
@appendixsubsec User Catalog
@cindex User catalog
@cindex IDL library routine info
labeling in routine-info display.
@end defopt
-@node Load-Path Shadows, Documentation Scan, Catalogs, Sources of Routine Info
+@node Load-Path Shadows
@appendixsec Load-Path Shadows
@cindex Load-path shadows
@cindex Shadows, load-path
Another way to find out if a specific routine has multiple definitions
on the load path is routine info display (@pxref{Routine Info}).
-@node Documentation Scan, , Load-Path Shadows, Sources of Routine Info
+@node Documentation Scan
@appendixsec Documentation Scan
@cindex @file{get_html_rinfo}
@cindex @file{idlw-rinfo.el}
Instructions on how to use @file{get_html_rinfo} are in the program
itself.
-@node HTML Help Browser Tips, Configuration Examples, Sources of Routine Info, Top
+@node HTML Help Browser Tips
@appendix HTML Help Browser Tips
@cindex Browser Tips
@code{w3m} using @kbd{M}.
@end itemize
-@node Configuration Examples, Windows and MacOS, HTML Help Browser Tips, Top
+@node Configuration Examples
@appendix Configuration Examples
@cindex Configuration examples
@cindex Example configuration
@html
<A NAME="WINDOWS_MAC"></A>
@end html
-@node Windows and MacOS, Troubleshooting, Configuration Examples, Top
+@node Windows and MacOS
@appendix Windows and MacOS
@cindex Windows
@cindex MacOS
@html
<A NAME="TROUBLE"></A>
@end html
-@node Troubleshooting, GNU Free Documentation License, Windows and MacOS, Top
+@node Troubleshooting
@appendix Troubleshooting
@cindex Troubleshooting
@end enumerate
-@node GNU Free Documentation License, Index, Troubleshooting, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Index, , GNU Free Documentation License, Top
+@node Index
@unnumbered Index
@printindex cp
node name by putting it at the front, in parentheses. Thus,
@kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is
the node @samp{Top} in the Info file @file{dir}. Likewise,
-@kbd{g(emacs)Top@key{RET}} goes to the top node of the Emacs manual.
+@kbd{g(emacs)Top@key{RET}} (or just @kbd{g(emacs)@key{RET}}) goes to the
+top node of the Emacs manual.
The node name @samp{*} specifies the whole file. So you can look at
all of the current file by typing @kbd{g*@key{RET}} or all of any
ebrowse.dvi: ebrowse.texi
$(ENVADD) $(TEXI2DVI) $(srcdir)/ebrowse.texi
-$(infodir)/woman$(INFO_EXT): woman.texi
+$(infodir)/woman$(INFO_EXT): woman.texi $(emacsdir)/emacsver.texi
$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ woman.texi
-woman.dvi: woman.texi
+woman.dvi: woman.texi $(emacsdir)/emacsver.texi
$(ENVADD) $(TEXI2DVI) $(srcdir)/woman.texi
$(infodir)/speedbar$(INFO_EXT): speedbar.texi
rcirc.dvi: rcirc.texi
$(ENVADD) $(TEXI2DVI) $(srcdir)/rcirc.texi
-$(infodir)/erc$(INFO_EXT): erc.texi gpl.texi
+$(infodir)/erc$(INFO_EXT): erc.texi
$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ erc.texi
-erc.dvi: erc.texi gpl.texi
+erc.dvi: erc.texi
$(ENVADD) $(TEXI2DVI) $(srcdir)/erc.texi
$(infodir)/ert$(INFO_EXT): ert.texi
@c %**end of header
@c Version of the software and manual.
-@set VERSION 8.3
+@set VERSION 8.4
@c Edition of the manual. It is either empty for the first edition or
@c has the form ", nth Edition" (without the quotes).
@set EDITION
-@set UPDATED 2011-09-20
-@set UPDATE-MONTH September, 2011
+@set UPDATED 2012-11-25
+@set UPDATE-MONTH November, 2012
@c Other variables.
@set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
them.
The MH-E package is distributed with Emacs@footnote{Version
-@value{VERSION} of MH-E appeared in Emacs 24.1. It is supported in GNU
+@value{VERSION} of MH-E appeared in Emacs 24.4. It is supported in GNU
Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is
known not to work with GNU Emacs versions 20 and below, and XEmacs
version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and
@cindex @command{mairix}
@cindex Unix commands, @command{mairix}
-In the examples below, replace @file{/home/user/Mail} with the path to
-your MH directory.
+In the examples below, replace @file{~/Mail} with the path to your MH
+directory.
-First create the directory @file{/home/user/Mail/.mairix}. Then create
-the file @file{/home/user/Mail/.mairix/config} with the following
-contents:
+First create the directory @file{~/Mail/.mairix}. Then create the file
+@file{~/Mail/.mairix/config} with the following contents:
@smallexample
@group
-base=/home/user/Mail
+base=~/Mail
# List of folders that should be indexed. 3 dots at the end means there
# are subfolders within the folder
mh=archive...:inbox:drafts:news:sent:trash
-vfolder_format=mh
-database=/home/user/Mail/.mairix/database
+mformat=mh
+database=~/Mail/.mairix/database
@end group
@end smallexample
from cron:
@smallexample
-mairix -f /home/user/Mail/.mairix/config
+mairix -f ~/Mail/.mairix/config
@end smallexample
@subsection namazu
@item mh-update-sequences-after-mh-show-flag
On means flush MH sequences to disk after message is shown (default:
@samp{on}).
+@item mh-whitelist-preserves-sequences-flag
+On means that sequences are preserved when messages are whitelisted
+(default: @samp{on}).
@end vtable
The following hook is available.
Spam program that MH-E should use (default: @samp{Auto-detect}).
@end vtable
+@cindex @samp{mh-sequences} customization group
+@cindex customization group, @samp{mh-sequences}
+
+The following option in the @samp{mh-sequences} customization group is
+also available.
+
+@vtable @code
+@item mh-whitelist-preserves-sequences-flag
+On means that sequences are preserved when messages are whitelisted
+(default: @samp{on}).
+@end vtable
+
+The following hooks are available.
+
+@vtable @code
+@item mh-blacklist-msg-hook
+Hook run by @kbd{J b} (@code{mh-junk-blacklist}) after marking each
+message for blacklisting (default: @code{nil}).
+@c -------------------------
+@item mh-whitelist-msg-hook
+Hook run by @kbd{J w} (@code{mh-junk-whitelist}) after marking each
+message for whitelisting (default @samp{nil}).
+@end vtable
+
+The following faces are available.
+
+@vtable @code
+@item mh-folder-blacklisted
+Blacklisted message face.
+@c -------------------------
+@item mh-folder-whitelisted
+Whitelisted message face
+@end vtable
+
@cindex SpamProbe
@cindex Spamassassin
@cindex bogofilter
incorrectly classified as spam. It then refiles the message into the
@file{+inbox} folder.
+@cindex MH profile component, @samp{Previous-Sequence:}
+@cindex @samp{cur} sequence
+@cindex @samp{Previous-Sequence:} MH profile component
+@cindex sequence, @samp{cur}
+@cindex sequence, @samp{Previous-Sequence}
+@vindex mh-whitelist-preserves-sequences-flag
+
+If a message is in any sequence (except @samp{Previous-Sequence:} and
+@samp{cur}) when it is whitelisted, then it will still be in those
+sequences in the destination folder. If this behavior is not desired,
+then turn off the option @code{mh-whitelist-preserves-sequences-flag}.
+
@cindex @samp{*MH-E Log*}
@cindex buffers, @samp{*MH-E Log*}
@findex call-process
@c The real text starts here
@c ================================================================
-@node Top, About PCL-CVS, (dir), (dir)
@ifnottex
+@node Top
@top PCL-CVS
This manual describes PCL-CVS, the GNU Emacs front-end to CVS@. It
@end detailmenu
@end menu
-@node About PCL-CVS, Getting started, Top, Top
+@node About PCL-CVS
@chapter About PCL-CVS
@cindex About PCL-CVS
* Contributors:: Contributors to PCL-CVS.
@end menu
-@node Contributors,, About PCL-CVS, About PCL-CVS
+@node Contributors
@section Contributors to PCL-CVS
@cindex Contributors
@cindex Authors
there would be no new releases of PCL-CVS.
-@node Getting started, Buffer contents, About PCL-CVS, Top
+@node Getting started
@chapter Getting started
@cindex Introduction
@cindex Example run
commands are available simply by pressing a key (@pxref{Getting info
about files}).
-@node Buffer contents, Selected files, Getting started, Top
+@node Buffer contents
@chapter Buffer contents
@cindex Buffer contents
@cindex @code{*cvs*} buffer contents
although it has not been @samp{cvs remove}d.
@end table
-@node Selected files, Commands, Buffer contents, Top
+@node Selected files
@chapter Selected files
@cindex Selected files
@cindex Marked files
For commands to mark and unmark files, see @ref{Marking files}.
-@node Commands, Log Edit Mode, Selected files, Top
+@node Commands
@chapter Commands
@iftex
@end menu
-@node Entering PCL-CVS, Setting flags, Commands, Commands
+@node Entering PCL-CVS
@section Entering PCL-CVS
@findex cvs-update
@findex cvs-examine
@kbd{C-u M-x cvs-update @key{RET} -l @key{RET}}).
-@node Setting flags, Updating the buffer, Entering PCL-CVS, Commands
+@node Setting flags
@section Setting flags for CVS commands
@cindex Optional switches to CVS
@cindex Command-line options to CVS
to the ones PCL-CVS thinks are relevant.
@end table
-@node Updating the buffer, Movement commands, Setting flags, Commands
+@node Updating the buffer
@section Updating the @samp{*cvs*} buffer
@findex cvs-update
@findex cvs-examine
@end table
-@node Movement commands, Marking files, Updating the buffer, Commands
+@node Movement commands
@section Movement Commands
@cindex Movement Commands
@findex cvs-mode-next-line
@end table
-@node Marking files, Committing changes, Movement commands, Commands
+@node Marking files
@section Marking files
@cindex Selecting files (commands to mark files)
@cindex Marking files
@end table
-@node Committing changes, Editing files, Marking files, Commands
+@node Committing changes
@section Committing changes
@cindex Committing changes
@findex cvs-mode-commit
@samp{nil}.
-@node Editing files, Getting info about files, Committing changes, Commands
+@node Editing files
@section Editing files
@cindex Editing files
@cindex Finding files
@end table
-@node Getting info about files, Adding and removing files, Editing files, Commands
+@node Getting info about files
@section Getting info about files
@cindex Status (cvs command)
@cindex Log (RCS/cvs command)
@end table
-@node Adding and removing files, Undoing changes, Getting info about files, Commands
+@node Adding and removing files
@section Adding and removing files
@cindex Adding files
@cindex Removing files
@end table
-@node Undoing changes, Removing handled entries, Adding and removing files, Commands
+@node Undoing changes
@section Undoing changes
@cindex Undo changes
@cindex Flush changes
@end table
-@node Removing handled entries, Ignoring files, Undoing changes, Commands
+@node Removing handled entries
@section Removing handled entries
@cindex Expunging uninteresting entries
@cindex Uninteresting entries, getting rid of them
@end table
-@node Ignoring files, Viewing differences, Removing handled entries, Commands
+@node Ignoring files
@section Ignoring files
@cindex Ignoring files
@kindex i@r{--ignoring files}
This runs @code{cvs-mode-ignore}.
@end table
-@node Viewing differences, Invoking Ediff, Ignoring files, Commands
+@node Viewing differences
@section Viewing differences
@cindex Diff
@cindex Invoking @code{diff}
By default, @samp{diff} commands ignore the marks. This can be changed
with @code{cvs-invert-ignore-marks}.
-@node Invoking Ediff, Updating files, Viewing differences, Commands
+@node Invoking Ediff
@section Running ediff
@cindex Ediff
@cindex Invoking ediff
created will be overwritten.@refill
@end table
-@node Updating files, Tagging files, Invoking Ediff, Commands
+@node Updating files
@section Updating files
@findex cvs-mode-update
@cindex Updating files
@end table
-@node Tagging files, Miscellaneous commands, Updating files, Commands
+@node Tagging files
@section Tagging files
@findex cvs-mode-tag
@findex cvs-mode-untag
to change this behavior.
-@node Miscellaneous commands, , Tagging files, Commands
+@node Miscellaneous commands
@section Miscellaneous commands
@findex cvs-mode-byte-compile-files
@cindex Recompiling elisp files
Quit PCL-CVS, killing the @samp{*cvs*} buffer.
@end table
-@node Log Edit Mode, Log View Mode, Commands, Top
+@node Log Edit Mode
@chapter Editing a Log Message
@cindex Log Edit mode
@c Fixme: customization variables
-@node Log View Mode, Customization, Log Edit Mode, Top
+@node Log View Mode
@chapter Browsing a Log of Changes
@cindex Log View mode
@c @node CVS Status Mode
@c @chapter Viewing CVS' Status output
-@node Customization, Bugs, Log View Mode, Top
+@node Customization
@chapter Customization
@vindex log-edit-changelog-full-paragraphs@r{ (variable)}
@vindex cvs-auto-remove-handled@r{ (variable)}
* Customizing Faces::
@end menu
-@node Customizing Faces, , Customization, Customization
+@node Customizing Faces
@section Customizing Faces
@vindex cvs-header (face)
@vindex cvs-filename (face)
@end table
-@node Bugs, GNU Free Documentation License, Customization, Top
+@node Bugs
@chapter Bugs (known and unknown)
@cindex Reporting bugs and ideas
@cindex Bugs, how to report them
buffer), and the versions of Emacs, PCL-CVS and CVS you are using.
@end table
-@node GNU Free Documentation License, Function and Variable Index, Bugs, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Function and Variable Index, Concept Index, GNU Free Documentation License, Top
+@node Function and Variable Index
@unnumbered Function and Variable Index
This is an index of all the functions and variables documented in this
@printindex fn
-@node Concept Index, Key Index, Function and Variable Index, Top
+@node Concept Index
@unnumbered Concept Index
This is an index of concepts discussed in this manual.
@printindex cp
-@node Key Index, , Concept Index, Top
+@node Key Index
@unnumbered Key Index
This index includes an entry for each PCL-CVS key sequence documented in
@contents
@ifnottex
-@node Top, Basics, (dir), (dir)
+@node Top
@top rcirc Manual
@code{rcirc} is an Emacs IRC client.
@end detailmenu
@end menu
-@node Basics, Reference, Top, Top
+@node Basics
@chapter Basics
This chapter contains a brief introduction to IRC (Internet Relay Chat),
* Getting started with rcirc::
@end menu
-@node Internet Relay Chat, Getting started with rcirc, Basics, Basics
+@node Internet Relay Chat
@section Internet Relay Chat
@cindex internet relay chat
@cindex irc
@kindex TAB
Since this is so common, you can use @key{TAB} to do nick completion.
-@node Getting started with rcirc, , Internet Relay Chat, Basics
+@node Getting started with rcirc
@section Getting started with rcirc
@cindex getting started
@cindex connecting to a server
Use @kbd{C-c C-@key{SPC}} to switch to these buffers.
-@node Reference, Fighting Information Overload, Basics, Top
+@node Reference
@chapter Reference
@cindex reference
* Configuration::
@end menu
-@node rcirc commands, Useful IRC commands, Reference, Reference
+@node rcirc commands
@section rcirc commands
@cindex rcirc commands
@cindex commands
@code{/quit ZZZzzz...}.)
@end table
-@node Useful IRC commands, Configuration, rcirc commands, Reference
+@node Useful IRC commands
@section Useful IRC commands
@cindex irc commands
@cindex commands
@uref{http://www.irchelp.org/, the Internet Relay Chat (IRC) help
archive}.
-@node Configuration, , Useful IRC commands, Reference
+@node Configuration
@section Configuration
@cindex configuring rcirc
@end table
-@node Fighting Information Overload, Hacking and Tweaking, Reference, Top
+@node Fighting Information Overload
@chapter Fighting Information Overload
@cindex information overload
* Notices::
@end menu
-@node Channels, People, Fighting Information Overload, Fighting Information Overload
+@node Channels
@section Channels
@cindex channels
@cindex modeline
have to ignore it. Use @kbd{C-c @key{TAB}} to ignore the current
channel.
-@node People, Keywords, Channels, Fighting Information Overload
+@node People
@section People
@cindex people, how to ignore
@cindex nicks, how to ignore
@end table
-@node Keywords, Notices, People, Fighting Information Overload
+@node Keywords
@section Keywords
@cindex keywords
listed. Example: @code{/keyword manual}.
@end table
-@node Notices, , Keywords, Fighting Information Overload
+@node Notices
@section Notices
@cindex part notices, how to omit
@cindex join notices, how to omit
window @code{rcirc} considers is controlled by the
@code{rcirc-omit-threshold} variable.
-@node Hacking and Tweaking, GNU Free Documentation License, Fighting Information Overload, Top
+@node Hacking and Tweaking
@chapter Hacking and Tweaking
@cindex hacking and tweaking
* Reconnecting after you have lost the connection::
@end menu
-@node Skipping /away messages using handlers, Using fly spell mode, Hacking and Tweaking, Hacking and Tweaking
+@node Skipping /away messages using handlers
@section Skipping @code{/away} messages using handlers
@cindex /away messages
"/away message handler.")
@end example
-@node Using fly spell mode, Scrolling conservatively, Skipping /away messages using handlers, Hacking and Tweaking
+@node Using fly spell mode
@section Using fly spell mode
@cindex fly spell
@cindex spelling
@xref{Spelling, , Flyspell mode, emacs, The GNU Emacs Manual},
for details.
-@node Scrolling conservatively, Changing the time stamp format, Using fly spell mode, Hacking and Tweaking
+@node Scrolling conservatively
@section Scrolling conservatively
@cindex input line
@cindex scrolling
@xref{Scrolling, , Scrolling conservatively, emacs, The GNU Emacs
Manual}, for details.
-@node Changing the time stamp format, Defining a new command, Scrolling conservatively, Hacking and Tweaking
+@node Changing the time stamp format
@section Changing the time stamp format
@cindex time stamp
@cindex date time
(setq rcirc-time-format "%Y-%m-%d %H:%M ")
@end example
-@node Defining a new command, Reconnecting after you have lost the connection, Changing the time stamp format, Hacking and Tweaking
+@node Defining a new command
@section Defining a new command
@cindex defining commands
@cindex commands, defining
(concat "I use " rcirc-id-string))))
@end smallexample
-@node Reconnecting after you have lost the connection, , Defining a new command, Hacking and Tweaking
+@node Reconnecting after you have lost the connection
@section Reconnecting after you have lost the connection
@cindex reconnecting
@cindex disconnecting servers, reconnecting
channels))))
@end smallexample
-@node GNU Free Documentation License, Key Index, Hacking and Tweaking, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Key Index, Variable Index, GNU Free Documentation License, Top
+@node Key Index
@unnumbered Key Index
@printindex ky
-@node Variable Index, Index, Key Index, Top
+@node Variable Index
@unnumbered Variable Index
@printindex vr
-@node Index, , Variable Index, Top
+@node Index
@unnumbered Index
@printindex cp
@contents
@ifnottex
-@node Top,,,(dir)
+@node Top
@top @RefTeX{}
@RefTeX{} is a package for managing Labels, References, Citations and
* Multifile Documents:: Document spread over many files.
* Language Support:: How to support other languages.
* Finding Files:: Included @TeX{} files and @BibTeX{} .bib files.
-* AUCTeX:: Cooperation with @AUCTeX{}.
* Optimizations:: When RefTeX is too slow.
+* AUCTeX:: Cooperation with @AUCTeX{}.
* Problems and Work-Arounds:: First Aid.
* Imprint:: Author, Web-site, Thanks
* Commands:: Which are the available commands.
* Options:: How to extend and configure RefTeX.
-* Keymaps and Hooks:: For customization.
* Changes:: A List of recent changes to RefTeX.
* GNU Free Documentation License:: The license for this documentation.
@end ifnottex
-@node Introduction, Table of Contents, , Top
+@node Introduction
@chapter Introduction
@cindex Introduction
* RefTeX in a Nutshell:: A brief summary and quick guide.
@end menu
-@node Installation, RefTeX in a Nutshell, , Introduction
+@node Installation
@section Installation
@cindex Installation
@xref{Finding Files}.
@page
-@node RefTeX in a Nutshell, , Installation, Introduction
+@node RefTeX in a Nutshell
@section @RefTeX{} in a Nutshell
@cindex Quick-Start
@cindex Getting Started
part is a command and variable reference.
@end enumerate
-@node Table of Contents, Labels and References, Introduction, Top
+@node Table of Contents
@chapter Table of Contents
@cindex @file{*toc*} buffer
@cindex Structure editing
theorem-like environments. @xref{Defining Label Environments}, for an
example.
-@node Labels and References, Citations, Table of Contents, Top
+@node Labels and References
@chapter Labels and References
@cindex Labels in LaTeX
@cindex References in LaTeX
* xr (LaTeX package):: References to external documents.
@end menu
-@node Creating Labels, Referencing Labels, , Labels and References
+@node Creating Labels
@section Creating Labels
@cindex Creating labels
@cindex Labels, creating
set it up to delegate the creation of labels to
@RefTeX{}. @xref{AUCTeX}, for more information.
-@node Referencing Labels, Builtin Label Environments, Creating Labels, Labels and References
+@node Referencing Labels
@section Referencing Labels
@cindex Referencing labels
@cindex Labels, referencing
In order to define additional commands for the selection process, the
keymap @code{reftex-select-label-map} may be used.
-@node Builtin Label Environments, Defining Label Environments, Referencing Labels, Labels and References
+@node Builtin Label Environments
@section Builtin Label Environments
@cindex Builtin label environments
@cindex Label environments, builtin
@code{\newtheorem}, @RefTeX{} needs to be configured to recognize
them (@pxref{Defining Label Environments}).
-@node Defining Label Environments, Reference Info, Builtin Label Environments, Labels and References
+@node Defining Label Environments
@section Defining Label Environments
@cindex Label environments, defining
* Putting it Together:: How to combine many entries.
@end menu
-@node Theorem and Axiom, Quick Equation, , Defining Label Environments
+@node Theorem and Axiom
@subsection Theorem and Axiom Environments
@cindex @code{theorem}, newtheorem
@cindex @code{axiom}, newtheorem
Labels)}).
-@node Quick Equation, Figure Wrapper, Theorem and Axiom , Defining Label Environments
+@node Quick Equation
@subsection Quick Equation Macro
@cindex Quick equation macro
@cindex Macros as environment wrappers
[ ] Make TOC entry : [Value Menu] No entry
@end example
-@node Figure Wrapper, Adding Magic Words, Quick Equation, Defining Label Environments
+@node Figure Wrapper
@subsection Figure Wrapping Macro
@cindex Macros as environment wrappers
@cindex Figure wrapping macro
[ ] Make TOC entry : [Value Menu] No entry
@end example
-@node Adding Magic Words, Using \eqref, Figure Wrapper, Defining Label Environments
+@node Adding Magic Words
@subsection Adding Magic Words
@cindex Magic words
@cindex German magic words
(nil ?i nil nil nil ("Punkt"))))
@end lisp
-@node Using \eqref, Non-Standard Environments, Adding Magic Words, Defining Label Environments
+@node Using \eqref
@subsection Using @code{\eqref}
@cindex @code{\eqref}, AMS-LaTeX macro
@cindex AMS-LaTeX
of @AUCTeX{} (@pxref{Style Files}); so if you use @AUCTeX{},
this configuration will not be necessary.
-@node Non-Standard Environments, Putting it Together, Using \eqref, Defining Label Environments
+@node Non-Standard Environments
@subsection Non-standard Environments
@cindex Non-standard environments
@cindex Environments without @code{\begin}
(incf cnt))))))))
@end lisp
-@node Putting it Together, , Non-Standard Environments, Defining Label Environments
+@node Putting it Together
@subsection Putting it all together
When you have to put several entries into @code{reftex-label-alist}, just
(detect-linguex ?x "ex:" "~\\ref@{%s@}" nil ("Example" "Ex."))))
@end lisp
-@node Reference Info, Reference Styles, Defining Label Environments, Labels and References
+@node Reference Info
@section Reference Info
@findex reftex-view-crossref
@findex reftex-mouse-view-crossref
@code{\label} macro. @xref{Viewing Cross-References}, for more
information.
-@node Reference Styles, xr (LaTeX package), Reference Info, Labels and References
+@node Reference Styles
@section Reference Styles
In case you defined your own macros for referencing or you are using
these variables are deprecated now. Instead of setting them, the
variable @code{reftex-ref-style-default-list} should be adapted now.
-@node xr (LaTeX package), , Reference Styles, Labels and References
+@node xr (LaTeX package)
@section @code{xr}: Cross-Document References
@cindex @code{xr}, LaTeX package
@cindex LaTeX packages, @code{xr}
information and the use of multiple selection buffers can mean a large
speed-up (@pxref{Optimizations}).
-@node Citations, Index Support, Labels and References, Top
+@node Citations
@chapter Citations
@cindex Citations
@cindex @code{\cite}
* BibTeX Database Subsets:: Extract parts of a big database.
@end menu
-@node Creating Citations, Citation Styles, , Citations
+@node Creating Citations
@section Creating Citations
@cindex Creating citations
@cindex Citations, creating
@end lisp
-@node Citation Styles, Citation Info, Creating Citations, Citations
+@node Citation Styles
@section Citation Styles
@cindex Citation styles
@cindex Citation styles, @code{natbib}
document. @xref{Style Files}, for information on how to set up the style
files correctly.
-@node Citation Info, Chapterbib and Bibunits, Citation Styles, Citations
+@node Citation Info
@section Citation Info
@cindex Displaying citations
@cindex Citations, displaying
corresponding to a @code{\bibitem} or @BibTeX{} database entry.
@xref{Viewing Cross-References}.
-@node Chapterbib and Bibunits, Citations Outside LaTeX, Citation Info, Citations
+@node Chapterbib and Bibunits
@section Chapterbib and Bibunits
@cindex @code{chapterbib}, LaTeX package
@cindex @code{bibunits}, LaTeX package
you have multiple bibliographies within a @emph{single file}, this may
or may not be the case.
-@node Citations Outside LaTeX, BibTeX Database Subsets, Chapterbib and Bibunits, Citations
+@node Citations Outside LaTeX
@section Citations outside @LaTeX{}
@cindex Citations outside LaTeX
@vindex reftex-default-bibliography
(reftex-citation))))))
@end lisp
-@node BibTeX Database Subsets, , Citations Outside LaTeX, Citations
+@node BibTeX Database Subsets
@section Database Subsets
@cindex BibTeX database subsets
@findex reftex-create-bibtex-file
either the @i{marked} entries (with the @kbd{e} key) or the
@i{unmarked} entries (with the @kbd{E} key).
-@node Index Support, Viewing Cross-References, Citations, Top
+@node Index Support
@chapter Index Support
@cindex Index Support
@cindex @code{\index}
* Defining Index Macros:: ... and macros it doesn't.
@end menu
-@node Creating Index Entries, The Index Phrases File, , Index Support
+@node Creating Index Entries
@section Creating Index Entries
@cindex Creating index entries
@cindex Index entries, creating
@file{multind} and @file{index} packages, this tag is the first argument
to the redefined @code{\index} macro.
-@node The Index Phrases File, Displaying and Editing the Index, Creating Index Entries, Index Support
+@node The Index Phrases File
@section The Index Phrases File
@cindex Index phrase file
@cindex Phrase file
* Global Indexing:: The interactive indexing process.
@end menu
-@node Collecting Phrases, Consistency Checks, , The Index Phrases File
+@node Collecting Phrases
@subsection Collecting Phrases
@cindex Collecting index phrases
@cindex Index phrases, collection
@samp{\index@{Planets!Pluto@}\index@{Kuiper Belt Objects!Pluto@}Pluto}
and will therefore create two different index entries.
-@node Consistency Checks, Global Indexing, Collecting Phrases, The Index Phrases File
+@node Consistency Checks
@subsection Consistency Checks
@cindex Index phrases, consistency checks
@cindex Phrases, consistency checks
In order to check the whole buffer like this, start at the beginning and
execute this command repeatedly.
-@node Global Indexing, , Consistency Checks, The Index Phrases File
+@node Global Indexing
@subsection Global Indexing
@cindex Global indexing
@cindex Indexing, global
purpose. When called from a @LaTeX{} document with active region, it will
apply @code{reftex-index-all-phrases} to the current region.
-@node Displaying and Editing the Index, Builtin Index Macros, The Index Phrases File, Index Support
+@node Displaying and Editing the Index
@section Displaying and Editing the Index
@cindex Displaying the Index
@cindex Editing the Index
@end table
-@node Builtin Index Macros, Defining Index Macros, Displaying and Editing the Index, Index Support
+@node Builtin Index Macros
@section Builtin Index Macros
@cindex Builtin index macros
@cindex Index macros, builtin
you will have to explicitly specify the index style used.
@xref{Creating Index Entries}, for information on how to do that.
-@node Defining Index Macros, , Builtin Index Macros, Index Support
+@node Defining Index Macros
@section Defining Index Macros
@cindex Defining Index Macros
@cindex Index macros, defining
in the buffer with @kbd{C-c /} (@code{reftex-index-selection-or-word}).
The index tag is "idx".
-@node Viewing Cross-References, RefTeXs Menu, Index Support, Top
+@node Viewing Cross-References
@chapter Viewing Cross-References
@findex reftex-view-crossref
@findex reftex-mouse-view-crossref
@iftex
@chapter All the Rest
@end iftex
+@ifnottex
+@raisesections
+@end ifnottex
-@node RefTeXs Menu, Key Bindings, Viewing Cross-References, Top
+@node RefTeXs Menu
@section @RefTeX{}'s Menu
@cindex RefTeXs Menu
@cindex Menu, in the menu bar
@code{Customize} submenu which can be used to access @RefTeX{}'s
entire set of options.
-@node Key Bindings, Faces, RefTeXs Menu, Top
+@node Key Bindings
@section Default Key Bindings
@cindex Key Bindings, summary
@code{reftex-load-hook}. For information on the keymaps
which should be used to add keys, see @ref{Keymaps and Hooks}.
-@node Faces, AUCTeX, Key Bindings, Top
+@node Faces
@section Faces
@cindex Faces
loaded. If you wish to turn off fontification or change the involved
faces, see @ref{Options (Fontification)}.
-@node Multifile Documents, Language Support, AUCTeX, Top
+@node Multifile Documents
@section Multifile Documents
@cindex Multifile documents
@cindex Documents, spread over files
context.
@end itemize
-@node Language Support, Finding Files, Multifile Documents, Top
+@node Language Support
@section Language Support
@cindex Language support
@code{reftex-cite-punctuation}.
@end itemize
-@node Finding Files, Optimizations, Language Support, Top
+@node Finding Files
@section Finding Files
@cindex Finding files
'( "nw" "tex" "sty" "cls" "ltx" "texi" "texinfo"))
@end lisp
-@node Optimizations, Problems and Work-Arounds, Finding Files, Top
+@node Optimizations
@section Optimizations
@cindex Optimizations
@end group
@end lisp
-@node AUCTeX, Multifile Documents, Faces, Top
+@node AUCTeX
@section @AUCTeX{}
@cindex @code{AUCTeX}, Emacs package
@cindex Emacs packages, @code{AUCTeX}
* Bib-Cite:: Hypertext reading of a document
@end menu
-@node AUCTeX-RefTeX Interface, Style Files, , AUCTeX
+@node AUCTeX-RefTeX Interface
@subsection The @AUCTeX{}-@RefTeX{} Interface
@RefTeX{} contains code to interface with @AUCTeX{}. When this
@RefTeX{} will add all newly created labels to @AUCTeX{}'s completion list.
@end itemize
-@node Style Files, Bib-Cite, AUCTeX-RefTeX Interface, AUCTeX
+@node Style Files
@subsection Style Files
@cindex Style files, AUCTeX
@findex TeX-add-style-hook, @r{AUCTeX}
("rotatefoilhead" . 3))))))
@end lisp
-@node Bib-Cite, , Style Files, AUCTeX
+@node Bib-Cite
@subsection Bib-Cite
@cindex @code{bib-cite}, Emacs package
@cindex Emacs packages, @code{bib-cite}
@end lisp
@page
-@node Problems and Work-Arounds, Imprint, Optimizations, Top
+@node Problems and Work-Arounds
@section Problems and Work-arounds
@cindex Problems and work-arounds
@end itemize
@page
-@node Imprint, Commands, Problems and Work-Arounds, Top
+@node Imprint
@section Imprint
@cindex Imprint
@cindex Maintainer
supporting @LaTeX{} labels and references with an editor (which was
MicroEmacs at the time).
-@node Commands, Options, Imprint, Top
+@c Turn off the raising that we turned on in ``All the rest''.
+@ifnottex
+@lowersections
+@end ifnottex
+
+@node Commands
@chapter Commands
@cindex Commands, list of
removes the parse file associated with the current document.
@end deffn
-@node Options, Keymaps and Hooks, Commands, Top
+@node Options
@chapter Options, Keymaps, Hooks
@cindex Options, list of
* Options (Optimizations)::
* Options (Fontification)::
* Options (Misc)::
+* Keymaps and Hooks::
@end menu
-@node Options (Table of Contents), Options (Defining Label Environments), , Options
+@node Options (Table of Contents)
@section Table of Contents
@cindex Options, table of contents
@cindex Table of contents, options
(@pxref{Table of Contents}).
@end deffn
-@node Options (Defining Label Environments), Options (Creating Labels), Options (Table of Contents), Options
+@node Options (Defining Label Environments)
@section Defining Label Environments
@cindex Options, defining label environments
@cindex Defining label environments, options
non-footnote labels.
@end defopt
-@node Options (Creating Labels), Options (Referencing Labels), Options (Defining Label Environments), Options
+@node Options (Creating Labels)
@section Creating Labels
@cindex Options, creating labels
@cindex Creating labels, options
@end table
@end defopt
-@node Options (Referencing Labels), Options (Creating Citations), Options (Creating Labels), Options
+@node Options (Referencing Labels)
@section Referencing Labels
@cindex Options, referencing labels
@cindex Referencing labels, options
(@pxref{Referencing Labels}).
@end deffn
-@node Options (Creating Citations), Options (Index Support), Options (Referencing Labels), Options
+@node Options (Creating Citations)
@section Creating Citations
@cindex Options, creating citations
@cindex Creating citations, options
@end defopt
-@node Options (Index Support), Options (Viewing Cross-References), Options (Creating Citations), Options
+@node Options (Index Support)
@section Index Support
@cindex Options, Index support
@cindex Index support, options
(@pxref{Index Support}).
@end deffn
-@node Options (Viewing Cross-References), Options (Finding Files), Options (Index Support), Options
+@node Options (Viewing Cross-References)
@section Viewing Cross-References
@cindex Options, viewing cross-references
@cindex Viewing cross-references, options
scans. In order to clear it, use @kbd{M-x reftex-reset-mode}.
@end defopt
-@node Options (Finding Files), Options (Optimizations), Options (Viewing Cross-References), Options
+@node Options (Finding Files)
@section Finding Files
@cindex Options, Finding Files
@cindex Finding files, options
@end defopt
@page
-@node Options (Optimizations), Options (Fontification), Options (Finding Files), Options
+@node Options (Optimizations)
@section Optimizations
@cindex Options, optimizations
@cindex Optimizations, options
non-@code{nil}.
@end defopt
-@node Options (Fontification), Options (Misc), Options (Optimizations), Options
+@node Options (Fontification)
@section Fontification
@cindex Options, fontification
@cindex Fontification, options
Face name for index entries.
@end defopt
-@node Options (Misc), , Options (Fontification), Options
+@node Options (Misc)
@section Miscellaneous
@cindex Options, misc
argument.
@end defopt
-@node Keymaps and Hooks, Changes, Options, Top
+@node Keymaps and Hooks
@section Keymaps and Hooks
@cindex Keymaps
are many more hooks which are described in the relevant sections about
options for a specific part of @RefTeX{}.
-@node Changes, GNU Free Documentation License, Keymaps and Hooks, Top
+@node Changes
@chapter Changes
@cindex Changes
released on 7 Jan 1997.
@end itemize
-@node GNU Free Documentation License, Index, Changes, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Index, , GNU Free Documentation License, Top
+@node Index
@unnumbered Index
@printindex cp
@contents
@ifnottex
-@node Top, Preface, (dir), (dir)
-@comment node-name, next, previous, up
+@node Top
@top Remember
@insertcopying
@end detailmenu
@end menu
-@node Preface, Introduction, Top, Top
-@comment node-name, next, previous, up
+@node Preface
@chapter Preface
This document describes remember-el, which was written by John Wiegley,
This document is a work in progress, and your contribution will be
greatly appreciated.
-@node Introduction, Installation, Preface, Top
-@comment node-name, next, previous, up
+@node Introduction
@chapter Introduction
Todo lists, schedules, phone databases... everything we use databases
manual-ness which computers from the very beginning have been championed
as being able to reduce.
-@node Installation, Implementation, Introduction, Top
-@comment node-name, next, previous, up
+@node Installation
@chapter Installation
Installing Remember Mode is as simple as adding the following lines to
(require 'remember)
@end lisp
-@node Implementation, Quick Start, Installation, Top
-@comment node-name, next, previous, up
+@node Implementation
@chapter Implementation
Hyperbole, as a data presentation tool, always struck me as being very
hierarchy. Well, as the future arrives, hopefully experience and user
feedback will help to make this as intuitive a tool as possible.
-@node Quick Start, Function Reference, Implementation, Top
-@comment node-name, next, previous, up
+@node Quick Start
@chapter Quick Start
@itemize
(call-interactively 'remember)))
@end lisp
-@node Function Reference, Keystrokes, Quick Start, Top
-@comment node-name, next, previous, up
+@node Function Reference
@chapter Function Reference
@file{remember.el} defines the following interactive functions:
the data for latter retrieval, and possible indexing.
@end defun
-@node Keystrokes, Backends, Function Reference, Top
-@comment node-name, next, previous, up
+@node Keystrokes
@chapter Keystroke Reference
@file{remember.el} defines the following keybindings by default:
@end table
-@node Backends, GNU Free Documentation License, Keystrokes, Top
-@comment node-name, next, previous, up
+@node Backends
@chapter Backends
You can save remembered notes to a variety of backends.
* Org:: Saving to an Org Mode file.
@end menu
-@node Text File, Diary, Backends, Backends
-@comment node-name, next, previous, up
+@node Text File
@section Saving to a Text File
@cindex text file, saving to
The text used to begin each remember item.
@end defopt
-@node Diary, Mailbox, Text File, Backends
-@comment node-name, next, previous, up
+@node Diary
@section Saving to a Diary file
@cindex diary, integration
If this is nil, then @code{diary-file} will be used instead."
@end defopt
-@node Mailbox, Org, Diary, Backends
-@comment node-name, next, previous, up
+@node Mailbox
@section Saving to a Mailbox
@cindex mailbox, saving to
The default priority for remembered mail messages.
@end defopt
-@node Org, , Mailbox, Backends
-@comment node-name, next, previous, up
+@node Org
@section Saving to an Org Mode file
@cindex org mode, integration
For instructions on how to integrate Remember with Org Mode,
consult @ref{Capture, , , org}.
-@node GNU Free Documentation License, Concept Index, Backends, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Concept Index, , GNU Free Documentation License, Top
-@comment node-name, next, previous, up
+@node Concept Index
@unnumbered Index
@printindex cp
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename ../../info/ses
-@settitle SES: Simple Emacs Spreadsheet
+@settitle @acronym{SES}: Simple Emacs Spreadsheet
@setchapternewpage off
@syncodeindex fn cp
@syncodeindex vr cp
@c %**end of header
@copying
-This file documents SES: the Simple Emacs Spreadsheet.
+This file documents @acronym{SES}: the Simple Emacs Spreadsheet.
Copyright @copyright{} 2002--2013 Free Software Foundation, Inc.
@dircategory Emacs misc features
@direntry
-* SES: (ses). Simple Emacs Spreadsheet.
+* @acronym{SES}: (ses). Simple Emacs Spreadsheet.
@end direntry
@finalout
@titlepage
-@title SES
+@title @acronym{SES}
@subtitle Simple Emacs Spreadsheet
@author Jonathan A. Yavner
@author @email{jyavner@@member.fsf.org}
@c ===================================================================
@ifnottex
-@node Top, Sales Pitch, (dir), (dir)
+@node Top
@comment node-name, next, previous, up
-@top SES: Simple Emacs Spreadsheet
+@top @acronym{SES}: Simple Emacs Spreadsheet
@display
-SES is a major mode for GNU Emacs to edit spreadsheet files, which
+@acronym{SES} is a major mode for GNU Emacs to edit spreadsheet files, which
contain a rectangular grid of cells. The cells' values are specified
by formulas that can refer to the values of other cells.
@end display
@insertcopying
@menu
-* Sales Pitch:: Why use SES?
+* Sales Pitch:: Why use @acronym{SES}?
* The Basics:: Basic spreadsheet commands
* Advanced Features:: Want to know more?
* For Gurus:: Want to know @emph{even more}?
@c ===================================================================
-@node Sales Pitch, The Basics, Top, Top
+@node Sales Pitch
@comment node-name, next, previous, up
@chapter Sales Pitch
@cindex features
@c ===================================================================
-@node The Basics, Advanced Features, Sales Pitch, Top
+@node The Basics
@comment node-name, next, previous, up
@chapter The Basics
@cindex basic commands
Point is always at the left edge of a cell, or at the empty endline.
When mark is inactive, the current cell is underlined. When mark is
-active, the range is the highlighted rectangle of cells (SES always
+active, the range is the highlighted rectangle of cells (@acronym{SES} always
uses transient mark mode). Drag the mouse from A1 to A3 to create the
-range A1-A2. Many SES commands operate only on single cells, not
+range A1-A2. Many @acronym{SES} commands operate only on single cells, not
ranges.
@table @kbd
* Printer functions::
* Clearing cells::
* Copy/cut/paste::
-* Customizing SES::
+* Customizing @acronym{SES}::
@end menu
-@node Formulas, Resizing, The Basics, The Basics
+@node Formulas
@section Cell formulas
@cindex formulas
@cindex formulas, entering
expression, you can use @kbd{M-@key{TAB}} to complete symbol names.
@item ' @r{(apostrophe)}
-Enter a symbol (ses-read-symbol). SES remembers all symbols that have
+Enter a symbol (ses-read-symbol). @acronym{SES} remembers all symbols that have
been used as formulas, so you can type just the beginning of a symbol
and use @kbd{@key{SPC}}, @kbd{@key{TAB}}, and @kbd{?} to complete it.
@end table
Recalculate the entire spreadsheet (@code{ses-recalculate-all}).
@end table
-@node Resizing, Printer functions, Formulas, The Basics
+@node Resizing
@section Resizing the spreadsheet
@cindex resizing spreadsheets
@findex ses-insert-row
@end table
-@node Printer functions, Clearing cells, Resizing, The Basics
+@node Printer functions
@section Printer functions
@cindex printer functions
@findex ses-read-cell-printer
@end table
-@node Clearing cells, Copy/cut/paste, Printer functions, The Basics
+@node Clearing cells
@section Clearing cells
@cindex clearing commands
@findex ses-clear-cell-backward
@end table
-@node Copy/cut/paste, Customizing SES, Clearing cells, The Basics
+@node Copy/cut/paste
@section Copy, cut, and paste
@cindex copy
@cindex cut
@findex ses-yank-pop
The copy functions work on rectangular regions of cells. You can paste the
-copies into non-SES buffers to export the print text.
+copies into non-@acronym{SES} buffers to export the print text.
@table @kbd
@item M-w
differently depending on the format of the text being inserted:
@itemize @bullet
@item
-When pasting cells that were cut from a SES buffer, the print text is
+When pasting cells that were cut from a @acronym{SES} buffer, the print text is
ignored and only the attached formula and printer are inserted; cell
references in the formula are relocated unless you use @kbd{C-u}.
@item
is the current cell. If part of the rectangle is beyond the edges of
the spreadsheet, you must confirm the increase in spreadsheet size.
@item
-Non-SES text is usually inserted as a replacement formula for the
+Non-@acronym{SES} text is usually inserted as a replacement formula for the
current cell. If the formula would be a symbol, it's treated as a
string unless you use @kbd{C-u}. Pasted formulas with syntax errors
are always treated as strings.
@item M-y
Immediately after a paste, you can replace the text with a preceding
element from the kill ring (@code{ses-yank-pop}). Unlike the standard
-Emacs yank-pop, the SES version uses @code{undo} to delete the old
+Emacs yank-pop, the @acronym{SES} version uses @code{undo} to delete the old
yank. This doesn't make any difference?
@end table
-@node Customizing SES, , Copy/cut/paste, The Basics
-@section Customizing SES
+@node Customizing @acronym{SES}
+@section Customizing @acronym{SES}
@cindex customizing
@vindex enable-local-eval
@vindex ses-mode-hook
list.
@code{ses-mode-hook} is a normal mode hook (list of functions to
-execute when starting SES mode for a buffer).
+execute when starting @acronym{SES} mode for a buffer).
The variable @code{safe-functions} is a list of possibly-unsafe
functions to be treated as safe when analyzing formulas and printers.
@c ===================================================================
-@node Advanced Features, For Gurus, The Basics, Top
+@node Advanced Features
@chapter Advanced Features
@cindex advanced features
@findex ses-read-header-row
@table @kbd
@item C-c M-C-h
-(@code{ses-set-header-row}). The header line at the top of the SES
+(@code{ses-set-header-row}).
+@findex ses-set-header-row
+@kindex C-c M-C-h
+The header line at the top of the @acronym{SES}
window normally shows the column letter for each column. You can set
it to show a copy of some row, such as a row of column titles, so that
row will always be visible. Default is to set the current row as the
@item [header-line mouse-3]
Pops up a menu to set the current row as the header, or revert to
column letters.
+@item M-x ses-rename-cell
+@findex ses-rename-cell
+Rename a cell from a standard A1-like name to any
+string.
+@item M-x ses-repair-cell-reference-all
+@findex ses-repair-cell-reference-all
+When you interrupt a cell formula update by clicking @kbd{C-g}, then
+the cell reference link may be broken, which will jeopardize automatic
+cell update when any other cell on which it depends is changed. To
+repair that use function @code{ses-repair-cell-reference-all}
@end table
@menu
* Spreadsheets with details and summary::
@end menu
-@node The print area, Ranges in formulas, Advanced Features, Advanced Features
+@node The print area
@section The print area
@cindex print area
@findex widen
@findex ses-renarrow-buffer
@findex ses-reprint-all
-A SES file consists of a print area and a data area. Normally the
+A @acronym{SES} file consists of a print area and a data area. Normally the
buffer is narrowed to show only the print area. The print area is
-read-only except for special SES commands; it contains cell values
+read-only except for special @acronym{SES} commands; it contains cell values
formatted by printer functions. The data area records the formula and
printer functions, etc.
(@code{ses-reprint-all}).
@end table
-@node Ranges in formulas, Sorting by column, The print area, Advanced Features
+@node Ranges in formulas
@section Ranges in formulas
@cindex ranges
@findex ses-insert-range-click
a new column just beyond a one-row range, the new cell is included in
the range. New cells inserted just before a range are not included.
+Flags can be added to @code{ses-range} immediately after the @var{to}
+cell.
+@table @code
+@item !
+Empty cells in range can be removed by adding the @code{!} flag. An
+empty cell is a cell the value of which is one of symbols @code{nil}
+or @code{*skip*}. For instance @code{(ses-range A1 A4 !)} will do the
+same as @code{(list A1 A3)} when cells @code{A2} and @code{A4} are
+empty.
+@item _
+Empty cell values are replaced by the argument following flag
+@code{_}, or @code{0} when flag @code{_} is last in argument list. For
+instance @code{(ses-range A1 A4 _ "empty")} will do the same as
+@code{(list A1 "empty" A3 "empty")} when cells @code{A2} and @code{A4}
+are empty. Similarly, @code{(ses-range A1 A4 _ )} will do the same as
+@code{(list A1 0 A3 0)}.
+@item >v
+When order matters, list cells by reading cells row-wise from top left
+to bottom right. This flag is provided for completeness only as it is
+the default reading order.
+@item <v
+List cells by reading cells row-wise from top right to bottom left.
+@item v>
+List cells by reading cells column-wise from top left to bottom right.
+@item v<
+List cells by reading cells column-wise from top right to bottom left.
+@item v
+A short hand for @code{v>}.
+@item ^
+A short hand for @code{^>}.
+@item >
+A short hand for @code{>v}.
+@item <
+A short hand for @code{>^}.
+@item *
+Instead of listing cells, it makes a Calc vector or matrix of it
+(@pxref{Top,,,calc,GNU Emacs Calc Manual}). If the range contains only
+one row or one column a vector is made, otherwise a matrix is made.
+@item *2
+Same as @code{*} except that a matrix is always made even when there
+is only one row or column in the range.
+@item *1
+Same as @code{*} except that a vector is always made even when there
+is only one row or column in the range, that is to say the
+corresponding matrix is flattened.
+@end table
-@node Sorting by column, Standard formula functions, Ranges in formulas, Advanced Features
+@node Sorting by column
@section Sorting by column
@cindex sorting
@findex ses-sort-column
range.
-@node Standard formula functions, More on cell printing, Sorting by column, Advanced Features
+@node Standard formula functions
@section Standard formula functions
@cindex standard formula functions
@cindex *skip*
as a single argument, since you'll probably use it with @code{ses-range}.
@end table
-@node More on cell printing, Import and export, Standard formula functions, Advanced Features
+@node More on cell printing
@section More on cell printing
@cindex cell printing, more
@findex ses-truncate-cell
row or the next non-@code{nil} cell), the result is truncated if the cell's
value is a string, or replaced with hash marks otherwise.
-SES could get confused by printer results that contain newlines or
+@acronym{SES} could get confused by printer results that contain newlines or
tabs, so these are replaced with question marks.
@table @kbd
argument type''.
-@node Import and export, Virus protection, More on cell printing, Advanced Features
+@node Import and export
@section Import and export
@cindex import and export
@cindex export, and import
To import text, use any of the yank commands where the text to paste
contains tabs and/or newlines. Imported formulas are not relocated.
-@node Virus protection, Spreadsheets with details and summary, Import and export, Advanced Features
+@node Virus protection
@section Virus protection
@cindex virus protection
your style as a formula-writer. See the documentation in @file{unsafep.el}
for more info on how Lisp forms are classified as safe or unsafe.
-@node Spreadsheets with details and summary, , Virus protection, Advanced Features
+@node Spreadsheets with details and summary
@section Spreadsheets with details and summary
@cindex details and summary
@cindex summary, and details
A common organization for spreadsheets is to have a bunch of ``detail''
rows, each perhaps describing a transaction, and then a set of
``summary'' rows that each show reduced data for some subset of the
-details. SES supports this organization via the @code{ses-select}
+details. @acronym{SES} supports this organization via the @code{ses-select}
function.
@table @code
@c ===================================================================
-@node For Gurus, Index, Advanced Features, Top
+@node For Gurus
@chapter For Gurus
@cindex advanced features
* Nonrelocatable references::
* The data area::
* Buffer-local variables in spreadsheets::
-* Uses of defadvice in SES::
+* Uses of defadvice in @acronym{SES}::
@end menu
-@node Deferred updates, Nonrelocatable references, For Gurus, For Gurus
+@node Deferred updates
@section Deferred updates
@cindex deferred updates
@cindex updates, deferred
These deferred cell-writes cannot be interrupted by @kbd{C-g}, so
you'll just have to wait.
-SES uses @code{run-with-idle-timer} to move the cell underline when
+@acronym{SES} uses @code{run-with-idle-timer} to move the cell underline when
Emacs will be scrolling the buffer after the end of a command, and
also to narrow and underline after @kbd{C-x C-v}. This is visible as
a momentary glitch after C-x C-v and certain scrolling commands. You
can type ahead without worrying about the glitch.
-@node Nonrelocatable references, The data area, Deferred updates, For Gurus
+@node Nonrelocatable references
@section Nonrelocatable references
@cindex nonrelocatable references
@cindex references, nonrelocatable
kind of dependency is also not recorded.
-@node The data area, Buffer-local variables in spreadsheets, Nonrelocatable references, For Gurus
+@node The data area
@section The data area
@cindex data area
@findex ses-reconstruct-all
macros for each row, followed by column-widths, column-printers,
default-printer, and header-row. Then there's the global parameters
(file-format ID, numrows, numcols) and the local variables (specifying
-SES mode for the buffer, etc.)
+@acronym{SES} mode for the buffer, etc.)
-When a SES file is loaded, first the numrows and numcols values are
+When a @acronym{SES} file is loaded, first the numrows and numcols values are
loaded, then the entire data area is @code{eval}ed, and finally the local
variables are processed.
You can edit the data area, but don't insert or delete any newlines
-except in the local-variables part, since SES locates things by
+except in the local-variables part, since @acronym{SES} locates things by
counting newlines. Use @kbd{C-x C-e} at the end of a line to install
your edits into the spreadsheet data structures (this does not update
the print area, use, e.g., @kbd{C-c C-l} for that).
@end table
-@node Buffer-local variables in spreadsheets, Uses of defadvice in SES, The data area, For Gurus
+@node Buffer-local variables in spreadsheets
@section Buffer-local variables in spreadsheets
@cindex buffer-local variables
@cindex variables, buffer-local
(put 'your-function-name 'safe-function t)
@end lisp
-@node Uses of defadvice in SES, , Buffer-local variables in spreadsheets, For Gurus
-@section Uses of defadvice in SES
+@node Uses of defadvice in @acronym{SES}
+@section Uses of defadvice in @acronym{SES}
@cindex defadvice
@cindex undo-more
@cindex copy-region-as-kill
@end table
@c ===================================================================
-@node Index, Acknowledgments, For Gurus, Top
+@node Index
@unnumbered Index
@printindex cp
@c ===================================================================
-@node Acknowledgments, GNU Free Documentation License, Index, Top
-@chapter Acknowledgments
+@node Acknowledgments
+@unnumbered Acknowledgments
Coding by:
@quotation
@c ===================================================================
-@node GNU Free Documentation License, , Acknowledgments, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
@contents
-@node Top, , , (dir)Top
-@comment node-name, next, previous, up
+@node Top
@top Speedbar
Speedbar is a program for Emacs which can be used to summarize
* Index::
@end menu
-@node Introduction, Basic Navigation, , Top
-@comment node-name, next, previous, up
+@node Introduction
@chapter Introduction
@cindex introduction
@code{speedbar-get-focus}. This function will toggle between frames, and
it's useful to bind it to a key in terminal mode. @xref{Customizing}.
-@node Basic Navigation, File Mode, Introduction, Top
-@comment node-name, next, previous, up
+@node Basic Navigation
@chapter Basic Navigation
Speedbar can display different types of data, and has several display
* Displays Submenu::
@end menu
-@node Basic Key Bindings, Basic Visuals, Basic Navigation, Basic Navigation
-@comment node-name, next, previous, up
+@node Basic Key Bindings
@section Basic Key Bindings
@cindex key bindings
Contract the current group, hiding sub items.
@end table
-@node Basic Visuals, Mouse Bindings, Basic Key Bindings, Basic Navigation
-@comment node-name, next, previous, up
+@node Basic Visuals
@section Basic Visuals
@cindex visuals
do not use files will attempt to use the same colors on analogous
entries.
-@node Mouse Bindings, Displays Submenu, Basic Visuals, Basic Navigation
-@comment node-name, next, previous, up
+@node Mouse Bindings
@section Mouse Bindings
@cindex mouse bindings
this can contain extra information such as file permissions, or tag
location.
-@node Displays Submenu, , Mouse Bindings, Basic Navigation
-@comment node-name, next, previous, up
+@node Displays Submenu
@section Displays Submenu
@cindex displays submenu
would include Files, Quick Buffers, and Buffers. Other major display
modes such as Info are loaded separately.
-@node File Mode, Buffer Mode, Basic Navigation, Top
-@comment node-name, next, previous, up
+@node File Mode
@chapter File Mode
@cindex file mode
* File Key Bindings:: Performing file operations.
@end menu
-@node Directory Display, Hidden Files, File Mode, File Mode
-@comment node-name, next, previous, up
+@node Directory Display
@section Directory Display
@cindex directory display
indicating that all symbols which alphabetically fall between those
categories are included in that sub-group. @xref{Tag Hierarchy Methods}.
-@node Hidden Files, File Key Bindings, Directory Display, File Mode
-@comment node-name, next, previous, up
+@node Hidden Files
@section Hidden Files
@cindex hidden files
determine their presence by the @samp{#} and @samp{!} file indicators.
@xref{Directory Display}.
-@node File Key Bindings, , Hidden Files, File Mode
-@comment node-name, next, previous, up
+@node File Key Bindings
@section File Key Bindings
@cindex file key bindings
also displayed, but they are prefixed with the @samp{[?]} symbol. This
means that it is a file, but Emacs doesn't know how to expand it.
-@node Buffer Mode, Minor Modes, File Mode, Top
-@comment node-name, next, previous, up
+@node Buffer Mode
@chapter Buffer Mode
@cindex buffer mode
press @kbd{b}, click on the buffer you want, and speedbar will revert
back to File mode.
-@node Minor Modes, Customizing, Buffer Mode, Top
-@comment node-name, next, previous, up
+@node Minor Modes
@chapter Minor Display Modes
@cindex minor display modes
stack trace.
@end menu
-@node RMAIL, Info, Minor Modes, Minor Modes
-@comment node-name, next, previous, up
+@node RMAIL
@section RMAIL
@cindex RMAIL
In this way you can manage your existing RMAIL folders fairly easily
using the mouse.
-@node Info, GDB, RMAIL, Minor Modes
-@comment node-name, next, previous, up
+@node Info
@section Info
@cindex Info
the @samp{[+]} button, sometimes a @samp{[?]} will appear when you click on
a @samp{[+]}, indicating that there are no sub-topics.
-@node GDB, , Info, Minor Modes
-@comment node-name, next, previous, up
+@node GDB
@section GDB
@cindex gdb
@cindex gud
level. You can then check variables local to that level at the GDB
prompt.
-@node Customizing, Extending, Minor Modes, Top
-@comment node-name, next, previous, up
+@node Customizing
@chapter Customizing
@cindex customizing
* Hooks:: The many hooks you can use.
@end menu
-@node Frames and Faces, Tag Hierarchy Methods, Customizing, Customizing
-@comment node-name, next, previous, up
+@node Frames and Faces
@section Frames and Faces
@cindex faces
@cindex frame parameters
In XEmacs, change the plist @code{speedbar-frame-plist}. This is the
XEmacs way of doing the same thing.
-@node Tag Hierarchy Methods, Version Control, Frames and Faces, Customizing
-@comment node-name, next, previous, up
+@node Tag Hierarchy Methods
@section Tag Hierarchy Methods
@cindex tag hierarchy
@cindex tag groups
items is reached.
@end table
-@node Version Control, Hooks, Tag Hierarchy Methods, Customizing
-@comment node-name, next, previous, up
+@node Version Control
@section Version Control
@cindex version control
@cindex vc extensions
Lastly, you can change the VC indicator using the variable
@code{speedbar-vc-indicator}, and specify a single character string.
-@node Hooks, , Version Control, Customizing
-@comment node-name, next, previous, up
+@node Hooks
@section Hooks
@cindex hooks
state data.
@end table
-@node Extending, GNU Free Documentation License, Customizing, Top
-@comment node-name, next, previous, up
+@node Extending
@chapter Extending
@cindex extending
* Creating a display:: How to insert buttons and hierarchies.
@end menu
-@node Minor Display Modes, Major Display Modes, Extending, Extending
+@node Minor Display Modes
@section Minor Display Modes
@cindex create minor display mode
display. If it needs to be cleared, you need to erase the speedbar
buffer yourself, and start drawing buttons. @xref{Creating a display}.
-@node Major Display Modes, Tagging Extensions, Minor Display Modes, Extending
+@node Major Display Modes
@section Major Display Modes
@cindex create major display mode
Once you have done all this, speedbar will show an entry in the
@samp{Displays} menu declaring that your extension is available.
-@node Tagging Extensions, Creating a display, Major Display Modes, Extending
+@node Tagging Extensions
@section Tagging Extensions
It is possible to create new methods for tagging files in speedbar.
is either a buffer local modification, or that the tag generator returns
@code{t} for non valid buffers.
-@node Creating a display, , Tagging Extensions, Extending
+@node Creating a display
@section Creating a display
@cindex creating a display
@end defun
-@node GNU Free Documentation License, Index, Extending, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Index, , GNU Free Documentation License, Top
-@comment node-name, next, previous, up
+@node Index
@unnumbered Concept Index
@printindex cp
current buffer. Template files are sorted by priority, with user
templates being found first, and system level default templates last.
Templates are also sorted by application. Each application has its
-own templates, and are kept seperate from the generic templates.
+own templates, and are kept separate from the generic templates.
@section Dictionary
Dictionaries contain values associated with variable. Variables are
By default, when inserting a template, if the user needs to enter text
to fill in a part of the template, then the minibuffer is used to
-query for that information. SRecode also supports a field-edting mode
+query for that information. SRecode also supports a field-editing mode
that can be used instead. To enable it set:
@defun srecode-insert-ask-variable-method
fields are cancelled.
@b{NOTE}: Some conveniences in templates, such as completion, or
-character restrictins are lost when using field editing mode.
+character restrictions are lost when using field editing mode.
@node Template Writing
@chapter Template Writing
@end example
Note that a VARIABLE is a name in a dictionary that can be used in a
-MACRO in a template. The macro referernces some variable by name.
+MACRO in a template. The macro references some variable by name.
@menu
* String Values:: Basic Variable values
@code{\n}, @code{\t}, and @code{\"} work.
When a string is inserted as part of a template, nothing within the
-string is interperted, such as template escape characters.
+string is interpreted, such as template escape characters.
@node Multi-string Values
@subsection Multi-string Values
priority that is set between SRecode base templates, and user defined
templates.
-Templates can be compiled via a project system, such as EDE. EDE
+Templates can be compiled via a project system, such as EDE@. EDE
loaded templates will get a @var{project} set automatically.
Example:
A template represents a text pattern that can be inserted into
a buffer.
-A basic template is declaired like this:
+A basic template is declared like this:
@example
template TEMPLATENAME :arg1 :arg2
@menu
* Template Section Dictionaries:: Template Scoped Macro values
-* Template Macros:: Macros occuring in template patterns
+* Template Macros:: Macros occurring in template patterns
@end menu
@node Template Section Dictionaries
@end example
In this example, the @var{NAME} variable gets the value ``foo'', but
-only while it is inside section macro A. The outer scoped NAME will
+only while it is inside section macro A@. The outer scoped NAME will
be empty.
This is particularly useful while using an include macro to pull in a
context C2
-temlate foo
+template foo
"Foo template in C2"
----
----
This is useful if there are multiple ways to declare something like a
function or variable that differ only by where it is in the syntax of
-the lanugage. The name @code{foo} is not ambiguous because each is in
+the language. The name @code{foo} is not ambiguous because each is in
a different context.
@node Prompts
@section Prompt
-Some templates use promtping macro insertion. A macro that needs a
+Some templates use prompting macro insertion. A macro that needs a
prompt looks like this:
@example
For such macros, you can pre-define prompts for any dictionary entry.
When that dictionary entry is first encountered, the user is prompted,
-and subsequent occurances of that dictionary entry use the same value.
+and subsequent occurrences of that dictionary entry use the same value.
To get a different prompt, use a prompt command like this:
prompt VARNAME "Varname: " defaultmacro "PREFIX"
@end example
-now, when it attempts to read in VARNAME, it will pre-populte the text
+now, when it attempts to read in VARNAME, it will pre-populate the text
editing section with whatever the value of PREFIX is.
Some language arguments may supply possible prefixes for prompts.
your dictionary values yourself. There are several utility functions
for this.
-In the simplest form, you can assocate a string with a variable.
+In the simplest form, you can associate a string with a variable.
@defun srecode-dictionary-set-value dict name value
@anchor{srecode-dictionary-set-value}
For each dictionary added to a variable, the block of codes in
the template will be repeated.
-If optional argument @var{SHOW-ONLY} is non-@code{nil}, then don't add a new dictionarly
-if there is already one in place. Also, don't add @var{FIRST}/@var{LAST} entries.
+If optional argument @var{SHOW-ONLY} is non-@code{nil}, then don't add
+a new dictionary if there is already one in place. Also, don't add
+@var{FIRST}/@var{LAST} entries.
These entries are not needed when we are just showing a section.
Each dictionary added will automatically get values for positional macros
@node Querying a Dictionary
@section Querying a Dictionary
-When creating a new argument, it may be useful to ask the dicitonary
+When creating a new argument, it may be useful to ask the dictionary
what entries are already set there, and conditionally create new
entries based on those.
@item HOUR12
The current hour in 12 hour format.
@item AMPM
-Locale equivalent of AM or PM. Usefule with HOUR12.
+Locale equivalent of AM or PM@. Useful with HOUR12.
@item MINUTE
The current minute.
@item SECOND
@table @code
@item ARGS
-A Loop macro value. Each argument is inserted in ARGS. To create a
+A Loop macro value. Each argument is inserted in ARGS@. To create a
comma separated list of arguments, you might do this:
@example
Converts the filename into text that would be suitable as a class-name
for the main class in the file.
@item CURRENT_PACKAGE
-Finds the occurance of ``package'' and gets its value.
+Finds the occurrence of ``package'' and gets its value.
@end table
@subsubsection Argument :el
The name of the Emacs Custom group that instances of @code{defcustom}
ought to use.
@item FACEGROUP
-The name of the Emacs Custom group that faces delcared with
+The name of the Emacs Custom group that faces declared with
@code{defface} ought to use.
@end table
@end defun
For purposes of an @srecode{} application, it is important to decide
-what to call yoru application, and use that with this method call.
+what to call your application, and use that with this method call.
@section Creating dictionaries
@node Template Naming Conventions
@chapter Template Naming Conventions
-For @srecode{} to work across langauges reliably, templates need to
+For @srecode{} to work across languages reliably, templates need to
follow a predictable pattern. For every language of similar nature
(OO, functional, doc based) if they all provide the same base
templates, then an application can be written against the base
@item function
A standalone function. Not a method, external method, or other.
@item method
-A method belonging to some class declaired outside the textual bounds
+A method belonging to some class declared outside the textual bounds
of that class' declaration.
@item variable
A global variable.
@table @var
@item TAG
-A special insertion value TAG. You can use semantic functions to turn
+A special insertion value TAG@. You can use semantic functions to turn
the tag into a string.
@item HAVEDEFAULT
@itemx DEFAULT
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2012-09-12.16}
+\def\texinfoversion{2013-01-01.15}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
%
% As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without
-% restriction. (This has been our intent since Texinfo was invented.)
+% restriction. This Exception is an additional permission under section 7
+% of the GNU General Public License, version 3 ("GPLv3").
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
\makedispenvdef{quotation}{\quotationstart}
%
\def\quotationstart{%
- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \parindent=0pt
- %
- % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \indentedblockstart % same as \indentedblock, but increase right margin too.
\ifx\nonarrowing\relax
- \advance\leftskip by \lispnarrowing
\advance\rightskip by \lispnarrowing
- \exdentamount = \lispnarrowing
- \else
- \let\nonarrowing = \relax
\fi
\parsearg\quotationlabel
}
\fi
}
+% @indentedblock is like @quotation, but indents only on the left and
+% has no optional argument.
+%
+\makedispenvdef{indentedblock}{\indentedblockstart}
+%
+\def\indentedblockstart{%
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \parindent=0pt
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+}
+
+% Keep a nonzero parskip for the environment, since we're doing normal filling.
+%
+\def\Eindentedblock{%
+ \par
+ {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallindentedblock{\Eindentedblock}
+
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
% If we want to allow any <char> as delimiter,
Remote commands on Windows hosts are available since September 2011.
@end ifset
Ad-hoc multi-hop methods (with a changed syntax) have been reenabled
-in November 2011.
+in November 2011. In November 2012, Juergen Hoetzel's
+@file{tramp-adb.el} has been added.
In December 2001, @value{tramp} has been added to the XEmacs package
repository. Being part of the Emacs repository happened in June 2002,
file names like @file{//melancholia/daniel$$/.emacs}. The only
disadvantage is that there's no possibility to specify another user
name.
+
+
+@item @option{adb}
+@cindex method adb
+@cindex adb method
+
+This special method uses the Android Debug Bridge for connecting
+Android devices. The Android Debug Bridge, part of the Android SDK,
+must be installed locally. The variable @var{tramp-adb-sdk-dir} must
+be set to its installation directory.
+
@end table
The @option{synce} method allows communication with Windows Mobile
devices. Beside GVFS for mounting remote files and directories via
FUSE, it also needs the SYNCE-GVFS plugin.
+
@end table
@defopt tramp-gvfs-methods
Finally, a function which parses @file{~/.netrc} like files. This
includes also @file{~/.authinfo}-style files.
+
@end table
If you want to keep your own data in a file, with your own structure,
@c In the Tramp CVS, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
-@set trampver 2.2.6-24.3
+@set trampver 2.2.7-pre
@c Other flags from configuration
@set instprefix /usr/local
The value of this option is an integer specifying the maximum number
of concurrent @code{url-queue-retrieve} network processes. If the
number of @code{url-queue-retrieve} calls is larger than this number,
-later ones are queued until ealier ones are finished.
+later ones are queued until earlier ones are finished.
@end defopt
@vindex url-queue-timeout
@end direntry
@ifnottex
-@node Top, Survey,, (DIR)
+@node Top
@top VIP
VIP is a Vi emulating package written in Emacs Lisp. VIP implements most
@code{masahiko@@unsun.riec.tohoku.junet} if you are in Japan.
@end iftex
-@node Survey, Basic Concepts, Top, Top
+@node Survey
@chapter A Survey of VIP
In this chapter we describe basics of VIP with emphasis on the features not
* Differences from Vi:: Differences of VIP from Vi is explained.
@end menu
-@node Basic Concepts, Loading VIP, Survey, Survey
+@node Basic Concepts
@section Basic Concepts
We begin by explaining some basic concepts of Emacs. These concepts are
local map, however, the function bound to the key in the global map becomes
in effect.@refill
-@node Loading VIP, Modes in VIP, Basic Concepts, Survey
+@node Loading VIP
@section Loading VIP
The recommended way to load VIP automatically is to include the line:
@end example
@noindent
-@node Modes in VIP, Emacs Mode, Loading VIP, Survey
+@node Modes in VIP
@section Modes in VIP
@kindex 032 @kbd{C-z} (@code{vip-change-mode-to-vi})
know enough Emacs commands.
@end menu
-@node Emacs Mode, Vi Mode, Modes in VIP, Modes in VIP
+@node Emacs Mode
@subsection Emacs Mode
@kindex 032 @kbd{C-z} (@code{vip-change-mode-to-vi})
bound to @code{vip-change-mode-to-vi}. So, if you type @kbd{C-z} in this mode
then you will be in vi mode.@refill
-@node Vi Mode, Insert Mode, Emacs Mode, Modes in VIP
+@node Vi Mode
@subsection Vi Mode
This mode corresponds to Vi's command mode. Most Vi commands work as they
do in Vi. You can go back to emacs mode by typing @kbd{C-z}. You can
enter insert mode, just as in Vi, by typing @kbd{i}, @kbd{a} etc.
-@node Insert Mode, Differences from Vi, Vi Mode, Modes in VIP
+@node Insert Mode
@subsection Insert Mode
The key bindings in this mode is the same as in the emacs mode except for
@kbd{ESC x} in emacs mode.
@end table
-@node Differences from Vi, Undoing, Insert Mode, Survey
+@node Differences from Vi
@section Differences from Vi
The major differences from Vi are explained below.
* Misc Commands:: Other useful commands.
@end menu
-@node Undoing, Changing, Differences from Vi, Differences from Vi
+@node Undoing
@subsection Undoing
@kindex 165 @kbd{u} (@code{vip-undo})
changes. Undo is undoable as in Vi. So the content of the buffer will
be the same before and after @kbd{u u}.@refill
-@node Changing, Searching, Undoing, Differences from Vi
+@node Changing
@subsection Changing
Some commands which change a small number of characters are executed
@kindex 007 @kbd{C-g} (@code{vip-keyboard-quit})
you can abort a partially formed command by typing @kbd{C-g}.@refill
-@node Searching, z Command, Changing, Differences from Vi
+@node Searching
@subsection Searching
@kindex 057 @kbd{/} (@code{vip-search-forward})
the buffer as in Vi. You can change this by rebinding the variable
@code{vip-search-wrap-around}. @xref{Customization}, for how to do this.@refill
-@node z Command, Counts, Searching, Differences from Vi
+@node z Command
@subsection z Command
@kindex 1723 @kbd{z H} (@code{vip-line-to-top})
@kbd{M} and @kbd{L} to place the current line in the Home (Middle, and
Last) line of the window.@refill
-@node Counts, Marking, z Command, Differences from Vi
+@node Counts
@subsection Counts
Some Vi commands which do not accept a count now accept one
Given a count @var{n}, @var{n}-th occurrence will be searched.
@end table
-@node Marking, Region Commands, Counts, Differences from Vi
+@node Marking
@subsection Marking
Typing an @kbd{m} followed by a lower-case character @var{ch} marks the
Jump to mark (and pop mark off the mark ring).
@end table
-@node Region Commands, New Commands, Marking, Differences from Vi
+@node Region Commands
@subsection Region Commands
@cindex region
smallest region containing the original region and consisting of whole
lines. Thus @kbd{m .@: d R} will have the same effect as @kbd{d d}.@refill
-@node New Commands, New Bindings, Region Commands, Differences from Vi
+@node New Commands
@subsection Some New Commands
Note that the keys below (except for @kbd{R}) are not used in Vi.
Call last keyboard macro.
@end table
-@node New Bindings, Window Commands, New Commands, Differences from Vi
+@node New Bindings
@subsection New Key Bindings
In VIP the meanings of some keys are entirely different from Vi. These key
This is equivalent to @kbd{C-x 1 C-x 2} (1 + 2 = 3).
@end table
-@node Window Commands, Buffer Commands, New Bindings, Differences from Vi
+@node Window Commands
@subsection Window Commands
In this and following subsections, we give a summary of key bindings for
Show current buffer in two windows.
@end table
-@node Buffer Commands, File Commands, Window Commands, Differences from Vi
+@node Buffer Commands
@subsection Buffer Commands
@table @kbd
Save the current buffer in the file associated to the buffer.
@end table
-@node File Commands, Misc Commands, Buffer Commands, Differences from Vi
+@node File Commands
@subsection File Commands
@table @kbd
Insert specified file at point.
@end table
-@node Misc Commands, Vi Commands, File Commands, Differences from Vi
+@node Misc Commands
@subsection Miscellaneous Commands
@table @kbd
Replace.
@end table
-@node Vi Commands, Numeric Arguments, Misc Commands, Top
+@node Vi Commands
@chapter Vi Commands
This chapter describes Vi commands other than Ex commands implemented in
* Commands in Insert Mode:: Commands for entering insert mode.
@end menu
-@node Numeric Arguments, Important Keys, Vi Commands, Vi Commands
+@node Numeric Arguments
@section Numeric Arguments
@cindex numeric arguments
For instance, @kbd{5 d d} deletes 5 lines while simple @kbd{d d} deletes a
line. In this manual the metavariable @var{n} will denote a count.@refill
-@node Important Keys, Buffers and Windows, Numeric Arguments, Vi Commands
+@node Important Keys
@section Important Keys
The keys @kbd{C-g} and @kbd{C-l} are unique in that their associated
@samp{+++++} before point.@refill
@end table
-@node Buffers and Windows, Files, Important Keys, Vi Commands
+@node Buffers and Windows
@section Buffers and Windows
@cindex buffer
and you can select it by giving a simple @key{RET}. See GNU Emacs Manual
for details of completion.
-@node Files, Viewing the Buffer, Buffers and Windows, Vi Commands
+@node Files
@section Files
We have the following commands related to files. They are used to visit,
you can type @kbd{X W}. You will then get a similar prompt as you get for
@kbd{v}, to which you can enter the file name.@refill
-@node Viewing the Buffer, Mark Commands, Files, Vi Commands
+@node Viewing the Buffer
@section Viewing the Buffer
In this and next section we discuss commands for moving around in the
Center point in window and redisplay screen (@code{recenter}).
@end table
-@node Mark Commands, Motion Commands, Viewing the Buffer, Vi Commands
+@node Mark Commands
@section Mark Commands
The following commands are used to mark positions in the buffer.
the command `@kbd{m ,}' you can visit older and older marked positions. You
will eventually be in a loop as the mark ring is a ring.
-@node Motion Commands, Searching and Replacing, Mark Commands, Vi Commands
+@node Motion Commands
@section Motion Commands
Commands for moving around in the current buffer are collected here. These
opposite direction (@code{vip-repeat-find-opposite}).
@end table
-@node Searching and Replacing, Modifying Commands, Motion Commands, Vi Commands
+@node Searching and Replacing
@section Searching and Replacing
Following commands are available for searching and replacing.
The commands @kbd{/} and @kbd{?} mark point before move, so that you can
return to the original point by @w{@kbd{` `}}.
-@node Modifying Commands, Delete Commands, Searching and Replacing, Vi Commands
+@node Modifying Commands
@section Modifying Commands
In this section, commands for modifying the content of a buffer are
* Change Commands:: Commands for changing text.
* Repeating and Undoing Modifications::
@end menu
-@node Delete Commands, Yank Commands, Modifying Commands, Modifying Commands
+@node Delete Commands
@subsection Delete Commands
@table @kbd
(@code{vip-delete-backward-char}).
@end table
-@node Yank Commands, Put Back Commands, Delete Commands, Modifying Commands
+@node Yank Commands
@subsection Yank Commands
@cindex yank
Expand current region and yank it.
@end table
-@node Put Back Commands, Change Commands, Yank Commands, Modifying Commands
+@node Put Back Commands
@subsection Put Back Commands
Deleted or yanked texts can be put back into the buffer by the command
below.
specified, @var{n}-th previously deleted/yanked text will be put back. It
is an error to specify a number register for the delete/yank commands.
-@node Change Commands, Repeating and Undoing Modifications, Put Back Commands, Modifying Commands
+@node Change Commands
@subsection Change Commands
Most commonly used change command takes the following form.
Expand current region and change it.
@end table
-@node Repeating and Undoing Modifications, Other Vi Commands, Change Commands, Modifying Commands
+@node Repeating and Undoing Modifications
@subsection Repeating and Undoing Modifications
VIP records the previous modifying command, so that it is easy to repeat
modifying command is used again (@code{vip-repeat}).
@end table
-@node Other Vi Commands, Commands in Insert Mode, Repeating and Undoing Modifications, Vi Commands
+@node Other Vi Commands
@section Other Vi Commands
Miscellaneous Vi commands are collected here.
(@code{kill-region}).
@end table
-@node Commands in Insert Mode, Ex Commands, Other Vi Commands, Vi Commands
+@node Commands in Insert Mode
@section Insert Mode
You can enter insert mode by one of the following commands. In addition to
command will not really repeat insertion if you move point by emacs
commands while in insert mode.
-@node Ex Commands, Ex Command Reference, Commands in Insert Mode, Top
+@node Ex Commands
@chapter Ex Commands
@kindex 072 @kbd{:} (@code{vip-ex})
@menu
* Ex Command Reference:: Explain all the Ex commands available in VIP.
@end menu
-@node Ex Command Reference, Customization, Ex Commands, Ex Commands
+@node Ex Command Reference
@section Ex Command Reference
In this section we briefly explain all the Ex commands supported by VIP@.
Most Ex commands expect @var{address} as their argument, and they use
@kbd{unabbreviate}, @kbd{xit}, @kbd{z}
@end example
-@node Customization, Customizing Constants, Ex Command Reference, Top
+@node Customization
@chapter Customization
If you have a file called @file{.vip} in your home directory, then it
* Customizing Key Bindings:: How to change key bindings.
@end menu
-@node Customizing Constants, Customizing Key Bindings, Customization, Customization
+@node Customizing Constants
@section Customizing Constants
An easy way to customize VIP is to change the values of constants used
in VIP@. Here is the list of the constants used in VIP and their default
(setq vip-case-fold-search t)
@end example
-@node Customizing Key Bindings,, Customizing Constants, Customization
+@node Customizing Key Bindings
@section Customizing Key Bindings
@cindex local keymap
(define-key vip-command-mode-map "X" 'vip-delete-backward-char)
@end example
-@node GNU Free Documentation License,,, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
@contents
@ifnottex
-@node Top, Overview,, (DIR)
-
-@unnumbered Viper
+@node Top
+@top Viper
We believe that one or more of the following statements are adequate
descriptions of Viper:
* Improvements over Vi:: New features, Improvements
* Customization:: How to customize Viper
* Commands:: Vi and Ex Commands
-
+* GNU Free Documentation License:: The license for this documentation.
+* Acknowledgments::
* Key Index:: Index of Vi and Ex Commands
* Function Index:: Index of Viper Functions
* Variable Index:: Index of Viper Variables
* Package Index:: Index of Packages Mentioned in this Document
* Concept Index:: Vi, Ex and Emacs concepts
-
-* Acknowledgments::
-* GNU Free Documentation License:: The license for this documentation.
-
@end menu
@iftex
@unnumbered Introduction
@end iftex
-@node Overview,Improvements over Vi,Top,Top
+@node Overview
@chapter Overview of Viper
Viper is a Vi emulation on top of Emacs. At the same time, Viper provides a
* Unimplemented Features:: That are unlikely to be implemented.
@end menu
-@node Emacs Preliminaries, Loading Viper, Overview, Overview
+@node Emacs Preliminaries
@section Emacs Preliminaries
@cindex buffer
cause Lisp functions to be called. It is possible to call these
functions directly, by typing @kbd{M-x function-name}.
-@node Loading Viper, States in Viper, Emacs Preliminaries, Overview
+@node Loading Viper
@section Loading Viper
The most common way to load it automatically is to include the following
viper-go-away} will do it for you. The function @code{toggle-viper-mode}
toggles Viperization of Emacs on and off.
-@node States in Viper, The Minibuffer, Loading Viper,Overview
+@node States in Viper
@section States in Viper
@kindex @kbd{C-z}
replacement commands, such as cw, C, R, etc.
@end menu
-@node Emacs State, Vi State, States in Viper, States in Viper
+@node Emacs State
@subsection Emacs State
@kindex @kbd{C-z}
single Vi command while staying in Viper's Insert state.
-@node Vi State, Insert State, Emacs State, States in Viper
+@node Vi State
@subsection Vi State
@cindex Vi state
`@kbd{.}'.
@xref{Improvements over Vi}, for more information.
-@node Insert State, Replace State, Vi State, States in Viper
+@node Insert State
@subsection Insert State
@cindex Insert state
When Viper is in Insert state, you will see <I> in the mode line.
-@node Replace State,, Insert State, States in Viper
+@node Replace State
@subsection Replace State
@cindex Replace state
would delete text between this position and the end of the replacement
region.
-@node The Minibuffer,Multiple Files in Viper, States in Viper, Overview
+@node The Minibuffer
@section The Minibuffer
@cindex Minibuffer
The appearance of the text in the minibuffer can be changed.
@xref{Viper Specials}, for more details.
-@node Multiple Files in Viper,Unimplemented Features,The Minibuffer,Overview
+@node Multiple Files in Viper
@section Multiple Files in Viper
@cindex multiple files
command @kbd{:n} can be given counts from the @kbd{:ar} list to switch to
other files. For example, use `:n3' to move to the third file in that list.
-@node Unimplemented Features,,Multiple Files in Viper,Overview
+@node Unimplemented Features
@section Unimplemented Features
Unimplemented features include:
back to normal tabs.@refill
@end itemize
-@comment node-name, next, previous, up
-@node Improvements over Vi, Customization, Overview, Top
+@node Improvements over Vi
@chapter Improvements over Vi
Some common problems with Vi and Ex have been solved in Viper. This
you should know about.
@end menu
-@node Basics, Undo and Backups, Improvements over Vi, Improvements over Vi
+@node Basics
@section Basics
The Vi command set is based on the idea of combining motion commands
specify @code{(setq ex-cycle-through-non-files t)} in your @file{.viper}
file. @xref{Customization}, for details.
-@node Undo and Backups, History, Basics, Improvements over Vi
+@node Undo and Backups
@section Undo and Backups
@cindex undo
can be any letters from a through z.
@comment ] balance parens
-@node History, Macros and Registers, Undo and Backups,Improvements over Vi
+@node History
@section History
@cindex history
have a buffer history, and commands that expect strings or regular
expressions keep a history on those items.
-@node Macros and Registers,Completion,History,Improvements over Vi
+@node Macros and Registers
@section Macros and Registers
@cindex keyboard macros
Viper also provides Vi-style macros. @xref{Vi Macros}, for details.
-@node Completion, Improved Search, Macros and Registers, Improvements over Vi
+@node Completion
@section Completion
@cindex completion
of the form @kbd{/foo//bar} as @kbd{/bar} and @kbd{/foo/~/bar} as
@kbd{~/bar}.
-@node Improved Search, Abbreviation Facilities, Completion, Improvements over Vi
+@node Improved Search
@section Improved Search
@cindex buffer search
Try it: it is really simple!
-@node Abbreviation Facilities,Movement and Markers,Improved Search,Improvements over Vi
+@node Abbreviation Facilities
@section Abbreviation Facilities
@cindex abbrevs
@code{dabbrev-expand} to that key.
Facilities like this make Vi's @kbd{:ab} command obsolete.
-@node Movement and Markers, New Commands, Abbreviation Facilities, Improvements over Vi
+@node Movement and Markers
@section Movement and Markers
@cindex Ex style motion
Textmarkers, this is very useful. Contents of textmarkers can be viewed
by @kbd{[marker}. (Contents of registers can be viewed by @kbd{]register}).
-@node New Commands, Useful Packages, Movement and Markers, Improvements over Vi
+@node New Commands
@section New Commands
These commands have no Vi analogs.
notably, Vi style macros are much more powerful in Viper than in Vi. @xref{Vi
Macros}, for details.
-@node Useful Packages, ,New Commands, Improvements over Vi
+@node Useful Packages
@section Useful Packages
Some Emacs packages are mentioned here as an aid to the new Viper user, to
and @samp{wuarchive.wustl.edu}@refill
-@node Customization,Commands,Improvements over Vi,Top
+@node Customization
@chapter Customization
@cindex customization
* Vi Macros:: How to do Vi style macros.
@end menu
-@node Rudimentary Changes,Key Bindings,Customization,Customization
+@node Rudimentary Changes
@section Rudimentary Changes
@cindex setting variables
@vindex @code{viper-replace-state-hook}
@vindex @code{viper-emacs-state-hook}
-@node Key Bindings, Packages that Change Keymaps, Rudimentary Changes,Customization
+@node Key Bindings
@section Key Bindings
@cindex key bindings
@findex @code{viper-add-local-keys}
@findex @code{viper-zap-local-keys}
-@node Packages that Change Keymaps,Viper Specials,Key Bindings,Customization
-@subsection Packages that Change Keymaps
+@node Packages that Change Keymaps
+@section Packages that Change Keymaps
@cindex C-c and Viper
@cindex Viper and C-c
@findex @code{remove-hook}
@findex @code{add-hook}
-@node Viper Specials,Vi Macros,Packages that Change Keymaps,Customization
+@node Viper Specials
@section Viper Specials
Viper extends Vi with a number of useful features. This includes various
Emacs. The function @code{viper-surrounding-word} in @file{viper.el} can be
used as a guiding example.
-@node Vi Macros, ,Viper Specials,Customization
+@node Vi Macros
@section Vi Macros
@cindex Vi macros
currently defined. To see all macros along with their definitions, type
@kbd{M-x viper-describe-kbd-macros}.
-@node Commands,,Customization,Top
+@node Commands
@chapter Commands
This section is a semi-automatically bowdlerized version of the Vi
* Mouse-bound Commands:: Search and insertion of text
@end menu
-@node Groundwork, Text Handling, Commands, Commands
-@comment node-name, next, previous, up
+@node Groundwork
@section Groundwork
The VI command set is based on the idea of combining motion commands
inserts them automatically in front of the Ex command.
@cindex Ex commands
-@node Text Handling, Display, Groundwork, Commands
+@node Text Handling
@section Text Handling
@menu
* Undoing:: Multiple Undo, Backups
@end menu
-@node Move Commands,Marking,,Text Handling
+@node Move Commands
@subsection Move Commands
@cindex movement commands
@kindex @kbd{l}
@vindex @code{viper-parse-sexp-ignore-comments}
-@node Marking,Appending Text,Move Commands,Text Handling
+@node Marking
@subsection Marking
Emacs mark is referred to in the region specifiers @kbd{r} and @kbd{R}.
@kindex @kbd{`<a-z>}
@kindex @kbd{'<a-z>}
-@node Appending Text, Editing in Insert State, Marking,Text Handling
+@node Appending Text
@subsection Appending Text
@xref{Options}, to see how to change tab and shiftwidth size. See the GNU
@kindex @kbd{A}
@kindex @kbd{a}
-@node Editing in Insert State, Deleting Text, Appending Text,Text Handling
+@node Editing in Insert State
@subsection Editing in Insert State
Minibuffer can be edited similarly to Insert state, and you can switch
@kindex @kbd{C-w}
@kindex @kbd{C-v}
-@node Deleting Text, Changing Text, Editing in Insert State, Text Handling
+@node Deleting Text
@subsection Deleting Text
@kindex @kbd{X}
@kindex @kbd{x}
-@node Changing Text, Search and Replace, Deleting Text,Text Handling
+@node Changing Text
@subsection Changing Text
@cindex joining lines
@kindex @kbd{R}
@kindex @kbd{r<char>}
-@node Search and Replace, Yanking, Changing Text,Text Handling
+@node Search and Replace
@subsection Search and Replace
@xref{Groundwork}, for Ex address syntax. @xref{Options}, to see how to
@kindex @kbd{?<string>}
@kindex @kbd{/<string>}
-@node Yanking,Undoing,Search and Replace,Text Handling
+@node Yanking
@subsection Yanking
@cindex cut and paste
@kindex @kbd{yank}
@findex @kbd{:yank}
-@node Undoing,, Yanking,Text Handling
+@node Undoing
@subsection Undoing
@cindex undo
@kindex @kbd{U}
@kindex @kbd{u}
-@node Display, File and Buffer Handling, Text Handling, Commands
+@node Display
@section Display
@cindex scrolling
@kindex @kbd{C-g}
-@node File and Buffer Handling, Mapping, Display,Commands
+@node File and Buffer Handling
@section File and Buffer Handling
@cindex multiple files
@findex @kbd{:cd [<dir>]}
@findex @kbd{:pwd}
-@node Mapping, Shell Commands, File and Buffer Handling, Commands
+@node Mapping
@section Mapping
@cindex key bindings
@findex @kbd{:unmap!@: <char>}
@findex @kbd{:map!@: <char> <seq>}
-@node Shell Commands, Options, Mapping, Commands
+@node Shell Commands
@section Shell Commands
@cindex % (Current file)
@findex @kbd{:sh}
@findex @kbd{:make}
-@node Options,Emacs Related Commands,Shell Commands,Commands
+@node Options
@section Options
@cindex Vi options
@findex @kbd{:set ai}
@findex @kbd{:set autoindent}
-@node Emacs Related Commands,,Options,Commands
+@node Emacs Related Commands
@section Emacs Related Commands
@table @kbd
@kindex @kbd{C-\}
@kindex @kbd{C-c\}
-@node Mouse-bound Commands,,,Commands
+@node Mouse-bound Commands
@section Mouse-bound Commands
The following two mouse actions are normally bound to special search and
@kindex @kbd{meta button1up}
@kindex @kbd{meta button2up}
-@node Acknowledgments,,,Top
-@comment node-name, next, previous, up
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
+@include doclicense.texi
+
+@node Acknowledgments
@unnumbered Acknowledgments
Viper, formerly known as VIP-19, was written by Michael Kifer. Viper is
zapman@@cc.gatech.edu (Jason Zapman II),
@end example
-@node GNU Free Documentation License,,, Top
-@appendix GNU Free Documentation License
-@include doclicense.texi
-
-@node Key Index,Function Index,,Top
-@comment node-name, next, previous, up
+@node Key Index
@unnumbered Key Index
@printindex ky
-@node Function Index,Variable Index,Key Index,Top
-@comment node-name, next, previous, up
+@node Function Index
@unnumbered Function Index
@printindex fn
-@node Variable Index,Package Index,Function Index,Top
-@comment node-name, next, previous, up
+@node Variable Index
@unnumbered Variable Index
@printindex vr
-@node Package Index,Concept Index,Variable Index,Top
-@comment node-name, next, previous, up
+@node Package Index
@unnumbered Package Index
@printindex pg
-@node Concept Index,,Package Index,Top
-@comment node-name, next, previous, up
+@node Concept Index
@unnumbered Concept Index
@printindex cp
@contents
-@node Top, Introduction, (dir), (dir)
-@comment node-name, next, previous, up
+@node Top
@top The Emacs Widget Library
@insertcopying
* Index::
@end menu
-@node Introduction, User Interface, Top, Top
-@comment node-name, next, previous, up
-@section Introduction
+@node Introduction
+@chapter Introduction
Most graphical user interface toolkits provide a number of standard
user interface controls (sometimes known as `widgets' or `gadgets').
widget library will also use the new graphic features automatically.
@end enumerate
-@node User Interface, Programming Example, Introduction, Top
-@comment node-name, next, previous, up
-@section User Interface
+@node User Interface
+@chapter User Interface
A form consists of read only text for documentation and some fields,
where each field contains two parts, a tag and a value. The tags are
within a form, namely editing the editable text fields and activating
the buttons.
-@subsection Editable Text Fields
+@section Editable Text Fields
In the example, the value for the @samp{Name} is most likely displayed
in an editable text field, and so are values for each of the members of
Face used for other editing fields.
@end deffn
-@subsection Buttons
+@section Buttons
@cindex widget buttons
@cindex button widgets
it.
@end defopt
-@subsection Navigation
+@section Navigation
You can use all the normal Emacs commands to move around in a form
buffer, plus you will have these additional commands:
@end deffn
@end table
-@node Programming Example, Setting Up the Buffer, User Interface, Top
-@comment node-name, next, previous, up
-@section Programming Example
+@node Programming Example
+@chapter Programming Example
@cindex widgets, programming example
@cindex example of using widgets
(widget-setup))
@end lisp
-@node Setting Up the Buffer, Basic Types, Programming Example, Top
-@comment node-name, next, previous, up
-@section Setting Up the Buffer
+@node Setting Up the Buffer
+@chapter Setting Up the Buffer
Widgets are created with @code{widget-create}, which returns a
@dfn{widget} object. This object can be queried and manipulated by
when not on a button. By default this is @code{global-map}.
@end defvar
-@node Basic Types, Sexp Types, Setting Up the Buffer, Top
-@comment node-name, next, previous, up
-@section Basic Types
+@node Basic Types
+@chapter Basic Types
This is the general syntax of a type specification:
* group::
@end menu
-@node link, url-link, Basic Types, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{link} Widget
+@node link
+@section The @code{link} Widget
@findex link@r{ widget}
Syntax:
String to suffix links.
@end defopt
-@node url-link, info-link, link, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{url-link} Widget
+@node url-link
+@section The @code{url-link} Widget
@findex url-link@r{ widget}
Syntax:
When this link is invoked, the @acronym{WWW} browser specified by
@code{browse-url-browser-function} will be called with @var{url}.
-@node info-link, push-button, url-link, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{info-link} Widget
+@node info-link
+@section The @code{info-link} Widget
@findex info-link@r{ widget}
Syntax:
When this link is invoked, the built-in Info reader is started on
@var{address}.
-@node push-button, editable-field, info-link, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{push-button} Widget
+@node push-button
+@section The @code{push-button} Widget
@findex push-button@r{ widget}
Syntax:
String to suffix push buttons.
@end defopt
-@node editable-field, text, push-button, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{editable-field} Widget
+@node editable-field
+@section The @code{editable-field} Widget
@findex editable-field@r{ widget}
Syntax:
@code{:action}.
@end table
-@node text, menu-choice, editable-field, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{text} Widget
+@node text
+@section The @code{text} Widget
@findex text@r{ widget}
@vindex widget-text-keymap
fields. The default @code{:keymap} is @code{widget-text-keymap}, which
does not rebind the @key{RET} key.
-@node menu-choice, radio-button-choice, text, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{menu-choice} Widget
+@node menu-choice
+@section The @code{menu-choice} Widget
@findex menu-choice@r{ widget}
Syntax:
The list of types.
@end table
-@node radio-button-choice, item, menu-choice, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{radio-button-choice} Widget
+@node radio-button-choice
+@section The @code{radio-button-choice} Widget
@findex radio-button-choice@r{ widget}
Syntax:
widget has been created will @strong{not} be properly destructed when
you call @code{widget-delete}.
-@node item, choice-item, radio-button-choice, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{item} Widget
+@node item
+@section The @code{item} Widget
@findex item@r{ widget}
Syntax:
property. The value should be a string, which will be inserted in the
buffer. This widget will only match the specified value.
-@node choice-item, toggle, item, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{choice-item} Widget
+@node choice-item
+@section The @code{choice-item} Widget
@findex choice-item@r{ widget}
Syntax:
equivalent to activating the parent widget. This widget will only match
the specified value.
-@node toggle, checkbox, choice-item, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{toggle} Widget
+@node toggle
+@section The @code{toggle} Widget
@findex toggle@r{ widget}
Syntax:
emacsen that supports this.
@end table
-@node checkbox, checklist, toggle, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{checkbox} Widget
+@node checkbox
+@section The @code{checkbox} Widget
@findex checkbox@r{ widget}
This widget has two possible states, @samp{selected} and
@var{type} ::= (checkbox [@var{keyword} @var{argument}]...)
@end example
-@node checklist, editable-list, checkbox, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{checklist} Widget
+@node checklist
+@section The @code{checklist} Widget
@findex checklist@r{ widget}
Syntax:
The list of types.
@end table
-@node editable-list, group, checklist, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{editable-list} Widget
+@node editable-list
+@section The @code{editable-list} Widget
@findex editable-list@r{ widget}
Syntax:
List whose @sc{car} is the type of the list elements.
@end table
-@node group, , editable-list, Basic Types
-@comment node-name, next, previous, up
-@subsection The @code{group} Widget
+@node group
+@section The @code{group} Widget
@findex group@r{ widget}
This widget simply group other widgets together.
The value is a list, with one member for each @var{type}.
-@node Sexp Types, Widget Properties, Basic Types, Top
-@comment
-@section Sexp Types
+@node Sexp Types
+@chapter Sexp Types
@cindex sexp types
A number of widgets for editing @dfn{s-expressions} (Lisp types), sexp
* composite::
@end menu
-@node constants, generic, Sexp Types, Sexp Types
-@comment node-name, next, previous, up
-@subsection The Constant Widgets
+@node constants
+@section The Constant Widgets
@cindex constant widgets
The @code{const} widget can contain any Lisp expression, but the user is
An immutable symbol that is bound as a function.
@end deffn
-@node generic, atoms, constants, Sexp Types
-@comment node-name, next, previous, up
-@subsection Generic Sexp Widget
+@node generic
+@section Generic Sexp Widget
@cindex generic sexp widget
The @code{sexp} widget can contain any Lisp expression, and allows the
@code{editable-field} widget. @xref{editable-field}.
@end deffn
-@node atoms, composite, generic, Sexp Types
-@comment node-name, next, previous, up
-@subsection Atomic Sexp Widgets
+@node atoms
+@section Atomic Sexp Widgets
@cindex atomic sexp widget
The atoms are s-expressions that do not consist of other s-expressions.
@end deffn
-@node composite, , atoms, Sexp Types
-@comment node-name, next, previous, up
-@subsection Composite Sexp Widgets
+@node composite
+@section Composite Sexp Widgets
@cindex composite sexp widgets
The syntax for the composite widget construct is:
@end example
@end deffn
-@node Widget Properties, Defining New Widgets, Sexp Types, Top
-@comment node-name, next, previous, up
-@section Properties
+@node Widget Properties
+@chapter Properties
@cindex properties of widgets
@cindex widget properties
@code{:deactivate} keywords instead.
-@node Defining New Widgets, Widget Browser, Widget Properties, Top
-@comment node-name, next, previous, up
-@section Defining New Widgets
+@node Defining New Widgets
+@chapter Defining New Widgets
@cindex new widgets
@cindex defining new widgets
default'' in this text.
@end deffn
-@node Widget Browser, Widget Minor Mode, Defining New Widgets, Top
-@comment node-name, next, previous, up
-@section Widget Browser
+@node Widget Browser
+@chapter Widget Browser
@cindex widget browser
There is a separate package to browse widgets. This is intended to help
When called interactively, use the position of point.
@end deffn
-@node Widget Minor Mode, Utilities, Widget Browser, Top
-@comment node-name, next, previous, up
-@section Widget Minor Mode
+@node Widget Minor Mode
+@chapter Widget Minor Mode
@cindex widget minor mode
There is a minor mode for manipulating widgets in major modes that
Keymap used in @code{widget-minor-mode}.
@end defvar
-@node Utilities, Widget Wishlist, Widget Minor Mode, Top
-@comment node-name, next, previous, up
-@section Utilities.
+@node Utilities
+@chapter Utilities
@cindex utility functions for widgets
@defun widget-prompt-value widget prompt [ value unbound ]
This is only meaningful for radio buttons or checkboxes in a list.
@end defun
-@node Widget Wishlist, GNU Free Documentation License, Utilities, Top
-@comment node-name, next, previous, up
-@section Wishlist
+@node Widget Wishlist
+@chapter Wishlist
@cindex todo
@itemize @bullet
Add a @code{mailto} widget.
@end itemize
-@node GNU Free Documentation License, Index, Widget Wishlist, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Index, , GNU Free Documentation License, Top
-@comment node-name, next, previous, up
+@node Index
@unnumbered Index
This is an alphabetical listing of all concepts, functions, commands,
@item
For generating the lookahead sets, Wisent uses the well-known
-technique of F. DeRemer and A. Pennello they described in:
+technique of F. DeRemer and A. Pennello described in:
@quotation
-@cite{Efficient Construction of LALR(1) Lookahead Sets}@*
-October 1982, ACM TOPLS Vol 4 No 4.
+@cite{Efficient Computation of LALR(1) Look-Ahead Sets}@*
+October 1982, ACM TOPLAS Vol 4 No 4, 615--49,
+@uref{http://dx.doi.org/10.1145/69622.357187}.
@end quotation
@item
* Conflicts::
@end menu
-@node Grammar format, Example, Wisent Grammar, Wisent Grammar
-@comment node-name, next, previous, up
+@node Grammar format
@section Grammar format
@cindex grammar format
Says that two groupings of type @samp{exp}, with a @samp{+} token in
between, can be combined into a larger grouping of type @samp{exp}.
-
+
@cindex grammar coding conventions
By convention, a nonterminal symbol should be in lower case, such as
@samp{exp}, @samp{stmt} or @samp{declaration}. Terminal symbols
@end table
@end table
-@node Example, Compiling a grammar, Grammar format, Wisent Grammar
-@comment node-name, next, previous, up
+@node Example
@section Example
@cindex grammar example
@end group
@end example
-@node Compiling a grammar, Conflicts, Example, Wisent Grammar
-@comment node-name, next, previous, up
+@node Compiling a grammar
@section Compiling a grammar
@cindex automaton
@end table
@end defun
-@node Conflicts, , Compiling a grammar, Wisent Grammar
-@comment node-name, next, previous, up
+@node Conflicts
@section Conflicts
Normally, a grammar should produce an automaton where at each state
@item start
@itemx end
-Are the optionals beginning and end positions of @var{value} in the
+Are the optional beginning and ending positions of @var{value} in the
input stream.
@end table
@example
@group
-(stmnt (( error ?; )) ;; on error, skip until ';' is read
- )
+(statement (( error ?; )) ;; on error, skip until ';' is read
+ )
@end group
@end example
* Useful functions::
@end menu
-@node Iterative style, Bison style, Grammar styles, Grammar styles
+@node Iterative style
@subsection Iterative style
@cindex grammar iterative style
@c %**start of header
@setfilename ../../info/woman
@settitle WoMan: Browse Unix Manual Pages ``W.O. (without) Man''
-@c FIXME
-@c Manual last updated:
-@set UPDATED Time-stamp: <2012-12-31 21:44:20 eggert>
-@c Software version:
-@set VERSION 0.54 (beta)
+@include emacsver.texi
@afourpaper
@c With different size paper the printed page breaks will need attention!
@c Look for @page and @need commands.
@titlepage
@title WoMan
@subtitle Browse Unix Manual Pages ``W.O. (without) Man''
-@subtitle Software Version @value{VERSION}
+@subtitle as distributed with Emacs @value{EMACSVER}
@author Francis J. Wright
@sp 2
@author School of Mathematical Sciences
@author @email{F.J.Wright@@qmul.ac.uk}
@author @uref{http://centaur.maths.qmw.ac.uk/}
@c He no longer maintains this manual.
-@sp 2
-@author Manual Last Updated @value{UPDATED}
@comment The following two commands start the copyright page.
@page
@c ===================================================================
@ifnottex
-@node Top, Introduction, (dir), (dir)
-@comment node-name, next, previous, up
+@node Top
@top WoMan: Browse Unix Manual Pages ``W.O. (without) Man''
@display
-Software Version @value{VERSION}
-Manual Last Updated @value{UPDATED}
+As distributed with Emacs @value{EMACSVER}.
@email{F.J.Wright@@qmw.ac.uk, Francis J. Wright}
@uref{http://centaur.maths.qmw.ac.uk/, School of Mathematical Sciences}
@c ===================================================================
-@node Introduction, Background, Top, Top
-@comment node-name, next, previous, up
+@node Introduction
@chapter Introduction
@cindex introduction
@c ===================================================================
-@node Background, Finding, Introduction, Top
-@comment node-name, next, previous, up
+@node Background
@chapter Background
@cindex background
emulation of @code{troff} as GNU Emacs moves to providing bit-mapped
display facilities.
-@node Finding, Browsing, Background, Top
-@comment node-name, next, previous, up
+@node Finding
@chapter Finding and Formatting Man Pages
@cindex using, finding man pages
@cindex using, formatting man pages
* Automatic:: Automatic Interface
@end menu
-@node Topic, Filename, Finding, Finding
-@comment node-name, next, previous, up
+@node Topic
@section Topic Interface
@cindex topic interface
* Word at point:: Using the "Word at Point" as a Topic Suggestion
@end menu
-@node Cache, Word at point, Topic, Topic
-@comment node-name, next, previous, up
+@node Cache
@subsection The WoMan Topic Cache
@cindex topic cache
@cindex cache, topic
time it is run in a new Emacs session.
-@node Word at point, , Cache, Topic
-@comment node-name, next, previous, up
+@node Word at point
@subsection Using the "Word at Point" as a Topic Suggestion
@cindex word at point
@cindex point, word at
@end lisp
-@node Filename, Automatic, Topic, Finding
-@comment node-name, next, previous, up
+@node Filename
@section Filename Interface
@cindex filename interface
primarily used internally by WoMan.
-@node Automatic, , Filename, Finding
-@comment node-name, next, previous, up
+@node Automatic
@section Automatic Interface
@cindex automatic interface
@c ===================================================================
-@node Browsing, Customization, Finding, Top
-@comment node-name, next, previous, up
+@node Browsing
@chapter Browsing Man Pages
@cindex using, browsing man pages
@cindex browsing man pages
* Imenu:: Imenu Support; Contents Menu
@end menu
-@node Fonts, Navigation, Browsing, Browsing
-@comment node-name, next, previous, up
+@node Fonts
@section Fonts and Faces
@cindex fonts
@cindex faces
sub-scripts, which are not displayed well by WoMan.
-@node Navigation, References, Fonts, Browsing
-@comment node-name, next, previous, up
+@node Navigation
@section Navigation
@cindex navigation
@end table
-@node References, Changing, Navigation, Browsing
-@comment node-name, next, previous, up
+@node References
@section Following References
@cindex following references
@cindex references
@end table
-@node Changing, Convenience, References, Browsing
-@comment node-name, next, previous, up
+@node Changing
@section Changing the Current Man Page
@cindex changing current man page
@cindex current man page, changing
@end table
-@node Convenience, Imenu, Changing, Browsing
-@comment node-name, next, previous, up
+@node Convenience
@section Convenience Key Bindings
@cindex convenience key bindings
@cindex key bindings, convenience
@end table
-@node Imenu, , Convenience, Browsing
-@comment node-name, next, previous, up
+@node Imenu
@section Imenu Support; Contents Menu
@cindex imenu support
@cindex contents menu
@c ===================================================================
-@node Customization, Log, Browsing, Top
-@comment node-name, next, previous, up
+@node Customization
@chapter Customization
@cindex customization
* Special symbols::
@end menu
-@node Interface Options, Formatting Options, Customization, Customization
-@comment node-name, next, previous, up
+@node Interface Options
@section Interface Options
@cindex interface options
@end vtable
-@node Formatting Options, Faces, Interface Options, Customization
-@comment node-name, next, previous, up
+@node Formatting Options
@section Formatting Options
@cindex formatting options
@end vtable
-@node Faces, Special symbols, Formatting Options, Customization
-@comment node-name, next, previous, up
+@node Faces
@section Faces
@cindex faces
@end vtable
-@node Special symbols, , Faces, Customization
-@comment node-name, next, previous, up
+@node Special symbols
@section Special symbols
@cindex special symbols
@c ===================================================================
-@node Log, Technical, Customization, Top
-@comment node-name, next, previous, up
+@node Log
@chapter The *WoMan-Log* Buffer
@cindex log buffer
@cindex buffer, log
@c ===================================================================
-@node Technical, Bugs, Log, Top
-@comment node-name, next, previous, up
+@node Technical
@chapter Technical Details
@cindex technical details
@cindex horizontal spacing
@c ===================================================================
-@node Bugs, Acknowledgments, Technical, Top
-@comment node-name, next, previous, up
+@node Bugs
@chapter Reporting Bugs
@cindex reporting bugs
@cindex bugs, reporting
@c ===================================================================
-@node Acknowledgments, GNU Free Documentation License, Bugs, Top
-@comment node-name, next, previous, up
+@node Acknowledgments
@chapter Acknowledgments
@cindex acknowledgments
@page
-@node GNU Free Documentation License, Command Index, Acknowledgments, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
-@node Command Index, Variable Index, GNU Free Documentation License, Top
-@comment node-name, next, previous, up
+@node Command Index
@unnumbered Command Index
@printindex fn
-@node Variable Index, Keystroke Index, Command Index, Top
-@comment node-name, next, previous, up
+@node Variable Index
@unnumbered Variable Index
@printindex vr
@page
-@node Keystroke Index, Concept Index, Variable Index, Top
-@comment node-name, next, previous, up
+@node Keystroke Index
@unnumbered Keystroke Index
@printindex ky
@page
-@node Concept Index, , Keystroke Index, Top
-@comment node-name, next, previous, up
+@node Concept Index
@unnumbered Concept Index
@printindex cp
Aaron Larson: co-wrote bibtex.el
-Aaron S. Hawley: changed files.texi morse.el tar-mode.el thingatpt.el
- add-log.el autoinsert.el building.texi custom.texi files.el
- glossary.texi isearch.el jka-cmpr-hook.el make-mode.el misc.texi
- re-builder.el sgml-mode.el simple.el texinfo.el tutorial.el vc.el
+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-html.el org-odt.el org.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-clock.el org.texi org-compat.el ob-R.el
- ob.el org-agenda.el org-exp-blocks.el ob-C.el ob-ditaa.el ob-exp.el
- ob-fortran.el ob-ref.el org-bbdb.el org-element.el org-gnus.el
- org-install.el org-macs.el org-odt.el org-version.el
+Achim Gratz: changed org-clock.el org.el org.texi ob-ref.el ob.el
+ org-macs.el
Adam Gołębiowski: changed Makefile.in
-Adam Hupp: changed gud.el progmodes/python.el
+Adam Hupp: changed emacs.py emacs2.py emacs3.py gud.el
+ progmodes/python.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 org-clock.el org-html.el
+Adam Spiers: changed calendar.el
Adam W: changed mail-source.el
Adrian Robert: co-wrote ns-win.el
and changed nsterm.m nsfns.m nsfont.m nsterm.h Makefile.in nsmenu.m
- configure.ac README config.in emacs.c font.c keyboard.c nsgui.h
- nsimage.m xdisp.c image.c lisp.h macos.texi menu.c darwin.h faces.el
- and 77 other files
+ 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
Ævar Arnfjörð Bjarmason: changed rcirc.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 font-core.el
- isearch.el lisp.el modes.texi cc-menus.el cc-subword.el display.texi
- os.texi search.texi startup.el subr.el text.texi INSTALL.BZR add-log.el
- buffers.texi bytecomp.el callint.c and 22 other files
+ isearch.el lisp.el modes.texi cc-subword.el display.texi os.texi
+ search.texi startup.el subr.el text.texi INSTALL.BZR 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
Alex Coventry: changed files.el
-Alex Ott: changed TUTORIAL.ru ru-refcard.tex idle.el ispell.el
- ru-refcard.ps
+Alex Ott: changed TUTORIAL.ru ru-refcard.tex ispell.el ru-refcard.ps
Alex Rezinsky: wrote which-func.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
Alexandre Veyrenc: changed fr-refcard.tex
Alexandru Harsanyi: wrote soap-client.el soap-inspect.el
-and changed vc-hooks.el vc.el xml.el
+and changed emacs3.py vc-hooks.el vc.el xml.el
Alfred Correira: changed generic-x.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
Alon Albert: wrote rcompile.el
-Alp Aker: changed nsfont.m nsterm.m nsfns.m nsmenu.m nsterm.h
- buff-menu.el configure.ac 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
Andre Spiegel: changed vc.el vc-hooks.el vc-cvs.el vc-rcs.el vc-sccs.el
files.el dired.el files.texi cperl-mode.el ediff-util.el log-view.el
parse-time.el startup.el tramp-vc.el vc-arch.el vc-mcvs.el vc-svn.el
- viper-util.el
+ vcdiff viper-util.el
Andre Srinivasan: changed gnus-group.el gnus-sum.el gnus.texi message.el
mm-decode.el mml.el nnmail.el
Andreas Luik: changed xfns.c xterm.c
-Andreas Politz: changed editfns.c elp.el ido.el outline.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 Makefile.in configure.ac lisp.h xdisp.c alloc.c
- process.c coding.c files.el keyboard.c emacs.c fileio.c xterm.c
- editfns.c print.c fns.c eval.c lread.c xfns.c font.c buffer.c sysdep.c
- and 606 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
Andreas Vögele: changed pgg-def.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 Makefile.in configure.ac frame.h macterm.h titdic-cnv.el
+ 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
Andrew Hall: changed paren.el
-Andrew Hyatt: changed org-archive.el org.el org.texi
-
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 inc/ms-w32.h
+ 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
Andrey Zhdanov: changed gud.el
-Andrzej Lichnerowicz: wrote ob-io.el ob-scala.el
-
Andy Moreton: changed makefile.w32-in
Andy Norman: wrote ange-ftp.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 mule.texi startup.el time-date.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: changed ada-mode.texi frames.texi texinfo.el
Ashwin Ram: wrote refer.el
-Atsuo Ohki: changed lread.c
-
Aubrey Jaffer: changed info.el unexelf.c
-Aurelien Aptel: changed cus-face.el dispextern.h display.texi faces.el
- nsterm.m w32term.c xfaces.c xterm.c
-
-Aurélien Aptel: changed url.texi
-
Axel Boldt: changed ehelp.el electric.el
B. Anyos: changed w32term.c
Barry Fishman: changed gnu-linux.h
-Barry Oreilly: changed eval.c keyboard.c lisp.h
-
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 org-clock.el org-html.el
- org-capture.el org-table.el org-exp.el ob.el org-publish.el
- org-timer.el org-colview.el org-mobile.el org-archive.el org-compat.el
- org-faces.el org-id.el org-pcomplete.el org-export-latex.el
- org-ascii.el org-icalendar.el and 84 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 makefile.w32-in
- INSTALL gmake.defs nmake.defs w32.h w32term.c configure.ac emacs.c
- inc/ms-w32.h keyboard.c make-docfile.c nsfont.m nsterm.m sound.c
- xfaces.c
+ 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
Benjamin Drieu: wrote pong.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
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
Boris Samorodov: changed imap.el
-Boyd Lynn Gerber: changed configure.ac
+Boyd Lynn Gerber: changed configure.in
Brad Howes: changed gnus-demon.el
Brian D. Carlstrom: changed gud.el smtpmail.el
-Brian Fox: changed Makefile.in Makefile configure.ac minibuf.c dired.el
+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 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 O'Sullivan: changed ange-ftp.el
-Bt Templeton: changed lread.c nsfont.m
-
-Caio Tiago Oliveira: changed ob-scala.el
-
Caleb Deupree: changed w32-fns.el
Carl D. Roth: changed gnus-nocem.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-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
+ 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
and changed org-latex.el org.texi org-publish.el orgcard.tex
- org-export-latex.el org-docbook.el org-attach.el org-mouse.el
- org-protocol.el org-mac-message.el org-wl.el org-crypt.el
+ 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 org-special-blocks.el reftex.texi ob.el and 24 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
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 xdisp.c display.texi files.el frames.texi
- cus-edit.el files.texi subr.el custom.el keyboard.c text.texi
- startup.el faces.el package.el misc.texi emacs.texi mouse.el
- custom.texi image.c window.el xterm.c and 938 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: wrote org-special-blocks.el
-and changed mm-decode.el org-html.el
+and changed mm-decode.el
Chris Hall: changed callproc.c frame.c
Christian Egli: wrote org-taskjuggler.el
and changed org.texi
-Christian Faulhammer: changed Makefile.in configure configure.ac
+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 Neukirchen: changed mm-util.el
-Christian Ohler: wrote ert-tests.el ert.el
-and co-wrote ert-x.el
-and changed Makefile.in automated configure.ac ert-x-tests.el ert.texi
+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 von Roques: changed mml2015.el epg.el gnus-start.el
-Christoph Bauer: changed configure.ac
+Christoph Bauer: changed configure.in
Christoph Conrad: changed gnus-agent.el gnus-score.el makefile.w32-in
qp.el
-Christoph Dittmann: changed org-beamer.el
-
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
and changed format.el gnus-art.el gnus-picon.el message.el register.el
smiley.el texinfmt.el
-Christophe Junke: changed org-agenda.el
-
-Christophe Rhodes: changed org-exp.el org-latex.el
+Christophe Rhodes: changed org-exp.el
Christophe de Dinechin: co-wrote ns-win.el
Christopher Oliver: changed mouse.el
-Christopher Schmidt: changed ibuffer.el cl-macs.el files.el files.texi
- gnus-msg.el gnus.texi help-fns.el lread.c pp.el
+Christopher Schmidt: changed ibuffer.el
Christopher Suckling: co-wrote org-mac-message.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 gnus.texi
- mm-decode.el mm-uu.el mml-smime.el Makefile.in auth.texi gnus-sum.el
+ 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 19 other files
+ epa-setup.el epg-package-info.el faces.el files.el and 17 other files
Dale Gulledge: changed TUTORIAL.eo
Dale R. Worley: wrote emerge.el (public domain)
and changed mail-extr.el
-Dale Sedivec: changed wisent/python.el
-
Damien Elmes: changed erc.el erc-dcc.el erc-track.el erc-log.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
Dan Nicolaescu: wrote iris-ansi.el romanian.el vc-dir.el
and co-wrote hideshow.el
-and changed vc.el Makefile.in configure.ac vc-hg.el vc-git.el vc-bzr.el
+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 919 other files
+ and 918 other files
Dan Rosenberg: changed movemail.c
-Dani Moncayo: changed buffers.texi lists.texi makefile.w32-in mini.texi
- basic.texi custom.texi dired.texi display.texi killing.texi mark.texi
- simple.el text.texi
-
-Daniel Bergey: changed quail/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 org-html.el
Daniel Colascione: co-wrote js.el
-and changed w32fns.c cygw32.c image.c Makefile.in cygw32.h emacs.c
- keyboard.c w32term.h menu.c unexw32.c w32.c w32console.c w32font.c
- w32menu.c w32proc.c w32select.c w32select.h w32xfns.c cmdproxy.c
- conf_post.h configure.ac and 63 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 org-exp.el
+Daniel Dehennin: changed mml2015.el gnus-msg.el mm-decode.el
Daniel E. Doherty: changed calc.texi
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: changed package.el emacsclient.c process.c
+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
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
+Darren Hoo: changed db.el gnus-art.el
Darren Stalder: changed gnus-util.el
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 Makefile.in configure.ac help.el mule-cmds.el fortran.el
+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
David A. Capello: changed etags.c
-David Abrahams: changed gnus-int.el gnus-sum.el gnus-registry.el
- org-agenda.el auth-source.el coding.c cus-start.el ediff-init.el
- filelock.c gnus-range.el gnus.texi mairix.el nnimap.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
mm-view.el mml2015.el nnfolder.el nnimap.el nnml.el
David Engster: wrote mairix.el nnmairix.el
-and changed cedet/semantic.el gnus.texi insert.el bovine-grammar.el
- db-find.el ede-grammar.el grammar.el registry.el wisent/python.el
- analyze/complete.el bovine/el.el cpp-root.el db-el.el db-file.el db.el
- dictionary.el eieio-opt.el eieio.el fw.el gnus-msg.el javascript.el
- and 63 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
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-lib.el cl-macs.el cl-seq.el
- cl.texi edmacro.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
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
-David J. MacKenzie: changed configure.ac etags.c Makefile.in fakemail.c
+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 13 other files
+ etags-vmslib.c fortran.el hexl.c and 14 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
and changed imenu.el pgg-def.el xterm.c
David Maus: co-wrote org-wl.el
-and changed org.el org-agenda.el org-exp.el org-feed.el org-html.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
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 org-publish.el
and co-wrote ob-lisp.el
-David Ponce: wrote cedet.el comp.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/wisent.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
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 Makefile.in cus-start.el
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
-Deanna Phillips: changed configure.ac
+Deanna Phillips: changed configure.in
Debarshi Ray: changed erc-backend.el erc.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
Dmitri Paduchikh: changed advice.el
-Dmitry Antipov: changed alloc.c buffer.c lisp.h xdisp.c editfns.c print.c
- window.c buffer.h keyboard.c xfns.c w32fns.c fns.c frame.c xterm.c
- minibuf.c data.c fontset.c insdel.c intervals.c lread.c window.h
- and 112 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 vc-git.el lisp.el
- log-edit.el ruby.rb vc-hooks.el window.el
+Dmitry Gutov: changed lisp.el ruby-mode.el
Dmitry Kurochkin: changed isearch.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 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 and 10 other files
+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
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 sysdep.c vc-rcs.el
+ nxml-mode.texi objects.texi ps-print.el vc-rcs.el
Eduardo Muñoz: changed dired.el ls-lisp.el
erc-list.el erc-macs.el erc-match.el erc-ring.el erc-services.el
erc-stamp.el goto-addr.el latin-ltx.el progmodes/python.el url-auth.el
-Edward Reingold: changed cal-tex.el
-
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
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 w32.c
- fileio.c config.bat sed1v2.inp simple.el msdos.h w32fns.c mainmake.v2
- rmail.el display.texi info.el process.c dispnew.c pc-win.el emacs.c
- startup.el and 738 other files
+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 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
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 info.el rmail.el speedbspec.el cedet.el ede.texi eieio.texi
- 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 sb-tag-v.xpm sb-tag.xpm Makefile.in
- and 28 other files
+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 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
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 org-src.el
- ob-plantuml.el org-macs.el org-table.el org-agenda.el org-mouse.el
- orgcard.tex ob-lilypond.el ob-mscgen.el ob-octave.el ob-screen.el
- org-ascii.el org-clock.el org-compat.el org-footnote.el org-html.el
- gnus-art.el and 7 other files
+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 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
Fabian Ezequiel Gallina: changed progmodes/python.el
-Fabián E. Gallina: wrote progmodes/python.el
-
-Fabián Ezequiel Gallina: changed progmodes/python.el
-
Fabrice Bauzac: changed dired-aux.el
-Fabrice Niessen: changed org-agenda.el
-
-Fabrice Popineau: changed w32.c w32fns.c nmake.defs w32heap.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
- gmalloc.c gnus-cache.el image.c inc/ms-w32.h inttypes.h lisp.h
- and 18 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
Feng Li: changed calc-ext.el
-Feng Shu: changed org.el org-exp.el org-html.el org-latex.el org.texi
-
Ferenc Wagner: changed nnweb.el
Filipe Cabecinhas: changed nsterm.m
Flemming Hoejstrup Hansen: changed forms.el
-Florian Adamsky: changed recentf.el
-
Florian Ragwitz: changed gnus-html.el sieve-manage.el
Florian Weimer: changed message.el gnus.el coding.c gnus-sum.el gnus.texi
Francesco Potortì: wrote cmacexp.el
and changed etags.c man.el delta.h etags.1 undigest.el Makefile.in
- comint.el configure.ac maintaining.texi uniquify.el latin-post.el
+ 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
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
Frederic Pierresteguy: wrote widget.c
and changed xmenu.c xterm.c xfns.c dpx2.h lwlib.c rmailsum.el rmail.el
- xlwmenu.c xterm.h lwlib-Xaw.c lwlib-Xlw.c Makefile.in configure.ac
+ 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
G Dinesh Dutt: changed etags.el
-Gabor Vida: changed ido.el
-
Gareth Jones: changed fns.c gnus-score.el
Garrett Wollman: changed sendmail.el
and changed makefile.nt w32fns.c fileio.c makefile.def callproc.c
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 inc/ms-w32.h and 105 other files
+ 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 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 Makefile.in faces.el alloc.c buffer.c
- startup.el xterm.h fns.c simple.el term.c configure.ac frame.c xmenu.c
- and 616 other files
+ 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 alloc.c
+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
-Giovanni Ridolfi: changed org.texi
-
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 Makefile.in configure.ac calendar.el diary-lib.el rmail.el
- files.el progmodes/f90.el cal-menu.el emacs.texi appt.el bytecomp.el
- cal-hebrew.el makefile.w32-in holidays.el make-dist fortran.el ack.texi
- calendar.texi cal-tex.el simple.el sed1v2.inp and 1349 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
Greg Hill: changed bytecomp.el
-Greg Hudson: changed configure.ac indent.c
+Greg Hudson: changed configure.in indent.c
Greg Klanderman: changed messagexmas.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
Han-Wen Nienhuys: changed emacsclient.c server.el
-Hanataka, Shinya: changed coding.c
-
Hans Chalupsky: wrote advice.el trace.el
and changed bytecomp.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 org-publish.el
+Harri Kiiskinen: changed org-publish.el
Heiko Muenkel: changed b2m.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
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
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
International Business Machines: changed emacs.c fileio.c process.c
sysdep.c unexcoff.c
-Ippei Furuhashi: changed org-colview.el org.texi
-
Irie Shinsuke: changed subr.el
Irie Tetsuya: changed gnus.texi message.texi
Itai Zukerman: changed mm-decode.el
-Ivan Andrus: changed ibuf-ext.el ibuffer.el
-
Ivan Boldyrev: changed mml1991.el
Ivan Kanis: wrote vc-hg.el
Jaap-Henk Hoepman: changed mm-decode.el
-Jack Duthen: changed which-func.el
-
Jack Repenning: changed unexelfsgi.c
Jack Twilley: changed message.el
Jambunathan K: wrote org-lparse.el org-odt.el
and changed org.el org-exp.el org.texi OrgOdtContentTemplate.xml
- OrgOdtStyles.xml org-footnote.el org-inlinetask.el register.el
- htmlfontify.el minibuffer.el org-bbdb.el org-compat.el org-html.el
- package-x.el quail/indian.el regs.texi tar-mode.el vc-dir.el
+ 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
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
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: changed org.texi
-
Jan Böcker: wrote org-docview.el
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 xfns.c nsterm.m configure.ac xmenu.c
- xterm.h gtkutil.h Makefile.in keyboard.c x-win.el nsfns.m nsmenu.m
- frame.c frames.texi nsterm.h xsettings.c emacs.c xselect.c process.c
- xlwmenu.c and 306 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
Jan Seeger: changed org-publish.el parse-time.el
-Jan Tatarik: changed gnus-score.el gnus-logic.el
-
Jan Vroonhof: changed gnus-cite.el gnus-msg.el nntp.el
Jan-Hein Buhrman: changed ange-ftp.el env.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 desktop.el
em-ls.el emacs-lisp/debug.el emacsclient.1 executable.el files.el
- and 21 other files
+ and 20 other files
Jason Baker: changed gnus-art.el
Jason Dunsmore: changed org-html.el org.el
-Jason L. Wright: changed smtpmail.el
-
Jason Merrill: changed gnus-sum.el add-log.el gnus-salt.el imap.el
nnfolder.el
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
- calccomp.el calc-math.el calc-arith.el calc-graph.el calc-misc.el
- calc-alg.el calc-forms.el calc-store.el calc-yank.el calcalg2.el
- calc-bin.el calc-mode.el and 40 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-Philippe Theberge: wrote thumbs.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
Jim Blandy: wrote tvi970.el
and co-wrote wyse50.el
and changed keyboard.c xterm.c xfns.c Makefile.in window.c process.c
- ymakefile dispnew.c xdisp.c sysdep.c configure.ac lisp.h keymap.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 388 other files
-Jim Diamond: changed server.el
-
Jim Kingdon: changed emacsclient.c emacs.tex functions.texinfo hp300bsd.h
rmail.el
-Jim Meyering: changed lread.c w32.c w32font.c copyright.el ebrowse.c
- emacs.c make-docfile.c nsfont.m pop.c term.c xfaces.c xselect.c xterm.c
- Makefile.in alloc.c artist.el autoinsert.el buffer.h callproc.c
- character.h charset.c and 56 other files
+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
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
Jochen Küpper: changed gnus.texi calc-units.el
-Joe Buehler: changed Makefile.in configure.ac cygwin.h browse-url.el
+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 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
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 50 other files
+ 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 Basrai: changed man.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 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
- and 22 other files
+ 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 19 other files
John Williams: changed etags.el
Jon K Hellan: wrote utf7.el
Jonathan I. Kamens: changed pop.c movemail.c rmail.el Makefile.in
- configure.ac b2m.pl config.in files.el pop.h terminal.el vc.el
+ 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
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
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
João Cachopo: changed spam.el
-João Távora: changed tex-mode.el
-
Juan León Lahoz García: wrote wdired.el
and changed files.el perl-mode.el
and changed ob-octave.el
Juanma Barranquero: wrote emacs-lock.el
-and changed makefile.w32-in subr.el w32fns.c server.el emacsclient.c
- files.el bs.el config.nt help-fns.el faces.el org.el simple.el xdisp.c
- buffer.c w32.c ido.el keyboard.c w32term.c desktop.el process.c
- window.c and 1098 other files
+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
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 gnus-html.el gnus.el
- message.el gnus-group.el gnus-util.el mm-decode.el gnus-sum.el
- mm-view.el org.el gnus.texi nnimap.el mm-uu.el nnir.el sieve-manage.el
- color-lab.el gnus-demon.el gnus-msg.el url-cache.el and 94 other files
+ 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
Jure Cuhalev: changed ispell.el
Juri Linkov: wrote files-x.el misearch.el occur-tests.el
-and changed info.el isearch.el simple.el replace.el dired-aux.el
- progmodes/grep.el dired.el progmodes/compile.el startup.el faces.el
- files.el descr-text.el display.texi menu-bar.el bindings.el cus-edit.el
- image-mode.el ispell.el man.el dired-x.el arc-mode.el
- and 339 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
Justus Piater: changed smtpmail.el
-Jérémie Courrèges-Anglas: changed org-latex.el org.texi
+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.ac
+Jérôme Marant: changed Makefile.in make-dist bindings.el configure.in
emacsclient.c misc.texi
Jürgen Hötzel: changed comint.el url-handlers.el wid-edit.el
Kailash C. Chowksey: changed HELLO Makefile.in ind-util.el kannada.el
knd-util.el loadup.el makefile.w32-in
-Kalle Kankare: changed image.c
-
Kalle Olavi Niemitalo: changed keyboard.c
Kan-Ru Chen: changed nnir.el ecomplete.el gnus-diary.el gnus.texi
Kanematsu Daiji: changed nnimap.el
-Karel Klíč: changed fileio.c files.el Makefile.in configure.ac eval.c
+Karel Klíč: changed fileio.c files.el Makefile.in configure.in eval.c
ftfont.c lisp.h text.texi tramp.el
Karl Berry: changed emacs.texi info.texi elisp.texi text.texi anti.texi
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.BZR 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 Makefile.in data.c
+ 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 443 other files
+ 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
Katsumi Yamaoka: wrote canlock.el
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 gnus-msg.el gnus-util.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 141 other files
+ 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
Kayvan Sylvan: changed supercite.el
-Kazuhiro Ito: changed coding.c flow-fill.el font.c starttls.el
+Kazuhiro Ito: changed coding.c flow-fill.el
Kazushi Marukawa: changed filelock.c hexl.c profile.c unexalpha.c
Keith Packard: changed font.c
-Ken Brown: changed configure.ac cygwin.h browse-url.el gmalloc.c sheap.c
- emacs.c vm-limit.c xgselect.c callproc.c dired.c fileio.c gdb-mi.el
- loadup.el mem-limits.h unexcw.c xfns.c xterm.h
+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
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.ac emacs.c undo.c xfns.c xterm.c charset.h coding.h fontset.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
and changed coding.c mule-cmds.el mule.el fontset.c charset.c xdisp.c
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 408 other files
+ xfaces.c editfns.c and 388 other files
Kenichi Okada: co-wrote sasl-cram.el sasl-digest.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
Kevin Ryde: wrote info-xref.el
and changed info-look.el info.el checkdoc.el cl.texi compilation.txt
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 etags.c flyspell.el keyboard.c mailcap.el and 81 other files
+ 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
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
x-win.el xdisp.c xt-mouse.el xterm.c xterm.h .gdbinit AT386.el HELLO
Makefile.in and 101 other files
-Laimonas Vėbra: changed european.el
-
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
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
+ 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
+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 simple.el gnus-nocem.el
- gnus-registry.el imap.el nnkiboze.el nnrss.el nnslashdot.el
- and 219 other files
+ 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
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 24 other files
+ and 23 other files
Lawrence R. Dodd: co-wrote dired-x.el
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 hilit-chg.el misc.el
-
Leigh Stoller: changed emacsclient.c server.el
-Lennart Borgman: wrote org-freemind.el
-and 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: changed rcirc.el ido.el abbrev.el progmodes/python.el files.el
- makefile.w32-in subr.el diff-mode.el font-lock.el Makefile.in
- cc-cmds.el deps.mk dnd.el em-hist.el erc.el flymake.el fns.c
- footnote.el fringe.c gnulib.mk help-mode.el and 78 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
-Levin Du: changed parse-time.el org-clock.el
+Levin Du: changed parse-time.el
-Liam Healy: changed outline.el
+Lewis Perin: changed emacs.manifest
-Liam Stitt: changed url-file.el url-vars.el
+Liam Healy: changed outline.el
Liang Wang: changed etags.el
Ludovic Courtes: changed nnregistry.el
Ludovic Courtès: wrote nnregistry.el
-and changed configure.ac gnus.texi
+and changed gnus.texi
Lukas Huonker: changed tetris.el
Maciek Pasternacki: changed nnrss.el
-Madan Ramakrishnan: changed org-agenda.el
-
Magnus Henoch: changed url-http.el ispell.el url.el dbusbind.c dns.el
- nnmaildir.el url-gw.el url-parse.el url-proxy.el autoinsert.el cl.texi
- configure.ac dbus.el gnus.texi hashcash.el log-edit.el message.el
- org-clock.el org-latex.el org-table.el process.c and 11 other files
+ 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
Marco Walther: changed mips-siemens.h unexelfsni.c unexsni.c
-Marcus G. Daniels: changed xterm.c configure.ac lwlib-Xm.c lwlib.c
+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
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 Makefile.in amdx86-64.h configure configure.ac
+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
-
Mark H. Weaver: changed comint.el
Mark Hood: changed gnus-uu.el
Mark Plaksin: changed nnrss.el term.el
-Mark Shoulson: changed org-entities.el org.el
+Mark Shoulson: changed org.el
Mark Thomas: changed flow-fill.el gnus-sum.el gnus-util.el nnmail.el
Markus Rost: wrote cus-test.el
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.ac custom.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
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
Martin Pohlack: changed iimage.el pc-select.el
-Martin Rudalics: changed window.el window.c windows.texi help.el frame.c
- buffer.c cus-start.el window.h dired.el frame.el subr.el cus-edit.el
- files.el buffers.texi mouse.el emacs-lisp/debug.el keyboard.c xdisp.c
- add-log.el lisp.h simple.el and 145 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
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 gnus-demon.el mm-decode.el simple.el
+ gnus-art.el mm-decode.el simple.el
Martin Svenson: changed progmodes/python.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 buffer.c
- cc-langs.el cus-face.el dired-x.el and 78 other files
+ 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
Mathias Megyei: changed Makefile.in
-Mats Lidell: changed TUTORIAL.sv european.el gnus-art.el org-element.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
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
Matthew Junker: changed cal-tex.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
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
-
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-fish.el files.el files.texi tramp-imap.el Makefile.in
- notifications.el tramp-vc.el tramp-util.el tramp-uu.el configure.ac
- em-unix.el simple.el auth-source.el dired-aux.el keyboard.c
- and 80 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.el org-agenda.el org-capture.el org.texi
- ob-tangle.el org-feed.el org-id.el org-list.el org-table.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
Michael Harnois: changed nnimap.el
-Michael Heerdegen: changed emacs-lisp/debug.el wdired.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 intel386.h linux.h
+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
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-ascii.el org-docbook.el
- org-html.el org-latex.el org-table.el org.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 Staats: wrote pc-select.el
-Michael Vehrs: changed woman.el
-
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 Witten: changed TUTORIAL fixit.texi intro.texi
-
Michal Jankowski: changed insdel.c keyboard.c
-Michal Nazarewicz: changed frame.c frame.h ispell.el mpc.el server.el
- w32term.c xterm.c
+Michal Nazarewicz: changed frame.c frame.h ispell.el w32term.c xterm.c
Michal Sojka: changed org-icalendar.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
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
Motorola: changed buff-menu.el
-Muchenxuan Tong: changed 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
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 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
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
-and changed vnvi.el
-
Niall Mansfield: changed etags.c
Nic Ferrier: changed tramp.el
Nick Alcock: changed gnus.el
-Nick Dokos: changed org-exp.el icalendar.el mh-search.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
Nicolas Avrutin: changed url-http.el
-Nicolas Calderon Asselin: changed org-clock.el
-
-Nicolas Goaziou: wrote org-element.el
-and 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 ob.el org-agenda.el org-ascii.el org-capture.el
- org.texi org-archive.el org-macs.el org-mouse.el org-table.el ob-exp.el
- and 7 other files
-
-Nicolas Richard: changed Makefile.in
+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-icalendar.el org-latex.el org-table.el
+ org-docbook.el org-icalendar.el
Niimi Satoshi: changed pp.el search.c
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
Ognyan Kulev: changed TUTORIAL.bg quail/cyrillic.el
-Okazaki Tetsurou: changed cc-fonts.el vc-svn.el
+Okazaki Tetsurou: changed cc-fonts.el
Olaf Sylvester: wrote bs.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 diff-mode.el emacsclient.c
- vc-bzr.el
+Óscar Fuentes: changed ido.el cmdproxy.c emacsclient.c vc-bzr.el
P. E. Jareth Hein: changed gnus-util.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 Makefile.in alloc.c configure.ac editfns.c xdisp.c
- sysdep.c process.c keyboard.c fileio.c image.c emacs.c xterm.c data.c
- dispextern.h fns.c lread.c buffer.c eval.c xfns.c xfaces.c
- and 709 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
gnus-start.el gnus-sum.el nnmail.el
Paul Pogonyshev: changed progmodes/python.el subr.el which-func.el
- Makefile.in align.el byte-opt.el configure.ac dabbrev.el display.texi
+ 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.ac
+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
european.el iso-transl.el pcmpl-gnu.el replace.el startup.el
trouble.texi vc.el xdisp.c
-Pete Beardmore: changed idle.el semantic/complete.el
-
Pete Kazmier: changed gnus-art.el
Pete Ware: changed message.el
Peter Liljenberg: wrote elint.el
-Peter Munster: changed gnus-demon.el gnus-group.el gnus-start.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 von der Ahe: changed gnus-ems.el
-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.texi
- newcomment.el
+Philipp Haselwarter: changed gnus-agent.el gnus.texi
Philippe Schnoebelen: wrote gomoku.el mpuz.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
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
Randall Smith: changed dired.el
-Ransom Williams: changed files.el
-
Raul Acevedo: changed info.el options.el
Ray Blaak: co-wrote delphi.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 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 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
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
Makefile.in fileio.c process.c sysdep.c buffer.c xfns.c window.c
- configure.ac subr.el startup.el sendmail.el emacs.c editfns.c info.el
+ 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
Rick Farnbach: wrote morse.el
-Rick Frankel: changed ob-sql.el
-
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
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.texinfo vip.texinfo
-Robert Jarzmik: changed ede/linux.el inversion.el
-
Robert Marshall: changed mule-cmds.el
Robert P. Goldman: changed org.texi ob-exp.el org-latex.el org.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 Makefile.in vc.el
+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 process.c appt.el artist.el conf-mode.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
+ 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 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.ac doclicense.texi emacs.c files.texi gnus-fun.el help-fns.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
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
Rémi Vanicat: changed org-icalendar.el
-Rüdiger Sonderfeld: changed calc-lang.el vhdl-mode.el
-
Sacha Chua: wrote erc-pcomplete.el
and changed erc.el erc-button.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 141 other files
+ 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 Bronson: changed custom.el emacsclient.c
+Samuel Bronson: changed custom.el
Samuel Tardieu: changed smime.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
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
Sergey Poznyakoff: changed mh-mime.el rmail.el rmail.texi smtpmail.el
-Sergio Durigan Junior: changed eudcb-bbdb.el
-
Sergio Pokrovskij: changed TUTORIAL.eo
Seweryn Kokot: changed positions.texi searching.texi
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 99 other files
-Simon Law: changed delsel.el electric.el
-
Simon Leinen: changed Makefile.in smtpmail.el Makefile cm.c cm.h hpux9.h
indent.c process.c sc.texinfo sgml-mode.el term.c vc.el xfns.c xmenu.c
xterm.c
Simon South: co-wrote delphi.el
-Simon Thum: changed ob-maxima.el
-
Skip Collins: changed w32fns.c w32term.c w32term.h
-Slawomir Nowaczyk: changed progmodes/python.el TUTORIAL.pl flyspell.el
- ls-lisp.el w32proc.c
+Slawomir Nowaczyk: changed emacs.py progmodes/python.el TUTORIAL.pl
+ flyspell.el ls-lisp.el w32proc.c
Spencer Thomas: changed dabbrev.el emacsclient.c gnus.texi server.el
unexcoff.c
Stefan Merten: co-wrote rst.el
-Stefan Monnier: wrote bibtex-style.el bzrmerge.el cl.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 pcase.el pcvs-defs.el pcvs-info.el
- pcvs-parse.el pcvs-util.el reveal.el smerge-mode.el smie.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 vc.el lisp.h files.el keyboard.c
- bytecomp.el alloc.c Makefile.in progmodes/compile.el xdisp.c keymap.c
- pcvs.el newcomment.el tex-mode.el eval.c vc-hooks.el cl-macs.el
- sh-script.el buffer.c fileio.c and 1091 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
Stefan Wiens: changed gnus-sum.el
-Stefano Facchini: changed gtkutil.c
-
Steinar Bang: changed imap.el
Štěpán Němec: changed INSTALL calc-ext.el cl.texi comint.el edebug.texi
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
- gomoku.el gtkutil.c info.el minibuffer.el newcomment.el page.el
- proced.el recentf.el rfc822.el subr.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
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
Steve Fisk: co-wrote cal-tex.el
+Steve Grubb: changed vcdiff
+
Steve Nygard: changed unexnext.c
Steve Purcell: changed nnimap.el
Steven E. Harris: changed nnheader.el
-Steven Huwig: changed progmodes/python.el
+Steven Huwig: changed emacs.py progmodes/python.el
Steven L. Baur: wrote footnote.el gnus-setup.el
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
+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
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 org-html.el
-
Sun Microsystems, Inc: wrote emacs.icon sun.el
and changed emacsclient.c server.el
Sébastien Delafond: changed org.el
-Sébastien Gross: changed hideshow.el
-
Sébastien Vauban: changed org.el org-agenda.el org-html.el org-latex.el
-T.F. Torrey: changed org-exp.el org-rmail.el
-
T.V. Raman: changed completion.el files.el json.el mairix.el mspools.el
xml.c
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 which-func.el
-
Takahashi Kaoru: changed texinfmt.el
Takahashi Naoto: wrote ethio-util.el language/ethiopic.el latin-post.el
Tassilo Horn: wrote doc-view.el
and co-wrote org-gnus.el
and changed subword.el image-mode.el Makefile.in cc-cmds.el emacsbug.el
- gnus-art.el gnus-sum.el gnus.texi nnimap.el files.el info.el misc.texi
- org-footnote.el org.el reftex-ref.el reftex-vars.el reftex.el
- saveplace.el simple.el tsdh-dark-theme.el tsdh-light-theme.el
- and 28 other files
+ 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 Phelps: changed mh-search.el mh-tool-bar.el
-Teemu Likonen: changed dired.el erc-backend.el gnus-agent.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 auth.texi
- gnus-util.el gnutls.c netrc.el gnus-start.el Makefile.in message.el
- spam-stat.el encrypt.el nnir.el nnmail.el gnutls.h imap.el
- mail-source.el nnmairix.el nntp.el and 101 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
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 Makefile.in
+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.ac dcl-mode.el diff-mode.el and 158 other files
+ 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 files.texi image-mode.el info.el man.el
- tramp.el woman.el avoid.el dired.el doc-view.el find-func.el
- gnus-art.el gnus-msg.el image-dired.el vc-rcs.el
-
-Thomas Bach: changed wisent/python.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
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
Toby Allsopp: changed ldap.el eudc.el
Toby Cubitt: co-wrote avl-tree.el
-and changed org-capture.el org-agenda.el org.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: wrote org-mew.el
and co-wrote org-wl.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 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 134 other files
+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
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 Makefile.in alloc.c emacs.c eval.c lisp.h
- makefile.w32-in xdisp.c
-
Tomoji Kagatani: wrote smtpmail.el
Torbjörn Axelsson: changed options.el
Toshiaki Nomura: changed uxpds.h
+Travis Jeffery: changed Info.plist
+
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
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
Ulrich Leodolter: changed w32proc.c
-Ulrich Müller: changed configure.ac 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 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
gnus-art.el gnus-dired.el gnus-msg.el gnus-util.el mail-source.el
smiley.el
-Vegard Øye: changed viper-init.el
-
Victor Zandy: wrote zone.el
Vida Gábor: changed gnus-demon.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 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
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 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
and co-wrote mailcap.el socks.el
and changed url-handlers.el url-file.el url-methods.el url-vars.el
url-https.el aclocal.m4 mule-sysdp.el url-imap.el url-news.el
- url-nfs.el configure.ac image.el mwheel.el url-about.el url-auth.el
- url-cid.el url-dired.el url-expand.el url-ftp.el url-history.el
- url-irc.el and 6 other files
+ 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 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
Wolfgang Glas: changed unexsgi.c
-Wolfgang Jenkner: changed gnus-agent.el image-mode.el ansi-color.el
- man.el conf-mode.el gnus-picon.el gnus-start.el gnus-sum.el gnus.texi
- lread.c network-stream.el nntp.el pcvs.el pop3.el progmodes/grep.el
+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 config.in process.c alloc.c callint.c configure.ac data.c
+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
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 unexmacosx.c emacs.c darwin.h dispnew.c w32term.c alloc.c
- dispextern.h configure.ac and 88 other files
+ 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 rcirc.el
-Yavor Doganov: changed configure.ac Makefile.in emacs.1 etags.1 make-dist
- nsfont.m
+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
Yuri Shtil: changed etags.c
-Yutaka Niibe: changed indent.c xdisp.c configure.ac Makefile.in dispnew.c
+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 makefile.w32-in mm-util.el mule.el org-publish.el
+2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
+
+ * TODO: Adjust entry about NS event loop.
+
+2012-12-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * NEWS: Tramp implements `file-acl' and `set-file-acl'.
+
+2012-12-19 Tassilo Horn <tsdh@gnu.org>
+
+ * themes/tsdh-dark-theme.el (tsdh-dark): Add customizations of
+ many new faces.
+
+2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix permissions bugs with setgid directories etc. (Bug#13125)
+ * NEWS: Document changes to file-attributes,
+ file-ownership-preserved-p.
+ Mention new functions group-gid, group-real-gid.
+
+2012-12-06 Andreas Schwab <schwab@linux-m68k.org>
+
+ * themes/leuven-theme.el: Convert to Unix format.
+
+2012-12-06 Fabrice Niessen <fniessen@pirilampo.org>
+
+ * themes/leuven-theme.el: New theme.
+
+2012-12-04 Michael Albinus <michael.albinus@gmx.de>
+
+ * NEWS: Mention new Tramp method "adb".
+
+2012-11-25 Bill Wohler <wohler@newt.com>
+
+ Release MH-E version 8.4.
+
+ * NEWS, MH-E-NEWS: Update for MH-E release 8.4.
+
+2012-11-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Document Calc changes for Gregorian calendar (Bug#12633).
+
2012-10-26 Nicolas Goaziou <n.goaziou@gmail.com>
* refcards/orgcard.tex: Fix keybindings about
Copyright (C) 2001-2013 Free Software Foundation, Inc.
See the end of the file for license conditions.
+* Changes in MH-E 8.4
+
+Version 8.4 postpones junk processing and merges in your components
+file when re-editing a draft. A few bugs were also fixed.
+
+** New Features in MH-E 8.4
+
+*** Postpone junk processing
+
+The `J w' (`mh-junk-whitelist') and `J b' (`mh-junk-blacklist')
+commands now mark the message. Like with other marks, this mark can be
+removed with `u' (`mh-undo') and processed with `x'
+(`mh-execute-commands'). Thanks to Ted Phelps (closes SF #2945712).
+
+** New Variables in MH-E 8.4
+
+*** mh-blacklist-msg-hook
+
+Hook run by `J b' (`mh-junk-blacklist') after marking each message for blacklisting.
+
+*** mh-whitelist-msg-hook
+
+Hook run by `J w' (`mh-junk-whitelist') after marking each message for whitelisting.
+
+*** mh-whitelist-preserves-sequences-flag
+
+Non-nil means that sequences are preserved when messages are
+whitelisted.
+
+** New Faces in MH-E 8.4
+
+*** mh-folder-blacklisted
+
+Blacklisted message face.
+
+*** mh-folder-whitelisted
+
+Whitelisted message face.
+
+** Bug Fixes in MH-E 8.4
+
+*** mh-edit-again should add Fcc
+
+More generally, `mh-edit-again' now merges the components file into
+the draft (closes SF #1708292).
+
+*** Loses changes when message column goes from 1 to 2 digits
+
+Call `mh-process-or-undo-commands' before running inc to insure we do
+not lose any pending changes (closes SF #2321115).
+
+*** mh-yank-cur-msg fails in emacs 23
+
+Replace usage of `set-buffer' with `with-current-buffer' (closes SF
+#2830504).
+
+*** Folder pack action (Fp) missing in show mode
+
+Add missing key binding for `mh-show-pack-folder' (closes SF #3466086).
+
+\f
+
* Changes in MH-E 8.3.1
This version of MH-E fixes typos in the documentation and is packaged
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 the appropriate manual has already been updated.
+--- means no change in the manuals is called for.
+When you add a new item, please add it without either +++ or ---
+so we will look at it and add it to the manual.
+
+\f
+* Installation Changes in Emacs 24.4
+
+** Emacs can be compiled with POSIX ACL support.
+This happens by default if a suitable support library is found at
+build time, like libacl on GNU/Linux. To prevent this, use the
+configure option `--without-acl'.
+
+* Startup Changes in Emacs 24.4
+* Changes in Emacs 24.4
+
++++
+** `apropos-variable' is now `apropos-user-option'
+`apropos-user-option' shows all user options while `apropos-variable'
+shows all variables. When called with a universal prefix argument,
+the two commands swap their behaviors. When `apropos-do-all' is
+non-nil, they output the same results.
+
++++
+** `eval-defun' on an already defined defcustom calls the :set function,
+if there is one.
+
+** The option `set-mark-default-inactive' has been deleted.
+This unfinished feature was introduced by accident in Emacs 23.1;
+simply disabling Transient Mark mode does the same thing.
+
+** `initial-buffer-choice' can now specify a function to set up the
+initial buffer.
+
+** ACL support has been added.
++++
+*** Emacs preserves the ACL entries of files when backing up.
++++
+*** New functions `file-acl' and `set-file-acl' get and set the ACL
+entries of a file. On GNU/Linux, the POSIX ACL interface is used via
+libacl. On MS-Windows, the NT Security APIs are used to emulate the
+POSIX ACL interfaces.
+
+* Editing Changes in Emacs 24.4
+
+** New commands `toggle-frame-fullscreen' and `toggle-frame-maximized',
+bound to <f11> and M-<f10>, respectively.
+
+\f
+* Changes in Specialized Modes and Packages in Emacs 24.4
+
+** Battery
+
+*** Battery information via the BSD `apm' utility is now supported.
+
+** cl-lib
+
+*** New macro cl-tagbody.
+
++++
+*** letf is now just an alias for cl-letf.
+
+** Calc
+
+*** Calc by default now uses the Gregorian calendar for all dates, and
+uses January 1, 1 AD as its day number 1. Previously Calc used the
+Julian calendar for dates before September 14, 1752, and it used
+December 31, 1 BC as its day number 1; the new scheme is more
+consistent with Calendar's calendrical system and day numbering.
+
+*** The new variable `calc-gregorian-switch' lets you configure the
+date when Calc switches from the Julian to the Gregorian calendar.
+Nil, the default value, means to always use the Gregorian calendar.
+The value (YEAR MONTH DAY) means to start using the Gregorian calendar
+on the given date.
+
+** ERC
+
+*** New option `erc-accidental-paste-threshold-seconds'.
+If set to a number, this can be used to avoid accidentally paste large
+amounts of data into the ERC input.
+
+** Icomplete is a bit more like IDO.
+*** key bindings to navigate through and select the completions.
+*** The icomplete-separator is customizable, and its default has changed.
+*** Removed icomplete-show-key-bindings.
+
+** Isearch
+
+*** `C-x 8 RET' in Isearch mode reads a character by its Unicode name
+and adds it to the search string.
+
+** MH-E has been updated to MH-E version 8.4.
+See MH-E-NEWS for details.
+
+---
+** The unrmail command converts from BABYL to mboxrd rather than mboxo.
+Customize `unrmail-mbox-format' to change this.
+
+---
+** Similarly, customize `rmail-mbox-format' to influence some minor aspects
+of how Rmail displays non-MIME messages.
+
++++
+** New function `ses-rename-cell' to give SES cells arbitrary names.
+
+** trace-function was largely rewritten.
+New features include:
+- no prompting for the destination buffer, unless a prefix-arg was used.
+- additionally to prompting for a destination buffer, when a prefix-arg is
+ used, the user can enter a "context", i.e. Lisp expression whose value at the
+ time the function is entered/exited will be printed along with the function
+ name and arguments. Useful to trace the value of (current-buffer) or
+ (point) when the function is invoked.
+
+** New command `delete-duplicate-lines' has two types of operation:
+when its arg ADJACENT is non-nil (when called interactively with C-u C-u)
+it works like the utility `uniq'. Otherwise by default it deletes
+duplicate lines everywhere in the region without regard to adjacency.
+
+** Tramp
++++
+*** New connection method "adb", which allows to access Android
+devices by the Android Debug Bridge. The variable `tramp-adb-sdk-dir'
+must be set to the Android SDK installation directory.
++++
+*** Handlers for `file-acl' and `set-file-acl' for remote machines
+which support POSIX ACLs.
+
+** Woman
+
+*** The commands `woman-default-faces' and `woman-monochrome-faces'
+are obsolete. Customize the `woman-* faces instead.
+
+** Obsolete packages:
+
+*** longlines.el is obsolete; use visual-line-mode instead.
+
+*** terminal.el is obsolete; use term.el instead.
+
+\f
+* New Modes and Packages in Emacs 24.4
+** New nadvice.el package offering lighter-weight advice facilities.
+It is layered as:
+- add-function/remove-function which can be used to add/remove code on any
+ function-carrying place, such as process-filters or `<foo>-function' hooks.
+- advice-add/advice-remove to add/remove a piece of advice on a named function,
+ much like `defadvice' does.
+
+* Incompatible Lisp Changes in Emacs 24.4
+
+** frame-local variables that affect redisplay do not work any more.
+More specifically, the redisplay does not bother to check for a frame-local
+value when looking up variables.
+
+** nil and "unbound" are indistinguishable in symbol-function.
+`symbol-function' never signals `void-function' any more.
+`fboundp' returns non-nil if the symbol was `fset' to nil.
+
+** `defadvice' does not honor the `freeze' flag and cannot advise
+special-forms any more.
+
+** `dolist' in lexical-binding mode does not bind VAR in RESULT any more.
+VAR was bound to nil which was not tremendously useful and just lead to
+spurious warnings about an unused var.
+
+** The return value of `backup-buffer' has changed.
+The second argument is no longer an SELinux context, instead it is an
+alist of extended attributes as returned by the new function
+`file-extended-attributes'. The attributes can be applied to another
+file using `set-file-extended-attributes'.
+
+* Lisp changes in Emacs 24.4
+
+** Support for filesystem notifications.
+Emacs now supports notifications of filesystem changes, such as
+creation, modification, and deletion of files. This requires the
+'inotify' API on GNU/Linux systems. On MS-Windows systems, this is
+supported for Windows XP and newer versions.
+
+** Face changes
+
+*** The `face-spec-set' is now analogous to `setq' for face specs.
+Its third arg now accepts values specifying exactly which face spec to
+set (defface, custom, or user spec), and it directly sets the relevant
+property using the supplied face spec.
+
+*** Face specs set via Custom themes now replace the `defface' spec
+rather than inheriting from it (as do face specs set via Customize).
+
+*** New face characteristic (supports :underline (:style wave))
+specifies whether or not the terminal can display a wavy line.
+
+** time-to-seconds is not obsolete any more.
+** New function special-form-p.
+** Docstrings can be made dynamic by adding a `dynamic-docstring-function'
+text-property on the first char.
+
+** The `defalias-fset-function' property lets you catch calls to defalias
+and redirect them to your own function instead of `fset'.
+
+** The 9th element returned by `file-attributes' is now unspecified.
+Formerly, it was t if the file's gid would change if file were deleted
+and recreated. This value has been inaccurate for years on many
+platforms, and nobody seems to have noticed or cared.
+
+** The function `file-ownership-preserved-p' now has an optional
+argument GROUP which causes it check for file group too. This can be
+used in place of the 9th element of `file-attributes'.
+
+** New functions `group-gid' and `group-real-gid'.
+
+** The 6th argument to `copy-file' has been renamed to
+`preserve-extended-attributes' as it now handles both SELinux context
+and ACL entries.
+
+* Changes in Emacs 24.4 on non-free operating systems
+
++++
+** The "generate a backtrace on fatal error" feature now works on MS Windows.
+The backtrace is written to the 'emacs_backtrace.txt' file in the
+directory where Emacs was running.
+
\f
* Installation Changes in Emacs 24.3
*** Bugs
-**** The event loop relies on polling and that hurts performance.
- A better strategy is to have the select part in its own thread and let
- the main thread communicate with that thread (see how Gdk does it for
- inspiration). A problem is that redraw don't happen during resize,
+**** The event loop does not redraw.
+ A problem is that redraw don't happen during resize,
because we can't break out from the NSapp loop during resize.
- There is a special trick to detect mouse press in the lower right
- corner and track mouse movements, but this does not work well, and is
+ There was a special trick to detect mouse press in the lower right
+ corner and track mouse movements, but this did not work well, and was
not scalable to the new Lion "resize on every window edge" behavior.
**** (mouse-avoidance-mode 'banish) then minimize Emacs, will pop window back
--- /dev/null
+;;; leuven-theme.el --- Emacs custom theme
+
+;; Copyright (C) 2003-2013 Free Software Foundation, Inc.
+;; Time-stamp: <2012-12-05 Wed 10:47>
+
+;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 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/>.
+
+;;; Code:
+
+(deftheme leuven
+ "Face colors with a light background.
+Basic, Font Lock, Isearch, Gnus, Message, Diff, Ediff, Flyspell,
+Semantic, and Ansi-Color faces are included -- and much more...")
+
+(let ((class '((class color) (min-colors 89)))
+ ;; Leuven generic colors
+ (cancel '(:slant italic :strike-through t :foreground "gray55"))
+ (clock-line '(:box (:line-width 1 :color "#335EA8") :foreground "black" :background "#EEC900"))
+ (code-block '(:foreground "#000088" :background "#FBF9EA"))
+ (code-inline '(:box (:line-width 1 :color "#DDDDDD") :foreground "#000088" :background "#FFFFE0"))
+ (column '(:height 1.0 :weight normal :slant normal :underline nil :strike-through nil :foreground "#E6AD4F" :background "#FFF2DE"))
+ (diff-added '(:foreground "#008000" :background "#DDFFDD"))
+ (diff-hunk-header '(:box (:line-width 1 :color "#FFE0FF") :foreground "#990099" :background "#FFEEFF"))
+ (diff-none '(:foreground "gray33"))
+ (diff-removed '(:foreground "#A60000" :background "#FFDDDD"))
+ (directory '(:weight bold :foreground "blue" :background "#FFFFD2"))
+ (highlight-line '(:inverse-video t))
+ (link '(:underline t :foreground "#006DAF"))
+ (mail-header-name '(:weight bold :foreground "black"))
+ (marked-line '(:weight bold :foreground "white" :background "red"))
+ (match '(:background "#FFFF99"))
+ (ol1 '(:height 1.3 :weight bold :overline "#A7A7A7" :foreground "#3C3C3C" :background "#F0F0F0"))
+ (ol2 '(:height 1.0 :weight bold :overline "#123555" :foreground "#123555" :background "#E5F4FB"))
+ (ol3 '(:height 1.0 :weight bold :overline "#005522" :foreground "#005522" :background "#EFFFEF"))
+ (ol4 '(:height 1.0 :weight bold :slant normal :foreground "#EA6300"))
+ (ol5 '(:height 1.0 :weight bold :slant normal :foreground "#E3258D"))
+ (ol6 '(:height 1.0 :weight bold :slant italic :foreground "#0077CC"))
+ (ol7 '(:height 1.0 :weight bold :slant italic :foreground "#2EAE2C"))
+ (ol8 '(:height 1.0 :weight bold :slant italic :foreground "#FD8008"))
+ (region '(:background "#D2D9E0"))
+ (shadow '(:foreground "#7F7F7F"))
+ (string '(:foreground "#008000"))
+ (subject '(:weight bold :foreground "#CF5D60"))
+ (symlink '(:foreground "deep sky blue"))
+ (vc-branch '(:box (:line-width 1 :color "#00CC33") :foreground "black" :background "#AAFFAA")))
+
+ (custom-theme-set-faces
+ 'leuven
+ `(default ((,class (:background "#ffffff" :foreground "#333333"))))
+ `(bold ((,class (:weight bold :foreground "black"))))
+ `(bold-italic ((,class (:weight bold :slant italic :foreground "black"))))
+ `(italic ((,class (:slant italic :foreground "#1A1A1A"))))
+ `(underline ((,class (:underline t))))
+ `(cursor ((,class (:background "#15ff00"))))
+ ;; Highlighting faces
+ `(fringe ((,class (:foreground "#808080" :background "#DDEEFF"))))
+ `(highlight ((,class (:background "#FFFF00"))))
+ `(region ((t ,region)))
+ `(secondary-selection ((t ,match))) ;; used by Org-mode for highlighting matched entries and keywords
+ `(isearch ((,class (:weight bold :foreground "#00AA00" :background "#99FF99"))))
+ `(isearch-fail ((,class (:weight bold :foreground "black" :background "#FF9999"))))
+ `(lazy-highlight ((,class (:weight bold :foreground "#990099" :background "#FF66FF"))))
+ `(trailing-whitespace ((t (:background "#F6EBFE"))))
+ `(whitespace-line ((t (:foreground "#CC0000" :background "#FFFF88"))))
+ `(whitespace-tab ((t (:foreground "lightgray" :background "beige"))))
+ `(whitespace-indentation ((t (:foreground "firebrick" :background "yellow"))))
+ `(whitespace-trailing ((t (:weight bold :foreground "yellow" :background "red1"))))
+ `(whitespace-hspace ((t (:background "#CCE8F6"))))
+ ;; Mode line faces
+ `(mode-line ((,class (:box (:line-width 1 :color "#1A2F54") :foreground "#85CEEB" :background "#335EA8"))))
+ `(mode-line-inactive ((,class (:box (:line-width 1 :color "#4E4E4C") :foreground "#F0F0EF" :background "#9B9C97"))))
+ `(mode-line-buffer-id ((,class (:weight bold :foreground "white"))))
+ `(mode-line-emphasis ((,class (:weight bold :foreground "white"))))
+ `(mode-line-highlight ((,class (:foreground "yellow"))))
+ ;; Escape and prompt faces
+ `(minibuffer-prompt ((,class (:weight bold :foreground "black" :background "gold"))))
+ `(minibuffer-noticeable-prompt ((,class (:weight bold :foreground "black" :background "gold"))))
+ `(escape-glyph ((,class (:foreground "#008ED1"))))
+ `(error ((,class (:foreground "red"))))
+ `(warning ((,class (:foreground "orange"))))
+ `(success ((,class (:foreground "green"))))
+ ;; Font lock faces
+ `(font-lock-builtin-face ((,class (:foreground "#FF5803"))))
+ `(font-lock-comment-delimiter-face ((,class (:foreground "#EE0000"))))
+ `(font-lock-comment-face ((,class (:slant italic :foreground "#EE0000"))))
+ `(font-lock-constant-face ((,class (:foreground "#009944"))))
+ `(font-lock-doc-face ((,class (:foreground "#BA2121"))))
+ `(font-lock-doc-string-face ((,class (:foreground "#63639C"))))
+ `(font-lock-function-name-face ((,class (:foreground "#1A50B8"))))
+ `(font-lock-keyword-face ((,class (:bold t :foreground "#A535AE"))))
+ `(font-lock-preprocessor-face ((,class (:bold t :foreground "#A3A3A3"))))
+ `(font-lock-reference-face ((,class (:foreground "dark cyan"))))
+ `(font-lock-regexp-grouping-backslash ((,class (:bold t :weight bold))))
+ `(font-lock-regexp-grouping-construct ((,class (:bold t :weight bold))))
+ `(font-lock-string-face ((t ,string)))
+ `(font-lock-type-face ((,class (:foreground "#1B781F"))))
+ `(font-lock-variable-name-face ((,class (:foreground "#2E91AF"))))
+ `(font-lock-warning-face ((,class (:weight bold :foreground "red"))))
+ ;; Button and link faces
+ `(link ((,class (:foreground "#8ac6f2" :underline t))))
+ `(link-visited ((,class (:foreground "#e5786d" :underline t))))
+ `(button ((,class (:underline t :foreground "#006DAF"))))
+ `(header-line ((,class (:weight bold :underline "black" :overline "black" :foreground "black" :background "#FFFF88"))))
+ ;; Gnus faces
+ `(gnus-group-news-1-empty ((,class (:foreground "#5050B0"))))
+ `(gnus-group-news-1 ((,class (:weight bold :foreground "#FF50B0"))))
+ `(gnus-group-news-2-empty ((,class (:foreground "#660066"))))
+ `(gnus-group-news-2 ((,class (:weight bold :foreground "#FF0066"))))
+ `(gnus-group-news-3-empty ((,class (:foreground "#808080"))))
+ `(gnus-group-news-3 ((,class (:weight bold :foreground "black"))))
+ `(gnus-group-news-4-empty ((,class (:foreground "#990000"))))
+ `(gnus-group-news-4 ((,class (:weight bold :foreground "#FF0000"))))
+ `(gnus-group-news-5-empty ((,class (:foreground "#000099"))))
+ `(gnus-group-news-5 ((,class (:weight bold :foreground "#FF0099"))))
+ `(gnus-group-news-6-empty ((,class (:foreground "#808080"))))
+ `(gnus-group-news-6 ((,class (:weight bold :foreground "gray50"))))
+ `(gnus-group-mail-1-empty ((,class (:foreground "#5050B0"))))
+ `(gnus-group-mail-1 ((,class (:weight bold :foreground "#FF50B0"))))
+ `(gnus-group-mail-2-empty ((,class (:foreground "#660066"))))
+ `(gnus-group-mail-2 ((,class (:weight bold :foreground "#FF0066"))))
+ `(gnus-group-mail-3-empty ((,class (:foreground "#808080"))))
+ `(gnus-group-mail-3 ((,class (:weight bold :foreground "black"))))
+ `(gnus-group-mail-low-empty ((t ,cancel)))
+ `(gnus-group-mail-low ((t ,cancel)))
+ `(gnus-header-content ((,class (:family "Sans Serif" :foreground "#786FB4"))))
+ `(gnus-header-from ((,class (:family "Sans Serif" :foreground "blue"))))
+ `(gnus-header-subject ((t ,subject)))
+ `(gnus-header-name ((t ,mail-header-name)))
+ `(gnus-header-newsgroups ((,class (:family "Sans Serif" :foreground "#3399CC"))))
+ ;; Message faces
+ `(message-header-name ((t ,mail-header-name)))
+ `(message-header-cc ((,class (:family "Sans Serif" :foreground "blue"))))
+ `(message-header-other ((,class (:family "Sans Serif" :foreground "#3399CC"))))
+ `(message-header-subject ((t ,subject)))
+ `(message-header-to ((,class (:family "Sans Serif" :foreground "blue"))))
+ `(message-cited-text ((,class (:foreground "#5050B0"))))
+ `(message-separator ((,class (:family "Sans Serif" :weight bold :foreground "red"))))
+ `(message-header-newsgroups ((,class (:family "Sans Serif" :foreground "#3399CC"))))
+ `(message-header-xheader ((,class (:foreground "red"))))
+ `(message-mml ((,class (:foreground "forest green"))))
+ ;; Diff
+ `(diff-added ((t ,diff-added)))
+ `(diff-changed ((,class (:foreground "blue" :background "#DDDDFF"))))
+ `(diff-context ((t ,diff-none)))
+ `(diff-file-header ((,class (:foreground "#0000CC" :background "#EAF2F5"))))
+ `(diff-file1-hunk-header ((,class (:foreground "dark magenta" :background "#EAF2F5"))))
+ `(diff-file2-hunk-header ((,class (:foreground "#2B7E2A" :background "#EAF2F5"))))
+ `(diff-header ((,class (:foreground "#999999" :background "#EAF2F5"))))
+ `(diff-hunk-header ((t ,diff-hunk-header)))
+ `(diff-index ((,class (:family "Sans Serif" :height 1.1 :weight bold :foreground "#4183C4" :background "#EAF2F5"))))
+ `(diff-indicator-added ((,class (:background "#AAFFAA"))))
+ `(diff-indicator-changed ((,class (:background "#AAAAFF"))))
+ `(diff-indicator-removed ((,class (:background "#FFAAAA"))))
+ `(diff-refine-change ((,class (:background "#DDDDFF"))))
+ `(diff-removed ((t ,diff-removed)))
+ ;; SMerge
+ `(smerge-refined-change ((,class (:background "#AAAAFF"))))
+ ;; Ediff
+ `(ediff-current-diff-A ((,class (:foreground "gray33" :background "#FFDDDD"))))
+ `(ediff-current-diff-B ((,class (:foreground "gray33" :background "#DDFFDD"))))
+ `(ediff-current-diff-C ((,class (:foreground "black" :background "cyan"))))
+ `(ediff-even-diff-A ((,class (:foreground "black" :background "light grey"))))
+ `(ediff-even-diff-B ((,class (:foreground "black" :background "light grey"))))
+ `(ediff-fine-diff-A ((,class (:foreground "#A60000" :background "#FFAAAA"))))
+ `(ediff-fine-diff-B ((,class (:foreground "#008000" :background "#55FF55"))))
+ `(ediff-odd-diff-A ((,class (:foreground "black" :background "light grey"))))
+ `(ediff-odd-diff-B ((,class (:foreground "black" :background "light grey"))))
+ ;; Flyspell
+ `(flyspell-duplicate ((,class (:underline "#008000"))))
+ `(flyspell-incorrect ((,class (:underline "red"))))
+ ;; ;; Semantic faces
+ ;; `(semantic-decoration-on-includes ((,class (:underline ,cham-4))))
+ ;; `(semantic-decoration-on-private-members-face ((,class (:background ,alum-2))))
+ ;; `(semantic-decoration-on-protected-members-face ((,class (:background ,alum-2))))
+ ;; `(semantic-decoration-on-unknown-includes ((,class (:background ,choc-3))))
+ ;; `(semantic-decoration-on-unparsed-includes ((,class (:underline ,orange-3))))
+ ;; `(semantic-tag-boundary-face ((,class (:overline ,blue-1))))
+ ;; `(semantic-unmatched-syntax-face ((,class (:underline ,red-1))))
+
+ `(Info-title-1-face ((t ,ol1)))
+ `(Info-title-2-face ((t ,ol2)))
+ `(Info-title-3-face ((t ,ol3)))
+ `(Info-title-4-face ((t ,ol4)))
+ `(bbdb-company ((,class (:slant italic :foreground "steel blue"))))
+ `(bbdb-field-name ((,class (:weight bold :foreground "steel blue"))))
+ `(bbdb-field-value ((,class (:foreground "steel blue"))))
+ `(bbdb-name ((,class (:underline t :foreground "#FF6633"))))
+ `(browse-kill-ring-separator-face ((,class (:weight bold :foreground "slate gray"))))
+ `(calendar-today ((,class (:weight bold :background "#CCCCFF"))))
+ `(cfw:face-annotation ((,class (:foreground "RosyBrown" :inherit cfw:face-day-title))))
+ `(cfw:face-day-title ((,class (:background "#F8F9FF"))))
+ `(cfw:face-default-content ((,class (:foreground "#2952A3"))))
+ `(cfw:face-default-day ((,class (:weight bold :inherit cfw:face-day-title))))
+ `(cfw:face-disable ((,class (:foreground "DarkGray" :inherit cfw:face-day-title))))
+ `(cfw:face-grid ((,class (:foreground "SlateBlue"))))
+ `(cfw:face-header ((,class (:foreground "blue" :background "#D4E5FF" :weight bold))))
+ `(cfw:face-holiday ((,class (:background "#FFD5E5"))))
+ `(cfw:face-periods ((,class (:background "#668CD9" :foreground "white" :slant italic))))
+ `(cfw:face-saturday ((,class (:foreground "SlateGray4" :background "gray90" :weight bold))))
+ `(cfw:face-select ((,class (:background "#C3C9F8"))))
+ `(cfw:face-sunday ((,class (:foreground "red2" :background "#FFD5E5" :weight bold))))
+ `(cfw:face-title ((,class (:foreground "DarkGrey" :weight bold :height 2.0 :inherit variable-pitch))))
+ `(cfw:face-today ((,class (:background "#FFF7D7"))))
+ `(cfw:face-today-title ((,class (:background "#FAD163"))))
+ `(cfw:face-toolbar ((,class (:foreground "gray90" :background "gray90"))))
+ `(cfw:face-toolbar-button-off ((,class (:foreground "LightSkyBlue4" :background "white"))))
+ `(cfw:face-toolbar-button-on ((,class (:foreground "LightPink3" :background "gray94"))))
+ `(change-log-date-face ((,class (:foreground "purple"))))
+ `(change-log-file ((,class (:weight bold :foreground "#4183C4"))))
+ `(circe-highlight-all-nicks-face ((,class (:foreground "blue" :background "#F0F0F0")))) ;; other nick names
+ `(circe-highlight-nick-face ((,class (:foreground "#009300" :background "#F0F0F0")))) ;; messages with my nick cited
+ `(circe-my-message-face ((,class (:foreground "#8B8B8B" :background "#F0F0F0"))))
+ `(circe-originator-face ((,class (:foreground "blue"))))
+ `(circe-prompt-face ((,class (:foreground "red"))))
+ `(circe-server-face ((,class (:foreground "#99CAE5"))))
+ `(comint-highlight-input ((t ,code-block)))
+ `(comint-highlight-prompt ((,class (:foreground "#008ED1" :background "#EAEAFF"))))
+ `(compare-windows ((,class (:background "#FFFF00"))))
+ `(compilation-error ((,class (:weight bold :foreground "red"))))
+ `(compilation-info ((,class (:weight bold :foreground "#2A489E")))) ;; used for grep
+ `(compilation-line-number ((,class (:bold t :foreground "#A535AE"))))
+ `(compilation-warning ((,class (:weight bold :foreground "orange"))))
+ `(css-property ((,class (:foreground "#00AA00"))))
+ `(css-selector ((,class (:weight bold :foreground "blue"))))
+ `(custom-button ((,class (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
+ `(custom-button-mouse ((,class (:background "grey90" :foreground "black" :box (:line-width 2 :style released-button)))))
+ `(custom-button-pressed ((,class (:foreground "black" :background "light grey" :box (:line-width 2 :style pressed-button)))))
+ `(custom-button-pressed-unraised ((,class (:underline t :foreground "magenta4"))))
+ `(custom-button-unraised ((,class (:underline t))))
+ `(custom-changed ((,class (:foreground "white" :background "blue"))))
+ `(custom-comment ((,class (:background "gray85"))))
+ `(custom-comment-tag ((,class (:foreground "blue4"))))
+ `(custom-documentation ((,class (nil))))
+ `(custom-face-tag ((,class (:family "Sans Serif" :weight bold :height 1.2))))
+ `(custom-group-tag ((,class (:bold t :foreground "blue1" :weight bold :height 1.2))))
+ `(custom-group-tag-1 ((,class (:bold t :family "Sans Serif" :foreground "red1" :weight bold :height 1.2))))
+ `(custom-invalid ((,class (:foreground "yellow" :background "red"))))
+ `(custom-link ((,class (:underline t :foreground "blue1"))))
+ `(custom-modified ((,class (:foreground "white" :background "blue"))))
+ `(custom-rogue ((,class (:foreground "pink" :background "black"))))
+ `(custom-saved ((,class (:underline t))))
+ `(custom-set ((,class (:foreground "blue" :background "white"))))
+ `(custom-state ((,class (:foreground "green4"))))
+ `(custom-themed ((,class (:background "blue1" :foreground "white"))))
+ `(custom-variable-button ((,class (:weight bold :underline t))))
+ `(custom-variable-tag ((,class (:bold t :family "Sans Serif" :foreground "blue1" :weight bold :height 1.2))))
+ `(diary-face ((,class (:foreground "#87C9FC"))))
+ `(dircolors-face-asm ((,class (:foreground "black"))))
+ `(dircolors-face-backup ((,class (:foreground "black"))))
+ `(dircolors-face-compress ((,class (:foreground "red"))))
+ `(dircolors-face-dir ((t ,directory)))
+ `(dircolors-face-doc ((,class (:foreground "black"))))
+ `(dircolors-face-dos ((,class (:foreground "green3"))))
+ `(dircolors-face-emacs ((,class (:foreground "black"))))
+ `(dircolors-face-exec ((,class (:foreground "green3"))))
+ `(dircolors-face-html ((,class (:foreground "black"))))
+ `(dircolors-face-img ((,class (:foreground "black"))))
+ `(dircolors-face-lang ((,class (:foreground "black"))))
+ `(dircolors-face-lang-interface ((,class (:foreground "black"))))
+ `(dircolors-face-make ((,class (:foreground "black"))))
+ `(dircolors-face-objet ((,class (:foreground "black"))))
+ `(dircolors-face-package ((,class (:foreground "red"))))
+ `(dircolors-face-paddb ((,class (:foreground "black"))))
+ `(dircolors-face-ps ((,class (:foreground "black"))))
+ `(dircolors-face-sound ((,class (:foreground "black"))))
+ `(dircolors-face-tar ((,class (:foreground "red"))))
+ `(dircolors-face-text ((,class (:foreground "black"))))
+ `(dircolors-face-yacc ((,class (:foreground "black"))))
+ `(dired-directory ((t ,directory)))
+ `(dired-header ((t ,directory)))
+ `(dired-ignored ((,class (:strike-through t :foreground "red"))))
+ `(dired-mark ((t ,marked-line)))
+ `(dired-marked ((t ,marked-line)))
+ `(dired-symlink ((t ,symlink)))
+ `(diredp-compressed-file-suffix ((,class (:foreground "red"))))
+ `(diredp-date-time ((,class (:foreground "purple"))))
+ `(diredp-dir-heading ((t ,directory)))
+ `(diredp-dir-priv ((t ,directory)))
+ `(diredp-exec-priv ((,class (:background "#03C03C"))))
+ `(diredp-executable-tag ((,class (:foreground "green3" :background "white"))))
+ `(diredp-file-name ((,class (:foreground "black"))))
+ `(diredp-file-suffix ((,class (:foreground "#008000"))))
+ `(diredp-flag-mark-line ((t ,marked-line)))
+ `(diredp-ignored-file-name ((,class (:strike-through t :foreground "red"))))
+ `(diredp-read-priv ((,class (:background "#0A99FF"))))
+ `(diredp-write-priv ((,class (:foreground "white" :background "#FF4040"))))
+ `(file-name-shadow ((t ,shadow)))
+ `(font-latex-bold-face ((,class (:weight bold :foreground "medium sea green"))))
+ `(font-latex-math-face ((,class (:foreground "blue"))))
+ `(font-latex-sectioning-1-face ((,class (:family "Sans Serif" :height 2.7 :weight bold :foreground "cornflower blue"))))
+ `(font-latex-sectioning-2-face ((t ,ol1)))
+ `(font-latex-sectioning-3-face ((t ,ol2)))
+ `(font-latex-sectioning-4-face ((t ,ol3)))
+ `(font-latex-sectioning-5-face ((t ,ol4)))
+ `(font-latex-sedate-face ((,class (:foreground "#FF5803"))))
+ `(font-latex-string-face ((,class (:bold t :foreground "#0066FF"))))
+ `(font-latex-verbatim-face ((,class (:foreground "tan1"))))
+ `(gnus-cite-attribution-face ((,class (:foreground "#5050B0"))))
+ `(gnus-cite-face-1 ((,class (:foreground "#5050B0"))))
+ `(gnus-cite-face-10 ((,class (:foreground "#990000"))))
+ `(gnus-cite-face-2 ((,class (:foreground "#660066"))))
+ `(gnus-cite-face-3 ((,class (:foreground "#007777"))))
+ `(gnus-cite-face-4 ((,class (:foreground "#990000"))))
+ `(gnus-cite-face-5 ((,class (:foreground "#000099"))))
+ `(gnus-cite-face-6 ((,class (:foreground "#BB6600"))))
+ `(gnus-cite-face-7 ((,class (:foreground "#5050B0"))))
+ `(gnus-cite-face-8 ((,class (:foreground "#660066"))))
+ `(gnus-cite-face-9 ((,class (:foreground "#007777"))))
+ `(gnus-emphasis-bold ((,class (:weight bold))))
+ `(gnus-emphasis-highlight-words ((,class (:foreground "yellow" :background "black"))))
+ `(gnus-picon ((,class (:foreground "yellow" :background "white"))))
+ `(gnus-picon-xbm ((,class (:foreground "yellow" :background "white"))))
+ `(gnus-signature ((,class (:foreground "#7F7F7F"))))
+ `(gnus-splash ((,class (:foreground "#FF8C00"))))
+ `(gnus-summary-cancelled ((t ,cancel)))
+ `(gnus-summary-high-ancient ((,class (:weight normal :foreground "#808080" :background "#FFFFE6"))))
+ `(gnus-summary-high-read ((,class (:weight normal :foreground "#808080" :background "#FFFFE6"))))
+ `(gnus-summary-high-ticked ((,class (:weight normal :foreground "black" :background "#E7AEB0"))))
+ `(gnus-summary-high-unread ((,class (:weight normal :foreground "black" :background "#FFFFCC"))))
+ `(gnus-summary-low-ancient ((,class (:slant italic :foreground "gray55"))))
+ `(gnus-summary-low-read ((,class (:slant italic :foreground "gray55" :background "#E0E0E0"))))
+ `(gnus-summary-low-ticked ((,class (:slant italic :foreground "black" :background "#E7AEB0"))))
+ `(gnus-summary-low-unread ((,class (:slant italic :foreground "black"))))
+ `(gnus-summary-normal-ancient ((,class (:foreground "#808080"))))
+ `(gnus-summary-normal-read ((,class (:foreground "#808080"))))
+ `(gnus-summary-normal-ticked ((,class (:foreground "black" :background "#E7AEB0"))))
+ `(gnus-summary-normal-unread ((,class (:foreground "black"))))
+ `(gnus-summary-selected ((,class (:foreground "black" :background "#FFD0D0" :underline t))))
+ `(gnus-x-face ((,class (:foreground "black" :background "white"))))
+ `(helm-action ((,class (:foreground "#335EA8"))))
+ `(helm-bookmarks-su-face ((,class (:foreground "red"))))
+ `(helm-candidate-number ((,class (:foreground "black" :background "#FFFF66"))))
+ `(helm-dir-heading ((,class (:foreground "blue" :background "pink"))))
+ `(helm-dir-priv ((,class (:foreground "dark red" :background "light grey"))))
+ `(helm-ff-directory ((t ,directory)))
+ `(helm-ff-executable ((,class (:foreground "green3" :background "white"))))
+ `(helm-ff-file ((,class (:foreground "black"))))
+ `(helm-ff-invalid-symlink ((,class (:foreground "yellow" :background "red"))))
+ `(helm-ff-symlink ((t ,symlink)))
+ `(helm-file-name ((,class (:foreground "blue"))))
+ `(helm-gentoo-match-face ((,class (:foreground "red"))))
+ `(helm-grep-running ((,class (:weight bold :foreground "white"))))
+ `(helm-isearch-match ((,class (:background "#CCFFCC"))))
+ `(helm-match ((t ,match)))
+ `(helm-overlay-line-face ((,class (:underline t :foreground "white" :background "IndianRed4"))))
+ `(helm-selection ((t ,highlight-line)))
+ `(helm-source-header ((,class (:family "Sans Serif" :height 1.3 :weight bold :foreground "white" :background "#666699"))))
+ `(helm-visible-mark ((t ,marked-line)))
+ `(helm-w3m-bookmarks-face ((,class (:underline t :foreground "cyan1"))))
+ `(highlight-symbol-face ((,class (:background "#FFFFA0"))))
+ `(hl-line ((t ,highlight-line)))
+ `(holiday-face ((,class (:background "#B6B2AE"))))
+ `(html-helper-bold-face ((,class (:weight bold :foreground "black"))))
+ `(html-helper-italic-face ((,class (:slant italic :foreground "black"))))
+ `(html-helper-underline-face ((,class (:underline t :foreground "black"))))
+ `(html-tag-face ((,class (:foreground "blue"))))
+ `(info-file ((,class (:family "Sans Serif" :height 1.8 :weight bold :box (:line-width 1 :color "#0000CC") :foreground "cornflower blue" :background "LightSteelBlue1"))))
+ `(info-header-node ((,class (:underline t :foreground "orange")))) ;; nodes in header
+ `(info-header-xref ((,class (:underline t :foreground "dodger blue")))) ;; cross references in header
+ `(info-menu-header ((,class (:family "Sans Serif" :height 1.6 :weight bold :underline t :foreground "#00CC00")))) ;; menu titles (headers) -- major topics
+ `(info-menu-star ((,class (:foreground "black")))) ;; every 3rd menu item
+ `(info-node ((,class (:underline t :foreground "blue")))) ;; node names
+ `(info-quoted-name ((t ,code-inline)))
+ `(info-string ((t ,string)))
+ `(info-title-1 ((t ,ol1)))
+ `(info-xref ((,class (:weight bold :underline t :foreground "blue")))) ;; unvisited cross-references
+ `(info-xref-visited ((,class (:weight bold :foreground "magenta4")))) ;; previously visited cross-references
+ `(light-symbol-face ((,class (:background "#FFFFA0"))))
+ `(linum ((,class (:foreground "#AFB7BA" :background "#DDEEFF"))))
+ `(log-view-file ((,class (:foreground "#0000CC" :background "#EAF2F5"))))
+ `(lui-button-face ((t ,link)))
+ `(lui-highlight-face ((,class (:box '(:line-width 1 :color "#CC0000") :foreground "#CC0000" :background "#FFFF88")))) ;; my nickname
+ `(lui-time-stamp-face ((,class (:foreground "purple"))))
+ `(magit-branch ((t ,vc-branch)))
+ `(magit-diff-add ((t ,diff-added)))
+ `(magit-diff-del ((t ,diff-removed)))
+ `(magit-diff-file-header ((,class (:family "Sans Serif" :height 1.1 :weight bold :foreground "#4183C4"))))
+ `(magit-diff-hunk-header ((t ,diff-hunk-header)))
+ `(magit-diff-none ((t ,diff-none)))
+ `(magit-header ((,class (:foreground "white" :background "#FF4040"))))
+ `(magit-item-highlight ((,class (:background "#EAF2F5"))))
+ `(magit-item-mark ((t ,marked-line)))
+ `(magit-log-head-label ((,class (:box (:line-width 1 :color "blue" :style nil)))))
+ `(magit-log-tag-label ((,class (:box (:line-width 1 :color "#00CC00" :style nil)))))
+ `(magit-section-title ((,class (:family "Sans Serif" :height 1.8 :weight bold :foreground "cornflower blue"))))
+ `(makefile-space-face ((,class (:background "hot pink"))))
+ `(makefile-targets ((,class (:weight bold :foreground "blue"))))
+ `(match ((t ,match)))
+ `(mm-uu-extract ((t ,code-block)))
+ `(moccur-current-line-face ((,class (:background "#FFFFCC" :foreground "black"))))
+ `(moccur-face ((,class (:background "#FFFF99" :foreground "black"))))
+ `(nobreak-space ((,class (:background "#CCE8F6"))))
+ `(nxml-attribute-local-name-face ((,class (:foreground "magenta"))))
+ `(nxml-attribute-value-delimiter-face ((,class (:foreground "green4"))))
+ `(nxml-attribute-value-face ((,class (:foreground "green4"))))
+ `(nxml-comment-content-face ((,class (:slant italic :foreground "red"))))
+ `(nxml-comment-delimiter-face ((,class (:foreground "red"))))
+ `(nxml-element-local-name ((,class (:box (:line-width 1 :color "#999999") :background "#DEDEDE" :foreground "#000088"))))
+ `(nxml-element-local-name-face ((,class (:foreground "blue"))))
+ `(nxml-processing-instruction-target-face ((,class (:foreground "purple1"))))
+ `(nxml-tag-delimiter-face ((,class (:foreground "blue"))))
+ `(nxml-tag-slash-face ((,class (:foreground "blue"))))
+ `(org-agenda-calendar-event ((,class (:weight bold :foreground "white" :background "#1662AF"))))
+ `(org-agenda-calendar-sexp ((,class (:foreground "black" :background "#80CBFF"))))
+ `(org-agenda-clocking ((t ,clock-line)))
+ `(org-agenda-column-dateline ((t ,column)))
+ `(org-agenda-current-time ((,class (:underline t :foreground "#1662AF"))))
+ `(org-agenda-date ((,class (:height 1.6 :weight normal :foreground "#0063F5"))))
+ `(org-agenda-date-today ((,class (:height 1.6 :weight bold :foreground "#1662AF"))))
+ `(org-agenda-date-weekend ((,class (:height 1.6 :weight normal :foreground "dim gray"))))
+ `(org-agenda-diary ((,class (:weight bold :foreground "green4" :background "light blue"))))
+ `(org-agenda-dimmed-todo-face ((,class (:foreground "gold2"))))
+ `(org-agenda-done ((,class (:foreground "#555555" :background "#EEEEEE"))))
+ `(org-agenda-filter-category ((,class (:weight bold :foreground "orange"))))
+ `(org-agenda-filter-tags ((,class (:weight bold :foreground "orange"))))
+ `(org-agenda-restriction-lock ((,class (:weight bold :foreground "white" :background "orange"))))
+ `(org-agenda-structure ((,class (:height 1.6 :weight bold :box (:line-width 1 :color "#999999") :foreground "#666666" :background "#CCCCCC"))))
+ `(org-archived ((,class (:foreground "gray70"))))
+ `(org-beamer-tag ((,class (:box (:line-width 1 :color "#FABC18") :foreground "#2C2C2C" :background "#FFF8D0"))))
+ `(org-block ((t ,code-block)))
+ `(org-block-background ((,class (:background "#FFFFE0"))))
+ `(org-block-begin-line ((,class (:underline "#A7A6AA" :foreground "#555555" :background "#E2E1D5"))))
+ `(org-block-end-line ((,class (:overline "#A7A6AA" :foreground "#555555" :background "#E2E1D5"))))
+ `(org-checkbox ((,class (:weight bold :foreground "white" :background "#777777" :box (:line-width 1 :style pressed-button)))))
+ `(org-clock-overlay ((,class (:foreground "white" :background "SkyBlue4"))))
+ `(org-code ((t ,code-inline)))
+ `(org-column ((t ,column)))
+ `(org-column-title ((t ,column)))
+ `(org-date ((,class (:underline t :foreground "#00459E"))))
+ `(org-default ((,class (:foreground "#333333"))))
+ `(org-dim ((,class (:foreground "#AAAAAA"))))
+ `(org-document-info ((,class (:foreground "#484848"))))
+ `(org-document-info-keyword ((,class (:foreground "#008ED1" :background "#EAEAFF"))))
+ `(org-document-title ((,class (:family "Sans Serif" :height 1.8 :weight bold :foreground "black"))))
+ `(org-done ((,class (:weight bold :box (:line-width 1 :color "#BBBBBB") :foreground "#BBBBBB" :background "#F0F0F0"))))
+ `(org-drawer ((,class (:foreground "light sky blue"))))
+ `(org-ellipsis ((,class (:underline "#B0EEB0" :foreground "#00BB00"))))
+ `(org-example ((,class (:foreground "blue" :background "#EAFFEA"))))
+ `(org-footnote ((,class (:underline t :foreground "#008ED1"))))
+ `(org-formula ((,class (:foreground "chocolate1"))))
+ `(org-headline-done ((,class (:height 1.0 :weight bold :strike-through "#BEBEBE" :foreground "#C5C5C5"))))
+ `(org-hide ((,class (:foreground "#E2E2E2"))))
+ `(org-inlinetask ((,class (:box (:line-width 1 :color "#EBEBEB") :foreground "#777777" :background "#FFFFD6"))))
+ `(org-latex-and-export-specials ((,class (:foreground "blue"))))
+ `(org-level-1 ((t ,ol1)))
+ `(org-level-2 ((t ,ol2)))
+ `(org-level-3 ((t ,ol3)))
+ `(org-level-4 ((t ,ol4)))
+ `(org-level-5 ((t ,ol5)))
+ `(org-level-6 ((t ,ol6)))
+ `(org-level-7 ((t ,ol7)))
+ `(org-level-8 ((t ,ol8)))
+ `(org-link ((t ,link)))
+ `(org-list-dt ((,class (:weight bold :foreground "#335EA8"))))
+ `(org-meta-line ((,class (:slant normal :foreground "#008ED1" :background "#EAEAFF"))))
+ `(org-mode-line-clock ((t ,clock-line)))
+ `(org-mode-line-clock-overrun ((,class (:weight bold :box (:line-width 1 :color "#335EA8") :foreground "white" :background "#FF4040"))))
+ `(org-number-of-items ((,class (:weight bold :foreground "white" :background "#79BA79"))))
+ `(org-property-value ((,class (:foreground "#00A000"))))
+ `(org-quote ((,class (:slant italic :foreground "dim gray" :background "#FFFFE0"))))
+ `(org-scheduled ((,class (:slant italic :foreground "#0063DC"))))
+ `(org-scheduled-previously ((,class (:weight bold :foreground "#373737"))))
+ `(org-scheduled-today ((,class (:foreground "black" :background "#FFFFCB"))))
+ `(org-sexp-date ((,class (:foreground "purple"))))
+ `(org-special-keyword ((,class (:weight bold :foreground "#00BB00" :background "#EAFFEA"))))
+ `(org-table ((,class (:foreground "dark green" :background "#EAFFEA"))))
+ `(org-tag ((,class (:height 1.0 :weight normal :slant italic :foreground "#3C424F" :background "#E5ECFA"))))
+ `(org-target ((,class (:underline t))))
+ `(org-time-grid ((,class (:foreground "#6D6D6D"))))
+ `(org-todo ((,class (:weight bold :box (:line-width 1 :color "#D8ABA7") :foreground "#D8ABA7" :background "#FFE6E4"))))
+ `(org-upcoming-deadline ((,class (:foreground "#FF5555"))))
+ `(org-verbatim ((,class (:box (:line-width 1 :color "#DDDDDD") :foreground "#000088" :background "#E0FFE0"))))
+ `(org-verse ((,class (:slant italic :foreground "dim gray" :background "#EEEEEE"))))
+ `(org-warning ((,class (:weight bold :foreground "black" :background "#CCE7FF"))))
+ `(outline-1 ((t ,ol1)))
+ `(outline-2 ((t ,ol2)))
+ `(outline-3 ((t ,ol3)))
+ `(outline-4 ((t ,ol4)))
+ `(outline-5 ((t ,ol5)))
+ `(outline-6 ((t ,ol6)))
+ `(outline-7 ((t ,ol7)))
+ `(outline-8 ((t ,ol8)))
+ `(pabbrev-debug-display-label-face ((,class (:background "chartreuse"))))
+ `(pabbrev-suggestions-face ((,class (:weight bold :foreground "white" :background "red"))))
+ `(pabbrev-suggestions-label-face ((,class (:weight bold :foreground "white" :background "purple"))))
+ `(paren-face-match ((,class (:foreground "white" :background "#FF3F3F"))))
+ `(paren-face-mismatch ((,class (:weight bold :foreground "white" :background "purple"))))
+ `(paren-face-no-match ((,class (:weight bold :foreground "white" :background "purple"))))
+ `(pp^L-highlight ((,class (:strike-through t))))
+ `(recover-this-file ((,class (:background "white" :background "#FF3F3F"))))
+ `(sh-heredoc ((,class (:foreground "blue" :background "#FBF9EA"))))
+ `(shadow ((t ,shadow)))
+ `(shell-option-face ((,class (:foreground "forest green"))))
+ `(shell-output-2-face ((,class (:foreground "blue"))))
+ `(shell-output-3-face ((,class (:foreground "purple"))))
+ `(shell-output-face ((,class (:foreground "black"))))
+ `(shell-prompt-face ((,class (:weight bold :foreground "yellow"))))
+ `(show-paren-match ((,class (:foreground "white" :background "#FF3F3F"))))
+ `(show-paren-mismatch ((,class (:weight bold :foreground "white" :background "purple"))))
+ `(speedbar-button-face ((,class (:foreground "green4"))))
+ `(speedbar-directory-face ((,class (:foreground "blue4"))))
+ `(speedbar-file-face ((,class (:foreground "cyan4"))))
+ `(speedbar-highlight-face ((,class (:background "green"))))
+ `(speedbar-selected-face ((,class (:underline t :foreground "red"))))
+ `(speedbar-tag-face ((,class (:foreground "brown"))))
+ `(svn-status-directory-face ((t ,directory)))
+ `(svn-status-filename-face ((,class (:weight bold :foreground "#4183C4"))))
+ `(svn-status-locked-face ((,class (:weight bold :foreground "red"))))
+ `(svn-status-marked-face ((t ,marked-line)))
+ `(svn-status-marked-popup-face ((,class (:weight bold :foreground "green3"))))
+ `(svn-status-switched-face ((,class (:slant italic :foreground "gray55"))))
+ `(svn-status-symlink-face ((t ,symlink)))
+ `(svn-status-update-available-face ((,class (:foreground "orange"))))
+ `(tex-verbatim ((,class (:foreground "blue"))))
+ `(tool-bar ((,class (:box (:line-width 1 :style released-button) :foreground "black" :background "gray75"))))
+ `(tooltip ((,class (:foreground "black" :background "light yellow"))))
+ `(trailing-whitespace ((,class (:background "#F6EBFE"))))
+ `(traverse-match-face ((,class (:weight bold :foreground "blue violet"))))
+ `(vc-annotate-face-3F3FFF ((,class (:foreground "#3F3FFF" :background "black"))))
+ `(vc-annotate-face-3F6CFF ((,class (:foreground "#3F3FFF" :background "black"))))
+ `(vc-annotate-face-3F99FF ((,class (:foreground "#3F99FF" :background "black"))))
+ `(vc-annotate-face-3FC6FF ((,class (:foreground "#3F99FF" :background "black"))))
+ `(vc-annotate-face-3FF3FF ((,class (:foreground "#3FF3FF" :background "black"))))
+ `(vc-annotate-face-3FFF56 ((,class (:foreground "#4BFF4B" :background "black"))))
+ `(vc-annotate-face-3FFF83 ((,class (:foreground "#3FFFB0" :background "black"))))
+ `(vc-annotate-face-3FFFB0 ((,class (:foreground "#3FFFB0" :background "black"))))
+ `(vc-annotate-face-3FFFDD ((,class (:foreground "#3FF3FF" :background "black"))))
+ `(vc-annotate-face-56FF3F ((,class (:foreground "#4BFF4B" :background "black"))))
+ `(vc-annotate-face-83FF3F ((,class (:foreground "#B0FF3F" :background "black"))))
+ `(vc-annotate-face-B0FF3F ((,class (:foreground "#B0FF3F" :background "black"))))
+ `(vc-annotate-face-DDFF3F ((,class (:foreground "#FFF33F" :background "black"))))
+ `(vc-annotate-face-FF3F3F ((,class (:foreground "#FF3F3F" :background "black"))))
+ `(vc-annotate-face-FF6C3F ((,class (:foreground "#FF3F3F" :background "black"))))
+ `(vc-annotate-face-FF993F ((,class (:foreground "#FF993F" :background "black"))))
+ `(vc-annotate-face-FFC63F ((,class (:foreground "#FF993F" :background "black"))))
+ `(vc-annotate-face-FFF33F ((,class (:foreground "#FFF33F" :background "black"))))
+ `(w3m-anchor ((t ,link)))
+ `(w3m-arrived-anchor ((,class (:foreground "purple1"))))
+ `(w3m-bitmap-image-face ((,class (:foreground "gray4" :background "green"))))
+ `(w3m-bold ((,class (:weight bold :foreground "medium sea green"))))
+ `(w3m-current-anchor ((,class (:weight bold :underline t :foreground "blue"))))
+ `(w3m-form ((,class (:underline t :foreground "tan1"))))
+ `(w3m-form-button-face ((,class (:weight bold :underline t :foreground "gray4" :background "light grey"))))
+ `(w3m-form-button-mouse-face ((,class (:underline t :foreground "light grey" :background "#2B7E2A"))))
+ `(w3m-form-button-pressed-face ((,class (:weight bold :underline t :foreground "gray4" :background "light grey"))))
+ `(w3m-header-line-location-content-face ((,class (:foreground "#7F7F7F":background "#F7F7F7"))))
+ `(w3m-header-line-location-title-face ((,class (:foreground "#2C55B1" :background "#F7F7F7"))))
+ `(w3m-history-current-url-face ((,class (:foreground "lemon chiffon"))))
+ `(w3m-image-face ((,class (:weight bold :foreground "DarkSeaGreen2"))))
+ `(w3m-link-numbering ((,class (:foreground "#B4C7EB")))) ;; mouseless browsing
+ `(w3m-strike-through-face ((,class (:strike-through t))))
+ `(w3m-underline-face ((,class (:underline t))))
+ `(which-func ((,class (:weight bold :foreground "white"))))
+ `(whitespace-hspace ((,class (:background "#CCE8F6"))))
+ `(whitespace-indentation ((,class (:foreground "firebrick" :background "yellow"))))
+ `(whitespace-line ((,class (:foreground "#CC0000" :background "#FFFF88"))))
+ `(whitespace-tab ((,class (:foreground "lightgray" :background "beige"))))
+ `(whitespace-trailing ((,class (:weight bold :foreground "yellow" :background "red1"))))
+ `(widget-button-face ((t ,link)))
+ `(widget-button-pressed-face ((,class (:foreground "red"))))
+ `(widget-documentation-face ((,class (:foreground "green4"))))
+ `(widget-field-face ((,class (:background "gray85"))))
+ `(widget-inactive-face ((,class (:foreground "dim gray"))))
+ `(widget-single-line-field-face ((,class (:background "gray85"))))
+ `(yas/field-debug-face ((,class (:background "ivory2"))))
+ `(yas/field-highlight-face ((,class (:background "DarkSeaGreen1"))))
+ ))
+
+(custom-theme-set-variables
+ 'leuven
+ '(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682"
+ "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"]))
+
+(provide-theme 'leuven)
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
+;;; leuven-theme.el ends here
(custom-theme-set-faces
'tsdh-dark
'(default ((t (:background "gray20" :foreground "white smoke"))))
- '(compilation-mode-line-fail ((t (:foreground "red"))))
- '(compilation-mode-line-run ((t (:foreground "dark orange"))))
- '(compilation-mode-line-exit ((t (:foreground "sea green"))))
- '(diff-added ((t (:inherit diff-changed :background "dark green"))))
- '(diff-changed ((t (:background "midnight blue"))))
- '(diff-indicator-added ((t (:inherit diff-indicator-changed))))
- '(diff-indicator-changed ((t (:weight bold))))
- '(diff-indicator-removed ((t (:inherit diff-indicator-changed))))
- '(diff-removed ((t (:inherit diff-changed :background "dark red"))))
- '(dired-directory ((t (:inherit font-lock-function-name-face :weight bold))))
+ '(diff-added ((t (:inherit diff-changed :background "dark green"))) t)
+ '(diff-changed ((t (:background "midnight blue"))) t)
+ '(diff-indicator-added ((t (:inherit diff-indicator-changed))) t)
+ '(diff-indicator-changed ((t (:weight bold))) t)
+ '(diff-indicator-removed ((t (:inherit diff-indicator-changed))) t)
+ '(diff-removed ((t (:inherit diff-changed :background "dark red"))) t)
+ '(dired-directory ((t (:foreground "DodgerBlue" :weight bold))))
+ '(error ((t (:foreground "deep pink" :weight bold))))
+ '(font-lock-builtin-face ((t (:foreground "chartreuse2"))))
+ '(font-lock-comment-face ((t (:foreground "peru"))))
+ '(font-lock-constant-face ((t (:foreground "dodger blue"))))
+ '(font-lock-doc-face ((t (:foreground "indian red"))))
+ '(font-lock-function-name-face ((t (:foreground "spring green"))))
+ '(font-lock-keyword-face ((t (:foreground "light sea green" :weight bold))))
+ '(font-lock-preprocessor-face ((t (:foreground "cornflower blue"))))
+ '(font-lock-string-face ((t (:foreground "light salmon"))))
+ '(font-lock-type-face ((t (:foreground "medium purple"))))
+ '(font-lock-variable-name-face ((t (:foreground "yellow green"))))
+ '(font-lock-warning-face ((t (:foreground "hot pink"))))
'(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))))
- '(hl-line ((t (:background "grey28"))))
- '(message-header-subject ((t (:foreground "SkyBlue"))))
+ '(gnus-cite-1 ((t (:foreground "dark turquoise"))) t)
+ '(gnus-group-mail-1 ((t (:inherit gnus-group-mail-1-empty :weight bold))))
+ '(gnus-group-mail-1-empty ((t (:foreground "#00CC00"))))
+ '(gnus-group-mail-3 ((t (:inherit gnus-group-mail-3-empty :weight bold))))
+ '(gnus-group-mail-3-empty ((t (:foreground "#009999"))))
+ '(gnus-group-news-3 ((t (:inherit gnus-group-news-3-empty :weight bold))))
+ '(gnus-group-news-3-empty ((t (:foreground "light green"))))
+ '(gnus-header-content ((t (:foreground "#A64B00"))))
+ '(gnus-header-name ((t (:weight bold))))
+ '(gnus-header-subject ((t (:foreground "#A64B00" :weight bold))))
+ '(gnus-summary-high-ancient ((t (:foreground "#A64B00" :weight bold))))
+ '(gnus-summary-low-ancient ((t (:foreground "medium turquoise" :slant italic))))
+ '(gnus-summary-low-read ((t (:foreground "dark sea green" :slant italic))))
+ '(header-line ((t (:inverse-video t :box (:line-width -1 :color "red" :style released-button)))))
+ '(helm-header ((t (:background "DeepSkyBlue4" :weight bold))))
+ '(highlight ((t (:background "sea green"))))
+ '(hl-line ((t (:background "grey25"))))
+ '(hl-paren-face ((t (:weight bold))) t)
+ '(lusty-file-face ((t (:foreground "SpringGreen1"))) t)
+ '(menu ((t (:background "gray30" :foreground "gray70"))))
'(minibuffer-prompt ((t (:background "yellow" :foreground "medium blue" :box (:line-width -1 :color "red" :style released-button) :weight bold))))
- '(mode-line ((t (:box (:line-width -1 :color "red" :style released-button) :family "DejaVu Sans"))))
- '(mode-line-inactive ((t (:inherit mode-line :foreground "gray"))))
- '(org-agenda-date ((t (:inherit org-agenda-structure))))
- '(org-agenda-date-today ((t (:inherit org-agenda-date :underline t))))
- '(org-agenda-date-weekend ((t (:inherit org-agenda-date :foreground "dark green"))))
- '(org-agenda-structure ((t (:foreground "SkyBlue" :weight bold))))
- '(org-hide ((t (:foreground "gray30"))))
+ '(mode-line ((t (:box (:line-width 1 :color "red") :family "DejaVu Sans"))))
+ '(mode-line-inactive ((t (:inherit mode-line :foreground "dim gray"))))
+ '(org-agenda-date ((t (:inherit org-agenda-structure))) t)
+ '(org-agenda-date-today ((t (:inherit org-agenda-date :underline t))) t)
+ '(org-agenda-date-weekend ((t (:inherit org-agenda-date :foreground "green"))) t)
+ '(org-agenda-done ((t (:foreground "#269926"))))
+ '(org-agenda-restriction-lock ((t (:background "#FFB273"))))
+ '(org-agenda-structure ((t (:foreground "#4671D5" :weight bold))))
+ '(org-date ((t (:foreground "medium sea green" :underline t))))
+ '(org-done ((t (:foreground "#008500" :weight bold))))
+ '(org-drawer ((t (:foreground "#2A4480"))))
+ '(org-ellipsis ((t (:foreground "#FF7400" :underline t))))
+ '(org-footnote ((t (:foreground "#1240AB" :underline t))))
+ '(org-hide ((t (:foreground "gray20"))))
+ '(org-level-1 ((t (:inherit outline-1 :box nil))))
+ '(org-level-2 ((t (:inherit outline-2 :box nil))))
+ '(org-level-3 ((t (:inherit outline-3 :box nil))))
+ '(org-level-4 ((t (:inherit outline-4 :box nil))))
+ '(org-level-5 ((t (:inherit outline-5 :box nil))))
+ '(org-level-6 ((t (:inherit outline-6 :box nil))))
+ '(org-level-7 ((t (:inherit outline-7 :box nil))))
+ '(org-level-8 ((t (:inherit outline-8 :box nil))))
+ '(org-scheduled-previously ((t (:foreground "#FF7400"))))
'(org-tag ((t (:weight bold))))
- '(outline-1 ((t (:inherit font-lock-function-name-face :weight bold))))
- '(outline-2 ((t (:inherit font-lock-variable-name-face :weight bold))))
- '(outline-3 ((t (:inherit font-lock-keyword-face :weight bold))))
- '(outline-4 ((t (:inherit font-lock-comment-face :weight bold))))
- '(outline-5 ((t (:inherit font-lock-type-face :weight bold))))
- '(outline-6 ((t (:inherit font-lock-constant-face :weight bold))))
- '(outline-7 ((t (:inherit font-lock-builtin-face :weight bold))))
- '(outline-8 ((t (:inherit font-lock-string-face :weight bold))))
- '(rcirc-my-nick ((t (:foreground "LightSkyBlue" :weight bold))))
- '(region ((t (:background "SteelBlue4"))))
- '(show-paren-match ((t (:background "DarkGreen"))))
- '(show-paren-mismatch ((t (:background "deep pink"))))
+ '(org-todo ((t (:foreground "#FF6961" :weight bold))))
+ '(outline-1 ((t (:foreground "cyan1" :box (:line-width 1 :color "gainsboro") :weight bold))))
+ '(outline-2 ((t (:foreground "SeaGreen1" :box (:line-width 1 :color "gainsboro") :weight bold))))
+ '(outline-3 ((t (:foreground "cyan3" :box (:line-width 1 :color "gainsboro") :weight bold))))
+ '(outline-4 ((t (:foreground "SeaGreen3" :box (:line-width 1 :color "gainsboro") :weight bold))))
+ '(outline-5 ((t (:foreground "LightGoldenrod1" :box (:line-width 1 :color "gainsboro") :weight bold))))
+ '(outline-6 ((t (:foreground "light salmon" :box (:line-width 1 :color "gainsboro") :weight bold))))
+ '(outline-7 ((t (:foreground "pale goldenrod" :box (:line-width 1 :color "gainsboro") :weight bold))))
+ '(outline-8 ((t (:foreground "OliveDrab1" :box (:line-width 1 :color "gainsboro") :weight bold))))
+ '(rcirc-my-nick ((t (:foreground "SpringGreen1" :weight bold))) t)
+ '(rcirc-other-nick ((t (:foreground "dodger blue"))) t)
+ '(rcirc-track-keyword ((t (:foreground "DodgerBlue" :weight bold))) t)
+ '(rcirc-track-nick ((t (:background "yellow" :foreground "DodgerBlue" :weight bold))) t)
+ '(region ((t (:background "SeaGreen4"))))
+ '(scroll-bar ((t (:background "gray20" :foreground "dark turquoise"))))
+ '(secondary-selection ((t (:background "#333366" :foreground "#f6f3e8"))))
+ '(show-paren-match ((t (:background "DeepSkyBlue4"))))
+ '(show-paren-mismatch ((t (:background "dark magenta"))))
+ '(th-sentence-hl-face ((t (:weight bold))))
+ '(widget-field ((t (:box (:line-width 2 :color "grey75" :style pressed-button)))))
'(window-number-face ((t (:foreground "red" :weight bold)))))
(provide-theme 'tsdh-dark)
+2012-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * quail/latin-ltx.el: Avoid deprecated chars for \langle and \rangle.
+ Remove \rightparengtr and \leftparengtr for lack of consensus.
+ Suggested by Mattias Engdegård <mattiase@bredband.net> (bug#12948).
+
2012-09-05 Eli Zaretskii <eliz@gnu.org>
* quail/hebrew.el ("yiddish-royal"): Fix several bogus entries.
("\\infty" ?∞)
("\\int" ?∫)
("\\intercal" ?⊺)
- ("\\langle" ?â\8c©)
+ ("\\langle" ?â\9f¨) ;; Was ?â\8c©, see bug#12948.
("\\lbrace" ?{)
("\\lbrack" ?\[)
("\\lceil" ?⌈)
("\\leftharpoondown" ?↽)
("\\leftharpoonup" ?↼)
("\\leftleftarrows" ?⇇)
- ("\\leftparengtr" ?〈)
+ ;; ("\\leftparengtr" ?〈), see bug#12948.
("\\leftrightarrow" ?↔)
("\\leftrightarrows" ?⇆)
("\\leftrightharpoons" ?⇋)
("\\propto" ?∝)
("\\qed" ?∎)
("\\quad" ? )
- ("\\rangle" ?â\8cª)
+ ("\\rangle" ?â\9f©) ;; Was ?â\8cª, see bug#12948.
("\\rbrace" ?})
("\\rbrack" ?\])
("\\rceil" ?⌉)
("\\rightharpoonup" ?⇀)
("\\rightleftarrows" ?⇄)
("\\rightleftharpoons" ?⇌)
- ("\\rightparengtr" ?〉)
+ ;; ("\\rightparengtr" ?⦔) ;; Was ?〉, see bug#12948.
("\\rightrightarrows" ?⇉)
("\\rightthreetimes" ?⋌)
("\\risingdotseq" ?≓)
+2013-01-01 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in (lisp1): Add macroexp.elc (bug#13320).
+
+2012-12-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in (SYSWAIT_H): Update dependencies.
+
+2012-12-10 Eli Zaretskii <eliz@gnu.org>
+
+ * makefile.w32-in (obj): Add w32notify.o. Add missing X and Unix
+ sources.
+
+2012-12-02 Kevin Ryde <user42@zip.com.au>
+
+ * etags.c (Lisp_functions): Skip (defvar foo) declarations unless
+ the --declarations flag is enabled (Bug#5600).
+ (Lisp_help): Update.
+ (skip_name): New function.
+
+2012-12-01 Kevin Ryde <user42@zip.com.au>
+
+ * etags.c (Perl_functions): Support "use constant" (Bug#5055).
+
+2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
+ * movemail.c (main): Assume EAGAIN and EBUSY.
+
+2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ movemail: treat EACCES etc. failures as permanent
+ * movemail.c (main): Treat any link failure other than EEXIST as a
+ permanent failure, not just EPERM. EACCES, for example.
+
+2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
+ * emacsclient.c (getcwd): Remove decl.
+ (get_current_dir_name): Assume getcwd exists.
+ * etags.c (HAVE_GETCWD): Remove.
+ (getcwd): Remove decl.
+ (NO_LONG_OPTIONS): Remove this. All uses removed.
+ Emacs always has GNU getopt.
+ (etags_getcwd): Assume getcwd exists.
+ * movemail.c (F_OK, X_OK, W_OK, R_OK): Remove.
+
+2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * emacsclient.c (handle_sigcont, handle_sigtstp): Use raise (sig)
+ rather than kill (getpid (), sig), as it's simpler and safer.
+
+2012-11-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in (SYSWAIT_H): New macro.
+ ($(BLD)/movemail.$(O)): Update dependencies.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
+ * movemail.c, update-game-score.c: Assume <fcntl.h> exists.
+
2012-10-26 Glenn Morris <rgm@gnu.org>
* Makefile.in (uninstall): No INSTALLABLES live in archlibdir.
\f
-char *getenv (const char *), *getwd (char *);
-#ifdef HAVE_GETCWD
-char *(getcwd) (char *, size_t);
-#endif
+char *getenv (const char *);
#ifndef VERSION
#define VERSION "unspecified"
char *buf;
const char *pwd;
struct stat dotstat, pwdstat;
- /* If PWD is accurate, use it instead of calling getwd. PWD is
+ /* If PWD is accurate, use it instead of calling getcwd. PWD is
sometimes a nicer name, and using it may avoid a fatal error if a
parent directory is searchable but not readable. */
if ((pwd = egetenv ("PWD")) != 0
buf = (char *) xmalloc (strlen (pwd) + 1);
strcpy (buf, pwd);
}
-#ifdef HAVE_GETCWD
else
{
size_t buf_size = 1024;
}
}
}
-#else
- else
- {
- /* We need MAXPATHLEN here. */
- buf = (char *) xmalloc (MAXPATHLEN + 1);
- if (getwd (buf) == NULL)
- {
- int tmp_errno = errno;
- free (buf);
- errno = tmp_errno;
- return NULL;
- }
- }
-#endif
return buf;
}
#endif
else
{
/* We are in the background; cancel the continue. */
- kill (getpid (), SIGSTOP);
+ raise (SIGSTOP);
}
signal (signalnum, handle_sigcont);
sigprocmask (SIG_BLOCK, NULL, &set);
sigdelset (&set, signalnum);
signal (signalnum, SIG_DFL);
- kill (getpid (), signalnum);
+ raise (signalnum);
sigprocmask (SIG_SETMASK, &set, NULL); /* Let's the above signal through. */
signal (signalnum, handle_sigtstp);
cwd = get_current_dir_name ();
if (cwd == 0)
{
- /* getwd puts message in STRING if it fails. */
message (TRUE, "%s: %s\n", progname,
"Cannot get current working directory");
fail ();
# undef HAVE_NTGUI
# undef DOS_NT
# define DOS_NT
-# ifndef HAVE_GETCWD
-# define HAVE_GETCWD
-# endif /* undef HAVE_GETCWD */
-#else /* not WINDOWSNT */
-#endif /* !WINDOWSNT */
+#endif /* WINDOWSNT */
#include <unistd.h>
-#ifndef HAVE_UNISTD_H
-# if defined (HAVE_GETCWD) && !defined (WINDOWSNT)
- extern char *getcwd (char *buf, size_t size);
-# endif
-#endif /* HAVE_UNISTD_H */
-
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
# define assert(x) ((void) 0)
#endif
-#ifdef NO_LONG_OPTIONS /* define this if you don't have GNU getopt */
-# define NO_LONG_OPTIONS TRUE
-# define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr)
- extern char *optarg;
- extern int optind, opterr;
-#else
-# define NO_LONG_OPTIONS FALSE
-# include <getopt.h>
-#endif /* NO_LONG_OPTIONS */
-
+#include <getopt.h>
#include <regex.h>
/* Define CTAGS to make the program "ctags" compatible with the usual one.
static char *concat (const char *, const char *, const char *);
static char *skip_spaces (char *);
static char *skip_non_spaces (char *);
+static char *skip_name (char *);
static char *savenstr (const char *, int);
static char *savestr (const char *);
static char *etags_strchr (const char *, int);
"In Lisp code, any function defined with `defun', any variable\n\
defined with `defvar' or `defconst', and in general the first\n\
argument of any expression that starts with `(def' in column zero\n\
-is a tag.";
+is a tag.\n\
+The `--declarations' option tags \"(defvar foo)\" constructs too.";
static const char *Lua_suffixes [] =
{ "lua", "LUA", NULL };
printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\
\n\
These are the options accepted by %s.\n", progname, progname);
- if (NO_LONG_OPTIONS)
- puts ("WARNING: long option names do not work with this executable,\n\
-as it is not linked with GNU getopt.");
- else
- puts ("You may use unambiguous abbreviations for the long option names.");
+ puts ("You may use unambiguous abbreviations for the long option names.");
puts (" A - as file name means read names from stdin (one per line).\n\
Absolute names are stored in the output file as they are.\n\
Relative ones are stored relative to the output file's directory.\n");
/* When the optstring begins with a '-' getopt_long does not rearrange the
non-options arguments to be at the end, but leaves them alone. */
- optstring = concat (NO_LONG_OPTIONS ? "" : "-",
- "ac:Cf:Il:o:r:RSVhH",
- (CTAGS) ? "BxdtTuvw" : "Di:");
+ optstring = concat ("-ac:Cf:Il:o:r:RSVhH",
+ (CTAGS) ? "BxdtTuvw" : "Di:",
+ "");
while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF)
switch (opt)
/*
* Perl support
* Perl sub names: /^sub[ \t\n]+[^ \t\n{]+/
+ * /^use constant[ \t\n]+[^ \t\n{=,;]+/
* Perl variable names: /^(my|local).../
* Original code by Bart Robinson <lomew@cs.utah.edu> (1995)
* Additions by Michael Ernst <mernst@alum.mit.edu> (1997)
}
else if (LOOKING_AT (cp, "sub"))
{
- char *pos;
- char *sp = cp;
+ char *pos, *sp;
+ subr:
+ sp = cp;
while (!notinname (*cp))
cp++;
if (cp == sp)
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
free (name);
}
+ }
+ else if (LOOKING_AT (cp, "use constant")
+ || LOOKING_AT (cp, "use constant::defer"))
+ {
+ /* For hash style multi-constant like
+ use constant { FOO => 123,
+ BAR => 456 };
+ only the first FOO is picked up. Parsing across the value
+ expressions would be difficult in general, due to possible nested
+ hashes, here-documents, etc. */
+ if (*cp == '{')
+ cp = skip_spaces (cp+1);
+ goto subr;
}
- else if (globals) /* only if we are tagging global vars */
+ else if (globals) /* only if we are tagging global vars */
{
/* Skip a qualifier, if any. */
bool qual = LOOKING_AT (cp, "my") || LOOKING_AT (cp, "local");
if (dbp[0] != '(')
continue;
+ /* "(defvar foo)" is a declaration rather than a definition. */
+ if (! declarations)
+ {
+ char *p = dbp + 1;
+ if (LOOKING_AT (p, "defvar"))
+ {
+ p = skip_name (p); /* past var name */
+ p = skip_spaces (p);
+ if (*p == ')')
+ continue;
+ }
+ }
+
if (strneq (dbp+1, "def", 3) || strneq (dbp+1, "DEF", 3))
{
dbp = skip_non_spaces (dbp);
return cp;
}
+/* Skip any chars in the "name" class.*/
+static char *
+skip_name (char *cp)
+{
+ /* '\0' is a notinname() so loop stops there too */
+ while (! notinname (*cp))
+ cp++;
+ return cp;
+}
+
/* Print error message and exit. */
void
fatal (const char *s1, const char *s2)
static void
suggest_asking_for_help (void)
{
- fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
- progname, NO_LONG_OPTIONS ? "-h" : "--help");
+ fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n",
+ progname);
exit (EXIT_FAILURE);
}
static char *
etags_getcwd (void)
{
-#ifdef HAVE_GETCWD
int bufsize = 200;
char *path = xnew (bufsize, char);
canonicalize_filename (path);
return path;
-
-#else /* not HAVE_GETCWD */
-#if MSDOS
-
- char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */
-
- getwd (path);
-
- for (p = path; *p != '\0'; p++)
- if (*p == '\\')
- *p = '/';
- else
- *p = lowcase (*p);
-
- return strdup (path);
-#else /* not MSDOS */
- linebuffer path;
- FILE *pipe;
-
- linebuffer_init (&path);
- pipe = (FILE *) popen ("pwd 2>/dev/null", "r");
- if (pipe == NULL || readline_internal (&path, pipe) == 0)
- pfatal ("pwd");
- pclose (pipe);
-
- return path.buffer;
-#endif /* not MSDOS */
-#endif /* not HAVE_GETCWD */
}
/* Return a newly allocated string containing the file name of FILE
#
obj = dosfns.o msdos.o \
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
- fontset.o menu.o \
- w32.o w32console.o w32fns.o w32heap.o w32inevt.o cygw32.o \
+ fontset.o menu.o dbusbind.o cygw32.o \
+ nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
+ w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
- font.o w32font.o w32uniscribe.o \
+ w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
+ xsettings.o xgselect.o termcap.o \
+ font.o w32font.o w32uniscribe.o w32notify.o \
dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
charset.o coding.o category.o ccl.o character.o chartab.o \
cm.o term.o terminal.o xfaces.o \
$(lispsource)international/mule-cmds.elc \
$(lispsource)international/characters.elc \
$(lispsource)international/charprop.el \
- $(lispsource)case-table.elc
+ $(lispsource)case-table.elc \
+ $(lispsource)emacs-lisp/macroexp.elc
lisp2 = \
$(lispsource)language/chinese.elc \
SYSTIME_H = $(SRC)/systime.h \
$(NT_INC)/sys/time.h \
$(GNU_LIB)/timespec.h
+SYSWAIT_H = $(SRC)/syswait.h \
+ $(NT_INC)/stdbool.h \
+ $(NT_INC)/sys/wait.h
$(BLD)/ctags.$(O) : \
$(LIB_SRC)/ctags.c \
$(BLD)/movemail.$(O) : \
$(LIB_SRC)/movemail.c \
$(LIB_SRC)/pop.h \
- $(SRC)/syswait.h \
$(NT_INC)/pwd.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/sys/stat.h \
$(NT_INC)/unistd.h \
$(GNU_LIB)/getopt.h \
$(CONFIG_H) \
- $(NTLIB_H)
+ $(NTLIB_H) \
+ $(SYSWAIT_H)
$(BLD)/ntlib.$(O) : \
$(LIB_SRC)/ntlib.c \
#include <getopt.h>
#include <unistd.h>
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif
#include <string.h>
#include "syswait.h"
#ifdef MAIL_USE_POP
#include <fcntl.h>
#endif /* WINDOWSNT */
-#ifndef F_OK
-#define F_OK 0
-#define X_OK 1
-#define W_OK 2
-#define R_OK 4
-#endif
-
#ifdef WINDOWSNT
#include <sys/locking.h>
#endif
tem = link (tempname, lockname);
-#ifdef EPERM
- if (tem < 0 && errno == EPERM)
- fatal ("Unable to create hard link between %s and %s",
- tempname, lockname);
-#endif
+ if (tem < 0 && errno != EEXIST)
+ pfatal_with_name (lockname);
unlink (tempname);
if (tem >= 0)
for certain failure codes. */
if (status < 0)
{
- if (++lockcount <= 5)
+ if (++lockcount <= 5 && (errno == EAGAIN || errno == EBUSY))
{
-#ifdef EAGAIN
- if (errno == EAGAIN)
- {
- sleep (1);
- goto retry_lock;
- }
-#endif
-#ifdef EBUSY
- if (errno == EBUSY)
- {
- sleep (1);
- goto retry_lock;
- }
-#endif
+ sleep (1);
+ goto retry_lock;
}
pfatal_with_name (inname);
#include <time.h>
#include <pwd.h>
#include <ctype.h>
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif
#include <sys/stat.h>
#include <getopt.h>
--- /dev/null
+/* Define at-style functions like fstatat, unlinkat, fchownat, etc.
+ Copyright (C) 2006, 2009-2013 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/>. */
+
+/* written by Jim Meyering */
+
+#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+
+#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
+# include <errno.h>
+# ifndef ENOTSUP
+# define ENOTSUP EINVAL
+# endif
+#else
+# include "openat.h"
+# include "openat-priv.h"
+# include "save-cwd.h"
+#endif
+
+#ifdef AT_FUNC_USE_F1_COND
+# define CALL_FUNC(F) \
+ (flag == AT_FUNC_USE_F1_COND \
+ ? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS) \
+ : AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS))
+# define VALIDATE_FLAG(F) \
+ if (flag & ~AT_FUNC_USE_F1_COND) \
+ { \
+ errno = EINVAL; \
+ return FUNC_FAIL; \
+ }
+#else
+# define CALL_FUNC(F) (AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS))
+# define VALIDATE_FLAG(F) /* empty */
+#endif
+
+#ifdef AT_FUNC_RESULT
+# define FUNC_RESULT AT_FUNC_RESULT
+#else
+# define FUNC_RESULT int
+#endif
+
+#ifdef AT_FUNC_FAIL
+# define FUNC_FAIL AT_FUNC_FAIL
+#else
+# define FUNC_FAIL -1
+#endif
+
+/* Call AT_FUNC_F1 to operate on FILE, which is in the directory
+ open on descriptor FD. If AT_FUNC_USE_F1_COND is defined to a value,
+ AT_FUNC_POST_FILE_PARAM_DECLS must include a parameter named flag;
+ call AT_FUNC_F2 if FLAG is 0 or fail if FLAG contains more bits than
+ AT_FUNC_USE_F1_COND. Return int and fail with -1 unless AT_FUNC_RESULT
+ or AT_FUNC_FAIL are defined. If possible, do it without changing the
+ working directory. Otherwise, resort to using save_cwd/fchdir,
+ then AT_FUNC_F?/restore_cwd. If either the save_cwd or the restore_cwd
+ fails, then give a diagnostic and exit nonzero. */
+FUNC_RESULT
+AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
+{
+ VALIDATE_FLAG (flag);
+
+ if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
+ return CALL_FUNC (file);
+
+#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
+ errno = ENOTSUP;
+ return FUNC_FAIL;
+#else
+ {
+ /* Be careful to choose names unlikely to conflict with
+ AT_FUNC_POST_FILE_PARAM_DECLS. */
+ struct saved_cwd saved_cwd;
+ int saved_errno;
+ FUNC_RESULT err;
+
+ {
+ char proc_buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (proc_buf, fd, file);
+ if (proc_file)
+ {
+ FUNC_RESULT proc_result = CALL_FUNC (proc_file);
+ int proc_errno = errno;
+ if (proc_file != proc_buf)
+ free (proc_file);
+ /* If the syscall succeeds, or if it fails with an unexpected
+ errno value, then return right away. Otherwise, fall through
+ and resort to using save_cwd/restore_cwd. */
+ if (FUNC_FAIL != proc_result)
+ return proc_result;
+ if (! EXPECTED_ERRNO (proc_errno))
+ {
+ errno = proc_errno;
+ return proc_result;
+ }
+ }
+ }
+
+ if (save_cwd (&saved_cwd) != 0)
+ openat_save_fail (errno);
+ if (0 <= fd && fd == saved_cwd.desc)
+ {
+ /* If saving the working directory collides with the user's
+ requested fd, then the user's fd must have been closed to
+ begin with. */
+ free_cwd (&saved_cwd);
+ errno = EBADF;
+ return FUNC_FAIL;
+ }
+
+ if (fchdir (fd) != 0)
+ {
+ saved_errno = errno;
+ free_cwd (&saved_cwd);
+ errno = saved_errno;
+ return FUNC_FAIL;
+ }
+
+ err = CALL_FUNC (file);
+ saved_errno = (err == FUNC_FAIL ? errno : 0);
+
+ if (restore_cwd (&saved_cwd) != 0)
+ openat_restore_fail (errno);
+
+ free_cwd (&saved_cwd);
+
+ if (saved_errno)
+ errno = saved_errno;
+ return err;
+ }
+#endif
+}
+#undef CALL_FUNC
+#undef FUNC_RESULT
+#undef FUNC_FAIL
--- /dev/null
+/* Close a stream, with nicer error checking than fclose's.
+
+ Copyright (C) 1998-2002, 2004, 2006-2013 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/>. */
+
+#include <config.h>
+
+#include "close-stream.h"
+
+#include <errno.h>
+#include <stdbool.h>
+
+#include "fpending.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+/* Close STREAM. Return 0 if successful, EOF (setting errno)
+ otherwise. A failure might set errno to 0 if the error number
+ cannot be determined.
+
+ A failure with errno set to EPIPE may or may not indicate an error
+ situation worth signaling to the user. See the documentation of the
+ close_stdout_set_ignore_EPIPE function for details.
+
+ If a program writes *anything* to STREAM, that program should close
+ STREAM and make sure that it succeeds before exiting. Otherwise,
+ suppose that you go to the extreme of checking the return status
+ of every function that does an explicit write to STREAM. The last
+ printf can succeed in writing to the internal stream buffer, and yet
+ the fclose(STREAM) could still fail (due e.g., to a disk full error)
+ when it tries to write out that buffered data. Thus, you would be
+ left with an incomplete output file and the offending program would
+ exit successfully. Even calling fflush is not always sufficient,
+ since some file systems (NFS and CODA) buffer written/flushed data
+ until an actual close call.
+
+ Besides, it's wasteful to check the return value from every call
+ that writes to STREAM -- just let the internal stream state record
+ the failure. That's what the ferror test is checking below. */
+
+int
+close_stream (FILE *stream)
+{
+ const bool some_pending = (__fpending (stream) != 0);
+ const bool prev_fail = (ferror (stream) != 0);
+ const bool fclose_fail = (fclose (stream) != 0);
+
+ /* Return an error indication if there was a previous failure or if
+ fclose failed, with one exception: ignore an fclose failure if
+ there was no previous error, no data remains to be flushed, and
+ fclose failed with EBADF. That can happen when a program like cp
+ is invoked like this 'cp a b >&-' (i.e., with standard output
+ closed) and doesn't generate any output (hence no previous error
+ and nothing to be flushed). */
+
+ if (prev_fail || (fclose_fail && (some_pending || errno != EBADF)))
+ {
+ if (! fclose_fail)
+ errno = 0;
+ return EOF;
+ }
+
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+int close_stream (FILE *stream);
/* Duplicate an open file descriptor to a specified file descriptor.
- Copyright (C) 1999, 2004-2007, 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004-2007, 2009-2013 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
# ifdef F_GETFL
/* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
On Cygwin 1.5.x, dup2 (1, 1) returns 0.
+ On Cygwin 1.7.17, dup2 (1, -1) dumps core.
On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */
+ if (desired_fd < 0)
+ fd = desired_fd;
if (fd == desired_fd)
return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
# endif
--- /dev/null
+/* euidaccess -- check if effective user id can access file
+
+ Copyright (C) 1990-1991, 1995, 1998, 2000, 2003-2006, 2008-2013 Free
+ Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ 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/>. */
+
+/* Written by David MacKenzie and Torbjorn Granlund.
+ Adapted for GNU C library by Roland McGrath. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "root-uid.h"
+
+#if HAVE_LIBGEN_H
+# include <libgen.h>
+#endif
+
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
+
+#if defined EACCES && !defined EACCESS
+# define EACCESS EACCES
+#endif
+
+#ifndef F_OK
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+#endif
+
+
+#ifdef _LIBC
+
+# define access __access
+# define getuid __getuid
+# define getgid __getgid
+# define geteuid __geteuid
+# define getegid __getegid
+# define group_member __group_member
+# define euidaccess __euidaccess
+# undef stat
+# define stat stat64
+
+#endif
+
+/* Return 0 if the user has permission of type MODE on FILE;
+ otherwise, return -1 and set 'errno'.
+ Like access, except that it uses the effective user and group
+ id's instead of the real ones, and it does not always check for read-only
+ file system, text busy, etc. */
+
+int
+euidaccess (const char *file, int mode)
+{
+#if HAVE_FACCESSAT /* glibc, AIX 7, Solaris 11, Cygwin 1.7 */
+ return faccessat (AT_FDCWD, file, mode, AT_EACCESS);
+#elif defined EFF_ONLY_OK /* IRIX, OSF/1, Interix */
+ return access (file, mode | EFF_ONLY_OK);
+#elif defined ACC_SELF /* AIX */
+ return accessx (file, mode, ACC_SELF);
+#elif HAVE_EACCESS /* FreeBSD */
+ return eaccess (file, mode);
+#else /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, mingw, BeOS */
+
+ uid_t uid = getuid ();
+ gid_t gid = getgid ();
+ uid_t euid = geteuid ();
+ gid_t egid = getegid ();
+ struct stat stats;
+
+# if HAVE_DECL_SETREGID && PREFER_NONREENTRANT_EUIDACCESS
+
+ /* Define PREFER_NONREENTRANT_EUIDACCESS if you prefer euidaccess to
+ return the correct result even if this would make it
+ nonreentrant. Define this only if your entire application is
+ safe even if the uid or gid might temporarily change. If your
+ application uses signal handlers or threads it is probably not
+ safe. */
+
+ if (mode == F_OK)
+ return stat (file, &stats);
+ else
+ {
+ int result;
+ int saved_errno;
+
+ if (uid != euid)
+ setreuid (euid, uid);
+ if (gid != egid)
+ setregid (egid, gid);
+
+ result = access (file, mode);
+ saved_errno = errno;
+
+ /* Restore them. */
+ if (uid != euid)
+ setreuid (uid, euid);
+ if (gid != egid)
+ setregid (gid, egid);
+
+ errno = saved_errno;
+ return result;
+ }
+
+# else
+
+ /* The following code assumes the traditional Unix model, and is not
+ correct on systems that have ACLs or the like. However, it's
+ better than nothing, and it is reentrant. */
+
+ unsigned int granted;
+ if (uid == euid && gid == egid)
+ /* If we are not set-uid or set-gid, access does the same. */
+ return access (file, mode);
+
+ if (stat (file, &stats) != 0)
+ return -1;
+
+ /* The super-user can read and write any file, and execute any file
+ that anyone can execute. */
+ if (euid == ROOT_UID
+ && ((mode & X_OK) == 0
+ || (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
+ return 0;
+
+ /* Convert the mode to traditional form, clearing any bogus bits. */
+ if (R_OK == 4 && W_OK == 2 && X_OK == 1 && F_OK == 0)
+ mode &= 7;
+ else
+ mode = ((mode & R_OK ? 4 : 0)
+ + (mode & W_OK ? 2 : 0)
+ + (mode & X_OK ? 1 : 0));
+
+ if (mode == 0)
+ return 0; /* The file exists. */
+
+ /* Convert the file's permission bits to traditional form. */
+ if (S_IRUSR == (4 << 6) && S_IWUSR == (2 << 6) && S_IXUSR == (1 << 6)
+ && S_IRGRP == (4 << 3) && S_IWGRP == (2 << 3) && S_IXGRP == (1 << 3)
+ && S_IROTH == (4 << 0) && S_IWOTH == (2 << 0) && S_IXOTH == (1 << 0))
+ granted = stats.st_mode;
+ else
+ granted = ((stats.st_mode & S_IRUSR ? 4 << 6 : 0)
+ + (stats.st_mode & S_IWUSR ? 2 << 6 : 0)
+ + (stats.st_mode & S_IXUSR ? 1 << 6 : 0)
+ + (stats.st_mode & S_IRGRP ? 4 << 3 : 0)
+ + (stats.st_mode & S_IWGRP ? 2 << 3 : 0)
+ + (stats.st_mode & S_IXGRP ? 1 << 3 : 0)
+ + (stats.st_mode & S_IROTH ? 4 << 0 : 0)
+ + (stats.st_mode & S_IWOTH ? 2 << 0 : 0)
+ + (stats.st_mode & S_IXOTH ? 1 << 0 : 0));
+
+ if (euid == stats.st_uid)
+ granted >>= 6;
+ else if (egid == stats.st_gid || group_member (stats.st_gid))
+ granted >>= 3;
+
+ if ((mode & ~granted) == 0)
+ return 0;
+ __set_errno (EACCESS);
+ return -1;
+
+# endif
+#endif
+}
+#undef euidaccess
+#ifdef weak_alias
+weak_alias (__euidaccess, euidaccess)
+#endif
+\f
+#ifdef TEST
+# include <error.h>
+# include <stdio.h>
+# include <stdlib.h>
+
+char *program_name;
+
+int
+main (int argc, char **argv)
+{
+ char *file;
+ int mode;
+ int err;
+
+ program_name = argv[0];
+ if (argc < 3)
+ abort ();
+ file = argv[1];
+ mode = atoi (argv[2]);
+
+ err = euidaccess (file, mode);
+ printf ("%d\n", err);
+ if (err != 0)
+ error (0, errno, "%s", file);
+ exit (0);
+}
+#endif
--- /dev/null
+/* Check the access rights of a file relative to an open directory.
+ Copyright (C) 2009-2013 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/>. */
+
+/* written by Eric Blake */
+
+#include <config.h>
+
+#include <unistd.h>
+#include <fcntl.h>
+
+#ifndef HAVE_ACCESS
+/* Mingw lacks access, but it also lacks real vs. effective ids, so
+ the gnulib euidaccess module is good enough. */
+# undef access
+# define access euidaccess
+#endif
+
+/* Invoke access or euidaccess on file, FILE, using mode MODE, in the directory
+ open on descriptor FD. If possible, do it without changing the
+ working directory. Otherwise, resort to using save_cwd/fchdir, then
+ (access|euidaccess)/restore_cwd. If either the save_cwd or the
+ restore_cwd fails, then give a diagnostic and exit nonzero.
+ Note that this implementation only supports AT_EACCESS, although some
+ native versions also support AT_SYMLINK_NOFOLLOW. */
+
+#define AT_FUNC_NAME faccessat
+#define AT_FUNC_F1 euidaccess
+#define AT_FUNC_F2 access
+#define AT_FUNC_USE_F1_COND AT_EACCESS
+#define AT_FUNC_POST_FILE_PARAM_DECLS , int mode, int flag
+#define AT_FUNC_POST_FILE_ARGS , mode
+#include "at-func.c"
--- /dev/null
+/* Like <fcntl.h>, but with non-working flags defined to 0.
+
+ Copyright (C) 2006-2013 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/>. */
+
+/* written by Paul Eggert */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_fcntl_h
+/* Special invocation convention. */
+
+/* Needed before <sys/stat.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+# include <sys/stat.h>
+#endif
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+
+/* Needed before <sys/stat.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+# include <sys/stat.h>
+#endif
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+#define _@GUARD_PREFIX@_FCNTL_H
+
+#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
+# include <unistd.h>
+#endif
+
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_FCNTL@
+# if @REPLACE_FCNTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcntl
+# define fcntl rpl_fcntl
+# endif
+_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
+_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
+# else
+# if !@HAVE_FCNTL@
+_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+# endif
+_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
+# endif
+_GL_CXXALIASWARN (fcntl);
+#elif defined GNULIB_POSIXCHECK
+# undef fcntl
+# if HAVE_RAW_DECL_FCNTL
+_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
+ "use gnulib module fcntl for portability");
+# endif
+#endif
+
+#if @GNULIB_OPEN@
+# if @REPLACE_OPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open rpl_open
+# endif
+_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a
+ default argument. _GL_CXXALIASWARN does not work in this case. */
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef open
+/* Assume open is always declared. */
+_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
+ "use gnulib module open for portability");
+#endif
+
+#if @GNULIB_OPENAT@
+# if @REPLACE_OPENAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef openat
+# define openat rpl_openat
+# endif
+_GL_FUNCDECL_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# else
+# if !@HAVE_OPENAT@
+_GL_FUNCDECL_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# endif
+_GL_CXXALIASWARN (openat);
+#elif defined GNULIB_POSIXCHECK
+# undef openat
+# if HAVE_RAW_DECL_OPENAT
+_GL_WARN_ON_USE (openat, "openat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+/* Fix up the FD_* macros, only known to be missing on mingw. */
+
+#ifndef FD_CLOEXEC
+# define FD_CLOEXEC 1
+#endif
+
+/* Fix up the supported F_* macros. Intentionally leave other F_*
+ macros undefined. Only known to be missing on mingw. */
+
+#ifndef F_DUPFD_CLOEXEC
+# define F_DUPFD_CLOEXEC 0x40000000
+/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */
+# define GNULIB_defined_F_DUPFD_CLOEXEC 1
+#else
+# define GNULIB_defined_F_DUPFD_CLOEXEC 0
+#endif
+
+#ifndef F_DUPFD
+# define F_DUPFD 1
+#endif
+
+#ifndef F_GETFD
+# define F_GETFD 2
+#endif
+
+/* Fix up the O_* macros. */
+
+#if !defined O_DIRECT && defined O_DIRECTIO
+/* Tru64 spells it 'O_DIRECTIO'. */
+# define O_DIRECT O_DIRECTIO
+#endif
+
+#if !defined O_CLOEXEC && defined O_NOINHERIT
+/* Mingw spells it 'O_NOINHERIT'. */
+# define O_CLOEXEC O_NOINHERIT
+#endif
+
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+
+#ifndef O_DIRECT
+# define O_DIRECT 0
+#endif
+
+#ifndef O_DIRECTORY
+# define O_DIRECTORY 0
+#endif
+
+#ifndef O_DSYNC
+# define O_DSYNC 0
+#endif
+
+#ifndef O_EXEC
+# define O_EXEC O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_IGNORE_CTTY
+# define O_IGNORE_CTTY 0
+#endif
+
+#ifndef O_NDELAY
+# define O_NDELAY 0
+#endif
+
+#ifndef O_NOATIME
+# define O_NOATIME 0
+#endif
+
+#ifndef O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+#endif
+
+/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero
+ value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY
+ or to 0 as fallback. */
+#if @GNULIB_NONBLOCKING@
+# if O_NONBLOCK
+# define GNULIB_defined_O_NONBLOCK 0
+# else
+# define GNULIB_defined_O_NONBLOCK 1
+# undef O_NONBLOCK
+# define O_NONBLOCK 0x40000000
+# endif
+#endif
+
+#ifndef O_NOCTTY
+# define O_NOCTTY 0
+#endif
+
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
+#ifndef O_NOLINK
+# define O_NOLINK 0
+#endif
+
+#ifndef O_NOLINKS
+# define O_NOLINKS 0
+#endif
+
+#ifndef O_NOTRANS
+# define O_NOTRANS 0
+#endif
+
+#ifndef O_RSYNC
+# define O_RSYNC 0
+#endif
+
+#ifndef O_SEARCH
+# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_SYNC
+# define O_SYNC 0
+#endif
+
+#ifndef O_TTY_INIT
+# define O_TTY_INIT 0
+#endif
+
+#if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+# undef O_ACCMODE
+# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+#endif
+
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in fcntl.h */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+
+#if defined __BEOS__ || defined __HAIKU__
+ /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+
+#ifndef O_BINARY
+# define O_BINARY 0
+# define O_TEXT 0
+#endif
+
+/* Fix up the AT_* macros. */
+
+/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
+ value exceeds INT_MAX, so its use as an int doesn't conform to the
+ C standard, and GCC and Sun C complain in some cases. If the bug
+ is present, undef AT_FDCWD here, so it can be redefined below. */
+#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
+# undef AT_FDCWD
+#endif
+
+/* Use the same bit pattern as Solaris 9, but with the proper
+ signedness. The bit pattern is important, in case this actually is
+ Solaris with the above workaround. */
+#ifndef AT_FDCWD
+# define AT_FDCWD (-3041965)
+#endif
+
+/* Use the same values as Solaris 9. This shouldn't matter, but
+ there's no real reason to differ. */
+#ifndef AT_SYMLINK_NOFOLLOW
+# define AT_SYMLINK_NOFOLLOW 4096
+#endif
+
+#ifndef AT_REMOVEDIR
+# define AT_REMOVEDIR 1
+#endif
+
+/* Solaris 9 lacks these two, so just pick unique values. */
+#ifndef AT_SYMLINK_FOLLOW
+# define AT_SYMLINK_FOLLOW 2
+#endif
+
+#ifndef AT_EACCESS
+# define AT_EACCESS 4
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif
/* filemode.c -- make a string describing file modes
- Copyright (C) 1985, 1990, 1993, 1998-2000, 2004, 2006, 2009-2012 Free
+ Copyright (C) 1985, 1990, 1993, 1998-2000, 2004, 2006, 2009-2013 Free
Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
return 'C';
if (S_ISDOOR (bits))
return 'D';
- if (S_ISMPB (bits) || S_ISMPC (bits))
+ if (S_ISMPB (bits) || S_ISMPC (bits) || S_ISMPX (bits))
return 'm';
if (S_ISNWK (bits))
return 'n';
--- /dev/null
+/* fpending.c -- return the number of pending output bytes on a stream
+ Copyright (C) 2000, 2004, 2006-2007, 2009-2013 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/>. */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+#include "fpending.h"
+
+/* Return the number of pending (aka buffered, unflushed)
+ bytes on the stream, FP, that is open for writing. */
+size_t
+__fpending (FILE *fp)
+{
+ return PENDING_OUTPUT_N_BYTES;
+}
--- /dev/null
+/* Declare __fpending.
+
+ Copyright (C) 2000, 2003, 2005-2006, 2009-2013 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/>.
+
+ Written by Jim Meyering. */
+
+#include <stddef.h>
+#include <stdio.h>
+
+#if HAVE_DECL___FPENDING
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
+#else
+size_t __fpending (FILE *);
+#endif
--- /dev/null
+/* provide consistent interface to getgroups for systems that don't allow N==0
+
+ Copyright (C) 1996, 1999, 2003, 2006-2013 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/>. */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#if !HAVE_GETGROUPS
+
+/* Provide a stub that fails with ENOSYS, since there is no group
+ information available on mingw. */
+int
+getgroups (int n _GL_UNUSED, GETGROUPS_T *groups _GL_UNUSED)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+#else /* HAVE_GETGROUPS */
+
+# undef getgroups
+# ifndef GETGROUPS_ZERO_BUG
+# define GETGROUPS_ZERO_BUG 0
+# endif
+
+/* On at least Ultrix 4.3 and NextStep 3.2, getgroups (0, NULL) always
+ fails. On other systems, it returns the number of supplemental
+ groups for the process. This function handles that special case
+ and lets the system-provided function handle all others. However,
+ it can fail with ENOMEM if memory is tight. It is unspecified
+ whether the effective group id is included in the list. */
+
+int
+rpl_getgroups (int n, gid_t *group)
+{
+ int n_groups;
+ GETGROUPS_T *gbuf;
+ int saved_errno;
+
+ if (n < 0)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (n != 0 || !GETGROUPS_ZERO_BUG)
+ {
+ int result;
+ if (sizeof *group == sizeof *gbuf)
+ return getgroups (n, (GETGROUPS_T *) group);
+
+ if (SIZE_MAX / sizeof *gbuf <= n)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ gbuf = malloc (n * sizeof *gbuf);
+ if (!gbuf)
+ return -1;
+ result = getgroups (n, gbuf);
+ if (0 <= result)
+ {
+ n = result;
+ while (n--)
+ group[n] = gbuf[n];
+ }
+ saved_errno = errno;
+ free (gbuf);
+ errno == saved_errno;
+ return result;
+ }
+
+ n = 20;
+ while (1)
+ {
+ /* No need to worry about address arithmetic overflow here,
+ since the ancient systems that we're running on have low
+ limits on the number of secondary groups. */
+ gbuf = malloc (n * sizeof *gbuf);
+ if (!gbuf)
+ return -1;
+ n_groups = getgroups (n, gbuf);
+ if (n_groups == -1 ? errno != EINVAL : n_groups < n)
+ break;
+ free (gbuf);
+ n *= 2;
+ }
+
+ saved_errno = errno;
+ free (gbuf);
+ errno = saved_errno;
+
+ return n_groups;
+}
+
+#endif /* HAVE_GETGROUPS */
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub 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=at-internal --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=openat-h --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask putenv readlink sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings
MOSTLYCLEANFILES += core *.stackdump
## end gnulib module careadlinkat
+## begin gnulib module close-stream
+
+libgnu_a_SOURCES += close-stream.c
+
+EXTRA_DIST += close-stream.h
+
+## end gnulib module close-stream
+
## begin gnulib module crypto/md5
libgnu_a_SOURCES += md5.c
## end gnulib module dup2
+## begin gnulib module euidaccess
+
+if gl_GNULIB_ENABLED_euidaccess
+
+endif
+EXTRA_DIST += euidaccess.c
+
+EXTRA_libgnu_a_SOURCES += euidaccess.c
+
+## end gnulib module euidaccess
+
## begin gnulib module execinfo
BUILT_SOURCES += $(EXECINFO_H)
## end gnulib module execinfo
+## begin gnulib module faccessat
+
+
+EXTRA_DIST += at-func.c faccessat.c
+
+EXTRA_libgnu_a_SOURCES += at-func.c faccessat.c
+
+## end gnulib module faccessat
+
+## begin gnulib module fcntl-h
+
+BUILT_SOURCES += fcntl.h
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(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_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
+ -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
+ -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/fcntl.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += fcntl.h fcntl.h-t
+
+EXTRA_DIST += fcntl.in.h
+
+## end gnulib module fcntl-h
+
## begin gnulib module filemode
libgnu_a_SOURCES += filemode.c
## end gnulib module filemode
+## begin gnulib module fpending
+
+
+EXTRA_DIST += fpending.c fpending.h
+
+EXTRA_libgnu_a_SOURCES += fpending.c
+
+## end gnulib module fpending
+
+## begin gnulib module getgroups
+
+if gl_GNULIB_ENABLED_getgroups
+
+endif
+EXTRA_DIST += getgroups.c
+
+EXTRA_libgnu_a_SOURCES += getgroups.c
+
+## end gnulib module getgroups
+
## begin gnulib module getloadavg
## end gnulib module gettimeofday
+## begin gnulib module group-member
+
+if gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1
+
+endif
+EXTRA_DIST += group-member.c
+
+EXTRA_libgnu_a_SOURCES += group-member.c
+
+## end gnulib module group-member
+
## begin gnulib module ignore-value
## end gnulib module pthread_sigmask
+## begin gnulib module putenv
+
+
+EXTRA_DIST += putenv.c
+
+EXTRA_libgnu_a_SOURCES += putenv.c
+
+## end gnulib module putenv
+
## begin gnulib module readlink
## end gnulib module readlink
+## begin gnulib module root-uid
+
+if gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c
+
+endif
+EXTRA_DIST += root-uid.h
+
+## end gnulib module root-uid
+
+## begin gnulib module sig2str
+
+
+EXTRA_DIST += sig2str.c sig2str.h
+
+EXTRA_libgnu_a_SOURCES += sig2str.c
+
+## end gnulib module sig2str
+
## begin gnulib module signal-h
BUILT_SOURCES += signal.h
## begin gnulib module unistd
BUILT_SOURCES += unistd.h
+libgnu_a_SOURCES += unistd.c
# We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one.
## end gnulib module unistd
+## begin gnulib module unsetenv
+
+
+EXTRA_DIST += unsetenv.c
+
+EXTRA_libgnu_a_SOURCES += unsetenv.c
+
+## end gnulib module unsetenv
+
## begin gnulib module utimens
libgnu_a_SOURCES += utimens.c
## end gnulib module verify
+## begin gnulib module xalloc-oversized
+
+if gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec
+
+endif
+EXTRA_DIST += xalloc-oversized.h
+
+## end gnulib module xalloc-oversized
+
mostlyclean-local: mostlyclean-generic
@for dir in '' $(MOSTLYCLEANDIRS); do \
--- /dev/null
+/* group-member.c -- determine whether group id is in calling user's group list
+
+ Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2013 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#include "xalloc-oversized.h"
+
+/* Most processes have no more than this many groups, and for these
+ processes we can avoid using malloc. */
+enum { GROUPBUF_SIZE = 100 };
+
+struct group_info
+ {
+ gid_t *group;
+ gid_t groupbuf[GROUPBUF_SIZE];
+ };
+
+static void
+free_group_info (struct group_info const *g)
+{
+ if (g->group != g->groupbuf)
+ free (g->group);
+}
+
+static int
+get_group_info (struct group_info *gi)
+{
+ int n_groups = getgroups (GROUPBUF_SIZE, gi->groupbuf);
+ gi->group = gi->groupbuf;
+
+ if (n_groups < 0)
+ {
+ int n_group_slots = getgroups (0, NULL);
+ if (0 <= n_group_slots
+ && ! xalloc_oversized (n_group_slots, sizeof *gi->group))
+ {
+ gi->group = malloc (n_group_slots * sizeof *gi->group);
+ if (gi->group)
+ n_groups = getgroups (n_group_slots, gi->group);
+ }
+ }
+
+ /* In case of error, the user loses. */
+ return n_groups;
+}
+
+/* Return non-zero if GID is one that we have in our groups list.
+ Note that the groups list is not guaranteed to contain the current
+ or effective group ID, so they should generally be checked
+ separately. */
+
+int
+group_member (gid_t gid)
+{
+ int i;
+ int found;
+ struct group_info gi;
+ int n_groups = get_group_info (&gi);
+
+ /* Search through the list looking for GID. */
+ found = 0;
+ for (i = 0; i < n_groups; i++)
+ {
+ if (gid == gi.group[i])
+ {
+ found = 1;
+ break;
+ }
+ }
+
+ free_group_info (&gi);
+
+ return found;
+}
+
+#ifdef TEST
+
+char *program_name;
+
+int
+main (int argc, char **argv)
+{
+ int i;
+
+ program_name = argv[0];
+
+ for (i = 1; i < argc; i++)
+ {
+ gid_t gid;
+
+ gid = atoi (argv[i]);
+ printf ("%d: %s\n", gid, group_member (gid) ? "yes" : "no");
+ }
+ exit (0);
+}
+
+#endif /* TEST */
/* Work around a bug of lstat on some systems
- Copyright (C) 1997-2006, 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-2006, 2008-2013 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
# include <sys/stat.h>
# undef __need_system_sys_stat_h
-static inline int
+static int
orig_lstat (const char *filename, struct stat *buf)
{
return lstat (filename, buf);
GNULIBOBJS = $(BLD)/c-ctype.$(O) \
$(BLD)/c-strcasecmp.$(O) \
$(BLD)/c-strncasecmp.$(O) \
+ $(BLD)/close-stream.$(O) \
$(BLD)/dtoastr.$(O) \
$(BLD)/dtotimespec.$(O) \
$(BLD)/execinfo.$(O) \
+ $(BLD)/fpending.$(O) \
$(BLD)/getopt.$(O) \
$(BLD)/getopt1.$(O) \
$(BLD)/gettime.$(O) \
$(BLD)/sha1.$(O) \
$(BLD)/sha256.$(O) \
$(BLD)/sha512.$(O) \
+ $(BLD)/sig2str.$(O) \
$(BLD)/stat-time.$(O) \
$(BLD)/timespec.$(O) \
$(BLD)/u64.$(O) \
$(NT_INC)/stdint.h
SHA512_H = $(GNU_LIB)/sha512.h \
$(U64_H)
+SIG2STR_H = $(GNU_LIB)/sig2str.h \
+ $(GNU_LIB)/intprops.h
STAT_TIME_H = $(GNU_LIB)/stat-time.h \
$(NT_INC)/sys/stat.h
$(CONFIG_H) \
$(C_CTYPE_H)
+$(BLD)/close-stream.$(O) : \
+ $(GNU_LIB)/close-stream.c \
+ $(GNU_LIB)/close-stream.h \
+ $(GNU_LIB)/fpending.h \
+ $(NT_INC)/stdbool.h \
+ $(CONFIG_H)
+
$(BLD)/dtoastr.$(O) : \
$(GNU_LIB)/dtoastr.c \
$(FTOASTR_C)
$(GNU_LIB)/execinfo.h \
$(CONFIG_H)
+$(BLD)/fpending.$(O) : \
+ $(GNU_LIB)/fpending.c \
+ $(GNU_LIB)/fpending.h \
+ $(CONFIG_H)
+
$(BLD)/getopt.$(O) : \
$(GNU_LIB)/getopt.c \
$(GNU_LIB)/getopt.h \
$(CONFIG_H) \
$(FILEMODE_H)
+$(BLD)/sig2str.$(O) : \
+ $(GNU_LIB)/sig2str.c \
+ $(CONFIG_H) \
+ $(SIG2STR_H)
+
+
# The following dependencies are for supporting parallel builds, where
# we must make sure $(BLD) exists before any compilation starts.
#
execinfo.h: execinfo.in.h
$(CP) execinfo.in.h $@
-
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
- Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2012 Free Software
+ Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2013 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
/* Copy the 4 byte value from v into the memory location pointed to by *cp,
If your architecture allows unaligned access this is equivalent to
* (uint32_t *) cp = v */
-static inline void
+static void
set_uint32 (char *cp, uint32_t v)
{
memcpy (cp, &v, sizeof v);
--- /dev/null
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2013 Free Software
+ Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C
+ Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ 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 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <stddef.h>
+
+/* Include errno.h *after* sys/types.h to work around header problems
+ on AIX 3.2.5. */
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(ev) ((errno) = (ev))
+#endif
+
+#include <string.h>
+#include <unistd.h>
+
+#if _LIBC
+# if HAVE_GNU_LD
+# define environ __environ
+# else
+extern char **environ;
+# endif
+#endif
+
+#if _LIBC
+/* This lock protects against simultaneous modifications of 'environ'. */
+# include <bits/libc-lock.h>
+__libc_lock_define_initialized (static, envlock)
+# define LOCK __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+static int
+_unsetenv (const char *name)
+{
+ size_t len;
+ char **ep;
+
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ len = strlen (name);
+
+ LOCK;
+
+ ep = environ;
+ while (*ep != NULL)
+ if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
+ {
+ /* Found it. Remove this pointer by moving later ones back. */
+ char **dp = ep;
+
+ do
+ dp[0] = dp[1];
+ while (*dp++);
+ /* Continue the loop in case NAME appears again. */
+ }
+ else
+ ++ep;
+
+ UNLOCK;
+
+ return 0;
+}
+
+
+/* Put STRING, which is of the form "NAME=VALUE", in the environment.
+ If STRING contains no '=', then remove STRING from the environment. */
+int
+putenv (char *string)
+{
+ const char *const name_end = strchr (string, '=');
+ register size_t size;
+ register char **ep;
+
+ if (name_end == NULL)
+ {
+ /* Remove the variable from the environment. */
+ return _unsetenv (string);
+ }
+
+ size = 0;
+ for (ep = environ; *ep != NULL; ++ep)
+ if (!strncmp (*ep, string, name_end - string) &&
+ (*ep)[name_end - string] == '=')
+ break;
+ else
+ ++size;
+
+ if (*ep == NULL)
+ {
+ static char **last_environ = NULL;
+ char **new_environ = (char **) malloc ((size + 2) * sizeof (char *));
+ if (new_environ == NULL)
+ return -1;
+ (void) memcpy ((void *) new_environ, (void *) environ,
+ size * sizeof (char *));
+ new_environ[size] = (char *) string;
+ new_environ[size + 1] = NULL;
+ free (last_environ);
+ last_environ = new_environ;
+ environ = new_environ;
+ }
+ else
+ *ep = string;
+
+ return 0;
+}
--- /dev/null
+/* The user ID that always has appropriate privileges in the POSIX sense.
+
+ Copyright 2012-2013 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/>.
+
+ Written by Paul Eggert. */
+
+#ifndef ROOT_UID_H_
+#define ROOT_UID_H_
+
+/* The user ID that always has appropriate privileges in the POSIX sense. */
+#ifdef __TANDEM
+# define ROOT_UID 65535
+#else
+# define ROOT_UID 0
+#endif
+
+#endif
/* sha1.c - Functions to compute SHA1 message digest of files or
memory blocks according to the NIST specification FIPS-180-1.
- Copyright (C) 2000-2001, 2003-2006, 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2001, 2003-2006, 2008-2013 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
/* Copy the 4 byte value from v into the memory location pointed to by *cp,
If your architecture allows unaligned access this is equivalent to
* (uint32_t *) cp = v */
-static inline void
+static void
set_uint32 (char *cp, uint32_t v)
{
memcpy (cp, &v, sizeof v);
/* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or
memory blocks according to the NIST specification FIPS-180-2.
- Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-2013 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
/* Copy the value from v into the memory location pointed to by *cp,
If your architecture allows unaligned access this is equivalent to
* (uint32_t *) cp = v */
-static inline void
+static void
set_uint32 (char *cp, uint32_t v)
{
memcpy (cp, &v, sizeof v);
/* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or
memory blocks according to the NIST specification FIPS-180-2.
- Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-2013 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
/* Copy the value from V into the memory location pointed to by *CP,
If your architecture allows unaligned access, this is equivalent to
* (__typeof__ (v) *) cp = v */
-static inline void
+static void
set_uint64 (char *cp, u64 v)
{
memcpy (cp, &v, sizeof v);
--- /dev/null
+/* sig2str.c -- convert between signal names and numbers
+
+ Copyright (C) 2002, 2004, 2006, 2009-2013 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/>. */
+
+/* Written by Paul Eggert. */
+
+#include <config.h>
+
+#include <limits.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sig2str.h"
+
+#ifndef SIGRTMIN
+# define SIGRTMIN 0
+# undef SIGRTMAX
+#endif
+#ifndef SIGRTMAX
+# define SIGRTMAX (SIGRTMIN - 1)
+#endif
+
+#define NUMNAME(name) { SIG##name, #name }
+
+/* Signal names and numbers. Put the preferred name first. */
+static struct numname { int num; char const name[8]; } numname_table[] =
+ {
+ /* Signals required by POSIX 1003.1-2001 base, listed in
+ traditional numeric order where possible. */
+#ifdef SIGHUP
+ NUMNAME (HUP),
+#endif
+#ifdef SIGINT
+ NUMNAME (INT),
+#endif
+#ifdef SIGQUIT
+ NUMNAME (QUIT),
+#endif
+#ifdef SIGILL
+ NUMNAME (ILL),
+#endif
+#ifdef SIGTRAP
+ NUMNAME (TRAP),
+#endif
+#ifdef SIGABRT
+ NUMNAME (ABRT),
+#endif
+#ifdef SIGFPE
+ NUMNAME (FPE),
+#endif
+#ifdef SIGKILL
+ NUMNAME (KILL),
+#endif
+#ifdef SIGSEGV
+ NUMNAME (SEGV),
+#endif
+ /* On Haiku, SIGSEGV == SIGBUS, but we prefer SIGSEGV to match
+ strsignal.c output, so SIGBUS must be listed second. */
+#ifdef SIGBUS
+ NUMNAME (BUS),
+#endif
+#ifdef SIGPIPE
+ NUMNAME (PIPE),
+#endif
+#ifdef SIGALRM
+ NUMNAME (ALRM),
+#endif
+#ifdef SIGTERM
+ NUMNAME (TERM),
+#endif
+#ifdef SIGUSR1
+ NUMNAME (USR1),
+#endif
+#ifdef SIGUSR2
+ NUMNAME (USR2),
+#endif
+#ifdef SIGCHLD
+ NUMNAME (CHLD),
+#endif
+#ifdef SIGURG
+ NUMNAME (URG),
+#endif
+#ifdef SIGSTOP
+ NUMNAME (STOP),
+#endif
+#ifdef SIGTSTP
+ NUMNAME (TSTP),
+#endif
+#ifdef SIGCONT
+ NUMNAME (CONT),
+#endif
+#ifdef SIGTTIN
+ NUMNAME (TTIN),
+#endif
+#ifdef SIGTTOU
+ NUMNAME (TTOU),
+#endif
+
+ /* Signals required by POSIX 1003.1-2001 with the XSI extension. */
+#ifdef SIGSYS
+ NUMNAME (SYS),
+#endif
+#ifdef SIGPOLL
+ NUMNAME (POLL),
+#endif
+#ifdef SIGVTALRM
+ NUMNAME (VTALRM),
+#endif
+#ifdef SIGPROF
+ NUMNAME (PROF),
+#endif
+#ifdef SIGXCPU
+ NUMNAME (XCPU),
+#endif
+#ifdef SIGXFSZ
+ NUMNAME (XFSZ),
+#endif
+
+ /* Unix Version 7. */
+#ifdef SIGIOT
+ NUMNAME (IOT), /* Older name for ABRT. */
+#endif
+#ifdef SIGEMT
+ NUMNAME (EMT),
+#endif
+
+ /* USG Unix. */
+#ifdef SIGPHONE
+ NUMNAME (PHONE),
+#endif
+#ifdef SIGWIND
+ NUMNAME (WIND),
+#endif
+
+ /* Unix System V. */
+#ifdef SIGCLD
+ NUMNAME (CLD),
+#endif
+#ifdef SIGPWR
+ NUMNAME (PWR),
+#endif
+
+ /* GNU/Linux 2.2 and Solaris 8. */
+#ifdef SIGCANCEL
+ NUMNAME (CANCEL),
+#endif
+#ifdef SIGLWP
+ NUMNAME (LWP),
+#endif
+#ifdef SIGWAITING
+ NUMNAME (WAITING),
+#endif
+#ifdef SIGFREEZE
+ NUMNAME (FREEZE),
+#endif
+#ifdef SIGTHAW
+ NUMNAME (THAW),
+#endif
+#ifdef SIGLOST
+ NUMNAME (LOST),
+#endif
+#ifdef SIGWINCH
+ NUMNAME (WINCH),
+#endif
+
+ /* GNU/Linux 2.2. */
+#ifdef SIGINFO
+ NUMNAME (INFO),
+#endif
+#ifdef SIGIO
+ NUMNAME (IO),
+#endif
+#ifdef SIGSTKFLT
+ NUMNAME (STKFLT),
+#endif
+
+ /* AIX 5L. */
+#ifdef SIGDANGER
+ NUMNAME (DANGER),
+#endif
+#ifdef SIGGRANT
+ NUMNAME (GRANT),
+#endif
+#ifdef SIGMIGRATE
+ NUMNAME (MIGRATE),
+#endif
+#ifdef SIGMSG
+ NUMNAME (MSG),
+#endif
+#ifdef SIGPRE
+ NUMNAME (PRE),
+#endif
+#ifdef SIGRETRACT
+ NUMNAME (RETRACT),
+#endif
+#ifdef SIGSAK
+ NUMNAME (SAK),
+#endif
+#ifdef SIGSOUND
+ NUMNAME (SOUND),
+#endif
+
+ /* Older AIX versions. */
+#ifdef SIGALRM1
+ NUMNAME (ALRM1), /* unknown; taken from Bash 2.05 */
+#endif
+#ifdef SIGKAP
+ NUMNAME (KAP), /* Older name for SIGGRANT. */
+#endif
+#ifdef SIGVIRT
+ NUMNAME (VIRT), /* unknown; taken from Bash 2.05 */
+#endif
+#ifdef SIGWINDOW
+ NUMNAME (WINDOW), /* Older name for SIGWINCH. */
+#endif
+
+ /* BeOS */
+#ifdef SIGKILLTHR
+ NUMNAME (KILLTHR),
+#endif
+
+ /* Older HP-UX versions. */
+#ifdef SIGDIL
+ NUMNAME (DIL),
+#endif
+
+ /* Korn shell and Bash, of uncertain vintage. */
+ { 0, "EXIT" }
+ };
+
+#define NUMNAME_ENTRIES (sizeof numname_table / sizeof numname_table[0])
+
+/* ISDIGIT differs from isdigit, as follows:
+ - Its arg may be any int or unsigned int; it need not be an unsigned char
+ or EOF.
+ - It's typically faster.
+ POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
+ isdigit unless it's important to use the locale's definition
+ of "digit" even when the host does not conform to POSIX. */
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+/* Convert the signal name SIGNAME to a signal number. Return the
+ signal number if successful, -1 otherwise. */
+
+static int
+str2signum (char const *signame)
+{
+ if (ISDIGIT (*signame))
+ {
+ char *endp;
+ long int n = strtol (signame, &endp, 10);
+ if (! *endp && n <= SIGNUM_BOUND)
+ return n;
+ }
+ else
+ {
+ unsigned int i;
+ for (i = 0; i < NUMNAME_ENTRIES; i++)
+ if (strcmp (numname_table[i].name, signame) == 0)
+ return numname_table[i].num;
+
+ {
+ char *endp;
+ int rtmin = SIGRTMIN;
+ int rtmax = SIGRTMAX;
+
+ if (0 < rtmin && strncmp (signame, "RTMIN", 5) == 0)
+ {
+ long int n = strtol (signame + 5, &endp, 10);
+ if (! *endp && 0 <= n && n <= rtmax - rtmin)
+ return rtmin + n;
+ }
+ else if (0 < rtmax && strncmp (signame, "RTMAX", 5) == 0)
+ {
+ long int n = strtol (signame + 5, &endp, 10);
+ if (! *endp && rtmin - rtmax <= n && n <= 0)
+ return rtmax + n;
+ }
+ }
+ }
+
+ return -1;
+}
+
+/* Convert the signal name SIGNAME to the signal number *SIGNUM.
+ Return 0 if successful, -1 otherwise. */
+
+int
+str2sig (char const *signame, int *signum)
+{
+ *signum = str2signum (signame);
+ return *signum < 0 ? -1 : 0;
+}
+
+/* Convert SIGNUM to a signal name in SIGNAME. SIGNAME must point to
+ a buffer of at least SIG2STR_MAX bytes. Return 0 if successful, -1
+ otherwise. */
+
+int
+sig2str (int signum, char *signame)
+{
+ unsigned int i;
+ for (i = 0; i < NUMNAME_ENTRIES; i++)
+ if (numname_table[i].num == signum)
+ {
+ strcpy (signame, numname_table[i].name);
+ return 0;
+ }
+
+ {
+ int rtmin = SIGRTMIN;
+ int rtmax = SIGRTMAX;
+
+ if (! (rtmin <= signum && signum <= rtmax))
+ return -1;
+
+ if (signum <= rtmin + (rtmax - rtmin) / 2)
+ {
+ int delta = signum - rtmin;
+ sprintf (signame, delta ? "RTMIN+%d" : "RTMIN", delta);
+ }
+ else
+ {
+ int delta = rtmax - signum;
+ sprintf (signame, delta ? "RTMAX-%d" : "RTMAX", delta);
+ }
+
+ return 0;
+ }
+}
--- /dev/null
+/* sig2str.h -- convert between signal names and numbers
+
+ Copyright (C) 2002, 2005, 2009-2013 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/>. */
+
+/* Written by Paul Eggert. */
+
+#include <signal.h>
+
+/* Don't override system declarations of SIG2STR_MAX, sig2str, str2sig. */
+#ifndef SIG2STR_MAX
+
+# include "intprops.h"
+
+/* Size of a buffer needed to hold a signal name like "HUP". */
+# define SIG2STR_MAX (sizeof "SIGRTMAX" + INT_STRLEN_BOUND (int) - 1)
+
+int sig2str (int, char *);
+int str2sig (char const *, int *);
+
+#endif
+
+/* An upper bound on signal numbers allowed by the system. */
+
+#if defined _sys_nsig
+# define SIGNUM_BOUND (_sys_nsig - 1)
+#elif defined NSIG
+# define SIGNUM_BOUND (NSIG - 1)
+#else
+# define SIGNUM_BOUND 64
+#endif
/* Work around platform bugs in stat.
- Copyright (C) 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2013 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
# endif
#endif
-static inline int
+static int
orig_stat (const char *filename, struct stat *buf)
{
return stat (filename, buf);
/* A GNU-like <stdio.h>.
- Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007-2013 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
_GL_CXXALIAS_SYS (fwrite, size_t,
(const void *ptr, size_t s, size_t n, FILE *stream));
-/* Work around glibc bug 11959
+/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
<http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
which sometimes causes an unwanted diagnostic for fwrite calls.
- This affects only function declaration attributes, so it's not
- needed for C++. */
-# if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
-static inline size_t _GL_ARG_NONNULL ((1, 4))
-rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
-{
- size_t r = fwrite (ptr, s, n, stream);
- (void) r;
- return r;
-}
+ This affects only function declaration attributes under certain
+ versions of gcc, and is not needed for C++. */
+# if (0 < __USE_FORTIFY_LEVEL \
+ && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
+ && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
+ && !defined __cplusplus)
# undef fwrite
-# define fwrite rpl_fwrite
+# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; })
# endif
# endif
_GL_CXXALIASWARN (fwrite);
"POSIX compliance");
#endif
-
#endif /* _@GUARD_PREFIX@_STDIO_H */
#endif /* _@GUARD_PREFIX@_STDIO_H */
#endif
#else
# include <config.h>
# if FPRINTFTIME
-# include "ignore-value.h"
# include "fprintftime.h"
# else
# include "strftime.h"
fwrite_uppcase (p, (s), _n); \
else \
{ \
- /* We are ignoring the value of fwrite here, in spite of the \
- fact that technically, that may not be valid: the fwrite \
- specification in POSIX 2008 defers to that of fputc, which \
- is intended to be consistent with the one from ISO C, \
- which permits failure due to ENOMEM *without* setting the \
- stream's error indicator. */ \
- ignore_value (fwrite ((s), _n, 1, p)); \
+ /* Ignore the value of fwrite. The caller can determine whether \
+ an error occurred by inspecting ferror (P). All known fwrite \
+ implementations set the stream's error indicator when they \
+ fail due to ENOMEM etc., even though C11 and POSIX.1-2008 do \
+ not require this. */ \
+ fwrite (s, _n, 1, p); \
} \
} \
while (0) \
/* Provide a more complete sys/stat header file.
- Copyright (C) 2005-2012 Free Software Foundation, Inc.
+ Copyright (C) 2005-2013 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
# endif
#endif
+#ifndef S_ISMPX /* AIX */
+# define S_ISMPX(m) 0
+#endif
+
#ifndef S_ISNAM /* Xenix */
# ifdef S_IFNAM
# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# if !GNULIB_defined_rpl_mkdir
-static inline int
+static int
rpl_mkdir (char const *name, mode_t mode)
{
return _mkdir (name);
--- /dev/null
+#include <config.h>
+#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
+#include "unistd.h"
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2003-2012 Free Software Foundation, Inc.
+ Copyright (C) 2003-2013 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
# include <getopt.h>
#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_UNISTD_INLINE
+# define _GL_UNISTD_INLINE _GL_INLINE
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
# endif
#elif defined GNULIB_POSIXCHECK
# if HAVE_RAW_DECL_ENVIRON
-static inline char ***
+_GL_UNISTD_INLINE char ***
rpl_environ (void)
{
return &environ;
# define getpagesize() _gl_getpagesize ()
# else
# if !GNULIB_defined_getpagesize_function
-static inline int
+_GL_UNISTD_INLINE int
getpagesize ()
{
return _gl_getpagesize ();
_GL_CXXALIASWARN (write);
#endif
+_GL_INLINE_HEADER_END
#endif /* _@GUARD_PREFIX@_UNISTD_H */
#endif /* _@GUARD_PREFIX@_UNISTD_H */
--- /dev/null
+/* Copyright (C) 1992, 1995-2002, 2005-2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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/>. */
+
+#include <config.h>
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the name == NULL test below. */
+#define _GL_ARG_NONNULL(params)
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+#if !_LIBC
+# define __set_errno(ev) ((errno) = (ev))
+#endif
+
+#include <string.h>
+#include <unistd.h>
+
+#if !_LIBC
+# define __environ environ
+#endif
+
+#if _LIBC
+/* This lock protects against simultaneous modifications of 'environ'. */
+# include <bits/libc-lock.h>
+__libc_lock_define_initialized (static, envlock)
+# define LOCK __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+/* In the GNU C library we must keep the namespace clean. */
+#ifdef _LIBC
+# define unsetenv __unsetenv
+#endif
+
+#if _LIBC || !HAVE_UNSETENV
+
+int
+unsetenv (const char *name)
+{
+ size_t len;
+ char **ep;
+
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ len = strlen (name);
+
+ LOCK;
+
+ ep = __environ;
+ while (*ep != NULL)
+ if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
+ {
+ /* Found it. Remove this pointer by moving later ones back. */
+ char **dp = ep;
+
+ do
+ dp[0] = dp[1];
+ while (*dp++);
+ /* Continue the loop in case NAME appears again. */
+ }
+ else
+ ++ep;
+
+ UNLOCK;
+
+ return 0;
+}
+
+#ifdef _LIBC
+# undef unsetenv
+weak_alias (__unsetenv, unsetenv)
+#endif
+
+#else /* HAVE_UNSETENV */
+
+# undef unsetenv
+# if !HAVE_DECL_UNSETENV
+# if VOID_UNSETENV
+extern void unsetenv (const char *);
+# else
+extern int unsetenv (const char *);
+# endif
+# endif
+
+/* Call the underlying unsetenv, in case there is hidden bookkeeping
+ that needs updating beyond just modifying environ. */
+int
+rpl_unsetenv (const char *name)
+{
+ int result = 0;
+ if (!name || !*name || strchr (name, '='))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ while (getenv (name))
+# if !VOID_UNSETENV
+ result =
+# endif
+ unsetenv (name);
+ return result;
+}
+
+#endif /* HAVE_UNSETENV */
--- /dev/null
+/* xalloc-oversized.h -- memory allocation size checking
+
+ Copyright (C) 1990-2000, 2003-2004, 2006-2013 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/>. */
+
+#ifndef XALLOC_OVERSIZED_H_
+# define XALLOC_OVERSIZED_H_
+
+# include <stddef.h>
+
+/* Return 1 if an array of N objects, each of size S, cannot exist due
+ to size arithmetic overflow. S must be positive and N must be
+ nonnegative. This is a macro, not a function, so that it
+ works correctly even when SIZE_MAX < N.
+
+ By gnulib convention, SIZE_MAX represents overflow in size
+ calculations, so the conservative dividend to use here is
+ SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
+ However, malloc (SIZE_MAX) fails on all known hosts where
+ sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for
+ exactly-SIZE_MAX allocations on such hosts; this avoids a test and
+ branch when S is known to be 1. */
+# define xalloc_oversized(n, s) \
+ ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
+
+#endif /* !XALLOC_OVERSIZED_H_ */
2013-01-09 Glenn Morris <rgm@gnu.org>
- * emacs-lisp/trace.el (trace-function, trace-function-background):
- Doc fix.
+ * emacs-lisp/trace.el (trace-function-foreground)
+ (trace-function-background): Doc fix.
2013-01-09 Juri Linkov <juri@jurta.org>
`completion-ignore-case' in `completion-pcm--all-completions'.
(Bug#12615).
-2013-01-07 Glenn Morris <rgm@gnu.org>
+2013-01-09 Glenn Morris <rgm@gnu.org>
* progmodes/compile.el (compilation-parse-errors):
Fix typo. (Bug#13369)
-2013-01-07 Vitalie Spinu <spinuvit@gmail.com> (tiny change)
+2013-01-09 Vitalie Spinu <spinuvit@gmail.com> (tiny change)
* comint.el (comint-send-input): Check size of buffer before
waiting for process output, in case already accepted. (Bug#13290)
+2013-01-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ Spelling fixes.
+ * net/tramp-adb.el (tramp-adb-get-toolbox):
+ Fix misspelling of 'unknown'.
+
+2013-01-08 Juri Linkov <juri@jurta.org>
+
+ * textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
+ * progmodes/flymake.el (flymake-errline, flymake-warnline):
+ Use underline style wave on terminals that support it. (Bug#13000)
+
+2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/pcase.el (pcase--split-equal): Also take advantage if
+ the predicate returns nil.
+
+ * simple.el: Use lexical-binding.
+ (primitive-undo): Use pcase.
+ (minibuffer-history-isearch-push-state): Use a closure.
+
+2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
+
+ * simple.el (primitive-undo): Move from undo.c.
+
+2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc/pcvs.el (cvs-cleanup-collection): Extend meaning of `rm-handled'.
+ (cvs-mode-remove-handled): Use it (bug#13380).
+
+ * emacs-lisp/nadvice.el (advice--tweak): New function.
+ (advice--remove-function, advice--subst-main): Use it.
+
+ * emacs-lisp/advice.el: Update commentary.
+
+2013-01-08 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-adb.el (tramp-adb-file-name-handler-alist):
+ Remove spurious entry.
+
+2013-01-08 Glenn Morris <rgm@gnu.org>
+
+ * net/tramp.el (tramp-default-host-alist): Add :version.
+
+2013-01-08 Juri Linkov <juri@jurta.org>
+
+ * info.el (Info-read-node-name-2): Don't duplicate suffixes for
+ single completion. (Bug#12456)
+ (info--manual-names): Expand node completions into an explicit list
+ before appending it to another list. Filter out internal buffers
+ with the leading space in the buffer name. (Bug#10771)
+
+2013-01-08 Juri Linkov <juri@jurta.org>
+
+ * info.el (Info-read-node-name-1): Allow empty node name in (FILENAME)
+ that defaults to the Top node.
+ (Info-goto-node, Info-read-node-name): Doc fix to mention that
+ the short format (FILENAME) goes to the Top node.
+ (Info-build-node-completions): Rename arg `file' to `filename'.
+ (Bug#13365)
+
+2013-01-07 Bastien Guerry <bzg@gnu.org>
+
+ * menu-bar.el (menu-bar-search-documentation-menu):
+ Use `apropos-user-option' and fix the help message.
+
+2013-01-07 Bastien Guerry <bzg@gnu.org>
+
+ * apropos.el (apropos-do-all): Update docstring.
+ (apropos-user-option-button): New face.
+ (apropos-user-option): Rename from `apropos-variable' and update
+ docstring.
+ (apropos-variable): Rewrite, now show all variables by default.
+ (apropos-print): Mention "User option" instead of "Variable" when
+ printing doc for user options. (Bug#13276)
+
+2013-01-07 Jürgen Hötzel <juergen@archlinux.org>
+
+ * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls):
+ Handle filename correctly, when parsing "source -> target" symlink
+ output.
+ (tramp-adb-handle-set-file-times): New defun.
+
+2013-01-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the
+ advice list when the interactive-spec of ad-Advice-* changes.
+
+2013-01-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * wid-edit.el (widget-default-get): Work for inlined elements.
+ (Bug#12670)
+
+2013-01-07 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-default-host-alist): New defcustom.
+ (tramp-find-host): Use it.
+ (tramp-eshell-directory-change): Move from tramp-sh.el. Add to
+ `eshell-directory-change-hook'.
+
+ * net/tramp-adb.el (top): Add adb specific entry in
+ `tramp-default-host-alist'.
+ (tramp-adb-file-name-host): Remove function.
+ (tramp-adb-execute-adb-command, tramp-adb-maybe-open-connection):
+ Use `tramp-file-name-host' instead of `tramp-adb-file-name-host'.
+
+ * net/tramp-sh.el: Move eshell integration code to tramp.el.
+
+2013-01-06 Jürgen Hötzel <juergen@archlinux.org>
+
+ * net/tramp-adb.el (tramp-methods): Add `tramp-tmpdir' entry.
+
+2013-01-06 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-adb.el (tramp-adb-ls-toolbox-regexp): The file size can
+ consist of more than one digit.
+ (tramp-adb-file-name-handler-alist):
+ Use `tramp-handle-file-exists-p' consistently.
+ (tramp-adb-file-name-handler): Don't tweak `tramp-default-host'.
+ (tramp-adb-handle-file-exists-p): Remove function.
+ (tramp-adb-file-name-host): New defun.
+ (tramp-adb-execute-adb-command, tramp-adb-maybe-open-connection):
+ Use it.
+ (tramp-adb-maybe-open-connection): Set "remote-path" property.
+
+2013-01-06 Chong Yidong <cyd@gnu.org>
+
+ * vc/vc.el (vc-next-action): Detect buffer modifications
+ conflicting with locking VCS operation (Bug#11490).
+
+ * vc/vc-hooks.el (vc-after-save): DTRT for locking VCSes.
+
+2013-01-05 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls):
+ (tramp-adb-handle-directory-files-and-attributes): Fix typos.
+
+2013-01-05 Jürgen Hötzel <juergen@archlinux.org>
+
+ * net/tramp-adb.el (tramp-adb-handle-file-attributes): More robust
+ parsing of ls output using regular expression (handle filenames
+ with spaces). Use virtual device number.
+ (tramp-do-parse-file-attributes-with-ls): New defun (Code
+ cleanup).
+
+2013-01-04 Daiki Ueno <ueno@gnu.org>
+
+ * epg.el: Silence byte-compiler warnings.
+ (epg--start): Use delete-char instead of delete-backward-char.
+ (epg-wait-for-completion): Pass FRAME arg to redraw-frame.
+
+2013-01-04 Daiki Ueno <ueno@gnu.org>
+
+ * epg.el (epg--start): Don't call "tty" program on W32 platforms.
+ Suggested by Eli Zaretskii <eliz@gnu.org>.
+
2013-01-04 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-set-file-uid-gid): UID and GID must be
non-negative integers. Otherwise, the default values are used.
(tramp-convert-file-attributes): Convert uid and gid to integers.
-2013-01-03 Glenn Morris <rgm@gnu.org>
+2013-01-04 Glenn Morris <rgm@gnu.org>
* term.el (term-handle-colors-array): Ensure face attributes
are fully specified, not nil. (Bug#13337)
(tag-find-file-of-tag-noselect): Check auto-compression-mode
rather than 'jka-compr being loaded. (Bug#13338)
+2013-01-04 Wesley Dawson <whd@lavabit.com> (tiny change)
+
+ * icomplete.el (icomplete-completions):
+ Honor icomplete-prospects-height once more following
+ 2012-11-29 changes. (Bug#13224)
+
+2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * subr.el (internal--called-interactively-p--get-frame): Find aliases
+ of called-interactively-p as well (bug#13237).
+
+ * view.el (view--enable, view--disable): Rename from view-mode-enable
+ and view-mode-disable and assume it's called from view-mode.
+ (view-mode-enable, view-mode-disable): Redefine as obsolete
+ compatibility layer above view-mode.
+ (view-mode-enter): Call `view-mode'.
+
+ * files.el (after-find-file): Call `view-mode'.
+
+ * doc-view.el (doc-view-scale-internally): New var.
+ (doc-view-enlarge, doc-view-insert-image): Obey it.
+
+2013-01-03 Daiki Ueno <ueno@gnu.org>
+
+ * epg.el (epg--start): Ignore errors when /dev/fd/0 does not
+ exist. (Bug#13344)
+
+2013-01-03 Glenn Morris <rgm@gnu.org>
+
+ * mail/rmail.el (rmail-set-header-1): Ignore case.
+ Handle multi-line headers. (Bug#13330)
+
+ * progmodes/make-mode.el (makefile-fill-paragraph): Add doc.
+ Handle paragraph starting at beginning of buffer.
+
* subr.el (eval-after-load): Don't purecopy the form, so that it
can be nconc'd later on; reverts 2009-11-11 change. (Bug#13331)
- * emacs-lisp/byte-run.el (defun): Place cl declarations
- after any interactive spec. (Bug#13265)
+ * emacs-lisp/byte-run.el (defun): Place cl declarations
+ after any interactive spec. (Bug#13265)
+
+2013-01-02 Andreas Schwab <schwab@linux-m68k.org>
+
+ * emacs-lisp/byte-run.el (defmacro): Use same argument parsing as
+ defun. Don't check for DECL if DOCSTRING isn't a string.
+ (defun): Likewise.
+
+2013-01-02 Glenn Morris <rgm@gnu.org>
+
+ * eshell/em-cmpl.el (eshell-pcomplete):
+ More thoroughly imitate pcomplete. (Bug#13293)
+
+ * files.el (parse-colon-path): Doc fix. (Bug#12351)
+ Return nil for empty path elements. (Bug#13296)
+
+2013-01-02 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el (python-nav-end-of-statement): Rewrite in
+ order to improve efficiency (Based on Daniel Colascione's
+ <dancol@dancol.org> patch). (Bug#13182)
+
+2013-01-02 Glenn Morris <rgm@gnu.org>
+
+ * vc/log-edit.el (log-edit-header-contents-regexp): Add doc string.
+
+2013-01-02 Andreas Schwab <schwab@linux-m68k.org>
+
+ * emacs-lisp/byte-run.el (defmacro): Don't lose final nil if
+ neither DOCSTRING nor DECL was given. (Bug#13316)
+
+2013-01-02 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-sh-handle-set-file-acl): Add argument to
+ `error' call.
+ (tramp-do-copy-or-rename-file): Ignore errors when calling
+ `set-file-extended-attributes'.
+
+ * net/tramp-smb.el (tramp-smb-file-name-handler-alist):
+ Add handler for `file-acl'.
+ (tramp-smb-handle-file-acl): New defun.
+
+2013-01-02 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/README: Mention ISO 8601 week-numbering dates.
+
+2013-01-01 Martin Rudalics <rudalics@gmx.at>
+
+ * view.el (view-mode-enable): New argument run-view-mode-hook.
+ Run view-mode-hook only when it's non-nil (Bug#13315).
+ (view-mode-enter): Call view-mode-enable with run-view-mode-hook
+ argument t.
+
+2012-12-31 Jürgen Hötzel <juergen@archlinux.org>
+
+ * net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors
+ (No device connected, invalid device name). (Bug #13299)
+
+2012-12-31 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (window-resizable--p): Rename to window-resizable-p.
+ (window-resize-no-error): New function.
+
+ * mail/rmail.el (rmail-maybe-display-summary): Restore behavior
+ broken in fix from 2012-12-28.
+
+2012-12-31 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * subr.el (special-form-p): Don't signal errors on undef aliases.
+
+2012-12-31 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-forms.el (math-parse-date): Try using
+ `math-parse-iso-date' when it looks like it might be needed.
+ Allow times of 24:00.
+ (math-parse-date-validate, math-parse-iso-date-validate): Allow times
+ of 24:00.
+
+2012-12-30 Glenn Morris <rgm@gnu.org>
+
+ * net/mairix.el (rmail, rmail-summary-displayed, rmail-summary):
+ Remove unnecessary/buggy autoloads (missing interactive). (Bug#13294)
+ (rmail-summary-displayed, rmail-summary): Declare.
+ (mairix-rmail-display): Just require rmail.
+
+2012-12-30 Chong Yidong <cyd@gnu.org>
+
+ * emacs-lisp/package.el (package-untar-buffer): Improve integrity
+ check for the tarball contents.
+
+2012-12-30 Matt Fidler <matt.fidler@alcon.com> (tiny change)
+
+ * emacs-lisp/package.el (package-untar-buffer): Handle problematic
+ tarfile content listings (Bug#13136).
+
+2012-12-30 Mark Lillibridge <mark.lillibridge@hp.com>
+
+ * mail/rmailmm.el (rmail-insert-mime-forwarded-message):
+ Insert the undecoded text of the message being forwarded. (Bug#9521)
+
+2012-12-30 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-set-file-uid-gid): Convert UID and GID to
+ integers, if they are real numbers. (Bug#13282)
+
+ * net/tramp-sh.el (tramp-sh-handle-set-file-selinux-context):
+ Return `t' on success.
+
+ * net/tramp-smb.el (tramp-smb-file-name-handler-alist):
+ Add handler for `set-file-selinux-context'.
+
+2012-12-29 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-sh-handle-file-acl): Suppress basic attributes.
+ (tramp-sh-handle-set-file-acl): Return `t' on success.
+
+2012-12-29 Eli Zaretskii <eliz@gnu.org>
+
+ * files.el (backup-buffer-copy, basic-save-buffer-2):
+ If set-file-extended-attributes fails, fall back on set-file-modes
+ instead of signaling an error. (Bug#13298)
+ (basic-save-buffer): Likewise.
+
+2012-12-29 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el: Support other commands triggering
+ python-indent-line so indentation cycling continues to work.
+ (python-indent-trigger-commands): New defcustom.
+ (python-indent-line): Use it.
+
+2012-12-29 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el (python-shell-send-region): Add blank lines
+ for non sent code so backtraces remain correct.
+
+2012-12-29 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el: Remove cl dependency.
+ (python-syntax-count-quotes): Replace incf call.
+ (python-fill-string): Replace setf call.
+
+2012-12-29 Damien Cassou <damien.cassou@gmail.com>
+
+ * info.el (info-other-window): New arg, for consistency with info.
+
+2012-12-28 Martin Rudalics <rudalics@gmx.at>
+
+ * mail/rmail.el (rmail-maybe-display-summary):
+ Rewrite (Bug#13066).
+
+2012-12-28 Andreas Schwab <schwab@linux-m68k.org>
+
+ * epg.el (epg--start): Modify process-environment locally.
+
+2012-12-28 Daiki Ueno <ueno@gnu.org>
+
+ * epg.el: Support pinentry-curses.
+ Suggested by Werner Koch in
+ <http://lists.gnu.org/archive/html/emacs-devel/2007-02/msg00755.html>.
+ (epg-agent-file, epg-agent-mtime): New variable.
+ (epg--start): Record the modified time of gpg-agent socket file,
+ to restore Emacs frame after pinentry-curses termination.
+ (epg-wait-for-completion): Restore Emacs frame here.
+
+2012-12-27 Juri Linkov <juri@jurta.org>
+
+ * info.el (Info-file-completions): New variable.
+ (Info-read-node-name-1): Complete node names in the Info file
+ when a file name is given. Call `Info-build-node-completions'
+ with a file name.
+ (Info-build-node-completions): Add new arg `file'. When it is
+ non-nil, visit it in a temporary buffer and cache its completions in
+ `Info-current-file-completions'. Move most of the function body to
+ `Info-build-node-completions-1'.
+ (Info-build-node-completions-1): New function with the body from
+ `Info-build-node-completions'. (Bug#12456)
+
+2012-12-27 Juri Linkov <juri@jurta.org>
+
+ * frame.el (frame-maximization-style): Remove user option.
+ (cycle-frame-maximized): Remove function.
+ (toggle-frame-maximized): Rewrite and bind to M-<f10>.
+ (toggle-frame-fullscreen): New command bound to <f11> instead of
+ `toggle-frame-maximized'.
+ http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00703.html
+
+2012-12-27 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-handle-file-accessible-directory-p): New defun.
+
+ * net/tramp-adb.el (tramp-adb-file-name-handler-alist):
+ * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
+ * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Add handler
+ for `file-accessible-directory-p'. (Bug#13275)
+
+2012-12-27 Sam Steingold <sds@gnu.org>
+
+ * progmodes/cperl-mode.el (cperl-calculate-indent): Do not stagger
+ continuations, see <http://stackoverflow.com/questions/3582436>.
+
+2012-12-27 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-indent-beg-re): Only allow "class",
+ "module" and "def" to have indentation before them.
+ Regression from 2012-09-07T04:15:56Z!dgutov@yandex.ru (see the new test).
+
+ * progmodes/ruby-mode.el: Bump the version to 1.2 (Bug#13200).
+
+2012-12-27 Alan Mackenzie <acm@muc.de>
+
+ Speed up fontification where there's large brace blocks.
+ * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Add a limit
+ to a call of c-beginning-of-decl-1.
+
+2012-12-27 Vitalie Spinu <spinuvit@gmail.com> (tiny change)
+
+ * comint.el (comint-adjust-window-point): New function.
+ (comint-postoutput-scroll-to-bottom):
+ Call comint-adjust-window-point (Bug#13248).
+
+2012-12-26 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (auto-mode-alist): `purecopy' the
+ Rakefile regexp.
+ (auto-mode-alist): Associate .gemspec files with ruby-mode
+ (https://bugs.ruby-lang.org/issues/5453).
+
+2012-12-26 Jürgen Hötzel <juergen@archlinux.org>
+
+ * net/tramp-adb.el (tramp-adb-get-ls-command): New defun.
+ Suppress coloring, if possible (required for BusyBox based systems like
+ CyanogenMod).
+ (tramp-adb-handle-file-attributes)
+ (tramp-adb-handle-insert-directory)
+ (tramp-adb-handle-file-name-all-completions): Use it.
+ (tramp-adb-get-toolbox): New defun. Check for remote shell
+ implementation (BusyBox or Toolbox).
+
+2012-12-24 Constantin Kulikov <zxnotdead@gmail.com> (tiny change)
+
+ * startup.el (initial-buffer-choice): Allow function as value
+ (Bug#13251).
+ (command-line-1): Handle case where initial-buffer-choice
+ specifies a function.
+ * server.el (server-execute): Handle case where
+ initial-buffer-choice specifies a function.
+
+2012-12-24 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * mail/smtpmail.el (smtpmail-try-auth-method): Refactored out into
+ its own function.
+ (smtpmail-try-auth-methods): Forget the user name/password if the
+ login is unsuccessful (bug#12424).
+
+2012-12-22 Michael Albinus <michael.albinus@gmx.de>
+
+ * notifications.el (notifications-notify): Protect body with
+ `with-demoted-errors'.
+
+ * net/tramp-adb.el (tramp-adb-maybe-open-connection):
+ Check properties of remote device. Restart connection, if there is a
+ change.
+
+2012-12-21 Chong Yidong <cyd@gnu.org>
+
+ * sort.el (sort-subr): Doc fix (Bug#13056).
+
+2012-12-21 Bastien Guerry <bzg@gnu.org>
+
+ * progmodes/etags.el (tags-search): Fix typo. Bug #13232.
+
+2012-12-21 Michael Albinus <michael.albinus@gmx.de>
+
+ * simple.el (process-file): Overwrite stderr file, if exists.
+
+2012-12-21 Daiki Ueno <ueno@gnu.org>
+
+ * epg.el (epg--start): Print GPG_AGENT_INFO in the debug buffer.
+ (epg-error): Set `error-message' property.
+
+2012-12-21 Chong Yidong <cyd@gnu.org>
+
+ * international/mule-cmds.el (read-char-by-name): Signal an error
+ if the user does not supply a valid character (Bug#13177).
+
+ * simple.el (transpose-subr-1): Preserve marker positions by
+ changing the insertion sequence (Bug#13122).
+
+2012-12-21 Kelly Dean <kellydeanch@yahoo.com> (tiny change)
+
+ * simple.el (kill-region): Deactivate mark even for empty regions
+ (Bug#13169).
+
+2012-12-21 Chong Yidong <cyd@gnu.org>
+
+ * help-fns.el (describe-variable): Make sure we get the right
+ buffer name (Bug#13105). Suggested by Kelly Dean.
+
+2012-12-20 Michael R. Mauger <mmaug@yahoo.com>
+
+ * comint.el (comint-redirect-previous-input-string): New variable.
+ (comint-redirect-setup, comint-redirect-cleanup)
+ (comint-redirect-preoutput-filter): Use it. Fixes redirection bug.
+ (comint-redirect-preoutput-filter): Fix verbose message.
+
+2012-12-20 Michael Albinus <michael.albinus@gmx.de>
+
+ * progmodes/grep.el (rgrep): Escape command line. Sometimes, it
+ is too long for Tramp. See discussion in
+ <http://thread.gmane.org/gmane.emacs.tramp/8233/focus=8244>.
+
+ * progmodes/compile.el (compilation-start): Remove line escape
+ template.
+
+2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * vc/ediff-ptch.el (ediff-map-patch-buffer): Use `point-min-marker'.
+ Adjust comment.
+
+2012-12-19 Jonas Bernoulli <jonas@bernoul.li>
+
+ * emacs-lisp/lisp-mnt.el (lm-section-end): Always end before the
+ following non-comment text (bug#13207).
+ (lm-header-multiline): Continuation lines need to be indented more than
+ the first line.
+ (lm-homepage): New function.
+ (lm-with-file): Don't be confused if narrowing is in effect.
+
+2012-12-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc/diff-mode.el (diff-post-command-hook): Don't ignore changes at the
+ very beginning of a hunk (e.g. killing the first line).
+
+2012-12-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-sh-handle-file-acl): Delete empty lines
+ and text properties from returned ACL string.
+ (tramp-sh-handle-set-file-acl): Do not use additional parentheses
+ for "setfacl" command.
+
+2012-12-18 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-error-with-buffer): Give a hint to use
+ `tramp-cleanup-this-connection', when the process has died.
+ (Bug#13151)
+
+2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * icomplete.el (icomplete-completions): Also use … to truncate prefix.
+
+2012-12-17 Kevin Ryde <user42@zip.com.au>
+
+ * files.el (auto-save-file-name-p): Use \` and \' (bug#13186).
+
+2012-12-17 Michael Albinus <michael.albinus@gmx.de>
+
+ Add support for preserving ACL entries of files.
+
+ * net/tramp.el (tramp-file-name-for-operation): Add `file-acl' and
+ `set-file-acl' handlers.
+
+ * net/tramp-adb.el (tramp-adb-handle-copy-file):
+ Handle PRESERVE-EXTENDED-ATTRIBUTES.
+
+ * net/tramp-compat.el (tramp-compat-copy-file):
+ Handle PRESERVE-EXTENDED-ATTRIBUTES.
+
+ * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
+ Add `file-acl' and `set-file-acl' handlers.
+ (tramp-gvfs-handle-copy-file):
+ Handle PRESERVE-EXTENDED-ATTRIBUTES.
+ (tramp-gvfs-handle-file-acl, tramp-gvfs-handle-set-file-acl):
+ New defuns.
+
+ * net/tramp-sh.el (tramp-sh-file-name-handler-alist):
+ Add `file-acl' and `set-file-acl' handlers.
+ (tramp-remote-acl-p, tramp-sh-handle-file-acl)
+ (tramp-sh-handle-set-file-acl): New defuns.
+ (tramp-sh-handle-copy-file, tramp-do-copy-or-rename-file):
+ Handle PRESERVE-EXTENDED-ATTRIBUTES.
+
+ * net/tramp-smb.el (tramp-smb-file-name-handler-alist):
+ Add `file-acl' and `set-file-acl' handlers.
+ (tramp-smb-handle-copy-file): Handle PRESERVE-EXTENDED-ATTRIBUTES.
+
+2012-12-17 Kelly Dean <kellydeanch@yahoo.com> (tiny change)
+
+ * help-macro.el (make-help-screen): Instead of switch-to-buffer
+ use pop-to-buffer with NORECORD argument t. As buffer name, use
+ *Metahelp* with a leading space (Bug#13190).
+
+2012-12-16 Romain Francoise <romain@orebokech.com>
+
+ * files.el (file-extended-attributes)
+ (set-file-extended-attributes): New functions.
+ (backup-buffer): Use them to handle both SELinux context and ACL
+ entries.
+ (backup-buffer-copy): Work with an alist of extended attributes,
+ rather than an SELinux context.
+ (basic-save-buffer-2): Ditto.
+
+2012-12-16 Timo Myyrä <timo.myyra@gmail.com>
+
+ * battery.el (battery-bsd-apm): New function.
+
+2012-12-16 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc.el (calc-standard-date-formats): Adjust one of the
+ standard date formats.
+
+2012-12-15 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-mode-map): Bind `C-x 8 RET' to
+ `isearch-insert-char-by-name'.
+ (with-isearch-suspended): New defmacro with body mostly from
+ `isearch-edit-string' except the part that sets
+ `isearch-new-string' and `isearch-new-message'.
+ (isearch-edit-string): Use new macro `with-isearch-suspended' with
+ body that sets `isearch-new-string' and `isearch-new-message'.
+ (isearch-insert-char-by-name): New command.
+ * international/mule-cmds.el (read-char-by-name): Let-bind
+ `enable-recursive-minibuffers' to t.
+ http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00234.html
+
+2012-12-15 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-delete-char, isearch-del-char): Doc fix.
+ (Bug#13175)
+
+2012-12-15 Christopher Schmidt <christopher@ch.ristopher.com>
+
+ * dired-x.el (dired-guess-shell-command): Put colon at the end of
+ the prompt. (Bug#13045)
+
+2012-12-14 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/macroexp.el (macroexp--warn-and-return):
+ Try to include filename in non-bytecomp warning. (Bug#13132)
+
+2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix permissions bugs with setgid directories etc. (Bug#13125)
+ * files.el (backup-buffer): Don't rely on 9th output of
+ file-attributes, as it's now a placeholder. Instead, use the new
+ optional arg of file-ownership-preserved-p.
+ (file-ownership-preserved-p): New optional arg GROUP.
+ Fix mishandling of setuid directories that would cause this
+ function to return t when it should have returned nil.
+ Document what happens if the file does not exist, and when
+ it's not known whether the ownership will be preserved.
+ * net/tramp-sh.el (tramp-sh-handle-file-ownership-preserved-p):
+ Likewise.
+ (tramp-get-local-gid): Use group-gid for integer, as that's
+ faster and more reliable.
+
+2012-12-14 Julien Danjou <julien@danjou.info>
+
+ * progmodes/sql.el (sql-mode-postgres-font-lock-keywords):
+ Update keywords list, data type and PL/pgSQL.
+
+2012-12-14 Dave Abrahams <dave@boostpro.com>
+
+ * vc/ediff-util.el (ediff-buffer-type): New function.
+ (ediff-clone-buffer-for-current-diff-comparison): Compute the buf-type
+ rather than taking it as as argument.
+ (ediff-inferior-compare-regions): Adjust calls accordingly (bug#11319).
+
+2012-12-14 Ryan Crum <ryan.crum@eleostech.com>
+
+ * json.el: Add pretty-print option (bug#12634).
+ (json-encoding-separator, json-encoding-default-indentation)
+ (json--encoding-current-indentation, json-encoding-pretty-print)
+ (json-encoding-lisp-style-closings): New vars.
+ (json--with-indentation): New macro.
+ (json-encode-hash-table, json-encode-alist, json-encode-plist)
+ (json-encode-array): Use it to obey json-encoding-pretty-print.
+ (json-pretty-print-buffer, json-pretty-print): New commands.
+
+2012-12-14 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-syntax-propertize-function):
+ Extract `ruby-syntax-propertize-expansions'.
+ (ruby-syntax-propertize-expansions): Only change syntax on
+ certain string delimiters, to punctuation. This way the common
+ functions like forward-word and thing-at-point still work.
+ (ruby-match-expression-expansion): Improve readability.
+ (ruby-block-contains-point): New function.
+ (ruby-add-log-current-method): Handle several edge cases.
+
+2012-12-13 Juanma Barranquero <lekktu@gmail.com>
+
+ * emacs-lisp/edebug.el (edebug-unload-function): Make sure that
+ unload-feature finishes even when aborting an ongoing edebug session.
+ Also, do not worry about edebug-mode, unload-feature takes care of it.
+
+2012-12-13 Andreas Schwab <schwab@suse.de>
+
+ * net/tls.el (tls-program): Update customize type.
+
+2012-12-13 Juanma Barranquero <lekktu@gmail.com>
+
+ * emacs-lisp/edebug.el (edebug--require-cl-read): New function.
+ (edebug-setup-hook, cl-read-load-hooks): Use it.
+ (edebug-unload-function): New function. (Bug#13163)
+
+2012-12-13 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-adb.el (tramp-adb-file-name-p): Make it a defsubst.
+ Otherwise, there could be errors in autoloading. (Bug#13151)
+
+2012-12-13 Jürgen Hötzel <juergen@archlinux.org>
+
+ * net/tramp-adb.el (tramp-adb-wait-for-output): Remove spurious " ^H"
+ sequences.
+
+2012-12-13 Alan Mackenzie <acm@muc.de>
+
+ Make CC Mode not hang when _some_ lines end in CRLF. Bug #11841.
+ * progmodes/cc-engine.el (c-backward-comments): Add code to work
+ around `forward-comment' not recognizing ^M as whitespace.
+
+2012-12-13 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el (python-skeleton-class)
+ (python-skeleton-def): Do not add space after defun name.
+
+2012-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/cl.el (letf): Make it an alias of cl-letf.
+ (cl--symbol-function): Remove (now that funbound is like nil).
+
+2012-12-12 Glenn Morris <rgm@gnu.org>
+
+ * button.el (button--area-button-p): Fix typo.
+
+2012-12-12 Sam Steingold <sds@gnu.org>
+
+ * frame.el (frame-maximization-style): New user option.
+ (toggle-frame-maximized): Toggle frame maximization according to
+ `frame-maximization-style', bound to <f11>.
+ (cycle-frame-maximized): Cycle between all maximization styles and
+ non-maximized frame, bound to shift-<f11>.
+
+2012-12-12 David Cadé <codename68@gmail.com>
+
+ * mpc.el (mpc-format): Use truncate-string-to-width (bug#13143).
+
+2012-12-12 Jonas Bernoulli <jonas@bernoul.li>
+
+ * lisp/emacs-lisp/eieio.el: Prettier object pretty-printing (bug#13115).
+ (eieio-override-prin1): Don't quote kewords and booleans.
+ (object-write) <eieio-default-superclass>: Don't put closing parens
+ on new line, avoid needless empty lines, align values that are objects
+ with the slot keyword (instead of beginning on the same line).
+ (eieio-list-prin1): Align value with slot keyword; increase
+ eieio-print-depth before printing members of the list.
+
+2012-12-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * mail/emacsbug.el (report-emacs-bug): Move the intangible text to
+ a display text-property.
+ (report-emacs-bug-hook): Don't bother deleting it any more.
+
+ * hilit-chg.el (highlight-save-buffer-state): Delete.
+ Use with-silent-modifications instead.
+ (hilit-chg-set-face-on-change): Only fixup the text that's modified.
+
+ * button.el: Handle buttons in display text-properties.
+ (button--area-button-p, button--area-button-string):
+ Use (STRING . STRING-POS) representation instead of just STRING.
+
+2012-12-11 Eli Zaretskii <eliz@gnu.org>
+
+ * makefile.w32-in (compile4-SH): Fix a typo that caused term
+ subdirectory be skipped.
+
+2012-12-11 Glenn Morris <rgm@gnu.org>
+
+ * net/rcirc.el (rcirc-urls, rcirc-condition-filter): Doc fixes.
+
+ * progmodes/f90.el (f90-line-continued, f90-indent-region):
+ Treat preprocessor lines embedded in continuations like comments.
+ (f90-indent-line): Special-case preprocessor lines. (Bug#13138)
+
+2012-12-11 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc.el (calc-standard-date-formats): Add more date
+ formats.
+ * calc/calc-forms.el (math-parse-iso-date): New function.
+ (math-parse-date): Use `math-parse-iso-date' when appropriate.
+ (math-parse-iso-date-validate): Add extra error checking.
+ (calc-date-notation): Add ability to access new date formats.
+
+2012-12-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * hi-lock.el (hi-lock--regexps-at-point): Fix boundary case for
+ font-lock as well as when there's no text-property.
+
+2012-12-10 Jambunathan K <kjambunathan@gmail.com>
+
+ * hi-lock.el: Refine the choice of default face.
+ (hi-lock-keyword->face): New function. Use it wherever we used
+ cadadadr instead.
+ (hi-lock--regexps-at-point): Ignore faces that can't come from hi-lock.
+ (hi-lock--last-face): Remove var.
+ (hi-lock--unused-faces): New var to replace it.
+ (hi-lock-read-face-name): Use/maintain it.
+ (hi-lock-unface-buffer): Maintain it. Fix error for the C-u case.
+ (hi-lock-set-pattern): Ignore new rule if it has the same regexp even
+ if it has another face.
+
+2012-12-10 Eli Zaretskii <eliz@gnu.org>
+
+ * subr.el (w32notify-handle-event): New function.
+ (inotify-handle-event): Doc fix.
+
+2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
+
+ * subr.el (inotify-event-p, inotify-handle-event): New functions.
+
+2012-12-10 Dani Moncayo <dmoncayo@gmail.com>
+
+ * simple.el (just-one-space): Doc fix.
+
+2012-12-10 Eli Zaretskii <eliz@gnu.org>
+
+ * textmodes/texinfo.el (texinfo-enable-quote-envs): Add "smallexample".
+
+2012-12-10 Le Wang <l26wang@gmail.com>
+
+ * hilit-chg.el (hilit-chg-set-face-on-change): Don't burp in
+ narrowed buffer (bug#12361).
+
+2012-12-10 Juanma Barranquero <lekktu@gmail.com>
+
+ * vc/vc-hooks.el (vc-state): Doc fix.
+
+2012-12-10 Glenn Morris <rgm@gnu.org>
+
+ * mail/rmail.el (rmail-maybe-display-summary):
+ Preserve buffer, in case select-window changes it. (Bug#13066)
+
+2012-12-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/cl.el, emacs-lisp/cl-lib.el: Move cl-unload-function and
+ cl-load-hook where they belong.
+
+2012-12-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/cl-lib.el (cl-declaim): Paren typo.
+
+2012-12-09 Eli Zaretskii <eliz@gnu.org>
+
+ Parallelize byte compilation on MS-Windows.
+ * makefile.w32-in (WINS_BASIC1, WINS_BASIC2, WINS_BASIC3)
+ (WINS_BASIC4): New variables, subdivide subdirectories into 4 parts.
+ (WINS_BASIC): Define as concatenation of the above.
+ (compile): Subdivide into 4 separate and independent jobs that can
+ be run in parallel.
+ (compile0-CMD, compile0-SH): New targets for compiling
+ COMPILE_FIRST files, which are prerequisites for the rest of the
+ byte-compilation.
+ (compile1-CMD, compile2-CMD, compile3-CMD, compile4-CMD):
+ New targets for parallel compilation with cmd.exe.
+ (compile1-SH, compile2-SH, compile3-SH, compile4-SH): Ditto for
+ compiling under a Unixy shell.
+
+2012-12-09 Chong Yidong <cyd@gnu.org>
+
+ * simple.el (set-mark-default-inactive): Delete this
+ accidentally-introduced option.
+ (set-mark-command, exchange-point-and-mark): Remove calls.
+
+2012-12-09 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/lisp-mode.el (eval-defun-1): Doc fix.
+ Respect a defcustom's :set function, if appropriate. (Bug#109)
+ (eval-defun): Doc fix.
+
+2012-12-08 Juri Linkov <juri@jurta.org>
+
+ * info.el (Info-copy-current-node-name, Info-breadcrumbs)
+ (Info-fontify-node, Info-bookmark-make-record): Remove the
+ file extension from Info-current-file (Bug#13016).
+
+2012-12-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * hi-lock.el (hi-lock-unface-buffer): If there's no matching regexp at
+ point, still provide some default.
+ (hi-lock--regexps-at-point): Don't enforce a "hi-lock-" prefix on face
+ names, since we don't use it right now. Actually return the list.
+ (hi-lock-file-patterns, hi-lock-interactive-patterns): Use defvar-local.
+
+2012-12-07 Chong Yidong <cyd@gnu.org>
+
+ * novice.el (disabled-command-function): Remove a spurious help
+ xref (Bug#13043). Suggested by Kelly Dean.
+
+ * subr.el (text-clone-maintain): Fix clone overlay deletion when a
+ syntax is specified (Bug#13025).
+
+ * info.el (Info-set-mode-line): Remove the file extension from
+ Info-current-file if there is one (Bug#13016).
+
+2012-12-07 Glenn Morris <rgm@gnu.org>
+
+ * mail/rmail.el (rmail-mime-decoded): New permanent local.
+ (rmail-show-message-1): Set rmail-mime-decoded when appropriate.
+ * mail/rmailedit.el (rmail-cease-edit): Respect rmail-mbox-format
+ and rmail-mime-decoded. (Bug#9841)
+
+ * mail/unrmail.el (unrmail-mbox-format): New option. (Bug#6574)
+ (batch-unrmail, unrmail): Doc fixes.
+ (unrmail): Respect unrmail-mbox-format.
+ * mail/rmail.el (rmail-mbox-format): New option.
+ (rmail-show-message-1): Respect rmail-mbox-format.
+
+2012-12-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/cl-macs.el (cl-tagbody): New macro.
+
+2012-12-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Further cleanup of the "cl-" namespace. Fit CL in 80 columns.
+ * emacs-lisp/cl-macs.el (cl--pop2, cl--optimize-safety)
+ (cl--optimize-speed, cl--not-toplevel, cl--parse-loop-clause)
+ (cl--expand-do-loop, cl--proclaim-history, cl--declare-stack)
+ (cl--do-proclaim, cl--proclaims-deferred): Rename from the "cl-" prefix.
+ (cl-progv): Don't rely on dynamic scoping to find the body.
+ * emacs-lisp/cl-lib.el (cl--optimize-speed, cl--optimize-safety)
+ (cl--proclaims-deferred): Rename from the "cl-" prefix.
+ (cl-declaim): Use backquotes.
+ * emacs-lisp/cl-extra.el (cl-make-random-state, cl-random-state-p):
+ Use "cl--" prefix for the object's tag.
+
+ * ses.el: Use advice-add/remove.
+ (ses--advice-copy-region-as-kill, ses--advice-yank): New functions.
+ (copy-region-as-kill, yank): Use advice-add.
+ (ses-unload-function): Use advice-remove.
+
+2012-12-06 Jonas Bernoulli <jonas@bernoul.li>
+
+ * button.el: Make them work in header-lines (bug#12817).
+ (button-map): Add bindings for header-line and mode-line use.
+ (button-get, button-put, button-label): `button' may now be a string.
+ (button-activate): Don't make it a defsubst.
+ (button--area-button-p, button--area-button-string): New functions.
+ (make-text-button): Fix the return value when `beg' was a string.
+ (push-button): Handle the mode-line case.
+
+2012-12-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/sql.el: Use cl-lib and lexical-binding; various cleanup.
+ (sql-signum): Remove. Use `cl-signum' instead.
+ (sql-read-passwd): Remove; use read-passwd instread.
+ (sql-get-login-ext): Use read-string.
+ (sql-get-login): Use dolist and pcase.
+ (sql--completion-table): Rename from sql-try-completion.
+ Use complete-with-action.
+ (sql-mode): Don't change abbrev-all-caps globally.
+ (sql-connect): Don't rely on dynamic scoping for `new-name'.
+ (sql-postgres-completion-object): Initialize vars in their `let'.
+ (sql-comint-sybase, sql-comint-sqlite, sql-comint-mysql)
+ (sql-comint-solid, sql-comint-ms, sql-comint-postgres)
+ (sql-comint-interbase): Use a single append, without setq.
+ (sql-comint-linter): Same, and unwind-protect the LINTER_MBX var.
+
+ * hi-lock.el: Rework the default face and the serialize regexp code.
+ (hi-lock--auto-select-face-defaults): Remove.
+ (hi-lock-string-serialize-serial): Remove.
+ (hi-lock--hashcons-hash): Rename from hi-lock-string-serialize-hash;
+ make weak.
+ (hi-lock--hashcons): Rename from hi-lock-string-serialize, return an
+ equal string.
+ (hi-lock-set-pattern): Adjust accordingly.
+ (hi-lock--regexps-at-point): Simplify accordingly.
+ (hi-lock--auto-select-face-defaults): Remove.
+ (hi-lock--last-face): New var to replace it.
+ (hi-lock-read-face-name): Rewrite (bug#11095).
+ (hi-lock-unface-buffer): Arrange for the face to be the next default.
+
+2012-12-06 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-replace-environment-variables):
+ Hide compiler warning.
+ (tramp-file-name-for-operation): Remove `executable-find',
+ `start-process', `call-process' and `call-process-region'.
+
+ * net/tramp-compat.el (top): Don't require 'tramp-util and 'tramp-vc.
+
+ * net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): Ensure backward
+ compatibility.
+
+ * net/tramp-sh.el (top): Remove `tramp-sh-handle-call-process-region'.
+
+2012-12-06 Chong Yidong <cyd@gnu.org>
+
+ * ffap.el (ffap-replace-file-component): Fix typo.
+
+2012-12-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/octave-mod.el (octave-mark-block): Move out of tokens and
+ fix open-paren-like token test (bug#12785).
+
+2012-12-06 Glenn Morris <rgm@gnu.org>
+
+ * mail/rmailsum.el (rmail-new-summary): Tweak for
+ rmail-maybe-display-summary changing buffer. (Bug#13066)
+
+2012-12-06 Juri Linkov <juri@jurta.org>
+
+ * info.el (Info-fontify-node): Don't hide the last newline.
+ (Bug#12272)
+
+2012-12-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mail/mailabbrev.el (mail-abbrev-expand-wrapper): Work in minibuffer
+ so as to enable message-read-from-minibuffer to expand mail aliases.
+
+2012-12-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * minibuf-eldef.el (minibuf-eldef-update-minibuffer): Don't mess with
+ the `intangible' property.
+ Suggested by Christopher Schmidt <christopher@ch.ristopher.com>
+
+2012-12-05 Deniz Dogan <deniz@dogan.se>
+
+ * net/rcirc.el (rcirc-urls): Update documentation.
+ (rcirc-condition-filter): New function.
+ (rcirc-browse-url, rcirc-markup-urls): Use only URLs before point
+ and exclude consecutive duplicate URLs (Bug#6082).
+
+2012-12-05 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
+ Check return code of copy command.
+
+ * net/tramp-adb.el (tramp-adb-sdk-dir, tramp-adb-prompt):
+ Use group `tramp'. Add version.
+
+2012-12-05 Chong Yidong <cyd@gnu.org>
+
+ * ffap.el (ffap-url-regexp): Don't require matching at front of
+ string (Bug#4952).
+ (ffap-url-p): If only a substring matches, return that.
+ (ffap-url-at-point): Use the return value of ffap-url-p.
+ (ffap-read-file-or-url, ffap-read-file-or-url-internal)
+ (find-file-at-point, dired-at-point, dired-at-point-prompter)
+ (ffap-guess-file-name-at-point): Likewise.
+ (ffap-replace-file-component): Fix typo.
+
+ * info.el (info-display-manual): Add existing Info buffers, whose
+ files may not be in Info-directory-list, to the completion.
+ (info--manual-names): New helper function.
+
+2012-12-05 Glenn Morris <rgm@gnu.org>
+
+ * vc/vc-hg.el (vc-hg-resolve-when-done, vc-hg-find-file-hook):
+ New functions, for detecting and resolving conflicts. (Bug#10709)
+
+2012-12-04 Jambunathan K <kjambunathan@gmail.com>
+
+ * hi-lock.el (hi-lock-auto-select-face): New user variable.
+ (hi-lock-auto-select-face-defaults): New buffer local variable.
+ (hi-lock-read-face-name): Honor `hi-lock-auto-select-face'.
+ (hi-lock-unface-buffer): Prompt user with useful defaults.
+ With prefix arg, unhighlight all hi-lock patterns in buffer.
+
+2012-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * obsolete/terminal.el, obsolete/longlines.el: Add obsolecence info.
+
+2012-12-04 Michael Albinus <michael.albinus@gmx.de>
+
+ * Makefile.in (TRAMP_SRC):
+ * makefile.w32-in (TRAMP_SRC): Add tramp-adb.el.
+
+2012-12-04 Juergen Hoetzel <juergen@archlinux.org>
+
+ * net/tramp-adb.el: New package.
+
+2012-12-04 Chong Yidong <cyd@gnu.org>
+
+ * terminal.el: Move to obsolete/.
+
+ * longlines.el: Move to obsolete/.
+
+ * vc/ediff-diff.el (ediff-extract-diffs, ediff-extract-diffs3):
+ Remove code referring to longlines mode.
+
+2012-12-03 Juri Linkov <juri@jurta.org>
-2012-12-31 Andreas Schwab <schwab@linux-m68k.org>
+ * sort.el (delete-duplicate-lines): New command. (Bug#13032)
- * emacs-lisp/byte-run.el (defmacro): Use same argument parsing as
- defun. Don't check for DECL if DOCSTRING isn't a string.
- (defun): Likewise.
+2012-12-03 Agustín Martín Domingo <agustin.martin@hispalinux.es>
-2012-12-31 Glenn Morris <rgm@gnu.org>
+ * textmodes/ispell.el (ispell-init-process)
+ (ispell-start-process, ispell-internal-change-dictionary):
+ Make sure personal dictionary name is expanded after initial
+ `default-directory' value. Use expanded strings for
+ keep/restart checks and for value (Bug#13019).
- * eshell/em-cmpl.el (eshell-pcomplete):
- More thoroughly imitate pcomplete. (Bug#13293)
+2012-12-03 Jay Belanger <jay.p.belanger@gmail.com>
- * files.el (parse-colon-path): Doc fix. (Bug#12351)
- Return nil for empty path elements. (Bug#13296)
+ * calc/calc-forms.el (math-date-to-iso-dt): Fix weekday number.
-2012-12-31 Fabián Ezequiel Gallina <fgallina@cuca>
+2012-12-03 Leo Liu <sdl.web@gmail.com>
- * progmodes/python.el (python-nav-end-of-statement): Rewrite in
- order to improve efficiency (Based on Daniel Colascione's
- <dancol@dancol.org> patch). (Bug#13182)
+ * files.el (dir-locals-read-from-file): Check file non-empty
+ before reading. (Bug#13038)
-2012-12-31 Glenn Morris <rgm@gnu.org>
+2012-12-03 Glenn Morris <rgm@gnu.org>
- * vc/log-edit.el (log-edit-header-contents-regexp): Add doc string.
+ * jka-cmpr-hook.el (jka-compr-get-compression-info):
+ Remove any version extension before checking filename. (Bug#13006)
+ (jka-compr-compression-info-list): Belated :version bump.
-2012-12-31 Fabián Ezequiel Gallina <fgallina@cuca>
+2012-12-03 Chong Yidong <cyd@gnu.org>
- * progmodes/python.el: Support other commands triggering
- python-indent-line so indentation cycling continues to work.
- (python-indent-trigger-commands): New defcustom.
- (python-indent-line): Use it.
+ * simple.el (transient-mark-mode): Doc fix (Bug#11523).
-2012-12-31 Fabián Ezequiel Gallina <fgallina@cuca>
+ * buff-menu.el (Buffer-menu-delete-backwards, Buffer-menu-mode)
+ (buffer-menu): Doc fix (Bug#12294).
- * progmodes/python.el (python-shell-send-region): Add blank lines
- for non sent code so backtraces remain correct.
+2012-12-03 Roland Winkler <winkler@gnu.org>
-2012-12-31 Andreas Schwab <schwab@linux-m68k.org>
+ * calendar/diary-lib.el (diary-header-line-format): Use keybinding
+ of diary-show-all-entries in the diary buffer (Bug#12994).
- * emacs-lisp/byte-run.el (defmacro): Don't lose final nil if
- neither DOCSTRING nor DECL was given. (Bug#13316)
+2012-12-03 Michael Albinus <michael.albinus@gmx.de>
-2012-12-30 Glenn Morris <rgm@gnu.org>
+ * net/tramp-sh.el (tramp-perl-encode): Use "read STDIN" instead of
+ "<STDIN>". This is binary safe.
- * net/mairix.el (rmail, rmail-summary-displayed, rmail-summary):
- Remove unnecessary/buggy autoloads (missing interactive). (Bug#13294)
- (rmail-summary-displayed, rmail-summary): Declare.
- (mairix-rmail-display): Just require rmail.
+2012-12-03 Jay Belanger <jay.p.belanger@gmail.com>
-2012-12-29 Chong Yidong <cyd@gnu.org>
+ * calc/calc-forms.el (math-absolute-from-iso-dt)
+ (math-date-to-iso-dt, math-parse-iso-date-validate)
+ (math-iso-dt-to-date): New functions.
+ (math-fd-iso-dt, math-fd-isoyear, math-fd-isoweek)
+ (math-fd-isoweekday): New variables.
+ (calc-date-notation, math-parse-standard-date, math-format-date)
+ (math-format-date-part): Add support for more formatting codes.
- * emacs-lisp/package.el (package-untar-buffer): Improve integrity
- check for the tarball contents.
+2012-12-02 Dmitry Gutov <dgutov@yandex.ru>
-2012-12-29 Matt Fidler <matt.fidler@alcon.com> (tiny change)
+ * vc/vc.el (vc-delete-file, vc-rename-file): Default to the
+ current buffer's file name when called interactively (Bug#12488).
- * emacs-lisp/package.el (package-untar-buffer): Handle problematic
- tarfile content listings (Bug#13136).
+2012-12-02 Juri Linkov <juri@jurta.org>
-2012-12-29 Mark Lillibridge <mark.lillibridge@hp.com>
+ * info.el (info-display-manual): Don't clobber an existing Info
+ buffer (Bug#10770). Add completion (Bug#10771).
- * mail/rmailmm.el (rmail-insert-mime-forwarded-message): Insert
- the undecoded text of the message being forwarded. (Bug#9521)
+2012-12-01 Yuya Nishihara <yuya@tcha.org> (tiny change)
-2012-12-28 Michael Albinus <michael.albinus@gmx.de>
+ * vc/vc-hooks.el (vc-find-file-hook): Expand buffer-file-truename
+ before using it for comparison (Bug#5297).
- * net/tramp-sh.el (tramp-set-file-uid-gid): Convert UID and GID to
- integers, if they are real numbers. (Bug#13282)
+2012-12-01 Jari Aalto <jari.aalto@cante.net>
-2012-12-26 Dmitry Gutov <dgutov@yandex.ru>
+ * textmodes/css-mode.el (css-current-defun-name): New function.
+ (css-mode): Use it.
- * progmodes/ruby-mode.el (ruby-indent-beg-re): Only allow "class",
- "module" and "def" to have indentation before them. Regression
- from 109911 (see the new test).
+ * textmodes/sgml-mode.el (html-current-defun-name): New function.
+ (html-mode): Use it.
-2012-12-24 Dmitry Gutov <dgutov@yandex.ru>
+2012-12-01 Chong Yidong <cyd@gnu.org>
- * progmodes/ruby-mode.el: Bump the version to 1.2 (Bug#13200).
+ Modularize add-log-current-defun (Bug#2224).
+ Suggested by Jari Aalto.
-2012-12-23 Alan Mackenzie <acm@muc.de>
+ * vc/add-log.el (add-log-current-defun-function): Doc fix.
+ (add-log-current-defun): Move mode-specific code to other files.
+ (add-log-lisp-like-modes, add-log-c-like-modes)
+ (add-log-tex-like-modes): Variables deleted.
- Speed up fontification where there's large brace blocks.
- * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Add a limit
- to a call of c-beginning-of-decl-1.
+ * emacs-lisp/lisp-mode.el (lisp-current-defun-name): New.
+ (lisp-mode-variables): Use it.
-2012-12-21 Chong Yidong <cyd@gnu.org>
+ * progmodes/cc-mode.el (c-common-init):
+ * progmodes/cperl-mode.el (cperl-mode): Set a value for
+ add-log-current-defun-function.
- * sort.el (sort-subr): Doc fix (Bug#13056).
+ * progmodes/m4-mode.el (m4-current-defun-name): New function.
+ (m4-mode): Use it.
-2012-12-20 Bastien Guerry <bzg@gnu.org>
+ * progmodes/perl-mode.el (perl-current-defun-name): New.
+ (perl-mode): Use it.
- * progmodes/etags.el (tags-search): Fix typo. Bug #13232.
+ * progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
+ Use lisp-current-defun-name.
-2012-12-11 Alan Mackenzie <acm@muc.de>
+ * textmodes/tex-mode.el (tex-current-defun-name): New.
+ (tex-common-initialization): Use it.
- Make CC Mode not hang when _some_ lines end in CRLF. Bug #11841.
- * progmodes/cc-engine.el (c-backward-comments): Add code to work
- around `forward-comment' not recognizing ^M as whitespace.
+ * textmodes/texinfo.el (texinfo-current-defun-name): New.
+ (texinfo-mode): Use it.
-2012-12-11 Fabián Ezequiel Gallina <fgallina@cuca>
+2012-12-01 Chong Yidong <cyd@gnu.org>
- * progmodes/python.el (python-skeleton-class)
- (python-skeleton-def): Do not add space after defun name.
+ * emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
+ * progmodes/autoconf.el (autoconf-mode):
+ * progmodes/js.el (js-mode):
+ * progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
+ (makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
+ * progmodes/perl-mode.el (perl-mode):
+ * progmodes/sh-script.el (sh-mode, sh-set-shell):
+ * textmodes/css-mode.el (css-mode):
+ * textmodes/sgml-mode.el (html-mode, sgml-mode)
+ (sgml-tags-invisible, sgml-guess-indent):
+ * textmodes/tex-mode.el (tex-common-initialization)
+ (latex-complete-bibtex-keys, tex-shell, tex-main-file)
+ (doctex-mode, plain-tex-mode, latex-mode):
+ * textmodes/texinfo.el (texinfo-mode): Use setq-local.
-2012-12-09 Chong Yidong <cyd@gnu.org>
+2012-12-01 Kirk Kelsey <kirk.kelsey@0x4b.net>
- * simple.el (set-mark-default-inactive): Mark as obsolete, for
- removal after 24.3.
+ * vc/vc-hg.el (vc-hg-next-revision):
+ Ensure use of default "tip" output format. (Bug#6968)
-2012-12-08 Dani Moncayo <dmoncayo@gmail.com>
+2012-12-01 Kim F. Storm <storm@cua.dk>
- * simple.el (just-one-space): Doc fix.
+ * startup.el (fancy-startup-tail): Add a clickable link
+ (Bug#2176).
-2012-12-07 Eli Zaretskii <eliz@gnu.org>
+2012-12-01 Chong Yidong <cyd@gnu.org>
- * textmodes/texinfo.el (texinfo-enable-quote-envs): Add
- "smallexample".
+ * startup.el (fancy-startup-tail): Improve the message about
+ auto-save files (Bug#2176).
-2012-12-07 Le Wang <l26wang@gmail.com>
+ * files.el (recover-session): Improve the descriptive message, and
+ use substitute-command-keys.
- * hilit-chg.el (hilit-chg-set-face-on-change): Don't burp in
- narrowed buffer (bug#12361).
+2012-12-01 Glenn Morris <rgm@gnu.org>
-2012-12-07 Michael Heerdegen <michael_heerdegen@web.de>
+ * ido.el (ido-file-internal):
+ Handle other-window, other-frame for dired. (Bug#13036)
- * emacs-lisp/debug.el (debug): Fix hard-coded frame counts (bug#10025).
- Virtually backported from trunk.
+2012-11-30 Glenn Morris <rgm@gnu.org>
-2012-12-07 Juanma Barranquero <lekktu@gmail.com>
+ * icomplete.el (icomplete-separator): Fix :version.
- * vc/vc-hooks.el (vc-state): Doc fix.
+2012-11-30 Chong Yidong <cyd@gnu.org>
-2012-12-06 Glenn Morris <rgm@gnu.org>
+ * shell.el (shell): For C-u M-x shell, use an inactive shell
+ buffer as the default (Bug#1975).
+ (shell-apply-ansi-color, shell-reapply-ansi-color): New functions.
+ (shell-mode): Use them to reapply ansi colorization if Shell mode
+ is re-enabled.
- * mail/rmail.el (rmail-maybe-display-summary):
- Preserve buffer, in case select-window changes it. (Bug#13066)
+2012-11-30 Yuriy Vostrikov <delamonpansie@gmail.com> (tiny change)
-2012-12-06 Stefan Monnier <monnier@iro.umontreal.ca>
+ * vc/vc-git.el (vc-git-command): Disable the pager (Bug#6137).
- * emacs-lisp/cl.el, emacs-lisp/cl-lib.el: Move cl-unload-function and
- cl-load-hook where they belong.
+2012-11-30 Samuel Bronson <naesten@gmail.com>
-2012-12-06 Chong Yidong <cyd@gnu.org>
+ * progmodes/grep.el (grep-compute-defaults): Do not pass the -e
+ flag to xargs, for compatibility with BSD xargs (Bug#11703).
- * ffap.el (ffap-replace-file-component): Fix typo.
+2012-11-30 Toru TSUNEYOSHI <t_tuneyosi@hotmail.com>
-2012-12-05 Stefan Monnier <monnier@iro.umontreal.ca>
+ * textmodes/fill.el (fill-region-as-paragraph): Handle overshoot
+ by move-to-column (Bug#3234).
- * progmodes/octave-mod.el (octave-mark-block): Move out of tokens and
- fix open-paren-like token test (bug#12785).
+2012-11-30 Chong Yidong <cyd@gnu.org>
-2012-12-04 Glenn Morris <rgm@gnu.org>
+ * longlines.el (longlines-wrap-line, longlines-encode-region):
+ Preserve text properties (Bug#1425).
- * mail/rmailsum.el (rmail-new-summary): Tweak for
- rmail-maybe-display-summary changing buffer. (Bug#13066)
+2012-11-30 OKAZAKI Tetsurou <okazaki.tetsurou@gmail.com> (tiny change)
-2012-12-03 Juri Linkov <juri@jurta.org>
+ * vc/vc.el (vc-register): Allow registering a file which is
+ already registered with a different backend (Bug#10589).
- * info.el (Info-fontify-node): Don't hide the last newline.
- (Bug#12272)
+2012-11-29 Jambunathan K <kjambunathan@gmail.com>
+ Stefan Monnier <monnier@iro.umontreal.ca>
-2012-12-01 Leo Liu <sdl.web@gmail.com>
+ * icomplete.el: Change separator; add ido-style commands.
+ (icomplete-show-key-bindings): Remove custom var.
+ (icomplete-get-keys): Remove function.
+ (icomplete-forward-completions, icomplete-backward-completions):
+ New commands.
+ (icomplete-minibuffer-map): New var.
+ (icomplete-minibuffer-setup): Use it.
+ (icomplete-exhibit): Don't delay if the list of completions is known.
+ (icomplete-separator): New custom.
+ (icomplete-completions): Use it.
+ * minibuffer.el (completion-all-sorted-completions): Delete duplicates.
+ (minibuffer-force-complete-and-exit): New command.
+ (minibuffer--complete-and-exit): New function extracted from
+ minibuffer-complete-and-exit.
+ (minibuffer-complete-and-exit): Use it.
- * files.el (dir-locals-read-from-file): Check file non-empty
- before reading. (Bug#13038)
+ * progmodes/etags.el (visit-tags-table-buffer): Give a more precise
+ error message when the file doesn't exist (bug#12974).
-2012-11-28 Glenn Morris <rgm@gnu.org>
+2012-11-29 Kelly Dean <kellydeanch@yahoo.com> (tiny change)
- * jka-cmpr-hook.el (jka-compr-get-compression-info):
- Remove any version extension before checking filename. (Bug#13006)
- (jka-compr-compression-info-list): Belated :version bump.
+ * simple.el (activate-mark): Run activate-mark-hook (bug#13027).
-2012-11-28 Chong Yidong <cyd@gnu.org>
+2012-11-29 Glenn Morris <rgm@gnu.org>
- * simple.el (transient-mark-mode): Doc fix (Bug#11523).
+ * files.el (hack-dir-local-variables): Warn if try to set
+ coding via dir-locals, since it doesn't work. (Bug#7169)
- * buff-menu.el (Buffer-menu-delete-backwards, Buffer-menu-mode)
- (buffer-menu): Doc fix (Bug#12294).
+ Add desktop support for restoring vc-dir buffers. (Bug#10606)
+ * vc/vc-dir.el (vc-dir-mode): Autoload it (for desktop restore).
+ Set buffer-local value of desktop-save-buffer.
+ (vc-dir-desktop-buffer-misc-data, vc-dir-restore-desktop-buffer):
+ New functions.
+ (desktop-buffer-mode-handlers): Add vc-dir-mode entry.
+ * desktop.el (desktop-save-buffer-p): Treat vc-dir like dired.
-2012-11-27 Roland Winkler <winkler@gnu.org>
+ * files.el (inhibit-local-variables-ignore-case): New. (Bug#10610)
+ (inhibit-local-variables-p): Use inhibit-local-variables-ignore-case.
+ Doc fix.
+ (inhibit-local-variables-regexps, inhibit-local-variables-suffixes):
+ Doc fixes.
- * calendar/diary-lib.el (diary-header-line-format): Use keybinding
- of diary-show-all-entries in the diary buffer (Bug#12994).
+2012-11-28 Jay Belanger <jay.p.belanger@gmail.com>
-2012-11-27 Michael Albinus <michael.albinus@gmx.de>
+ * calc/calc-forms.el (calc-date-notation): Fix regexp
+ used to find time codes. Fix symbol for seconds.
- * net/tramp-sh.el (tramp-perl-encode): Use "read STDIN" instead of
- "<STDIN>". This is binary safe.
+2012-11-27 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/derived.el (derived-mode-make-docstring):
+ Don't mention "abbrev" or "syntax" if nil. (Bug#11277)
2012-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
* textmodes/table.el (table-insert): Don't use `symbol-name' on
lexically scoped variables (bug#13005).
-2012-11-26 Glenn Morris <rgm@gnu.org>
+2012-11-27 Glenn Morris <rgm@gnu.org>
* vc/vc-hooks.el (vc-mistrust-permissions):
Default to t, to avoid data-loss. (Bug#11490)
-2012-11-26 Fabián Ezequiel Gallina <fgallina@cuca>
+2012-11-27 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (python-indent-guess-indent-offset):
If indentation is guessed make python-indent-offset buffer-local.
Fix forward movement when statement(s) separates point from defun.
(python-imenu-prev-index-position): New function.
-2012-11-26 Eli Zaretskii <eliz@gnu.org>
+2012-11-27 Eli Zaretskii <eliz@gnu.org>
* subr.el (buffer-file-type): Declare with defvar-local. Doc fix.
* dos-w32.el (find-file-not-found-set-buffer-file-coding-system):
Don't set buffer-file-type. Return nil. (Bug#12989)
-2012-11-26 Glenn Morris <rgm@gnu.org>
+2012-11-27 Glenn Morris <rgm@gnu.org>
* hippie-exp.el (hippie-expand-try-functions-list):
Re-autoload it. (Bug#12982)
-2012-11-25 Eli Zaretskii <eliz@gnu.org>
+2012-11-27 Eli Zaretskii <eliz@gnu.org>
* descr-text.el (describe-char-padded-string):
Call internal-char-font only on GUI frames. (Bug#11964)
-2012-11-24 Andreas Schwab <schwab@linux-m68k.org>
+2012-11-27 Andreas Schwab <schwab@linux-m68k.org>
* buff-menu.el (Buffer-menu-buffer+size-width): Fix customize type
and obsoletion message.
-2012-11-24 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl-macs.el (cl--transform-lambda): Add back `declare' in
the constructs to keep outside of the `cl-block' (bug#12977).
-2012-11-24 Chong Yidong <cyd@gnu.org>
+2012-11-27 Chong Yidong <cyd@gnu.org>
* mouse.el (mouse-drag-line): Even if the line is not draggable,
keep reading until we get the up-event anyway, in order to process
the up-event for mouse-1-click-follows-link (Bug#12971).
-2012-11-23 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/advice.el (ad-should-compile): Don't compile advice if the
+ base function is not yet defined (bug#12965).
+ (ad-activate-advised-definition): Use ad-compile-function.
+ (ad-activate): Use cond.
+
+2012-11-25 Leo Liu <sdl.web@gmail.com>
+
+ * textmodes/sgml-mode.el (sgml-tag): Fix indentation for closing tag.
+ (Bug#12979)
+
+2012-11-24 Vincent Belaïche <vincentb1@users.sourceforge.net>
+
+ * textmodes/reftex-parse.el (reftex-parse-from-file): Use variable
+ reftex-section-info-function in order to be compatible with
+ Texinfo integration.
+
+ * textmodes/reftex.el (reftex-section-pre-regexp)
+ (reftex-section-post-regexp, reftex-section-info-function):
+ New variable.
+ (reftex-compile-variables): Use variables reftex-section-pre-regexp,
+ reftex-section-post-regexp, and reftex-section-info-function in order
+ to be compatible with Texinfo integration.
+
+ * textmodes/reftex-toc.el (reftex-toc-promote-action):
+ use reftex-section-pre-regexp variable in order to be compatible with
+ Texinfo integration.
+
+2012-11-25 Chong Yidong <cyd@gnu.org>
+
+ * faces.el: Make face-spec-set more analogous to setq.
+ (face-spec-set): Change the third arg to specify whether this
+ function is being called via defface, customize, or a third party.
+ Set the appropriate symbol properties. Clear the override spec if
+ setting via Custom. Initialize face if necessary. (Bug#4988)
+ (face-spec-recalc): Allow theme faces to completely replace the
+ defface spec, in the same way as custom faces (Bug#8454).
+
+ * cus-face.el (custom-declare-face): Move face initialization to
+ face-spec-set.
+ (custom-theme-set-faces): Don't initialize the face name here, as
+ that is now done in face-spec-set.
+
+ * cus-edit.el (custom-face-set, custom-face-mark-to-save)
+ (custom-face-reset-saved, custom-face-mark-to-reset-standard):
+ Simplify by using the new arg to face-spec-set.
+
+ * emacs-lisp/lisp-mode.el (eval-defun-1): When evaluating defface,
+ reset face-override-spec too, and use custom-declare-face.
+
+2012-11-24 Jan Djärv <jan.h.d@swipnet.se>
+
+ * term/ns-win.el (ns-initialize-window-system): Move creation of
+ fontsets here (Bug#11964).
+
+2012-11-24 Vincent Belaïche <vincentb1@users.sourceforge.net>
+
+ * ses.el (ses-rename-cell): Correct bug on mode-line update after
+ cell renaming.
+
+2012-11-24 Chong Yidong <cyd@gnu.org>
+
+ * woman.el (woman-default-faces, woman-monochrome-faces): Mark as
+ obsolete.
+
+ * custom.el (custom-theme-set-variables): Use a topological sort
+ for ordering by custom dependencies (Bug#12952).
+ (custom--sort-vars, custom--sort-vars-1): New functions.
+
+2012-11-24 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/bytecomp.el (byte-compile-file): Setup default value for
lexical-binding (bug#12938).
-2012-11-23 Wolfgang Jenkner <wjenkner@inode.at>
+2012-11-24 Wolfgang Jenkner <wjenkner@inode.at>
* image-mode.el (image-transform-check-size): Use assertions only
for images of type imagemagick.
Otherwise no error, image-transform-fit-to-{width,height} is
silently ignored, as before. Doc fix.
-2012-11-23 Chong Yidong <cyd@gnu.org>
+2012-11-24 Chong Yidong <cyd@gnu.org>
* faces.el (color-defined-p): Doc fix (Bug#12853).
-2012-11-23 Juri Linkov <juri@jurta.org>
+2012-11-24 Juri Linkov <juri@jurta.org>
* dired.el (dired-mark): Add optional arg `interactive'.
Check for `use-region-p' if `interactive' is non-nil.
`interactive'. Call `dired-mark' with the arg `interactive'.
(Bug#10624)
-2012-11-23 Juri Linkov <juri@jurta.org>
-
* wdired.el: Revert 2012-10-17 change partly and replace it with
Patch by Christopher Schmidt <christopher@ch.ristopher.com>.
(wdired-finish-edit): Add marks for new file names to
(wdired-do-renames): Remove calls to `dired-remove-file',
`dired-add-file', `dired-add-entry'. (Bug#11795)
-2012-11-21 Alan Mackenzie <acm@muc.de>
+2012-11-24 Alan Mackenzie <acm@muc.de>
* progmodes/cc-defs.el (c-version): Bump to 5.32.4.
Call c-invalidate-state-cache from `c-before-change' instead of
`c-after-change'.
-2012-11-20 Daniel Colascione <dancol@dancol.org>
+2012-11-23 Chong Yidong <cyd@gnu.org>
- * term/w32-win.el (cygwin-convert-path-from-windows):
- Accomodate rename of cygwin_convert_path* to cygwin_convert_file_name*.
- This change is a backport from trunk.
+ * find-cmd.el (find-constituents): Add executable, ipath,
+ readable, samefile, writable, daystart, regextype (Bug#12856).
-2012-11-20 Eli Zaretskii <eliz@gnu.org>
+2012-11-23 Stefan Monnier <monnier@iro.umontreal.ca>
- * simple.el (line-move): Don't call line-move-partial if
- scroll-conservatively is in effect. (Bug#12927)
+ * emacs-lisp/ert.el, emacs-lisp/ert-x.el: Use cl-lib and lexical-binding.
-2012-11-20 Michael Albinus <michael.albinus@gmx.de>
+2012-11-22 Paul Eggert <eggert@cs.ucla.edu>
- * net/trampver.el (tramp-version): Downgrade to 2.2.6-24.3, in
- order to distinguish from trunk.
+ * calc/calc.el (calc-gregorian-switch): Move to after calc-refresh
+ definition. This fixes a bootstrap failure.
+ (calc-gregorian-switch): In menu, put dates before regions.
+ This is easier to follow, lines up better in the menu, and lets us
+ coalesce regions that switch at the same time. Give country
+ names, not "Vatican", as that's better for non-expert users.
+ Use names that are stable between the date of switch and now, e.g.,
+ Bohemia and Moravia (which existed then and now) and not
+ Czechoslovakia (which didn't exist then and doesn't exist now).
+ What is now the U.S. mostly did not switch at the same time as
+ Britain, so omit the U.S. Correct spelling of "Britain".
+ Catholic Switzerland was too much of a mess, so omit it.
-2012-11-19 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-22 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc.el (calc-gregorian-switch): Refresh the Calc buffer
+ after the variable is changed.
+
+2012-11-21 Daniel Colascione <dancol@dancol.org>
+
+ * progmodes/sql.el (sql-mode-font-lock-object-name): Support IF NOT EXISTS
+ in SQL declarations for font-lock.
+ (sql-imenu-generic-expression): Teach imenu about IF NOT EXISTS.
+
+2012-11-21 Glenn Morris <rgm@gnu.org>
+
+ * faces.el (face-underline-p, face-inverse-video-p, face-bold-p)
+ (face-italic-p): Add optional argument "inherit".
+
+ * faces.el (set-face-inverse-video, set-face-bold, set-face-italic):
+ Remove -p suffix from names, for consistency with other set-face-*.
+ (set-face-inverse-video): Fix interactive spec.
+ * play/gamegrid.el (gamegrid-make-mono-tty-face):
+ * textmodes/table.el (table--update-cell-face):
+ Use set-face-inverse-video rather than now obsolete alias.
+
+2012-11-21 Eli Zaretskii <eliz@gnu.org>
- * emacs-lisp/byte-run.el (defun-declarations-alist): Don't accept
- non-symbols for compiler macros (yet).
+ * simple.el (line-move): Don't call line-move-partial if
+ scroll-conservatively is in effect. (Bug#12927)
+
+2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
* eshell/em-cmpl.el (eshell-pcomplete): Refine fix for bug#12838:
Fallback on completion-at-point rather than
* emacs-lisp/ert.el (ert--expand-should-1): Adapt to cl-lib.
-2012-11-19 Michael Albinus <michael.albinus@gmx.de>
+2012-11-21 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-do-copy-or-rename-file): If both files
are remote, check out-of-band property for both.
-2012-11-19 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
* window.el (switch-to-buffer): Re-add the warning that was lost in the
code rewrite.
-2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
+2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
More minor time fixes.
* calendar/time-date.el: Commentary fix.
* ps-bdf.el (bdf-file-newer-than-time):
Process four-integers time stamps, not two. Doc fixes.
+2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * uniquify.el (uniquify-managed): Use defvar-local.
+ (rename-buffer, create-file-buffer): Advise with advice-add.
+ (uniquify-unload-function): Unadvise accordingly.
+
+ * emacs-lisp/trace.el: Rewrite, use nadvice and lexical-binding.
+ (trace-buffer): Don't purecopy.
+ (trace-entry-message, trace-exit-message): Add `context' arg.
+ (trace--timer): New var.
+ (trace-make-advice): Adjust for use in nadvice.
+ Add `context' argument. Delay `display-buffer' via a timer.
+ (trace-function-internal): Use advice-add.
+ (trace--read-args): New function.
+ (trace-function-foreground, trace-function-background): Use it.
+ (trace-function): Rename to trace-function-foreground and redefine as
+ an alias to that new name.
+ (untrace-function, untrace-all): Adjust to the use of nadvice.
+
+ * emacs-lisp/bytecomp.el (byte-compile): Fix handling of closures.
+
+ * emacs-lisp/byte-run.el (defun-declarations-alist): Fix last change.
+
+ * subr.el (called-interactively-p-functions): New var.
+ (internal--called-interactively-p--get-frame): New macro.
+ (called-interactively-p, interactive-p): Rewrite in Lisp.
+ * emacs-lisp/nadvice.el (advice--called-interactively-skip): New fun.
+ (called-interactively-p-functions): Use it.
+ * emacs-lisp/edebug.el (edebug--called-interactively-skip): New fun.
+ (called-interactively-p-functions): Use it.
+ * allout.el (allout-called-interactively-p): Don't assume
+ called-interactively-p is a subr.
+
+2012-11-20 Glenn Morris <rgm@gnu.org>
+
+ * profiler.el (profiler-report-mode-map): Add a menu.
+ No need to bind `q' because we derive from special-mode.
+ (profiler-report-find-entry): Handle calls from the menu-bar.
+
+2012-11-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/byte-run.el (defun-declarations-alist):
+ Allow a compiler-macro to be a lambda expression.
+
+ * progmodes/python.el: Use cl-lib. Move var declarations outside of
+ eval-when-compile.
+ (python-syntax-context): Add compiler-macro.
+ (python-font-lock-keywords): Simplify with De Morgan.
+
+ * vc/diff-mode.el (diff-hunk): Don't make useless timers.
+
+ * files.el (load-file): Require match in minibuffer selection, as was
+ the case in Emacs-20 before we changed the spec to allow .elc files
+ (bug#12935).
+
+ * json.el: Don't require cl since we don't use it.
+ * color.el: Don't require cl.
+ (color-complement): `caddr' -> `nth 2'.
+
+ * calendar/time-date.el (time-to-seconds): De-obsolete.
+
+2012-11-19 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-forms.el (math-leap-year-p): Fix formula for negative
+ year numbers.
+ (math-date-to-julian-dt): Adjust the initial approximation for the
+ year to deal with the new definition of the DATE.
+
+2012-11-19 Daniel Colascione <dancol@dancol.org>
+
+ * term/w32-win.el (cygwin-convert-path-from-windows):
+ Accomodate rename of cygwin_convert_path* to cygwin_convert_file_name*.
+
+2012-11-18 Chong Yidong <cyd@gnu.org>
+
+ * filecache.el (file-cache--read-list): New function.
+ (file-cache-add-directory-list, file-cache-add-file-list)
+ (file-cache-delete-file-list, file-cache-delete-directory-list):
+ Use it to read a list of files or directories (Bug#12846).
+ (file-cache-add-file, file-cache-add-directory)
+ (file-cache-delete-file-list, file-cache-delete-file-regexp)
+ (file-cache-delete-directory): Print an message.
+
+2012-11-18 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-forms.el (math-date-to-dt): Use integer date when
+ calling `math-date-to-julian-dt' and 'math-date-to-gregorian-dt'.
+
2012-11-18 Glenn Morris <rgm@gnu.org>
* image.el (insert-image, insert-sliced-image): Doc fix.
-2012-11-17 Chong Yidong <cyd@gnu.org>
+2012-11-18 Chong Yidong <cyd@gnu.org>
* emacs-lisp/syntax.el (syntax-propertize-function): Doc fix
(Bug#12810).
-2012-11-17 OKAZAKI Tetsurou <okazaki.tetsurou@gmail.com> (tiny change)
+2012-11-18 OKAZAKI Tetsurou <okazaki.tetsurou@gmail.com> (tiny change)
* vc/vc-svn.el (vc-svn-merge-news): Properly parse the merge
response when the target file is in a subdirectory (Bug#12757).
-2012-11-17 Chong Yidong <cyd@gnu.org>
+2012-11-18 Chong Yidong <cyd@gnu.org>
* filecache.el (file-cache-add-file-list): Doc fix (Bug#12694).
-2012-11-17 Glenn Morris <rgm@gnu.org>
+2012-11-18 Glenn Morris <rgm@gnu.org>
- * woman.el (woman-non-underline-faces):
* emacs-lisp/cl-lib.el (face-underline-p):
Use set-face-underline rather than the alias set-face-underline-p.
* subr.el (with-output-to-temp-buffer):
Add doc xref to with-temp-buffer-window.
+2012-11-18 Juanma Barranquero <lekktu@gmail.com>
+
+ * woman.el (woman-non-underline-faces): Use `set-face-underline'.
+ * calc/calc.el (math-format-date-cache): Declare.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Calc by default uses the Gregorian calendar for all dates (Bug#12633).
+ It also uses January 1, 1 AD as its day number 1.
+ * calc/calc-forms.el (math-julian-date-beginning)
+ (math-julian-date-beginning-int): Implement this.
+
+2012-11-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * descr-text.el (quail-find-key):
+ * dired.el (desktop-file-name):
+ * dirtrack.el (shell-prefixed-directory-name, shell-process-cd):
+ * generic-x.el (comint-mode, comint-exec):
+ * image-dired.el (widget-forward):
+ * info.el (speedbar-add-expansion-list, speedbar-center-buffer-smartly)
+ (speedbar-change-expand-button-char)
+ (speedbar-change-initial-expansion-list, speedbar-delete-subblock)
+ (speedbar-make-specialized-keymap, speedbar-make-tag-line):
+ * printing.el (easy-menu-add-item, easy-menu-remove-item)
+ (widget-field-action, widget-value-set):
+ * speedbar.el (imenu--make-index-alist):
+ * term.el (ring-empty-p, ring-ref, ring-insert-at-beginning)
+ (ring-length, ring-insert):
+ * vcursor.el (compare-windows-skip-whitespace):
+ * woman.el (dired-get-filename):
+ Declare functions.
+
+ * term/w32-win.el (cygwin-convert-path-from-windows): Fix declaration.
+
+2012-11-17 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc.el (calc-gregorian-switch): New variable.
+
+ * calc/calc-forms.el (math-day-in-year, math-dt-before-p)
+ (math-absolute-from-gregorian-dt, math-absolute-from-julian-dt)
+ (math-date-to-julian-dt, math-date-to-gregorian-dt): New functions.
+ (math-leap-year-p): Add option to distinguish between Julian
+ and Gregorian calendars.
+ (math-day-number): Use `math-day-in-year' to do the computations.
+ (math-absolute-from-dt): Rename from `math-absolute-from-date'.
+ Use `math-absolute-from-gregorian' and `math-absolute-from-julian'
+ to do the computations.
+ (math-date-to-dt): Use `math-date-to-julian-dt' and
+ `math-date-to-gregorian-dt' to do the computations.
+ (calcFunc-weekday, math-format-date-part): Use the new version of
+ the DATE to determine the weekday.
+ (calcFunc-newmonth, calcFunc-newyear): Use `calc-gregorian-switch'
+ when necessary.
+
+2012-11-17 Eli Zaretskii <eliz@gnu.org>
+
+ * term/w32-win.el (w32-handle-dropped-file): Use 'file://' only on
+ Cygwin; otherwise use 'file:'. (Bug#12914)
+ (cygwin-convert-path-from-windows): Declare, to avoid
+ byte-compiler warnings.
+
+2012-11-17 Andreas Politz <politza@fh-trier.de>
+
+ * ibuffer.el (ibuffer-mark-forward, ibuffer-unmark-forward)
+ (ibuffer-unmark-backward, ibuffer-mark-interactive): Support plain
+ prefix and negative numeric prefix args (Bug#12795).
+
+2012-11-17 Stephen Berman <stephen.berman@gmx.net>
+
+ * play/gamegrid.el (gamegrid-add-score-with-update-game-score-1):
+ Don't signal an error with a score that is too low to add to the
+ list of top scores. (Bug#12779)
+
+2012-11-17 Chong Yidong <cyd@gnu.org>
+
+ * help-mode.el (help-xref-interned): End on point-min (Bug#12737).
+
+ * filecache.el (file-cache-add-file): Handle relative file name in
+ the argument (Bug#12694).
+
+2012-11-16 Jürgen Hötzel <juergen@archlinux.org> (tiny change)
+
+ * eshell/em-unix.el (eshell/mkdir): Handle "--parents" (bug#12897).
+
2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
+ * emacs-lisp/advice.el (ad-make-advised-definition): Improve last fix.
+
* emacs-lisp/cl-lib.el: Set more meaningful version number.
2012-11-16 Martin Rudalics <rudalics@gmx.at>
* faces.el (face-underline-p): Use face-attribute-specified-or.
-2012-11-15 Juanma Barranquero <lekktu@gmail.com>
+2012-11-16 Juanma Barranquero <lekktu@gmail.com>
* emacs-lisp/cl-macs.el (cl-loop, cl-do, cl-do*): Doc fixes.
-2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl-macs.el (cl-flet, cl-flet*): Fix docstring (bug#12895).
-2012-11-15 Glenn Morris <rgm@gnu.org>
+2012-11-16 Glenn Morris <rgm@gnu.org>
* eshell/em-cmpl.el (eshell-pcomplete): New command. (Bug#12838)
(eshell-cmpl-initialize): Bind eshell-pcomplete to TAB, C-i.
* term.el (ansi-term): Don't let C-x escape-char binding
clobber the more standard C-c binding. (Bug#12842)
-2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
-
- * emacs-lisp/gv.el (setf): Fix debug spec for multiple assignments
- (bug#12879).
-
-2012-11-14 Glenn Morris <rgm@gnu.org>
-
* subr.el (set-temporary-overlay-map): Doc fix.
-2012-11-13 Martin Rudalics <rudalics@gmx.at>
+2012-11-16 Martin Rudalics <rudalics@gmx.at>
* window.el (record-window-buffer)
(display-buffer-record-window): When copying the markers to
window-point preserve window-point-insertion-type. (Bug#12588)
-2012-11-13 Glenn Morris <rgm@gnu.org>
+2012-11-16 Glenn Morris <rgm@gnu.org>
* emacs-lisp/eieio-datadebug.el (eieio-debug-methodinvoke):
* net/tramp-gvfs.el (tramp-gvfs-dbus-event-error):
Use new names for hooks rather than obsolete aliases.
-2012-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-15 Daniel Colascione <dancol@dancol.org>
+
+ * term/w32-win.el (w32-handle-dropped-file): Use a "file://"
+ prefix instead of "file:" so that when FILE-NAME begins with "//",
+ as it does when the target file is on a network share, url-handler
+ isn't confused.
+
+2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/advice.el (ad-definition-type): Make sure we don't use
+ a preactivated advice from an old advice.el; they're not compatible!
+
+2012-11-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * emacs-lisp/nadvice.el (advice--make-interactive-form):
+ Fix string-spec case.
+
+ * emacs-lisp/advice.el (ad-make-advised-definition): Fix undefined case.
+
+2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/nadvice.el: Add buffer-local support to add-function.
+ (advice--buffer-local-function-sample): New var.
+ (advice--set-buffer-local, advice--buffer-local): New functions.
+ (add-function, remove-function): Use them.
+
+2012-11-15 Drew Adams <drew.adams@oracle.com>
+
+ * imenu.el (imenu--split-submenus): Use imenu--subalist-p (bug#12717).
+
+2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/cl-macs.el (cl--transform-lambda): Defend against
+ potential binding of print-gensym to t, and prettify (back)quotes in
+ case they appear in args's default values (bug#12884).
+
+2012-11-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/nadvice.el: Add around advice for interactive specs.
+ (advice-eval-interactive-spec): New function.
+ (advice--make-interactive-form): Support around advice (bug#12844).
+
+2012-11-14 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-expr-beg): Make heredoc detection
+ more strict. Add docstring.
+ (ruby-expression-expansion-re): Extract from
+ `ruby-match-expression-expansion'.
+ (ruby-syntax-propertize-function): After everything else, search
+ for expansions in string literals, mark their insides as
+ whitespace syntax and save match data for font-lock.
+ (ruby-font-lock-keywords): Use the 2nd group from expression
+ expansion matches.
+ (ruby-match-expression-expansion): Use the match data saved to the
+ text property in ruby-syntax-propertize-function.
+
+2012-11-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/gv.el (setf): Fix debug spec for multiple assignments
+ (bug#12879).
+
+2012-11-13 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-move-to-block): Looks for a block
+ start/end keyword a bit harder. Works with different values of N.
+ Add more comments.
+ (ruby-end-of-block): Update accordingly.
+
+2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * woman.el (woman-file-name): Don't mess with unread-command-events
+ (bug#12861).
+
+ * emacs-lisp/advice.el: Layer on top of nadvice.el.
+ Remove out of date self-require hack.
+ (ad-do-advised-functions): Use simple `dolist'.
+ (ad-advice-name, ad-advice-protected, ad-advice-enabled)
+ (ad-advice-definition): Redefine as functions.
+ (ad-advice-classes): Move before first use.
+ (ad-make-origname, ad-set-orig-definition, ad-clear-orig-definition)
+ (ad-make-mapped-call, ad-make-advised-docstring,ad-make-plain-docstring)
+ (ad--defalias-fset): Remove functions.
+ (ad-make-advicefunname, ad-clear-advicefunname-definition): New funs.
+ (ad-get-orig-definition): Rewrite.
+ (ad-make-advised-definition-docstring): Change base docstring.
+ (ad-real-orig-definition): Rewrite.
+ (ad-map-arglists): Change name of called function.
+ (ad--make-advised-docstring): Redirect `function' from ad-Advice-...
+ (ad-make-advised-definition): Simplify.
+ (ad-assemble-advised-definition): Tweak for new calling context.
+ (ad-activate-advised-definition): Setup ad-Advice-* i.s.o ad-Orig-*.
+ (ad--defalias-fset): Rename from ad-handle-definition. Make it set the
+ function and call ad-activate if needed.
+ (ad-activate, ad-deactivate): Don't call ad-handle-definition any more.
+ (ad-recover): Clear ad-Advice-* instead of ad-Orig-*.
+ (ad-compile-function): Compile ad-Advice-*.
+ (ad-activate-on-top-level, ad-with-auto-activation-disabled): Remove.
+ (ad-start-advice, ad-stop-advice): Remove.
+
+2012-11-13 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-add-log-current-method): Print the
+ period before class method names, not after. Remove handling of
+ one impossible case. Add comments.
+
+2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/advice.el: Remove support for freezing.
+ (ad-make-freeze-docstring, ad-make-freeze-definition): Remove functions.
+ (ad-make-single-advice-docstring, ad-defadvice-flags, defadvice):
+ Remove support for `freeze'.
+
+ * emacs-lisp/cl.el (dolist, dotimes, declare): Use advice-add to
+ override the default.
+ * emacs-lisp/cl-macs.el (cl-dolist, cl-dotimes): Rewrite without using
+ cl--dotimes/dolist.
+ * subr.el (dolist, dotimes, declare): Redefine them normally, even when
+ `cl' is loaded.
+
+ * emacs-lisp/nadvice.el (advice--normalize): New function, extracted
+ from add-advice.
+ (advice--strip-macro): New function.
+ (advice--defalias-fset): Use them to handle macros.
+ (advice-add): Use them.
+ (advice-member-p): Correctly handle macros.
+
+2012-11-13 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-font-lock-keywords):
+ Never font-lock the beginning of singleton class as heredoc.
+
+2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/gv.el (gv-define-simple-setter): One more fix (bug#12871).
-2012-11-12 Wolfgang Jenkner <wjenkner@inode.at>
+2012-11-13 Wolfgang Jenkner <wjenkner@inode.at>
* ansi-color.el (ansi-color-apply-sequence): Implement SGR codes
- 39 and 49. This fixes bug#12792. Also, treat unimplemented
- parameters as 0, thereby restoring the behavior of revisions prior
- to 2012-08-15T03:33:55Z!monnier@iro.umontreal.ca.
+ 39 and 49 (bug#12792). Also, treat unimplemented parameters as 0,
+ thereby restoring the behavior of revisions prior to 2012-08-15T03:33:55Z!monnier@iro.umontreal.ca.
-2012-11-12 Fabián Ezequiel Gallina <fgallina@cuca>
+2012-11-13 Fabián Ezequiel Gallina <fgallina@cuca>
Fix end-of-defun misbehavior.
* progmodes/python.el (python-nav-beginning-of-defun): Rename from
with new fixed python-nav-{end,beginning}-of-defun. Stop scanning
parent defuns as soon as possible.
-2012-11-12 Glenn Morris <rgm@gnu.org>
+2012-11-13 Glenn Morris <rgm@gnu.org>
* progmodes/flymake.el (flymake-error-bitmap)
(flymake-warning-bitmap, flymake-fringe-indicator-position): Doc fixes.
(flymake-error-bitmap, flymake-warning-bitmap): Fix :types.
-2012-11-12 Dmitry Gutov <dgutov@yandex.ru>
+2012-11-13 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-move-to-block): When moving
backward, always stop at indentation. Reverts the change from
2012-08-12T22:06:56Z!monnier@iro.umontreal.ca (Bug#12851).
-2012-11-11 Glenn Morris <rgm@gnu.org>
+2012-11-13 Glenn Morris <rgm@gnu.org>
* ibuffer.el (ibuffer-mode-map, ibuffer-mode):
Add ibuffer-filter-by-derived-mode.
* window.el (fit-frame-to-buffer, fit-frame-to-buffer-bottom-margin):
* emacs-lisp/debug.el (debugger-bury-or-kill): Fix :version.
-2012-11-10 Leo Liu <sdl.web@gmail.com>
+2012-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
- * ido.el (ido-set-matches-1): Fix split-string args to avoid
- performance issue. (Bug#12796)
+ * emacs-lisp/nadvice.el: New package.
+ * subr.el (special-form-p): New function.
+ * emacs-lisp/elp.el: Use lexical-binding and advice-add.
+ (elp-all-instrumented-list): Remove var.
+ (elp-not-profilable): Remove elp-wrapper.
+ (elp-profilable-p): Use autoloadp and special-form-p.
+ (elp--advice-name): New const.
+ (elp-instrument-function): Use advice-add.
+ (elp--instrumented-p): New predicate.
+ (elp-restore-function): Use advice-remove.
+ (elp-restore-all, elp-reset-all): Use mapatoms.
+ (elp-set-master): Use elp--instrumented-p.
+ (elp--make-wrapper): Rename from elp-wrapper, return a function
+ suitable for advice-add. Use cl-inf.
+ (elp-results): Use mapatoms+elp--instrumented-p.
+ * emacs-lisp/debug.el: Use lexical-binding and advice-add.
+ (debug-function-list): Remove var.
+ (debug): Rename arg, and then let-bind it explicitly inside.
+ (debugger-setup-buffer): Rename arg.
+ (debugger-setup-buffer): Adjust counts to new debug-on-entry setup.
+ (debugger-frame-number): Adjust to new debug-on-entry setup.
+ (debug--implement-debug-on-entry): Rename from
+ implement-debug-on-entry, add argument.
+ (debugger-special-form-p): Remove, use special-form-p instead.
+ (debug-on-entry): Use advice-add.
+ (debug--function-list): New function.
+ (cancel-debug-on-entry): Use it, along with advice-remove.
+ (debug-arglist, debug-convert-byte-code, debug-on-entry-1): Remove.
+ (debugger-list-functions): Use debug--function-list instead of
+ debug-function-list.
+ * emacs-lisp/advice.el (ad-save-real-definition): Remove, unused.
+ (ad-special-form-p): Remove, use special-form-p instead.
+ (ad-set-advice-info): Use add-function and remove-function.
+ (ad--defalias-fset): Adjust accordingly.
2012-11-10 Glenn Morris <rgm@gnu.org>
+ * mail/emacsbug.el (report-emacs-bug-tracker-url)
+ (report-emacs-bug-bug-alist, report-emacs-bug-choice-widget)
+ (report-emacs-bug-create-existing-bugs-buffer)
+ (report-emacs-bug-parse-query-results)
+ (report-emacs-bug-query-existing-bugs): Remove. (Bug#7449)
+
* term.el (term-default-fg-color, term-default-bg-color):
Make obsolete, rather than just saying "deprecated" in the doc.
(term-default-fg-color, term-default-bg-color, term-ansi-reset):
Update all users.
-2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
-
- * server.el (server-create-window-system-frame): Improve comment.
-
-2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
+2012-11-10 Jan Djärv <jan.h.d@swipnet.se>
* server.el (server-create-window-system-frame): Handle Nextstep
specially (Bug#12780).
-2012-11-08 Glenn Morris <rgm@gnu.org>
+2012-11-10 Glenn Morris <rgm@gnu.org>
* mail/emacsbug.el (report-emacs-bug-query-existing-bugs):
Unautoload, and make obsolete. (Bug#7449)
-2012-11-08 Chong Yidong <cyd@gnu.org>
+2012-11-10 Chong Yidong <cyd@gnu.org>
* vc/diff-mode.el (diff-delete-trailing-whitespace): Rewrite, and
rename from diff-remove-trailing-whitespace (Bug#12831).
-2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-10 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/advice.el: Require `cl-lib' at run-time to fix
miscompilation of trace.el.
-2012-11-08 Glenn Morris <rgm@gnu.org>
+2012-11-10 Glenn Morris <rgm@gnu.org>
* vc/diff-mode.el (diff-remove-trailing-whitespace): Doc fix.
-2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-10 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/gv.el (gv-define-simple-setter): Fix last change
(bug#12812).
-2012-11-07 Chong Yidong <cyd@gnu.org>
+2012-11-10 Chong Yidong <cyd@gnu.org>
* minibuf-eldef.el (minibuffer-eldef-shorten-default): Convert to
a defcustom with an appropriate :set function.
(minibuffer-default--in-prompt-regexps): New function.
-2012-11-07 Glenn Morris <rgm@gnu.org>
+2012-11-10 Glenn Morris <rgm@gnu.org>
* emacs-lisp/cl.el (define-setf-expander, defsetf)
(define-modify-macro): Doc fixes.
* emacs-lisp/gv.el (gv-letplace): Fix doc typo.
(gv-define-simple-setter): Update doc of `fix-return'.
-2012-11-07 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-10 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/gv.el (gv-define-simple-setter): Don't evaluate `val'
twice when `fix-return' is set (bug#12813).
* emacs-lisp/cl.el (defsetf): Pass the third arg to
gv-define-simple-setter (bug#12812).
-2012-11-06 Stefan Monnier <monnier@iro.umontreal.ca>
-
* woman.el (woman-decode-region): Disable adaptive-fill when rendering
(bug#12756).
-2012-11-06 Glenn Morris <rgm@gnu.org>
+2012-11-10 Glenn Morris <rgm@gnu.org>
* emacs-lisp/gv.el (gv-define-setter): Fix doc typo.
-2012-11-05 Glenn Morris <rgm@gnu.org>
-
* emacs-lisp/cl-extra.el (cl-prettyexpand):
* emacs-lisp/cl-lib.el (cl-proclaim, cl-declaim):
* emacs-lisp/cl-macs.el (cl-destructuring-bind, cl-locally)
* emacs-lisp/cl-extra.el (cl-maplist, cl-mapcan): Doc fix.
+2012-11-10 Leo Liu <sdl.web@gmail.com>
+
+ * ido.el (ido-set-matches-1): Improve flex matching performance by
+ removing backtracking in the regexp (suggested by Stefan). (Bug#12796)
+
+2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/advice.el (ad-set-advice-info): Set defalias-fset-function.
+ (ad--defalias-fset): New function.
+ (ad-safe-fset): Remove.
+ (ad-make-freeze-definition): Use cl-letf*.
+
+2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * subr.el (dolist): Don't bind VAR in RESULT.
+
+ * emacs-lisp/advice.el: Miscellaneous cleanup. Use lexical-binding.
+ (fset, documentation): Don't save real def since we don't advise.
+ (ad-do-advised-functions): Remove problematic `result-form'.
+ (ad-safe-fset): `ad-real-fset' => `fset'.
+ (ad-read-advised-function): Don't assume that ad-do-advised-functions
+ uses CL's dolist internally.
+ (ad-arglist): Remove unused arg `name'.
+ (ad-docstring, ad-make-advised-docstring):
+ `ad-real-documentation' => `documentation'.
+ (warning-suppress-types): Declare.
+ (ad-set-arguments): Simple CSE.
+ (ad-recover-normality): Sanity check.
+
+ * emacs-lisp/bytecomp.el (byte-compile-out-toplevel): Don't turn
+ (funcall '(lambda ..) ..) into ((lambda ..) ..).
+
+2012-11-09 Vincent Belaïche <vincentb1@users.sourceforge.net>
+
+ * ses.el: symbol to coordinate mapping is made by symbol property
+ `ses-cell'. This means that the same mapping is done for all SES
+ sheets. That is good enough for cells with standard A1 names, but
+ not for named cell. So a hash map is added for the latter.
+ (defconst ses-localvars): Add local variable ses--named-cell-hashmap
+ (ses-sym-rowcol): Use hashmap for named cell.
+ (ses-is-cell-sym-p): New defun.
+ (ses-decode-cell-symbol): New defun.
+ (ses-create-cell-variable): Add cell to hashmap when name is not
+ A1-like.
+ (ses-rename-cell): Check that cell new name is not already in
+ spreadsheet with the use of ses-is-cell-sym-p
+ (ses-rename-cell): Use hash map for named cells, but accept also
+ renaming back to A1-like.
+
+2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/advice.el: Use new dynamic docstrings.
+ (ad-make-advised-definition-docstring, ad-advised-definition-p):
+ Use dynamic-docstring-function instead of ad-advice-info.
+ (ad--make-advised-docstring): New function extracted from
+ ad-make-advised-docstring.
+ (ad-make-advised-docstring): Use it.
+ * progmodes/sql.el (sql--make-help-docstring): New function, extracted
+ from sql-help.
+ (sql-help): Use it with dynamic-docstring-function.
+
+ * env.el (env--substitute-vars-regexp): Don't use rx (for bootstrap).
+
+2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * files.el (hack-one-local-variable--obsolete): New function.
+ (hack-one-local-variable): Use it for obsolete settings.
+
+ * subr.el (locate-user-emacs-file): If both old and new name exist, use
+ the new name.
+
+ * progmodes/js.el (js--filling-paragraph): New var.
+ (c-forward-sws, c-backward-sws, c-beginning-of-macro): Advise.
+ (js-c-fill-paragraph): Prefer advice to cl-letf so the rebinding is
+ less sneaky.
+
+2012-11-08 Julien Danjou <julien@danjou.info>
+
+ * progmodes/ruby-mode.el (auto-mode-alist): Add Rakefile in
+ `auto-mode-alist' (Bug#12835).
+
+2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/perl-mode.el (perl-prettify-symbols): New defcustom.
+ (perl--prettify-symbols-alist): New const.
+ (perl--font-lock-compose-symbol, perl--font-lock-symbols-keywords):
+ New functions.
+ (perl-font-lock-keywords-2): Use them.
+ (perl-electric-noindent-p): New function.
+ (perl-mode): Use it to set up electric-indent-mode.
+ (perl-electric-terminator, perl-indent-command): Mark obsolete.
+ (perl-mode-map): Remove bindings for them.
+ (perl-imenu-generic-expression, perl-outline-level):
+ Match functions&packages in column>0.
+
+ * env.el (env--substitute-vars-regexp): New const.
+ (substitute-env-vars): Use it. Add `only-defined' arg.
+ * net/tramp.el (tramp-replace-environment-variables): Use it.
+
+ * emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
+ Byte-compile *before* eval in eval-and-compile.
+ (byte-compile-log-warning): Remove redundant inhibit-read-only.
+ (byte-compile-file-form-autoload): Don't hide actual definition.
+ (byte-compile-maybe-guarded): Accept `functionp' as well.
+
+ * emacs-lisp/gv.el (gv-ref, gv-deref): New function and macro.
+
+2012-11-07 Michael Albinus <michael.albinus@gmx.de>
+
+ * notifications.el (notifications-get-server-information-method):
+ New defconst.
+ (notifications-get-capabilities): Fix docstring.
+ (notifications-get-server-information): New defun.
+
+2012-11-06 Agustín Martín Domingo <agustin.martin@hispalinux.es>
+
+ * textmodes/ispell.el (ispell-region): Standard re-indent for better
+ readability.
+
+ * textmodes/ispell.el: Experimental support for support debugging.
+ (ispell-create-debug-buffer): Create a `ispell-debug-buffer' debug
+ buffer for ispell.
+ (ispell-print-if-debug): New function to print stuff to
+ `ispell-debug-buffer' if debugging is enabled.
+ (ispell-region, ispell-process-line): Use `ispell-print-if-debug' to
+ show some debugging info.
+ (ispell-buffer-with-debug): New function that creates a debugging
+ buffer and calls `ispell-buffer' with debugging enabled.
+
+ * textmodes/ispell.el (ispell-region): Do not prefix sent string by
+ comment in autoconf mode. (Bug#12768)
+
+2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * emacs-lisp/byte-opt.el (toplevel): Add compare-window-configurations,
+ frame-first-window, frame-root-window, frame-selected-window,
+ minibuffer-selected-window, minibuffer-window,
+ window-absolute-pixel-edges, window-at, window-body-height,
+ window-body-width, window-display-table, window-combination-limit,
+ window-frame, window-fringes, window-inside-absolute-pixel-edges,
+ window-inside-edges, window-inside-pixel-edges, window-left-child,
+ window-left-column, window-margins, window-next-buffers,
+ window-next-sibling, window-new-normal, window-new-total,
+ window-normal-size, window-parameter, window-parameters, window-parent,
+ window-pixel-edges, window-point, window-prev-buffers,
+ window-prev-sibling, window-redisplay-end-trigger, window-scroll-bars,
+ window-start, window-text-height, window-top-child, window-top-line,
+ window-total-height, window-total-width and window-use-time to the list
+ of functions without side-effects.
+ (toplevel): Add window-valid-p to the list of error-free functions
+ without side-effects.
+
+2012-11-05 Agustín Martín Domingo <agustin.martin@hispalinux.es>
+
+ * textmodes/ispell.el (ispell-program-name):
+ Update spellchecker parameters when customized.
+
+2012-11-04 Glenn Morris <rgm@gnu.org>
+
+ * vc/vc-svn.el (vc-svn-state-heuristic): Avoid calling svn. (Bug#7850)
+
+2012-11-04 Chong Yidong <cyd@gnu.org>
+
+ * bookmark.el (bookmark-bmenu-switch-other-window): Avoid binding
+ same-window-* variables.
+
+2012-11-04 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-help-for-help, isearch-describe-bindings)
+ (isearch-describe-key, isearch-describe-mode): Use a display
+ action instead of binding same-window-* variables (Bug#10040).
+
2012-11-03 Glenn Morris <rgm@gnu.org>
* emacs-lisp/cl-macs.el (cl-parse-loop-clause):
* window.el (switch-to-visible-buffer)
(switch-to-buffer-preserve-window-point): Fix doc-strings.
+2012-11-03 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/cl-lib.el (cl--random-time):
+ Rename from cl-random-time. (Bug#12773)
+ (cl--gensym-counter, cl--random-state): Update callers.
+ * emacs-lisp/cl-extra.el (cl-make-random-state): Update callers.
+
+2012-11-03 Chong Yidong <cyd@gnu.org>
+
+ * cus-start.el: Make cursor-type customizable (Bug#11633).
+
+2012-11-02 Glenn Morris <rgm@gnu.org>
+
+ * filecache.el: No need to load find-lisp when compiling.
+ (find-lisp-find-files): Autoload it.
+ (file-cache-add-directory-recursively): Don't require find-lisp.
+
+ * image.el (image-type-from-file-name): Trivial simplification.
+
+ * emacs-lisp/bytecomp.el (byte-compile-eval):
+ Decouple "noruntime" and "cl-functions" warnings.
+
2012-11-01 Stephen Berman <stephen.berman@gmx.net>
* play/gomoku.el (gomoku-display-statistics): Update mode line
2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
* minibuffer.el (minibuffer-force-complete): Make the next completion use
- the same completion-field (bug@12221).
+ the same completion-field (bug#12221).
2012-10-19 Martin Rudalics <rudalics@gmx.at>
2012-03-16 Alan Mackenzie <acm@muc.de>
- Further optimise the handling of large macros.
+ Further optimize the handling of large macros.
* progmodes/cc-engine.el (c-crosses-statement-barrier-p): Use a
limit to a call of `c-literal-limits'.
* dynamic-setting.el (font-setting-change-default-font): Don't
change the default face if SET-FONT argument is non-nil (Bug#9982).
-2012-01-29 Samuel Bronson <naesten@gmail.com> (tiny change)
+2012-01-29 Samuel Bronson <naesten@gmail.com>
* custom.el (defcustom): Add doc link to Lisp manual (Bug#10635).
2012-01-08 Alan Mackenzie <acm@muc.de>
- Optimise font locking in long enum definitions.
+ Optimize font locking in long enum definitions.
* progmodes/cc-fonts.el (c-font-lock-declarations): Add an extra
arm to a cond form to handle enums.
(ert-run-tests-batch, ert--print-test-for-ewoc):
Handle `ert-test-quit'.
-2011-03-03 David Abrahams <dave@boostpro.com> (tiny change)
+2011-03-03 David Abrahams <dave@boostpro.com>
* vc/ediff-init.el (ediff-use-faces, ediff-highlight-all-diffs):
Move ediff-defvar-local calls after defcustoms. (Bug#1821)
Remember the buffers at head, rather than their name.
* iswitchb.el (iswitchb-kill-buffer): Re-make the list.
-2010-08-22 Kirk Kelsey <kirk.kelsey@0x4b.net> (tiny change)
+2010-08-22 Kirk Kelsey <kirk.kelsey@0x4b.net>
Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/make-mode.el (makefile-fill-paragraph): Account for the
* textmodes/artist.el (artist-compute-popup-menu-table):
Remove duplicated words in doc-strings.
-2010-01-15 David Abrahams <dave@boostpro.com> (tiny change)
+2010-01-15 David Abrahams <dave@boostpro.com>
* net/mairix.el (mairix-widget-send-query): Send -1 instead of nil
to mairix-search to suppress threading (Bug#5342).
# an own subdirectory. OTOH, it does not hurt to keep them in
# lisp/net.
TRAMP_DIR = $(lisp)/net
-TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-cache.el \
- $(TRAMP_DIR)/tramp-cmds.el $(TRAMP_DIR)/tramp-compat.el \
- $(TRAMP_DIR)/tramp-ftp.el $(TRAMP_DIR)/tramp-gvfs.el \
- $(TRAMP_DIR)/tramp-gw.el $(TRAMP_DIR)/tramp-sh.el \
- $(TRAMP_DIR)/tramp-smb.el $(TRAMP_DIR)/tramp-uu.el \
- $(TRAMP_DIR)/trampver.el
+TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \
+ $(TRAMP_DIR)/tramp-cache.el $(TRAMP_DIR)/tramp-cmds.el \
+ $(TRAMP_DIR)/tramp-compat.el $(TRAMP_DIR)/tramp-ftp.el \
+ $(TRAMP_DIR)/tramp-gvfs.el $(TRAMP_DIR)/tramp-gw.el \
+ $(TRAMP_DIR)/tramp-sh.el $(TRAMP_DIR)/tramp-smb.el \
+ $(TRAMP_DIR)/tramp-uu.el $(TRAMP_DIR)/trampver.el
$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
$(emacs) -l autoload \
(defmacro allout-called-interactively-p ()
"A version of `called-interactively-p' independent of Emacs version."
;; ... to ease maintenance of allout without betraying deprecation.
- (if (equal (subr-arity (symbol-function 'called-interactively-p))
- '(0 . 0))
- '(called-interactively-p)
- '(called-interactively-p 'interactive)))
+ (if (ignore-errors (called-interactively-p 'interactive) t)
+ '(called-interactively-p 'interactive)
+ '(called-interactively-p)))
;;;_ = allout-inhibit-aberrance-doublecheck nil
;; In some exceptional moments, disparate topic depths need to be allowed
;; momentarily, eg when one topic is being yanked into another and they're
"Non nil means apropos commands will search more extensively.
This may be slower. This option affects the following commands:
-`apropos-variable' will search all variables, not just user variables.
+`apropos-user-option' will search all variables, not just user options.
`apropos-command' will also search non-interactive functions.
`apropos' will search all symbols, not just functions, variables, faces,
and those with property lists.
:group 'apropos
:version "24.3")
+(defface apropos-user-option-button
+ '((t (:inherit (font-lock-variable-name-face button))))
+ "Button face indicating a user option in Apropos."
+ :group 'apropos
+ :version "24.4")
+
(defface apropos-misc-button
'((t (:inherit (font-lock-constant-face button))))
"Button face indicating a miscellaneous object type in Apropos."
'action (lambda (button)
(describe-variable (button-get button 'apropos-symbol))))
+(define-button-type 'apropos-user-option
+ 'apropos-label "User option"
+ 'apropos-short-label "o"
+ 'face 'apropos-user-option-button
+ 'help-echo "mouse-2, RET: Display more help on this user option"
+ 'follow-link t
+ 'action (lambda (button)
+ (describe-variable (button-get button 'apropos-symbol))))
+
(define-button-type 'apropos-face
'apropos-label "Face"
'apropos-short-label "F"
This is used to decide whether to print the result's type or not.")
;;;###autoload
-(defun apropos-variable (pattern &optional do-all)
- "Show user variables that match PATTERN.
+(defun apropos-user-option (pattern &optional do-all)
+ "Show user options that match PATTERN.
PATTERN can be a word, a list of words (separated by spaces),
or a regexp (using some regexp special characters). If it is a word,
search for matches for that word as a substring. If it is a list of words,
search for matches for any two (or more) of those words.
With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, also show
-normal variables."
+variables, not just user options."
(interactive (list (apropos-read-pattern
(if (or current-prefix-arg apropos-do-all)
"variable" "user option"))
(get symbol 'variable-documentation)))
'custom-variable-p)))
+;;;###autoload
+(defun apropos-variable (pattern &optional do-not-all)
+ "Show variables that match PATTERN.
+When DO-NOT-ALL is not-nil, show user options only, i.e. behave
+like `apropos-user-option'."
+ (interactive (list (apropos-read-pattern
+ (if current-prefix-arg "user option" "variable"))
+ current-prefix-arg))
+ (let ((apropos-do-all (if do-not-all nil t)))
+ (apropos-user-option pattern)))
+
;; For auld lang syne:
;;;###autoload
(defalias 'command-apropos 'apropos-command)
'apropos-macro
'apropos-function))
(not nosubst))
- (apropos-print-doc 3 'apropos-variable (not nosubst))
+ (apropos-print-doc 3
+ (if (custom-variable-p symbol)
+ 'apropos-user-option
+ 'apropos-variable)
+ (not nosubst))
(apropos-print-doc 7 'apropos-group t)
(apropos-print-doc 6 'apropos-face t)
(apropos-print-doc 5 'apropos-widget t)
(directory-files "/sys/class/power_supply/" nil
battery--linux-sysfs-regexp))
'battery-linux-sysfs)
+ ((and (eq system-type 'berkeley-unix)
+ (file-executable-p "/usr/sbin/apm"))
+ 'battery-bsd-apm)
((and (eq system-type 'darwin)
(condition-case nil
(with-temp-buffer
"AC"
"BAT")
"N/A")))))
+
+\f
+;;; `apm' interface for BSD.
+(defun battery-bsd-apm ()
+ "Get APM status information from BSD apm binary.
+The following %-sequences are provided:
+%L AC line status (verbose)
+%B Battery status (verbose)
+%b Battery status, empty means high, `-' means low,
+ `!' means critical, and `+' means charging
+%P Advanced power saving mode state (verbose)
+%p Battery charge percentage
+%s Remaining battery charge time in seconds
+%m Remaining battery charge time in minutes
+%h Remaining battery charge time in hours
+%t Remaining battery charge time in the form `h:min'"
+ (let* ((os-name (car (split-string
+ (shell-command-to-string "/usr/bin/uname"))))
+ (apm-flag (if (equal os-name "OpenBSD") "P" "s"))
+ (apm-cmd (concat "/usr/sbin/apm -ablm" apm-flag))
+ (apm-output (split-string (shell-command-to-string apm-cmd)))
+ ;; Battery status
+ (battery-status
+ (let ((stat (string-to-number (nth 0 apm-output))))
+ (cond ((eq stat 0) '("high" . ""))
+ ((eq stat 1) '("low" . "-"))
+ ((eq stat 2) '("critical" . "!"))
+ ((eq stat 3) '("charging" . "+"))
+ ((eq stat 4) '("absent" . nil)))))
+ ;; Battery percentage
+ (battery-percentage (nth 1 apm-output))
+ ;; Battery life
+ (battery-life (nth 2 apm-output))
+ ;; AC status
+ (line-status
+ (let ((ac (string-to-number (nth 3 apm-output))))
+ (cond ((eq ac 0) "disconnected")
+ ((eq ac 1) "connected")
+ ((eq ac 2) "backup power"))))
+ ;; Advanced power savings mode
+ (apm-mode
+ (let ((apm (string-to-number (nth 4 apm-output))))
+ (if (string= os-name "OpenBSD")
+ (cond ((eq apm 0) "manual")
+ ((eq apm 1) "automatic")
+ ((eq apm 2) "cool running"))
+ (if (eq apm 1) "on" "off"))))
+ seconds minutes hours remaining-time)
+ (unless (member battery-life '("unknown" "-1"))
+ (if (member os-name '("OpenBSD" "NetBSD"))
+ (setq minutes (string-to-number battery-life)
+ seconds (* 60 minutes))
+ (setq seconds (string-to-number battery-life)
+ minutes (truncate (/ seconds 60))))
+ (setq hours (truncate (/ minutes 60))
+ remaining-time (format "%d:%02d" hours
+ (- minutes (* 60 hours)))))
+ (list (cons ?L (or line-status "N/A"))
+ (cons ?B (or (car battery-status) "N/A"))
+ (cons ?b (or (cdr battery-status) "N/A"))
+ (cons ?p (if (string= battery-percentage "255")
+ "N/A"
+ battery-percentage))
+ (cons ?P (or apm-mode "N/A"))
+ (cons ?s (or (and seconds (number-to-string seconds)) "N/A"))
+ (cons ?m (or (and minutes (number-to-string minutes)) "N/A"))
+ (cons ?h (or (and hours (number-to-string hours)) "N/A"))
+ (cons ?t (or remaining-time "N/A")))))
+
\f
;;; `pmset' interface for Darwin (OS X).
The current window remains selected."
(interactive)
(let ((bookmark (bookmark-bmenu-bookmark))
- (pop-up-windows t)
- same-window-buffer-names
- same-window-regexps)
- (bookmark--jump-via bookmark 'display-buffer)))
+ (fun (lambda (b) (display-buffer b t))))
+ (bookmark--jump-via bookmark fun)))
(defun bookmark-bmenu-other-window-with-mouse (event)
"Select bookmark at the mouse pointer in other window, leaving bookmark menu visible."
;; might get converted to ^M when building loaddefs.el
(define-key map [(control ?m)] 'push-button)
(define-key map [mouse-2] 'push-button)
+ ;; FIXME: You'd think that for keymaps coming from text-properties on the
+ ;; mode-line or header-line, the `mode-line' or `header-line' prefix
+ ;; shouldn't be necessary!
+ (define-key map [mode-line mouse-2] 'push-button)
+ (define-key map [header-line mouse-2] 'push-button)
map)
"Keymap used by buttons.")
(defun button-get (button prop)
"Get the property of button BUTTON named PROP."
- (if (overlayp button)
- (overlay-get button prop)
- ;; Must be a text-property button.
- (get-text-property button prop)))
+ (cond ((overlayp button)
+ (overlay-get button prop))
+ ((button--area-button-p button)
+ (get-text-property (cdr button)
+ prop (button--area-button-string button)))
+ (t ; Must be a text-property button.
+ (get-text-property button prop))))
(defun button-put (button prop val)
"Set BUTTON's PROP property to VAL."
;; Disallow updating the `category' property directly.
(error "Button `category' property may not be set directly")))
;; Add the property.
- (if (overlayp button)
- (overlay-put button prop val)
- ;; Must be a text-property button.
- (put-text-property
- (or (previous-single-property-change (1+ button) 'button)
- (point-min))
- (or (next-single-property-change button 'button)
- (point-max))
- prop val)))
-
-(defsubst button-activate (button &optional use-mouse-action)
+ (cond ((overlayp button)
+ (overlay-put button prop val))
+ ((button--area-button-p button)
+ (setq button (button--area-button-string button))
+ (put-text-property 0 (length button) prop val button))
+ (t ; Must be a text-property button.
+ (put-text-property
+ (or (previous-single-property-change (1+ button) 'button)
+ (point-min))
+ (or (next-single-property-change button 'button)
+ (point-max))
+ prop val))))
+
+(defun button-activate (button &optional use-mouse-action)
"Call BUTTON's action property.
If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action
instead of its normal action; if the button has no mouse-action,
-the normal action is used instead."
+the normal action is used instead.
+
+The action can either be a marker or a function. If it's a
+marker then goto it. Otherwise it it is a function then it is
+called with BUTTON as only argument. BUTTON is either an
+overlay, a buffer position, or (for buttons in the mode-line or
+header-line) a string."
(let ((action (or (and use-mouse-action (button-get button 'mouse-action))
(button-get button 'action))))
(if (markerp action)
(defun button-label (button)
"Return BUTTON's text label."
- (buffer-substring-no-properties (button-start button) (button-end button)))
+ (if (button--area-button-p button)
+ (substring-no-properties (button--area-button-string button))
+ (buffer-substring-no-properties (button-start button)
+ (button-end button))))
(defsubst button-type (button)
"Return BUTTON's button-type."
"Return t if BUTTON has button-type TYPE, or one of TYPE's subtypes."
(button-type-subtype-p (button-get button 'type) type))
+(defun button--area-button-p (b)
+ "Return non-nil if BUTTON is an area button.
+Such area buttons are used for buttons in the mode-line and header-line."
+ (stringp (car-safe b)))
+
+(defalias 'button--area-button-string #'car
+ "Return area button BUTTON's button-string.")
\f
;; Creating overlay buttons
(cons 'button (cons (list t) properties))
object)
;; Return something that can be used to get at the button.
- beg))
+ (or object beg)))
(defun insert-text-button (label &rest properties)
"Insert a button with the label LABEL.
USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action
instead of its normal action; if the button has no mouse-action,
the normal action is used instead. The action may be either a
-function to call or a marker to display.
+function to call or a marker to display and is invoked using
+`button-activate' (which see).
+
POS defaults to point, except when `push-button' is invoked
interactively as the result of a mouse-event, in which case, the
mouse event is used.
;; POS is a mouse event; switch to the proper window/buffer
(let ((posn (event-start pos)))
(with-current-buffer (window-buffer (posn-window posn))
- (push-button (posn-point posn) t)))
+ (if (posn-string posn)
+ ;; mode-line, header-line, or display string event.
+ (button-activate (posn-string posn) t)
+ (push-button (posn-point posn)) t)))
;; POS is just normal position
(let ((button (button-at (or pos (point)))))
- (if (not button)
- nil
+ (when button
(button-activate button use-mouse-action)
t))))
Summary of changes to "Calc"
------- -- ------- -- ----
+Emacs 24.4
+
+* The date forms use the Gregorian calendar for all dates.
+ (Previously they were a combination of Julian and Gregorian
+ dates.) This can be configured with the customizable variable
+ `calc-gregorian-switch'.
+
+* Support for ISO 8601 dates added.
Emacs 24.3
-Algebraic simplification mode is now the default.
-To restrict to the limited simplifications given by the former
-default simplification mode, use `m I'.
+* Algebraic simplification mode is now the default.
+ To restrict to the limited simplifications given by the former
+ default simplification mode, use `m I'.
Emacs 24.1
(calc-wrapper
(if (string-match-p "\\`\\s-*\\'" fmt)
(setq fmt "1"))
- (if (string-match "\\` *[0-9] *\\'" fmt)
+ (if (string-match "\\` *\\([0-9]\\|10\\|11\\) *\\'" fmt)
(setq fmt (nth (string-to-number fmt) calc-standard-date-formats)))
(or (string-match "[a-zA-Z]" fmt)
(error "Bad date format specifier"))
(and arg
(>= (setq arg (prefix-numeric-value arg)) 0)
- (<= arg 9)
+ (<= arg 11)
(setq calc-standard-date-formats
(copy-sequence calc-standard-date-formats))
(setcar (nthcdr arg calc-standard-date-formats) fmt))
(let ((case-fold-search nil))
(and (not (string-match "<.*>" fmt))
- (string-match "\\`[^hHspP]*\\([^ac-gi-lnoqrt-zAC-GI-OQRT-Z]*[bBhHmpPsS]+[^ac-gi-lnoqrt-zAC-GI-OQRT-Z]*\\)[^hHspP]*\\'" fmt)
+ ;; Find time part to put in <...>
+ (string-match "\\`[^hHspPT]*\\([^ac-gi-lnoqrt-zAC-GI-OQRU-Z]*\\(bs\\|bm\\|bh\\|BS\\|BH\\|[hHmpPsST]\\)+[^ac-gi-lnoqrt-zAC-GI-OQRU-Z]*\\)[^hHspPT]*\\'" fmt)
(string-match (concat "[^ac-gi-lnoqrt-zAC-GI-OQRT-Z]*"
(regexp-quote (math-match-substring fmt 1))
"[^ac-gi-lnoqrt-zAC-GI-OQRT-Z]*") fmt)
lfmt nil))
(setq time nil))
(t
- (if (string-match "\\`[^a-zA-Z]*[bB][a-zA-Z]" fmt)
+ (if (string-match "\\`[^a-zA-Z]*[bBZI][a-zA-Z]" fmt)
(setq pos2 (1+ pos2)))
(while (and (< pos2 (length fmt))
(= (upcase (aref fmt pos2))
(setq pos2 (1+ pos2)))
(setq sym (intern (substring fmt pos pos2)))
(or (memq sym '(Y YY BY YYY YYYY
+ ZYYY IYYY Iww w
aa AA aaa AAA aaaa AAAA
bb BB bbb BBB bbbb BBBB
M MM BM mmm Mmm Mmmm MMM MMMM
W www Www Wwww WWW WWWW
h hh bh H HH BH
p P pp PP pppp PPPP
- m mm bm s ss bss SS BS C
- N n J j U b))
+ m mm bm s ss bs SS BS C
+ N n J j U b T))
(and (eq sym 'X) (not lfmt) (not fullfmt))
(error "Bad format code: %s" sym))
(and (memq sym '(bb BB bbb BBB bbbb BBBB))
;;; Some of these functions are adapted from Edward Reingold's "calendar.el".
;;; These versions are rewritten to use arbitrary-size integers.
-;;; The Julian calendar is used up to 9/2/1752, after which the Gregorian
-;;; calendar is used; the first day after 9/2/1752 is 9/14/1752.
;;; A numerical date is the number of days since midnight on
-;;; the morning of January 1, 1 A.D. If the date is a non-integer,
-;;; it represents a specific date and time.
+;;; the morning of December 31, 1 B.C. (Gregorian) or January 2, 1 A.D. (Julian).
+;;; Emacs's calendar refers to such a date as an absolute date, some Calc function
+;;; names also use that terminology. If the date is a non-integer, it represents
+;;; a specific date and time.
;;; A "dt" is a list of the form, (year month day), corresponding to
;;; an integer code, or (year month day hour minute second), corresponding
;;; to a non-integer code.
+(defun math-date-to-gregorian-dt (date)
+ "Return the day (YEAR MONTH DAY) in the Gregorian calendar.
+DATE is the number of days since December 31, -1 in the Gregorian calendar."
+ (let* ((month 1)
+ day
+ (year (math-quotient (math-add date (if (Math-lessp date 711859)
+ 365 ; for speed, we take
+ -108)) ; >1950 as a special case
+ (if (math-negp date) 366 365)))
+ ; this result may be an overestimate
+ temp)
+ (while (Math-lessp date (setq temp (math-absolute-from-gregorian-dt year 1 1)))
+ (setq year (math-add year -1)))
+ (if (eq year 0) (setq year -1))
+ (setq date (1+ (math-sub date temp)))
+ (setq temp
+ (if (math-leap-year-p year)
+ [1 32 61 92 122 153 183 214 245 275 306 336 999]
+ [1 32 60 91 121 152 182 213 244 274 305 335 999]))
+ (while (>= date (aref temp month))
+ (setq month (1+ month)))
+ (setq day (1+ (- date (aref temp (1- month)))))
+ (list year month day)))
+
+(defun math-date-to-julian-dt (date)
+ "Return the day (YEAR MONTH DAY) in the Julian calendar.
+DATE is the number of days since December 31, -1 in the Gregorian calendar."
+ (let* ((month 1)
+ day
+ (year (math-quotient (math-add date (if (Math-lessp date 711859)
+ 367 ; for speed, we take
+ -106)) ; >1950 as a special case
+ (if (math-negp date) 366 365)))
+ ; this result may be an overestimate
+ temp)
+ (while (Math-lessp date (setq temp (math-absolute-from-julian-dt year 1 1)))
+ (setq year (math-add year -1)))
+ (if (eq year 0) (setq year -1))
+ (setq date (1+ (math-sub date temp)))
+ (setq temp
+ (if (math-leap-year-p year t)
+ [1 32 61 92 122 153 183 214 245 275 306 336 999]
+ [1 32 60 91 121 152 182 213 244 274 305 335 999]))
+ (while (>= date (aref temp month))
+ (setq month (1+ month)))
+ (setq day (1+ (- date (aref temp (1- month)))))
+ (list year month day)))
+
(defun math-date-to-dt (value)
+ "Return the day and time of VALUE.
+The integer part of VALUE is the number of days since Dec 31, -1
+in the Gregorian calendar and the remaining part determines the time."
(if (eq (car-safe value) 'date)
(setq value (nth 1 value)))
(or (math-realp value)
(let* ((parts (math-date-parts value))
(date (car parts))
(time (nth 1 parts))
- (month 1)
- day
- (year (math-quotient (math-add date (if (Math-lessp date 711859)
- 365 ; for speed, we take
- -108)) ; >1950 as a special case
- (if (math-negp value) 366 365)))
- ; this result may be an overestimate
- temp)
- (while (Math-lessp date (setq temp (math-absolute-from-date year 1 1)))
- (setq year (math-add year -1)))
- (if (eq year 0) (setq year -1))
- (setq date (1+ (math-sub date temp)))
- (and (eq year 1752) (>= date 247)
- (setq date (+ date 11)))
- (setq temp (if (math-leap-year-p year)
- [1 32 61 92 122 153 183 214 245 275 306 336 999]
- [1 32 60 91 121 152 182 213 244 274 305 335 999]))
- (while (>= date (aref temp month))
- (setq month (1+ month)))
- (setq day (1+ (- date (aref temp (1- month)))))
+ (dt (if (and calc-gregorian-switch
+ (Math-lessp value
+ (or
+ (nth 3 calc-gregorian-switch)
+ (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch))
+))
+ (math-date-to-julian-dt date)
+ (math-date-to-gregorian-dt date))))
(if (math-integerp value)
- (list year month day)
- (list year month day
- (/ time 3600)
- (% (/ time 60) 60)
- (math-add (% time 60) (nth 2 parts))))))
+ dt
+ (append dt
+ (list
+ (/ time 3600)
+ (% (/ time 60) 60)
+ (math-add (% time 60) (nth 2 parts)))))))
+
+(defun math-date-to-iso-dt (date)
+ "Return the ISO8601 date (year week day) of DATE."
+ (unless (Math-integerp date)
+ (setq date (math-floor date)))
+ (let* ((approx (nth 0 (math-date-to-gregorian-dt (math-sub date 3))))
+ (year (math-add approx
+ (let ((y approx)
+ (sum 0))
+ (while (>= (math-compare date
+ (math-absolute-from-iso-dt (setq y (math-add y 1)) 1 1)) 0)
+ (setq sum (+ sum 1)))
+ sum))))
+ (list
+ year
+ (math-add (car (math-idivmod
+ (math-sub date (math-absolute-from-iso-dt year 1 1))
+ 7))
+ 1)
+ (let ((day (calcFunc-mod date 7)))
+ (if (= day 0) 7 day)))))
(defun math-dt-to-date (dt)
(or (integerp (nth 1 dt))
(math-reject-arg (nth 2 dt) 'fixnump))
(if (or (< (nth 2 dt) 1) (> (nth 2 dt) 31))
(math-reject-arg (nth 2 dt) "Day value is out of range"))
- (let ((date (math-absolute-from-date (car dt) (nth 1 dt) (nth 2 dt))))
+ (let ((date (math-absolute-from-dt (car dt) (nth 1 dt) (nth 2 dt))))
+ (if (nth 3 dt)
+ (math-add (math-float date)
+ (math-div (math-add (+ (* (nth 3 dt) 3600)
+ (* (nth 4 dt) 60))
+ (nth 5 dt))
+ '(float 864 2)))
+ date)))
+
+(defun math-iso-dt-to-date (dt)
+ (let ((date (math-absolute-from-iso-dt (car dt) (nth 1 dt) (nth 2 dt))))
(if (nth 3 dt)
(math-add (math-float date)
(math-div (math-add (+ (* (nth 3 dt) 3600)
(defun math-this-year ()
(nth 5 (decode-time)))
-(defun math-leap-year-p (year)
- (if (Math-lessp year 1752)
+(defun math-leap-year-p (year &optional julian)
+ "Non-nil if YEAR is a leap year.
+If JULIAN is non-nil, then use the criterion for leap years
+in the Julian calendar, otherwise use the criterion in the
+Gregorian calendar."
+ (if julian
(if (math-negp year)
(= (math-imod (math-neg year) 4) 1)
(= (math-imod year 4) 0))
+ (if (math-negp year)
+ (setq year (math-sub -1 year)))
(setq year (math-imod year 400))
(or (and (= (% year 4) 0) (/= (% year 100) 0))
(= year 0))))
29
(aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month))))
-(defun math-day-number (year month day)
+(defun math-day-in-year (year month day &optional julian)
+ "Return the number of days of the year up to YEAR MONTH DAY.
+The count includes the given date.
+If JULIAN is non-nil, use the Julian calendar, otherwise
+use the Gregorian calendar."
(let ((day-of-year (+ day (* 31 (1- month)))))
(if (> month 2)
(progn
(setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10)))
- (if (math-leap-year-p year)
+ (if (math-leap-year-p year julian)
(setq day-of-year (1+ day-of-year)))))
- (and (eq year 1752)
- (or (> month 9)
- (and (= month 9) (>= day 14)))
- (setq day-of-year (- day-of-year 11)))
day-of-year))
-(defun math-absolute-from-date (year month day)
+(defun math-day-number (year month day)
+ "Return the number of days of the year up to YEAR MONTH DAY.
+The count includes the given date."
+ (if calc-gregorian-switch
+ (cond ((eq year (nth 0 calc-gregorian-switch))
+ (1+
+ (- (math-absolute-from-dt year month day)
+ (math-absolute-from-dt year 1 1))))
+ ((Math-lessp year (nth 0 calc-gregorian-switch))
+ (math-day-in-year year month day t))
+ (t
+ (math-day-in-year year month day)))
+ (math-day-in-year year month day)))
+
+(defun math-dt-before-p (dt1 dt2)
+ "Non-nil if DT1 occurs before DT2.
+A DT is a list of the form (YEAR MONTH DAY)."
+ (or (Math-lessp (nth 0 dt1) (nth 0 dt2))
+ (and (equal (nth 0 dt1) (nth 0 dt2))
+ (or (< (nth 1 dt1) (nth 1 dt2))
+ (and (= (nth 1 dt1) (nth 1 dt2))
+ (< (nth 2 dt1) (nth 2 dt2)))))))
+
+(defun math-absolute-from-gregorian-dt (year month day)
+ "Return the DATE of the day given by the Gregorian day YEAR MONTH DAY.
+Recall that DATE is the number of days since December 31, -1
+in the Gregorian calendar."
(if (eq year 0) (setq year -1))
(let ((yearm1 (math-sub year 1)))
- (math-sub (math-add (math-day-number year month day)
- (math-add (math-mul 365 yearm1)
- (if (math-posp year)
- (math-quotient yearm1 4)
- (math-sub 365
- (math-quotient (math-sub 3 year)
- 4)))))
- (if (or (Math-lessp year 1753)
- (and (eq year 1752) (<= month 9)))
- 1
- (let ((correction (math-mul (math-quotient yearm1 100) 3)))
- (let ((res (math-idivmod correction 4)))
- (math-add (if (= (cdr res) 0)
- -1
- 0)
- (car res))))))))
-
+ (math-sub
+ ;; Add the number of days of the year and the numbers of days
+ ;; in the previous years (leap year days to be added separately)
+ (math-add (math-day-in-year year month day)
+ (math-add (math-mul 365 yearm1)
+ ;; Add the number of Julian leap years
+ (if (math-posp year)
+ (math-quotient yearm1 4)
+ (math-sub 365
+ (math-quotient (math-sub 3 year)
+ 4)))))
+ ;; Subtract the number of Julian leap years which are not
+ ;; Gregorian leap years. In C=4N+r centuries, there will
+ ;; be 3N+r of these days. The following will compute
+ ;; 3N+r.
+ (let* ((correction (math-mul (math-quotient yearm1 100) 3))
+ (res (math-idivmod correction 4)))
+ (math-add (if (= (cdr res) 0)
+ 0
+ 1)
+ (car res))))))
+
+(defun math-absolute-from-julian-dt (year month day)
+ "Return the DATE of the day given by the Julian day YEAR MONTH DAY.
+Recall that DATE is the number of days since December 31, -1
+in the Gregorian calendar."
+ (if (eq year 0) (setq year -1))
+ (let ((yearm1 (math-sub year 1)))
+ (math-sub
+ ;; Add the number of days of the year and the numbers of days
+ ;; in the previous years (leap year days to be added separately)
+ (math-add (math-day-in-year year month day)
+ (math-add (math-mul 365 yearm1)
+ ;; Add the number of Julian leap years
+ (if (math-posp year)
+ (math-quotient yearm1 4)
+ (math-sub 365
+ (math-quotient (math-sub 3 year)
+ 4)))))
+ ;; Adjustment, since January 1, 1 (Julian) is absolute day -1
+ 2)))
+
+;; calc-gregorian-switch is a customizable variable defined in calc.el
+(defvar calc-gregorian-switch)
+
+(defun math-absolute-from-iso-dt (year week day)
+ "Return the DATE of the day given by the iso8601 day YEAR WEEK DAY."
+ (let* ((janfour (math-absolute-from-gregorian-dt year 1 4))
+ (prevmon (math-sub janfour
+ (cdr (math-idivmod (math-sub janfour 1) 7)))))
+ (math-add
+ (math-add prevmon (* (1- week) 7))
+ (if (zerop day) 6 (1- day)))))
+
+(defun math-absolute-from-dt (year month day)
+ "Return the DATE of the day given by the day YEAR MONTH DAY.
+Recall that DATE is the number of days since December 31, -1
+in the Gregorian calendar."
+ (if (and calc-gregorian-switch
+ ;; The next few lines determine if the given date
+ ;; occurs before the switch to the Gregorian calendar.
+ (math-dt-before-p (list year month day) calc-gregorian-switch))
+ (math-absolute-from-julian-dt year month day)
+ (math-absolute-from-gregorian-dt year month day)))
;;; It is safe to redefine these in your init file to use a different
;;; language.
(defvar math-fd-minute)
(defvar math-fd-second)
(defvar math-fd-bc-flag)
+(defvar math-fd-iso-dt)
+(defvar math-fd-isoyear)
+(defvar math-fd-isoweek)
+(defvar math-fd-isoweekday)
(defun math-format-date (math-fd-date)
(if (eq (car-safe math-fd-date) 'date)
(let ((entry (list math-fd-date calc-internal-prec calc-date-format)))
(or (cdr (assoc entry math-format-date-cache))
(let* ((math-fd-dt nil)
+ (math-fd-iso-dt nil)
(calc-group-digits nil)
(calc-leading-zeros nil)
(calc-number-radix 10)
(calc-twos-complement-mode nil)
math-fd-year math-fd-month math-fd-day math-fd-weekday
math-fd-hour math-fd-minute math-fd-second
+ math-fd-isoyear math-fd-isoweek math-fd-isoweekday
(math-fd-bc-flag nil)
(fmt (apply 'concat (mapcar 'math-format-date-part
calc-date-format))))
(setcdr math-fd-dt nil))
fmt))))
-(defconst math-julian-date-beginning '(float 17214235 -1)
- "The beginning of the Julian calendar,
-as measured in the number of days before January 1 of the year 1AD.")
+(defconst math-julian-date-beginning '(float 17214225 -1)
+ "The beginning of the Julian date calendar,
+as measured in the number of days before December 31, 1 BC (Gregorian).")
-(defconst math-julian-date-beginning-int 1721424
- "The beginning of the Julian calendar,
-as measured in the integer number of days before January 1 of the year 1AD.")
+(defconst math-julian-date-beginning-int 1721423
+ "The beginning of the Julian date calendar,
+as measured in the integer number of days before December 31, 1 BC (Gregorian).")
(defun math-format-date-part (x)
(cond ((stringp x)
math-julian-date-beginning-int)))
((eq x 'U)
(math-format-number (nth 1 (math-date-parts math-fd-date 719164))))
+ ((memq x '(IYYY Iww w))
+ (progn
+ (or math-fd-iso-dt
+ (setq math-fd-iso-dt (math-date-to-iso-dt math-fd-date)
+ math-fd-isoyear (car math-fd-iso-dt)
+ math-fd-isoweek (nth 1 math-fd-iso-dt)
+ math-fd-isoweekday (nth 2 math-fd-iso-dt)))
+ (cond ((eq x 'IYYY)
+ (let* ((neg (Math-negp math-fd-isoyear))
+ (pyear (calcFunc-abs math-fd-isoyear)))
+ (if (and (natnump pyear) (< pyear 10000))
+ (concat (if neg "-" "") (format "%04d" pyear))
+ (concat (if neg "-" "+") (math-format-number pyear)))))
+ ((eq x 'Iww)
+ (concat "W" (format "%02d" math-fd-isoweek)))
+ ((eq x 'w)
+ (format "%d" math-fd-isoweekday)))))
((progn
(or math-fd-dt
(progn
math-fd-year (car math-fd-dt)
math-fd-month (nth 1 math-fd-dt)
math-fd-day (nth 2 math-fd-dt)
- math-fd-weekday (math-mod
- (math-add (math-floor math-fd-date) 6) 7)
+ math-fd-weekday (math-mod (math-floor math-fd-date) 7)
math-fd-hour (nth 3 math-fd-dt)
math-fd-minute (nth 4 math-fd-dt)
math-fd-second (nth 5 math-fd-dt))
(if (and (natnump math-fd-year) (< math-fd-year 100))
(format "+%d" math-fd-year)
(math-format-number math-fd-year)))
+ ((eq x 'ZYYY)
+ (let* ((year (if (Math-negp math-fd-year)
+ (math-add math-fd-year 1)
+ math-fd-year))
+ (neg (Math-negp year))
+ (pyear (calcFunc-abs year)))
+ (if (and (natnump pyear) (< pyear 10000))
+ (concat (if neg "-" "") (format "%04d" pyear))
+ (concat (if neg "-" "+") (math-format-number pyear)))))
((eq x 'b) "")
((eq x 'aa)
(and (not math-fd-bc-flag) "ad"))
(and math-fd-bc-flag "b.c."))
((eq x 'BBBB)
(and math-fd-bc-flag "B.C."))
+ ((eq x 'T) "T")
((eq x 'M)
(format "%d" math-fd-month))
((eq x 'MM)
(catch 'syntax
(or (math-parse-standard-date math-pd-str t)
(math-parse-standard-date math-pd-str nil)
+ (and (string-match "W[0-9][0-9]" math-pd-str)
+ (math-parse-iso-date math-pd-str))
(and (string-match "\\`[^-+/0-9a-zA-Z]*\\([-+]?[0-9]+\\.?[0-9]*\\([eE][-+]?[0-9]+\\)?\\)[^-+/0-9a-zA-Z]*\\'" math-pd-str)
(list 'date (math-read-number (math-match-substring math-pd-str 1))))
(let ((case-fold-search t)
(setq second 0)
(setq second (math-read-number second)))
(if (equal ampm "")
- (if (> hour 23)
- (throw 'syntax "Hour value out of range"))
+ (if (or
+ (> hour 24)
+ (and (= hour 24)
+ (not (= minute 0))
+ (not (eq second 0))))
+ (throw 'syntax "Hour value is out of range"))
(setq ampm (upcase (aref ampm 0)))
(if (memq ampm '(?N ?M))
(if (and (= hour 12) (= minute 0) (eq second 0))
(throw 'syntax
"Time must be 12:00:00 in this context"))
(if (or (= hour 0) (> hour 12))
- (throw 'syntax "Hour value out of range"))
+ (throw 'syntax "Hour value is out of range"))
(if (eq (= ampm ?A) (= hour 12))
(setq hour (% (+ hour 12) 24)))))))
(throw 'syntax "Day value is out of range"))
(and hour
(progn
- (if (or (< hour 0) (> hour 23))
+ (if (or (< hour 0)
+ (> hour 24)
+ (and (= hour 24)
+ (not (= minute 0))
+ (not (eq second 0))))
(throw 'syntax "Hour value is out of range"))
(if (or (< minute 0) (> minute 59))
(throw 'syntax "Minute value is out of range"))
(list 'date (math-dt-to-date (append (list year month day)
(and hour (list hour minute second))))))
+(defun math-parse-iso-date-validate (isoyear isoweek isoweekday hour minute second)
+ (if (or (< isoweek 1) (> isoweek 53))
+ (throw 'syntax "Week value is out of range"))
+ (if (or (< isoweekday 1) (> isoweekday 7))
+ (throw 'syntax "Weekday value is out of range"))
+ (and hour
+ (progn
+ (if (or (< hour 0)
+ (> hour 24)
+ (and (= hour 24)
+ (not (= minute 0))
+ (not (eq second 0))))
+ (throw 'syntax "Hour value is out of range"))
+ (if (or (< minute 0) (> minute 59))
+ (throw 'syntax "Minute value is out of range"))
+ (if (or (math-negp second) (not (Math-lessp second 60)))
+ (throw 'syntax "Seconds value is out of range"))))
+ (list 'date (math-iso-dt-to-date (append (list isoyear isoweek isoweekday)
+ (and hour (list hour minute second))))))
+
(defun math-parse-date-word (names &optional front)
(let ((n 1))
(while (and names (not (string-match (if (equal (car names) "Sep")
(let ((case-fold-search t)
(okay t) num
(fmt calc-date-format) this next (gnext nil)
+ (isoyear nil) (isoweek nil) (isoweekday nil)
(year nil) (month nil) (day nil) (bigyear nil) (yearday nil)
(hour nil) (minute nil) (second nil) (bc-flag nil))
(while (and fmt okay)
(if (string-match "\\`pm\\|p\\.m\\." math-pd-str)
(setq hour (if (= hour 12) 12 (% (+ hour 12) 24))
math-pd-str (substring math-pd-str (match-end 0))))))
- ((memq this '(Y YY BY YYY YYYY))
+ ((memq this '(Y YY BY YYY YYYY ZYYY))
(and (if (memq next '(MM DD ddd hh HH mm ss SS))
(if (memq this '(Y YY BYY))
(string-match "\\` *[0-9][0-9]" math-pd-str)
(string-match "\\`[0-9][0-9][0-9][0-9]" math-pd-str))
(string-match "\\`[-+]?[0-9]+" math-pd-str))
(setq year (math-match-substring math-pd-str 0)
- bigyear (or (eq this 'YYY)
+ bigyear (or (eq this 'YYY)
(memq (aref math-pd-str 0) '(?\+ ?\-)))
math-pd-str (substring math-pd-str (match-end 0))
- year (math-read-number year))))
+ year (math-read-number year))
+ (if (and (eq this 'ZYYY) (eq year 0))
+ (setq year (math-sub year 1)
+ bigyear t)
+ t)))
+ ((eq this 'IYYY)
+ (if (string-match "\\`[-+]?[0-9]+" math-pd-str)
+ (setq isoyear (string-to-number (math-match-substring math-pd-str 0))
+ math-pd-str (substring math-pd-str (match-end 0)))))
+ ((eq this 'Iww)
+ (if (string-match "W\\([0-9][0-9]\\)" math-pd-str)
+ (setq isoweek (string-to-number (math-match-substring math-pd-str 1))
+ math-pd-str (substring math-pd-str 3))))
((eq this 'b)
t)
+ ((eq this 'T)
+ (if (eq (aref math-pd-str 0) ?T)
+ (setq math-pd-str (substring math-pd-str 1))
+ t))
((memq this '(aa AA aaaa AAAA))
(if (string-match "\\` *\\(ad\\|a\\.d\\.\\)" math-pd-str)
(setq math-pd-str (substring math-pd-str (match-end 0)))))
nil))
nil)
((eq this 'W)
- (and (>= num 0) (< num 7)))
+ (and (>= num 0) (< num 7)))
+ ((eq this 'w)
+ (setq isoweekday num))
((memq this '(d ddd bdd))
(setq yearday num))
((memq this '(M MM BM))
(setq yearday nil)
(setq month 1 day 1)))
(if (and okay (equal math-pd-str ""))
- (and month day (or (not (or hour minute second))
- (and hour minute))
- (progn
- (or year (setq year (math-this-year)))
- (or second (setq second 0))
- (if bc-flag
- (setq year (math-neg (math-abs year))))
- (setq day (math-parse-date-validate year bigyear month day
- hour minute second))
- (if yearday
- (setq day (math-add day (1- yearday))))
- day)))))
-
+ (if isoyear
+ (math-parse-iso-date-validate isoyear isoweek isoweekday hour minute second)
+ (and month day (or (not (or hour minute second))
+ (and hour minute))
+ (progn
+ (or year (setq year (math-this-year)))
+ (or second (setq second 0))
+ (if bc-flag
+ (setq year (math-neg (math-abs year))))
+ (setq day (math-parse-date-validate year bigyear month day
+ hour minute second))
+ (if yearday
+ (setq day (math-add day (1- yearday))))
+ day))))))
+
+(defun math-parse-iso-date (math-pd-str)
+ "Parse MATH-PD-STR as an ISO week date, or return nil."
+ (let ((case-fold-search t)
+ (isoyear nil) (isoweek nil) (isoweekday nil)
+ (hour nil) (minute nil) (second nil))
+ ;; Extract the time, if any.
+ (if (string-match "T[^0-9]*\\([0-9][0-9]\\)[^0-9]*\\([0-9][0-9]\\)?[^0-9]*\\([0-9][0-9]\\(\\.[0-9]+\\)?\\)?" math-pd-str)
+ (progn
+ (setq hour (string-to-number (math-match-substring math-pd-str 1))
+ minute (math-match-substring math-pd-str 2)
+ second (math-match-substring math-pd-str 3)
+ math-pd-str (substring math-pd-str 0 (match-beginning 0)))
+ (if (equal minute "")
+ (setq minute 0)
+ (setq minute (string-to-number minute)))
+ (if (equal second "")
+ (setq second 0)
+ (setq second (math-read-number second)))))
+ ;; Next, the year, week and weekday
+ (if (string-match "\\(-?[0-9]*\\)[^0-9]*W\\([0-9][0-9]\\)[^0-9]*\\([0-9]\\)[^0-9]*\\'" math-pd-str)
+ (progn
+ (setq isoyear (string-to-number (math-match-substring math-pd-str 1))
+ isoweek (string-to-number (math-match-substring math-pd-str 2))
+ isoweekday (string-to-number (math-match-substring math-pd-str 3)))
+ (math-parse-iso-date-validate isoyear isoweek isoweekday hour minute second)))))
(defun calcFunc-now (&optional zone)
(let ((date (let ((calc-date-format nil))
(setq date (nth 1 date)))
(or (math-realp date)
(math-reject-arg date 'datep))
- (math-mod (math-add (math-floor date) 6) 7))
+ (math-mod (math-floor date) 7))
(defun calcFunc-yearday (date)
(let ((dt (math-date-to-dt date)))
0)))
(rounded-abs-date
(+
- (calendar-absolute-from-gregorian
+ (calendar-absolute-from-gregorian
(list (nth 1 dt) (nth 2 dt) (nth 0 dt)))
(/ (round (* 60 time)) 60.0 24.0))))
(if (dst-in-effect rounded-abs-date)
(and (math-messy-integerp day) (setq day (math-trunc day)))
(or (integerp day) (math-reject-arg day 'fixnump))
(and (or (< day 0) (> day 31)) (math-reject-arg day 'range))
- (let ((dt (math-date-to-dt date)))
- (if (or (= day 0) (> day (math-days-in-month (car dt) (nth 1 dt))))
- (setq day (math-days-in-month (car dt) (nth 1 dt))))
- (and (eq (car dt) 1752) (= (nth 1 dt) 9)
- (if (>= day 14) (setq day (- day 11))))
- (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1))
- (1- day)))))
+ (let* ((dt (math-date-to-dt date))
+ (dim (math-days-in-month (car dt) (nth 1 dt)))
+ (julian (if calc-gregorian-switch
+ (math-date-to-dt (math-sub
+ (or (nth 3 calc-gregorian-switch)
+ (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch))
+ 1)))))
+ (if (or (= day 0) (> day dim))
+ (setq day (1- dim))
+ (setq day (1- day)))
+ ;; Adjust if this occurs near the switch to the Gregorian calendar
+ (if calc-gregorian-switch
+ (cond
+ ((and (math-dt-before-p (list (car dt) (nth 1 dt) 1) calc-gregorian-switch)
+ (math-dt-before-p julian (list (car dt) (nth 1 dt) 1)))
+ ;; In this case, CALC-GREGORIAN-SWITCH is the first day of the month
+ (list 'date
+ (math-dt-to-date (list (car calc-gregorian-switch)
+ (nth 1 calc-gregorian-switch)
+ (if (> (+ (nth 2 calc-gregorian-switch) day) dim)
+ dim
+ (+ (nth 2 calc-gregorian-switch) day))))))
+ ((and (eq (car dt) (car calc-gregorian-switch))
+ (= (nth 1 dt) (nth 1 calc-gregorian-switch)))
+ ;; In this case, the switch to the Gregorian calendar occurs in the given month
+ (if (< (+ (nth 2 julian) day) (nth 2 calc-gregorian-switch))
+ ;; If the DAYth day occurs before the switch, use it
+ (list 'date (math-dt-to-date (list (car dt) (nth 1 dt) (1+ day))))
+ ;; Otherwise do some computations
+ (let ((tm (+ day (- (nth 2 calc-gregorian-switch) (nth 2 julian)))))
+ (list 'date (math-dt-to-date
+ (list (car dt)
+ (nth 1 dt)
+ ;;
+ (if (> tm dim) dim tm)))))))
+ ((and (eq (car dt) (car julian))
+ (= (nth 1 dt) (nth 1 julian)))
+ ;; In this case, the current month is truncated because of the switch
+ ;; to the Gregorian calendar
+ (list 'date (math-dt-to-date
+ (list (car dt)
+ (nth 1 dt)
+ (if (>= day (nth 2 julian))
+ (nth 2 julian)
+ (1+ day))))))
+ (t
+ ;; The default
+ (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) day))))
+ (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) day)))))
(defun calcFunc-newyear (date &optional day)
+ (if (eq (car-safe date) 'date) (setq date (nth 1 date)))
(or day (setq day 1))
(and (math-messy-integerp day) (setq day (math-trunc day)))
(or (integerp day) (math-reject-arg day 'fixnump))
- (let ((dt (math-date-to-dt date)))
+ (let* ((dt (math-date-to-dt date))
+ (gregbeg (if calc-gregorian-switch
+ (or (nth 3 calc-gregorian-switch)
+ (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch))))
+ (julianend (if calc-gregorian-switch (math-sub gregbeg 1)))
+ (julian (if calc-gregorian-switch
+ (math-date-to-dt julianend))))
(if (and (>= day 0) (<= day 366))
- (let ((max (if (eq (car dt) 1752) 355
- (if (math-leap-year-p (car dt)) 366 365))))
+ (let ((max (if (math-leap-year-p (car dt)) 366 365)))
(if (or (= day 0) (> day max)) (setq day max))
- (list 'date (math-add (math-dt-to-date (list (car dt) 1 1))
- (1- day))))
+ (if calc-gregorian-switch
+ ;; Now to break this down into cases
+ (cond
+ ((and (math-dt-before-p (list (car dt) 1 1) calc-gregorian-switch)
+ (math-dt-before-p julian (list (car dt) 1 1)))
+ ;; In this case, CALC-GREGORIAN-SWITCH is the first day of the year
+ (list 'date (math-min (math-add gregbeg (1- day))
+ (math-dt-to-date (list (car calc-gregorian-switch) 12 31)))))
+ ((eq (car dt) (car julian))
+ ;; In this case, the switch to the Gregorian calendar occurs in the given year
+ (if (Math-lessp (car julian) (car calc-gregorian-switch))
+ ;; Here, the last Julian day is the last day of the year.
+ (list 'date (math-min (math-add (math-dt-to-date (list (car dt) 1 1)) (1- day))
+ julianend))
+ ;; Otherwise, just make sure the date doesn't go past the end of the year
+ (list 'date (math-min (math-add (math-dt-to-date (list (car dt) 1 1)) (1- day))
+ (math-dt-to-date (list (car dt) 12 31))))))
+ (t
+ (list 'date (math-add (math-dt-to-date (list (car dt) 1 1))
+ (1- day)))))
+ (list 'date (math-add (math-dt-to-date (list (car dt) 1 1))
+ (1- day)))))
(if (and (>= day -12) (<= day -1))
- (list 'date (math-dt-to-date (list (car dt) (- day) 1)))
- (math-reject-arg day 'range)))))
+ (if (and calc-gregorian-switch
+ (math-dt-before-p (list (car dt) (- day) 1) calc-gregorian-switch)
+ (math-dt-before-p julian (list (car dt) (- day) 1)))
+ (list 'date gregbeg)
+ (list 'date (math-dt-to-date (list (car dt) (- day) 1))))
+ (math-reject-arg day 'range)))))
(defun calcFunc-incmonth (date &optional step)
(or step (setq step 1))
:type 'string
:group 'calc)
+(defvar math-format-date-cache) ; calc-forms.el
+
(defface calc-nonselected-face
'((t :inherit shadow
:slant italic))
"M-D-Y< H:mm:SSpp>"
"D-M-Y< h:mm:SS>"
"j<, h:mm:SS>"
- "YYddd< hh:mm:ss>"))
+ "YYddd< hh:mm:ss>"
+ "ZYYY-MM-DD Www< hh:mm>"
+ "IYYY-Iww-w<Thh:mm:ss>"))
(defcalcmodevar calc-autorange-units nil
"If non-nil, automatically set unit prefixes to keep units in a reasonable range.")
(calc-refresh align)))
(setq calc-refresh-count (1+ calc-refresh-count)))
+;; Dates that are built-in options for `calc-gregorian-switch' should be
+;; (YEAR MONTH DAY math-date-from-gregorian-dt(YEAR MONTH DAY)) for speed.
+(defcustom calc-gregorian-switch nil
+ "The first day the Gregorian calendar is used by Calc's date forms.
+This is `nil' (the default) if the Gregorian calendar is the only one used.
+Otherwise, it should be a list `(YEAR MONTH DAY)' when Calc begins to use
+the Gregorian calendar; Calc will use the Julian calendar for earlier dates.
+The dates in which different regions of the world began to use the
+Gregorian calendar vary quite a bit, even within a single country.
+If you want Calc's date forms to switch between the Julian and
+Gregorian calendar, you can specify the date or choose from several
+common choices. Some of these choices should be taken with a grain
+of salt; for example different parts of France changed calendars at
+different times, and Sweden's change to the Gregorian calendar was
+complicated. Also, the boundaries of the countries were different at
+the times of the calendar changes than they are now.
+The Vatican decided that the Gregorian calendar should take effect
+on 15 October 1582 (Gregorian), and many Catholic countries made
+the change then. Great Britain and its colonies had the Gregorian
+calendar take effect on 14 September 1752 (Gregorian); this includes
+the United States."
+ :group 'calc
+ :version "24.4"
+ :type '(choice (const :tag "Always use the Gregorian calendar" nil)
+ (const :tag "1582-10-15 - Italy, Poland, Portugal, Spain" (1582 10 15 577736))
+ (const :tag "1582-12-20 - France" (1582 12 20 577802))
+ (const :tag "1582-12-25 - Luxemburg" (1582 12 25 577807))
+ (const :tag "1584-01-17 - Bohemia and Moravia" (1584 1 17 578195))
+ (const :tag "1587-11-01 - Hungary" (1587 11 1 579579))
+ (const :tag "1700-03-01 - Denmark" (1700 3 1 620607))
+ (const :tag "1701-01-12 - Protestant Switzerland" (1701 1 12 620924))
+ (const :tag "1752-09-14 - Great Britain and dominions" (1752 9 14 639797))
+ (const :tag "1753-03-01 - Sweden" (1753 3 1 639965))
+ (const :tag "1918-02-14 - Russia" (1918 2 14 700214))
+ (const :tag "1919-04-14 - Romania" (1919 4 14 700638))
+ (list :tag "(YEAR MONTH DAY)"
+ (integer :tag "Year")
+ (integer :tag "Month (integer)")
+ (integer :tag "Day")))
+ :set (lambda (symbol value)
+ (set-default symbol value)
+ (setq math-format-date-cache nil)
+ (calc-refresh)))
+
;;;; The Calc Trail buffer.
(defun calc-check-trail-aligned ()
;;;###autoload(if (or (featurep 'emacs)
;;;###autoload (and (fboundp 'float-time)
;;;###autoload (subrp (symbol-function 'float-time))))
-;;;###autoload (progn
-;;;###autoload (defalias 'time-to-seconds 'float-time)
-;;;###autoload (make-obsolete 'time-to-seconds 'float-time "21.1"))
+;;;###autoload (defalias 'time-to-seconds 'float-time)
;;;###autoload (autoload 'time-to-seconds "time-date"))
(eval-when-compile
-2012-11-14 David Engster <deng@randomsample.de>
+2012-11-19 Stefan Monnier <monnier@iro.umontreal.ca>
- * semantic/symref/list.el (semantic-symref-symbol): Use
- `semantic-complete-read-tag-project' instead of
+ * semantic/fw.el (semantic-make-local-hook, semantic-mode-line-update):
+ Simplify via CSE.
+
+2012-11-16 David Engster <deng@randomsample.de>
+
+ * semantic/symref/list.el (semantic-symref-symbol):
+ Use `semantic-complete-read-tag-project' instead of
`semantic-complete-read-tag-buffer-deep', since the latter is not
working correctly.
- * semantic/symref.el (semantic-symref-result-get-tags): Use
- `find-buffer-visiting' to follow symbolic links.
+ * semantic/symref.el (semantic-symref-result-get-tags):
+ Use `find-buffer-visiting' to follow symbolic links.
* semantic/fw.el (semantic-find-file-noselect): Always set
`enable-local-variables' to `:safe' when loading files.
-2012-11-13 Glenn Morris <rgm@gnu.org>
+2012-11-16 Glenn Morris <rgm@gnu.org>
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* semantic/util.el (semantic-describe-buffer):
(semantic-default-c-setup):
Use new names for hooks rather than obsolete aliases.
-2012-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca>
* semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
* semantic/grammar.el (semantic-grammar-mode):
(semantic-show-parser-state-mode): Avoid obsolete name
semantic-edits-new-change-hooks (bug#12869).
-2012-11-10 Glenn Morris <rgm@gnu.org>
+2012-11-13 Glenn Morris <rgm@gnu.org>
* srecode/srt-mode.el (srecode-template-mode):
Don't change global values of comment-start, comment-end. (Bug#12781)
)
- (if (and (not (featurep 'xemacs))
- (>= emacs-major-version 21))
- (defalias 'semantic-make-local-hook 'identity)
- (defalias 'semantic-make-local-hook 'make-local-hook)
- )
+ (defalias 'semantic-make-local-hook
+ (if (and (not (featurep 'xemacs))
+ (>= emacs-major-version 21))
+ #'identity #'make-local-hook))
- (if (featurep 'xemacs)
- (defalias 'semantic-mode-line-update 'redraw-modeline)
- (defalias 'semantic-mode-line-update 'force-mode-line-update))
+ (defalias 'semantic-mode-line-update
+ (if (featurep 'xemacs) #'redraw-modeline #'force-mode-line-update))
;; Since Emacs 22 major mode functions should use `run-mode-hooks' to
;; run major mode hooks.
;;; Code:
-(eval-when-compile
- (require 'cl))
-
;; Emacs < 23.3
(eval-and-compile
(unless (boundp 'float-pi)
COLOR-NAME should be a string naming a color (e.g. \"white\"), or
a string specifying a color's RGB components (e.g. \"#ff12ec\")."
(let ((color (color-name-to-rgb color-name)))
- (list (- 1.0 (car color))
- (- 1.0 (cadr color))
- (- 1.0 (caddr color)))))
+ (list (- 1.0 (nth 0 color))
+ (- 1.0 (nth 1 color))
+ (- 1.0 (nth 2 color)))))
(defun color-gradient (start stop step-number)
"Return a list with STEP-NUMBER colors from START to STOP.
((bound-and-true-p follow-mode)
(follow-comint-scroll-to-bottom))
(t
- (let ((selected (selected-window)))
- (dolist (w (get-buffer-window-list current nil t))
- (select-window w)
- (unwind-protect
- (progn
- (comint-adjust-point selected)
- ;; Optionally scroll to the bottom of the window.
- (and comint-scroll-show-maximum-output
- (eobp)
- (recenter (- -1 scroll-margin))))
- (select-window selected))))))
+ (dolist (w (get-buffer-window-list current nil t))
+ (comint-adjust-window-point w process)
+ ;; Optionally scroll to the bottom of the window.
+ (and comint-scroll-show-maximum-output
+ (eq (window-point w) (point-max))
+ (with-selected-window w
+ (recenter (- -1 scroll-margin)))))))
(set-buffer current))))
+
+(defun comint-adjust-window-point (window process)
+ "Move point in WINDOW based on Comint settings.
+For point adjustment use the process-mark of PROCESS."
+ (and (< (window-point window) (process-mark process))
+ (or (memq comint-move-point-for-output '(t all))
+ ;; Maybe user wants point to jump to end.
+ (eq comint-move-point-for-output
+ (if (eq (selected-window) window) 'this 'others))
+ ;; If point was at the end, keep it at end.
+ (and (marker-position comint-last-output-start)
+ (>= (window-point window) comint-last-output-start)))
+ (set-window-point window (process-mark process))))
+
+
+;; this function is nowhere used
(defun comint-adjust-point (selected)
"Move point in the selected window based on Comint settings.
SELECTED is the window that was originally selected."
This is useful, for instance, for insertion into Help mode buffers.
You probably want to set it locally to the output buffer.")
+(defvar comint-redirect-previous-input-string nil
+ "Last redirected line of text.
+Allows detection of the end of the redirection in case the
+completion string is split between two output segments.")
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(make-local-variable 'comint-redirect-completed)
(setq comint-redirect-completed nil)
+ (make-local-variable 'comint-redirect-previous-input-string)
+ (setq comint-redirect-previous-input-string "")
+
(setq mode-line-process
(if mode-line-process
(list (concat (elt mode-line-process 0) " Redirection"))
(defun comint-redirect-cleanup ()
"End a Comint redirection. See `comint-redirect-send-command'."
(interactive)
+ ;; Release the last redirected string
+ (setq comint-redirect-previous-input-string nil)
;; Restore the process filter
(set-process-filter (get-buffer-process (current-buffer))
comint-redirect-original-filter-function)
;; Message
(and comint-redirect-verbose
- (message "Redirected output to buffer(s) %s"
- (mapconcat 'identity output-buffer-list " ")))
+ (message "Redirected output to buffer(s) %s" output-buffer-list))
;; If we see the prompt, tidy up
;; We'll look for the prompt in the original string, so nobody can
;; clobber it
- (and (string-match comint-redirect-finished-regexp input-string)
+ (and (string-match comint-redirect-finished-regexp
+ (concat comint-redirect-previous-input-string
+ input-string))
(progn
(and comint-redirect-verbose
(message "Redirection completed"))
(comint-redirect-cleanup)
(run-hooks 'comint-redirect-hook)))
+ (setq comint-redirect-previous-input-string input-string)
+
;; Echo input?
(if comint-redirect-echo-input
filtered-input-string
(setq comment nil)
;; Make the comment invisible by hand if it's empty
(custom-comment-hide comment-widget))
- (put symbol 'customized-face value)
(custom-push-theme 'theme-face symbol 'user 'set value)
- (if (face-spec-choose value)
- (face-spec-set symbol value t)
- ;; face-set-spec ignores empty attribute lists, so just give it
- ;; something harmless instead.
- (face-spec-set symbol '((t :foreground unspecified)) t))
- (put symbol 'customized-face-comment comment)
+ (face-spec-set symbol value 'customized-face)
(put symbol 'face-comment comment)
+ (put symbol 'customized-face-comment comment)
(custom-face-state-set widget)
(custom-redraw-magic widget)))
(let* ((symbol (widget-value widget))
(value (custom-face-widget-to-spec widget))
(comment-widget (widget-get widget :comment-widget))
- (comment (widget-value comment-widget)))
+ (comment (widget-value comment-widget))
+ (standard (eq (widget-get widget :custom-state) 'standard)))
(when (equal comment "")
(setq comment nil)
;; Make the comment invisible by hand if it's empty
(custom-comment-hide comment-widget))
(custom-push-theme 'theme-face symbol 'user 'set value)
- (if (face-spec-choose value)
- (face-spec-set symbol value t)
- ;; face-set-spec ignores empty attribute lists, so just give it
- ;; something harmless instead.
- (face-spec-set symbol '((t :foreground unspecified)) t))
- (unless (eq (widget-get widget :custom-state) 'standard)
- (put symbol 'saved-face value))
- (put symbol 'customized-face nil)
+ (face-spec-set symbol value (if standard 'reset 'saved-face))
(put symbol 'face-comment comment)
(put symbol 'customized-face-comment nil)
(put symbol 'saved-face-comment comment)))
(saved-face (get face 'saved-face))
(comment (get face 'saved-face-comment))
(comment-widget (widget-get widget :comment-widget)))
- (put face 'customized-face nil)
- (put face 'customized-face-comment nil)
(custom-push-theme 'theme-face face 'user
(if saved-face 'set 'reset)
saved-face)
- (face-spec-set face saved-face t)
+ (face-spec-set face saved-face 'saved-face)
(put face 'face-comment comment)
+ (put face 'customized-face-comment nil)
(widget-value-set child saved-face)
;; This call manages the comment visibility
(widget-value-set comment-widget (or comment ""))
(comment-widget (widget-get widget :comment-widget)))
(unless value
(user-error "No standard setting for this face"))
- (put symbol 'customized-face nil)
- (put symbol 'customized-face-comment nil)
(custom-push-theme 'theme-face symbol 'user 'reset)
- (face-spec-set symbol value t)
- (custom-theme-recalc-face symbol)
+ (face-spec-set symbol value 'reset)
+ (put symbol 'face-comment nil)
+ (put symbol 'customized-face-comment nil)
(if (and custom-reset-standard-faces-list
(or (get symbol 'saved-face) (get symbol 'saved-face-comment)))
;; Do this later.
(put symbol 'saved-face nil)
(put symbol 'saved-face-comment nil)
(custom-save-all))
- (put symbol 'face-comment nil)
(widget-value-set child
(custom-pre-filter-face-spec
(list (list t (custom-face-attributes-get
;;; Declaring a face.
(defun custom-declare-face (face spec doc &rest args)
- "Like `defface', but FACE is evaluated as a normal argument."
+ "Like `defface', but with FACE evaluated as a normal argument."
(unless (get face 'face-defface-spec)
- (let ((facep (facep face)))
- (unless facep
- ;; If the user has already created the face, respect that.
- (let ((value (or (get face 'saved-face) spec))
- (have-window-system (memq initial-window-system '(x w32))))
- ;; Create global face.
- (make-empty-face face)
- ;; Create frame-local faces
- (dolist (frame (frame-list))
- (face-spec-set-2 face frame value)
- (when (memq (window-system frame) '(x w32 ns))
- (setq have-window-system t)))
- ;; When making a face after frames already exist
- (if have-window-system
- (make-face-x-resource-internal face))))
- ;; Don't record SPEC until we see it causes no errors.
- (put face 'face-defface-spec (purecopy spec))
- (push (cons 'defface face) current-load-list)
- (when (and doc (null (face-documentation face)))
- (set-face-documentation face (purecopy doc)))
- (custom-handle-all-keywords face args 'custom-face)
- (run-hooks 'custom-define-hook)
- ;; If the face had existing settings, recalculate it. For
- ;; example, the user might load a theme with a face setting, and
- ;; later load a library defining that face.
- (if facep
- (custom-theme-recalc-face face))))
+ (face-spec-set face (purecopy spec) 'face-defface-spec)
+ (push (cons 'defface face) current-load-list)
+ (when doc
+ (set-face-documentation face (purecopy doc)))
+ (custom-handle-all-keywords face args 'custom-face)
+ (run-hooks 'custom-define-hook))
face)
;;; Face attributes.
If THEME property `theme-immediate' is non-nil, this is equivalent of
providing the NOW argument to all faces in the argument list: FACE is
-created now. The only difference is FACE property `force-face': if NOW
-is non-nil, FACE property `force-face' is set to the symbol `rogue', else
-if THEME property `theme-immediate' is non-nil, FACE property `force-face'
-is set to the symbol `immediate'.
+created now.
SPEC itself is saved in FACE property `saved-face' and it is stored in
FACE's list property `theme-face' \(using `custom-push-theme')."
(when (not (and oldspec (eq 'user (caar oldspec))))
(put face 'saved-face spec)
(put face 'saved-face-comment comment))
- ;; Do this AFTER checking the `theme-face' property.
(custom-push-theme 'theme-face face theme 'set spec)
(when (or now immediate)
(put face 'force-face (if now 'rogue 'immediate)))
(when (or now immediate (facep face))
- (unless (facep face)
- (make-empty-face face))
(put face 'face-comment comment)
- (put face 'face-override-spec nil)
(face-spec-set face spec t))))))))
;; XEmacs compatibility function. In XEmacs, when you reset a Custom
(gc-cons-percentage alloc float)
(garbage-collection-messages alloc boolean)
;; buffer.c
+ (cursor-type
+ display
+ (choice
+ (const :tag "Frame default" t)
+ (const :tag "Filled box" box)
+ (const :tag "Hollow cursor" hollow)
+ (const :tag "Vertical bar" bar)
+ (cons :tag "Vertical bar with specified width"
+ (const bar) integer)
+ (const :tag "Horizontal bar" hbar)
+ (cons :tag "Horizontal bar with specified width"
+ (const hbar) integer)
+ (const :tag "None "nil)))
(mode-line-format mode-line sexp) ;Hard to do right.
(major-mode internal function)
(case-fold-search matching boolean)
COMMENT is a comment string about SYMBOL."
(custom-check-theme theme)
-
;; Process all the needed autoloads before anything else, so that the
;; subsequent code has all the info it needs (e.g. which var corresponds
;; to a minor mode), regardless of the ordering of the variables.
(memq (get symbol 'custom-autoload) '(nil noset)))
;; This symbol needs to be autoloaded, even just for a `set'.
(custom-load-symbol symbol))))
-
- ;; Move minor modes and variables with explicit requires to the end.
- (setq args
- (sort args
- (lambda (a1 a2)
- (let* ((sym1 (car a1))
- (sym2 (car a2))
- (1-then-2 (memq sym1 (get sym2 'custom-dependencies)))
- (2-then-1 (memq sym2 (get sym1 'custom-dependencies))))
- (cond ((and 1-then-2 2-then-1)
- (error "Circular custom dependency between `%s' and `%s'"
- sym1 sym2))
- (2-then-1 nil)
- ;; 1 is a dependency of 2, so needs to be set first.
- (1-then-2)
- ;; Put minor modes and symbols with :require last.
- ;; Putting minor modes last ensures that the mode
- ;; function will see other customized values rather
- ;; than default values.
- (t (or (nth 3 a2)
- (eq (get sym2 'custom-set)
- 'custom-set-minor-mode))))))))
-
+ (setq args (custom--sort-vars args))
(dolist (entry args)
(unless (listp entry)
(error "Incompatible Custom theme spec"))
(and (or now (default-boundp symbol))
(put symbol 'variable-comment comment)))))))
+(defvar custom--sort-vars-table)
+(defvar custom--sort-vars-result)
+
+(defun custom--sort-vars (vars)
+ "Sort VARS based on custom dependencies.
+VARS is a list whose elements have the same form as the ARGS
+arguments to `custom-theme-set-variables'. Return the sorted
+list, in which A occurs before B if B was defined with a
+`:set-after' keyword specifying A (see `defcustom')."
+ (let ((custom--sort-vars-table (make-hash-table))
+ (dependants (make-hash-table))
+ (custom--sort-vars-result nil)
+ last)
+ ;; Construct a pair of tables keyed with the symbols of VARS.
+ (dolist (var vars)
+ (puthash (car var) (cons t var) custom--sort-vars-table)
+ (puthash (car var) var dependants))
+ ;; From the second table, remove symbols that are depended-on.
+ (dolist (var vars)
+ (dolist (dep (get (car var) 'custom-dependencies))
+ (remhash dep dependants)))
+ ;; If a variable is "stand-alone", put it last if it's a minor
+ ;; mode or has a :require flag. This is not really necessary, but
+ ;; putting minor modes last helps ensure that the mode function
+ ;; sees other customized values rather than default values.
+ (maphash (lambda (sym var)
+ (when (and (null (get sym 'custom-dependencies))
+ (or (nth 3 var)
+ (eq (get sym 'custom-set)
+ 'custom-set-minor-mode)))
+ (remhash sym dependants)
+ (push var last)))
+ dependants)
+ ;; The remaining symbols depend on others but are not
+ ;; depended-upon. Do a depth-first topological sort.
+ (maphash #'custom--sort-vars-1 dependants)
+ (nreverse (append last custom--sort-vars-result))))
+
+(defun custom--sort-vars-1 (sym &optional _ignored)
+ (let ((elt (gethash sym custom--sort-vars-table)))
+ ;; The car of the hash table value is nil if the variable has
+ ;; already been processed, `dependant' if it is a dependant in the
+ ;; current graph descent, and t otherwise.
+ (when elt
+ (cond
+ ((eq (car elt) 'dependant)
+ (error "Circular custom dependency on `%s'" sym))
+ ((car elt)
+ (setcar elt 'dependant)
+ (dolist (dep (get sym 'custom-dependencies))
+ (custom--sort-vars-1 dep))
+ (setcar elt nil)
+ (push (cdr elt) custom--sort-vars-result))))))
+
\f
;;; Defining themes.
(format "%c:%s" x doc)))
mnemonics ", ")))))
+(declare-function quail-find-key "quail" (char))
+
;;;###autoload
(defun describe-char (pos &optional buffer)
"Describe position POS (interactively, point) and the char after POS.
(or (and filename
(stringp desktop-files-not-to-save)
(not (string-match desktop-files-not-to-save filename)))
- (and (eq mode 'dired-mode)
+ (and (memq mode '(dired-mode vc-dir-mode))
(with-current-buffer bufname
(not (setq dired-skip
(string-match desktop-files-not-to-save
(if (null default)
;; Nothing to guess
(read-shell-command prompt nil 'dired-shell-command-history)
+ (setq prompt (replace-regexp-in-string ": $" " " prompt))
(if (listp default)
;; More than one guess
(setq default-list default
;; Just one guess
(setq default-list (list default)))
;; Put the first guess in the prompt but not in the initial value.
- (setq prompt (concat prompt (format "[%s] " default)))
+ (setq prompt (concat prompt (format "[%s]: " default)))
;; All guesses can be retrieved with M-n
(setq val (read-shell-command prompt nil
'dired-shell-command-history
;;;; Desktop support
(eval-when-compile (require 'desktop))
+(declare-function desktop-file-name "desktop" (filename dirname))
(defun dired-desktop-buffer-misc-data (dirname)
"Auxiliary information to be saved in desktop file."
;;;***
\f
;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
-;;;;;; "dired-x" "dired-x.el" "ce753ade80ea9f4e64ab3569e3a5421e")
+;;;;;; "dired-x" "dired-x.el" "cdaacce7c861256289ba48493dd6d0ec")
;;; Generated autoloads from dired-x.el
(autoload 'dired-jump "dired-x" "\
(goto-char (point-max))
(insert msg1 msg2 "\n"))))
+(declare-function shell-prefixed-directory-name "shell" (dir))
+(declare-function shell-process-cd "shell" (arg))
+
;;;###autoload
(defun dirtrack (input)
"Determine the current directory from the process output for a prompt.
:type 'number
:group 'doc-view)
+(defcustom doc-view-scale-internally t
+ "Whether we should try to rescale images ourselves.
+If nil, the document is re-rendered every time the scaling factor is modified.
+This only has an effect if the image libraries linked with Emacs support
+scaling."
+ :type 'boolean)
+
(defcustom doc-view-image-width 850
"Default image width.
-Has only an effect if imagemagick support is compiled into emacs."
+Has only an effect if `doc-view-scale-internally' is non-nil and support for
+scaling is compiled into emacs."
:version "24.1"
:type 'number
:group 'doc-view)
(defun doc-view-enlarge (factor)
"Enlarge the document by FACTOR."
(interactive (list doc-view-shrink-factor))
- (if (eq (plist-get (cdr (doc-view-current-image)) :type)
- 'imagemagick)
+ (if (and doc-view-scale-internally
+ (eq (plist-get (cdr (doc-view-current-image)) :type)
+ 'imagemagick))
;; ImageMagick supports on-the-fly-rescaling.
(let ((new (ceiling (* factor doc-view-image-width))))
(unless (equal new doc-view-image-width)
(setq doc-view-pending-cache-flush nil))
(let ((ol (doc-view-current-overlay))
(image (if (and file (file-readable-p file))
- (if (not (fboundp 'imagemagick-types))
+ (if (not (and doc-view-scale-internally
+ (fboundp 'imagemagick-types)))
(apply 'create-image file 'png nil args)
(unless (member :width args)
- (setq args (append args (list :width doc-view-image-width))))
+ (setq args `(,@args :width ,doc-view-image-width)))
(apply 'create-image file 'imagemagick nil args))))
(slice (doc-view-current-slice)))
(setf (doc-view-current-image) image)
-;;; advice.el --- An overloading mechanism for Emacs Lisp functions
+;;; advice.el --- An overloading mechanism for Emacs Lisp functions -*- lexical-binding: t -*-
;; Copyright (C) 1993-1994, 2000-2013 Free Software Foundation, Inc.
;; @ Highlights:
;; =============
;; - Clean definition of multiple, named before/around/after advices
-;; for functions, macros, subrs and special forms
+;; for functions and macros.
;; - Full control over the arguments an advised function will receive,
;; the binding environment in which it will be executed, as well as the
;; value it will return.
-;; - Allows re/definition of interactive behavior for functions and subrs
-;; - Every piece of advice can have its documentation string which will be
-;; combined with the original documentation of the advised function at
-;; call-time of `documentation' for proper command-key substitution.
+;; - Allows re/definition of interactive behavior for commands.
+;; - Every piece of advice can have its documentation string.
;; - The execution of every piece of advice can be protected against error
;; and non-local exits in preceding code or advices.
;; - Simple argument access either by name, or, more portable but as
;; version of a function.
;; - Advised functions can be byte-compiled either at file-compile time
;; (see preactivation) or activation time.
-;; - Separation of advice definition and activation
+;; - Separation of advice definition and activation.
;; - Forward advice is possible, that is
;; as yet undefined or autoload functions can be advised without having to
;; preload the file in which they are defined.
;; - En/disablement mechanism allows the use of different "views" of advised
;; functions depending on what pieces of advice are currently en/disabled
;; - Provides manipulation mechanisms for sets of advised functions via
-;; regular expressions that match advice names
+;; regular expressions that match advice names.
;; @ Overview, or how to read this file:
;; =====================================
;; others come from the various Lisp advice mechanisms I've come across
;; so far, and a few are simply mine.
-;; @ Comments, suggestions, bug reports:
-;; =====================================
-;; If you find any bugs, have suggestions for new advice features, find the
-;; documentation wrong, confusing, incomplete, or otherwise unsatisfactory,
-;; have any questions about Advice, or have otherwise enlightening
-;; comments feel free to send me email at <hans@cs.buffalo.edu>.
-
;; @ Safety Rules and Emergency Exits:
;; ===================================
;; Before we begin: CAUTION!!
;; Advice provides you with a lot of rope to hang yourself on very
;; easily accessible trees, so, here are a few important things you
-;; should know: Once Advice has been started with `ad-start-advice'
-;; (which happens automatically when you load this file), it
-;; generates an advised definition of the `documentation' function, and
-;; it will enable automatic advice activation when functions get defined.
-;; All of this can be undone at any time with `M-x ad-stop-advice'.
+;; should know:
;;
;; If you experience any strange behavior/errors etc. that you attribute to
;; Advice or to some ill-advised function do one of the following:
;; - M-x ad-deactivate FUNCTION (if you have a definite suspicion what
;; function gives you problems)
;; - M-x ad-deactivate-all (if you don't have a clue what's going wrong)
-;; - M-x ad-stop-advice (if you think the problem is related to the
-;; advised functions used by Advice itself)
;; - M-x ad-recover-normality (for real emergencies)
;; - If none of the above solves your Advice-related problem go to another
;; terminal, kill your Emacs process and send me some hate mail.
-;; The first three measures have restarts, i.e., once you've figured out
+;; The first two measures have restarts, i.e., once you've figured out
;; the problem you can reactivate advised functions with either `ad-activate',
-;; `ad-activate-all', or `ad-start-advice'. `ad-recover-normality' unadvises
+;; or `ad-activate-all'. `ad-recover-normality' unadvises
;; everything so you won't be able to reactivate any advised functions, you'll
;; have to stick with their standard incarnations for the rest of the session.
-;; IMPORTANT: With Advice loaded always do `M-x ad-deactivate-all' before
-;; you byte-compile a file, because advised special forms and macros can lead
-;; to unwanted compilation results. When you are done compiling use
-;; `M-x ad-activate-all' to go back to the advised state of all your
-;; advised functions.
-
;; RELAX: Advice is pretty safe even if you are oblivious to the above.
;; I use it extensively and haven't run into any serious trouble in a long
-;; time. Just wanted you to be warned.
+;; time. Just wanted you to be warned.
;; @ Customization:
;; ================
;; Look at the documentation of `ad-redefinition-action' for possible values
-;; of this variable. Its default value is `warn' which will print a warning
+;; of this variable. Its default value is `warn' which will print a warning
;; message when an already defined advised function gets redefined with a
;; new original definition and de/activated.
;; Look at the documentation of `ad-default-compilation-action' for possible
-;; values of this variable. Its default value is `maybe' which will compile
+;; values of this variable. Its default value is `maybe' which will compile
;; advised definitions during activation in case the byte-compiler is already
-;; loaded. Otherwise, it will leave them uncompiled.
+;; loaded. Otherwise, it will leave them uncompiled.
;; @ Motivation:
;; =============
;; Before I go on explaining how advice works, here are four simple examples
-;; how this package can be used. The first three are very useful, the last one
+;; how this package can be used. The first three are very useful, the last one
;; is just a joke:
;;(defadvice switch-to-buffer (before existing-buffers-only activate)
;; @ Advice documentation:
;; =======================
-;; Below is general documentation of the various features of advice. For more
+;; Below is general documentation of the various features of advice. For more
;; concrete examples check the corresponding sections in the tutorial part.
;; @@ Terminology:
;; ===============
;; - Emacs: Emacs as released by the GNU Project
-;; - jwz: Jamie Zawinski - creator of the byte-compiler used in v19s.
;; - Advice: The name of this package.
;; - advices: Short for "pieces of advice".
;; <name> is the name of the advice which has to be a non-nil symbol.
;; Names uniquely identify a piece of advice in a certain advice class,
;; hence, advices can be redefined by defining an advice with the same class
-;; and name. Advice names are global symbols, hence, the same name space
+;; and name. Advice names are global symbols, hence, the same name space
;; conventions used for function names should be applied.
;; An optional <position> specifies where in the current list of advices of
-;; the specified <class> this new advice will be placed. <position> has to
+;; the specified <class> this new advice will be placed. <position> has to
;; be either `first', `last' or a number that specifies a zero-based
-;; position (`first' is equivalent to 0). If no position is specified
-;; `first' will be used as a default. If this call to `defadvice' redefines
+;; position (`first' is equivalent to 0). If no position is specified
+;; `first' will be used as a default. If this call to `defadvice' redefines
;; an already existing advice (see above) then the position argument will
;; be ignored and the position of the already existing advice will be used.
;; An optional <arglist> which has to be a list can be used to define the
-;; argument list of the advised function. This argument list should of
+;; argument list of the advised function. This argument list should of
;; course be compatible with the argument list of the original function,
;; otherwise functions that call the advised function with the original
-;; argument list in mind will break. If more than one advice specify an
+;; argument list in mind will break. If more than one advice specify an
;; argument list then the first one (the one with the smallest position)
;; found in the list of before/around/after advices will be used.
;; `disable': Specifies that the defined advice should be disabled, hence,
;; it will not be used in an activation until somebody enables it.
;; `preactivate': Specifies that the advised function should get preactivated
-;; at macro-expansion/compile time of this `defadvice'. This
+;; at macro-expansion/compile time of this `defadvice'. This
;; generates a compiled advised definition according to the
;; current advice state which will be used during activation
-;; if appropriate. Only use this if the `defadvice' gets
+;; if appropriate. Only use this if the `defadvice' gets
;; actually compiled.
;; An optional <documentation-string> can be supplied to document the advice.
;; documentation strings of the original function and other advices.
;; An optional <interactive-form> form can be supplied to change/add
-;; interactive behavior of the original function. If more than one advice
+;; interactive behavior of the original function. If more than one advice
;; has an `(interactive ...)' specification then the first one (the one
;; with the smallest position) found in the list of before/around/after
;; advices will be used.
;; A possibly empty list of <body-forms> specifies the body of the advice in
-;; an implicit progn. The body of an advice can access/change arguments,
+;; an implicit progn. The body of an advice can access/change arguments,
;; the return value, the binding environment, and can have all sorts of
;; other side effects.
;; @@ Assembling advised definitions:
;; ==================================
;; Suppose a function/macro/subr/special-form has N pieces of before advice,
-;; M pieces of around advice and K pieces of after advice. Assuming none of
+;; M pieces of around advice and K pieces of after advice. Assuming none of
;; the advices is protected, its advised definition will look like this
;; (body-form indices correspond to the position of the respective advice in
;; that advice class):
;; be expanded into a proper documentation string upon call of `documentation'.
;; (interactive ...) is an optional interactive form either taken from the
-;; original function or from a before/around/after advice. For advised
+;; original function or from a before/around/after advice. For advised
;; interactive subrs that do not have an interactive form specified in any
;; advice we have to use (interactive) and then call the subr interactively
;; if the advised function was called interactively, because the
-;; interactive specification of subrs is not accessible. This is the only
+;; interactive specification of subrs is not accessible. This is the only
;; case where changing the values of arguments will not have an affect
;; because they will be reset by the interactive specification of the subr.
;; If this is a problem one can always specify an interactive form in a
;;
;; Then the body forms of the various advices in the various classes of advice
;; are assembled in order. The forms of around advice L are normally part of
-;; one of the forms of around advice L-1. An around advice can specify where
+;; one of the forms of around advice L-1. An around advice can specify where
;; the forms of the wrapped or surrounded forms should go with the special
-;; keyword `ad-do-it', which will be substituted with a `progn' containing the
-;; forms of the surrounded code.
+;; keyword `ad-do-it', which will run the forms of the surrounded code.
;; The innermost part of the around advice onion is
;; <apply original definition to <arglist>>
-;; whose form depends on the type of the original function. The variable
-;; `ad-return-value' will be set to its result. This variable is visible to
+;; whose form depends on the type of the original function. The variable
+;; `ad-return-value' will be set to its result. This variable is visible to
;; all pieces of advice which can access and modify it before it gets returned.
;;
;; The semantic structure of advised functions that contain protected pieces
-;; of advice is the same. The only difference is that `unwind-protect' forms
+;; of advice is the same. The only difference is that `unwind-protect' forms
;; make sure that the protected advice gets executed even if some previous
-;; piece of advice had an error or a non-local exit. If any around advice is
+;; piece of advice had an error or a non-local exit. If any around advice is
;; protected then the whole around advice onion will be protected.
;; @@ Argument access in advised functions:
;; ========================================
;; As already mentioned, the simplest way to access the arguments of an
-;; advised function in the body of an advice is to refer to them by name. To
-;; do that, the advice programmer needs to know either the names of the
+;; advised function in the body of an advice is to refer to them by name.
+;; To do that, the advice programmer needs to know either the names of the
;; argument variables of the original function, or the names used in the
-;; argument list redefinition given in a piece of advice. While this simple
+;; argument list redefinition given in a piece of advice. While this simple
;; method might be sufficient in many cases, it has the disadvantage that it
;; is not very portable because it hardcodes the argument names into the
;; advice. If the definition of the original function changes the advice
-;; might break even though the code might still be correct. Situations like
+;; might break even though the code might still be correct. Situations like
;; that arise, for example, if one advises a subr like `eval-region' which
;; gets redefined in a non-advice style into a function by the edebug
-;; package. If the advice assumes `eval-region' to be a subr it might break
-;; once edebug is loaded. Similar situations arise when one wants to use the
+;; package. If the advice assumes `eval-region' to be a subr it might break
+;; once edebug is loaded. Similar situations arise when one wants to use the
;; same piece of advice across different versions of Emacs.
;; As a solution to that advice provides argument list access macros that get
;; translated into the proper access forms at activation time, i.e., when the
-;; advised definition gets constructed. Access macros access actual arguments
+;; advised definition gets constructed. Access macros access actual arguments
;; by position regardless of how these actual argument get distributed onto
-;; the argument variables of a function. The rational behind this is that in
+;; the argument variables of a function. The rational behind this is that in
;; Emacs Lisp the semantics of an argument is strictly determined by its
;; position (there are no keyword arguments).
;;
;; (foo 0 1 2 3 4 5 6)
-;; which means that X=0, Y=1, Z=2 and R=(3 4 5 6). The assumption is that
-;; the semantics of an actual argument is determined by its position. It is
-;; this semantics that has to be known by the advice programmer. Then s/he
+;; which means that X=0, Y=1, Z=2 and R=(3 4 5 6). The assumption is that
+;; the semantics of an actual argument is determined by its position. It is
+;; this semantics that has to be known by the advice programmer. Then s/he
;; can access these arguments in a piece of advice with some of the
;; following macros (the arrows indicate what value they will return):
;; `(ad-get-arg <position>)' will return the actual argument that was supplied
;; at <position>, `(ad-get-args <position>)' will return the list of actual
-;; arguments supplied starting at <position>. Note that these macros can be
+;; arguments supplied starting at <position>. Note that these macros can be
;; used without any knowledge about the form of the actual argument list of
;; the original function.
;; Similarly, `(ad-set-arg <position> <value-form>)' can be used to set the
-;; value of the actual argument at <position> to <value-form>. For example,
+;; value of the actual argument at <position> to <value-form>. For example,
;;
;; (ad-set-arg 5 "five")
;;
;; will have the effect that R=(3 4 "five" 6) once the original function is
-;; called. `(ad-set-args <position> <value-list-form>)' can be used to set
+;; called. `(ad-set-args <position> <value-list-form>)' can be used to set
;; the list of actual arguments starting at <position> to <value-list-form>.
;; For example,
;;
;; will have the effect that X=5, Y=4, Z=3 and R=(2 1 0) once the original
;; function is called.
-;; All these access macros are text macros rather than real Lisp macros. When
+;; All these access macros are text macros rather than real Lisp macros. When
;; the advised definition gets constructed they get replaced with actual access
;; forms depending on the argument list of the advised function, i.e., after
;; that argument access is in most cases as efficient as using the argument
;; =======================================================
;; Some functions (such as `trace-function' defined in trace.el) need a
;; method of accessing the names and bindings of the arguments of an
-;; arbitrary advised function. To do that within an advice one can use the
+;; arbitrary advised function. To do that within an advice one can use the
;; special keyword `ad-arg-bindings' which is a text macro that will be
;; substituted with a form that will evaluate to a list of binding
;; specifications, one for every argument variable. These binding
;; ==========================
;; Because `defadvice' allows the specification of the argument list
;; of the advised function we need a mapping mechanism that maps this
-;; argument list onto that of the original function. Hence SYM and
+;; argument list onto that of the original function. Hence SYM and
;; NEWDEF have to be properly mapped onto the &rest variable when the
;; original definition is called. Advice automatically takes care of
;; that mapping, hence, the advice programmer can specify an argument
;; @@ Activation and deactivation:
;; ===============================
;; The definition of an advised function does not change until all its advice
-;; gets actually activated. Activation can either happen with the `activate'
+;; gets actually activated. Activation can either happen with the `activate'
;; flag specified in the `defadvice', with an explicit call or interactive
-;; invocation of `ad-activate', or if forward advice is enabled (i.e., the
-;; value of `ad-activate-on-definition' is t) at the time an already advised
-;; function gets defined.
+;; invocation of `ad-activate', or at the time an already advised function
+;; gets defined.
;; When a function gets first activated its original definition gets saved,
;; all defined and enabled pieces of advice will get combined with the
;; the file that contained the `defadvice' with the `preactivate' flag.
;; `ad-deactivate' can be used to back-define an advised function to its
-;; original definition. It can be called interactively or directly. Because
+;; original definition. It can be called interactively or directly. Because
;; `ad-activate' caches the advised definition the function can be
;; reactivated via `ad-activate' with only minor overhead (it is checked
;; whether the current advice state is consistent with the cached
;; `ad-activate-regexp' and `ad-deactivate-regexp' can be used to de/activate
;; all currently advised function that have a piece of advice with a name that
-;; contains a match for a regular expression. These functions can be used to
+;; contains a match for a regular expression. These functions can be used to
;; de/activate sets of functions depending on certain advice naming
;; conventions.
;; Finally, `ad-activate-all' and `ad-deactivate-all' can be used to
-;; de/activate all currently advised functions. These are useful to
+;; de/activate all currently advised functions. These are useful to
;; (temporarily) return to an un/advised state.
;; @@@ Reasons for the separation of advice definition and activation:
;; The advantage of this is that various pieces of advice can be defined
;; before they get combined into an advised definition which avoids
-;; unnecessary constructions of intermediate advised definitions. The more
+;; unnecessary constructions of intermediate advised definitions. The more
;; important advantage is that it allows the implementation of forward advice.
;; Advice information for a certain function accumulates as the value of the
-;; `advice-info' property of the function symbol. This accumulation is
+;; `advice-info' property of the function symbol. This accumulation is
;; completely independent of the fact that that function might not yet be
-;; defined. The special forms `defun' and `defmacro' have been advised to
-;; check whether the function/macro they defined had advice information
-;; associated with it. If so and forward advice is enabled, the original
+;; defined. The macros `defun' and `defmacro' check whether the
+;; function/macro they defined had advice information
+;; associated with it. If so and forward advice is enabled, the original
;; definition will be saved, and then the advice will be activated.
;; @@ Enabling/disabling pieces or sets of advice:
;; ===============================================
;; A major motivation for the development of this advice package was to bring
;; a little bit more structure into the function overloading chaos in Emacs
-;; Lisp. Many packages achieve some of their functionality by adding a little
+;; Lisp. Many packages achieve some of their functionality by adding a little
;; bit (or a lot) to the standard functionality of some Emacs Lisp function.
-;; ange-ftp is a very popular package that achieves its magic by overloading
-;; most Emacs Lisp functions that deal with files. A popular function that's
-;; overloaded by many packages is `expand-file-name'. The situation that one
-;; function is multiply overloaded can arise easily.
+;; ange-ftp is a very popular package that used to achieve its magic by
+;; overloading most Emacs Lisp functions that deal with files. A popular
+;; function that's overloaded by many packages is `expand-file-name'.
+;; The situation that one function is multiply overloaded can arise easily.
;; Once in a while it would be desirable to be able to disable some/all
;; overloads of a particular package while keeping all the rest. Ideally -
;; I know I am dreaming right now... In that ideal case the enable/disable
;; mechanism of advice could be used to achieve just that.
-;; Every piece of advice is associated with an enablement flag. When the
+;; Every piece of advice is associated with an enablement flag. When the
;; advised definition of a particular function gets constructed (e.g., during
;; activation) only the currently enabled pieces of advice will be considered.
;; This mechanism allows one to have different "views" of an advised function
;; Another motivation for this mechanism is that it allows one to define a
;; piece of advice for some function yet keep it dormant until a certain
-;; condition is met. Until then activation of the function will not make use
-;; of that piece of advice. Once the condition is met the advice can be
+;; condition is met. Until then activation of the function will not make use
+;; of that piece of advice. Once the condition is met the advice can be
;; enabled and a reactivation of the function will add its functionality as
-;; part of the new advised definition. For example, the advices of `defun'
-;; etc. used by advice itself will stay disabled until `ad-start-advice' is
-;; called and some variables have the proper values. Hence, if somebody
+;; part of the new advised definition. Hence, if somebody
;; else advised these functions too and activates them the advices defined
;; by advice will get used only if they are intended to be used.
;; The main interface to this mechanism are the interactive functions
-;; `ad-enable-advice' and `ad-disable-advice'. For example, the following
+;; `ad-enable-advice' and `ad-disable-advice'. For example, the following
;; would disable a particular advice of the function `foo':
;;
;; (ad-disable-advice 'foo 'before 'my-advice)
;;
;; (ad-activate 'foo)
;;
-;; or interactively. To disable whole sets of advices one can use a regular
-;; expression mechanism. For example, let us assume that ange-ftp actually
+;; or interactively. To disable whole sets of advices one can use a regular
+;; expression mechanism. For example, let us assume that ange-ftp actually
;; used advice to overload all its functions, and that it used the
;; "ange-ftp-" prefix for all its advice names, then we could temporarily
;; disable all its advices with
;;
-;; (ad-disable-regexp "^ange-ftp-")
+;; (ad-disable-regexp "\\`ange-ftp-")
;;
;; and the following call would put that actually into effect:
;;
-;; (ad-activate-regexp "^ange-ftp-")
+;; (ad-activate-regexp "\\`ange-ftp-")
;;
;; A safer way would have been to use
;;
-;; (ad-update-regexp "^ange-ftp-")
+;; (ad-update-regexp "\\`ange-ftp-")
;;
;; instead which would have only reactivated currently actively advised
-;; functions, but not functions that were currently inactive. All these
+;; functions, but not functions that were currently inactive. All these
;; functions can also be called interactively.
;; A certain piece of advice is considered a match if its name contains a
-;; match for the regular expression. To enable ange-ftp again we would use
+;; match for the regular expression. To enable ange-ftp again we would use
;; `ad-enable-regexp' and then activate or update again.
;; @@ Forward advice, automatic advice activation:
;; Advice implements forward advice mainly via the following: 1) Separation
;; of advice definition and activation that makes it possible to accumulate
;; advice information without having the original function already defined,
-;; 2) special versions of the built-in functions `fset/defalias' which check
-;; for advice information whenever they define a function. If advice
-;; information was found then the advice will immediately get activated when
-;; the function gets defined.
+;; 2) Use of the `defalias-fset-function' symbol property which lets
+;; us advise the function when it gets defined.
;; Automatic advice activation means, that whenever a function gets defined
-;; with either `defun', `defmacro', `fset' or by loading a byte-compiled
+;; with either `defun', `defmacro', `defalias' or by loading a byte-compiled
;; file, and the function has some advice-info stored with it then that
;; advice will get activated right away.
-;; @@@ Enabling automatic advice activation:
-;; =========================================
-;; Automatic advice activation is enabled by default. It can be disabled with
-;; `M-x ad-stop-advice' and enabled again with `M-x ad-start-advice'.
-
;; @@ Caching of advised definitions:
;; ==================================
;; After an advised definition got constructed it gets cached as part of the
;; advised function's advice-info so it can be reused, for example, after an
-;; intermediate deactivation. Because the advice-info of a function might
+;; intermediate deactivation. Because the advice-info of a function might
;; change between the time of caching and reuse a cached definition gets
;; a cache-id associated with it so it can be verified whether the cached
;; definition is still valid (the main application of this is preactivation
;; When an advised function gets activated and a verifiable cached definition
;; is available, then that definition will be used instead of creating a new
-;; advised definition from scratch. If you want to make sure that a new
+;; advised definition from scratch. If you want to make sure that a new
;; definition gets constructed then you should use `ad-clear-cache' before you
;; activate the advised function.
;; @@ Preactivation:
;; =================
-;; Constructing an advised definition is moderately expensive. In a situation
+;; Constructing an advised definition is moderately expensive. In a situation
;; where one package defines a lot of advised functions it might be
;; prohibitively expensive to do all the advised definition construction at
-;; runtime. Preactivation is a mechanism that allows compile-time construction
+;; runtime. Preactivation is a mechanism that allows compile-time construction
;; of compiled advised definitions that can be activated cheaply during
-;; runtime. Preactivation uses the caching mechanism to do that. Here's how it
-;; works:
+;; runtime. Preactivation uses the caching mechanism to do that. Here's how
+;; it works:
;; When the byte-compiler compiles a `defadvice' that has the `preactivate'
;; flag specified, it uses the current original definition of the advised
;; byte-compiler.
;; When the file with the compiled, preactivating `defadvice' gets loaded the
;; precompiled advised definition will be cached on the advised function's
-;; advice-info. When it gets activated (can be immediately on execution of the
+;; advice-info. When it gets activated (can be immediately on execution of the
;; `defadvice' or any time later) the cache-id gets checked against the
;; current state of advice and if it is verified the precompiled definition
-;; will be used directly (the verification is pretty cheap). If it couldn't get
-;; verified a new advised definition for that function will be built from
-;; scratch, hence, the efficiency added by the preactivation mechanism does
-;; not at all impair the flexibility of the advice mechanism.
+;; will be used directly (the verification is pretty cheap). If it couldn't
+;; get verified a new advised definition for that function will be built from
+;; scratch, hence, the efficiency added by the preactivation mechanism does not
+;; at all impair the flexibility of the advice mechanism.
;; MORAL: In order get all the efficiency out of preactivation the advice
;; state of an advised function at the time the file with the
;; preactivating `defadvice' gets byte-compiled should be exactly
;; the same as it will be when the advice of that function gets
-;; actually activated. If it is not there is a high chance that the
+;; actually activated. If it is not there is a high chance that the
;; cache-id will not match and hence a new advised definition will
;; have to be constructed at runtime.
-;; Preactivation and forward advice do not contradict each other. It is
+;; Preactivation and forward advice do not contradict each other. It is
;; perfectly ok to load a file with a preactivating `defadvice' before the
-;; original definition of the advised function is available. The constructed
+;; original definition of the advised function is available. The constructed
;; advised definition will be used once the original function gets defined and
-;; its advice gets activated. The only constraint is that at the time the
+;; its advice gets activated. The only constraint is that at the time the
;; file with the preactivating `defadvice' got compiled the original function
;; definition was available.
;; - `byte-compile' is part of the `features' variable even though you
;; did not use the byte-compiler
;; Right now advice does not provide an elegant way to find out whether
-;; and why a preactivation failed. What you can do is to trace the
+;; and why a preactivation failed. What you can do is to trace the
;; function `ad-cache-id-verification-code' (with the function
;; `trace-function-background' defined in my trace.el package) before
-;; any of your advised functions get activated. After they got
+;; any of your advised functions get activated. After they got
;; activated check whether all calls to `ad-cache-id-verification-code'
-;; returned `verified' as a result. Other values indicate why the
+;; returned `verified' as a result. Other values indicate why the
;; verification failed which should give you enough information to
;; fix your preactivation/compile/load/activation sequence.
;; IMPORTANT: There is one case (that I am aware of) that can make
;; preactivation fail, i.e., a preconstructed advised definition that does
-;; NOT match the current state of advice gets used nevertheless. That case
+;; NOT match the current state of advice gets used nevertheless. That case
;; arises if one package defines a certain piece of advice which gets used
;; during preactivation, and another package incompatibly redefines that
;; very advice (i.e., same function/class/name), and it is the second advice
;; MORAL-II: Redefining somebody else's advice is BAAAAD (to speak with
;; George Walker Bush), and why would you redefine your own advice anyway?
;; Advice is a mechanism to facilitate function redefinition, not advice
-;; redefinition (wait until I write Meta-Advice :-). If you really have
-;; to undo somebody else's advice try to write a "neutralizing" advice.
+;; redefinition (wait until I write Meta-Advice :-). If you really have
+;; to undo somebody else's advice, try to write a "neutralizing" advice.
-;; @@ Advising macros and special forms and other dangerous things:
-;; ================================================================
+;; @@ Advising macros and other dangerous things:
+;; ==============================================
;; Look at the corresponding tutorial sections for more information on
-;; these topics. Here it suffices to point out that the special treatment
-;; of macros and special forms by the byte-compiler can lead to problems
-;; when they get advised. Macros can create problems because they get
-;; expanded at compile time, hence, they might not have all the necessary
-;; runtime support and such advice cannot be de/activated or changed as
-;; it is possible for functions. Special forms create problems because they
-;; have to be advised "into" macros, i.e., an advised special form is a
-;; implemented as a macro, hence, in most cases the byte-compiler will
-;; not recognize it as a special form anymore which can lead to very strange
-;; results.
-;;
-;; MORAL: - Only advise macros or special forms when you are absolutely sure
-;; what you are doing.
-;; - As a safety measure, always do `ad-deactivate-all' before you
-;; byte-compile a file to make sure that even if some inconsiderate
-;; person advised some special forms you'll get proper compilation
-;; results. After compilation do `ad-activate-all' to get back to
-;; the previous state.
+;; these topics. Here it suffices to point out that the special treatment
+;; of macros can lead to problems when they get advised. Macros can create
+;; problems because they get expanded at compile or load time, hence, they
+;; might not have all the necessary runtime support and such advice cannot be
+;; de/activated or changed as it is possible for functions.
+;; Special forms cannot be advised.
+;;
+;; MORAL: - Only advise macros when you are absolutely sure what you are doing.
;; @@ Adding a piece of advice with `ad-add-advice':
;; =================================================
;; @@ Activation/deactivation advices, file load hooks:
;; ====================================================
;; There are two special classes of advice called `activation' and
-;; `deactivation'. The body forms of these advices are not included into the
+;; `deactivation'. The body forms of these advices are not included into the
;; advised definition of a function, rather they are assembled into a hook
;; form which will be evaluated whenever the advice-info of the advised
-;; function gets activated or deactivated. One application of this mechanism
+;; function gets activated or deactivated. One application of this mechanism
;; is to define file load hooks for files that do not provide such hooks.
;; For example, suppose you want to print a message whenever `file-x' gets
;; loaded, and suppose the last function defined in `file-x' is
;;
;; This will constitute a forward advice for function `file-x-last-fn' which
;; will get activated when `file-x' is loaded (only if forward advice is
-;; enabled of course). Because there are no "real" pieces of advice
+;; enabled of course). Because there are no "real" pieces of advice
;; available for it, its definition will not be changed, but the activation
;; advice will be run during its activation which is equivalent to having a
;; file load hook for `file-x'.
;; enabled advices are considered during construction of an advised
;; definition.
;; - Activation:
-;; Redefine an advised function with its advised definition. Constructs
+;; Redefine an advised function with its advised definition. Constructs
;; an advised definition from scratch if no verifiable cached advised
;; definition is available and caches it.
;; - Deactivation:
;; Back-define an advised function to its original definition.
;; - Update:
;; Reactivate an advised function but only if its advice is currently
-;; active. This can be used to bring all currently advised function up
+;; active. This can be used to bring all currently advised function up
;; to date with the current state of advice without also activating
;; currently inactive functions.
;; - Caching:
;; - Preactivation:
;; Is the construction of an advised definition according to the current
;; state of advice during byte-compilation of a file with a preactivating
-;; `defadvice'. That advised definition can then rather cheaply be used
+;; `defadvice'. That advised definition can then rather cheaply be used
;; during activation without having to construct an advised definition
;; from scratch at runtime.
;; @ Foo games: An advice tutorial
;; ===============================
-;; The following tutorial was created in Emacs 18.59. Left-justified
+;; The following tutorial was created in Emacs 18.59. Left-justified
;; s-expressions are input forms followed by one or more result forms.
-;; First we have to start the advice magic:
-;;
-;; (ad-start-advice)
-;; nil
;;
;; We start by defining an innocent looking function `foo' that simply
;; adds 1 to its argument X:
;; (call-interactively 'foo)
;; 6
;;
-;; Let's have a look at what the definition of `foo' looks like now
-;; (indentation added by hand for legibility):
-;;
-;; (symbol-function 'foo)
-;; (lambda (x)
-;; "$ad-doc: foo$"
-;; (interactive (list 5))
-;; (let (ad-return-value)
-;; (setq x (1- x))
-;; (setq x (1+ x))
-;; (setq ad-return-value (ad-Orig-foo x))
-;; ad-return-value))
-;;
;; @@ Around advices:
;; ==================
;; Now we'll try some `around' advices. An around advice is a wrapper around
;; (foo 3)
;; 8
;;
-;; Again, let's see what the definition of `foo' looks like so far:
-;;
-;; (symbol-function 'foo)
-;; (lambda (x)
-;; "$ad-doc: foo$"
-;; (interactive (list 5))
-;; (let (ad-return-value)
-;; (setq x (1- x))
-;; (setq x (1+ x))
-;; (let ((x (* x 2)))
-;; (let ((x (1+ x)))
-;; (setq ad-return-value (ad-Orig-foo x))))
-;; ad-return-value))
-;;
;; @@ Controlling advice activation:
;; =================================
;; In every `defadvice' so far we have used the flag `activate' to activate
;; 8
;;
;; Now we define another advice and activate which will also activate the
-;; previous advice `fg-times-x'. Note the use of the special variable
+;; previous advice `fg-times-x'. Note the use of the special variable
;; `ad-return-value' in the body of the advice which is set to the result of
-;; the original function. If we change its value then the value returned by
+;; the original function. If we change its value then the value returned by
;; the advised function will be changed accordingly:
;;
;; (defadvice foo (after fg-times-x-again act)
;; "Let's clean up now!"
;; error-in-foo
;;
-;; Again, let's see what `foo' looks like:
-;;
-;; (symbol-function 'foo)
-;; (lambda (x)
-;; "$ad-doc: foo$"
-;; (interactive (list 5))
-;; (let (ad-return-value)
-;; (unwind-protect
-;; (progn (setq x (1- x))
-;; (setq x (1+ x))
-;; (let ((x (* x 2)))
-;; (let ((x (1+ x)))
-;; (setq ad-return-value (ad-Orig-foo x))))
-;; (setq ad-return-value (* ad-return-value x))
-;; (setq ad-return-value (* ad-return-value x)))
-;; (print "Let's clean up now!"))
-;; ad-return-value))
-;;
;; @@ Compilation of advised definitions:
;; ======================================
;; Finally, we can specify the `compile' keyword in a `defadvice' to say
;; (print "Let's clean up now!"))
;; foo
;;
-;; Now `foo' is byte-compiled:
+;; Now `foo's advice is byte-compiled:
;;
-;; (symbol-function 'foo)
-;; (lambda (x)
-;; "$ad-doc: foo$"
-;; (interactive (byte-code "....." [5] 1))
-;; (byte-code "....." [ad-return-value x nil ((byte-code "....." [print "Let's clean up now!"] 2)) * 2 ad-Orig-foo] 6))
+;; (byte-code-function-p 'ad-Advice-foo)
+;; t
;;
;; (foo 3)
;; "Let's clean up now!"
;; deactivate functions that have a piece of advice defined by a certain
;; package (we save the old definition to check out caching):
;;
-;; (setq old-definition (symbol-function 'foo))
+;; (setq old-definition (symbol-function 'ad-Advice-foo))
;; (lambda (x) ....)
;;
;; (ad-deactivate-regexp "^fg-")
;; (ad-activate-regexp "^fg-")
;; nil
;;
-;; (eq old-definition (symbol-function 'foo))
+;; (eq old-definition (symbol-function 'ad-Advice-foo))
;; t
;;
;; (foo 3)
;;
;; @@ Forward advice:
;; ==================
-;; To enable automatic activation of forward advice we first have to set
-;; `ad-activate-on-definition' to t and restart advice:
-;;
-;; (setq ad-activate-on-definition t)
-;; t
-;;
-;; (ad-start-advice)
-;; (ad-activate-defined-function)
;;
;; Let's define a piece of advice for an undefined function:
;;
;; (fboundp 'bar)
;; nil
;;
-;; Now we define it and the forward advice will get activated (only because
-;; `ad-activate-on-definition' was t when we started advice above with
-;; `ad-start-advice'):
+;; Now we define it and the forward advice will get activated:
;;
;; (defun bar (x)
;; "Subtract 1 from X."
;; (ad-activate 'fie)
;; fie
;;
-;; (eq cached-definition (symbol-function 'fie))
+;; (eq cached-definition (symbol-function 'ad-Advice-fie))
;; t
;;
;; (fie 2)
;;
;; If you put a preactivating `defadvice' into a Lisp file that gets byte-
;; compiled then the constructed advised definition will get compiled by
-;; the byte-compiler. For that to occur in a v18 Emacs you had to put the
+;; the byte-compiler. For that to occur in a v18 Emacs you had to put the
;; `defadvice' inside a `defun' because the v18 compiler did not compile
;; top-level forms other than `defun' or `defmacro', for example,
;;
;; constructed during preactivation was used, even though we did not specify
;; the `compile' flag:
;;
-;; (symbol-function 'fum)
-;; (lambda (x)
-;; "$ad-doc: fum$"
-;; (byte-code "....." [ad-return-value x nil * 2 ad-Orig-fum] 4))
+;; (byte-code-function-p 'ad-Advice-fum)
+;; t
;;
;; (fum 2)
;; 8
;;
;; A preactivated definition will only be used if it matches the current
-;; function definition and advice information. If it does not match it
+;; function definition and advice information. If it does not match it
;; will simply be discarded and a new advised definition will be constructed
-;; from scratch. For example, let's first remove all advice-info for `fum':
+;; from scratch. For example, let's first remove all advice-info for `fum':
;;
;; (ad-unadvise 'fum)
;; (("fie") ("bar") ("foo") ...)
;; fum
;;
;; When we now try to use a preactivation it will not be used because the
-;; current advice state is different from the one at preactivation time. This
+;; current advice state is different from the one at preactivation time. This
;; is no tragedy, everything will work as expected just not as efficient,
;; because a new advised definition has to be constructed from scratch:
;;
;;
;; A new uncompiled advised definition got constructed:
;;
-;; (ad-compiled-p (symbol-function 'fum))
+;; (byte-code-function-p 'ad-Advice-fum)
;; nil
;;
;; (fum 2)
;;
;; MORAL: To get all the efficiency out of preactivation the function
;; definition and advice state at preactivation time must be the same as the
-;; state at activation time. Preactivation does work with forward advice, all
+;; state at activation time. Preactivation does work with forward advice, all
;; that's necessary is that the definition of the forward advised function is
;; available when the `defadvice' with the preactivation gets compiled.
;;
;; @@ Compilation idiosyncrasies:
;; ==============================
-;; `defadvice' expansion needs quite a few advice functions and variables,
-;; hence, I need to preload the file before it can be compiled. To avoid
-;; interference of bogus compiled files I always preload the source file:
-(provide 'advice-preload)
-;; During a normal load this is a noop:
-(require 'advice-preload "advice.el")
(require 'macroexp)
;; At run-time also, since ad-do-advised-functions returns code that uses it.
-(require 'cl-lib)
+(eval-when-compile (require 'cl-lib))
;; @@ Variable definitions:
;; ========================
(funcall fUnCtIoN tReE))
(t tReE)))
-;; @@ Save real definitions of subrs used by Advice:
-;; =================================================
-;; Advice depends on the real, unmodified functionality of various subrs,
-;; we save them here so advised versions will not interfere (eventually,
-;; we will save all subrs used in code generated by Advice):
-
-(defmacro ad-save-real-definition (function)
- (let ((saved-function (intern (format "ad-real-%s" function))))
- ;; Make sure the compiler is loaded during macro expansion:
- (require 'byte-compile "bytecomp")
- `(if (not (fboundp ',saved-function))
- (progn (fset ',saved-function (symbol-function ',function))
- ;; Copy byte-compiler properties:
- ,@(if (get function 'byte-compile)
- `((put ',saved-function 'byte-compile
- ',(get function 'byte-compile))))
- ,@(if (get function 'byte-opcode)
- `((put ',saved-function 'byte-opcode
- ',(get function 'byte-opcode))))))))
-
-(defun ad-save-real-definitions ()
- ;; Macro expansion will hardcode the values of the various byte-compiler
- ;; properties into the compiled version of this function such that the
- ;; proper values will be available at runtime without loading the compiler:
- (ad-save-real-definition fset)
- (ad-save-real-definition documentation))
-
-(ad-save-real-definitions)
-
-
;; @@ Advice info access fns:
;; ==========================
;; (after adv1 adv2 ...)
;; (activation adv1 adv2 ...)
;; (deactivation adv1 adv2 ...)
-;; (origname . <symbol fbound to origdef>)
+;; (advicefunname . <symbol fbound to assembled advice function>)
;; (cache . (<advised-definition> . <id>)))
;; List of currently advised though not necessarily activated functions
ad-advised-functions)))
(defmacro ad-do-advised-functions (varform &rest body)
- "`dolist'-style iterator that maps over `ad-advised-functions'.
-\(ad-do-advised-functions (VAR [RESULT-FORM])
+ "`dolist'-style iterator that maps over advised functions.
+\(ad-do-advised-functions (VAR)
BODY-FORM...)
On each iteration VAR will be bound to the name of an advised function
\(a symbol)."
(declare (indent 1))
- `(cl-dolist (,(car varform)
- ad-advised-functions
- ,(car (cdr varform)))
+ `(dolist (,(car varform) ad-advised-functions)
(setq ,(car varform) (intern (car ,(car varform))))
,@body))
(defmacro ad-get-advice-info-macro (function)
`(get ,function 'ad-advice-info))
-(defmacro ad-set-advice-info (function advice-info)
- `(put ,function 'ad-advice-info ,advice-info))
+(defsubst ad-set-advice-info (function advice-info)
+ (cond
+ (advice-info
+ (add-function :around (get function 'defalias-fset-function)
+ #'ad--defalias-fset))
+ ((get function 'defalias-fset-function)
+ (remove-function (get function 'defalias-fset-function)
+ #'ad--defalias-fset)))
+ (put function 'ad-advice-info advice-info))
(defmacro ad-copy-advice-info (function)
`(copy-tree (get ,function 'ad-advice-info)))
(defmacro ad-is-advised (function)
"Return non-nil if FUNCTION has any advice info associated with it.
This does not mean that the advice is also active."
- (list 'ad-get-advice-info-macro function))
+ `(ad-get-advice-info-macro ,function))
(defun ad-initialize-advice-info (function)
"Initialize the advice info for FUNCTION.
;; ad-find-advice uses the alist structure directly ->
;; change if this data structure changes!!
-(defmacro ad-advice-name (advice)
- (list 'car advice))
-(defmacro ad-advice-protected (advice)
- (list 'nth 1 advice))
-(defmacro ad-advice-enabled (advice)
- (list 'nth 2 advice))
-(defmacro ad-advice-definition (advice)
- (list 'nth 3 advice))
+(defsubst ad-advice-name (advice) (car advice))
+(defsubst ad-advice-protected (advice) (nth 1 advice))
+(defsubst ad-advice-enabled (advice) (nth 2 advice))
+(defsubst ad-advice-definition (advice) (nth 3 advice))
(defun ad-advice-set-enabled (advice flag)
(rplaca (cdr (cdr advice)) flag))
+(defvar ad-advice-classes '(before around after activation deactivation)
+ "List of defined advice classes.")
+
(defun ad-class-p (thing)
(memq thing ad-advice-classes))
(defun ad-name-p (thing)
;; @@ Advice access functions:
;; ===========================
-;; List of defined advice classes:
-(defvar ad-advice-classes '(before around after activation deactivation))
-
(defun ad-has-enabled-advice (function class)
"True if at least one of FUNCTION's advices in CLASS is enabled."
(cl-dolist (advice (ad-get-advice-info-field function class))
(defun ad-has-any-advice (function)
"True if the advice info of FUNCTION defines at least one advice."
(and (ad-is-advised function)
- (cl-dolist (class ad-advice-classes nil)
+ (cl-dolist (class ad-advice-classes)
(if (ad-get-advice-info-field function class)
(cl-return t)))))
;; @@ Dealing with automatic advice activation via `fset/defalias':
;; ================================================================
-;; Since Emacs 19.26 the built-in versions of `fset' and `defalias'
-;; take care of automatic advice activation, hence, we don't have to
-;; hack it anymore by advising `fset/defun/defmacro/byte-code/etc'.
+;; Automatic activation happens when a function gets defined via `defalias',
+;; which calls the `defalias-fset-function' (which we set to
+;; `ad--defalias-fset') instead of `fset', if non-nil.
-;; The functionality of the new `fset' is as follows:
-;;
-;; fset(sym,newdef)
-;; assign NEWDEF to SYM
-;; if (get SYM 'ad-advice-info)
-;; ad-activate-internal(SYM, nil)
-;; return (symbol-function SYM)
-;;
;; Whether advised definitions created by automatic activations will be
;; compiled depends on the value of `ad-default-compilation-action'.
-;; Since calling `ad-activate-internal' in the built-in definition of `fset' can
-;; create major disasters we have to be a bit careful. One precaution is
-;; to provide a dummy definition for `ad-activate-internal' which can be used to
-;; turn off automatic advice activation (e.g., when `ad-stop-advice' or
-;; `ad-recover-normality' are called). Another is to avoid recursive calls
-;; to `ad-activate' by using `ad-with-auto-activation-disabled' where
-;; appropriate, especially in a safe version of `fset'.
+(defalias 'ad-activate-internal 'ad-activate)
-;; For now define `ad-activate-internal' to the dummy definition:
-(defun ad-activate-internal (function &optional compile)
- "Automatic advice activation is disabled. `ad-start-advice' enables it."
- nil)
+(defun ad-make-advicefunname (function)
+ "Make name to be used to call the assembled advice function."
+ (intern (format "ad-Advice-%s" function)))
-;; This is just a copy of the above:
-(defun ad-activate-internal-off (function &optional compile)
- "Automatic advice activation is disabled. `ad-start-advice' enables it."
- nil)
+(defun ad-get-orig-definition (function) ;FIXME: Rename to "-unadvised-".
+ (if (symbolp function)
+ (setq function (if (fboundp function)
+ (advice--strip-macro (symbol-function function)))))
+ (while (advice--p function) (setq function (advice--cdr function)))
+ function)
-;; This will be t for top-level calls to `ad-activate-internal-on':
-(defvar ad-activate-on-top-level t)
-
-(defmacro ad-with-auto-activation-disabled (&rest body)
- `(let ((ad-activate-on-top-level nil))
- ,@body))
-
-(defun ad-safe-fset (symbol definition)
- "A safe `fset' which will never call `ad-activate-internal' recursively."
- (ad-with-auto-activation-disabled
- (ad-real-fset symbol definition)))
-
-
-;; @@ Access functions for original definitions:
-;; ============================================
-;; The advice-info of an advised function contains its `origname' which is
-;; a symbol that is fbound to the original definition available at the first
-;; proper activation of the function after a valid re/definition. If the
-;; original was defined via fcell indirection then `origname' will be defined
-;; just so. Hence, to get hold of the actual original definition of a function
-;; we need to use `ad-real-orig-definition'.
-
-(defun ad-make-origname (function)
- "Make name to be used to call the original FUNCTION."
- (intern (format "ad-Orig-%s" function)))
-
-(defmacro ad-get-orig-definition (function)
- `(let ((origname (ad-get-advice-info-field ,function 'origname)))
- (if (fboundp origname)
- (symbol-function origname))))
-
-(defmacro ad-set-orig-definition (function definition)
- `(ad-safe-fset
- (ad-get-advice-info-field ,function 'origname) ,definition))
-
-(defmacro ad-clear-orig-definition (function)
- `(fmakunbound (ad-get-advice-info-field ,function 'origname)))
+(defun ad-clear-advicefunname-definition (function)
+ (let ((advicefunname (ad-get-advice-info-field function 'advicefunname)))
+ (advice-remove function advicefunname)
+ (fmakunbound advicefunname)))
;; @@ Interactive input functions:
(error "ad-read-advised-function: There are no advised functions"))
(setq default
(or default
- ;; Prefer func name at point, if it's in ad-advised-functions etc.
+ ;; Prefer func name at point, if it's an advised function etc.
(let ((function (progn
(require 'help)
(function-called-at-point))))
(or (null predicate)
(funcall predicate function))
function))
- (ad-do-advised-functions (function)
- (if (or (null predicate)
- (funcall predicate function))
- (cl-return function)))
+ (cl-block nil
+ (ad-do-advised-functions (function)
+ (if (or (null predicate)
+ (funcall predicate function))
+ (cl-return function))))
(error "ad-read-advised-function: %s"
"There are no qualifying advised functions")))
- (let* ((ad-pReDiCaTe predicate)
- (function
+ (let* ((function
(completing-read
(format "%s (default %s): " (or prompt "Function") default)
ad-advised-functions
(if predicate
- (function
- (lambda (function)
- ;; Oops, no closures - the joys of dynamic scoping:
- ;; `predicate' clashed with the `predicate' argument
- ;; of `completing-read'.....
- (funcall ad-pReDiCaTe (intern (car function))))))
+ (lambda (function)
+ (funcall predicate (intern (car function)))))
t)))
(if (equal function "")
(if (ad-is-advised default)
(cond ((not (ad-is-advised function))
(ad-initialize-advice-info function)
(ad-set-advice-info-field
- function 'origname (ad-make-origname function))))
+ function 'advicefunname (ad-make-advicefunname function))))
(let* ((previous-position
(ad-advice-position function class (ad-advice-name advice)))
(advices (ad-get-advice-info-field function class))
"Take a macro function DEFINITION and make a lambda out of it."
`(cdr ,definition))
-(defun ad-special-form-p (definition)
- "Non-nil if and only if DEFINITION is a special form."
- (if (and (symbolp definition) (fboundp definition))
- (setq definition (indirect-function definition)))
- (and (subrp definition) (eq (cdr (subr-arity definition)) 'unevalled)))
-
(defmacro ad-subr-p (definition)
;;"non-nil if DEFINITION is a subr."
(list 'subrp definition))
(cdr definition))
(t nil)))
-(defun ad-arglist (definition &optional name)
- "Return the argument list of DEFINITION.
-If DEFINITION could be from a subr then its NAME should be
-supplied to make subr arglist lookup more efficient."
+(defun ad-arglist (definition)
+ "Return the argument list of DEFINITION."
(require 'help-fns)
(help-function-arglist
(if (or (ad-macro-p definition) (ad-advice-p definition))
"Return the unexpanded docstring of DEFINITION."
(let ((docstring
(if (ad-compiled-p definition)
- (ad-real-documentation definition t)
+ (documentation definition t)
(car (cdr (cdr (ad-lambda-expression definition)))))))
(if (or (stringp docstring)
(natnump docstring))
(if (ad-interactive-form definition) 1 0))
(cdr (cdr (ad-lambda-expression definition)))))))
-(defun ad-make-advised-definition-docstring (function)
+(defun ad-make-advised-definition-docstring (_function)
"Make an identifying docstring for the advised definition of FUNCTION.
Put function name into the documentation string so we can infer
the name of the advised function from the docstring. This is needed
to generate a proper advised docstring even if we are just given a
definition (see the code for `documentation')."
- (propertize "Advice doc string" 'ad-advice-info function))
+ (eval-when-compile
+ (propertize "Advice function assembled by advice.el."
+ 'dynamic-docstring-function
+ #'ad--make-advised-docstring)))
(defun ad-advised-definition-p (definition)
"Return non-nil if DEFINITION was generated from advice information."
(ad-compiled-p definition))
(let ((docstring (ad-docstring definition)))
(and (stringp docstring)
- (get-text-property 0 'ad-advice-info docstring)))))
+ (get-text-property 0 'dynamic-docstring-function docstring)))))
(defun ad-definition-type (definition)
"Return symbol that describes the type of DEFINITION."
+ ;; These symbols are only ever used to check a cache entry's validity.
+ ;; The suffix `2' reflects the fact that we're using version 2 of advice
+ ;; representations, so cache entries preactivated with version
+ ;; 1 can't be used.
(cond
- ((ad-macro-p definition) 'macro)
- ((ad-subr-p definition)
- (if (ad-special-form-p definition)
- 'special-form
- 'subr))
- ((or (ad-lambda-p definition)
- (ad-compiled-p definition))
- 'function)
- ((ad-advice-p definition) 'advice)))
+ ((ad-macro-p definition) 'macro2)
+ ((ad-subr-p definition) 'subr2)
+ ((or (ad-lambda-p definition) (ad-compiled-p definition)) 'fun2)
+ ((ad-advice-p definition) 'advice2))) ;; FIXME: Can this ever happen?
(defun ad-has-proper-definition (function)
"True if FUNCTION is a symbol with a proper definition.
definition))))
(defun ad-real-orig-definition (function)
- "Find FUNCTION's real original definition starting from its `origname'."
- (if (ad-is-advised function)
- (ad-real-definition (ad-get-advice-info-field function 'origname))))
+ (let* ((fun1 (ad-get-orig-definition function))
+ (fun2 (indirect-function fun1)))
+ (unless (autoloadp fun2) fun2)))
(defun ad-is-compilable (function)
"True if FUNCTION has an interpreted definition that can be compiled."
(ad-macro-p (symbol-function function)))
(not (ad-compiled-p (symbol-function function)))))
+(defvar warning-suppress-types) ;From warnings.el.
(defun ad-compile-function (function)
- "Byte-compiles FUNCTION (or macro) if it is not yet compiled."
- (interactive "aByte-compile function: ")
- (if (ad-is-compilable function)
- ;; Need to turn off auto-activation
- ;; because `byte-compile' uses `fset':
- (ad-with-auto-activation-disabled
- (require 'bytecomp)
- (require 'warnings) ;To define warning-suppress-types
- ;before we let-bind it.
- (let ((symbol (make-symbol "advice-compilation"))
- (byte-compile-warnings byte-compile-warnings)
- ;; Don't pop up windows showing byte-compiler warnings.
- (warning-suppress-types '((bytecomp))))
- (if (featurep 'cl)
- (byte-compile-disable-warning 'cl-functions))
- (fset symbol (symbol-function function))
- (byte-compile symbol)
- (fset function (symbol-function symbol))))))
+ "Byte-compile the assembled advice function."
+ (require 'bytecomp)
+ (require 'warnings) ;To define warning-suppress-types before we let-bind it.
+ (let ((byte-compile-warnings byte-compile-warnings)
+ ;; Don't pop up windows showing byte-compiler warnings.
+ (warning-suppress-types '((bytecomp))))
+ (if (featurep 'cl)
+ (byte-compile-disable-warning 'cl-functions))
+ (byte-compile (ad-get-advice-info-field function 'advicefunname))))
;; @@@ Accessing argument lists:
;; =============================
(let ((values-index 0)
argument-access set-forms)
(while (setq argument-access (ad-access-argument arglist index))
- (if (symbolp argument-access)
- (setq set-forms
- (cons (ad-set-argument
- arglist index
- (ad-element-access values-index 'ad-vAlUeS))
- set-forms))
- (setq set-forms
- (cons (if (= (car argument-access) 0)
- (list 'setq
- (car (cdr argument-access))
- (ad-list-access values-index 'ad-vAlUeS))
- (list 'setcdr
- (ad-list-access (1- (car argument-access))
- (car (cdr argument-access)))
- (ad-list-access values-index 'ad-vAlUeS)))
- set-forms))
- ;; terminate loop
- (setq arglist nil))
+ (push (if (symbolp argument-access)
+ (ad-set-argument
+ arglist index
+ (ad-element-access values-index 'ad-vAlUeS))
+ (setq arglist nil) ;; Terminate loop.
+ (if (= (car argument-access) 0)
+ `(setq
+ ,(car (cdr argument-access))
+ ,(ad-list-access values-index 'ad-vAlUeS))
+ `(setcdr
+ ,(ad-list-access (1- (car argument-access))
+ (car (cdr argument-access)))
+ ,(ad-list-access values-index 'ad-vAlUeS))))
+ set-forms)
(setq index (1+ index))
(setq values-index (1+ values-index)))
(if (null set-forms)
(if (= (length set-forms) 1)
;; For exactly one set-form we can use values-form directly,...
(ad-substitute-tree
- (function (lambda (form) (eq form 'ad-vAlUeS)))
- (function (lambda (form) values-form))
+ (lambda (form) (eq form 'ad-vAlUeS))
+ (lambda (_form) values-form)
(car set-forms))
;; ...if we have more we have to bind it to a variable:
`(let ((ad-vAlUeS ,values-form))
supplied as nil. Returns a `funcall' or `apply' form with the second element
being `function' which has to be replaced by an actual function argument.
Example: `(ad-map-arglists '(a &rest args) '(w x y z))' will return
- `(funcall function a (car args) (car (cdr args)) (nth 2 args))'."
+ `(funcall ad--addoit-function a (car args) (car (cdr args)) (nth 2 args))'."
(let* ((parsed-source-arglist (ad-parse-arglist source-arglist))
(source-reqopt-args (append (nth 0 parsed-source-arglist)
(nth 1 parsed-source-arglist)))
;; This produces ``error-proof'' target function calls with the exception
;; of a case like (&rest a) mapped onto (x &rest y) where the actual args
;; supplied to A might not be enough to supply the required target arg X
- (append (list (if need-apply 'apply 'funcall) 'function)
+ (append (list (if need-apply 'apply 'funcall) 'ad--addoit-function)
(cond (need-apply
;; `apply' can take care of that directly:
(append source-reqopt-args (list source-rest-arg)))
- (t (mapcar (function
- (lambda (arg)
- (setq target-arg-index (1+ target-arg-index))
- (ad-get-argument
- source-arglist target-arg-index)))
+ (t (mapcar (lambda (_arg)
+ (setq target-arg-index (1+ target-arg-index))
+ (ad-get-argument
+ source-arglist target-arg-index))
(append target-reqopt-args
(and target-rest-arg
;; If we have a rest arg gobble up
(nthcdr (length target-reqopt-args)
source-reqopt-args)))))))))
-(defun ad-make-mapped-call (source-arglist target-arglist target-function)
- "Make form to call TARGET-FUNCTION with args from SOURCE-ARGLIST."
- (let ((mapped-form (ad-map-arglists source-arglist target-arglist)))
- (if (eq (car mapped-form) 'funcall)
- (cons target-function (cdr (cdr mapped-form)))
- (prog1 mapped-form
- (setcar (cdr mapped-form) (list 'quote target-function))))))
;; @@@ Making an advised documentation string:
;; ===========================================
(let ((advice-docstring (ad-docstring (ad-advice-definition advice))))
(cond ((eq style 'plain)
advice-docstring)
- ((eq style 'freeze)
- (format "Permanent %s-advice `%s':%s%s"
- class (ad-advice-name advice)
- (if advice-docstring "\n" "")
- (or advice-docstring "")))
(t (if advice-docstring
(format "%s-advice `%s':\n%s"
(capitalize (symbol-name class))
(require 'help-fns) ;For help-split-fundoc and help-add-fundoc-usage.
-(defun ad-make-advised-docstring (function &optional style)
+(defun ad--make-advised-docstring (origdoc function &optional style)
"Construct a documentation string for the advised FUNCTION.
It concatenates the original documentation with the documentation
strings of the individual pieces of advice which will be formatted
-according to STYLE. STYLE can be `plain' or `freeze', everything else
+according to STYLE. STYLE can be `plain', everything else
will be interpreted as `default'. The order of the advice documentation
strings corresponds to before/around/after and the individual ordering
in any of these classes."
- (let* ((origdef (ad-real-orig-definition function))
- (origtype (symbol-name (ad-definition-type origdef)))
- (origdoc
- ;; Retrieve raw doc, key substitution will be taken care of later:
- (ad-real-documentation origdef t))
- (usage (help-split-fundoc origdoc function))
- paragraphs advice-docstring ad-usage)
+ (if (and (symbolp function)
+ (string-match "\\`ad-+Advice-" (symbol-name function)))
+ (setq function
+ (intern (substring (symbol-name function) (match-end 0)))))
+ (let* ((usage (help-split-fundoc origdoc function))
+ paragraphs advice-docstring)
(setq usage (if (null usage) t (setq origdoc (cdr usage)) (car usage)))
(if origdoc (setq paragraphs (list origdoc)))
- (unless (eq style 'plain)
- (push (concat "This " origtype " is advised.") paragraphs))
(dolist (class ad-advice-classes)
(dolist (advice (ad-get-enabled-advices function class))
(setq advice-docstring
(propertize
;; separate paragraphs with blank lines:
(mapconcat 'identity (nreverse paragraphs) "\n\n")
- 'ad-advice-info function)))
+ ;; FIXME: what is this for?
+ 'dynamic-docstring-function
+ #'ad--make-advised-docstring)))
(help-add-fundoc-usage origdoc usage)))
-(defun ad-make-plain-docstring (function)
- (ad-make-advised-docstring function 'plain))
-(defun ad-make-freeze-docstring (function)
- (ad-make-advised-docstring function 'freeze))
;; @@@ Accessing overriding arglists and interactive forms:
;; ========================================================
(if (and (ad-is-advised function)
(ad-has-redefining-advice function))
(let* ((origdef (ad-real-orig-definition function))
- (origname (ad-get-advice-info-field function 'origname))
- (orig-interactive-p (commandp origdef))
- (orig-subr-p (ad-subr-p origdef))
- (orig-special-form-p (ad-special-form-p origdef))
- (orig-macro-p (ad-macro-p origdef))
;; Construct the individual pieces that we need for assembly:
- (orig-arglist (ad-arglist origdef function))
+ (orig-arglist (let ((args (ad-arglist origdef)))
+ ;; The arglist may still be unknown.
+ (if (listp args) args '(&rest args))))
(advised-arglist (or (ad-advised-arglist function)
orig-arglist))
- (advised-interactive-form (ad-advised-interactive-form function))
- (interactive-form
- (cond (orig-macro-p nil)
- (advised-interactive-form)
- ((interactive-form origdef)
- (interactive-form
- (if (and (symbolp function) (get function 'elp-info))
- (aref (get function 'elp-info) 2)
- origdef)))))
+ (interactive-form (ad-advised-interactive-form function))
(orig-form
- (cond ((or orig-special-form-p orig-macro-p)
- ;; Special forms and macros will be advised into macros.
- ;; The trick is to construct an expansion for the advised
- ;; macro that does the correct thing when it gets eval'ed.
- ;; For macros we'll just use the expansion of the original
- ;; macro and return that. This way compiled advised macros
- ;; will be expanded into something useful. Note that after
- ;; advices have full control over whether they want to
- ;; evaluate the expansion (the value of `ad-return-value')
- ;; at macro expansion time or not. For special forms there
- ;; is no solution that interacts reasonably with the
- ;; compiler, hence we just evaluate the original at macro
- ;; expansion time and return the result. The moral of that
- ;; is that one should always deactivate advised special
- ;; forms before one byte-compiles a file.
- `(,(if orig-macro-p 'macroexpand 'eval)
- (cons ',origname
- ,(ad-get-arguments advised-arglist 0))))
- ((and orig-subr-p
- orig-interactive-p
- (not interactive-form)
- (not advised-interactive-form))
- ;; Check whether we were called interactively
- ;; in order to do proper prompting:
- `(if (called-interactively-p 'any)
- (call-interactively ',origname)
- ,(ad-make-mapped-call advised-arglist
- orig-arglist
- origname)))
- ;; And now for normal functions and non-interactive subrs
- ;; (or subrs whose interactive behavior was advised):
- (t (ad-make-mapped-call
- advised-arglist orig-arglist origname)))))
+ (ad-map-arglists advised-arglist orig-arglist)))
;; Finally, build the sucker:
(ad-assemble-advised-definition
- (cond (orig-macro-p 'macro)
- (orig-special-form-p 'special-form)
- (t 'function))
advised-arglist
(ad-make-advised-definition-docstring function)
interactive-form
(ad-get-enabled-advices function 'after)))))
(defun ad-assemble-advised-definition
- (type args docstring interactive orig &optional befores arounds afters)
-
- "Assembles an original and its advices into an advised function.
-It constructs a function or macro definition according to TYPE which has to
-be either `macro', `function' or `special-form'. ARGS is the argument list
-that has to be used, DOCSTRING if non-nil defines the documentation of the
-definition, INTERACTIVE if non-nil is the interactive form to be used,
+ (args docstring interactive orig &optional befores arounds afters)
+ "Assemble the advices into an overall advice function.
+ARGS is the argument list that has to be used,
+DOCSTRING if non-nil defines the documentation of the definition,
+INTERACTIVE if non-nil is the interactive form to be used,
ORIG is a form that calls the body of the original unadvised function,
and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG
should be modified. The assembled function will be returned."
(setq around-form-protected t))
(setq around-form
(ad-substitute-tree
- (function (lambda (form) (eq form 'ad-do-it)))
- (function (lambda (form) around-form))
+ (lambda (form) (eq form 'ad-do-it))
+ (lambda (_form) around-form)
(macroexp-progn (ad-body-forms (ad-advice-definition advice))))))
(setq after-forms
(ad-body-forms (ad-advice-definition advice)))))))
(setq definition
- `(,@(if (memq type '(macro special-form)) '(macro))
- lambda
- ,args
+ `(lambda (ad--addoit-function ,@args)
,@(if docstring (list docstring))
,@(if interactive (list interactive))
(let (ad-return-value)
,@after-forms
- ,(if (eq type 'special-form)
- '(list 'quote ad-return-value)
- 'ad-return-value))))
+ ad-return-value)))
(ad-insert-argument-access-forms definition args)))
"Generate an identifying image of the current advices of FUNCTION."
(let ((original-definition (ad-real-orig-definition function))
(cached-definition (ad-get-cache-definition function)))
- (list (mapcar (function (lambda (advice) (ad-advice-name advice)))
+ (list (mapcar #'ad-advice-name
(ad-get-enabled-advices function 'before))
- (mapcar (function (lambda (advice) (ad-advice-name advice)))
+ (mapcar #'ad-advice-name
(ad-get-enabled-advices function 'around))
- (mapcar (function (lambda (advice) (ad-advice-name advice)))
+ (mapcar #'ad-advice-name
(ad-get-enabled-advices function 'after))
(ad-definition-type original-definition)
- (if (equal (ad-arglist original-definition function)
+ (if (equal (ad-arglist original-definition)
(ad-arglist cached-definition))
t
- (ad-arglist original-definition function))
+ (ad-arglist original-definition))
(if (eq (ad-definition-type original-definition) 'function)
(equal (interactive-form original-definition)
(interactive-form cached-definition))))))
(and (eq (nth 3 cache-id) (ad-definition-type original-definition))
(setq code 'arglist-mismatch)
(equal (if (eq (nth 4 cache-id) t)
- (ad-arglist original-definition function)
+ (ad-arglist original-definition)
(nth 4 cache-id) )
(ad-arglist cached-definition))
(setq code 'interactive-form-mismatch)
(ad-set-advice-info function old-advice-info)
;; Don't `fset' function to nil if it was previously unbound:
(if function-defined-p
- (ad-safe-fset function old-definition)
+ (fset function old-definition)
(fmakunbound function)))))
-;; @@ Freezing:
-;; ============
-;; Freezing transforms a `defadvice' into a redefining `defun/defmacro'
-;; for the advised function without keeping any advice information. This
-;; feature was jwz's idea: It generates a dumpable function definition
-;; whose documentation can be written to the DOC file, and the generated
-;; code does not need any Advice runtime support. Of course, frozen advices
-;; cannot be undone.
-
-;; Freezing only considers the advice of the particular `defadvice', other
-;; already existing advices for the same function will be ignored. To ensure
-;; proper interaction when an already advised function gets redefined with
-;; a frozen advice, frozen advices always use the actual original definition
-;; of the function, i.e., they are always at the core of the onion. E.g., if
-;; an already advised function gets redefined with a frozen advice and then
-;; unadvised, the frozen advice remains as the new definition of the function.
-
-;; While multiple freeze advices for a single function or freeze-advising
-;; of an already advised function are possible, they are better avoided,
-;; because definition/compile/load ordering is relevant, and it becomes
-;; incomprehensible pretty quickly.
-
-(defun ad-make-freeze-definition (function advice class position)
- (if (not (ad-has-proper-definition function))
- (error
- "ad-make-freeze-definition: `%s' is not yet defined"
- function))
- (let* ((name (ad-advice-name advice))
- ;; With a unique origname we can have multiple freeze advices
- ;; for the same function, each overloading the previous one:
- (unique-origname
- (intern (format "%s-%s-%s" (ad-make-origname function) class name)))
- (orig-definition
- ;; If FUNCTION is already advised, we'll use its current origdef
- ;; as the original definition of the frozen advice:
- (or (ad-get-orig-definition function)
- (symbol-function function)))
- (old-advice-info
- (if (ad-is-advised function)
- (ad-copy-advice-info function)))
- (real-docstring-fn
- (symbol-function 'ad-make-advised-definition-docstring))
- (real-origname-fn
- (symbol-function 'ad-make-origname))
- (frozen-definition
- (unwind-protect
- (progn
- ;; Make sure we construct a proper docstring:
- (ad-safe-fset 'ad-make-advised-definition-docstring
- 'ad-make-freeze-docstring)
- ;; Make sure `unique-origname' is used as the origname:
- (ad-safe-fset 'ad-make-origname (lambda (x) unique-origname))
- ;; No we reset all current advice information to nil and
- ;; generate an advised definition that's solely determined
- ;; by ADVICE and the current origdef of FUNCTION:
- (ad-set-advice-info function nil)
- (ad-add-advice function advice class position)
- ;; The following will provide proper real docstrings as
- ;; well as a definition that will make the compiler happy:
- (ad-set-orig-definition function orig-definition)
- (ad-make-advised-definition function))
- ;; Restore the old advice state:
- (ad-set-advice-info function old-advice-info)
- ;; Restore functions:
- (ad-safe-fset
- 'ad-make-advised-definition-docstring real-docstring-fn)
- (ad-safe-fset 'ad-make-origname real-origname-fn))))
- (if frozen-definition
- (let* ((macro-p (ad-macro-p frozen-definition))
- (body (cdr (if macro-p
- (ad-lambdafy frozen-definition)
- frozen-definition))))
- `(progn
- (if (not (fboundp ',unique-origname))
- (fset ',unique-origname
- ;; avoid infinite recursion in case the function
- ;; we want to freeze is already advised:
- (or (ad-get-orig-definition ',function)
- (symbol-function ',function))))
- (,(if macro-p 'defmacro 'defun)
- ,function
- ,@body))))))
-
-
;; @@ Activation and definition handling:
;; ======================================
If COMPILE is a negative number then it returns nil.
If COMPILE is nil then the result depends on the value of
`ad-default-compilation-action' (which see)."
- (if (integerp compile)
- (>= compile 0)
- (if compile
- compile
- (cond ((eq ad-default-compilation-action 'never)
- nil)
- ((eq ad-default-compilation-action 'always)
- t)
- ((eq ad-default-compilation-action 'like-original)
- (or (ad-subr-p (ad-get-orig-definition function))
- (ad-compiled-p (ad-get-orig-definition function))))
- ;; everything else means `maybe':
- (t (featurep 'byte-compile))))))
+ (cond
+ ;; Don't compile until the real function definition is known (bug#12965).
+ ((not (ad-real-orig-definition function)) nil)
+ ((integerp compile) (>= compile 0))
+ (compile)
+ ((eq ad-default-compilation-action 'never) nil)
+ ((eq ad-default-compilation-action 'always) t)
+ ((eq ad-default-compilation-action 'like-original)
+ (or (ad-subr-p (ad-get-orig-definition function))
+ (ad-compiled-p (ad-get-orig-definition function))))
+ ;; everything else means `maybe':
+ (t (featurep 'byte-compile))))
(defun ad-activate-advised-definition (function compile)
"Redefine FUNCTION with its advised definition from cache or scratch.
The resulting FUNCTION will be compiled if `ad-should-compile' returns t.
The current definition and its cache-id will be put into the cache."
- (let ((verified-cached-definition
- (if (ad-verify-cache-id function)
- (ad-get-cache-definition function))))
- (ad-safe-fset function
- (or verified-cached-definition
- (ad-make-advised-definition function)))
+ (let* ((verified-cached-definition
+ (if (ad-verify-cache-id function)
+ (ad-get-cache-definition function)))
+ (advicefunname (ad-get-advice-info-field function 'advicefunname))
+ (old-ispec (interactive-form advicefunname)))
+ (fset advicefunname
+ (or verified-cached-definition
+ (ad-make-advised-definition function)))
+ (unless (equal (interactive-form advicefunname) old-ispec)
+ ;; If the interactive-spec of advicefunname has changed, force nadvice to
+ ;; refresh its copy.
+ (advice-remove function advicefunname))
+ (advice-add function :around advicefunname)
(if (ad-should-compile function compile)
(ad-compile-function function))
(if verified-cached-definition
- (if (not (eq verified-cached-definition (symbol-function function)))
+ (if (not (eq verified-cached-definition
+ (symbol-function advicefunname)))
;; we must have compiled, cache the compiled definition:
- (ad-set-cache
- function (symbol-function function) (ad-get-cache-id function)))
+ (ad-set-cache function (symbol-function advicefunname)
+ (ad-get-cache-id function)))
;; We created a new advised definition, cache it with a proper id:
(ad-clear-cache function)
;; ad-make-cache-id needs the new cached definition:
- (ad-set-cache function (symbol-function function) nil)
+ (ad-set-cache function (symbol-function advicefunname) nil)
(ad-set-cache
- function (symbol-function function) (ad-make-cache-id function)))))
+ function (symbol-function advicefunname) (ad-make-cache-id function)))))
-(defun ad-handle-definition (function)
+(defun ad--defalias-fset (fsetfun function newdef)
+ ;; Besides ad-redefinition-action we use this defalias-fset-function hook
+ ;; for two other reasons:
+ ;; - for `activation/deactivation' advices.
+ ;; - to rebuild the ad-Advice-* function with the right argument names.
"Handle re/definition of an advised FUNCTION during de/activation.
If FUNCTION does not have an original definition associated with it and
the current definition is usable, then it will be stored as FUNCTION's
de/activated. If you do not like the current redefinition action change
the value of `ad-redefinition-action' and de/activate again."
(let ((original-definition (ad-get-orig-definition function))
- (current-definition (if (ad-real-definition function)
- (symbol-function function))))
+ (current-definition (ad-get-orig-definition newdef)))
(if original-definition
(if current-definition
- (if (and (not (eq current-definition original-definition))
- ;; Redefinition with an advised definition from a
- ;; different function won't count as such:
- (not (ad-advised-definition-p current-definition)))
- ;; we have a redefinition:
+ (if (not (eq current-definition original-definition))
+ ;; We have a redefinition:
(if (not (memq ad-redefinition-action '(accept discard warn)))
- (error "ad-handle-definition (see its doc): `%s' %s"
+ (error "ad-redefinition-action: `%s' %s"
function "invalidly redefined")
(if (eq ad-redefinition-action 'discard)
- (ad-safe-fset function original-definition)
- (ad-set-orig-definition function current-definition)
+ nil ;; Just drop it!
+ (funcall (or fsetfun #'fset) function newdef)
+ (ad-activate-internal function)
(if (eq ad-redefinition-action 'warn)
(message "ad-handle-definition: `%s' got redefined"
function))))
;; either advised def or correct original is in place:
nil)
- ;; we have an undefinition, ignore it:
- nil)
- (if current-definition
- ;; we have a first definition, save it as original:
- (ad-set-orig-definition function current-definition)
- ;; we don't have anything noteworthy:
- nil))))
+ ;; We have an undefinition, ignore it:
+ (funcall (or fsetfun #'fset) function newdef))
+ (funcall (or fsetfun #'fset) function newdef)
+ (when current-definition (ad-activate-internal function)))))
;; @@ The top-level advice interface:
(interactive
(list (ad-read-advised-function "Activate advice of")
current-prefix-arg))
- (if ad-activate-on-top-level
- ;; avoid recursive calls to `ad-activate':
- (ad-with-auto-activation-disabled
- (if (not (ad-is-advised function))
- (error "ad-activate: `%s' is not advised" function)
- (ad-handle-definition function)
- ;; Just return for forward advised and not yet defined functions:
- (if (ad-get-orig-definition function)
- (if (not (ad-has-any-advice function))
- (ad-unadvise function)
- ;; Otherwise activate the advice:
- (cond ((ad-has-redefining-advice function)
- (ad-activate-advised-definition function compile)
- (ad-set-advice-info-field function 'active t)
- (eval (ad-make-hook-form function 'activation))
- function)
- ;; Here we are if we have all disabled advices:
- (t (ad-deactivate function)))))))))
+ (cond
+ ((not (ad-is-advised function))
+ (error "ad-activate: `%s' is not advised" function))
+ ;; Just return for forward advised and not yet defined functions:
+ ((not (ad-get-orig-definition function)) nil)
+ ((not (ad-has-any-advice function)) (ad-unadvise function))
+ ;; Otherwise activate the advice:
+ ((ad-has-redefining-advice function)
+ (ad-activate-advised-definition function compile)
+ (ad-set-advice-info-field function 'active t)
+ (eval (ad-make-hook-form function 'activation))
+ function)
+ ;; Here we are if we have all disabled advices:
+ (t (ad-deactivate function))))
(defalias 'ad-activate-on 'ad-activate)
(if (not (ad-is-advised function))
(error "ad-deactivate: `%s' is not advised" function)
(cond ((ad-is-active function)
- (ad-handle-definition function)
(if (not (ad-get-orig-definition function))
(error "ad-deactivate: `%s' has no original definition"
function)
- (ad-safe-fset function (ad-get-orig-definition function))
+ (ad-clear-advicefunname-definition function)
(ad-set-advice-info-field function 'active nil)
(eval (ad-make-hook-form function 'deactivation))
function)))))
(cond ((ad-is-advised function)
(if (ad-is-active function)
(ad-deactivate function))
- (ad-clear-orig-definition function)
+ (ad-clear-advicefunname-definition function)
(ad-set-advice-info function nil)
(ad-pop-advised-function function))))
(list (intern
(completing-read "Recover advised function: " obarray nil t))))
(cond ((ad-is-advised function)
- (cond ((ad-get-orig-definition function)
- (ad-safe-fset function (ad-get-orig-definition function))
- (ad-clear-orig-definition function)))
+ (ad-clear-advicefunname-definition function)
(ad-set-advice-info function nil)
(ad-pop-advised-function function))))
;; Completion alist of valid `defadvice' flags
(defvar ad-defadvice-flags
'(("protect") ("disable") ("activate")
- ("compile") ("preactivate") ("freeze")))
+ ("compile") ("preactivate")))
;;;###autoload
(defmacro defadvice (function args &rest body)
ARGLIST ::= An optional argument list to be used for the advised function
instead of the argument list of the original. The first one found in
before/around/after-advices will be used.
-FLAG ::= `protect'|`disable'|`activate'|`compile'|`preactivate'|`freeze'.
+FLAG ::= `protect'|`disable'|`activate'|`compile'|`preactivate'.
All flags can be specified with unambiguous initial substrings.
DOCSTRING ::= Optional documentation for this piece of advice.
INTERACTIVE-FORM ::= Optional interactive form to be used for the advised
advice state that will be used during activation if appropriate. Only use
this if the `defadvice' gets actually compiled.
-`freeze': Expands the `defadvice' into a redefining `defun/defmacro' according
-to this particular single advice. No other advice information will be saved.
-Frozen advices cannot be undone, they behave like a hard redefinition of
-the advised function. `freeze' implies `activate' and `preactivate'. The
-documentation of the advised function can be dumped onto the `DOC' file
-during preloading.
-
See Info node `(elisp)Advising Functions' for comprehensive documentation.
usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...)
[DOCSTRING] [INTERACTIVE-FORM]
(ad-preactivate-advice
function advice class position))))
;; Now for the things to be done at evaluation time:
- (if (memq 'freeze flags)
- ;; jwz's idea: Freeze the advised definition into a dumpable
- ;; defun/defmacro whose docs can be written to the DOC file:
- (ad-make-freeze-definition function advice class position)
- ;; the normal case:
- `(progn
- (ad-add-advice ',function ',advice ',class ',position)
- ,@(if preactivation
- `((ad-set-cache
- ',function
- ;; the function will get compiled:
- ,(cond ((ad-macro-p (car preactivation))
- `(ad-macrofy
- (function
- ,(ad-lambdafy
- (car preactivation)))))
- (t `(function
- ,(car preactivation))))
- ',(car (cdr preactivation)))))
- ,@(if (memq 'activate flags)
- `((ad-activate ',function
- ,(if (memq 'compile flags) t))))
- ',function))))
+ `(progn
+ (ad-add-advice ',function ',advice ',class ',position)
+ ,@(if preactivation
+ `((ad-set-cache
+ ',function
+ ;; the function will get compiled:
+ ,(cond ((ad-macro-p (car preactivation))
+ `(ad-macrofy
+ (function
+ ,(ad-lambdafy
+ (car preactivation)))))
+ (t `(function
+ ,(car preactivation))))
+ ',(car (cdr preactivation)))))
+ ,@(if (memq 'activate flags)
+ `((ad-activate ',function
+ ,(if (memq 'compile flags) t))))
+ ',function)))
;; @@ Tools:
;; Make forms to redefine functions to their
;; original definitions if they are advised:
(setq index -1)
- (mapcar
- (function
- (lambda (function)
- (setq index (1+ index))
- `(ad-safe-fset
- ',function
- (or (ad-get-orig-definition ',function)
- ,(car (nth index current-bindings))))))
- functions))
+ (mapcar (lambda (function)
+ (setq index (1+ index))
+ `(fset ',function
+ (or (ad-get-orig-definition ',function)
+ ,(car (nth index current-bindings)))))
+ functions))
,@body)
,@(progn
;; Make forms to back-define functions to the definitions
;; they had outside this macro call:
(setq index -1)
- (mapcar
- (function
- (lambda (function)
- (setq index (1+ index))
- `(ad-safe-fset
- ',function
- ,(car (nth index current-bindings)))))
- functions))))))
+ (mapcar (lambda (function)
+ (setq index (1+ index))
+ `(fset ',function
+ ,(car (nth index current-bindings))))
+ functions))))))
;; @@ Starting, stopping and recovering from the advice package magic:
;; ===================================================================
-(defun ad-start-advice ()
- "Start the automatic advice handling magic."
- (interactive)
- ;; Advising `ad-activate-internal' means death!!
- (ad-set-advice-info 'ad-activate-internal nil)
- (ad-safe-fset 'ad-activate-internal 'ad-activate))
-
-(defun ad-stop-advice ()
- "Stop the automatic advice handling magic.
-You should only need this in case of Advice-related emergencies."
- (interactive)
- ;; Advising `ad-activate-internal' means death!!
- (ad-set-advice-info 'ad-activate-internal nil)
- (ad-safe-fset 'ad-activate-internal 'ad-activate-internal-off))
-
(defun ad-recover-normality ()
"Undo all advice related redefinitions and unadvises everything.
Use only in REAL emergencies."
(interactive)
- ;; Advising `ad-activate-internal' means death!!
- (ad-set-advice-info 'ad-activate-internal nil)
- (ad-safe-fset 'ad-activate-internal 'ad-activate-internal-off)
(ad-recover-all)
- (setq ad-advised-functions nil))
-
-(ad-start-advice)
+ (ad-do-advised-functions (function)
+ (message "Oops! Left over advised function %S" function)
+ (ad-pop-advised-function function)))
(provide 'advice)
boundp buffer-file-name buffer-local-variables buffer-modified-p
buffer-substring byte-code-function-p
capitalize car-less-than-car car cdr ceiling char-after char-before
- char-equal char-to-string char-width
- compare-strings concat coordinates-in-window-p
+ char-equal char-to-string char-width compare-strings
+ compare-window-configurations concat coordinates-in-window-p
copy-alist copy-sequence copy-marker cos count-lines
decode-char
decode-time default-boundp default-value documentation downcase
fboundp fceiling featurep ffloor
file-directory-p file-exists-p file-locked-p file-name-absolute-p
file-newer-than-file-p file-readable-p file-symlink-p file-writable-p
- float float-time floor format format-time-string frame-visible-p
- fround ftruncate
+ float float-time floor format format-time-string frame-first-window
+ frame-root-window frame-selected-window
+ frame-visible-p fround ftruncate
get gethash get-buffer get-buffer-window getenv get-file-buffer
hash-table-count
int-to-string intern-soft
keymap-parent
length local-variable-if-set-p local-variable-p log log10 logand
logb logior lognot logxor lsh langinfo
- make-list make-string make-symbol
- marker-buffer max member memq min mod multibyte-char-to-unibyte
- next-window nth nthcdr number-to-string
+ make-list make-string make-symbol marker-buffer max member memq min
+ minibuffer-selected-window minibuffer-window
+ mod multibyte-char-to-unibyte next-window nth nthcdr number-to-string
parse-colon-path plist-get plist-member
prefix-numeric-value previous-window prin1-to-string propertize
degrees-to-radians
unibyte-char-to-multibyte upcase user-full-name
user-login-name user-original-login-name custom-variable-p
vconcat
- window-buffer window-dedicated-p window-edges window-height
- window-hscroll window-minibuffer-p window-width
- zerop))
+ window-absolute-pixel-edges window-at window-body-height
+ window-body-width window-buffer window-dedicated-p window-display-table
+ window-combination-limit window-edges window-frame window-fringes
+ window-height window-hscroll window-inside-edges
+ window-inside-absolute-pixel-edges window-inside-pixel-edges
+ window-left-child window-left-column window-margins window-minibuffer-p
+ window-next-buffers window-next-sibling window-new-normal
+ window-new-total window-normal-size window-parameter window-parameters
+ window-parent window-pixel-edges window-point window-prev-buffers
+ window-prev-sibling window-redisplay-end-trigger window-scroll-bars
+ window-start window-text-height window-top-child window-top-line
+ window-total-height window-total-width window-use-time window-vscroll
+ window-width zerop))
(side-effect-and-error-free-fns
'(arrayp atom
bobp bolp bool-vector-p
this-single-command-raw-keys
user-real-login-name user-real-uid user-uid
vector vectorp visible-frame-list
- wholenump window-configuration-p window-live-p windowp)))
+ wholenump window-configuration-p window-live-p
+ window-valid-p windowp)))
(while side-effect-free-fns
(put (car side-effect-free-fns) 'side-effect-free t)
(setq side-effect-free-fns (cdr side-effect-free-fns)))
#'(lambda (f _args new-name when)
`(make-obsolete ',f ',new-name ,when)))
(list 'compiler-macro
- #'(lambda (f _args compiler-function)
- (if (not (symbolp compiler-function))
- (error "Only symbols are supported in `compiler-macro'")
- `(put ',f 'compiler-macro #',compiler-function))))
+ #'(lambda (f args compiler-function)
+ ;; FIXME: Make it possible to just reuse `args'.
+ `(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)))))
(list 'doc-string
#'(lambda (f _args pos)
(list 'put (list 'quote f) ''doc-string-elt (list 'quote pos))))
(defconst byte-compile-initial-macro-environment
'(
-;; (byte-compiler-options . (lambda (&rest forms)
-;; (apply 'byte-compiler-options-handler forms)))
+ ;; (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
(byte-compile-top-level
(byte-compile-preprocess (cons 'progn body)))))))
(eval-and-compile . (lambda (&rest body)
- (byte-compile-eval-before-compile (cons 'progn body))
- (cons 'progn 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)))))
"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.")
;; Also, this lets us notice references to free variables.
(defmacro byte-compile-push-bytecodes (&rest args)
- "Push BYTE... onto BYTES, and increment PC by the number of bytes pushed.
-ARGS is of the form (BYTE... BYTES PC), where BYTES and PC are variable names.
-BYTES and PC are updated after evaluating all the arguments."
+ "Push bytes onto BVAR, and increment CVAR by the number of bytes pushed.
+BVAR and CVAR are variables which are updated after evaluating
+all the arguments.
+
+\(fn BYTE1 BYTE2 ... BYTEn BVAR CVAR)"
(let ((byte-exprs (butlast args 2))
(bytes-var (car (last args 2)))
(pc-var (car (last args))))
(let ((xs (pop hist-new))
old-autoloads)
;; Make sure the file was not already loaded before.
- (unless (or (assoc (car xs) hist-orig)
- ;; Don't give both the "noruntime" and
- ;; "cl-functions" warning for the same function.
- ;; FIXME This seems incorrect - these are two
- ;; independent warnings. For example, you may be
- ;; choosing to see the cl warnings but ignore them.
- ;; You probably don't want to ignore noruntime in the
- ;; same way.
- (and (byte-compile-warning-enabled-p 'cl-functions)
- (byte-compile-cl-file-p (car xs))))
+ (unless (assoc (car xs) hist-orig)
(dolist (s xs)
(cond
((and (consp s) (eq t (car s)))
(defun byte-compile-log-warning (string &optional fill level)
(let ((warning-prefix-function 'byte-compile-warning-prefix)
(warning-type-format "")
- (warning-fill-prefix (if fill " "))
- (inhibit-read-only t))
+ (warning-fill-prefix (if fill " ")))
(display-warning 'bytecomp string level byte-compile-log-buffer)))
(defun byte-compile-warn (format &rest args)
(when (and (consp (nth 1 form))
(eq (car (nth 1 form)) 'quote)
(consp (cdr (nth 1 form)))
- (symbolp (nth 1 (nth 1 form))))
+ (symbolp (nth 1 (nth 1 form)))
+ ;; Don't add it if it's already defined. Otherwise, it might
+ ;; hide the actual definition.
+ (not (fboundp (nth 1 (nth 1 form)))))
(push (cons (nth 1 (nth 1 form))
(cons 'autoload (cdr (cdr form))))
byte-compile-function-environment)
(when (symbolp form)
(unless (memq (car-safe fun) '(closure lambda))
(error "Don't know how to compile %S" fun))
- (setq fun (byte-compile--reify-function fun))
- (setq lexical-binding (eq (car fun) 'closure)))
+ (setq lexical-binding (eq (car fun) 'closure))
+ (setq fun (byte-compile--reify-function fun)))
(unless (eq (car-safe fun) 'lambda)
(error "Don't know how to compile %S" fun))
;; Expand macros.
(setq body (nreverse body))
(setq body (list
(if (and (eq tmp 'funcall)
- (eq (car-safe (car body)) 'quote))
+ (eq (car-safe (car body)) 'quote)
+ (symbolp (nth 1 (car body))))
(cons (nth 1 (car body)) (cdr body))
(cons tmp body))))
(or (eq output-type 'file)
that suppresses all warnings during execution of BODY."
(declare (indent 1) (debug t))
`(let* ((fbound-list (byte-compile-find-bound-condition
- ,condition (list 'fboundp)
+ ,condition '(fboundp functionp)
byte-compile-unresolved-functions))
(bound-list (byte-compile-find-bound-condition
- ,condition (list 'boundp 'default-boundp)))
+ ,condition '(boundp default-boundp)))
;; Maybe add to the bound list.
(byte-compile-bound-variables
(append bound-list byte-compile-bound-variables)))
((eq type 'string) (if (stringp x) x (concat x)))
((eq type 'array) (if (arrayp x) x (vconcat x)))
((and (eq type 'character) (stringp x) (= (length x) 1)) (aref x 0))
- ((and (eq type 'character) (symbolp x)) (cl-coerce (symbol-name x) type))
+ ((and (eq type 'character) (symbolp x))
+ (cl-coerce (symbol-name x) type))
((eq type 'float) (float x))
((cl-typep x type) x)
(t (error "Can't coerce %s to type %s" x type))))
((stringp x)
(and (stringp y) (= (length x) (length y))
(or (string-equal x y)
- (string-equal (downcase x) (downcase y))))) ; lazy but simple!
+ (string-equal (downcase x) (downcase y))))) ;Lazy but simple!
((numberp x)
(and (numberp y) (= x y)))
((consp x)
If STATE is t, return a new state object seeded from the time of day."
(cond ((null state) (cl-make-random-state cl--random-state))
((vectorp state) (copy-tree state t))
- ((integerp state) (vector 'cl-random-state-tag -1 30 state))
- (t (cl-make-random-state (cl-random-time)))))
+ ((integerp state) (vector 'cl--random-state-tag -1 30 state))
+ (t (cl-make-random-state (cl--random-time)))))
;;;###autoload
(defun cl-random-state-p (object)
"Return t if OBJECT is a random-state object."
(and (vectorp object) (= (length object) 4)
- (eq (aref object 0) 'cl-random-state-tag)))
+ (eq (aref object 0) 'cl--random-state-tag)))
;; Implementation limits.
(require 'macroexp)
-(defvar cl-optimize-speed 1)
-(defvar cl-optimize-safety 1)
+(defvar cl--optimize-speed 1)
+(defvar cl--optimize-safety 1)
;;;###autoload
(define-obsolete-variable-alias
(equal (buffer-name (symbol-value 'byte-compile--outbuffer))
" *Compiler Output*"))))
-(defvar cl-proclaims-deferred nil)
+(defvar cl--proclaims-deferred nil)
(defun cl-proclaim (spec)
"Record a global declaration specified by SPEC."
- (if (fboundp 'cl-do-proclaim) (cl-do-proclaim spec t)
- (push spec cl-proclaims-deferred))
+ (if (fboundp 'cl--do-proclaim) (cl--do-proclaim spec t)
+ (push spec cl--proclaims-deferred))
nil)
(defmacro cl-declaim (&rest specs)
"Like `cl-proclaim', but takes any number of unevaluated, unquoted arguments.
Puts `(cl-eval-when (compile load eval) ...)' around the declarations
so that they are registered at compile-time as well as run-time."
- (let ((body (mapcar (function (lambda (x)
- (list 'cl-proclaim (list 'quote x))))
- specs)))
- (if (cl--compiling-file) (cl-list* 'cl-eval-when '(compile load eval) body)
- (cons 'progn body)))) ; avoid loading cl-macs.el for cl-eval-when
+ (let ((body (mapcar (lambda (x) `(cl-proclaim ',x)) specs)))
+ (if (cl--compiling-file) `(cl-eval-when (compile load eval) ,@body)
+ `(progn ,@body)))) ; Avoid loading cl-macs.el for cl-eval-when.
;;; Symbols.
-(defun cl-random-time ()
+(defun cl--random-time ()
(let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0))
(while (>= (cl-decf i) 0) (setq v (+ (* v 3) (aref time i))))
v))
-(defvar cl--gensym-counter (* (logand (cl-random-time) 1023) 100))
+(defvar cl--gensym-counter (* (logand (cl--random-time) 1023) 100))
;;; Numbers.
"Return t if INTEGER is even."
(eq (logand integer 1) 0))
-(defvar cl--random-state (vector 'cl-random-state-tag -1 30 (cl-random-time)))
+(defvar cl--random-state
+ (vector 'cl--random-state-tag -1 30 (cl--random-time)))
(defconst cl-most-positive-float nil
"The largest value that a Lisp float can hold.
;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively
;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan
;;;;;; cl-mapl cl-mapc cl-maplist cl-map cl--mapcar-many cl-equalp
-;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "6c7926a10c377679687a2ab6a4d1c186")
+;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "c5730f2a706cb1efc5fec0a790d3ca72")
;;; Generated autoloads from cl-extra.el
(autoload 'cl-coerce "cl-extra" "\
\(fn SYMBOL PROPNAME &optional DEFAULT)" nil nil)
-(put 'cl-get 'compiler-macro #'cl--compiler-macro-get)
+(eval-and-compile (put 'cl-get 'compiler-macro #'cl--compiler-macro-get))
(autoload 'cl-getf "cl-extra" "\
Search PROPLIST for property PROPNAME; return its value or DEFAULT.
;;;;;; cl-rotatef cl-shiftf cl-remf cl-psetf cl-declare cl-the cl-locally
;;;;;; cl-multiple-value-setq cl-multiple-value-bind cl-symbol-macrolet
;;;;;; cl-macrolet cl-labels cl-flet* cl-flet cl-progv cl-psetq
-;;;;;; cl-do-all-symbols cl-do-symbols cl-dotimes cl-dolist cl-do*
-;;;;;; cl-do cl-loop cl-return-from cl-return cl-block cl-etypecase
+;;;;;; cl-do-all-symbols cl-do-symbols cl-tagbody cl-dotimes cl-dolist
+;;;;;; cl-do* cl-do cl-loop cl-return-from cl-return cl-block cl-etypecase
;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
-;;;;;; "cl-macs" "cl-macs.el" "ad8afd35d8d75f5f22e7547b02bac556")
+;;;;;; "cl-macs" "cl-macs.el" "3b4d4e869f81f0b07ab3aa08f5478c2e")
;;; Generated autoloads from cl-macs.el
(autoload 'cl--compiler-macro-list* "cl-macs" "\
(put 'cl-dotimes 'lisp-indent-function '1)
+(autoload 'cl-tagbody "cl-macs" "\
+Execute statements while providing for control transfers to labels.
+Each element of LABELS-OR-STMTS can be either a label (integer or symbol)
+or a `cons' cell, in which case it's taken to be a statement.
+This distinction is made before performing macroexpansion.
+Statements are executed in sequence left to right, discarding any return value,
+stopping only when reaching the end of LABELS-OR-STMTS.
+Any statement can transfer control at any time to the statements that follow
+one of the labels with the special form (go LABEL).
+Labels have lexical scope and dynamic extent.
+
+\(fn &rest LABELS-OR-STMTS)" nil t)
+
(autoload 'cl-do-symbols "cl-macs" "\
Loop over all symbols.
Evaluate BODY with VAR bound to each interned symbol, or to each symbol
;;;;;; cl-nsubstitute-if cl-nsubstitute cl-substitute-if-not cl-substitute-if
;;;;;; cl-substitute cl-delete-duplicates cl-remove-duplicates cl-delete-if-not
;;;;;; cl-delete-if cl-delete cl-remove-if-not cl-remove-if cl-remove
-;;;;;; cl-replace cl-fill cl-reduce) "cl-seq" "cl-seq.el" "5ce2761d9a21845a7f6a2da0e4543844")
+;;;;;; cl-replace cl-fill cl-reduce) "cl-seq" "cl-seq.el" "51a70dea9cbc225165a50135956609aa")
;;; Generated autoloads from cl-seq.el
(autoload 'cl-reduce "cl-seq" "\
\(fn ITEM LIST [KEYWORD VALUE]...)" nil nil)
-(put 'cl-member 'compiler-macro #'cl--compiler-macro-member)
+(eval-and-compile (put 'cl-member 'compiler-macro #'cl--compiler-macro-member))
(autoload 'cl-member-if "cl-seq" "\
Find the first item satisfying PREDICATE in LIST.
\(fn ITEM LIST [KEYWORD VALUE]...)" nil nil)
-(put 'cl-assoc 'compiler-macro #'cl--compiler-macro-assoc)
+(eval-and-compile (put 'cl-assoc 'compiler-macro #'cl--compiler-macro-assoc))
(autoload 'cl-assoc-if "cl-seq" "\
Find the first item whose car satisfies PREDICATE in LIST.
;; `gv' is required here because cl-macs can be loaded before loaddefs.el.
(require 'gv)
-(defmacro cl-pop2 (place)
+(defmacro cl--pop2 (place)
(declare (debug edebug-sexps))
`(prog1 (car (cdr ,place))
(setq ,place (cdr (cdr ,place)))))
-(defvar cl-optimize-safety)
-(defvar cl-optimize-speed)
+(defvar cl--optimize-safety)
+(defvar cl--optimize-speed)
;;; Initialization.
(require 'help-fns)
(cons (help-add-fundoc-usage
(if (stringp (car hdr)) (pop hdr))
- (format "%S"
- (cons 'fn
- (cl--make-usage-args orig-args))))
+ ;; Be careful with make-symbol and (back)quote,
+ ;; see bug#12884.
+ (let ((print-gensym nil) (print-quoted t))
+ (format "%S" (cons 'fn (cl--make-usage-args
+ orig-args)))))
hdr)))
(list `(let* ,cl--bind-lets
,@(nreverse cl--bind-forms)
(if (memq '&environment args) (error "&environment used incorrectly"))
(let ((save-args args)
(restarg (memq '&rest args))
- (safety (if (cl--compiling-file) cl-optimize-safety 3))
+ (safety (if (cl--compiling-file) cl--optimize-safety 3))
(keys nil)
(laterarg nil) (exactarg nil) minarg)
(or num (setq num 0))
(setq restarg (cadr restarg)))
(push (list restarg expr) cl--bind-lets)
(if (eq (car args) '&whole)
- (push (list (cl-pop2 args) restarg) cl--bind-lets))
+ (push (list (cl--pop2 args) restarg) cl--bind-lets))
(let ((p args))
(setq minarg restarg)
(while (and p (not (memq (car p) cl--lambda-list-keywords)))
(if def `(if ,restarg ,poparg ,def) poparg))
(setq num (1+ num))))))
(if (eq (car args) '&rest)
- (let ((arg (cl-pop2 args)))
+ (let ((arg (cl--pop2 args)))
(if (consp arg) (cl--do-arglist arg restarg)))
(or (eq (car args) '&key) (= safety 0) exactarg
(push `(if ,restarg
;;; The `cl-eval-when' form.
-(defvar cl-not-toplevel nil)
+(defvar cl--not-toplevel nil)
;;;###autoload
(defmacro cl-eval-when (when &rest body)
\(fn (WHEN...) BODY...)"
(declare (indent 1) (debug ((&rest &or "compile" "load" "eval") body)))
(if (and (fboundp 'cl--compiling-file) (cl--compiling-file)
- (not cl-not-toplevel) (not (boundp 'for-effect))) ; horrible kludge
+ (not cl--not-toplevel) (not (boundp 'for-effect))) ;Horrible kludge.
(let ((comp (or (memq 'compile when) (memq :compile-toplevel when)))
- (cl-not-toplevel t))
+ (cl--not-toplevel t))
(if (or (memq 'load when) (memq :load-toplevel when))
(if comp (cons 'progn (mapcar 'cl--compile-time-too body))
`(if nil nil ,@body))
(defvar cl--loop-first-flag)
(defvar cl--loop-initially) (defvar cl--loop-map-form) (defvar cl--loop-name)
(defvar cl--loop-result) (defvar cl--loop-result-explicit)
-(defvar cl--loop-result-var) (defvar cl--loop-steps) (defvar cl--loop-symbol-macs)
+(defvar cl--loop-result-var) (defvar cl--loop-steps)
+(defvar cl--loop-symbol-macs)
;;;###autoload
(defmacro cl-loop (&rest loop-args)
"return"] form]
;; Simple default, which covers 99% of the cases.
symbolp form)))
- (if (not (memq t (mapcar 'symbolp (delq nil (delq t (cl-copy-list loop-args))))))
+ (if (not (memq t (mapcar #'symbolp
+ (delq nil (delq t (cl-copy-list loop-args))))))
`(cl-block nil (while t ,@loop-args))
(let ((cl--loop-args loop-args) (cl--loop-name nil) (cl--loop-bindings nil)
(cl--loop-body nil) (cl--loop-steps nil)
(cl--loop-map-form nil) (cl--loop-first-flag nil)
(cl--loop-destr-temps nil) (cl--loop-symbol-macs nil))
(setq cl--loop-args (append cl--loop-args '(cl-end-loop)))
- (while (not (eq (car cl--loop-args) 'cl-end-loop)) (cl-parse-loop-clause))
+ (while (not (eq (car cl--loop-args) 'cl-end-loop))
+ (cl--parse-loop-clause))
(if cl--loop-finish-flag
(push `((,cl--loop-finish-flag t)) cl--loop-bindings))
(if cl--loop-first-flag
(progn (push `((,cl--loop-first-flag t)) cl--loop-bindings)
(push `(setq ,cl--loop-first-flag nil) cl--loop-steps)))
(let* ((epilogue (nconc (nreverse cl--loop-finally)
- (list (or cl--loop-result-explicit cl--loop-result))))
+ (list (or cl--loop-result-explicit
+ cl--loop-result))))
(ands (cl--loop-build-ands (nreverse cl--loop-body)))
(while-body (nconc (cadr ands) (nreverse cl--loop-steps)))
(body (append
`((if ,cl--loop-finish-flag
(progn ,@epilogue) ,cl--loop-result-var)))
epilogue))))
- (if cl--loop-result-var (push (list cl--loop-result-var) cl--loop-bindings))
+ (if cl--loop-result-var
+ (push (list cl--loop-result-var) cl--loop-bindings))
(while cl--loop-bindings
(if (cdar cl--loop-bindings)
(setq body (list (cl--loop-let (pop cl--loop-bindings) body t)))
(push (car (pop cl--loop-bindings)) lets))
(setq body (list (cl--loop-let lets body nil))))))
(if cl--loop-symbol-macs
- (setq body (list `(cl-symbol-macrolet ,cl--loop-symbol-macs ,@body))))
+ (setq body
+ (list `(cl-symbol-macrolet ,cl--loop-symbol-macs ,@body))))
`(cl-block ,cl--loop-name ,@body)))))
;; Below is a complete spec for cl-loop, in several parts that correspond
-(defun cl-parse-loop-clause () ; uses loop-*
+(defun cl--parse-loop-clause () ; uses loop-*
(let ((word (pop cl--loop-args))
(hash-types '(hash-key hash-keys hash-value hash-values))
(key-types '(key-code key-codes key-seq key-seqs
((eq word 'initially)
(if (memq (car cl--loop-args) '(do doing)) (pop cl--loop-args))
- (or (consp (car cl--loop-args)) (error "Syntax error on `initially' clause"))
+ (or (consp (car cl--loop-args))
+ (error "Syntax error on `initially' clause"))
(while (consp (car cl--loop-args))
(push (pop cl--loop-args) cl--loop-initially)))
((eq word 'finally)
(if (eq (car cl--loop-args) 'return)
- (setq cl--loop-result-explicit (or (cl-pop2 cl--loop-args) '(quote nil)))
+ (setq cl--loop-result-explicit
+ (or (cl--pop2 cl--loop-args) '(quote nil)))
(if (memq (car cl--loop-args) '(do doing)) (pop cl--loop-args))
- (or (consp (car cl--loop-args)) (error "Syntax error on `finally' clause"))
+ (or (consp (car cl--loop-args))
+ (error "Syntax error on `finally' clause"))
(if (and (eq (caar cl--loop-args) 'return) (null cl--loop-name))
- (setq cl--loop-result-explicit (or (nth 1 (pop cl--loop-args)) '(quote nil)))
+ (setq cl--loop-result-explicit
+ (or (nth 1 (pop cl--loop-args)) '(quote nil)))
(while (consp (car cl--loop-args))
(push (pop cl--loop-args) cl--loop-finally)))))
(if (eq word 'being) (setq word (pop cl--loop-args)))
(if (memq word '(the each)) (setq word (pop cl--loop-args)))
(if (memq word '(buffer buffers))
- (setq word 'in cl--loop-args (cons '(buffer-list) cl--loop-args)))
+ (setq word 'in
+ cl--loop-args (cons '(buffer-list) cl--loop-args)))
(cond
((memq word '(from downfrom upfrom to downto upto
(if (memq (car cl--loop-args) '(downto above))
(error "Must specify `from' value for downward cl-loop"))
(let* ((down (or (eq (car cl--loop-args) 'downfrom)
- (memq (cl-caddr cl--loop-args) '(downto above))))
+ (memq (cl-caddr cl--loop-args)
+ '(downto above))))
(excl (or (memq (car cl--loop-args) '(above below))
- (memq (cl-caddr cl--loop-args) '(above below))))
- (start (and (memq (car cl--loop-args) '(from upfrom downfrom))
- (cl-pop2 cl--loop-args)))
+ (memq (cl-caddr cl--loop-args)
+ '(above below))))
+ (start (and (memq (car cl--loop-args)
+ '(from upfrom downfrom))
+ (cl--pop2 cl--loop-args)))
(end (and (memq (car cl--loop-args)
'(to upto downto above below))
- (cl-pop2 cl--loop-args)))
- (step (and (eq (car cl--loop-args) 'by) (cl-pop2 cl--loop-args)))
+ (cl--pop2 cl--loop-args)))
+ (step (and (eq (car cl--loop-args) 'by)
+ (cl--pop2 cl--loop-args)))
(end-var (and (not (macroexp-const-p end))
(make-symbol "--cl-var--")))
(step-var (and (not (macroexp-const-p step))
loop-for-sets))))
(push (list temp
(if (eq (car cl--loop-args) 'by)
- (let ((step (cl-pop2 cl--loop-args)))
+ (let ((step (cl--pop2 cl--loop-args)))
(if (and (memq (car-safe step)
'(quote function
cl-function))
((eq word '=)
(let* ((start (pop cl--loop-args))
- (then (if (eq (car cl--loop-args) 'then) (cl-pop2 cl--loop-args) start)))
+ (then (if (eq (car cl--loop-args) 'then)
+ (cl--pop2 cl--loop-args) start)))
(push (list var nil) loop-for-bindings)
(if (or ands (eq (car cl--loop-args) 'and))
(progn
(let ((ref (or (memq (car cl--loop-args) '(in-ref of-ref))
(and (not (memq (car cl--loop-args) '(in of)))
(error "Expected `of'"))))
- (seq (cl-pop2 cl--loop-args))
+ (seq (cl--pop2 cl--loop-args))
(temp-seq (make-symbol "--cl-seq--"))
- (temp-idx (if (eq (car cl--loop-args) 'using)
- (if (and (= (length (cadr cl--loop-args)) 2)
- (eq (cl-caadr cl--loop-args) 'index))
- (cadr (cl-pop2 cl--loop-args))
- (error "Bad `using' clause"))
- (make-symbol "--cl-idx--"))))
+ (temp-idx
+ (if (eq (car cl--loop-args) 'using)
+ (if (and (= (length (cadr cl--loop-args)) 2)
+ (eq (cl-caadr cl--loop-args) 'index))
+ (cadr (cl--pop2 cl--loop-args))
+ (error "Bad `using' clause"))
+ (make-symbol "--cl-idx--"))))
(push (list temp-seq seq) loop-for-bindings)
(push (list temp-idx 0) loop-for-bindings)
(if ref
loop-for-steps)))
((memq word hash-types)
- (or (memq (car cl--loop-args) '(in of)) (error "Expected `of'"))
- (let* ((table (cl-pop2 cl--loop-args))
- (other (if (eq (car cl--loop-args) 'using)
- (if (and (= (length (cadr cl--loop-args)) 2)
- (memq (cl-caadr cl--loop-args) hash-types)
- (not (eq (cl-caadr cl--loop-args) word)))
- (cadr (cl-pop2 cl--loop-args))
- (error "Bad `using' clause"))
- (make-symbol "--cl-var--"))))
+ (or (memq (car cl--loop-args) '(in of))
+ (error "Expected `of'"))
+ (let* ((table (cl--pop2 cl--loop-args))
+ (other
+ (if (eq (car cl--loop-args) 'using)
+ (if (and (= (length (cadr cl--loop-args)) 2)
+ (memq (cl-caadr cl--loop-args) hash-types)
+ (not (eq (cl-caadr cl--loop-args) word)))
+ (cadr (cl--pop2 cl--loop-args))
+ (error "Bad `using' clause"))
+ (make-symbol "--cl-var--"))))
(if (memq word '(hash-value hash-values))
(setq var (prog1 other (setq other var))))
(setq cl--loop-map-form
((memq word '(symbol present-symbol external-symbol
symbols present-symbols external-symbols))
- (let ((ob (and (memq (car cl--loop-args) '(in of)) (cl-pop2 cl--loop-args))))
+ (let ((ob (and (memq (car cl--loop-args) '(in of))
+ (cl--pop2 cl--loop-args))))
(setq cl--loop-map-form
`(mapatoms (lambda (,var) . --cl-map) ,ob))))
((memq word '(overlay overlays extent extents))
(let ((buf nil) (from nil) (to nil))
(while (memq (car cl--loop-args) '(in of from to))
- (cond ((eq (car cl--loop-args) 'from) (setq from (cl-pop2 cl--loop-args)))
- ((eq (car cl--loop-args) 'to) (setq to (cl-pop2 cl--loop-args)))
- (t (setq buf (cl-pop2 cl--loop-args)))))
+ (cond ((eq (car cl--loop-args) 'from)
+ (setq from (cl--pop2 cl--loop-args)))
+ ((eq (car cl--loop-args) 'to)
+ (setq to (cl--pop2 cl--loop-args)))
+ (t (setq buf (cl--pop2 cl--loop-args)))))
(setq cl--loop-map-form
`(cl--map-overlays
(lambda (,var ,(make-symbol "--cl-var--"))
(var1 (make-symbol "--cl-var1--"))
(var2 (make-symbol "--cl-var2--")))
(while (memq (car cl--loop-args) '(in of property from to))
- (cond ((eq (car cl--loop-args) 'from) (setq from (cl-pop2 cl--loop-args)))
- ((eq (car cl--loop-args) 'to) (setq to (cl-pop2 cl--loop-args)))
+ (cond ((eq (car cl--loop-args) 'from)
+ (setq from (cl--pop2 cl--loop-args)))
+ ((eq (car cl--loop-args) 'to)
+ (setq to (cl--pop2 cl--loop-args)))
((eq (car cl--loop-args) 'property)
- (setq prop (cl-pop2 cl--loop-args)))
- (t (setq buf (cl-pop2 cl--loop-args)))))
+ (setq prop (cl--pop2 cl--loop-args)))
+ (t (setq buf (cl--pop2 cl--loop-args)))))
(if (and (consp var) (symbolp (car var)) (symbolp (cdr var)))
(setq var1 (car var) var2 (cdr var))
(push (list var `(cons ,var1 ,var2)) loop-for-sets))
,buf ,prop ,from ,to))))
((memq word key-types)
- (or (memq (car cl--loop-args) '(in of)) (error "Expected `of'"))
- (let ((cl-map (cl-pop2 cl--loop-args))
- (other (if (eq (car cl--loop-args) 'using)
- (if (and (= (length (cadr cl--loop-args)) 2)
- (memq (cl-caadr cl--loop-args) key-types)
- (not (eq (cl-caadr cl--loop-args) word)))
- (cadr (cl-pop2 cl--loop-args))
- (error "Bad `using' clause"))
- (make-symbol "--cl-var--"))))
+ (or (memq (car cl--loop-args) '(in of))
+ (error "Expected `of'"))
+ (let ((cl-map (cl--pop2 cl--loop-args))
+ (other
+ (if (eq (car cl--loop-args) 'using)
+ (if (and (= (length (cadr cl--loop-args)) 2)
+ (memq (cl-caadr cl--loop-args) key-types)
+ (not (eq (cl-caadr cl--loop-args) word)))
+ (cadr (cl--pop2 cl--loop-args))
+ (error "Bad `using' clause"))
+ (make-symbol "--cl-var--"))))
(if (memq word '(key-binding key-bindings))
(setq var (prog1 other (setq other var))))
(setq cl--loop-map-form
loop-for-steps)))
((memq word '(window windows))
- (let ((scr (and (memq (car cl--loop-args) '(in of)) (cl-pop2 cl--loop-args)))
+ (let ((scr (and (memq (car cl--loop-args) '(in of))
+ (cl--pop2 cl--loop-args)))
(temp (make-symbol "--cl-var--"))
(minip (make-symbol "--cl-minip--")))
(push (list var (if scr
((memq word '(minimize minimizing maximize maximizing))
(let* ((what (pop cl--loop-args))
- (temp (if (cl--simple-expr-p what) what (make-symbol "--cl-var--")))
+ (temp (if (cl--simple-expr-p what) what
+ (make-symbol "--cl-var--")))
(var (cl--loop-handle-accum nil))
(func (intern (substring (symbol-name word) 0 3)))
(set `(setq ,var (if ,var (,func ,var ,temp) ,temp))))
((eq word 'with)
(let ((bindings nil))
(while (progn (push (list (pop cl--loop-args)
- (and (eq (car cl--loop-args) '=) (cl-pop2 cl--loop-args)))
+ (and (eq (car cl--loop-args) '=)
+ (cl--pop2 cl--loop-args)))
bindings)
(eq (car cl--loop-args) 'and))
(pop cl--loop-args))
(push `(not ,(pop cl--loop-args)) cl--loop-body))
((eq word 'always)
- (or cl--loop-finish-flag (setq cl--loop-finish-flag (make-symbol "--cl-flag--")))
+ (or cl--loop-finish-flag
+ (setq cl--loop-finish-flag (make-symbol "--cl-flag--")))
(push `(setq ,cl--loop-finish-flag ,(pop cl--loop-args)) cl--loop-body)
(setq cl--loop-result t))
((eq word 'never)
- (or cl--loop-finish-flag (setq cl--loop-finish-flag (make-symbol "--cl-flag--")))
+ (or cl--loop-finish-flag
+ (setq cl--loop-finish-flag (make-symbol "--cl-flag--")))
(push `(setq ,cl--loop-finish-flag (not ,(pop cl--loop-args)))
cl--loop-body)
(setq cl--loop-result t))
((eq word 'thereis)
- (or cl--loop-finish-flag (setq cl--loop-finish-flag (make-symbol "--cl-flag--")))
- (or cl--loop-result-var (setq cl--loop-result-var (make-symbol "--cl-var--")))
+ (or cl--loop-finish-flag
+ (setq cl--loop-finish-flag (make-symbol "--cl-flag--")))
+ (or cl--loop-result-var
+ (setq cl--loop-result-var (make-symbol "--cl-var--")))
(push `(setq ,cl--loop-finish-flag
(not (setq ,cl--loop-result-var ,(pop cl--loop-args))))
cl--loop-body))
((memq word '(if when unless))
(let* ((cond (pop cl--loop-args))
(then (let ((cl--loop-body nil))
- (cl-parse-loop-clause)
+ (cl--parse-loop-clause)
(cl--loop-build-ands (nreverse cl--loop-body))))
(else (let ((cl--loop-body nil))
(if (eq (car cl--loop-args) 'else)
- (progn (pop cl--loop-args) (cl-parse-loop-clause)))
+ (progn (pop cl--loop-args) (cl--parse-loop-clause)))
(cl--loop-build-ands (nreverse cl--loop-body))))
(simple (and (eq (car then) t) (eq (car else) t))))
(if (eq (car cl--loop-args) 'end) (pop cl--loop-args))
(push (cons 'progn (nreverse (cons t body))) cl--loop-body)))
((eq word 'return)
- (or cl--loop-finish-flag (setq cl--loop-finish-flag (make-symbol "--cl-var--")))
- (or cl--loop-result-var (setq cl--loop-result-var (make-symbol "--cl-var--")))
+ (or cl--loop-finish-flag
+ (setq cl--loop-finish-flag (make-symbol "--cl-var--")))
+ (or cl--loop-result-var
+ (setq cl--loop-result-var (make-symbol "--cl-var--")))
(push `(setq ,cl--loop-result-var ,(pop cl--loop-args)
,cl--loop-finish-flag nil) cl--loop-body))
(or handler (error "Expected a cl-loop keyword, found %s" word))
(funcall handler))))
(if (eq (car cl--loop-args) 'and)
- (progn (pop cl--loop-args) (cl-parse-loop-clause)))))
+ (progn (pop cl--loop-args) (cl--parse-loop-clause)))))
(defun cl--loop-let (specs body par) ; uses loop-*
(let ((p specs) (temps nil) (new nil))
(if (and (consp (car specs)) (listp (caar specs)))
(let* ((spec (caar specs)) (nspecs nil)
(expr (cadr (pop specs)))
- (temp (cdr (or (assq spec cl--loop-destr-temps)
- (car (push (cons spec (or (last spec 0)
- (make-symbol "--cl-var--")))
- cl--loop-destr-temps))))))
+ (temp
+ (cdr (or (assq spec cl--loop-destr-temps)
+ (car (push (cons spec
+ (or (last spec 0)
+ (make-symbol "--cl-var--")))
+ cl--loop-destr-temps))))))
(push (list temp expr) new)
(while (consp spec)
(push (list (pop spec)
(setq specs (nconc (nreverse nspecs) specs)))
(push (pop specs) new)))
(if (eq body 'setq)
- (let ((set (cons (if par 'cl-psetq 'setq) (apply 'nconc (nreverse new)))))
+ (let ((set (cons (if par 'cl-psetq 'setq)
+ (apply 'nconc (nreverse new)))))
(if temps `(let* ,(nreverse temps) ,set) set))
`(,(if par 'let 'let*)
,(nconc (nreverse temps) (nreverse new)) ,@body))))
-(defun cl--loop-handle-accum (def &optional func) ; uses loop-*
+(defun cl--loop-handle-accum (def &optional func) ; uses loop-*
(if (eq (car cl--loop-args) 'into)
- (let ((var (cl-pop2 cl--loop-args)))
+ (let ((var (cl--pop2 cl--loop-args)))
(or (memq var cl--loop-accum-vars)
(progn (push (list (list var def)) cl--loop-bindings)
(push var cl--loop-accum-vars)))
var)
(or cl--loop-accum-var
(progn
- (push (list (list (setq cl--loop-accum-var (make-symbol "--cl-var--")) def))
- cl--loop-bindings)
+ (push (list (list
+ (setq cl--loop-accum-var (make-symbol "--cl-var--"))
+ def))
+ cl--loop-bindings)
(setq cl--loop-result (if func (list func cl--loop-accum-var)
- cl--loop-accum-var))
+ cl--loop-accum-var))
cl--loop-accum-var))))
(defun cl--loop-build-ands (clauses)
((&rest &or symbolp (symbolp &optional form form))
(form body)
cl-declarations body)))
- (cl-expand-do-loop steps endtest body nil))
+ (cl--expand-do-loop steps endtest body nil))
;;;###autoload
(defmacro cl-do* (steps endtest &rest body)
\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)"
(declare (indent 2) (debug cl-do))
- (cl-expand-do-loop steps endtest body t))
+ (cl--expand-do-loop steps endtest body t))
-(defun cl-expand-do-loop (steps endtest body star)
+(defun cl--expand-do-loop (steps endtest body star)
`(cl-block nil
(,(if star 'let* 'let)
,(mapcar (lambda (c) (if (consp c) (list (car c) (nth 1 c)) c))
\(fn (VAR LIST [RESULT]) BODY...)"
(declare (debug ((symbolp form &optional form) cl-declarations body))
(indent 1))
- `(cl-block nil
- (,(if (eq 'cl-dolist (symbol-function 'dolist)) 'cl--dolist 'dolist)
- ,spec ,@body)))
+ (let ((loop `(dolist ,spec ,@body)))
+ (if (advice-member-p #'cl--wrap-in-nil-block 'dolist)
+ loop `(cl-block nil ,loop))))
;;;###autoload
(defmacro cl-dotimes (spec &rest body)
\(fn (VAR COUNT [RESULT]) BODY...)"
(declare (debug cl-dolist) (indent 1))
- `(cl-block nil
- (,(if (eq 'cl-dotimes (symbol-function 'dotimes)) 'cl--dotimes 'dotimes)
- ,spec ,@body)))
+ (let ((loop `(dotimes ,spec ,@body)))
+ (if (advice-member-p #'cl--wrap-in-nil-block 'dotimes)
+ loop `(cl-block nil ,loop))))
+
+(defvar cl--tagbody-alist nil)
+
+;;;###autoload
+(defmacro cl-tagbody (&rest labels-or-stmts)
+ "Execute statements while providing for control transfers to labels.
+Each element of LABELS-OR-STMTS can be either a label (integer or symbol)
+or a `cons' cell, in which case it's taken to be a statement.
+This distinction is made before performing macroexpansion.
+Statements are executed in sequence left to right, discarding any return value,
+stopping only when reaching the end of LABELS-OR-STMTS.
+Any statement can transfer control at any time to the statements that follow
+one of the labels with the special form (go LABEL).
+Labels have lexical scope and dynamic extent."
+ (let ((blocks '())
+ (first-label (if (consp (car labels-or-stmts))
+ 'cl--preamble (pop labels-or-stmts))))
+ (let ((block (list first-label)))
+ (dolist (label-or-stmt labels-or-stmts)
+ (if (consp label-or-stmt) (push label-or-stmt block)
+ ;; Add a "go to next block" to implement the fallthrough.
+ (unless (eq 'go (car-safe (car-safe block)))
+ (push `(go ,label-or-stmt) block))
+ (push (nreverse block) blocks)
+ (setq block (list label-or-stmt))))
+ (unless (eq 'go (car-safe (car-safe block)))
+ (push `(go cl--exit) block))
+ (push (nreverse block) blocks))
+ (let ((catch-tag (make-symbol "cl--tagbody-tag")))
+ (push (cons 'cl--exit catch-tag) cl--tagbody-alist)
+ (dolist (block blocks)
+ (push (cons (car block) catch-tag) cl--tagbody-alist))
+ (macroexpand-all
+ `(let ((next-label ',first-label))
+ (while
+ (not (eq (setq next-label
+ (catch ',catch-tag
+ (cl-case next-label
+ ,@blocks)))
+ 'cl--exit))))
+ `((go . ,(lambda (label)
+ (let ((catch-tag (cdr (assq label cl--tagbody-alist))))
+ (unless catch-tag
+ (error "Unknown cl-tagbody go label `%S'" label))
+ `(throw ',catch-tag ',label))))
+ ,@macroexpand-all-environment)))))
;;;###autoload
(defmacro cl-do-symbols (spec &rest body)
BODY forms are executed and their result is returned. This is much like
a `let' form, except that the list of symbols can be computed at run-time."
(declare (indent 2) (debug (form form body)))
- (let ((bodyfun (make-symbol "cl--progv-body"))
+ (let ((bodyfun (make-symbol "body"))
(binds (make-symbol "binds"))
(syms (make-symbol "syms"))
(vals (make-symbol "vals")))
`(progn
- (defvar ,bodyfun)
(let* ((,syms ,symbols)
(,vals ,values)
(,bodyfun (lambda () ,@body))
(,binds ()))
(while ,syms
(push (list (pop ,syms) (list 'quote (pop ,vals))) ,binds))
- (eval (list 'let ,binds '(funcall ,bodyfun)))))))
+ (eval (list 'let ,binds (list 'funcall (list 'quote ,bodyfun))))))))
(defvar cl--labels-convert-cache nil)
(declare (indent 1) (debug (cl-type-spec form)))
form)
-(defvar cl-proclaim-history t) ; for future compilers
-(defvar cl-declare-stack t) ; for future compilers
+(defvar cl--proclaim-history t) ; for future compilers
+(defvar cl--declare-stack t) ; for future compilers
-(defun cl-do-proclaim (spec hist)
- (and hist (listp cl-proclaim-history) (push spec cl-proclaim-history))
+(defun cl--do-proclaim (spec hist)
+ (and hist (listp cl--proclaim-history) (push spec cl--proclaim-history))
(cond ((eq (car-safe spec) 'special)
(if (boundp 'byte-compile-bound-variables)
(setq byte-compile-bound-variables
'((0 nil) (1 t) (2 t) (3 t))))
(safety (assq (nth 1 (assq 'safety (cdr spec)))
'((0 t) (1 t) (2 t) (3 nil)))))
- (if speed (setq cl-optimize-speed (car speed)
+ (if speed (setq cl--optimize-speed (car speed)
byte-optimize (nth 1 speed)))
- (if safety (setq cl-optimize-safety (car safety)
+ (if safety (setq cl--optimize-safety (car safety)
byte-compile-delete-errors (nth 1 safety)))))
((and (eq (car-safe spec) 'warn) (boundp 'byte-compile-warnings))
nil)
;;; Process any proclamations made before cl-macs was loaded.
-(defvar cl-proclaims-deferred)
-(let ((p (reverse cl-proclaims-deferred)))
- (while p (cl-do-proclaim (pop p) t))
- (setq cl-proclaims-deferred nil))
+(defvar cl--proclaims-deferred)
+(let ((p (reverse cl--proclaims-deferred)))
+ (while p (cl--do-proclaim (pop p) t))
+ (setq cl--proclaims-deferred nil))
;;;###autoload
(defmacro cl-declare (&rest specs)
See Info node `(cl)Declarations' for details."
(if (cl--compiling-file)
(while specs
- (if (listp cl-declare-stack) (push (car specs) cl-declare-stack))
- (cl-do-proclaim (pop specs) nil)))
+ (if (listp cl--declare-stack) (push (car specs) cl--declare-stack))
+ (cl--do-proclaim (pop specs) nil)))
nil)
;;; The standard modify macros.
(copier (intern (format "copy-%s" name)))
(predicate (intern (format "%s-p" name)))
(print-func nil) (print-auto nil)
- (safety (if (cl--compiling-file) cl-optimize-safety 3))
+ (safety (if (cl--compiling-file) cl--optimize-safety 3))
(include nil)
(tag (intern (format "cl-struct-%s" name)))
(tag-symbol (intern (format "cl-struct-%s-tags" name)))
(if (consp (cadr type)) `(> ,val ,(cl-caadr type))
`(>= ,val ,(cadr type))))
,(if (memq (cl-caddr type) '(* nil)) t
- (if (consp (cl-caddr type)) `(< ,val ,(cl-caaddr type))
+ (if (consp (cl-caddr type))
+ `(< ,val ,(cl-caaddr type))
`(<= ,val ,(cl-caddr type)))))))
((memq (car type) '(and or not))
(cons (car type)
STRING is an optional description of the desired type."
(declare (debug (place cl-type-spec &optional stringp)))
(and (or (not (cl--compiling-file))
- (< cl-optimize-speed 3) (= cl-optimize-safety 3))
+ (< cl--optimize-speed 3) (= cl--optimize-safety 3))
(let* ((temp (if (cl--simple-expr-p form 3)
form (make-symbol "--cl-var--")))
(body `(or ,(cl--make-type-test temp type)
omitted, a default message listing FORM itself is used."
(declare (debug (form &rest form)))
(and (or (not (cl--compiling-file))
- (< cl-optimize-speed 3) (= cl-optimize-safety 3))
+ (< cl--optimize-speed 3) (= cl--optimize-safety 3))
(let ((sargs (and show-args
(delq nil (mapcar (lambda (x)
(unless (macroexp-const-p x)
;;; Things that are side-effect-free.
(mapc (lambda (x) (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))
+ '(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))
- '(eql cl-floatp-safe cl-list* cl-subst cl-acons cl-equalp cl-random-state-p
- copy-tree cl-sublis))
+ '(eql cl-floatp-safe cl-list* cl-subst cl-acons cl-equalp
+ cl-random-state-p copy-tree cl-sublis))
(run-hooks 'cl-macs-load-hook)
(eq (not (funcall cl-test ,x ,y)) cl-test-not)
(eql ,x ,y)))
+;; Yuck! These vars are set/bound by cl--parsing-keywords to match :if :test
+;; and :key keyword args, and they are also accessed (sometimes) via dynamic
+;; scoping (and some of those accesses are from macro-expanded code).
(defvar cl-test) (defvar cl-test-not)
(defvar cl-if) (defvar cl-if-not)
(defvar cl-key)
(defun cl--delete-duplicates (cl-seq cl-keys cl-copy)
(if (listp cl-seq)
- (cl--parsing-keywords (:test :test-not :key (:start 0) :end :from-end :if)
+ (cl--parsing-keywords
+ (:test :test-not :key (:start 0) :end :from-end :if)
()
(if cl-from-end
(let ((cl-p (nthcdr cl-start cl-seq)) cl-i)
(setq cl-list1 (prog1 cl-list2 (setq cl-list2 cl-list1))))
(while cl-list2
(if (or cl-keys (numberp (car cl-list2)))
- (setq cl-list1 (apply 'cl-adjoin (car cl-list2) cl-list1 cl-keys))
+ (setq cl-list1
+ (apply 'cl-adjoin (car cl-list2) cl-list1 cl-keys))
(or (memq (car cl-list2) cl-list1)
(push (car cl-list2) cl-list1)))
(pop cl-list2))
))
(defvaralias var (intern (format "cl-%s" var))))
-;; Before overwriting subr.el's `dotimes' and `dolist', let's remember
-;; them under a different name, so we can use them in our implementation
-;; of `dotimes' and `dolist'.
-(unless (fboundp 'cl--dotimes)
- (defalias 'cl--dotimes (symbol-function 'dotimes) "The non-CL `dotimes'."))
-(unless (fboundp 'cl--dolist)
- (defalias 'cl--dolist (symbol-function 'dolist) "The non-CL `dolist'."))
-
(dolist (fun '(
(get* . cl-get)
(random* . cl-random)
callf2
callf
letf*
- ;; letf
+ letf
rotatef
shiftf
remf
psetf
(define-setf-method . define-setf-expander)
- declare
the
locally
multiple-value-setq
psetq
do-all-symbols
do-symbols
- dotimes
- dolist
do*
do
loop
(intern (format "cl-%s" fun)))))
(defalias fun new)))
+(defun cl--wrap-in-nil-block (fun &rest args)
+ `(cl-block nil ,(apply fun args)))
+(advice-add 'dolist :around #'cl--wrap-in-nil-block)
+(advice-add 'dotimes :around #'cl--wrap-in-nil-block)
+
+(defun cl--pass-args-to-cl-declare (&rest specs)
+ (macroexpand `(cl-declare ,@specs)))
+(advice-add 'declare :after #'cl--pass-args-to-cl-declare)
+
;;; Features provided a bit differently in Elisp.
;; First, the old lexical-let is now better served by `lexical-binding', tho
;; not 100% compatible: not worth the trouble to add them to cl-lib.el, but we
;; still need to support old users of cl.el.
-(defmacro cl--symbol-function (symbol)
- "Like `symbol-function' but return `cl--unbound' if not bound."
- ;; (declare (gv-setter (lambda (store)
- ;; `(if (eq ,store 'cl--unbound)
- ;; (fmakunbound ,symbol) (fset ,symbol ,store)))))
- `(if (fboundp ,symbol) (symbol-function ,symbol) 'cl--unbound))
-(gv-define-setter cl--symbol-function (store symbol)
- `(if (eq ,store 'cl--unbound) (fmakunbound ,symbol) (fset ,symbol ,store)))
-
-(defmacro letf (bindings &rest body)
- "Dynamically scoped let-style bindings for places.
-For more details, see `cl-letf'. This macro behaves like that one
-in almost every respect (apart from details that relate to some
-deprecated usage of `symbol-function' in place forms)." ; bug#12760
- (declare (indent 1) (debug cl-letf))
- ;; Like cl-letf, but with special handling of symbol-function.
- `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function)
- `((cl--symbol-function ,@(cdar x)) ,@(cdr x))
- x))
- bindings)
- ,@body))
-
(defun cl--gv-adapt (cl-gv do)
;; This function is used by all .elc files that use define-setf-expander and
;; were compiled with Emacs>=24.3.
-;;; debug.el --- debuggers and related commands for Emacs
+;;; debug.el --- debuggers and related commands for Emacs -*- lexical-binding: t -*-
;; Copyright (C) 1985-1986, 1994, 2001-2013 Free Software Foundation,
;; Inc.
:group 'debugger
:version "24.3")
-(defvar debug-function-list nil
- "List of functions currently set for debug on entry.")
-
(defvar debugger-step-after-exit nil
"Non-nil means \"single-step\" after the debugger exits.")
;;;###autoload
(setq debugger 'debug)
;;;###autoload
-(defun debug (&rest debugger-args)
+(defun debug (&rest args)
"Enter debugger. \\<debugger-mode-map>`\\[debugger-continue]' returns from the debugger.
Arguments are mainly for use when this is called from the internals
of the evaluator.
(if (get-buffer "*Backtrace*")
(with-current-buffer (get-buffer "*Backtrace*")
(list major-mode (buffer-string)))))
+ (debugger-args args)
(debugger-buffer (get-buffer-create "*Backtrace*"))
(debugger-old-buffer (current-buffer))
(debugger-window nil)
(save-excursion
(when (eq (car debugger-args) 'debug)
;; Skip the frames for backtrace-debug, byte-code,
- ;; and implement-debug-on-entry.
- (backtrace-debug 3 t)
+ ;; debug--implement-debug-on-entry and the advice's `apply'.
+ (backtrace-debug 4 t)
;; Place an extra debug-on-exit for macro's.
- (when (eq 'lambda (car-safe (cadr (backtrace-frame 3))))
- (backtrace-debug 4 t)))
+ (when (eq 'lambda (car-safe (cadr (backtrace-frame 4))))
+ (backtrace-debug 5 t)))
(pop-to-buffer
debugger-buffer
`((display-buffer-reuse-window
(setq debug-on-next-call debugger-step-after-exit)
debugger-value)))
\f
-(defun debugger-setup-buffer (debugger-args)
+(defun debugger-setup-buffer (args)
"Initialize the `*Backtrace*' buffer for entry to the debugger.
That buffer should be current already."
(setq buffer-read-only nil)
(delete-region (point)
(progn
(search-forward "\n debug(")
- (forward-line (if (eq (car debugger-args) 'debug)
- 2 ; Remove implement-debug-on-entry frame.
+ (forward-line (if (eq (car args) 'debug)
+ ;; Remove debug--implement-debug-on-entry
+ ;; and the advice's `apply' frame.
+ 3
1))
(point)))
(insert "Debugger entered")
;; lambda is for debug-on-call when a function call is next.
;; debug is for debug-on-entry function called.
- (pcase (car debugger-args)
+ (pcase (car args)
((or `lambda `debug)
(insert "--entering a function:\n"))
;; Exiting a function.
(`exit
(insert "--returning value: ")
- (setq debugger-value (nth 1 debugger-args))
+ (setq debugger-value (nth 1 args))
(prin1 debugger-value (current-buffer))
(insert ?\n)
(delete-char 1)
;; Debugger entered for an error.
(`error
(insert "--Lisp error: ")
- (prin1 (nth 1 debugger-args) (current-buffer))
+ (prin1 (nth 1 args) (current-buffer))
(insert ?\n))
;; debug-on-call, when the next thing is an eval.
(`t
;; User calls debug directly.
(_
(insert ": ")
- (prin1 (if (eq (car debugger-args) 'nil)
- (cdr debugger-args) debugger-args)
+ (prin1 (if (eq (car args) 'nil)
+ (cdr args) args)
(current-buffer))
(insert ?\n)))
;; After any frame that uses eval-buffer,
(count 0))
(while (not (eq (cadr (backtrace-frame count)) 'debug))
(setq count (1+ count)))
- ;; Skip implement-debug-on-entry frame.
- (when (eq 'implement-debug-on-entry (cadr (backtrace-frame (1+ count))))
- (setq count (1+ count)))
+ ;; Skip debug--implement-debug-on-entry frame.
+ (when (eq 'debug--implement-debug-on-entry
+ (cadr (backtrace-frame (1+ count))))
+ (setq count (+ 2 count)))
(goto-char (point-min))
(when (looking-at "Debugger entered--\\(Lisp error\\|returning value\\):")
(goto-char (match-end 0))
:help "Continue to exit from this frame, with all debug-on-entry suspended"))
(define-key menu-map [deb-cont]
'(menu-item "Continue" debugger-continue
- :help "Continue, evaluating this expression without stopping"))
+ :help "Continue, evaluating this expression without stopping"))
(define-key menu-map [deb-step]
'(menu-item "Step through" debugger-step-through
- :help "Proceed, stepping through subexpressions of this expression"))
+ :help "Proceed, stepping through subexpressions of this expression"))
map))
(put 'debugger-mode 'mode-class 'special)
\f
;; When you change this, you may also need to change the number of
;; frames that the debugger skips.
-(defun implement-debug-on-entry ()
+(defun debug--implement-debug-on-entry (&rest _ignore)
"Conditionally call the debugger.
A call to this function is inserted by `debug-on-entry' to cause
functions to break on entry."
nil
(funcall debugger 'debug)))
-(defun debugger-special-form-p (symbol)
- "Return whether SYMBOL is a special form."
- (and (fboundp symbol)
- (subrp (symbol-function symbol))
- (eq (cdr (subr-arity (symbol-function symbol))) 'unevalled)))
-
;;;###autoload
(defun debug-on-entry (function)
"Request FUNCTION to invoke debugger each time it is called.
Redefining FUNCTION also cancels it."
(interactive
(let ((fn (function-called-at-point)) val)
- (when (debugger-special-form-p fn)
+ (when (special-form-p fn)
(setq fn nil))
(setq val (completing-read
(if fn
obarray
#'(lambda (symbol)
(and (fboundp symbol)
- (not (debugger-special-form-p symbol))))
+ (not (special-form-p symbol))))
t nil nil (symbol-name fn)))
(list (if (equal val "") fn (intern val)))))
- ;; FIXME: Use advice.el.
- (when (debugger-special-form-p function)
- (error "Function %s is a special form" function))
- (if (or (symbolp (symbol-function function))
- (subrp (symbol-function function)))
- ;; The function is built-in or aliased to another function.
- ;; Create a wrapper in which we can add the debug call.
- (fset function `(lambda (&rest debug-on-entry-args)
- ,(interactive-form (symbol-function function))
- (apply ',(symbol-function function)
- debug-on-entry-args)))
- (when (autoloadp (symbol-function function))
- ;; The function is autoloaded. Load its real definition.
- (autoload-do-load (symbol-function function) function))
- (when (or (not (consp (symbol-function function)))
- (and (eq (car (symbol-function function)) 'macro)
- (not (consp (cdr (symbol-function function))))))
- ;; The function is byte-compiled. Create a wrapper in which
- ;; we can add the debug call.
- (debug-convert-byte-code function)))
- (unless (consp (symbol-function function))
- (error "Definition of %s is not a list" function))
- (fset function (debug-on-entry-1 function t))
- (unless (memq function debug-function-list)
- (push function debug-function-list))
+ (advice-add function :before #'debug--implement-debug-on-entry)
function)
+(defun debug--function-list ()
+ "List of functions currently set for debug on entry."
+ (let ((funs '()))
+ (mapatoms
+ (lambda (s)
+ (when (advice-member-p #'debug--implement-debug-on-entry s)
+ (push s funs))))
+ funs))
+
;;;###autoload
(defun cancel-debug-on-entry (&optional function)
"Undo effect of \\[debug-on-entry] on FUNCTION.
(list (let ((name
(completing-read
"Cancel debug on entry to function (default all functions): "
- (mapcar 'symbol-name debug-function-list) nil t)))
+ (mapcar #'symbol-name (debug--function-list)) nil t)))
(when name
(unless (string= name "")
(intern name))))))
- (if (and function
- (not (string= function ""))) ; Pre 22.1 compatibility test.
+ (if function
(progn
- (let ((defn (debug-on-entry-1 function nil)))
- (condition-case nil
- (when (and (equal (nth 1 defn) '(&rest debug-on-entry-args))
- (eq (car (nth 3 defn)) 'apply))
- ;; `defn' is a wrapper introduced in debug-on-entry.
- ;; Get rid of it since we don't need it any more.
- (setq defn (nth 1 (nth 1 (nth 3 defn)))))
- (error nil))
- (fset function defn))
- (setq debug-function-list (delq function debug-function-list))
+ (advice-remove function #'debug--implement-debug-on-entry)
function)
(message "Cancelling debug-on-entry for all functions")
- (mapcar 'cancel-debug-on-entry debug-function-list)))
-
-(defun debug-arglist (definition)
- ;; FIXME: copied from ad-arglist.
- "Return the argument list of DEFINITION."
- (require 'help-fns)
- (help-function-arglist definition 'preserve-names))
-
-(defun debug-convert-byte-code (function)
- (let* ((defn (symbol-function function))
- (macro (eq (car-safe defn) 'macro)))
- (when macro (setq defn (cdr defn)))
- (when (byte-code-function-p defn)
- (let* ((args (debug-arglist defn))
- (body
- `((,(if (memq '&rest args) #'apply #'funcall)
- ,defn
- ,@(remq '&rest (remq '&optional args))))))
- (if (> (length defn) 5)
- ;; The mere presence of field 5 is sufficient to make
- ;; it interactive.
- (push `(interactive ,(aref defn 5)) body))
- (if (and (> (length defn) 4) (aref defn 4))
- ;; Use `documentation' here, to get the actual string,
- ;; in case the compiled function has a reference
- ;; to the .elc file.
- (setq body (cons (documentation function) body)))
- (setq defn `(closure (t) ,args ,@body)))
- (when macro (setq defn (cons 'macro defn)))
- (fset function defn))))
-
-(defun debug-on-entry-1 (function flag)
- (let* ((defn (symbol-function function))
- (tail defn))
- (when (eq (car-safe tail) 'macro)
- (setq tail (cdr tail)))
- (if (not (memq (car-safe tail) '(closure lambda)))
- ;; Only signal an error when we try to set debug-on-entry.
- ;; When we try to clear debug-on-entry, we are now done.
- (when flag
- (error "%s is not a user-defined Lisp function" function))
- (if (eq (car tail) 'closure) (setq tail (cdr tail)))
- (setq tail (cdr tail))
- ;; Skip the docstring.
- (when (and (stringp (cadr tail)) (cddr tail))
- (setq tail (cdr tail)))
- ;; Skip the interactive form.
- (when (eq 'interactive (car-safe (cadr tail)))
- (setq tail (cdr tail)))
- (unless (eq flag (equal (cadr tail) '(implement-debug-on-entry)))
- ;; Add/remove debug statement as needed.
- (setcdr tail (if flag
- (cons '(implement-debug-on-entry) (cdr tail))
- (cddr tail)))))
- defn))
+ (mapcar #'cancel-debug-on-entry (debug--function-list))))
(defun debugger-list-functions ()
"Display a list of all the functions now set to debug on entry."
(called-interactively-p 'interactive))
(with-output-to-temp-buffer (help-buffer)
(with-current-buffer standard-output
- (if (null debug-function-list)
- (princ "No debug-on-entry functions now\n")
- (princ "Functions set to debug on entry:\n\n")
- (dolist (fun debug-function-list)
- (make-text-button (point) (progn (prin1 fun) (point))
- 'type 'help-function
- 'help-args (list fun))
- (terpri))
- (terpri)
- (princ "Note: if you have redefined a function, then it may no longer\n")
- (princ "be set to debug on entry, even if it is in the list.")))))
+ (let ((funs (debug--function-list)))
+ (if (null funs)
+ (princ "No debug-on-entry functions now\n")
+ (princ "Functions set to debug on entry:\n\n")
+ (dolist (fun funs)
+ (make-text-button (point) (progn (prin1 fun) (point))
+ 'type 'help-function
+ 'help-args (list fun))
+ (terpri))
+ (terpri)
+ (princ "Note: if you have redefined a function, then it may no longer\n")
+ (princ "be set to debug on entry, even if it is in the list."))))))
(provide 'debug)
;; Use a default docstring.
(setq docstring
(if (null parent)
- (format "Major-mode.
-Uses keymap `%s', abbrev table `%s' and syntax-table `%s'." map abbrev syntax)
+ ;; FIXME filling.
+ (format "Major-mode.\nUses keymap `%s'%s%s." map
+ (if abbrev (format "%s abbrev table `%s'"
+ (if syntax "," " and") abbrev) "")
+ (if syntax (format " and syntax-table `%s'" syntax) ""))
(format "Major mode derived from `%s' by `define-derived-mode'.
-It inherits all of the parent's attributes, but has its own keymap,
-abbrev table and syntax table:
-
- `%s', `%s' and `%s'
-
-which more-or-less shadow %s's corresponding tables."
- parent map abbrev syntax parent))))
+It inherits all of the parent's attributes, but has its own keymap%s:
+
+ `%s'%s
+
+which more-or-less shadow%s %s's corresponding table%s."
+ parent
+ (cond ((and abbrev syntax)
+ ",\nabbrev table and syntax table")
+ (abbrev "\nand abbrev table")
+ (syntax "\nand syntax table")
+ (t ""))
+ map
+ (cond ((and abbrev syntax)
+ (format ", `%s' and `%s'" abbrev syntax))
+ ((or abbrev syntax)
+ (format " and `%s'" (or abbrev syntax)))
+ (t ""))
+ (if (or abbrev syntax) "" "s")
+ parent
+ (if (or abbrev syntax) "s" "")))))
(unless (string-match (regexp-quote (symbol-name hook)) docstring)
;; Make sure the docstring mentions the mode's hook.
;;; Autoloading of Edebug accessories
;; edebug-cl-read and cl-read are available from liberte@cs.uiuc.edu
+(defun edebug--require-cl-read ()
+ (require 'edebug-cl-read))
+
(if (featurep 'cl-read)
- (add-hook 'edebug-setup-hook
- (function (lambda () (require 'edebug-cl-read))))
+ (add-hook 'edebug-setup-hook #'edebug--require-cl-read)
;; The following causes edebug-cl-read to be loaded when you load cl-read.el.
- (add-hook 'cl-read-load-hooks
- (function (lambda () (require 'edebug-cl-read)))))
+ (add-hook 'cl-read-load-hooks #'edebug--require-cl-read))
\f
;;; Finalize Loading
+;; When edebugging a function, some of the sub-expressions are
+;; wrapped in (edebug-enter (lambda () ..)), so we need to teach
+;; called-interactively-p that calls within the inner lambda should refer to
+;; the outside function.
+(add-hook 'called-interactively-p-functions
+ #'edebug--called-interactively-skip)
+(defun edebug--called-interactively-skip (i frame1 frame2)
+ (when (and (eq (car-safe (nth 1 frame1)) 'lambda)
+ (eq (nth 1 (nth 1 frame1)) '())
+ (eq (nth 1 frame2) 'edebug-enter))
+ ;; `edebug-enter' calls itself on its first invocation.
+ (if (eq (nth 1 (internal--called-interactively-p--get-frame i))
+ 'edebug-enter)
+ 2 1)))
+
;; Finally, hook edebug into the rest of Emacs.
;; There are probably some other things that could go here.
;; Install edebug read and eval functions.
(edebug-install-read-eval-functions)
+(defun edebug-unload-function ()
+ "Unload the Edebug source level debugger."
+ (when edebug-active
+ (setq edebug-active nil)
+ (unwind-protect
+ (abort-recursive-edit)
+ ;; We still want to run unload-feature to completion
+ (run-with-idle-timer 0 nil #'(lambda () (unload-feature 'edebug)))))
+ (remove-hook 'called-interactively-p-functions
+ 'edebug--called-interactively-skip)
+ (remove-hook 'cl-read-load-hooks 'edebug--require-cl-read)
+ (edebug-uninstall-read-eval-functions)
+ ;; continue standard unloading
+ nil)
+
(provide 'edebug)
;;; edebug.el ends here
(v (eieio-oref this (car publa)))
)
(unless (or (not i) (equal v (car publd)))
+ (unless (bolp)
+ (princ "\n"))
(princ (make-string (* eieio-print-depth 2) ? ))
(princ (symbol-name i))
- (princ " ")
(if (car publp)
;; Use our public printer
- (funcall (car publp) v)
+ (progn
+ (princ " ")
+ (funcall (car publp) v))
;; Use our generic override prin1 function.
- (eieio-override-prin1 v))
- (princ "\n"))))
+ (princ (if (or (eieio-object-p v)
+ (eieio-object-p (car-safe v)))
+ "\n" " "))
+ (eieio-override-prin1 v)))))
(setq publa (cdr publa) publd (cdr publd)
- publp (cdr publp)))
- (princ (make-string (* eieio-print-depth 2) ? )))
- (princ ")\n")))
+ publp (cdr publp))))
+ (princ ")")
+ (when (= eieio-print-depth 0)
+ (princ "\n"))))
(defun eieio-override-prin1 (thing)
"Perform a `prin1' on THING taking advantage of object knowledge."
(cond ((eieio-object-p thing)
(object-write thing))
- ((listp thing)
+ ((consp thing)
(eieio-list-prin1 thing))
((class-p thing)
(princ (class-name thing)))
+ ((or (keywordp thing) (booleanp thing))
+ (prin1 thing))
((symbolp thing)
(princ (concat "'" (symbol-name thing))))
(t (prin1 thing))))
(progn
(princ "'")
(prin1 list))
- (princ "(list ")
- (if (eieio-object-p (car list)) (princ "\n "))
- (while list
- (if (eieio-object-p (car list))
- (object-write (car list))
- (princ "'")
- (prin1 (car list)))
- (princ " ")
- (setq list (cdr list)))
(princ (make-string (* eieio-print-depth 2) ? ))
+ (princ "(list")
+ (let ((eieio-print-depth (1+ eieio-print-depth)))
+ (while list
+ (princ "\n")
+ (if (eieio-object-p (car list))
+ (object-write (car list))
+ (princ (make-string (* eieio-print-depth 2) ? ))
+ (eieio-override-prin1 (car list)))
+ (setq list (cdr list))))
(princ ")")))
\f
-;;; elp.el --- Emacs Lisp Profiler
+;;; elp.el --- Emacs Lisp Profiler -*- lexical-binding: t -*-
;; Copyright (C) 1994-1995, 1997-1998, 2001-2013 Free Software
;; Foundation, Inc.
;;; Code:
+(eval-when-compile (require 'cl-lib))
\f
;; start of user configuration variables
;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
"Non-nil specifies ELP results sorting function.
These functions are currently available:
- elp-sort-by-call-count -- sort by the highest call count
- elp-sort-by-total-time -- sort by the highest total time
- elp-sort-by-average-time -- sort by the highest average times
+ `elp-sort-by-call-count' -- sort by the highest call count
+ `elp-sort-by-total-time' -- sort by the highest total time
+ `elp-sort-by-average-time' -- sort by the highest average times
You can write your own sort function. It should adhere to the
interface specified by the PREDICATE argument for `sort'.
of times will be displayed in the output buffer. If nil, all
functions will be displayed."
:type '(choice integer
- (const :tag "Show All" nil))
+ (const :tag "Show All" nil))
:group 'elp)
(defcustom elp-use-standard-output nil
(defconst elp-timer-info-property 'elp-info
"ELP information property name.")
-(defvar elp-all-instrumented-list nil
- "List of all functions currently being instrumented.")
-
(defvar elp-record-p t
"Controls whether functions should record times or not.
This variable is set by the master function.")
(defvar elp-not-profilable
;; First, the functions used inside each instrumented function:
- '(elp-wrapper called-interactively-p
+ '(called-interactively-p
;; Then the functions used by the above functions. I used
;; (delq nil (mapcar (lambda (x) (and (symbolp x) (fboundp x) x))
;; (aref (symbol-function 'elp-wrapper) 2)))
(fboundp fun)
(not (or (memq fun elp-not-profilable)
(keymapp fun)
- (memq (car-safe (symbol-function fun)) '(autoload macro))
- (condition-case nil
- (when (subrp (indirect-function fun))
- (eq 'unevalled
- (cdr (subr-arity (indirect-function fun)))))
- (error nil))))))
+ (autoloadp (symbol-function fun)) ;FIXME: Why not just load it?
+ (special-form-p fun)))))
+(defconst elp--advice-name 'ELP-instrumentation\ )
\f
;;;###autoload
(defun elp-instrument-function (funsym)
"Instrument FUNSYM for profiling.
FUNSYM must be a symbol of a defined function."
(interactive "aFunction to instrument: ")
- ;; restore the function. this is necessary to avoid infinite
- ;; recursion of already instrumented functions (i.e. elp-wrapper
- ;; calling elp-wrapper ad infinitum). it is better to simply
- ;; restore the function than to throw an error. this will work
- ;; properly in the face of eval-defun because if the function was
- ;; redefined, only the timer info will be nil'd out since
- ;; elp-restore-function is smart enough not to trash the new
- ;; definition.
- (elp-restore-function funsym)
- (let* ((funguts (symbol-function funsym))
- (infovec (vector 0 0 funguts))
- (newguts '(lambda (&rest args))))
- ;; we cannot profile macros
- (and (eq (car-safe funguts) 'macro)
- (error "ELP cannot profile macro: %s" funsym))
- ;; TBD: at some point it might be better to load the autoloaded
- ;; function instead of throwing an error. if we do this, then we
- ;; probably want elp-instrument-package to be updated with the
- ;; newly loaded list of functions. i'm not sure it's smart to do
- ;; the autoload here, since that could have side effects, and
- ;; elp-instrument-function is similar (in my mind) to defun-ish
- ;; type functionality (i.e. it shouldn't execute the function).
- (and (autoloadp funguts)
- (error "ELP cannot profile autoloaded function: %s" funsym))
+ (let* ((infovec (vector 0 0)))
;; We cannot profile functions used internally during profiling.
(unless (elp-profilable-p funsym)
(error "ELP cannot profile the function: %s" funsym))
- ;; put rest of newguts together
- (if (commandp funsym)
- (setq newguts (append newguts '((interactive)))))
- (setq newguts (append newguts `((elp-wrapper
- (quote ,funsym)
- ,(when (commandp funsym)
- '(called-interactively-p 'any))
- args))))
- ;; to record profiling times, we set the symbol's function
- ;; definition so that it runs the elp-wrapper function with the
- ;; function symbol as an argument. We place the old function
- ;; definition on the info vector.
- ;;
- ;; The info vector data structure is a 3 element vector. The 0th
+ ;; The info vector data structure is a 2 element vector. The 0th
;; element is the call-count, i.e. the total number of times this
;; function has been entered. This value is bumped up on entry to
;; the function so that non-local exists are still recorded. TBD:
;; The 1st element is the total amount of time in seconds that has
;; been spent inside this function. This number is added to on
;; function exit.
- ;;
- ;; The 2nd element is the old function definition list. This gets
- ;; funcall'd in between start/end time retrievals. I believe that
- ;; this lets us profile even byte-compiled functions.
- ;; put the info vector on the property list
+ ;; Put the info vector on the property list.
(put funsym elp-timer-info-property infovec)
;; Set the symbol's new profiling function definition to run
- ;; elp-wrapper.
- (let ((advice-info (get funsym 'ad-advice-info)))
- (if advice-info
- (progn
- ;; If function is advised, don't let Advice change
- ;; its definition from under us during the `fset'.
- (put funsym 'ad-advice-info nil)
- (fset funsym newguts)
- (put funsym 'ad-advice-info advice-info))
- (fset funsym newguts)))
-
- ;; add this function to the instrumentation list
- (unless (memq funsym elp-all-instrumented-list)
- (push funsym elp-all-instrumented-list))))
+ ;; ELP wrapper.
+ (advice-add funsym :around (elp--make-wrapper funsym)
+ `((name . ,elp--advice-name)))))
+
+(defun elp--instrumented-p (sym)
+ (advice-member-p elp--advice-name sym))
(defun elp-restore-function (funsym)
"Restore an instrumented function to its original definition.
Argument FUNSYM is the symbol of a defined function."
- (interactive "aFunction to restore: ")
- (let ((info (get funsym elp-timer-info-property)))
- ;; delete the function from the all instrumented list
- (setq elp-all-instrumented-list
- (delq funsym elp-all-instrumented-list))
-
- ;; if the function was the master, reset the master
- (if (eq funsym elp-master)
- (setq elp-master nil
- elp-record-p t))
-
- ;; zap the properties
- (put funsym elp-timer-info-property nil)
-
- ;; restore the original function definition, but if the function
- ;; wasn't instrumented do nothing. we do this after the above
- ;; because its possible the function got un-instrumented due to
- ;; circumstances beyond our control. Also, check to make sure
- ;; that the current function symbol points to elp-wrapper. If
- ;; not, then the user probably did an eval-defun, or loaded a
- ;; byte-compiled version, while the function was instrumented and
- ;; we don't want to destroy the new definition. can it ever be
- ;; the case that a lisp function can be compiled instrumented?
- (and info
- (functionp funsym)
- (not (byte-code-function-p (symbol-function funsym)))
- (assq 'elp-wrapper (symbol-function funsym))
- (fset funsym (aref info 2)))))
+ (interactive
+ (list
+ (intern
+ (completing-read "Function to restore: " obarray
+ #'elp--instrumented-p t))))
+ ;; If the function was the master, reset the master.
+ (if (eq funsym elp-master)
+ (setq elp-master nil
+ elp-record-p t))
+
+ ;; Zap the properties.
+ (put funsym elp-timer-info-property nil)
+
+ (advice-remove funsym elp--advice-name))
;;;###autoload
(defun elp-instrument-list (&optional list)
"Instrument, for profiling, all functions in `elp-function-list'.
Use optional LIST if provided instead.
If called interactively, read LIST using the minibuffer."
- (interactive "PList of functions to instrument: ")
+ (interactive "PList of functions to instrument: ") ;FIXME: Doesn't work?!
(unless (listp list)
(signal 'wrong-type-argument (list 'listp list)))
- (let ((list (or list elp-function-list)))
- (mapcar 'elp-instrument-function list)))
+ (mapcar #'elp-instrument-function (or list elp-function-list)))
;;;###autoload
(defun elp-instrument-package (prefix)
(defun elp-restore-list (&optional list)
"Restore the original definitions for all functions in `elp-function-list'.
Use optional LIST if provided instead."
- (interactive "PList of functions to restore: ")
- (let ((list (or list elp-function-list)))
- (mapcar 'elp-restore-function list)))
+ (interactive "PList of functions to restore: ") ;FIXME: Doesn't work!?
+ (mapcar #'elp-restore-function (or list elp-function-list)))
(defun elp-restore-all ()
"Restore the original definitions of all functions being profiled."
(interactive)
- (elp-restore-list elp-all-instrumented-list))
-
+ (mapatoms #'elp-restore-function))
\f
(defun elp-reset-function (funsym)
"Reset the profiling information for FUNSYM."
(defun elp-reset-list (&optional list)
"Reset the profiling information for all functions in `elp-function-list'.
Use optional LIST if provided instead."
- (interactive "PList of functions to reset: ")
+ (interactive "PList of functions to reset: ") ;FIXME: Doesn't work!?
(let ((list (or list elp-function-list)))
(mapcar 'elp-reset-function list)))
(defun elp-reset-all ()
"Reset the profiling information for all functions being profiled."
(interactive)
- (elp-reset-list elp-all-instrumented-list))
+ (mapatoms (lambda (sym)
+ (if (get sym elp-timer-info-property)
+ (elp-reset-function sym)))))
(defun elp-set-master (funsym)
"Set the master function for profiling."
- (interactive "aMaster function: ")
- ;; when there's a master function, recording is turned off by
- ;; default
+ (interactive
+ (list
+ (intern
+ (completing-read "Master function: " obarray
+ #'elp--instrumented-p
+ t nil nil (if elp-master (symbol-name elp-master))))))
+ ;; When there's a master function, recording is turned off by default.
(setq elp-master funsym
elp-record-p nil)
- ;; make sure master function is instrumented
- (or (memq funsym elp-all-instrumented-list)
+ ;; Make sure master function is instrumented.
+ (or (elp--instrumented-p funsym)
(elp-instrument-function funsym)))
(defun elp-unset-master ()
"Unset the master function."
(interactive)
- ;; when there's no master function, recording is turned on by default.
+ ;; When there's no master function, recording is turned on by default.
(setq elp-master nil
elp-record-p t))
(defsubst elp-elapsed-time (start end)
(float-time (time-subtract end start)))
-(defun elp-wrapper (funsym interactive-p args)
- "This function has been instrumented for profiling by the ELP.
+(defun elp--make-wrapper (funsym)
+ "Make the piece of advice that instruments FUNSYM."
+ (lambda (func &rest args)
+ "This function has been instrumented for profiling by the ELP.
ELP is the Emacs Lisp Profiler. To restore the function to its
original definition, use \\[elp-restore-function] or \\[elp-restore-all]."
- ;; turn on recording if this is the master function
- (if (and elp-master
- (eq funsym elp-master))
- (setq elp-record-p t))
- ;; get info vector and original function symbol
- (let* ((info (get funsym elp-timer-info-property))
- (func (aref info 2))
- result)
- (or func
- (error "%s is not instrumented for profiling" funsym))
- (if (not elp-record-p)
- ;; when not recording, just call the original function symbol
- ;; and return the results.
- (setq result
- (if interactive-p
- (call-interactively func)
- (apply func args)))
- ;; we are recording times
- (let (enter-time exit-time)
- ;; increment the call-counter
- (aset info 0 (1+ (aref info 0)))
- ;; now call the old symbol function, checking to see if it
- ;; should be called interactively. make sure we return the
- ;; correct value
- (if interactive-p
- (setq enter-time (current-time)
- result (call-interactively func)
- exit-time (current-time))
+ ;; turn on recording if this is the master function
+ (if (and elp-master
+ (eq funsym elp-master))
+ (setq elp-record-p t))
+ ;; get info vector and original function symbol
+ (let* ((info (get funsym elp-timer-info-property))
+ result)
+ (or func
+ (error "%s is not instrumented for profiling" funsym))
+ (if (not elp-record-p)
+ ;; when not recording, just call the original function symbol
+ ;; and return the results.
+ (setq result (apply func args))
+ ;; we are recording times
+ (let (enter-time exit-time)
+ ;; increment the call-counter
+ (cl-incf (aref info 0))
(setq enter-time (current-time)
result (apply func args)
- exit-time (current-time)))
- ;; calculate total time in function
- (aset info 1 (+ (aref info 1) (elp-elapsed-time enter-time exit-time)))
- ))
- ;; turn off recording if this is the master function
- (if (and elp-master
- (eq funsym elp-master))
- (setq elp-record-p nil))
- result))
+ exit-time (current-time))
+ ;; calculate total time in function
+ (cl-incf (aref info 1) (elp-elapsed-time enter-time exit-time))
+ ))
+ ;; turn off recording if this is the master function
+ (if (and elp-master
+ (eq funsym elp-master))
+ (setq elp-record-p nil))
+ result)))
\f
;; shut the byte-compiler up
(elp-et-len (length et-header))
(at-header "Average Time")
(elp-at-len (length at-header))
- (resvec
- (mapcar
- (function
- (lambda (funsym)
- (let* ((info (get funsym elp-timer-info-property))
- (symname (format "%s" funsym))
- (cc (aref info 0))
- (tt (aref info 1)))
- (if (not info)
- (insert "No profiling information found for: "
- symname)
- (setq longest (max longest (length symname)))
- (vector cc tt (if (zerop cc)
- 0.0 ;avoid arithmetic div-by-zero errors
- (/ (float tt) (float cc)))
- symname)))))
- elp-all-instrumented-list))
+ (resvec '())
) ; end let*
+ (mapatoms
+ (lambda (funsym)
+ (when (elp--instrumented-p funsym)
+ (let* ((info (get funsym elp-timer-info-property))
+ (symname (format "%s" funsym))
+ (cc (aref info 0))
+ (tt (aref info 1)))
+ (if (not info)
+ (insert "No profiling information found for: "
+ symname)
+ (setq longest (max longest (length symname)))
+ (push
+ (vector cc tt (if (zerop cc)
+ 0.0 ;avoid arithmetic div-by-zero errors
+ (/ (float tt) (float cc)))
+ symname)
+ resvec))))))
;; If printing to stdout, insert the header so it will print.
;; Otherwise use header-line-format.
(setq elp-field-len (max titlelen longest))
(if (or elp-use-standard-output noninteractive)
- (progn
- (insert title)
- (if (> longest titlelen)
- (progn
- (insert-char 32 (- longest titlelen))))
- (insert " " cc-header " " et-header " " at-header "\n")
- (insert-char ?= elp-field-len)
- (insert " ")
- (insert-char ?= elp-cc-len)
- (insert " ")
- (insert-char ?= elp-et-len)
- (insert " ")
- (insert-char ?= elp-at-len)
- (insert "\n"))
- (let ((column 0))
- (setq header-line-format
- (mapconcat
- (lambda (title)
- (prog1
- (concat
- (propertize " "
- 'display (list 'space :align-to column)
- 'face 'fixed-pitch)
- title)
- (setq column (+ column 2
- (if (= column 0)
- elp-field-len
- (length title))))))
- (list title cc-header et-header at-header) ""))))
+ (progn
+ (insert title)
+ (if (> longest titlelen)
+ (progn
+ (insert-char 32 (- longest titlelen))))
+ (insert " " cc-header " " et-header " " at-header "\n")
+ (insert-char ?= elp-field-len)
+ (insert " ")
+ (insert-char ?= elp-cc-len)
+ (insert " ")
+ (insert-char ?= elp-et-len)
+ (insert " ")
+ (insert-char ?= elp-at-len)
+ (insert "\n"))
+ (let ((column 0))
+ (setq header-line-format
+ (mapconcat
+ (lambda (title)
+ (prog1
+ (concat
+ (propertize " "
+ 'display (list 'space :align-to column)
+ 'face 'fixed-pitch)
+ title)
+ (setq column (+ column 2
+ (if (= column 0)
+ elp-field-len
+ (length title))))))
+ (list title cc-header et-header at-header) ""))))
;; if sorting is enabled, then sort the results list. in either
;; case, call elp-output-result to output the result in the
;; buffer
(pop-to-buffer resultsbuf)
;; copy results to standard-output?
(if (or elp-use-standard-output noninteractive)
- (princ (buffer-substring (point-min) (point-max)))
+ (princ (buffer-substring (point-min) (point-max)))
(goto-char (point-min)))
;; reset profiling info if desired
(and elp-reset-after-results
-;;; ert-x.el --- Staging area for experimental extensions to ERT
+;;; ert-x.el --- Staging area for experimental extensions to ERT -*- lexical-binding: t -*-
;; Copyright (C) 2008, 2010-2013 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile
- (require 'cl))
+(eval-when-compile (require 'cl-lib))
(require 'ert)
(kill-buffer ert--buffer)
(remhash ert--buffer ert--test-buffers))))
-(defmacro* ert-with-test-buffer ((&key ((:name name-form)))
- &body body)
+(cl-defmacro ert-with-test-buffer ((&key ((:name name-form)))
+ &body body)
"Create a test buffer and run BODY in that buffer.
To be used in ERT tests. If BODY finishes successfully, the test
"Kill all test buffers that are still live."
(interactive)
(let ((count 0))
- (maphash (lambda (buffer dummy)
+ (maphash (lambda (buffer _dummy)
(when (or (not (buffer-live-p buffer))
(kill-buffer buffer))
- (incf count)))
+ (cl-incf count)))
ert--test-buffers)
(message "%s out of %s test buffers killed"
count (hash-table-count ert--test-buffers)))
NOTE: Since the command is not called by `call-interactively'
test for `called-interactively' in the command will fail."
- (assert (listp command) t)
- (assert (commandp (car command)) t)
- (assert (not unread-command-events) t)
+ (cl-assert (listp command) t)
+ (cl-assert (commandp (car command)) t)
+ (cl-assert (not unread-command-events) t)
(let (return-value)
;; For the order of things here see command_loop_1 in keyboard.c.
;;
(when (boundp 'last-repeatable-command)
(setq last-repeatable-command real-last-command))
(when (and deactivate-mark transient-mark-mode) (deactivate-mark))
- (assert (not unread-command-events) t)
+ (cl-assert (not unread-command-events) t)
return-value))
(defun ert-run-idle-timers ()
(with-temp-buffer
(insert s)
(dolist (x regexps)
- (destructuring-bind (regexp subexp) (if (listp x) x `(,x nil))
+ (cl-destructuring-bind (regexp subexp) (if (listp x) x `(,x nil))
(goto-char (point-min))
(while (re-search-forward regexp nil t)
(replace-match "" t t nil subexp))))
None of the ARGS are modified, but the return value may share
structure with the plists in ARGS."
(with-temp-buffer
- (loop with current-plist = nil
- for x in args do
- (etypecase x
- (string (let ((begin (point)))
- (insert x)
- (set-text-properties begin (point) current-plist)))
- (list (unless (zerop (mod (length x) 2))
- (error "Odd number of args in plist: %S" x))
- (setq current-plist x))))
+ (cl-loop with current-plist = nil
+ for x in args do
+ (cl-etypecase x
+ (string (let ((begin (point)))
+ (insert x)
+ (set-text-properties begin (point) current-plist)))
+ (list (unless (zerop (mod (length x) 2))
+ (error "Odd number of args in plist: %S" x))
+ (setq current-plist x))))
(buffer-string)))
This is useful if THUNK has undesirable side-effects on an Emacs
buffer with a fixed name such as *Messages*."
- (lexical-let ((new-buffer-name (generate-new-buffer-name
- (format "%s orig buffer" buffer-name))))
+ (let ((new-buffer-name (generate-new-buffer-name
+ (format "%s orig buffer" buffer-name))))
(with-current-buffer (get-buffer-create buffer-name)
(rename-buffer new-buffer-name))
(unwind-protect
(with-current-buffer new-buffer-name
(rename-buffer buffer-name)))))
-(defmacro* ert-with-buffer-renamed ((buffer-name-form) &body body)
+(cl-defmacro ert-with-buffer-renamed ((buffer-name-form) &body body)
"Protect the buffer named BUFFER-NAME from side-effects and run BODY.
See `ert-call-with-buffer-renamed' for details."
-;;; ert.el --- Emacs Lisp Regression Testing
+;;; ert.el --- Emacs Lisp Regression Testing -*- lexical-binding: t -*-
;; Copyright (C) 2007-2008, 2010-2013 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile
- (require 'cl))
+(eval-when-compile (require 'cl-lib))
(require 'button)
(require 'debug)
(require 'easymenu)
"A reimplementation of `remove-if-not'.
ERT-PRED is a predicate, ERT-LIST is the input list."
- (loop for ert-x in ert-list
- if (funcall ert-pred ert-x)
- collect ert-x))
+ (cl-loop for ert-x in ert-list
+ if (funcall ert-pred ert-x)
+ collect ert-x))
(defun ert--intersection (a b)
"A reimplementation of `intersection'. Intersect the sets A and B.
Elements are compared using `eql'."
- (loop for x in a
- if (memql x b)
- collect x))
+ (cl-loop for x in a
+ if (memql x b)
+ collect x))
(defun ert--set-difference (a b)
"A reimplementation of `set-difference'. Subtract the set B from the set A.
Elements are compared using `eql'."
- (loop for x in a
- unless (memql x b)
- collect x))
+ (cl-loop for x in a
+ unless (memql x b)
+ collect x))
(defun ert--set-difference-eq (a b)
"A reimplementation of `set-difference'. Subtract the set B from the set A.
Elements are compared using `eq'."
- (loop for x in a
- unless (memq x b)
- collect x))
+ (cl-loop for x in a
+ unless (memq x b)
+ collect x))
(defun ert--union (a b)
"A reimplementation of `union'. Compute the union of the sets A and B.
(make-symbol (format "%s%s"
prefix
(prog1 ert--gensym-counter
- (incf ert--gensym-counter))))))
+ (cl-incf ert--gensym-counter))))))
(defun ert--coerce-to-vector (x)
"Coerce X to a vector."
x
(vconcat x)))
-(defun* ert--remove* (x list &key key test)
+(cl-defun ert--remove* (x list &key key test)
"Does not support all the keywords of remove*."
(unless key (setq key #'identity))
(unless test (setq test #'eql))
- (loop for y in list
- unless (funcall test x (funcall key y))
- collect y))
+ (cl-loop for y in list
+ unless (funcall test x (funcall key y))
+ collect y))
(defun ert--string-position (c s)
"Return the position of the first occurrence of C in S, or nil if none."
- (loop for i from 0
- for x across s
- when (eql x c) return i))
+ (cl-loop for i from 0
+ for x across s
+ when (eql x c) return i))
(defun ert--mismatch (a b)
"Return index of first element that differs between A and B.
(t
(let ((la (length a))
(lb (length b)))
- (assert (arrayp a) t)
- (assert (arrayp b) t)
- (assert (<= la lb) t)
- (loop for i below la
- when (not (equal (aref a i) (aref b i))) return i
- finally (return (if (/= la lb)
- la
- (assert (equal a b) t)
- nil)))))))
+ (cl-assert (arrayp a) t)
+ (cl-assert (arrayp b) t)
+ (cl-assert (<= la lb) t)
+ (cl-loop for i below la
+ when (not (equal (aref a i) (aref b i))) return i
+ finally (cl-return (if (/= la lb)
+ la
+ (cl-assert (equal a b) t)
+ nil)))))))
(defun ert--subseq (seq start &optional end)
"Return a subsequence of SEQ from START to END."
(when (char-table-p seq) (error "Not supported"))
(let ((vector (substring (ert--coerce-to-vector seq) start end)))
- (etypecase seq
+ (cl-etypecase seq
(vector vector)
(string (concat vector))
(list (append vector nil))
- (bool-vector (loop with result = (make-bool-vector (length vector) nil)
- for i below (length vector) do
- (setf (aref result i) (aref vector i))
- finally (return result)))
- (char-table (assert nil)))))
+ (bool-vector (cl-loop with result
+ = (make-bool-vector (length vector) nil)
+ for i below (length vector) do
+ (setf (aref result i) (aref vector i))
+ finally (cl-return result)))
+ (char-table (cl-assert nil)))))
(defun ert-equal-including-properties (a b)
"Return t if A and B have similar structure and contents.
;;; Defining and locating tests.
;; The data structure that represents a test case.
-(defstruct ert-test
+(cl-defstruct ert-test
(name nil)
(documentation nil)
- (body (assert nil))
+ (body (cl-assert nil))
(most-recent-result nil)
(expected-result-type ':passed)
(tags '()))
and the body."
(let ((extracted-key-accu '())
(remaining keys-and-body))
- (while (and (consp remaining) (keywordp (first remaining)))
+ (while (keywordp (car-safe remaining))
(let ((keyword (pop remaining)))
(unless (consp remaining)
(error "Value expected after keyword %S in %S"
keys-and-body))
(push (cons keyword (pop remaining)) extracted-key-accu)))
(setq extracted-key-accu (nreverse extracted-key-accu))
- (list (loop for (key . value) in extracted-key-accu
- collect key
- collect value)
+ (list (cl-loop for (key . value) in extracted-key-accu
+ collect key
+ collect value)
remaining)))
;;;###autoload
-(defmacro* ert-deftest (name () &body docstring-keys-and-body)
+(cl-defmacro ert-deftest (name () &body docstring-keys-and-body)
"Define NAME (a symbol) as a test.
BODY is evaluated as a `progn' when the test is run. It should
(indent 2))
(let ((documentation nil)
(documentation-supplied-p nil))
- (when (stringp (first docstring-keys-and-body))
+ (when (stringp (car docstring-keys-and-body))
(setq documentation (pop docstring-keys-and-body)
documentation-supplied-p t))
- (destructuring-bind ((&key (expected-result nil expected-result-supplied-p)
- (tags nil tags-supplied-p))
- body)
+ (cl-destructuring-bind
+ ((&key (expected-result nil expected-result-supplied-p)
+ (tags nil tags-supplied-p))
+ body)
(ert--parse-keys-and-body docstring-keys-and-body)
`(progn
(ert-set-test ',name
(t
(let ((fn-name (car form))
(arg-forms (cdr form)))
- (assert (or (symbolp fn-name)
- (and (consp fn-name)
- (eql (car fn-name) 'lambda)
- (listp (cdr fn-name)))))
+ (cl-assert (or (symbolp fn-name)
+ (and (consp fn-name)
+ (eql (car fn-name) 'lambda)
+ (listp (cdr fn-name)))))
(let ((fn (ert--gensym "fn-"))
(args (ert--gensym "args-"))
(value (ert--gensym "value-"))
and error signaling specific to the particular variant of
`should'. The code that INNER-EXPANDER returns must not call
FORM-DESCRIPTION-FORM before it has called INNER-FORM."
- (lexical-let ((inner-expander inner-expander))
- (ert--expand-should-1
- whole form
- (lambda (inner-form form-description-form value-var)
- (let ((form-description (ert--gensym "form-description-")))
- `(let (,form-description)
- ,(funcall inner-expander
- `(unwind-protect
- ,inner-form
- (setq ,form-description ,form-description-form)
- (ert--signal-should-execution ,form-description))
- `,form-description
- value-var)))))))
-
-(defmacro* should (form)
+ (ert--expand-should-1
+ whole form
+ (lambda (inner-form form-description-form value-var)
+ (let ((form-description (ert--gensym "form-description-")))
+ `(let (,form-description)
+ ,(funcall inner-expander
+ `(unwind-protect
+ ,inner-form
+ (setq ,form-description ,form-description-form)
+ (ert--signal-should-execution ,form-description))
+ `,form-description
+ value-var))))))
+
+(cl-defmacro should (form)
"Evaluate FORM. If it returns nil, abort the current test as failed.
Returns the value of FORM."
(ert--expand-should `(should ,form) form
- (lambda (inner-form form-description-form value-var)
+ (lambda (inner-form form-description-form _value-var)
`(unless ,inner-form
(ert-fail ,form-description-form)))))
-(defmacro* should-not (form)
+(cl-defmacro should-not (form)
"Evaluate FORM. If it returns non-nil, abort the current test as failed.
Returns nil."
(ert--expand-should `(should-not ,form) form
- (lambda (inner-form form-description-form value-var)
+ (lambda (inner-form form-description-form _value-var)
`(unless (not ,inner-form)
(ert-fail ,form-description-form)))))
Determines whether CONDITION matches TYPE and EXCLUDE-SUBTYPES,
and aborts the current test as failed if it doesn't."
(let ((signaled-conditions (get (car condition) 'error-conditions))
- (handled-conditions (etypecase type
+ (handled-conditions (cl-etypecase type
(list type)
(symbol (list type)))))
- (assert signaled-conditions)
+ (cl-assert signaled-conditions)
(unless (ert--intersection signaled-conditions handled-conditions)
(ert-fail (append
(funcall form-description-fn)
;; FIXME: The expansion will evaluate the keyword args (if any) in
;; nonstandard order.
-(defmacro* should-error (form &rest keys &key type exclude-subtypes)
+(cl-defmacro should-error (form &rest keys &key type exclude-subtypes)
"Evaluate FORM and check that it signals an error.
The error signaled needs to match TYPE. TYPE should be a list
(defun ert--proper-list-p (x)
"Return non-nil if X is a proper list, nil otherwise."
- (loop
+ (cl-loop
for firstp = t then nil
for fast = x then (cddr fast)
for slow = x then (cdr slow) do
- (when (null fast) (return t))
- (when (not (consp fast)) (return nil))
- (when (null (cdr fast)) (return t))
- (when (not (consp (cdr fast))) (return nil))
- (when (and (not firstp) (eq fast slow)) (return nil))))
+ (when (null fast) (cl-return t))
+ (when (not (consp fast)) (cl-return nil))
+ (when (null (cdr fast)) (cl-return t))
+ (when (not (consp (cdr fast))) (cl-return nil))
+ (when (and (not firstp) (eq fast slow)) (cl-return nil))))
(defun ert--explain-format-atom (x)
"Format the atom X for `ert--explain-equal'."
- (typecase x
+ (cl-typecase x
(fixnum (list x (format "#x%x" x) (format "?%c" x)))
(t x)))
Returns nil if they are."
(if (not (equal (type-of a) (type-of b)))
`(different-types ,a ,b)
- (etypecase a
+ (cl-etypecase a
(cons
(let ((a-proper-p (ert--proper-list-p a))
(b-proper-p (ert--proper-list-p b)))
,a ,b
first-mismatch-at
,(ert--mismatch a b))
- (loop for i from 0
- for ai in a
- for bi in b
- for xi = (ert--explain-equal-rec ai bi)
- do (when xi (return `(list-elt ,i ,xi)))
- finally (assert (equal a b) t)))
+ (cl-loop for i from 0
+ for ai in a
+ for bi in b
+ for xi = (ert--explain-equal-rec ai bi)
+ do (when xi (cl-return `(list-elt ,i ,xi)))
+ finally (cl-assert (equal a b) t)))
(let ((car-x (ert--explain-equal-rec (car a) (car b))))
(if car-x
`(car ,car-x)
(let ((cdr-x (ert--explain-equal-rec (cdr a) (cdr b))))
(if cdr-x
`(cdr ,cdr-x)
- (assert (equal a b) t)
+ (cl-assert (equal a b) t)
nil))))))))
(array (if (not (equal (length a) (length b)))
`(arrays-of-different-length ,(length a) ,(length b)
,@(unless (char-table-p a)
`(first-mismatch-at
,(ert--mismatch a b))))
- (loop for i from 0
- for ai across a
- for bi across b
- for xi = (ert--explain-equal-rec ai bi)
- do (when xi (return `(array-elt ,i ,xi)))
- finally (assert (equal a b) t))))
+ (cl-loop for i from 0
+ for ai across a
+ for bi across b
+ for xi = (ert--explain-equal-rec ai bi)
+ do (when xi (cl-return `(array-elt ,i ,xi)))
+ finally (cl-assert (equal a b) t))))
(atom (if (not (equal a b))
(if (and (symbolp a) (symbolp b) (string= a b))
`(different-symbols-with-the-same-name ,a ,b)
(defun ert--significant-plist-keys (plist)
"Return the keys of PLIST that have non-null values, in order."
- (assert (zerop (mod (length plist) 2)) t)
- (loop for (key value . rest) on plist by #'cddr
- unless (or (null value) (memq key accu)) collect key into accu
- finally (return accu)))
+ (cl-assert (zerop (mod (length plist) 2)) t)
+ (cl-loop for (key value . rest) on plist by #'cddr
+ unless (or (null value) (memq key accu)) collect key into accu
+ finally (cl-return accu)))
(defun ert--plist-difference-explanation (a b)
"Return a programmer-readable explanation of why A and B are different plists.
Returns nil if they are equivalent, i.e., have the same value for
each key, where absent values are treated as nil. The order of
key/value pairs in each list does not matter."
- (assert (zerop (mod (length a) 2)) t)
- (assert (zerop (mod (length b) 2)) t)
+ (cl-assert (zerop (mod (length a) 2)) t)
+ (cl-assert (zerop (mod (length b) 2)) t)
;; Normalizing the plists would be another way to do this but it
;; requires a total ordering on all lisp objects (since any object
;; is valid as a text property key). Perhaps defining such an
(keys-b (ert--significant-plist-keys b))
(keys-in-a-not-in-b (ert--set-difference-eq keys-a keys-b))
(keys-in-b-not-in-a (ert--set-difference-eq keys-b keys-a)))
- (flet ((explain-with-key (key)
- (let ((value-a (plist-get a key))
- (value-b (plist-get b key)))
- (assert (not (equal value-a value-b)) t)
- `(different-properties-for-key
- ,key ,(ert--explain-equal-including-properties value-a
- value-b)))))
+ (cl-flet ((explain-with-key (key)
+ (let ((value-a (plist-get a key))
+ (value-b (plist-get b key)))
+ (cl-assert (not (equal value-a value-b)) t)
+ `(different-properties-for-key
+ ,key ,(ert--explain-equal-including-properties value-a
+ value-b)))))
(cond (keys-in-a-not-in-b
- (explain-with-key (first keys-in-a-not-in-b)))
+ (explain-with-key (car keys-in-a-not-in-b)))
(keys-in-b-not-in-a
- (explain-with-key (first keys-in-b-not-in-a)))
+ (explain-with-key (car keys-in-b-not-in-a)))
(t
- (loop for key in keys-a
- when (not (equal (plist-get a key) (plist-get b key)))
- return (explain-with-key key)))))))
+ (cl-loop for key in keys-a
+ when (not (equal (plist-get a key) (plist-get b key)))
+ return (explain-with-key key)))))))
(defun ert--abbreviate-string (s len suffixp)
"Shorten string S to at most LEN chars.
`ert-equal-including-properties', or nil if they are."
(if (not (equal a b))
(ert--explain-equal a b)
- (assert (stringp a) t)
- (assert (stringp b) t)
- (assert (eql (length a) (length b)) t)
- (loop for i from 0 to (length a)
- for props-a = (text-properties-at i a)
- for props-b = (text-properties-at i b)
- for difference = (ert--plist-difference-explanation props-a props-b)
- do (when difference
- (return `(char ,i ,(substring-no-properties a i (1+ i))
- ,difference
- context-before
- ,(ert--abbreviate-string
- (substring-no-properties a 0 i)
- 10 t)
- context-after
- ,(ert--abbreviate-string
- (substring-no-properties a (1+ i))
- 10 nil))))
- ;; TODO(ohler): Get `equal-including-properties' fixed in
- ;; Emacs, delete `ert-equal-including-properties', and
- ;; re-enable this assertion.
- ;;finally (assert (equal-including-properties a b) t)
- )))
+ (cl-assert (stringp a) t)
+ (cl-assert (stringp b) t)
+ (cl-assert (eql (length a) (length b)) t)
+ (cl-loop for i from 0 to (length a)
+ for props-a = (text-properties-at i a)
+ for props-b = (text-properties-at i b)
+ for difference = (ert--plist-difference-explanation
+ props-a props-b)
+ do (when difference
+ (cl-return `(char ,i ,(substring-no-properties a i (1+ i))
+ ,difference
+ context-before
+ ,(ert--abbreviate-string
+ (substring-no-properties a 0 i)
+ 10 t)
+ context-after
+ ,(ert--abbreviate-string
+ (substring-no-properties a (1+ i))
+ 10 nil))))
+ ;; TODO(ohler): Get `equal-including-properties' fixed in
+ ;; Emacs, delete `ert-equal-including-properties', and
+ ;; re-enable this assertion.
+ ;;finally (cl-assert (equal-including-properties a b) t)
+ )))
(put 'ert-equal-including-properties
'ert-explainer
'ert--explain-equal-including-properties)
Bound dynamically. This is a list of (PREFIX . MESSAGE) pairs.")
-(defmacro* ert-info ((message-form &key ((:prefix prefix-form) "Info: "))
- &body body)
+(cl-defmacro ert-info ((message-form &key ((:prefix prefix-form) "Info: "))
+ &body body)
"Evaluate MESSAGE-FORM and BODY, and report the message if BODY fails.
To be used within ERT tests. MESSAGE-FORM should evaluate to a
"Non-nil means enter debugger when a test fails or terminates with an error.")
;; The data structures that represent the result of running a test.
-(defstruct ert-test-result
+(cl-defstruct ert-test-result
(messages nil)
(should-forms nil)
)
-(defstruct (ert-test-passed (:include ert-test-result)))
-(defstruct (ert-test-result-with-condition (:include ert-test-result))
- (condition (assert nil))
- (backtrace (assert nil))
- (infos (assert nil)))
-(defstruct (ert-test-quit (:include ert-test-result-with-condition)))
-(defstruct (ert-test-failed (:include ert-test-result-with-condition)))
-(defstruct (ert-test-aborted-with-non-local-exit (:include ert-test-result)))
+(cl-defstruct (ert-test-passed (:include ert-test-result)))
+(cl-defstruct (ert-test-result-with-condition (:include ert-test-result))
+ (condition (cl-assert nil))
+ (backtrace (cl-assert nil))
+ (infos (cl-assert nil)))
+(cl-defstruct (ert-test-quit (:include ert-test-result-with-condition)))
+(cl-defstruct (ert-test-failed (:include ert-test-result-with-condition)))
+(cl-defstruct (ert-test-aborted-with-non-local-exit
+ (:include ert-test-result)))
(defun ert--record-backtrace ()
;; `ert-results-pop-to-backtrace-for-test-at-point' given that we
;; already have `ert-results-rerun-test-debugging-errors-at-point'.
;; For batch use, however, printing the backtrace may be useful.
- (loop
+ (cl-loop
;; 6 is the number of frames our own debugger adds (when
;; compiled; more when interpreted). FIXME: Need to describe a
;; procedure for determining this constant.
(print-level 8)
(print-length 50))
(dolist (frame backtrace)
- (ecase (first frame)
+ (cl-ecase (car frame)
((nil)
;; Special operator.
- (destructuring-bind (special-operator &rest arg-forms)
+ (cl-destructuring-bind (special-operator &rest arg-forms)
(cdr frame)
(insert
- (format " %S\n" (list* special-operator arg-forms)))))
+ (format " %S\n" (cons special-operator arg-forms)))))
((t)
;; Function call.
- (destructuring-bind (fn &rest args) (cdr frame)
+ (cl-destructuring-bind (fn &rest args) (cdr frame)
(insert (format " %S(" fn))
- (loop for firstp = t then nil
- for arg in args do
- (unless firstp
- (insert " "))
- (insert (format "%S" arg)))
+ (cl-loop for firstp = t then nil
+ for arg in args do
+ (unless firstp
+ (insert " "))
+ (insert (format "%S" arg)))
(insert ")\n")))))))
;; A container for the state of the execution of a single test and
;; environment data needed during its execution.
-(defstruct ert--test-execution-info
- (test (assert nil))
- (result (assert nil))
+(cl-defstruct ert--test-execution-info
+ (test (cl-assert nil))
+ (result (cl-assert nil))
;; A thunk that may be called when RESULT has been set to its final
;; value and test execution should be terminated. Should not
;; return.
- (exit-continuation (assert nil))
+ (exit-continuation (cl-assert nil))
;; The binding of `debugger' outside of the execution of the test.
next-debugger
;; The binding of `ert-debug-on-error' that is in effect for the
;; don't remember whether this feature is important.)
ert-debug-on-error)
-(defun ert--run-test-debugger (info debugger-args)
+(defun ert--run-test-debugger (info args)
"During a test run, `debugger' is bound to a closure that calls this function.
This function records failures and errors and either terminates
appropriate.
INFO is the ert--test-execution-info corresponding to this test
-run. DEBUGGER-ARGS are the arguments to `debugger'."
- (destructuring-bind (first-debugger-arg &rest more-debugger-args)
- debugger-args
- (ecase first-debugger-arg
+run. ARGS are the arguments to `debugger'."
+ (cl-destructuring-bind (first-debugger-arg &rest more-debugger-args)
+ args
+ (cl-ecase first-debugger-arg
((lambda debug t exit nil)
- (apply (ert--test-execution-info-next-debugger info) debugger-args))
+ (apply (ert--test-execution-info-next-debugger info) args))
(error
- (let* ((condition (first more-debugger-args))
- (type (case (car condition)
+ (let* ((condition (car more-debugger-args))
+ (type (cl-case (car condition)
((quit) 'quit)
(otherwise 'failed)))
(backtrace (ert--record-backtrace))
(infos (reverse ert--infos)))
(setf (ert--test-execution-info-result info)
- (ecase type
+ (cl-ecase type
(quit
(make-ert-test-quit :condition condition
:backtrace backtrace
:infos infos))))
;; Work around Emacs's heuristic (in eval.c) for detecting
;; errors in the debugger.
- (incf num-nonmacro-input-events)
+ (cl-incf num-nonmacro-input-events)
;; FIXME: We should probably implement more fine-grained
;; control a la non-t `debug-on-error' here.
(cond
((ert--test-execution-info-ert-debug-on-error info)
- (apply (ert--test-execution-info-next-debugger info) debugger-args))
+ (apply (ert--test-execution-info-next-debugger info) args))
(t))
(funcall (ert--test-execution-info-exit-continuation info)))))))
-(defun ert--run-test-internal (ert-test-execution-info)
- "Low-level function to run a test according to ERT-TEST-EXECUTION-INFO.
+(defun ert--run-test-internal (test-execution-info)
+ "Low-level function to run a test according to TEST-EXECUTION-INFO.
This mainly sets up debugger-related bindings."
- (lexical-let ((info ert-test-execution-info))
- (setf (ert--test-execution-info-next-debugger info) debugger
- (ert--test-execution-info-ert-debug-on-error info) ert-debug-on-error)
- (catch 'ert--pass
- ;; For now, each test gets its own temp buffer and its own
- ;; window excursion, just to be safe. If this turns out to be
- ;; too expensive, we can remove it.
- (with-temp-buffer
- (save-window-excursion
- (let ((debugger (lambda (&rest debugger-args)
- (ert--run-test-debugger info debugger-args)))
- (debug-on-error t)
- (debug-on-quit t)
- ;; FIXME: Do we need to store the old binding of this
- ;; and consider it in `ert--run-test-debugger'?
- (debug-ignored-errors nil)
- (ert--infos '()))
- (funcall (ert-test-body (ert--test-execution-info-test info))))))
- (ert-pass))
- (setf (ert--test-execution-info-result info) (make-ert-test-passed)))
+ (setf (ert--test-execution-info-next-debugger test-execution-info) debugger
+ (ert--test-execution-info-ert-debug-on-error test-execution-info)
+ ert-debug-on-error)
+ (catch 'ert--pass
+ ;; For now, each test gets its own temp buffer and its own
+ ;; window excursion, just to be safe. If this turns out to be
+ ;; too expensive, we can remove it.
+ (with-temp-buffer
+ (save-window-excursion
+ (let ((debugger (lambda (&rest args)
+ (ert--run-test-debugger test-execution-info
+ args)))
+ (debug-on-error t)
+ (debug-on-quit t)
+ ;; FIXME: Do we need to store the old binding of this
+ ;; and consider it in `ert--run-test-debugger'?
+ (debug-ignored-errors nil)
+ (ert--infos '()))
+ (funcall (ert-test-body (ert--test-execution-info-test
+ test-execution-info))))))
+ (ert-pass))
+ (setf (ert--test-execution-info-result test-execution-info)
+ (make-ert-test-passed))
nil)
(defun ert--force-message-log-buffer-truncation ()
Returns the result and stores it in ERT-TEST's `most-recent-result' slot."
(setf (ert-test-most-recent-result ert-test) nil)
- (block error
- (lexical-let ((begin-marker
- (with-current-buffer (get-buffer-create "*Messages*")
- (set-marker (make-marker) (point-max)))))
+ (cl-block error
+ (let ((begin-marker
+ (with-current-buffer (get-buffer-create "*Messages*")
+ (set-marker (make-marker) (point-max)))))
(unwind-protect
- (lexical-let ((info (make-ert--test-execution-info
- :test ert-test
- :result
- (make-ert-test-aborted-with-non-local-exit)
- :exit-continuation (lambda ()
- (return-from error nil))))
- (should-form-accu (list)))
+ (let ((info (make-ert--test-execution-info
+ :test ert-test
+ :result
+ (make-ert-test-aborted-with-non-local-exit)
+ :exit-continuation (lambda ()
+ (cl-return-from error nil))))
+ (should-form-accu (list)))
(unwind-protect
(let ((ert--should-execution-observer
(lambda (form-description)
RESULT."
;; It would be easy to add `member' and `eql' types etc., but I
;; haven't bothered yet.
- (etypecase result-type
+ (cl-etypecase result-type
((member nil) nil)
((member t) t)
((member :failed) (ert-test-failed-p result))
((member :passed) (ert-test-passed-p result))
(cons
- (destructuring-bind (operator &rest operands) result-type
- (ecase operator
+ (cl-destructuring-bind (operator &rest operands) result-type
+ (cl-ecase operator
(and
- (case (length operands)
+ (cl-case (length operands)
(0 t)
(t
- (and (ert-test-result-type-p result (first operands))
- (ert-test-result-type-p result `(and ,@(rest operands)))))))
+ (and (ert-test-result-type-p result (car operands))
+ (ert-test-result-type-p result `(and ,@(cdr operands)))))))
(or
- (case (length operands)
+ (cl-case (length operands)
(0 nil)
(t
- (or (ert-test-result-type-p result (first operands))
- (ert-test-result-type-p result `(or ,@(rest operands)))))))
+ (or (ert-test-result-type-p result (car operands))
+ (ert-test-result-type-p result `(or ,@(cdr operands)))))))
(not
- (assert (eql (length operands) 1))
- (not (ert-test-result-type-p result (first operands))))
+ (cl-assert (eql (length operands) 1))
+ (not (ert-test-result-type-p result (car operands))))
(satisfies
- (assert (eql (length operands) 1))
- (funcall (first operands) result)))))))
+ (cl-assert (eql (length operands) 1))
+ (funcall (car operands) result)))))))
(defun ert-test-result-expected-p (test result)
"Return non-nil if TEST's expected result type matches RESULT."
contained in UNIVERSE."
;; This code needs to match the etypecase in
;; `ert-insert-human-readable-selector'.
- (etypecase selector
+ (cl-etypecase selector
((member nil) nil)
- ((member t) (etypecase universe
+ ((member t) (cl-etypecase universe
(list universe)
((member t) (ert-select-tests "" universe))))
((member :new) (ert-select-tests
universe))
((member :unexpected) (ert-select-tests `(not :expected) universe))
(string
- (etypecase universe
+ (cl-etypecase universe
((member t) (mapcar #'ert-get-test
(apropos-internal selector #'ert-test-boundp)))
(list (ert--remove-if-not (lambda (test)
universe))))
(ert-test (list selector))
(symbol
- (assert (ert-test-boundp selector))
+ (cl-assert (ert-test-boundp selector))
(list (ert-get-test selector)))
(cons
- (destructuring-bind (operator &rest operands) selector
- (ecase operator
+ (cl-destructuring-bind (operator &rest operands) selector
+ (cl-ecase operator
(member
(mapcar (lambda (purported-test)
- (etypecase purported-test
- (symbol (assert (ert-test-boundp purported-test))
+ (cl-etypecase purported-test
+ (symbol (cl-assert (ert-test-boundp purported-test))
(ert-get-test purported-test))
(ert-test purported-test)))
operands))
(eql
- (assert (eql (length operands) 1))
+ (cl-assert (eql (length operands) 1))
(ert-select-tests `(member ,@operands) universe))
(and
;; Do these definitions of AND, NOT and OR satisfy de
;; Morgan's laws? Should they?
- (case (length operands)
+ (cl-case (length operands)
(0 (ert-select-tests 't universe))
- (t (ert-select-tests `(and ,@(rest operands))
- (ert-select-tests (first operands)
+ (t (ert-select-tests `(and ,@(cdr operands))
+ (ert-select-tests (car operands)
universe)))))
(not
- (assert (eql (length operands) 1))
+ (cl-assert (eql (length operands) 1))
(let ((all-tests (ert-select-tests 't universe)))
(ert--set-difference all-tests
- (ert-select-tests (first operands)
+ (ert-select-tests (car operands)
all-tests))))
(or
- (case (length operands)
+ (cl-case (length operands)
(0 (ert-select-tests 'nil universe))
- (t (ert--union (ert-select-tests (first operands) universe)
- (ert-select-tests `(or ,@(rest operands))
+ (t (ert--union (ert-select-tests (car operands) universe)
+ (ert-select-tests `(or ,@(cdr operands))
universe)))))
(tag
- (assert (eql (length operands) 1))
- (let ((tag (first operands)))
+ (cl-assert (eql (length operands) 1))
+ (let ((tag (car operands)))
(ert-select-tests `(satisfies
,(lambda (test)
(member tag (ert-test-tags test))))
universe)))
(satisfies
- (assert (eql (length operands) 1))
- (ert--remove-if-not (first operands)
+ (cl-assert (eql (length operands) 1))
+ (ert--remove-if-not (car operands)
(ert-select-tests 't universe))))))))
(defun ert--insert-human-readable-selector (selector)
;; `backtrace' slot of the result objects in the
;; `most-recent-result' slots of test case objects in (eql ...) or
;; (member ...) selectors.
- (labels ((rec (selector)
- ;; This code needs to match the etypecase in `ert-select-tests'.
- (etypecase selector
- ((or (member nil t
- :new :failed :passed
- :expected :unexpected)
- string
- symbol)
- selector)
- (ert-test
- (if (ert-test-name selector)
- (make-symbol (format "<%S>" (ert-test-name selector)))
- (make-symbol "<unnamed test>")))
- (cons
- (destructuring-bind (operator &rest operands) selector
- (ecase operator
- ((member eql and not or)
- `(,operator ,@(mapcar #'rec operands)))
- ((member tag satisfies)
- selector)))))))
+ (cl-labels ((rec (selector)
+ ;; This code needs to match the etypecase in
+ ;; `ert-select-tests'.
+ (cl-etypecase selector
+ ((or (member nil t
+ :new :failed :passed
+ :expected :unexpected)
+ string
+ symbol)
+ selector)
+ (ert-test
+ (if (ert-test-name selector)
+ (make-symbol (format "<%S>" (ert-test-name selector)))
+ (make-symbol "<unnamed test>")))
+ (cons
+ (cl-destructuring-bind (operator &rest operands) selector
+ (cl-ecase operator
+ ((member eql and not or)
+ `(,operator ,@(mapcar #'rec operands)))
+ ((member tag satisfies)
+ selector)))))))
(insert (format "%S" (rec selector)))))
;; that corresponds to this run in order to be able to update the
;; statistics correctly when a test is re-run interactively and has a
;; different result than before.
-(defstruct ert--stats
- (selector (assert nil))
+(cl-defstruct ert--stats
+ (selector (cl-assert nil))
;; The tests, in order.
- (tests (assert nil) :type vector)
+ (tests (cl-assert nil) :type vector)
;; A map of test names (or the test objects themselves for unnamed
;; tests) to indices into the `tests' vector.
- (test-map (assert nil) :type hash-table)
+ (test-map (cl-assert nil) :type hash-table)
;; The results of the tests during this run, in order.
- (test-results (assert nil) :type vector)
+ (test-results (cl-assert nil) :type vector)
;; The start times of the tests, in order, as reported by
;; `current-time'.
- (test-start-times (assert nil) :type vector)
+ (test-start-times (cl-assert nil) :type vector)
;; The end times of the tests, in order, as reported by
;; `current-time'.
- (test-end-times (assert nil) :type vector)
+ (test-end-times (cl-assert nil) :type vector)
(passed-expected 0)
(passed-unexpected 0)
(failed-expected 0)
(results (ert--stats-test-results stats))
(old-test (aref tests pos))
(map (ert--stats-test-map stats)))
- (flet ((update (d)
- (if (ert-test-result-expected-p (aref tests pos)
- (aref results pos))
- (etypecase (aref results pos)
- (ert-test-passed (incf (ert--stats-passed-expected stats) d))
- (ert-test-failed (incf (ert--stats-failed-expected stats) d))
- (null)
- (ert-test-aborted-with-non-local-exit)
- (ert-test-quit))
- (etypecase (aref results pos)
- (ert-test-passed (incf (ert--stats-passed-unexpected stats) d))
- (ert-test-failed (incf (ert--stats-failed-unexpected stats) d))
- (null)
- (ert-test-aborted-with-non-local-exit)
- (ert-test-quit)))))
+ (cl-flet ((update (d)
+ (if (ert-test-result-expected-p (aref tests pos)
+ (aref results pos))
+ (cl-etypecase (aref results pos)
+ (ert-test-passed
+ (cl-incf (ert--stats-passed-expected stats) d))
+ (ert-test-failed
+ (cl-incf (ert--stats-failed-expected stats) d))
+ (null)
+ (ert-test-aborted-with-non-local-exit)
+ (ert-test-quit))
+ (cl-etypecase (aref results pos)
+ (ert-test-passed
+ (cl-incf (ert--stats-passed-unexpected stats) d))
+ (ert-test-failed
+ (cl-incf (ert--stats-failed-unexpected stats) d))
+ (null)
+ (ert-test-aborted-with-non-local-exit)
+ (ert-test-quit)))))
;; Adjust counters to remove the result that is currently in stats.
(update -1)
;; Put new test and result into stats.
SELECTOR is the selector that was used to select TESTS."
(setq tests (ert--coerce-to-vector tests))
(let ((map (make-hash-table :size (length tests))))
- (loop for i from 0
- for test across tests
- for key = (ert--stats-test-key test) do
- (assert (not (gethash key map)))
- (setf (gethash key map) i))
+ (cl-loop for i from 0
+ for test across tests
+ for key = (ert--stats-test-key test) do
+ (cl-assert (not (gethash key map)))
+ (setf (gethash key map) i))
(make-ert--stats :selector selector
:tests tests
:test-map map
(force-mode-line-update)
(unwind-protect
(progn
- (loop for test in tests do
- (ert-run-or-rerun-test stats test listener))
+ (cl-loop for test in tests do
+ (ert-run-or-rerun-test stats test listener))
(setq abortedp nil))
(setf (ert--stats-aborted-p stats) abortedp)
(setf (ert--stats-end-time stats) (current-time))
"Return a character that represents the test result RESULT.
EXPECTEDP specifies whether the result was expected."
- (let ((s (etypecase result
+ (let ((s (cl-etypecase result
(ert-test-passed ".P")
(ert-test-failed "fF")
(null "--")
"Return a string that represents the test result RESULT.
EXPECTEDP specifies whether the result was expected."
- (let ((s (etypecase result
+ (let ((s (cl-etypecase result
(ert-test-passed '("passed" "PASSED"))
(ert-test-failed '("failed" "FAILED"))
(null '("unknown" "UNKNOWN"))
"Insert `ert-info' infos from RESULT into current buffer.
RESULT must be an `ert-test-result-with-condition'."
- (check-type result ert-test-result-with-condition)
+ (cl-check-type result ert-test-result-with-condition)
(dolist (info (ert-test-result-with-condition-infos result))
- (destructuring-bind (prefix . message) info
+ (cl-destructuring-bind (prefix . message) info
(let ((begin (point))
(indentation (make-string (+ (length prefix) 4) ?\s))
(end nil))
(ert-run-tests
selector
(lambda (event-type &rest event-args)
- (ecase event-type
+ (cl-ecase event-type
(run-started
- (destructuring-bind (stats) event-args
+ (cl-destructuring-bind (stats) event-args
(message "Running %s tests (%s)"
(length (ert--stats-tests stats))
(ert--format-time-iso8601 (ert--stats-start-time stats)))))
(run-ended
- (destructuring-bind (stats abortedp) event-args
+ (cl-destructuring-bind (stats abortedp) event-args
(let ((unexpected (ert-stats-completed-unexpected stats))
(expected-failures (ert--stats-failed-expected stats)))
(message "\n%sRan %s tests, %s results as expected%s (%s)%s\n"
(format "\n%s expected failures" expected-failures)))
(unless (zerop unexpected)
(message "%s unexpected results:" unexpected)
- (loop for test across (ert--stats-tests stats)
- for result = (ert-test-most-recent-result test) do
- (when (not (ert-test-result-expected-p test result))
- (message "%9s %S"
- (ert-string-for-test-result result nil)
- (ert-test-name test))))
+ (cl-loop for test across (ert--stats-tests stats)
+ for result = (ert-test-most-recent-result test) do
+ (when (not (ert-test-result-expected-p test result))
+ (message "%9s %S"
+ (ert-string-for-test-result result nil)
+ (ert-test-name test))))
(message "%s" "")))))
(test-started
)
(test-ended
- (destructuring-bind (stats test result) event-args
+ (cl-destructuring-bind (stats test result) event-args
(unless (ert-test-result-expected-p test result)
- (etypecase result
+ (cl-etypecase result
(ert-test-passed
(message "Test %S passed unexpectedly" (ert-test-name test)))
(ert-test-result-with-condition
(ert--pp-with-indentation-and-newline
(ert-test-result-with-condition-condition result)))
(goto-char (1- (point-max)))
- (assert (looking-at "\n"))
+ (cl-assert (looking-at "\n"))
(delete-char 1)
(message "Test %S condition:" (ert-test-name test))
(message "%s" (buffer-string))))
(1 font-lock-keyword-face nil t)
(2 font-lock-function-name-face nil t)))))
-(defun* ert--remove-from-list (list-var element &key key test)
+(cl-defun ert--remove-from-list (list-var element &key key test)
"Remove ELEMENT from the value of LIST-VAR if present.
This can be used as an inverse of `add-to-list'."
include the default, if any.
Signals an error if no test name was read."
- (etypecase default
+ (cl-etypecase default
(string (let ((symbol (intern-soft default)))
(unless (and symbol (ert-test-boundp symbol))
(setq default nil))))
;;; Display of test progress and results.
;; An entry in the results buffer ewoc. There is one entry per test.
-(defstruct ert--ewoc-entry
- (test (assert nil))
+(cl-defstruct ert--ewoc-entry
+ (test (cl-assert nil))
;; If the result of this test was expected, its ewoc entry is hidden
;; initially.
- (hidden-p (assert nil))
+ (hidden-p (cl-assert nil))
;; An ewoc entry may be collapsed to hide details such as the error
;; condition.
;;
((ert--stats-current-test stats) 'running)
((ert--stats-end-time stats) 'finished)
(t 'preparing))))
- (ecase state
+ (cl-ecase state
(preparing
(insert ""))
(aborted
(t
(insert "Aborted."))))
(running
- (assert (ert--stats-current-test stats))
+ (cl-assert (ert--stats-current-test stats))
(insert "Running test: ")
(ert-insert-test-name-button (ert-test-name
(ert--stats-current-test stats))))
(finished
- (assert (not (ert--stats-current-test stats)))
+ (cl-assert (not (ert--stats-current-test stats)))
(insert "Finished.")))
(insert "\n")
(if (ert--stats-end-time stats)
(defun ert-face-for-stats (stats)
"Return a face that represents STATS."
(cond ((ert--stats-aborted-p stats) 'nil)
- ((plusp (ert-stats-completed-unexpected stats))
+ ((cl-plusp (ert-stats-completed-unexpected stats))
(ert-face-for-test-result nil))
((eql (ert-stats-completed-expected stats) (ert-stats-total stats))
(ert-face-for-test-result t))
(let* ((test (ert--ewoc-entry-test entry))
(stats ert--results-stats)
(result (let ((pos (ert--stats-test-pos stats test)))
- (assert pos)
+ (cl-assert pos)
(aref (ert--stats-test-results stats) pos)))
(hiddenp (ert--ewoc-entry-hidden-p entry))
(expandedp (ert--ewoc-entry-expanded-p entry))
(ert--string-first-line (ert-test-documentation test))
'font-lock-face 'font-lock-doc-face)
"\n"))
- (etypecase result
+ (cl-etypecase result
(ert-test-passed
(if (ert-test-result-expected-p test result)
(insert " passed\n")
(make-string (ert-stats-total stats)
(ert-char-for-test-result nil t)))
(set (make-local-variable 'ert--results-listener) listener)
- (loop for test across (ert--stats-tests stats) do
- (ewoc-enter-last ewoc
- (make-ert--ewoc-entry :test test :hidden-p t)))
+ (cl-loop for test across (ert--stats-tests stats) do
+ (ewoc-enter-last ewoc
+ (make-ert--ewoc-entry :test test
+ :hidden-p t)))
(ert--results-update-ewoc-hf ert--results-ewoc ert--results-stats)
(goto-char (1- (point-max)))
buffer)))))
default nil))
nil))
(unless message-fn (setq message-fn 'message))
- (lexical-let ((output-buffer-name output-buffer-name)
- buffer
- listener
- (message-fn message-fn))
+ (let ((output-buffer-name output-buffer-name)
+ buffer
+ listener
+ (message-fn message-fn))
(setq listener
(lambda (event-type &rest event-args)
- (ecase event-type
+ (cl-ecase event-type
(run-started
- (destructuring-bind (stats) event-args
+ (cl-destructuring-bind (stats) event-args
(setq buffer (ert--setup-results-buffer stats
listener
output-buffer-name))
(pop-to-buffer buffer)))
(run-ended
- (destructuring-bind (stats abortedp) event-args
+ (cl-destructuring-bind (stats abortedp) event-args
(funcall message-fn
"%sRan %s tests, %s results were as expected%s"
(if (not abortedp)
ert--results-ewoc)
stats)))
(test-started
- (destructuring-bind (stats test) event-args
+ (cl-destructuring-bind (stats test) event-args
(with-current-buffer buffer
(let* ((ewoc ert--results-ewoc)
(pos (ert--stats-test-pos stats test))
(node (ewoc-nth ewoc pos)))
- (assert node)
+ (cl-assert node)
(setf (ert--ewoc-entry-test (ewoc-data node)) test)
(aset ert--results-progress-bar-string pos
(ert-char-for-test-result nil t))
(ert--results-update-stats-display-maybe ewoc stats)
(ewoc-invalidate ewoc node)))))
(test-ended
- (destructuring-bind (stats test result) event-args
+ (cl-destructuring-bind (stats test result) event-args
(with-current-buffer buffer
(let* ((ewoc ert--results-ewoc)
(pos (ert--stats-test-pos stats test))
(define-derived-mode ert-results-mode special-mode "ERT-Results"
"Major mode for viewing results of ERT test runs.")
-(loop for (key binding) in
- '(;; Stuff that's not in the menu.
- ("\t" forward-button)
- ([backtab] backward-button)
- ("j" ert-results-jump-between-summary-and-result)
- ("L" ert-results-toggle-printer-limits-for-test-at-point)
- ("n" ert-results-next-test)
- ("p" ert-results-previous-test)
- ;; Stuff that is in the menu.
- ("R" ert-results-rerun-all-tests)
- ("r" ert-results-rerun-test-at-point)
- ("d" ert-results-rerun-test-at-point-debugging-errors)
- ("." ert-results-find-test-at-point-other-window)
- ("b" ert-results-pop-to-backtrace-for-test-at-point)
- ("m" ert-results-pop-to-messages-for-test-at-point)
- ("l" ert-results-pop-to-should-forms-for-test-at-point)
- ("h" ert-results-describe-test-at-point)
- ("D" ert-delete-test)
- ("T" ert-results-pop-to-timings)
- )
- do
- (define-key ert-results-mode-map key binding))
+(cl-loop for (key binding) in
+ '( ;; Stuff that's not in the menu.
+ ("\t" forward-button)
+ ([backtab] backward-button)
+ ("j" ert-results-jump-between-summary-and-result)
+ ("L" ert-results-toggle-printer-limits-for-test-at-point)
+ ("n" ert-results-next-test)
+ ("p" ert-results-previous-test)
+ ;; Stuff that is in the menu.
+ ("R" ert-results-rerun-all-tests)
+ ("r" ert-results-rerun-test-at-point)
+ ("d" ert-results-rerun-test-at-point-debugging-errors)
+ ("." ert-results-find-test-at-point-other-window)
+ ("b" ert-results-pop-to-backtrace-for-test-at-point)
+ ("m" ert-results-pop-to-messages-for-test-at-point)
+ ("l" ert-results-pop-to-should-forms-for-test-at-point)
+ ("h" ert-results-describe-test-at-point)
+ ("D" ert-delete-test)
+ ("T" ert-results-pop-to-timings)
+ )
+ do
+ (define-key ert-results-mode-map key binding))
(easy-menu-define ert-results-mode-menu ert-results-mode-map
"Menu for `ert-results-mode'."
EWOC-FN specifies the direction and should be either `ewoc-prev'
or `ewoc-next'. If there are no more nodes in that direction, an
error is signaled with the message ERROR-MESSAGE."
- (loop
+ (cl-loop
(setq node (funcall ewoc-fn ert--results-ewoc node))
(when (null node)
(error "%s" error-message))
(unless (ert--ewoc-entry-hidden-p (ewoc-data node))
(goto-char (ewoc-location node))
- (return))))
+ (cl-return))))
-(defun ert--results-expand-collapse-button-action (button)
+(defun ert--results-expand-collapse-button-action (_button)
"Expand or collapse the test node BUTTON belongs to."
(let* ((ewoc ert--results-ewoc)
(node (save-excursion
(defun ert--ewoc-position (ewoc node)
;; checkdoc-order: nil
"Return the position of NODE in EWOC, or nil if NODE is not in EWOC."
- (loop for i from 0
- for node-here = (ewoc-nth ewoc 0) then (ewoc-next ewoc node-here)
- do (when (eql node node-here)
- (return i))
- finally (return nil)))
+ (cl-loop for i from 0
+ for node-here = (ewoc-nth ewoc 0) then (ewoc-next ewoc node-here)
+ do (when (eql node node-here)
+ (cl-return i))
+ finally (cl-return nil)))
(defun ert-results-jump-between-summary-and-result ()
"Jump back and forth between the test run summary and individual test results.
"Return the test at point, or nil.
To be used in the ERT results buffer."
- (assert (eql major-mode 'ert-results-mode))
+ (cl-assert (eql major-mode 'ert-results-mode))
(if (ert--results-test-node-or-null-at-point)
(let* ((node (ert--results-test-node-at-point))
(test (ert--ewoc-entry-test (ewoc-data node))))
(point))
((eventp last-command-event)
(posn-point (event-start last-command-event)))
- (t (assert nil))))
+ (t (cl-assert nil))))
-(defun ert--results-progress-bar-button-action (button)
+(defun ert--results-progress-bar-button-action (_button)
"Jump to details for the test represented by the character clicked in BUTTON."
(goto-char (ert--button-action-position))
(ert-results-jump-between-summary-and-result))
To be used in the ERT results buffer."
(interactive)
- (assert (eql major-mode 'ert-results-mode))
+ (cl-assert (eql major-mode 'ert-results-mode))
(let ((selector (ert--stats-selector ert--results-stats)))
(ert-run-tests-interactively selector (buffer-name))))
To be used in the ERT results buffer."
(interactive)
- (destructuring-bind (test redefinition-state)
+ (cl-destructuring-bind (test redefinition-state)
(ert--results-test-at-point-allow-redefinition)
(when (null test)
(error "No test at point"))
(let* ((stats ert--results-stats)
(progress-message (format "Running %stest %S"
- (ecase redefinition-state
+ (cl-ecase redefinition-state
((nil) "")
(redefined "new definition of ")
(deleted "deleted "))
(stats ert--results-stats)
(pos (ert--stats-test-pos stats test))
(result (aref (ert--stats-test-results stats) pos)))
- (etypecase result
+ (cl-etypecase result
(ert-test-passed (error "Test passed, no backtrace available"))
(ert-test-result-with-condition
(let ((backtrace (ert-test-result-with-condition-backtrace result))
(ert-simple-view-mode)
(if (null (ert-test-result-should-forms result))
(insert "\n(No should forms during this test.)\n")
- (loop for form-description in (ert-test-result-should-forms result)
- for i from 1 do
- (insert "\n")
- (insert (format "%s: " i))
- (let ((begin (point)))
- (ert--pp-with-indentation-and-newline form-description)
- (ert--make-xrefs-region begin (point)))))
+ (cl-loop for form-description
+ in (ert-test-result-should-forms result)
+ for i from 1 do
+ (insert "\n")
+ (insert (format "%s: " i))
+ (let ((begin (point)))
+ (ert--pp-with-indentation-and-newline form-description)
+ (ert--make-xrefs-region begin (point)))))
(goto-char (point-min))
(insert "`should' forms executed during test `")
(ert-insert-test-name-button (ert-test-name test))
To be used in the ERT results buffer."
(interactive)
(let* ((stats ert--results-stats)
- (start-times (ert--stats-test-start-times stats))
- (end-times (ert--stats-test-end-times stats))
(buffer (get-buffer-create "*ERT timings*"))
- (data (loop for test across (ert--stats-tests stats)
- for start-time across (ert--stats-test-start-times stats)
- for end-time across (ert--stats-test-end-times stats)
- collect (list test
- (float-time (subtract-time end-time
- start-time))))))
+ (data (cl-loop for test across (ert--stats-tests stats)
+ for start-time across (ert--stats-test-start-times
+ stats)
+ for end-time across (ert--stats-test-end-times stats)
+ collect (list test
+ (float-time (subtract-time
+ end-time start-time))))))
(setq data (sort data (lambda (a b)
- (> (second a) (second b)))))
+ (> (cl-second a) (cl-second b)))))
(pop-to-buffer buffer)
(let ((inhibit-read-only t))
(buffer-disable-undo)
(if (null data)
(insert "(No data)\n")
(insert (format "%-3s %8s %8s\n" "" "time" "cumul"))
- (loop for (test time) in data
- for cumul-time = time then (+ cumul-time time)
- for i from 1 do
- (let ((begin (point)))
- (insert (format "%3s: %8.3f %8.3f " i time cumul-time))
- (ert-insert-test-name-button (ert-test-name test))
- (insert "\n"))))
+ (cl-loop for (test time) in data
+ for cumul-time = time then (+ cumul-time time)
+ for i from 1 do
+ (progn
+ (insert (format "%3s: %8.3f %8.3f " i time cumul-time))
+ (ert-insert-test-name-button (ert-test-name test))
+ (insert "\n"))))
(goto-char (point-min))
(insert "Tests by run time (seconds):\n\n")
(forward-line 1))))
(error "Requires Emacs 24"))
(let (test-name
test-definition)
- (etypecase test-or-test-name
+ (cl-etypecase test-or-test-name
(symbol (setq test-name test-or-test-name
test-definition (ert-get-test test-or-test-name)))
(ert-test (setq test-name (ert-test-name test-or-test-name)
`(logior (logand ,v ,mask)
(logand ,getter (lognot ,mask))))))))))
+;;; References
+
+;;;###autoload
+(defmacro gv-ref (place)
+ "Return a reference to PLACE.
+This is like the `&' operator of the C language."
+ (gv-letplace (getter setter) place
+ `(cons (lambda () ,getter)
+ (lambda (gv--val) ,(funcall setter 'gv--val)))))
+
+(defsubst gv-deref (ref)
+ "Dereference REF, returning the referenced value.
+This is like the `*' operator of the C language.
+REF must have been previously obtained with `gv-ref'."
+ (funcall (car ref)))
+;; Don't use `declare' because it seems to introduce circularity problems:
+;; Warning: Eager macro-expansion skipped due to cycle:
+;; … => (load "gv.el") => (macroexpand-all (defsubst gv-deref …)) => (macroexpand (defun …)) => (load "gv.el")
+(gv-define-setter gv-deref (v ref) `(funcall (cdr ,ref) ,v))
+
;;; Vaguely related definitions that should be moved elsewhere.
;; (defun alist-get (key alist)
The HEADER is the section string marking the beginning of the
section. If the given section does not exist, return nil.
-The end of the section is defined as the beginning of the next
-section of the same level or lower. The function
-`lisp-outline-level' is used to compute the level of a section.
-If no such section exists, return the end of the buffer."
+The section ends before the first non-comment text or the next
+section of the same level or lower; whatever comes first. The
+function `lisp-outline-level' is used to compute the level of
+a section."
(require 'outline) ;; for outline-regexp.
(let ((start (lm-section-start header)))
(when start
(beginning-of-line)
(lisp-outline-level))
level)))
- (if next-section-found
- (line-beginning-position)
- (point-max)))))))
+ (min (if next-section-found
+ (progn (beginning-of-line 0)
+ (unless (looking-at "\f")
+ (beginning-of-line 2))
+ (point))
+ (point-max))
+ (progn (goto-char start)
+ (while (forward-comment 1))
+ (point))))))))
(defsubst lm-code-start ()
"Return the buffer location of the `Code' start marker."
(when res
(setq res (list res))
(forward-line 1)
- (while (and (or (looking-at (concat lm-header-prefix "[\t ]+"))
- (and (not (looking-at
- (lm-get-header-re "\\sw\\(\\sw\\|\\s_\\)*")))
- (looking-at lm-header-prefix)))
- (goto-char (match-end 0))
- (looking-at ".+"))
- (setq res (cons (match-string-no-properties 0) res))
+ (while (looking-at "^;+\\(\t\\|[\t\s]\\{2,\\}\\)\\(.+\\)")
+ (push (match-string-no-properties 2) res)
(forward-line 1)))
(nreverse res))))
(emacs-lisp-mode)
,@body)
(save-excursion
- ;; Switching major modes is too drastic, so just switch
- ;; temporarily to the Emacs Lisp mode syntax table.
- (with-syntax-table emacs-lisp-mode-syntax-table
- ,@body))))))
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ ;; Switching major modes is too drastic, so just switch
+ ;; temporarily to the Emacs Lisp mode syntax table.
+ (with-syntax-table emacs-lisp-mode-syntax-table
+ ,@body)))))))
;; Fixme: Probably this should be amalgamated with copyright.el; also
;; we need a check for ranges in copyright years.
(when start
(buffer-substring-no-properties start (lm-commentary-end))))))
+(defun lm-homepage (&optional file)
+ "Return the homepage in file FILE, or current buffer if FILE is nil."
+ (let ((page (lm-with-file file
+ (lm-header "\\(?:x-\\)?\\(?:homepage\\|url\\)"))))
+ (if (and page (string-match "^<.+>$" page))
+ (substring page 1 -1)
+ page)))
+
;;; Verification and synopses
(defun lm-insert-at-column (col &rest strings)
font-lock keywords will not be case sensitive."
(when lisp-syntax
(set-syntax-table lisp-mode-syntax-table))
- (make-local-variable 'paragraph-ignore-fill-prefix)
- (setq paragraph-ignore-fill-prefix t)
- (make-local-variable 'fill-paragraph-function)
- (setq fill-paragraph-function 'lisp-fill-paragraph)
+ (setq-local paragraph-ignore-fill-prefix t)
+ (setq-local fill-paragraph-function 'lisp-fill-paragraph)
;; Adaptive fill mode gets the fill wrong for a one-line paragraph made of
;; a single docstring. Let's fix it here.
- (set (make-local-variable 'adaptive-fill-function)
- (lambda () (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") "")))
+ (setq-local adaptive-fill-function
+ (lambda () (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") "")))
;; Adaptive fill mode gets in the way of auto-fill,
;; and should make no difference for explicit fill
;; because lisp-fill-paragraph should do the job.
;; I believe that newcomment's auto-fill code properly deals with it -stef
;;(set (make-local-variable 'adaptive-fill-mode) nil)
- (make-local-variable 'indent-line-function)
- (setq indent-line-function 'lisp-indent-line)
- (make-local-variable 'outline-regexp)
- (setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
- (make-local-variable 'outline-level)
- (setq outline-level 'lisp-outline-level)
- (make-local-variable 'comment-start)
- (setq comment-start ";")
- (make-local-variable 'comment-start-skip)
+ (setq-local indent-line-function 'lisp-indent-line)
+ (setq-local outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
+ (setq-local outline-level 'lisp-outline-level)
+ (setq-local add-log-current-defun-function #'lisp-current-defun-name)
+ (setq-local comment-start ";")
;; Look within the line for a ; following an even number of backslashes
;; after either a non-backslash or the line beginning.
- (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
- (make-local-variable 'font-lock-comment-start-skip)
+ (setq-local comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
;; Font lock mode uses this only when it KNOWS a comment is starting.
- (setq font-lock-comment-start-skip ";+ *")
- (make-local-variable 'comment-add)
- (setq comment-add 1) ;default to `;;' in comment-region
- (make-local-variable 'comment-column)
- (setq comment-column 40)
+ (setq-local font-lock-comment-start-skip ";+ *")
+ (setq-local comment-add 1) ;default to `;;' in comment-region
+ (setq-local comment-column 40)
;; Don't get confused by `;' in doc strings when paragraph-filling.
- (set (make-local-variable 'comment-use-global-state) t)
- (make-local-variable 'imenu-generic-expression)
- (setq imenu-generic-expression lisp-imenu-generic-expression)
- (make-local-variable 'multibyte-syntax-as-symbol)
- (setq multibyte-syntax-as-symbol t)
- (set (make-local-variable 'syntax-begin-function) 'beginning-of-defun)
+ (setq-local comment-use-global-state t)
+ (setq-local imenu-generic-expression lisp-imenu-generic-expression)
+ (setq-local multibyte-syntax-as-symbol t)
+ (setq-local syntax-begin-function 'beginning-of-defun)
(setq font-lock-defaults
`((lisp-font-lock-keywords
lisp-font-lock-keywords-1 lisp-font-lock-keywords-2)
1000
len)))
+(defun lisp-current-defun-name ()
+ "Return the name of the defun at point, or nil."
+ (save-excursion
+ (let ((location (point)))
+ ;; If we are now precisely at the beginning of a defun, make sure
+ ;; beginning-of-defun finds that one rather than the previous one.
+ (or (eobp) (forward-char 1))
+ (beginning-of-defun)
+ ;; Make sure we are really inside the defun found, not after it.
+ (when (and (looking-at "\\s(")
+ (progn (end-of-defun)
+ (< location (point)))
+ (progn (forward-sexp -1)
+ (>= location (point))))
+ (if (looking-at "\\s(")
+ (forward-char 1))
+ ;; Skip the defining construct name, typically "defun" or
+ ;; "defvar".
+ (forward-sexp 1)
+ ;; The second element is usually a symbol being defined. If it
+ ;; is not, use the first symbol in it.
+ (skip-chars-forward " \t\n'(")
+ (buffer-substring-no-properties (point)
+ (progn (forward-sexp 1)
+ (point)))))))
+
(defvar lisp-mode-shared-map
(let ((map (make-sparse-keymap)))
(define-key map "\e\C-q" 'indent-sexp)
Entry to this mode calls the value of `lisp-mode-hook'
if that value is non-nil."
(lisp-mode-variables nil t)
- (set (make-local-variable 'find-tag-default-function) 'lisp-find-tag-default)
- (make-local-variable 'comment-start-skip)
- (setq comment-start-skip
- "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
+ (setq-local find-tag-default-function 'lisp-find-tag-default)
+ (setq-local comment-start-skip
+ "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
(setq imenu-case-fold-search t))
(defun lisp-find-tag-default ()
(defun eval-defun-1 (form)
"Treat some expressions specially.
Reset the `defvar' and `defcustom' variables to the initial value.
+\(For `defcustom', use the :set function if there is one.)
Reinitialize the face according to the `defface' specification."
;; The code in edebug-defun should be consistent with this, but not
;; the same, since this gets a macroexpanded form.
;; `custom-declare-variable' with a quoted value arg.
((and (eq (car form) 'custom-declare-variable)
(default-boundp (eval (nth 1 form) lexical-binding)))
- ;; Force variable to be bound.
- (set-default (eval (nth 1 form) lexical-binding)
- ;; The second arg is an expression that evaluates to
- ;; an expression. The second evaluation is the one
- ;; normally performed not be normal execution but by
- ;; custom-initialize-set (for example), which does not
- ;; use lexical-binding.
- (eval (eval (nth 2 form) lexical-binding)))
+ ;; Force variable to be bound, using :set function if specified.
+ (let ((setfunc (memq :set form)))
+ (when setfunc
+ (setq setfunc (car-safe (cdr-safe setfunc)))
+ (or (functionp setfunc) (setq setfunc nil)))
+ (funcall (or setfunc 'set-default)
+ (eval (nth 1 form) lexical-binding)
+ ;; The second arg is an expression that evaluates to
+ ;; an expression. The second evaluation is the one
+ ;; normally performed not by normal execution but by
+ ;; custom-initialize-set (for example), which does not
+ ;; use lexical-binding.
+ (eval (eval (nth 2 form) lexical-binding))))
form)
;; `defface' is macroexpanded to `custom-declare-face'.
((eq (car form) 'custom-declare-face)
(setq face-new-frame-defaults
(assq-delete-all face-symbol face-new-frame-defaults))
(put face-symbol 'face-defface-spec nil)
- (put face-symbol 'face-documentation (nth 3 form))
- ;; Setting `customized-face' to the new spec after calling
- ;; the form, but preserving the old saved spec in `saved-face',
- ;; imitates the situation when the new face spec is set
- ;; temporarily for the current session in the customize
- ;; buffer, thus allowing `face-user-default-spec' to use the
- ;; new customized spec instead of the saved spec.
- ;; Resetting `saved-face' temporarily to nil is needed to let
- ;; `defface' change the spec, regardless of a saved spec.
- (prog1 `(prog1 ,form
- (put ,(nth 1 form) 'saved-face
- ',(get face-symbol 'saved-face))
- (put ,(nth 1 form) 'customized-face
- ,(nth 2 form)))
- (put face-symbol 'saved-face nil))))
+ (put face-symbol 'face-override-spec nil))
+ form)
((eq (car form) 'progn)
(cons 'progn (mapcar 'eval-defun-1 (cdr form))))
(t form)))
If the current defun is actually a call to `defvar' or `defcustom',
evaluating it this way resets the variable using its initial value
-expression even if the variable already has some other value.
-\(Normally `defvar' and `defcustom' do not alter the value if there
-already is one.) In an analogous way, evaluating a `defface'
-overrides any customizations of the face, so that it becomes
-defined exactly as the `defface' expression says.
+expression (using the defcustom's :set function if there is one), even
+if the variable already has some other value. \(Normally `defvar' and
+`defcustom' do not alter the value if there already is one.) In an
+analogous way, evaluating a `defface' overrides any customizations of
+the face, so that it becomes defined exactly as the `defface' expression
+says.
If `eval-expression-debug-on-error' is non-nil, which is the default,
this command arranges for all errors to enter the debugger.
(macroexp--funcall-if-compiled ',when-compiled)
,form))
(t
- (message "%s" msg)
+ (message "%s%s" (if (stringp load-file-name)
+ (concat (file-relative-name load-file-name) ": ")
+ "")
+ msg)
form))))
(defun macroexp--obsolete-warning (fun obsolescence-data type)
--- /dev/null
+;;; nadvice.el --- Light-weight advice primitives for Elisp functions -*- lexical-binding: t -*-
+
+;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+;; Keywords: extensions, lisp, tools
+;; Package: 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:
+
+;; This package lets you add behavior (which we call "piece of advice") to
+;; existing functions, like the old `advice.el' package, but with much fewer
+;; bells ans whistles. It comes in 2 parts:
+;;
+;; - The first part lets you add/remove functions, similarly to
+;; add/remove-hook, from any "place" (i.e. as accepted by `setf') that
+;; holds a function.
+;; This part provides mainly 2 macros: `add-function' and `remove-function'.
+;;
+;; - The second part provides `advice-add' and `advice-remove' which are
+;; refined version of the previous macros specially tailored for the case
+;; where the place that we want to modify is a `symbol-function'.
+
+;;; Code:
+
+;;;; Lightweight advice/hook
+(defvar advice--where-alist
+ '((:around "\300\301\302\003#\207" 5)
+ (:before "\300\301\002\"\210\300\302\002\"\207" 4)
+ (:after "\300\302\002\"\300\301\003\"\210\207" 5)
+ (:after-until "\300\302\002\"\206\013\000\300\301\002\"\207" 4)
+ (:after-while "\300\302\002\"\205\013\000\300\301\002\"\207" 4)
+ (:before-until "\300\301\002\"\206\013\000\300\302\002\"\207" 4)
+ (:before-while "\300\301\002\"\205\013\000\300\302\002\"\207" 4))
+ "List of descriptions of how to add a function.
+Each element has the form (WHERE BYTECODE STACK) where:
+ WHERE is a keyword indicating where the function is added.
+ BYTECODE is the corresponding byte-code that will be used.
+ STACK is the amount of stack space needed by the byte-code.")
+
+(defvar advice--bytecodes (mapcar #'cadr advice--where-alist))
+
+(defun advice--p (object)
+ (and (byte-code-function-p object)
+ (eq 128 (aref object 0))
+ (memq (length object) '(5 6))
+ (memq (aref object 1) advice--bytecodes)
+ (eq #'apply (aref (aref object 2) 0))))
+
+(defsubst advice--car (f) (aref (aref f 2) 1))
+(defsubst advice--cdr (f) (aref (aref f 2) 2))
+(defsubst advice--props (f) (aref (aref f 2) 3))
+
+(defun advice--make-docstring (_string function)
+ "Build the raw doc-string of SYMBOL, presumably advised."
+ (let ((flist (indirect-function function))
+ (docstring nil))
+ (if (eq 'macro (car-safe flist)) (setq flist (cdr flist)))
+ (while (advice--p flist)
+ (let ((bytecode (aref flist 1))
+ (where nil))
+ (dolist (elem advice--where-alist)
+ (if (eq bytecode (cadr elem)) (setq where (car elem))))
+ (setq docstring
+ (concat
+ docstring
+ (propertize (format "%s advice: " where)
+ 'face 'warning)
+ (let ((fun (advice--car flist)))
+ (if (symbolp fun) (format "`%S'" fun)
+ (let* ((name (cdr (assq 'name (advice--props flist))))
+ (doc (documentation fun t))
+ (usage (help-split-fundoc doc function)))
+ (if usage (setq doc (cdr usage)))
+ (if name
+ (if doc
+ (format "%s\n%s" name doc)
+ (format "%s" name))
+ (or doc "No documentation")))))
+ "\n")))
+ (setq flist (advice--cdr flist)))
+ (if docstring (setq docstring (concat docstring "\n")))
+ (let* ((origdoc (unless (eq function flist) ;Avoid inf-loops.
+ (documentation flist t)))
+ (usage (help-split-fundoc origdoc function)))
+ (setq usage (if (null usage)
+ (let ((arglist (help-function-arglist flist)))
+ (format "%S" (help-make-usage function arglist)))
+ (setq origdoc (cdr usage)) (car usage)))
+ (help-add-fundoc-usage (concat docstring origdoc) usage))))
+
+(defvar advice--docstring
+ ;; Can't eval-when-compile nor use defconst because it then gets pure-copied,
+ ;; which drops the text-properties.
+ ;;(eval-when-compile
+ (propertize "Advised function"
+ 'dynamic-docstring-function #'advice--make-docstring)) ;; )
+
+(defun advice-eval-interactive-spec (spec)
+ "Evaluate the interactive spec SPEC."
+ (cond
+ ((stringp spec)
+ ;; There's no direct access to the C code (in call-interactively) that
+ ;; processes those specs, but that shouldn't stop us, should it?
+ ;; FIXME: Despite appearances, this is not faithful: SPEC and
+ ;; (advice-eval-interactive-spec SPEC) will behave subtly differently w.r.t
+ ;; command-history (and maybe a few other details).
+ (call-interactively `(lambda (&rest args) (interactive ,spec) args)))
+ ;; ((functionp spec) (funcall spec))
+ (t (eval spec))))
+
+(defun advice--make-interactive-form (function main)
+ ;; TODO: make it so that interactive spec can be a constant which
+ ;; dynamically checks the advice--car/cdr to do its job.
+ ;; For that, advice-eval-interactive-spec needs to be more faithful.
+ ;; FIXME: The calls to interactive-form below load autoloaded functions
+ ;; too eagerly.
+ (let ((fspec (cadr (interactive-form function))))
+ (when (eq 'function (car-safe fspec)) ;; Macroexpanded lambda?
+ (setq fspec (nth 1 fspec)))
+ (if (functionp fspec)
+ `(funcall ',fspec
+ ',(cadr (interactive-form main)))
+ (cadr (or (interactive-form function)
+ (interactive-form main))))))
+
+(defsubst advice--make-1 (byte-code stack-depth function main props)
+ "Build a function value that adds FUNCTION to MAIN."
+ (let ((adv-sig (gethash main advertised-signature-table))
+ (advice
+ (apply #'make-byte-code 128 byte-code
+ (vector #'apply function main props) stack-depth
+ advice--docstring
+ (when (or (commandp function) (commandp main))
+ (list (advice--make-interactive-form
+ function main))))))
+ (when adv-sig (puthash advice adv-sig advertised-signature-table))
+ advice))
+
+(defun advice--make (where function main props)
+ "Build a function value that adds FUNCTION to MAIN at WHERE.
+WHERE is a symbol to select an entry in `advice--where-alist'."
+ (let ((desc (assq where advice--where-alist)))
+ (unless desc (error "Unknown add-function location `%S'" where))
+ (advice--make-1 (nth 1 desc) (nth 2 desc)
+ function main props)))
+
+(defun advice--member-p (function definition)
+ (let ((found nil))
+ (while (and (not found) (advice--p definition))
+ (if (or (equal function (advice--car definition))
+ (equal function (cdr (assq 'name (advice--props definition)))))
+ (setq found t)
+ (setq definition (advice--cdr definition))))
+ found))
+
+(defun advice--tweak (flist tweaker)
+ (if (not (advice--p flist))
+ (funcall tweaker nil flist nil)
+ (let ((first (advice--car flist))
+ (rest (advice--cdr flist))
+ (props (advice--props flist)))
+ (or (funcall tweaker first rest props)
+ (let ((nrest (advice--tweak rest tweaker)))
+ (if (eq rest nrest) flist
+ (advice--make-1 (aref flist 1) (aref flist 3)
+ first nrest props)))))))
+
+;;;###autoload
+(defun advice--remove-function (flist function)
+ (advice--tweak flist
+ (lambda (first rest props)
+ (if (or (not first)
+ (equal function first)
+ (equal function (cdr (assq 'name props))))
+ rest))))
+
+(defvar advice--buffer-local-function-sample nil)
+
+(defun advice--set-buffer-local (var val)
+ (if (function-equal val advice--buffer-local-function-sample)
+ (kill-local-variable var)
+ (set (make-local-variable var) val)))
+
+;;;###autoload
+(defun advice--buffer-local (var)
+ "Buffer-local value of VAR, presumed to contain a function."
+ (declare (gv-setter advice--set-buffer-local))
+ (if (local-variable-p var) (symbol-value var)
+ (setq advice--buffer-local-function-sample
+ (lambda (&rest args) (apply (default-value var) args)))))
+
+;;;###autoload
+(defmacro add-function (where place function &optional props)
+ ;; TODO:
+ ;; - obsolete with-wrapper-hook (mostly requires buffer-local support).
+ ;; - provide some kind of control over ordering. E.g. debug-on-entry, ELP
+ ;; and tracing want to stay first.
+ ;; - maybe let `where' specify some kind of predicate and use it
+ ;; to implement things like mode-local or eieio-defmethod.
+ ;; Of course, that only makes sense if the predicates of all advices can
+ ;; be combined and made more efficient.
+ ;; :before is like a normal add-hook on a normal hook.
+ ;; :before-while is like add-hook on run-hook-with-args-until-failure.
+ ;; :before-until is like add-hook on run-hook-with-args-until-success.
+ ;; Same with :after-* but for (add-hook ... 'append).
+ "Add a piece of advice on the function stored at PLACE.
+FUNCTION describes the code to add. WHERE describes where to add it.
+WHERE can be explained by showing the resulting new function, as the
+result of combining FUNCTION and the previous value of PLACE, which we
+call OLDFUN here:
+`:before' (lambda (&rest r) (apply FUNCTION r) (apply OLDFUN r))
+`:after' (lambda (&rest r) (prog1 (apply OLDFUN r) (apply FUNCTION r)))
+`:around' (lambda (&rest r) (apply FUNCTION OLDFUN r))
+`:before-while' (lambda (&rest r) (and (apply FUNCTION r) (apply OLDFUN r)))
+`:before-until' (lambda (&rest r) (or (apply FUNCTION r) (apply OLDFUN r)))
+`:after-while' (lambda (&rest r) (and (apply OLDFUN r) (apply FUNCTION r)))
+`:after-until' (lambda (&rest r) (or (apply OLDFUN r) (apply FUNCTION r)))
+If FUNCTION was already added, do nothing.
+PROPS is an alist of additional properties, among which the following have
+a special meaning:
+- `name': a string or symbol. It can be used to refer to this piece of advice.
+
+PLACE cannot be a simple variable. Instead it should either be
+\(default-value 'VAR) or (local 'VAR) depending on whether FUNCTION
+should be applied to VAR buffer-locally or globally.
+
+If one of FUNCTION or OLDFUN is interactive, then the resulting function
+is also interactive. There are 3 cases:
+- FUNCTION is not interactive: the interactive spec of OLDFUN is used.
+- The interactive spec of FUNCTION is itself a function: it should take one
+ argument (the interactive spec of OLDFUN, which it can pass to
+ `advice-eval-interactive-spec') and return the list of arguments to use.
+- Else, use the interactive spec of FUNCTION and ignore the one of OLDFUN."
+ (declare (debug t)) ;;(indent 2)
+ (cond ((eq 'local (car-safe place))
+ (setq place `(advice--buffer-local ,@(cdr place))))
+ ((symbolp place)
+ (error "Use (default-value '%S) or (local '%S)" place place)))
+ `(advice--add-function ,where (gv-ref ,place) ,function ,props))
+
+;;;###autoload
+(defun advice--add-function (where ref function props)
+ (unless (advice--member-p function (gv-deref ref))
+ (setf (gv-deref ref)
+ (advice--make where function (gv-deref ref) props))))
+
+(defmacro remove-function (place function)
+ "Remove the FUNCTION piece of advice from PLACE.
+If FUNCTION was not added to PLACE, do nothing.
+Instead of FUNCTION being the actual function, it can also be the `name'
+of the piece of advice."
+ (declare (debug t))
+ (cond ((eq 'local (car-safe place))
+ (setq place `(advice--buffer-local ,@(cdr place))))
+ ((symbolp place)
+ (error "Use (default-value '%S) or (local '%S)" place place)))
+ (gv-letplace (getter setter) place
+ (macroexp-let2 nil new `(advice--remove-function ,getter ,function)
+ `(unless (eq ,new ,getter) ,(funcall setter new)))))
+
+;;;; Specific application of add-function to `symbol-function' for advice.
+
+(defun advice--subst-main (old new)
+ (advice--tweak old
+ (lambda (first _rest _props) (if (not first) new))))
+
+(defun advice--normalize (symbol def)
+ (cond
+ ((special-form-p def)
+ ;; Not worth the trouble trying to handle this, I think.
+ (error "advice-add failure: %S is a special form" symbol))
+ ((and (symbolp def)
+ (eq 'macro (car-safe (ignore-errors (indirect-function def)))))
+ (let ((newval (cons 'macro (cdr (indirect-function def)))))
+ (put symbol 'advice--saved-rewrite (cons def newval))
+ newval))
+ ;; `f' might be a pure (hence read-only) cons!
+ ((and (eq 'macro (car-safe def))
+ (not (ignore-errors (setcdr def (cdr def)) t)))
+ (cons 'macro (cdr def)))
+ (t def)))
+
+(defsubst advice--strip-macro (x)
+ (if (eq 'macro (car-safe x)) (cdr x) x))
+
+(defun advice--defalias-fset (fsetfun symbol newdef)
+ (when (get symbol 'advice--saved-rewrite)
+ (put symbol 'advice--saved-rewrite nil))
+ (setq newdef (advice--normalize symbol newdef))
+ (let* ((olddef (advice--strip-macro
+ (if (fboundp symbol) (symbol-function symbol))))
+ (oldadv
+ (cond
+ ((null (get symbol 'advice--pending))
+ (or olddef
+ (progn
+ (message "Delayed advice activation failed for %s: no data"
+ symbol)
+ nil)))
+ ((or (not olddef) (autoloadp olddef))
+ (prog1 (get symbol 'advice--pending)
+ (put symbol 'advice--pending nil)))
+ (t (message "Dropping left-over advice--pending for %s" symbol)
+ (put symbol 'advice--pending nil)
+ olddef))))
+ (let* ((snewdef (advice--strip-macro newdef))
+ (snewadv (advice--subst-main oldadv snewdef)))
+ (funcall (or fsetfun #'fset) symbol
+ (if (eq snewdef newdef) snewadv (cons 'macro snewadv))))))
+
+
+;;;###autoload
+(defun advice-add (symbol where function &optional props)
+ "Like `add-function' but for the function named SYMBOL.
+Contrary to `add-function', this will properly handle the cases where SYMBOL
+is defined as a macro, alias, command, ..."
+ ;; TODO:
+ ;; - record the advice location, to display in describe-function.
+ ;; - change all defadvice in lisp/**/*.el.
+ ;; - rewrite advice.el on top of this.
+ ;; - obsolete advice.el.
+ (let* ((f (and (fboundp symbol) (symbol-function symbol)))
+ (nf (advice--normalize symbol f)))
+ (unless (eq f nf) ;; Most importantly, if nf == nil!
+ (fset symbol nf))
+ (add-function where (cond
+ ((eq (car-safe nf) 'macro) (cdr nf))
+ ;; Reasons to delay installation of the advice:
+ ;; - If the function is not yet defined, installing
+ ;; the advice would affect `fboundp'ness.
+ ;; - If it's an autoloaded command,
+ ;; advice--make-interactive-form would end up
+ ;; loading the command eagerly.
+ ;; - `autoload' does nothing if the function is
+ ;; not an autoload or undefined.
+ ((or (not nf) (autoloadp nf))
+ (get symbol 'advice--pending))
+ (t (symbol-function symbol)))
+ function props)
+ (add-function :around (get symbol 'defalias-fset-function)
+ #'advice--defalias-fset))
+ nil)
+
+;;;###autoload
+(defun advice-remove (symbol function)
+ "Like `remove-function' but for the function named SYMBOL.
+Contrary to `remove-function', this will work also when SYMBOL is a macro
+and it will not signal an error if SYMBOL is not `fboundp'.
+Instead of the actual function to remove, FUNCTION can also be the `name'
+of the piece of advice."
+ (when (fboundp symbol)
+ (let ((f (symbol-function symbol)))
+ ;; Can't use the `if' place here, because the body is too large,
+ ;; resulting in use of code that only works with lexical-scoping.
+ (remove-function (if (eq (car-safe f) 'macro)
+ (cdr f)
+ (symbol-function symbol))
+ function)
+ (unless (advice--p
+ (if (eq (car-safe f) 'macro) (cdr f) (symbol-function symbol)))
+ ;; Not advised any more.
+ (remove-function (get symbol 'defalias-fset-function)
+ #'advice--defalias-fset)
+ (if (eq (symbol-function symbol)
+ (cdr (get symbol 'advice--saved-rewrite)))
+ (fset symbol (car (get symbol 'advice--saved-rewrite))))))
+ nil))
+
+;; (defun advice-mapc (fun symbol)
+;; "Apply FUN to every function added as advice to SYMBOL.
+;; FUN is called with a two arguments: the function that was added, and the
+;; properties alist that was specified when it was added."
+;; (let ((def (or (get symbol 'advice--pending)
+;; (if (fboundp symbol) (symbol-function symbol)))))
+;; (while (advice--p def)
+;; (funcall fun (advice--car def) (advice--props def))
+;; (setq def (advice--cdr def)))))
+
+;;;###autoload
+(defun advice-member-p (advice function-name)
+ "Return non-nil if ADVICE has been added to FUNCTION-NAME.
+Instead of ADVICE being the actual function, it can also be the `name'
+of the piece of advice."
+ (advice--member-p advice
+ (or (get function-name 'advice--pending)
+ (advice--strip-macro
+ (if (fboundp function-name)
+ (symbol-function function-name))))))
+
+;; When code is advised, called-interactively-p needs to be taught to skip
+;; the advising frames.
+;; FIXME: This Major Ugly Hack won't handle calls to called-interactively-p
+;; done from the advised function if the deepest advice is an around advice!
+;; In other cases (calls from an advice or calls from the advised function when
+;; the deepest advice is not an around advice), it should hopefully get
+;; it right.
+(add-hook 'called-interactively-p-functions
+ #'advice--called-interactively-skip)
+(defun advice--called-interactively-skip (origi frame1 frame2)
+ (let* ((i origi)
+ (get-next-frame
+ (lambda ()
+ (setq frame1 frame2)
+ (setq frame2 (internal--called-interactively-p--get-frame i))
+ ;; (message "Advice Frame %d = %S" i frame2)
+ (setq i (1+ i)))))
+ (when (and (eq (nth 1 frame2) 'apply)
+ (progn
+ (funcall get-next-frame)
+ (advice--p (indirect-function (nth 1 frame2)))))
+ (funcall get-next-frame)
+ ;; If we now have the symbol, this was the head advice and
+ ;; we're done.
+ (while (advice--p (nth 1 frame1))
+ ;; This was an inner advice called from some earlier advice.
+ ;; The stack frames look different depending on the particular
+ ;; kind of the earlier advice.
+ (let ((inneradvice (nth 1 frame1)))
+ (if (and (eq (nth 1 frame2) 'apply)
+ (progn
+ (funcall get-next-frame)
+ (advice--p (indirect-function
+ (nth 1 frame2)))))
+ ;; The earlier advice was something like a before/after
+ ;; advice where the "next" code is called directly by the
+ ;; advice--p object.
+ (funcall get-next-frame)
+ ;; It's apparently an around advice, where the "next" is
+ ;; called by the body of the advice in any way it sees fit,
+ ;; so we need to skip the frames of that body.
+ (while
+ (progn
+ (funcall get-next-frame)
+ (not (and (eq (nth 1 frame2) 'apply)
+ (eq (nth 3 frame2) inneradvice)))))
+ (funcall get-next-frame)
+ (funcall get-next-frame))))
+ (- i origi 1))))
+
+
+(provide 'nadvice)
+;;; nadvice.el ends here
(match ,symd . ,(pcase--upat (cdr qpat))))
:pcase--fail)))
;; A QPattern but not for a cons, can only go to the `else' side.
- ((eq (car-safe pat) '\`) (cons :pcase--fail nil))
+ ((eq (car-safe pat) '\`) '(:pcase--fail . nil))
((and (eq (car-safe pat) 'pred)
(or (member (cons 'consp (cadr pat))
pcase-mutually-exclusive-predicates)
(member (cons (cadr pat) 'consp)
pcase-mutually-exclusive-predicates)))
- (cons :pcase--fail nil))))
+ '(:pcase--fail . nil))))
(defun pcase--split-equal (elem pat)
(cond
;; The same match will give the same result.
((and (eq (car-safe pat) '\`) (equal (cadr pat) elem))
- (cons :pcase--succeed :pcase--fail))
+ '(:pcase--succeed . :pcase--fail))
;; A different match will fail if this one succeeds.
((and (eq (car-safe pat) '\`)
;; (or (integerp (cadr pat)) (symbolp (cadr pat))
;; (consp (cadr pat)))
)
- (cons :pcase--fail nil))
+ '(:pcase--fail . nil))
((and (eq (car-safe pat) 'pred)
(symbolp (cadr pat))
- (get (cadr pat) 'side-effect-free)
- (funcall (cadr pat) elem))
- (cons :pcase--succeed nil))))
+ (get (cadr pat) 'side-effect-free))
+ (if (funcall (cadr pat) elem)
+ '(:pcase--succeed . nil)
+ '(:pcase--fail . nil)))))
(defun pcase--split-member (elems pat)
;; Based on pcase--split-equal.
;; The same match (or a match of membership in a superset) will
;; give the same result, but we don't know how to check it.
;; (???
- ;; (cons :pcase--succeed nil))
+ ;; '(:pcase--succeed . nil))
;; A match for one of the elements may succeed or fail.
((and (eq (car-safe pat) '\`) (member (cadr pat) elems))
nil)
;; (or (integerp (cadr pat)) (symbolp (cadr pat))
;; (consp (cadr pat)))
)
- (cons :pcase--fail nil))
+ '(:pcase--fail . nil))
((and (eq (car-safe pat) 'pred)
(symbolp (cadr pat))
(get (cadr pat) 'side-effect-free)
(dolist (elem elems)
(unless (funcall p elem) (setq all nil)))
all))
- (cons :pcase--succeed nil))))
+ '(:pcase--succeed . nil))))
(defun pcase--split-pred (upat pat)
;; FIXME: For predicates like (pred (> a)), two such predicates may
;; actually refer to different variables `a'.
(let (test)
(cond
- ((equal upat pat) (cons :pcase--succeed :pcase--fail))
+ ((equal upat pat) '(:pcase--succeed . :pcase--fail))
((and (eq 'pred (car upat))
(eq 'pred (car-safe pat))
(or (member (cons (cadr upat) (cadr pat))
pcase-mutually-exclusive-predicates)
(member (cons (cadr pat) (cadr upat))
pcase-mutually-exclusive-predicates)))
- (cons :pcase--fail nil))
+ '(:pcase--fail . nil))
((and (eq 'pred (car upat))
(eq '\` (car-safe pat))
(symbolp (cadr upat))
(ignore-errors
(setq test (list (funcall (cadr upat) (cadr pat))))))
(if (car test)
- (cons nil :pcase--fail)
- (cons :pcase--fail nil))))))
+ '(nil . :pcase--fail)
+ '(:pcase--fail . nil))))))
(defun pcase--fgrep (vars sexp)
"Check which of the symbols VARS appear in SEXP."
-;;; trace.el --- tracing facility for Emacs Lisp functions
+;;; trace.el --- tracing facility for Emacs Lisp functions -*- lexical-binding: t -*-
;; Copyright (C) 1993, 1998, 2000-2013 Free Software Foundation, Inc.
;; generation of trace output won't interfere with what you are currently
;; doing.
-;; Requirement:
-;; ============
-;; trace.el needs advice.el version 2.0 or later which you can get from the
-;; same place from where you got trace.el.
-
;; Restrictions:
;; =============
;; - Traced subrs when called interactively will always show nil as the
;; + Macros that were expanded during compilation
;; - All the restrictions that apply to advice.el
-;; Installation:
-;; =============
-;; Put this file together with advice.el (version 2.0 or later) somewhere
-;; into your Emacs `load-path', byte-compile it/them for efficiency, and
-;; put the following autoload declarations into your .emacs
-;;
-;; (autoload 'trace-function "trace" "Trace a function" t)
-;; (autoload 'trace-function-background "trace" "Trace a function" t)
-;;
-;; or explicitly load it with (require 'trace) or (load "trace").
-
;; Usage:
;; ======
;; - To trace a function say `M-x trace-function' which will ask you for the
;;; Code:
-(require 'advice)
-
(defgroup trace nil
"Tracing facility for Emacs Lisp functions."
:prefix "trace-"
:group 'lisp)
;;;###autoload
-(defcustom trace-buffer (purecopy "*trace-output*")
+(defcustom trace-buffer "*trace-output*"
"Trace output will by default go to that buffer."
- :type 'string
- :group 'trace)
+ :type 'string)
;; Current level of traced function invocation:
(defvar trace-level 0)
(defvar inhibit-trace nil
"If non-nil, all tracing is temporarily inhibited.")
-(defun trace-entry-message (function level argument-bindings)
- ;; Generates a string that describes that FUNCTION has been entered at
- ;; trace LEVEL with ARGUMENT-BINDINGS.
- (format "%s%s%d -> %s: %s\n"
- (mapconcat 'char-to-string (make-string (1- level) ?|) " ")
- (if (> level 1) " " "")
- level
- function
- (let ((print-circle t))
- (mapconcat (lambda (binding)
- (concat
- (symbol-name (ad-arg-binding-field binding 'name))
- "="
- ;; do this so we'll see strings:
- (prin1-to-string
- (ad-arg-binding-field binding 'value))))
- argument-bindings
- " "))))
-
-(defun trace-exit-message (function level value)
- ;; Generates a string that describes that FUNCTION has been exited at
- ;; trace LEVEL and that it returned VALUE.
- (format "%s%s%d <- %s: %s\n"
- (mapconcat 'char-to-string (make-string (1- level) ?|) " ")
- (if (> level 1) " " "")
- level
- function
- ;; do this so we'll see strings:
- (let ((print-circle t)) (prin1-to-string value))))
-
-(defun trace-make-advice (function buffer background)
- ;; Builds the piece of advice to be added to FUNCTION's advice info
- ;; so that it will generate the proper trace output in BUFFER
- ;; (quietly if BACKGROUND is t).
- (ad-make-advice
- trace-advice-name nil t
- `(advice
- lambda ()
- (let ((trace-level (1+ trace-level))
- (trace-buffer (get-buffer-create ,buffer)))
- (unless inhibit-trace
- (with-current-buffer trace-buffer
- (set (make-local-variable 'window-point-insertion-type) t)
- ,(unless background '(display-buffer trace-buffer))
- (goto-char (point-max))
- ;; Insert a separator from previous trace output:
- (if (= trace-level 1) (insert trace-separator))
- (insert
- (trace-entry-message
- ',function trace-level ad-arg-bindings))))
- ad-do-it
- (unless inhibit-trace
- (with-current-buffer trace-buffer
- ,(unless background '(display-buffer trace-buffer))
- (goto-char (point-max))
- (insert
- (trace-exit-message
- ',function trace-level ad-return-value))))))))
-
-(defun trace-function-internal (function buffer background)
- ;; Adds trace advice for FUNCTION and activates it.
- (ad-add-advice
- function
- (trace-make-advice function (or buffer trace-buffer) background)
- 'around 'last)
- (ad-activate function nil))
+(defun trace-entry-message (function level args context)
+ "Generate a string that describes that FUNCTION has been entered.
+LEVEL is the trace level, ARGS is the list of arguments passed to FUNCTION,
+and CONTEXT is a string describing the dynamic context (e.g. values of
+some global variables)."
+ (let ((print-circle t))
+ (format "%s%s%d -> %S%s\n"
+ (mapconcat 'char-to-string (make-string (1- level) ?|) " ")
+ (if (> level 1) " " "")
+ level
+ (cons function args)
+ context)))
+
+(defun trace-exit-message (function level value context)
+ "Generate a string that describes that FUNCTION has exited.
+LEVEL is the trace level, VALUE value returned by FUNCTION,
+and CONTEXT is a string describing the dynamic context (e.g. values of
+some global variables)."
+ (let ((print-circle t))
+ (format "%s%s%d <- %s: %S%s\n"
+ (mapconcat 'char-to-string (make-string (1- level) ?|) " ")
+ (if (> level 1) " " "")
+ level
+ function
+ ;; Do this so we'll see strings:
+ value
+ context)))
+
+(defvar trace--timer nil)
+
+(defun trace-make-advice (function buffer background context)
+ "Build the piece of advice to be added to trace FUNCTION.
+FUNCTION is the name of the traced function.
+BUFFER is the buffer where the trace should be printed.
+BACKGROUND if nil means to display BUFFER.
+CONTEXT if non-nil should be a function that returns extra info that should
+be printed along with the arguments in the trace."
+ (lambda (body &rest args)
+ (let ((trace-level (1+ trace-level))
+ (trace-buffer (get-buffer-create buffer))
+ (ctx (funcall context)))
+ (unless inhibit-trace
+ (with-current-buffer trace-buffer
+ (set (make-local-variable 'window-point-insertion-type) t)
+ (unless (or background trace--timer
+ (get-buffer-window trace-buffer 'visible))
+ (setq trace--timer
+ ;; Postpone the display to some later time, in case we
+ ;; can't actually do it now.
+ (run-with-timer 0 nil
+ (lambda ()
+ (setq trace--timer nil)
+ (display-buffer trace-buffer)))))
+ (goto-char (point-max))
+ ;; Insert a separator from previous trace output:
+ (if (= trace-level 1) (insert trace-separator))
+ (insert
+ (trace-entry-message
+ function trace-level args ctx))))
+ (let ((result))
+ (unwind-protect
+ (setq result (list (apply body args)))
+ (unless inhibit-trace
+ (let ((ctx (funcall context)))
+ (with-current-buffer trace-buffer
+ (unless background (display-buffer trace-buffer))
+ (goto-char (point-max))
+ (insert
+ (trace-exit-message
+ function
+ trace-level
+ (if result (car result) '\!non-local\ exit\!)
+ ctx))))))
+ (car result)))))
+
+(defun trace-function-internal (function buffer background context)
+ "Add trace advice for FUNCTION."
+ (advice-add
+ function :around
+ (trace-make-advice function (or buffer trace-buffer) background
+ (or context (lambda () "")))
+ `((name . ,trace-advice-name))))
(defun trace-is-traced (function)
- (ad-find-advice function 'around trace-advice-name))
+ (advice-member-p trace-advice-name function))
+
+(defun trace--read-args (prompt)
+ (cons
+ (intern (completing-read prompt obarray 'fboundp t))
+ (when current-prefix-arg
+ (list
+ (read-buffer "Output to buffer: " trace-buffer)
+ (let ((exp
+ (let ((minibuffer-completing-symbol t))
+ (read-from-minibuffer "Context expression: "
+ nil read-expression-map t
+ 'read-expression-history))))
+ `(lambda ()
+ (let ((print-circle t))
+ (concat " [" (prin1-to-string ,exp) "]"))))))))
;;;###autoload
-(defun trace-function (function &optional buffer)
+(defun trace-function-foreground (function &optional buffer context)
"Traces FUNCTION with trace output going to BUFFER.
For every call of FUNCTION Lisp-style trace messages that display argument
and return values will be inserted into BUFFER. This function generates the
display oriented stuff, use `trace-function-background' instead.
To untrace a function, use `untrace-function' or `untrace-all'."
- (interactive
- (list
- (intern (completing-read "Trace function: " obarray 'fboundp t))
- (read-buffer "Output to buffer: " trace-buffer)))
- (trace-function-internal function buffer nil))
+ (interactive (trace--read-args "Trace function: "))
+ (trace-function-internal function buffer nil context))
;;;###autoload
-(defun trace-function-background (function &optional buffer)
+(defun trace-function-background (function &optional buffer context)
"Traces FUNCTION with trace output going quietly to BUFFER.
When this tracing is enabled, every call to FUNCTION writes
a Lisp-style trace message (showing the arguments and return value)
BUFFER defaults to `trace-buffer'.
To untrace a function, use `untrace-function' or `untrace-all'."
- (interactive
- (list
- (intern
- (completing-read "Trace function in background: " obarray 'fboundp t))
- (read-buffer "Output to buffer: " trace-buffer)))
- (trace-function-internal function buffer t))
+ (interactive (trace--read-args "Trace function in background: "))
+ (trace-function-internal function buffer t context))
+
+;;;###autoload
+(defalias 'trace-function 'trace-function-foreground)
(defun untrace-function (function)
"Untraces FUNCTION and possibly activates all remaining advice.
activated only if the advice of FUNCTION is currently active. If FUNCTION
was not traced this is a noop."
(interactive
- (list (ad-read-advised-function "Untrace function" 'trace-is-traced)))
- (when (trace-is-traced function)
- (ad-remove-advice function 'around trace-advice-name)
- (ad-update function)))
+ (list (intern (completing-read "Untrace function: "
+ obarray #'trace-is-traced t))))
+ (advice-remove function trace-advice-name))
(defun untrace-all ()
"Untraces all currently traced functions."
(interactive)
- (ad-do-advised-functions (function)
- (untrace-function function)))
+ (mapatoms #'untrace-function))
(provide 'trace)
;; History list for VALUE argument to setenv.
(defvar setenv-history nil)
+(defconst env--substitute-vars-regexp
+ "\\$\\(?:\\(?1:[[:alnum:]_]+\\)\\|{\\(?1:[^{}]+\\)}\\|\\$\\)")
-(defun substitute-env-vars (string)
+(defun substitute-env-vars (string &optional only-defined)
"Substitute environment variables referred to in STRING.
`$FOO' where FOO is an environment variable name means to substitute
the value of that variable. The variable name should be terminated
with a character not a letter, digit or underscore; otherwise, enclose
the entire variable name in braces. For instance, in `ab$cd-x',
`$cd' is treated as an environment variable.
+If ONLY-DEFINED is nil, references to undefined environment variables
+are replaced by the empty string; if it is non-nil, they are left unchanged.
Use `$$' to insert a single dollar sign."
(let ((start 0))
- (while (string-match
- (eval-when-compile
- (rx (or (and "$" (submatch (1+ (regexp "[[:alnum:]_]"))))
- (and "${" (submatch (minimal-match (0+ anything))) "}")
- "$$")))
- string start)
+ (while (string-match env--substitute-vars-regexp string start)
(cond ((match-beginning 1)
(let ((value (getenv (match-string 1 string))))
+ (if (and (null value) only-defined)
+ (setq start (match-end 0))
(setq string (replace-match (or value "") t t string)
- start (+ (match-beginning 0) (length value)))))
- ((match-beginning 2)
- (let ((value (getenv (match-string 2 string))))
- (setq string (replace-match (or value "") t t string)
- start (+ (match-beginning 0) (length value)))))
+ start (+ (match-beginning 0) (length value))))))
(t
(setq string (replace-match "$" t t string)
start (+ (match-beginning 0) 1)))))
the environment. Otherwise, value is a string.
If optional parameter FRAME is non-nil, then it should be a
-frame. This function will look up VARIABLE in its 'environment
+frame. This function will look up VARIABLE in its `environment'
parameter.
Otherwise, this function searches `process-environment' for
(defvar epg-key-id nil)
(defvar epg-context nil)
(defvar epg-debug-buffer nil)
+(defvar epg-agent-file nil)
+(defvar epg-agent-mtime nil)
;; from gnupg/include/cipher.h
(defconst epg-cipher-algorithm-alist
(defvar epg-prompt-alist nil)
(put 'epg-error 'error-conditions '(epg-error error))
+(put 'epg-error 'error-message "GPG error")
(defun epg-make-data-from-file (file)
"Make a data object from FILE."
"Convert SIGNATURE to a human readable string."
(let* ((user-id (cdr (assoc (epg-signature-key-id signature)
epg-user-id-alist)))
- (pubkey-algorithm (epg-signature-pubkey-algorithm signature)))
+ (pubkey-algorithm (epg-signature-pubkey-algorithm signature))
+ (key-id (epg-signature-key-id signature)))
(concat
(cond ((eq (epg-signature-status signature) 'good)
"Good signature from ")
"Signature made by revoked key ")
((eq (epg-signature-status signature) 'no-pubkey)
"No public key for "))
- (epg-signature-key-id signature)
+ key-id
(if user-id
(concat " "
(if (stringp user-id)
(if (eq (epg-context-protocol context) 'CMS)
epg-gpgsm-program
epg-gpg-program)))
- (let* ((args (append (list "--no-tty"
+ (let* ((agent-info (getenv "GPG_AGENT_INFO"))
+ (args (append (list "--no-tty"
"--status-fd" "1"
"--yes")
(if (and (not (eq (epg-context-protocol context) 'CMS))
- (string-match ":" (or (getenv "GPG_AGENT_INFO")
- "")))
+ (string-match ":" (or agent-info "")))
'("--use-agent"))
(if (and (not (eq (epg-context-protocol context) 'CMS))
(epg-context-progress-callback context))
(coding-system-for-write 'binary)
(coding-system-for-read 'binary)
process-connection-type
+ (process-environment process-environment)
(orig-mode (default-file-modes))
(buffer (generate-new-buffer " *epg*"))
- process)
+ process
+ terminal-name
+ agent-file
+ (agent-mtime '(0 0 0 0)))
+ ;; Set GPG_TTY and TERM for pinentry-curses. Note that we can't
+ ;; use `terminal-name' here to get the real pty name for the child
+ ;; process, though /dev/fd/0" is not portable.
+ (unless (memq system-type '(ms-dos windows-nt))
+ (with-temp-buffer
+ (condition-case nil
+ (when (= (call-process "tty" "/dev/fd/0" t) 0)
+ (delete-char -1)
+ (setq terminal-name (buffer-string)))
+ (file-error))))
+ (when terminal-name
+ (setq process-environment
+ (cons (concat "GPG_TTY=" terminal-name)
+ (cons "TERM=xterm" process-environment))))
+ ;; Record modified time of gpg-agent socket to restore the Emacs
+ ;; frame on text terminal in `epg-wait-for-completion'.
+ ;; See
+ ;; <http://lists.gnu.org/archive/html/emacs-devel/2007-02/msg00755.html>
+ ;; for more details.
+ (when (and agent-info (string-match "\\(.*\\):[0-9]+:[0-9]+" agent-info))
+ (setq agent-file (match-string 1 agent-info)
+ agent-mtime (or (nth 5 (file-attributes agent-file)) '(0 0 0 0))))
(if epg-debug
(save-excursion
(unless epg-debug-buffer
(setq epg-debug-buffer (generate-new-buffer " *epg-debug*")))
(set-buffer epg-debug-buffer)
(goto-char (point-max))
- (insert (format "%s %s\n"
+ (insert (if agent-info
+ (format "GPG_AGENT_INFO=%s\n" agent-info)
+ "GPG_AGENT_INFO is not set\n")
+ (format "%s %s\n"
(if (eq (epg-context-protocol context) 'CMS)
epg-gpgsm-program
epg-gpg-program)
(make-local-variable 'epg-key-id)
(setq epg-key-id nil)
(make-local-variable 'epg-context)
- (setq epg-context context))
+ (setq epg-context context)
+ (make-local-variable 'epg-agent-file)
+ (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)
(accept-process-output (epg-context-process context) 1))
;; This line is needed to run the process-filter right now.
(sleep-for 0.1)
+ ;; Restore Emacs frame on text terminal, when pinentry-curses has terminated.
+ (if (with-current-buffer (process-buffer (epg-context-process context))
+ (and epg-agent-file
+ (> (float-time (or (nth 5 (file-attributes epg-agent-file))
+ '(0 0 0 0)))
+ (float-time epg-agent-mtime))))
+ (redraw-frame (selected-frame)))
(epg-context-set-result-for
context 'error
(nreverse (epg-context-result-for context 'error))))
-2012-11-13 Glenn Morris <rgm@gnu.org>
+2013-01-04 Glenn Morris <rgm@gnu.org>
+
+ * erc-backend.el (312): Fix typo. (Bug#13235)
+
+2012-11-30 Glenn Morris <rgm@gnu.org>
+
+ * erc.el (erc-accidental-paste-threshold-seconds): Add :version.
+
+2012-11-30 Eric Hanchrow <eric.hanchrow@gmail.com>
+
+ * erc.el (erc-last-input-time): New variable.
+ (erc-accidental-paste-threshold-seconds): New option to avoid
+ sending accidentally-pasted text to the server (Bug#11592).
+ (erc-send-current-line): Use it.
+
+2012-11-30 Chong Yidong <cyd@gnu.org>
+
+ * erc.el (erc-lurker-cleanup, erc-lurker-p): Use float-time.
+
+2012-11-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * erc-backend.el: Fix last change that missed calls to `second'
+ (bug#12970).
+
+2012-11-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Use cl-lib instead of cl, and interactive-p => called-interactively-p.
+ * erc-track.el, erc-networks.el, erc-netsplit.el, erc-dcc.el:
+ * erc-backend.el: Use cl-lib, nth, pcase, and called-interactively-p
+ instead of cl.
+ * erc-speedbar.el, erc-services.el, erc-pcomplete.el, erc-notify.el:
+ * erc-match.el, erc-log.el, erc-join.el, erc-ezbounce.el:
+ * erc-capab.el: Don't require cl since we don't use it.
+ * erc.el: Use cl-lib, nth, pcase, and called-interactively-p i.s.o cl.
+ (erc-lurker-ignore-chars, erc-common-server-suffixes):
+ Move before first use.
+
+2012-11-16 Glenn Morris <rgm@gnu.org>
* erc.el (erc-modules): Add "notifications". Tweak "hecomplete" doc.
;;; Code:
(require 'erc-compat)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
;; There's a fairly strong mutual dependency between erc.el and erc-backend.el.
;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the
;; reverse is true:
(defvar erc-server-responses (make-hash-table :test #'equal)
"Hashtable mapping server responses to their handler hooks.")
-(defstruct (erc-response (:conc-name erc-response.))
+(cl-defstruct (erc-response (:conc-name erc-response.))
(unparsed "" :type string)
(sender "" :type string)
(command "" :type string)
(push str (erc-response.command-args msg))))
(setf (erc-response.contents msg)
- (first (erc-response.command-args msg)))
+ (car (erc-response.command-args msg)))
(setf (erc-response.command-args msg)
(nreverse (erc-response.command-args msg)))
(name &rest name)
&optional sexp sexp def-body))
-(defmacro* define-erc-response-handler ((name &rest aliases)
+(cl-defmacro define-erc-response-handler ((name &rest aliases)
&optional extra-fn-doc extra-var-doc
&rest fn-body)
"Define an ERC handler hook/function pair.
"")
name hook-name))
(fn-alternates
- (loop for alias in aliases
- collect (intern (format "erc-server-%s" alias))))
+ (cl-loop for alias in aliases
+ collect (intern (format "erc-server-%s" alias))))
(var-alternates
- (loop for alias in aliases
- collect (intern (format "erc-server-%s-functions" alias)))))
+ (cl-loop for alias in aliases
+ collect (intern (format "erc-server-%s-functions" alias)))))
`(prog2
;; Normal hook variable.
(defvar ,hook-name ',fn-name ,(format hook-doc name))
(put ',hook-name 'definition-name ',name)
;; Hashtable map of responses to hook variables
- ,@(loop for response in (cons name aliases)
- for var in (cons hook-name var-alternates)
- collect `(puthash ,(format "%s" response) ',var
- erc-server-responses))
+ ,@(cl-loop for response in (cons name aliases)
+ for var in (cons hook-name var-alternates)
+ collect `(puthash ,(format "%s" response) ',var
+ erc-server-responses))
;; Alternates.
;; Functions are defaliased, hook variables are defvared so we
;; can add hooks to one alias, but not another.
- ,@(loop for fn in fn-alternates
- for var in var-alternates
- for a in aliases
- nconc (list `(defalias ',fn ',fn-name)
- `(defvar ,var ',fn-name ,(format hook-doc a))
- `(put ',var 'definition-name ',hook-name))))))
+ ,@(cl-loop for fn in fn-alternates
+ for var in var-alternates
+ for a in aliases
+ nconc (list `(defalias ',fn ',fn-name)
+ `(defvar ,var ',fn-name ,(format hook-doc a))
+ `(put ',var 'definition-name ',hook-name))))))
(define-erc-response-handler (ERROR)
"Handle an ERROR command from the server." nil
(define-erc-response-handler (INVITE)
"Handle invitation messages."
nil
- (let ((target (first (erc-response.command-args parsed)))
+ (let ((target (car (erc-response.command-args parsed)))
(chnl (erc-response.contents parsed)))
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (pcase-let ((`(,nick ,login ,host)
+ (erc-parse-user (erc-response.sender parsed))))
(setq erc-invitation chnl)
(when (string= target (erc-current-nick))
(erc-display-message
nil
(let ((chnl (erc-response.contents parsed))
(buffer nil))
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (pcase-let ((`(,nick ,login ,host)
+ (erc-parse-user (erc-response.sender parsed))))
;; strip the stupid combined JOIN facility (IRC 2.9)
(if (string-match "^\\(.*\\)?\^g.*$" chnl)
(setq chnl (match-string 1 chnl)))
(define-erc-response-handler (KICK)
"Handle kick messages received from the server." nil
- (let* ((ch (first (erc-response.command-args parsed)))
- (tgt (second (erc-response.command-args parsed)))
+ (let* ((ch (nth 0 (erc-response.command-args parsed)))
+ (tgt (nth 1 (erc-response.command-args parsed)))
(reason (erc-trim-string (erc-response.contents parsed)))
(buffer (erc-get-buffer ch proc)))
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (pcase-let ((`(,nick ,login ,host)
+ (erc-parse-user (erc-response.sender parsed))))
(erc-remove-channel-member buffer tgt)
(cond
((string= tgt (erc-current-nick))
(define-erc-response-handler (MODE)
"Handle server mode changes." nil
- (let ((tgt (first (erc-response.command-args parsed)))
+ (let ((tgt (car (erc-response.command-args parsed)))
(mode (mapconcat 'identity (cdr (erc-response.command-args parsed))
" ")))
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (pcase-let ((`(,nick ,login ,host)
+ (erc-parse-user (erc-response.sender parsed))))
(erc-log (format "MODE: %s -> %s: %s" nick tgt mode))
;; dirty hack
(let ((buf (cond ((erc-channel-p tgt)
"Handle nick change messages." nil
(let ((nn (erc-response.contents parsed))
bufs)
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (pcase-let ((`(,nick ,login ,host)
+ (erc-parse-user (erc-response.sender parsed))))
(setq bufs (erc-buffer-list-with-nick nick proc))
(erc-log (format "NICK: %s -> %s" nick nn))
;; if we had a query with this user, make sure future messages will be
(define-erc-response-handler (PART)
"Handle part messages." nil
- (let* ((chnl (first (erc-response.command-args parsed)))
+ (let* ((chnl (car (erc-response.command-args parsed)))
(reason (erc-trim-string (erc-response.contents parsed)))
(buffer (erc-get-buffer chnl proc)))
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (pcase-let ((`(,nick ,login ,host)
+ (erc-parse-user (erc-response.sender parsed))))
(erc-remove-channel-member buffer nick)
(erc-display-message parsed 'notice buffer
'PART ?n nick ?u login
(define-erc-response-handler (PING)
"Handle ping messages." nil
- (let ((pinger (first (erc-response.command-args parsed))))
+ (let ((pinger (car (erc-response.command-args parsed))))
(erc-log (format "PING: %s" pinger))
;; ping response to the server MUST be forced, or you can lose big
(erc-server-send (format "PONG :%s" pinger) t)
(when erc-verbose-server-ping
(erc-display-message
parsed 'notice proc 'PONG
- ?h (first (erc-response.command-args parsed)) ?i erc-server-lag
+ ?h (car (erc-response.command-args parsed)) ?i erc-server-lag
?s (if (/= erc-server-lag 1) "s" "")))
(erc-update-mode-line))))
"Another user has quit IRC." nil
(let ((reason (erc-response.contents parsed))
bufs)
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (pcase-let ((`(,nick ,login ,host)
+ (erc-parse-user (erc-response.sender parsed))))
(setq bufs (erc-buffer-list-with-nick nick proc))
(erc-remove-user nick)
(setq reason (erc-wash-quit-reason reason nick login host))
(define-erc-response-handler (TOPIC)
"The channel topic has changed." nil
- (let* ((ch (first (erc-response.command-args parsed)))
+ (let* ((ch (car (erc-response.command-args parsed)))
(topic (erc-trim-string (erc-response.contents parsed)))
(time (format-time-string erc-server-timestamp-format
(current-time))))
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (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-topic ch (format "%s\C-o (%s, %s)" topic nick time))
(erc-display-message parsed 'notice (erc-get-buffer ch proc)
(define-erc-response-handler (WALLOPS)
"Display a WALLOPS message." nil
(let ((message (erc-response.contents parsed)))
- (multiple-value-bind (nick login host)
- (values-list (erc-parse-user (erc-response.sender parsed)))
+ (pcase-let ((`(,nick ,login ,host)
+ (erc-parse-user (erc-response.sender parsed))))
(erc-display-message
parsed 'notice nil
'WALLOPS ?n nick ?m message))))
(define-erc-response-handler (001)
"Set `erc-server-current-nick' to reflect server settings and display the welcome message."
nil
- (erc-set-current-nick (first (erc-response.command-args parsed)))
+ (erc-set-current-nick (car (erc-response.command-args parsed)))
(erc-update-mode-line) ; needed here?
(setq erc-nick-change-attempt-count 0)
(setq erc-default-nicks (if (consp erc-nick) erc-nick (list erc-nick)))
(define-erc-response-handler (004)
"Display the server's identification." nil
- (multiple-value-bind (server-name server-version)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,server-name ,server-version)
+ (cdr (erc-response.command-args parsed))))
(setq erc-server-version server-version)
(setq erc-server-announced-name server-name)
(erc-update-mode-line-buffer (process-buffer proc))
(erc-display-message
parsed 'notice proc
's004 ?s server-name ?v server-version
- ?U (fourth (erc-response.command-args parsed))
- ?C (fifth (erc-response.command-args parsed)))))
+ ?U (nth 3 (erc-response.command-args parsed))
+ ?C (nth 4 (erc-response.command-args parsed)))))
(define-erc-response-handler (005)
"Set the variable `erc-server-parameters' and display the received message.
(define-erc-response-handler (221)
"Display the current user modes." nil
- (let* ((nick (first (erc-response.command-args parsed)))
+ (let* ((nick (car (erc-response.command-args parsed)))
(modes (mapconcat 'identity
(cdr (erc-response.command-args parsed)) " ")))
(erc-set-modes nick modes)
(define-erc-response-handler (252)
"Display the number of IRC operators online." nil
(erc-display-message parsed 'notice 'active 's252
- ?i (second (erc-response.command-args parsed))))
+ ?i (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (253)
"Display the number of unknown connections." nil
(erc-display-message parsed 'notice 'active 's253
- ?i (second (erc-response.command-args parsed))))
+ ?i (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (254)
"Display the number of channels formed." nil
(erc-display-message parsed 'notice 'active 's254
- ?i (second (erc-response.command-args parsed))))
+ ?i (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (250 251 255 256 257 258 259 265 266 377 378)
"Generic display of server messages as notices.
(define-erc-response-handler (275)
"Display secure connection message." nil
- (multiple-value-bind (nick user message)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,nick ,user ,message)
+ (cdr (erc-response.command-args parsed))))
(erc-display-message
parsed 'notice 'active 's275
?n nick
(define-erc-response-handler (301)
"AWAY notice." nil
(erc-display-message parsed 'notice 'active 's301
- ?n (second (erc-response.command-args parsed))
+ ?n (cadr (erc-response.command-args parsed))
?r (erc-response.contents parsed)))
(define-erc-response-handler (303)
"ISON reply" nil
(erc-display-message parsed 'notice 'active 's303
- ?n (second (erc-response.command-args parsed))))
+ ?n (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (305)
"Return from AWAYness." nil
(define-erc-response-handler (307)
"Display nick-identified message." nil
- (multiple-value-bind (nick user message)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,nick ,user ,message)
+ (cdr (erc-response.command-args parsed))))
(erc-display-message
parsed 'notice 'active 's307
?n nick
"WHOIS/WHOWAS notices." nil
(let ((fname (erc-response.contents parsed))
(catalog-entry (intern (format "s%s" (erc-response.command parsed)))))
- (multiple-value-bind (nick user host)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,nick ,user ,host)
+ (cdr (erc-response.command-args parsed))))
(erc-update-user-nick nick nick host nil fname user)
(erc-display-message
parsed 'notice 'active catalog-entry
(define-erc-response-handler (312)
"Server name response in WHOIS." nil
- (multiple-value-bind (nick server-host)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,nick ,server-host)
+ (cdr (erc-response.command-args parsed))))
(erc-display-message
parsed 'notice 'active 's312
?n nick ?s server-host ?c (erc-response.contents parsed))))
"IRC Operator response in WHOIS." nil
(erc-display-message
parsed 'notice 'active 's313
- ?n (second (erc-response.command-args parsed))))
+ ?n (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (315 318 323 369)
;; 315 - End of WHO
(define-erc-response-handler (317)
"IDLE notice." nil
- (multiple-value-bind (nick seconds-idle on-since time)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,nick ,seconds-idle ,on-since ,time)
+ (cdr (erc-response.command-args parsed))))
(setq time (when on-since
(format-time-string erc-server-timestamp-format
(erc-string-to-emacs-time on-since))))
"Channel names in WHOIS response." nil
(erc-display-message
parsed 'notice 'active 's319
- ?n (second (erc-response.command-args parsed))
+ ?n (cadr (erc-response.command-args parsed))
?c (erc-response.contents parsed)))
(define-erc-response-handler (320)
"Identified user in WHOIS." nil
(erc-display-message
parsed 'notice 'active 's320
- ?n (second (erc-response.command-args parsed))))
+ ?n (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (321)
"LIST header." nil
(define-erc-response-handler (322)
"LIST notice." nil
(let ((topic (erc-response.contents parsed)))
- (multiple-value-bind (channel num-users)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,channel ,num-users)
+ (cdr (erc-response.command-args parsed))))
(add-to-list 'erc-channel-list (list channel))
(erc-update-channel-topic channel topic))))
(defun erc-server-322-message (proc parsed)
"Display a message for the 322 event."
(let ((topic (erc-response.contents parsed)))
- (multiple-value-bind (channel num-users)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,channel ,num-users)
+ (cdr (erc-response.command-args parsed))))
(erc-display-message
parsed 'notice proc 's322
?c channel ?u num-users ?t (or topic "")))))
(define-erc-response-handler (324)
"Channel or nick modes." nil
- (let ((channel (second (erc-response.command-args parsed)))
+ (let ((channel (cadr (erc-response.command-args parsed)))
(modes (mapconcat 'identity (cddr (erc-response.command-args parsed))
" ")))
(erc-set-modes channel modes)
(define-erc-response-handler (328)
"Channel URL (on freenode network)." nil
- (let ((channel (second (erc-response.command-args parsed)))
+ (let ((channel (cadr (erc-response.command-args parsed)))
(url (erc-response.contents parsed)))
(erc-display-message parsed 'notice (erc-get-buffer channel proc)
's328 ?c channel ?u url)))
(define-erc-response-handler (329)
"Channel creation date." nil
- (let ((channel (second (erc-response.command-args parsed)))
+ (let ((channel (cadr (erc-response.command-args parsed)))
(time (erc-string-to-emacs-time
- (third (erc-response.command-args parsed)))))
+ (nth 2 (erc-response.command-args parsed)))))
(erc-display-message
parsed 'notice (erc-get-buffer channel proc)
's329 ?c channel ?t (format-time-string erc-server-timestamp-format
;; authaccount == (aref parsed 4)
;; authmsg == (aref parsed 5)
;; The guesses below are, well, just that. -- Lawrence 2004/05/10
- (let ((nick (second (erc-response.command-args parsed)))
- (authaccount (third (erc-response.command-args parsed)))
+ (let ((nick (cadr (erc-response.command-args parsed)))
+ (authaccount (nth 2 (erc-response.command-args parsed)))
(authmsg (erc-response.contents parsed)))
(erc-display-message parsed 'notice 'active 's330
?n nick ?a authmsg ?i authaccount)))
(define-erc-response-handler (331)
"No topic set for channel." nil
- (let ((channel (second (erc-response.command-args parsed)))
+ (let ((channel (cadr (erc-response.command-args parsed)))
(topic (erc-response.contents parsed)))
(erc-display-message parsed 'notice (erc-get-buffer channel proc)
's331 ?c channel)))
(define-erc-response-handler (332)
"TOPIC notice." nil
- (let ((channel (second (erc-response.command-args parsed)))
+ (let ((channel (cadr (erc-response.command-args parsed)))
(topic (erc-response.contents parsed)))
(erc-update-channel-topic channel topic)
(erc-display-message parsed 'notice (erc-get-buffer channel proc)
(define-erc-response-handler (333)
"Who set the topic, and when." nil
- (multiple-value-bind (channel nick time)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,channel ,nick ,time)
+ (cdr (erc-response.command-args parsed))))
(setq time (format-time-string erc-server-timestamp-format
(erc-string-to-emacs-time time)))
(erc-update-channel-topic channel
(define-erc-response-handler (341)
"Let user know when an INVITE attempt has been sent successfully."
nil
- (multiple-value-bind (nick channel)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,nick ,channel)
+ (cdr (erc-response.command-args parsed))))
(erc-display-message parsed 'notice (erc-get-buffer channel proc)
's341 ?n nick ?c channel)))
(define-erc-response-handler (352)
"WHO notice." nil
- (multiple-value-bind (channel user host server nick away-flag)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,channel ,user ,host ,server ,nick ,away-flag)
+ (cdr (erc-response.command-args parsed))))
(let ((full-name (erc-response.contents parsed))
hopcount)
(when (string-match "\\(^[0-9]+ \\)\\(.*\\)$" full-name)
(define-erc-response-handler (353)
"NAMES notice." nil
- (let ((channel (third (erc-response.command-args parsed)))
+ (let ((channel (nth 2 (erc-response.command-args parsed)))
(users (erc-response.contents parsed)))
(erc-display-message parsed 'notice (or (erc-get-buffer channel proc)
'active)
(define-erc-response-handler (366)
"End of NAMES." nil
- (erc-with-buffer ((second (erc-response.command-args parsed)) proc)
+ (erc-with-buffer ((cadr (erc-response.command-args parsed)) proc)
(erc-channel-end-receiving-names)))
(define-erc-response-handler (367)
"Channel ban list entries." nil
- (multiple-value-bind (channel banmask setter time)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,channel ,banmask ,setter ,time)
+ (cdr (erc-response.command-args parsed))))
;; setter and time are not standard
(if setter
(erc-display-message parsed 'notice 'active 's367-set-by
(define-erc-response-handler (368)
"End of channel ban list." nil
- (let ((channel (second (erc-response.command-args parsed))))
+ (let ((channel (cadr (erc-response.command-args parsed))))
(erc-display-message parsed 'notice 'active 's368
?c channel)))
;; FIXME: Yet more magic numbers in original code, I'm guessing this
;; command takes two arguments, and doesn't have any "contents". --
;; Lawrence 2004/05/10
- (multiple-value-bind (from to)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,from ,to)
+ (cdr (erc-response.command-args parsed))))
(erc-display-message parsed 'notice 'active
's379 ?c from ?f to)))
"Server's time string." nil
(erc-display-message
parsed 'notice 'active
- 's391 ?s (second (erc-response.command-args parsed))
- ?t (third (erc-response.command-args parsed))))
+ 's391 ?s (cadr (erc-response.command-args parsed))
+ ?t (nth 2 (erc-response.command-args parsed))))
(define-erc-response-handler (401)
"No such nick/channel." nil
- (let ((nick/channel (second (erc-response.command-args parsed))))
+ (let ((nick/channel (cadr (erc-response.command-args parsed))))
(when erc-whowas-on-nosuchnick
(erc-log (format "cmd: WHOWAS: %s" nick/channel))
(erc-server-send (format "WHOWAS %s 1" nick/channel)))
(define-erc-response-handler (403)
"No such channel." nil
(erc-display-message parsed '(notice error) 'active
- 's403 ?c (second (erc-response.command-args parsed))))
+ 's403 ?c (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (404)
"Cannot send to channel." nil
(erc-display-message parsed '(notice error) 'active
- 's404 ?c (second (erc-response.command-args parsed))))
+ 's404 ?c (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (405)
"Can't join that many channels." nil
(erc-display-message parsed '(notice error) 'active
- 's405 ?c (second (erc-response.command-args parsed))))
+ 's405 ?c (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (406)
"No such nick." nil
(erc-display-message parsed '(notice error) 'active
- 's406 ?n (second (erc-response.command-args parsed))))
+ 's406 ?n (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (412)
"No text to send." nil
(define-erc-response-handler (421)
"Unknown command." nil
(erc-display-message parsed '(notice error) 'active 's421
- ?c (second (erc-response.command-args parsed))))
+ ?c (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (432)
"Bad nick." nil
(erc-display-message parsed '(notice error) 'active 's432
- ?n (second (erc-response.command-args parsed))))
+ ?n (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (433)
"Login-time \"nick in use\"." nil
- (erc-nickname-in-use (second (erc-response.command-args parsed))
+ (erc-nickname-in-use (cadr (erc-response.command-args parsed))
"already in use"))
(define-erc-response-handler (437)
"Nick temporarily unavailable (on IRCnet)." nil
- (let ((nick/channel (second (erc-response.command-args parsed))))
+ (let ((nick/channel (cadr (erc-response.command-args parsed))))
(unless (erc-channel-p nick/channel)
(erc-nickname-in-use nick/channel "temporarily unavailable"))))
(define-erc-response-handler (442)
"Not on channel." nil
(erc-display-message parsed '(notice error) 'active 's442
- ?c (second (erc-response.command-args parsed))))
+ ?c (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (461)
"Not enough parameters for command." nil
(erc-display-message parsed '(notice error) 'active 's461
- ?c (second (erc-response.command-args parsed))
+ ?c (cadr (erc-response.command-args parsed))
?m (erc-response.contents parsed)))
(define-erc-response-handler (465)
(erc-display-message parsed '(notice error) nil
(intern (format "s%s"
(erc-response.command parsed)))
- ?c (second (erc-response.command-args parsed))))
+ ?c (cadr (erc-response.command-args parsed))))
(define-erc-response-handler (475)
"Channel key needed." nil
(erc-display-message parsed '(notice error) nil 's475
- ?c (second (erc-response.command-args parsed)))
+ ?c (cadr (erc-response.command-args parsed)))
(when erc-prompt-for-channel-key
- (let ((channel (second (erc-response.command-args parsed)))
+ (let ((channel (cadr (erc-response.command-args parsed)))
(key (read-from-minibuffer
(format "Channel %s is mode +k. Enter key (RET to cancel): "
- (second (erc-response.command-args parsed))))))
+ (cadr (erc-response.command-args parsed))))))
(when (and key (> (length key) 0))
(erc-cmd-JOIN channel key)))))
(define-erc-response-handler (477)
"Channel doesn't support modes." nil
- (let ((channel (second (erc-response.command-args parsed)))
+ (let ((channel (cadr (erc-response.command-args parsed)))
(message (erc-response.contents parsed)))
(erc-display-message parsed 'notice (erc-get-buffer channel proc)
(format "%s: %s" channel message))))
(define-erc-response-handler (482)
"You need to be a channel operator to do that." nil
- (let ((channel (second (erc-response.command-args parsed)))
+ (let ((channel (cadr (erc-response.command-args parsed)))
(message (erc-response.contents parsed)))
(erc-display-message parsed '(error notice) 'active 's482
?c channel ?m message)))
(define-erc-response-handler (671)
"Secure connection response in WHOIS." nil
- (let ((nick (second (erc-response.command-args parsed)))
+ (let ((nick (cadr (erc-response.command-args parsed)))
(securemsg (erc-response.contents parsed)))
(erc-display-message parsed 'notice 'active 's671
?n nick ?a securemsg)))
;;; Code:
(require 'erc)
-(eval-when-compile (require 'cl))
;;; Customization:
;;; Code:
(require 'erc)
-(eval-when-compile
- (require 'cl)
- (require 'pcomplete))
+(eval-when-compile (require 'pcomplete))
;;;###autoload (autoload 'erc-dcc-mode "erc-dcc")
(define-erc-module dcc nil
(* (nth 1 ips) 65536.0)
(* (nth 2 ips) 256.0)
(nth 3 ips))))
- (if (interactive-p)
+ (if (called-interactively-p 'interactive)
(message "%s is %.0f" ip res)
(format "%.0f" res)))))
(with-no-warnings ; obsolete since 23.1
(set-process-filter-multibyte process nil)))))
(file-error
- (unless (and (string= "Cannot bind server socket" (cadr err))
- (string= "address already in use" (caddr err)))
+ (unless (and (string= "Cannot bind server socket" (nth 1 err))
+ (string= "address already in use" (nth 2 err)))
(signal (car err) (cdr err)))
(setq port (1+ port))
(unless (< port upper)
(pcomplete-here (append '("chat" "close" "get" "list")
(when (fboundp 'make-network-process) '("send"))))
(pcomplete-here
- (case (intern (downcase (pcomplete-arg 1)))
- (chat (mapcar (lambda (elt) (plist-get elt :nick))
+ (pcase (intern (downcase (pcomplete-arg 1)))
+ (`chat (mapcar (lambda (elt) (plist-get elt :nick))
+ (erc-remove-if-not
+ #'(lambda (elt)
+ (eq (plist-get elt :type) 'CHAT))
+ erc-dcc-list)))
+ (`close (erc-delete-dups
+ (mapcar (lambda (elt) (symbol-name (plist-get elt :type)))
+ erc-dcc-list)))
+ (`get (mapcar #'erc-dcc-nick
(erc-remove-if-not
#'(lambda (elt)
- (eq (plist-get elt :type) 'CHAT))
+ (eq (plist-get elt :type) 'GET))
erc-dcc-list)))
- (close (erc-delete-dups
- (mapcar (lambda (elt) (symbol-name (plist-get elt :type)))
- erc-dcc-list)))
- (get (mapcar #'erc-dcc-nick
- (erc-remove-if-not
- #'(lambda (elt)
- (eq (plist-get elt :type) 'GET))
- erc-dcc-list)))
- (send (pcomplete-erc-all-nicks))))
+ (`send (pcomplete-erc-all-nicks))))
(pcomplete-here
- (case (intern (downcase (pcomplete-arg 2)))
- (get (mapcar (lambda (elt) (plist-get elt :file))
- (erc-remove-if-not
- #'(lambda (elt)
- (and (eq (plist-get elt :type) 'GET)
- (erc-nick-equal-p (erc-extract-nick
- (plist-get elt :nick))
- (pcomplete-arg 1))))
- erc-dcc-list)))
- (close (mapcar #'erc-dcc-nick
- (erc-remove-if-not
- #'(lambda (elt)
- (eq (plist-get elt :type)
- (intern (upcase (pcomplete-arg 1)))))
- erc-dcc-list)))
- (send (pcomplete-entries)))))
+ (pcase (intern (downcase (pcomplete-arg 2)))
+ (`get (mapcar (lambda (elt) (plist-get elt :file))
+ (erc-remove-if-not
+ #'(lambda (elt)
+ (and (eq (plist-get elt :type) 'GET)
+ (erc-nick-equal-p (erc-extract-nick
+ (plist-get elt :nick))
+ (pcomplete-arg 1))))
+ erc-dcc-list)))
+ (`close (mapcar #'erc-dcc-nick
+ (erc-remove-if-not
+ #'(lambda (elt)
+ (eq (plist-get elt :type)
+ (intern (upcase (pcomplete-arg 1)))))
+ erc-dcc-list)))
+ (`send (pcomplete-entries)))))
(defun erc-dcc-do-CHAT-command (proc &optional nick)
(when nick
(defun erc-dcc-no-such-nick (proc parsed)
"Detect and handle no-such-nick replies from the IRC server."
- (let* ((elt (erc-dcc-member :nick (second (erc-response.command-args parsed))
+ (let* ((elt (erc-dcc-member :nick (nth 1 (erc-response.command-args parsed))
:parent proc))
(peer (plist-get elt :peer)))
(when (or (and (processp peer) (not (eq (process-status peer) 'open)))
;;; Code:
(require 'erc)
-(eval-when-compile (require 'cl))
(defgroup erc-ezbounce nil
"Interface to the EZBounce IRC bouncer (a virtual IRC server)"
(require 'erc)
(require 'auth-source)
-(eval-when-compile (require 'cl))
(defgroup erc-autojoin nil
"Enable autojoining."
;;; Code:
(require 'erc)
-(eval-when-compile
- (require 'erc-networks)
- (require 'cl))
+(eval-when-compile (require 'erc-networks))
(defgroup erc-log nil
"Logging facilities for ERC."
file t 'nomessage))))
(let ((coding-system-for-write coding-system))
(write-region start end file t 'nomessage))))
- (if (and erc-truncate-buffer-on-save (interactive-p))
+ (if (and erc-truncate-buffer-on-save
+ (called-interactively-p 'interactive))
(progn
(let ((inhibit-read-only t)) (erase-buffer))
(move-marker erc-last-saved-position (point-max))
;;; Code:
(require 'erc)
-(eval-when-compile (require 'cl))
;; Customization:
;;; Code:
(require 'erc)
-(eval-when-compile (require 'cl))
(defgroup erc-netsplit nil
"Netsplit detection tries to automatically figure when a
(dolist (elt erc-netsplit-list)
(if (member nick (nthcdr 3 elt))
(progn
- (if (not (caddr elt))
+ (if (not (nth 2 elt))
(progn
(erc-display-message
parsed 'notice (process-buffer proc)
;; element for this netsplit exists already
(progn
(setcdr (nthcdr 2 ass) (cons nick (nthcdr 3 ass)))
- (when (caddr ass)
+ (when (nth 2 ass)
;; There was already a netjoin for this netsplit, it
;; seems like the old one didn't get finished...
(erc-display-message
nil 'notice 'active
'netsplit-wholeft ?s (car elt)
?n (mapconcat 'erc-extract-nick (nthcdr 3 elt) " ")
- ?t (if (caddr elt)
+ ?t (if (nth 2 elt)
"(joining)"
"")))))
t)
;;; Code:
(require 'erc)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
;; Variables
(or
;; Loop through `erc-networks-alist' looking for a match.
(let ((server (or erc-server-announced-name erc-session-server)))
- (loop for (name matcher) in erc-networks-alist
- when (and matcher
- (string-match (concat matcher "\\'") server))
- do (return name)))
+ (cl-loop for (name matcher) in erc-networks-alist
+ when (and matcher
+ (string-match (concat matcher "\\'") server))
+ do (cl-return name)))
'Unknown)))
(defun erc-network ()
(cond ((numberp p)
(push p result))
((listp p)
- (setq result (nconc (loop for i from (cadr p) downto (car p)
- collect i)
+ (setq result (nconc (cl-loop for i from (cadr p) downto (car p)
+ collect i)
result)))))
(nreverse result)))
(require 'erc)
(require 'erc-networks)
-(eval-when-compile
- (require 'cl)
- (require 'pcomplete))
+(eval-when-compile (require 'pcomplete))
;;;; Customizable variables
(require 'erc)
(require 'erc-compat)
(require 'time-date)
-(eval-when-compile (require 'cl))
(defgroup erc-pcomplete nil
"Programmable completion for ERC"
(require 'erc)
(require 'erc-networks)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
;; Customization:
(require 'erc)
(require 'speedbar)
(condition-case nil (require 'dframe) (error nil))
-(eval-when-compile (require 'cl))
;;; Customization:
;; * Add extensibility so that custom functions can track
;; custom modification types.
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(require 'erc)
(require 'erc-compat)
(require 'erc-match)
;;; Test:
-(assert
+(cl-assert
(and
;; verify examples from the doc strings
(equal (let ((erc-track-shorten-aggressively nil))
(setq erc-modified-channels-alist
(delete (assq buffer erc-modified-channels-alist)
erc-modified-channels-alist))
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(erc-modified-channels-display)))
(defun erc-track-find-face (faces)
(add-to-list 'faces cur)))
faces))
-(assert
+(cl-assert
(let ((str "is bold"))
(put-text-property 3 (length str)
'face '(bold erc-current-nick-face)
(let ((dir erc-track-switch-direction)
offset)
(when (< arg 0)
- (setq dir (case dir
- (oldest 'newest)
- (newest 'oldest)
- (mostactive 'leastactive)
- (leastactive 'mostactive)
- (importance 'oldest)))
+ (setq dir (pcase dir
+ (`oldest 'newest)
+ (`newest 'oldest)
+ (`mostactive 'leastactive)
+ (`leastactive 'mostactive)
+ (`importance 'oldest)))
(setq arg (- arg)))
- (setq offset (case dir
- ((oldest leastactive)
+ (setq offset (pcase dir
+ ((or `oldest `leastactive)
(- (length erc-modified-channels-alist) arg))
- (t (1- arg))))
+ (_ (1- arg))))
;; normalize out of range user input
(cond ((>= offset (length erc-modified-channels-alist))
(setq offset (1- (length erc-modified-channels-alist))))
(defconst erc-version-string "Version 5.3"
"ERC version. This is used by function `erc-version'.")
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(require 'font-lock)
(require 'pp)
(require 'thingatpt)
(with-current-buffer ,buffer
,@body)))))
-(defstruct (erc-server-user (:type vector) :named)
+(cl-defstruct (erc-server-user (:type vector) :named)
;; User data
nickname host login full-name info
;; Buffers
(buffers nil)
)
-(defstruct (erc-channel-user (:type vector) :named)
+(cl-defstruct (erc-channel-user (:type vector) :named)
op voice
;; Last message time (in the form of the return value of
;; (current-time)
t))
(erc-server-send (format "ISON %s" nick))
(while (eq erc-online-p 'unknown) (accept-process-output))
- (if (interactive-p)
+ (if (called-interactively-p 'interactive)
(message "%s is %sonline"
(or erc-online-p nick)
(if erc-online-p "" "not "))
(list :server server :port port :nick nick :password passwd)))
;;;###autoload
-(defun* erc (&key (server (erc-compute-server))
- (port (erc-compute-port))
- (nick (erc-compute-nick))
- password
- (full-name (erc-compute-full-name)))
+(cl-defun erc (&key (server (erc-compute-server))
+ (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.
(while list
(setq elt (car list))
(cond ((integerp elt) ; POSITION
- (incf (car list) shift))
+ (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)
- (incf (car elt) shift)
- (incf (cdr elt) shift))
+ (cl-incf (car elt) shift)
+ (cl-incf (cdr elt) shift))
((stringp (car elt)) ; (TEXT . POSITION)
- (incf (cdr elt) (* (if (natnump (cdr elt)) 1 -1) shift)))
+ (cl-incf (cdr elt) (* (if (natnump (cdr elt)) 1 -1) shift)))
((null (car elt)) ; (nil PROPERTY VALUE BEG . END)
(let ((cons (nthcdr 3 elt)))
- (incf (car cons) shift)
- (incf (cdr cons) shift)))
+ (cl-incf (car cons) shift)
+ (cl-incf (cdr cons) shift)))
((and (featurep 'xemacs)
(extentp (car elt))) ; (EXTENT START END)
- (incf (nth 1 elt) shift)
- (incf (nth 2 elt) shift)))
+ (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-]*"
:group 'erc-lurker
:type 'boolean)
+(defcustom erc-lurker-ignore-chars "`_"
+ "Characters at the end of a nick to strip for activity tracking purposes.
+
+See also `erc-lurker-trim-nicks'."
+ :group 'erc-lurker
+ :type 'string)
+
(defun erc-lurker-maybe-trim (nick)
"Maybe trim trailing `erc-lurker-ignore-chars' from NICK.
"" nick)
nick))
-(defcustom erc-lurker-ignore-chars "`_"
- "Characters at the end of a nick to strip for activity tracking purposes.
-
-See also `erc-lurker-trim-nicks'."
- :group 'erc-lurker
- :type 'string)
-
(defcustom erc-lurker-hide-list nil
"List of IRC type messages to hide when sent by lurkers.
(maphash
(lambda (nick last-PRIVMSG-time)
(when
- (> (time-to-seconds (time-subtract
- (current-time)
- last-PRIVMSG-time))
+ (> (float-time (time-subtract
+ (current-time)
+ last-PRIVMSG-time))
erc-lurker-threshold-time)
(remhash nick hash)))
hash)
(server
(erc-canonicalize-server-name erc-server-announced-name)))
(when (equal command "PRIVMSG")
- (when (>= (incf erc-lurker-cleanup-count) erc-lurker-cleanup-interval)
+ (when (>= (cl-incf erc-lurker-cleanup-count)
+ erc-lurker-cleanup-interval)
(setq erc-lurker-cleanup-count 0)
(erc-lurker-cleanup))
(unless (gethash server erc-lurker-state)
(gethash (erc-lurker-maybe-trim nick)
(gethash server erc-lurker-state (make-hash-table)))))
(or (null last-PRIVMSG-time)
- (> (time-to-seconds
+ (> (float-time
(time-subtract (current-time) last-PRIVMSG-time))
erc-lurker-threshold-time))))
+(defcustom erc-common-server-suffixes
+ '(("openprojects.net$" . "OPN")
+ ("freenode.net$" . "freenode")
+ ("oftc.net$" . "OFTC"))
+ "Alist of common server name suffixes.
+This variable is used in mode-line display to save screen
+real estate. Set it to nil if you want to avoid changing
+displayed hostnames."
+ :group 'erc-mode-line-and-header
+ :type 'alist)
+
(defun erc-canonicalize-server-name (server)
"Returns the canonical network name for SERVER if any,
otherwise `erc-server-announced-name'. SERVER is matched against
(add-to-list 'symlist
(cons (erc-once-with-server-event
311 `(string= ,nick
- (second
+ (nth 1
(erc-response.command-args parsed))))
'erc-server-311-functions))
(add-to-list 'symlist
(cons (erc-once-with-server-event
312 `(string= ,nick
- (second
+ (nth 1
(erc-response.command-args parsed))))
'erc-server-312-functions))
(add-to-list 'symlist
(cons (erc-once-with-server-event
318 `(string= ,nick
- (second
+ (nth 1
(erc-response.command-args parsed))))
'erc-server-318-functions))
(add-to-list 'symlist
(cons (erc-once-with-server-event
319 `(string= ,nick
- (second
+ (nth 1
(erc-response.command-args parsed))))
'erc-server-319-functions))
(add-to-list 'symlist
(cons (erc-once-with-server-event
320 `(string= ,nick
- (second
+ (nth 1
(erc-response.command-args parsed))))
'erc-server-320-functions))
(add-to-list 'symlist
(cons (erc-once-with-server-event
330 `(string= ,nick
- (second
+ (nth 1
(erc-response.command-args parsed))))
'erc-server-330-functions))
(add-to-list 'symlist
(defun erc-banlist-store (proc parsed)
"Record ban entries for a channel."
- (multiple-value-bind (channel mask whoset)
- (values-list (cdr (erc-response.command-args parsed)))
+ (pcase-let ((`(,channel ,mask ,whoset)
+ (cdr (erc-response.command-args parsed))))
;; Determine to which buffer the message corresponds
(let ((buffer (erc-get-buffer channel proc)))
(with-current-buffer buffer
(defun erc-banlist-finished (proc parsed)
"Record that we have received the banlist."
- (let* ((channel (second (erc-response.command-args parsed)))
+ (let* ((channel (nth 1 (erc-response.command-args parsed)))
(buffer (erc-get-buffer channel proc)))
(with-current-buffer buffer
(put 'erc-channel-banlist 'received-from-server t)))
(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 (first (erc-response.command-args parsed)))
+ (let* ((tgt (car (erc-response.command-args parsed)))
(mode (erc-response.contents parsed))
(whoset (erc-response.sender parsed))
(buffer (erc-get-buffer tgt proc)))
"Return the value of `point' at the end of the input line."
(point-max))
+(defvar erc-last-input-time 0
+ "Time of last call to `erc-send-current-line'.
+If that function has never been called, the value is 0.")
+
+(defcustom erc-accidental-paste-threshold-seconds nil
+ "Minimum time, in seconds, before sending new lines via IRC.
+If the value is a number, `erc-send-current-line' signals an
+error if its previous invocation was less than this much time
+ago. This is useful so that if you accidentally enter large
+amounts of text into the ERC buffer, that text is not sent to the
+IRC server.
+
+If the value is nil, `erc-send-current-line' always considers any
+submitted line to be intentional."
+ :group 'erc
+ :version "24.4"
+ :type '(choice number (other :tag "disabled" nil)))
+
(defun erc-send-current-line ()
"Parse current line and send it to IRC."
(interactive)
- (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))))))
+ (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))
+ (switch-to-buffer "*ERC Accidental Paste Overflow*")
+ (lwarn 'erc :warning
+ "You seem to have accidentally pasted some text!"))))
(defun erc-user-input ()
"Return the input of the user in the current buffer."
(if cuser
(setq op (erc-channel-user-op cuser)
voice (erc-channel-user-voice cuser)))
- (if (interactive-p)
+ (if (called-interactively-p 'interactive)
(message "%s is %s@%s%s%s"
nick login host
(if full-name (format " (%s)" full-name) "")
:group 'erc-paranoia
:type 'boolean)
-(defcustom erc-common-server-suffixes
- '(("openprojects.net$" . "OPN")
- ("freenode.net$" . "freenode")
- ("oftc.net$" . "OFTC"))
- "Alist of common server name suffixes.
-This variable is used in mode-line display to save screen
-real estate. Set it to nil if you want to avoid changing
-displayed hostnames."
- :group 'erc-mode-line-and-header
- :type 'alist)
-
(defcustom erc-mode-line-away-status-format
"(AWAY since %a %b %d %H:%M) "
"When you're away on a server, this is shown in the mode line.
(format "ERC %s (GNU Emacs %s)" erc-version-string emacs-version)))
(if here
(insert version-string)
- (if (interactive-p)
+ (if (called-interactively-p 'interactive)
(message "%s" version-string)
version-string))))
", ")))
(if here
(insert string)
- (if (interactive-p)
+ (if (called-interactively-p 'interactive)
(message "%s" string)
string))))
(eshell-eval-using-options
"mkdir" args
'((?h "help" nil nil "show this usage screen")
+ (?p "parents" nil em-parents "make parent directories as needed")
:external "mkdir"
:show-usage
:usage "[OPTION] DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.")
(while args
- (eshell-funcalln 'make-directory (car args))
+ (eshell-funcalln 'make-directory (car args) em-parents)
(setq args (cdr args)))
nil))
(defalias 'face-background-pixmap 'face-stipple)
-;; FIXME all of these -p functions ignore inheritance (cf face-stipple).
-;; Ie, a face that inherits from an underlined face but does not
-;; specify :underline will return nil.
-;; So these functions don't actually tell you anything about how the
-;; face will _appear_. So not very useful IMO.
-(defun face-underline-p (face &optional frame)
+(defun face-underline-p (face &optional frame inherit)
"Return non-nil if FACE specifies a non-nil underlining.
If the optional argument FRAME is given, report on face FACE in that frame.
If FRAME is t, report on the defaults for face FACE (for new frames).
-If FRAME is omitted or nil, use the selected frame."
- (face-attribute-specified-or (face-attribute face :underline frame) nil))
+If FRAME is omitted or nil, use the selected frame.
+Optional argument INHERIT is passed to `face-attribute'."
+ (face-attribute-specified-or
+ (face-attribute face :underline frame inherit) nil))
-(defun face-inverse-video-p (face &optional frame)
+(defun face-inverse-video-p (face &optional frame inherit)
"Return non-nil if FACE specifies a non-nil inverse-video.
If the optional argument FRAME is given, report on face FACE in that frame.
If FRAME is t, report on the defaults for face FACE (for new frames).
-If FRAME is omitted or nil, use the selected frame."
- (eq (face-attribute face :inverse-video frame) t))
+If FRAME is omitted or nil, use the selected frame.
+Optional argument INHERIT is passed to `face-attribute'."
+ (eq (face-attribute face :inverse-video frame inherit) t))
-(defun face-bold-p (face &optional frame)
+(defun face-bold-p (face &optional frame inherit)
"Return non-nil if the font of FACE is bold on FRAME.
If the optional argument FRAME is given, report on face FACE in that frame.
If FRAME is t, report on the defaults for face FACE (for new frames).
If FRAME is omitted or nil, use the selected frame.
+Optional argument INHERIT is passed to `face-attribute'.
Use `face-attribute' for finer control."
- (let ((bold (face-attribute face :weight frame)))
+ (let ((bold (face-attribute face :weight frame inherit)))
(memq bold '(semi-bold bold extra-bold ultra-bold))))
-(defun face-italic-p (face &optional frame)
+(defun face-italic-p (face &optional frame inherit)
"Return non-nil if the font of FACE is italic on FRAME.
If the optional argument FRAME is given, report on face FACE in that frame.
If FRAME is t, report on the defaults for face FACE (for new frames).
If FRAME is omitted or nil, use the selected frame.
+Optional argument INHERIT is passed to `face-attribute'.
Use `face-attribute' for finer control."
- (let ((italic (face-attribute face :slant frame)))
+ (let ((italic (face-attribute face :slant frame inherit)))
(memq italic '(italic oblique))))
'set-face-underline "24.3")
-(defun set-face-inverse-video-p (face inverse-video-p &optional frame)
+(defun set-face-inverse-video (face inverse-video-p &optional frame)
"Specify whether face FACE is in inverse video.
INVERSE-VIDEO-P non-nil means FACE displays explicitly in inverse video.
INVERSE-VIDEO-P nil means FACE explicitly is not in inverse video.
Use `set-face-attribute' to ``unspecify'' the inverse video attribute."
(interactive
(let ((list (read-face-and-attribute :inverse-video)))
- (list (car list) (eq (car (cdr list)) t))))
+ (list (car list) (if (cadr list) t))))
(set-face-attribute face frame :inverse-video inverse-video-p))
+(define-obsolete-function-alias 'set-face-inverse-video-p
+ 'set-face-inverse-video "24.4")
-;; The -p suffix is a hostage to fortune. What if we want to extend
-;; this to allow more than boolean options? Exactly this happened
-;; to set-face-underline-p.
-(defun set-face-bold-p (face bold-p &optional frame)
+(defun set-face-bold (face bold-p &optional frame)
"Specify whether face FACE is bold.
BOLD-P non-nil means FACE should explicitly display bold.
BOLD-P nil means FACE should explicitly display non-bold.
(make-face-unbold face frame)
(make-face-bold face frame)))
+(define-obsolete-function-alias 'set-face-bold-p 'set-face-bold "24.4")
-(defun set-face-italic-p (face italic-p &optional frame)
+
+(defun set-face-italic (face italic-p &optional frame)
"Specify whether face FACE is italic.
ITALIC-P non-nil means FACE should explicitly display italic.
ITALIC-P nil means FACE should explicitly display non-italic.
(make-face-unitalic face frame)
(make-face-italic face frame)))
+(define-obsolete-function-alias 'set-face-italic-p 'set-face-italic "24.4")
+
(defalias 'set-face-background-pixmap 'set-face-stipple)
(mapcar (lambda (x) (list (car x) 'unspecified))
face-attribute-name-alist)))))
-(defun face-spec-set (face spec &optional for-defface)
- "Set and apply the face spec for FACE.
-If the optional argument FOR-DEFFACE is omitted or nil, set the
-overriding spec to SPEC, recording it in the `face-override-spec'
-property of FACE. See `defface' for the format of SPEC.
-
-If FOR-DEFFACE is non-nil, set the base spec (the one set by
-`defface' and Custom). In this case, SPEC is ignored; the caller
-is responsible for putting the face spec in the `saved-face',
-`customized-face', or `face-defface-spec', as appropriate.
-
-The appearance of FACE is controlled by the base spec, by any
-custom theme specs on top of that, and by the overriding spec on
-top of all the rest."
- (if for-defface
- ;; When we reset the face based on its custom spec, then it is
- ;; unmodified as far as Custom is concerned.
- (put (or (get face 'face-alias) face) 'face-modified nil)
- ;; When we change a face based on a spec from outside custom,
- ;; record it for future frames.
- (put (or (get face 'face-alias) face) 'face-override-spec spec))
- ;; Reset each frame according to the rules implied by all its specs.
- (dolist (frame (frame-list))
- (face-spec-recalc face frame)))
+(defun face-spec-set (face spec &optional spec-type)
+ "Set the face spec SPEC for FACE.
+See `defface' for the format of SPEC.
+
+The appearance of each face is controlled by its spec, and by the
+internal face attributes (which can be frame-specific and can be
+set via `set-face-attribute').
+
+The argument SPEC-TYPE determines which spec to set:
+ nil or `face-override-spec' means the override spec (which is
+ usually what you want if calling this function outside of
+ Custom code);
+ `customized-face' or `saved-face' means the customized spec or
+ the saved custom spec;
+ `face-defface-spec' means the default spec
+ (usually set only via `defface');
+ `reset' means to ignore SPEC, but clear the `customized-face'
+ and `face-override-spec' specs;
+Any other value means not to set any spec, but to run the
+function for its other effects.
+
+In addition to setting the face spec, this function defines FACE
+as a valid face name if it is not already one, and (re)calculates
+the face's attributes on existing frames."
+ (if (get face 'face-alias)
+ (setq face (get face 'face-alias)))
+ ;; Save SPEC to the relevant symbol property.
+ (unless spec-type
+ (setq spec-type 'face-override-spec))
+ (if (memq spec-type '(face-defface-spec face-override-spec
+ customized-face saved-face))
+ (put face spec-type spec))
+ (if (memq spec-type '(reset saved-face))
+ (put face 'customized-face nil))
+ ;; Setting the face spec via Custom empties out any override spec,
+ ;; similar to how setting a variable via Custom changes its values.
+ (if (memq spec-type '(customized-face saved-face reset))
+ (put face 'face-override-spec nil))
+ ;; If we reset the face based on its custom spec, it is unmodified
+ ;; as far as Custom is concerned.
+ (unless (eq face 'face-override-spec)
+ (put face 'face-modified nil))
+ (if (facep face)
+ ;; If the face already exists, recalculate it.
+ (dolist (frame (frame-list))
+ (face-spec-recalc face frame))
+ ;; Otherwise, initialize it on all frames.
+ (make-empty-face face)
+ (let ((value (face-user-default-spec face))
+ (have-window-system (memq initial-window-system '(x w32 ns))))
+ (dolist (frame (frame-list))
+ (face-spec-set-2 face frame value)
+ (when (memq (window-system frame) '(x w32 ns))
+ (setq have-window-system t)))
+ (if have-window-system
+ (make-face-x-resource-internal face)))))
(defun face-spec-recalc (face frame)
"Reset the face attributes of FACE on FRAME according to its specs.
This applies the defface/custom spec first, then the custom theme specs,
then the override spec."
+ (while (get face 'face-alias)
+ (setq face (get face 'face-alias)))
(face-spec-reset-face face frame)
- (let ((face-sym (or (get face 'face-alias) face)))
- (or (get face 'customized-face)
- (get face 'saved-face)
- (face-spec-set-2 face frame (face-default-spec face)))
- (let ((theme-faces (reverse (get face-sym 'theme-face))))
- (dolist (spec theme-faces)
- (face-spec-set-2 face frame (cadr spec))))
- (face-spec-set-2 face frame (get face-sym 'face-override-spec))))
+ ;; If FACE is customized or themed, set the custom spec from
+ ;; `theme-face' records, which completely replace the defface spec
+ ;; rather than inheriting from it.
+ (let ((theme-faces (get face 'theme-face)))
+ (if theme-faces
+ (dolist (spec (reverse theme-faces))
+ (face-spec-set-2 face frame (cadr spec)))
+ (face-spec-set-2 face frame (face-default-spec face))))
+ (face-spec-set-2 face frame (get face 'face-override-spec)))
(defun face-spec-set-2 (face frame spec)
"Set the face attributes of FACE on FRAME according to SPEC."
;; Could just use `url-nonrelative-link' of w3, if loaded.
;; This regexp is not exhaustive, it just matches common cases.
(concat
- "\\`\\("
+ "\\("
"news\\(post\\)?:\\|mailto:\\|file:" ; no host ok
"\\|"
"\\(ftp\\|https?\\|telnet\\|gopher\\|www\\|wais\\)://" ; needs host
(defsubst ffap-url-p (string)
"If STRING looks like an URL, return it (maybe improved), else nil."
- (let ((case-fold-search t))
- (and ffap-url-regexp (string-match ffap-url-regexp string)
- ;; I lied, no improvement:
- string)))
+ (when (and (stringp string) ffap-url-regexp)
+ (let* ((case-fold-search t)
+ (match (string-match ffap-url-regexp string)))
+ (cond ((eq match 0) string)
+ (match (substring string match))))))
;; Broke these out of ffap-fixup-url, for use of ffap-url package.
(defun ffap-url-unwrap-local (url)
(equal (ffap-string-around) "<>")
;; (ffap-user-p name):
(not (string-match "~" (expand-file-name (concat "~" name)))))
- (setq name (concat "mailto:" name))))
-
- (if (ffap-url-p name)
- name)))))
+ (setq name (concat "mailto:" name)))
+ ((ffap-url-p name)))))))
(defvar ffap-gopher-regexp
"^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$"
(let (dir)
;; Tricky: guess may have or be a local directory, like "w3/w3.elc"
;; or "w3/" or "../el/ffap.el" or "../../../"
- (or (ffap-url-p guess)
- (progn
- (or (ffap-file-remote-p guess)
- (setq guess
- (abbreviate-file-name (expand-file-name guess))
- ))
- (setq dir (file-name-directory guess))))
+ (unless (ffap-url-p guess)
+ (unless (ffap-file-remote-p guess)
+ (setq guess
+ (abbreviate-file-name (expand-file-name guess))))
+ (setq dir (file-name-directory guess)))
(let ((minibuffer-completing-file-name t)
(completion-ignore-case read-file-name-completion-ignore-case)
(fnh-elem (cons ffap-url-regexp 'url-file-handler)))
;; other modifications to be lost (e.g. when Tramp gets loaded
;; during the completing-read call).
(setq file-name-handler-alist (delq fnh-elem file-name-handler-alist))))
- ;; Do file substitution like (interactive "F"), suggested by MCOOK.
- (or (ffap-url-p guess) (setq guess (substitute-in-file-name guess)))
- ;; Should not do it on url's, where $ is a common (VMS?) character.
- ;; Note: upcoming url.el package ought to handle this automatically.
- guess))
+ (or (ffap-url-p guess)
+ (substitute-in-file-name guess))))
(defun ffap-read-url-internal (string pred action)
"Complete URLs from history, treating given string as valid."
(t t))))
(defun ffap-read-file-or-url-internal (string pred action)
- (unless string ;Why would this ever happen?
- (setq string default-directory))
- (if (ffap-url-p string)
- (ffap-read-url-internal string pred action)
- (read-file-name-internal string pred action)))
+ (let ((url (ffap-url-p string)))
+ (if url
+ (ffap-read-url-internal url pred action)
+ (read-file-name-internal (or string default-directory) pred action))))
;; The rest of this page is just to work with package complete.el.
;; This code assumes that you load ffap.el after complete.el.
(let (current-prefix-arg) ; we already interpreted it
(call-interactively ffap-file-finder))
(or filename (setq filename (ffap-prompter)))
- (cond
- ((ffap-url-p filename)
- (let (current-prefix-arg) ; w3 2.3.25 bug, reported by KPC
- (funcall ffap-url-fetcher filename)))
- ((and ffap-pass-wildcards-to-dired
- ffap-dired-wildcards
- (string-match ffap-dired-wildcards filename))
- (funcall ffap-directory-finder filename))
- ((and ffap-dired-wildcards
- (string-match ffap-dired-wildcards filename)
- find-file-wildcards
- ;; Check if it's find-file that supports wildcards arg
- (memq ffap-file-finder '(find-file find-alternate-file)))
- (funcall ffap-file-finder (expand-file-name filename) t))
- ((or (not ffap-newfile-prompt)
- (file-exists-p filename)
- (y-or-n-p "File does not exist, create buffer? "))
- (funcall ffap-file-finder
- ;; expand-file-name fixes "~/~/.emacs" bug sent by CHUCKR.
- (expand-file-name filename)))
- ;; User does not want to find a non-existent file:
- ((signal 'file-error (list "Opening file buffer"
- "no such file or directory"
- filename))))))
+ (let ((url (ffap-url-p filename)))
+ (cond
+ (url
+ (let (current-prefix-arg)
+ (funcall ffap-url-fetcher url)))
+ ((and ffap-pass-wildcards-to-dired
+ ffap-dired-wildcards
+ (string-match ffap-dired-wildcards filename))
+ (funcall ffap-directory-finder filename))
+ ((and ffap-dired-wildcards
+ (string-match ffap-dired-wildcards filename)
+ find-file-wildcards
+ ;; Check if it's find-file that supports wildcards arg
+ (memq ffap-file-finder '(find-file find-alternate-file)))
+ (funcall ffap-file-finder (expand-file-name filename) t))
+ ((or (not ffap-newfile-prompt)
+ (file-exists-p filename)
+ (y-or-n-p "File does not exist, create buffer? "))
+ (funcall ffap-file-finder
+ ;; expand-file-name fixes "~/~/.emacs" bug sent by CHUCKR.
+ (expand-file-name filename)))
+ ;; User does not want to find a non-existent file:
+ ((signal 'file-error (list "Opening file buffer"
+ "no such file or directory"
+ filename)))))))
;; Shortcut: allow {M-x ffap} rather than {M-x find-file-at-point}.
;;;###autoload
(let (current-prefix-arg) ; already interpreted
(call-interactively ffap-directory-finder))
(or filename (setq filename (dired-at-point-prompter)))
- (cond
- ((ffap-url-p filename)
- (funcall ffap-url-fetcher filename))
- ((and ffap-dired-wildcards
- (string-match ffap-dired-wildcards filename))
- (funcall ffap-directory-finder filename))
- ((file-exists-p filename)
- (if (file-directory-p filename)
+ (let ((url (ffap-url-p filename)))
+ (cond
+ (url
+ (funcall ffap-url-fetcher url))
+ ((and ffap-dired-wildcards
+ (string-match ffap-dired-wildcards filename))
+ (funcall ffap-directory-finder filename))
+ ((file-exists-p filename)
+ (if (file-directory-p filename)
+ (funcall ffap-directory-finder
+ (expand-file-name filename))
(funcall ffap-directory-finder
- (expand-file-name filename))
- (funcall ffap-directory-finder
- (concat (expand-file-name filename) "*"))))
- ((and (file-writable-p
- (or (file-name-directory (directory-file-name filename))
- filename))
- (y-or-n-p "Directory does not exist, create it? "))
- (make-directory filename)
- (funcall ffap-directory-finder filename))
- ((error "No such file or directory `%s'" filename)))))
+ (concat (expand-file-name filename) "*"))))
+ ((and (file-writable-p
+ (or (file-name-directory (directory-file-name filename))
+ filename))
+ (y-or-n-p "Directory does not exist, create it? "))
+ (make-directory filename)
+ (funcall ffap-directory-finder filename))
+ ((error "No such file or directory `%s'" filename))))))
(defun dired-at-point-prompter (&optional guess)
;; Does guess and prompt step for find-file-at-point.
(ffap-url-regexp "Dired file or URL: ")
(t "Dired file: "))
(prog1
- (setq guess (or guess
- (let ((guess (ffap-guesser)))
- (if (or (not guess)
- (ffap-url-p guess)
- (ffap-file-remote-p guess))
- guess
- (setq guess (abbreviate-file-name
- (expand-file-name guess)))
- (cond
- ;; Interpret local directory as a directory.
- ((file-directory-p guess)
- (file-name-as-directory guess))
- ;; Get directory component from local files.
- ((file-regular-p guess)
- (file-name-directory guess))
- (guess))))
- ))
+ (setq guess
+ (let ((guess (or guess (ffap-guesser))))
+ (cond
+ ((null guess) nil)
+ ((ffap-url-p guess))
+ ((ffap-file-remote-p guess)
+ guess)
+ ((progn
+ (setq guess (abbreviate-file-name
+ (expand-file-name guess)))
+ ;; Interpret local directory as a directory.
+ (file-directory-p guess))
+ (file-name-as-directory guess))
+ ;; Get directory component from local files.
+ ((file-regular-p guess)
+ (file-name-directory guess))
+ (guess))))
(and guess (ffap-highlight))))
(ffap-highlight t)))
\f
(defun ffap-guess-file-name-at-point ()
"Try to get a file name at point.
This hook is intended to be put in `file-name-at-point-functions'."
- (when (fboundp 'ffap-guesser)
- ;; Logic from `ffap-read-file-or-url' and `dired-at-point-prompter'.
- (let ((guess (ffap-guesser)))
- (setq guess
- (if (or (not guess)
- (and (fboundp 'ffap-url-p)
- (ffap-url-p guess))
- (and (fboundp 'ffap-file-remote-p)
- (ffap-file-remote-p guess)))
- guess
- (abbreviate-file-name (expand-file-name guess))))
- (when guess
- (if (file-directory-p guess)
- (file-name-as-directory guess)
- guess)))))
-
+ (let ((guess (ffap-guesser)))
+ (when (stringp guess)
+ (let ((url (ffap-url-p guess)))
+ (or url
+ (progn
+ (unless (ffap-file-remote-p guess)
+ (setq guess
+ (abbreviate-file-name (expand-file-name guess))))
+ (if (file-directory-p guess)
+ (file-name-as-directory guess)
+ guess)))))))
\f
;;; Offer default global bindings (`ffap-bindings'):
;;; Code:
-(eval-when-compile
- (require 'find-lisp))
-
(defgroup file-cache nil
"Find files using a pre-loaded cache."
:group 'files
;; Functions to add files to the cache
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun file-cache--read-list (file op-prompt)
+ (let* ((fun (if file 'read-file-name 'read-directory-name))
+ (type (if file "file" "directory"))
+ (prompt-1 (concat op-prompt " " type ": "))
+ (prompt-2 (concat op-prompt " another " type "?"))
+ (continue t)
+ result)
+ (while continue
+ (push (funcall fun prompt-1 nil nil t) result)
+ (setq continue (y-or-n-p prompt-2)))
+ (nreverse result)))
+
;;;###autoload
(defun file-cache-add-directory (directory &optional regexp)
- "Add DIRECTORY to the file cache.
-If the optional REGEXP argument is non-nil, only files which match it will
-be added to the cache."
- (interactive "DAdd files from directory: ")
+ "Add all files in DIRECTORY to the file cache.
+If called from Lisp with a non-nil REGEXP argument is non-nil,
+only add files whose names match REGEXP."
+ (interactive (list (read-directory-name "Add files from directory: "
+ nil nil t)
+ nil))
;; Not an error, because otherwise we can't use load-paths that
;; contain non-existent directories.
- (if (not (file-accessible-directory-p directory))
- (message "Directory %s does not exist" directory)
+ (when (file-accessible-directory-p directory)
(let* ((dir (expand-file-name directory))
(dir-files (directory-files dir t regexp)))
;; Filter out files we don't want to see
(dolist (file dir-files)
- (if (file-directory-p file)
- (setq dir-files (delq file dir-files))
- (dolist (regexp file-cache-filter-regexps)
- (if (string-match regexp file)
- (setq dir-files (delq file dir-files))))))
+ (if (file-directory-p file)
+ (setq dir-files (delq file dir-files))
+ (dolist (regexp file-cache-filter-regexps)
+ (if (string-match regexp file)
+ (setq dir-files (delq file dir-files))))))
(file-cache-add-file-list dir-files))))
;;;###autoload
-(defun file-cache-add-directory-list (directory-list &optional regexp)
- "Add DIRECTORY-LIST (a list of directory names) to the file cache.
+(defun file-cache-add-directory-list (directories &optional regexp)
+ "Add DIRECTORIES (a list of directory names) to the file cache.
+If called interactively, read the directory names one by one.
If the optional REGEXP argument is non-nil, only files which match it
will be added to the cache. Note that the REGEXP is applied to the
files in each directory, not to the directory list itself."
- (interactive "XAdd files from directory list: ")
- (mapcar
- (lambda (dir) (file-cache-add-directory dir regexp))
- directory-list))
-
-(defun file-cache-add-file-list (file-list)
- "Add FILE-LIST (a list of file names) to the file cache.
-Interactively, FILE-LIST is read as a Lisp expression, which
-should evaluate to the desired list of file names."
- (interactive "XFile List: ")
- (mapcar 'file-cache-add-file file-list))
+ (interactive (list (file-cache--read-list nil "Add")))
+ (dolist (dir directories)
+ (file-cache-add-directory dir regexp))
+ (let ((n (length directories)))
+ (message "Filecache: cached file names from %d director%s."
+ n (if (= n 1) "y" "ies"))))
+
+(defun file-cache-add-file-list (files)
+ "Add FILES (a list of file names) to the file cache.
+If called interactively, read the file names one by one."
+ (interactive (list (file-cache--read-list t "Add")))
+ (dolist (f files)
+ (file-cache-add-file f))
+ (let ((n (length files)))
+ (message "Filecache: cached %d file name%s."
+ n (if (= n 1) "" "s"))))
;; Workhorse function
(defun file-cache-add-file (file)
"Add FILE to the file cache."
(interactive "fAdd File: ")
- (if (not (file-exists-p file))
- (message "Filecache: file %s does not exist" file)
- (let* ((file-name (file-name-nondirectory file))
- (dir-name (file-name-directory file))
- (the-entry (assoc-string
- file-name file-cache-alist
- file-cache-ignore-case)))
- ;; Does the entry exist already?
- (if the-entry
- (if (or (and (stringp (cdr the-entry))
- (string= dir-name (cdr the-entry)))
- (and (listp (cdr the-entry))
- (member dir-name (cdr the-entry))))
- nil
- (setcdr the-entry (cons dir-name (cdr the-entry))))
- ;; If not, add it to the cache
- (push (list file-name dir-name) file-cache-alist)))))
+ (setq file (file-truename file))
+ (unless (file-exists-p file)
+ (error "Filecache: file %s does not exist" file))
+ (let* ((file-name (file-name-nondirectory file))
+ (dir-name (file-name-directory file))
+ (the-entry (assoc-string file-name file-cache-alist
+ file-cache-ignore-case)))
+ (cond ((null the-entry)
+ ;; If the entry wasn't in the cache, add it.
+ (push (list file-name dir-name) file-cache-alist)
+ (if (called-interactively-p 'interactive)
+ (message "Filecache: cached file name %s." file)))
+ ((not (member dir-name (cdr the-entry)))
+ (setcdr the-entry (cons dir-name (cdr the-entry)))
+ (if (called-interactively-p 'interactive)
+ (message "Filecache: cached file name %s." file)))
+ (t
+ (if (called-interactively-p 'interactive)
+ (message "Filecache: %s is already cached." file))))))
;;;###autoload
(defun file-cache-add-directory-using-find (directory)
string)
(file-cache-add-from-file-cache-buffer))
+(autoload 'find-lisp-find-files "find-lisp")
+
;;;###autoload
(defun file-cache-add-directory-recursively (dir &optional regexp)
"Adds DIR and any subdirectories to the file-cache.
will be added to the cache. Note that the REGEXP is applied to the
files in each directory, not to the directory list itself."
(interactive "DAdd directory: ")
- (require 'find-lisp)
(mapcar
- (function
- (lambda (file)
- (or (file-directory-p file)
- (let (filtered)
- (dolist (regexp file-cache-filter-regexps)
- (and (string-match regexp file)
- (setq filtered t)))
- filtered)
- (file-cache-add-file file))))
- (find-lisp-find-files dir (if regexp regexp "^"))))
+ (lambda (file)
+ (or (file-directory-p file)
+ (let (filtered)
+ (dolist (regexp file-cache-filter-regexps)
+ (and (string-match regexp file)
+ (setq filtered t)))
+ filtered)
+ (file-cache-add-file file)))
+ (find-lisp-find-files dir (or regexp "^"))))
(defun file-cache-add-from-file-cache-buffer (&optional regexp)
"Add any entries found in the file cache buffer.
;; This clears *all* files with the given name
(defun file-cache-delete-file (file)
- "Delete FILE from the file cache."
+ "Delete FILE (a relative file name) from the file cache.
+Return nil if FILE was not in the file cache, non-nil otherwise."
(interactive
(list (completing-read "Delete file from cache: " file-cache-alist)))
- (setq file-cache-alist
- (delq (assoc-string file file-cache-alist file-cache-ignore-case)
- file-cache-alist)))
-
-(defun file-cache-delete-file-list (file-list)
- "Delete FILE-LIST (a list of files) from the file cache."
- (interactive "XFile List: ")
- (mapcar 'file-cache-delete-file file-list))
+ (let ((elt (assoc-string file file-cache-alist file-cache-ignore-case)))
+ (setq file-cache-alist (delq elt file-cache-alist))
+ elt))
+
+(defun file-cache-delete-file-list (files &optional message)
+ "Delete FILES (a list of files) from the file cache.
+If called interactively, read the file names one by one.
+If MESSAGE is non-nil, or if called interactively, print a
+message reporting the number of file names deleted."
+ (interactive (list (file-cache--read-list t "Uncache") t))
+ (let ((n 0))
+ (dolist (f files)
+ (if (file-cache-delete-file f)
+ (setq n (1+ n))))
+ (message "Filecache: uncached %d file name%s."
+ n (if (= n 1) "" "s"))))
(defun file-cache-delete-file-regexp (regexp)
"Delete files matching REGEXP from the file cache."
(dolist (elt file-cache-alist)
(and (string-match regexp (car elt))
(push (car elt) delete-list)))
- (file-cache-delete-file-list delete-list)
- (message "Filecache: deleted %d files from file cache"
- (length delete-list))))
+ (file-cache-delete-file-list delete-list)))
(defun file-cache-delete-directory (directory)
"Delete DIRECTORY from the file cache."
(interactive "DDelete directory from file cache: ")
(let ((dir (expand-file-name directory))
- (result 0))
+ (n 0))
(dolist (entry file-cache-alist)
(if (file-cache-do-delete-directory dir entry)
- (setq result (1+ result))))
- (if (zerop result)
- (error "Filecache: no entries containing %s found in cache" directory)
- (message "Filecache: deleted %d entries" result))))
+ (setq n (1+ n))))
+ (message "Filecache: uncached %d file name%s."
+ n (if (= n 1) "" "s"))))
(defun file-cache-do-delete-directory (dir entry)
(let ((directory-list (cdr entry))
(delq entry file-cache-alist))
(setcdr entry (delete directory directory-list))))))
-(defun file-cache-delete-directory-list (directory-list)
- "Delete DIRECTORY-LIST (a list of directories) from the file cache."
- (interactive "XDirectory List: ")
- (mapcar 'file-cache-delete-directory directory-list))
+(defun file-cache-delete-directory-list (directories)
+ "Delete DIRECTORIES (a list of directory names) from the file cache.
+If called interactively, read the directory names one by one."
+ (interactive (list (file-cache--read-list nil "Uncache")))
+ (dolist (d directories)
+ (file-cache-delete-directory d)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Utility functions
(declare-function dired-unmark "dired" (arg))
(declare-function dired-do-flagged-delete "dired" (&optional nomessage))
(declare-function dos-8+3-filename "dos-fns" (filename))
-(declare-function view-mode-disable "view" ())
(declare-function dosified-file-name "dos-fns" (file-name))
(defvar file-name-invalid-regexp
;; This is a case where .elc makes a lot of sense.
(interactive (list (let ((completion-ignored-extensions
(remove ".elc" completion-ignored-extensions)))
- (read-file-name "Load file: "))))
+ (read-file-name "Load file: " nil nil 'lambda))))
(load (expand-file-name file) nil nil t))
(defun locate-file (filename path &optional suffixes predicate)
(setq buffer-read-only t))
(unless nomodes
(when (and view-read-only view-mode)
- (view-mode-disable))
+ (view-mode -1))
(normal-mode t)
;; If requested, add a newline at the end of the file.
(and (memq require-final-newline '(visit visit-save))
specifications, but are not really, or they may be containers for
member files with their own local variable sections, which are
not appropriate for the containing file.
-See also `inhibit-local-variables-suffixes'.")
+The function `inhibit-local-variables-p' uses this.")
(define-obsolete-variable-alias 'inhibit-first-line-modes-suffixes
'inhibit-local-variables-suffixes "24.1")
(defvar inhibit-local-variables-suffixes nil
"List of regexps matching suffixes to remove from file names.
-When checking `inhibit-local-variables-regexps', we first discard
-from the end of the file name anything that matches one of these regexps.")
+The function `inhibit-local-variables-p' uses this: when checking
+a file name, it first discards from the end of the name anything that
+matches one of these regexps.")
+
+;; Can't think of any situation in which you'd want this to be nil...
+(defvar inhibit-local-variables-ignore-case t
+ "Non-nil means `inhibit-local-variables-p' ignores case.")
-;; TODO explicitly add case-fold-search t?
(defun inhibit-local-variables-p ()
"Return non-nil if file local variables should be ignored.
This checks the file (or buffer) name against `inhibit-local-variables-regexps'
-and `inhibit-local-variables-suffixes'."
+and `inhibit-local-variables-suffixes'. If
+`inhibit-local-variables-ignore-case' is non-nil, this ignores case."
(let ((temp inhibit-local-variables-regexps)
(name (if buffer-file-name
(file-name-sans-versions buffer-file-name)
- (buffer-name))))
+ (buffer-name)))
+ (case-fold-search inhibit-local-variables-ignore-case))
(while (let ((sufs inhibit-local-variables-suffixes))
(while (and sufs (not (string-match (car sufs) name)))
(setq sufs (cdr sufs)))
(setq ok t)))
ok))))))))
+(defun hack-one-local-variable--obsolete (var)
+ (let ((o (get var 'byte-obsolete-variable)))
+ (when o
+ (let ((instead (nth 0 o))
+ (since (nth 2 o)))
+ (message "%s is obsolete%s; %s"
+ var (if since (format " (since %s)" since))
+ (if (stringp instead) instead
+ (format "use `%s' instead" instead)))))))
+
(defun hack-one-local-variable (var val)
"Set local variable VAR with value VAL.
If VAR is `mode', call `VAL-mode' as a function unless it's
already the major mode."
- (cond ((eq var 'mode)
- (let ((mode (intern (concat (downcase (symbol-name val))
- "-mode"))))
- (unless (eq (indirect-function mode)
- (indirect-function major-mode))
- (if (memq mode minor-mode-list)
- ;; A minor mode must be passed an argument.
- ;; Otherwise, if the user enables the minor mode in a
- ;; major mode hook, this would toggle it off.
- (funcall mode 1)
- (funcall mode)))))
- ((eq var 'eval)
- (save-excursion (eval val)))
- (t
- ;; Make sure the string has no text properties.
- ;; Some text properties can get evaluated in various ways,
- ;; so it is risky to put them on with a local variable list.
- (if (stringp val)
- (set-text-properties 0 (length val) nil val))
- (set (make-local-variable var) val))))
+ (pcase var
+ (`mode
+ (let ((mode (intern (concat (downcase (symbol-name val))
+ "-mode"))))
+ (unless (eq (indirect-function mode)
+ (indirect-function major-mode))
+ (funcall mode))))
+ (`eval
+ (pcase val
+ (`(add-hook ',hook . ,_) (hack-one-local-variable--obsolete hook)))
+ (save-excursion (eval val)))
+ (_
+ (hack-one-local-variable--obsolete var)
+ ;; Make sure the string has no text properties.
+ ;; Some text properties can get evaluated in various ways,
+ ;; so it is risky to put them on with a local variable list.
+ (if (stringp val)
+ (set-text-properties 0 (length val) nil val))
+ (set (make-local-variable var) val))))
\f
;;; Handling directory-local variables, aka project settings.
(dir-locals-get-class-variables class) dir-name nil)))
(when variables
(dolist (elt variables)
- (unless (memq (car elt) '(eval mode))
- (setq dir-local-variables-alist
- (assq-delete-all (car elt) dir-local-variables-alist)))
- (push elt dir-local-variables-alist))
+ (if (eq (car elt) 'coding)
+ (display-warning :warning
+ "Coding cannot be specified by dir-locals")
+ (unless (memq (car elt) '(eval mode))
+ (setq dir-local-variables-alist
+ (assq-delete-all (car elt) dir-local-variables-alist)))
+ (push elt dir-local-variables-alist)))
(hack-local-variables-filter variables dir-name)))))))
(defun hack-dir-local-variables-non-file-buffer ()
;; the one at the old location.
(vc-find-file-hook))
\f
+(defun file-extended-attributes (filename)
+ "Return an alist of extended attributes of file FILENAME.
+
+Extended attributes are platform-specific metadata about the file,
+such as SELinux context, list of ACL entries, etc."
+ `((acl . ,(file-acl filename))
+ (selinux-context . ,(file-selinux-context filename))))
+
+(defun set-file-extended-attributes (filename attributes)
+ "Set extended attributes of file FILENAME to ATTRIBUTES.
+
+ATTRIBUTES must be an alist of file attributes as returned by
+`file-extended-attributes'."
+ (dolist (elt attributes)
+ (let ((attr (car elt))
+ (val (cdr elt)))
+ (cond ((eq attr 'acl)
+ (set-file-acl filename val))
+ ((eq attr 'selinux-context)
+ (set-file-selinux-context filename val))))))
+\f
(defun backup-buffer ()
"Make a backup of the disk file visited by the current buffer, if appropriate.
This is normally done before saving the buffer the first time.
no longer accessible under its old name.
The value is non-nil after a backup was made by renaming.
-It has the form (MODES SELINUXCONTEXT BACKUPNAME).
+It has the form (MODES EXTENDED-ATTRIBUTES BACKUPNAME).
MODES is the result of `file-modes' on the original
file; this means that the caller, after saving the buffer, should change
the modes of the new file to agree with the old modes.
-SELINUXCONTEXT is the result of `file-selinux-context' on the original
-file; this means that the caller, after saving the buffer, should change
-the SELinux context of the new file to agree with the old context.
+EXTENDED-ATTRIBUTES is the result of `file-extended-attributes'
+on the original file; this means that the caller, after saving
+the buffer, should change the extended attributes of the new file
+to agree with the old attributes.
BACKUPNAME is the backup file name, which is the old file renamed."
(if (and make-backup-files (not backup-inhibited)
(not buffer-backed-up)
(y-or-n-p (format "Delete excess backup versions of %s? "
real-file-name)))))
(modes (file-modes buffer-file-name))
- (context (file-selinux-context buffer-file-name)))
+ (extended-attributes
+ (file-extended-attributes buffer-file-name)))
;; Actually write the back up file.
(condition-case ()
(if (or file-precious-flag
(and (integerp (nth 2 attr))
(integerp backup-by-copying-when-privileged-mismatch)
(<= (nth 2 attr) backup-by-copying-when-privileged-mismatch)))
- (or (nth 9 attr)
- (not (file-ownership-preserved-p real-file-name)))))))
- (backup-buffer-copy real-file-name backupname modes context)
+ (not (file-ownership-preserved-p
+ real-file-name t))))))
+ (backup-buffer-copy real-file-name
+ backupname modes
+ extended-attributes)
;; rename-file should delete old backup.
(rename-file real-file-name backupname t)
- (setq setmodes (list modes context backupname)))
+ (setq setmodes (list modes extended-attributes
+ backupname)))
(file-error
;; If trouble writing the backup, write it in
;; .emacs.d/%backup%.
(message "Cannot write backup file; backing up in %s"
backupname)
(sleep-for 1)
- (backup-buffer-copy real-file-name backupname modes context)))
+ (backup-buffer-copy real-file-name backupname
+ modes extended-attributes)))
(setq buffer-backed-up t)
;; Now delete the old versions, if desired.
(if delete-old-versions
setmodes)
(file-error nil))))))
-(defun backup-buffer-copy (from-name to-name modes context)
+(defun backup-buffer-copy (from-name to-name modes extended-attributes)
(let ((umask (default-file-modes)))
(unwind-protect
(progn
nil)))
;; Reset the umask.
(set-default-file-modes umask)))
- (and modes
- (set-file-modes to-name (logand modes #o1777)))
- (and context
- (set-file-selinux-context to-name context)))
+ ;; If set-file-extended-attributes fails, fall back on set-file-modes.
+ (unless (and extended-attributes
+ (with-demoted-errors
+ (set-file-extended-attributes to-name extended-attributes)))
+ (and modes
+ (set-file-modes to-name (logand modes #o1777)))))
(defvar file-name-version-regexp
"\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(?:~[[:digit:]]+\\)?~\\)"
(string-match (concat file-name-version-regexp "\\'")
name))))))
-(defun file-ownership-preserved-p (file)
- "Return t if deleting FILE and rewriting it would preserve the owner."
+(defun file-ownership-preserved-p (file &optional group)
+ "Return t if deleting FILE and rewriting it would preserve the owner.
+Return nil if FILE does not exist, or if deleting and recreating it
+might not preserve the owner. If GROUP is non-nil, check whether
+the group would be preserved too."
(let ((handler (find-file-name-handler file 'file-ownership-preserved-p)))
(if handler
- (funcall handler 'file-ownership-preserved-p file)
+ (funcall handler 'file-ownership-preserved-p file group)
(let ((attributes (file-attributes file 'integer)))
;; Return t if the file doesn't exist, since it's true that no
;; information would be lost by an (attempted) delete and create.
(or (null attributes)
- (= (nth 2 attributes) (user-uid))
- ;; Files created on Windows by Administrator (RID=500)
- ;; have the Administrators group (RID=544) recorded as
- ;; their owner. Rewriting them will still preserve the
- ;; owner.
- (and (eq system-type 'windows-nt)
- (= (user-uid) 500) (= (nth 2 attributes) 544)))))))
+ (and (or (= (nth 2 attributes) (user-uid))
+ ;; Files created on Windows by Administrator (RID=500)
+ ;; have the Administrators group (RID=544) recorded as
+ ;; their owner. Rewriting them will still preserve the
+ ;; owner.
+ (and (eq system-type 'windows-nt)
+ (= (user-uid) 500) (= (nth 2 attributes) 544)))
+ (or (not group)
+ ;; On BSD-derived systems files always inherit the parent
+ ;; directory's group, so skip the group-gid test.
+ (memq system-type '(berkeley-unix darwin gnu/kfreebsd))
+ (= (nth 3 attributes) (group-gid)))
+ (let* ((parent (or (file-name-directory file) "."))
+ (parent-attributes (file-attributes parent 'integer)))
+ (and parent-attributes
+ ;; On some systems, a file created in a setuid directory
+ ;; inherits that directory's owner.
+ (or
+ (= (nth 2 parent-attributes) (user-uid))
+ (string-match "^...[^sS]" (nth 8 parent-attributes)))
+ ;; On many systems, a file created in a setgid directory
+ ;; inherits that directory's group. On some systems
+ ;; this happens even if the setgid bit is not set.
+ (or (not group)
+ (= (nth 3 parent-attributes)
+ (nth 3 attributes)))))))))))
(defun file-name-sans-extension (filename)
"Return FILENAME sans final \"extension\".
(if setmodes
(condition-case ()
(progn
- (set-file-modes buffer-file-name (car setmodes))
- (set-file-selinux-context buffer-file-name (nth 1 setmodes)))
+ (unless
+ (with-demoted-errors
+ (set-file-modes buffer-file-name (car setmodes)))
+ (set-file-extended-attributes buffer-file-name
+ (nth 1 setmodes))))
(error nil))))
;; If the auto-save file was recent before this command,
;; delete it now.
;; This does the "real job" of writing a buffer into its visited file
;; and making a backup file. This is what is normally done
;; but inhibited if one of write-file-functions returns non-nil.
-;; It returns a value (MODES SELINUXCONTEXT BACKUPNAME), like backup-buffer.
+;; It returns a value (MODES EXTENDED-ATTRIBUTES BACKUPNAME), like
+;; backup-buffer.
(defun basic-save-buffer-1 ()
(prog1
(if save-buffer-coding-system
(setq buffer-file-coding-system-explicit
(cons last-coding-system-used nil)))))
-;; This returns a value (MODES SELINUXCONTEXT BACKUPNAME), like backup-buffer.
+;; This returns a value (MODES EXTENDED-ATTRIBUTES BACKUPNAME), like
+;; backup-buffer.
(defun basic-save-buffer-2 ()
(let (tempsetmodes setmodes)
(if (not (file-writable-p buffer-file-name))
(setq setmodes (or setmodes
(list (or (file-modes buffer-file-name)
(logand ?\666 umask))
- (file-selinux-context buffer-file-name)
+ (file-extended-attributes buffer-file-name)
buffer-file-name)))
;; We succeeded in writing the temp file,
;; so rename it.
(cond ((and tempsetmodes (not setmodes))
;; Change the mode back, after writing.
(setq setmodes (list (file-modes buffer-file-name)
- (file-selinux-context buffer-file-name)
+ (file-extended-attributes buffer-file-name)
buffer-file-name))
- (set-file-modes buffer-file-name (logior (car setmodes) 128))
- (set-file-selinux-context buffer-file-name (nth 1 setmodes)))))
+ ;; If set-file-extended-attributes fails, fall back on
+ ;; set-file-modes.
+ (unless
+ (with-demoted-errors
+ (set-file-extended-attributes buffer-file-name
+ (nth 1 setmodes)))
+ (set-file-modes buffer-file-name
+ (logior (car setmodes) 128))))))
(let (success)
(unwind-protect
(progn
(let ((ls-lisp-support-shell-wildcards t))
(dired (concat auto-save-list-file-prefix "*")
(concat dired-listing-switches " -t")))
+ (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
+ (define-key (current-local-map) "\C-c\C-c" 'recover-session-finish)
(save-excursion
(goto-char (point-min))
(or (looking-at " Move to the session you want to recover,")
(let ((inhibit-read-only t))
;; Each line starts with a space
;; so that Font Lock mode won't highlight the first character.
- (insert " Move to the session you want to recover,\n"
- " then type C-c C-c to select it.\n\n"
- " You can also delete some of these files;\n"
- " type d on a line to mark that file for deletion.\n\n"))))
- (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
- (define-key (current-local-map) "\C-c\C-c" 'recover-session-finish))
+ (insert " To recover a session, move to it and type C-c C-c.\n"
+ (substitute-command-keys
+ " To delete a session file, type \
+\\[dired-flag-file-deletion] on its line to flag
+ the file for deletion, then \\[dired-do-flagged-delete] to \
+delete flagged files.\n\n"))))))
(defun recover-session-finish ()
"Choose one saved session to recover auto-save files from.
(defun auto-save-file-name-p (filename)
"Return non-nil if FILENAME can be yielded by `make-auto-save-file-name'.
FILENAME should lack slashes. You can redefine this for customization."
- (string-match "^#.*#$" filename))
+ (string-match "\\`#.*#\\'" filename))
\f
(defun wildcard-to-regexp (wildcard)
"Given a shell file name pattern WILDCARD, return an equivalent regexp.
(cnewer . (1))
(ctime . (1))
(empty . (0))
+ (executable . (0))
(false . (0))
(fstype . (1))
(gid . (1))
(ilname . (1))
(iname . (1))
(inum . (1))
- (iwholename . (1))
+ (ipath . (1))
(iregex . (1))
+ (iwholename . (1))
(links . (1))
(lname . (1))
(mmin . (1))
(mtime . (1))
(name . (1))
(newer . (1))
- (nouser . (0))
(nogroup . (0))
+ (nouser . (0))
(path . (1))
(perm . (0))
+ (readable . (0))
(regex . (1))
- (wholename . (1))
+ (samefile . (1))
(size . (1))
(true . (0))
(type . (1))
(uid . (1))
(used . (1))
(user . (1))
+ (wholename . (1))
+ (writable . (0))
(xtype . (nil))
;; normal options (always true)
+ (daystart . (0))
(depth . (0))
(maxdepth . (1))
(mindepth . (1))
(mount . (0))
(noleaf . (0))
- (xdev . (0))
(ignore_readdir_race . (0))
(noignore_readdir_race . (0))
+ (regextype . (1))
+ (xdev . (0))
;; actions
(delete . (0))
blink-cursor-delay
'blink-cursor-start))))
+\f
+;; Frame maximization/fullscreen
+
+(defun toggle-frame-maximized ()
+ "Toggle maximization state of the selected frame.
+Maximize the selected frame or un-maximize if it is already maximized.
+Respect window manager screen decorations.
+If the frame is in fullscreen mode, don't change its mode,
+just toggle the temporary frame parameter `maximized',
+so the frame will go to the right maximization state
+after disabling fullscreen mode.
+See also `toggle-frame-fullscreen'."
+ (interactive)
+ (if (eq (frame-parameter nil 'fullscreen) 'fullscreen)
+ (modify-frame-parameters
+ nil
+ `((maximized
+ . ,(unless (eq (frame-parameter nil 'maximized) 'maximized)
+ 'maximized))))
+ (modify-frame-parameters
+ nil
+ `((fullscreen
+ . ,(unless (eq (frame-parameter nil 'fullscreen) 'maximized)
+ 'maximized))))))
+
+(defun toggle-frame-fullscreen ()
+ "Toggle fullscreen mode of the selected frame.
+Enable fullscreen mode of the selected frame or disable if it is
+already fullscreen. Ignore window manager screen decorations.
+When turning on fullscreen mode, remember the previous value of the
+maximization state in the temporary frame parameter `maximized'.
+Restore the maximization state when turning off fullscreen mode.
+See also `toggle-frame-maximized'."
+ (interactive)
+ (modify-frame-parameters
+ nil
+ `((maximized
+ . ,(unless (eq (frame-parameter nil 'fullscreen) 'fullscreen)
+ (frame-parameter nil 'fullscreen)))
+ (fullscreen
+ . ,(if (eq (frame-parameter nil 'fullscreen) 'fullscreen)
+ (if (eq (frame-parameter nil 'maximized) 'maximized)
+ 'maximized)
+ 'fullscreen)))))
+
\f
;;;; Key bindings
(define-key ctl-x-5-map "1" 'delete-other-frames)
(define-key ctl-x-5-map "0" 'delete-frame)
(define-key ctl-x-5-map "o" 'other-frame)
+(define-key global-map [f11] 'toggle-frame-fullscreen)
+(define-key global-map [(meta f10)] 'toggle-frame-maximized)
\f
;; Misc.
(concat (w32-shell-name) " -c " (buffer-file-name)))))
(eval-when-compile (require 'comint))
+(declare-function comint-mode "comint" ())
+(declare-function comint-exec "comint" (buffer name command startfile switches))
+
(defun bat-generic-mode-run-as-comint ()
"Run the current BAT file in a comint buffer."
(interactive)
+2013-01-09 Daiki Ueno <ueno@gnu.org>
+
+ * mml-smime.el (epg-sub-key-fingerprint): Autoload for
+ mml-smime-epg-find-usable-secret-key.
+
+2013-01-08 Glenn Morris <rgm@gnu.org>
+
+ * mml-smime.el (mml-smime-sign-with-sender): Add :version.
+
+2013-01-07 Daiki Ueno <ueno@gnu.org>
+
+ * mml-smime.el: Support signing by sender.
+ Requested by Uwe Brauer.
+ (mml-smime-sign-with-sender): New user option analogous
+ to mml2015-sign-with-sender.
+ (mml-smime-epg-sign): Respect mml-smime-sign-with-sender.
+ (mml-smime-epg-find-usable-secret-key): New helper function copied from
+ mml2015.el.
+
+2012-12-31 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-msg.el (gnus-inews-insert-gcc): Don't insert Gcc headers if Gnus
+ isn't running, because Gnus will probably not know how to handle the
+ Gcc header (bug#11941).
+
+ * nnimap.el (nnimap-update-info): Treat \Deleted articles as \Read
+ articles.
+
+2012-12-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * nnfolder.el (nnfolder-recursive-directory-files): New function.
+ (nnfolder-generate-active-file): Make this function work with recursive
+ folder names.
+
+2012-12-27 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * nntp.el (nntp-open-connection): Use HELP as the capability command
+ instead of CAPABILITY because Typhoon v2.2.2.503 chokes completely on
+ unknown commands. And CAPABILITY is an unknown command (bug#12763).
+
+2012-12-27 Wolfgang Jenkner <wjenkner@inode.at>
+
+ * gnus-spec.el (gnus-face-face-function): Don't use nil as no-op face
+ place holder since this gives `Invalid face reference: nil' messages.
+ Use the `default' face instead. It has the same effect here, even
+ though it is not no-op.
+
+ * gnus-util.el
+ (gnus-put-text-property-excluding-characters-with-faces): Similarly.
+
2012-12-27 Lars Ingebrigtsen <larsi@gnus.org>
* gnus-msg.el (gnus-summary-resend-message): Don't bug out on
2012-12-27 Glenn Morris <rgm@gnu.org>
* plstore.el (plstore-passphrase-callback-function):
- Fix file/buffer typo. (Bug#13264)
+ Use plstore-get-file.
+
+2012-12-27 Andreas Schwab <schwab@linux-m68k.org>
-2012-12-24 Andreas Schwab <schwab@linux-m68k.org>
+ * mml2015.el (mml2015-epg-key-image): Separate attribute stream from
+ stderr.
* nnimap.el (nnimap-find-article-by-message-id): Don't error out if
group is nil.
-2012-12-23 Andreas Schwab <schwab@linux-m68k.org>
-
* shr.el (shr-tag-em): Render as italic, not bold.
-2012-12-02 Andreas Schwab <schwab@linux-m68k.org>
+2012-12-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mml2015.el (mml2015-epg-key-image): Use mm-set-buffer-multibyte.
+
+2012-12-25 Adam Sjøgren <asjo@koldfront.dk>
+
+ * mml2015.el (mml2015-epg-key-image): use --attribute-fd rather than
+ temporary file to get PGP key image. Pass no-show-photos when extracting
+ image to avoid having it pop up twice.
+
+2012-12-26 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el (gnus-article-treat-types): Include text/html as parts
+ eligible for treatment.
+
+ * gnus-util.el (gnus-goto-colon): Move to the beginning of the visual
+ lines. This makes summary commands with hidden threads work more
+ reliably.
+
+ * gnus-cite.el (gnus-article-hide-citation-maybe): Leave an expansion
+ button to mark the hidden citations (bug#9395).
+
+2012-12-26 Daiki Ueno <ueno@gnu.org>
+
+ * mml2015.el (mml2015-epg-signature-to-string): New function.
+ (mml2015-epg-verify-result-to-string): New function.
+ (mml2015-epg-decrypt, mml2015-epg-clear-decrypt, mml2015-epg-verify)
+ (mml2015-epg-clear-verify): Use mml2015-epg-verify-result-to-string
+ instead of epg-verify-result-to-string.
+ (epg-signature-key-id, epg-signature-to-string): Autoload.
+ (epg-verify-result-to-string): Remove autoload.
+
+2012-12-25 Adam Sjøgren <asjo@koldfront.dk>
+
+ * mml2015.el (mml2015-epg-key-image): New function, to retrieve photo
+ ID image from GPG public key.
+ (mml2015-epg-key-image-to-string): New function.
+
+2012-12-25 Leo Liu <sdl.web@gmail.com>
+
+ * plstore.el (plstore-passphrase-callback-function): Fix error when
+ error when plstore-cache-passphrase-for-symmetric-encryption is set
+ (bug#13264).
+
+2012-12-25 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-sum.el (gnus-set-global-variables): Don't copy over the summary
+ buffer to the article buffer here, because that clobbers multiple
+ article buffers.
+
+ * gnus-art.el (gnus-article-setup-buffer): Make sure that the article
+ buffer always points to the right summary buffer.
+
+2012-12-25 John Wiegley <jwiegley@gmail.com>
+
+ * auth-source.el (auth-source-netrc-parse): Allow using "password" as
+ the password (bug#12097).
+
+2012-12-25 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * shr.el (shr-tag-a): Don't tagify <A> elements that don't have HREFs
+ (bug#13263).
+
+ * gnus-salt.el (gnus-highlight-selected-tree): Check whether the Tree
+ buffer exists before using it (bug#12475).
+
+ * gnus-agent.el (gnus-agent-fetch-articles): Don't fetch articles from
+ offline groups (bug#11937).
+
+ * message.el (message-yank-original): When using customize to set the
+ value of `message-cite-style', the variable it set to a symbol that's
+ the name of the variable, which must then be dereferenced (bug#12616).
+
+2012-12-25 Wolfgang Jenkner <wjenkner@inode.at>
+
+ * lisp/gnus-spec.el (gnus-face-face-function): Initialize the value of
+ the `face' property with a list whose car is the face specified in the
+ format string and whose cdr is (nil).
+ * lisp/gnus-util.el
+ (gnus-put-text-property-excluding-characters-with-faces): Change
+ accordingly.
+ (gnus-get-text-property-excluding-characters-with-faces): New function.
+ * lisp/gnus-sum.el (gnus-summary-highlight-line):
+ * lisp/gnus-salt.el (gnus-tree-highlight-node):
+ * lisp/gnus-group.el (gnus-group-highlight-line): Use it.
+
+2012-12-25 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * nnimap.el (nnimap-authenticator): Expand to allow specifying the
+ login methods.
+ (nnimap-login): Respect the `nnimap-authenticator' variable.
+
+ * gnus-sum.el (gnus-summary-push-marks-to-backend): Push the complete
+ mark state when moving articles. Otherwise unticked articles will get
+ their ticks back after moving.
+
+2012-12-24 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-srvr.el (gnus-browse-delete-group): Fix syntax error.
+
+ * message.el (message-ignored-news-headers): Always remove
+ X-Message-SMTP-Method to avoid information leakage if the user
+ mistakenly inserts the header into news messages.
+
+ * gnus-srvr.el (gnus-browse-delete-group): New command and keystroke.
+
+ * gnus-sum.el (gnus-summary-hide-thread): If point were further to the
+ right than four characters, this command would move point to
+ `point-max'. Don't do that.
+
+ * gnus-group.el (gnus-group-read-ephemeral-group): Set the active data
+ to nil to allow re-selecting groups that gain articles.
+ (gnus-bug-group-download-format-alist): Update the URL.
+
+2012-12-23 Andreas Schwab <schwab@suse.de>
+
+ * shr.el (shr-tag-em): Render em as italic, not bold.
+
+2012-12-23 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-int.el (gnus-backend-trace): Factor out into its own function
+ for reuse.
+ (gnus-open-server): Use it to add more tracing.
+ (gnus-finish-retrieve-group-infos): Add backend tracing.
+ (gnus-backend-trace): Also note the elapsed seconds.
+
+2012-12-22 Philipp Haselwarter <philipp@haselwarter.org>
+
+ * gnus-sync.el (gnus-sync-file-encrypt-to, gnus-sync-save): Set
+ epa-file-encrypt-to from variable to avoid querying.
+
+2012-12-14 Akinori MUSHA <knu@iDaemons.org> (tiny change)
+
+ * sieve-mode.el (sieve-font-lock-keywords):
+ Keywords should be word delimited. (Bug#13173)
+
+2012-12-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-article-browse-html-parts): Use <div align="left">
+ instead of <pre> to align message header.
+
+2012-12-12 Sam Steingold <sds@gnu.org>
+
+ * gnus.el (gnus-other-frame-resume-function): Add user option.
+ (gnus-other-frame): Call `gnus-other-frame-resume-function' on resume.
+
+2012-12-06 Sam Steingold <sds@gnu.org>
+
+ * gnus-start.el (gnus-before-resume-hook): Add.
+ (gnus-1): Run it when Gnus is alive.
+
+2012-12-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gmm-utils.el (gmm-called-interactively-p): Restore as a macro.
+ * gnus-art.el (article-unsplit-urls)
+ * gnus-bookmark.el (gnus-bookmark-bmenu-list)
+ * gnus-registry.el (gnus-registry-get-article-marks)
+ * message.el (message-goto-body): Use it.
+ (message-called-interactively-p): Remove.
+
+ * spam-stat.el (spam-stat-called-interactively-p): New macro.
+ (spam-stat-score-buffer): Use it.
+
+ * spam.el: Silence the warnings against BBDB functions when compiling.
+
+ * gnus-score.el (gnus-score-decode-text-parts):
+ Use append+mapcar instead of the cl function mapcan.
+
+ * gmm-utils.el (gmm-flet): Remove.
+
+ * gnus-sync.el (gnus-sync-lesync-call):
+ Avoid overriding json-alist-p.
+
+ * message.el (message-read-from-minibuffer):
+ Avoid overriding mail-abbrev-in-expansion-header-p.
+
+2012-12-05 Sam Steingold <sds@gnu.org>
+
+ * gnus.el (gnus-delete-gnus-frame): Extract from `gnus-other-frame'.
+ (gnus-other-frame): Add `gnus-delete-gnus-frame' to
+ `gnus-suspend-gnus-hook' in addition to `gnus-exit-gnus-hook'.
+
+2012-12-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gmm-utils.el (gmm-called-interactively-p): Revert.
+ This seems to cause Emacs to get stuck!
+ * gnus-art.el (article-unsplit-urls)
+ * gnus-bookmark.el (gnus-bookmark-bmenu-list)
+ * gnus-registry.el (gnus-registry-get-article-marks)
+ * message.el (message-goto-body)
+ (message-called-interactively-p): Revert.
+
+ * gmm-utils.el (gmm-called-interactively-p): New function.
+ * gnus-art.el (article-unsplit-urls)
+ * gnus-bookmark.el (gnus-bookmark-bmenu-list)
+ * gnus-registry.el (gnus-registry-get-article-marks)
+ * message.el (message-goto-body): Use it.
+ (message-called-interactively-p): Remove.
+
+ * gmm-utils.el (gmm-flet): Restore it using cl-letf.
+ * gnus-sync.el (gnus-sync-lesync-call)
+ * message.el (message-read-from-minibuffer): Use it.
+
+2012-12-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gmm-utils.el (gmm-flet): Remove.
+ * gnus-sync.el (gnus-sync-lesync-call)
+ * message.el (message-read-from-minibuffer): Don't use it.
+
+2012-12-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gmm-utils.el (gmm-labels): Use cl-labels if available.
+
+2012-12-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gmm-utils.el (gmm-flet, gmm-labels): New macros.
+
+ * gnus-sync.el (gnus-sync-lesync-call)
+ * message.el (message-read-from-minibuffer): Use gmm-flet.
+
+ * gnus-score.el (gnus-score-decode-text-parts): Use gmm-labels.
+
+ * gnus-util.el (gnus-macroexpand-all): Remove.
+
+2012-12-03 Andreas Schwab <schwab@linux-m68k.org>
* gnus-sum.el (gnus-summary-mode-map): Bind gnus-summary-widget-forward
to TAB, not [tab].
* gnus-sync.el (gnus-sync-newsrc-offsets): Restore definition.
(gnus-sync-save): Use correct format for gnus-sync-newsrc-loader.
+2012-11-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * message.el (message-get-reply-headers):
+ Make sure the reply goes to the author if it is a wide reply.
+
2012-11-16 Jan Tatarik <jan.tatarik@gmail.com>
* gnus-score.el (gnus-score-body):
* gnus-logic.el (gnus-advanced-body): Don't score by headers when
scoring by body.
-2012-11-13 Glenn Morris <rgm@gnu.org>
+2012-11-16 Glenn Morris <rgm@gnu.org>
* gnus-diary.el (nndiary-request-create-group-functions)
(nndiary-request-update-info-functions)
(nndiary-request-accept-article-functions):
Use new names for hooks rather than obsolete aliases.
+2012-11-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-article-browse-html-parts): Always replace charset
+ in meta tag with the one the part specifies in its header.
+
+2012-11-02 Stephen Eglen <S.J.Eglen@damtp.cam.ac.uk>
+
+ * gnus-dired.el (gnus-dired-attach): Attach to last used message buffer
+ by default.
+
+2012-11-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ New UIDL implementation.
+
+ * mail-source.el (mail-sources, mail-source-keyword-map):
+ Add :leave as a pop3 keyword.
+ (mail-source-fetch-pop): Bind pop3-leave-mail-on-server.
+
+ * pop3.el (pop3-leave-mail-on-server): Allow number.
+ (pop3-uidl-file, pop3-uidl-file-backup): New user options.
+ (pop3-movemail): Add UIDL support.
+ (pop3-send-streaming-command): Take a list of mail numbers instead of
+ the number of mails.
+ (pop3-write-to-file): Add X-UIDL header.
+ (pop3-uidl-stat, pop3-uidl-dele, pop3-uidl-load, pop3-uidl-save)
+ (pop3-uidl-add-xheader): New functions.
+
+ * message.el (message-ignored-resent-headers):
+ Add X-Content-Length and X-UIDL headers.
+
2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
* nndiary.el (nndiary-request-create-group-functions)
(while (and (zerop (forward-line 1))
(looking-at "$")))
(narrow-to-region (point) (point)))
- ((member elem tokens)
+ ((and (member elem tokens) (null pair))
;; Tokens that don't have a following value are ignored,
;; except "default".
(when (and pair (or (cdr pair)
(write-region start end filename append visit lockname))
(write-region start end filename append visit lockname mustbenew)))
+;; `interactive-p' is obsolete since Emacs 23.2.
+(defmacro gmm-called-interactively-p (kind)
+ (condition-case nil
+ (progn
+ (eval '(called-interactively-p 'any))
+ ;; Emacs >=23.2
+ `(called-interactively-p ,kind))
+ ;; Emacs <23.2
+ (wrong-number-of-arguments '(called-interactively-p))
+ ;; XEmacs
+ (void-function '(interactive-p))))
+
+;; `labels' is obsolete since Emacs 24.3.
+(defmacro gmm-labels (bindings &rest body)
+ "Make temporary function bindings.
+The bindings can be recursive and the scoping is lexical, but capturing
+them in closures will only work if `lexical-binding' is in use. But in
+Emacs 24.2 and older, the lexical scoping is handled via `lexical-let'
+rather than relying on `lexical-binding'.
+
+\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
+ `(,(progn (require 'cl) (if (fboundp 'cl-labels) 'cl-labels 'labels))
+ ,bindings ,@body))
+(put 'gmm-labels 'lisp-indent-function 1)
+
(provide 'gmm-utils)
;;; gmm-utils.el ends here
(defun gnus-agent-fetch-articles (group articles)
"Fetch ARTICLES from GROUP and put them into the Agent."
- (when articles
+ (when (and articles
+ (gnus-online (gnus-group-method group)))
(gnus-agent-load-alist group)
(let* ((alist gnus-agent-article-alist)
(headers (if (< (length articles) 2) nil gnus-newsgroup-headers))
(const :tag "Header" head)))
(defvar gnus-article-treat-types '("text/plain" "text/x-verbatim"
- "text/x-patch")
- "Parts to treat.")
+ "text/x-patch" "text/html")
+ "Part types eligible for treatment.")
(defvar gnus-inhibit-treatment nil
"Whether to inhibit treatment.")
(while (re-search-forward
"\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t)
(replace-match "\\1\\3" t)))
- (when (interactive-p)
+ (when (gmm-called-interactively-p 'any)
(gnus-treat-article nil))))
(defun article-wash-html ()
;; Add a meta html tag to specify charset and a header.
(cond
(header
- (let (title eheader body hcharset coding force-charset)
+ (let (title eheader body hcharset coding)
(with-temp-buffer
(mm-enable-multibyte)
(setq case-fold-search t)
(insert header "\n")
(setq title (message-fetch-field "subject"))
(goto-char (point-min))
- (while (re-search-forward "\\(<\\)\\|\\(>\\)\\|&" nil t)
+ (while (re-search-forward "\\(<\\)\\|\\(>\\)\\|\\(&\\)\\|\n"
+ nil t)
(replace-match (cond ((match-beginning 1) "<")
((match-beginning 2) ">")
- (t "&"))))
+ ((match-beginning 3) "&")
+ (t "<br>\n"))))
(goto-char (point-min))
- (insert "<pre>\n")
+ (insert "<div align=\"left\">\n")
(goto-char (point-max))
- (insert "</pre>\n<hr>\n")
+ (insert "</div>\n<hr>\n")
;; We have to examine charset one by one since
;; charset specified in parts might be different.
(if (eq charset 'gnus-decoded)
charset)
title (when title
(mm-encode-coding-string title charset))
- body (mm-encode-coding-string content charset)
- force-charset t)
+ body (mm-encode-coding-string content charset))
(setq hcharset (mm-find-mime-charset-region (point-min)
(point-max)))
(cond ((= (length hcharset) 1)
body (mm-encode-coding-string
(mm-decode-coding-string
content body)
- charset)
- force-charset t)))
+ charset))))
(setq charset hcharset
eheader (mm-encode-coding-string
(buffer-string) coding)
(mm-disable-multibyte)
(insert body)
(when charset
- (mm-add-meta-html-tag handle charset force-charset))
+ (mm-add-meta-html-tag handle charset t))
(when title
(goto-char (point-min))
(unless (search-forward "<title>" nil t)
(gnus-article-mode))
(setq truncate-lines gnus-article-truncate-lines)
(current-buffer))
- (with-current-buffer (gnus-get-buffer-create name)
- (gnus-article-mode)
- (setq truncate-lines gnus-article-truncate-lines)
- (make-local-variable 'gnus-summary-buffer)
- (setq gnus-summary-buffer
- (gnus-summary-buffer-name gnus-newsgroup-name))
- (gnus-summary-set-local-parameters gnus-newsgroup-name)
- (when article-lapsed-timer
- (gnus-stop-date-timer))
- (when gnus-article-update-date-headers
- (gnus-start-date-timer gnus-article-update-date-headers))
- (current-buffer)))))
+ (let ((summary gnus-summary-buffer))
+ (with-current-buffer (gnus-get-buffer-create name)
+ (gnus-article-mode)
+ (setq truncate-lines gnus-article-truncate-lines)
+ (set (make-local-variable 'gnus-summary-buffer) summary)
+ (gnus-summary-set-local-parameters gnus-newsgroup-name)
+ (when article-lapsed-timer
+ (gnus-stop-date-timer))
+ (when gnus-article-update-date-headers
+ (gnus-start-date-timer gnus-article-update-date-headers))
+ (current-buffer))))))
(defun gnus-article-stop-animations ()
(dolist (timer (and (boundp 'timer-list)
deletion, or > if it is flagged for displaying."
(interactive)
(gnus-bookmark-maybe-load-default-file)
- (if (interactive-p)
+ (if (gmm-called-interactively-p 'any)
(switch-to-buffer (get-buffer-create "*Gnus Bookmark List*"))
(set-buffer (get-buffer-create "*Gnus Bookmark List*")))
(let ((inhibit-read-only t)
(gnus-article-search-signature)
(setq total (count-lines start (point)))
(while atts
- (setq hidden (+ hidden (length (cdr (assoc (cdar atts)
- gnus-cite-prefix-alist))))
+ (setq hidden (+ hidden (length
+ (cdr (assoc (cdar atts)
+ gnus-cite-prefix-alist))))
atts (cdr atts)))
(when (or force
(and (> (* 100 hidden) (* gnus-cite-hide-percentage total))
(> hidden gnus-cite-hide-absolute)))
- (gnus-add-wash-type 'cite)
- (setq atts gnus-cite-attribution-alist)
- (while atts
- (setq total (cdr (assoc (cdar atts) gnus-cite-prefix-alist))
- atts (cdr atts))
- (while total
- (setq hidden (car total)
- total (cdr total))
- (goto-char (point-min))
- (forward-line (1- hidden))
- (unless (assq hidden gnus-cite-attribution-alist)
- (gnus-add-text-properties
- (point) (progn (forward-line 1) (point))
- (nconc (list 'article-type 'cite)
- gnus-hidden-properties)))))))))
- (gnus-set-mode-line 'article)))
+ (gnus-article-hide-citation)))))))
(defun gnus-article-hide-citation-in-followups ()
"Hide cited text in non-root articles."
(setq destination
(if (= (length bufs) 1)
(get-buffer (car bufs))
- (gnus-completing-read "Attach to which mail composition buffer"
- bufs t)))
+ (gnus-completing-read "Attach to buffer"
+ bufs t nil nil (car bufs))))
;; setup a new mail composition buffer
(let ((mail-user-agent gnus-dired-mail-mode)
;; A workaround to prevent Gnus from displaying the Gnus
(let ((face (cdar (gnus-group-update-eval-form
group
gnus-group-highlight))))
- (unless (eq face (get-text-property beg 'face))
+ (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face))
(let ((inhibit-read-only t))
(gnus-put-text-property-excluding-characters-with-faces
beg end 'face
(let ((group (if (gnus-group-foreign-p group) group
(gnus-group-prefixed-name (gnus-group-real-name group)
method))))
+ (gnus-set-active group nil)
(gnus-sethash
group
`(-1 nil (,group
(gnus-read-ephemeral-gmane-group group start range)))
(defcustom gnus-bug-group-download-format-alist
- '((emacs . "http://debbugs.gnu.org/%s;mboxmaint=yes;mboxstat=yes")
+ '((emacs . "http://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s;mboxmaint=yes;mboxstat=yes")
(debian
. "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s&mbox=yes;mboxmaint=yes"))
"Alist of symbols for bug trackers and the corresponding URL format string.
(defvar gnus-backend-trace nil)
+(defun gnus-backend-trace (type form)
+ (with-current-buffer (get-buffer-create "*gnus trace*")
+ (buffer-disable-undo)
+ (goto-char (point-max))
+ (insert (format-time-string "%H:%M:%S")
+ (format " %.2fs %s %S\n"
+ (if (numberp gnus-backend-trace)
+ (- (float-time) gnus-backend-trace)
+ 0)
+ type form))
+ (setq gnus-backend-trace (float-time))))
+
(defun gnus-open-server (gnus-command-method)
"Open a connection to GNUS-COMMAND-METHOD."
(when (stringp gnus-command-method)
(setq gnus-command-method (gnus-server-to-method gnus-command-method)))
- (when gnus-backend-trace
- (with-current-buffer (get-buffer-create "*gnus trace*")
- (buffer-disable-undo)
- (goto-char (point-max))
- (insert (format-time-string "%H:%M:%S")
- (format " %S\n" gnus-command-method))))
+ (gnus-backend-trace :opening gnus-command-method)
(let ((elem (assoc gnus-command-method gnus-opened-servers))
(server (gnus-method-to-server-name gnus-command-method)))
;; If this method was previously denied, we just return nil.
(save-excursion
(gnus-agent-possibly-synchronize-flags-server
gnus-command-method)))
+ (gnus-backend-trace :opened gnus-command-method)
result)))))
(defun gnus-close-server (gnus-command-method)
"Read and update infos from GNUS-COMMAND-METHOD."
(when (stringp gnus-command-method)
(setq gnus-command-method (gnus-server-to-method gnus-command-method)))
- (funcall (gnus-get-function gnus-command-method 'finish-retrieve-group-infos)
- (nth 1 gnus-command-method)
- infos data))
+ (gnus-backend-trace :finishing gnus-command-method)
+ (prog1
+ (funcall (gnus-get-function gnus-command-method
+ 'finish-retrieve-group-infos)
+ (nth 1 gnus-command-method)
+ infos data)
+ (gnus-backend-trace :finished gnus-command-method)))
(defun gnus-retrieve-group-data-early (gnus-command-method infos)
"Start early async retrieval of data from GNUS-COMMAND-METHOD."
(setq var (cdr var)))
result)))
name)
- (when (or groups gcc-self-val)
+ (when (and (or groups gcc-self-val)
+ (gnus-alive-p))
(when (stringp groups)
(setq groups (list groups)))
(save-excursion
(let* ((article (last articles))
(id (gnus-registry-fetch-message-id-fast article))
(marks (when id (gnus-registry-get-id-key id 'mark))))
- (when (interactive-p)
+ (when (gmm-called-interactively-p 'any)
(gnus-message 1 "Marks are %S" marks))
marks))
(while (and list
(not (eval (caar list))))
(setq list (cdr list)))))
- (unless (eq (setq face (cdar list)) (get-text-property beg 'face))
+ (unless (eq (setq face (cdar list)) (gnus-get-text-property-excluding-characters-with-faces beg 'face))
(gnus-put-text-property-excluding-characters-with-faces
beg end 'face
(if (boundp face) (symbol-value face) face)))))
(defun gnus-highlight-selected-tree (article)
"Highlight the selected article in the tree."
- (let ((buf (current-buffer))
- region)
- (set-buffer gnus-tree-buffer)
- (when (setq region (gnus-tree-article-region article))
- (when (or (not gnus-selected-tree-overlay)
- (gnus-extent-detached-p gnus-selected-tree-overlay))
- ;; Create a new overlay.
- (gnus-overlay-put
- (setq gnus-selected-tree-overlay
- (gnus-make-overlay (point-min) (1+ (point-min))))
- 'face gnus-selected-tree-face))
- ;; Move the overlay to the article.
- (gnus-move-overlay
- gnus-selected-tree-overlay (goto-char (car region)) (cdr region))
- (gnus-tree-minimize)
- (gnus-tree-recenter)
- (let ((selected (selected-window)))
- (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)
- (select-window (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t))
- (gnus-horizontal-recenter)
- (select-window selected))))
-;; If we remove this save-excursion, it updates the wrong mode lines?!?
- (with-current-buffer gnus-tree-buffer
- (gnus-set-mode-line 'tree))
- (set-buffer buf)))
+ (when (buffer-live-p gnus-tree-buffer)
+ (let ((buf (current-buffer))
+ region)
+ (set-buffer gnus-tree-buffer)
+ (when (setq region (gnus-tree-article-region article))
+ (when (or (not gnus-selected-tree-overlay)
+ (gnus-extent-detached-p gnus-selected-tree-overlay))
+ ;; Create a new overlay.
+ (gnus-overlay-put
+ (setq gnus-selected-tree-overlay
+ (gnus-make-overlay (point-min) (1+ (point-min))))
+ 'face gnus-selected-tree-face))
+ ;; Move the overlay to the article.
+ (gnus-move-overlay
+ gnus-selected-tree-overlay (goto-char (car region)) (cdr region))
+ (gnus-tree-minimize)
+ (gnus-tree-recenter)
+ (let ((selected (selected-window)))
+ (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)
+ (select-window
+ (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t))
+ (gnus-horizontal-recenter)
+ (select-window selected))))
+ ;; If we remove this save-excursion, it updates the wrong mode lines?!?
+ (with-current-buffer gnus-tree-buffer
+ (gnus-set-mode-line 'tree))
+ (set-buffer buf))))
(defun gnus-tree-highlight-article (article face)
(with-current-buffer (gnus-get-tree-buffer)
(require 'gnus-win)
(require 'message)
(require 'score-mode)
+(require 'gmm-utils)
(defcustom gnus-global-score-files nil
"List of global score files and directories.
nil)
(defun gnus-score-decode-text-parts ()
- (labels ((mm-text-parts (handle)
- (cond ((stringp (car handle))
- (let ((parts (mapcan #'mm-text-parts (cdr handle))))
- (if (equal "multipart/alternative" (car handle))
- ;; pick the first supported alternative
- (list (car parts))
- parts)))
-
- ((bufferp (car handle))
- (when (string-match "^text/" (mm-handle-media-type handle))
- (list handle)))
-
- (t (mapcan #'mm-text-parts handle))))
- (my-mm-display-part (handle)
- (when handle
- (save-restriction
- (narrow-to-region (point) (point))
- (mm-display-inline handle)
- (goto-char (point-max))))))
+ (gmm-labels
+ ((mm-text-parts
+ (handle)
+ (cond ((stringp (car handle))
+ (let ((parts (apply #'append
+ (mapcar #'mm-text-parts (cdr handle)))))
+ (if (equal "multipart/alternative" (car handle))
+ ;; pick the first supported alternative
+ (list (car parts))
+ parts)))
+
+ ((bufferp (car handle))
+ (when (string-match "^text/" (mm-handle-media-type handle))
+ (list handle)))
+
+ (t (apply #'append (mapcar #'mm-text-parts handle)))))
+ (my-mm-display-part
+ (handle)
+ (when handle
+ (save-restriction
+ (narrow-to-region (point) (point))
+ (mm-display-inline handle)
+ (goto-char (point-max))))))
(let (;(mm-text-html-renderer 'w3m-standalone)
- (handles (mm-dissect-buffer t)))
+ (handles (mm-dissect-buffer t)))
(save-excursion
- (article-goto-body)
- (delete-region (point) (point-max))
- (mapc #'my-mm-display-part (mm-text-parts handles))
- handles))))
+ (article-goto-body)
+ (delete-region (point) (point-max))
+ (mapc #'my-mm-display-part (mm-text-parts handles))
+ handles))))
(defun gnus-score-body (scores header now expire &optional trace)
(if gnus-agent-fetching
(defun gnus-face-face-function (form type)
`(gnus-add-text-properties
(point) (progn ,@form (point))
- '(gnus-face t face ,(symbol-value (intern (format "gnus-face-%d" type))))))
+ (cons 'face
+ (cons
+ ;; Delay consing the value of the `face' property until
+ ;; `gnus-add-text-properties' runs, since it will be modified
+ ;; by `gnus-put-text-property-excluding-characters-with-faces'.
+ (list ',(symbol-value (intern (format "gnus-face-%d" type))) 'default)
+ ;; Redundant now, but still convenient.
+ '(gnus-face t)))))
(defun gnus-balloon-face-function (form type)
`(gnus-put-text-property
"q" gnus-browse-exit
"Q" gnus-browse-exit
"d" gnus-browse-describe-group
+ [delete] gnus-browse-delete-group
"\C-c\C-c" gnus-browse-exit
"?" gnus-browse-describe-briefly
(interactive (list (gnus-browse-group-name)))
(gnus-group-describe-group nil group))
+(defun gnus-browse-delete-group (group force)
+ "Delete the current group. Only meaningful with editable groups.
+If FORCE (the prefix) is non-nil, all the articles in the group will
+be deleted. This is \"deleted\" as in \"removed forever from the face
+of the Earth\". There is no undo. The user will be prompted before
+doing the deletion."
+ (interactive (list (gnus-browse-group-name)
+ current-prefix-arg))
+ (gnus-group-delete-group group force))
+
(defun gnus-browse-unsubscribe-group ()
"Toggle subscription of the current group in the browse buffer."
(let ((sub nil)
(defcustom gnus-before-startup-hook nil
"A hook called before startup.
-This hook is called as the first thing when Gnus is started."
+This hook is called as the first thing when Gnus is started.
+See also `gnus-before-resume-hook'."
+ :group 'gnus-start
+ :type 'hook)
+
+(defcustom gnus-before-resume-hook nil
+ "A hook called before resuming Gnus after suspend.
+This hook is called as the first thing when Gnus is resumed after a suspend.
+See also `gnus-before-startup-hook'."
+ :version "24.4"
:group 'gnus-start
:type 'hook)
(if (gnus-alive-p)
(progn
+ (gnus-run-hooks 'gnus-before-resume-hook)
(switch-to-buffer gnus-group-buffer)
(gnus-group-get-new-news
(and (numberp arg)
(set-buffer buffer)
(setq gnus-summary-buffer (current-buffer))
(not gnus-newsgroup-prepared))
- ;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
- (setq gnus-summary-buffer (set-buffer (gnus-get-buffer-create buffer)))
+ (set-buffer (gnus-get-buffer-create buffer))
+ (setq gnus-summary-buffer (current-buffer))
(gnus-summary-mode group)
(when (gnus-group-quit-config group)
(set (make-local-variable 'gnus-single-article-buffer) nil))
(if (consp (car locals))
(set (caar locals) (pop vlist))
(set (car locals) (pop vlist)))
- (setq locals (cdr locals))))
- ;; The article buffer also has local variables.
- (when (gnus-buffer-live-p gnus-article-buffer)
- (set-buffer gnus-article-buffer)
- (setq gnus-summary-buffer summary))))))
+ (setq locals (cdr locals))))))))
(defun gnus-summary-article-unread-p (article)
"Say whether ARTICLE is unread or not."
Also see the variable `gnus-article-skip-boring'."
(interactive "P")
- (setq gnus-summary-buffer (current-buffer))
(gnus-set-global-variables)
(let ((article (gnus-summary-article-number))
(article-window (get-buffer-window gnus-article-buffer t))
(defun gnus-summary-push-marks-to-backend (article)
(let ((set nil)
+ (del nil)
(marks gnus-article-mark-lists))
(unless (memq article gnus-newsgroup-unreads)
(push 'read set))
(while marks
- (when (and (eq (gnus-article-mark-to-type (cdar marks)) 'list)
- (memq article (symbol-value
- (intern (format "gnus-newsgroup-%s"
- (caar marks))))))
- (push (cdar marks) set))
+ (if (and (eq (gnus-article-mark-to-type (cdar marks)) 'list)
+ (memq article (symbol-value
+ (intern (format "gnus-newsgroup-%s"
+ (caar marks))))))
+ (push (cdar marks) set)
+ (push (cdar marks) del))
(pop marks))
- (gnus-request-set-mark gnus-newsgroup-name `(((,article) set ,set)))))
+ (gnus-request-set-mark gnus-newsgroup-name `(((,article) set ,set)
+ ((,article) del ,del)))))
(defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
"Copy the current article to some other group.
will not be hidden.
Returns nil if no threads were there to be hidden."
(interactive)
+ (beginning-of-line)
(let ((start (point))
(starteol (line-end-position))
(article (gnus-summary-article-number)))
- (goto-char start)
;; Go forward until either the buffer ends or the subthread ends.
(when (and (not (eobp))
(or (zerop (gnus-summary-next-thread 1 t))
(memq article gnus-newsgroup-undownloaded)
(not (memq article gnus-newsgroup-cached)))))
(let ((face (funcall (gnus-summary-highlight-line-0))))
- (unless (eq face (get-text-property beg 'face))
+ (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face))
(gnus-put-text-property-excluding-characters-with-faces
beg (point-at-eol) 'face
(setq face (if (boundp face) (symbol-value face) face)))
(defcustom gnus-sync-newsrc-offsets '(2 3)
"List of per-group data to be synchronized."
:group 'gnus-sync
+ :version "24.4"
:type '(set (const :tag "Read ranges" 2)
- (const :tag "Marks" 3)))
+ (const :tag "Marks" 3)))
(defcustom gnus-sync-global-vars nil
"List of global variables to be synchronized.
(defvar gnus-sync-newsrc-loader nil
"Carrier for newsrc data")
+(defcustom gnus-sync-file-encrypt-to nil
+ "If non-nil, `epa-file-encrypt-to' is set from this for encrypting the Sync
+ file."
+ :group 'gnus-sync)
+
(defcustom gnus-sync-lesync-name (system-name)
"The LeSync name for this machine."
:group 'gnus-sync
(defun gnus-sync-lesync-call (url method headers &optional kvdata)
"Make an access request to URL using KVDATA and METHOD.
KVDATA must be an alist."
- (flet ((json-alist-p (list) (gnus-sync-json-alist-p list))) ; temp patch
- (let ((url-request-method method)
- (url-request-extra-headers headers)
- (url-request-data (if kvdata (json-encode kvdata) nil)))
- (with-current-buffer (url-retrieve-synchronously url)
- (let ((data (gnus-sync-lesync-parse)))
- (gnus-message 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S"
- method url `((headers . ,headers) (data ,kvdata)) data)
- (kill-buffer (current-buffer))
- data)))))
+ (let ((url-request-method method)
+ (url-request-extra-headers headers)
+ (url-request-data (if kvdata (json-encode kvdata) nil)))
+ (with-current-buffer (url-retrieve-synchronously url)
+ (let ((data (gnus-sync-lesync-parse)))
+ (gnus-message 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S"
+ method url `((headers . ,headers) (data ,kvdata)) data)
+ (kill-buffer (current-buffer))
+ data))))
(defun gnus-sync-lesync-PUT (url headers &optional data)
(gnus-sync-lesync-call url "PUT" headers data))
(progn
(let ((coding-system-for-write gnus-ding-file-coding-system)
(standard-output (current-buffer)))
+ (when gnus-sync-file-encrypt-to
+ (set (make-local-variable 'epa-file-encrypt-to)
+ gnus-sync-file-encrypt-to))
(princ (format ";; -*- mode:emacs-lisp; coding: %s; -*-\n"
gnus-ding-file-coding-system))
(princ ";; Gnus sync data v. 0.0.1\n")
(defun gnus-goto-colon ()
- (beginning-of-line)
+ (move-beginning-of-line 1)
(let ((eol (point-at-eol)))
(goto-char (or (text-property-any (point) eol 'gnus-position t)
(search-forward ":" eol t)
(setq beg (point)))
(gnus-overlay-put (gnus-make-overlay beg (point)) prop val)))))
-(defun gnus-put-text-property-excluding-characters-with-faces (beg end
- prop val)
- "The same as `put-text-property', but don't put props on characters with the `gnus-face' property."
- (let ((b beg))
- (while (/= b end)
- (when (get-text-property b 'gnus-face)
- (setq b (next-single-property-change b 'gnus-face nil end)))
- (when (/= b end)
+(defun gnus-put-text-property-excluding-characters-with-faces (beg end prop val)
+ "The same as `put-text-property', except where `gnus-face' is set.
+If so, and PROP is `face', set the second element of its value to VAL.
+Otherwise, do nothing."
+ (while (< beg end)
+ ;; Property values are compared with `eq'.
+ (let ((stop (next-single-property-change beg 'face nil end)))
+ (if (get-text-property beg 'gnus-face)
+ (when (eq prop 'face)
+ (setcar (cdr (get-text-property beg 'face)) (or val 'default)))
(inline
- (gnus-put-text-property
- b (setq b (next-single-property-change b 'gnus-face nil end))
- prop val))))))
+ (gnus-put-text-property beg stop prop val)))
+ (setq beg stop))))
+
+(defun gnus-get-text-property-excluding-characters-with-faces (pos prop)
+ "The same as `get-text-property', except where `gnus-face' is set.
+If so, and PROP is `face', return the second element of its value.
+Otherwise, return the value."
+ (let ((val (get-text-property pos prop)))
+ (if (and (get-text-property pos 'gnus-face)
+ (eq prop 'face))
+ (cadr val)
+ (get-text-property pos prop))))
(defmacro gnus-faces-at (position)
"Return a list of faces at POSITION."
(string-equal (downcase str1) (downcase prefix))
(string-equal str1 prefix))))))
-(eval-and-compile
- (if (fboundp 'macroexpand-all)
- (defalias 'gnus-macroexpand-all 'macroexpand-all)
- (defun gnus-macroexpand-all (form &optional environment)
- "Return result of expanding macros at all levels in FORM.
-If no macros are expanded, FORM is returned unchanged.
-The second optional arg ENVIRONMENT specifies an environment of macro
-definitions to shadow the loaded ones for use in file byte-compilation."
- (if (consp form)
- (let ((idx 1)
- (len (length (setq form (copy-sequence form))))
- expanded)
- (while (< idx len)
- (setcar (nthcdr idx form) (gnus-macroexpand-all (nth idx form)
- environment))
- (setq idx (1+ idx)))
- (if (eq (setq expanded (macroexpand form environment)) form)
- form
- (gnus-macroexpand-all expanded environment)))
- form))))
-
;; Simple check: can be a macro but this way, although slow, it's really clear.
;; We don't use `bound-and-true-p' because it's not in XEmacs.
(defun gnus-bound-and-true-p (sym)
:type 'boolean)
(defcustom gnus-other-frame-function 'gnus
- "Function called by the command `gnus-other-frame'."
+ "Function called by the command `gnus-other-frame' when starting Gnus."
+ :group 'gnus-start
+ :type '(choice (function-item gnus)
+ (function-item gnus-no-server)
+ (function-item gnus-slave)
+ (function-item gnus-slave-no-server)))
+
+(defcustom gnus-other-frame-resume-function 'gnus-group-get-new-news
+ "Function called by the command `gnus-other-frame' when resuming Gnus."
+ :version "24.4"
:group 'gnus-start
:type '(choice (function-item gnus)
(function-item gnus-no-server)
(interactive "P")
(gnus arg nil 'slave))
+(defun gnus-delete-gnus-frame ()
+ "Delete gnus frame unless it is the only one.
+Used for `gnus-exit-gnus-hook' in `gnus-other-frame'."
+ (when (and (frame-live-p gnus-other-frame-object)
+ (cdr (frame-list)))
+ (delete-frame gnus-other-frame-object))
+ (setq gnus-other-frame-object nil))
+
;;;###autoload
(defun gnus-other-frame (&optional arg display)
"Pop up a frame to read news.
This will call one of the Gnus commands which is specified by the user
option `gnus-other-frame-function' (default `gnus') with the argument
-ARG if Gnus is not running, otherwise just pop up a Gnus frame. The
-optional second argument DISPLAY should be a standard display string
+ARG if Gnus is not running, otherwise pop up a Gnus frame and run the
+command specified by `gnus-other-frame-resume-function'.
+The optional second argument DISPLAY should be a standard display string
such as \"unix:0\" to specify where to pop up a frame. If DISPLAY is
omitted or the function `make-frame-on-display' is not available, the
current display is used."
(make-frame-on-display display gnus-other-frame-parameters)
(make-frame gnus-other-frame-parameters))))
(if alive
- (switch-to-buffer gnus-group-buffer)
+ (progn (switch-to-buffer gnus-group-buffer)
+ (funcall gnus-other-frame-resume-function arg))
(funcall gnus-other-frame-function arg)
- (add-hook 'gnus-exit-gnus-hook
- (lambda nil
- (when (and (frame-live-p gnus-other-frame-object)
- (cdr (frame-list)))
- (delete-frame gnus-other-frame-object))
- (setq gnus-other-frame-object nil)))))))
+ (add-hook 'gnus-exit-gnus-hook 'gnus-delete-gnus-frame)
+ ;; One might argue that `gnus-delete-gnus-frame' should not be called
+ ;; from `gnus-suspend-gnus-hook', but, on the other hand, one might
+ ;; argue that it should. No matter what you think, for the sake of
+ ;; those who want it to be called from it, please keep (defun
+ ;; gnus-delete-gnus-frame) even if you remove the next `add-hook'.
+ (add-hook 'gnus-suspend-gnus-hook 'gnus-delete-gnus-frame)))))
;;;###autoload
(defun gnus (&optional arg dont-connect slave)
This variable is a list of mail source specifiers.
See Info node `(gnus)Mail Source Specifiers'."
:group 'mail-source
- :version "23.1" ;; No Gnus
+ :version "24.4"
:link '(custom-manual "(gnus)Mail Source Specifiers")
:type `(choice
(const :tag "None" nil)
:value nil
(const :tag "Clear" nil)
(const starttls)
- (const :tag "SSL/TLS" ssl)))))
+ (const :tag "SSL/TLS" ssl)))
+ (group :inline t
+ (const :format "" :value :leave)
+ (choice :format "\
+%{Leave mail on server%}:\n\t\t%[Value Menu%] %v"
+ :value nil
+ (const :tag "\
+Don't leave mails" nil)
+ (const :tag "\
+Leave all mails" t)
+ (number :tag "\
+Leave mails for this many days" :value 14)))))
(cons :tag "Maildir (qmail, postfix...)"
(const :format "" maildir)
(checklist :tag "Options" :greedy t
(:function)
(:password)
(:authentication password)
- (:stream nil))
+ (:stream nil)
+ (:leave))
(maildir
(:path (or (getenv "MAILDIR") "~/Maildir/"))
(:subdirs ("cur" "new"))
(pop3-port port)
(pop3-authentication-scheme
(if (eq authentication 'apop) 'apop 'pass))
- (pop3-stream-type stream))
+ (pop3-stream-type stream)
+ (pop3-leave-mail-on-server leave))
(if (or debug-on-quit debug-on-error)
(save-excursion (pop3-movemail mail-source-crash-box))
(condition-case err
:type 'sexp)
(defcustom message-ignored-news-headers
- "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
+ "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:\\|^X-Message-SMTP-Method:"
"*Regexp of headers to be removed unconditionally before posting."
:group 'message-news
:group 'message-headers
;; comes back to you (e.g. a mailing-list to which you subscribe, in which
;; case you may be removed from the list on the grounds that mail to you
;; bounced with a "mailing loop" error).
- "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From \\|^Delivered-To:"
+ "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From \\|^Delivered-To:\
+\\|^X-Content-Length:\\|^X-UIDL:"
"*All headers that match this regexp will be deleted when resending a message."
+ :version "24.4"
:group 'message-interface
:link '(custom-manual "(message)Resending")
:type '(repeat :value-to-internal (lambda (widget value)
(push-mark)
(message-position-on-field "Summary" "Subject"))
-(eval-when-compile
- (defmacro message-called-interactively-p (kind)
- (condition-case nil
- (progn
- (eval '(called-interactively-p 'any))
- ;; Emacs >=23.2
- `(called-interactively-p ,kind))
- ;; Emacs <23.2
- (wrong-number-of-arguments '(called-interactively-p))
- ;; XEmacs
- (void-function '(interactive-p)))))
-
(defun message-goto-body ()
"Move point to the beginning of the message body."
(interactive)
- (when (and (message-called-interactively-p 'any)
+ (when (and (gmm-called-interactively-p 'any)
(looking-at "[ \t]*\n"))
(expand-abbrev))
(push-mark)
(interactive "P")
;; eval the let forms contained in message-cite-style
(eval
- `(let ,message-cite-style
+ `(let ,(if (symbolp message-cite-style)
+ (symbol-value message-cite-style)
+ message-cite-style)
(message--yank-original-internal ',arg))))
(defun message-yank-buffer (buffer)
", "))
mct (message-fetch-field "mail-copies-to")
author (or (message-fetch-field "mail-reply-to")
- (message-fetch-field "reply-to")
- (message-fetch-field "from")
- "")
+ (message-fetch-field "reply-to"))
mft (and message-use-mail-followup-to
- (message-fetch-field "mail-followup-to"))))
+ (message-fetch-field "mail-followup-to")))
+ ;; Make sure this message goes to the author if this is a wide
+ ;; reply, since Reply-To address may be a list address a mailing
+ ;; list server added.
+ (when (and wide author)
+ (setq cc (concat author ", " cc)))
+ (when (or wide (not author))
+ (setq author (or (message-fetch-field "from") ""))))
;; Handle special values of Mail-Copies-To.
(when mct
(if (fboundp 'mail-abbrevs-setup)
(let ((minibuffer-setup-hook 'mail-abbrevs-setup)
(minibuffer-local-map message-minibuffer-local-map))
- (flet ((mail-abbrev-in-expansion-header-p nil t))
- (read-from-minibuffer prompt initial-contents)))
+ (read-from-minibuffer prompt initial-contents))
(let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)
(minibuffer-local-map message-minibuffer-local-map))
(read-string prompt initial-contents))))
:group 'mime-security
:type '(repeat (string :tag "Key ID")))
+(defcustom mml-smime-sign-with-sender nil
+ "If t, use message sender so find a key to sign with."
+ :group 'mime-security
+ :version "24.4"
+ :type 'boolean)
+
(defun mml-smime-sign (cont)
(let ((func (nth 1 (assq mml-smime-use mml-smime-function-alist))))
(if func
(autoload 'epg-encrypt-string "epg")
(autoload 'epg-passphrase-callback-function "epg")
(autoload 'epg-context-set-passphrase-callback "epg")
+ (autoload 'epg-sub-key-fingerprint "epg")
(autoload 'epg-configuration "epg-config")
(autoload 'epg-expand-group "epg-config")
(autoload 'epa-select-keys "epa"))
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+;; XXX: since gpg --list-secret-keys does not return validity of each
+;; key, `mml-smime-epg-find-usable-key' defined above is not enough for
+;; secret keys. The function `mml-smime-epg-find-usable-secret-key'
+;; below looks at appropriate public keys to check usability.
+(defun mml-smime-epg-find-usable-secret-key (context name usage)
+ (let ((secret-keys (epg-list-keys context name t))
+ secret-key)
+ (while (and (not secret-key) secret-keys)
+ (if (mml-smime-epg-find-usable-key
+ (epg-list-keys context (epg-sub-key-fingerprint
+ (car (epg-key-sub-key-list
+ (car secret-keys)))))
+ usage)
+ (setq secret-key (car secret-keys)
+ secret-keys nil)
+ (setq secret-keys (cdr secret-keys))))
+ secret-key))
+
(autoload 'mml-compute-boundary "mml")
;; We require mm-decode, which requires mm-bodies, which autoloads
(let* ((inhibit-redisplay t)
(context (epg-make-context 'CMS))
(boundary (mml-compute-boundary cont))
+ (sender (message-options-get 'message-sender))
+ (signer-names (or mml-smime-signers
+ (if (and mml-smime-sign-with-sender sender)
+ (list (concat "<" sender ">")))))
signer-key
(signers
(or (message-options-get 'mml-smime-epg-signers)
(message-options-set
- 'mml-smime-epg-signers
- (if (eq mm-sign-option 'guided)
- (epa-select-keys context "\
+ 'mml-smime-epg-signers
+ (if (eq mm-sign-option 'guided)
+ (epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml-smime-signers t)
- (if mml-smime-signers
- (mapcar
- (lambda (signer)
- (setq signer-key (mml-smime-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format "No secret key for %s; skip it? "
+ signer-names
+ t)
+ (if (or sender mml-smime-signers)
+ (delq nil
+ (mapcar
+ (lambda (signer)
+ (setq signer-key
+ (mml-smime-epg-find-usable-secret-key
+ context signer 'sign))
+ (unless (or signer-key
+ (y-or-n-p
+ (format
+ "No secret key for %s; skip it? "
signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml-smime-signers))))))
+ (error "No secret key for %s" signer))
+ signer-key)
+ signer-names)))))))
signature micalg)
(epg-context-set-signers context signers)
(if mml-smime-cache-passphrase
(defvar epg-user-id-alist)
(defvar epg-digest-algorithm-alist)
+(defvar epg-gpg-program)
(defvar inhibit-redisplay)
(autoload 'epg-make-context "epg")
(autoload 'epg-context-set-signers "epg")
(autoload 'epg-context-result-for "epg")
(autoload 'epg-new-signature-digest-algorithm "epg")
-(autoload 'epg-verify-result-to-string "epg")
(autoload 'epg-list-keys "epg")
(autoload 'epg-decrypt-string "epg")
(autoload 'epg-verify-string "epg")
(autoload 'epg-sub-key-capability "epg")
(autoload 'epg-sub-key-validity "epg")
(autoload 'epg-sub-key-fingerprint "epg")
+(autoload 'epg-signature-key-id "epg")
+(autoload 'epg-signature-to-string "epg")
(autoload 'epg-configuration "epg-config")
(autoload 'epg-expand-group "epg-config")
(autoload 'epa-select-keys "epa")
(setq secret-keys (cdr secret-keys))))
secret-key))
+(defun mml2015-epg-key-image (key-id)
+ "Return the image of a key, if any"
+ (with-temp-buffer
+ (mm-set-buffer-multibyte nil)
+ (let* ((coding-system-for-write 'binary)
+ (coding-system-for-read 'binary)
+ (data (shell-command-to-string
+ (format "%s --list-options no-show-photos --attribute-fd 3 --list-keys %s 3>&1 >/dev/null 2>&1"
+ epg-gpg-program key-id))))
+ (when (> (length data) 0)
+ (insert (substring data 16))
+ (create-image (buffer-string) nil t)))))
+
+(defun mml2015-epg-key-image-to-string (key-id)
+ "Return a string with the image of a key, if any"
+ (let* ((result "")
+ (key-image (mml2015-epg-key-image key-id)))
+ (when key-image
+ (setq result " ")
+ (put-text-property 1 2 'display key-image result))
+ result))
+
+(defun mml2015-epg-signature-to-string (signature)
+ (concat (epg-signature-to-string signature)
+ (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"))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info
(concat "OK\n"
- (epg-verify-result-to-string
+ (mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify))))
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info "OK"))
(if (epg-context-result-for context 'verify)
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-details
- (epg-verify-result-to-string
+ (mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify)))))))
(defun mml2015-epg-verify (handle ctl)
(throw 'error handle)))
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info
- (epg-verify-result-to-string (epg-context-result-for context 'verify)))
+ (mml2015-epg-verify-result-to-string
+ (epg-context-result-for context 'verify)))
handle)))
(defun mml2015-epg-clear-verify ()
(progn
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info
- (epg-verify-result-to-string
+ (mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify)))
(delete-region (point-min) (point-max))
(insert (mm-decode-coding-string plain coding-system-for-read)))
(nnfolder-save-nov))
(current-buffer))))))
+(defun nnfolder-recursive-directory-files (dir prefix)
+ (let ((files nil))
+ (dolist (file (directory-files dir))
+ (cond
+ ((or (file-symlink-p (expand-file-name file dir))
+ (member file '("." "..")))
+ ;; Ignore
+ )
+ ((file-directory-p (expand-file-name file dir))
+ (setq files (nconc (nnfolder-recursive-directory-files
+ (expand-file-name file dir)
+ (if prefix
+ (concat prefix "." (directory-file-name file))
+ (file-name-nondirectory file)))
+ files)))
+ ((file-regular-p (expand-file-name file dir))
+ (push (if prefix
+ (concat prefix "." file)
+ file)
+ files))))
+ files))
+
;;;###autoload
(defun nnfolder-generate-active-file ()
"Look for mbox folders in the nnfolder directory and make them into groups.
(when (not (message-mail-file-mbox-p file))
(ignore-errors
(delete-file file)))))
- (dolist (file (directory-files nnfolder-directory))
+ (dolist (file (if nnmail-use-long-file-names
+ (directory-files nnfolder-directory)
+ (nnfolder-recursive-directory-files
+ nnfolder-directory nil)))
(when (and (not (backup-file-name-p file))
(message-mail-file-mbox-p
- (nnheader-concat nnfolder-directory file)))
+ (nnfolder-group-pathname file)))
(let ((oldgroup (assoc file nnfolder-group-alist)))
(if oldgroup
(nnheader-message 5 "Refreshing group %s..." file)
(defvoo nnimap-authenticator nil
"How nnimap authenticate itself to the server.
-Possible choices are nil (use default methods) or `anonymous'.")
+Possible choices are nil (use default methods), `anonymous',
+`login', `plain' and `cram-md5'.")
(defvoo nnimap-expunge t
"If non-nil, expunge articles after deleting them.
;; round trips than CRAM-MD5, and it's less likely to be buggy),
;; and we're using an encrypted connection.
((and (not (nnimap-capability "LOGINDISABLED"))
- (eq (nnimap-stream-type nnimap-object) 'tls))
+ (eq (nnimap-stream-type nnimap-object) 'tls)
+ (or (null nnimap-authenticator)
+ (eq nnimap-authenticator 'login)))
(nnimap-command "LOGIN %S %S" user password))
- ((nnimap-capability "AUTH=CRAM-MD5")
+ ((and (nnimap-capability "AUTH=CRAM-MD5")
+ (or (null nnimap-authenticator)
+ (eq nnimap-authenticator 'cram-md5)))
(erase-buffer)
(let ((sequence (nnimap-send-command "AUTHENTICATE CRAM-MD5"))
(challenge (nnimap-wait-for-line "^\\+\\(.*\\)\n")))
(base64-decode-string challenge))))
"\r\n"))
(nnimap-wait-for-response sequence)))
- ((not (nnimap-capability "LOGINDISABLED"))
+ ((and (not (nnimap-capability "LOGINDISABLED"))
+ (or (null nnimap-authenticator)
+ (eq nnimap-authenticator 'login)))
(nnimap-command "LOGIN %S %S" user password))
- ((nnimap-capability "AUTH=PLAIN")
+ ((and (nnimap-capability "AUTH=PLAIN")
+ (or (null nnimap-authenticator)
+ (eq nnimap-authenticator 'plain)))
(nnimap-command
"AUTHENTICATE PLAIN %s"
(base64-encode-string
(gnus-set-difference
(gnus-set-difference
existing
- (cdr (assoc '%Seen flags)))
+ (gnus-sorted-union
+ (cdr (assoc '%Seen flags))
+ (cdr (assoc '%Deleted flags))))
(cdr (assoc '%Flagged flags)))))
(read (gnus-range-difference
(cons start-article high) unread)))
"nntpd" pbuffer nntp-address nntp-port-number
:type (cadr (assoc nntp-open-connection-function map))
:end-of-command "^\\([2345]\\|[.]\\).*\n"
- :capability-command "CAPABILITIES\r\n"
+ :capability-command "HELP\r\n"
:success "^3"
:starttls-function
(lambda (capabilities)
:group 'pop3)
(defcustom pop3-leave-mail-on-server nil
- "*Non-nil if the mail is to be left on the POP server after fetching.
-
-If `pop3-leave-mail-on-server' is non-nil the mail is to be left
-on the POP server after fetching. Note that POP servers maintain
-no state information between sessions, so what the client
-believes is there and what is actually there may not match up.
-If they do not, then you may get duplicate mails or the whole
-thing can fall apart and leave you with a corrupt mailbox."
- ;; We can't use the UILD support from XEmacs mail-lib or cvs.m17n.org:
- ;; http://thread.gmane.org/v9lld8fml4.fsf@marauder.physik.uni-ulm.de
- ;; http://thread.gmane.org/b9yy8hzy9ej.fsf@jpl.org
- ;; Any volunteer to re-implement this?
- :version "22.1" ;; Oort Gnus
- :type 'boolean
+ "Non-nil if the mail is to be left on the POP server after fetching.
+Mails once fetched will never be fetched again by the UIDL control.
+
+If this is neither nil nor a number, all mails will be left on the
+server. If this is a number, leave mails on the server for this many
+days since you first checked new mails. If this is nil, mails will be
+deleted on the server right after fetching.
+
+Gnus users should use the `:leave' keyword in a mail source to direct
+the behaviour per server, rather than directly modifying this value.
+
+Note that POP servers maintain no state information between sessions,
+so what the client believes is there and what is actually there may
+not match up. If they do not, then you may get duplicate mails or
+the whole thing can fall apart and leave you with a corrupt mailbox."
+ :version "24.4"
+ :type '(choice (const :tag "Don't leave mails" nil)
+ (const :tag "Leave all mails" t)
+ (number :tag "Leave mails for this many days" :value 14))
+ :group 'pop3)
+
+(defcustom pop3-uidl-file "~/.pop3-uidl"
+ "File used to save UIDL."
+ :version "24.4"
+ :type 'file
+ :group 'pop3)
+
+(defcustom pop3-uidl-file-backup '(0 9)
+ "How to backup the UIDL file `pop3-uidl-file' when updating.
+If it is a list of numbers, the first one binds `kept-old-versions' and
+the other binds `kept-new-versions' to keep number of oldest and newest
+versions. Otherwise, the value binds `version-control' (which see).
+
+Note: Backup will take place whenever you check new mails on a server.
+So, you may lose the backup files having been saved before a trouble
+if you set it so as to make too few backups whereas you have access to
+many servers."
+ :version "24.4"
+ :type '(choice (group :tag "Keep versions" :format "\n%v" :indent 3
+ (number :tag "oldest")
+ (number :tag "newest"))
+ (sexp :format "%v"
+ :match (lambda (widget value)
+ (condition-case nil
+ (not (and (numberp (car value))
+ (numberp (car (cdr value)))))
+ (error t)))))
:group 'pop3)
(defvar pop3-timestamp nil
(truncate pop3-read-timeout))
1000))))))
+(defvar pop3-uidl)
+;; List of UIDLs of existing messages at present in the server:
+;; ("UIDL1" "UIDL2" "UIDL3"...)
+
+(defvar pop3-uidl-saved)
+;; Locally saved UIDL data; an alist of the server, the user, and the UIDL
+;; and timestamp pairs:
+;; (("SERVER_A" ("USER_A1" "UIDL1" TIMESTAMP1 "UIDL2" TIMESTAMP2...)
+;; ("USER_A2" "UIDL1" TIMESTAMP1 "UIDL2" TIMESTAMP2...)
+;; ...)
+;; ("SERVER_B" ("USER_B1" "UIDL1" TIMESTAMP1 "UIDL2" TIMESTAMP2...)
+;; ("USER_B2" "UIDL1" TIMESTAMP1 "UIDL2" TIMESTAMP2...)
+;; ...))
+;; Where TIMESTAMP is the most significant two digits of an Emacs time,
+;; i.e. the return value of `current-time'.
+
;;;###autoload
(defun pop3-movemail (file)
"Transfer contents of a maildrop to the specified FILE.
Use streaming commands."
- (let* ((process (pop3-open-server pop3-mailhost pop3-port))
- message-count message-total-size)
+ (let ((process (pop3-open-server pop3-mailhost pop3-port))
+ messages total-size
+ pop3-uidl
+ pop3-uidl-saved)
(pop3-logon process)
- (with-current-buffer (process-buffer process)
+ (if pop3-leave-mail-on-server
+ (setq messages (pop3-uidl-stat process)
+ total-size (cadr messages)
+ messages (car messages))
(let ((size (pop3-stat process)))
- (setq message-count (car size)
- message-total-size (cadr size)))
- (when (> message-count 0)
- (pop3-send-streaming-command
- process "RETR" message-count message-total-size)
- (pop3-write-to-file file)
+ (dotimes (i (car size)) (push (1+ i) messages))
+ (setq messages (nreverse messages)
+ total-size (cadr size))))
+ (when messages
+ (with-current-buffer (process-buffer process)
+ (pop3-send-streaming-command process "RETR" messages total-size)
+ (pop3-write-to-file file messages)
(unless pop3-leave-mail-on-server
- (pop3-send-streaming-command
- process "DELE" message-count nil))))
- (pop3-quit process)
+ (pop3-send-streaming-command process "DELE" messages nil))))
+ (if pop3-leave-mail-on-server
+ (when (prog1 (pop3-uidl-dele process) (pop3-quit process))
+ (pop3-uidl-save))
+ (pop3-quit process)
+ ;; Remove UIDL data for the account that got not to leave mails.
+ (setq pop3-uidl-saved (pop3-uidl-load))
+ (let ((elt (assoc pop3-maildrop
+ (cdr (assoc pop3-mailhost pop3-uidl-saved)))))
+ (when elt
+ (setcdr elt nil)
+ (pop3-uidl-save))))
t))
-(defun pop3-send-streaming-command (process command count total-size)
+(defun pop3-send-streaming-command (process command messages total-size)
(erase-buffer)
- (let ((i 1)
+ (let ((count (length messages))
+ (i 1)
(start-point (point-min))
(waited-for 0))
- (while (>= count i)
- (process-send-string process (format "%s %d\r\n" command i))
+ (while messages
+ (process-send-string process (format "%s %d\r\n" command (pop messages)))
;; Only do 100 messages at a time to avoid pipe stalls.
(when (zerop (% i pop3-stream-length))
(setq start-point
(pop3-accept-process-output process))
start-point)
-(defun pop3-write-to-file (file)
+(defun pop3-write-to-file (file messages)
(let ((pop-buffer (current-buffer))
(start (point-min))
beg end
(pop3-clean-region hstart (point))
(goto-char (point-max))
(pop3-munge-message-separator hstart (point))
+ (when pop3-leave-mail-on-server
+ (pop3-uidl-add-xheader hstart (pop messages)))
(goto-char (point-max))))))
(let ((coding-system-for-write 'binary))
(goto-char (point-min))
(pop3-quit process)
message-count))
+(defun pop3-uidl-stat (process)
+ "Return a list of unread message numbers and total size."
+ (pop3-send-command process "UIDL")
+ (let (err messages size)
+ (if (condition-case code
+ (progn
+ (pop3-read-response process)
+ t)
+ (error (setq err (error-message-string code))
+ nil))
+ (let ((start pop3-read-point)
+ saved list)
+ (with-current-buffer (process-buffer process)
+ (while (not (re-search-forward "^\\.\r\n" nil t))
+ (unless (memq (process-status process) '(open run))
+ (error "pop3 server closed the connection"))
+ (pop3-accept-process-output process)
+ (goto-char start))
+ (setq pop3-read-point (point-marker)
+ pop3-uidl nil)
+ (while (progn (forward-line -1) (>= (point) start))
+ (when (looking-at "[0-9]+ \\([^\n\r ]+\\)")
+ (push (match-string 1) pop3-uidl)))
+ (when pop3-uidl
+ (setq pop3-uidl-saved (pop3-uidl-load)
+ saved (cdr (assoc pop3-maildrop
+ (cdr (assoc pop3-mailhost
+ pop3-uidl-saved)))))
+ (let ((i (length pop3-uidl)))
+ (while (> i 0)
+ (unless (member (nth (1- i) pop3-uidl) saved)
+ (push i messages))
+ (decf i)))
+ (when messages
+ (setq list (pop3-list process)
+ size 0)
+ (dolist (msg messages)
+ (setq size (+ size (cdr (assq msg list)))))
+ (list messages size)))))
+ (message "%s doesn't support UIDL (%s), so we try a regressive way..."
+ pop3-mailhost err)
+ (sit-for 1)
+ (setq size (pop3-stat process))
+ (dotimes (i (car size)) (push (1+ i) messages))
+ (setcar size (nreverse messages))
+ size)))
+
+(defun pop3-uidl-dele (process)
+ "Delete messages according to `pop3-leave-mail-on-server'.
+Return non-nil if it is necessary to update the local UIDL file."
+ (let* ((ctime (current-time))
+ (srvr (assoc pop3-mailhost pop3-uidl-saved))
+ (saved (assoc pop3-maildrop (cdr srvr)))
+ i uidl mod new tstamp dele)
+ (setcdr (cdr ctime) nil)
+ ;; Add new messages to the data to be saved.
+ (cond ((and pop3-uidl saved)
+ (setq i (1- (length pop3-uidl)))
+ (while (>= i 0)
+ (unless (member (setq uidl (nth i pop3-uidl)) (cdr saved))
+ (push ctime new)
+ (push uidl new))
+ (decf i)))
+ (pop3-uidl
+ (setq new (apply 'nconc (mapcar (lambda (elt) (list elt ctime))
+ pop3-uidl)))))
+ (when new (setq mod t))
+ ;; List expirable messages and delete them from the data to be saved.
+ (setq ctime (when (numberp pop3-leave-mail-on-server)
+ (/ (+ (* (car ctime) 65536.0) (cadr ctime)) 86400))
+ i (1- (length saved)))
+ (while (> i 0)
+ (if (member (setq uidl (nth (1- i) saved)) pop3-uidl)
+ (progn
+ (setq tstamp (nth i saved))
+ (if (and ctime
+ (> (- ctime (/ (+ (* (car tstamp) 65536.0) (cadr tstamp))
+ 86400))
+ pop3-leave-mail-on-server))
+ ;; Mails to delete.
+ (progn
+ (setq mod t)
+ (push uidl dele))
+ ;; Mails to keep.
+ (push tstamp new)
+ (push uidl new)))
+ ;; Mails having been deleted in the server.
+ (setq mod t))
+ (decf i 2))
+ (cond (saved
+ (setcdr saved new))
+ (srvr
+ (setcdr (last srvr) (list (cons pop3-maildrop new))))
+ (t
+ (add-to-list 'pop3-uidl-saved
+ (list pop3-mailhost (cons pop3-maildrop new))
+ t)))
+ ;; Actually delete the messages in the server.
+ (when dele
+ (setq uidl nil
+ i (length pop3-uidl))
+ (while (> i 0)
+ (when (member (nth (1- i) pop3-uidl) dele)
+ (push i uidl))
+ (decf i))
+ (when uidl
+ (pop3-send-streaming-command process "DELE" uidl nil)))
+ mod))
+
+(defun pop3-uidl-load ()
+ "Load saved UIDL."
+ (when (file-exists-p pop3-uidl-file)
+ (with-temp-buffer
+ (condition-case code
+ (progn
+ (insert-file-contents pop3-uidl-file)
+ (goto-char (point-min))
+ (read (current-buffer)))
+ (error
+ (message "Error while loading %s (%s)"
+ pop3-uidl-file (error-message-string code))
+ (sit-for 1)
+ nil)))))
+
+(defun pop3-uidl-save ()
+ "Save UIDL."
+ (with-temp-buffer
+ (if pop3-uidl-saved
+ (progn
+ (insert "(")
+ (dolist (srvr pop3-uidl-saved)
+ (when (cdr srvr)
+ (insert "(\"" (pop srvr) "\"\n ")
+ (dolist (elt srvr)
+ (when (cdr elt)
+ (insert "(\"" (pop elt) "\"\n ")
+ (while elt
+ (insert (format "\"%s\" %s\n " (pop elt) (pop elt))))
+ (delete-char -4)
+ (insert ")\n ")))
+ (delete-char -3)
+ (if (eq (char-before) ?\))
+ (insert ")\n ")
+ (goto-char (1+ (point-at-bol)))
+ (delete-region (point) (point-max)))))
+ (when (eq (char-before) ? )
+ (delete-char -2))
+ (insert ")\n"))
+ (insert "()\n"))
+ (let ((buffer-file-name pop3-uidl-file)
+ (delete-old-versions t)
+ (kept-new-versions kept-new-versions)
+ (kept-old-versions kept-old-versions)
+ (version-control version-control))
+ (if (consp pop3-uidl-file-backup)
+ (setq kept-new-versions (cadr pop3-uidl-file-backup)
+ kept-old-versions (car pop3-uidl-file-backup)
+ version-control t)
+ (setq version-control pop3-uidl-file-backup))
+ (save-buffer))))
+
+(defun pop3-uidl-add-xheader (start msgno)
+ "Add X-UIDL header."
+ (let ((case-fold-search t))
+ (save-restriction
+ (narrow-to-region start (progn
+ (goto-char start)
+ (search-forward "\n\n" nil 'move)
+ (1- (point))))
+ (goto-char start)
+ (while (re-search-forward "^x-uidl:" nil t)
+ (while (progn
+ (forward-line 1)
+ (memq (char-after) '(?\t ? ))))
+ (delete-region (match-beginning 0) (point)))
+ (goto-char (point-max))
+ (insert "X-UIDL: " (nth (1- msgno) pop3-uidl) "\n"))))
+
(defcustom pop3-stream-type nil
"*Transport security type for POP3 connections.
This may be either nil (plain connection), `ssl' (use an
;; Possible responses:
;; +OK [all delete marks removed]
+;; UIDL [msg]
+;; Arguments: a message-id (optional)
+;; Restrictions: transaction state; msg must not be deleted
+;; Possible responses:
+;; +OK [uidl listing follows]
+;; -ERR [no such message]
+
;;; UPDATE STATE
;; QUIT
(start (point))
shr-start)
(shr-generic cont)
- (shr-urlify (or shr-start start) (shr-expand-url url) title)))
+ (when url
+ (shr-urlify (or shr-start start) (shr-expand-url url) title))))
(defun shr-tag-object (cont)
(let ((start (point))
(eval-when-compile
(list
;; control commands
- (cons (regexp-opt '("require" "if" "else" "elsif" "stop"))
+ (cons (regexp-opt '("require" "if" "else" "elsif" "stop")
+ 'words)
'sieve-control-commands-face)
;; action commands
- (cons (regexp-opt '("fileinto" "redirect" "reject" "keep" "discard"))
+ (cons (regexp-opt '("fileinto" "redirect" "reject" "keep" "discard")
+ 'words)
'sieve-action-commands-face)
;; test commands
(cons (regexp-opt '("address" "allof" "anyof" "exists" "false"
- "true" "header" "not" "size" "envelope"))
+ "true" "header" "not" "size" "envelope")
+ 'words)
'sieve-test-commands-face)
(cons "\\Sw+:\\sw+"
'sieve-tagged-arguments-face))))
(setcdr (nthcdr 14 result) nil)
result))
+(eval-when-compile
+ (defmacro spam-stat-called-interactively-p (kind)
+ (condition-case nil
+ (progn
+ (eval '(called-interactively-p 'any))
+ ;; Emacs >=23.2
+ `(called-interactively-p ,kind))
+ ;; Emacs <23.2
+ (wrong-number-of-arguments '(called-interactively-p))
+ ;; XEmacs
+ (void-function '(interactive-p)))))
+
(defun spam-stat-score-buffer ()
"Return a score describing the spam-probability for this buffer.
Add user supplied modifications if supplied."
(error nil)))
(ans
(if score1s (+ score0 score1s) score0)))
- (when (interactive-p)
+ (when (spam-stat-called-interactively-p 'any)
(message "%S" ans))
ans))
(declare-function gnus-extract-address-components "gnus-util" (from))
(eval-and-compile
- (when (condition-case nil
- (progn
- (require 'bbdb)
- (require 'bbdb-com))
- (file-error
- ;; `bbdb-records' should not be bound as an autoload function
- ;; before loading bbdb because of `bbdb-hashtable-size'.
- (defalias 'bbdb-buffer 'ignore)
- (defalias 'bbdb-create-internal 'ignore)
- (defalias 'bbdb-records 'ignore)
- (defalias 'spam-BBDB-register-routine 'ignore)
- (defalias 'spam-enter-ham-BBDB 'ignore)
- (defalias 'spam-exists-in-BBDB-p 'ignore)
- (defalias 'bbdb-gethash 'ignore)
- nil))
+ (condition-case nil
+ (progn
+ (require 'bbdb)
+ (require 'bbdb-com))
+ (file-error
+ ;; `bbdb-records' should not be bound as an autoload function
+ ;; before loading bbdb because of `bbdb-hashtable-size'.
+ (defalias 'bbdb-buffer 'ignore)
+ (defalias 'bbdb-create-internal 'ignore)
+ (defalias 'bbdb-records 'ignore)
+ (defalias 'spam-BBDB-register-routine 'ignore)
+ (defalias 'spam-enter-ham-BBDB 'ignore)
+ (defalias 'spam-exists-in-BBDB-p 'ignore)
+ (defalias 'bbdb-gethash 'ignore)
+ nil)))
+(eval-and-compile
+ (when (featurep 'bbdb-com)
;; when the BBDB changes, we want to clear out our cache
(defun spam-clear-cache-BBDB (&rest immaterial)
(spam-clear-cache 'spam-use-BBDB))
(cond
((bufferp locus)
(princ (format "Local in buffer %s; "
- (buffer-name))))
+ (buffer-name buffer))))
((framep locus)
(princ (format "It is a frame-local variable; ")))
((terminal-live-p locus)
(when (or (eq char ??) (eq char help-char)
(memq char help-event-list))
(setq config (current-window-configuration))
- (switch-to-buffer-other-window "*Help*")
+ (pop-to-buffer " *Metahelp*" nil t)
(and (fboundp 'make-frame)
(not (eq (window-frame (selected-window))
prev-frame))
" is also a " "face." "\n\n" facedoc))
;; Don't record the `describe-function' item in the stack.
(setq help-xref-stack-item nil)
- (help-setup-xref (list #'help-xref-interned symbol) nil)))))))
+ (help-setup-xref (list #'help-xref-interned symbol) nil))))
+ (goto-char (point-min)))))
\f
;; Navigation/hyperlinking with xrefs
-;;; hi-lock.el --- minor mode for interactive automatic highlighting
+;;; hi-lock.el --- minor mode for interactive automatic highlighting -*- lexical-binding: t -*-
;; Copyright (C) 2000-2013 Free Software Foundation, Inc.
;; It can have a function value.
(put 'hi-lock-file-patterns-policy 'risky-local-variable t)
+(defcustom hi-lock-auto-select-face nil
+ "Non-nil if highlighting commands should not prompt for face names.
+When non-nil, each hi-lock command will cycle through faces in
+`hi-lock-face-defaults' without prompting."
+ :type 'boolean
+ :version "24.4")
+
(defgroup hi-lock-faces nil
"Faces for hi-lock."
:group 'hi-lock
"Face for hi-lock mode."
:group 'hi-lock-faces)
-(defvar hi-lock-file-patterns nil
+(defvar-local hi-lock-file-patterns nil
"Patterns found in file for hi-lock. Should not be changed.")
+(put 'hi-lock-file-patterns 'permanent-local t)
-(defvar hi-lock-interactive-patterns nil
+(defvar-local hi-lock-interactive-patterns nil
"Patterns provided to hi-lock by user. Should not be changed.")
+(put 'hi-lock-interactive-patterns 'permanent-local t)
(define-obsolete-variable-alias 'hi-lock-face-history
'hi-lock-face-defaults "23.1")
"hi-blue-b" "hi-red-b" "hi-green-b" "hi-black-hb")
"Default faces for hi-lock interactive functions.")
-;;(dolist (f hi-lock-face-defaults)
-;; (unless (facep f) (error "%s not a face" f)))
-
(define-obsolete-variable-alias 'hi-lock-regexp-history
'regexp-history
"23.1")
Assumption is made if `hi-lock-mode' used in the *scratch* buffer while
a library is being loaded.")
-(make-variable-buffer-local 'hi-lock-interactive-patterns)
-(put 'hi-lock-interactive-patterns 'permanent-local t)
-(make-variable-buffer-local 'hi-lock-file-patterns)
-(put 'hi-lock-file-patterns 'permanent-local t)
-
(defvar hi-lock-menu
(let ((map (make-sparse-keymap "Hi Lock")))
(define-key-after map [highlight-regexp]
(unless hi-lock-mode (hi-lock-mode 1))
(hi-lock-set-pattern regexp face))
+(defun hi-lock-keyword->face (keyword)
+ (cadr (cadr (cadr keyword)))) ; Keyword looks like (REGEXP (0 'FACE) ...).
+
(declare-function x-popup-menu "menu.c" (position menu))
+(defun hi-lock--regexps-at-point ()
+ (let ((regexps '()))
+ ;; When using overlays, there is no ambiguity on the best
+ ;; choice of regexp.
+ (let ((regexp (get-char-property (point) 'hi-lock-overlay-regexp)))
+ (when regexp (push regexp regexps)))
+ ;; With font-locking on, check if the cursor is on a highlighted text.
+ (let ((face-after (get-text-property (point) 'face))
+ (face-before
+ (unless (bobp) (get-text-property (1- (point)) 'face)))
+ (faces (mapcar #'hi-lock-keyword->face
+ hi-lock-interactive-patterns)))
+ (unless (memq face-before faces) (setq face-before nil))
+ (unless (memq face-after faces) (setq face-after nil))
+ (when (and face-before face-after (not (eq face-before face-after)))
+ (setq face-before nil))
+ (when (or face-after face-before)
+ (let* ((hi-text
+ (buffer-substring-no-properties
+ (if face-before
+ (or (previous-single-property-change (point) 'face)
+ (point-min))
+ (point))
+ (if face-after
+ (or (next-single-property-change (point) 'face)
+ (point-max))
+ (point)))))
+ ;; Compute hi-lock patterns that match the
+ ;; highlighted text at point. Use this later in
+ ;; during completing-read.
+ (dolist (hi-lock-pattern hi-lock-interactive-patterns)
+ (let ((regexp (car hi-lock-pattern)))
+ (if (string-match regexp hi-text)
+ (push regexp regexps)))))))
+ regexps))
+
+(defvar-local hi-lock--unused-faces nil
+ "List of faces that is not used and is available for highlighting new text.
+Face names from this list come from `hi-lock-face-defaults'.")
+
;;;###autoload
(defalias 'unhighlight-regexp 'hi-lock-unface-buffer)
;;;###autoload
(defun hi-lock-unface-buffer (regexp)
"Remove highlighting of each match to REGEXP set by hi-lock.
Interactively, prompt for REGEXP, accepting only regexps
-previously inserted by hi-lock interactive functions."
+previously inserted by hi-lock interactive functions.
+If REGEXP is t (or if \\[universal-argument] was specified interactively),
+then remove all hi-lock highlighting."
(interactive
- (if (and (display-popup-menus-p)
- (listp last-nonmenu-event)
- use-dialog-box)
- (catch 'snafu
- (or
- (x-popup-menu
- t
- (cons
- `keymap
- (cons "Select Pattern to Unhighlight"
- (mapcar (lambda (pattern)
- (list (car pattern)
- (format
- "%s (%s)" (car pattern)
- (symbol-name
- (car
- (cdr (car (cdr (car (cdr pattern))))))))
- (cons nil nil)
- (car pattern)))
- hi-lock-interactive-patterns))))
- ;; If the user clicks outside the menu, meaning that they
- ;; change their mind, x-popup-menu returns nil, and
- ;; interactive signals a wrong number of arguments error.
- ;; To prevent that, we return an empty string, which will
- ;; effectively disable the rest of the function.
- (throw 'snafu '(""))))
- (let ((history-list (mapcar (lambda (p) (car p))
- hi-lock-interactive-patterns)))
- (unless hi-lock-interactive-patterns
- (error "No highlighting to remove"))
+ (cond
+ (current-prefix-arg (list t))
+ ((and (display-popup-menus-p)
+ (listp last-nonmenu-event)
+ use-dialog-box)
+ (catch 'snafu
+ (or
+ (x-popup-menu
+ t
+ (cons
+ `keymap
+ (cons "Select Pattern to Unhighlight"
+ (mapcar (lambda (pattern)
+ (list (car pattern)
+ (format
+ "%s (%s)" (car pattern)
+ (hi-lock-keyword->face pattern))
+ (cons nil nil)
+ (car pattern)))
+ hi-lock-interactive-patterns))))
+ ;; If the user clicks outside the menu, meaning that they
+ ;; change their mind, x-popup-menu returns nil, and
+ ;; interactive signals a wrong number of arguments error.
+ ;; To prevent that, we return an empty string, which will
+ ;; effectively disable the rest of the function.
+ (throw 'snafu '("")))))
+ (t
+ ;; Un-highlighting triggered via keyboard action.
+ (unless hi-lock-interactive-patterns
+ (error "No highlighting to remove"))
+ ;; Infer the regexp to un-highlight based on cursor position.
+ (let* ((defaults (or (hi-lock--regexps-at-point)
+ (mapcar #'car hi-lock-interactive-patterns))))
(list
- (completing-read "Regexp to unhighlight: "
- hi-lock-interactive-patterns nil t
- (car (car hi-lock-interactive-patterns))
- (cons 'history-list 1))))))
- (let ((keyword (assoc regexp hi-lock-interactive-patterns)))
+ (completing-read (if (null defaults)
+ "Regexp to unhighlight: "
+ (format "Regexp to unhighlight (default %s): "
+ (car defaults)))
+ hi-lock-interactive-patterns
+ nil t nil nil defaults))))))
+ (dolist (keyword (if (eq regexp t) hi-lock-interactive-patterns
+ (list (assoc regexp hi-lock-interactive-patterns))))
(when keyword
+ (let ((face (hi-lock-keyword->face keyword)))
+ ;; Make `face' the next one to use by default.
+ (add-to-list 'hi-lock--unused-faces (face-name face)))
(font-lock-remove-keywords nil (list keyword))
(setq hi-lock-interactive-patterns
(delq keyword hi-lock-interactive-patterns))
(remove-overlays
- nil nil 'hi-lock-overlay-regexp (hi-lock-string-serialize regexp))
+ nil nil 'hi-lock-overlay-regexp (hi-lock--hashcons (car keyword)))
(when font-lock-fontified (font-lock-fontify-buffer)))))
;;;###autoload
regexp))
(defun hi-lock-read-face-name ()
- "Read face name from minibuffer with completion and history."
- (intern (completing-read
- "Highlight using face: "
- obarray 'facep t
- (cons (car hi-lock-face-defaults)
- (let ((prefix
- (try-completion
- (substring (car hi-lock-face-defaults) 0 1)
- hi-lock-face-defaults)))
- (if (and (stringp prefix)
- (not (equal prefix (car hi-lock-face-defaults))))
- (length prefix) 0)))
- 'face-name-history
- (cdr hi-lock-face-defaults))))
+ "Return face for interactive highlighting.
+When `hi-lock-auto-select-face' is non-nil, just return the next face.
+Otherwise, read face name from minibuffer with completion and history."
+ (unless hi-lock-interactive-patterns
+ (setq hi-lock--unused-faces hi-lock-face-defaults))
+ (let* ((last-used-face
+ (when hi-lock-interactive-patterns
+ (face-name (hi-lock-keyword->face
+ (car hi-lock-interactive-patterns)))))
+ (defaults (append hi-lock--unused-faces
+ (cdr (member last-used-face hi-lock-face-defaults))
+ hi-lock-face-defaults))
+ face)
+ (if (and hi-lock-auto-select-face (not current-prefix-arg))
+ (setq face (or (pop hi-lock--unused-faces) (car defaults)))
+ (setq face (completing-read
+ (format "Highlight using face (default %s): "
+ (car defaults))
+ obarray 'facep t nil 'face-name-history defaults))
+ ;; Update list of un-used faces.
+ (setq hi-lock--unused-faces (remove face hi-lock--unused-faces))
+ ;; Grow the list of defaults.
+ (add-to-list 'hi-lock-face-defaults face t))
+ (intern face)))
(defun hi-lock-set-pattern (regexp face)
"Highlight REGEXP with face FACE."
+ ;; Hashcons the regexp, so it can be passed to remove-overlays later.
+ (setq regexp (hi-lock--hashcons regexp))
(let ((pattern (list regexp (list 0 (list 'quote face) t))))
- (unless (member pattern hi-lock-interactive-patterns)
+ ;; Refuse to highlight a text that is already highlighted.
+ (unless (assoc regexp hi-lock-interactive-patterns)
(push pattern hi-lock-interactive-patterns)
(if font-lock-mode
(progn
(font-lock-add-keywords nil (list pattern) t)
(font-lock-fontify-buffer))
- (let* ((serial (hi-lock-string-serialize regexp))
- (range-min (- (point) (/ hi-lock-highlight-range 2)))
+ (let* ((range-min (- (point) (/ hi-lock-highlight-range 2)))
(range-max (+ (point) (/ hi-lock-highlight-range 2)))
(search-start
(max (point-min)
(while (re-search-forward regexp search-end t)
(let ((overlay (make-overlay (match-beginning 0) (match-end 0))))
(overlay-put overlay 'hi-lock-overlay t)
- (overlay-put overlay 'hi-lock-overlay-regexp serial)
+ (overlay-put overlay 'hi-lock-overlay-regexp regexp)
(overlay-put overlay 'face face))
(goto-char (match-end 0)))))))))
(font-lock-add-keywords nil hi-lock-file-patterns t)
(font-lock-add-keywords nil hi-lock-interactive-patterns t)))
-(defvar hi-lock-string-serialize-hash
- (make-hash-table :test 'equal)
- "Hash table used to assign unique numbers to strings.")
+(defvar hi-lock--hashcons-hash
+ (make-hash-table :test 'equal :weakness t)
+ "Hash table used to hash cons regexps.")
-(defvar hi-lock-string-serialize-serial 1
- "Number assigned to last new string in call to `hi-lock-string-serialize'.
-A string is considered new if it had not previously been used in a call to
-`hi-lock-string-serialize'.")
-
-(defun hi-lock-string-serialize (string)
- "Return unique serial number for STRING."
- (interactive)
- (let ((val (gethash string hi-lock-string-serialize-hash)))
- (if val val
- (puthash string
- (setq hi-lock-string-serialize-serial
- (1+ hi-lock-string-serialize-serial))
- hi-lock-string-serialize-hash)
- hi-lock-string-serialize-serial)))
+(defun hi-lock--hashcons (string)
+ "Return unique object equal to STRING."
+ (or (gethash string hi-lock--hashcons-hash)
+ (puthash string string hi-lock--hashcons-hash)))
(defun hi-lock-unload-function ()
"Unload the Hi-Lock library."
(remove-overlays beg end 'hilit-chg t)
(hilit-chg-display-changes beg end))
-;; Inspired by font-lock. Something like this should be moved to subr.el.
-(defmacro highlight-save-buffer-state (&rest body)
- "Bind variables according to VARLIST and eval BODY restoring buffer state."
- (declare (indent 0) (debug t))
- (let ((modified (make-symbol "modified")))
- `(let* ((,modified (buffer-modified-p))
- (inhibit-modification-hooks t)
- deactivate-mark
- ;; So we don't check the file's mtime.
- buffer-file-name
- buffer-file-truename)
- (progn
- ,@body)
- (unless ,modified
- (restore-buffer-modified-p nil)))))
-
;;;###autoload
(defun highlight-changes-remove-highlight (beg end)
"Remove the change face from the region between BEG and END.
This allows you to manually remove highlighting from uninteresting changes."
(interactive "r")
- (highlight-save-buffer-state
+ (with-silent-modifications
(remove-text-properties beg end '(hilit-chg nil))
(hilit-chg-fixup beg end)))
(if (and highlight-changes-mode
highlight-changes-visible-mode)
(hilit-chg-fixup beg end))
- (highlight-save-buffer-state
- (if (and (= beg end) (> leng-before 0))
- ;; deletion
- (progn
- ;; The eolp and bolp tests are a kludge! But they prevent
- ;; rather nasty looking displays when deleting text at the end
- ;; of line, such as normal corrections as one is typing and
- ;; immediately makes a correction, and when deleting first
- ;; character of a line.
- ;; (if (= leng-before 1)
- ;; (if (eolp)
- ;; (setq beg-decr 0 end-incr 0)
- ;; (if (bolp)
- ;; (setq beg-decr 0))))
- ;; (setq beg (max (- beg beg-decr) (point-min)))
- (setq end (min (+ end end-incr) (point-max)))
- (setq type 'hilit-chg-delete))
- ;; Not a deletion.
- ;; Most of the time the following is not necessary, but
- ;; if the current text was marked as a deletion then
- ;; the old overlay is still in effect. So if the user adds some
- ;; text where she earlier deleted text, we have to remove the
- ;; deletion marking, and replace it explicitly with a `changed'
- ;; marking, otherwise its highlighting would disappear.
- (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete)
- (save-restriction
- (widen)
- (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg)
- (if highlight-changes-visible-mode
- (hilit-chg-fixup beg (+ end 1))))))
- (unless no-property-change
- (put-text-property beg end 'hilit-chg type))
- (if (or highlight-changes-visible-mode no-property-change)
- (hilit-chg-make-ov type beg end)))))))
+ (with-silent-modifications
+ (if (and (= beg end) (> leng-before 0))
+ ;; deletion
+ (progn
+ ;; The eolp and bolp tests are a kludge! But they prevent
+ ;; rather nasty looking displays when deleting text at the end
+ ;; of line, such as normal corrections as one is typing and
+ ;; immediately makes a correction, and when deleting first
+ ;; character of a line.
+ ;; (if (= leng-before 1)
+ ;; (if (eolp)
+ ;; (setq beg-decr 0 end-incr 0)
+ ;; (if (bolp)
+ ;; (setq beg-decr 0))))
+ ;; (setq beg (max (- beg beg-decr) (point-min)))
+ (setq end (min (+ end end-incr) (point-max)))
+ (setq type 'hilit-chg-delete))
+ ;; Not a deletion.
+ ;; Most of the time the following is not necessary, but
+ ;; if the current text was marked as a deletion then
+ ;; the old overlay is still in effect. So if the user adds some
+ ;; text where she earlier deleted text, we have to remove the
+ ;; deletion marking, and replace it explicitly with a `changed'
+ ;; marking, otherwise its highlighting would disappear.
+ (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete)
+ (save-restriction
+ (widen)
+ (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg)
+ (if highlight-changes-visible-mode
+ (hilit-chg-fixup end (+ end 1))))))
+ (unless no-property-change
+ (put-text-property beg end 'hilit-chg type))
+ (if (or highlight-changes-visible-mode no-property-change)
+ (hilit-chg-make-ov type beg end)))))))
(defun hilit-chg-update ()
"Update a buffer's highlight changes when visibility changed."
(message "Cannot remove highlighting from read-only mode buffer %s"
(buffer-name))
(remove-hook 'after-change-functions 'hilit-chg-set-face-on-change t)
- (highlight-save-buffer-state
+ (with-silent-modifications
(hilit-chg-hide-changes)
(hilit-chg-map-changes
(lambda (_prop start stop)
(defun ibuffer-mark-forward (arg)
"Mark the buffer on this line, and move forward ARG lines.
If point is on a group name, this function operates on that group."
- (interactive "P")
- (ibuffer-mark-interactive arg ibuffer-marked-char 1))
+ (interactive "p")
+ (ibuffer-mark-interactive arg ibuffer-marked-char))
(defun ibuffer-unmark-forward (arg)
"Unmark the buffer on this line, and move forward ARG lines.
If point is on a group name, this function operates on that group."
- (interactive "P")
- (ibuffer-mark-interactive arg ?\s 1))
+ (interactive "p")
+ (ibuffer-mark-interactive arg ?\s))
(defun ibuffer-unmark-backward (arg)
"Unmark the buffer on this line, and move backward ARG lines.
If point is on a group name, this function operates on that group."
- (interactive "P")
- (ibuffer-mark-interactive arg ?\s -1))
+ (interactive "p")
+ (ibuffer-unmark-forward (- arg)))
-(defun ibuffer-mark-interactive (arg mark movement)
+(defun ibuffer-mark-interactive (arg mark &optional movement)
(ibuffer-assert-ibuffer-mode)
(or arg (setq arg 1))
+ ;; deprecated movement argument
+ (when (and movement (< movement 0))
+ (setq arg (- arg)))
(ibuffer-forward-line 0)
(ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name)
(progn
(let ((inhibit-read-only t))
(while (> arg 0)
(ibuffer-set-mark mark)
- (ibuffer-forward-line movement t)
- (setq arg (1- arg))))))
+ (ibuffer-forward-line 1 t)
+ (setq arg (1- arg)))
+ (while (< arg 0)
+ (ibuffer-forward-line -1 t)
+ (ibuffer-set-mark mark)
+ (setq arg (1+ arg))))))
(defun ibuffer-set-mark (mark)
(ibuffer-assert-ibuffer-mode)
(make-obsolete-variable
'icomplete-prospects-length 'icomplete-prospects-height "23.1")
+(defcustom icomplete-separator " | "
+ "String used by icomplete to separate alternatives in the minibuffer."
+ :type 'string
+ :version "24.4")
+
;;;_* User Customization variables
(defcustom icomplete-prospects-height
;; 20 is an estimated common size for the prompt + minibuffer content, to
:type 'integer
:group 'icomplete)
-(defcustom icomplete-show-key-bindings t
- "If non-nil, show key bindings as well as completion for sole matches."
- :type 'boolean
- :group 'icomplete)
-
(defcustom icomplete-minibuffer-setup-hook nil
"Icomplete-specific customization of minibuffer setup.
minibuffer completion.")
(add-hook 'icomplete-post-command-hook 'icomplete-exhibit)
-(defun icomplete-get-keys (func-name)
- "Return strings naming keys bound to FUNC-NAME, or nil if none.
-Examines the prior, not current, buffer, presuming that current buffer
-is minibuffer."
- (when (commandp func-name)
- (save-excursion
- (let* ((sym (intern func-name))
- (buf (other-buffer nil t))
- (keys (with-current-buffer buf (where-is-internal sym))))
- (when keys
- (concat "<"
- (mapconcat 'key-description
- (sort keys
- #'(lambda (x y)
- (< (length x) (length y))))
- ", ")
- ">"))))))
;;;_ = icomplete-with-completion-tables
(defvar icomplete-with-completion-tables '(internal-complete-buffer)
"Specialized completion tables with which icomplete should operate.
Icomplete does not operate with any specialized completion tables
except those on this list.")
+(defvar icomplete-minibuffer-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [?\M-\t] 'minibuffer-force-complete)
+ (define-key map [?\C-j] 'minibuffer-force-complete-and-exit)
+ (define-key map [?\C-s] 'icomplete-forward-completions)
+ (define-key map [?\C-r] 'icomplete-backward-completions)
+ map))
+
+(defun icomplete-forward-completions ()
+ "Step forward completions by one entry.
+Second entry becomes the first and can be selected with
+`minibuffer-force-complete-and-exit'."
+ (interactive)
+ (let* ((comps (completion-all-sorted-completions))
+ (last (last comps)))
+ (setcdr last (cons (car comps) (cdr last)))
+ (completion--cache-all-sorted-completions (cdr comps))))
+
+(defun icomplete-backward-completions ()
+ "Step backward completions by one entry.
+Last entry becomes the first and can be selected with
+`minibuffer-force-complete-and-exit'."
+ (interactive)
+ (let* ((comps (completion-all-sorted-completions))
+ (last-but-one (last comps 2))
+ (last (cdr last-but-one)))
+ (when last
+ (setcdr last-but-one (cdr last))
+ (push (car last) comps)
+ (completion--cache-all-sorted-completions comps))))
+
;;;_ > icomplete-mode (&optional prefix)
;;;###autoload
(define-minor-mode icomplete-mode
Usually run by inclusion in `minibuffer-setup-hook'."
(when (and icomplete-mode (icomplete-simple-completing-p))
(set (make-local-variable 'completion-show-inline-help) nil)
+ (use-local-map (make-composed-keymap icomplete-minibuffer-map
+ (current-local-map)))
(add-hook 'pre-command-hook
(lambda () (let ((non-essential t))
(run-hooks 'icomplete-pre-command-hook)))
(goto-char (point-max))
; Insert the match-status information:
(if (and (> (point-max) (minibuffer-prompt-end))
- buffer-undo-list ; Wait for some user input.
- (or
- ;; Don't bother with delay after certain number of chars:
- (> (- (point) (field-beginning)) icomplete-max-delay-chars)
- ;; Don't delay if alternatives number is small enough:
- (and (sequencep minibuffer-completion-table)
- (< (length minibuffer-completion-table)
- icomplete-delay-completions-threshold))
- ;; Delay - give some grace time for next keystroke, before
+ buffer-undo-list ; Wait for some user input.
+ (or
+ ;; Don't bother with delay after certain number of chars:
+ (> (- (point) (field-beginning)) icomplete-max-delay-chars)
+ ;; Don't delay if the completions are known.
+ completion-all-sorted-completions
+ ;; Don't delay if alternatives number is small enough:
+ (and (sequencep minibuffer-completion-table)
+ (< (length minibuffer-completion-table)
+ icomplete-delay-completions-threshold))
+ ;; Delay - give some grace time for next keystroke, before
;; embarking on computing completions:
(sit-for icomplete-compute-delay)))
(let ((text (while-no-input
- (icomplete-completions
- (field-string)
- minibuffer-completion-table
- minibuffer-completion-predicate
+ (icomplete-completions
+ (field-string)
+ minibuffer-completion-table
+ minibuffer-completion-predicate
(not minibuffer-completion-confirm))))
(buffer-undo-list t)
deactivate-mark)
;; Do nothing if while-no-input was aborted.
- (when (stringp text)
+ (when (stringp text)
(move-overlay icomplete-overlay (point) (point) (current-buffer))
;; The current C cursor code doesn't know to use the overlay's
;; marker's stickiness to figure out whether to place the cursor
((= compare (length name))
;; Typical case: name is a prefix.
(substring most compare))
- ((< compare 5) most)
- (t (concat "..." (substring most compare))))
+ ;; Don't bother truncating if it doesn't gain
+ ;; us at least 2 columns.
+ ((< compare 3) most)
+ (t (concat "…" (substring most compare))))
close-bracket)))
;;"-prospects" - more than one candidate
- (prospects-len (+ (length determ) 6 ;; take {,...} into account
- (string-width (buffer-string))))
+ (prospects-len (+ (length determ)
+ (string-width icomplete-separator)
+ 3 ;; take {…} into account
+ (string-width (buffer-string))))
(prospects-max
;; Max total length to use, including the minibuffer content.
(* (+ icomplete-prospects-height
(cond ((string-equal comp "") (setq most-is-exact t))
((member comp prospects))
(t (setq prospects-len
- (+ (string-width comp) 1 prospects-len))
+ (+ (string-width comp)
+ (string-width icomplete-separator)
+ prospects-len))
(if (< prospects-len prospects-max)
(push comp prospects)
(setq limit t))))))
(if prospects
(concat determ
"{"
- (and most-is-exact ",")
- (mapconcat 'identity (nreverse prospects) ",")
- (and limit ",...")
+ (and most-is-exact
+ (substring icomplete-separator
+ (string-match "[^ ]" icomplete-separator)))
+ (mapconcat 'identity (nreverse prospects)
+ icomplete-separator)
+ (and limit (concat icomplete-separator "…"))
"}")
- (concat determ
- " [Matched"
- (let ((keys (and icomplete-show-key-bindings
- (commandp (intern-soft most))
- (icomplete-get-keys most))))
- (if keys (concat "; " keys) ""))
- "]"))))))
+ (concat determ " [Matched]"))))))
;;_* Local emacs vars.
;;Local variables:
(ido-buffer-internal 'insert 'insert-buffer "Insert buffer: " nil ido-text 'ido-enter-insert-file))
((eq ido-exit 'dired)
- (dired (concat ido-current-directory (or ido-text ""))))
+ (funcall (cond ((eq method 'other-window) 'dired-other-window)
+ ((eq method 'other-frame) 'dired-other-frame)
+ (t 'dired))
+ (concat ido-current-directory (or ido-text ""))))
((eq ido-exit 'ffap)
(find-file-at-point))
ido-enable-flex-matching
(> (length ido-text) 1)
(not ido-enable-regexp))
- (setq re (mapconcat #'regexp-quote (split-string ido-text "" t) ".*"))
+ (setq re (concat (regexp-quote (string (aref ido-text 0)))
+ (mapconcat (lambda (c)
+ (concat "[^" (string c) "]*"
+ (regexp-quote (string c))))
+ (substring ido-text 1) "")))
(if ido-enable-prefix
(setq re (concat "\\`" re)))
(mapc
(defvar image-dired-widget-list nil
"List to keep track of meta data in edit buffer.")
+(declare-function widget-forward "wid-edit" (arg))
+
;;;###autoload
(defun image-dired-dired-edit-comment-and-tags ()
"Edit comment and tags of current or marked image files.
Value is a symbol specifying the image type, or nil if type cannot
be determined."
(let (type first)
- (or
- (catch 'found
- (dolist (elem image-type-file-name-regexps)
- (when (string-match-p (car elem) file)
- (setq type (cdr elem))
- (or first (setq first type))
- (if (image-type-available-p type)
- (throw 'found type)))))
- ;; If nothing seems to be supported, return the first type that matched.
- first)))
+ (catch 'found
+ (dolist (elem image-type-file-name-regexps first)
+ (when (string-match-p (car elem) file)
+ (if (image-type-available-p (setq type (cdr elem)))
+ (throw 'found type)
+ ;; If nothing seems to be supported, return first type that matched.
+ (or first (setq first type))))))))
;;;###autoload
(defun image-type (source &optional type data-p)
Return a split and sorted copy of ALIST. The returned alist DOES
NOT share structure with ALIST."
(mapcar (lambda (elt)
- (if (and (consp elt)
- (stringp (car elt))
- (listp (cdr elt)))
+ (if (imenu--subalist-p elt)
(imenu--split-menu (cdr elt) (car elt))
elt))
alist))
(defvar 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
"Non-nil if current Info file supports index cookies.")
(push dir Info-directory-list)))))))
;;;###autoload
-(defun info-other-window (&optional file-or-node)
+(defun info-other-window (&optional file-or-node buffer)
"Like `info' but show the Info buffer in another window."
- (interactive (if current-prefix-arg
- (list (read-file-name "Info file name: " nil nil t))))
- (info-setup file-or-node (switch-to-buffer-other-window "*info*")))
+ (interactive (list
+ (if (and current-prefix-arg (not (numberp current-prefix-arg)))
+ (read-file-name "Info file name: " nil nil t))
+ (if (numberp current-prefix-arg)
+ (format "*info*<%s>" current-prefix-arg))))
+ (info-setup file-or-node
+ (switch-to-buffer-other-window (or buffer "*info*"))))
;;;###autoload (put 'info 'info-file (purecopy "emacs"))
;;;###autoload
In interactive use, a non-numeric prefix argument directs
this command to read a file name from the minibuffer.
-A numeric prefix argument selects an Info buffer with the prefix number
-appended to the Info buffer name.
+
+A numeric prefix argument N selects an Info buffer named
+\"*info*<%s>\".
The search path for Info files is in the variable `Info-directory-list'.
The top-level Info directory is made by combining all the files named `dir'
" ("
(if (stringp Info-current-file)
(replace-regexp-in-string
- "%" "%%" (file-name-nondirectory Info-current-file))
+ "%" "%%"
+ (file-name-sans-extension
+ (file-name-nondirectory Info-current-file)))
(format "*%S*" Info-current-file))
") "
(if Info-current-node
If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file
FILENAME; otherwise, NODENAME should be in the current Info file (or one of
its sub-files).
-Completion is available, but only for node names in the current Info file.
+Completion is available for node names in the current Info file as well as
+in the Info file FILENAME after the closing parenthesis in (FILENAME).
+Empty NODENAME in (FILENAME) defaults to the Top node.
If FORK is non-nil (interactively with a prefix arg), show the node in
a new Info buffer.
If FORK is a string, it is the name to use for the new buffer."
(when (file-name-absolute-p string)
(setq dirs (list (file-name-directory string))))
(let ((names nil)
+ (names-sans-suffix nil)
(suffix (concat (regexp-opt suffixes t) "\\'"))
(string-dir (file-name-directory string)))
(dolist (dir dirs)
;; add the unsuffixed name as a completion option.
(when (string-match suffix file)
(setq file (substring file 0 (match-beginning 0)))
- (push (if string-dir (concat string-dir file) file) names)))))
+ (push (if string-dir (concat string-dir file) file)
+ names-sans-suffix)))))
+ ;; If there is just one file, don't duplicate it with suffixes,
+ ;; so `Info-read-node-name-1' will be able to complete a single
+ ;; candidate and to add the terminating ")".
+ (if (and (= (length names) 1) (= (length names-sans-suffix) 1))
+ (setq names names-sans-suffix)
+ (setq names (append names-sans-suffix names)))
(complete-with-action action names string pred)))
(defun Info-read-node-name-1 (string predicate code)
(substring string 1)
predicate
code))
- ;; If a file name was given, then any node is fair game.
- ((string-match "\\`(" string)
- (cond
- ((eq code nil) string)
- ((eq code t) nil)
- (t t)))
+ ;; If a file name was given, complete nodes in the file.
+ ((string-match "\\`(\\([^)]+\\))" string)
+ (let ((file0 (match-string 0 string))
+ (file1 (match-string 1 string))
+ (nodename (substring string (match-end 0))))
+ (if (and (equal nodename "") (eq code 'lambda))
+ ;; Empty node name is permitted that means "Top".
+ t
+ (completion-table-with-context
+ file0
+ (apply-partially
+ (lambda (string pred action)
+ (complete-with-action
+ action
+ (Info-build-node-completions (Info-find-file file1))
+ string pred)))
+ nodename predicate code))))
;; Otherwise use Info-read-node-completion-table.
(t (complete-with-action
code Info-read-node-completion-table string predicate))))
(defun Info-read-node-name (prompt)
"Read an Info node name with completion, prompting with PROMPT.
A node name can have the form \"NODENAME\", referring to a node
-in the current Info file, or \"(FILENAME)NODENAME\"."
+in the current Info file, or \"(FILENAME)NODENAME\", referring to
+a node in FILENAME. \"(FILENAME)\" is a short format to go to
+the Top node in FILENAME."
(let* ((completion-ignore-case t)
(Info-read-node-completion-table (Info-build-node-completions))
(nodename (completing-read prompt 'Info-read-node-name-1 nil t)))
(Info-read-node-name prompt)
nodename)))
-(defun Info-build-node-completions ()
- (or Info-current-file-completions
- (let ((compl nil)
- ;; Bind this in case the user sets it to nil.
- (case-fold-search t)
- (node-regexp "Node: *\\([^,\n]*\\) *[,\n\t]"))
- (save-excursion
- (save-restriction
- (or Info-tag-table-marker
- (error "No Info tags found"))
- (if (marker-buffer Info-tag-table-marker)
- (let ((marker Info-tag-table-marker))
- (set-buffer (marker-buffer marker))
- (widen)
- (goto-char marker)
- (while (re-search-forward "\n\\(Node\\|Ref\\): \\(.*\\)\177" nil t)
- (setq compl
- (cons (list (match-string-no-properties 2))
- compl))))
+(defun Info-build-node-completions (&optional filename)
+ (if filename
+ (or (cdr (assoc filename Info-file-completions))
+ (with-temp-buffer
+ (Info-mode)
+ (Info-goto-node (format "(%s)Top" filename))
+ (Info-build-node-completions-1)
+ (push (cons filename Info-current-file-completions) Info-file-completions)
+ Info-current-file-completions))
+ (or Info-current-file-completions
+ (Info-build-node-completions-1))))
+
+(defun Info-build-node-completions-1 ()
+ (let ((compl nil)
+ ;; Bind this in case the user sets it to nil.
+ (case-fold-search t)
+ (node-regexp "Node: *\\([^,\n]*\\) *[,\n\t]"))
+ (save-excursion
+ (save-restriction
+ (or Info-tag-table-marker
+ (error "No Info tags found"))
+ (if (marker-buffer Info-tag-table-marker)
+ (let ((marker Info-tag-table-marker))
+ (set-buffer (marker-buffer marker))
(widen)
- (goto-char (point-min))
- ;; If the buffer begins with a node header, process that first.
- (if (Info-node-at-bob-matching node-regexp)
- (setq compl (list (match-string-no-properties 1))))
- ;; Now for the rest of the nodes.
- (while (search-forward "\n\^_" nil t)
- (forward-line 1)
- (let ((beg (point)))
- (forward-line 1)
- (if (re-search-backward node-regexp beg t)
- (setq compl
- (cons (list (match-string-no-properties 1))
- compl))))))))
- (setq compl (cons '("*") compl))
- (set (make-local-variable 'Info-current-file-completions) compl))))
+ (goto-char marker)
+ (while (re-search-forward "\n\\(Node\\|Ref\\): \\(.*\\)\177" nil t)
+ (setq compl
+ (cons (list (match-string-no-properties 2))
+ compl))))
+ (widen)
+ (goto-char (point-min))
+ ;; If the buffer begins with a node header, process that first.
+ (if (Info-node-at-bob-matching node-regexp)
+ (setq compl (list (match-string-no-properties 1))))
+ ;; Now for the rest of the nodes.
+ (while (search-forward "\n\^_" nil t)
+ (forward-line 1)
+ (let ((beg (point)))
+ (forward-line 1)
+ (if (re-search-backward node-regexp beg t)
+ (setq compl
+ (cons (list (match-string-no-properties 1))
+ compl))))))))
+ (setq compl (cons '("*") (nreverse compl)))
+ (set (make-local-variable 'Info-current-file-completions) compl)
+ compl))
+
\f
(defun Info-restore-point (hl)
"If this node has been visited, restore the point value when we left."
(unless Info-current-node
(user-error "No current Info node"))
(let ((node (if (stringp Info-current-file)
- (concat "(" (file-name-nondirectory Info-current-file) ") "
+ (concat "(" (file-name-sans-extension
+ (file-name-nondirectory Info-current-file))
+ ") "
Info-current-node))))
(if (zerop (prefix-numeric-value arg))
(setq node (concat "(info \"" node "\")")))
(if (not (equal node "Top")) node
(format "(%s)Top"
(if (stringp Info-current-file)
- (file-name-nondirectory Info-current-file)
+ (file-name-sans-extension
+ (file-name-nondirectory Info-current-file))
;; Some legacy code can still use a symbol.
Info-current-file)))))
(setq line (concat
(if (re-search-forward
(format "File: %s\\([^,\n\t]+\\),"
(if (stringp Info-current-file)
- (file-name-nondirectory Info-current-file)
+ (file-name-sans-extension
+ (file-name-nondirectory Info-current-file))
Info-current-file))
header-end t)
(put-text-property (match-beginning 1) (match-end 1)
;; current Info node.
(eval-when-compile (require 'speedbar))
+(declare-function speedbar-add-expansion-list "speedbar" (new-list))
+(declare-function speedbar-center-buffer-smartly "speedbar" ())
+(declare-function speedbar-change-expand-button-char "speedbar" (char))
+(declare-function speedbar-change-initial-expansion-list "speedbar" (new-default))
+(declare-function speedbar-delete-subblock "speedbar" (indent))
+(declare-function speedbar-make-specialized-keymap "speedbar" ())
+(declare-function speedbar-make-tag-line "speedbar"
+ (exp-button-type exp-button-char exp-button-function
+ exp-button-data tag-button tag-button-function
+ tag-button-data tag-button-face depth))
+
(defvar Info-speedbar-key-map nil
"Keymap used when in the Info display mode.")
"This implements the `bookmark-make-record-function' type (which see)
for Info nodes."
(let* ((file (and (stringp Info-current-file)
- (file-name-nondirectory Info-current-file)))
+ (file-name-sans-extension
+ (file-name-nondirectory Info-current-file))))
(bookmark-name (if file
(concat "(" file ") " Info-current-node)
Info-current-node))
\f
;;;###autoload
(defun info-display-manual (manual)
- "Go to Info buffer that displays MANUAL, creating it if none already exists."
- (interactive "sManual name: ")
+ "Display an Info buffer displaying MANUAL.
+If there is an existing Info buffer for MANUAL, display it.
+Otherwise, visit the manual in a new Info buffer."
+ (interactive
+ (list
+ (progn
+ (info-initialize)
+ (completing-read "Manual name: "
+ (info--manual-names)
+ nil t))))
(let ((blist (buffer-list))
(manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
(case-fold-search t)
(if found
(switch-to-buffer found)
(info-initialize)
- (info (Info-find-file manual)))))
+ (info (Info-find-file manual)
+ (generate-new-buffer-name "*info*")))))
+
+(defun info--manual-names ()
+ (let (names)
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (and (eq major-mode 'Info-mode)
+ (stringp Info-current-file)
+ (not (string= (substring (buffer-name) 0 1) " "))
+ (push (file-name-sans-extension
+ (file-name-nondirectory Info-current-file))
+ names))))
+ (delete-dups (append (nreverse names)
+ (all-completions
+ ""
+ (apply-partially 'Info-read-node-name-2
+ Info-directory-list
+ (mapcar 'car Info-suffix-list)))))))
(provide 'info)
This function also accepts a hexadecimal number of Unicode code
point or a number in hash notation, e.g. #o21430 for octal,
#x2318 for hex, or #10r8984 for decimal."
- (let* ((completion-ignore-case t)
- (input (completing-read
- prompt
- (lambda (string pred action)
- (if (eq action 'metadata)
- '(metadata (category . unicode-name))
- (complete-with-action action (ucs-names) string pred))))))
- (cond
- ((string-match-p "\\`[0-9a-fA-F]+\\'" input)
- (string-to-number input 16))
- ((string-match-p "\\`#" input)
- (read input))
- (t
- (cdr (assoc-string input (ucs-names) t))))))
+ (let* ((enable-recursive-minibuffers t)
+ (completion-ignore-case t)
+ (input
+ (completing-read
+ prompt
+ (lambda (string pred action)
+ (if (eq action 'metadata)
+ '(metadata (category . unicode-name))
+ (complete-with-action action (ucs-names) string pred)))))
+ (char
+ (cond
+ ((string-match-p "\\`[0-9a-fA-F]+\\'" input)
+ (string-to-number input 16))
+ ((string-match-p "\\`#" input)
+ (read input))
+ (t
+ (cdr (assoc-string input (ucs-names) t))))))
+ (unless (characterp char)
+ (error "Invalid character"))
+ char))
(define-obsolete-function-alias 'ucs-insert 'insert-char "24.3")
(define-key ctl-x-map "8\r" 'insert-char)
they exit Isearch mode before displaying global help."
isearch-help-map)
+(defvar isearch--display-help-action '(nil (inhibit-same-window . t)))
+
(defun isearch-help-for-help ()
"Display Isearch help menu."
(interactive)
- (let (same-window-buffer-names same-window-regexps)
+ (let ((display-buffer-overriding-action isearch--display-help-action))
(isearch-help-for-help-internal))
(isearch-update))
"Show a list of all keys defined in Isearch mode, and their definitions.
This is like `describe-bindings', but displays only Isearch keys."
(interactive)
- (let (same-window-buffer-names same-window-regexps)
+ (let ((display-buffer-overriding-action isearch--display-help-action))
(with-help-window "*Help*"
(with-current-buffer standard-output
(princ "Isearch Mode Bindings:\n")
(defun isearch-describe-key ()
"Display documentation of the function invoked by isearch key."
(interactive)
- (let (same-window-buffer-names same-window-regexps)
+ (let ((display-buffer-overriding-action isearch--display-help-action))
(call-interactively 'describe-key))
(isearch-update))
(defun isearch-describe-mode ()
"Display documentation of Isearch mode."
(interactive)
- (let (same-window-buffer-names same-window-regexps)
+ (let ((display-buffer-overriding-action isearch--display-help-action))
(describe-function 'isearch-forward))
(isearch-update))
(define-key map "\C-x" nil)
(define-key map [?\C-x t] 'isearch-other-control-char)
(define-key map "\C-x8" nil)
- (define-key map "\C-x8\r" 'isearch-other-control-char)
+ (define-key map "\C-x8\r" 'isearch-insert-char-by-name)
map)
"Keymap for `isearch-mode'.")
(length succ-msg)
0))))
-(defun isearch-edit-string ()
- "Edit the search string in the minibuffer.
-The following additional command keys are active while editing.
-\\<minibuffer-local-isearch-map>
-\\[exit-minibuffer] to resume incremental searching with the edited string.
-\\[isearch-nonincremental-exit-minibuffer] to do one nonincremental search.
-\\[isearch-forward-exit-minibuffer] to resume isearching forward.
-\\[isearch-reverse-exit-minibuffer] to resume isearching backward.
-\\[isearch-complete-edit] to complete the search string using the search ring."
-
+(defmacro with-isearch-suspended (&rest body)
+ "Exit Isearch mode, run BODY, and reinvoke the pending search.
+You can update the global isearch variables by setting new values to
+`isearch-new-string', `isearch-new-message', `isearch-new-forward',
+`isearch-new-word', `isearch-new-case-fold'."
;; This code is very hairy for several reasons, explained in the code.
;; Mainly, isearch-mode must be terminated while editing and then restarted.
;; If there were a way to catch any change of buffer from the minibuffer,
;; this could be simplified greatly.
;; Editing doesn't back up the search point. Should it?
- (interactive)
- (condition-case nil
+ `(condition-case nil
(progn
(let ((isearch-nonincremental isearch-nonincremental)
(setq old-point (point) old-other-end isearch-other-end)
(unwind-protect
- (let* ((message-log-max nil)
- ;; Don't add a new search string to the search ring here
- ;; in `read-from-minibuffer'. It should be added only
- ;; by `isearch-update-ring' called from `isearch-done'.
- (history-add-new-input nil)
- ;; Binding minibuffer-history-symbol to nil is a work-around
- ;; for some incompatibility with gmhist.
- (minibuffer-history-symbol))
- (setq isearch-new-string
- (read-from-minibuffer
- (isearch-message-prefix nil isearch-nonincremental)
- (cons isearch-string (1+ (or (isearch-fail-pos)
- (length isearch-string))))
- minibuffer-local-isearch-map nil
- (if isearch-regexp
- (cons 'regexp-search-ring
- (1+ (or regexp-search-ring-yank-pointer -1)))
- (cons 'search-ring
- (1+ (or search-ring-yank-pointer -1))))
- nil t)
- isearch-new-message
- (mapconcat 'isearch-text-char-description
- isearch-new-string "")))
+ (progn ,@body)
;; Set point at the start (end) of old match if forward (backward),
;; so after exiting minibuffer isearch resumes at the start (end)
(isearch-abort) ;; outside of let to restore outside global values
)))
+(defun isearch-edit-string ()
+ "Edit the search string in the minibuffer.
+The following additional command keys are active while editing.
+\\<minibuffer-local-isearch-map>
+\\[exit-minibuffer] to resume incremental searching with the edited string.
+\\[isearch-nonincremental-exit-minibuffer] to do one nonincremental search.
+\\[isearch-forward-exit-minibuffer] to resume isearching forward.
+\\[isearch-reverse-exit-minibuffer] to resume isearching backward.
+\\[isearch-complete-edit] to complete the search string using the search ring."
+ (interactive)
+ (with-isearch-suspended
+ (let* ((message-log-max nil)
+ ;; Don't add a new search string to the search ring here
+ ;; in `read-from-minibuffer'. It should be added only
+ ;; by `isearch-update-ring' called from `isearch-done'.
+ (history-add-new-input nil)
+ ;; Binding minibuffer-history-symbol to nil is a work-around
+ ;; for some incompatibility with gmhist.
+ (minibuffer-history-symbol))
+ (setq isearch-new-string
+ (read-from-minibuffer
+ (isearch-message-prefix nil isearch-nonincremental)
+ (cons isearch-string (1+ (or (isearch-fail-pos)
+ (length isearch-string))))
+ minibuffer-local-isearch-map nil
+ (if isearch-regexp
+ (cons 'regexp-search-ring
+ (1+ (or regexp-search-ring-yank-pointer -1)))
+ (cons 'search-ring
+ (1+ (or search-ring-yank-pointer -1))))
+ nil t)
+ isearch-new-message
+ (mapconcat 'isearch-text-char-description
+ isearch-new-string "")))))
+
(defun isearch-nonincremental-exit-minibuffer ()
(interactive)
(setq isearch-nonincremental t)
\f
(defun isearch-delete-char ()
"Discard last input item and move point back.
+Last input means the last character or the last isearch command
+that added or deleted characters from the search string,
+moved point, toggled regexp mode or case-sensitivity, etc.
If no previous match was done, just beep."
(interactive)
(if (null (cdr isearch-cmds))
(defun isearch-del-char (&optional arg)
"Delete character from end of search string and search again.
+Unlike `isearch-delete-char', it only deletes the last character,
+but doesn't cancel the effect of other isearch command.
If search string is empty, just beep."
(interactive "p")
(if (= 0 (length isearch-string))
(lambda () (let ((inhibit-field-text-motion t))
(line-end-position (if (eolp) 2 1))))))
+(defun isearch-insert-char-by-name ()
+ "Read a character by its Unicode name and insert it into search string."
+ (interactive)
+ (with-isearch-suspended
+ (let ((char (read-char-by-name "Insert character (Unicode name or hex): ")))
+ (when char
+ (setq isearch-new-string (concat isearch-string (string char))
+ isearch-new-message (concat isearch-message
+ (mapconcat 'isearch-text-char-description
+ (string char) "")))))))
+
(defun isearch-search-and-update ()
;; Do the search and update the display.
(when (or isearch-success
;; Copyright (C) 2006-2013 Free Software Foundation, Inc.
;; Author: Edward O'Connor <ted@oconnor.cx>
-;; Version: 1.3
+;; Version: 1.4
;; Keywords: convenience
;; This file is part of GNU Emacs.
;; 2006-12-29 - XEmacs support, from Aidan Kehoe <kehoea@parhasard.net>.
;; 2008-02-21 - Installed in GNU Emacs.
;; 2011-10-17 - Patch `json-alist-p' and `json-plist-p' to avoid recursion -tzz
+;; 2012-10-25 - Added pretty-printed reformatting -Ryan Crum (ryan@ryancrum.org)
;;; Code:
-(eval-when-compile (require 'cl))
;; Compatibility code
tell the difference between `false' and `null'. Consider let-binding
this around your call to `json-read' instead of `setq'ing it.")
+(defvar json-encoding-separator ","
+ "Value to use as an element separator when encoding.")
+
+(defvar json-encoding-default-indentation " "
+ "The default indentation level for encoding.
+Used only when `json-encoding-pretty-print' is non-nil.")
+
+(defvar json--encoding-current-indentation "\n"
+ "Internally used to keep track of the current indentation level of encoding.
+Used only when `json-encoding-pretty-print' is non-nil.")
+
+(defvar json-encoding-pretty-print nil
+ "If non-nil, then the output of `json-encode' will be pretty-printed.")
+
+(defvar json-encoding-lisp-style-closings nil
+ "If non-nil, ] and } closings will be formatted lisp-style,
+without indentation.")
+
\f
;;; Utilities
'not-plist)))
(null list))
+(defmacro json--with-indentation (body)
+ `(let ((json--encoding-current-indentation
+ (if json-encoding-pretty-print
+ (concat json--encoding-current-indentation
+ json-encoding-default-indentation)
+ "")))
+ ,body))
+
;; Reader utilities
(defsubst json-advance (&optional n)
(defun json-encode-hash-table (hash-table)
"Return a JSON representation of HASH-TABLE."
- (format "{%s}"
+ (format "{%s%s}"
(json-join
(let (r)
- (maphash
- (lambda (k v)
- (push (format "%s:%s"
- (json-encode-key k)
- (json-encode v))
- r))
- hash-table)
+ (json--with-indentation
+ (maphash
+ (lambda (k v)
+ (push (format
+ (if json-encoding-pretty-print
+ "%s%s: %s"
+ "%s%s:%s")
+ json--encoding-current-indentation
+ (json-encode-key k)
+ (json-encode v))
+ r))
+ hash-table))
r)
- ", ")))
+ json-encoding-separator)
+ (if (or (not json-encoding-pretty-print)
+ json-encoding-lisp-style-closings)
+ ""
+ json--encoding-current-indentation)))
;; List encoding (including alists and plists)
(defun json-encode-alist (alist)
"Return a JSON representation of ALIST."
- (format "{%s}"
- (json-join (mapcar (lambda (cons)
- (format "%s:%s"
- (json-encode-key (car cons))
- (json-encode (cdr cons))))
- alist)
- ", ")))
+ (format "{%s%s}"
+ (json-join
+ (json--with-indentation
+ (mapcar (lambda (cons)
+ (format (if json-encoding-pretty-print
+ "%s%s: %s"
+ "%s%s:%s")
+ json--encoding-current-indentation
+ (json-encode-key (car cons))
+ (json-encode (cdr cons))))
+ alist))
+ json-encoding-separator)
+ (if (or (not json-encoding-pretty-print)
+ json-encoding-lisp-style-closings)
+ ""
+ json--encoding-current-indentation)))
(defun json-encode-plist (plist)
"Return a JSON representation of PLIST."
(let (result)
- (while plist
- (push (concat (json-encode-key (car plist))
- ":"
- (json-encode (cadr plist)))
- result)
- (setq plist (cddr plist)))
- (concat "{" (json-join (nreverse result) ", ") "}")))
+ (json--with-indentation
+ (while plist
+ (push (concat
+ json--encoding-current-indentation
+ (json-encode-key (car plist))
+ (if json-encoding-pretty-print
+ ": "
+ ":")
+ (json-encode (cadr plist)))
+ result)
+ (setq plist (cddr plist))))
+ (concat "{"
+ (json-join (nreverse result) json-encoding-separator)
+ (if (and json-encoding-pretty-print
+ (not json-encoding-lisp-style-closings))
+ json--encoding-current-indentation
+ "")
+ "}")))
(defun json-encode-list (list)
"Return a JSON representation of LIST.
(defun json-encode-array (array)
"Return a JSON representation of ARRAY."
- (concat "[" (mapconcat 'json-encode array ", ") "]"))
+ (if (and json-encoding-pretty-print
+ (> (length array) 0))
+ (concat
+ (json--with-indentation
+ (concat (format "[%s" json--encoding-current-indentation)
+ (json-join (mapcar 'json-encode array)
+ (format "%s%s"
+ json-encoding-separator
+ json--encoding-current-indentation))))
+ (format "%s]"
+ (if json-encoding-lisp-style-closings
+ ""
+ json--encoding-current-indentation)))
+ (concat "["
+ (mapconcat 'json-encode array json-encoding-separator)
+ "]")))
\f
((listp object) (json-encode-list object))
(t (signal 'json-error (list object)))))
+;; Pretty printing
+
+(defun json-pretty-print-buffer ()
+ "Pretty-print current buffer."
+ (interactive)
+ (json-pretty-print (point-min) (point-max)))
+
+(defun json-pretty-print (begin end)
+ "Pretty-print selected region."
+ (interactive "r")
+ (atomic-change-group
+ (let ((json-encoding-pretty-print t)
+ (txt (delete-and-extract-region begin end)))
+ (insert (json-encode (json-read-from-string txt))))))
+
(provide 'json)
;;; json.el ends here
\f
;;;### (autoloads (5x5-crack 5x5-crack-xor-mutate 5x5-crack-mutating-best
;;;;;; 5x5-crack-mutating-current 5x5-crack-randomly 5x5) "5x5"
-;;;;;; "play/5x5.el" (20706 54231 807276 0))
+;;;;;; "play/5x5.el" (20545 57511 257469 0))
;;; Generated autoloads from play/5x5.el
(autoload '5x5 "5x5" "\
;;;***
\f
;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20576 42138 697312 0))
;;; Generated autoloads from progmodes/ada-mode.el
(autoload 'ada-add-extensions "ada-mode" "\
;;;***
\f
;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from progmodes/ada-stmt.el
(autoload 'ada-header "ada-stmt" "\
;;;***
\f
;;;### (autoloads (ada-find-file) "ada-xref" "progmodes/ada-xref.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20458 56750 651721 0))
;;; Generated autoloads from progmodes/ada-xref.el
(autoload 'ada-find-file "ada-xref" "\
;;;;;; add-change-log-entry-other-window add-change-log-entry find-change-log
;;;;;; prompt-for-change-log-name add-log-mailing-address add-log-full-name
;;;;;; add-log-current-defun-function) "add-log" "vc/add-log.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20665 59189 799105 0))
;;; Generated autoloads from vc/add-log.el
(put 'change-log-default-name 'safe-local-variable 'string-or-null-p)
(defvar add-log-current-defun-function nil "\
If non-nil, function to guess name of surrounding function.
-It is used by `add-log-current-defun' in preference to built-in rules.
-Returns function's name as a string, or nil if outside a function.")
+It is called by `add-log-current-defun' with no argument, and
+should return the function's name as a string, or nil if point is
+outside a function.")
(custom-autoload 'add-log-current-defun-function "add-log" t)
\(fn)" t nil)
-(defvar add-log-lisp-like-modes '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode) "\
-Modes that look like Lisp to `add-log-current-defun'.")
-
-(defvar add-log-c-like-modes '(c-mode c++-mode c++-c-mode objc-mode) "\
-Modes that look like C to `add-log-current-defun'.")
-
-(defvar add-log-tex-like-modes '(TeX-mode plain-TeX-mode LaTeX-mode tex-mode) "\
-Modes that look like TeX to `add-log-current-defun'.")
-
(autoload 'add-log-current-defun "add-log" "\
Return name of function definition point is in, or nil.
\f
;;;### (autoloads (defadvice ad-activate ad-add-advice ad-disable-advice
;;;;;; ad-enable-advice ad-default-compilation-action ad-redefinition-action)
-;;;;;; "advice" "emacs-lisp/advice.el" (20706 54231 807276 0))
+;;;;;; "advice" "emacs-lisp/advice.el" (20660 41272 835092 0))
;;; Generated autoloads from emacs-lisp/advice.el
(defvar ad-redefinition-action 'warn "\
ARGLIST ::= An optional argument list to be used for the advised function
instead of the argument list of the original. The first one found in
before/around/after-advices will be used.
-FLAG ::= `protect'|`disable'|`activate'|`compile'|`preactivate'|`freeze'.
+FLAG ::= `protect'|`disable'|`activate'|`compile'|`preactivate'.
All flags can be specified with unambiguous initial substrings.
DOCSTRING ::= Optional documentation for this piece of advice.
INTERACTIVE-FORM ::= Optional interactive form to be used for the advised
advice state that will be used during activation if appropriate. Only use
this if the `defadvice' gets actually compiled.
-`freeze': Expands the `defadvice' into a redefining `defun/defmacro' according
-to this particular single advice. No other advice information will be saved.
-Frozen advices cannot be undone, they behave like a hard redefinition of
-the advised function. `freeze' implies `activate' and `preactivate'. The
-documentation of the advised function can be dumped onto the `DOC' file
-during preloading.
-
See Info node `(elisp)Advising Functions' for comprehensive documentation.
usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...)
[DOCSTRING] [INTERACTIVE-FORM]
\f
;;;### (autoloads (align-newline-and-indent align-unhighlight-rule
;;;;;; align-highlight-rule align-current align-entire align-regexp
-;;;;;; align) "align" "align.el" (20706 54231 807276 0))
+;;;;;; align) "align" "align.el" (20566 63671 243798 0))
;;; Generated autoloads from align.el
(autoload 'align "align" "\
\f
;;;### (autoloads (outlineify-sticky allout-mode allout-mode-p allout-auto-activation
;;;;;; allout-setup allout-auto-activation-helper) "allout" "allout.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20651 26294 774003 0))
;;; Generated autoloads from allout.el
(autoload 'allout-auto-activation-helper "allout" "\
\f
;;;### (autoloads (allout-widgets-mode allout-widgets-auto-activation
;;;;;; allout-widgets-setup allout-widgets) "allout-widgets" "allout-widgets.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20545 57511 257469 0))
;;; Generated autoloads from allout-widgets.el
(let ((loads (get 'allout-widgets 'custom-loads))) (if (member '"allout-widgets" loads) nil (put 'allout-widgets 'custom-loads (cons '"allout-widgets" loads))))
;;;***
\f
;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp"
-;;;;;; "net/ange-ftp.el" (20706 54231 807276 0))
+;;;;;; "net/ange-ftp.el" (20566 63671 243798 0))
;;; Generated autoloads from net/ange-ftp.el
(defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir)
;;;***
\f
;;;### (autoloads (animate-birthday-present animate-sequence animate-string)
-;;;;;; "animate" "play/animate.el" (20706 54231 807276 0))
+;;;;;; "animate" "play/animate.el" (20545 57511 257469 0))
;;; Generated autoloads from play/animate.el
(autoload 'animate-string "animate" "\
;;;***
\f
;;;### (autoloads (ansi-color-process-output ansi-color-for-comint-mode-on)
-;;;;;; "ansi-color" "ansi-color.el" (20706 54231 807276 0))
+;;;;;; "ansi-color" "ansi-color.el" (20642 11326 759953 0))
;;; Generated autoloads from ansi-color.el
(autoload 'ansi-color-for-comint-mode-on "ansi-color" "\
;;;***
\f
;;;### (autoloads (antlr-set-tabs antlr-mode antlr-show-makefile-rules)
-;;;;;; "antlr-mode" "progmodes/antlr-mode.el" (20706 54231 807276
+;;;;;; "antlr-mode" "progmodes/antlr-mode.el" (20566 63671 243798
;;;;;; 0))
;;; Generated autoloads from progmodes/antlr-mode.el
;;;***
\f
;;;### (autoloads (appt-activate appt-add) "appt" "calendar/appt.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from calendar/appt.el
(autoload 'appt-add "appt" "\
\f
;;;### (autoloads (apropos-documentation apropos-value apropos-library
;;;;;; apropos apropos-documentation-property apropos-command apropos-variable
-;;;;;; apropos-read-pattern) "apropos" "apropos.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; apropos-read-pattern) "apropos" "apropos.el" (20523 62082
+;;;;;; 997685 0))
;;; Generated autoloads from apropos.el
(autoload 'apropos-read-pattern "apropos" "\
;;;***
\f
-;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (20647
+;;;;;; 29243 972198 0))
;;; Generated autoloads from arc-mode.el
(autoload 'archive-mode "arc-mode" "\
;;;***
\f
-;;;### (autoloads (array-mode) "array" "array.el" (20706 54231 807276
+;;;### (autoloads (array-mode) "array" "array.el" (20355 10021 546955
;;;;;; 0))
;;; Generated autoloads from array.el
;;;***
\f
-;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20513
+;;;;;; 18948 537867 0))
;;; Generated autoloads from textmodes/artist.el
(autoload 'artist-mode "artist" "\
;;;***
\f
-;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from progmodes/asm-mode.el
(autoload 'asm-mode "asm-mode" "\
;;;***
\f
;;;### (autoloads (auth-source-cache-expiry) "auth-source" "gnus/auth-source.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20698 56506 332830 0))
;;; Generated autoloads from gnus/auth-source.el
(defvar auth-source-cache-expiry 7200 "\
;;;***
\f
;;;### (autoloads (autoarg-kp-mode autoarg-mode) "autoarg" "autoarg.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from autoarg.el
(defvar autoarg-mode nil "\
;;;***
\f
;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20665 59189 799105 0))
;;; Generated autoloads from progmodes/autoconf.el
(autoload 'autoconf-mode "autoconf" "\
;;;***
\f
;;;### (autoloads (auto-insert-mode define-auto-insert auto-insert)
-;;;;;; "autoinsert" "autoinsert.el" (20706 54231 807276 0))
+;;;;;; "autoinsert" "autoinsert.el" (20566 63671 243798 0))
;;; Generated autoloads from autoinsert.el
(autoload 'auto-insert "autoinsert" "\
\f
;;;### (autoloads (batch-update-autoloads update-directory-autoloads
;;;;;; update-file-autoloads) "autoload" "emacs-lisp/autoload.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20594 43050 277913 0))
;;; Generated autoloads from emacs-lisp/autoload.el
(put 'generated-autoload-file 'safe-local-variable 'stringp)
\f
;;;### (autoloads (global-auto-revert-mode turn-on-auto-revert-tail-mode
;;;;;; auto-revert-tail-mode turn-on-auto-revert-mode auto-revert-mode)
-;;;;;; "autorevert" "autorevert.el" (20706 54231 807276 0))
+;;;;;; "autorevert" "autorevert.el" (20476 31768 298871 0))
;;; Generated autoloads from autorevert.el
(autoload 'auto-revert-mode "autorevert" "\
;;;***
\f
;;;### (autoloads (mouse-avoidance-mode mouse-avoidance-mode) "avoid"
-;;;;;; "avoid.el" (20706 54231 807276 0))
+;;;;;; "avoid.el" (20593 22184 581574 0))
;;; Generated autoloads from avoid.el
(defvar mouse-avoidance-mode nil "\
;;;***
\f
;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20685 44469 497553 0))
;;; Generated autoloads from battery.el
(put 'battery-mode-line-string 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (benchmark benchmark-run-compiled benchmark-run)
-;;;;;; "benchmark" "emacs-lisp/benchmark.el" (20706 54231 807276
+;;;;;; "benchmark" "emacs-lisp/benchmark.el" (20557 48712 315579
;;;;;; 0))
;;; Generated autoloads from emacs-lisp/benchmark.el
;;;***
\f
;;;### (autoloads (bibtex-search-entry bibtex-mode bibtex-initialize)
-;;;;;; "bibtex" "textmodes/bibtex.el" (20706 54231 807276 0))
+;;;;;; "bibtex" "textmodes/bibtex.el" (20576 13095 881042 0))
;;; Generated autoloads from textmodes/bibtex.el
(autoload 'bibtex-initialize "bibtex" "\
;;;***
\f
;;;### (autoloads (bibtex-style-mode) "bibtex-style" "textmodes/bibtex-style.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from textmodes/bibtex-style.el
(autoload 'bibtex-style-mode "bibtex-style" "\
\f
;;;### (autoloads (binhex-decode-region binhex-decode-region-external
;;;;;; binhex-decode-region-internal) "binhex" "mail/binhex.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from mail/binhex.el
(defconst binhex-begin-line "^:...............................................................$" "\
;;;***
\f
-;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (20551
+;;;;;; 9899 283417 0))
;;; Generated autoloads from play/blackbox.el
(autoload 'blackbox "blackbox" "\
;;;;;; bookmark-save bookmark-write bookmark-delete bookmark-insert
;;;;;; bookmark-rename bookmark-insert-location bookmark-relocate
;;;;;; bookmark-jump-other-window bookmark-jump bookmark-set) "bookmark"
-;;;;;; "bookmark.el" (20706 54231 807276 0))
+;;;;;; "bookmark.el" (20630 20152 156327 0))
;;; Generated autoloads from bookmark.el
(define-key ctl-x-r-map "b" 'bookmark-jump)
(define-key ctl-x-r-map "m" 'bookmark-set)
;;;;;; browse-url-xdg-open browse-url-at-mouse browse-url-at-point
;;;;;; browse-url browse-url-of-region browse-url-of-dired-file
;;;;;; browse-url-of-buffer browse-url-of-file browse-url-browser-function)
-;;;;;; "browse-url" "net/browse-url.el" (20706 54231 807276 0))
+;;;;;; "browse-url" "net/browse-url.el" (20566 63671 243798 0))
;;; Generated autoloads from net/browse-url.el
(defvar browse-url-browser-function 'browse-url-default-browser "\
;;;***
\f
;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next)
-;;;;;; "bs" "bs.el" (20706 54231 807276 0))
+;;;;;; "bs" "bs.el" (20576 13095 881042 0))
;;; Generated autoloads from bs.el
(autoload 'bs-cycle-next "bs" "\
;;;***
\f
-;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (20566 63671
+;;;;;; 243798 0))
;;; Generated autoloads from play/bubbles.el
(autoload 'bubbles "bubbles" "\
;;;***
\f
;;;### (autoloads (bug-reference-prog-mode bug-reference-mode) "bug-reference"
-;;;;;; "progmodes/bug-reference.el" (20706 54231 807276 0))
+;;;;;; "progmodes/bug-reference.el" (20593 22184 581574 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)))))
;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile
;;;;;; compile-defun byte-compile-file byte-recompile-directory
;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning)
-;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20706 54231 807276 0))
+;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20656 44218 805102 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)
;;;***
\f
-;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from calendar/cal-china.el
(put 'calendar-chinese-time-zone 'risky-local-variable t)
;;;***
\f
-;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (20461 32935
+;;;;;; 300400 0))
;;; Generated autoloads from calendar/cal-dst.el
(put 'calendar-daylight-savings-starts 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (calendar-hebrew-list-yahrzeits) "cal-hebrew" "calendar/cal-hebrew.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from calendar/cal-hebrew.el
(autoload 'calendar-hebrew-list-yahrzeits "cal-hebrew" "\
\f
;;;### (autoloads (defmath calc-embedded-activate calc-embedded calc-grab-rectangle
;;;;;; calc-grab-region full-calc-keypad calc-keypad calc-eval quick-calc
-;;;;;; full-calc calc calc-dispatch) "calc" "calc/calc.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; full-calc calc calc-dispatch) "calc" "calc/calc.el" (20685
+;;;;;; 44469 497553 0))
;;; Generated autoloads from calc/calc.el
(define-key ctl-x-map "*" 'calc-dispatch)
;;;***
\f
-;;;### (autoloads (calc-undo) "calc-undo" "calc/calc-undo.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (calc-undo) "calc-undo" "calc/calc-undo.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from calc/calc-undo.el
(autoload 'calc-undo "calc-undo" "\
;;;***
\f
-;;;### (autoloads (calculator) "calculator" "calculator.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (calculator) "calculator" "calculator.el" (20476
+;;;;;; 31768 298871 0))
;;; Generated autoloads from calculator.el
(autoload 'calculator "calculator" "\
;;;***
\f
-;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (20594
+;;;;;; 43050 277913 0))
;;; Generated autoloads from calendar/calendar.el
(autoload 'calendar "calendar" "\
;;;***
\f
;;;### (autoloads (canlock-verify canlock-insert-header) "canlock"
-;;;;;; "gnus/canlock.el" (20706 54231 807276 0))
+;;;;;; "gnus/canlock.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/canlock.el
(autoload 'canlock-insert-header "canlock" "\
;;;***
\f
;;;### (autoloads (capitalized-words-mode) "cap-words" "progmodes/cap-words.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from progmodes/cap-words.el
(autoload 'capitalized-words-mode "cap-words" "\
;;;***
\f
-;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from progmodes/cc-compat.el
(put 'c-indent-level 'safe-local-variable 'integerp)
;;;***
\f
;;;### (autoloads (c-guess-basic-syntax) "cc-engine" "progmodes/cc-engine.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20681 47415 473102 0))
;;; Generated autoloads from progmodes/cc-engine.el
(autoload 'c-guess-basic-syntax "cc-engine" "\
\f
;;;### (autoloads (c-guess-install c-guess-region-no-install c-guess-region
;;;;;; c-guess-buffer-no-install c-guess-buffer c-guess-no-install
-;;;;;; c-guess) "cc-guess" "progmodes/cc-guess.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; c-guess) "cc-guess" "progmodes/cc-guess.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from progmodes/cc-guess.el
(defvar c-guess-guessed-offsets-alist nil "\
\f
;;;### (autoloads (awk-mode pike-mode idl-mode java-mode objc-mode
;;;;;; c++-mode c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20665 59189 799105 0))
;;; Generated autoloads from progmodes/cc-mode.el
(autoload 'c-initialize-cc-mode "cc-mode" "\
;;;***
\f
;;;### (autoloads (c-set-offset c-add-style c-set-style) "cc-styles"
-;;;;;; "progmodes/cc-styles.el" (20706 54231 807276 0))
+;;;;;; "progmodes/cc-styles.el" (20566 63671 243798 0))
;;; Generated autoloads from progmodes/cc-styles.el
(autoload 'c-set-style "cc-styles" "\
;;;***
\f
-;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (20595 63909
+;;;;;; 923329 0))
;;; Generated autoloads from progmodes/cc-vars.el
(put 'c-basic-offset 'safe-local-variable 'integerp)
(put 'c-backslash-column 'safe-local-variable 'integerp)
\f
;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program
;;;;;; declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from international/ccl.el
(autoload 'ccl-compile "ccl" "\
;;;***
\f
;;;### (autoloads (cconv-closure-convert) "cconv" "emacs-lisp/cconv.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20453 5437 764254 0))
;;; Generated autoloads from emacs-lisp/cconv.el
(autoload 'cconv-closure-convert "cconv" "\
;;;***
\f
;;;### (autoloads (cfengine-auto-mode cfengine2-mode cfengine3-mode)
-;;;;;; "cfengine" "progmodes/cfengine.el" (20706 54231 807276 0))
+;;;;;; "cfengine" "progmodes/cfengine.el" (20355 10021 546955 0))
;;; Generated autoloads from progmodes/cfengine.el
(autoload 'cfengine3-mode "cfengine" "\
;;;***
\f
;;;### (autoloads (check-declare-directory check-declare-file) "check-declare"
-;;;;;; "emacs-lisp/check-declare.el" (20706 54231 807276 0))
+;;;;;; "emacs-lisp/check-declare.el" (20378 29222 722320 0))
;;; Generated autoloads from emacs-lisp/check-declare.el
(autoload 'check-declare-file "check-declare" "\
;;;;;; checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer
;;;;;; checkdoc-eval-current-buffer checkdoc-message-interactive
;;;;;; checkdoc-interactive checkdoc checkdoc-list-of-strings-p)
-;;;;;; "checkdoc" "emacs-lisp/checkdoc.el" (20706 54231 807276 0))
+;;;;;; "checkdoc" "emacs-lisp/checkdoc.el" (20647 29243 972198 0))
;;; Generated autoloads from emacs-lisp/checkdoc.el
(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp)
(put 'checkdoc-force-history-flag 'safe-local-variable 'booleanp)
\f
;;;### (autoloads (pre-write-encode-hz post-read-decode-hz encode-hz-buffer
;;;;;; encode-hz-region decode-hz-buffer decode-hz-region) "china-util"
-;;;;;; "language/china-util.el" (20706 54231 807276 0))
+;;;;;; "language/china-util.el" (20355 10021 546955 0))
;;; Generated autoloads from language/china-util.el
(autoload 'decode-hz-region "china-util" "\
;;;***
\f
;;;### (autoloads (command-history list-command-history repeat-matching-complex-command)
-;;;;;; "chistory" "chistory.el" (20706 54231 807276 0))
+;;;;;; "chistory" "chistory.el" (20355 10021 546955 0))
;;; Generated autoloads from chistory.el
(autoload 'repeat-matching-complex-command "chistory" "\
;;;***
\f
;;;### (autoloads (common-lisp-indent-function) "cl-indent" "emacs-lisp/cl-indent.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from emacs-lisp/cl-indent.el
(autoload 'common-lisp-indent-function "cl-indent" "\
;;;***
\f
-;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20677 50357
+;;;;;; 68628 0))
;;; Generated autoloads from emacs-lisp/cl-lib.el
(define-obsolete-variable-alias 'custom-print-functions 'cl-custom-print-functions "24.3")
;;;***
\f
;;;### (autoloads (c-macro-expand) "cmacexp" "progmodes/cmacexp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20566 63671 243798 0))
;;; Generated autoloads from progmodes/cmacexp.el
(autoload 'c-macro-expand "cmacexp" "\
;;;***
\f
-;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from cmuscheme.el
(autoload 'run-scheme "cmuscheme" "\
;;;***
\f
-;;;### (autoloads (color-name-to-rgb) "color" "color.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (color-name-to-rgb) "color" "color.el" (20650 54512
+;;;;;; 564403 0))
;;; Generated autoloads from color.el
(autoload 'color-name-to-rgb "color" "\
;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
;;;;;; comint-redirect-send-command-to-process comint-redirect-send-command
;;;;;; comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20700 11832 779612 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) "\
;;;***
\f
;;;### (autoloads (compare-windows) "compare-w" "vc/compare-w.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from vc/compare-w.el
(autoload 'compare-windows "compare-w" "\
;;;;;; compilation-shell-minor-mode compilation-mode compilation-start
;;;;;; compile compilation-disable-input compile-command compilation-search-path
;;;;;; compilation-ask-about-save compilation-window-height compilation-start-hook
-;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (20690
+;;;;;; 62389 885263 0))
;;; Generated autoloads from progmodes/compile.el
(defvar compilation-mode-hook nil "\
;;;***
\f
;;;### (autoloads (dynamic-completion-mode) "completion" "completion.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20495 51111 757560 0))
;;; Generated autoloads from completion.el
(defvar dynamic-completion-mode nil "\
;;;### (autoloads (conf-xdefaults-mode conf-ppd-mode conf-colon-mode
;;;;;; conf-space-keywords conf-space-mode conf-javaprop-mode conf-windows-mode
;;;;;; conf-unix-mode conf-mode) "conf-mode" "textmodes/conf-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from textmodes/conf-mode.el
(autoload 'conf-mode "conf-mode" "\
;;;***
\f
;;;### (autoloads (shuffle-vector cookie-snarf cookie-insert cookie)
-;;;;;; "cookie1" "play/cookie1.el" (20706 54231 807276 0))
+;;;;;; "cookie1" "play/cookie1.el" (20545 57511 257469 0))
;;; Generated autoloads from play/cookie1.el
(autoload 'cookie "cookie1" "\
;;;***
\f
;;;### (autoloads (copyright-update-directory copyright copyright-fix-years
-;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (20518
+;;;;;; 12580 46478 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)
;;;***
\f
;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
-;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20706 54231 807276
+;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20701 32695 861936
;;;;;; 0))
;;; Generated autoloads from progmodes/cperl-mode.el
(put 'cperl-indent-level 'safe-local-variable 'integerp)
;;;***
\f
;;;### (autoloads (cpp-parse-edit cpp-highlight-buffer) "cpp" "progmodes/cpp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from progmodes/cpp.el
(autoload 'cpp-highlight-buffer "cpp" "\
;;;***
\f
;;;### (autoloads (crisp-mode crisp-mode) "crisp" "emulation/crisp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20593 22184 581574 0))
;;; Generated autoloads from emulation/crisp.el
(defvar crisp-mode nil "\
;;;***
\f
;;;### (autoloads (completing-read-multiple) "crm" "emacs-lisp/crm.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from emacs-lisp/crm.el
(autoload 'completing-read-multiple "crm" "\
;;;***
\f
-;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (20665
+;;;;;; 59189 799105 0))
;;; Generated autoloads from textmodes/css-mode.el
(autoload 'css-mode "css-mode" "\
;;;***
\f
;;;### (autoloads (cua-selection-mode cua-mode) "cua-base" "emulation/cua-base.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20434 17809 692608 0))
;;; Generated autoloads from emulation/cua-base.el
(defvar cua-mode nil "\
;;;;;; customize-mode customize customize-push-and-save customize-save-variable
;;;;;; customize-set-variable customize-set-value custom-menu-sort-alphabetically
;;;;;; custom-buffer-sort-alphabetically custom-browse-sort-alphabetically)
-;;;;;; "cus-edit" "cus-edit.el" (20706 54231 807276 0))
+;;;;;; "cus-edit" "cus-edit.el" (20657 65077 880084 0))
;;; Generated autoloads from cus-edit.el
(defvar custom-browse-sort-alphabetically nil "\
;;;***
\f
;;;### (autoloads (customize-themes describe-theme custom-theme-visit-theme
-;;;;;; customize-create-theme) "cus-theme" "cus-theme.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; customize-create-theme) "cus-theme" "cus-theme.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from cus-theme.el
(autoload 'customize-create-theme "cus-theme" "\
;;;***
\f
;;;### (autoloads (cvs-status-mode) "cvs-status" "vc/cvs-status.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20476 31768 298871 0))
;;; Generated autoloads from vc/cvs-status.el
(autoload 'cvs-status-mode "cvs-status" "\
;;;***
\f
;;;### (autoloads (global-cwarn-mode cwarn-mode) "cwarn" "progmodes/cwarn.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20577 33959 40183 0))
;;; Generated autoloads from progmodes/cwarn.el
(autoload 'cwarn-mode "cwarn" "\
\f
;;;### (autoloads (standard-display-cyrillic-translit cyrillic-encode-alternativnyj-char
;;;;;; cyrillic-encode-koi8-r-char) "cyril-util" "language/cyril-util.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from language/cyril-util.el
(autoload 'cyrillic-encode-koi8-r-char "cyril-util" "\
;;;***
\f
;;;### (autoloads (dabbrev-expand dabbrev-completion) "dabbrev" "dabbrev.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20397 45851 446679 0))
;;; Generated autoloads from dabbrev.el
(put 'dabbrev-case-fold-search 'risky-local-variable t)
(put 'dabbrev-case-replace 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (data-debug-new-buffer) "data-debug" "cedet/data-debug.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20586 48936 135199 0))
;;; Generated autoloads from cedet/data-debug.el
(autoload 'data-debug-new-buffer "data-debug" "\
;;;***
\f
-;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (20614
+;;;;;; 54428 654267 0))
;;; Generated autoloads from net/dbus.el
(autoload 'dbus-handle-event "dbus" "\
;;;***
\f
-;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from progmodes/dcl-mode.el
(autoload 'dcl-mode "dcl-mode" "\
;;;***
\f
;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug"
-;;;;;; "emacs-lisp/debug.el" (20706 54231 807276 0))
+;;;;;; "emacs-lisp/debug.el" (20642 11326 759953 0))
;;; Generated autoloads from emacs-lisp/debug.el
(setq debugger 'debug)
any other args you like. In that case, the list of args after the
first will be printed into the backtrace buffer.
-\(fn &rest DEBUGGER-ARGS)" t nil)
+\(fn &rest ARGS)" t nil)
(autoload 'debug-on-entry "debug" "\
Request FUNCTION to invoke debugger each time it is called.
;;;***
\f
;;;### (autoloads (decipher-mode decipher) "decipher" "play/decipher.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20566 63671 243798 0))
;;; Generated autoloads from play/decipher.el
(autoload 'decipher "decipher" "\
;;;***
\f
;;;### (autoloads (delimit-columns-rectangle delimit-columns-region
-;;;;;; delimit-columns-customize) "delim-col" "delim-col.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; delimit-columns-customize) "delim-col" "delim-col.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from delim-col.el
(autoload 'delimit-columns-customize "delim-col" "\
;;;***
\f
-;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from progmodes/delphi.el
(autoload 'delphi-mode "delphi" "\
;;;***
\f
-;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (20613
+;;;;;; 49078 764749 0))
;;; Generated autoloads from delsel.el
(defalias 'pending-delete-mode 'delete-selection-mode)
;;;***
\f
;;;### (autoloads (derived-mode-init-mode-variables define-derived-mode)
-;;;;;; "derived" "emacs-lisp/derived.el" (20706 54231 807276 0))
+;;;;;; "derived" "emacs-lisp/derived.el" (20660 60553 594737 612000))
;;; Generated autoloads from emacs-lisp/derived.el
(autoload 'define-derived-mode "derived" "\
;;;***
\f
;;;### (autoloads (describe-char describe-text-properties) "descr-text"
-;;;;;; "descr-text.el" (20706 54231 807276 0))
+;;;;;; "descr-text.el" (20660 41272 835092 0))
;;; Generated autoloads from descr-text.el
(autoload 'describe-text-properties "descr-text" "\
;;;### (autoloads (desktop-revert desktop-save-in-desktop-dir desktop-change-dir
;;;;;; desktop-load-default desktop-read desktop-remove desktop-save
;;;;;; desktop-clear desktop-locals-to-save desktop-save-mode) "desktop"
-;;;;;; "desktop.el" (20706 54231 807276 0))
+;;;;;; "desktop.el" (20662 46799 344737 276000))
;;; Generated autoloads from desktop.el
(defvar desktop-save-mode nil "\
\f
;;;### (autoloads (gnus-article-outlook-deuglify-article gnus-outlook-deuglify-article
;;;;;; gnus-article-outlook-repair-attribution gnus-article-outlook-unwrap-lines)
-;;;;;; "deuglify" "gnus/deuglify.el" (20706 54231 807276 0))
+;;;;;; "deuglify" "gnus/deuglify.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/deuglify.el
(autoload 'gnus-article-outlook-unwrap-lines "deuglify" "\
;;;***
\f
;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib"
-;;;;;; "calendar/diary-lib.el" (20706 54231 807276 0))
+;;;;;; "calendar/diary-lib.el" (20668 35382 940599 0))
;;; Generated autoloads from calendar/diary-lib.el
(autoload 'diary "diary-lib" "\
\f
;;;### (autoloads (diff-buffer-with-file diff-latest-backup-file
;;;;;; diff-backup diff diff-command diff-switches) "diff" "vc/diff.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20570 60708 993668 0))
;;; Generated autoloads from vc/diff.el
(defvar diff-switches (purecopy "-c") "\
;;;***
\f
;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "vc/diff-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20690 62389 885263 0))
;;; Generated autoloads from vc/diff-mode.el
(autoload 'diff-mode "diff-mode" "\
;;;***
\f
-;;;### (autoloads (dig) "dig" "net/dig.el" (20706 54231 807276 0))
+;;;### (autoloads (dig) "dig" "net/dig.el" (20355 10021 546955 0))
;;; Generated autoloads from net/dig.el
(autoload 'dig "dig" "\
;;;***
\f
;;;### (autoloads (dired-mode dired-noselect dired-other-frame dired-other-window
-;;;;;; dired dired-listing-switches) "dired" "dired.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; dired dired-listing-switches) "dired" "dired.el" (20685 44764
+;;;;;; 669491 35000))
;;; Generated autoloads from dired.el
(defvar dired-listing-switches (purecopy "-al") "\
;;;***
\f
;;;### (autoloads (dirtrack dirtrack-mode) "dirtrack" "dirtrack.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20648 50109 802321 0))
;;; Generated autoloads from dirtrack.el
(autoload 'dirtrack-mode "dirtrack" "\
;;;***
\f
-;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (20497
+;;;;;; 6436 957082 0))
;;; Generated autoloads from emacs-lisp/disass.el
(autoload 'disassemble "disass" "\
;;;;;; standard-display-g1 standard-display-ascii standard-display-default
;;;;;; standard-display-8bit describe-current-display-table describe-display-table
;;;;;; set-display-table-slot display-table-slot make-display-table)
-;;;;;; "disp-table" "disp-table.el" (20706 54231 807276 0))
+;;;;;; "disp-table" "disp-table.el" (20355 10021 546955 0))
;;; Generated autoloads from disp-table.el
(autoload 'make-display-table "disp-table" "\
;;;***
\f
;;;### (autoloads (dissociated-press) "dissociate" "play/dissociate.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20545 57511 257469 0))
;;; Generated autoloads from play/dissociate.el
(autoload 'dissociated-press "dissociate" "\
;;;***
\f
-;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (20355 10021
+;;;;;; 546955 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)) "\
;;;***
\f
;;;### (autoloads (dns-mode-soa-increment-serial dns-mode) "dns-mode"
-;;;;;; "textmodes/dns-mode.el" (20706 54231 807276 0))
+;;;;;; "textmodes/dns-mode.el" (20355 10021 546955 0))
;;; Generated autoloads from textmodes/dns-mode.el
(autoload 'dns-mode "dns-mode" "\
;;;***
\f
;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode-maybe
-;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (20581
+;;;;;; 31014 234484 0))
;;; Generated autoloads from doc-view.el
(autoload 'doc-view-mode-p "doc-view" "\
;;;***
\f
-;;;### (autoloads (doctor) "doctor" "play/doctor.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (doctor) "doctor" "play/doctor.el" (20545 57511
+;;;;;; 257469 0))
;;; Generated autoloads from play/doctor.el
(autoload 'doctor "doctor" "\
;;;***
\f
-;;;### (autoloads (double-mode) "double" "double.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (double-mode) "double" "double.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from double.el
(autoload 'double-mode "double" "\
;;;***
\f
-;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (20545 57511
+;;;;;; 257469 0))
;;; Generated autoloads from play/dunnet.el
(autoload 'dunnet "dunnet" "\
\f
;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap
;;;;;; define-globalized-minor-mode define-minor-mode) "easy-mmode"
-;;;;;; "emacs-lisp/easy-mmode.el" (20706 54231 807276 0))
+;;;;;; "emacs-lisp/easy-mmode.el" (20574 57775 217760 0))
;;; Generated autoloads from emacs-lisp/easy-mmode.el
(defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
;;;***
\f
;;;### (autoloads (easy-menu-change easy-menu-create-menu easy-menu-do-define
-;;;;;; easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (20615
+;;;;;; 49194 141673 0))
;;; Generated autoloads from emacs-lisp/easymenu.el
(autoload 'easy-menu-define "easymenu" "\
;;;;;; ebnf-eps-file ebnf-eps-directory ebnf-spool-region ebnf-spool-buffer
;;;;;; ebnf-spool-file ebnf-spool-directory ebnf-print-region ebnf-print-buffer
;;;;;; ebnf-print-file ebnf-print-directory ebnf-customize) "ebnf2ps"
-;;;;;; "progmodes/ebnf2ps.el" (20706 54231 807276 0))
+;;;;;; "progmodes/ebnf2ps.el" (20566 63671 243798 0))
;;; Generated autoloads from progmodes/ebnf2ps.el
(autoload 'ebnf-customize "ebnf2ps" "\
;;;;;; ebrowse-tags-find-declaration-other-window ebrowse-tags-find-definition
;;;;;; ebrowse-tags-view-definition ebrowse-tags-find-declaration
;;;;;; ebrowse-tags-view-declaration ebrowse-member-mode ebrowse-electric-choose-tree
-;;;;;; ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (20561
+;;;;;; 18280 338092 0))
;;; Generated autoloads from progmodes/ebrowse.el
(autoload 'ebrowse-tree-mode "ebrowse" "\
;;;***
\f
;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20523 62082 997685 0))
;;; Generated autoloads from ebuff-menu.el
(autoload 'electric-buffer-list "ebuff-menu" "\
;;;***
\f
;;;### (autoloads (Electric-command-history-redo-expression) "echistory"
-;;;;;; "echistory.el" (20706 54231 807276 0))
+;;;;;; "echistory.el" (20355 10021 546955 0))
;;; Generated autoloads from echistory.el
(autoload 'Electric-command-history-redo-expression "echistory" "\
;;;***
\f
;;;### (autoloads (ecomplete-setup) "ecomplete" "gnus/ecomplete.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/ecomplete.el
(autoload 'ecomplete-setup "ecomplete" "\
;;;***
\f
-;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (20590 45996
+;;;;;; 129575 0))
;;; Generated autoloads from cedet/ede.el
(defvar global-ede-mode nil "\
\f
;;;### (autoloads (edebug-all-forms edebug-all-defs edebug-eval-top-level-form
;;;;;; edebug-basic-spec edebug-all-forms edebug-all-defs) "edebug"
-;;;;;; "emacs-lisp/edebug.el" (20706 54231 807276 0))
+;;;;;; "emacs-lisp/edebug.el" (20683 2742 588278 0))
;;; Generated autoloads from emacs-lisp/edebug.el
(defvar edebug-all-defs nil "\
;;;;;; ediff-merge-directories-with-ancestor ediff-merge-directories
;;;;;; ediff-directories3 ediff-directory-revisions ediff-directories
;;;;;; ediff-buffers3 ediff-buffers ediff-backup ediff-current-file
-;;;;;; ediff-files3 ediff-files) "ediff" "vc/ediff.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; ediff-files3 ediff-files) "ediff" "vc/ediff.el" (20495 51111
+;;;;;; 757560 0))
;;; Generated autoloads from vc/ediff.el
(autoload 'ediff-files "ediff" "\
;;;***
\f
;;;### (autoloads (ediff-customize) "ediff-help" "vc/ediff-help.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from vc/ediff-help.el
(autoload 'ediff-customize "ediff-help" "\
;;;***
\f
;;;### (autoloads (ediff-show-registry) "ediff-mult" "vc/ediff-mult.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20614 54428 654267 0))
;;; Generated autoloads from vc/ediff-mult.el
(autoload 'ediff-show-registry "ediff-mult" "\
;;;***
\f
;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
-;;;;;; "ediff-util" "vc/ediff-util.el" (20706 54231 807276 0))
+;;;;;; "ediff-util" "vc/ediff-util.el" (20683 39246 740032 0))
;;; Generated autoloads from vc/ediff-util.el
(autoload 'ediff-toggle-multiframe "ediff-util" "\
\f
;;;### (autoloads (format-kbd-macro read-kbd-macro edit-named-kbd-macro
;;;;;; edit-last-kbd-macro edit-kbd-macro) "edmacro" "edmacro.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20476 31768 298871 0))
;;; Generated autoloads from edmacro.el
(autoload 'edit-kbd-macro "edmacro" "\
;;;***
\f
;;;### (autoloads (edt-emulation-on edt-set-scroll-margins) "edt"
-;;;;;; "emulation/edt.el" (20706 54231 807276 0))
+;;;;;; "emulation/edt.el" (20566 63671 243798 0))
;;; Generated autoloads from emulation/edt.el
(autoload 'edt-set-scroll-margins "edt" "\
;;;***
\f
;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20593 22184 581574 0))
;;; Generated autoloads from ehelp.el
(autoload 'with-electric-help "ehelp" "\
;;;***
\f
;;;### (autoloads (customize-object) "eieio-custom" "emacs-lisp/eieio-custom.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20586 48936 135199 0))
;;; Generated autoloads from emacs-lisp/eieio-custom.el
(autoload 'customize-object "eieio-custom" "\
\f
;;;### (autoloads (eieio-describe-generic eieio-describe-constructor
;;;;;; eieio-describe-class eieio-browse) "eieio-opt" "emacs-lisp/eieio-opt.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20617 41641 89638 0))
;;; Generated autoloads from emacs-lisp/eieio-opt.el
(autoload 'eieio-browse "eieio-opt" "\
;;;***
\f
;;;### (autoloads (turn-on-eldoc-mode eldoc-mode eldoc-minor-mode-string)
-;;;;;; "eldoc" "emacs-lisp/eldoc.el" (20706 54231 807276 0))
+;;;;;; "eldoc" "emacs-lisp/eldoc.el" (20355 10021 546955 0))
;;; Generated autoloads from emacs-lisp/eldoc.el
(defvar eldoc-minor-mode-string (purecopy " ElDoc") "\
;;;***
\f
;;;### (autoloads (electric-layout-mode electric-pair-mode electric-indent-mode)
-;;;;;; "electric" "electric.el" (20706 54231 807276 0))
+;;;;;; "electric" "electric.el" (20613 49078 764749 0))
;;; Generated autoloads from electric.el
(defvar electric-indent-chars '(10) "\
;;;***
\f
-;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from elide-head.el
(autoload 'elide-head "elide-head" "\
\f
;;;### (autoloads (elint-initialize elint-defun elint-current-buffer
;;;;;; elint-directory elint-file) "elint" "emacs-lisp/elint.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20486 36135 22104 0))
;;; Generated autoloads from emacs-lisp/elint.el
(autoload 'elint-file "elint" "\
;;;***
\f
;;;### (autoloads (elp-results elp-instrument-package elp-instrument-list
-;;;;;; elp-instrument-function) "elp" "emacs-lisp/elp.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; elp-instrument-function) "elp" "emacs-lisp/elp.el" (20642
+;;;;;; 11326 759953 0))
;;; Generated autoloads from emacs-lisp/elp.el
(autoload 'elp-instrument-function "elp" "\
;;;***
\f
;;;### (autoloads (emacs-lock-mode) "emacs-lock" "emacs-lock.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20577 33959 40183 0))
;;; Generated autoloads from emacs-lock.el
(autoload 'emacs-lock-mode "emacs-lock" "\
;;;***
\f
;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20680 26549 383882 0))
;;; Generated autoloads from mail/emacsbug.el
(autoload 'report-emacs-bug "emacsbug" "\
;;;;;; emerge-revisions emerge-files-with-ancestor-remote emerge-files-remote
;;;;;; emerge-files-with-ancestor-command emerge-files-command emerge-buffers-with-ancestor
;;;;;; emerge-buffers emerge-files-with-ancestor emerge-files) "emerge"
-;;;;;; "vc/emerge.el" (20627 10158 364804 0))
+;;;;;; "vc/emerge.el" (20576 42138 697312 0))
;;; Generated autoloads from vc/emerge.el
(autoload 'emerge-files "emerge" "\
;;;***
\f
;;;### (autoloads (enriched-decode enriched-encode enriched-mode)
-;;;;;; "enriched" "textmodes/enriched.el" (20706 54231 807276 0))
+;;;;;; "enriched" "textmodes/enriched.el" (20461 32935 300400 0))
;;; Generated autoloads from textmodes/enriched.el
(autoload 'enriched-mode "enriched" "\
;;;;;; epa-sign-region epa-verify-cleartext-in-region epa-verify-region
;;;;;; epa-decrypt-armor-in-region epa-decrypt-region epa-encrypt-file
;;;;;; epa-sign-file epa-verify-file epa-decrypt-file epa-select-keys
-;;;;;; epa-list-secret-keys epa-list-keys) "epa" "epa.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; epa-list-secret-keys epa-list-keys) "epa" "epa.el" (20577
+;;;;;; 33959 40183 0))
;;; Generated autoloads from epa.el
(autoload 'epa-list-keys "epa" "\
;;;***
\f
;;;### (autoloads (epa-dired-do-encrypt epa-dired-do-sign epa-dired-do-verify
-;;;;;; epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from epa-dired.el
(autoload 'epa-dired-do-decrypt "epa-dired" "\
;;;***
\f
;;;### (autoloads (epa-file-disable epa-file-enable epa-file-handler)
-;;;;;; "epa-file" "epa-file.el" (20706 54231 807276 0))
+;;;;;; "epa-file" "epa-file.el" (20355 10021 546955 0))
;;; Generated autoloads from epa-file.el
(autoload 'epa-file-handler "epa-file" "\
\f
;;;### (autoloads (epa-global-mail-mode epa-mail-import-keys epa-mail-encrypt
;;;;;; epa-mail-sign epa-mail-verify epa-mail-decrypt epa-mail-mode)
-;;;;;; "epa-mail" "epa-mail.el" (20706 54231 807276 0))
+;;;;;; "epa-mail" "epa-mail.el" (20566 63671 243798 0))
;;; Generated autoloads from epa-mail.el
(autoload 'epa-mail-mode "epa-mail" "\
;;;***
\f
-;;;### (autoloads (epg-make-context) "epg" "epg.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (epg-make-context) "epg" "epg.el" (20701 32695
+;;;;;; 861936 0))
;;; Generated autoloads from epg.el
(autoload 'epg-make-context "epg" "\
;;;***
\f
;;;### (autoloads (epg-expand-group epg-check-configuration epg-configuration)
-;;;;;; "epg-config" "epg-config.el" (20706 54231 807276 0))
+;;;;;; "epg-config" "epg-config.el" (20373 11301 906925 0))
;;; Generated autoloads from epg-config.el
(autoload 'epg-configuration "epg-config" "\
;;;***
\f
;;;### (autoloads (erc-handle-irc-url erc-tls erc erc-select-read-args)
-;;;;;; "erc" "erc/erc.el" (20706 54231 807276 0))
+;;;;;; "erc" "erc/erc.el" (20665 23726 628150 0))
;;; Generated autoloads from erc/erc.el
(autoload 'erc-select-read-args "erc" "\
;;;***
\f
-;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (20591
+;;;;;; 33616 626144 310000))
;;; Generated autoloads from erc/erc-autoaway.el
(autoload 'erc-autoaway-mode "erc-autoaway")
;;;***
\f
-;;;### (autoloads nil "erc-button" "erc/erc-button.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "erc-button" "erc/erc-button.el" (20593 22184
+;;;;;; 581574 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" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (20650 54512
+;;;;;; 564403 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" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (20591 33616
+;;;;;; 736174 412000))
;;; Generated autoloads from erc/erc-compat.el
(autoload 'erc-define-minor-mode "erc-compat")
;;;***
\f
;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC)
-;;;;;; "erc-dcc" "erc/erc-dcc.el" (20706 54231 807276 0))
+;;;;;; "erc-dcc" "erc/erc-dcc.el" (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-dcc.el
(autoload 'erc-dcc-mode "erc-dcc")
;;;***
\f
;;;### (autoloads nil "erc-desktop-notifications" "erc/erc-desktop-notifications.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20593 22184 581574 0))
;;; Generated autoloads from erc/erc-desktop-notifications.el
(autoload 'erc-notifications-mode "erc-desktop-notifications" "" t)
;;;;;; erc-ezb-add-session erc-ezb-end-of-session-list erc-ezb-init-session-list
;;;;;; erc-ezb-identify erc-ezb-notice-autodetect erc-ezb-lookup-action
;;;;;; erc-ezb-get-login erc-cmd-ezb) "erc-ezbounce" "erc/erc-ezbounce.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-ezbounce.el
(autoload 'erc-cmd-ezb "erc-ezbounce" "\
;;;***
\f
-;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (20591
+;;;;;; 33616 776163 920000))
;;; Generated autoloads from erc/erc-fill.el
(autoload 'erc-fill-mode "erc-fill" nil t)
;;;***
\f
;;;### (autoloads (erc-identd-stop erc-identd-start) "erc-identd"
-;;;;;; "erc/erc-identd.el" (20706 54231 807276 0))
+;;;;;; "erc/erc-identd.el" (20591 33616 794740 81000))
;;; Generated autoloads from erc/erc-identd.el
(autoload 'erc-identd-mode "erc-identd")
;;;***
\f
;;;### (autoloads (erc-create-imenu-index) "erc-imenu" "erc/erc-imenu.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20591 33616 794740 81000))
;;; Generated autoloads from erc/erc-imenu.el
(autoload 'erc-create-imenu-index "erc-imenu" "\
;;;***
\f
-;;;### (autoloads nil "erc-join" "erc/erc-join.el" (20706 54231 807276
+;;;### (autoloads nil "erc-join" "erc/erc-join.el" (20650 54512 564403
;;;;;; 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" (20706 54231 807276
-;;;;;; 0))
+;;;### (autoloads nil "erc-list" "erc/erc-list.el" (20591 33616 824757
+;;;;;; 867000))
;;; Generated autoloads from erc/erc-list.el
(autoload 'erc-list-mode "erc-list")
;;;***
\f
;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log"
-;;;;;; "erc/erc-log.el" (20706 54231 807276 0))
+;;;;;; "erc/erc-log.el" (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-log.el
(autoload 'erc-log-mode "erc-log" nil t)
;;;### (autoloads (erc-delete-dangerous-host erc-add-dangerous-host
;;;;;; erc-delete-keyword erc-add-keyword erc-delete-fool erc-add-fool
;;;;;; erc-delete-pal erc-add-pal) "erc-match" "erc/erc-match.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-match.el
(autoload 'erc-match-mode "erc-match")
;;;***
\f
-;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (20706 54231 807276
-;;;;;; 0))
+;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (20591 33616 844710
+;;;;;; 904000))
;;; Generated autoloads from erc/erc-menu.el
(autoload 'erc-menu-mode "erc-menu" nil t)
;;;***
\f
;;;### (autoloads (erc-cmd-WHOLEFT) "erc-netsplit" "erc/erc-netsplit.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-netsplit.el
(autoload 'erc-netsplit-mode "erc-netsplit")
;;;***
\f
;;;### (autoloads (erc-server-select erc-determine-network) "erc-networks"
-;;;;;; "erc/erc-networks.el" (20706 54231 807276 0))
+;;;;;; "erc/erc-networks.el" (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-networks.el
(autoload 'erc-determine-network "erc-networks" "\
;;;***
\f
;;;### (autoloads (pcomplete/erc-mode/NOTIFY erc-cmd-NOTIFY) "erc-notify"
-;;;;;; "erc/erc-notify.el" (20706 54231 807276 0))
+;;;;;; "erc/erc-notify.el" (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-notify.el
(autoload 'erc-notify-mode "erc-notify" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-page" "erc/erc-page.el" (20706 54231 807276
-;;;;;; 0))
+;;;### (autoloads nil "erc-page" "erc/erc-page.el" (20591 33616 864734
+;;;;;; 46000))
;;; Generated autoloads from erc/erc-page.el
(autoload 'erc-page-mode "erc-page")
;;;***
\f
-;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (20650
+;;;;;; 54512 564403 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" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (20591 33616
+;;;;;; 874723 983000))
;;; Generated autoloads from erc/erc-replace.el
(autoload 'erc-replace-mode "erc-replace")
;;;***
\f
-;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (20706 54231 807276
-;;;;;; 0))
+;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (20591 33616 884730
+;;;;;; 605000))
;;; Generated autoloads from erc/erc-ring.el
(autoload 'erc-ring-mode "erc-ring" nil t)
;;;***
\f
;;;### (autoloads (erc-nickserv-identify erc-nickserv-identify-mode)
-;;;;;; "erc-services" "erc/erc-services.el" (20706 54231 807276
+;;;;;; "erc-services" "erc/erc-services.el" (20650 54512 564403
;;;;;; 0))
;;; Generated autoloads from erc/erc-services.el
(autoload 'erc-services-mode "erc-services" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (20591 33616
+;;;;;; 894723 303000))
;;; Generated autoloads from erc/erc-sound.el
(autoload 'erc-sound-mode "erc-sound")
;;;***
\f
;;;### (autoloads (erc-speedbar-browser) "erc-speedbar" "erc/erc-speedbar.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-speedbar.el
(autoload 'erc-speedbar-browser "erc-speedbar" "\
;;;***
\f
-;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (20591
+;;;;;; 33616 904733 437000))
;;; Generated autoloads from erc/erc-spelling.el
(autoload 'erc-spelling-mode "erc-spelling" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (20593 22184
+;;;;;; 581574 0))
;;; Generated autoloads from erc/erc-stamp.el
(autoload 'erc-timestamp-mode "erc-stamp" nil t)
;;;***
\f
;;;### (autoloads (erc-track-minor-mode) "erc-track" "erc/erc-track.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20650 54512 564403 0))
;;; Generated autoloads from erc/erc-track.el
(defvar erc-track-minor-mode nil "\
;;;***
\f
;;;### (autoloads (erc-truncate-buffer erc-truncate-buffer-to-size)
-;;;;;; "erc-truncate" "erc/erc-truncate.el" (20706 54231 807276
-;;;;;; 0))
+;;;;;; "erc-truncate" "erc/erc-truncate.el" (20591 33616 934716
+;;;;;; 526000))
;;; Generated autoloads from erc/erc-truncate.el
(autoload 'erc-truncate-mode "erc-truncate" nil t)
;;;***
\f
;;;### (autoloads (erc-xdcc-add-file) "erc-xdcc" "erc/erc-xdcc.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20591 33616 934716 526000))
;;; Generated autoloads from erc/erc-xdcc.el
(autoload 'erc-xdcc-mode "erc-xdcc")
\f
;;;### (autoloads (ert-describe-test ert-run-tests-interactively
;;;;;; ert-run-tests-batch-and-exit ert-run-tests-batch ert-deftest)
-;;;;;; "ert" "emacs-lisp/ert.el" (20706 54231 807276 0))
+;;;;;; "ert" "emacs-lisp/ert.el" (20655 23358 697173 0))
;;; Generated autoloads from emacs-lisp/ert.el
(autoload 'ert-deftest "ert" "\
;;;***
\f
;;;### (autoloads (ert-kill-all-test-buffers) "ert-x" "emacs-lisp/ert-x.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20655 23358 697173 0))
;;; Generated autoloads from emacs-lisp/ert-x.el
(put 'ert-with-test-buffer 'lisp-indent-function 1)
;;;***
\f
-;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (20593
+;;;;;; 22184 581574 0))
;;; Generated autoloads from eshell/esh-mode.el
(autoload 'eshell-mode "esh-mode" "\
;;;***
\f
;;;### (autoloads (eshell-command-result eshell-command eshell) "eshell"
-;;;;;; "eshell/eshell.el" (20706 54231 807276 0))
+;;;;;; "eshell/eshell.el" (20577 33959 40183 0))
;;; Generated autoloads from eshell/eshell.el
(autoload 'eshell "eshell" "\
;;;;;; visit-tags-table tags-table-mode find-tag-default-function
;;;;;; find-tag-hook tags-add-tables tags-compression-info-list
;;;;;; tags-table-list tags-case-fold-search) "etags" "progmodes/etags.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20693 38586 665915 0))
;;; Generated autoloads from progmodes/etags.el
(defvar tags-file-name nil "\
;;;;;; ethio-fidel-to-sera-marker ethio-fidel-to-sera-region ethio-fidel-to-sera-buffer
;;;;;; ethio-sera-to-fidel-marker ethio-sera-to-fidel-region ethio-sera-to-fidel-buffer
;;;;;; setup-ethiopic-environment-internal) "ethio-util" "language/ethio-util.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from language/ethio-util.el
(autoload 'setup-ethiopic-environment-internal "ethio-util" "\
\f
;;;### (autoloads (eudc-load-eudc eudc-query-form eudc-expand-inline
;;;;;; eudc-get-phone eudc-get-email eudc-set-server) "eudc" "net/eudc.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20478 3673 653810 0))
;;; Generated autoloads from net/eudc.el
(autoload 'eudc-set-server "eudc" "\
\f
;;;### (autoloads (eudc-display-jpeg-as-button eudc-display-jpeg-inline
;;;;;; eudc-display-sound eudc-display-mail eudc-display-url eudc-display-generic-binary)
-;;;;;; "eudc-bob" "net/eudc-bob.el" (20706 54231 807276 0))
+;;;;;; "eudc-bob" "net/eudc-bob.el" (20355 10021 546955 0))
;;; Generated autoloads from net/eudc-bob.el
(autoload 'eudc-display-generic-binary "eudc-bob" "\
;;;***
\f
;;;### (autoloads (eudc-try-bbdb-insert eudc-insert-record-at-point-into-bbdb)
-;;;;;; "eudc-export" "net/eudc-export.el" (20706 54231 807276 0))
+;;;;;; "eudc-export" "net/eudc-export.el" (20355 10021 546955 0))
;;; Generated autoloads from net/eudc-export.el
(autoload 'eudc-insert-record-at-point-into-bbdb "eudc-export" "\
;;;***
\f
;;;### (autoloads (eudc-edit-hotlist) "eudc-hotlist" "net/eudc-hotlist.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from net/eudc-hotlist.el
(autoload 'eudc-edit-hotlist "eudc-hotlist" "\
;;;***
\f
-;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (20453
+;;;;;; 5437 764254 0))
;;; Generated autoloads from emacs-lisp/ewoc.el
(autoload 'ewoc-create "ewoc" "\
;;;### (autoloads (executable-make-buffer-file-executable-if-script-p
;;;;;; executable-self-display executable-set-magic executable-interpret
;;;;;; executable-command-find-posix-p) "executable" "progmodes/executable.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20533 6181 437016 717000))
;;; Generated autoloads from progmodes/executable.el
(autoload 'executable-command-find-posix-p "executable" "\
\f
;;;### (autoloads (expand-jump-to-next-slot expand-jump-to-previous-slot
;;;;;; expand-abbrev-hook expand-add-abbrevs) "expand" "expand.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from expand.el
(autoload 'expand-add-abbrevs "expand" "\
;;;***
\f
-;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (20679 5689
+;;;;;; 779225 0))
;;; Generated autoloads from progmodes/f90.el
(autoload 'f90-mode "f90" "\
;;;### (autoloads (variable-pitch-mode buffer-face-toggle buffer-face-set
;;;;;; buffer-face-mode text-scale-adjust text-scale-decrease text-scale-increase
;;;;;; text-scale-set face-remap-set-base face-remap-reset-base
-;;;;;; face-remap-add-relative) "face-remap" "face-remap.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; face-remap-add-relative) "face-remap" "face-remap.el" (20622
+;;;;;; 22438 32851 0))
;;; Generated autoloads from face-remap.el
(autoload 'face-remap-add-relative "face-remap" "\
\f
;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue
;;;;;; feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts
-;;;;;; feedmail-send-it) "feedmail" "mail/feedmail.el" (20627 10158
-;;;;;; 364804 0))
+;;;;;; feedmail-send-it) "feedmail" "mail/feedmail.el" (20566 63671
+;;;;;; 243798 0))
;;; Generated autoloads from mail/feedmail.el
(autoload 'feedmail-send-it "feedmail" "\
\f
;;;### (autoloads (ffap-bindings ffap-guess-file-name-at-point dired-at-point
;;;;;; ffap-at-mouse ffap-menu find-file-at-point ffap-next) "ffap"
-;;;;;; "ffap.el" (20706 54231 807276 0))
+;;;;;; "ffap.el" (20671 11582 624449 0))
;;; Generated autoloads from ffap.el
(autoload 'ffap-next "ffap" "\
;;;### (autoloads (file-cache-minibuffer-complete file-cache-add-directory-recursively
;;;;;; file-cache-add-directory-using-locate file-cache-add-directory-using-find
;;;;;; file-cache-add-file file-cache-add-directory-list file-cache-add-directory)
-;;;;;; "filecache" "filecache.el" (20706 54231 807276 0))
+;;;;;; "filecache" "filecache.el" (20648 50109 802321 0))
;;; Generated autoloads from filecache.el
(autoload 'file-cache-add-directory "filecache" "\
-Add DIRECTORY to the file cache.
-If the optional REGEXP argument is non-nil, only files which match it will
-be added to the cache.
+Add all files in DIRECTORY to the file cache.
+If called from Lisp with a non-nil REGEXP argument is non-nil,
+only add files whose names match REGEXP.
\(fn DIRECTORY &optional REGEXP)" t nil)
(autoload 'file-cache-add-directory-list "filecache" "\
-Add DIRECTORY-LIST (a list of directory names) to the file cache.
+Add DIRECTORIES (a list of directory names) to the file cache.
+If called interactively, read the directory names one by one.
If the optional REGEXP argument is non-nil, only files which match it
will be added to the cache. Note that the REGEXP is applied to the
files in each directory, not to the directory list itself.
-\(fn DIRECTORY-LIST &optional REGEXP)" t nil)
+\(fn DIRECTORIES &optional REGEXP)" t nil)
(autoload 'file-cache-add-file "filecache" "\
Add FILE to the file cache.
;;;;;; copy-file-locals-to-dir-locals delete-dir-local-variable
;;;;;; add-dir-local-variable delete-file-local-variable-prop-line
;;;;;; add-file-local-variable-prop-line delete-file-local-variable
-;;;;;; add-file-local-variable) "files-x" "files-x.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; add-file-local-variable) "files-x" "files-x.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from files-x.el
(autoload 'add-file-local-variable "files-x" "\
;;;***
\f
-;;;### (autoloads (filesets-init) "filesets" "filesets.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (filesets-init) "filesets" "filesets.el" (20614
+;;;;;; 54428 654267 0))
;;; Generated autoloads from filesets.el
(autoload 'filesets-init "filesets" "\
;;;***
\f
-;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (20655 23358
+;;;;;; 697173 0))
;;; Generated autoloads from find-cmd.el
(autoload 'find-cmd "find-cmd" "\
;;;***
\f
;;;### (autoloads (find-grep-dired find-name-dired find-dired) "find-dired"
-;;;;;; "find-dired.el" (20706 54231 807276 0))
+;;;;;; "find-dired.el" (20355 10021 546955 0))
;;; Generated autoloads from find-dired.el
(autoload 'find-dired "find-dired" "\
\f
;;;### (autoloads (ff-mouse-find-other-file-other-window ff-mouse-find-other-file
;;;;;; ff-find-other-file ff-get-other-file ff-special-constructs)
-;;;;;; "find-file" "find-file.el" (20706 54231 807276 0))
+;;;;;; "find-file" "find-file.el" (20387 44199 24128 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)))) "\
;;;;;; find-variable find-variable-noselect find-function-other-frame
;;;;;; find-function-other-window find-function find-function-noselect
;;;;;; find-function-search-for-symbol find-library) "find-func"
-;;;;;; "emacs-lisp/find-func.el" (20706 54231 807276 0))
+;;;;;; "emacs-lisp/find-func.el" (20497 6436 957082 0))
;;; Generated autoloads from emacs-lisp/find-func.el
(autoload 'find-library "find-func" "\
;;;***
\f
;;;### (autoloads (find-lisp-find-dired-filter find-lisp-find-dired-subdirectories
-;;;;;; find-lisp-find-dired) "find-lisp" "find-lisp.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; find-lisp-find-dired) "find-lisp" "find-lisp.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from find-lisp.el
(autoload 'find-lisp-find-dired "find-lisp" "\
;;;***
\f
;;;### (autoloads (finder-by-keyword finder-commentary finder-list-keywords)
-;;;;;; "finder" "finder.el" (20706 54231 807276 0))
+;;;;;; "finder" "finder.el" (20355 10021 546955 0))
;;; Generated autoloads from finder.el
(autoload 'finder-list-keywords "finder" "\
;;;***
\f
;;;### (autoloads (enable-flow-control-on enable-flow-control) "flow-ctrl"
-;;;;;; "flow-ctrl.el" (20706 54231 807276 0))
+;;;;;; "flow-ctrl.el" (20566 63671 243798 0))
;;; Generated autoloads from flow-ctrl.el
(autoload 'enable-flow-control "flow-ctrl" "\
;;;***
\f
;;;### (autoloads (fill-flowed fill-flowed-encode) "flow-fill" "gnus/flow-fill.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/flow-fill.el
(autoload 'fill-flowed-encode "flow-fill" "\
;;;***
\f
;;;### (autoloads (flymake-find-file-hook flymake-mode-off flymake-mode-on
-;;;;;; flymake-mode) "flymake" "progmodes/flymake.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; flymake-mode) "flymake" "progmodes/flymake.el" (20642 11326
+;;;;;; 759953 0))
;;; Generated autoloads from progmodes/flymake.el
(autoload 'flymake-mode "flymake" "\
\f
;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off
;;;;;; turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode)
-;;;;;; "flyspell" "textmodes/flyspell.el" (20706 54231 807276 0))
+;;;;;; "flyspell" "textmodes/flyspell.el" (20566 63671 243798 0))
;;; Generated autoloads from textmodes/flyspell.el
(autoload 'flyspell-prog-mode "flyspell" "\
\f
;;;### (autoloads (follow-delete-other-windows-and-split follow-mode
;;;;;; turn-off-follow-mode turn-on-follow-mode) "follow" "follow.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20501 3499 284800 0))
;;; Generated autoloads from follow.el
(autoload 'turn-on-follow-mode "follow" "\
;;;***
\f
-;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (20478
+;;;;;; 3673 653810 0))
;;; Generated autoloads from mail/footnote.el
(autoload 'footnote-mode "footnote" "\
;;;***
\f
;;;### (autoloads (forms-find-file-other-window forms-find-file forms-mode)
-;;;;;; "forms" "forms.el" (20706 54231 807276 0))
+;;;;;; "forms" "forms.el" (20427 14766 970343 0))
;;; Generated autoloads from forms.el
(autoload 'forms-mode "forms" "\
;;;***
\f
;;;### (autoloads (fortran-mode) "fortran" "progmodes/fortran.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20438 24024 724594 589000))
;;; Generated autoloads from progmodes/fortran.el
(autoload 'fortran-mode "fortran" "\
;;;***
\f
;;;### (autoloads (fortune fortune-to-signature fortune-compile fortune-from-region
-;;;;;; fortune-add-fortune) "fortune" "play/fortune.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; fortune-add-fortune) "fortune" "play/fortune.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from play/fortune.el
(autoload 'fortune-add-fortune "fortune" "\
;;;***
\f
;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20609 10405 476026 0))
;;; Generated autoloads from progmodes/gdb-mi.el
(defvar gdb-enable-debug nil "\
;;;***
\f
;;;### (autoloads (generic-make-keywords-list generic-mode generic-mode-internal
-;;;;;; define-generic-mode) "generic" "emacs-lisp/generic.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; define-generic-mode) "generic" "emacs-lisp/generic.el" (20406
+;;;;;; 8611 875037 0))
;;; Generated autoloads from emacs-lisp/generic.el
(defvar generic-mode-list nil "\
;;;***
\f
;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20478 3673 653810 0))
;;; Generated autoloads from progmodes/glasses.el
(autoload 'glasses-mode "glasses" "\
\f
;;;### (autoloads (gmm-tool-bar-from-list gmm-widget-p gmm-error
;;;;;; gmm-message gmm-regexp-concat) "gmm-utils" "gnus/gmm-utils.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20672 32446 100992 0))
;;; Generated autoloads from gnus/gmm-utils.el
(autoload 'gmm-regexp-concat "gmm-utils" "\
;;;***
\f
;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
-;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (20681 1859 197031
+;;;;;; 0))
;;; Generated autoloads from gnus/gnus.el
(when (fboundp 'custom-autoload)
(custom-autoload 'gnus-select-method "gnus"))
Pop up a frame to read news.
This will call one of the Gnus commands which is specified by the user
option `gnus-other-frame-function' (default `gnus') with the argument
-ARG if Gnus is not running, otherwise just pop up a Gnus frame. The
-optional second argument DISPLAY should be a standard display string
+ARG if Gnus is not running, otherwise pop up a Gnus frame and run the
+command specified by `gnus-other-frame-resume-function'.
+The optional second argument DISPLAY should be a standard display string
such as \"unix:0\" to specify where to pop up a frame. If DISPLAY is
omitted or the function `make-frame-on-display' is not available, the
current display is used.
;;;;;; gnus-agent-get-undownloaded-list gnus-agent-delete-group
;;;;;; gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize
;;;;;; gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent"
-;;;;;; "gnus/gnus-agent.el" (20706 54231 807276 0))
+;;;;;; "gnus/gnus-agent.el" (20698 56506 332830 0))
;;; Generated autoloads from gnus/gnus-agent.el
(autoload 'gnus-unplugged "gnus-agent" "\
;;;***
\f
;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20700 11832 779612 0))
;;; Generated autoloads from gnus/gnus-art.el
(autoload 'gnus-article-prepare-display "gnus-art" "\
;;;***
\f
;;;### (autoloads (gnus-bookmark-bmenu-list gnus-bookmark-jump gnus-bookmark-set)
-;;;;;; "gnus-bookmark" "gnus/gnus-bookmark.el" (20706 54231 807276
+;;;;;; "gnus-bookmark" "gnus/gnus-bookmark.el" (20672 32446 100992
;;;;;; 0))
;;; Generated autoloads from gnus/gnus-bookmark.el
\f
;;;### (autoloads (gnus-cache-delete-group gnus-cache-rename-group
;;;;;; gnus-cache-generate-nov-databases gnus-cache-generate-active
-;;;;;; gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from gnus/gnus-cache.el
(autoload 'gnus-jog-cache "gnus-cache" "\
;;;***
\f
;;;### (autoloads (gnus-delay-initialize gnus-delay-send-queue gnus-delay-article)
-;;;;;; "gnus-delay" "gnus/gnus-delay.el" (20706 54231 807276 0))
+;;;;;; "gnus-delay" "gnus/gnus-delay.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/gnus-delay.el
(autoload 'gnus-delay-article "gnus-delay" "\
;;;***
\f
;;;### (autoloads (gnus-user-format-function-D gnus-user-format-function-d)
-;;;;;; "gnus-diary" "gnus/gnus-diary.el" (20706 54231 807276 0))
+;;;;;; "gnus-diary" "gnus/gnus-diary.el" (20647 29243 972198 0))
;;; Generated autoloads from gnus/gnus-diary.el
(autoload 'gnus-user-format-function-d "gnus-diary" "\
;;;***
\f
;;;### (autoloads (turn-on-gnus-dired-mode) "gnus-dired" "gnus/gnus-dired.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20628 29298 719852 0))
;;; Generated autoloads from gnus/gnus-dired.el
(autoload 'turn-on-gnus-dired-mode "gnus-dired" "\
;;;***
\f
;;;### (autoloads (gnus-draft-reminder) "gnus-draft" "gnus/gnus-draft.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/gnus-draft.el
(autoload 'gnus-draft-reminder "gnus-draft" "\
\f
;;;### (autoloads (gnus-convert-png-to-face gnus-convert-face-to-png
;;;;;; gnus-face-from-file gnus-x-face-from-file gnus-insert-random-x-face-header
-;;;;;; gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (20549
+;;;;;; 54573 979353 0))
;;; Generated autoloads from gnus/gnus-fun.el
(autoload 'gnus-random-x-face "gnus-fun" "\
;;;***
\f
;;;### (autoloads (gnus-treat-mail-gravatar gnus-treat-from-gravatar)
-;;;;;; "gnus-gravatar" "gnus/gnus-gravatar.el" (20706 54231 807276
+;;;;;; "gnus-gravatar" "gnus/gnus-gravatar.el" (20355 10021 546955
;;;;;; 0))
;;; Generated autoloads from gnus/gnus-gravatar.el
;;;***
\f
;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
-;;;;;; "gnus-group" "gnus/gnus-group.el" (20706 54231 807276 0))
+;;;;;; "gnus-group" "gnus/gnus-group.el" (20698 56506 332830 0))
;;; Generated autoloads from gnus/gnus-group.el
(autoload 'gnus-fetch-group "gnus-group" "\
;;;***
\f
;;;### (autoloads (gnus-html-prefetch-images gnus-article-html) "gnus-html"
-;;;;;; "gnus/gnus-html.el" (20706 54231 807276 0))
+;;;;;; "gnus/gnus-html.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/gnus-html.el
(autoload 'gnus-article-html "gnus-html" "\
;;;***
\f
;;;### (autoloads (gnus-batch-score) "gnus-kill" "gnus/gnus-kill.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20495 51111 757560 0))
;;; Generated autoloads from gnus/gnus-kill.el
(defalias 'gnus-batch-kill 'gnus-batch-score)
\f
;;;### (autoloads (gnus-mailing-list-mode gnus-mailing-list-insinuate
;;;;;; turn-on-gnus-mailing-list-mode) "gnus-ml" "gnus/gnus-ml.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/gnus-ml.el
(autoload 'turn-on-gnus-mailing-list-mode "gnus-ml" "\
\f
;;;### (autoloads (gnus-group-split-fancy gnus-group-split gnus-group-split-update
;;;;;; gnus-group-split-setup) "gnus-mlspl" "gnus/gnus-mlspl.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/gnus-mlspl.el
(autoload 'gnus-group-split-setup "gnus-mlspl" "\
;;;***
\f
;;;### (autoloads (gnus-button-reply gnus-button-mailto gnus-msg-mail)
-;;;;;; "gnus-msg" "gnus/gnus-msg.el" (20706 54231 807276 0))
+;;;;;; "gnus-msg" "gnus/gnus-msg.el" (20701 32695 861936 0))
;;; Generated autoloads from gnus/gnus-msg.el
(autoload 'gnus-msg-mail "gnus-msg" "\
;;;***
\f
;;;### (autoloads (gnus-notifications) "gnus-notifications" "gnus/gnus-notifications.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20593 22184 581574 0))
;;; Generated autoloads from gnus/gnus-notifications.el
(autoload 'gnus-notifications "gnus-notifications" "\
\f
;;;### (autoloads (gnus-treat-newsgroups-picon gnus-treat-mail-picon
;;;;;; gnus-treat-from-picon) "gnus-picon" "gnus/gnus-picon.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20523 62082 997685 0))
;;; Generated autoloads from gnus/gnus-picon.el
(autoload 'gnus-treat-from-picon "gnus-picon" "\
;;;;;; gnus-sorted-nintersection gnus-sorted-range-intersection
;;;;;; gnus-sorted-intersection gnus-intersection gnus-sorted-complement
;;;;;; gnus-sorted-ndifference gnus-sorted-difference) "gnus-range"
-;;;;;; "gnus/gnus-range.el" (20706 54231 807276 0))
+;;;;;; "gnus/gnus-range.el" (20544 36659 880486 0))
;;; Generated autoloads from gnus/gnus-range.el
(autoload 'gnus-sorted-difference "gnus-range" "\
;;;***
\f
;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize)
-;;;;;; "gnus-registry" "gnus/gnus-registry.el" (20706 54231 807276
+;;;;;; "gnus-registry" "gnus/gnus-registry.el" (20672 32446 100992
;;;;;; 0))
;;; Generated autoloads from gnus/gnus-registry.el
;;;***
\f
;;;### (autoloads (gnus-sieve-article-add-rule gnus-sieve-generate
-;;;;;; gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from gnus/gnus-sieve.el
(autoload 'gnus-sieve-update "gnus-sieve" "\
;;;***
\f
;;;### (autoloads (gnus-update-format) "gnus-spec" "gnus/gnus-spec.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20701 32695 861936 0))
;;; Generated autoloads from gnus/gnus-spec.el
(autoload 'gnus-update-format "gnus-spec" "\
;;;***
\f
;;;### (autoloads (gnus-declare-backend) "gnus-start" "gnus/gnus-start.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20681 47415 473102 0))
;;; Generated autoloads from gnus/gnus-start.el
(autoload 'gnus-declare-backend "gnus-start" "\
;;;***
\f
;;;### (autoloads (gnus-summary-bookmark-jump) "gnus-sum" "gnus/gnus-sum.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20698 56506 332830 0))
;;; Generated autoloads from gnus/gnus-sum.el
(autoload 'gnus-summary-bookmark-jump "gnus-sum" "\
;;;***
\f
;;;### (autoloads (gnus-sync-install-hooks gnus-sync-initialize)
-;;;;;; "gnus-sync" "gnus/gnus-sync.el" (20706 54231 807276 0))
+;;;;;; "gnus-sync" "gnus/gnus-sync.el" (20696 14774 167809 0))
;;; Generated autoloads from gnus/gnus-sync.el
(autoload 'gnus-sync-initialize "gnus-sync" "\
;;;***
\f
;;;### (autoloads (gnus-add-configuration) "gnus-win" "gnus/gnus-win.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20447 49522 409090 0))
;;; Generated autoloads from gnus/gnus-win.el
(autoload 'gnus-add-configuration "gnus-win" "\
;;;***
\f
;;;### (autoloads (gnutls-min-prime-bits) "gnutls" "net/gnutls.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20476 31768 298871 0))
;;; Generated autoloads from net/gnutls.el
(defvar gnutls-min-prime-bits 256 "\
;;;***
\f
-;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (20626 19492
+;;;;;; 855904 0))
;;; Generated autoloads from play/gomoku.el
(autoload 'gomoku "gomoku" "\
;;;***
\f
;;;### (autoloads (goto-address-prog-mode goto-address-mode goto-address
-;;;;;; goto-address-at-point) "goto-addr" "net/goto-addr.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; goto-address-at-point) "goto-addr" "net/goto-addr.el" (20566
+;;;;;; 63671 243798 0))
;;; Generated autoloads from net/goto-addr.el
(define-obsolete-function-alias 'goto-address-at-mouse 'goto-address-at-point "22.1")
;;;***
\f
;;;### (autoloads (gravatar-retrieve-synchronously gravatar-retrieve)
-;;;;;; "gravatar" "gnus/gravatar.el" (20706 54231 807276 0))
+;;;;;; "gravatar" "gnus/gravatar.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/gravatar.el
(autoload 'gravatar-retrieve "gravatar" "\
\f
;;;### (autoloads (zrgrep rgrep lgrep grep-find grep grep-mode grep-compute-defaults
;;;;;; grep-process-setup grep-setup-hook grep-find-command grep-command
-;;;;;; grep-window-height) "grep" "progmodes/grep.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; grep-window-height) "grep" "progmodes/grep.el" (20690 62389
+;;;;;; 885263 0))
;;; Generated autoloads from progmodes/grep.el
(defvar grep-window-height nil "\
;;;***
\f
-;;;### (autoloads (gs-load-image) "gs" "gs.el" (20706 54231 807276
+;;;### (autoloads (gs-load-image) "gs" "gs.el" (20355 10021 546955
;;;;;; 0))
;;; Generated autoloads from gs.el
;;;***
\f
;;;### (autoloads (gud-tooltip-mode gdb-script-mode jdb pdb perldb
-;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (20614 55343
+;;;;;; 384716 548000))
;;; Generated autoloads from progmodes/gud.el
(autoload 'gud-gdb "gud" "\
;;;***
\f
-;;;### (autoloads (setf gv-define-simple-setter gv-define-setter
+;;;### (autoloads (gv-ref setf gv-define-simple-setter gv-define-setter
;;;;;; gv--defun-declaration gv-define-expander gv-letplace gv-get)
-;;;;;; "gv" "emacs-lisp/gv.el" (20706 54231 807276 0))
+;;;;;; "gv" "emacs-lisp/gv.el" (20643 32183 554981 0))
;;; Generated autoloads from emacs-lisp/gv.el
(autoload 'gv-get "gv" "\
(put 'gv-place 'edebug-form-spec 'edebug-match-form)
+(autoload 'gv-ref "gv" "\
+Return a reference to PLACE.
+This is like the `&' operator of the C language.
+
+\(fn PLACE)" nil t)
+
;;;***
\f
-;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (20566
+;;;;;; 63671 243798 0))
;;; Generated autoloads from play/handwrite.el
(autoload 'handwrite "handwrite" "\
;;;***
\f
;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
-;;;;;; (20627 10158 364804 0))
+;;;;;; (20478 3673 653810 0))
;;; Generated autoloads from play/hanoi.el
(autoload 'hanoi "hanoi" "\
\f
;;;### (autoloads (mail-check-payment mail-add-payment-async mail-add-payment
;;;;;; hashcash-verify-payment hashcash-insert-payment-async hashcash-insert-payment)
-;;;;;; "hashcash" "mail/hashcash.el" (20706 54231 807276 0))
+;;;;;; "hashcash" "mail/hashcash.el" (20355 10021 546955 0))
;;; Generated autoloads from mail/hashcash.el
(autoload 'hashcash-insert-payment "hashcash" "\
;;;### (autoloads (scan-buf-previous-region scan-buf-next-region
;;;;;; scan-buf-move-to-region help-at-pt-display-when-idle help-at-pt-set-timer
;;;;;; help-at-pt-cancel-timer display-local-help help-at-pt-kbd-string
-;;;;;; help-at-pt-string) "help-at-pt" "help-at-pt.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; help-at-pt-string) "help-at-pt" "help-at-pt.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from help-at-pt.el
(autoload 'help-at-pt-string "help-at-pt" "\
;;;### (autoloads (doc-file-to-info doc-file-to-man describe-categories
;;;;;; describe-syntax describe-variable variable-at-point describe-function-1
;;;;;; find-lisp-object-file-name help-C-file-name describe-function)
-;;;;;; "help-fns" "help-fns.el" (20706 54231 807276 0))
+;;;;;; "help-fns" "help-fns.el" (20692 17721 295021 0))
;;; Generated autoloads from help-fns.el
(autoload 'describe-function "help-fns" "\
;;;***
\f
;;;### (autoloads (three-step-help) "help-macro" "help-macro.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20686 65335 65598 0))
;;; Generated autoloads from help-macro.el
(defvar three-step-help nil "\
;;;### (autoloads (help-bookmark-jump help-xref-on-pp help-insert-xref-button
;;;;;; help-xref-button help-make-xrefs help-buffer help-setup-xref
;;;;;; help-mode-finish help-mode-setup help-mode) "help-mode" "help-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20647 29243 972198 0))
;;; Generated autoloads from help-mode.el
(autoload 'help-mode "help-mode" "\
;;;***
\f
;;;### (autoloads (Helper-help Helper-describe-bindings) "helper"
-;;;;;; "emacs-lisp/helper.el" (20706 54231 807276 0))
+;;;;;; "emacs-lisp/helper.el" (20355 10021 546955 0))
;;; Generated autoloads from emacs-lisp/helper.el
(autoload 'Helper-describe-bindings "helper" "\
;;;***
\f
;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl"
-;;;;;; "hexl.el" (20706 54231 807276 0))
+;;;;;; "hexl.el" (20523 62082 997685 0))
;;; Generated autoloads from hexl.el
(autoload 'hexl-mode "hexl" "\
;;;### (autoloads (hi-lock-write-interactive-patterns hi-lock-unface-buffer
;;;;;; hi-lock-face-phrase-buffer hi-lock-face-buffer hi-lock-line-face-buffer
;;;;;; global-hi-lock-mode hi-lock-mode) "hi-lock" "hi-lock.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20679 5689 779225 0))
;;; Generated autoloads from hi-lock.el
(autoload 'hi-lock-mode "hi-lock" "\
Remove highlighting of each match to REGEXP set by hi-lock.
Interactively, prompt for REGEXP, accepting only regexps
previously inserted by hi-lock interactive functions.
+If REGEXP is t (or if \\[universal-argument] was specified interactively),
+then remove all hi-lock highlighting.
\(fn REGEXP)" t nil)
;;;***
\f
;;;### (autoloads (hide-ifdef-mode) "hideif" "progmodes/hideif.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20588 4262 531841 0))
;;; Generated autoloads from progmodes/hideif.el
(autoload 'hide-ifdef-mode "hideif" "\
;;;***
\f
;;;### (autoloads (turn-off-hideshow hs-minor-mode) "hideshow" "progmodes/hideshow.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20566 63671 243798 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))) "\
;;;;;; highlight-compare-buffers highlight-changes-rotate-faces
;;;;;; highlight-changes-previous-change highlight-changes-next-change
;;;;;; highlight-changes-remove-highlight highlight-changes-visible-mode
-;;;;;; highlight-changes-mode) "hilit-chg" "hilit-chg.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; highlight-changes-mode) "hilit-chg" "hilit-chg.el" (20680
+;;;;;; 26549 383882 0))
;;; Generated autoloads from hilit-chg.el
(autoload 'highlight-changes-mode "hilit-chg" "\
;;;***
\f
;;;### (autoloads (make-hippie-expand-function hippie-expand hippie-expand-try-functions-list)
-;;;;;; "hippie-exp" "hippie-exp.el" (20706 54231 807276 0))
+;;;;;; "hippie-exp" "hippie-exp.el" (20660 41272 835092 0))
;;; Generated autoloads from hippie-exp.el
(defvar hippie-expand-try-functions-list '(try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol) "\
;;;***
\f
;;;### (autoloads (global-hl-line-mode hl-line-mode) "hl-line" "hl-line.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from hl-line.el
(autoload 'hl-line-mode "hl-line" "\
;;;;;; holiday-bahai-holidays holiday-islamic-holidays holiday-christian-holidays
;;;;;; holiday-hebrew-holidays holiday-other-holidays holiday-local-holidays
;;;;;; holiday-oriental-holidays holiday-general-holidays) "holidays"
-;;;;;; "calendar/holidays.el" (20706 54231 807276 0))
+;;;;;; "calendar/holidays.el" (20566 63671 243798 0))
;;; Generated autoloads from calendar/holidays.el
(define-obsolete-variable-alias 'general-holidays 'holiday-general-holidays "23.1")
;;;***
\f
-;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from gnus/html2text.el
(autoload 'html2text "html2text" "\
;;;***
\f
;;;### (autoloads (htmlfontify-copy-and-link-dir htmlfontify-buffer)
-;;;;;; "htmlfontify" "htmlfontify.el" (20706 54231 807276 0))
+;;;;;; "htmlfontify" "htmlfontify.el" (20614 54428 654267 0))
;;; Generated autoloads from htmlfontify.el
(autoload 'htmlfontify-buffer "htmlfontify" "\
;;;***
\f
;;;### (autoloads (define-ibuffer-filter define-ibuffer-op define-ibuffer-sorter
-;;;;;; define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (20478
+;;;;;; 3673 653810 0))
;;; Generated autoloads from ibuf-macs.el
(autoload 'define-ibuffer-column "ibuf-macs" "\
;;;***
\f
;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers)
-;;;;;; "ibuffer" "ibuffer.el" (20706 54231 807276 0))
+;;;;;; "ibuffer" "ibuffer.el" (20647 29243 972198 0))
;;; Generated autoloads from ibuffer.el
(autoload 'ibuffer-list-buffers "ibuffer" "\
\f
;;;### (autoloads (icalendar-import-buffer icalendar-import-file
;;;;;; icalendar-export-region icalendar-export-file) "icalendar"
-;;;;;; "calendar/icalendar.el" (20706 54231 807276 0))
+;;;;;; "calendar/icalendar.el" (20593 22184 581574 0))
;;; Generated autoloads from calendar/icalendar.el
(autoload 'icalendar-export-file "icalendar" "\
;;;***
\f
-;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (20688
+;;;;;; 20662 910837 0))
;;; Generated autoloads from icomplete.el
(defvar icomplete-mode nil "\
;;;***
\f
-;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from progmodes/icon.el
(autoload 'icon-mode "icon" "\
;;;***
\f
;;;### (autoloads (idlwave-shell) "idlw-shell" "progmodes/idlw-shell.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20572 16038 402143 0))
;;; Generated autoloads from progmodes/idlw-shell.el
(autoload 'idlwave-shell "idlw-shell" "\
;;;***
\f
;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20576 42138 697312 0))
;;; Generated autoloads from progmodes/idlwave.el
(autoload 'idlwave-mode "idlwave" "\
;;;;;; ido-find-alternate-file ido-find-file-other-window ido-find-file
;;;;;; ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer
;;;;;; ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window
-;;;;;; ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (20665
+;;;;;; 23733 615437 420000))
;;; Generated autoloads from ido.el
(defvar ido-mode nil "\
;;;***
\f
-;;;### (autoloads (ielm) "ielm" "ielm.el" (20706 54231 807276 0))
+;;;### (autoloads (ielm) "ielm" "ielm.el" (20566 63671 243798 0))
;;; Generated autoloads from ielm.el
(autoload 'ielm "ielm" "\
;;;***
\f
-;;;### (autoloads (iimage-mode) "iimage" "iimage.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (iimage-mode) "iimage" "iimage.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from iimage.el
(define-obsolete-function-alias 'turn-on-iimage-mode 'iimage-mode "24.1")
;;;;;; create-image image-type-auto-detected-p image-type-available-p
;;;;;; image-type image-type-from-file-name image-type-from-file-header
;;;;;; image-type-from-buffer image-type-from-data) "image" "image.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20648 50109 802321 0))
;;; Generated autoloads from image.el
(autoload 'image-type-from-data "image" "\
;;;;;; image-dired-jump-thumbnail-buffer image-dired-delete-tag
;;;;;; image-dired-tag-files image-dired-show-all-from-dir image-dired-display-thumbs
;;;;;; image-dired-dired-with-window-configuration image-dired-dired-toggle-marked-thumbs)
-;;;;;; "image-dired" "image-dired.el" (20706 54231 807276 0))
+;;;;;; "image-dired" "image-dired.el" (20648 50109 802321 0))
;;; Generated autoloads from image-dired.el
(autoload 'image-dired-dired-toggle-marked-thumbs "image-dired" "\
\f
;;;### (autoloads (auto-image-file-mode insert-image-file image-file-name-regexp
;;;;;; image-file-name-regexps image-file-name-extensions) "image-file"
-;;;;;; "image-file.el" (20706 54231 807276 0))
+;;;;;; "image-file.el" (20355 10021 546955 0))
;;; Generated autoloads from image-file.el
(defvar image-file-name-extensions (purecopy '("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg")) "\
;;;***
\f
;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode
-;;;;;; image-mode) "image-mode" "image-mode.el" (20706 54231 807276
+;;;;;; image-mode) "image-mode" "image-mode.el" (20656 44218 805102
;;;;;; 0))
;;; Generated autoloads from image-mode.el
;;;***
\f
;;;### (autoloads (imenu imenu-add-menubar-index imenu-add-to-menubar
-;;;;;; imenu-sort-function) "imenu" "imenu.el" (20706 54231 807276
+;;;;;; imenu-sort-function) "imenu" "imenu.el" (20644 53049 326201
;;;;;; 0))
;;; Generated autoloads from imenu.el
\f
;;;### (autoloads (indian-2-column-to-ucs-region in-is13194-pre-write-conversion
;;;;;; in-is13194-post-read-conversion indian-compose-string indian-compose-region)
-;;;;;; "ind-util" "language/ind-util.el" (20706 54231 807276 0))
+;;;;;; "ind-util" "language/ind-util.el" (20355 10021 546955 0))
;;; Generated autoloads from language/ind-util.el
(autoload 'indian-compose-region "ind-util" "\
;;;***
\f
;;;### (autoloads (inferior-lisp) "inf-lisp" "progmodes/inf-lisp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20584 7212 455152 0))
;;; Generated autoloads from progmodes/inf-lisp.el
(autoload 'inferior-lisp "inf-lisp" "\
;;;;;; Info-goto-emacs-key-command-node Info-goto-emacs-command-node
;;;;;; Info-mode info-finder info-apropos Info-index Info-directory
;;;;;; Info-on-current-buffer info-standalone info-emacs-bug info-emacs-manual
-;;;;;; info info-other-window) "info" "info.el" (20706 54231 807276
+;;;;;; info info-other-window) "info" "info.el" (20702 53568 929244
;;;;;; 0))
;;; Generated autoloads from info.el
(autoload 'info-other-window "info" "\
Like `info' but show the Info buffer in another window.
-\(fn &optional FILE-OR-NODE)" t nil)
+\(fn &optional FILE-OR-NODE BUFFER)" t nil)
(put 'info 'info-file (purecopy "emacs"))
(autoload 'info "info" "\
In interactive use, a non-numeric prefix argument directs
this command to read a file name from the minibuffer.
-A numeric prefix argument selects an Info buffer with the prefix number
-appended to the Info buffer name.
+
+A numeric prefix argument N selects an Info buffer named
+\"*info*<%s>\".
The search path for Info files is in the variable `Info-directory-list'.
The top-level Info directory is made by combining all the files named `dir'
\(fn BMK)" nil nil)
(autoload 'info-display-manual "info" "\
-Go to Info buffer that displays MANUAL, creating it if none already exists.
+Display an Info buffer displaying MANUAL.
+If there is an existing Info buffer for MANUAL, display it.
+Otherwise, visit the manual in a new Info buffer.
\(fn MANUAL)" t nil)
\f
;;;### (autoloads (info-complete-file info-complete-symbol info-lookup-file
;;;;;; info-lookup-symbol info-lookup-reset) "info-look" "info-look.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20474 44971 970015 0))
;;; Generated autoloads from info-look.el
(autoload 'info-lookup-reset "info-look" "\
\f
;;;### (autoloads (info-xref-docstrings info-xref-check-all-custom
;;;;;; info-xref-check-all info-xref-check) "info-xref" "info-xref.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20476 31768 298871 0))
;;; Generated autoloads from info-xref.el
(autoload 'info-xref-check "info-xref" "\
;;;***
\f
;;;### (autoloads (batch-info-validate Info-validate Info-split Info-split-threshold
-;;;;;; Info-tagify) "informat" "informat.el" (20706 54231 807276
+;;;;;; Info-tagify) "informat" "informat.el" (20355 10021 546955
;;;;;; 0))
;;; Generated autoloads from informat.el
;;;***
\f
;;;### (autoloads (inversion-require-emacs) "inversion" "cedet/inversion.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20590 45996 129575 0))
;;; Generated autoloads from cedet/inversion.el
(autoload 'inversion-require-emacs "inversion" "\
\f
;;;### (autoloads (isearch-process-search-multibyte-characters isearch-toggle-input-method
;;;;;; isearch-toggle-specified-input-method) "isearch-x" "international/isearch-x.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from international/isearch-x.el
(autoload 'isearch-toggle-specified-input-method "isearch-x" "\
;;;***
\f
-;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from isearchb.el
(autoload 'isearchb-activate "isearchb" "\
;;;### (autoloads (iso-cvt-define-menu iso-cvt-write-only iso-cvt-read-only
;;;;;; iso-sgml2iso iso-iso2sgml iso-iso2duden iso-iso2gtex iso-gtex2iso
;;;;;; iso-tex2iso iso-iso2tex iso-german iso-spanish) "iso-cvt"
-;;;;;; "international/iso-cvt.el" (20706 54231 807276 0))
+;;;;;; "international/iso-cvt.el" (20355 10021 546955 0))
;;; Generated autoloads from international/iso-cvt.el
(autoload 'iso-spanish "iso-cvt" "\
;;;***
\f
;;;### (autoloads nil "iso-transl" "international/iso-transl.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20486 36135 22104 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 (ispell-message ispell-minor-mode ispell ispell-complete-word-interior-frag
-;;;;;; ispell-complete-word ispell-continue ispell-buffer ispell-comments-and-strings
-;;;;;; ispell-region ispell-change-dictionary ispell-kill-ispell
-;;;;;; ispell-help ispell-pdict-save ispell-word ispell-personal-dictionary)
-;;;;;; "ispell" "textmodes/ispell.el" (20706 54231 807276 0))
+;;;;;; ispell-complete-word ispell-continue ispell-buffer-with-debug
+;;;;;; ispell-buffer ispell-comments-and-strings ispell-region ispell-change-dictionary
+;;;;;; ispell-kill-ispell ispell-help ispell-pdict-save ispell-word
+;;;;;; ispell-personal-dictionary) "ispell" "textmodes/ispell.el"
+;;;;;; (20669 56247 196168 0))
;;; Generated autoloads from textmodes/ispell.el
(put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
\(fn)" t nil)
+(autoload 'ispell-buffer-with-debug "ispell" "\
+`ispell-buffer' with some output sent to `ispell-debug-buffer' buffer.
+Use APPEND to append the info to previous buffer if exists.
+
+\(fn &optional APPEND)" t nil)
+
(autoload 'ispell-continue "ispell" "\
Continue a halted spelling session beginning with the current word.
;;;***
\f
-;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (20577
+;;;;;; 33959 40183 0))
;;; Generated autoloads from iswitchb.el
(defvar iswitchb-mode nil "\
;;;### (autoloads (read-hiragana-string japanese-zenkaku-region japanese-hankaku-region
;;;;;; japanese-hiragana-region japanese-katakana-region japanese-zenkaku
;;;;;; japanese-hankaku japanese-hiragana japanese-katakana setup-japanese-environment-internal)
-;;;;;; "japan-util" "language/japan-util.el" (20706 54231 807276
+;;;;;; "japan-util" "language/japan-util.el" (20355 10021 546955
;;;;;; 0))
;;; Generated autoloads from language/japan-util.el
;;;***
\f
;;;### (autoloads (jka-compr-uninstall jka-compr-handler) "jka-compr"
-;;;;;; "jka-compr.el" (20706 54231 807276 0))
+;;;;;; "jka-compr.el" (20355 10021 546955 0))
;;; Generated autoloads from jka-compr.el
(defvar jka-compr-inhibit nil "\
;;;***
\f
-;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20706 54231 807276
+;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20665 59189 799105
;;;;;; 0))
;;; Generated autoloads from progmodes/js.el
\f
;;;### (autoloads (keypad-setup keypad-numlock-shifted-setup keypad-shifted-setup
;;;;;; keypad-numlock-setup keypad-setup) "keypad" "emulation/keypad.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from emulation/keypad.el
(defvar keypad-setup nil "\
;;;***
\f
;;;### (autoloads (kinsoku) "kinsoku" "international/kinsoku.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from international/kinsoku.el
(autoload 'kinsoku "kinsoku" "\
;;;***
\f
-;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from international/kkc.el
(defvar kkc-after-update-conversion-functions nil "\
;;;### (autoloads (kmacro-end-call-mouse kmacro-end-and-call-macro
;;;;;; kmacro-end-or-call-macro kmacro-start-macro-or-insert-counter
;;;;;; kmacro-call-macro kmacro-end-macro kmacro-start-macro kmacro-exec-ring-item)
-;;;;;; "kmacro" "kmacro.el" (20706 54231 807276 0))
+;;;;;; "kmacro" "kmacro.el" (20471 22929 875294 592000))
;;; Generated autoloads from kmacro.el
(global-set-key "\C-x(" 'kmacro-start-macro)
(global-set-key "\C-x)" 'kmacro-end-macro)
;;;***
\f
;;;### (autoloads (setup-korean-environment-internal) "korea-util"
-;;;;;; "language/korea-util.el" (20706 54231 807276 0))
+;;;;;; "language/korea-util.el" (20501 3499 284800 0))
;;; Generated autoloads from language/korea-util.el
(defvar default-korean-keyboard (purecopy (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) "3" "")) "\
;;;***
\f
;;;### (autoloads (landmark landmark-test-run) "landmark" "play/landmark.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20545 57511 257469 0))
;;; Generated autoloads from play/landmark.el
(defalias 'landmark-repeat 'landmark-test-run)
\f
;;;### (autoloads (lao-compose-region lao-composition-function lao-transcribe-roman-to-lao-string
;;;;;; lao-transcribe-single-roman-syllable-to-lao lao-compose-string)
-;;;;;; "lao-util" "language/lao-util.el" (20706 54231 807276 0))
+;;;;;; "lao-util" "language/lao-util.el" (20355 10021 546955 0))
;;; Generated autoloads from language/lao-util.el
(autoload 'lao-compose-string "lao-util" "\
\f
;;;### (autoloads (latexenc-find-file-coding-system latexenc-coding-system-to-inputenc
;;;;;; latexenc-inputenc-to-coding-system latex-inputenc-coding-alist)
-;;;;;; "latexenc" "international/latexenc.el" (20706 54231 807276
+;;;;;; "latexenc" "international/latexenc.el" (20355 10021 546955
;;;;;; 0))
;;; Generated autoloads from international/latexenc.el
;;;***
\f
;;;### (autoloads (latin1-display-ucs-per-lynx latin1-display latin1-display)
-;;;;;; "latin1-disp" "international/latin1-disp.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; "latin1-disp" "international/latin1-disp.el" (20577 33959
+;;;;;; 40183 0))
;;; Generated autoloads from international/latin1-disp.el
(defvar latin1-display nil "\
;;;***
\f
;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from progmodes/ld-script.el
(autoload 'ld-script-mode "ld-script" "\
;;;***
\f
-;;;### (autoloads (life) "life" "play/life.el" (20706 54231 807276
+;;;### (autoloads (life) "life" "play/life.el" (20545 57511 257469
;;;;;; 0))
;;; Generated autoloads from play/life.el
;;;***
\f
;;;### (autoloads (global-linum-mode linum-mode) "linum" "linum.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20580 10161 446444 0))
;;; Generated autoloads from linum.el
(autoload 'linum-mode "linum" "\
;;;***
\f
-;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (20476
+;;;;;; 31768 298871 0))
;;; Generated autoloads from loadhist.el
(autoload 'unload-feature "loadhist" "\
;;;***
\f
;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;; "locate" "locate.el" (20706 54231 807276 0))
+;;;;;; "locate" "locate.el" (20566 63671 243798 0))
;;; Generated autoloads from locate.el
(defvar locate-ls-subdir-switches (purecopy "-al") "\
;;;***
\f
-;;;### (autoloads (log-edit) "log-edit" "vc/log-edit.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (log-edit) "log-edit" "vc/log-edit.el" (20586 48936
+;;;;;; 135199 0))
;;; Generated autoloads from vc/log-edit.el
(autoload 'log-edit "log-edit" "\
;;;***
\f
-;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (20515
+;;;;;; 36389 544939 0))
;;; Generated autoloads from vc/log-view.el
(autoload 'log-view-mode "log-view" "\
\(fn)" t nil)
-;;;***
-\f
-;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (20706
-;;;;;; 54231 807276 0))
-;;; Generated autoloads from longlines.el
-
-(autoload 'longlines-mode "longlines" "\
-Toggle Long Lines mode in this buffer.
-With a prefix argument ARG, enable Long Lines mode if ARG is
-positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil.
-
-When Long Lines mode is enabled, long lines are wrapped if they
-extend beyond `fill-column'. The soft newlines used for line
-wrapping will not show up when the text is yanked or saved to
-disk.
-
-If the variable `longlines-auto-wrap' is non-nil, lines are
-automatically wrapped whenever the buffer is changed. You can
-always call `fill-paragraph' to fill individual paragraphs.
-
-If the variable `longlines-show-hard-newlines' is non-nil, hard
-newlines are indicated with a symbol.
-
-\(fn &optional ARG)" t nil)
-
;;;***
\f
;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer
-;;;;;; lpr-command lpr-switches printer-name) "lpr" "lpr.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; lpr-command lpr-switches printer-name) "lpr" "lpr.el" (20476
+;;;;;; 31768 298871 0))
;;; Generated autoloads from lpr.el
(defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)) "\
;;;***
\f
;;;### (autoloads (ls-lisp-support-shell-wildcards) "ls-lisp" "ls-lisp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from ls-lisp.el
(defvar ls-lisp-support-shell-wildcards t "\
;;;***
\f
-;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (20566
+;;;;;; 63671 243798 0))
;;; Generated autoloads from calendar/lunar.el
(autoload 'lunar-phases "lunar" "\
;;;***
\f
-;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (20665
+;;;;;; 59189 799105 0))
;;; Generated autoloads from progmodes/m4-mode.el
(autoload 'm4-mode "m4-mode" "\
;;;***
\f
;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro
-;;;;;; name-last-kbd-macro) "macros" "macros.el" (20706 54231 807276
+;;;;;; name-last-kbd-macro) "macros" "macros.el" (20355 10021 546955
;;;;;; 0))
;;; Generated autoloads from macros.el
;;;***
\f
;;;### (autoloads (what-domain mail-extract-address-components) "mail-extr"
-;;;;;; "mail/mail-extr.el" (20706 54231 807276 0))
+;;;;;; "mail/mail-extr.el" (20355 10021 546955 0))
;;; Generated autoloads from mail/mail-extr.el
(autoload 'mail-extract-address-components "mail-extr" "\
\f
;;;### (autoloads (mail-hist-put-headers-into-history mail-hist-keep-history
;;;;;; mail-hist-enable mail-hist-define-keys) "mail-hist" "mail/mail-hist.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20566 63671 243798 0))
;;; Generated autoloads from mail/mail-hist.el
(autoload 'mail-hist-define-keys "mail-hist" "\
;;;### (autoloads (mail-fetch-field mail-unquote-printable-region
;;;;;; mail-unquote-printable mail-quote-printable-region mail-quote-printable
;;;;;; mail-file-babyl-p mail-dont-reply-to-names mail-use-rfc822)
-;;;;;; "mail-utils" "mail/mail-utils.el" (20706 54231 807276 0))
+;;;;;; "mail-utils" "mail/mail-utils.el" (20355 10021 546955 0))
;;; Generated autoloads from mail/mail-utils.el
(defvar mail-use-rfc822 nil "\
;;;***
\f
;;;### (autoloads (define-mail-abbrev build-mail-abbrevs mail-abbrevs-setup
-;;;;;; mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (20672
+;;;;;; 32446 100992 0))
;;; Generated autoloads from mail/mailabbrev.el
(defvar mail-abbrevs-mode nil "\
\f
;;;### (autoloads (mail-complete mail-completion-at-point-function
;;;;;; define-mail-alias expand-mail-aliases mail-complete-style)
-;;;;;; "mailalias" "mail/mailalias.el" (20706 54231 807276 0))
+;;;;;; "mailalias" "mail/mailalias.el" (20577 33959 40183 0))
;;; Generated autoloads from mail/mailalias.el
(defvar mail-complete-style 'angles "\
;;;***
\f
;;;### (autoloads (mailclient-send-it) "mailclient" "mail/mailclient.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from mail/mailclient.el
(autoload 'mailclient-send-it "mailclient" "\
\f
;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode
;;;;;; makefile-gmake-mode makefile-automake-mode makefile-mode)
-;;;;;; "make-mode" "progmodes/make-mode.el" (20706 54231 807276
+;;;;;; "make-mode" "progmodes/make-mode.el" (20665 59189 799105
;;;;;; 0))
;;; Generated autoloads from progmodes/make-mode.el
;;;***
\f
-;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from makesum.el
(autoload 'make-command-summary "makesum" "\
;;;***
\f
;;;### (autoloads (Man-bookmark-jump man-follow man) "man" "man.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20523 62082 997685 0))
;;; Generated autoloads from man.el
(defalias 'manual-entry 'man)
;;;***
\f
-;;;### (autoloads (master-mode) "master" "master.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (master-mode) "master" "master.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from master.el
(autoload 'master-mode "master" "\
;;;***
\f
;;;### (autoloads (minibuffer-depth-indicate-mode) "mb-depth" "mb-depth.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from mb-depth.el
(defvar minibuffer-depth-indicate-mode nil "\
;;;;;; message-forward-make-body message-forward message-recover
;;;;;; message-supersede message-cancel-news message-followup message-wide-reply
;;;;;; message-reply message-news message-mail message-mode) "message"
-;;;;;; "gnus/message.el" (20706 54231 807276 0))
+;;;;;; "gnus/message.el" (20698 56506 332830 0))
;;; Generated autoloads from gnus/message.el
(define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook)
;;;***
\f
;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20399 35365 4050 0))
;;; Generated autoloads from progmodes/meta-mode.el
(autoload 'metafont-mode "meta-mode" "\
\f
;;;### (autoloads (metamail-region metamail-buffer metamail-interpret-body
;;;;;; metamail-interpret-header) "metamail" "mail/metamail.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from mail/metamail.el
(autoload 'metamail-interpret-header "metamail" "\
\f
;;;### (autoloads (mh-fully-kill-draft mh-send-letter mh-user-agent-compose
;;;;;; mh-smail-batch mh-smail-other-window mh-smail) "mh-comp"
-;;;;;; "mh-e/mh-comp.el" (20706 54231 807276 0))
+;;;;;; "mh-e/mh-comp.el" (20659 20411 59719 0))
;;; Generated autoloads from mh-e/mh-comp.el
(autoload 'mh-smail "mh-comp" "\
;;;***
\f
-;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (20673 53308
+;;;;;; 39372 0))
;;; Generated autoloads from mh-e/mh-e.el
(put 'mh-progs 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (mh-folder-mode mh-nmail mh-rmail) "mh-folder"
-;;;;;; "mh-e/mh-folder.el" (20706 54231 807276 0))
+;;;;;; "mh-e/mh-folder.el" (20659 20411 59719 0))
;;; Generated autoloads from mh-e/mh-folder.el
(autoload 'mh-rmail "mh-folder" "\
;;;***
\f
;;;### (autoloads (midnight-delay-set clean-buffer-list) "midnight"
-;;;;;; "midnight.el" (20706 54231 807276 0))
+;;;;;; "midnight.el" (20478 3673 653810 0))
;;; Generated autoloads from midnight.el
(autoload 'clean-buffer-list "midnight" "\
;;;***
\f
;;;### (autoloads (minibuffer-electric-default-mode) "minibuf-eldef"
-;;;;;; "minibuf-eldef.el" (20706 54231 807276 0))
+;;;;;; "minibuf-eldef.el" (20672 32446 100992 0))
;;; Generated autoloads from minibuf-eldef.el
(defvar minibuffer-electric-default-mode nil "\
;;;***
\f
;;;### (autoloads (list-dynamic-libraries butterfly) "misc" "misc.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20533 5993 500881 0))
;;; Generated autoloads from misc.el
(autoload 'butterfly "misc" "\
\f
;;;### (autoloads (multi-isearch-files-regexp multi-isearch-files
;;;;;; multi-isearch-buffers-regexp multi-isearch-buffers multi-isearch-setup)
-;;;;;; "misearch" "misearch.el" (20706 54231 807276 0))
+;;;;;; "misearch" "misearch.el" (20490 33188 850375 0))
;;; Generated autoloads from misearch.el
(add-hook 'isearch-mode-hook 'multi-isearch-setup)
;;;***
\f
;;;### (autoloads (mixal-mode) "mixal-mode" "progmodes/mixal-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20566 63671 243798 0))
;;; Generated autoloads from progmodes/mixal-mode.el
(autoload 'mixal-mode "mixal-mode" "\
;;;***
\f
;;;### (autoloads (mm-default-file-encoding) "mm-encode" "gnus/mm-encode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/mm-encode.el
(autoload 'mm-default-file-encoding "mm-encode" "\
;;;***
\f
;;;### (autoloads (mm-inline-external-body mm-extern-cache-contents)
-;;;;;; "mm-extern" "gnus/mm-extern.el" (20706 54231 807276 0))
+;;;;;; "mm-extern" "gnus/mm-extern.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/mm-extern.el
(autoload 'mm-extern-cache-contents "mm-extern" "\
;;;***
\f
;;;### (autoloads (mm-inline-partial) "mm-partial" "gnus/mm-partial.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/mm-partial.el
(autoload 'mm-inline-partial "mm-partial" "\
;;;***
\f
;;;### (autoloads (mm-url-insert-file-contents-external mm-url-insert-file-contents)
-;;;;;; "mm-url" "gnus/mm-url.el" (20706 54231 807276 0))
+;;;;;; "mm-url" "gnus/mm-url.el" (20495 51111 757560 0))
;;; Generated autoloads from gnus/mm-url.el
(autoload 'mm-url-insert-file-contents "mm-url" "\
;;;***
\f
;;;### (autoloads (mm-uu-dissect-text-parts mm-uu-dissect) "mm-uu"
-;;;;;; "gnus/mm-uu.el" (20706 54231 807276 0))
+;;;;;; "gnus/mm-uu.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/mm-uu.el
(autoload 'mm-uu-dissect "mm-uu" "\
;;;***
\f
;;;### (autoloads (mml-attach-file mml-to-mime) "mml" "gnus/mml.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20567 23165 75548 0))
;;; Generated autoloads from gnus/mml.el
(autoload 'mml-to-mime "mml" "\
;;;***
\f
;;;### (autoloads (mml1991-sign mml1991-encrypt) "mml1991" "gnus/mml1991.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/mml1991.el
(autoload 'mml1991-encrypt "mml1991" "\
\f
;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
;;;;;; mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
-;;;;;; "mml2015" "gnus/mml2015.el" (20706 54231 807276 0))
+;;;;;; "mml2015" "gnus/mml2015.el" (20701 32695 861936 0))
;;; Generated autoloads from gnus/mml2015.el
(autoload 'mml2015-decrypt "mml2015" "\
;;;***
\f
-;;;### (autoloads nil "mode-local" "cedet/mode-local.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "mode-local" "cedet/mode-local.el" (20406 8611
+;;;;;; 875037 0))
;;; Generated autoloads from cedet/mode-local.el
(put 'define-overloadable-function 'doc-string-elt 3)
;;;***
\f
-;;;### (autoloads (m2-mode) "modula2" "progmodes/modula2.el" (20627
-;;;;;; 10158 364804 0))
+;;;### (autoloads (m2-mode) "modula2" "progmodes/modula2.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from progmodes/modula2.el
(defalias 'modula-2-mode 'm2-mode)
;;;***
\f
;;;### (autoloads (denato-region nato-region unmorse-region morse-region)
-;;;;;; "morse" "play/morse.el" (20706 54231 807276 0))
+;;;;;; "morse" "play/morse.el" (20355 10021 546955 0))
;;; Generated autoloads from play/morse.el
(autoload 'morse-region "morse" "\
;;;***
\f
;;;### (autoloads (mouse-drag-drag mouse-drag-throw) "mouse-drag"
-;;;;;; "mouse-drag.el" (20706 54231 807276 0))
+;;;;;; "mouse-drag.el" (20566 63671 243798 0))
;;; Generated autoloads from mouse-drag.el
(autoload 'mouse-drag-throw "mouse-drag" "\
;;;***
\f
-;;;### (autoloads (mpc) "mpc" "mpc.el" (20706 54231 807276 0))
+;;;### (autoloads (mpc) "mpc" "mpc.el" (20681 1859 197031 0))
;;; Generated autoloads from mpc.el
(autoload 'mpc "mpc" "\
;;;***
\f
-;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (20706 54231 807276
+;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (20545 57511 257469
;;;;;; 0))
;;; Generated autoloads from play/mpuz.el
;;;***
\f
-;;;### (autoloads (msb-mode) "msb" "msb.el" (20706 54231 807276 0))
+;;;### (autoloads (msb-mode) "msb" "msb.el" (20476 31768 298871 0))
;;; Generated autoloads from msb.el
(defvar msb-mode nil "\
;;;;;; describe-current-coding-system describe-current-coding-system-briefly
;;;;;; describe-coding-system describe-character-set list-charset-chars
;;;;;; read-charset list-character-sets) "mule-diag" "international/mule-diag.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20577 33959 40183 0))
;;; Generated autoloads from international/mule-diag.el
(autoload 'list-character-sets "mule-diag" "\
;;;;;; coding-system-translation-table-for-decode coding-system-pre-write-conversion
;;;;;; coding-system-post-read-conversion lookup-nested-alist set-nested-alist
;;;;;; truncate-string-to-width store-substring) "mule-util" "international/mule-util.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20577 33959 40183 0))
;;; Generated autoloads from international/mule-util.el
(defsubst string-to-list (string) "\
\(fn CHAR)" nil nil)
+;;;***
+\f
+;;;### (autoloads (advice-member-p advice-remove advice-add advice--add-function
+;;;;;; add-function advice--buffer-local advice--remove-function)
+;;;;;; "nadvice" "emacs-lisp/nadvice.el" (20651 26294 774003 0))
+;;; Generated autoloads from emacs-lisp/nadvice.el
+
+(autoload 'advice--remove-function "nadvice" "\
+
+
+\(fn FLIST FUNCTION)" nil nil)
+
+(autoload 'advice--buffer-local "nadvice" "\
+Buffer-local value of VAR, presumed to contain a function.
+
+\(fn VAR)" nil nil)
+
+(autoload 'add-function "nadvice" "\
+Add a piece of advice on the function stored at PLACE.
+FUNCTION describes the code to add. WHERE describes where to add it.
+WHERE can be explained by showing the resulting new function, as the
+result of combining FUNCTION and the previous value of PLACE, which we
+call OLDFUN here:
+`:before' (lambda (&rest r) (apply FUNCTION r) (apply OLDFUN r))
+`:after' (lambda (&rest r) (prog1 (apply OLDFUN r) (apply FUNCTION r)))
+`:around' (lambda (&rest r) (apply FUNCTION OLDFUN r))
+`:before-while' (lambda (&rest r) (and (apply FUNCTION r) (apply OLDFUN r)))
+`:before-until' (lambda (&rest r) (or (apply FUNCTION r) (apply OLDFUN r)))
+`:after-while' (lambda (&rest r) (and (apply OLDFUN r) (apply FUNCTION r)))
+`:after-until' (lambda (&rest r) (or (apply OLDFUN r) (apply FUNCTION r)))
+If FUNCTION was already added, do nothing.
+PROPS is an alist of additional properties, among which the following have
+a special meaning:
+- `name': a string or symbol. It can be used to refer to this piece of advice.
+
+PLACE cannot be a simple variable. Instead it should either be
+\(default-value 'VAR) or (local 'VAR) depending on whether FUNCTION
+should be applied to VAR buffer-locally or globally.
+
+If one of FUNCTION or OLDFUN is interactive, then the resulting function
+is also interactive. There are 3 cases:
+- FUNCTION is not interactive: the interactive spec of OLDFUN is used.
+- The interactive spec of FUNCTION is itself a function: it should take one
+ argument (the interactive spec of OLDFUN, which it can pass to
+ `advice-eval-interactive-spec') and return the list of arguments to use.
+- Else, use the interactive spec of FUNCTION and ignore the one of OLDFUN.
+
+\(fn WHERE PLACE FUNCTION &optional PROPS)" nil t)
+
+(autoload 'advice--add-function "nadvice" "\
+
+
+\(fn WHERE REF FUNCTION PROPS)" nil nil)
+
+(autoload 'advice-add "nadvice" "\
+Like `add-function' but for the function named SYMBOL.
+Contrary to `add-function', this will properly handle the cases where SYMBOL
+is defined as a macro, alias, command, ...
+
+\(fn SYMBOL WHERE FUNCTION &optional PROPS)" nil nil)
+
+(autoload 'advice-remove "nadvice" "\
+Like `remove-function' but for the function named SYMBOL.
+Contrary to `remove-function', this will work also when SYMBOL is a macro
+and it will not signal an error if SYMBOL is not `fboundp'.
+Instead of the actual function to remove, FUNCTION can also be the `name'
+of the piece of advice.
+
+\(fn SYMBOL FUNCTION)" nil nil)
+
+(autoload 'advice-member-p "nadvice" "\
+Return non-nil if ADVICE has been added to FUNCTION-NAME.
+Instead of ADVICE being the actual function, it can also be the `name'
+of the piece of advice.
+
+\(fn ADVICE FUNCTION-NAME)" nil nil)
+
;;;***
\f
;;;### (autoloads (network-connection network-connection-to-service
;;;;;; whois-reverse-lookup whois finger ftp run-dig dns-lookup-host
;;;;;; nslookup nslookup-host ping traceroute route arp netstat
-;;;;;; iwconfig ifconfig) "net-utils" "net/net-utils.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; iwconfig ifconfig) "net-utils" "net/net-utils.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from net/net-utils.el
(autoload 'ifconfig "net-utils" "\
;;;***
\f
-;;;### (autoloads (netrc-credentials) "netrc" "net/netrc.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (netrc-credentials) "netrc" "net/netrc.el" (20495
+;;;;;; 51111 757560 0))
;;; Generated autoloads from net/netrc.el
(autoload 'netrc-credentials "netrc" "\
;;;***
\f
;;;### (autoloads (open-network-stream) "network-stream" "net/network-stream.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20369 14251 85829 0))
;;; Generated autoloads from net/network-stream.el
(autoload 'open-network-stream "network-stream" "\
;;;***
\f
;;;### (autoloads (newsticker-start newsticker-running-p) "newst-backend"
-;;;;;; "net/newst-backend.el" (20706 54231 807276 0))
+;;;;;; "net/newst-backend.el" (20577 33959 40183 0))
;;; Generated autoloads from net/newst-backend.el
(autoload 'newsticker-running-p "newst-backend" "\
;;;***
\f
;;;### (autoloads (newsticker-plainview) "newst-plainview" "net/newst-plainview.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20434 17809 692608 0))
;;; Generated autoloads from net/newst-plainview.el
(autoload 'newsticker-plainview "newst-plainview" "\
;;;***
\f
;;;### (autoloads (newsticker-show-news) "newst-reader" "net/newst-reader.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20434 17809 692608 0))
;;; Generated autoloads from net/newst-reader.el
(autoload 'newsticker-show-news "newst-reader" "\
;;;***
\f
;;;### (autoloads (newsticker-start-ticker newsticker-ticker-running-p)
-;;;;;; "newst-ticker" "net/newst-ticker.el" (20706 54231 807276
+;;;;;; "newst-ticker" "net/newst-ticker.el" (20427 14766 970343
;;;;;; 0))
;;; Generated autoloads from net/newst-ticker.el
;;;***
\f
;;;### (autoloads (newsticker-treeview) "newst-treeview" "net/newst-treeview.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20590 45996 129575 0))
;;; Generated autoloads from net/newst-treeview.el
(autoload 'newsticker-treeview "newst-treeview" "\
;;;***
\f
;;;### (autoloads (nndiary-generate-nov-databases) "nndiary" "gnus/nndiary.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20614 54428 654267 0))
;;; Generated autoloads from gnus/nndiary.el
(autoload 'nndiary-generate-nov-databases "nndiary" "\
;;;***
\f
-;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from gnus/nndoc.el
(autoload 'nndoc-add-type "nndoc" "\
;;;***
\f
;;;### (autoloads (nnfolder-generate-active-file) "nnfolder" "gnus/nnfolder.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20704 8885 590749 0))
;;; Generated autoloads from gnus/nnfolder.el
(autoload 'nnfolder-generate-active-file "nnfolder" "\
;;;***
\f
;;;### (autoloads (nnml-generate-nov-databases) "nnml" "gnus/nnml.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20458 56750 651721 0))
;;; Generated autoloads from gnus/nnml.el
(autoload 'nnml-generate-nov-databases "nnml" "\
;;;***
\f
;;;### (autoloads (disable-command enable-command disabled-command-function)
-;;;;;; "novice" "novice.el" (20706 54231 807276 0))
+;;;;;; "novice" "novice.el" (20675 8629 685250 0))
;;; Generated autoloads from novice.el
(define-obsolete-variable-alias 'disabled-command-hook 'disabled-command-function "22.1")
;;;***
\f
;;;### (autoloads (nroff-mode) "nroff-mode" "textmodes/nroff-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from textmodes/nroff-mode.el
(autoload 'nroff-mode "nroff-mode" "\
;;;***
\f
;;;### (autoloads (nxml-glyph-display-string) "nxml-glyph" "nxml/nxml-glyph.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20523 62082 997685 0))
;;; Generated autoloads from nxml/nxml-glyph.el
(autoload 'nxml-glyph-display-string "nxml-glyph" "\
;;;***
\f
-;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (20478
+;;;;;; 3673 653810 0))
;;; Generated autoloads from nxml/nxml-mode.el
(autoload 'nxml-mode "nxml-mode" "\
;;;***
\f
;;;### (autoloads (nxml-enable-unicode-char-name-sets) "nxml-uchnm"
-;;;;;; "nxml/nxml-uchnm.el" (20706 54231 807276 0))
+;;;;;; "nxml/nxml-uchnm.el" (20355 10021 546955 0))
;;; Generated autoloads from nxml/nxml-uchnm.el
(autoload 'nxml-enable-unicode-char-name-sets "nxml-uchnm" "\
;;;***
\f
;;;### (autoloads (inferior-octave) "octave-inf" "progmodes/octave-inf.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from progmodes/octave-inf.el
(autoload 'inferior-octave "octave-inf" "\
;;;***
\f
;;;### (autoloads (octave-mode) "octave-mod" "progmodes/octave-mod.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20672 32446 100992 0))
;;; Generated autoloads from progmodes/octave-mod.el
(autoload 'octave-mode "octave-mod" "\
;;;;;; org-run-like-in-org-mode turn-on-orgstruct++ turn-on-orgstruct
;;;;;; orgstruct-mode org-global-cycle org-cycle org-mode org-clock-persistence-insinuate
;;;;;; turn-on-orgtbl org-version org-babel-do-load-languages) "org"
-;;;;;; "org/org.el" (20706 54231 807276 0))
+;;;;;; "org/org.el" (20681 47415 473102 0))
;;; Generated autoloads from org/org.el
(autoload 'org-babel-do-load-languages "org" "\
;;;;;; org-search-view org-agenda-list org-batch-store-agenda-views
;;;;;; org-store-agenda-views org-batch-agenda-csv org-batch-agenda
;;;;;; org-agenda org-toggle-sticky-agenda) "org-agenda" "org/org-agenda.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20681 47415 473102 0))
;;; Generated autoloads from org/org-agenda.el
(autoload 'org-toggle-sticky-agenda "org-agenda" "\
;;;***
\f
;;;### (autoloads (org-beamer-mode org-beamer-sectioning) "org-beamer"
-;;;;;; "org/org-beamer.el" (20706 54231 807276 0))
+;;;;;; "org/org-beamer.el" (20618 55210 422086 0))
;;; Generated autoloads from org/org-beamer.el
(autoload 'org-beamer-sectioning "org-beamer" "\
;;;***
\f
;;;### (autoloads (org-capture-import-remember-templates org-capture
-;;;;;; org-capture-string) "org-capture" "org/org-capture.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; org-capture-string) "org-capture" "org/org-capture.el" (20618
+;;;;;; 55210 422086 0))
;;; Generated autoloads from org/org-capture.el
(autoload 'org-capture-string "org-capture" "\
;;;***
\f
;;;### (autoloads (org-agenda-columns org-insert-columns-dblock org-dblock-write:columnview
-;;;;;; org-columns) "org-colview" "org/org-colview.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; org-columns) "org-colview" "org/org-colview.el" (20618 55210
+;;;;;; 422086 0))
;;; Generated autoloads from org/org-colview.el
(autoload 'org-columns "org-colview" "\
;;;***
\f
;;;### (autoloads (org-check-version) "org-compat" "org/org-compat.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20618 55210 422086 0))
;;; Generated autoloads from org/org-compat.el
(autoload 'org-check-version "org-compat" "\
;;;***
\f
;;;### (autoloads (org-git-version org-release) "org-version" "org/org-version.el"
-;;;;;; (20680 52801 789133 0))
+;;;;;; (20681 47415 473102 0))
;;; Generated autoloads from org/org-version.el
(autoload 'org-release "org-version" "\
;;;***
\f
;;;### (autoloads (outline-minor-mode outline-mode) "outline" "outline.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from outline.el
(put 'outline-regexp 'safe-local-variable 'stringp)
(put 'outline-heading-end-regexp 'safe-local-variable 'stringp)
;;;### (autoloads (list-packages describe-package package-initialize
;;;;;; package-refresh-contents package-install-file package-install-from-buffer
;;;;;; package-install package-enable-at-startup) "package" "emacs-lisp/package.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20705 29751 556330 0))
;;; Generated autoloads from emacs-lisp/package.el
(defvar package-enable-at-startup t "\
;;;***
\f
-;;;### (autoloads (show-paren-mode) "paren" "paren.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (show-paren-mode) "paren" "paren.el" (20542 50478
+;;;;;; 439878 507000))
;;; Generated autoloads from paren.el
(defvar show-paren-mode nil "\
;;;***
\f
;;;### (autoloads (parse-time-string) "parse-time" "calendar/parse-time.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20478 3673 653810 0))
;;; Generated autoloads from calendar/parse-time.el
(put 'parse-time-rules 'risky-local-variable t)
;;;***
\f
-;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (20478
+;;;;;; 3673 653810 0))
;;; Generated autoloads from progmodes/pascal.el
(autoload 'pascal-mode "pascal" "\
;;;***
\f
;;;### (autoloads (password-in-cache-p password-cache-expiry password-cache)
-;;;;;; "password-cache" "password-cache.el" (20706 54231 807276
-;;;;;; 0))
+;;;;;; "password-cache" "password-cache.el" (20577 33959 40183 0))
;;; Generated autoloads from password-cache.el
(defvar password-cache t "\
;;;***
\f
;;;### (autoloads (pcase-let pcase-let* pcase) "pcase" "emacs-lisp/pcase.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20582 12914 894781 0))
;;; Generated autoloads from emacs-lisp/pcase.el
(autoload 'pcase "pcase" "\
;;;***
\f
-;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from pcmpl-cvs.el
(autoload 'pcomplete/cvs "pcmpl-cvs" "\
;;;***
\f
;;;### (autoloads (pcomplete/tar pcomplete/make pcomplete/bzip2 pcomplete/gzip)
-;;;;;; "pcmpl-gnu" "pcmpl-gnu.el" (20706 54231 807276 0))
+;;;;;; "pcmpl-gnu" "pcmpl-gnu.el" (20572 16038 402143 0))
;;; Generated autoloads from pcmpl-gnu.el
(autoload 'pcomplete/gzip "pcmpl-gnu" "\
;;;***
\f
;;;### (autoloads (pcomplete/mount pcomplete/umount pcomplete/kill)
-;;;;;; "pcmpl-linux" "pcmpl-linux.el" (20706 54231 807276 0))
+;;;;;; "pcmpl-linux" "pcmpl-linux.el" (20355 10021 546955 0))
;;; Generated autoloads from pcmpl-linux.el
(autoload 'pcomplete/kill "pcmpl-linux" "\
;;;***
\f
-;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (20523
+;;;;;; 62082 997685 0))
;;; Generated autoloads from pcmpl-rpm.el
(autoload 'pcomplete/rpm "pcmpl-rpm" "\
\f
;;;### (autoloads (pcomplete/scp pcomplete/ssh pcomplete/chgrp pcomplete/chown
;;;;;; pcomplete/which pcomplete/xargs pcomplete/rm pcomplete/rmdir
-;;;;;; pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (20706 54231 807276
+;;;;;; pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (20376 40834 914217
;;;;;; 0))
;;; Generated autoloads from pcmpl-unix.el
\f
;;;### (autoloads (pcomplete-shell-setup pcomplete-comint-setup pcomplete-list
;;;;;; pcomplete-help pcomplete-expand pcomplete-continue pcomplete-expand-and-complete
-;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (20652
+;;;;;; 47164 970964 0))
;;; Generated autoloads from pcomplete.el
(autoload 'pcomplete "pcomplete" "\
\f
;;;### (autoloads (cvs-dired-use-hook cvs-dired-action cvs-status
;;;;;; cvs-update cvs-examine cvs-quickdir cvs-checkout) "pcvs"
-;;;;;; "vc/pcvs.el" (20706 54231 807276 0))
+;;;;;; "vc/pcvs.el" (20584 7212 455152 0))
;;; Generated autoloads from vc/pcvs.el
(autoload 'cvs-checkout "pcvs" "\
;;;***
\f
-;;;### (autoloads nil "pcvs-defs" "vc/pcvs-defs.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads nil "pcvs-defs" "vc/pcvs-defs.el" (20576 42138
+;;;;;; 697312 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)) "\
;;;***
\f
;;;### (autoloads (perl-mode) "perl-mode" "progmodes/perl-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20665 59189 799105 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)
;;;***
\f
;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20551 9899 283417 0))
;;; Generated autoloads from textmodes/picture.el
(autoload 'picture-mode "picture" "\
;;;***
\f
;;;### (autoloads (plstore-mode plstore-open) "plstore" "gnus/plstore.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20700 11832 779612 0))
;;; Generated autoloads from gnus/plstore.el
(autoload 'plstore-open "plstore" "\
;;;***
\f
;;;### (autoloads (po-find-file-coding-system) "po" "textmodes/po.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from textmodes/po.el
(autoload 'po-find-file-coding-system "po" "\
;;;***
\f
-;;;### (autoloads (pong) "pong" "play/pong.el" (20706 54231 807276
+;;;### (autoloads (pong) "pong" "play/pong.el" (20478 3673 653810
;;;;;; 0))
;;; Generated autoloads from play/pong.el
;;;***
\f
-;;;### (autoloads (pop3-movemail) "pop3" "gnus/pop3.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (pop3-movemail) "pop3" "gnus/pop3.el" (20643 32183
+;;;;;; 554981 0))
;;; Generated autoloads from gnus/pop3.el
(autoload 'pop3-movemail "pop3" "\
\f
;;;### (autoloads (pp-macroexpand-last-sexp pp-eval-last-sexp pp-macroexpand-expression
;;;;;; pp-eval-expression pp pp-buffer pp-to-string) "pp" "emacs-lisp/pp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20495 51111 757560 0))
;;; Generated autoloads from emacs-lisp/pp.el
(autoload 'pp-to-string "pp" "\
;;;;;; pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview
;;;;;; pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript
;;;;;; pr-ps-directory-preview pr-interface) "printing" "printing.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20648 50109 802321 0))
;;; Generated autoloads from printing.el
(autoload 'pr-interface "printing" "\
;;;***
\f
-;;;### (autoloads (proced) "proced" "proced.el" (20706 54231 807276
+;;;### (autoloads (proced) "proced" "proced.el" (20593 22184 581574
;;;;;; 0))
;;; Generated autoloads from proced.el
\f
;;;### (autoloads (profiler-find-profile-other-frame profiler-find-profile-other-window
;;;;;; profiler-find-profile profiler-start) "profiler" "profiler.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20650 54468 205452 950000))
;;; Generated autoloads from profiler.el
(autoload 'profiler-start "profiler" "\
;;;***
\f
;;;### (autoloads (run-prolog mercury-mode prolog-mode) "prolog"
-;;;;;; "progmodes/prolog.el" (20706 54231 807276 0))
+;;;;;; "progmodes/prolog.el" (20576 42138 697312 0))
;;; Generated autoloads from progmodes/prolog.el
(autoload 'prolog-mode "prolog" "\
;;;***
\f
-;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (20652
+;;;;;; 47164 970964 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")) "\
;;;***
\f
-;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (20576
+;;;;;; 42138 697312 0))
;;; Generated autoloads from progmodes/ps-mode.el
(autoload 'ps-mode "ps-mode" "\
;;;;;; ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer
;;;;;; ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces
;;;;;; ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type
-;;;;;; ps-page-dimensions-database) "ps-print" "ps-print.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; ps-page-dimensions-database) "ps-print" "ps-print.el" (20566
+;;;;;; 63671 243798 0))
;;; Generated autoloads from ps-print.el
(defvar ps-page-dimensions-database (purecopy (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list 'letter (* 72 8.5) (* 72 11.0) "Letter") (list 'legal (* 72 8.5) (* 72 14.0) "Legal") (list 'letter-small (* 72 7.68) (* 72 10.16) "LetterSmall") (list 'tabloid (* 72 11.0) (* 72 17.0) "Tabloid") (list 'ledger (* 72 17.0) (* 72 11.0) "Ledger") (list 'statement (* 72 5.5) (* 72 8.5) "Statement") (list 'executive (* 72 7.5) (* 72 10.0) "Executive") (list 'a4small (* 72 7.47) (* 72 10.85) "A4Small") (list 'b4 (* 72 10.125) (* 72 14.33) "B4") (list 'b5 (* 72 7.16) (* 72 10.125) "B5") '(addresslarge 236.0 99.0 "AddressLarge") '(addresssmall 236.0 68.0 "AddressSmall") '(cuthanging13 90.0 222.0 "CutHanging13") '(cuthanging15 90.0 114.0 "CutHanging15") '(diskette 181.0 136.0 "Diskette") '(eurofilefolder 139.0 112.0 "EuropeanFilefolder") '(eurofoldernarrow 526.0 107.0 "EuroFolderNarrow") '(eurofolderwide 526.0 136.0 "EuroFolderWide") '(euronamebadge 189.0 108.0 "EuroNameBadge") '(euronamebadgelarge 223.0 136.0 "EuroNameBadgeLarge") '(filefolder 230.0 37.0 "FileFolder") '(jewelry 76.0 136.0 "Jewelry") '(mediabadge 180.0 136.0 "MediaBadge") '(multipurpose 126.0 68.0 "MultiPurpose") '(retaillabel 90.0 104.0 "RetailLabel") '(shipping 271.0 136.0 "Shipping") '(slide35mm 26.0 104.0 "Slide35mm") '(spine8mm 187.0 26.0 "Spine8mm") '(topcoated 425.19685 136.0 "TopCoatedPaper") '(topcoatedpaper 396.0 136.0 "TopcoatedPaper150") '(vhsface 205.0 127.0 "VHSFace") '(vhsspine 400.0 50.0 "VHSSpine") '(zipdisk 156.0 136.0 "ZipDisk"))) "\
;;;***
\f
;;;### (autoloads (python-mode run-python) "python" "progmodes/python.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20704 8885 590749 0))
;;; Generated autoloads from progmodes/python.el
(add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode))
;;;***
\f
;;;### (autoloads (quoted-printable-decode-region) "qp" "gnus/qp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20557 48712 315579 0))
;;; Generated autoloads from gnus/qp.el
(autoload 'quoted-printable-decode-region "qp" "\
;;;;;; quail-defrule quail-install-decode-map quail-install-map
;;;;;; quail-define-rules quail-show-keyboard-layout quail-set-keyboard-layout
;;;;;; quail-define-package quail-use-package quail-title) "quail"
-;;;;;; "international/quail.el" (20706 54231 807276 0))
+;;;;;; "international/quail.el" (20523 62082 997685 0))
;;; Generated autoloads from international/quail.el
(autoload 'quail-title "quail" "\
\f
;;;### (autoloads (quickurl-list quickurl-list-mode quickurl-edit-urls
;;;;;; quickurl-browse-url-ask quickurl-browse-url quickurl-add-url
-;;;;;; quickurl-ask quickurl) "quickurl" "net/quickurl.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; quickurl-ask quickurl) "quickurl" "net/quickurl.el" (20566
+;;;;;; 63671 243798 0))
;;; Generated autoloads from net/quickurl.el
(defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" "\
;;;***
\f
;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
-;;;;;; "net/rcirc.el" (20706 54231 807276 0))
+;;;;;; "net/rcirc.el" (20679 5689 779225 0))
;;; Generated autoloads from net/rcirc.el
(autoload 'rcirc "rcirc" "\
;;;***
\f
-;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from net/rcompile.el
(autoload 'remote-compile "rcompile" "\
;;;***
\f
;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20427 14766 970343 0))
;;; Generated autoloads from emacs-lisp/re-builder.el
(defalias 'regexp-builder 're-builder)
;;;***
\f
-;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (20356 2211
+;;;;;; 532900 0))
;;; Generated autoloads from recentf.el
(defvar recentf-mode nil "\
;;;;;; string-rectangle delete-whitespace-rectangle open-rectangle
;;;;;; insert-rectangle yank-rectangle copy-rectangle-as-kill kill-rectangle
;;;;;; extract-rectangle delete-extract-rectangle delete-rectangle)
-;;;;;; "rect" "rect.el" (20706 54231 807276 0))
+;;;;;; "rect" "rect.el" (20501 3499 284800 0))
;;; Generated autoloads from rect.el
(autoload 'delete-rectangle "rect" "\
;;;***
\f
-;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (20478
+;;;;;; 3673 653810 0))
;;; Generated autoloads from textmodes/refill.el
(autoload 'refill-mode "refill" "\
;;;***
\f
;;;### (autoloads (reftex-reset-scanning-information reftex-mode
-;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20657 65077
+;;;;;; 880084 0))
;;; Generated autoloads from textmodes/reftex.el
(autoload 'turn-on-reftex "reftex" "\
;;;***
\f
;;;### (autoloads (reftex-citation) "reftex-cite" "textmodes/reftex-cite.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20585 28088 480237 0))
;;; Generated autoloads from textmodes/reftex-cite.el
(autoload 'reftex-citation "reftex-cite" "\
;;;***
\f
;;;### (autoloads (reftex-isearch-minor-mode) "reftex-global" "textmodes/reftex-global.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20585 28088 480237 0))
;;; Generated autoloads from textmodes/reftex-global.el
(autoload 'reftex-isearch-minor-mode "reftex-global" "\
;;;***
\f
;;;### (autoloads (reftex-index-phrases-mode) "reftex-index" "textmodes/reftex-index.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20585 28088 480237 0))
;;; Generated autoloads from textmodes/reftex-index.el
(autoload 'reftex-index-phrases-mode "reftex-index" "\
;;;***
\f
;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20657 65077 880084 0))
;;; Generated autoloads from textmodes/reftex-parse.el
(autoload 'reftex-all-document-files "reftex-parse" "\
;;;***
\f
-;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (20593
+;;;;;; 22184 581574 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))))
;;;***
\f
;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20522 38650 757441 0))
;;; Generated autoloads from emacs-lisp/regexp-opt.el
(autoload 'regexp-opt "regexp-opt" "\
\f
;;;### (autoloads (remember-diary-extract-entries remember-clipboard
;;;;;; remember-other-frame remember) "remember" "textmodes/remember.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from textmodes/remember.el
(autoload 'remember "remember" "\
;;;***
\f
-;;;### (autoloads (repeat) "repeat" "repeat.el" (20706 54231 807276
+;;;### (autoloads (repeat) "repeat" "repeat.el" (20614 54428 654267
;;;;;; 0))
;;; Generated autoloads from repeat.el
;;;***
\f
;;;### (autoloads (reporter-submit-bug-report) "reporter" "mail/reporter.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from mail/reporter.el
(autoload 'reporter-submit-bug-report "reporter" "\
;;;***
\f
;;;### (autoloads (reposition-window) "reposition" "reposition.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from reposition.el
(autoload 'reposition-window "reposition" "\
;;;***
\f
;;;### (autoloads (global-reveal-mode reveal-mode) "reveal" "reveal.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from reveal.el
(autoload 'reveal-mode "reveal" "\
;;;***
\f
;;;### (autoloads (make-ring ring-p) "ring" "emacs-lisp/ring.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from emacs-lisp/ring.el
(autoload 'ring-p "ring" "\
;;;***
\f
-;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (20402 11562
+;;;;;; 85788 0))
;;; Generated autoloads from net/rlogin.el
(autoload 'rlogin "rlogin" "\
;;;;;; rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers
;;;;;; rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers
;;;;;; rmail-user-mail-address-regexp rmail-movemail-variant-p rmail-spool-directory
-;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20706 54231 807276
+;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20706 50624 612201
;;;;;; 0))
;;; Generated autoloads from mail/rmail.el
;;;***
\f
;;;### (autoloads (rmail-output-body-to-file rmail-output-as-seen
-;;;;;; rmail-output) "rmailout" "mail/rmailout.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; rmail-output) "rmailout" "mail/rmailout.el" (20530 3765 184907
+;;;;;; 0))
;;; Generated autoloads from mail/rmailout.el
(put 'rmail-output-file-alist 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (rng-c-load-schema) "rng-cmpct" "nxml/rng-cmpct.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from nxml/rng-cmpct.el
(autoload 'rng-c-load-schema "rng-cmpct" "\
;;;***
\f
;;;### (autoloads (rng-nxml-mode-init) "rng-nxml" "nxml/rng-nxml.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from nxml/rng-nxml.el
(autoload 'rng-nxml-mode-init "rng-nxml" "\
;;;***
\f
;;;### (autoloads (rng-validate-mode) "rng-valid" "nxml/rng-valid.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from nxml/rng-valid.el
(autoload 'rng-validate-mode "rng-valid" "\
;;;***
\f
-;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from nxml/rng-xsd.el
(put 'http://www\.w3\.org/2001/XMLSchema-datatypes 'rng-dt-compile 'rng-xsd-compile)
;;;***
\f
;;;### (autoloads (robin-use-package robin-modify-package robin-define-package)
-;;;;;; "robin" "international/robin.el" (20627 10158 364804 0))
+;;;;;; "robin" "international/robin.el" (20523 62082 997685 0))
;;; Generated autoloads from international/robin.el
(autoload 'robin-define-package "robin" "\
;;;***
\f
;;;### (autoloads (toggle-rot13-mode rot13-other-window rot13-region
-;;;;;; rot13-string rot13) "rot13" "rot13.el" (20706 54231 807276
+;;;;;; rot13-string rot13) "rot13" "rot13.el" (20355 10021 546955
;;;;;; 0))
;;; Generated autoloads from rot13.el
;;;***
\f
;;;### (autoloads (rst-minor-mode rst-mode) "rst" "textmodes/rst.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20594 43050 277913 0))
;;; Generated autoloads from textmodes/rst.el
(add-to-list 'auto-mode-alist (purecopy '("\\.re?st\\'" . rst-mode)))
;;;***
\f
;;;### (autoloads (ruby-mode) "ruby-mode" "progmodes/ruby-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20700 11832 779612 0))
;;; Generated autoloads from progmodes/ruby-mode.el
(autoload 'ruby-mode "ruby-mode" "\
(add-to-list 'auto-mode-alist (cons (purecopy "\\.rb\\'") 'ruby-mode))
+(add-to-list 'auto-mode-alist (cons (purecopy "Rakefile\\'") 'ruby-mode))
+
+(add-to-list 'auto-mode-alist (cons (purecopy "\\.gemspec\\'") 'ruby-mode))
+
(dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8")) (add-to-list 'interpreter-mode-alist (cons (purecopy name) 'ruby-mode)))
;;;***
\f
-;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from ruler-mode.el
(defvar ruler-mode nil "\
;;;***
\f
-;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (20518
+;;;;;; 12580 46478 0))
;;; Generated autoloads from emacs-lisp/rx.el
(autoload 'rx-to-string "rx" "\
;;;***
\f
-;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (20577
+;;;;;; 33959 40183 0))
;;; Generated autoloads from savehist.el
(defvar savehist-mode nil "\
;;;***
\f
;;;### (autoloads (dsssl-mode scheme-mode) "scheme" "progmodes/scheme.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20665 59189 799105 0))
;;; Generated autoloads from progmodes/scheme.el
(autoload 'scheme-mode "scheme" "\
;;;***
\f
;;;### (autoloads (gnus-score-mode) "score-mode" "gnus/score-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/score-mode.el
(autoload 'gnus-score-mode "score-mode" "\
;;;***
\f
;;;### (autoloads (scroll-all-mode) "scroll-all" "scroll-all.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20363 61861 222722 0))
;;; Generated autoloads from scroll-all.el
(defvar scroll-all-mode nil "\
;;;***
\f
;;;### (autoloads (scroll-lock-mode) "scroll-lock" "scroll-lock.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from scroll-lock.el
(autoload 'scroll-lock-mode "scroll-lock" "\
;;;***
\f
-;;;### (autoloads nil "secrets" "net/secrets.el" (20706 54231 807276
+;;;### (autoloads nil "secrets" "net/secrets.el" (20478 3673 653810
;;;;;; 0))
;;; Generated autoloads from net/secrets.el
(when (featurep 'dbusbind)
;;;***
\f
;;;### (autoloads (semantic-mode semantic-default-submodes) "semantic"
-;;;;;; "cedet/semantic.el" (20706 54231 807276 0))
+;;;;;; "cedet/semantic.el" (20617 41641 89638 0))
;;; Generated autoloads from cedet/semantic.el
(defvar semantic-default-submodes '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode) "\
;;;***
\f
;;;### (autoloads (bovine-grammar-mode) "semantic/bovine/grammar"
-;;;;;; "cedet/semantic/bovine/grammar.el" (20706 54231 807276 0))
+;;;;;; "cedet/semantic/bovine/grammar.el" (20593 22184 581574 0))
;;; Generated autoloads from cedet/semantic/bovine/grammar.el
(autoload 'bovine-grammar-mode "semantic/bovine/grammar" "\
;;;***
\f
;;;### (autoloads (wisent-grammar-mode) "semantic/wisent/grammar"
-;;;;;; "cedet/semantic/wisent/grammar.el" (20706 54231 807276 0))
+;;;;;; "cedet/semantic/wisent/grammar.el" (20593 22184 581574 0))
;;; Generated autoloads from cedet/semantic/wisent/grammar.el
(autoload 'wisent-grammar-mode "semantic/wisent/grammar" "\
;;;;;; mail-personal-alias-file mail-default-reply-to mail-archive-file-name
;;;;;; mail-header-separator send-mail-function mail-interactive
;;;;;; mail-self-blind mail-specify-envelope-from mail-from-style)
-;;;;;; "sendmail" "mail/sendmail.el" (20706 54231 807276 0))
+;;;;;; "sendmail" "mail/sendmail.el" (20614 54428 654267 0))
;;; Generated autoloads from mail/sendmail.el
(defvar mail-from-style 'default "\
;;;***
\f
;;;### (autoloads (server-save-buffers-kill-terminal server-mode
-;;;;;; server-force-delete server-start) "server" "server.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; server-force-delete server-start) "server" "server.el" (20697
+;;;;;; 35643 276642 0))
;;; Generated autoloads from server.el
(put 'server-host 'risky-local-variable t)
;;;***
\f
-;;;### (autoloads (ses-mode) "ses" "ses.el" (20706 54231 807276 0))
+;;;### (autoloads (ses-mode) "ses" "ses.el" (20673 53308 39372 0))
;;; Generated autoloads from ses.el
(autoload 'ses-mode "ses" "\
;;;***
\f
;;;### (autoloads (html-mode sgml-mode) "sgml-mode" "textmodes/sgml-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20665 59189 799105 0))
;;; Generated autoloads from textmodes/sgml-mode.el
(autoload 'sgml-mode "sgml-mode" "\
;;;***
\f
;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20665 59189 799105 0))
;;; Generated autoloads from progmodes/sh-script.el
(put 'sh-shell 'safe-local-variable 'symbolp)
;;;***
\f
;;;### (autoloads (list-load-path-shadows) "shadow" "emacs-lisp/shadow.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20572 16038 402143 0))
;;; Generated autoloads from emacs-lisp/shadow.el
(autoload 'list-load-path-shadows "shadow" "\
;;;***
\f
;;;### (autoloads (shadow-initialize shadow-define-regexp-group shadow-define-literal-group
-;;;;;; shadow-define-cluster) "shadowfile" "shadowfile.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; shadow-define-cluster) "shadowfile" "shadowfile.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from shadowfile.el
(autoload 'shadow-define-cluster "shadowfile" "\
;;;***
\f
;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20664 38325 385623 0))
;;; Generated autoloads from shell.el
(defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\
;;;***
\f
-;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20698
+;;;;;; 56506 332830 0))
;;; Generated autoloads from gnus/shr.el
(autoload 'shr-insert-document "shr" "\
;;;***
\f
;;;### (autoloads (sieve-upload-and-kill sieve-upload-and-bury sieve-upload
-;;;;;; sieve-manage) "sieve" "gnus/sieve.el" (20706 54231 807276
+;;;;;; sieve-manage) "sieve" "gnus/sieve.el" (20487 57003 603251
;;;;;; 0))
;;; Generated autoloads from gnus/sieve.el
;;;***
\f
;;;### (autoloads (sieve-mode) "sieve-mode" "gnus/sieve-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20683 2742 588278 0))
;;; Generated autoloads from gnus/sieve-mode.el
(autoload 'sieve-mode "sieve-mode" "\
;;;***
\f
-;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from progmodes/simula.el
(autoload 'simula-mode "simula" "\
;;;***
\f
;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy-new
-;;;;;; define-skeleton) "skeleton" "skeleton.el" (20706 54231 807276
+;;;;;; define-skeleton) "skeleton" "skeleton.el" (20541 6907 775259
;;;;;; 0))
;;; Generated autoloads from skeleton.el
;;;***
\f
;;;### (autoloads (smerge-start-session smerge-mode smerge-ediff)
-;;;;;; "smerge-mode" "vc/smerge-mode.el" (20706 54231 807276 0))
+;;;;;; "smerge-mode" "vc/smerge-mode.el" (20585 28088 480237 0))
;;; Generated autoloads from vc/smerge-mode.el
(autoload 'smerge-ediff "smerge-mode" "\
;;;***
\f
;;;### (autoloads (smiley-buffer smiley-region) "smiley" "gnus/smiley.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from gnus/smiley.el
(autoload 'smiley-region "smiley" "\
;;;***
\f
;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
-;;;;;; "mail/smtpmail.el" (20706 54231 807276 0))
+;;;;;; "mail/smtpmail.el" (20697 35643 276642 0))
;;; Generated autoloads from mail/smtpmail.el
(autoload 'smtpmail-send-it "smtpmail" "\
;;;***
\f
-;;;### (autoloads (snake) "snake" "play/snake.el" (20706 54231 807276
+;;;### (autoloads (snake) "snake" "play/snake.el" (20478 3673 653810
;;;;;; 0))
;;; Generated autoloads from play/snake.el
;;;***
\f
;;;### (autoloads (snmpv2-mode snmp-mode) "snmp-mode" "net/snmp-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20577 33959 40183 0))
;;; Generated autoloads from net/snmp-mode.el
(autoload 'snmp-mode "snmp-mode" "\
;;;***
\f
-;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (20566
+;;;;;; 63671 243798 0))
;;; Generated autoloads from calendar/solar.el
(autoload 'sunrise-sunset "solar" "\
;;;***
\f
-;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (20427
+;;;;;; 14766 970343 0))
;;; Generated autoloads from play/solitaire.el
(autoload 'solitaire "solitaire" "\
;;;***
\f
-;;;### (autoloads (reverse-region sort-columns sort-regexp-fields
-;;;;;; sort-fields sort-numeric-fields sort-pages sort-paragraphs
-;;;;;; sort-lines sort-subr) "sort" "sort.el" (20706 54231 807276
-;;;;;; 0))
+;;;### (autoloads (delete-duplicate-lines reverse-region sort-columns
+;;;;;; sort-regexp-fields sort-fields sort-numeric-fields sort-pages
+;;;;;; sort-paragraphs sort-lines sort-subr) "sort" "sort.el" (20693
+;;;;;; 38586 665915 0))
;;; Generated autoloads from sort.el
(put 'sort-fold-case 'safe-local-variable 'booleanp)
\(fn BEG END)" t nil)
+(autoload 'delete-duplicate-lines "sort" "\
+Delete duplicate lines in the region between BEG and END.
+
+If REVERSE is nil, search and delete duplicates forward keeping the first
+occurrence of duplicate lines. If REVERSE is non-nil (when called
+interactively with C-u prefix), search and delete duplicates backward
+keeping the last occurrence of duplicate lines.
+
+If ADJACENT is non-nil (when called interactively with two C-u prefixes),
+delete repeated lines only if they are adjacent. It works like the utility
+`uniq' and is useful when lines are already sorted in a large file since
+this is more efficient in performance and memory usage than when ADJACENT
+is nil that uses additional memory to remember previous lines.
+
+When called from Lisp and INTERACTIVE is omitted or nil, return the number
+of deleted duplicate lines, do not print it; if INTERACTIVE is t, the
+function behaves in all respects as if it had been called interactively.
+
+\(fn BEG END &optional REVERSE ADJACENT INTERACTIVE)" t nil)
+
;;;***
\f
-;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (20672
+;;;;;; 32446 100992 0))
;;; Generated autoloads from gnus/spam.el
(autoload 'spam-initialize "spam" "\
\f
;;;### (autoloads (spam-report-deagentize spam-report-agentize spam-report-url-to-file
;;;;;; spam-report-url-ping-mm-url spam-report-process-queue) "spam-report"
-;;;;;; "gnus/spam-report.el" (20706 54231 807276 0))
+;;;;;; "gnus/spam-report.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/spam-report.el
(autoload 'spam-report-process-queue "spam-report" "\
;;;***
\f
;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
-;;;;;; "speedbar.el" (20706 54231 807276 0))
+;;;;;; "speedbar.el" (20648 50109 802321 0))
;;; Generated autoloads from speedbar.el
(defalias 'speedbar 'speedbar-frame-mode)
;;;***
\f
-;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from play/spook.el
(autoload 'spook "spook" "\
;;;### (autoloads (sql-linter sql-db2 sql-interbase sql-postgres
;;;;;; sql-ms sql-ingres sql-solid sql-mysql sql-sqlite sql-informix
;;;;;; sql-sybase sql-oracle sql-product-interactive sql-connect
-;;;;;; sql-mode sql-help sql-add-product-keywords) "sql" "progmodes/sql.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; sql-mode sql-add-product-keywords) "sql" "progmodes/sql.el"
+;;;;;; (20683 39246 740032 0))
;;; Generated autoloads from progmodes/sql.el
(autoload 'sql-add-product-keywords "sql" "\
\(fn PRODUCT KEYWORDS &optional APPEND)" nil nil)
-(autoload 'sql-help "sql" "\
-Show short help for the SQL modes.
-
-Use an entry function to open an interactive SQL buffer. This buffer is
-usually named `*SQL*'. The name of the major mode is SQLi.
-
-Use the following commands to start a specific SQL interpreter:
-
- \\\\FREE
-
-Other non-free SQL implementations are also supported:
-
- \\\\NONFREE
-
-But we urge you to choose a free implementation instead of these.
-
-You can also use \\[sql-product-interactive] to invoke the
-interpreter for the current `sql-product'.
-
-Once you have the SQLi buffer, you can enter SQL statements in the
-buffer. The output generated is appended to the buffer and a new prompt
-is generated. See the In/Out menu in the SQLi buffer for some functions
-that help you navigate through the buffer, the input history, etc.
-
-If you have a really complex SQL statement or if you are writing a
-procedure, you can do this in a separate buffer. Put the new buffer in
-`sql-mode' by calling \\[sql-mode]. The name of this buffer can be
-anything. The name of the major mode is SQL.
-
-In this SQL buffer (SQL mode), you can send the region or the entire
-buffer to the interactive SQL buffer (SQLi mode). The results are
-appended to the SQLi buffer without disturbing your SQL buffer.
-
-\(fn)" t nil)
+(eval '(defun sql-help nil #("Show short help for the SQL modes.\n\nUse an entry function to open an interactive SQL buffer. This buffer is\nusually named `*SQL*'. The name of the major mode is SQLi.\n\nUse the following commands to start a specific SQL interpreter:\n\n \\\\FREE\n\nOther non-free SQL implementations are also supported:\n\n \\\\NONFREE\n\nBut we urge you to choose a free implementation instead of these.\n\nYou can also use \\[sql-product-interactive] to invoke the\ninterpreter for the current `sql-product'.\n\nOnce you have the SQLi buffer, you can enter SQL statements in the\nbuffer. The output generated is appended to the buffer and a new prompt\nis generated. See the In/Out menu in the SQLi buffer for some functions\nthat help you navigate through the buffer, the input history, etc.\n\nIf you have a really complex SQL statement or if you are writing a\nprocedure, you can do this in a separate buffer. Put the new buffer in\n`sql-mode' by calling \\[sql-mode]. The name of this buffer can be\nanything. The name of the major mode is SQL.\n\nIn this SQL buffer (SQL mode), you can send the region or the entire\nbuffer to the interactive SQL buffer (SQLi mode). The results are\nappended to the SQLi buffer without disturbing your SQL buffer." 0 1 (dynamic-docstring-function sql--make-help-docstring)) (interactive) (describe-function 'sql-help)))
(autoload 'sql-mode "sql" "\
Major mode to edit SQL.
;;;***
\f
;;;### (autoloads (srecode-template-mode) "srecode/srt-mode" "cedet/srecode/srt-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20642 11326 759953 0))
;;; Generated autoloads from cedet/srecode/srt-mode.el
(autoload 'srecode-template-mode "srecode/srt-mode" "\
;;;***
\f
;;;### (autoloads (starttls-open-stream) "starttls" "gnus/starttls.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20606 34222 123795 0))
;;; Generated autoloads from gnus/starttls.el
(autoload 'starttls-open-stream "starttls" "\
;;;;;; strokes-mode strokes-list-strokes strokes-load-user-strokes
;;;;;; strokes-help strokes-describe-stroke strokes-do-complex-stroke
;;;;;; strokes-do-stroke strokes-read-complex-stroke strokes-read-stroke
-;;;;;; strokes-global-set-stroke) "strokes" "strokes.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; strokes-global-set-stroke) "strokes" "strokes.el" (20593
+;;;;;; 22184 581574 0))
;;; Generated autoloads from strokes.el
(autoload 'strokes-global-set-stroke "strokes" "\
;;;***
\f
;;;### (autoloads (studlify-buffer studlify-word studlify-region)
-;;;;;; "studly" "play/studly.el" (20355 10320 526171 0))
+;;;;;; "studly" "play/studly.el" (20355 10021 546955 0))
;;; Generated autoloads from play/studly.el
(autoload 'studlify-region "studly" "\
;;;***
\f
;;;### (autoloads (global-subword-mode subword-mode) "subword" "progmodes/subword.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20524 51365 2559 0))
;;; Generated autoloads from progmodes/subword.el
(autoload 'subword-mode "subword" "\
;;;***
\f
;;;### (autoloads (sc-cite-original) "supercite" "mail/supercite.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20576 42138 697312 0))
;;; Generated autoloads from mail/supercite.el
(autoload 'sc-cite-original "supercite" "\
;;;***
\f
-;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from t-mouse.el
(define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1")
;;;***
\f
-;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from tabify.el
(autoload 'untabify "tabify" "\
;;;;;; table-recognize table-insert-row-column table-insert-column
;;;;;; table-insert-row table-insert table-point-left-cell-hook
;;;;;; table-point-entered-cell-hook table-load-hook table-cell-map-hook)
-;;;;;; "table" "textmodes/table.el" (20706 54231 807276 0))
+;;;;;; "table" "textmodes/table.el" (20660 41272 835092 0))
;;; Generated autoloads from textmodes/table.el
(defvar table-cell-map-hook nil "\
;;;***
\f
-;;;### (autoloads (talk talk-connect) "talk" "talk.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (talk talk-connect) "talk" "talk.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from talk.el
(autoload 'talk-connect "talk" "\
;;;***
\f
-;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (20585 28088
+;;;;;; 480237 0))
;;; Generated autoloads from tar-mode.el
(autoload 'tar-mode "tar-mode" "\
;;;***
\f
;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl"
-;;;;;; "progmodes/tcl.el" (20706 54231 807276 0))
+;;;;;; "progmodes/tcl.el" (20580 10161 446444 0))
;;; Generated autoloads from progmodes/tcl.el
(autoload 'tcl-mode "tcl" "\
;;;***
\f
-;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from net/telnet.el
(autoload 'telnet "telnet" "\
;;;***
\f
;;;### (autoloads (serial-term ansi-term term make-term) "term" "term.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20648 50109 802321 0))
;;; Generated autoloads from term.el
(autoload 'make-term "term" "\
\(fn PORT SPEED)" t nil)
-;;;***
-\f
-;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (20706
-;;;;;; 54231 807276 0))
-;;; Generated autoloads from terminal.el
-
-(autoload 'terminal-emulator "terminal" "\
-Under a display-terminal emulator in BUFFER, run PROGRAM on arguments ARGS.
-ARGS is a list of argument-strings. Remaining arguments are WIDTH and HEIGHT.
-BUFFER's contents are made an image of the display generated by that program,
-and any input typed when BUFFER is the current Emacs buffer is sent to that
-program as keyboard input.
-
-Interactively, BUFFER defaults to \"*terminal*\" and PROGRAM and ARGS
-are parsed from an input-string using your usual shell.
-WIDTH and HEIGHT are determined from the size of the current window
--- WIDTH will be one less than the window's width, HEIGHT will be its height.
-
-To switch buffers and leave the emulator, or to give commands
-to the emulator itself (as opposed to the program running under it),
-type Control-^. The following character is an emulator command.
-Type Control-^ twice to send it to the subprogram.
-This escape character may be changed using the variable `terminal-escape-char'.
-
-`Meta' characters may not currently be sent through the terminal emulator.
-
-Here is a list of some of the variables which control the behavior
-of the emulator -- see their documentation for more information:
-terminal-escape-char, terminal-scrolling, terminal-more-processing,
-terminal-redisplay-interval.
-
-This function calls the value of terminal-mode-hook if that exists
-and is non-nil after the terminal buffer has been set up and the
-subprocess started.
-
-\(fn BUFFER PROGRAM ARGS &optional WIDTH HEIGHT)" t nil)
-
;;;***
\f
;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20580 10161 446444 0))
;;; Generated autoloads from emacs-lisp/testcover.el
(autoload 'testcover-this-defun "testcover" "\
;;;***
\f
-;;;### (autoloads (tetris) "tetris" "play/tetris.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (tetris) "tetris" "play/tetris.el" (20545 57511
+;;;;;; 257469 0))
;;; Generated autoloads from play/tetris.el
(autoload 'tetris "tetris" "\
;;;;;; tex-start-commands tex-start-options slitex-run-command latex-run-command
;;;;;; tex-run-command tex-offer-save tex-main-file tex-first-line-header-regexp
;;;;;; tex-directory tex-shell-file-name) "tex-mode" "textmodes/tex-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20665 59189 799105 0))
;;; Generated autoloads from textmodes/tex-mode.el
(defvar tex-shell-file-name nil "\
;;;***
\f
;;;### (autoloads (texi2info texinfo-format-region texinfo-format-buffer)
-;;;;;; "texinfmt" "textmodes/texinfmt.el" (20706 54231 807276 0))
+;;;;;; "texinfmt" "textmodes/texinfmt.el" (20434 17809 692608 0))
;;; Generated autoloads from textmodes/texinfmt.el
(autoload 'texinfo-format-buffer "texinfmt" "\
;;;***
\f
;;;### (autoloads (texinfo-mode texinfo-close-quote texinfo-open-quote)
-;;;;;; "texinfo" "textmodes/texinfo.el" (20706 54231 807276 0))
+;;;;;; "texinfo" "textmodes/texinfo.el" (20677 50357 68628 0))
;;; Generated autoloads from textmodes/texinfo.el
(defvar texinfo-open-quote (purecopy "``") "\
\f
;;;### (autoloads (thai-composition-function thai-compose-buffer
;;;;;; thai-compose-string thai-compose-region) "thai-util" "language/thai-util.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from language/thai-util.el
(autoload 'thai-compose-region "thai-util" "\
\f
;;;### (autoloads (list-at-point number-at-point symbol-at-point
;;;;;; sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
-;;;;;; "thingatpt" "thingatpt.el" (20706 54231 807276 0))
+;;;;;; "thingatpt" "thingatpt.el" (20623 43301 870757 0))
;;; Generated autoloads from thingatpt.el
(autoload 'forward-thing "thingatpt" "\
\f
;;;### (autoloads (thumbs-dired-setroot thumbs-dired-show thumbs-dired-show-marked
;;;;;; thumbs-show-from-dir thumbs-find-thumb) "thumbs" "thumbs.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from thumbs.el
(autoload 'thumbs-find-thumb "thumbs" "\
;;;;;; tibetan-post-read-conversion tibetan-compose-buffer tibetan-decompose-buffer
;;;;;; tibetan-decompose-string tibetan-decompose-region tibetan-compose-region
;;;;;; tibetan-compose-string tibetan-transcription-to-tibetan tibetan-tibetan-to-transcription
-;;;;;; tibetan-char-p) "tibet-util" "language/tibet-util.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; tibetan-char-p) "tibet-util" "language/tibet-util.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from language/tibet-util.el
(autoload 'tibetan-char-p "tibet-util" "\
;;;***
\f
;;;### (autoloads (tildify-buffer tildify-region) "tildify" "textmodes/tildify.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20373 11301 906925 0))
;;; Generated autoloads from textmodes/tildify.el
(autoload 'tildify-region "tildify" "\
\f
;;;### (autoloads (emacs-init-time emacs-uptime display-time-world
;;;;;; display-time-mode display-time display-time-day-and-date)
-;;;;;; "time" "time.el" (20706 54231 807276 0))
+;;;;;; "time" "time.el" (20619 46245 806932 0))
;;; Generated autoloads from time.el
(defvar display-time-day-and-date nil "\
;;;;;; time-to-day-in-year date-leap-year-p days-between date-to-day
;;;;;; time-add time-subtract time-since days-to-time time-less-p
;;;;;; seconds-to-time date-to-time) "time-date" "calendar/time-date.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20652 47164 970964 0))
;;; Generated autoloads from calendar/time-date.el
(autoload 'date-to-time "time-date" "\
(if (or (featurep 'emacs)
(and (fboundp 'float-time)
(subrp (symbol-function 'float-time))))
- (progn
- (defalias 'time-to-seconds 'float-time)
- (make-obsolete 'time-to-seconds 'float-time "21.1"))
+ (defalias 'time-to-seconds 'float-time)
(autoload 'time-to-seconds "time-date"))
(autoload 'seconds-to-time "time-date" "\
;;;***
\f
;;;### (autoloads (time-stamp-toggle-active time-stamp) "time-stamp"
-;;;;;; "time-stamp.el" (20706 54231 807276 0))
+;;;;;; "time-stamp.el" (20566 63671 243798 0))
;;; Generated autoloads from time-stamp.el
(put 'time-stamp-format 'safe-local-variable 'stringp)
(put 'time-stamp-time-zone 'safe-local-variable 'string-or-null-p)
;;;;;; timeclock-workday-remaining-string timeclock-reread-log timeclock-query-out
;;;;;; timeclock-change timeclock-status-string timeclock-out timeclock-in
;;;;;; timeclock-mode-line-display) "timeclock" "calendar/timeclock.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20593 22184 581574 0))
;;; Generated autoloads from calendar/timeclock.el
(autoload 'timeclock-mode-line-display "timeclock" "\
;;;***
\f
;;;### (autoloads (batch-titdic-convert titdic-convert) "titdic-cnv"
-;;;;;; "international/titdic-cnv.el" (20706 54231 807276 0))
+;;;;;; "international/titdic-cnv.el" (20355 10021 546955 0))
;;; Generated autoloads from international/titdic-cnv.el
(autoload 'titdic-convert "titdic-cnv" "\
;;;***
\f
;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm"
-;;;;;; "tmm.el" (20706 54231 807276 0))
+;;;;;; "tmm.el" (20622 22438 32851 0))
;;; Generated autoloads from tmm.el
(define-key global-map "\M-`" 'tmm-menubar)
(define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
\f
;;;### (autoloads (todo-show todo-cp todo-mode todo-print todo-top-priorities
;;;;;; todo-insert-item todo-add-item-non-interactively todo-add-category)
-;;;;;; "todo-mode" "calendar/todo-mode.el" (20706 54231 807276 0))
+;;;;;; "todo-mode" "calendar/todo-mode.el" (20355 10021 546955 0))
;;; Generated autoloads from calendar/todo-mode.el
(autoload 'todo-add-category "todo-mode" "\
\f
;;;### (autoloads (tool-bar-local-item-from-menu tool-bar-add-item-from-menu
;;;;;; tool-bar-local-item tool-bar-add-item toggle-tool-bar-mode-from-frame)
-;;;;;; "tool-bar" "tool-bar.el" (20706 54231 807276 0))
+;;;;;; "tool-bar" "tool-bar.el" (20355 10021 546955 0))
;;; Generated autoloads from tool-bar.el
(autoload 'toggle-tool-bar-mode-from-frame "tool-bar" "\
;;;***
\f
;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20566 63671 243798 0))
;;; Generated autoloads from emulation/tpu-edt.el
(defvar tpu-edt-mode nil "\
;;;***
\f
;;;### (autoloads (tpu-mapper) "tpu-mapper" "emulation/tpu-mapper.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20566 63671 243798 0))
;;; Generated autoloads from emulation/tpu-mapper.el
(autoload 'tpu-mapper "tpu-mapper" "\
;;;***
\f
-;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from emacs-lisp/tq.el
(autoload 'tq-create "tq" "\
;;;***
\f
-;;;### (autoloads (trace-function-background trace-function trace-buffer)
-;;;;;; "trace" "emacs-lisp/trace.el" (20706 54231 807276 0))
+;;;### (autoloads (trace-function-background trace-function-foreground
+;;;;;; trace-buffer) "trace" "emacs-lisp/trace.el" (20652 47164
+;;;;;; 970964 0))
;;; Generated autoloads from emacs-lisp/trace.el
-(defvar trace-buffer (purecopy "*trace-output*") "\
+(defvar trace-buffer "*trace-output*" "\
Trace output will by default go to that buffer.")
(custom-autoload 'trace-buffer "trace" t)
-(autoload 'trace-function "trace" "\
+(autoload 'trace-function-foreground "trace" "\
Traces FUNCTION with trace output going to BUFFER.
For every call of FUNCTION Lisp-style trace messages that display argument
and return values will be inserted into BUFFER. This function generates the
Do not use this to trace functions that switch buffers or do any other
display oriented stuff, use `trace-function-background' instead.
-\(fn FUNCTION &optional BUFFER)" t nil)
+\(fn FUNCTION &optional BUFFER CONTEXT)" t nil)
(autoload 'trace-function-background "trace" "\
Traces FUNCTION with trace output going quietly to BUFFER.
BUFFER defaults to `trace-buffer'.
-\(fn FUNCTION &optional BUFFER)" t nil)
+\(fn FUNCTION &optional BUFFER CONTEXT)" t nil)
+
+(defalias 'trace-function 'trace-function-foreground)
;;;***
\f
;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion
;;;;;; tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers
;;;;;; tramp-file-name-handler tramp-syntax tramp-mode) "tramp"
-;;;;;; "net/tramp.el" (20706 54231 807276 0))
+;;;;;; "net/tramp.el" (20701 32695 861936 0))
;;; Generated autoloads from net/tramp.el
(defvar tramp-mode t "\
;;;***
\f
;;;### (autoloads (tramp-ftp-enable-ange-ftp) "tramp-ftp" "net/tramp-ftp.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20683 2742 588278 0))
;;; Generated autoloads from net/tramp-ftp.el
(autoload 'tramp-ftp-enable-ange-ftp "tramp-ftp" "\
;;;***
\f
-;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20584
+;;;;;; 7212 455152 0))
;;; Generated autoloads from tutorial.el
(autoload 'help-with-tutorial "tutorial" "\
;;;***
\f
;;;### (autoloads (tai-viet-composition-function) "tv-util" "language/tv-util.el"
-;;;;;; (20355 10320 526171 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from language/tv-util.el
(autoload 'tai-viet-composition-function "tv-util" "\
;;;***
\f
;;;### (autoloads (2C-split 2C-associate-buffer 2C-two-columns) "two-column"
-;;;;;; "textmodes/two-column.el" (20706 54231 807276 0))
+;;;;;; "textmodes/two-column.el" (20566 63671 243798 0))
;;; Generated autoloads from textmodes/two-column.el
(autoload '2C-command "two-column" () t 'keymap)
(global-set-key "\C-x6" '2C-command)
\f
;;;### (autoloads (type-break-guesstimate-keystroke-threshold type-break-statistics
;;;;;; type-break type-break-mode) "type-break" "type-break.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20582 12914 894781 0))
;;; Generated autoloads from type-break.el
(defvar type-break-mode nil "\
;;;***
\f
-;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (20566 63671
+;;;;;; 243798 0))
;;; Generated autoloads from mail/uce.el
(autoload 'uce-reply-to-uce "uce" "\
;;;;;; ucs-normalize-NFKC-string ucs-normalize-NFKC-region ucs-normalize-NFKD-string
;;;;;; ucs-normalize-NFKD-region ucs-normalize-NFC-string ucs-normalize-NFC-region
;;;;;; ucs-normalize-NFD-string ucs-normalize-NFD-region) "ucs-normalize"
-;;;;;; "international/ucs-normalize.el" (20706 54231 807276 0))
+;;;;;; "international/ucs-normalize.el" (20476 31768 298871 0))
;;; Generated autoloads from international/ucs-normalize.el
(autoload 'ucs-normalize-NFD-region "ucs-normalize" "\
;;;***
\f
;;;### (autoloads (ununderline-region underline-region) "underline"
-;;;;;; "textmodes/underline.el" (20706 54231 807276 0))
+;;;;;; "textmodes/underline.el" (20355 10021 546955 0))
;;; Generated autoloads from textmodes/underline.el
(autoload 'underline-region "underline" "\
;;;***
\f
;;;### (autoloads (unrmail batch-unrmail) "unrmail" "mail/unrmail.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20673 53308 39372 0))
;;; Generated autoloads from mail/unrmail.el
(autoload 'batch-unrmail "unrmail" "\
-Convert old-style Rmail Babyl files to system inbox format.
+Convert old-style Rmail Babyl files to mbox format.
Specify the input Rmail Babyl file names as command line arguments.
For each Rmail file, the corresponding output file name
is made by adding `.mail' at the end.
\(fn)" nil nil)
(autoload 'unrmail "unrmail" "\
-Convert old-style Rmail Babyl file FILE to system inbox format file TO-FILE.
+Convert old-style Rmail Babyl file FILE to mbox format file TO-FILE.
+The variable `unrmail-mbox-format' controls which mbox format to use.
\(fn FILE TO-FILE)" t nil)
;;;***
\f
-;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from emacs-lisp/unsafep.el
(autoload 'unsafep "unsafep" "\
;;;***
\f
;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
-;;;;;; "url/url.el" (20706 54231 807276 0))
+;;;;;; "url/url.el" (20601 16294 451653 0))
;;; Generated autoloads from url/url.el
(autoload 'url-retrieve "url" "\
;;;***
\f
;;;### (autoloads (url-register-auth-scheme url-get-authentication)
-;;;;;; "url-auth" "url/url-auth.el" (20706 54231 807276 0))
+;;;;;; "url-auth" "url/url-auth.el" (20355 10021 546955 0))
;;; Generated autoloads from url/url-auth.el
(autoload 'url-get-authentication "url-auth" "\
;;;***
\f
;;;### (autoloads (url-cache-extract url-is-cached url-store-in-cache)
-;;;;;; "url-cache" "url/url-cache.el" (20706 54231 807276 0))
+;;;;;; "url-cache" "url/url-cache.el" (20355 10021 546955 0))
;;; Generated autoloads from url/url-cache.el
(autoload 'url-store-in-cache "url-cache" "\
;;;***
\f
-;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from url/url-cid.el
(autoload 'url-cid "url-cid" "\
;;;***
\f
;;;### (autoloads (url-dav-vc-registered url-dav-request url-dav-supported-p)
-;;;;;; "url-dav" "url/url-dav.el" (20706 54231 807276 0))
+;;;;;; "url-dav" "url/url-dav.el" (20501 3499 284800 0))
;;; Generated autoloads from url/url-dav.el
(autoload 'url-dav-supported-p "url-dav" "\
;;;***
\f
-;;;### (autoloads (url-file) "url-file" "url/url-file.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (url-file) "url-file" "url/url-file.el" (20602
+;;;;;; 37158 321420 0))
;;; Generated autoloads from url/url-file.el
(autoload 'url-file "url-file" "\
;;;***
\f
;;;### (autoloads (url-open-stream url-gateway-nslookup-host) "url-gw"
-;;;;;; "url/url-gw.el" (20706 54231 807276 0))
+;;;;;; "url/url-gw.el" (20478 3673 653810 0))
;;; Generated autoloads from url/url-gw.el
(autoload 'url-gateway-nslookup-host "url-gw" "\
\f
;;;### (autoloads (url-insert-file-contents url-file-local-copy url-copy-file
;;;;;; url-file-handler url-handler-mode) "url-handlers" "url/url-handlers.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20584 7212 455152 0))
;;; Generated autoloads from url/url-handlers.el
(defvar url-handler-mode nil "\
;;;***
\f
-;;;### (autoloads nil "url-http" "url/url-http.el" (20706 54231 807276
+;;;### (autoloads nil "url-http" "url/url-http.el" (20693 38586 665915
;;;;;; 0))
;;; Generated autoloads from url/url-http.el
(autoload 'url-default-expander "url-expand")
;;;***
\f
-;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from url/url-irc.el
(autoload 'url-irc "url-irc" "\
;;;***
\f
-;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (20355
+;;;;;; 10021 546955 0))
;;; Generated autoloads from url/url-ldap.el
(autoload 'url-ldap "url-ldap" "\
;;;***
\f
;;;### (autoloads (url-mailto url-mail) "url-mailto" "url/url-mailto.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from url/url-mailto.el
(autoload 'url-mail "url-mailto" "\
;;;***
\f
;;;### (autoloads (url-data url-generic-emulator-loader url-info
-;;;;;; url-man) "url-misc" "url/url-misc.el" (20706 54231 807276
+;;;;;; url-man) "url-misc" "url/url-misc.el" (20668 35382 940599
;;;;;; 0))
;;; Generated autoloads from url/url-misc.el
;;;***
\f
;;;### (autoloads (url-snews url-news) "url-news" "url/url-news.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from url/url-news.el
(autoload 'url-news "url-news" "\
\f
;;;### (autoloads (url-ns-user-pref url-ns-prefs isInNet isResolvable
;;;;;; dnsResolve dnsDomainIs isPlainHostName) "url-ns" "url/url-ns.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from url/url-ns.el
(autoload 'isPlainHostName "url-ns" "\
;;;***
\f
;;;### (autoloads (url-generic-parse-url url-recreate-url) "url-parse"
-;;;;;; "url/url-parse.el" (20706 54231 807276 0))
+;;;;;; "url/url-parse.el" (20693 38586 665915 0))
;;; Generated autoloads from url/url-parse.el
(autoload 'url-recreate-url "url-parse" "\
;;;***
\f
;;;### (autoloads (url-setup-privacy-info) "url-privacy" "url/url-privacy.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20478 3673 653810 0))
;;; Generated autoloads from url/url-privacy.el
(autoload 'url-setup-privacy-info "url-privacy" "\
;;;***
\f
;;;### (autoloads (url-queue-retrieve) "url-queue" "url/url-queue.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20478 3673 653810 0))
;;; Generated autoloads from url/url-queue.el
(autoload 'url-queue-retrieve "url-queue" "\
;;;;;; url-percentage url-display-percentage url-pretty-length url-strip-leading-spaces
;;;;;; url-eat-trailing-space url-get-normalized-date url-lazy-message
;;;;;; url-normalize-url url-insert-entities-in-string url-parse-args
-;;;;;; url-debug url-debug) "url-util" "url/url-util.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; url-debug url-debug) "url-util" "url/url-util.el" (20584
+;;;;;; 7212 455152 0))
;;; Generated autoloads from url/url-util.el
(defvar url-debug nil "\
;;;***
\f
;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock)
-;;;;;; "userlock" "userlock.el" (20706 54231 807276 0))
+;;;;;; "userlock" "userlock.el" (20555 6946 859539 0))
;;; Generated autoloads from userlock.el
(autoload 'ask-user-about-lock "userlock" "\
\f
;;;### (autoloads (utf-7-imap-pre-write-conversion utf-7-pre-write-conversion
;;;;;; utf-7-imap-post-read-conversion utf-7-post-read-conversion)
-;;;;;; "utf-7" "international/utf-7.el" (20706 54231 807276 0))
+;;;;;; "utf-7" "international/utf-7.el" (20355 10021 546955 0))
;;; Generated autoloads from international/utf-7.el
(autoload 'utf-7-post-read-conversion "utf-7" "\
;;;***
\f
-;;;### (autoloads (utf7-encode) "utf7" "gnus/utf7.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (utf7-encode) "utf7" "gnus/utf7.el" (20355 10021
+;;;;;; 546955 0))
;;; Generated autoloads from gnus/utf7.el
(autoload 'utf7-encode "utf7" "\
\f
;;;### (autoloads (uudecode-decode-region uudecode-decode-region-internal
;;;;;; uudecode-decode-region-external) "uudecode" "mail/uudecode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from mail/uudecode.el
(autoload 'uudecode-decode-region-external "uudecode" "\
;;;;;; vc-print-log vc-retrieve-tag vc-create-tag vc-merge vc-insert-headers
;;;;;; vc-revision-other-window vc-root-diff vc-ediff vc-version-ediff
;;;;;; vc-diff vc-version-diff vc-register vc-next-action vc-before-checkin-hook
-;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (20668
+;;;;;; 35382 940599 0))
;;; Generated autoloads from vc/vc.el
(defvar vc-checkout-hook nil "\
(autoload 'vc-delete-file "vc" "\
Delete file and mark it as such in the version control system.
+If called interactively, read FILE, defaulting to the current
+buffer's file name if it's under version control.
\(fn FILE)" t nil)
(autoload 'vc-rename-file "vc" "\
Rename file OLD to NEW in both work area and repository.
+If called interactively, read OLD and NEW, defaulting OLD to the
+current buffer's file name if it's under version control.
\(fn OLD NEW)" t nil)
;;;***
\f
;;;### (autoloads (vc-annotate) "vc-annotate" "vc/vc-annotate.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20478 3673 653810 0))
;;; Generated autoloads from vc/vc-annotate.el
(autoload 'vc-annotate "vc-annotate" "\
;;;***
\f
-;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (20706 54231 807276
+;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (20478 3673 653810
;;;;;; 0))
;;; Generated autoloads from vc/vc-arch.el
(defun vc-arch-registered (file)
;;;***
\f
-;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (20706 54231 807276
+;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (20584 7212 455152
;;;;;; 0))
;;; Generated autoloads from vc/vc-bzr.el
;;;***
\f
-;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20706 54231 807276
+;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20542 46798 773957
;;;;;; 0))
;;; Generated autoloads from vc/vc-cvs.el
(defun vc-cvs-registered (f)
;;;***
\f
-;;;### (autoloads (vc-dir) "vc-dir" "vc/vc-dir.el" (20706 54231 807276
-;;;;;; 0))
+;;;### (autoloads (vc-dir vc-dir-mode) "vc-dir" "vc/vc-dir.el" (20662
+;;;;;; 46799 394737 457000))
;;; Generated autoloads from vc/vc-dir.el
+(autoload 'vc-dir-mode "vc-dir" "\
+Major mode for VC directory buffers.
+Marking/Unmarking key bindings and actions:
+m - mark a file/directory
+ - if the region is active, mark all the files in region.
+ Restrictions: - a file cannot be marked if any parent directory is marked
+ - a directory cannot be marked if any child file or
+ directory is marked
+u - unmark a file/directory
+ - if the region is active, unmark all the files in region.
+M - if the cursor is on a file: mark all the files with the same state as
+ the current file
+ - if the cursor is on a directory: mark all child files
+ - with a prefix argument: mark all files
+U - if the cursor is on a file: unmark all the files with the same state
+ as the current file
+ - if the cursor is on a directory: unmark all child files
+ - with a prefix argument: unmark all files
+mouse-2 - toggles the mark state
+
+VC commands
+VC commands in the `C-x v' prefix can be used.
+VC commands act on the marked entries. If nothing is marked, VC
+commands act on the current entry.
+
+Search & Replace
+S - searches the marked files
+Q - does a query replace on the marked files
+M-s a C-s - does an isearch on the marked files
+M-s a C-M-s - does a regexp isearch on the marked files
+If nothing is marked, these commands act on the current entry.
+When a directory is current or marked, the Search & Replace
+commands act on the child files of that directory that are displayed in
+the *vc-dir* buffer.
+
+\\{vc-dir-mode-map}
+
+\(fn)" t nil)
+
(autoload 'vc-dir "vc-dir" "\
Show the VC status for \"interesting\" files in and below DIR.
This allows you to mark files and perform VC operations on them.
;;;***
\f
;;;### (autoloads (vc-do-command) "vc-dispatcher" "vc/vc-dispatcher.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20489 12324 656827 0))
;;; Generated autoloads from vc/vc-dispatcher.el
(autoload 'vc-do-command "vc-dispatcher" "\
;;;***
\f
-;;;### (autoloads nil "vc-git" "vc/vc-git.el" (20706 54231 807276
+;;;### (autoloads nil "vc-git" "vc/vc-git.el" (20664 38325 385623
;;;;;; 0))
;;; Generated autoloads from vc/vc-git.el
(defun vc-git-registered (file)
;;;***
\f
-;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (20706 54231 807276 0))
+;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (20670 42926 924735 782000))
;;; Generated autoloads from vc/vc-hg.el
(defun vc-hg-registered (file)
"Return non-nil if FILE is registered with hg."
;;;***
\f
-;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20706 54231 807276
-;;;;;; 0))
+;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20524 51365 2559 0))
;;; Generated autoloads from vc/vc-mtn.el
(defconst vc-mtn-admin-dir "_MTN" "\
;;;***
\f
;;;### (autoloads (vc-rcs-master-templates) "vc-rcs" "vc/vc-rcs.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20584 7212 455152 0))
;;; Generated autoloads from vc/vc-rcs.el
(defvar vc-rcs-master-templates (purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")) "\
;;;***
\f
;;;### (autoloads (vc-sccs-master-templates) "vc-sccs" "vc/vc-sccs.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20584 7212 455152 0))
;;; Generated autoloads from vc/vc-sccs.el
(defvar vc-sccs-master-templates (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) "\
;;;***
\f
-;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (20706 54231 807276
+;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (20648 50109 802321
;;;;;; 0))
;;; Generated autoloads from vc/vc-svn.el
(defun vc-svn-registered (f)
;;;***
\f
;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20577 33959 40183 0))
;;; Generated autoloads from progmodes/vera-mode.el
(add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'") 'vera-mode))
;;;***
\f
;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20593 22184 581574 0))
;;; Generated autoloads from progmodes/verilog-mode.el
(autoload 'verilog-mode "verilog-mode" "\
;;;***
\f
;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20593 22184 581574 0))
;;; Generated autoloads from progmodes/vhdl-mode.el
(autoload 'vhdl-mode "vhdl-mode" "\
;;;***
\f
-;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (20627 10158 364804
+;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (20566 63671 243798
;;;;;; 0))
;;; Generated autoloads from emulation/vi.el
;;;### (autoloads (viqr-pre-write-conversion viqr-post-read-conversion
;;;;;; viet-encode-viqr-buffer viet-encode-viqr-region viet-decode-viqr-buffer
;;;;;; viet-decode-viqr-region viet-encode-viscii-char) "viet-util"
-;;;;;; "language/viet-util.el" (20706 54231 807276 0))
+;;;;;; "language/viet-util.el" (20355 10021 546955 0))
;;; Generated autoloads from language/viet-util.el
(autoload 'viet-encode-viscii-char "viet-util" "\
;;;;;; view-mode view-buffer-other-frame view-buffer-other-window
;;;;;; view-buffer view-file-other-frame view-file-other-window
;;;;;; view-file kill-buffer-if-not-modified view-remove-frame-by-deleting)
-;;;;;; "view" "view.el" (20706 54231 807276 0))
+;;;;;; "view" "view.el" (20706 50624 612201 0))
;;; Generated autoloads from view.el
(defvar view-remove-frame-by-deleting t "\
;;;***
\f
-;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (20513
+;;;;;; 18948 537867 0))
;;; Generated autoloads from emulation/vip.el
(autoload 'vip-setup "vip" "\
;;;***
\f
;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "emulation/viper.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20566 63671 243798 0))
;;; Generated autoloads from emulation/viper.el
(autoload 'toggle-viper-mode "viper" "\
;;;***
\f
;;;### (autoloads (warn lwarn display-warning) "warnings" "emacs-lisp/warnings.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from emacs-lisp/warnings.el
(defvar warning-prefix-function nil "\
;;;***
\f
;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20656 44218 805102 0))
;;; Generated autoloads from wdired.el
(autoload 'wdired-change-to-wdired-mode "wdired" "\
;;;***
\f
-;;;### (autoloads (webjump) "webjump" "net/webjump.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (webjump) "webjump" "net/webjump.el" (20566 63671
+;;;;;; 243798 0))
;;; Generated autoloads from net/webjump.el
(autoload 'webjump "webjump" "\
;;;***
\f
;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20613 49078 764749 0))
;;; Generated autoloads from progmodes/which-func.el
(put 'which-func-format 'risky-local-variable t)
(put 'which-func-current 'risky-local-variable t)
;;;### (autoloads (whitespace-report-region whitespace-report whitespace-cleanup-region
;;;;;; whitespace-cleanup global-whitespace-toggle-options whitespace-toggle-options
;;;;;; global-whitespace-newline-mode global-whitespace-mode whitespace-newline-mode
-;;;;;; whitespace-mode) "whitespace" "whitespace.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; whitespace-mode) "whitespace" "whitespace.el" (20508 13724
+;;;;;; 260761 0))
;;; Generated autoloads from whitespace.el
(autoload 'whitespace-mode "whitespace" "\
;;;***
\f
;;;### (autoloads (widget-minor-mode widget-browse-other-window widget-browse
-;;;;;; widget-browse-at) "wid-browse" "wid-browse.el" (20706 54231
-;;;;;; 807276 0))
+;;;;;; widget-browse-at) "wid-browse" "wid-browse.el" (20478 3673
+;;;;;; 653810 0))
;;; Generated autoloads from wid-browse.el
(autoload 'widget-browse-at "wid-browse" "\
;;;***
\f
;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
-;;;;;; widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (20373
+;;;;;; 11301 906925 0))
;;; Generated autoloads from wid-edit.el
(autoload 'widgetp "wid-edit" "\
;;;***
\f
;;;### (autoloads (windmove-default-keybindings windmove-down windmove-right
-;;;;;; windmove-up windmove-left) "windmove" "windmove.el" (20706
-;;;;;; 54231 807276 0))
+;;;;;; windmove-up windmove-left) "windmove" "windmove.el" (20566
+;;;;;; 63671 243798 0))
;;; Generated autoloads from windmove.el
(autoload 'windmove-left "windmove" "\
;;;***
\f
-;;;### (autoloads (winner-mode) "winner" "winner.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (winner-mode) "winner" "winner.el" (20584 7212
+;;;;;; 455152 0))
;;; Generated autoloads from winner.el
(defvar winner-mode nil "\
;;;***
\f
;;;### (autoloads (woman-bookmark-jump woman-find-file woman-dired-find-file
-;;;;;; woman woman-locale) "woman" "woman.el" (20706 54231 807276
+;;;;;; woman woman-locale) "woman" "woman.el" (20657 65077 880084
;;;;;; 0))
;;; Generated autoloads from woman.el
;;;***
\f
;;;### (autoloads (wordstar-mode) "ws-mode" "emulation/ws-mode.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20355 10021 546955 0))
;;; Generated autoloads from emulation/ws-mode.el
(autoload 'wordstar-mode "ws-mode" "\
;;;***
\f
-;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (20706 54231
-;;;;;; 807276 0))
+;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (20478 3673
+;;;;;; 653810 0))
;;; Generated autoloads from net/xesam.el
(autoload 'xesam-search "xesam" "\
;;;***
\f
;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el"
-;;;;;; (20706 54231 807276 0))
+;;;;;; (20528 48420 241677 0))
;;; Generated autoloads from xml.el
(autoload 'xml-parse-file "xml" "\
;;;***
\f
;;;### (autoloads (xmltok-get-declared-encoding-position) "xmltok"
-;;;;;; "nxml/xmltok.el" (20706 54231 807276 0))
+;;;;;; "nxml/xmltok.el" (20355 10021 546955 0))
;;; Generated autoloads from nxml/xmltok.el
(autoload 'xmltok-get-declared-encoding-position "xmltok" "\
;;;***
\f
-;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (20706
-;;;;;; 54231 807276 0))
+;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (20485
+;;;;;; 15269 390836 0))
;;; Generated autoloads from xt-mouse.el
(defvar xterm-mouse-mode nil "\
;;;***
\f
;;;### (autoloads (yenc-extract-filename yenc-decode-region) "yenc"
-;;;;;; "gnus/yenc.el" (20706 54231 807276 0))
+;;;;;; "gnus/yenc.el" (20355 10021 546955 0))
;;; Generated autoloads from gnus/yenc.el
(autoload 'yenc-decode-region "yenc" "\
;;;***
\f
;;;### (autoloads (psychoanalyze-pinhead apropos-zippy insert-zippyism
-;;;;;; yow) "yow" "play/yow.el" (20706 54231 807276 0))
+;;;;;; yow) "yow" "play/yow.el" (20364 42504 244840 586000))
;;; Generated autoloads from play/yow.el
(autoload 'yow "yow" "\
;;;***
\f
-;;;### (autoloads (zone) "zone" "play/zone.el" (20706 54231 807276
+;;;### (autoloads (zone) "zone" "play/zone.el" (20545 57511 257469
;;;;;; 0))
;;; Generated autoloads from play/zone.el
;;;;;; "net/hmac-def.el" "net/hmac-md5.el" "net/imap.el" "net/ldap.el"
;;;;;; "net/mairix.el" "net/newsticker.el" "net/ntlm.el" "net/sasl-cram.el"
;;;;;; "net/sasl-digest.el" "net/sasl-ntlm.el" "net/sasl.el" "net/soap-client.el"
-;;;;;; "net/soap-inspect.el" "net/socks.el" "net/tls.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"
+;;;;;; "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"
;;;;;; "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") (20706 54515 9904
-;;;;;; 262000))
+;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (20706 50646 12288
+;;;;;; 733000))
;;;***
\f
;; User options end here.
-(defvar report-emacs-bug-tracker-url "http://debbugs.gnu.org/cgi/"
- "Base URL of the GNU bugtracker.
-Used for querying duplicates and linking to existing bugs.")
-
(defvar report-emacs-bug-orig-text nil
"The automatically-created initial text of the bug report.")
(when (string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
(setq topic (concat (match-string 1 emacs-version) "; " topic))))
(let ((from-buffer (current-buffer))
- ;; Put these properties on semantically-void text.
- ;; report-emacs-bug-hook deletes these regions before sending.
- (prompt-properties '(field emacsbug-prompt
- intangible but-helpful
- rear-nonsticky t))
(can-insert-mail (or (report-emacs-bug-can-use-xdg-email)
(report-emacs-bug-can-use-osx-open)))
user-point message-end-point)
(insert (format "The report will be sent to %s.\n\n"
report-emacs-bug-address))
(insert "This bug report will be sent to the ")
- (insert-button
+ (insert-text-button
"Bug-GNU-Emacs"
'face 'link
'help-echo (concat "mouse-2, RET: Follow this link")
(browse-url "http://lists.gnu.org/archive/html/bug-gnu-emacs/"))
'follow-link t)
(insert " mailing list\nand the GNU bug tracker at ")
- (insert-button
+ (insert-text-button
"debbugs.gnu.org"
'face 'link
'help-echo (concat "mouse-2, RET: Follow this link")
(insert "Please describe exactly what actions triggered the bug, and\n"
"the precise symptoms of the bug. If you can, give a recipe\n"
"starting from `emacs -Q':\n\n")
- (add-text-properties (save-excursion
- (rfc822-goto-eoh)
- (line-beginning-position 2))
- (point)
- prompt-properties)
+ (let ((txt (delete-and-extract-region
+ (save-excursion (rfc822-goto-eoh) (line-beginning-position 2))
+ (point))))
+ (insert (propertize "\n" 'display txt)))
(setq user-point (point))
(insert "\n\n")
(if (file-readable-p debug-file)
(insert "For information about debugging Emacs, please read the file\n"
debug-file ".\n")))
- (add-text-properties (1+ user-point) (point) prompt-properties)
+ (let ((txt (delete-and-extract-region (1+ user-point) (point))))
+ (insert (propertize "\n" 'display txt)))
(insert "\n\nIn " (emacs-version) "\n")
(if (stringp emacs-bzr-version)
from))
(not (yes-or-no-p
(format "Is `%s' really your email address? " from)))
- (error "Please edit the From address and try again"))))
- ;; Delete the uninteresting text that was just to help fill out the report.
- (rfc822-goto-eoh)
- (forward-line 1)
- (let ((pos (1- (point))))
- (while (setq pos (text-property-any pos (point-max)
- 'field 'emacsbug-prompt))
- (delete-region pos (field-end (1+ pos)))))))
-
-
-;; Querying the bug database
-
-(defvar report-emacs-bug-bug-alist nil)
-(make-variable-buffer-local 'report-emacs-bug-bug-alist)
-(defvar report-emacs-bug-choice-widget nil)
-(make-variable-buffer-local 'report-emacs-bug-choice-widget)
-
-(defun report-emacs-bug-create-existing-bugs-buffer (bugs keywords)
- (switch-to-buffer (get-buffer-create "*Existing Emacs Bugs*"))
- (setq buffer-read-only t)
- (let ((inhibit-read-only t))
- (erase-buffer)
- (setq report-emacs-bug-bug-alist bugs)
- (widget-insert (propertize (concat "Already known bugs ("
- keywords "):\n\n")
- 'face 'bold))
- (if bugs
- (setq report-emacs-bug-choice-widget
- (apply 'widget-create 'radio-button-choice
- :value (caar bugs)
- (let (items)
- (dolist (bug bugs)
- (push (list
- 'url-link
- :format (concat "Bug#" (number-to-string (nth 2 bug))
- ": " (cadr bug) "\n %[%v%]\n")
- ;; FIXME: Why is only the link of the
- ;; active item clickable?
- (car bug))
- items))
- (nreverse items))))
- (widget-insert "No bugs matching your keywords found.\n"))
- (widget-insert "\n")
- (widget-create 'push-button
- :notify (lambda (&rest ignore)
- ;; TODO: Do something!
- (message "Reporting new bug!"))
- "Report new bug")
- (when bugs
- (widget-insert " ")
- (widget-create 'push-button
- :notify (lambda (&rest ignore)
- (let ((val (widget-value report-emacs-bug-choice-widget)))
- ;; TODO: Do something!
- (message "Appending to bug %s!"
- (nth 2 (assoc val report-emacs-bug-bug-alist)))))
- "Append to chosen bug"))
- (widget-insert " ")
- (widget-create 'push-button
- :notify (lambda (&rest ignore)
- (kill-buffer))
- "Quit reporting bug")
- (widget-insert "\n"))
- (use-local-map widget-keymap)
- (widget-setup)
- (goto-char (point-min)))
-
-(defun report-emacs-bug-parse-query-results (status keywords)
- (goto-char (point-min))
- (let (buglist)
- (while (re-search-forward "<a href=\"bugreport\\.cgi\\?bug=\\([[:digit:]]+\\)\">\\([^<]+\\)</a>" nil t)
- (let ((number (match-string 1))
- (subject (match-string 2)))
- (when (not (string-match "^#" subject))
- (push (list
- ;; first the bug URL
- (concat report-emacs-bug-tracker-url
- "bugreport.cgi?bug=" number)
- ;; then the subject and number
- subject (string-to-number number))
- buglist))))
- (report-emacs-bug-create-existing-bugs-buffer (nreverse buglist) keywords)))
-
-(defun report-emacs-bug-query-existing-bugs (keywords)
- "Query for KEYWORDS at `report-emacs-bug-tracker-url', and return the result.
-The result is an alist with items of the form (URL SUBJECT NO)."
- (interactive "sBug keywords (comma separated): ")
- (url-retrieve (concat report-emacs-bug-tracker-url
- "pkgreport.cgi?include=subject%3A"
- (replace-regexp-in-string "[[:space:]]+" "+" keywords)
- ";package=emacs")
- 'report-emacs-bug-parse-query-results (list keywords)))
-(make-obsolete 'report-emacs-bug-query-existing-bugs
- "use the `debbugs' package from GNU ELPA instead." "24.3")
+ (error "Please edit the From address and try again"))))))
+
(provide 'emacsbug)
(defun mail-abbrev-expand-wrapper (expand)
(if (and mail-abbrevs (not (eq mail-abbrevs t)))
- (if (mail-abbrev-in-expansion-header-p)
+ (if (or (mail-abbrev-in-expansion-header-p)
+ ;; Necessary for `message-read-from-minibuffer' to work.
+ (window-minibuffer-p))
- ;; We are in a To: (or CC:, or whatever) header, and
- ;; should use word-abbrevs to expand mail aliases.
+ ;; We are in a To: (or CC:, or whatever) header or a minibuffer,
+ ;; and should use word-abbrevs to expand mail aliases.
(let ((local-abbrev-table mail-abbrevs))
;; Before anything else, resolve aliases if they need it.
"The current header display style choice, one of
'normal (selected headers) or 'full (all headers).")
+(defvar rmail-mime-decoded nil
+ "Non-nil if message has been processed by `rmail-show-mime-function'.")
+(put 'rmail-mime-decoded 'permanent-local t) ; for rmail-edit
+
(defgroup rmail nil
"Mail reader for Emacs."
:group 'mail)
(defun rmail-set-header-1 (name value)
"Subroutine of `rmail-set-header'.
-Narrow to header, set header NAME to VALUE, replacing existing if present.
-VALUE nil means to remove NAME altogether."
+Narrow to headers, set header NAME to VALUE, replacing existing if present.
+VALUE nil means to remove NAME altogether.
+
+Only changes the first instance of NAME. If VALUE is multi-line,
+continuation lines should already be indented. VALUE should not
+end in a newline."
(if (search-forward "\n\n" nil t)
(progn
(forward-char -1)
(narrow-to-region (point-min) (point))
+ ;; cf mail-fetch-field.
(goto-char (point-min))
- (if (re-search-forward (concat "^" (regexp-quote name) ":") nil 'move)
+ (if (let ((case-fold-search t))
+ (re-search-forward (concat "^" (regexp-quote name) "[ \t]*:")
+ nil 'move))
+ (let ((start (point))
+ end)
+ (while (and (zerop (forward-line 1))
+ (looking-at "[ \t]")))
+ ;; Back up over newline.
+ (forward-char -1)
+ (setq end (point))
+ (goto-char start)
(if value
(progn
- (delete-region (point) (line-end-position))
+ (delete-region start end)
(insert " " value))
- (delete-region (line-beginning-position)
- (line-beginning-position 2)))
+ (delete-region (line-beginning-position) (1+ end))))
+ ;; Not already present: insert at end of headers.
(if value (insert name ": " value "\n"))))
(rmail-error-bad-format)))
:group 'rmail
:version "23.1")
+;; FIXME?
+;; rmail-show-mime-function does not unquote >From lines. Should it?
+(defcustom rmail-mbox-format 'mboxrd
+ "The mbox format that your system uses.
+There is no way to determine this, so you should set the appropriate value.
+The formats quote lines containing \"From \" differently.
+The choices are:
+ `mboxo' : lines that start with \"From \" quoted as \">From \"
+ `mboxrd': lines that start with \">*From \" quoted with another \">\"
+The `mboxo' format is ambiguous, in that one cannot know whether
+a line starting with \">From \" originally had a \">\" or not.
+
+It is not critical to set this to the correct value; it only affects
+how Rmail displays lines starting with \">*From \" in non-MIME messages.
+
+See also `unrmail-mbox-format'."
+ :type '(choice (const mboxrd)
+ (const mboxro))
+ :version "24.4"
+ :group 'rmail-files)
+
(defun rmail-show-message-1 (&optional msg)
"Show message MSG (default: current message) using `rmail-view-buffer'.
Return text to display in the minibuffer if MSG is out of
(re-search-forward "mime-version: 1.0" nil t))
(let ((rmail-buffer mbox-buf)
(rmail-view-buffer view-buf))
+ (set (make-local-variable 'rmail-mime-decoded) t)
(funcall rmail-show-mime-function))
(setq body-start (search-forward "\n\n" nil t))
(narrow-to-region beg (point))
;; Prepare the separator (blank line) before the body.
(goto-char (point-min))
(insert "\n")
- ;; Unquote quoted From lines
- (while (re-search-forward "^>+From " nil t)
- (beginning-of-line)
- (delete-char 1)
- (forward-line))
+ ;; Unquote quoted From lines.
+ (let ((fromline (if (eq 'mboxrd rmail-mbox-format)
+ "^>+From "
+ "^>From "))
+ case-fold-search)
+ (while (re-search-forward fromline nil t)
+ (beginning-of-line)
+ (delete-char 1)
+ (forward-line)))
(goto-char (point-min)))
;; Copy the headers to the front of the message view buffer.
(rmail-copy-headers beg end)
(msgnum rmail-current-message)
(subject (concat "["
(let ((from (or (mail-fetch-field "From")
+ ;; FIXME - huh?
(mail-fetch-field ">From"))))
(if from
(concat (mail-strip-quoted-names from) ": ")
;; Put the summary buffer back on the screen, if user wants that.
(defun rmail-maybe-display-summary ()
- (let ((selected (selected-window))
- (buffer (current-buffer))
- window)
- ;; If requested, make sure the summary is displayed.
- (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
- rmail-redisplay-summary
- (if (get-buffer-window rmail-summary-buffer 0)
- ;; It's already in some frame; show that one.
- (let ((frame (window-frame
- (get-buffer-window rmail-summary-buffer 0))))
- (make-frame-visible frame)
- (raise-frame frame))
- (display-buffer rmail-summary-buffer)))
- ;; If requested, set the height of the summary window.
- (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
- rmail-summary-window-size
- (setq window (get-buffer-window rmail-summary-buffer))
- ;; Don't try to change the size if just one window in frame.
- (not (eq window (frame-root-window (window-frame window))))
- (unwind-protect
- (progn
- (select-window window)
- (enlarge-window (- rmail-summary-window-size (window-height))))
- (select-window selected)
- (set-buffer buffer)))))
+ (cond
+ ((or (not rmail-summary-buffer)
+ (not (buffer-name rmail-summary-buffer))))
+ (rmail-redisplay-summary
+ ;; If `rmail-redisplay-summary' is non-nil, make sure the summary
+ ;; buffer is displayed.
+ (display-buffer
+ rmail-summary-buffer
+ `(nil
+ (reusable-frames . 0)
+ ,(when rmail-summary-window-size
+ `(window-height . ,rmail-summary-window-size)))))
+ (rmail-summary-window-size
+ ;; If `rmail-summary-window-size' is non-nil and the summary buffer
+ ;; is displayed, make sure it gets resized.
+ (let ((window (get-buffer-window rmail-summary-buffer 0)))
+ (when window
+ (window-resize-no-error
+ window (- rmail-summary-window-size (window-height window))))))))
\f
;;;; *** Rmail Local Fontification ***
;;; Start of automatically extracted autoloads.
\f
;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el"
-;;;;;; "1aec1d54f9767ee0fea557bbfb1d547b")
+;;;;;; "0b056146d4775080a1847b8ce7527bc5")
;;; Generated autoloads from rmailedit.el
(autoload 'rmail-edit-current-message "rmailedit" "\
(if (or rmail-old-mime-state
(not rmail-old-pruned))
(forward-line 1))
- (while (re-search-forward "^>*From " nil t)
- (beginning-of-line)
- (insert ">")
- (forward-line))
+ ;; When editing a non-MIME message, rmail-show-message-1 has unescaped
+ ;; ^>*From lines according to rmail-mbox-format. We are editing
+ ;; the message as it was displayed, and need to put the escapes when done.
+ ;; When editing a MIME message, we are editing the "raw" message.
+ ;; ^>*From lines have not been escaped, but we still need to ensure
+ ;; a "^From " line is escaped so as not to break later parsing (?).
+ ;; With ^>+From lines, we have no way of knowing whether the person
+ ;; doing the editing escaped them or not, so it seems best to leave
+ ;; them alone. (This all assumes you are using rmailmm rather than
+ ;; something else that behaves differently.)
+ (let ((fromline (if (or (eq 'mboxo rmail-mbox-format)
+ rmail-mime-decoded)
+ "^From "
+ "^>*From "))
+ case-fold-search)
+ (while (re-search-forward fromline nil t)
+ (beginning-of-line)
+ (insert ">")
+ (forward-line)))
;; Make sure buffer ends with a blank line so as not to run this
;; message together with the following one.
(goto-char (point-max))
(setq buffer-undo-list t)
(rmail-variables))
;; If text has really changed, mark message as edited.
+ ;; FIXME we should do the comparison before escaping From lines.
(unless (and (= (length old) (- (point-max) (point-min)))
(string= old (buffer-substring (point-min) (point-max))))
(setq old nil)
password (plist-get auth-info :secret)))
(when (functionp password)
(setq password (funcall password)))
+ (let ((result (catch 'done
+ (smtpmail-try-auth-method process mech user password))))
+ (if (stringp result)
+ (progn
+ (auth-source-forget+ :host host :port port)
+ (throw 'done result))
+ (when save-function
+ (funcall save-function))
+ result))))
+
+(defun smtpmail-try-auth-method (process mech user password)
+ (let (ret)
(cond
((or (not mech)
(not user)
;; are taken as a response to the server, and the
;; authentication fails.
(encoded (base64-encode-string response t)))
- (smtpmail-command-or-throw process encoded)
- (when save-function
- (funcall save-function)))))
+ (smtpmail-command-or-throw process encoded))))
((eq mech 'login)
(smtpmail-command-or-throw process "AUTH LOGIN")
- (smtpmail-command-or-throw
- process (base64-encode-string user t))
- (smtpmail-command-or-throw process (base64-encode-string password t))
- (when save-function
- (funcall save-function)))
+ (smtpmail-command-or-throw process (base64-encode-string user t))
+ (smtpmail-command-or-throw process (base64-encode-string password t)))
((eq mech 'plain)
;; We used to send an empty initial request, and wait for an
;; empty response, and then send the password, but this
process
(concat "AUTH PLAIN "
(base64-encode-string (concat "\0" user "\0" password) t))
- 235)
- (when save-function
- (funcall save-function)))
+ 235))
(t
(error "Mechanism %s not implemented" mech)))))
-;;; unrmail.el --- convert Rmail Babyl files to mailbox files
+;;; unrmail.el --- convert Rmail Babyl files to mbox files
;; Copyright (C) 1992, 2001-2013 Free Software Foundation, Inc.
;;;###autoload
(defun batch-unrmail ()
- "Convert old-style Rmail Babyl files to system inbox format.
+ "Convert old-style Rmail Babyl files to mbox format.
Specify the input Rmail Babyl file names as command line arguments.
For each Rmail file, the corresponding output file name
is made by adding `.mail' at the end.
(declare-function mail-mbox-from "mail-utils" ())
(defvar rmime-magic-string) ; in rmime.el, if you have it
+(defcustom unrmail-mbox-format 'mboxrd
+ "The mbox format that `unrmail' should produce.
+These formats separate messages using lines that start with \"From \".
+Therefore any lines in the message bodies that start with \"From \"
+must be quoted. The `mboxo' format just prepends a \">\" to such lines.
+This is not reversible, because given a line starting with \">From \" in
+an mboxo file, it is not possible to know whether the original had a \">\"
+or not. The `mxbord' format avoids this by also quoting \">From \" as
+\">>From \", and so on. For this reason, mboxrd is recommended.
+
+See also `rmail-mbox-format'."
+ :type '(choice (const mboxrd)
+ (const mboxro))
+ :version "24.4"
+ :group 'rmail-files)
+
;;;###autoload
(defun unrmail (file to-file)
- "Convert old-style Rmail Babyl file FILE to system inbox format file TO-FILE."
+ "Convert old-style Rmail Babyl file FILE to mbox format file TO-FILE.
+The variable `unrmail-mbox-format' controls which mbox format to use."
(interactive "fUnrmail (babyl file): \nFUnrmail into (new mailbox file): ")
(with-temp-buffer
;; Read in the old Rmail file with no decoding.
(when keywords
(insert "X-RMAIL-KEYWORDS: " keywords "\n"))
(goto-char (point-min))
- ;; ``Quote'' "\nFrom " as "\n>From "
- ;; (note that this isn't really quoting, as there is no requirement
- ;; that "\n[>]+From " be quoted in the same transparent way.)
- (let ((case-fold-search nil))
- (while (search-forward "\nFrom " nil t)
- (forward-char -5)
- (insert ?>)))
+ ;; Convert From to >From, etc.
+ (let ((case-fold-search nil)
+ (fromline (if (eq 'mboxrd unrmail-mbox-format)
+ "^>*From "
+ "^From ")))
+ (while (re-search-forward fromline nil t)
+ (beginning-of-line)
+ (insert ?>)
+ (forward-line 1)))
(goto-char (point-max))
;; Add terminator blank line to message.
(insert "\n")
cedet/semantic/symref \
cedet/semantic/wisent
-WINS_BASIC=\
+# The list of subdirectories is subdivided into 4 more or less equal
+# parts so that we could have 4-way parallelism while compiling Lisp
+# files, which helps to slash bootstrap times. See the 'compile'
+# target below.
+WINS_BASIC1=\
calc \
calendar \
emacs-lisp \
- emulation \
erc \
- eshell \
+ net \
+ url
+
+WINS_BASIC2=\
gnus \
international \
language \
- mail \
+ mail
+
+WINS_BASIC3=\
+ emulation \
mh-e \
- net \
nxml \
org \
play \
- progmodes \
textmodes \
- url \
vc
+WINS_BASIC4=\
+ eshell \
+ progmodes
+
+WINS_BASIC= $(WINS_BASIC1) $(WINS_BASIC2) $(WINS_BASIC3) $(WINS_BASIC4)
+
# Directories with lisp files to compile, and to extract data from
# (customs, autoloads, etc.)
WINS_UPDATES=$(WINS_BASIC) \
# compiled find the right files.
# Need separate version for sh and native cmd.exe
-compile: $(lisp)/subdirs.el compile-$(SHELLTYPE) doit
+compile: $(lisp)/subdirs.el compile0-$(SHELLTYPE) compile1-$(SHELLTYPE) compile2-$(SHELLTYPE) compile3-$(SHELLTYPE) compile4-$(SHELLTYPE) doit
-compile-CMD: autoloads
+compile0-CMD: autoloads
# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
for %%f in ($(COMPILE_FIRST)) do \
$(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f
- for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
+
+compile1-CMD: autoloads compile0-CMD
+ for %%f in (. $(WINS_BASIC1)) do for %%g in (%%f/*.el) do \
$(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
-compile-SH: autoloads
+compile2-CMD: autoloads compile0-CMD
+ for %%f in ($(WINS_BASIC2)) do for %%g in (%%f/*.el) do \
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
+
+compile3-CMD: autoloads compile0-CMD
+ for %%f in ($(WINS_BASIC3)) do for %%g in (%%f/*.el) do \
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
+
+compile4-CMD: autoloads compile0-CMD
+ for %%f in ($(WINS_BASIC4) $(WINS_CEDET) term obsolete) do for %%g in (%%f/*.el) do \
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
+
+compile0-SH: autoloads
# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
for el in $(COMPILE_FIRST); do \
echo Compiling $$el; \
$(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
done
- for dir in $(lisp) $(WINS); do \
+
+compile1-SH: autoloads compile0-SH
+ for dir in $(lisp) $(WINS_BASIC1); do \
+ for el in $$dir/*.el; do \
+ if test -f $$el; \
+ then \
+ echo Compiling $$el; \
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
+ fi \
+ done; \
+ done
+
+compile2-SH: autoloads compile0-SH
+ for dir in $(WINS_BASIC2); do \
+ for el in $$dir/*.el; do \
+ if test -f $$el; \
+ then \
+ echo Compiling $$el; \
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
+ fi \
+ done; \
+ done
+
+compile3-SH: autoloads compile0-SH
+ for dir in $(WINS_BASIC3); do \
+ for el in $$dir/*.el; do \
+ if test -f $$el; \
+ then \
+ echo Compiling $$el; \
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
+ fi \
+ done; \
+ done
+
+compile4-SH: autoloads compile0-SH
+ for dir in $(WINS_BASIC4) $(WINS_CEDET) term obsolete; do \
for el in $$dir/*.el; do \
if test -f $$el; \
then \
$(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) $(MAKE) ./mh-e
# Update TRAMP internal autoloads. Maybe we could move tramp*.el into
-# its own subdirectory. OTOH, it does not hurt to keep them in
+# an own subdirectory. OTOH, it does not hurt to keep them in
# lisp/net.
-TRAMP_SRC = $(lisp)/net/tramp.el $(lisp)/net/tramp-cache.el \
- $(lisp)/net/tramp-cmds.el $(lisp)/net/tramp-compat.el \
- $(lisp)/net/tramp-ftp.el $(lisp)/net/tramp-gvfs.el \
- $(lisp)/net/tramp-gw.el $(lisp)/net/tramp-sh.el \
- $(lisp)/net/tramp-smb.el $(lisp)/net/tramp-uu.el \
- $(lisp)/net/trampver.el
-
-$(lisp)/net/tramp-loaddefs.el: $(TRAMP_SRC) $(lisp)/subdirs.el
+TRAMP_DIR = $(lisp)/net
+TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \
+ $(TRAMP_DIR)/tramp-cache.el $(TRAMP_DIR)/tramp-cmds.el \
+ $(TRAMP_DIR)/tramp-compat.el $(TRAMP_DIR)/tramp-ftp.el \
+ $(TRAMP_DIR)/tramp-gvfs.el $(TRAMP_DIR)/tramp-gw.el \
+ $(TRAMP_DIR)/tramp-sh.el $(TRAMP_DIR)/tramp-smb.el \
+ $(TRAMP_DIR)/tramp-uu.el $(TRAMP_DIR)/trampver.el
+
+$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC) $(lisp)/subdirs.el
"$(EMACS)" $(EMACSOPT) \
-l autoload \
--eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###tramp-autoload$(DQUOTE))$(ARGQUOTE) \
--eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
--eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \
-f w32-batch-update-autoloads \
- $(ARGQUOTE)$(lisp)/net/tramp-loaddefs.el$(ARGQUOTE) $(MAKE) ./net
+ $(ARGQUOTE)$(TRAMP_DIR)/tramp-loaddefs.el$(ARGQUOTE) $(MAKE) ./net
# Prepare a bootstrap in the lisp subdirectory.
#
'(menu-item "Find Options by Value..." apropos-value
:help "Find variables whose values match a regexp"))
(bindings--define-key menu [find-options-by-name]
- '(menu-item "Find Options by Name..." apropos-variable
- :help "Find variables whose names match a regexp"))
+ '(menu-item "Find Options by Name..." apropos-user-option
+ :help "Find user options whose names match a regexp"))
(bindings--define-key menu [find-commands-by-name]
'(menu-item "Find Commands by Name..." apropos-command
:help "Find commands whose names match a regexp"))
+2012-11-25 Bill Wohler <wohler@newt.com>
+
+ Release MH-E version 8.4.
+
+ * mh-e.el (Version, mh-version): Update for release 8.4.
+
+ * mh-comp.el (mh-regexp-in-field-syntax-table): Fix docstring.
+ (mh-edit-again): Format.
+ (mh-components-to-list): Fix docstring.
+ (mh-regexp-in-field-p): Remove unused variable `field'.
+
+ * mh-compat.el (mh-define-obsolete-variable-alias)
+ (mh-make-obsolete-variable): New macros to fix XEmacs compiler
+ warnings.
+
+ * mh-letter.el (mh-yank-hooks): Use new mh-make-obsolete-variable
+ macro.
+
+ * mh-e.el (mh-kill-folder-suppress-prompt-hooks): Use
+ new mh-define-obsolete-variable-alias macro.
+
+ * mh-compat.el (mh-cl-flet): New alias for cl-flet on Emacs 24 and
+ flet elsewhere.
+
+ * mh-thread.el (mh-thread-set-tables): Replace flet with new alias
+ mh-cl-flet.
+
+ * mh-show.el (mh-gnus-article-highlight-citation):
+ Replace flet with new alias mh-cl-flet.
+
+ * mh-mime.el (mh-display-with-external-viewer, mh-mime-display)
+ (mh-press-button, mh-push-button, mh-display-emphasis): Replace
+ flet with new alias mh-cl-flet.
+
+ * mh-e.el (mh-invisible-header-fields-internal):
+ Remove trailing whitespace.
+
+2012-11-25 Jeffrey C Honig <jch@honig.net>
+
+ * mh-comp.el: (mh-edit-again): Use the components file to specify
+ default values for missing headers in the draft.
+ (mh-regexp-in-field-syntax-table, mh-fcc-syntax-table)
+ (mh-addr-syntax-table, mh-regexp-in-field-p): Use a syntax table
+ so we'll properly parse non-address fields.
+ (mh-components-to-list, mh-extract-header-field): New functions to
+ read components file.
+ (mh-find-components, mh-send-sub): Move code to locate components
+ file into a new function.
+ (mh-insert-auto-fields, mh-modify-header-field): New syntax for
+ calling mh-regexp-in-field-p (closes SF #1708292).
+
+ * mh-e.el (mh-invisible-header-fields-internal): Added: X-xsi.
+ (addresses SF #1916032).
+
+ * mh-folder.el (mh-inc-folder): Call mh-process-or-undo-commands
+ before running to insure we do not lose any pending changes.
+ (closes SF #2321115).
+
+2012-11-25 Ted Phelps <phelps@gnusto.com>
+
+ Postpone junk processing (closes SF #2945712). Patch submitted by
+ Ted Phelps and refined by Bill Wohler.
+
+ * mh-e.el (mh-blacklist, mh-whitelist): New variables.
+ (mh-whitelist-preserves-sequences-flag): New option.
+ (mh-before-commands-processed-hook): Update documentation.
+ (mh-blacklist-msg-hook, mh-whitelist-msg-hook): New hooks.
+ (mh-folder-blacklisted, mh-folder-whitelisted): New faces.
+ * mh-folder.el (mh-folder-message-menu): Add "Junk" to "Undo."
+ (mh-folder-font-lock-keywords): Add regexps for blacklisted and
+ whitelisted messages.
+ (mh-folder-mode): Add mh-blacklist and mh-whitelist variables.
+ (mh-execute-commands): Update documentation.
+ (mh-undo, mh-outstanding-commands-p, mh-process-commands)
+ (mh-delete-a-msg, mh-refile-a-msg, mh-undo-msg): Handle
+ blacklisted and whitelisted messages.
+ * mh-junk.el (mh-junk-blacklist, mh-junk-whitelist): Update to put
+ messages in blacklist and whitelist respectively for latter
+ processing.
+ (mh-blacklist-a-msg, mh-junk-whitelist-a-msg): New function to
+ support previous functions.
+ (mh-junk-blacklist-disposition): New function.
+ (mh-junk-process-blacklist, mh-junk-process-whitelist): New
+ functions that perform the blacklisting and whitelisting
+ respectively that used to be performed by mh-junk-blacklist and
+ mh-junk-whitelist.
+ * mh-scan.el (mh-scan-blacklisted-msg-regexp)
+ (mh-scan-whitelisted-msg-regexp): New scan line regexps.
+ (mh-scan-good-msg-regexp): Add B and W characters to regexp.
+ (mh-scan-cmd-note-width): Update documentation.
+ (mh-note-blacklisted, mh-note-whitelisted): New scan line
+ characters.
+ * mh-search.el (mh-index-execute-commands): Handle blacklisted and
+ whitelisted messages.
+
+2012-11-25 Jeffrey C Honig <jch@honig.net>
+
+ * mh-e.el (mh-invisible-header-fields-internal): Added:
+ Bounces-To:, Bounces_to:, X-ACL-Warn:, X-BFI:, X-BPS1:, X-BPS2:,
+ X-Campaign-Id:, X-Campaign:, X-Cloudmark-SP-, X-Destination-ID:,
+ X-detected-operating-system:, X-DocGen-Version:, X-EM-,
+ X-Email-Type-Id:, X-FB-SS:, X-FuHaFi:, X-MailFlowPolicy:,
+ X-mail_abuse-inquires, X-MailingID:, X-Match:,
+ X-MaxCode-Template:, X-ME-Bayesian:, X-Sendergroup:, X-SFDC-,
+ X-SMFBL:, X-SMHeaderMap:, X-VGI-OESCD:, X-VirtualServer:,
+ X-VirtualServerGroup:, X-XPT-XSL-Name:, X-Y-GMX-Trusted:,
+ X-XWALL-, X-ZixNet:. Changed X-Habeas-SWE- to X-Habeas-. Updated
+ the comment. (addresses SF #1916032).
+
+2012-11-25 Bill Wohler <wohler@newt.com>
+
+ * mh-e.el (mh-invisible-header-fields-internal): Add
+ X-AnalysisOut, X-Authentication-Info, X-Auto-Response-Suppress,
+ X-Bayes-Prob, X-Cam-, X-CanIt-Geo, X-Completed, X-Facebook,
+ X-Forwarded-, X-Generated-By, X-Headers-End, X-IEEE-UCE,
+ X-Jira-Fingerprint, X-Junkmail-, X-Launchpad-, X-MXL-Hash,
+ X-Notification-, X-Notifications, X-Oracle-Calendar. Replace
+ X-DCC-Usenix-Metrics with X-DCC- (addresses SF #1916032).
+
+2012-11-25 Jeffrey C Honig <jch@honig.net>
+
+ * mh-letter.el (mh-yank-cur-msg): Replace usage of set-buffer with
+ with-current-buffer in mh-yang-cur-msg, semantics changed in emacs
+ 23 and we do not want to use set-buffer unless we actually want to
+ change the buffer the user is looking at (closes SF #2830504).
+
+ * mh-show.el (mh-show-folder-map): Add missing key binding for
+ mh-show-pack-folder (closes SF #3466086).
+
+2012-11-25 Bill Wohler <wohler@newt.com>
+
+ * mh-e.el (Version, mh-version): Add +bzr to version.
+
2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
* mh-letter.el (mh-yank-hooks): Use make-obsolete-variable.
syntax-table)
"Syntax table used by MH-E while in MH-Letter mode.")
+(defvar mh-regexp-in-field-syntax-table nil
+ "Specify a syntax table for `mh-regexp-in-field-p' to use.")
+
+(defvar mh-fcc-syntax-table
+ (let ((syntax-table (make-syntax-table text-mode-syntax-table)))
+ (modify-syntax-entry ?+ "w" syntax-table)
+ (modify-syntax-entry ?/ "w" syntax-table)
+ syntax-table)
+ "Syntax table used by MH-E while searching an Fcc field.")
+
+(defvar mh-addr-syntax-table
+ (let ((syntax-table (make-syntax-table text-mode-syntax-table)))
+ (modify-syntax-entry ?! "w" syntax-table)
+ (modify-syntax-entry ?# "w" syntax-table)
+ (modify-syntax-entry ?$ "w" syntax-table)
+ (modify-syntax-entry ?% "w" syntax-table)
+ (modify-syntax-entry ?& "w" syntax-table)
+ (modify-syntax-entry ?' "w" syntax-table)
+ (modify-syntax-entry ?* "w" syntax-table)
+ (modify-syntax-entry ?+ "w" syntax-table)
+ (modify-syntax-entry ?- "w" syntax-table)
+ (modify-syntax-entry ?/ "w" syntax-table)
+ (modify-syntax-entry ?= "w" syntax-table)
+ (modify-syntax-entry ?? "w" syntax-table)
+ (modify-syntax-entry ?^ "w" syntax-table)
+ (modify-syntax-entry ?_ "w" syntax-table)
+ (modify-syntax-entry ?` "w" syntax-table)
+ (modify-syntax-entry ?{ "w" syntax-table)
+ (modify-syntax-entry ?| "w" syntax-table)
+ (modify-syntax-entry ?} "w" syntax-table)
+ (modify-syntax-entry ?~ "w" syntax-table)
+ (modify-syntax-entry ?. "w" syntax-table)
+ (modify-syntax-entry ?@ "w" syntax-table)
+ syntax-table)
+ "Syntax table used by MH-E while searching an address field.")
+
(defvar mh-send-args ""
"Extra args to pass to \"send\" command.")
(mh-read-draft "clean-up" (mh-msg-filename message) nil)))))
(mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil)
(mh-insert-header-separator)
+ ;; Merge in components
+ (mh-mapc
+ (function
+ (lambda (header-field)
+ (let ((field (car header-field))
+ (value (cdr header-field))
+ (case-fold-search t))
+ (cond
+ ;; Address field
+ ((string-match field "^To$\\|^Cc$\\|^From$")
+ (cond
+ ((not (mh-goto-header-field (concat field ":")))
+ ;; Header field does not exist, add it
+ (mh-goto-header-end 0)
+ (insert field ": " value "\n"))
+ ((string-equal value "")
+ ;; Header field already exists and no value
+ )
+ (t
+ ;; Header field exists and we have a value
+ (let (address mailbox (alias (mh-alias-expand value)))
+ (and alias
+ (setq address (ietf-drums-parse-address alias))
+ (setq mailbox (car address)))
+ ;; XXX - Need to parse all addresses out of field
+ (if (and
+ (not (mh-regexp-in-field-p
+ (concat "\\b" (regexp-quote value) "\\b") field))
+ mailbox
+ (not (mh-regexp-in-field-p
+ (concat "\\b" (regexp-quote mailbox) "\\b") field)))
+ (insert " " value ","))
+ ))))
+ ((string-match field "^Fcc$")
+ ;; Folder reference
+ (mh-modify-header-field field value))
+ ;; Text field, that's an easy case
+ (t
+ (mh-modify-header-field field value))))))
+ (mh-components-to-list (mh-find-components)))
(goto-char (point-min))
(save-buffer)
- (mh-compose-and-send-mail draft "" from-folder nil nil nil nil nil nil
- config)
+ (mh-compose-and-send-mail
+ draft "" from-folder nil nil nil nil nil nil config)
(mh-letter-mode-message)
(mh-letter-adjust-point)))
+(defun mh-extract-header-field ()
+ "Extract field name and field value from the field at point.
+Returns a list of field name and value (which may be null)."
+ (let ((end (save-excursion (mh-header-field-end)
+ (point))))
+ (if (looking-at mh-letter-header-field-regexp)
+ (save-excursion
+ (goto-char (match-end 1))
+ (forward-char 1)
+ (skip-chars-forward " \t")
+ (cons (match-string-no-properties 1) (buffer-substring-no-properties (point) end))))))
+
+
+(defun mh-components-to-list (components)
+ "Convert the COMPONENTS file to a list of field names and values."
+ (with-current-buffer (get-buffer-create mh-temp-buffer)
+ (erase-buffer)
+ (insert-file-contents components)
+ (goto-char (point-min))
+ (let
+ ((header-fields nil))
+ (while (mh-in-header-p)
+ (setq header-fields (append header-fields (list (mh-extract-header-field))))
+ (mh-header-field-end)
+ (forward-char 1)
+ )
+ header-fields)))
+
;;;###mh-autoload
(defun mh-extract-rejected-mail (message)
"Edit a MESSAGE that was returned by the mail system.
(t
nil))))
+(defun mh-find-components ()
+ "Return the path to the components file."
+ (let (components)
+ (cond
+ ((file-exists-p
+ (setq components
+ (expand-file-name mh-comp-formfile mh-user-path)))
+ components)
+ ((file-exists-p
+ (setq components
+ (expand-file-name mh-comp-formfile mh-lib)))
+ components)
+ (t
+ (error "Can't find %s in %s or %s"
+ mh-comp-formfile mh-user-path mh-lib)))))
+
(defun mh-send-sub (to cc subject config)
"Do the real work of composing and sending a letter.
Expects the TO, CC, and SUBJECT fields as arguments.
(message "Composing a message...")
(let ((draft (mh-read-draft
"message"
- (let (components)
- (cond
- ((file-exists-p
- (setq components
- (expand-file-name mh-comp-formfile mh-user-path)))
- components)
- ((file-exists-p
- (setq components
- (expand-file-name mh-comp-formfile mh-lib)))
- components)
- (t
- (error "Can't find %s in %s or %s"
- mh-comp-formfile mh-user-path mh-lib))))
+ (mh-find-components)
nil)))
(mh-insert-fields "To:" to "Subject:" subject "Cc:" cc)
(goto-char (point-max))
(insert " " value)
(delete-region (point) (mh-line-end-position)))
((and (not overwrite-flag)
- (mh-regexp-in-field-p (concat "\\b" value "\\b") field))
+ (mh-regexp-in-field-p (concat "\\b" (regexp-quote value) "\\b") field))
;; Already there, do nothing.
)
((and (not overwrite-flag)
(defun mh-regexp-in-field-p (regexp &rest fields)
"Non-nil means REGEXP was found in FIELDS."
- (save-excursion
- (let ((search-result nil)
- (field))
- (while fields
- (setq field (car fields))
- (if (and (mh-goto-header-field field)
- (re-search-forward
- regexp (save-excursion (mh-header-field-end)(point)) t))
- (setq fields nil
- search-result t)
- (setq fields (cdr fields))))
- search-result)))
+ (let ((old-syntax-table (syntax-table)))
+ (unwind-protect
+ (save-excursion
+ (let ((search-result nil))
+ (while fields
+ (let ((field (car fields))
+ (syntax-table mh-regexp-in-field-syntax-table))
+ (if (null syntax-table)
+ (let ((case-fold-search t))
+ (cond
+ ((string-match field "^To$\\|^[BD]?cc$\\|^From$")
+ (setq syntax-table mh-addr-syntax-table))
+ ((string-match field "^Fcc$")
+ (setq syntax-table mh-fcc-syntax-table))
+ (t
+ (setq syntax-table (syntax-table)))
+ )))
+ (if (and (mh-goto-header-field field)
+ (set-syntax-table syntax-table)
+ (re-search-forward
+ regexp (save-excursion (mh-header-field-end)(point)) t))
+ (setq fields nil
+ search-result t)
+ (setq fields (cdr fields)))
+ (set-syntax-table old-syntax-table)))
+ search-result))
+ (set-syntax-table old-syntax-table))))
(defun mh-ascii-buffer-p ()
"Check if current buffer is entirely composed of ASCII.
'cancel-timer
'delete-itimer))
+;; Emacs 24 renamed flet to cl-flet.
+(defalias 'mh-cl-flet
+ (if (fboundp 'cl-flet)
+ 'cl-flet
+ 'flet))
+
(defun mh-display-color-cells (&optional display)
"Return the number of color cells supported by DISPLAY.
This function is used by XEmacs to return 2 when `device-color-cells'
This function returns nil on those systems."
nil)
+(defmacro mh-define-obsolete-variable-alias
+ (obsolete-name current-name &optional when docstring)
+ "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
+See documentation for `define-obsolete-variable-alias' for a description
+of the arguments OBSOLETE-NAME, CURRENT-NAME, and perhaps WHEN
+and DOCSTRING. This macro is used by XEmacs that lacks WHEN and
+DOCSTRING arguments."
+ (if (featurep 'xemacs)
+ `(define-obsolete-variable-alias ,obsolete-name ,current-name)
+ `(define-obsolete-variable-alias ,obsolete-name ,current-name ,when ,docstring)))
+
+(defmacro mh-make-obsolete-variable (obsolete-name current-name &optional when access-type)
+ "Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
+See documentation for `make-obsolete-variable' for a description
+of the arguments OBSOLETE-NAME, CURRENT-NAME, and perhaps WHEN
+and ACCESS-TYPE. This macro is used by XEmacs that lacks WHEN and
+ACCESS-TYPE arguments."
+ (if (featurep 'xemacs)
+ `(make-obsolete-variable ,obsolete-name ,current-name)
+ `(make-obsolete-variable ,obsolete-name ,current-name ,when ,access-type)))
+
+(defmacro mh-make-obsolete-variable (obsolete-name current-name &optional when access-type)
+ "Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
+See documentation for `make-obsolete-variable' for a description
+of the arguments OBSOLETE-NAME, CURRENT-NAME, and perhaps WHEN
+and ACCESS-TYPE. This macro is used by XEmacs that lacks WHEN and
+ACCESS-TYPE arguments and by Emacs versions that lack ACCESS-TYPE,
+introduced in Emacs 24."
+ (if (featurep 'xemacs)
+ `(make-obsolete-variable ,obsolete-name ,current-name)
+ (if (< emacs-major-version 24)
+ `(make-obsolete-variable ,obsolete-name ,current-name ,when)
+ `(make-obsolete-variable ,obsolete-name ,current-name ,when ,access-type))))
+
(defun-mh mh-match-string-no-properties
match-string-no-properties (num &optional string)
"Return string of text matched by last search, without text properties.
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 8.3.1
+;; Version: 8.4
;; Keywords: mail
;; This file is part of GNU Emacs.
;; Try to keep variables local to a single file. Provide accessors if
;; variables are shared. Use this section as a last resort.
-(defconst mh-version "8.3.1" "Version number of MH-E.")
+(defconst mh-version "8.4" "Version number of MH-E.")
;; Variants
(defvar mh-arrow-marker nil
"Marker for arrow display in fringe.")
+(defvar mh-blacklist nil
+ "List of messages to use to train the junk filter.
+This variable can be used by
+`mh-before-commands-processed-hook'.")
+
(defvar mh-colors-available-flag nil
"Non-nil means colors are available.")
"Stack of operations that change the folder view.
These operations include narrowing or threading.")
+(defvar mh-whitelist nil
+ "List of messages to use to train the junk filter.
+This variable can be used by
+`mh-before-commands-processed-hook'.")
+
;; MH-Show Locals (alphabetical)
(defvar mh-globals-hash (make-hash-table)
:group 'mh-sequences
:package-version '(MH-E . "7.0"))
+(defcustom-mh mh-whitelist-preserves-sequences-flag t
+ "*Non-nil means that sequences are preserved when messages are whitelisted.
+
+If a message is in any sequence (except \"Previous-Sequence:\"
+and \"cur\") when it is whitelisted, then it will still be in
+those sequences in the destination folder. If this behavior is
+not desired, then turn off this option."
+ :type 'boolean
+ :group 'mh-sequences
+ :package-version '(MH-E . "8.4"))
+
;;; Reading Your Mail (:group 'mh-show)
(defcustom-mh mh-bury-show-buffer-flag t
;; "X-Mailer:" ;
;; "X-Operator:" ; Similar to X-Mailer, so display it
-;; Keep fields alphabetized (set sort-fold-case to t first).
+;; Keep fields alphabetized with case folding. Use M-:(setq
+;; sort-fold-case t) from the minibuffer to accomplish this.
;; Mention source, if known.
(defvar mh-invisible-header-fields-internal
'(
"Auto-forwarded:" ; RFC 2156
"Autoforwarded:" ; RFC 2156
"Bestservhost:"
+ "Bounces-To:"
+ "Bounces_to:"
"Bytes:"
"Cancel-Key:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"Cancel-Lock:" ; NNTP posts
"X-Abuse-Info:"
"X-Accept-Language:" ; Netscape/Mozilla
"X-Ack:"
+ "X-ACL-Warn:" ; http://www.exim.org
"X-Admin:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-Administrivia-To:"
"X-AMAZON" ; Amazon.com
+ "X-AnalysisOut:" ; Exchange
"X-AntiAbuse:" ; cPanel
"X-Antivirus-Scanner:"
"X-AOL-IP:" ; AOL WebMail
"X-AuditID:"
"X-Authenticated-Info:" ; Verizon.net?
"X-Authenticated-Sender:" ; AT&T Message Center (webmail)
+ "X-Authentication-Info:" ; verizon.net?
"X-Authentication-Warning:" ; sendmail
"X-Authority-Analysis:"
+ "X-Auto-Response-Suppress:" ; Exchange
"X-Barracuda-" ; Barracuda spam scores
+ "X-Bayes-Prob:" ; IEEE spam filter
"X-Beenthere:" ; Mailman mailing list manager
+ "X-BFI:"
"X-Bigfish:"
"X-Bogosity:" ; bogofilter
+ "X-BPS1:" ; http://www.boggletools.com
+ "X-BPS2:" ; http://www.boggletools.com
"X-Brightmail-Tracker:" ; Brightmail
"X-BrightmailFiltered:" ; Brightmail
"X-Bugzilla-" ; Bugzilla
+ "X-Cam-" ; Cambridge scanners
+ "X-Campaign-Id:"
+ "X-Campaign:"
"X-Campaignid:"
+ "X-CanIt-Geo:" ; IEEE spam filter
+ "X-Cloudmark-SP-" ; Cloudmark (www.cloudmark.com)
"X-Comment:" ; AT&T Mailennium
"X-Complaints-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+ "X-Completed:"
"X-Confirm-Reading-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-Content-Filtered-By:"
"X-ContentStamp:" ; NetZero
"X-Cr-Hashedpuzzle:"
"X-Cr-Puzzleid:"
"X-Cron-Env:"
- "X-DCC-Usenix-Metrics:"
+ "X-DCC-" ; SpamAssassin
"X-Declude-" ; http://www.declude.com/x-note.htm
"X-Dedicated:"
"X-Delivered"
+ "X-Destination-ID:"
+ "X-detected-operating-system:" ; GNU.ORG?
"X-DH-Virus-"
"X-DMCA"
+ "X-DocGen-Version:" ; DocGen
"X-Domain:"
"X-Echelon-Distraction"
"X-EFL-Spamscore:" ; MIT alumni spam filtering
"X-eGroups-" ; Egroups/yahoogroups mailing list manager
"X-EID:"
"X-ELNK-Trace:" ; Earthlink mailer
+ "X-EM-" ; Some ecommerce software
+ "X-Email-Type-Id:" ; Paypal http://www.paypal.com
"X-Enigmail-Version:"
"X-Envelope-Date:" ; GNU mailutils
"X-Envelope-From:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-Evolution:" ; Evolution mail client
"X-ExtLoop"
"X-Face:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+ "X-Facebook" ; Facebook
+ "X-FB-SS:"
"X-fmx-"
"X-Folder:" ; Spam
+ "X-Forwarded-" ; Google+
"X-From-Line"
+ "X-FuHaFi:" ; http://www.gmx.net/
+ "X-Generated-By:" ; launchpad.net
"X-Gmail-" ; Gmail
"X-Gnus-Mail-Source:" ; gnus
"X-Google-" ; Google mail
"X-Google-Sender-Auth:"
"X-Greylist:" ; milter-greylist-1.2.1
- "X-Habeas-SWE-" ; Spam
+ "X-Habeas-" ; http://www.returnpath.net
"X-Hashcash:" ; hashcash
+ "X-Headers-End:" ; SpamCop
"X-HPL-"
"X-HR-"
"X-HTTP-UserAgent:"
"X-Hz" ; Hertz
"X-Identity:" ; http://www.declude.com/x-note.htm
+ "X-IEEE-UCE-" ; IEEE spam filter
"X-Image-URL:"
"X-IMAP:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-Info:" ; NTMail
"X-IronPort-" ; IronPort AV
"X-ISI-4-30-3-MailScanner:"
"X-J2-"
+ "X-Jira-Fingerprint:" ; JIRA
+ "X-Junkmail-" ; RCN?
"X-Juno-" ; Juno
"X-Key:"
+ "X-Launchpad-" ; plaunchpad.net
"X-List-Host:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-List-Subscribe:" ; Unknown mailing list managers
"X-List-Unsubscribe:" ; Unknown mailing list managers
"X-Loop:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-Lrde-Mailscanner:"
"X-Lumos-SenderID:" ; Roving ConstantContact
+ "X-mail_abuse_inquiries:" ; http://www.salesforce.com
"X-Mail-from:" ; fastmail.fm
"X-MAIL-INFO:" ; NetZero
"X-Mailer_"
+ "X-MailFlowPolicy:" ; Cisco Email Security (formerly IronPort; http://www.ironport.com)
"X-Mailing-List:" ; Unknown mailing list managers
+ "X-MailingID:"
"X-Mailman-Approved-At:" ; Mailman mailing list manager
"X-Mailman-Version:" ; Mailman mailing list manager
"X-MailScanner" ; ListProc(tm) by CREN
"X-Mailutils-Message-Id" ; GNU Mailutils
"X-Majordomo:" ; Majordomo mailing list manager
+ "X-Match:"
+ "X-MaxCode-Template:" ; Paypal http://www.paypal.com
"X-MB-Message-" ; AOL WebMail
"X-MDaemon-Deliver-To:"
"X-MDRemoteIP:"
+ "X-ME-Bayesian:" ; http://www.newmediadevelopment.net/page.cfm/parent/Client-Area/content/Managing-spam/
"X-Message-Id"
"X-Message-Type:"
"X-MessageWall-Score:" ; Unknown mailing list manager, AUC TeX
"X-MS-" ; MS Outlook
"X-Msmail-" ; MS Outlook
"X-MSMail-Priority" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+ "X-MXL-Hash:"
"X-NAI-Spam-" ; Network Associates Inc. SpamKiller
"X-News:" ; News
"X-Newsreader:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-No-Archive:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-Notes-Item:" ; Lotus Notes Domino structured header
+ "X-Notification-" ; Google+
+ "X-Notifications:" ; Google+
"X-OperatingSystem:"
+ "X-Oracle-Calendar:" ; Oracle calendar invitations
"X-ORBL:"
"X-Orcl-Content-Type:"
"X-Organization:"
"X-PID:"
"X-PMG-"
"X-PMX-Version:"
+ "X-Policyd-Weight:" ; policyd-weight (Postfix)
"X-Postfilter:"
"X-Priority:" ; MS Outlook
"X-Proofpoint-" ; Proofpoint mail filter
"X-SBRS:"
"X-SBRule:" ; Spam
"X-Scanned-By:"
+ "X-Sender-ID:" ; Google+
"X-Sender:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+ "X-Sendergroup:" ; Cisco Email Security (formerly IronPort; http://www.ironport.com)
"X-Server-Date:"
"X-Server-Uuid:"
"X-Service-Code:"
+ "X-SFDC-" ; http://www.salesforce.com
"X-Sieve:" ; Sieve filtering
+ "X-SMFBL:"
+ "X-SMHeaderMap:"
"X-SMTP-"
"X-Source"
- "X-Spam-" ; Spamassassin
+ "X-Spam-" ; SpamAssassin
+ "X-Spam:" ; Exchange
"X-SpamBouncer:" ; Spam
"X-SPF-"
"X-Status"
"X-Submissions-To:"
"X-Sun-Charset:"
"X-Telecom-Digest"
+ "X-TM-IMSS-Message-ID:" ; http://www.trendmicro.com
"X-Trace:"
"X-UID"
"X-UIDL:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
"X-USANET-" ; usa.net
"X-Usenet-Provider"
"X-UserInfo1:"
+ "X-VGI-OESCD:"
+ "X-VirtualServer:"
+ "X-VirtualServerGroup:"
"X-Virus-" ;
"X-Vms-To:"
"X-VSMLoop:" ; NTMail
"X-WebTV-Signature:"
"X-Wss-Id:" ; Worldtalk gateways
"X-X-Sender:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+ "X-XPT-XSL-Name:" ; Paypal http://www.paypal.com
+ "X-xsi-"
+ "X-XWALL-" ; http://www.dataenter.co.at/doc/xwall_undocumented_config.htm
+ "X-Y-GMX-Trusted:" ; http://www.gmx.net/
"X-Yahoo"
"X-Yahoo-Newman-"
"X-YMail-"
+ "X-ZixNet:"
"X400-" ; X400
"Xref:" ; RFC 1036
)
(defcustom-mh mh-before-commands-processed-hook nil
"Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests.
-Variables that are useful in this hook include `mh-delete-list'
-and `mh-refile-list' which can be used to see which changes will
-be made to the current folder, `mh-current-folder'."
+Variables that are useful in this hook include `mh-delete-list',
+`mh-refile-list', `mh-blacklist', and `mh-whitelist' which can be
+used to see which changes will be made to the current folder,
+`mh-current-folder'."
:type 'hook
:group 'mh-hooks
:group 'mh-folder
:group 'mh-letter
:package-version '(MH-E . "6.0"))
+(defcustom-mh mh-blacklist-msg-hook nil
+ "Hook run by \\<mh-letter-mode-map>\\[mh-junk-blacklist] after marking each message for blacklisting."
+ :type 'hook
+ :group 'mh-hooks
+ :group 'mh-show
+ :package-version '(MH-E . "8.4"))
+
(defcustom-mh mh-delete-msg-hook nil
"Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion.
:group 'mh-letter
:package-version '(MH-E . "8.0"))
-(define-obsolete-variable-alias 'mh-kill-folder-suppress-prompt-hooks
+(mh-define-obsolete-variable-alias 'mh-kill-folder-suppress-prompt-hooks
'mh-kill-folder-suppress-prompt-functions "24.3")
(defcustom-mh mh-kill-folder-suppress-prompt-functions '(mh-search-p)
"Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder].
:group 'mh-sequences
:package-version '(MH-E . "6.0"))
+(defcustom-mh mh-whitelist-msg-hook nil
+ "Hook run by \\<mh-letter-mode-map>\\[mh-junk-whitelist] after marking each message for whitelisting."
+ :type 'hook
+ :group 'mh-hooks
+ :group 'mh-show
+ :package-version '(MH-E . "8.4"))
+
\f
;;; Faces (:group 'mh-faces + group where faces described)
:group 'mh-folder
:package-version '(MH-E . "8.0"))
+(defface-mh mh-folder-blacklisted
+ (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
+ "Blacklisted message face."
+ :group 'mh-faces
+ :group 'mh-folder
+ :package-version '(MH-E . "8.4"))
+
(defface-mh mh-folder-body
(mh-face-data 'mh-folder-msg-number
'((((class color))
:group 'mh-folder
:package-version '(MH-E . "8.0"))
+(defface-mh mh-folder-whitelisted
+ (mh-face-data 'mh-folder-refiled '((t (:inherit mh-folder-refiled))))
+ "Whitelisted message face."
+ :group 'mh-faces
+ :group 'mh-folder
+ :package-version '(MH-E . "8.4"))
+
(defface-mh mh-letter-header-field (mh-face-data 'mh-letter-header-field)
"Editable header field value face in draft buffers."
:group 'mh-faces
["Go to Last Message" mh-last-msg t]
["Go to Message by Number..." mh-goto-msg t]
["Modify Message" mh-modify t]
- ["Delete Message" mh-delete-msg (mh-get-msg-num nil)]
["Refile Message" mh-refile-msg (mh-get-msg-num nil)]
- ["Undo Delete/Refile" mh-undo (mh-outstanding-commands-p)]
+ ["Delete Message" mh-delete-msg (mh-get-msg-num nil)]
+ ["Undo Delete/Refile/Junk" mh-undo (mh-outstanding-commands-p)]
["Execute Delete/Refile" mh-execute-commands
(mh-outstanding-commands-p)]
"--"
;; Folders when displaying index buffer
(list "^\\+.*"
'(0 'mh-search-folder))
- ;; Marked for deletion
- (list (concat mh-scan-deleted-msg-regexp ".*")
- '(0 'mh-folder-deleted))
;; Marked for refile
(list (concat mh-scan-refiled-msg-regexp ".*")
'(0 'mh-folder-refiled))
+ ;; Marked for deletion
+ (list (concat mh-scan-deleted-msg-regexp ".*")
+ '(0 'mh-folder-deleted))
+ ;; Marked for blacklisting
+ (list (concat mh-scan-blacklisted-msg-regexp ".*")
+ '(0 'mh-folder-blacklisted))
+ ;; Marked for whitelisting
+ (list (concat mh-scan-whitelisted-msg-regexp ".*")
+ '(0 'mh-folder-whitelisted))
;; After subject
(list mh-scan-body-regexp
'(1 'mh-folder-body nil t))
'overlay-arrow-position nil ; Allow for simultaneous display in
'overlay-arrow-string ">" ; different MH-E buffers.
'mh-showing-mode nil ; Show message also?
- 'mh-delete-list nil ; List of msgs nums to delete
'mh-refile-list nil ; List of folder names in mh-seq-list
+ 'mh-delete-list nil ; List of msgs nums to delete
+ 'mh-blacklist nil ; List of messages to process as spam
+ 'mh-whitelist nil ; List of messages to process as ham
'mh-seq-list nil ; Alist of (seq . msgs) nums
'mh-seen-list nil ; List of displayed messages
'mh-next-direction 'forward ; Direction to move to next message
;;;###mh-autoload
(defun mh-execute-commands ()
- "Process outstanding delete and refile requests\\<mh-folder-mode-map>.
+ "Perform outstanding operations\\<mh-folder-mode-map>.
-If you've marked messages to be deleted or refiled and you want
-to go ahead and delete or refile the messages, use this command.
-Many MH-E commands that may affect the numbering of the
-messages (such as \\[mh-rescan-folder] or \\[mh-pack-folder])
-will ask if you want to process refiles or deletes first and then
-either run this command for you or undo the pending refiles and
-deletes.
+If you've marked messages to be refiled, deleted, blacklisted, or
+whitelisted and you want to go ahead and perform these operations
+on these messages, use this command. Many MH-E commands that may
+affect the numbering of the messages (such as
+\\[mh-rescan-folder] or \\[mh-pack-folder]) will ask if you want
+to perform these operations first and then either run this
+command for you or undo the pending operations.
This function runs `mh-before-commands-processed-hook' before the
commands are processed and `mh-after-commands-processed-hook'
return-value))
;;;###mh-autoload
-(defun mh-inc-folder (&optional file folder)
+(defun mh-inc-folder (&optional file folder dont-exec-pending)
"Incorporate new mail into a folder.
You can incorporate mail from any file into the current folder by
mail.
Do not call this function from outside MH-E; use \\[mh-rmail]
-instead."
+instead.
+
+In a program, the processing of outstanding commands is not performed
+if DONT-EXEC-PENDING is non-nil."
(interactive (list (if current-prefix-arg
(expand-file-name
(read-file-name "inc mail from file: "
(mh-prompt-for-folder "inc mail into" mh-inbox t))))
(if (not folder)
(setq folder mh-inbox))
+ (unless dont-exec-pending
+ (mh-process-or-undo-commands folder))
(let ((threading-needed-flag nil))
(let ((config (current-window-configuration)))
(when (and mh-show-buffer (get-buffer mh-show-buffer))
(cond ((numberp range)
(let ((original-position (point)))
(beginning-of-line)
- (while (not (or (looking-at mh-scan-deleted-msg-regexp)
- (looking-at mh-scan-refiled-msg-regexp)
+ (while (not (or (looking-at mh-scan-refiled-msg-regexp)
+ (looking-at mh-scan-deleted-msg-regexp)
+ (looking-at mh-scan-blacklisted-msg-regexp)
+ (looking-at mh-scan-whitelisted-msg-regexp)
(and (eq mh-next-direction 'forward) (bobp))
(and (eq mh-next-direction 'backward)
(save-excursion (forward-line) (eobp)))))
(forward-line (if (eq mh-next-direction 'forward) -1 1)))
- (if (or (looking-at mh-scan-deleted-msg-regexp)
- (looking-at mh-scan-refiled-msg-regexp))
+ (if (or (looking-at mh-scan-refiled-msg-regexp)
+ (looking-at mh-scan-deleted-msg-regexp)
+ (looking-at mh-scan-blacklisted-msg-regexp)
+ (looking-at mh-scan-whitelisted-msg-regexp))
(progn
(mh-undo-msg (mh-get-msg-num t))
(mh-maybe-show))
(save-excursion
(when (eq major-mode 'mh-show-mode)
(set-buffer mh-show-folder-buffer))
- (or mh-delete-list mh-refile-list)))
+ (or mh-delete-list mh-refile-list mh-blacklist mh-whitelist)))
;;;###mh-autoload
(defun mh-set-folder-modified-p (flag)
(let ((redraw-needed-flag mh-index-data)
(folders-changed (list mh-current-folder))
- (seq-map (and mh-refile-list mh-refile-preserves-sequences-flag
- (mh-create-sequence-map mh-seq-list)))
+ (seq-map (and
+ (or (and mh-refile-list mh-refile-preserves-sequences-flag)
+ (and mh-whitelist
+ mh-whitelist-preserves-sequences-flag))
+ (mh-create-sequence-map mh-seq-list)))
(dest-map (and mh-refile-list mh-refile-preserves-sequences-flag
- (make-hash-table))))
+ (make-hash-table)))
+ (white-map (and mh-whitelist mh-whitelist-preserves-sequences-flag
+ (make-hash-table))))
;; Remove invalid scan lines if we are in an index folder and then remove
;; the real messages
(when mh-index-data
(mh-delete-scan-msgs mh-delete-list)
(setq mh-delete-list nil)))
+ ;; Blacklist messages.
+ (when mh-blacklist
+ (let ((msg-list (mh-coalesce-msg-list mh-blacklist))
+ (dest (mh-junk-blacklist-disposition)))
+ (mh-junk-process-blacklist mh-blacklist)
+ ;; TODO I wonder why mh-exec-cmd is used instead of the following:
+ ;; (mh-refile-a-msg nil (intern dest))
+ ;; (mh-delete-a-msg nil)))
+ (if (null dest)
+ (apply 'mh-exec-cmd "rmm" folder msg-list)
+ (apply 'mh-exec-cmd "refile" "-src" folder dest msg-list)
+ (push dest folders-changed))
+ (setq redraw-needed-flag t)
+ (mh-delete-scan-msgs mh-blacklist)
+ (setq mh-blacklist nil)))
+
+ ;; Whitelist messages.
+ (when mh-whitelist
+ (let ((msg-list (mh-coalesce-msg-list mh-whitelist))
+ (last (car (mh-translate-range mh-inbox "last"))))
+ (mh-junk-process-whitelist mh-whitelist)
+ (apply #'mh-exec-cmd "refile" "-src" folder mh-inbox msg-list)
+ (push mh-inbox folders-changed)
+ (setq redraw-needed-flag t)
+ (mh-delete-scan-msgs mh-whitelist)
+ (when mh-whitelist-preserves-sequences-flag
+ (clrhash white-map)
+ (loop for i from (1+ (or last 0))
+ for msg in (sort (copy-sequence mh-whitelist) #'<)
+ do (loop for seq-name in (gethash msg seq-map)
+ do (push i (gethash seq-name white-map))))
+ (maphash
+ #'(lambda (seq msgs)
+ ;; Can't be run in background, since the current
+ ;; folder is changed by mark this could lead to a
+ ;; race condition with the next refile/whitelist.
+ (apply #'mh-exec-cmd "mark"
+ "-sequence" (symbol-name seq) mh-inbox
+ "-add" (mapcar #'(lambda(x) (format "%s" x))
+ (mh-coalesce-msg-list msgs))))
+ white-map))
+ (setq mh-whitelist nil)))
+
;; Don't need to remove sequences since delete and refile do so.
;; Mark cur message
(if (> (buffer-size) 0)
(setq message (mh-get-msg-num t)))
(if (looking-at mh-scan-refiled-msg-regexp)
(error "Message %d is refiled; undo refile before deleting" message))
+ (if (looking-at mh-scan-blacklisted-msg-regexp)
+ (error "Message %d is blacklisted; undo before deleting" message))
+ (if (looking-at mh-scan-whitelisted-msg-regexp)
+ (error "Message %d is whitelisted; undo before deleting" message))
(if (looking-at mh-scan-deleted-msg-regexp)
nil
(mh-set-folder-modified-p t)
(setq message (mh-get-msg-num t)))
(cond ((looking-at mh-scan-deleted-msg-regexp)
(error "Message %d is deleted; undo delete before moving" message))
+ ((looking-at mh-scan-blacklisted-msg-regexp)
+ (error "Message %d is blacklisted; undo before moving" message))
+ ((looking-at mh-scan-whitelisted-msg-regexp)
+ (error "Message %d is whitelisted; undo before moving" message))
((looking-at mh-scan-refiled-msg-regexp)
(if (y-or-n-p
(format "Message %d already refiled; copy to %s as well? "
(run-hooks 'mh-refile-msg-hook)))))
(defun mh-undo-msg (msg)
- "Undo the deletion or refile of one MSG.
+ "Undo the deletion, refile, black- or whitelisting of one MSG.
If MSG is nil then act on the message at point"
(save-excursion
(if (numberp msg)
(setq msg (mh-get-msg-num t)))
(cond ((memq msg mh-delete-list)
(setq mh-delete-list (delq msg mh-delete-list)))
+ ((memq msg mh-blacklist)
+ (setq mh-blacklist (delq msg mh-blacklist)))
+ ((memq msg mh-whitelist)
+ (setq mh-whitelist (delq msg mh-whitelist)))
(t
(dolist (folder-msg-list mh-refile-list)
(setf (cdr folder-msg-list) (remove msg (cdr folder-msg-list))))
- `mh-bogofilter-blacklist'
- `mh-spamprobe-blacklist'"
(interactive (list (mh-interactive-range "Blacklist")))
+ (mh-iterate-on-range () range (mh-blacklist-a-msg nil))
+ (if (looking-at mh-scan-blacklisted-msg-regexp)
+ (mh-next-msg)))
+
+(defun mh-blacklist-a-msg (message)
+ "Blacklist MESSAGE.
+If MESSAGE is nil then the message at point is blacklisted.
+The hook `mh-blacklisted-msg-hook' is called after you mark a message
+for blacklisting."
+ (save-excursion
+ (if (numberp message)
+ (mh-goto-msg message nil t)
+ (beginning-of-line)
+ (setq message (mh-get-msg-num t)))
+ (cond ((looking-at mh-scan-refiled-msg-regexp)
+ (error "Message %d is refiled; undo refile before blacklisting"
+ message))
+ ((looking-at mh-scan-deleted-msg-regexp)
+ (error "Message %d is deleted; undo delete before blacklisting"
+ message))
+ ((looking-at mh-scan-whitelisted-msg-regexp)
+ (error "Message %d is whitelisted; undo before blacklisting"
+ message))
+ ((looking-at mh-scan-blacklisted-msg-regexp) nil)
+ (t
+ (mh-set-folder-modified-p t)
+ (setq mh-blacklist (cons message mh-blacklist))
+ (if (not (memq message mh-seen-list))
+ (setq mh-seen-list (cons message mh-seen-list)))
+ (mh-notate nil mh-note-blacklisted mh-cmd-note)
+ (run-hooks 'mh-blacklist-msg-hook)))))
+
+;;;###mh-autoload
+(defun mh-junk-blacklist-disposition ()
+ "Determines the fate of the selected spam."
+ (cond ((null mh-junk-disposition) nil)
+ ((equal mh-junk-disposition "") "+")
+ ((eq (aref mh-junk-disposition 0) ?+)
+ mh-junk-disposition)
+ ((eq (aref mh-junk-disposition 0) ?@)
+ (concat mh-current-folder "/"
+ (substring mh-junk-disposition 1)))
+ (t (concat "+" mh-junk-disposition))))
+
+;;;###mh-autoload
+(defun mh-junk-process-blacklist (range)
+ "Blacklist RANGE as spam.
+This command trains the spam program in use (see the option
+`mh-junk-program') with the content of RANGE and then handles the
+message(s) as specified by the option `mh-junk-disposition'."
(let ((blacklist-func (nth 1 (assoc mh-junk-choice mh-junk-function-alist))))
(unless blacklist-func
(error "Customize `mh-junk-program' appropriately"))
- (let ((dest (cond ((null mh-junk-disposition) nil)
- ((equal mh-junk-disposition "") "+")
- ((eq (aref mh-junk-disposition 0) ?+)
- mh-junk-disposition)
- ((eq (aref mh-junk-disposition 0) ?@)
- (concat mh-current-folder "/"
- (substring mh-junk-disposition 1)))
- (t (concat "+" mh-junk-disposition)))))
- (mh-iterate-on-range msg range
- (message "Blacklisting message %d..." msg)
- (funcall (symbol-function blacklist-func) msg)
- (message "Blacklisting message %d...done" msg)
- (if (not (memq msg mh-seen-list))
- (setq mh-seen-list (cons msg mh-seen-list)))
- (if dest
- (mh-refile-a-msg nil (intern dest))
- (mh-delete-a-msg nil)))
- (mh-next-msg))))
+ (mh-iterate-on-range msg range
+ (message "Blacklisting message %d..." msg)
+ (funcall (symbol-function blacklist-func) msg)
+ (message "Blacklisting message %d...done" msg))
+ (mh-next-msg)))
;;;###mh-autoload
(defun mh-junk-whitelist (range)
Check the documentation of `mh-interactive-range' to see how
RANGE is read in interactive use."
(interactive (list (mh-interactive-range "Whitelist")))
+ (mh-iterate-on-range () range (mh-junk-whitelist-a-msg nil))
+ (if (looking-at mh-scan-whitelisted-msg-regexp)
+ (mh-next-msg)))
+
+(defun mh-junk-whitelist-a-msg (message)
+ "Whitelist MESSAGE.
+If MESSAGE is nil then the message at point is whitelisted. The
+hook `mh-whitelist-msg-hook' is called after you mark a message
+for whitelisting."
+ (save-excursion
+ (if (numberp message)
+ (mh-goto-msg message nil t)
+ (beginning-of-line)
+ (setq message (mh-get-msg-num t)))
+ (cond ((looking-at mh-scan-refiled-msg-regexp)
+ (error "Message %d is refiled; undo refile before whitelisting"
+ message))
+ ((looking-at mh-scan-deleted-msg-regexp)
+ (error "Message %d is deleted; undo delete before whitelisting"
+ message))
+ ((looking-at mh-scan-blacklisted-msg-regexp)
+ (error "Message %d is blacklisted; undo before whitelisting"
+ message))
+ ((looking-at mh-scan-whitelisted-msg-regexp) nil)
+ (t
+ (mh-set-folder-modified-p t)
+ (setq mh-whitelist (cons message mh-whitelist))
+ (mh-notate nil mh-note-whitelisted mh-cmd-note)
+ (run-hooks 'mh-whitelist-msg-hook)))))
+
+;;;###mh-autoload
+(defun mh-junk-process-whitelist (range)
+ "Whitelist RANGE as ham.
+
+This command reclassifies the RANGE as ham if it were incorrectly
+classified as spam (see the option `mh-junk-program')."
(let ((whitelist-func (nth 2 (assoc mh-junk-choice mh-junk-function-alist))))
(unless whitelist-func
(error "Customize `mh-junk-program' appropriately"))
(mh-iterate-on-range msg range
(message "Whitelisting message %d..." msg)
(funcall (symbol-function whitelist-func) msg)
- (message "Whitelisting message %d...done" msg)
- (mh-refile-a-msg nil (intern mh-inbox)))
+ (message "Whitelisting message %d...done" msg))
(mh-next-msg)))
\f
This is a normal hook, misnamed for historical reasons.
It is obsolete and is only used if `mail-citation-hook' is nil.")
-(make-obsolete-variable 'mh-yank-hooks 'mail-citation-hook "19.34")
+(mh-make-obsolete-variable 'mh-yank-hooks 'mail-citation-hook "19.34")
\f
the supercite flavors, the hook `mail-citation-hook' is ignored
and `mh-ins-buf-prefix' is not inserted."
(interactive)
- (if (and mh-sent-from-folder
- (with-current-buffer mh-sent-from-folder mh-show-buffer)
- (with-current-buffer mh-sent-from-folder
- (get-buffer mh-show-buffer))
- mh-sent-from-msg)
- (let ((to-point (point))
- (to-buffer (current-buffer)))
- (set-buffer mh-sent-from-folder)
- (if mh-delete-yanked-msg-window-flag
- (delete-windows-on mh-show-buffer))
- (set-buffer mh-show-buffer) ; Find displayed message
- (let* ((from-attr (mh-extract-from-attribution))
- (yank-region (mh-mark-active-p nil))
- (mh-ins-str
- (cond ((and yank-region
- (or (eq 'supercite mh-yank-behavior)
- (eq 'autosupercite mh-yank-behavior)
- (eq t mh-yank-behavior)))
- ;; supercite needs the full header
- (concat
- (buffer-substring (point-min) (mh-mail-header-end))
- "\n"
- (buffer-substring (region-beginning) (region-end))))
- (yank-region
- (buffer-substring (region-beginning) (region-end)))
- ((or (eq 'body mh-yank-behavior)
- (eq 'attribution mh-yank-behavior)
- (eq 'autoattrib mh-yank-behavior))
- (buffer-substring
- (save-excursion
- (goto-char (point-min))
- (mh-goto-header-end 1)
- (point))
- (point-max)))
- ((or (eq 'supercite mh-yank-behavior)
- (eq 'autosupercite mh-yank-behavior)
- (eq t mh-yank-behavior))
- (buffer-substring (point-min) (point-max)))
- (t
- (buffer-substring (point) (point-max))))))
- (set-buffer to-buffer)
- (save-restriction
- (narrow-to-region to-point to-point)
- (insert (mh-filter-out-non-text mh-ins-str))
- (goto-char (point-max)) ;Needed for sc-cite-original
- (push-mark) ;Needed for sc-cite-original
- (goto-char (point-min)) ;Needed for sc-cite-original
- (mh-insert-prefix-string mh-ins-buf-prefix)
- (when (or (eq 'attribution mh-yank-behavior)
- (eq 'autoattrib mh-yank-behavior))
- (insert from-attr)
- (mh-identity-insert-attribution-verb nil)
- (insert "\n\n"))
- ;; If the user has selected a region, he has already "edited" the
- ;; text, so leave the cursor at the end of the yanked text. In
- ;; either case, leave a mark at the opposite end of the included
- ;; text to make it easy to jump or delete to the other end of the
- ;; text.
- (push-mark)
- (goto-char (point-max))
- (if (null yank-region)
- (mh-exchange-point-and-mark-preserving-active-mark)))))
- (error "There is no current message")))
+ (let ((show-buffer))
+ (if (and mh-sent-from-folder
+ (with-current-buffer mh-sent-from-folder mh-show-buffer)
+ (setq show-buffer (with-current-buffer mh-sent-from-folder
+ (get-buffer mh-show-buffer)))
+ mh-sent-from-msg)
+ (let ((to-point (point))
+ (to-buffer (current-buffer)))
+ (if mh-delete-yanked-msg-window-flag
+ (with-current-buffer mh-sent-from-folder
+ (delete-windows-on show-buffer)))
+ ;; Find displayed message
+ (with-current-buffer show-buffer
+ (let* ((from-attr (mh-extract-from-attribution))
+ (yank-region (mh-mark-active-p nil))
+ (mh-ins-str
+ (cond ((and yank-region
+ (or (eq 'supercite mh-yank-behavior)
+ (eq 'autosupercite mh-yank-behavior)
+ (eq t mh-yank-behavior)))
+ ;; supercite needs the full header
+ (concat
+ (buffer-substring (point-min) (mh-mail-header-end))
+ "\n"
+ (buffer-substring (region-beginning) (region-end))))
+ (yank-region
+ (buffer-substring (region-beginning) (region-end)))
+ ((or (eq 'body mh-yank-behavior)
+ (eq 'attribution mh-yank-behavior)
+ (eq 'autoattrib mh-yank-behavior))
+ (buffer-substring
+ (save-excursion
+ (goto-char (point-min))
+ (mh-goto-header-end 1)
+ (point))
+ (point-max)))
+ ((or (eq 'supercite mh-yank-behavior)
+ (eq 'autosupercite mh-yank-behavior)
+ (eq t mh-yank-behavior))
+ (buffer-substring (point-min) (point-max)))
+ (t
+ (buffer-substring (point) (point-max))))))
+ (with-current-buffer to-buffer
+ (save-restriction
+ (narrow-to-region to-point to-point)
+ (insert (mh-filter-out-non-text mh-ins-str))
+ (goto-char (point-max)) ;Needed for sc-cite-original
+ (push-mark) ;Needed for sc-cite-original
+ (goto-char (point-min)) ;Needed for sc-cite-original
+ (mh-insert-prefix-string mh-ins-buf-prefix)
+ (when (or (eq 'attribution mh-yank-behavior)
+ (eq 'autoattrib mh-yank-behavior))
+ (insert from-attr)
+ (mh-identity-insert-attribution-verb nil)
+ (insert "\n\n"))
+ ;; If the user has selected a region, he has already "edited" the
+ ;; text, so leave the cursor at the end of the yanked text. In
+ ;; either case, leave a mark at the opposite end of the included
+ ;; text to make it easy to jump or delete to the other end of the
+ ;; text.
+ (push-mark)
+ (goto-char (point-max))
+ (if (null yank-region)
+ (mh-exchange-point-and-mark-preserving-active-mark)))))))
+ (error "There is no current message"))))
\f
(buffer-read-only nil))
(when (string-match "^[^% \t]+$" method)
(setq method (concat method " %s")))
- (flet ((mm-handle-set-external-undisplayer (handle function)
- (mh-handle-set-external-undisplayer folder handle function)))
- (unwind-protect (mm-display-external part method)
- (set-buffer-modified-p nil)))))
+ (mh-cl-flet
+ ((mm-handle-set-external-undisplayer
+ (handle function)
+ (mh-handle-set-external-undisplayer folder handle function)))
+ (unwind-protect (mm-display-external part method)
+ (set-buffer-modified-p nil)))))
nil))
;;;###mh-autoload
(let ((handles ())
(folder mh-show-folder-buffer)
(raw-message-data (buffer-string)))
- (flet ((mm-handle-set-external-undisplayer
- (handle function)
- (mh-handle-set-external-undisplayer folder handle function)))
- (goto-char (point-min))
- (unless (search-forward "\n\n" nil t)
- (goto-char (point-max))
- (insert "\n\n"))
-
- (condition-case err
- (progn
- ;; If needed dissect the current buffer
- (if pre-dissected-handles
- (setq handles pre-dissected-handles)
- (if (setq handles (mm-dissect-buffer nil))
- (mh-mm-uu-dissect-text-parts handles)
- (setq handles (mm-uu-dissect)))
- (setf (mh-mime-handles (mh-buffer-data))
- (mh-mm-merge-handles handles
- (mh-mime-handles (mh-buffer-data))))
- (unless handles
- (mh-decode-message-body)))
-
- (cond ((and handles
- (or (not (stringp (car handles)))
- (cdr handles)))
- ;; Go to start of message body
- (goto-char (point-min))
- (or (search-forward "\n\n" nil t)
- (goto-char (point-max)))
-
- ;; Delete the body
- (delete-region (point) (point-max))
-
- ;; Display the MIME handles
- (mh-mime-display-part handles))
- (t
- (mh-signature-highlight))))
- (error
- (message "Could not display body: %s" (error-message-string err))
- (delete-region (point-min) (point-max))
- (insert raw-message-data))))))
+ (mh-cl-flet
+ ((mm-handle-set-external-undisplayer
+ (handle function)
+ (mh-handle-set-external-undisplayer folder handle function)))
+ (goto-char (point-min))
+ (unless (search-forward "\n\n" nil t)
+ (goto-char (point-max))
+ (insert "\n\n"))
+
+ (condition-case err
+ (progn
+ ;; If needed dissect the current buffer
+ (if pre-dissected-handles
+ (setq handles pre-dissected-handles)
+ (if (setq handles (mm-dissect-buffer nil))
+ (mh-mm-uu-dissect-text-parts handles)
+ (setq handles (mm-uu-dissect)))
+ (setf (mh-mime-handles (mh-buffer-data))
+ (mh-mm-merge-handles handles
+ (mh-mime-handles (mh-buffer-data))))
+ (unless handles
+ (mh-decode-message-body)))
+
+ (cond ((and handles
+ (or (not (stringp (car handles)))
+ (cdr handles)))
+ ;; Go to start of message body
+ (goto-char (point-min))
+ (or (search-forward "\n\n" nil t)
+ (goto-char (point-max)))
+
+ ;; Delete the body
+ (delete-region (point) (point-max))
+
+ ;; Display the MIME handles
+ (mh-mime-display-part handles))
+ (t
+ (mh-signature-highlight))))
+ (error
+ (message "Could not display body: %s" (error-message-string err))
+ (delete-region (point-min) (point-max))
+ (insert raw-message-data))))))
(defun mh-decode-message-body ()
"Decode message based on charset.
(function (get-text-property (point) 'mh-callback))
(buffer-read-only nil)
(folder mh-show-folder-buffer))
- (flet ((mm-handle-set-external-undisplayer
- (handle function)
- (mh-handle-set-external-undisplayer folder handle function)))
- (when (and function (eolp))
- (backward-char))
- (unwind-protect (and function (funcall function data))
- (set-buffer-modified-p nil)))))
+ (mh-cl-flet
+ ((mm-handle-set-external-undisplayer
+ (handle function)
+ (mh-handle-set-external-undisplayer folder handle function)))
+ (when (and function (eolp))
+ (backward-char))
+ (unwind-protect (and function (funcall function data))
+ (set-buffer-modified-p nil)))))
(defun mh-push-button (event)
"Click MIME button for EVENT.
(mm-inline-media-tests mh-mm-inline-media-tests)
(data (get-text-property (point) 'mh-data))
(function (get-text-property (point) 'mh-callback)))
- (flet ((mm-handle-set-external-undisplayer (handle func)
- (mh-handle-set-external-undisplayer folder handle func)))
- (and function (funcall function data))))))
+ (mh-cl-flet
+ ((mm-handle-set-external-undisplayer
+ (handle func)
+ (mh-handle-set-external-undisplayer folder handle func)))
+ (and function (funcall function data))))))
(defun mh-handle-set-external-undisplayer (folder handle function)
"Replacement for `mm-handle-set-external-undisplayer'.
(defun mh-display-emphasis ()
"Display graphical emphasis."
(when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p))
- (flet ((article-goto-body ())) ; shadow this function to do nothing
- (save-excursion
- (goto-char (point-min))
- (article-emphasize)))))
+ (mh-cl-flet
+ ((article-goto-body ())) ; shadow this function to do nothing
+ (save-excursion
+ (goto-char (point-min))
+ (article-emphasize)))))
(defun mh-small-show-buffer-p ()
"Check if show buffer is small.
not correct, the body fragment will not be highlighted with the
face `mh-folder-body'.")
+(defvar mh-scan-blacklisted-msg-regexp "^\\( *[0-9]+\\)B"
+ "This regular expression matches blacklisted (spam) messages.
+
+It must match from the beginning of the line. Note that the
+default setting of `mh-folder-font-lock-keywords' expects this
+expression to contain at least one parenthesized expression which
+matches the message number as in the default of
+
+ \"^\\\\( *[0-9]+\\\\)B\".
+
+This expression includes the leading space within parenthesis
+since it looks better to highlight it as well. The highlighting
+is done with the face `mh-folder-blacklisted'. This regular
+expression should be correct as it is needed by non-fontification
+functions. See also `mh-note-blacklisted'.")
+
(defvar mh-scan-cur-msg-number-regexp "^\\( *[0-9]+\\+\\).*"
"This regular expression matches the current message.
expression should be correct as it is needed by non-fontification
functions. See also `mh-note-deleted'.")
-(defvar mh-scan-good-msg-regexp "^\\( *[0-9]+\\)[^D^0-9]"
+(defvar mh-scan-good-msg-regexp "^\\( *[0-9]+\\)[^^DBW0-9]"
"This regular expression matches \"good\" messages.
It must match from the beginning of the line. Note that the
expression to contain at least one parenthesized expression which
matches the message number as in the default of
- \"^\\\\( *[0-9]+\\\\)[^D^0-9]\".
+ \"^\\\\( *[0-9]+\\\\)[^^DBW0-9]\".
This expression includes the leading space within the parenthesis
since it looks better to highlight it as well. The highlighting
This is used to eliminate error messages that are occasionally
produced by \"inc\".")
+(defvar mh-scan-whitelisted-msg-regexp "^\\( *[0-9]+\\)W"
+ "This regular expression matches whitelisted (non-spam) messages.
+
+It must match from the beginning of the line. Note that the
+default setting of `mh-folder-font-lock-keywords' expects this
+expression to contain at least one parenthesized expression which
+matches the message number as in the default of
+
+ \"^\\\\( *[0-9]+\\\\)W\".
+
+This expression includes the leading space within parenthesis
+since it looks better to highlight it as well. The highlighting
+is done with the face `mh-folder-whitelisted'. This regular
+expression should be correct as it is needed by non-fontification
+functions. See also `mh-note-whitelisted'.")
+
\f
;;; Widths, Offsets and Columns
(defvar mh-scan-cmd-note-width 1
"Number of columns consumed by the cmd-note field in `mh-scan-format'.
-This column will have one of the values: \" \", \"D\", \"^\", \"+\", where
+This column will have one of the values: \" \", \"^\", \"D\", \"B\", \"W\", \"+\", where
\" \" is the default value,
+ \"^\" is the `mh-note-refiled' character,
\"D\" is the `mh-note-deleted' character,
- \"^\" is the `mh-note-refiled' character, and
+ \"B\" is the `mh-note-blacklisted' character,
+ \"W\" is the `mh-note-whitelisted' character, and
\"+\" is the `mh-note-cur' character.")
(defvar mh-scan-destination-width 1
;; Alphabetical.
+(defvar mh-note-blacklisted ?B
+ "Messages that have been blacklisted are marked by this character.
+See also `mh-scan-blacklisted-msg-regexp'.")
+
(defvar mh-note-cur ?+
"The current message (in MH, not in MH-E) is marked by this character.
See also `mh-scan-cur-msg-number-regexp'.")
Messages in the \"search\" sequence are marked by this character as
well.")
+(defvar mh-note-whitelisted ?W
+ "Messages that have been whitelisted are marked by this character.
+See also `mh-scan-whitelisted-msg-regexp'.")
+
\f
;;; Utilities
;;;###mh-autoload
(defun mh-index-execute-commands ()
- "Delete/refile the actual messages.
-The copies in the searched folder are then deleted/refiled to get
-the desired result. Before deleting the messages we make sure
-that the message being deleted is identical to the one that the
-user has marked in the index buffer."
+ "Perform the outstanding operations on the actual messages.
+The copies in the searched folder are then deleted, refiled,
+blacklisted and whitelisted to get the desired result. Before
+processing the messages we make sure that the message is
+identical to the one that the user has marked in the index
+buffer."
(save-excursion
(let ((folders ())
(mh-speed-flists-inhibit-flag t))
;; Otherwise delete the messages in the source buffer...
(with-current-buffer folder
(let ((old-refile-list mh-refile-list)
- (old-delete-list mh-delete-list))
+ (old-delete-list mh-delete-list)
+ (old-blacklist mh-blacklist)
+ (old-whitelist mh-whitelist))
(setq mh-refile-list nil
- mh-delete-list msgs)
+ mh-delete-list msgs
+ mh-blacklist nil
+ mh-whitelist nil)
(unwind-protect (mh-execute-commands)
(setq mh-refile-list
(mapcar (lambda (x)
old-refile-list)
mh-delete-list
(loop for x in old-delete-list
+ unless (memq x msgs) collect x)
+ mh-blacklist
+ (loop for x in old-blacklist
+ unless (memq x msgs) collect x)
+ mh-whitelist
+ (loop for x in old-whitelist
unless (memq x msgs) collect x))
(mh-set-folder-modified-p (mh-outstanding-commands-p))
(when (mh-outstanding-commands-p)
(mh-notate-deleted-and-refiled)))))))
(mh-index-matching-source-msgs (append (loop for x in mh-refile-list
append (cdr x))
- mh-delete-list)
+ mh-delete-list
+ mh-blacklist
+ mh-whitelist)
t))
folders)))
"l" mh-show-list-folders
"n" mh-index-new-messages
"o" mh-show-visit-folder
+ "p" mh-show-pack-folder
"q" mh-show-index-sequenced-messages
"r" mh-show-rescan-folder
"s" mh-search
(interactive)
;; Don't allow Gnus to create buttons while highlighting, maybe this is bad
;; style?
- (flet ((gnus-article-add-button (&rest args) nil))
- (let* ((modified (buffer-modified-p))
- (gnus-article-buffer (buffer-name))
- (gnus-cite-face-list `(,@(cdr gnus-cite-face-list)
- ,(car gnus-cite-face-list))))
- (gnus-article-highlight-citation t)
- (set-buffer-modified-p modified))))
+ (mh-cl-flet
+ ((gnus-article-add-button (&rest args) nil))
+ (let* ((modified (buffer-modified-p))
+ (gnus-article-buffer (buffer-name))
+ (gnus-cite-face-list `(,@(cdr gnus-cite-face-list)
+ ,(car gnus-cite-face-list))))
+ (gnus-article-highlight-citation t)
+ (set-buffer-modified-p modified))))
(provide 'mh-show)
(defun mh-thread-set-tables (folder)
"Use the tables of FOLDER in current buffer."
- (flet ((mh-get-table (symbol)
- (with-current-buffer folder
- (symbol-value symbol))))
- (setq mh-thread-id-hash (mh-get-table 'mh-thread-id-hash))
- (setq mh-thread-subject-hash (mh-get-table 'mh-thread-subject-hash))
- (setq mh-thread-id-table (mh-get-table 'mh-thread-id-table))
- (setq mh-thread-id-index-map (mh-get-table 'mh-thread-id-index-map))
- (setq mh-thread-index-id-map (mh-get-table 'mh-thread-index-id-map))
- (setq mh-thread-scan-line-map (mh-get-table 'mh-thread-scan-line-map))
- (setq mh-thread-subject-container-hash
- (mh-get-table 'mh-thread-subject-container-hash))
- (setq mh-thread-duplicates (mh-get-table 'mh-thread-duplicates))
- (setq mh-thread-history (mh-get-table 'mh-thread-history))))
+ (mh-cl-flet
+ ((mh-get-table (symbol)
+ (with-current-buffer folder
+ (symbol-value symbol))))
+ (setq mh-thread-id-hash (mh-get-table 'mh-thread-id-hash))
+ (setq mh-thread-subject-hash (mh-get-table 'mh-thread-subject-hash))
+ (setq mh-thread-id-table (mh-get-table 'mh-thread-id-table))
+ (setq mh-thread-id-index-map (mh-get-table 'mh-thread-id-index-map))
+ (setq mh-thread-index-id-map (mh-get-table 'mh-thread-index-id-map))
+ (setq mh-thread-scan-line-map (mh-get-table 'mh-thread-scan-line-map))
+ (setq mh-thread-subject-container-hash
+ (mh-get-table 'mh-thread-subject-container-hash))
+ (setq mh-thread-duplicates (mh-get-table 'mh-thread-duplicates))
+ (setq mh-thread-history (mh-get-table 'mh-thread-history))))
(defun mh-thread-process-in-reply-to (reply-to-header)
"Extract message id's from REPLY-TO-HEADER.
(and (= (point-max) minibuf-eldef-initial-buffer-length)
(string-equal (minibuffer-contents-no-properties)
minibuf-eldef-initial-input)))
- ;; swap state
+ ;; Swap state.
(setq minibuf-eldef-showing-default-in-prompt
(not minibuf-eldef-showing-default-in-prompt))
- (cond (minibuf-eldef-showing-default-in-prompt
- (overlay-put minibuf-eldef-overlay 'invisible nil)
- (overlay-put minibuf-eldef-overlay 'intangible nil))
- (t
- (overlay-put minibuf-eldef-overlay 'invisible t)
- (overlay-put minibuf-eldef-overlay 'intangible t)))))
+ (overlay-put minibuf-eldef-overlay 'invisible
+ (not minibuf-eldef-showing-default-in-prompt))))
\f
;;;###autoload
;;; Todo:
+;; - Make *Completions* readable even if some of the completion
+;; entries have LF chars or spaces in them (including at
+;; beginning/end) or are very long.
;; - for M-x, cycle-sort commands that have no key binding first.
;; - Make things like icomplete-mode or lightning-completion work with
;; completion-in-region-mode.
;; - whether the user wants completion to pay attention to case.
;; e.g. we may want to make it possible for the user to say "first try
;; completion case-sensitively, and if that fails, try to ignore case".
+;; Maybe the trick is that we should distinguish completion-ignore-case in
+;; try/all-completions (obey user's preference) from its use in
+;; test-completion (obey the underlying object's semantics).
;; - add support for ** to pcm.
;; - Add vc-file-name-completion-table to read-file-name-internal.
(sort-fun (completion-metadata-get all-md 'cycle-sort-function)))
(when last
(setcdr last nil)
+
+ ;; Delete duplicates: do it after setting last's cdr to nil (so
+ ;; it's a proper list), and be careful to reset `last' since it
+ ;; may be a different cons-cell.
+ (setq all (delete-dups all))
+ (setq last (last all))
+
(setq all (if sort-fun (funcall sort-fun all)
;; Prefer shorter completions, by default.
(sort all (lambda (c1 c2) (< (length c1) (length c2))))))
;; all possibilities.
(completion--cache-all-sorted-completions (nconc all base-size))))))
+(defun minibuffer-force-complete-and-exit ()
+ "Complete the minibuffer with first of the matches and exit."
+ (interactive)
+ (minibuffer-force-complete)
+ (minibuffer--complete-and-exit
+ ;; If the previous completion completed to an element which fails
+ ;; test-completion, then we shouldn't exit, but that should be rare.
+ (lambda () (minibuffer-message "Incomplete"))))
+
(defun minibuffer-force-complete ()
"Complete the minibuffer to an exact match.
Repeated uses step through the possible completions."
`minibuffer-confirm-exit-commands', and accept the input
otherwise."
(interactive)
+ (minibuffer--complete-and-exit
+ (lambda ()
+ (pcase (condition-case nil
+ (completion--do-completion nil 'expect-exact)
+ (error 1))
+ ((or #b001 #b011) (exit-minibuffer))
+ (#b111 (if (not minibuffer-completion-confirm)
+ (exit-minibuffer)
+ (minibuffer-message "Confirm")
+ nil))
+ (_ nil)))))
+
+(defun minibuffer--complete-and-exit (completion-function)
+ "Exit from `require-match' minibuffer.
+COMPLETION-FUNCTION is called if the current buffer's content does not
+appear to be a match."
(let ((beg (field-beginning))
(end (field-end)))
(cond
(t
;; Call do-completion, but ignore errors.
- (pcase (condition-case nil
- (completion--do-completion nil 'expect-exact)
- (error 1))
- ((or #b001 #b011) (exit-minibuffer))
- (#b111 (if (not minibuffer-completion-confirm)
- (exit-minibuffer)
- (minibuffer-message "Confirm")
- nil))
- (_ nil))))))
+ (funcall completion-function)))))
(defun completion--try-word-completion (string table predicate point md)
(let ((comp (completion-try-completion string table predicate point md)))
process-environment))
(defconst completion--embedded-envvar-re
+ ;; We can't reuse env--substitute-vars-regexp because we need to match only
+ ;; potentially-unfinished envvars at end of string.
(concat "\\(?:^\\|[^$]\\(?:\\$\\$\\)*\\)"
"$\\([[:alnum:]_]*\\|{\\([^}]*\\)\\)\\'"))
(let ((display
(if (and size
(> (+ postwidth textwidth) size))
- ;; This doesn't even obey double-width chars :-(
(propertize
- (if (zerop (- size postwidth 1))
- (substring text 0 1)
- (concat (substring text 0 (- size postwidth textwidth 1)) "…"))
+ (truncate-string-to-width text size nil nil "…")
'help-echo text)
text)))
(when (memq tag '(Artist Album Composer)) ;FIXME: wrong list.
"The channel or user associated with this buffer.")
(defvar rcirc-urls nil
- "List of urls seen in the current buffer.")
+ "List of URLs seen in the current buffer and their start positions.")
(put 'rcirc-urls 'permanent-local t)
(defvar rcirc-timeout-seconds 600
"\\)")
"Regexp matching URLs. Set to nil to disable URL features in rcirc.")
+;; cf cl-remove-if-not
+(defun rcirc-condition-filter (condp lst)
+ "Remove all items not satisfying condition CONDP in list LST.
+CONDP is a function that takes a list element as argument and returns
+non-nil if that element should be included. Returns a new list."
+ (delq nil (mapcar (lambda (x) (and (funcall condp x) x)) lst)))
+
(defun rcirc-browse-url (&optional arg)
- "Prompt for URL to browse based on URLs in buffer."
+ "Prompt for URL to browse based on URLs in buffer before point.
+
+If ARG is given, opens the URL in a new browser window."
(interactive "P")
- (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls))
- (initial-input (car rcirc-urls))
- (history (cdr rcirc-urls)))
+ (let* ((point (point))
+ (filtered (rcirc-condition-filter
+ (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)
arg)))
(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))
- (end (match-end 0))
- (url (match-string-no-properties 0)))
+ (let* ((start (match-beginning 0))
+ (end (match-end 0))
+ (url (match-string-no-properties 0))
+ (link-text (buffer-substring-no-properties start end)))
(make-button start end
'face 'rcirc-url
'follow-link t
'rcirc-url url
'action (lambda (button)
(browse-url (button-get button 'rcirc-url))))
- ;; record the url
- (push url rcirc-urls))))
+ ;; record the url if it is not already the latest stored url
+ (when (not (string= link-text (caar rcirc-urls)))
+ (push (cons link-text start) rcirc-urls)))))
(defun rcirc-markup-keywords (sender response)
(when (and (string= response "PRIVMSG")
successful negotiation."
:type
'(choice
+ (const :tag "Default list of commands"
+ ("gnutls-cli --insecure -p %p %h"
+ "gnutls-cli --insecure -p %p %h --protocols ssl3"
+ "openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
(list :tag "Choose commands"
:value
- ("gnutls-cli -p %p %h"
- "gnutls-cli -p %p %h --protocols ssl3"
+ ("gnutls-cli --insecure -p %p %h"
+ "gnutls-cli --insecure -p %p %h --protocols ssl3"
"openssl s_client -connect %h:%p -no_ssl2 -ign_eof")
(set :inline t
;; FIXME: add brief `:tag "..."' descriptions.
(const "gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt -p %p %h --protocols ssl3")
(const "openssl s_client -connect %h:%p -CAfile /etc/ssl/certs/ca-certificates.crt -no_ssl2 -ign_eof")
;; No trust check:
- (const "gnutls-cli -p %p %h")
- (const "gnutls-cli -p %p %h --protocols ssl3")
+ (const "gnutls-cli --insecure -p %p %h")
+ (const "gnutls-cli --insecure -p %p %h --protocols ssl3")
(const "openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
(repeat :inline t :tag "Other" (string)))
- (const :tag "Default list of commands"
- ("gnutls-cli -p %p %h"
- "gnutls-cli -p %p %h --protocols ssl3"
- "openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
(list :tag "List of commands"
(repeat :tag "Command" (string))))
:version "22.1"
--- /dev/null
+;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp
+
+;; Copyright (C) 2011-2013 Free Software Foundation, Inc.
+
+;; Author: Juergen Hoetzel <juergen@archlinux.org>
+;; Keywords: comm, processes
+;; Package: tramp
+
+;; 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:
+
+;; The Android Debug Bridge must be installed on your local machine.
+;; Add the following form into your .emacs:
+;;
+;; (setq tramp-adb-sdk-dir "/path/to/android/sdk")
+;;
+;; Due to security it is not possible to access non-root devices.
+
+;;; Code:
+
+(require 'tramp)
+
+(defvar dired-move-to-filename-regexp)
+
+(defcustom tramp-adb-sdk-dir "~/Android/sdk"
+ "Set to the directory containing the Android SDK."
+ :type 'string
+ :version "24.4"
+ :group 'tramp)
+
+;;;###tramp-autoload
+(defconst tramp-adb-method "adb"
+ "*When this method name is used, forward all calls to Android Debug Bridge.")
+
+(defcustom tramp-adb-prompt
+ "^\\(?:[[:alnum:]]*@[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
+ "Regexp used as prompt in almquist shell."
+ :type 'string
+ :version "24.4"
+ :group 'tramp)
+
+(defconst tramp-adb-ls-date-regexp
+ "[[:space:]][0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9][[:space:]][0-9][0-9]:[0-9][0-9][[:space:]]")
+
+(defconst tramp-adb-ls-toolbox-regexp
+ (concat
+ "^[[:space:]]*\\([-[:alpha:]]+\\)" ; \1 permissions
+ "[[:space:]]*\\([^[:space:]]+\\)" ; \2 username
+ "[[:space:]]+\\([^[:space:]]+\\)" ; \3 group
+ "[[:space:]]+\\([[:digit:]]+\\)" ; \4 size
+ "[[:space:]]+\\([-[:digit:]]+[[:space:]][:[:digit:]]+\\)" ; \5 date
+ "[[:space:]]+\\(.*\\)$")) ; \6 filename
+
+;;;###tramp-autoload
+(add-to-list 'tramp-methods
+ `(,tramp-adb-method
+ (tramp-tmpdir "/data/local/tmp")))
+
+;;;###tramp-autoload
+(add-to-list 'tramp-default-host-alist `(,tramp-adb-method nil ""))
+
+;;;###tramp-autoload
+(eval-after-load 'tramp
+ '(tramp-set-completion-function
+ tramp-adb-method '((tramp-adb-parse-device-names ""))))
+
+;;;###tramp-autoload
+(add-to-list 'tramp-foreign-file-name-handler-alist
+ (cons 'tramp-adb-file-name-p 'tramp-adb-file-name-handler))
+
+(defconst tramp-adb-file-name-handler-alist
+ '((directory-file-name . tramp-handle-directory-file-name)
+ (dired-uncache . tramp-handle-dired-uncache)
+ (file-name-as-directory . tramp-handle-file-name-as-directory)
+ (file-name-completion . tramp-handle-file-name-completion)
+ (file-name-all-completions . tramp-adb-handle-file-name-all-completions)
+ (file-attributes . tramp-adb-handle-file-attributes)
+ (file-name-directory . tramp-handle-file-name-directory)
+ (file-name-nondirectory . tramp-handle-file-name-nondirectory)
+ (file-truename . tramp-adb-handle-file-truename)
+ (file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
+ (file-name-as-directory . tramp-handle-file-name-as-directory)
+ (file-regular-p . tramp-handle-file-regular-p)
+ (file-remote-p . tramp-handle-file-remote-p)
+ (file-accessible-directory-p . tramp-handle-file-accessible-directory-p)
+ (file-directory-p . tramp-adb-handle-file-directory-p)
+ (file-symlink-p . tramp-handle-file-symlink-p)
+ ;; FIXME: This is too sloppy.
+ (file-executable-p . tramp-handle-file-exists-p)
+ (file-exists-p . tramp-handle-file-exists-p)
+ (file-readable-p . tramp-handle-file-exists-p)
+ (file-writable-p . tramp-adb-handle-file-writable-p)
+ (file-local-copy . tramp-adb-handle-file-local-copy)
+ (file-modes . tramp-handle-file-modes)
+ (expand-file-name . tramp-adb-handle-expand-file-name)
+ (find-backup-file-name . tramp-handle-find-backup-file-name)
+ (directory-files . tramp-handle-directory-files)
+ (directory-files-and-attributes
+ . tramp-adb-handle-directory-files-and-attributes)
+ (make-directory . tramp-adb-handle-make-directory)
+ (delete-directory . tramp-adb-handle-delete-directory)
+ (delete-file . tramp-adb-handle-delete-file)
+ (load . tramp-handle-load)
+ (insert-directory . tramp-adb-handle-insert-directory)
+ (insert-file-contents . tramp-handle-insert-file-contents)
+ (substitute-in-file-name . tramp-handle-substitute-in-file-name)
+ (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory)
+ (vc-registered . ignore) ;no vc control files on Android devices
+ (write-region . tramp-adb-handle-write-region)
+ (set-file-modes . tramp-adb-handle-set-file-modes)
+ (set-file-times . tramp-adb-handle-set-file-times)
+ (copy-file . tramp-adb-handle-copy-file)
+ (rename-file . tramp-adb-handle-rename-file)
+ (process-file . tramp-adb-handle-process-file)
+ (shell-command . tramp-adb-handle-shell-command)
+ (start-file-process . tramp-adb-handle-start-file-process))
+ "Alist of handler functions for Tramp ADB method.")
+
+;; It must be a `defsubst' in order to push the whole code into
+;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading.
+;;;###tramp-autoload
+(defsubst tramp-adb-file-name-p (filename)
+ "Check if it's a filename for ADB."
+ (let ((v (tramp-dissect-file-name filename)))
+ (string= (tramp-file-name-method v) tramp-adb-method)))
+
+;;;###tramp-autoload
+(defun tramp-adb-file-name-handler (operation &rest args)
+ "Invoke the ADB handler for OPERATION.
+First arg specifies the OPERATION, second arg is a list of arguments to
+pass to the OPERATION."
+ (let ((fn (assoc operation tramp-adb-file-name-handler-alist)))
+ (if fn
+ (save-match-data (apply (cdr fn) args))
+ (tramp-run-real-handler operation args))))
+
+;; This cannot be a constant, because `tramp-adb-sdk-dir' is customizable.
+(defun tramp-adb-program ()
+ "The Android Debug Bridge."
+ (expand-file-name "platform-tools/adb" tramp-adb-sdk-dir))
+
+;;;###tramp-autoload
+(defun tramp-adb-parse-device-names (ignore)
+ "Return a list of (nil host) tuples allowed to access."
+ (with-temp-buffer
+ (when (zerop (call-process (tramp-adb-program) nil t nil "devices"))
+ (let (result)
+ (goto-char (point-min))
+ (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t)
+ (add-to-list 'result (list nil (match-string 1))))
+ result))))
+
+(defun tramp-adb-handle-expand-file-name (name &optional dir)
+ "Like `expand-file-name' for Tramp files."
+ ;; 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)
+ (setq name (concat (file-name-as-directory dir) name)))
+ ;; If NAME is not a Tramp file, run the real handler.
+ (if (not (tramp-tramp-file-p name))
+ (tramp-run-real-handler 'expand-file-name (list name nil))
+ ;; Dissect NAME.
+ (with-parsed-tramp-file-name name nil
+ (unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
+ (setq localname (concat "/" localname)))
+ ;; Do normal `expand-file-name' (this does "/./" and "/../").
+ ;; We bind `directory-sep-char' here for XEmacs on Windows,
+ ;; which would otherwise use backslash. `default-directory' is
+ ;; bound, because on Windows there would be problems with UNC
+ ;; shares or Cygwin mounts.
+ (let ((directory-sep-char ?/)
+ (default-directory (tramp-compat-temporary-file-directory)))
+ (tramp-make-tramp-file-name
+ method user host
+ (tramp-drop-volume-letter
+ (tramp-run-real-handler
+ 'expand-file-name (list localname))))))))
+
+(defun tramp-adb-handle-file-directory-p (filename)
+ "Like `file-directory-p' for Tramp files."
+ (car (file-attributes (file-truename filename))))
+
+;; This is derived from `tramp-sh-handle-file-truename'. Maybe the
+;; code could be shared?
+(defun tramp-adb-handle-file-truename (filename &optional counter prev-dirs)
+ "Like `file-truename' for Tramp files."
+ (with-parsed-tramp-file-name (expand-file-name filename) nil
+ (with-tramp-file-property v localname "file-truename"
+ (let ((result nil)) ; result steps in reverse order
+ (tramp-message v 4 "Finding true name for `%s'" filename)
+ (let* ((directory-sep-char ?/)
+ (steps (tramp-compat-split-string localname "/"))
+ (localnamedir (tramp-run-real-handler
+ 'file-name-as-directory (list localname)))
+ (is-dir (string= localname localnamedir))
+ (thisstep nil)
+ (numchase 0)
+ ;; Don't make the following value larger than
+ ;; necessary. People expect an error message in a
+ ;; timely fashion when something is wrong; otherwise
+ ;; they might think that Emacs is hung. Of course,
+ ;; correctness has to come first.
+ (numchase-limit 20)
+ symlink-target)
+ (while (and steps (< numchase numchase-limit))
+ (setq thisstep (pop steps))
+ (tramp-message
+ v 5 "Check %s"
+ (mapconcat 'identity
+ (append '("") (reverse result) (list thisstep))
+ "/"))
+ (setq symlink-target
+ (nth 0 (file-attributes
+ (tramp-make-tramp-file-name
+ method user host
+ (mapconcat 'identity
+ (append '("")
+ (reverse result)
+ (list thisstep))
+ "/")))))
+ (cond ((string= "." thisstep)
+ (tramp-message v 5 "Ignoring step `.'"))
+ ((string= ".." thisstep)
+ (tramp-message v 5 "Processing step `..'")
+ (pop result))
+ ((stringp symlink-target)
+ ;; It's a symlink, follow it.
+ (tramp-message v 5 "Follow symlink to %s" symlink-target)
+ (setq numchase (1+ numchase))
+ (when (file-name-absolute-p symlink-target)
+ (setq result nil))
+ ;; If the symlink was absolute, we'll get a string
+ ;; like "/user@host:/some/target"; extract the
+ ;; "/some/target" part from it.
+ (when (tramp-tramp-file-p symlink-target)
+ (unless (tramp-equal-remote filename symlink-target)
+ (tramp-error
+ v 'file-error
+ "Symlink target `%s' on wrong host" symlink-target))
+ (setq symlink-target localname))
+ (setq steps
+ (append (tramp-compat-split-string
+ symlink-target "/")
+ steps)))
+ (t
+ ;; It's a file.
+ (setq result (cons thisstep result)))))
+ (when (>= numchase numchase-limit)
+ (tramp-error
+ v 'file-error
+ "Maximum number (%d) of symlinks exceeded" numchase-limit))
+ (setq result (reverse result))
+ ;; Combine list to form string.
+ (setq result
+ (if result
+ (mapconcat 'identity (cons "" result) "/")
+ "/"))
+ (when (and is-dir (or (string= "" result)
+ (not (string= (substring result -1) "/"))))
+ (setq result (concat result "/"))))
+
+ (tramp-message v 4 "True name of `%s' is `%s'" filename result)
+ (tramp-make-tramp-file-name method user host result)))))
+
+(defun tramp-adb-handle-file-attributes (filename &optional id-format)
+ "Like `file-attributes' for Tramp files."
+ (unless id-format (setq id-format 'integer))
+ (ignore-errors
+ (with-parsed-tramp-file-name filename nil
+ (with-tramp-file-property
+ v localname (format "file-attributes-%s" id-format)
+ (tramp-adb-barf-unless-okay
+ v (format "%s -d -l %s"
+ (tramp-adb-get-ls-command v)
+ (tramp-shell-quote-argument localname)) "")
+ (with-current-buffer (tramp-get-buffer v)
+ (tramp-adb-sh-fix-ls-output)
+ (cdar (tramp-do-parse-file-attributes-with-ls v id-format)))))))
+
+(defun tramp-do-parse-file-attributes-with-ls (vec &optional id-format)
+ "Parse `file-attributes' for Tramp files using the ls(1) command."
+ (with-current-buffer (tramp-get-buffer vec)
+ (goto-char (point-min))
+ (let ((file-properties nil))
+ (while (re-search-forward tramp-adb-ls-toolbox-regexp nil t)
+ (let* ((mod-string (match-string 1))
+ (is-dir (eq ?d (aref mod-string 0)))
+ (is-symlink (eq ?l (aref mod-string 0)))
+ (uid (match-string 2))
+ (gid (match-string 3))
+ (size (string-to-number (match-string 4)))
+ (date (match-string 5))
+ (name (match-string 6))
+ (symlink-target
+ (and is-symlink
+ (cadr (split-string name "\\( -> \\|\n\\)")))))
+ (push (list
+ (if is-symlink
+ (car (split-string name "\\( -> \\|\n\\)"))
+ name)
+ (or is-dir symlink-target)
+ 1 ;link-count
+ ;; no way to handle numeric ids in Androids ash
+ (if (eq id-format 'integer) 0 uid)
+ (if (eq id-format 'integer) 0 gid)
+ '(0 0) ; atime
+ (date-to-time date) ; mtime
+ '(0 0) ; ctime
+ size
+ mod-string
+ ;; fake
+ t 1
+ (tramp-get-device vec))
+ file-properties)))
+ file-properties)))
+
+(defun tramp-adb-handle-directory-files-and-attributes
+ (directory &optional full match nosort id-format)
+ "Like `directory-files-and-attributes' for Tramp files."
+ (when (file-directory-p directory)
+ (with-parsed-tramp-file-name (expand-file-name directory) nil
+ (with-tramp-file-property
+ v localname (format "directory-files-attributes-%s-%s-%s-%s"
+ full match id-format nosort)
+ (tramp-adb-barf-unless-okay
+ v (format "%s -a -l %s"
+ (tramp-adb-get-ls-command v)
+ (tramp-shell-quote-argument localname)) "")
+ (with-current-buffer (tramp-get-buffer v)
+ (tramp-adb-sh-fix-ls-output)
+ (let ((result (tramp-do-parse-file-attributes-with-ls
+ v (or id-format 'integer))))
+ (when full
+ (setq result
+ (mapcar
+ (lambda (x)
+ (cons (expand-file-name (car x) directory) (cdr x)))
+ result)))
+ (unless nosort
+ (setq result
+ (sort result (lambda (x y) (string< (car x) (car y))))))
+ (delq nil
+ (mapcar (lambda (x)
+ (if (or (not match) (string-match match (car x)))
+ x))
+ result))))))))
+
+(defun tramp-adb-get-ls-command (vec)
+ (with-tramp-connection-property vec "ls"
+ (tramp-message vec 5 "Finding a suitable `ls' command")
+ (if (zerop (tramp-adb-command-exit-status
+ vec "ls --color=never -al /dev/null"))
+ ;; On CyanogenMod based system BusyBox is used and "ls" output
+ ;; coloring is enabled by default. So we try to disable it
+ ;; when possible.
+ "ls --color=never"
+ "ls")))
+
+(defun tramp-adb-get-toolbox (vec)
+ "Get shell toolbox implementation: `toolbox' for original distributions
+or `busybox' for CyanogenMod based distributions"
+ (with-tramp-connection-property vec "toolbox"
+ (tramp-message vec 5 "Checking shell toolbox implementation")
+ (cond
+ ((zerop (tramp-adb-command-exit-status vec "busybox")) 'busybox)
+ ((zerop (tramp-adb-command-exit-status vec "toolbox")) 'toolbox)
+ (t 'unknown))))
+
+(defun tramp-adb--gnu-switches-to-ash
+ (switches)
+ "Almquist shell can't handle multiple arguments.
+Convert (\"-al\") to (\"-a\" \"-l\"). Remove arguments like \"--dired\"."
+ (split-string
+ (apply 'concat
+ (mapcar (lambda (s)
+ (replace-regexp-in-string
+ "\\(.\\)" " -\\1"
+ (replace-regexp-in-string "^-" "" s)))
+ ;; FIXME: Warning about removed switches (long and non-dash).
+ (delq nil
+ (mapcar
+ (lambda (s)
+ (and (not (string-match "\\(^--\\|^[^-]\\)" s)) s))
+ switches))))))
+
+(defun tramp-adb-handle-insert-directory
+ (filename switches &optional wildcard full-directory-p)
+ "Like `insert-directory' for Tramp files."
+ (when (stringp switches)
+ (setq switches (tramp-adb--gnu-switches-to-ash (split-string switches))))
+ (with-parsed-tramp-file-name (file-truename filename) nil
+ (with-current-buffer (tramp-get-buffer v)
+ (let ((name (tramp-shell-quote-argument (directory-file-name localname)))
+ (switch-d (member "-d" switches))
+ (switch-t (member "-t" switches))
+ (switches (mapconcat 'identity (remove "-t" switches) " ")))
+ (tramp-adb-barf-unless-okay
+ v (format "%s %s %s" (tramp-adb-get-ls-command v) switches name)
+ "Cannot insert directory listing: %s" filename)
+ (unless switch-d
+ ;; We insert also filename/. and filename/.., because "ls" doesn't.
+ (narrow-to-region (point) (point))
+ (ignore-errors
+ (tramp-adb-barf-unless-okay
+ v (format "%s -d %s %s %s"
+ (tramp-adb-get-ls-command v)
+ switches
+ (concat (file-name-as-directory name) ".")
+ (concat (file-name-as-directory name) ".."))
+ "Cannot insert directory listing: %s" filename))
+ (widen))
+ (tramp-adb-sh-fix-ls-output switch-t)))
+ (insert-buffer-substring (tramp-get-buffer v))))
+
+(defun tramp-adb-sh-fix-ls-output (&optional sort-by-time)
+ "Insert dummy 0 in empty size columns.
+Androids \"ls\" command doesn't insert size column for directories:
+Emacs dired can't find files."
+ (save-excursion
+ ;; Insert missing size.
+ (goto-char (point-min))
+ (while
+ (search-forward-regexp
+ "[[:space:]]\\([[:space:]][0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9][[:space:]]\\)" nil t)
+ (replace-match "0\\1" "\\1" nil)
+ ;; Insert missing "/".
+ (when (looking-at "[0-9][0-9]:[0-9][0-9][[:space:]]+$")
+ (end-of-line)
+ (insert "/")))
+ ;; Sort entries.
+ (let* ((lines (split-string (buffer-string) "\n" t))
+ (sorted-lines
+ (sort
+ lines
+ (if sort-by-time
+ 'tramp-adb-ls-output-time-less-p
+ 'tramp-adb-ls-output-name-less-p))))
+ (delete-region (point-min) (point-max))
+ (insert " " (mapconcat 'identity sorted-lines "\n ")))
+ ;; Add final newline.
+ (goto-char (point-max))
+ (unless (= (point) (line-beginning-position))
+ (insert "\n"))))
+
+
+(defun tramp-adb-ls-output-time-less-p (a b)
+ "Sort \"ls\" output by time, descending."
+ (let (time-a time-b)
+ (string-match tramp-adb-ls-date-regexp a)
+ (setq time-a (apply 'encode-time (parse-time-string (match-string 0 a))))
+ (string-match tramp-adb-ls-date-regexp b)
+ (setq time-b (apply 'encode-time (parse-time-string (match-string 0 b))))
+ (time-less-p time-b time-a)))
+
+(defun tramp-adb-ls-output-name-less-p (a b)
+ "Sort \"ls\" output by name, ascending."
+ (let (posa posb)
+ (string-match dired-move-to-filename-regexp a)
+ (setq posa (match-end 0))
+ (string-match dired-move-to-filename-regexp b)
+ (setq posb (match-end 0))
+ (string-lessp (substring a posa) (substring b posb))))
+
+(defun tramp-adb-handle-make-directory (dir &optional parents)
+ "Like `make-directory' for Tramp files."
+ (setq dir (expand-file-name dir))
+ (with-parsed-tramp-file-name dir nil
+ (when parents
+ (let ((par (expand-file-name ".." dir)))
+ (unless (file-directory-p par)
+ (make-directory par parents))))
+ (tramp-adb-barf-unless-okay
+ v (format "mkdir %s" (tramp-shell-quote-argument localname))
+ "Couldn't make directory %s" dir)
+ (tramp-flush-directory-property v (file-name-directory localname))))
+
+(defun tramp-adb-handle-delete-directory (directory &optional recursive)
+ "Like `delete-directory' for Tramp files."
+ (setq directory (expand-file-name directory))
+ (with-parsed-tramp-file-name directory nil
+ (tramp-flush-file-property v (file-name-directory localname))
+ (tramp-flush-directory-property v localname)
+ (tramp-adb-barf-unless-okay
+ v (format "%s %s"
+ (if recursive "rm -r" "rmdir")
+ (tramp-shell-quote-argument localname))
+ "Couldn't delete %s" directory)))
+
+(defun tramp-adb-handle-delete-file (filename &optional trash)
+ "Like `delete-file' for Tramp files."
+ (setq filename (expand-file-name filename))
+ (with-parsed-tramp-file-name filename nil
+ (tramp-flush-file-property v (file-name-directory localname))
+ (tramp-flush-file-property v localname)
+ (tramp-adb-barf-unless-okay
+ v (format "rm %s" (tramp-shell-quote-argument localname))
+ "Couldn't delete %s" filename)))
+
+(defun tramp-adb-handle-file-name-all-completions (filename directory)
+ "Like `file-name-all-completions' for Tramp files."
+ (all-completions
+ filename
+ (with-parsed-tramp-file-name directory nil
+ (with-tramp-file-property v localname "file-name-all-completions"
+ (save-match-data
+ (tramp-adb-send-command
+ v (format "%s %s"
+ (tramp-adb-get-ls-command v)
+ (tramp-shell-quote-argument localname)))
+ (mapcar
+ (lambda (f)
+ (if (file-directory-p f)
+ (file-name-as-directory f)
+ f))
+ (with-current-buffer (tramp-get-buffer v)
+ (delq
+ nil
+ (mapcar
+ (lambda (l) (and (not (string-match "^[[:space:]]*$" l)) l))
+ (split-string (buffer-string) "\n"))))))))))
+
+(defun tramp-adb-handle-file-local-copy (filename)
+ "Like `file-local-copy' for Tramp files."
+ (with-parsed-tramp-file-name filename nil
+ (unless (file-exists-p (file-truename filename))
+ (tramp-error
+ v 'file-error
+ "Cannot make local copy of non-existing file `%s'" filename))
+ (let ((tmpfile (tramp-compat-make-temp-file filename)))
+ (with-tramp-progress-reporter
+ v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
+ (when (tramp-adb-execute-adb-command v "pull" localname tmpfile)
+ (delete-file tmpfile)
+ (tramp-error
+ v 'file-error "Cannot make local copy of file `%s'" filename))
+ (set-file-modes tmpfile (file-modes filename)))
+ tmpfile)))
+
+(defun tramp-adb-handle-file-writable-p (filename)
+ "Like `tramp-sh-handle-file-writable-p'.
+But handle the case, if the \"test\" command is not available."
+ (with-parsed-tramp-file-name filename nil
+ (with-tramp-file-property v localname "file-writable-p"
+ (if (tramp-adb-find-test-command v)
+ (if (file-exists-p filename)
+ (zerop
+ (tramp-adb-command-exit-status
+ v (format "test -w %s" (tramp-shell-quote-argument localname))))
+ (and
+ (file-directory-p (file-name-directory filename))
+ (file-writable-p (file-name-directory filename))))
+
+ ;; Missing "test" command on Android < 4.
+ (let ((rw-path "/data/data"))
+ (tramp-message
+ v 5
+ "Not implemented yet (assuming \"/data/data\" is writable): %s"
+ localname)
+ (and (>= (length localname) (length rw-path))
+ (string= (substring localname 0 (length rw-path))
+ rw-path)))))))
+
+(defun tramp-adb-handle-write-region
+ (start end filename &optional append visit lockname confirm)
+ "Like `write-region' for Tramp files."
+ (setq filename (expand-file-name filename))
+ (with-parsed-tramp-file-name filename nil
+ (when append
+ (tramp-error
+ v 'file-error "Cannot append to file using Tramp (`%s')" filename))
+ (when (and confirm (file-exists-p filename))
+ (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
+ filename))
+ (tramp-error v 'file-error "File not overwritten")))
+ ;; We must also flush the cache of the directory, because
+ ;; `file-attributes' reads the values from there.
+ (tramp-flush-file-property v (file-name-directory localname))
+ (tramp-flush-file-property v localname)
+ (let* ((curbuf (current-buffer))
+ (tmpfile (tramp-compat-make-temp-file filename)))
+ (tramp-run-real-handler
+ '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)
+ (unwind-protect
+ (when (tramp-adb-execute-adb-command v "push" tmpfile localname)
+ (tramp-error v 'file-error "Cannot write: `%s' filename"))
+ (delete-file tmpfile)))
+
+ (unless (equal curbuf (current-buffer))
+ (tramp-error
+ v 'file-error
+ "Buffer has changed from `%s' to `%s'" curbuf (current-buffer))))))
+
+(defun tramp-adb-handle-set-file-modes (filename mode)
+ "Like `set-file-modes' for Tramp files."
+ (with-parsed-tramp-file-name filename nil
+ (tramp-flush-file-property v localname)
+ (tramp-adb-barf-unless-okay
+ v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname)
+ "Error while changing file's mode %s" filename)))
+
+(defun tramp-adb-handle-set-file-times (filename &optional time)
+ "Like `set-file-times' for Tramp files."
+ (with-parsed-tramp-file-name filename nil
+ (tramp-flush-file-property v localname)
+ (let ((time (if (or (null time) (equal time '(0 0)))
+ (current-time)
+ time)))
+ (tramp-adb-command-exit-status
+ ;; use shell arithmetic because of Emacs integer size limit
+ v (format "touch -t $(( %d * 65536 + %d )) %s"
+ (car time) (cadr time)
+ (tramp-shell-quote-argument localname))))))
+
+(defun tramp-adb-handle-copy-file
+ (filename newname &optional ok-if-already-exists keep-date
+ preserve-uid-gid preserve-extended-attributes)
+ "Like `copy-file' for Tramp files.
+PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
+ (setq filename (expand-file-name filename)
+ newname (expand-file-name newname))
+
+ (if (file-directory-p filename)
+ (copy-directory filename newname keep-date t)
+ (with-tramp-progress-reporter
+ (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
+ 0 (format "Copying %s to %s" filename newname)
+
+ (let ((tmpfile (file-local-copy filename)))
+
+ (if tmpfile
+ ;; Remote filename.
+ (condition-case err
+ (rename-file tmpfile newname ok-if-already-exists)
+ ((error quit)
+ (delete-file tmpfile)
+ (signal (car err) (cdr err))))
+
+ ;; Remote newname.
+ (when (file-directory-p newname)
+ (setq newname
+ (expand-file-name (file-name-nondirectory filename) newname)))
+
+ (with-parsed-tramp-file-name newname nil
+ (when (and (not ok-if-already-exists)
+ (file-exists-p newname))
+ (tramp-error v 'file-already-exists newname))
+
+ ;; We must also flush the cache of the directory, because
+ ;; `file-attributes' reads the values from there.
+ (tramp-flush-file-property v (file-name-directory localname))
+ (tramp-flush-file-property v localname)
+ (when (tramp-adb-execute-adb-command v "push" filename localname)
+ (tramp-error
+ v 'file-error "Cannot copy `%s' `%s'" filename newname))))))
+
+ ;; KEEP-DATE handling.
+ (when keep-date
+ (set-file-times newname (nth 5 (file-attributes filename))))))
+
+(defun tramp-adb-handle-rename-file
+ (filename newname &optional ok-if-already-exists)
+ "Like `rename-file' for Tramp files."
+ (setq filename (expand-file-name filename)
+ newname (expand-file-name newname))
+
+ (with-parsed-tramp-file-name
+ (if (file-remote-p filename) filename newname) nil
+ (with-tramp-progress-reporter
+ v 0 (format "Renaming %s to %s" newname filename)
+
+ (if (and (tramp-equal-remote filename newname)
+ (not (file-directory-p filename)))
+ (progn
+ (when (and (not ok-if-already-exists)
+ (file-exists-p newname))
+ (tramp-error v 'file-already-exists newname))
+ ;; We must also flush the cache of the directory, because
+ ;; `file-attributes' reads the values from there.
+ (tramp-flush-file-property v (file-name-directory localname))
+ (tramp-flush-file-property v localname)
+ ;; Short track.
+ (tramp-adb-barf-unless-okay
+ v (format "mv %s %s" (file-remote-p filename 'localname) localname)
+ "Error renaming %s to %s" filename newname))
+
+ ;; Rename by copy.
+ (copy-file filename newname ok-if-already-exists t t)
+ (delete-file filename)))))
+
+(defun tramp-adb-handle-process-file
+ (program &optional infile destination display &rest args)
+ "Like `process-file' for Tramp files."
+ ;; The implementation is not complete yet.
+ (when (and (numberp destination) (zerop destination))
+ (error "Implementation does not handle immediate return"))
+
+ (with-parsed-tramp-file-name default-directory nil
+ (let (command input tmpinput stderr tmpstderr outbuf ret)
+ ;; Compute command.
+ (setq command (mapconcat 'tramp-shell-quote-argument
+ (cons program args) " "))
+ ;; Determine input.
+ (if (null infile)
+ (setq input "/dev/null")
+ (setq infile (expand-file-name infile))
+ (if (tramp-equal-remote default-directory infile)
+ ;; INFILE is on the same remote host.
+ (setq input (with-parsed-tramp-file-name infile nil localname))
+ ;; INFILE must be copied to remote host.
+ (setq input (tramp-make-tramp-temp-file v)
+ tmpinput (tramp-make-tramp-file-name method user host input))
+ (copy-file infile tmpinput t)))
+ (when input (setq command (format "%s <%s" command input)))
+
+ ;; Determine output.
+ (cond
+ ;; Just a buffer.
+ ((bufferp destination)
+ (setq outbuf destination))
+ ;; A buffer name.
+ ((stringp destination)
+ (setq outbuf (get-buffer-create destination)))
+ ;; (REAL-DESTINATION ERROR-DESTINATION)
+ ((consp destination)
+ ;; output.
+ (cond
+ ((bufferp (car destination))
+ (setq outbuf (car destination)))
+ ((stringp (car destination))
+ (setq outbuf (get-buffer-create (car destination))))
+ ((car destination)
+ (setq outbuf (current-buffer))))
+ ;; stderr.
+ (cond
+ ((stringp (cadr destination))
+ (setcar (cdr destination) (expand-file-name (cadr destination)))
+ (if (tramp-equal-remote default-directory (cadr destination))
+ ;; stderr is on the same remote host.
+ (setq stderr (with-parsed-tramp-file-name
+ (cadr destination) nil localname))
+ ;; stderr must be copied to remote host. The temporary
+ ;; file must be deleted after execution.
+ (setq stderr (tramp-make-tramp-temp-file v)
+ tmpstderr (tramp-make-tramp-file-name
+ method user host stderr))))
+ ;; stderr to be discarded.
+ ((null (cadr destination))
+ (setq stderr "/dev/null"))))
+ ;; 't
+ (destination
+ (setq outbuf (current-buffer))))
+ (when stderr (setq command (format "%s 2>%s" command stderr)))
+
+ ;; Send the command. It might not return in time, so we protect
+ ;; it. Call it in a subshell, in order to preserve working
+ ;; directory.
+ (condition-case nil
+ (progn
+ (setq ret 0
+ ret
+ (tramp-adb-barf-unless-okay
+ v (format "(cd %s; %s)"
+ (tramp-shell-quote-argument localname)
+ command)
+ ""))
+ ;; We should show the output anyway.
+ (when outbuf
+ (with-current-buffer outbuf
+ (insert-buffer-substring (tramp-get-connection-buffer v)))
+ (when display (display-buffer outbuf))))
+ ;; When the user did interrupt, we should do it also. We use
+ ;; return code -1 as marker.
+ (quit
+ (kill-buffer (tramp-get-connection-buffer v))
+ (setq ret -1))
+ ;; Handle errors.
+ (error
+ (kill-buffer (tramp-get-connection-buffer v))
+ (setq ret 1)))
+
+ ;; Provide error file.
+ (when tmpstderr (rename-file tmpstderr (cadr destination) t))
+
+ ;; Cleanup. We remove all file cache values for the connection,
+ ;; because the remote process could have changed them.
+ (when tmpinput (delete-file tmpinput))
+
+ ;; `process-file-side-effects' has been introduced with GNU
+ ;; Emacs 23.2. If set to `nil', no remote file will be changed
+ ;; by `program'. If it doesn't exist, we assume its default
+ ;; value 't'.
+ (unless (and (boundp 'process-file-side-effects)
+ (not (symbol-value 'process-file-side-effects)))
+ (tramp-flush-directory-property v ""))
+
+ ;; Return exit status.
+ (if (equal ret -1)
+ (keyboard-quit)
+ ret))))
+
+(defun tramp-adb-handle-shell-command
+ (command &optional output-buffer error-buffer)
+ "Like `shell-command' for Tramp files."
+ (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
+ ;; We cannot use `shell-file-name' and `shell-command-switch',
+ ;; they are variables of the local host.
+ (args (list "sh" "-c" (substring command 0 asynchronous)))
+ current-buffer-p
+ (output-buffer
+ (cond
+ ((bufferp output-buffer) output-buffer)
+ ((stringp output-buffer) (get-buffer-create output-buffer))
+ (output-buffer
+ (setq current-buffer-p t)
+ (current-buffer))
+ (t (get-buffer-create
+ (if asynchronous
+ "*Async Shell Command*"
+ "*Shell Command Output*")))))
+ (error-buffer
+ (cond
+ ((bufferp error-buffer) error-buffer)
+ ((stringp error-buffer) (get-buffer-create error-buffer))))
+ (buffer
+ (if (and (not asynchronous) error-buffer)
+ (with-parsed-tramp-file-name default-directory nil
+ (list output-buffer (tramp-make-tramp-temp-file v)))
+ output-buffer))
+ (p (get-buffer-process output-buffer)))
+
+ ;; Check whether there is another process running. Tramp does not
+ ;; support 2 (asynchronous) processes in parallel.
+ (when p
+ (if (yes-or-no-p "A command is running. Kill it? ")
+ (ignore-errors (kill-process p))
+ (error "Shell command in progress")))
+
+ (if current-buffer-p
+ (progn
+ (barf-if-buffer-read-only)
+ (push-mark nil t))
+ (with-current-buffer output-buffer
+ (setq buffer-read-only nil)
+ (erase-buffer)))
+
+ (if (and (not current-buffer-p) (integerp asynchronous))
+ (prog1
+ ;; Run the process.
+ (apply 'start-file-process "*Async Shell*" buffer args)
+ ;; Display output.
+ (pop-to-buffer output-buffer)
+ (setq mode-line-process '(":%s"))
+ (shell-mode))
+
+ (prog1
+ ;; Run the process.
+ (apply 'process-file (car args) nil buffer nil (cdr args))
+ ;; Insert error messages if they were separated.
+ (when (listp buffer)
+ (with-current-buffer error-buffer
+ (insert-file-contents (cadr buffer)))
+ (delete-file (cadr buffer)))
+ (if current-buffer-p
+ ;; This is like exchange-point-and-mark, but doesn't
+ ;; activate the mark. It is cleaner to avoid activation,
+ ;; even though the command loop would deactivate the mark
+ ;; because we inserted text.
+ (goto-char (prog1 (mark t)
+ (set-marker (mark-marker) (point)
+ (current-buffer))))
+ ;; There's some output, display it.
+ (when (with-current-buffer output-buffer (> (point-max) (point-min)))
+ (if (functionp 'display-message-or-buffer)
+ (tramp-compat-funcall 'display-message-or-buffer output-buffer)
+ (pop-to-buffer output-buffer))))))))
+
+;; We use BUFFER also as connection buffer during setup. Because of
+;; this, its original contents must be saved, and restored once
+;; connection has been setup.
+(defun tramp-adb-handle-start-file-process (name buffer program &rest args)
+ "Like `start-file-process' for Tramp files."
+ (with-parsed-tramp-file-name default-directory nil
+ ;; When PROGRAM is nil, we just provide a tty.
+ (let ((command
+ (when (stringp program)
+ (format "cd %s; %s"
+ (tramp-shell-quote-argument localname)
+ (mapconcat 'tramp-shell-quote-argument
+ (cons program args) " "))))
+ (tramp-process-connection-type
+ (or (null program) tramp-process-connection-type))
+ (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
+ (name1 name)
+ (i 0))
+ (unwind-protect
+ (save-excursion
+ (save-restriction
+ (unless buffer
+ ;; BUFFER can be nil. We use a temporary buffer.
+ (setq buffer (generate-new-buffer tramp-temp-buffer-name)))
+ (while (get-process name1)
+ ;; NAME must be unique as process name.
+ (setq i (1+ i)
+ name1 (format "%s<%d>" name i)))
+ (setq name name1)
+ ;; Set the new process properties.
+ (tramp-set-connection-property v "process-name" name)
+ (tramp-set-connection-property v "process-buffer" buffer)
+ ;; Activate narrowing in order to save BUFFER contents.
+ ;; Clear also the modification time; otherwise we might
+ ;; be interrupted by `verify-visited-file-modtime'.
+ (with-current-buffer (tramp-get-connection-buffer v)
+ (let ((buffer-undo-list t))
+ (clear-visited-file-modtime)
+ (narrow-to-region (point-max) (point-max))
+ (if command
+ ;; Send the command.
+ (tramp-adb-send-command v command)
+ ;; Open the connection.
+ (tramp-adb-maybe-open-connection v))))
+ (let ((p (tramp-get-connection-process v)))
+ ;; Set sentinel and query flag for this process.
+ (tramp-set-connection-property p "vector" v)
+ (set-process-sentinel p 'tramp-process-sentinel)
+ (tramp-compat-set-process-query-on-exit-flag p t)
+ ;; Return process.
+ p)))
+ ;; Save exit.
+ (with-current-buffer (tramp-get-connection-buffer v)
+ (if (string-match tramp-temp-buffer-name (buffer-name))
+ (progn
+ (set-process-buffer (tramp-get-connection-process v) nil)
+ (kill-buffer (current-buffer)))
+ (set-buffer-modified-p bmp)))
+ (tramp-set-connection-property v "process-name" nil)
+ (tramp-set-connection-property v "process-buffer" nil)))))
+
+;; Helper functions.
+
+(defun tramp-adb-execute-adb-command (vec &rest args)
+ "Returns nil on success error-output on failure."
+ (when (> (length (tramp-file-name-host vec)) 0)
+ (setq args (append (list "-s" (tramp-file-name-host vec)) args)))
+ (with-temp-buffer
+ (prog1
+ (unless (zerop (apply 'call-process (tramp-adb-program) nil t nil args))
+ (buffer-string))
+ (tramp-message
+ vec 6 "%s %s\n%s"
+ (tramp-adb-program) (mapconcat 'identity args " ") (buffer-string)))))
+
+(defun tramp-adb-find-test-command (vec)
+ "Checks, whether the ash has a builtin \"test\" command.
+This happens for Android >= 4.0."
+ (with-tramp-connection-property vec "test"
+ (zerop (tramp-adb-command-exit-status vec "type test"))))
+
+;; Connection functions
+
+(defun tramp-adb-send-command (vec command)
+ "Send the COMMAND to connection VEC."
+ (tramp-adb-maybe-open-connection vec)
+ (tramp-message vec 6 "%s" command)
+ (tramp-send-string vec command)
+ ;; fixme: Race condition
+ (tramp-adb-wait-for-output (tramp-get-connection-process vec))
+ (with-current-buffer (tramp-get-connection-buffer vec)
+ (save-excursion
+ (goto-char (point-min))
+ ;; We can't use stty to disable echo of command.
+ (delete-matching-lines (regexp-quote command))
+ ;; When the local machine is W32, there are still trailing ^M.
+ ;; There must be a better solution by setting the correct coding
+ ;; system, but this requires changes in core Tramp.
+ (goto-char (point-min))
+ (while (re-search-forward "\r+$" nil t)
+ (replace-match "" nil nil)))))
+
+(defun tramp-adb-barf-unless-okay (vec command fmt &rest args)
+ "Run COMMAND, check exit status, throw error if exit status not okay.
+FMT and ARGS are passed to `error'."
+ (tramp-adb-send-command vec (format "%s; echo tramp_exit_status $?" command))
+ (with-current-buffer (tramp-get-connection-buffer vec)
+ (goto-char (point-max))
+ (unless (re-search-backward "tramp_exit_status [0-9]+" nil t)
+ (tramp-error
+ vec 'file-error "Couldn't find exit status of `%s'" command))
+ (skip-chars-forward "^ ")
+ (unless (zerop (read (current-buffer)))
+ (apply 'tramp-error vec 'file-error fmt args))
+ (let (buffer-read-only)
+ (delete-region (match-beginning 0) (point-max)))))
+
+(defun tramp-adb-command-exit-status
+ (vec command)
+ "Run COMMAND and return 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 vec (format "%s; echo tramp_exit_status $?" command))
+ (with-current-buffer (tramp-get-connection-buffer vec)
+ (goto-char (point-max))
+ (unless (re-search-backward "tramp_exit_status [0-9]+" nil t)
+ (tramp-error
+ vec 'file-error "Couldn't find exit status of `%s'" command))
+ (skip-chars-forward "^ ")
+ (read (current-buffer))))
+
+(defun tramp-adb-wait-for-output (proc &optional timeout)
+ "Wait for output from remote command."
+ (unless (buffer-live-p (process-buffer proc))
+ (delete-process proc)
+ (tramp-error proc 'file-error "Process `%s' not available, try again" proc))
+ (with-current-buffer (process-buffer proc)
+ (if (tramp-wait-for-regexp proc timeout tramp-adb-prompt)
+ (let (buffer-read-only)
+ (goto-char (point-min))
+ ;; ADB terminal sends "^H" sequences.
+ (when (re-search-forward "<\b+" (point-at-eol) t)
+ (forward-line 1)
+ (delete-region (point-min) (point)))
+ ;; Delete the prompt.
+ (goto-char (point-min))
+ (when (re-search-forward tramp-adb-prompt (point-at-eol) t)
+ (forward-line 1)
+ (delete-region (point-min) (point)))
+ (goto-char (point-max))
+ (re-search-backward tramp-adb-prompt nil t)
+ (delete-region (point) (point-max)))
+ (if timeout
+ (tramp-error
+ proc 'file-error
+ "[[Remote adb prompt `%s' not found in %d secs]]"
+ tramp-adb-prompt timeout)
+ (tramp-error
+ proc 'file-error
+ "[[Remote prompt `%s' not found]]" tramp-adb-prompt)))))
+
+(defun tramp-adb-maybe-open-connection (vec)
+ "Maybe open a connection VEC.
+Does not do anything if a connection is already open, but re-opens the
+connection if a previous connection has died for some reason."
+ (let* ((buf (tramp-get-connection-buffer vec))
+ (p (get-buffer-process buf))
+ (host (tramp-file-name-host vec))
+ (devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
+ (unless
+ (and p (processp p) (memq (process-status p) '(run open)))
+ (save-match-data
+ (when (and p (processp p)) (delete-process p))
+ (if (not devices)
+ (tramp-error vec 'file-error "No device connected"))
+ (if (and (> (length host) 0) (not (member host devices)))
+ (tramp-error vec 'file-error "Device %s not connected" host))
+ (if (and (> (length devices) 1) (zerop (length host)))
+ (tramp-error
+ vec 'file-error
+ "Multiple Devices connected: No Host/Device specified"))
+ (with-tramp-progress-reporter vec 3 "Opening adb shell connection"
+ (let* ((coding-system-for-read 'utf-8-dos) ;is this correct?
+ (process-connection-type tramp-process-connection-type)
+ (args (if (> (length host) 0)
+ (list "-s" host "shell")
+ (list "shell")))
+ (p (let ((default-directory
+ (tramp-compat-temporary-file-directory)))
+ (apply 'start-process (tramp-get-connection-name vec) buf
+ (tramp-adb-program) args))))
+ (tramp-message
+ vec 6 "%s" (mapconcat 'identity (process-command p) " "))
+ ;; Wait for initial prompt.
+ (tramp-adb-wait-for-output p)
+ (unless (eq 'run (process-status p))
+ (tramp-error vec 'file-error "Terminated!"))
+ (set-process-query-on-exit-flag p nil)
+
+ ;; Check whether the properties have been changed. If
+ ;; yes, this is a strong indication that we must expire all
+ ;; connection properties. We start again.
+ (tramp-message vec 5 "Checking system information")
+ (tramp-adb-send-command
+ vec "echo \\\"`getprop ro.product.model` `getprop ro.product.version` `getprop ro.build.version.release`\\\"")
+ (let ((old-getprop
+ (tramp-get-connection-property vec "getprop" nil))
+ (new-getprop
+ (tramp-set-connection-property
+ vec "getprop"
+ (with-current-buffer (tramp-get-connection-buffer vec)
+ ;; Read the expression.
+ (goto-char (point-min))
+ (read (current-buffer))))))
+ (when (and (stringp old-getprop)
+ (not (string-equal old-getprop new-getprop)))
+ (tramp-cleanup vec)
+ (tramp-message
+ vec 3
+ "Connection reset, because remote host changed from `%s' to `%s'"
+ old-getprop new-getprop)
+ (tramp-adb-maybe-open-connection vec)))
+
+ ;; Set "remote-path" connection property. This is needed
+ ;; for eshell.
+ (tramp-adb-send-command vec "echo \\\"$PATH\\\"")
+ (tramp-set-connection-property
+ vec "remote-path"
+ (split-string
+ (with-current-buffer (tramp-get-connection-buffer vec)
+ ;; Read the expression.
+ (goto-char (point-min))
+ (read (current-buffer)))
+ ":" 'omit-nulls))))))))
+
+(provide 'tramp-adb)
+;;; tramp-adb.el ends here
(require 'timer-funcs)
(require 'timer))
- ;; We check whether `start-file-process' is bound.
- ;; Note: we deactivate this. There are problems, at least in SXEmacs.
- (unless t;(fboundp 'start-file-process)
-
- ;; tramp-util offers integration into other (X)Emacs packages like
- ;; compile.el, gud.el etc. Not necessary in Emacs 23.
- (eval-after-load "tramp"
- '(require 'tramp-util))
-
- ;; Make sure that we get integration with the VC package. When it
- ;; is loaded, we need to pull in the integration module. Not
- ;; necessary in Emacs 23.
- (eval-after-load "vc"
- (eval-after-load "tramp"
- '(require 'tramp-vc))))
-
;; Avoid byte-compiler warnings if the byte-compiler supports this.
;; Currently, XEmacs supports this.
(when (featurep 'xemacs)
;; mechanism.
;; `file-remote-p' has been introduced with Emacs 22. The version
- ;; of XEmacs is not a magic file name function (yet); this is
- ;; corrected in tramp-util.el. Here it is sufficient if the
- ;; function exists.
+ ;; of XEmacs is not a magic file name function (yet).
(unless (fboundp 'file-remote-p)
(defalias 'file-remote-p
(lambda (file &optional identification connected)
(wrong-number-of-arguments (file-attributes filename))))))
;; PRESERVE-UID-GID does not exist in XEmacs.
-;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24.1.
+;; PRESERVE-EXTENDED-ATTRIBUTES has been introduced with Emacs 24.1
+;; (as PRESERVE-SELINUX-CONTEXT), and renamed in Emacs 24.3.
(defun tramp-compat-copy-file
(filename newname &optional ok-if-already-exists keep-date
- preserve-uid-gid preserve-selinux-context)
+ preserve-uid-gid preserve-extended-attributes)
"Like `copy-file' for Tramp files (compat function)."
(cond
- (preserve-selinux-context
+ (preserve-extended-attributes
(tramp-compat-funcall
'copy-file filename newname ok-if-already-exists keep-date
- preserve-uid-gid preserve-selinux-context))
+ preserve-uid-gid preserve-extended-attributes))
(preserve-uid-gid
(tramp-compat-funcall
'copy-file filename newname ok-if-already-exists keep-date
(inhibit-file-name-operation operation))
(apply 'ange-ftp-hook-function operation args)))))))
+;; It must be a `defsubst' in order to push the whole code into
+;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading.
;;;###tramp-autoload
(defsubst tramp-ftp-file-name-p (filename)
"Check if it's a filename that should be forwarded to Ange-FTP."
(dired-uncache . tramp-handle-dired-uncache)
;; `executable-find' is not official yet. performed by default handler.
(expand-file-name . tramp-gvfs-handle-expand-file-name)
- ;; `file-accessible-directory-p' performed by default handler.
+ (file-accessible-directory-p . tramp-handle-file-accessible-directory-p)
+ (file-acl . tramp-gvfs-handle-file-acl)
(file-attributes . tramp-gvfs-handle-file-attributes)
(file-directory-p . tramp-gvfs-handle-file-directory-p)
(file-executable-p . tramp-gvfs-handle-file-executable-p)
(make-symbolic-link . ignore)
(process-file . tramp-gvfs-handle-process-file)
(rename-file . tramp-gvfs-handle-rename-file)
+ (set-file-acl . tramp-gvfs-handle-set-file-acl)
(set-file-modes . tramp-gvfs-handle-set-file-modes)
(set-file-selinux-context . tramp-gvfs-handle-set-file-selinux-context)
(set-visited-file-modtime . tramp-gvfs-handle-set-visited-file-modtime)
"Alist of handler functions for Tramp GVFS method.
Operations not mentioned here will be handled by the default Emacs primitives.")
+;; It must be a `defsubst' in order to push the whole code into
+;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading.
;;;###tramp-autoload
(defsubst tramp-gvfs-file-name-p (filename)
"Check if it's a filename handled by the GVFS daemon."
(tramp-message tramp-gvfs-dbus-event-vector 10 "%S" event)
(tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err))))
-(add-hook 'dbus-event-error-functions 'tramp-gvfs-dbus-event-error)
+;; `dbus-event-error-hooks' has been renamed to `dbus-event-error-functions'.
+(add-hook
+ (if (boundp 'dbus-event-error-functions)
+ 'dbus-event-error-functions 'dbus-event-error-hooks)
+ 'tramp-gvfs-dbus-event-error)
\f
;; File name primitives.
(defun tramp-gvfs-handle-copy-file
(filename newname &optional ok-if-already-exists keep-date
- preserve-uid-gid preserve-selinux-context)
+ preserve-uid-gid preserve-extended-attributes)
"Like `copy-file' for Tramp files."
(with-parsed-tramp-file-name
(if (tramp-tramp-file-p filename) filename newname) nil
(tramp-gvfs-fuse-file-name newname)
newname)
ok-if-already-exists keep-date preserve-uid-gid)))
- (when preserve-selinux-context
- (setq args (append args (list preserve-selinux-context))))
+ (when preserve-extended-attributes
+ (setq args (append args (list preserve-extended-attributes))))
(apply 'copy-file args))
;; Error case. Let's try it with the GVFS utilities.
(tramp-run-real-handler
'expand-file-name (list localname))))))
+(defun tramp-gvfs-handle-file-acl (filename)
+ "Like `file-acl' for Tramp files."
+ (tramp-compat-funcall 'file-acl (tramp-gvfs-fuse-file-name filename)))
+
(defun tramp-gvfs-handle-file-attributes (filename &optional id-format)
"Like `file-attributes' for Tramp files."
(file-attributes (tramp-gvfs-fuse-file-name filename) id-format))
(tramp-flush-file-property v (file-name-directory localname))
(tramp-flush-file-property v localname))))
+(defun tramp-gvfs-handle-set-file-acl (filename acl-string)
+ "Like `set-file-acl' for Tramp files."
+ (with-tramp-gvfs-error-message filename 'set-file-acl
+ (tramp-gvfs-fuse-file-name filename) acl-string))
+
(defun tramp-gvfs-handle-set-file-modes (filename mode)
"Like `set-file-modes' for Tramp files."
(with-tramp-gvfs-error-message filename 'set-file-modes
(file-name-nondirectory . tramp-handle-file-name-nondirectory)
(file-truename . tramp-sh-handle-file-truename)
(file-exists-p . tramp-sh-handle-file-exists-p)
+ (file-accessible-directory-p . tramp-handle-file-accessible-directory-p)
(file-directory-p . tramp-sh-handle-file-directory-p)
(file-executable-p . tramp-sh-handle-file-executable-p)
(file-readable-p . tramp-sh-handle-file-readable-p)
(verify-visited-file-modtime . tramp-sh-handle-verify-visited-file-modtime)
(file-selinux-context . tramp-sh-handle-file-selinux-context)
(set-file-selinux-context . tramp-sh-handle-set-file-selinux-context)
+ (file-acl . tramp-sh-handle-file-acl)
+ (set-file-acl . tramp-sh-handle-set-file-acl)
(vc-registered . tramp-sh-handle-vc-registered))
"Alist of handler functions.
Operations not mentioned here will be handled by the normal Emacs functions.")
(if (stringp (nth 3 context))
(format "--range=%s" (nth 3 context)) "")
(tramp-shell-quote-argument localname))))
- (tramp-set-file-property v localname "file-selinux-context" context)
- (tramp-set-file-property v localname "file-selinux-context" 'undef)))
- ;; We always return nil.
- nil)
+ (progn
+ (tramp-set-file-property v localname "file-selinux-context" context)
+ t)
+ (tramp-set-file-property v localname "file-selinux-context" 'undef)
+ nil)))
+
+(defun tramp-remote-acl-p (vec)
+ "Check, whether ACL is enabled on the remote host."
+ (with-tramp-connection-property (tramp-get-connection-process vec) "acl-p"
+ (tramp-send-command-and-check vec "getfacl /")))
+
+(defun tramp-sh-handle-file-acl (filename)
+ "Like `file-acl' for Tramp files."
+ (with-parsed-tramp-file-name filename nil
+ (with-tramp-file-property v localname "file-acl"
+ (when (and (tramp-remote-acl-p v)
+ (tramp-send-command-and-check
+ v (format
+ "getfacl -acs %s 2>/dev/null"
+ (tramp-shell-quote-argument localname))))
+ (with-current-buffer (tramp-get-connection-buffer v)
+ (goto-char (point-max))
+ (delete-blank-lines)
+ (when (> (point-max) (point-min))
+ (substring-no-properties (buffer-string))))))))
+
+(defun tramp-sh-handle-set-file-acl (filename acl-string)
+ "Like `set-file-acl' for Tramp files."
+ (with-parsed-tramp-file-name filename nil
+ (when (tramp-remote-acl-p v)
+ (condition-case nil
+ (when (stringp acl-string)
+ (tramp-set-file-property v localname "file-acl" acl-string)
+ (dolist (line (split-string acl-string nil t) t)
+ (unless (tramp-send-command-and-check
+ v (format
+ "setfacl -m %s %s"
+ line (tramp-shell-quote-argument localname)))
+ (error nil))))
+ ;; In case of errors, we return `nil'.
+ (error
+ (tramp-set-file-property v localname "file-acl" 'undef)
+ nil)))))
;; Simple functions using the `test' command.
(and (tramp-run-test "-d" (file-name-directory filename))
(tramp-run-test "-w" (file-name-directory filename)))))))
-(defun tramp-sh-handle-file-ownership-preserved-p (filename)
+(defun tramp-sh-handle-file-ownership-preserved-p (filename &optional group)
"Like `file-ownership-preserved-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property v localname "file-ownership-preserved-p"
;; Return t if the file doesn't exist, since it's true that no
;; information would be lost by an (attempted) delete and create.
(or (null attributes)
- (= (nth 2 attributes) (tramp-get-remote-uid v 'integer)))))))
+ (and
+ (= (nth 2 attributes) (tramp-get-remote-uid v 'integer))
+ (or (not group)
+ (= (nth 3 attributes) (tramp-get-remote-gid v 'integer)))))))))
;; Directory listings.
(defun tramp-sh-handle-copy-file
(filename newname &optional ok-if-already-exists keep-date
- preserve-uid-gid preserve-selinux-context)
+ preserve-uid-gid preserve-extended-attributes)
"Like `copy-file' for Tramp files."
(setq filename (expand-file-name filename))
(setq newname (expand-file-name newname))
(tramp-tramp-file-p newname))
(tramp-do-copy-or-rename-file
'copy filename newname ok-if-already-exists keep-date
- preserve-uid-gid preserve-selinux-context))
+ preserve-uid-gid preserve-extended-attributes))
;; Compat section.
- (preserve-selinux-context
+ (preserve-extended-attributes
(tramp-run-real-handler
'copy-file
(list filename newname ok-if-already-exists keep-date
- preserve-uid-gid preserve-selinux-context)))
+ preserve-uid-gid preserve-extended-attributes)))
(preserve-uid-gid
(tramp-run-real-handler
'copy-file
(defun tramp-do-copy-or-rename-file
(op filename newname &optional ok-if-already-exists keep-date
- preserve-uid-gid preserve-selinux-context)
+ preserve-uid-gid preserve-extended-attributes)
"Copy or rename a remote file.
OP must be `copy' or `rename' and indicates the operation to perform.
FILENAME specifies the file to copy or rename, NEWNAME is the name of
KEEP-DATE means to make sure that NEWNAME has the same timestamp
as FILENAME. PRESERVE-UID-GID, when non-nil, instructs to keep
the uid and gid if both files are on the same host.
-PRESERVE-SELINUX-CONTEXT activates selinux commands.
+PRESERVE-EXTENDED-ATTRIBUTES activates selinux and acl commands.
This function is invoked by `tramp-sh-handle-copy-file' and
`tramp-sh-handle-rename-file'. It is an error if OP is neither
(let ((t1 (tramp-tramp-file-p filename))
(t2 (tramp-tramp-file-p newname))
(length (nth 7 (file-attributes (file-truename filename))))
- (context (and preserve-selinux-context
- (apply 'file-selinux-context (list filename))))
+ (attributes (and preserve-extended-attributes
+ (apply 'file-extended-attributes (list filename))))
pr tm)
(with-parsed-tramp-file-name (if t1 filename newname) nil
;; One of them must be a Tramp file.
(error "Tramp implementation says this cannot happen")))
- ;; Handle `preserve-selinux-context'.
- (when context (apply 'set-file-selinux-context (list newname context)))
+ ;; Handle `preserve-extended-attributes'. We ignore possible
+ ;; errors, because ACL strings could be incompatible.
+ (when attributes
+ (ignore-errors
+ (apply 'set-file-extended-attributes (list newname attributes))))
;; In case of `rename', we must flush the cache of the source file.
(when (and t1 (eq op 'rename))
;; last longer than 60 secs.
(let ((p (let ((default-directory
(tramp-compat-temporary-file-directory)))
- (apply 'start-process
+ (apply 'start-process-shell-command
(tramp-get-connection-name v)
(tramp-get-connection-buffer v)
copy-program
- (append copy-args (list source target))))))
+ (append
+ copy-args
+ (list
+ (shell-quote-argument source)
+ (shell-quote-argument target)
+ "&&" "echo" "tramp_exit_status" "0"
+ "||" "echo" "tramp_exit_status" "1"))))))
(tramp-message
orig-vec 6 "%s"
(mapconcat 'identity (process-command p) " "))
(tramp-compat-set-process-query-on-exit-flag p nil)
(tramp-process-actions
- p v nil tramp-actions-copy-out-of-band)))
+ p v nil tramp-actions-copy-out-of-band)
+
+ ;; Check the return code.
+ (goto-char (point-max))
+ (unless
+ (re-search-backward "tramp_exit_status [0-9]+" nil t)
+ (tramp-error
+ orig-vec 'file-error
+ "Couldn't find exit status of `%s'" (process-command p)))
+ (skip-chars-forward "^ ")
+ (unless (zerop (read (current-buffer)))
+ (forward-line -1)
+ (tramp-error
+ orig-vec 'file-error
+ "Error copying: `%s'"
+ (buffer-substring (point-min) (point-at-eol))))))
;; Reset the transfer process properties.
(tramp-message orig-vec 6 "\n%s" (buffer-string))
(keyboard-quit)
ret))))
-(defun tramp-sh-handle-call-process-region
- (start end program &optional delete buffer display &rest args)
- "Like `call-process-region' for Tramp files."
- (let ((tmpfile (tramp-compat-make-temp-file "")))
- (write-region start end tmpfile)
- (when delete (delete-region start end))
- (unwind-protect
- (apply 'call-process program tmpfile buffer display args)
- (delete-file tmpfile))))
-
(defun tramp-sh-handle-file-local-copy (filename)
"Like `file-local-copy' for Tramp files."
(with-parsed-tramp-file-name filename nil
(if (equal id-format 'integer) (user-uid) (user-login-name)))
(defun tramp-get-local-gid (id-format)
- (nth 3 (tramp-compat-file-attributes "~/" id-format)))
+ (if (and (fboundp 'group-gid) (equal id-format 'integer))
+ (tramp-compat-funcall 'group-gid)
+ (nth 3 (tramp-compat-file-attributes "~/" id-format))))
;; Some predefined connection properties.
(defun tramp-get-inline-compress (vec prop size)
(t
(format "%s <%%s" coding)))))))
-;;; Integration of eshell.el:
-
-(eval-when-compile
- (defvar eshell-path-env))
-
-;; eshell.el keeps the path in `eshell-path-env'. We must change it
-;; when `default-directory' points to another host.
-(defun tramp-eshell-directory-change ()
- "Set `eshell-path-env' to $PATH of the host related to `default-directory'."
- (setq eshell-path-env
- (if (file-remote-p default-directory)
- (with-parsed-tramp-file-name default-directory nil
- (mapconcat
- 'identity
- (tramp-get-remote-path v)
- ":"))
- (getenv "PATH"))))
-
-(eval-after-load "esh-util"
- '(progn
- (tramp-eshell-directory-change)
- (add-hook 'eshell-directory-change-hook
- 'tramp-eshell-directory-change)
- (add-hook 'tramp-unload-hook
- (lambda ()
- (remove-hook 'eshell-directory-change-hook
- 'tramp-eshell-directory-change)))))
-
(add-hook 'tramp-unload-hook
(lambda ()
(unload-feature 'tramp-sh 'force)))
(dired-uncache . tramp-handle-dired-uncache)
(expand-file-name . tramp-smb-handle-expand-file-name)
(file-accessible-directory-p . tramp-smb-handle-file-directory-p)
+ (file-acl . tramp-smb-handle-file-acl)
(file-attributes . tramp-smb-handle-file-attributes)
(file-directory-p . tramp-smb-handle-file-directory-p)
(file-executable-p . tramp-handle-file-exists-p)
(make-symbolic-link . tramp-smb-handle-make-symbolic-link)
(process-file . tramp-smb-handle-process-file)
(rename-file . tramp-smb-handle-rename-file)
+ (set-file-acl . ignore)
(set-file-modes . tramp-smb-handle-set-file-modes)
- ;; `set-file-selinux-context' performed by default handler.
+ (set-file-selinux-context . ignore)
(set-file-times . ignore)
(set-visited-file-modtime . ignore)
(shell-command . tramp-handle-shell-command)
:type 'string
:version "24.3")
+;; It must be a `defsubst' in order to push the whole code into
+;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading.
;;;###tramp-autoload
(defsubst tramp-smb-file-name-p (filename)
"Check if it's a filename for SMB servers."
(defun tramp-smb-handle-copy-file
(filename newname &optional ok-if-already-exists keep-date
- preserve-uid-gid preserve-selinux-context)
+ preserve-uid-gid preserve-extended-attributes)
"Like `copy-file' for Tramp files.
KEEP-DATE has no effect in case NEWNAME resides on an SMB server.
-PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
+PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq filename (expand-file-name filename)
newname (expand-file-name newname))
(with-tramp-progress-reporter
method user host
(tramp-run-real-handler 'expand-file-name (list localname))))))
+(defun tramp-smb-handle-file-acl (filename)
+ "Like `file-acl' for Tramp files."
+ (with-parsed-tramp-file-name filename nil
+ (with-tramp-file-property v localname "file-acl"
+ (when (tramp-smb-send-command
+ v (format "getfacl \"%s\"" (tramp-smb-get-localname v)))
+ (with-current-buffer (tramp-get-connection-buffer v)
+ (goto-char (point-min))
+ (while (looking-at-p "^#")
+ (forward-line)
+ (delete-region (point-min) (point)))
+ (goto-char (point-max))
+ (delete-blank-lines)
+ (when (> (point-max) (point-min))
+ (substring-no-properties (buffer-string))))))))
+
(defun tramp-smb-handle-file-attributes (filename &optional id-format)
"Like `file-attributes' for Tramp files."
(unless id-format (setq id-format 'integer))
:group 'tramp
:type 'string)
+;;;###tramp-autoload
+(defcustom tramp-default-host-alist nil
+ "Default host to use for specific method/user pairs.
+This is an alist of items (METHOD USER HOST). The first matching item
+specifies the host to use for a file name which does not specify a
+host. METHOD and HOST are regular expressions or nil, which is
+interpreted as a regular expression which always matches. If no entry
+matches, the variable `tramp-default-host' takes effect.
+
+If the file name does not specify the method, lookup is done using the
+empty string for the method name."
+ :group 'tramp
+ :version "24.4"
+ :type '(repeat (list (choice :tag "Method regexp" regexp sexp)
+ (choice :tag " User regexp" regexp sexp)
+ (choice :tag " Host name" string (const nil)))))
+
(defcustom tramp-default-proxies-alist nil
"Route to be followed for specific host/user pairs.
This is an alist of items (HOST USER PROXY). The first matching
This regexp should match partial Tramp file names only.
Please note that the entry in `file-name-handler-alist' is made when
-this file (tramp.el) is loaded. This means that this variable must be set
+this file \(tramp.el\) is loaded. This means that this variable must be set
before loading tramp.el. Alternatively, `file-name-handler-alist' can be
updated after changing this variable.
"Return the right host string to use.
This is HOST, if non-nil. Otherwise, it is `tramp-default-host'."
(or (and (> (length host) 0) host)
+ (let ((choices tramp-default-host-alist)
+ lhost item)
+ (while choices
+ (setq item (pop choices))
+ (when (and (string-match (or (nth 0 item) "") (or method ""))
+ (string-match (or (nth 1 item) "") (or user "")))
+ (setq lhost (nth 2 item))
+ (setq choices nil)))
+ lhost)
tramp-default-host))
(defun tramp-dissect-file-name (name &optional nodefault)
(or (and (bufferp buffer) buffer)
(and (processp vec-or-proc) (process-buffer vec-or-proc))
(tramp-get-connection-buffer vec-or-proc)))
+ (when (string-equal fmt-string "Process died")
+ (message
+ "%s\n %s"
+ "Tramp failed to connect. If this happens repeatedly, try"
+ "`M-x tramp-cleanup-this-connection'"))
(sit-for 30))))))
(defmacro with-parsed-tramp-file-name (filename var &rest body)
(or (file-modes filename)
(logand (default-file-modes) (tramp-compat-octal-to-decimal "0666"))))
-(defun tramp-replace-environment-variables (filename)
- "Replace environment variables in FILENAME.
+(defalias 'tramp-replace-environment-variables
+ (if (ignore-errors
+ (equal "${ tramp?}"
+ (tramp-compat-funcall
+ 'substitute-env-vars "${ tramp?}" 'only-defined)))
+ (lambda (filename)
+ "Like `substitute-env-vars' with `only-defined' non-nil."
+ (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
+ (lambda (filename)
+ "Replace environment variables in FILENAME.
Return the string with the replaced variables."
- (save-match-data
- (let ((idx (string-match "$\\(\\w+\\)" filename)))
- ;; `$' is coded as `$$'.
- (when (and idx
- (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
- (getenv (match-string 1 filename)))
- (setq filename
- (replace-match
- (substitute-in-file-name (match-string 0 filename))
- t nil filename)))
- filename)))
+ (save-match-data
+ (let ((idx (string-match "$\\(\\w+\\)" filename)))
+ ;; `$' is coded as `$$'.
+ (when (and idx
+ (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
+ (getenv (match-string 1 filename)))
+ (setq filename
+ (replace-match
+ (substitute-in-file-name (match-string 0 filename))
+ t nil filename)))
+ filename)))))
;; In XEmacs, electricity is implemented via a key map for ?/ and ?~,
;; which calls corresponding functions (see minibuf.el).
;; Emacs 22+ only.
'set-file-times
;; Emacs 24+ only.
- 'file-selinux-context 'set-file-selinux-context
+ 'file-acl 'file-selinux-context
+ 'set-file-acl 'set-file-selinux-context
;; XEmacs only.
'abbreviate-file-name 'create-file-buffer
'dired-file-modtime 'dired-make-compressed-filename
;; Emacs 23+ only.
'start-file-process
;; XEmacs only.
- 'dired-print-file 'dired-shell-call-process
- ;; nowhere yet.
- 'executable-find 'start-process
- 'call-process 'call-process-region))
+ 'dired-print-file 'dired-shell-call-process))
default-directory)
;; Unknown file primitive.
(t (error "unknown file I/O primitive: %s" operation))))
(if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil
(tramp-flush-directory-property v localname)))
+(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)))
+
(defun tramp-handle-file-exists-p (filename)
"Like `file-exists-p' for Tramp files."
(not (null (file-attributes filename))))
t t result)))
result))))
+;;; Integration of eshell.el:
+
+(eval-when-compile
+ (defvar eshell-path-env))
+
+;; eshell.el keeps the path in `eshell-path-env'. We must change it
+;; when `default-directory' points to another host.
+(defun tramp-eshell-directory-change ()
+ "Set `eshell-path-env' to $PATH of the host related to `default-directory'."
+ (setq eshell-path-env
+ (if (file-remote-p default-directory)
+ (with-parsed-tramp-file-name default-directory nil
+ (mapconcat
+ 'identity
+ (tramp-get-connection-property v "remote-path" nil)
+ ":"))
+ (getenv "PATH"))))
+
+(eval-after-load "esh-util"
+ '(progn
+ (tramp-eshell-directory-change)
+ (add-hook 'eshell-directory-change-hook
+ 'tramp-eshell-directory-change)
+ (add-hook 'tramp-unload-hook
+ (lambda ()
+ (remove-hook 'eshell-directory-change-hook
+ 'tramp-eshell-directory-change)))))
+
;; Checklist for `tramp-unload-hook'
;; - Unload all `tramp-*' packages
;; - Reset `file-name-handler-alist'
;; should be changed only there.
;;;###tramp-autoload
-(defconst tramp-version "2.2.6-24.3"
+(defconst tramp-version "2.2.7-pre"
"This version of Tramp.")
;;;###tramp-autoload
(= emacs-major-version 21)
(>= emacs-minor-version 4)))
"ok"
- (format "Tramp 2.2.6-24.3 is not fit for %s"
+ (format "Tramp 2.2.7-pre is not fit for %s"
(when (string-match "^.*$" (emacs-version))
(match-string 0 (emacs-version)))))))
(unless (string-match "\\`ok\\'" x) (error "%s" x)))
(defconst notifications-get-capabilities-method "GetCapabilities"
"D-Bus notifications get capabilities method.")
+(defconst notifications-get-server-information-method "GetServerInformation"
+ "D-Bus notifications get server information method.")
+
(defconst notifications-action-signal "ActionInvoked"
"D-Bus notifications action signal.")
used to manipulate the notification item with
`notifications-close-notification' or the `:replaces-id' argument
of another `notifications-notify' call."
- (let ((bus (or (plist-get params :bus) :session))
- (title (plist-get params :title))
- (body (plist-get params :body))
- (app-name (plist-get params :app-name))
- (replaces-id (plist-get params :replaces-id))
- (app-icon (plist-get params :app-icon))
- (actions (plist-get params :actions))
- (timeout (plist-get params :timeout))
- ;; Hints
- (hints '())
- (urgency (plist-get params :urgency))
- (category (plist-get params :category))
- (desktop-entry (plist-get params :desktop-entry))
- (image-data (plist-get params :image-data))
- (image-path (plist-get params :image-path))
- (action-items (plist-get params :action-items))
- (sound-file (plist-get params :sound-file))
- (sound-name (plist-get params :sound-name))
- (suppress-sound (plist-get params :suppress-sound))
- (resident (plist-get params :resident))
- (transient (plist-get params :transient))
- (x (plist-get params :x))
- (y (plist-get params :y))
- id)
- ;; Build hints array
- (when urgency
- (add-to-list 'hints `(:dict-entry
- "urgency"
- (:variant :byte ,(pcase urgency
- (`low 0)
- (`critical 2)
- (_ 1)))) t))
- (when category
- (add-to-list 'hints `(:dict-entry
- "category"
- (:variant :string ,category)) t))
- (when desktop-entry
- (add-to-list 'hints `(:dict-entry
- "desktop-entry"
- (:variant :string ,desktop-entry)) t))
- (when image-data
- (add-to-list 'hints `(:dict-entry
- "image-data"
- (:variant :struct ,image-data)) t))
- (when image-path
- (add-to-list 'hints `(:dict-entry
- "image-path"
- (:variant :string ,image-path)) t))
- (when action-items
- (add-to-list 'hints `(:dict-entry
- "action-items"
- (:variant :boolean ,action-items)) t))
- (when sound-file
- (add-to-list 'hints `(:dict-entry
- "sound-file"
- (:variant :string ,sound-file)) t))
- (when sound-name
- (add-to-list 'hints `(:dict-entry
- "sound-name"
- (:variant :string ,sound-name)) t))
- (when suppress-sound
- (add-to-list 'hints `(:dict-entry
- "suppress-sound"
- (:variant :boolean ,suppress-sound)) t))
- (when resident
- (add-to-list 'hints `(:dict-entry
- "resident"
- (:variant :boolean ,resident)) t))
- (when transient
- (add-to-list 'hints `(:dict-entry
- "transient"
- (:variant :boolean ,transient)) t))
- (when x
- (add-to-list 'hints `(:dict-entry "x" (:variant :int32 ,x)) t))
- (when y
- (add-to-list 'hints `(:dict-entry "y" (:variant :int32 ,y)) t))
-
- ;; Call Notify method.
- (setq id
- (dbus-call-method bus
- notifications-service
- notifications-path
- notifications-interface
- notifications-notify-method
- :string (or app-name
- notifications-application-name)
- :uint32 (or replaces-id 0)
- :string (if app-icon
- (expand-file-name app-icon)
- ;; If app-icon is nil because user
- ;; requested it to be so, send the
- ;; empty string
- (if (plist-member params :app-icon)
- ""
- ;; Otherwise send the default icon path
- notifications-application-icon))
- :string (or title "")
- :string (or body "")
- `(:array ,@actions)
- (or hints '(:array :signature "{sv}"))
- :int32 (or timeout -1)))
-
- ;; Register close/action callback function. We must also remember
- ;; the daemon's unique name, because the daemon could have
- ;; restarted.
- (let ((on-action (plist-get params :on-action))
- (on-close (plist-get params :on-close))
- (unique-name (dbus-get-name-owner bus notifications-service)))
- (when on-action
- (add-to-list 'notifications-on-action-map
- (list (list bus unique-name id) on-action))
- (unless notifications-on-action-object
- (setq notifications-on-action-object
- (dbus-register-signal
- bus
- nil
- notifications-path
- notifications-interface
- notifications-action-signal
- 'notifications-on-action-signal))))
-
- (when on-close
- (add-to-list 'notifications-on-close-map
- (list (list bus unique-name id) on-close))
- (unless notifications-on-close-object
- (setq notifications-on-close-object
- (dbus-register-signal
- bus
- nil
- notifications-path
- notifications-interface
- notifications-closed-signal
- 'notifications-on-closed-signal)))))
-
- ;; Return notification id
- id))
+ (with-demoted-errors
+ (let ((bus (or (plist-get params :bus) :session))
+ (title (plist-get params :title))
+ (body (plist-get params :body))
+ (app-name (plist-get params :app-name))
+ (replaces-id (plist-get params :replaces-id))
+ (app-icon (plist-get params :app-icon))
+ (actions (plist-get params :actions))
+ (timeout (plist-get params :timeout))
+ ;; Hints
+ (hints '())
+ (urgency (plist-get params :urgency))
+ (category (plist-get params :category))
+ (desktop-entry (plist-get params :desktop-entry))
+ (image-data (plist-get params :image-data))
+ (image-path (plist-get params :image-path))
+ (action-items (plist-get params :action-items))
+ (sound-file (plist-get params :sound-file))
+ (sound-name (plist-get params :sound-name))
+ (suppress-sound (plist-get params :suppress-sound))
+ (resident (plist-get params :resident))
+ (transient (plist-get params :transient))
+ (x (plist-get params :x))
+ (y (plist-get params :y))
+ id)
+ ;; Build hints array
+ (when urgency
+ (add-to-list 'hints `(:dict-entry
+ "urgency"
+ (:variant :byte ,(pcase urgency
+ (`low 0)
+ (`critical 2)
+ (_ 1)))) t))
+ (when category
+ (add-to-list 'hints `(:dict-entry
+ "category"
+ (:variant :string ,category)) t))
+ (when desktop-entry
+ (add-to-list 'hints `(:dict-entry
+ "desktop-entry"
+ (:variant :string ,desktop-entry)) t))
+ (when image-data
+ (add-to-list 'hints `(:dict-entry
+ "image-data"
+ (:variant :struct ,image-data)) t))
+ (when image-path
+ (add-to-list 'hints `(:dict-entry
+ "image-path"
+ (:variant :string ,image-path)) t))
+ (when action-items
+ (add-to-list 'hints `(:dict-entry
+ "action-items"
+ (:variant :boolean ,action-items)) t))
+ (when sound-file
+ (add-to-list 'hints `(:dict-entry
+ "sound-file"
+ (:variant :string ,sound-file)) t))
+ (when sound-name
+ (add-to-list 'hints `(:dict-entry
+ "sound-name"
+ (:variant :string ,sound-name)) t))
+ (when suppress-sound
+ (add-to-list 'hints `(:dict-entry
+ "suppress-sound"
+ (:variant :boolean ,suppress-sound)) t))
+ (when resident
+ (add-to-list 'hints `(:dict-entry
+ "resident"
+ (:variant :boolean ,resident)) t))
+ (when transient
+ (add-to-list 'hints `(:dict-entry
+ "transient"
+ (:variant :boolean ,transient)) t))
+ (when x
+ (add-to-list 'hints `(:dict-entry "x" (:variant :int32 ,x)) t))
+ (when y
+ (add-to-list 'hints `(:dict-entry "y" (:variant :int32 ,y)) t))
+
+ ;; Call Notify method.
+ (setq id
+ (dbus-call-method bus
+ notifications-service
+ notifications-path
+ notifications-interface
+ notifications-notify-method
+ :string (or app-name
+ notifications-application-name)
+ :uint32 (or replaces-id 0)
+ :string (if app-icon
+ (expand-file-name app-icon)
+ ;; If app-icon is nil because user
+ ;; requested it to be so, send the
+ ;; empty string
+ (if (plist-member params :app-icon)
+ ""
+ ;; Otherwise send the
+ ;; default icon path
+ notifications-application-icon))
+ :string (or title "")
+ :string (or body "")
+ `(:array ,@actions)
+ (or hints '(:array :signature "{sv}"))
+ :int32 (or timeout -1)))
+
+ ;; Register close/action callback function. We must also
+ ;; remember the daemon's unique name, because the daemon could
+ ;; have restarted.
+ (let ((on-action (plist-get params :on-action))
+ (on-close (plist-get params :on-close))
+ (unique-name (dbus-get-name-owner bus notifications-service)))
+ (when on-action
+ (add-to-list 'notifications-on-action-map
+ (list (list bus unique-name id) on-action))
+ (unless notifications-on-action-object
+ (setq notifications-on-action-object
+ (dbus-register-signal
+ bus
+ nil
+ notifications-path
+ notifications-interface
+ notifications-action-signal
+ 'notifications-on-action-signal))))
+
+ (when on-close
+ (add-to-list 'notifications-on-close-map
+ (list (list bus unique-name id) on-close))
+ (unless notifications-on-close-object
+ (setq notifications-on-close-object
+ (dbus-register-signal
+ bus
+ nil
+ notifications-path
+ notifications-interface
+ notifications-closed-signal
+ 'notifications-on-closed-signal)))))
+
+ ;; Return notification id
+ id)))
(defun notifications-close-notification (id &optional bus)
"Close a notification with identifier ID.
(defvar dbus-debug) ; used in the macroexpansion of dbus-ignore-errors
(defun notifications-get-capabilities (&optional bus)
- "Return the capabilities of the notification server, a list of strings.
+ "Return the capabilities of the notification server, a list of symbols.
BUS can be a string denoting a D-Bus connection, the default is `:session'.
The following capabilities can be expected:
Further vendor-specific caps start with `:x-vendor', like `:x-gnome-foo-cap'."
(dbus-ignore-errors
- (mapcar
- (lambda (x) (intern (concat ":" x)))
+ (mapcar
+ (lambda (x) (intern (concat ":" x)))
+ (dbus-call-method (or bus :session)
+ notifications-service
+ notifications-path
+ notifications-interface
+ notifications-get-capabilities-method))))
+
+(defun notifications-get-server-information (&optional bus)
+ "Return information on the notification server, a list of strings.
+BUS can be a string denoting a D-Bus connection, the default is `:session'.
+The returned list is (NAME VENDOR VERSION SPEC-VERSION).
+
+ NAME The product name of the server.
+ VENDOR The vendor name. For example, \"KDE\", \"GNOME\".
+ VERSION The server's version number.
+ SPEC-VERSION The specification version the server is compliant with.
+
+If SPEC_VERSION is missing, the server supports a specification
+prior to \"1.0\".
+
+See `notifications-specification-version' for the specification
+version this library is compliant with."
+ (dbus-ignore-errors
(dbus-call-method (or bus :session)
notifications-service
notifications-path
notifications-interface
- notifications-get-capabilities-method))))
+ notifications-get-server-information-method)))
(provide 'notifications)
(unless keys (setq keys (this-command-keys)))
(let (char)
(save-window-excursion
- (help-setup-xref (list 'disabled-command-function cmd keys) nil)
(with-output-to-temp-buffer "*Disabled Command*" ;; (help-buffer)
(if (or (eq (aref keys 0)
(if (stringp keys)
;; Alex Schroeder <alex@gnu.org>
;; Chong Yidong <cyd@stupidchicken.com>
;; Maintainer: Chong Yidong <cyd@stupidchicken.com>
+;; Obsolete-since: 24.4
;; Keywords: convenience, wp
;; This file is part of GNU Emacs.
If wrapping is performed, point remains on the line. If the line does
not need to be wrapped, move point to the next line and return t."
(if (longlines-set-breakpoint)
- (progn (insert-before-markers ?\n)
+ (progn (insert-before-markers-and-inherit ?\n)
(backward-char 1)
(delete-char -1)
(forward-char 1)
(mod (buffer-modified-p)))
(goto-char (min beg end))
(while (search-forward "\n" reg-max t)
- (unless (get-text-property (match-beginning 0) 'hard)
- (replace-match " ")))
+ (let ((pos (match-beginning 0)))
+ (unless (get-text-property pos 'hard)
+ (goto-char (1+ pos))
+ (insert-and-inherit " ")
+ (delete-region pos (1+ pos))
+ (remove-text-properties pos (1+ pos) 'hard))))
(set-buffer-modified-p mod)
end)))
;; Author: Richard Mlynarik <mly@eddie.mit.edu>
;; Maintainer: FSF
+;; Obsolete-since: 24.4
;; Keywords: comm, terminals
;; This file is part of GNU Emacs.
;;; Commentary:
-;;; This file has been censored by the Communications Decency Act.
-;;; That law was passed under the guise of a ban on pornography, but
-;;; it bans far more than that. This file did not contain pornography,
-;;; but it was censored nonetheless.
+;; This file has been censored by the Communications Decency Act.
+;; That law was passed under the guise of a ban on pornography, but
+;; it bans far more than that. This file did not contain pornography,
+;; but it was censored nonetheless.
-;;; For information on US government censorship of the Internet, and
-;;; what you can do to bring back freedom of the press, see the web
-;;; site http://www.vtw.org/
+;; For information on US government censorship of the Internet, and
+;; what you can do to bring back freedom of the press, see the web
+;; site http://www.vtw.org/
;;; Code:
-2013-01-08 Achim Gratz <Stromeko@Stromeko.de>
+2013-01-09 Achim Gratz <Stromeko@Stromeko.de>
* org-compat.el (org-define-obsolete-function-alias)
(org-define-obsolete-variable-alias): Introduce new compatibility
macros to obsolete functions and variables.
- * org-agenda.el, org-clock.el, org-id.el, org-lparse.el,
- org-protocol.el org.el: Use
- `org-define-obsolete-{function,variable}-alias' instead of
- `define-obsolate{function,variable}-alias'.
+ * org-agenda.el, org-clock.el, org-id.el, org-lparse.el:
+ * org-protocol.el, org.el:
+ Use `org-define-obsolete-{function,variable}-alias' instead
+ of `define-obsolate{function,variable}-alias'.
* org-faces.el: Define face alias mode-line for XEmacs (it's
called modeline there).
byte-compiling.
* org.el (org-get-location, org-switch-to-buffer-other-window):
- Use the wrapper `org-no-popups´ to let-bind the correct variables
+ Use the wrapper `org-no-popups' to let-bind the correct variables
for suppression of popup windows.
- * org-compat.el (user-error): Defalias to `error´ for Emacsen that
+ * org-compat.el (user-error): Defalias to `error' for Emacsen that
don't have it.
* org-agenda.el (org-agenda-write): Use org-called-interactively-p
instead of called-interactively-p.
* org.el (org-find-invisible-foreground): Do not use the value of
- variables `default-frame-alist´, `initial-frame-alist´ and
- `window-system-default-frame-alist´ when their symbol is not
- bound.
+ variables `default-frame-alist', `initial-frame-alist' and
+ `window-system-default-frame-alist' when their symbol is not bound.
-2013-01-08 Bastien Guerry <bzg@gnu.org>
+2013-01-09 Bastien Guerry <bzg@gnu.org>
* org-src.el (org-edit-src-code): Fix bug when trying to edit a
table.el table.
whole function.
* org.el (org-entry-get): Speed up by let-binding some variables
- only if needed. Also fix a bug: consider an empty drawer as no
- drawer.
+ only if needed. Also fix a bug: consider an empty drawer as no drawer.
* org-agenda.el (org-search-view, org-agenda-get-todos)
(org-agenda-get-timestamps, org-agenda-get-sexps)
* org-clock.el (org-clock-in): Use the renamed defun.
- * org-icalendar.el (org-icalendar-print-entries): Refresh the
- 'org-appt-warntime property.
+ * org-icalendar.el (org-icalendar-print-entries):
+ Refresh the 'org-appt-warntime property.
(org-icalendar-print-entries):
* org-agenda.el (org-agenda-get-timestamps)
(org-agenda-get-sexps, org-agenda-get-deadlines)
* org-agenda.el (org-agenda-format-item): Do not use
`org-get-effort' to get the effort text property.
- (org-agenda-get-sexps): Use `org-back-to-heading' when setting the
- tags.
+ (org-agenda-get-sexps): Use `org-back-to-heading' when setting tags.
* org-clock.el (org-clock-in): Refresh effort properties.
* org.el (org-refresh-effort-properties): New defun.
(org-get-effort): Delete.
(org-set-effort):
- (org-property-next-allowed-value): Set the 'org-effort text
- property.
+ (org-property-next-allowed-value): Set the 'org-effort text property.
(org-agenda-prepare-buffers): Refresh effort properties.
* org.el (org-read-date): Let-bind `mouse-autoselect-window' to
- nil so that the mouse doesn't jump when the option is set to t
- globally.
+ nil so that the mouse doesn't jump when the option is set to t globally.
* org-agenda.el (org-agenda-dim-blocked-tasks): Default to nil.
(org-agenda-dim-blocked-tasks): Make interactive and allow an
optional parameter 'invisible to hide blocked tasks instead of
just dimming them.
- (org-agenda-mode-map): Bind `org-agenda-dim-blocked-tasks' to
- "#".
+ (org-agenda-mode-map): Bind `org-agenda-dim-blocked-tasks' to "#".
* org-agenda.el (org-agenda-finalize): Don't try to align tags
when there are no tags. Only try to draw the habit consistency
* org.el (org-get-priority): Save match data even when using
`org-get-priority-function'.
- * org-mobile.el (org-mobile-create-index-file): Possibly normalize
- `org-todo-keywords'.
+ * org-mobile.el (org-mobile-create-index-file):
+ Possibly normalize `org-todo-keywords'.
- * org-mobile.el (org-mobile-push): Use the correct agenda buffer
- names.
+ * org-mobile.el (org-mobile-push): Use the correct agenda buffer names.
* org.el (org-store-link): Use `org-id-link-to-org-use-id' instead
of the obsolete variable name.
- * org.el (org-fontify-meta-lines-and-blocks-1): Fix bug when
- fontifying keywords with no value.
+ * org.el (org-fontify-meta-lines-and-blocks-1):
+ Fix bug when fontifying keywords with no value.
* org.el (org-goto-auto-isearch): Enhance docstring.
(org-goto-map): Make a defun, so that the customized value of
* org-exp.el (org-export-as-org): Remove useless argument.
* org-docbook.el (org-export-as-docbook-batch)
- (org-export-region-as-docbook, org-export-as-docbook-pdf): Fix
- the number of arguments.
+ (org-export-region-as-docbook, org-export-as-docbook-pdf):
+ Fix the number of arguments.
(org-export-as-docbook): Remove useless argument.
* org.el (org-speed-commands-default): Use ":" instead of ";" for
* org-latex.el (org-export-as-latex): Fix typo in docstring.
- * org-list.el (org-cycle-include-plain-lists): Docstring
- enhancement.
+ * org-list.el (org-cycle-include-plain-lists): Docstring enhancement.
* org.el (org-fontify-meta-lines-and-blocks-1): Fix fontification
bug when fontifying a keyword with no associated value.
* org.el (org-offer-links-in-entry): Do not open the link directly
through `org-open-link-from-string', only offer to select a link
- and return a cons with the link (as a string) and the end of
- entry.
+ and return a cons with the link (as a string) and the end of entry.
(org-open-at-point): Use `org-offer-links-in-entry' correctly.
- * org.el (org-cycle-internal-local): Fix bug: allow headings with
- leading blank characters.
+ * org.el (org-cycle-internal-local):
+ Fix bug: allow headings with leading blank characters.
- * org-clock.el (org-clock-persist): Docstring fix: document the
- 'history value.
+ * org-clock.el (org-clock-persist):
+ Docstring fix: document the 'history value.
* org.el (org-insert-link): Fix bug when inserting links to
headlines containing the ">" character.
for Emacs 22, where `delete-directory' does not support recursive
deletion.
- * org-odt.el (org-odt-cleanup-xml-buffers): Use the new
- compatibility function.
+ * org-odt.el (org-odt-cleanup-xml-buffers):
+ Use the new compatibility function.
* org.el (org-table-map-tables): Fix allowed blocks.
(org-edit-special): Fix bug about editing special blocks
"example" and "verbatim".
- * org.el (org-delete-backward-char, org-delete-char): Save match
- data, `delete-backward-char' and `delete-char' don't.
+ * org.el (org-delete-backward-char, org-delete-char):
+ Save match data, `delete-backward-char' and `delete-char' don't.
* org.el (org-enable-table-editor, org-insert-heading)
(org-remove-timestamp-with-keyword, org-self-insert-command):
(orgtbl-self-insert-command):
* org-latex.el (org-export-latex-subcontent):
* org-clock.el (org-clocktable-write-default):
- * org-ascii.el (org-export-ascii-preprocess): Use
- `delete-backward-char' instead of `backward-delete-char'.
+ * org-ascii.el (org-export-ascii-preprocess):
+ Use `delete-backward-char' instead of `backward-delete-char'.
* org.el (org-todo): Ignore the comment string when changing the
TODO state of a headline.
(org-export-as-html-and-open, org-export-as-html-batch)
(org-export-region-as-html): Don't use obsolete arg.
- * org-ascii.el (org-export-as-ascii): Delete obsolete arg
- `hidden'.
+ * org-ascii.el (org-export-as-ascii): Delete obsolete arg `hidden'.
(org-export-as-ascii-to-buffer): Don't use obsolete arg.
* org.el (org-in-fixed-width-region-p): Save match data.
* org-agenda.el (org-agenda-skip): Only check if point is
inside a code block, not at a code block.
- * org.el (org-in-fixed-width-region-p): Rewrite using
- org-element.el.
+ * org.el (org-in-fixed-width-region-p):
+ Rewrite using org-element.el.
- * org.el (org-fill-paragraph): Fill correctly in source code
- block.
+ * org.el (org-fill-paragraph): Fill correctly in source code block.
* org.el (org-in-fixed-width-region-p): New function.
(org-edit-special): Fix bug: make sure to DTRT in every
* org-src.el (org-edit-src-code): Fix bug triggered by the sexp
(copy-marker nil) on Emacs <24.1.
-2013-01-08 Dmitry Antipov <dmantipov@yandex.ru>
+2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
* org-agenda.el (org-agenda-get-restriction-and-command):
* org-capture.el (org-capture-place-template):
* org-table.el (org-table-convert-region):
* org.el (org-update-statistics-cookies): Use `point-marker'.
-2013-01-08 Eric Schulte <eric.schulte@gmx.com>
+2013-01-09 Eric Schulte <eric.schulte@gmx.com>
* org-exp.el (org-export-string): Pass the dir option on through
to any subsequent export functions.
-2013-01-08 Henning Weiss <hdweiss@gmail.com> (tiny change)
+2013-01-09 Henning Weiss <hdweiss@gmail.com> (tiny change)
* org-mobile.el (org-mobile-sumo-agenda-command): Remove match
description from block agendas when they have a title.
-2013-01-08 Jambunathan K <kjambunathan@gmail.com>
+2013-01-09 Jambunathan K <kjambunathan@gmail.com>
* org-odt.el (org-export-as-odt-batch): Init `org-odt-zip-dir'.
Fix Emacs Bug#13254.
* org-odt.el (org-odt-format-org-link): Add check for presence of
description in headline links.
-2013-01-08 Michael Albinus <michael.albinus@gmx.de>
-
- * ob.el (org-babel-temp-file): Fix setting of
- `temporary-file-directory' on remote hosts.
-
- * ob-eval.el (org-babel-shell-command-on-region): Use
- `process-file' instead of `call-process-region'. The latter one
- does not work on remote hosts.
-
-2013-01-08 Michael Gauland <mike_gauland@stanfordalumni.org> (tiny change)
+2013-01-09 Michael Gauland <mike_gauland@stanfordalumni.org> (tiny change)
* org-src.el: Create a marker to pass to copy-marker.
-2013-01-08 Nicolas Goaziou <n.goaziou@gmail.com>
+2013-01-09 Nicolas Goaziou <n.goaziou@gmail.com>
* org.el (org-setup-filling): Set `auto-fill-inhibit-regexp' to
nil because `org-adaptive-fill-function' already determines which
* org.el (org-fill-paragraph): Small refactoring.
* org-element.el (org-element--parse-elements)
- (org-element-at-point): Fix parsing of a list in a block in a
- list.
+ (org-element-at-point): Fix parsing of a list in a block in a list.
+
+2013-01-09 Sebastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
+
+ * org.el (org-copy-subtree, org-paste-subtree):
+ Fix whitespace handling when copying/pasting a subtree.
-2013-01-08 Sebastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
+2012-12-20 Michael Albinus <michael.albinus@gmx.de>
+
+ * ob.el (org-babel-temp-file): Fix setting of
+ `temporary-file-directory' on remote hosts.
- * org.el (org-copy-subtree, org-paste-subtree): Fix whitespace
- handling when copying/pasting a subtree.
+ * ob-eval.el (org-babel-shell-command-on-region): Use
+ `process-file' instead of `call-process-region'. The latter one
+ does not work on remote hosts.
-2012-12-12 Bastien Guerry <bzg@gnu.org>
+2012-12-13 Bastien Guerry <bzg@gnu.org>
* org-latex.el (org-export-latex-links): Escape raw path when
exporting links to files.
* org-timer.el (org-timer-stop): Add message.
- * org-agenda.el (org-agenda-schedule, org-agenda-deadline): Fix
- redundant messages.
+ * org-agenda.el (org-agenda-schedule, org-agenda-deadline):
+ Fix redundant messages.
* org-agenda.el (org-agenda-finalize): Fix clock highlighting.
* org-install.el: Enhance warning.
-2012-12-12 Erik Hetzner <egh@e6h.org> (tiny change)
+2012-12-13 Erik Hetzner <egh@e6h.org> (tiny change)
* org.el (org-log-into-drawer): Honor the nil value for the
:LOG_INTO_DRAWER: property.
-2012-12-12 Le Wang <l26wang@gmail.com> (tiny change)
+2012-12-13 Le Wang <l26wang@gmail.com> (tiny change)
* org-src.el (org-edit-src-exit): Fix editing source section with
blank lines.
-2012-12-12 Le Wang <le.wang@agworld.com.au>
+2012-12-13 Le Wang <le.wang@agworld.com.au>
* org-src.el (org-edit-src-code): Use marker with insertion type
t to track end and remove hack requiring delete from beg to (1- end).
-2012-12-12 Nicolas Goaziou <n.goaziou@gmail.com>
+2012-12-13 Nicolas Goaziou <n.goaziou@gmail.com>
* org-element.el (org-element-context): When point is between two
objects, be sure to return the second one.
delegate motion to `end-of-line' instead of `move-end-of-line' in
order to stay on the current line.
-2012-12-12 Rafael Laboissiere <rafael@laboissiere.net> (tiny change)
+2012-12-13 Rafael Laboissiere <rafael@laboissiere.net> (tiny change)
* org-bibtex.el: In the documentation section of the file, fix the
broken URL to Andrew Roberts' document on BibTeX entries.
commented lines in the Remember temporary buffer with the
appropriate characters.
-2012-12-12 Toby S. Cubitt <tsc25@cantab.net>
+2012-12-13 Toby S. Cubitt <tsc25@cantab.net>
* org.el (org-beginning-of-line): Check `visual-line-mode' instead
- of `line-visual-mode' to determine whether to move by visual
- lines.
+ of `line-visual-mode' to determine whether to move by visual lines.
* org.el (org-kill-line): Use the `org-bound-and-true-p' macro.
+2012-12-04 Chong Yidong <cyd@gnu.org>
+
+ * org-bibtex.el (org-bibtex-ask): Use visual-line-mode instead of
+ longlines-mode.
+
2012-10-26 Achim Gratz <stromeko@stromeko.de>
* ob-ditaa.el: Needs to (require 'org-compat) for
(declare-function bibtex-generate-autokey "bibtex" ())
(declare-function bibtex-parse-entry "bibtex" (&optional content))
(declare-function bibtex-url "bibtex" (&optional pos no-browse))
-(declare-function longlines-mode "longlines" (&optional arg))
(declare-function org-babel-trim "ob" (string &optional regexp))
\f
(buf-name (format "*Bibtex Help %s*" name)))
(with-output-to-temp-buffer buf-name
(princ (cdr (assoc field org-bibtex-fields))))
- (with-current-buffer buf-name (longlines-mode t))
+ (with-current-buffer buf-name (visual-line-mode 1))
(org-fit-window-to-buffer (get-buffer-window buf-name))
((lambda (result) (when (> (length result) 0) result))
(read-from-minibuffer (format "%s: " name))))))
(defun gamegrid-make-mono-tty-face ()
(let ((face (make-face 'gamegrid-mono-tty-face)))
- (set-face-inverse-video-p face t)
+ (set-face-inverse-video face t)
face))
(defun gamegrid-make-color-tty-face (color)
(goto-char (point-min))
(search-forward (concat (int-to-string score)
" " (user-login-name) " "
- marker-string))
+ marker-string) nil t)
(beginning-of-line)))))
(defun gamegrid-add-score-insecure (file score &optional directory)
(eval-when-compile
(require 'easymenu)) ; to avoid compilation gripes
+ (declare-function easy-menu-add-item "easymenu"
+ (map path item &optional before))
+ (declare-function easy-menu-remove-item "easymenu" (map path name))
+
(eval-and-compile
(defun pr-global-menubar (pr-menu-spec)
(require 'easymenu)
(and pr-i-region ; let region activated
(pr-keep-region-active)))
+(declare-function widget-field-action "wid-edit" (widget &optional _event))
+(declare-function widget-value-set "wid-edit" (widget value))
(defun pr-insert-section-1 ()
;; 1. Print:
(defvar profiler-report-mode-map
(let ((map (make-sparse-keymap)))
- ;; FIXME: Add menu.
(define-key map "n" 'profiler-report-next-entry)
(define-key map "p" 'profiler-report-previous-entry)
;; I find it annoying more than helpful to not be able to navigate
(define-key map "D" 'profiler-report-descending-sort)
(define-key map "=" 'profiler-report-compare-profile)
(define-key map (kbd "C-x C-w") 'profiler-report-write-profile)
- (define-key map "q" 'quit-window)
- map))
+ (easy-menu-define profiler-report-menu map "Menu for Profiler Report mode."
+ '("Profiler"
+ ["Next Entry" profiler-report-next-entry :active t
+ :help "Move to next entry"]
+ ["Previous Entry" profiler-report-previous-entry :active t
+ :help "Move to previous entry"]
+ "--"
+ ["Toggle Entry" profiler-report-toggle-entry
+ :active (profiler-report-calltree-at-point)
+ :help "Expand or collapse the current entry"]
+ ["Find Entry" profiler-report-find-entry
+ ;; FIXME should deactivate if not on a known function.
+ :active (profiler-report-calltree-at-point)
+ :help "Find the definition of the current entry"]
+ ["Describe Entry" profiler-report-describe-entry
+ :active (profiler-report-calltree-at-point)
+ :help "Show the documentation of the current entry"]
+ "--"
+ ["Show Calltree" profiler-report-render-calltree
+ :active profiler-report-reversed
+ :help "Show calltree view"]
+ ["Show Reversed Calltree" profiler-report-render-reversed-calltree
+ :active (not profiler-report-reversed)
+ :help "Show reversed calltree view"]
+ ["Sort Ascending" profiler-report-ascending-sort
+ :active (not (eq profiler-report-order 'ascending))
+ :help "Sort calltree view in ascending order"]
+ ["Sort Descending" profiler-report-descending-sort
+ :active (not (eq profiler-report-order 'descending))
+ :help "Sort calltree view in descending order"]
+ "--"
+ ["Compare Profile..." profiler-report-compare-profile :active t
+ :help "Compare current profile with another"]
+ ["Write Profile..." profiler-report-write-profile :active t
+ :help "Write current profile to a file"]))
+ map)
+ "Keymap for `profiler-report-mode'.")
(defun profiler-report-make-buffer-name (profile)
(format "*%s-Profiler-Report %s*"
(defun profiler-report-find-entry (&optional event)
"Find entry at point."
(interactive (list last-nonmenu-event))
- (if event (posn-set-point (event-end event)))
- (let ((tree (profiler-report-calltree-at-point)))
- (when tree
- (let ((entry (profiler-calltree-entry tree)))
- (find-function entry)))))
+ (with-current-buffer
+ (if event (window-buffer (posn-window (event-start event)))
+ (current-buffer))
+ (and event (setq event (event-end event))
+ (posn-set-point event))
+ (let ((tree (profiler-report-calltree-at-point)))
+ (when tree
+ (let ((entry (profiler-calltree-entry tree)))
+ (find-function entry))))))
(defun profiler-report-describe-entry ()
"Describe entry at point."
;;;###autoload
(define-derived-mode autoconf-mode prog-mode "Autoconf"
"Major mode for editing Autoconf configure.ac files."
- (set (make-local-variable 'parens-require-spaces) nil) ; for M4 arg lists
- (set (make-local-variable 'defun-prompt-regexp)
- "^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+")
- (set (make-local-variable 'comment-start) "dnl ")
- (set (make-local-variable 'comment-start-skip)
- "\\(?:\\(\\W\\|\\`\\)dnl\\|#\\) +")
- (set (make-local-variable 'syntax-propertize-function)
- (syntax-propertize-rules ("\\<dnl\\>" (0 "<"))))
- (set (make-local-variable 'font-lock-defaults)
- `(autoconf-font-lock-keywords nil nil (("_" . "w"))))
- (set (make-local-variable 'imenu-generic-expression)
- autoconf-imenu-generic-expression)
- (set (make-local-variable 'imenu-syntax-alist) '(("_" . "w")))
- (set (make-local-variable 'indent-line-function) #'indent-relative)
- (set (make-local-variable 'add-log-current-defun-function)
- #'autoconf-current-defun-function))
+ (setq-local parens-require-spaces nil) ; for M4 arg lists
+ (setq-local defun-prompt-regexp "^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+")
+ (setq-local comment-start "dnl ")
+ (setq-local comment-start-skip "\\(?:\\(\\W\\|\\`\\)dnl\\|#\\) +")
+ (setq-local syntax-propertize-function
+ (syntax-propertize-rules ("\\<dnl\\>" (0 "<"))))
+ (setq-local font-lock-defaults
+ `(autoconf-font-lock-keywords nil nil (("_" . "w"))))
+ (setq-local imenu-generic-expression autoconf-imenu-generic-expression)
+ (setq-local imenu-syntax-alist '(("_" . "w")))
+ (setq-local indent-line-function #'indent-relative)
+ (setq-local add-log-current-defun-function
+ #'autoconf-current-defun-function))
(provide 'autoconf-mode)
(provide 'autoconf)
(set (make-local-variable 'outline-regexp) "[^#\n\^M]")
(set (make-local-variable 'outline-level) 'c-outline-level)
-
+ (set (make-local-variable 'add-log-current-defun-function)
+ (lambda ()
+ (or (c-cpp-define-name) (c-defun-name))))
(let ((rfn (assq mode c-require-final-newline)))
(when rfn
(and (cdr rfn)
(format "%s started at %s\n\n"
mode-name
(substring (current-time-string) 0 19))
- command "\n")
+ ;; The command could be split into several lines, see
+ ;; `rgrep' for example. We want to display it as one
+ ;; line.
+ (apply 'concat (split-string command (regexp-quote "\\\n") t))
+ "\n")
(setq thisdir default-directory))
(set-buffer-modified-p nil))
;; Pop up the compilation buffer.
(setq outline-regexp cperl-outline-regexp)
(make-local-variable 'outline-level)
(setq outline-level 'cperl-outline-level)
+ (make-local-variable 'add-log-current-defun-function)
+ (setq add-log-current-defun-function
+ (lambda ()
+ (save-excursion
+ (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
+ (match-string-no-properties 1)))))
+
(make-local-variable 'paragraph-start)
(setq paragraph-start (concat "^$\\|" page-delimiter))
(make-local-variable 'paragraph-separate)
((eq 'continuation (elt i 0))
;; [continuation statement-start char-after is-block is-brace]
(goto-char (elt i 1)) ; statement-start
- (+ (if (memq (elt i 2) (append "}])" nil)) ; char-after
- 0 ; Closing parenth
+ (+ (if (or (memq (elt i 2) (append "}])" nil)) ; char-after
+ (eq 'continuation ; do not stagger continuations
+ (elt (cperl-sniff-for-indent parse-data) 0)))
+ 0 ; Closing parenth or continuation of a continuation
cperl-continued-statement-offset)
(if (or (elt i 3) ; is-block
(not (elt i 4)) ; is-brace
(kill-local-variable 'tags-file-name)
(if (eq local-tags-file-name tags-file-name)
(setq tags-file-name nil))
- (user-error "File %s is not a valid tags table"
+ (user-error (if (file-exists-p local-tags-file-name)
+ "File %s is not a valid tags table"
+ "File %s does not exist")
local-tags-file-name)))))
(defun tags-reset-tags-tables ()
(defsubst f90-line-continued ()
"Return t if the current line is a continued one.
-This includes comment lines embedded in continued lines, but
-not the last line of a continued statement."
+This includes comment or preprocessor lines embedded in continued lines,
+but not the last line of a continued statement."
(save-excursion
(beginning-of-line)
- (while (and (looking-at "[ \t]*\\(!\\|$\\)") (zerop (forward-line -1))))
+ (while (and (looking-at "[ \t]*\\([!#]\\|$\\)") (zerop (forward-line -1))))
(end-of-line)
(while (f90-in-comment)
(search-backward "!" (line-beginning-position))
(f90-indent-line-no)
(setq no-line-number t)
(skip-chars-forward " \t"))
- (if (looking-at "!")
- (setq indent (f90-comment-indent))
- (and f90-smart-end (looking-at "end")
- (f90-match-end))
- (setq indent (f90-calculate-indent)))
+ ;; FIXME This means f90-calculate-indent gives different answers
+ ;; for comments and preprocessor lines to this function.
+ ;; Better to make f90-calculate-indent return the correct answer?
+ (cond ((looking-at "!") (setq indent (f90-comment-indent)))
+ ((looking-at "#") (setq indent 0))
+ (t
+ (and f90-smart-end (looking-at "end")
+ (f90-match-end))
+ (setq indent (f90-calculate-indent))))
(or (= indent (current-column))
(f90-indent-to indent no-line-number))
;; If initial point was within line's indentation,
(f90-indent-to ind-curr))
(while (and (f90-line-continued) (zerop (forward-line 1))
(< (point) end-region-mark))
- (if (looking-at "[ \t]*!")
- (f90-indent-to (f90-comment-indent))
- (or (= (current-indentation)
- (+ ind-curr f90-continuation-indent))
- (f90-indent-to
- (+ ind-curr f90-continuation-indent) 'no-line-no)))))
+ (cond ((looking-at "[ \t]*#") (f90-indent-to 0))
+ ((looking-at "[ \t]*!") (f90-indent-to (f90-comment-indent)))
+ (t
+ (or (= (current-indentation)
+ (+ ind-curr f90-continuation-indent))
+ (f90-indent-to
+ (+ ind-curr f90-continuation-indent) 'no-line-no))))))
;; Restore point, etc.
(setq f90-cache-position nil)
(goto-char save-point)
has-flymake-overlays))
(defface flymake-errline
- '((t :inherit error))
+ '((((supports :underline (:style wave)))
+ :underline (:style wave :color "Red1"))
+ (t
+ :inherit error))
"Face used for marking error lines."
+ :version "24.4"
:group 'flymake)
(defface flymake-warnline
- '((t :inherit warning))
+ '((((supports :underline (:style wave)))
+ :underline (:style wave :color "DarkOrange"))
+ (t
+ :inherit warning))
"Face used for marking warning lines."
+ :version "24.4"
:group 'flymake)
(defun flymake-highlight-line (line-no line-err-info-list)
'exec-plus)
((and
(grep-probe find-program `(nil nil nil ,null-device "-print0"))
- (grep-probe xargs-program `(nil nil nil "-0" "-e" "echo")))
+ (grep-probe xargs-program `(nil nil nil "-0" "echo")))
'gnu)
(t
'exec))))
;; Windows shells need the program file name
;; after the pipe symbol be quoted if they use
;; forward slashes as directory separators.
- (format "%s . -type f -print0 | \"%s\" -0 -e %s"
+ (format "%s . -type f -print0 | \"%s\" -0 %s"
find-program xargs-program grep-command))
((memq grep-find-use-xargs '(exec exec-plus))
(let ((cmd0 (format "%s . -type f -exec %s"
(format "%s " null-device)
"")))
(cond ((eq grep-find-use-xargs 'gnu)
- (format "%s . <X> -type f <F> -print0 | \"%s\" -0 -e %s"
+ (format "%s . <X> -type f <F> -print0 | \"%s\" -0 %s"
find-program xargs-program gcmd))
((eq grep-find-use-xargs 'exec)
(format "%s . <X> -type f <F> -exec %s {} %s%s"
(compilation-start regexp 'grep-mode))
(setq dir (file-name-as-directory (expand-file-name dir)))
(require 'find-dired) ; for `find-name-arg'
+ ;; In Tramp, there could be problems if the command line is too
+ ;; long. We escape it, therefore.
(let ((command (grep-expand-template
grep-find-template
regexp
(concat (shell-quote-argument "(")
" " find-name-arg " "
- (mapconcat #'shell-quote-argument
- (split-string files)
- (concat " -o " find-name-arg " "))
+ (mapconcat
+ #'shell-quote-argument
+ (split-string files)
+ (concat "\\\n" " -o " find-name-arg " "))
" "
(shell-quote-argument ")"))
dir
(concat "*/"
(cdr ignore)))))))
grep-find-ignored-directories
- " -o -path ")
+ "\\\n -o -path ")
" "
(shell-quote-argument ")")
" -prune -o "))
(shell-quote-argument
(cdr ignore))))))
grep-find-ignored-files
- " -o -name ")
+ "\\\n -o -name ")
" "
(shell-quote-argument ")")
" -prune -o "))))))
;;; Filling
+(defvar js--filling-paragraph nil)
+
+;; FIXME: Such redefinitions are bad style. We should try and use some other
+;; way to get the same result.
+(defadvice c-forward-sws (around js-fill-paragraph activate)
+ (if js--filling-paragraph
+ (setq ad-return-value (js--forward-syntactic-ws (ad-get-arg 0)))
+ ad-do-it))
+
+(defadvice c-backward-sws (around js-fill-paragraph activate)
+ (if js--filling-paragraph
+ (setq ad-return-value (js--backward-syntactic-ws (ad-get-arg 0)))
+ ad-do-it))
+
+(defadvice c-beginning-of-macro (around js-fill-paragraph activate)
+ (if js--filling-paragraph
+ (setq ad-return-value (js--beginning-of-macro (ad-get-arg 0)))
+ ad-do-it))
+
(defun js-c-fill-paragraph (&optional justify)
"Fill the paragraph with `c-fill-paragraph'."
(interactive "*P")
- ;; FIXME: Such redefinitions are bad style. We should try and use some other
- ;; way to get the same result.
- (cl-letf (((symbol-function 'c-forward-sws)
- (lambda (&optional limit)
- (js--forward-syntactic-ws limit)))
- ((symbol-function 'c-backward-sws)
- (lambda (&optional limit)
- (js--backward-syntactic-ws limit)))
- ((symbol-function 'c-beginning-of-macro)
- (lambda (&optional limit)
- (js--beginning-of-macro limit))))
- (let ((fill-paragraph-function 'c-fill-paragraph))
- (c-fill-paragraph justify))))
+ (let ((js--filling-paragraph t)
+ (fill-paragraph-function 'c-fill-paragraph))
+ (c-fill-paragraph justify)))
;;; Type database and Imenu
(define-derived-mode js-mode prog-mode "Javascript"
"Major mode for editing JavaScript."
:group 'js
+ (setq-local indent-line-function 'js-indent-line)
+ (setq-local beginning-of-defun-function 'js-beginning-of-defun)
+ (setq-local end-of-defun-function 'js-end-of-defun)
+ (setq-local open-paren-in-column-0-is-defun-start nil)
+ (setq-local font-lock-defaults (list js--font-lock-keywords))
+ (setq-local syntax-propertize-function #'js-syntax-propertize)
- (set (make-local-variable 'indent-line-function) 'js-indent-line)
- (set (make-local-variable 'beginning-of-defun-function)
- 'js-beginning-of-defun)
- (set (make-local-variable 'end-of-defun-function)
- 'js-end-of-defun)
-
- (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil)
- (set (make-local-variable 'font-lock-defaults)
- (list js--font-lock-keywords))
- (set (make-local-variable 'syntax-propertize-function)
- #'js-syntax-propertize)
-
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
- (set (make-local-variable 'parse-sexp-lookup-properties) t)
- (set (make-local-variable 'which-func-imenu-joiner-function)
- #'js--which-func-joiner)
+ (setq-local parse-sexp-ignore-comments t)
+ (setq-local parse-sexp-lookup-properties t)
+ (setq-local which-func-imenu-joiner-function #'js--which-func-joiner)
;; Comments
- (set (make-local-variable 'comment-start) "// ")
- (set (make-local-variable 'comment-end) "")
- (set (make-local-variable 'fill-paragraph-function)
- 'js-c-fill-paragraph)
+ (setq-local comment-start "// ")
+ (setq-local comment-end "")
+ (setq-local fill-paragraph-function 'js-c-fill-paragraph)
;; Parse cache
(add-hook 'before-change-functions #'js--flush-caches t t)
;; Imenu
(setq imenu-case-fold-search nil)
- (set (make-local-variable 'imenu-create-index-function)
- #'js--imenu-create-index)
+ (setq imenu-create-index-function #'js--imenu-create-index)
;; for filling, pretend we're cc-mode
(setq c-comment-prefix-regexp "//+\\|\\**"
c-comment-start-regexp "/[*/]\\|\\s!"
comment-start-skip "\\(//+\\|/\\*+\\)\\s *")
- (set (make-local-variable 'electric-indent-chars)
- (append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*".
- (set (make-local-variable 'electric-layout-rules)
- '((?\; . after) (?\{ . after) (?\} . before)))
+ (setq-local electric-indent-chars
+ (append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*".
+ (setq-local electric-layout-rules
+ '((?\; . after) (?\{ . after) (?\} . before)))
(let ((c-buffer-is-cc-mode t))
;; FIXME: These are normally set by `c-basic-common-init'. Should
(make-local-variable 'adaptive-fill-regexp)
(c-setup-paragraph-variables))
- (set (make-local-variable 'syntax-begin-function)
- #'js--syntax-begin-function)
+ (setq-local syntax-begin-function #'js--syntax-begin-function)
;; Important to fontify the whole buffer syntactically! If we don't,
;; then we might have regular expression literals that aren't marked
"*m4-output*" nil)
(switch-to-buffer-other-window "*m4-output*"))
+(defun m4-current-defun-name ()
+ "Return the name of the M4 function at point, or nil."
+ (save-excursion
+ (if (re-search-backward
+ "^\\(\\(m4_\\)?define\\|A._DEFUN\\)(\\[?\\([A-Za-z0-9_]+\\)" nil t)
+ (match-string-no-properties 3))))
+
;;;###autoload
(define-derived-mode m4-mode prog-mode "m4"
"A major mode to edit m4 macro files."
:abbrev-table m4-mode-abbrev-table
- (set (make-local-variable 'comment-start) "#")
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
- (set (make-local-variable 'font-lock-defaults) '(m4-font-lock-keywords nil)))
+ (setq-local comment-start "#")
+ (setq-local parse-sexp-ignore-comments t)
+ (setq-local add-log-current-defun-function #'m4-current-defun-name)
+ (setq font-lock-defaults '(m4-font-lock-keywords nil)))
(provide 'm4-mode)
;;stuff to play with for debugging
(make-local-variable 'makefile-need-macro-pickup)
;; Font lock.
- (set (make-local-variable 'font-lock-defaults)
- ;; SYNTAX-BEGIN set to backward-paragraph to avoid slow-down
- ;; near the end of a large buffer, due to parse-partial-sexp's
- ;; trying to parse all the way till the beginning of buffer.
- '(makefile-font-lock-keywords
- nil nil
- ((?$ . "."))
- backward-paragraph))
- (set (make-local-variable 'syntax-propertize-function)
- makefile-syntax-propertize-function)
+ (setq-local font-lock-defaults
+ ;; Set SYNTAX-BEGIN to backward-paragraph to avoid
+ ;; slow-down near the end of a large buffer, due to
+ ;; `parse-partial-sexp' trying to parse all the way till
+ ;; the beginning of buffer.
+ '(makefile-font-lock-keywords
+ nil nil
+ ((?$ . "."))
+ backward-paragraph))
+ (setq-local syntax-propertize-function
+ makefile-syntax-propertize-function)
;; Add-log.
- (set (make-local-variable 'add-log-current-defun-function)
- 'makefile-add-log-defun)
+ (setq-local add-log-current-defun-function
+ 'makefile-add-log-defun)
;; Imenu.
- (set (make-local-variable 'imenu-generic-expression)
- makefile-imenu-generic-expression)
+ (setq-local imenu-generic-expression
+ makefile-imenu-generic-expression)
;; Dabbrev.
- (set (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) "\\$")
+ (setq-local dabbrev-abbrev-skip-leading-regexp "\\$")
;; Other abbrevs.
(setq local-abbrev-table makefile-mode-abbrev-table)
;; Filling.
- (set (make-local-variable 'fill-paragraph-function) 'makefile-fill-paragraph)
+ (setq-local fill-paragraph-function 'makefile-fill-paragraph)
;; Comment stuff.
- (set (make-local-variable 'comment-start) "#")
- (set (make-local-variable 'comment-end) "")
- (set (make-local-variable 'comment-start-skip) "#+[ \t]*")
+ (setq-local comment-start "#")
+ (setq-local comment-end "")
+ (setq-local comment-start-skip "#+[ \t]*")
;; Make sure TAB really inserts \t.
- (set (make-local-variable 'indent-line-function) 'indent-to-left-margin)
+ (setq-local indent-line-function 'indent-to-left-margin)
;; Real TABs are important in makefiles
(setq indent-tabs-mode t))
;;;###autoload
(define-derived-mode makefile-makepp-mode makefile-mode "Makeppfile"
"An adapted `makefile-mode' that knows about makepp."
- (set (make-local-variable 'makefile-rule-action-regex)
- makefile-makepp-rule-action-regex)
+ (setq-local makefile-rule-action-regex makefile-makepp-rule-action-regex)
(setq font-lock-defaults
`(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults))
imenu-generic-expression
;;;###autoload
(define-derived-mode makefile-bsdmake-mode makefile-mode "BSDmakefile"
"An adapted `makefile-mode' that knows about BSD make."
- (set (make-local-variable 'makefile-dependency-regex)
- makefile-bsdmake-dependency-regex)
- (set (make-local-variable 'makefile-dependency-skip) "^:!")
- (set (make-local-variable 'makefile-rule-action-regex)
- makefile-bsdmake-rule-action-regex)
+ (setq-local makefile-dependency-regex makefile-bsdmake-dependency-regex)
+ (setq-local makefile-dependency-skip "^:!")
+ (setq-local makefile-rule-action-regex makefile-bsdmake-rule-action-regex)
(setq font-lock-defaults
`(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults))))
(define-derived-mode makefile-imake-mode makefile-mode "Imakefile"
"An adapted `makefile-mode' that knows about imake."
:syntax-table makefile-imake-mode-syntax-table
- (set (make-local-variable 'syntax-propertize-function) nil)
+ (setq-local syntax-propertize-function nil)
(setq font-lock-defaults
`(makefile-imake-font-lock-keywords ,@(cdr font-lock-defaults))))
;; Filling
-(defun makefile-fill-paragraph (_arg)
- ;; Fill comments, backslashed lines, and variable definitions
- ;; specially.
+(defun makefile-fill-paragraph (_justify)
+ "Function used for `fill-paragraph-function' in Makefile mode.
+Fill comments, backslashed lines, and variable definitions specially."
(save-excursion
(beginning-of-line)
(cond
(end-of-line 0)
(while (= (preceding-char) ?\\)
(end-of-line 0))
- (forward-char)
+ ;; Maybe we hit bobp, in which case we are not at EOL.
+ (if (eq (point) (line-end-position))
+ (forward-char))
(point)))
(end
(save-excursion
(pop-to-buffer browser-buffer)
(makefile-browser-fill targets macros)
(shrink-window-if-larger-than-buffer)
- (set (make-local-variable 'makefile-browser-selection-vector)
- (make-vector (+ (length targets) (length macros)) nil))
+ (setq-local makefile-browser-selection-vector
+ (make-vector (+ (length targets) (length macros)) nil))
(makefile-browser-start-interaction))))
(defun makefile-switch-to-browser ()
-;;; perl-mode.el --- Perl code editing commands for GNU Emacs
+;;; perl-mode.el --- Perl code editing commands for GNU Emacs -*- coding: utf-8 -*-
;; Copyright (C) 1990, 1994, 2001-2013 Free Software Foundation, Inc.
;;; Code:
-
-(defvar font-lock-comment-face)
-(defvar font-lock-doc-face)
-(defvar font-lock-string-face)
-
(defgroup perl nil
"Major mode for editing Perl code."
:link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
(defvar perl-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "{" 'perl-electric-terminator)
- (define-key map "}" 'perl-electric-terminator)
- (define-key map ";" 'perl-electric-terminator)
- (define-key map ":" 'perl-electric-terminator)
(define-key map "\e\C-a" 'perl-beginning-of-function)
(define-key map "\e\C-e" 'perl-end-of-function)
(define-key map "\e\C-h" 'perl-mark-function)
(define-key map "\e\C-q" 'perl-indent-exp)
(define-key map "\177" 'backward-delete-char-untabify)
- (define-key map "\t" 'perl-indent-command)
map)
"Keymap used in Perl mode.")
(defvar perl-imenu-generic-expression
'(;; Functions
- (nil "^sub\\s-+\\([-A-Za-z0-9+_:]+\\)" 1)
+ (nil "^[ \t]*sub\\s-+\\([-A-Za-z0-9+_:]+\\)" 1)
;;Variables
("Variables" "^\\(?:my\\|our\\)\\s-+\\([$@%][-A-Za-z0-9+_:]+\\)\\s-*=" 1)
- ("Packages" "^package\\s-+\\([-A-Za-z0-9+_:]+\\);" 1)
+ ("Packages" "^[ \t]*package\\s-+\\([-A-Za-z0-9+_:]+\\);" 1)
("Doc sections" "^=head[0-9][ \t]+\\(.*\\)" 1))
"Imenu generic expression for Perl mode. See `imenu-generic-expression'.")
;; Regexps updated with help from Tom Tromey <tromey@cambric.colorado.edu> and
;; Jim Campbell <jec@murzim.ca.boeing.com>.
+(defcustom perl-prettify-symbols t
+ "If non-nil, some symbols will be displayed using Unicode chars."
+ :type 'boolean)
+
+(defconst perl--prettify-symbols-alist
+ '(;;("andalso" . ?∧) ("orelse" . ?∨) ("as" . ?≡)("not" . ?¬)
+ ;;("div" . ?÷) ("*" . ?×) ("o" . ?○)
+ ("->" . ?→)
+ ("=>" . ?⇒)
+ ;;("<-" . ?←) ("<>" . ?≠) (">=" . ?≥) ("<=" . ?≤) ("..." . ?⋯)
+ ("::" . ?∷)
+ ))
+
+(defun perl--font-lock-compose-symbol ()
+ "Compose a sequence of ascii chars into a symbol.
+Regexp match data 0 points to the chars."
+ ;; Check that the chars should really be composed into a symbol.
+ (let* ((start (match-beginning 0))
+ (end (match-end 0))
+ (syntaxes (if (eq (char-syntax (char-after start)) ?w)
+ '(?w) '(?. ?\\))))
+ (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes)
+ (memq (char-syntax (or (char-after end) ?\ )) syntaxes)
+ (nth 8 (syntax-ppss)))
+ ;; No composition for you. Let's actually remove any composition
+ ;; we may have added earlier and which is now incorrect.
+ (remove-text-properties start end '(composition))
+ ;; That's a symbol alright, so add the composition.
+ (compose-region start end (cdr (assoc (match-string 0)
+ perl--prettify-symbols-alist)))))
+ ;; Return nil because we're not adding any face property.
+ nil)
+
+(defun perl--font-lock-symbols-keywords ()
+ (when perl-prettify-symbols
+ `((,(regexp-opt (mapcar 'car perl--prettify-symbols-alist) t)
+ (0 (perl--font-lock-compose-symbol))))))
+
(defconst perl-font-lock-keywords-1
'(;; What is this for?
;;("\\(--- .* ---\\|=== .* ===\\)" . font-lock-string-face)
"Subdued level highlighting for Perl mode.")
(defconst perl-font-lock-keywords-2
- (append perl-font-lock-keywords-1
- (list
- ;;
- ;; Fontify keywords, except those fontified otherwise.
- (concat "\\<"
- (regexp-opt '("if" "until" "while" "elsif" "else" "unless"
- "do" "dump" "for" "foreach" "exit" "die"
- "BEGIN" "END" "return" "exec" "eval") t)
- "\\>")
- ;;
- ;; Fontify local and my keywords as types.
- '("\\<\\(local\\|my\\)\\>" . font-lock-type-face)
- ;;
- ;; Fontify function, variable and file name references.
- '("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face)
- ;; Additionally underline non-scalar variables. Maybe this is a bad idea.
- ;;'("[$@%*][#{]?\\(\\sw+\\)" 1 font-lock-variable-name-face)
- '("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-variable-name-face)
- '("\\([@%]\\|\\$#\\)\\(\\sw+\\(::\\sw+\\)*\\)"
+ (append
+ perl-font-lock-keywords-1
+ `( ;; Fontify keywords, except those fontified otherwise.
+ ,(concat "\\<"
+ (regexp-opt '("if" "until" "while" "elsif" "else" "unless"
+ "do" "dump" "for" "foreach" "exit" "die"
+ "BEGIN" "END" "return" "exec" "eval") t)
+ "\\>")
+ ;;
+ ;; Fontify local and my keywords as types.
+ ("\\<\\(local\\|my\\)\\>" . font-lock-type-face)
+ ;;
+ ;; Fontify function, variable and file name references.
+ ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face)
+ ;; Additionally underline non-scalar variables. Maybe this is a bad idea.
+ ;;'("[$@%*][#{]?\\(\\sw+\\)" 1 font-lock-variable-name-face)
+ ("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-variable-name-face)
+ ("\\([@%]\\|\\$#\\)\\(\\sw+\\(::\\sw+\\)*\\)"
(2 (cons font-lock-variable-name-face '(underline))))
- '("<\\(\\sw+\\)>" 1 font-lock-constant-face)
- ;;
- ;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'.
- '("\\<\\(continue\\|goto\\|last\\|next\\|redo\\)\\>[ \t]*\\(\\sw+\\)?"
+ ("<\\(\\sw+\\)>" 1 font-lock-constant-face)
+ ;;
+ ;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'.
+ ("\\<\\(continue\\|goto\\|last\\|next\\|redo\\)\\>[ \t]*\\(\\sw+\\)?"
(1 font-lock-keyword-face) (2 font-lock-constant-face nil t))
- '("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 font-lock-constant-face)))
+ ("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 font-lock-constant-face)
+ ,@(perl--font-lock-symbols-keywords)))
"Gaudy level highlighting for Perl mode.")
(defvar perl-font-lock-keywords perl-font-lock-keywords-1
(defun perl-outline-level ()
(cond
- ((looking-at "package\\s-") 0)
- ((looking-at "sub\\s-") 1)
+ ((looking-at "[ \t]*\\(package\\)\\s-")
+ (- (match-beginning 1) (match-beginning 0)))
+ ((looking-at "[ \t]*s\\(ub\\)\\s-")
+ (- (match-beginning 1) (match-beginning 0)))
((looking-at "=head[0-9]") (- (char-before (match-end 0)) ?0))
((looking-at "=cut") 1)
(t 3)))
+
+(defun perl-current-defun-name ()
+ "The `add-log-current-defun' function in Perl mode."
+ (save-excursion
+ (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
+ (match-string-no-properties 1))))
+
\f
(defvar perl-mode-hook nil
"Normal hook to run when entering Perl mode.")
Turning on Perl mode runs the normal hook `perl-mode-hook'."
:abbrev-table perl-mode-abbrev-table
- (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
- (set (make-local-variable 'paragraph-separate) paragraph-start)
- (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
- (set (make-local-variable 'indent-line-function) #'perl-indent-line)
- (set (make-local-variable 'comment-start) "# ")
- (set (make-local-variable 'comment-end) "")
- (set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *")
- (set (make-local-variable 'comment-indent-function) #'perl-comment-indent)
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
+ (setq-local paragraph-start (concat "$\\|" page-delimiter))
+ (setq-local paragraph-separate paragraph-start)
+ (setq-local paragraph-ignore-fill-prefix t)
+ (setq-local indent-line-function #'perl-indent-line)
+ (setq-local comment-start "# ")
+ (setq-local comment-end "")
+ (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
+ (setq-local comment-indent-function #'perl-comment-indent)
+ (setq-local parse-sexp-ignore-comments t)
;; Tell font-lock.el how to handle Perl.
(setq font-lock-defaults '((perl-font-lock-keywords
perl-font-lock-keywords-1
nil nil ((?\_ . "w")) nil
(font-lock-syntactic-face-function
. perl-font-lock-syntactic-face-function)))
- (set (make-local-variable 'syntax-propertize-function)
- #'perl-syntax-propertize-function)
+ (setq-local syntax-propertize-function #'perl-syntax-propertize-function)
(add-hook 'syntax-propertize-extend-region-functions
#'syntax-propertize-multiline 'append 'local)
+ ;; Electricity.
+ ;; FIXME: setup electric-layout-rules.
+ (setq-local electric-indent-chars
+ (append '(?\{ ?\} ?\; ?\:) electric-indent-chars))
+ (add-hook 'electric-indent-functions #'perl-electric-noindent-p nil t)
;; Tell imenu how to handle Perl.
- (set (make-local-variable 'imenu-generic-expression)
- perl-imenu-generic-expression)
+ (setq-local imenu-generic-expression perl-imenu-generic-expression)
(setq imenu-case-fold-search nil)
;; Setup outline-minor-mode.
- (set (make-local-variable 'outline-regexp) perl-outline-regexp)
- (set (make-local-variable 'outline-level) 'perl-outline-level))
+ (setq-local outline-regexp perl-outline-regexp)
+ (setq-local outline-level 'perl-outline-level)
+ (setq-local add-log-current-defun-function #'perl-current-defun-name))
\f
;; This is used by indent-for-comment
;; to decide how much to indent a comment in Perl code
0 ;Existing comment at bol stays there.
comment-column))
-(defalias 'electric-perl-terminator 'perl-electric-terminator)
+(define-obsolete-function-alias 'electric-perl-terminator
+ 'perl-electric-terminator "22.1")
+(defun perl-electric-noindent-p (char)
+ (unless (eolp) 'no-indent))
+
(defun perl-electric-terminator (arg)
"Insert character and maybe adjust indentation.
If at end-of-line, and not in a comment or a quote, correct the indentation."
(perl-indent-line)
(delete-char -1))))
(self-insert-command (prefix-numeric-value arg)))
+(make-obsolete 'perl-electric-terminator 'electric-indent-mode "24.4")
;; not used anymore, but may be useful someday:
;;(defun perl-inside-parens-p ()
(t
(message "Use backslash to quote # characters.")
(ding t)))))))))
+(make-obsolete 'perl-indent-command 'indent-according-to-mode "24.4")
(defun perl-indent-line (&optional nochange parse-start)
"Indent current line as Perl code.
(require 'ansi-color)
(require 'comint)
-(eval-when-compile
- (require 'cl)
- ;; Avoid compiler warnings
- (defvar view-return-to-alist)
- (defvar compilation-error-regexp-alist)
- (defvar outline-heading-end-regexp))
+;; Avoid compiler warnings
+(defvar view-return-to-alist)
+(defvar compilation-error-regexp-alist)
+(defvar outline-heading-end-regexp)
(autoload 'comint-mode "comint")
"Return non-nil if point is on TYPE using SYNTAX-PPSS.
TYPE can be `comment', `string' or `paren'. It returns the start
character address of the specified TYPE."
+ (declare (compiler-macro
+ (lambda (form)
+ (pcase type
+ (`'comment
+ `(let ((ppss (or ,syntax-ppss (syntax-ppss))))
+ (and (nth 4 ppss) (nth 8 ppss))))
+ (`'string
+ `(let ((ppss (or ,syntax-ppss (syntax-ppss))))
+ (and (nth 3 ppss) (nth 8 ppss))))
+ (`'paren
+ `(nth 1 (or ,syntax-ppss (syntax-ppss))))
+ (_ form)))))
(let ((ppss (or syntax-ppss (syntax-ppss))))
- (case type
- (comment (and (nth 4 ppss) (nth 8 ppss)))
- (string (and (not (nth 4 ppss)) (nth 8 ppss)))
- (paren (nth 1 ppss))
- (t nil))))
+ (pcase type
+ (`comment (and (nth 4 ppss) (nth 8 ppss)))
+ (`string (and (nth 3 ppss) (nth 8 ppss)))
+ (`paren (nth 1 ppss))
+ (_ nil))))
(defun python-syntax-context-type (&optional syntax-ppss)
"Return the context type using SYNTAX-PPSS.
(when (re-search-forward re limit t)
(while (and (python-syntax-context 'paren)
(re-search-forward re limit t)))
- (if (and (not (python-syntax-context 'paren))
- (not (equal (char-after (point-marker)) ?=)))
+ (if (not (or (python-syntax-context 'paren)
+ (equal (char-after (point-marker)) ?=)))
t
(set-match-data nil)))))
(1 font-lock-variable-name-face nil nil))
(while (and (< i 3)
(or (not limit) (< (+ point i) limit))
(eq (char-after (+ point i)) quote-char))
- (incf i))
+ (setq i (1+ i)))
i))
(defun python-syntax-stringify ()
(save-restriction
(widen)
(save-excursion
- (case context-status
- ('no-indent 0)
+ (pcase context-status
+ (`no-indent 0)
;; When point is after beginning of block just add one level
;; of indentation relative to the context-start
- ('after-beginning-of-block
+ (`after-beginning-of-block
(goto-char context-start)
(+ (current-indentation) python-indent-offset))
;; When after a simple line just use previous line
;; indentation, in the case current line starts with a
;; `python-indent-dedenters' de-indent one level.
- ('after-line
+ (`after-line
(-
(save-excursion
(goto-char context-start)
;; When inside of a string, do nothing. just use the current
;; indentation. XXX: perhaps it would be a good idea to
;; invoke standard text indentation here
- ('inside-string
+ (`inside-string
(goto-char context-start)
(current-indentation))
;; After backslash we have several possibilities.
- ('after-backslash
+ (`after-backslash
(cond
;; Check if current line is a dot continuation. For this
;; the current line must start with a dot and previous
(+ (current-indentation) python-indent-offset)))))
;; When inside a paren there's a need to handle nesting
;; correctly
- ('inside-paren
+ (`inside-paren
(cond
;; If current line closes the outermost open paren use the
;; current indentation of the context-start line.
'default)
(t nil)))
(completion-code
- (case completion-context
- (pdb python-shell-completion-pdb-string-code)
- (import python-shell-completion-module-string-code)
- (default python-shell-completion-string-code)
- (t nil)))
+ (pcase completion-context
+ (`pdb python-shell-completion-pdb-string-code)
+ (`import python-shell-completion-module-string-code)
+ (`default python-shell-completion-string-code)
+ (_ nil)))
(input
(if (eq completion-context 'import)
(replace-regexp-in-string "^[ \t]+" "" line)
JUSTIFY should be used (if applicable) as in `fill-paragraph'."
(let* ((marker (point-marker))
(str-start-pos
- (let ((m (make-marker)))
- (setf (marker-position m)
- (or (python-syntax-context 'string)
- (and (equal (string-to-syntax "|")
- (syntax-after (point)))
- (point)))) m))
+ (set-marker
+ (make-marker)
+ (or (python-syntax-context 'string)
+ (and (equal (string-to-syntax "|")
+ (syntax-after (point)))
+ (point)))))
(num-quotes (python-syntax-count-quotes
(char-after str-start-pos) str-start-pos))
(str-end-pos
;; Docstring styles may vary for oneliners and multi-liners.
(> (count-matches "\n" str-start-pos str-end-pos) 0))
(delimiters-style
- (case python-fill-docstring-style
+ (pcase python-fill-docstring-style
;; delimiters-style is a cons cell with the form
;; (START-NEWLINES . END-NEWLINES). When any of the sexps
;; is NIL means to not add any newlines for start or end
;; of docstring. See `python-fill-docstring-style' for a
;; graphic idea of each style.
- (django (cons 1 1))
- (onetwo (and multi-line-p (cons 1 2)))
- (pep-257 (and multi-line-p (cons nil 2)))
- (pep-257-nn (and multi-line-p (cons nil 1)))
- (symmetric (and multi-line-p (cons 1 1)))))
+ (`django (cons 1 1))
+ (`onetwo (and multi-line-p (cons 1 2)))
+ (`pep-257 (and multi-line-p (cons nil 2)))
+ (`pep-257-nn (and multi-line-p (cons nil 1)))
+ (`symmetric (and multi-line-p (cons 1 1)))))
(docstring-p (save-excursion
;; Consider docstrings those strings which
;; start on a line by themselves.
(easy-menu-add-item
nil '("Python" "Skeletons")
`[,(format
- "Insert %s" (caddr (split-string (symbol-name skeleton) "-")))
+ "Insert %s" (nth 2 (split-string (symbol-name skeleton) "-")))
,skeleton t]))))
\f
;;; FFAP
'"\\(def\\|class\\|module\\)"
"Regexp to match the beginning of a defun, in the general sense.")
+(defconst ruby-singleton-class-re
+ "class\\s *<<"
+ "Regexp to match the beginning of a singleton class context.")
+
(eval-and-compile
(defconst ruby-here-doc-beg-re
"\\(<\\)<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)"
- "Regexp to match the beginning of a heredoc."))
+ "Regexp to match the beginning of a heredoc.")
+
+ (defconst ruby-expression-expansion-re
+ "[^\\]\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)"))
(defun ruby-here-doc-end-match ()
"Return a regexp to find the end of a heredoc.
(when pos (goto-char pos))
(forward-word -1)
(and (or (bolp) (not (eq (char-before (point)) ?_)))
- (looking-at "class\\s *<<"))))
+ (looking-at ruby-singleton-class-re))))
(defun ruby-expr-beg (&optional option)
- "TODO: document."
+ "Check if point is possibly at the beginning of an expression.
+OPTION specifies the type of the expression.
+Can be one of `heredoc', `modifier', `expr-qstr', `expr-re'."
(save-excursion
(store-match-data nil)
(let ((space (skip-chars-backward " \t"))
(or (eq (char-syntax (char-before (point))) ?w)
(ruby-special-char-p))))
nil)
- ((and (eq option 'heredoc) (< space 0))
- (not (progn (goto-char start) (ruby-singleton-class-p))))
- ((or (looking-at ruby-operator-re)
- (looking-at "[\\[({,;]")
+ ((looking-at ruby-operator-re))
+ ((eq option 'heredoc)
+ (and (< space 0) (not (ruby-singleton-class-p start))))
+ ((or (looking-at "[\\[({,;]")
(and (looking-at "[!?]")
(or (not (eq option 'modifier))
(bolp)
(beginning-of-line)))))
(defun ruby-move-to-block (n)
- "Move to the beginning (N < 0) or the end (N > 0) of the current block
-or blocks containing the current block."
- ;; TODO: Make this work for n > 1,
- ;; make it not loop for n = 0,
- ;; document body
+ "Move to the beginning (N < 0) or the end (N > 0) of the
+current block, a sibling block, or an outer block. Do that (abs N) times."
(let ((orig (point))
(start (ruby-calculate-indent))
- (down (looking-at (if (< n 0) ruby-block-end-re
- (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))))
- pos done)
- (while (and (not done) (not (if (< n 0) (bobp) (eobp))))
- (forward-line n)
- (cond
- ((looking-at "^\\s *$"))
- ((looking-at "^\\s *#"))
- ((and (> n 0) (looking-at "^=begin\\>"))
- (re-search-forward "^=end\\>"))
- ((and (< n 0) (looking-at "^=end\\>"))
- (re-search-backward "^=begin\\>"))
- (t
- (setq pos (current-indentation))
+ (signum (if (> n 0) 1 -1))
+ (backward (< n 0))
+ down pos done)
+ (dotimes (_ (abs n))
+ (setq done nil)
+ (setq down (save-excursion
+ (back-to-indentation)
+ ;; There is a block start or block end keyword on this
+ ;; line, don't need to look for another block.
+ (and (re-search-forward
+ (if backward ruby-block-end-re
+ (concat "\\_<\\(" ruby-block-beg-re "\\)\\_>"))
+ (line-end-position) t)
+ (not (nth 8 (syntax-ppss))))))
+ (while (and (not done) (not (if backward (bobp) (eobp))))
+ (forward-line signum)
(cond
- ((< start pos)
- (setq down t))
- ((and down (= pos start))
- (setq done t))
- ((> start pos)
- (setq done t)))))
- (if done
- (save-excursion
- (back-to-indentation)
- (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
- (setq done nil)))))
+ ;; Skip empty and commented out lines.
+ ((looking-at "^\\s *$"))
+ ((looking-at "^\\s *#"))
+ ;; Skip block comments;
+ ((and (not backward) (looking-at "^=begin\\>"))
+ (re-search-forward "^=end\\>"))
+ ((and backward (looking-at "^=end\\>"))
+ (re-search-backward "^=begin\\>"))
+ (t
+ (setq pos (current-indentation))
+ (cond
+ ;; Deeper indentation, we found a block.
+ ;; FIXME: We can't recognize empty blocks this way.
+ ((< start pos)
+ (setq down t))
+ ;; Block found, and same indentation as when started, stop.
+ ((and down (= pos start))
+ (setq done t))
+ ;; Shallower indentation, means outer block, can stop now.
+ ((> start pos)
+ (setq done t)))))
+ (if done
+ (save-excursion
+ (back-to-indentation)
+ ;; Not really at the first or last line of the block, move on.
+ (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
+ (setq done nil))))))
(back-to-indentation)))
(defun ruby-beginning-of-block (&optional arg)
(defun ruby-end-of-block (&optional arg)
"Move forward to the end of the current block.
With ARG, move out of multiple blocks."
- ;; Passing a value > 1 to ruby-move-to-block currently doesn't work.
- (interactive)
+ (interactive "p")
(ruby-move-to-block (or arg 1)))
(defun ruby-forward-sexp (&optional arg)
#exit
String#gsub
Net::HTTP#active?
- File::open.
+ File.open
See `add-log-current-defun-function'."
- ;; TODO: Document body
- ;; Why does this append a period to class methods?
(condition-case nil
(save-excursion
- (let (mname mlist (indent 0))
- ;; get current method (or class/module)
- (if (re-search-backward
- (concat "^[ \t]*" ruby-defun-beg-re "[ \t]+"
- "\\("
- ;; \\. and :: for class method
+ (let ((indent 0) mname mlist
+ (start (point))
+ (definition-re
+ (concat "^[ \t]*" ruby-defun-beg-re "[ \t]+"
+ "\\("
+ ;; \\. and :: for class methods
"\\([A-Za-z_]" ruby-symbol-re "*\\|\\.\\|::" "\\)"
- "+\\)")
- nil t)
- (progn
- (setq mname (match-string 2))
- (unless (string-equal "def" (match-string 1))
- (setq mlist (list mname) mname nil))
- (goto-char (match-beginning 1))
- (setq indent (current-column))
- (beginning-of-line)))
- ;; nest class/module
+ "+\\)")))
+ ;; Get the current method definition (or class/module).
+ (when (re-search-backward definition-re nil t)
+ (goto-char (match-beginning 1))
+ (when (ruby-block-contains-point start)
+ ;; We're inside the method, class or module.
+ (setq mname (match-string 2))
+ (unless (string-equal "def" (match-string 1))
+ (setq mlist (list mname) mname nil)))
+ (setq indent (current-column))
+ (beginning-of-line))
+ ;; Walk up the class/module nesting.
(while (and (> indent 0)
- (re-search-backward
- (concat
- "^[ \t]*\\(class\\|module\\)[ \t]+"
- "\\([A-Z]" ruby-symbol-re "*\\)")
- nil t))
+ (re-search-backward definition-re nil t))
(goto-char (match-beginning 1))
- (if (< (current-column) indent)
- (progn
- (setq mlist (cons (match-string 2) mlist))
- (setq indent (current-column))
- (beginning-of-line))))
+ (when (ruby-block-contains-point start)
+ (setq mlist (cons (match-string 2) mlist))
+ (setq indent (current-column))
+ (beginning-of-line)))
+ ;; Process the method name.
(when mname
(let ((mn (split-string mname "\\.\\|::")))
(if (cdr mn)
(progn
- (cond
- ((string-equal "" (car mn))
- (setq mn (cdr mn) mlist nil))
- ((string-equal "self" (car mn))
- (setq mn (cdr mn)))
- ((let ((ml (nreverse mlist)))
+ (unless (string-equal "self" (car mn)) ; def self.foo
+ ;; def C.foo
+ (let ((ml (nreverse mlist)))
+ ;; If the method name references one of the
+ ;; containing modules, drop the more nested ones.
(while ml
(if (string-equal (car ml) (car mn))
(setq mlist (nreverse (cdr ml)) ml nil))
- (or (setq ml (cdr ml)) (nreverse mlist))))))
- (if mlist
- (setcdr (last mlist) mn)
- (setq mlist mn))
- (setq mn (last mn 2))
- (setq mname (concat "." (cadr mn)))
- (setcdr mn nil))
- (setq mname (concat "#" mname)))))
- ;; generate string
+ (or (setq ml (cdr ml)) (nreverse mlist))))
+ (if mlist
+ (setcdr (last mlist) (butlast mn))
+ (setq mlist (butlast mn))))
+ (setq mname (concat "." (car (last mn)))))
+ ;; See if the method is in singleton class context.
+ (let ((in-singleton-class
+ (when (re-search-forward ruby-singleton-class-re start t)
+ (goto-char (match-beginning 0))
+ (ruby-block-contains-point start))))
+ (setq mname (concat
+ (if in-singleton-class "." "#")
+ mname))))))
+ ;; Generate the string.
(if (consp mlist)
(setq mlist (mapconcat (function identity) mlist "::")))
(if mname
(if mlist (concat mlist mname) mname)
mlist)))))
+(defun ruby-block-contains-point (pt)
+ (save-excursion
+ (save-match-data
+ (ruby-forward-sexp)
+ (> (point) pt))))
+
(defun ruby-brace-to-do-end (orig end)
(let (beg-marker end-marker)
(goto-char end)
;; Handle percent literals: %w(), %q{}, etc.
((concat "\\(?:^\\|[[ \t\n<+(,=]\\)" ruby-percent-literal-beg-re)
(1 (prog1 "|" (ruby-syntax-propertize-percent-literal end)))))
- (point) end))
+ (point) end)
+ (ruby-syntax-propertize-expansions start end))
(defun ruby-syntax-propertize-heredoc (limit)
(let ((ppss (syntax-ppss))
(string-to-syntax "|")))
;; Unclosed literal, leave the following text unpropertized.
((scan-error search-failed) (goto-char limit))))))
+
+ (defun ruby-syntax-propertize-expansions (start end)
+ (remove-text-properties start end '(ruby-expansion-match-data))
+ (goto-char start)
+ ;; Find all expression expansions and
+ ;; - save the match data to a text property, for font-locking later,
+ ;; - set the syntax of all double quotes and backticks to punctuation.
+ (while (re-search-forward ruby-expression-expansion-re end 'move)
+ (let ((beg (match-beginning 2))
+ (end (match-end 2)))
+ (when (and beg (save-excursion (nth 3 (syntax-ppss beg))))
+ (put-text-property beg (1+ beg) 'ruby-expansion-match-data
+ (match-data))
+ (goto-char beg)
+ (while (re-search-forward "[\"`]" end 'move)
+ (put-text-property (match-beginning 0) (match-end 0)
+ 'syntax-table (string-to-syntax ".")))))))
)
;; For Emacsen where syntax-propertize-rules is not (yet) available,
ruby-keyword-end-re)
2)
;; here-doc beginnings
- (list ruby-here-doc-beg-re 0 'font-lock-string-face)
+ `(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0))
+ 'font-lock-string-face))
;; variables
'("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\>"
2 font-lock-variable-name-face)
'("\\(^\\s *\\|[\[\{\(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" 2 font-lock-constant-face)
;; expression expansion
'(ruby-match-expression-expansion
- 0 font-lock-variable-name-face t)
+ 2 font-lock-variable-name-face t)
;; warn lower camel case
;'("\\<[a-z]+[a-z0-9]*[A-Z][A-Za-z0-9]*\\([!?]?\\|\\>\\)"
; 0 font-lock-warning-face)
"Additional expressions to highlight in Ruby mode.")
(defun ruby-match-expression-expansion (limit)
- (when (re-search-forward "[^\\]\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)" limit 'move)
- (or (ruby-in-ppss-context-p 'string)
- (ruby-match-expression-expansion limit))))
+ (let* ((prop 'ruby-expansion-match-data)
+ (pos (next-single-char-property-change (point) prop nil limit))
+ value)
+ (when (and pos (> pos (point)))
+ (goto-char pos)
+ (or (and (setq value (get-text-property pos prop))
+ (progn (set-match-data value) t))
+ (ruby-match-expression-expansion limit)))))
;;;###autoload
(define-derived-mode ruby-mode prog-mode "Ruby"
;;;###autoload
(add-to-list 'auto-mode-alist (cons (purecopy "\\.rb\\'") 'ruby-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist (cons (purecopy "Rakefile\\'") 'ruby-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist (cons (purecopy "\\.gemspec\\'") 'ruby-mode))
;;;###autoload
(dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8"))
(defun scheme-mode-variables ()
(set-syntax-table scheme-mode-syntax-table)
(setq local-abbrev-table scheme-mode-abbrev-table)
- (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
- (set (make-local-variable 'paragraph-separate) paragraph-start)
- (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
- (set (make-local-variable 'fill-paragraph-function) 'lisp-fill-paragraph)
+ (setq-local paragraph-start (concat "$\\|" page-delimiter))
+ (setq-local paragraph-separate paragraph-start)
+ (setq-local paragraph-ignore-fill-prefix t)
+ (setq-local fill-paragraph-function 'lisp-fill-paragraph)
;; Adaptive fill mode gets in the way of auto-fill,
;; and should make no difference for explicit fill
;; because lisp-fill-paragraph should do the job.
- (set (make-local-variable 'adaptive-fill-mode) nil)
- (set (make-local-variable 'indent-line-function) 'lisp-indent-line)
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
- (set (make-local-variable 'outline-regexp) ";;; \\|(....")
- (set (make-local-variable 'comment-start) ";")
- (set (make-local-variable 'comment-add) 1)
+ (setq-local adaptive-fill-mode nil)
+ (setq-local indent-line-function 'lisp-indent-line)
+ (setq-local parse-sexp-ignore-comments t)
+ (setq-local outline-regexp ";;; \\|(....")
+ (setq-local add-log-current-defun-function #'lisp-current-defun-name)
+ (setq-local comment-start ";")
+ (setq-local comment-add 1)
;; Look within the line for a ; following an even number of backslashes
;; after either a non-backslash or the line beginning.
- (set (make-local-variable 'comment-start-skip)
- "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
- (set (make-local-variable 'font-lock-comment-start-skip) ";+ *")
- (set (make-local-variable 'comment-column) 40)
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
- (set (make-local-variable 'lisp-indent-function) 'scheme-indent-function)
+ (setq-local comment-start-skip
+ "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
+ (setq-local font-lock-comment-start-skip ";+ *")
+ (setq-local comment-column 40)
+ (setq-local parse-sexp-ignore-comments t)
+ (setq-local lisp-indent-function 'scheme-indent-function)
(setq mode-line-process '("" scheme-mode-line-process))
- (set (make-local-variable 'imenu-case-fold-search) t)
+ (setq-local imenu-case-fold-search t)
(setq imenu-generic-expression scheme-imenu-generic-expression)
- (set (make-local-variable 'imenu-syntax-alist)
+ (setq-local imenu-syntax-alist
'(("+-*/.<>=?!$%_&~^:" . "w")))
- (set (make-local-variable 'font-lock-defaults)
- '((scheme-font-lock-keywords
- scheme-font-lock-keywords-1 scheme-font-lock-keywords-2)
- nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14"))
- beginning-of-defun
- (font-lock-mark-block-function . mark-defun)
- (font-lock-syntactic-face-function
- . scheme-font-lock-syntactic-face-function)
- (parse-sexp-lookup-properties . t)
- (font-lock-extra-managed-props syntax-table)))
- (set (make-local-variable 'lisp-doc-string-elt-property)
- 'scheme-doc-string-elt))
+ (setq font-lock-defaults
+ '((scheme-font-lock-keywords
+ scheme-font-lock-keywords-1 scheme-font-lock-keywords-2)
+ nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14"))
+ beginning-of-defun
+ (font-lock-mark-block-function . mark-defun)
+ (font-lock-syntactic-face-function
+ . scheme-font-lock-syntactic-face-function)
+ (parse-sexp-lookup-properties . t)
+ (font-lock-extra-managed-props syntax-table)))
+ (setq-local lisp-doc-string-elt-property 'scheme-doc-string-elt))
(defvar scheme-mode-line-process "")
Entering this mode runs the hooks `scheme-mode-hook' and then
`dsssl-mode-hook' and inserts the value of `dsssl-sgml-declaration' if
that variable's value is a string."
- (set (make-local-variable 'page-delimiter) "^;;;") ; ^L not valid SGML char
+ (setq-local page-delimiter "^;;;") ; ^L not valid SGML char
;; Insert a suitable SGML declaration into an empty buffer.
;; FIXME: This should use `auto-insert-alist' instead.
(and (zerop (buffer-size))
nil t (("+-*/.<>=?$%_&~^:" . "w"))
beginning-of-defun
(font-lock-mark-block-function . mark-defun)))
- (set (make-local-variable 'imenu-case-fold-search) nil)
+ (setq-local add-log-current-defun-function #'lisp-current-defun-name)
+ (setq-local imenu-case-fold-search nil)
(setq imenu-generic-expression dsssl-imenu-generic-expression)
- (set (make-local-variable 'imenu-syntax-alist)
- '(("+-*/.<>=?$%_&~^:" . "w"))))
+ (setq-local imenu-syntax-alist '(("+-*/.<>=?$%_&~^:" . "w"))))
;; Extra syntax for DSSSL. This isn't separated from Scheme, but
;; shouldn't cause much trouble in scheme-mode.
(make-local-variable 'sh-shell-file)
(make-local-variable 'sh-shell)
- (set (make-local-variable 'skeleton-pair-default-alist)
- sh-skeleton-pair-default-alist)
- (set (make-local-variable 'skeleton-end-hook)
- (lambda () (or (eolp) (newline) (indent-relative))))
-
- (set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$"))
- (set (make-local-variable 'paragraph-separate) paragraph-start)
- (set (make-local-variable 'comment-start) "# ")
- (set (make-local-variable 'comment-start-skip) "#+[\t ]*")
- (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table)
- (set (make-local-variable 'comint-dynamic-complete-functions)
- sh-dynamic-complete-functions)
+ (setq-local skeleton-pair-default-alist
+ sh-skeleton-pair-default-alist)
+ (setq-local skeleton-end-hook
+ (lambda () (or (eolp) (newline) (indent-relative))))
+
+ (setq-local paragraph-start (concat page-delimiter "\\|$"))
+ (setq-local paragraph-separate paragraph-start)
+ (setq-local comment-start "# ")
+ (setq-local comment-start-skip "#+[\t ]*")
+ (setq-local local-abbrev-table sh-mode-abbrev-table)
+ (setq-local comint-dynamic-complete-functions
+ sh-dynamic-complete-functions)
(add-hook 'completion-at-point-functions 'comint-completion-at-point nil t)
;; we can't look if previous line ended with `\'
- (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*")
- (set (make-local-variable 'imenu-case-fold-search) nil)
- (set (make-local-variable 'font-lock-defaults)
- `((sh-font-lock-keywords
- sh-font-lock-keywords-1 sh-font-lock-keywords-2)
- nil nil
- ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
- (font-lock-syntactic-face-function
- . sh-font-lock-syntactic-face-function)))
- (set (make-local-variable 'syntax-propertize-function)
- #'sh-syntax-propertize-function)
+ (setq-local comint-prompt-regexp "^[ \t]*")
+ (setq-local imenu-case-fold-search nil)
+ (setq font-lock-defaults
+ `((sh-font-lock-keywords
+ sh-font-lock-keywords-1 sh-font-lock-keywords-2)
+ nil nil
+ ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
+ (font-lock-syntactic-face-function
+ . sh-font-lock-syntactic-face-function)))
+ (setq-local syntax-propertize-function #'sh-syntax-propertize-function)
(add-hook 'syntax-propertize-extend-region-functions
#'syntax-propertize-multiline 'append 'local)
(sh-electric-here-document-mode 1)
- (set (make-local-variable 'skeleton-pair-alist) '((?` _ ?`)))
- (set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p)
- (set (make-local-variable 'skeleton-further-elements)
- '((< '(- (min sh-indentation (current-column))))))
- (set (make-local-variable 'skeleton-filter-function) 'sh-feature)
- (set (make-local-variable 'skeleton-newline-indent-rigidly) t)
- (set (make-local-variable 'defun-prompt-regexp)
- (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)"))
+ (setq-local skeleton-pair-alist '((?` _ ?`)))
+ (setq-local skeleton-pair-filter-function 'sh-quoted-p)
+ (setq-local skeleton-further-elements
+ '((< '(- (min sh-indentation (current-column))))))
+ (setq-local skeleton-filter-function 'sh-feature)
+ (setq-local skeleton-newline-indent-rigidly t)
+ (setq-local defun-prompt-regexp
+ (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)"))
;; Parse or insert magic number for exec, and set all variables depending
;; on the shell thus determined.
(sh-set-shell
(executable-set-magic shell (sh-feature sh-shell-arg)
no-query-flag insert-flag)))
(setq mode-line-process (format "[%s]" sh-shell))
- (set (make-local-variable 'sh-shell-variables) nil)
- (set (make-local-variable 'sh-shell-variables-initialized) nil)
- (set (make-local-variable 'imenu-generic-expression)
- (sh-feature sh-imenu-generic-expression))
+ (setq-local sh-shell-variables nil)
+ (setq-local sh-shell-variables-initialized nil)
+ (setq-local imenu-generic-expression
+ (sh-feature sh-imenu-generic-expression))
(let ((tem (sh-feature sh-mode-syntax-table-input)))
(when tem
- (set (make-local-variable 'sh-mode-syntax-table)
- (apply 'sh-mode-syntax-table tem))
+ (setq-local sh-mode-syntax-table
+ (apply 'sh-mode-syntax-table tem))
(set-syntax-table sh-mode-syntax-table)))
(dolist (var (sh-feature sh-variables))
(sh-remember-variable var))
- (if (set (make-local-variable 'sh-indent-supported-here)
- (sh-feature sh-indent-supported))
+ (if (setq-local sh-indent-supported-here
+ (sh-feature sh-indent-supported))
(progn
(message "Setting up indent for shell type %s" sh-shell)
(if sh-use-smie
(funcall mksym "rules")
:forward-token (funcall mksym "forward-token")
:backward-token (funcall mksym "backward-token")))
- (set (make-local-variable 'parse-sexp-lookup-properties) t)
- (set (make-local-variable 'sh-kw-alist) (sh-feature sh-kw))
+ (setq-local parse-sexp-lookup-properties t)
+ (setq-local sh-kw-alist (sh-feature sh-kw))
(let ((regexp (sh-feature sh-kws-for-done)))
(if regexp
- (set (make-local-variable 'sh-regexp-for-done)
- (sh-mkword-regexpr (regexp-opt regexp t)))))
+ (setq-local sh-regexp-for-done
+ (sh-mkword-regexpr (regexp-opt regexp t)))))
(message "setting up indent stuff")
;; sh-mode has already made indent-line-function local
;; but do it in case this is called before that.
- (set (make-local-variable 'indent-line-function) 'sh-indent-line))
+ (setq-local indent-line-function 'sh-indent-line))
(if sh-make-vars-local
(sh-make-vars-local))
(message "Indentation setup for shell type %s" sh-shell))
-;;; sql.el --- specialized comint.el for SQL interpreters
+;;; sql.el --- specialized comint.el for SQL interpreters -*- lexical-binding: t -*-
;; Copyright (C) 1998-2013 Free Software Foundation, Inc.
;; Hint for newbies: take a look at `dabbrev-expand', `abbrev-mode', and
;; `imenu-add-menubar-index'.
-;;; Requirements for Emacs 19.34:
-
-;; If you are using Emacs 19.34, you will have to get and install
-;; the file regexp-opt.el
-;; <URL:ftp://ftp.ifi.uio.no/pub/emacs/emacs-20.3/lisp/emacs-lisp/regexp-opt.el>
-;; and the custom package
-;; <URL:http://www.dina.kvl.dk/~abraham/custom/>.
-
;;; Bugs:
;; sql-ms now uses osql instead of isql. Osql flushes its error
;;
;; ;; Do something with `sql-user', `sql-password',
;; ;; `sql-database', and `sql-server'.
-;; (let ((params options))
-;; (if (not (string= "" sql-server))
-;; (setq params (append (list "-S" sql-server) params)))
-;; (if (not (string= "" sql-database))
-;; (setq params (append (list "-D" sql-database) params)))
-;; (if (not (string= "" sql-password))
-;; (setq params (append (list "-P" sql-password) params)))
+;; (let ((params
+;; (append
;; (if (not (string= "" sql-user))
-;; (setq params (append (list "-U" sql-user) params)))
+;; (list "-U" sql-user))
+;; (if (not (string= "" sql-password))
+;; (list "-P" sql-password))
+;; (if (not (string= "" sql-database))
+;; (list "-D" sql-database))
+;; (if (not (string= "" sql-server))
+;; (list "-S" sql-server))
+;; options)))
;; (sql-comint product params)))
;;
;; (sql-set-product-feature 'xyz
;;; Code:
+(require 'cl-lib)
(require 'comint)
;; Need the following to allow GNU Emacs 19 to compile the file.
(eval-when-compile
(require 'regexp-opt))
(require 'custom)
(require 'thingatpt)
-(eval-when-compile ;; needed in Emacs 19, 20
- (setq max-specpdl-size (max max-specpdl-size 2000)))
-
-(defun sql-signum (n)
- "Return 1, 0, or -1 to identify the sign of N."
- (cond
- ((not (numberp n)) nil)
- ((< n 0) -1)
- ((> n 0) 1)
- (t 0)))
(defvar font-lock-keyword-face)
(defvar font-lock-set-defaults)
(set
(group (const :tag "Product" sql-product)
(choice
- ,@(mapcar (lambda (prod-info)
- `(const :tag
- ,(or (plist-get (cdr prod-info) :name)
- (capitalize (symbol-name (car prod-info))))
- (quote ,(car prod-info))))
- sql-product-alist)))
+ ,@(mapcar
+ (lambda (prod-info)
+ `(const :tag
+ ,(or (plist-get (cdr prod-info) :name)
+ (capitalize
+ (symbol-name (car prod-info))))
+ (quote ,(car prod-info))))
+ sql-product-alist)))
(group (const :tag "Username" sql-user) string)
(group (const :tag "Password" sql-password) string)
(group (const :tag "Server" sql-server) string)
:group 'SQL)
(defcustom sql-product 'ansi
- "Select the SQL database product used so that buffers can be
-highlighted properly when you open them."
+ "Select the SQL database product used.
+This allows highlighting buffers properly when you open them."
:type `(choice
,@(mapcar (lambda (prod-info)
`(const :tag
(defvar sql-imenu-generic-expression
;; Items are in reverse order because they are rendered in reverse.
- '(("Rules/Defaults" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(rule\\|default\\)\\s-+\\(\\w+\\)" 3)
- ("Sequences" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*sequence\\s-+\\(\\w+\\)" 2)
- ("Triggers" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*trigger\\s-+\\(\\w+\\)" 2)
- ("Functions" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?function\\s-+\\(\\w+\\)" 3)
- ("Procedures" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?proc\\(edure\\)?\\s-+\\(\\w+\\)" 4)
- ("Packages" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3)
- ("Types" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*type\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3)
- ("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2)
- ("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3))
+ '(("Rules/Defaults" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:rule\\|default\\)\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\s-+\\(\\w+\\)" 1)
+ ("Sequences" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*sequence\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)
+ ("Triggers" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*trigger\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)
+ ("Functions" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?function\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)
+ ("Procedures" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?proc\\(?:edure\\)?\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)
+ ("Packages" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*package\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)
+ ("Types" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*type\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)
+ ("Indexes" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*index\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)
+ ("Tables/Views" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:table\\|view\\)\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1))
"Define interesting points in the SQL buffer for `imenu'.
This is used to set `imenu-generic-expression' when SQL mode is
;; Customization for ANSI
-(defcustom sql-ansi-statement-starters (regexp-opt '(
- "create" "alter" "drop"
- "select" "insert" "update" "delete" "merge"
- "grant" "revoke"
-))
- "Regexp of keywords that start SQL commands
+(defcustom sql-ansi-statement-starters
+ (regexp-opt '("create" "alter" "drop"
+ "select" "insert" "update" "delete" "merge"
+ "grant" "revoke"))
+ "Regexp of keywords that start SQL commands.
All products share this list; products should define a regexp to
identify additional keywords in a variable defined by
Used by `sql-rename-buffer'.")
(defun sql-buffer-live-p (buffer &optional product connection)
- "Returns non-nil if the process associated with buffer is live.
+ "Return non-nil if the process associated with buffer is live.
BUFFER can be a buffer object or a buffer name. The buffer must
-be a live buffer, have an running process attached to it, be in
+be a live buffer, have a running process attached to it, be in
`sql-interactive-mode', and, if PRODUCT or CONNECTION are
specified, it's `sql-product' or `sql-connection' must match."
(setq buffer (get-buffer buffer))
(and buffer
(buffer-live-p buffer)
- (get-buffer-process buffer)
(comint-check-proc buffer)
(with-current-buffer buffer
(and (derived-mode-p 'sql-interactive-mode)
;; Abbreviations -- if you want more of them, define them in your init
;; file. Abbrevs have to be enabled in your init file, too.
-(defvar sql-mode-abbrev-table nil
+(define-abbrev-table 'sql-mode-abbrev-table
+ '(("ins" "insert" nil nil t)
+ ("upd" "update" nil nil t)
+ ("del" "delete" nil nil t)
+ ("sel" "select" nil nil t)
+ ("proc" "procedure" nil nil t)
+ ("func" "function" nil nil t)
+ ("cr" "create" nil nil t))
"Abbrev table used in `sql-mode' and `sql-interactive-mode'.")
-(unless sql-mode-abbrev-table
- (define-abbrev-table 'sql-mode-abbrev-table nil))
-
-(mapc
- ;; In Emacs 22+, provide SYSTEM-FLAG to define-abbrev.
- (lambda (abbrev)
- (let ((name (car abbrev))
- (expansion (cdr abbrev)))
- (condition-case nil
- (define-abbrev sql-mode-abbrev-table name expansion nil 0 t)
- (error
- (define-abbrev sql-mode-abbrev-table name expansion)))))
- '(("ins" . "insert")
- ("upd" . "update")
- ("del" . "delete")
- ("sel" . "select")
- ("proc" . "procedure")
- ("func" . "function")
- ("cr" . "create")))
;; Syntax Table
"\\(?:\\w+\\s-+\\)*" ;; optional intervening keywords
"\\(?:table\\|view\\|\\(?:package\\|type\\)\\(?:\\s-+body\\)?\\|proc\\(?:edure\\)?"
"\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+"
+ "\\(?:if\\s-+not\\s-+exists\\s-+\\)?" ;; IF NOT EXISTS
"\\(\\w+\\)")
1 'font-lock-function-name-face))
you define your own `sql-mode-ansi-font-lock-keywords'. You may want
to add functions and PL/SQL keywords.")
-(defun sql-oracle-show-reserved-words ()
+(defun sql--oracle-show-reserved-words ()
;; This function is for use by the maintainer of SQL.EL only.
- (interactive)
(if (or (and (not (derived-mode-p 'sql-mode))
(not (derived-mode-p 'sql-interactive-mode)))
(not sql-buffer)
;; Postgres non-reserved words
(sql-font-lock-keywords-builder 'font-lock-builtin-face nil
"abort" "absolute" "access" "action" "add" "admin" "after" "aggregate"
-"also" "alter" "always" "assertion" "assignment" "at" "backward"
+"also" "alter" "always" "assertion" "assignment" "at" "attribute" "backward"
"before" "begin" "between" "by" "cache" "called" "cascade" "cascaded"
"catalog" "chain" "characteristics" "checkpoint" "class" "close"
"cluster" "coalesce" "comment" "comments" "commit" "committed"
"delimiters" "dictionary" "disable" "discard" "document" "domain"
"drop" "each" "enable" "encoding" "encrypted" "enum" "escape"
"exclude" "excluding" "exclusive" "execute" "exists" "explain"
-"external" "extract" "family" "first" "float" "following" "force"
+"extension" "external" "extract" "family" "first" "float" "following" "force"
"forward" "function" "functions" "global" "granted" "greatest"
"handler" "header" "hold" "hour" "identity" "if" "immediate"
"immutable" "implicit" "including" "increment" "index" "indexes"
"inherit" "inherits" "inline" "inout" "input" "insensitive" "insert"
-"instead" "invoker" "isolation" "key" "language" "large" "last"
-"lc_collate" "lc_ctype" "least" "level" "listen" "load" "local"
+"instead" "invoker" "isolation" "key" "label" "language" "large" "last"
+"lc_collate" "lc_ctype" "leakproof" "least" "level" "listen" "load" "local"
"location" "lock" "login" "mapping" "match" "maxvalue" "minute"
-"minvalue" "mode" "month" "move" "name" "names" "national" "nchar"
+"minvalue" "mode" "month" "move" "names" "national" "nchar"
"next" "no" "nocreatedb" "nocreaterole" "nocreateuser" "noinherit"
-"nologin" "none" "nosuperuser" "nothing" "notify" "nowait" "nullif"
-"nulls" "object" "of" "oids" "operator" "option" "options" "out"
-"overlay" "owned" "owner" "parser" "partial" "partition" "password"
-"plans" "position" "preceding" "prepare" "prepared" "preserve" "prior"
+"nologin" "none" "noreplication" "nosuperuser" "nothing" "notify" "nowait" "nullif"
+"nulls" "object" "of" "off" "oids" "operator" "option" "options" "out"
+"overlay" "owned" "owner" "parser" "partial" "partition" "passing" "password"
+"plans" "position" "preceding" "precision" "prepare" "prepared" "preserve" "prior"
"privileges" "procedural" "procedure" "quote" "range" "read"
-"reassign" "recheck" "recursive" "reindex" "relative" "release"
-"rename" "repeatable" "replace" "replica" "reset" "restart" "restrict"
+"reassign" "recheck" "recursive" "ref" "reindex" "relative" "release"
+"rename" "repeatable" "replace" "replica" "replication" "reset" "restart" "restrict"
"returns" "revoke" "role" "rollback" "row" "rows" "rule" "savepoint"
-"schema" "scroll" "search" "second" "security" "sequence" "sequences"
+"schema" "scroll" "search" "second" "security" "sequence"
"serializable" "server" "session" "set" "setof" "share" "show"
-"simple" "stable" "standalone" "start" "statement" "statistics"
+"simple" "snapshot" "stable" "standalone" "start" "statement" "statistics"
"stdin" "stdout" "storage" "strict" "strip" "substring" "superuser"
"sysid" "system" "tables" "tablespace" "temp" "template" "temporary"
-"transaction" "treat" "trigger" "trim" "truncate" "trusted" "type"
-"unbounded" "uncommitted" "unencrypted" "unknown" "unlisten" "until"
-"update" "vacuum" "valid" "validator" "value" "values" "version"
-"view" "volatile" "whitespace" "work" "wrapper" "write"
-"xmlattributes" "xmlconcat" "xmlelement" "xmlforest" "xmlparse"
-"xmlpi" "xmlroot" "xmlserialize" "year" "yes"
+"transaction" "treat" "trim" "truncate" "trusted" "type" "types"
+"unbounded" "uncommitted" "unencrypted" "unlisten" "unlogged" "until"
+"update" "vacuum" "valid" "validate" "validator" "value" "values" "varying" "version"
+"view" "volatile" "whitespace" "without" "work" "wrapper" "write"
+"xmlattributes" "xmlconcat" "xmlelement" "xmlexists" "xmlforest" "xmlparse"
+"xmlpi" "xmlroot" "xmlserialize" "year" "yes" "zone"
)
;; Postgres Reserved
(sql-font-lock-keywords-builder 'font-lock-keyword-face nil
-"all" "analyse" "analyze" "and" "any" "array" "asc" "as" "asymmetric"
+"all" "analyse" "analyze" "and" "array" "asc" "as" "asymmetric"
"authorization" "binary" "both" "case" "cast" "check" "collate"
"column" "concurrently" "constraint" "create" "cross"
"current_catalog" "current_date" "current_role" "current_schema"
"fetch" "foreign" "for" "freeze" "from" "full" "grant" "group"
"having" "ilike" "initially" "inner" "in" "intersect" "into" "isnull"
"is" "join" "leading" "left" "like" "limit" "localtime"
-"localtimestamp" "natural" "notnull" "not" "null" "off" "offset"
+"localtimestamp" "natural" "notnull" "not" "null" "offset"
"only" "on" "order" "or" "outer" "overlaps" "over" "placing" "primary"
"references" "returning" "right" "select" "session_user" "similar"
"some" "symmetric" "table" "then" "to" "trailing" "true" "union"
"unique" "user" "using" "variadic" "verbose" "when" "where" "window"
"with"
+)
+
+ ;; Postgres PL/pgSQL
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
+"assign" "if" "case" "loop" "while" "for" "foreach" "exit" "elsif" "return"
+"raise" "execsql" "dynexecute" "perform" "getdiag" "open" "fetch" "move" "close"
)
;; Postgres Data Types
"bigint" "bigserial" "bit" "bool" "boolean" "box" "bytea" "char"
"character" "cidr" "circle" "date" "decimal" "double" "float4"
"float8" "inet" "int" "int2" "int4" "int8" "integer" "interval" "line"
-"lseg" "macaddr" "money" "numeric" "path" "point" "polygon"
-"precision" "real" "serial" "serial4" "serial8" "smallint" "text"
+"lseg" "macaddr" "money" "name" "numeric" "path" "point" "polygon"
+"precision" "real" "serial" "serial4" "serial8" "sequences" "smallint" "text"
"time" "timestamp" "timestamptz" "timetz" "tsquery" "tsvector"
-"txid_snapshot" "uuid" "varbit" "varchar" "varying" "without"
+"txid_snapshot" "unknown" "uuid" "varbit" "varchar" "varying" "without"
"xml" "zone"
)))
(append keywords old-val))))))
(defun sql-for-each-login (login-params body)
- "Iterates through login parameters and returns a list of results."
-
+ "Iterate through login parameters and return a list of results."
(delq nil
(mapcar
(lambda (param)
- (let ((token (or (and (listp param) (car param)) param))
- (plist (or (and (listp param) (cdr param)) nil)))
-
+ (let ((token (or (car-safe param) param))
+ (plist (cdr-safe param)))
(funcall body token plist)))
login-params)))
local variable."
(save-excursion (comint-bol nil) (point))))
+;;; SMIE support
+
+;; Needs a lot more love than I can provide. --Stef
+
+;; (require 'smie)
+
+;; (defconst sql-smie-grammar
+;; (smie-prec2->grammar
+;; (smie-bnf->prec2
+;; ;; Partly based on http://www.h2database.com/html/grammar.html
+;; '((cmd ("SELECT" select-exp "FROM" select-table-exp)
+;; )
+;; (select-exp ("*") (exp) (exp "AS" column-alias))
+;; (column-alias)
+;; (select-table-exp (table-exp "WHERE" exp) (table-exp))
+;; (table-exp)
+;; (exp ("CASE" exp "WHEN" exp "THEN" exp "ELSE" exp "END")
+;; ("CASE" exp "WHEN" exp "THEN" exp "END"))
+;; ;; Random ad-hoc additions.
+;; (foo (foo "," foo))
+;; )
+;; '((assoc ",")))))
+
+;; (defun sql-smie-rules (kind token)
+;; (pcase (cons kind token)
+;; (`(:list-intro . ,_) t)
+;; (`(:before . "(") (smie-rule-parent))))
+
;;; Motion Functions
(defun sql-statement-regexp (prod)
"\\>")))
(defun sql-beginning-of-statement (arg)
- "Moves the cursor to the beginning of the current SQL statement."
+ "Move to the beginning of the current SQL statement."
(interactive "p")
(let ((here (point))
(beginning-of-line)
;; If we didn't move, try again
(when (= here (point))
- (sql-beginning-of-statement (* 2 (sql-signum arg))))))
+ (sql-beginning-of-statement (* 2 (cl-signum arg))))))
(defun sql-end-of-statement (arg)
- "Moves the cursor to the end of the current SQL statement."
+ "Move to the end of the current SQL statement."
(interactive "p")
(let ((term (sql-get-product-feature sql-product :terminator))
(re-search (if (> 0 arg) 're-search-backward 're-search-forward))
(when (consp term)
(setq term (car term)))
;; Iterate until we've moved the desired number of stmt ends
- (while (not (= (sql-signum arg) 0))
+ (while (not (= (cl-signum arg) 0))
;; if we're looking at the terminator, jump by 2
(if (or (and (> 0 arg) (looking-back term))
(and (< 0 arg) (looking-at term)))
(setq arg 0)
;; count it if we're not in a comment
(unless (nth 7 (syntax-ppss))
- (setq arg (- arg (sql-signum arg))))))
+ (setq arg (- arg (cl-signum arg))))))
(goto-char (if (match-data)
(match-end 0)
here))))
doc))
;;;###autoload
-(defun sql-help ()
- "Show short help for the SQL modes.
+(eval
+ ;; FIXME: This dynamic-docstring-function trick doesn't work for byte-compiled
+ ;; functions, because of the lazy-loading of docstrings, which strips away
+ ;; text properties.
+ '(defun sql-help ()
+ #("Show short help for the SQL modes.
Use an entry function to open an interactive SQL buffer. This buffer is
usually named `*SQL*'. The name of the major mode is SQLi.
In this SQL buffer (SQL mode), you can send the region or the entire
buffer to the interactive SQL buffer (SQLi mode). The results are
appended to the SQLi buffer without disturbing your SQL buffer."
+ 0 1 (dynamic-docstring-function sql--make-help-docstring))
(interactive)
+ (describe-function 'sql-help)))
- ;; Insert references to loaded products into the help buffer string
- (let ((doc (documentation 'sql-help t))
- changedp)
- (setq changedp nil)
-
- ;; Insert FREE software list
- (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]FREE\\s-*\n" doc 0)
- (setq doc (replace-match (sql-help-list-products (match-string 1 doc) t)
- t t doc 0)
- changedp t))
-
- ;; Insert non-FREE software list
- (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]NONFREE\\s-*\n" doc 0)
- (setq doc (replace-match (sql-help-list-products (match-string 1 doc) nil)
- t t doc 0)
- changedp t))
+(defun sql--make-help-docstring (doc _fun)
+ "Insert references to loaded products into the help buffer string."
- ;; If we changed the help text, save the change so that the help
- ;; sub-system will see it
- (when changedp
- (put 'sql-help 'function-documentation doc)))
+ ;; Insert FREE software list
+ (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]FREE\\s-*\n" doc 0)
+ (setq doc (replace-match (sql-help-list-products (match-string 1 doc) t)
+ t t doc 0)))
- ;; Call help on this function
- (describe-function 'sql-help))
-
-(defun sql-read-passwd (prompt &optional default)
- "Read a password using PROMPT. Optional DEFAULT is password to start with."
- (read-passwd prompt nil default))
+ ;; Insert non-FREE software list
+ (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]NONFREE\\s-*\n" doc 0)
+ (setq doc (replace-match (sql-help-list-products (match-string 1 doc) nil)
+ t t doc 0)))
+ doc)
(defun sql-get-login-ext (symbol prompt history-var plist)
"Prompt user with extended login parameters.
(read-number prompt (or default last-value 0)))
(t
- (let ((r (read-from-minibuffer prompt-def last-value nil nil history-var nil)))
- (if (string= "" r) (or default "") r)))))))
+ (read-string prompt-def last-value history-var default))))))
(defun sql-get-login (&rest what)
"Get username, password and database from the user.
In order to ask the user for username, password and database, call the
function like this: (sql-get-login 'user 'password 'database)."
- (interactive)
- (mapcar
- (lambda (w)
- (let ((token (or (and (consp w) (car w)) w))
- (plist (or (and (consp w) (cdr w)) nil)))
-
- (cond
- ((eq token 'user) ; user
- (sql-get-login-ext 'sql-user "User: " 'sql-user-history plist))
+ (dolist (w what)
+ (let ((plist (cdr-safe w)))
+ (pcase (or (car-safe w) w)
+ (`user
+ (sql-get-login-ext 'sql-user "User: " 'sql-user-history plist))
- ((eq token 'password) ; password
- (setq-default sql-password
- (sql-read-passwd "Password: " sql-password)))
+ (`password
+ (setq-default sql-password
+ (read-passwd "Password: " nil sql-password)))
- ((eq token 'server) ; server
- (sql-get-login-ext 'sql-server "Server: " 'sql-server-history plist))
+ (`server
+ (sql-get-login-ext 'sql-server "Server: " 'sql-server-history plist))
- ((eq token 'database) ; database
- (sql-get-login-ext 'sql-database "Database: " 'sql-database-history plist))
+ (`database
+ (sql-get-login-ext 'sql-database "Database: "
+ 'sql-database-history plist))
- ((eq token 'port) ; port
- (sql-get-login-ext 'sql-port "Port: " nil (append '(:number t) plist))))))
- what))
+ (`port
+ (sql-get-login-ext 'sql-port "Port: "
+ nil (append '(:number t) plist)))))))
(defun sql-find-sqli-buffer (&optional product connection)
- "Returns the name of the current default SQLi buffer or nil.
+ "Return the name of the current default SQLi buffer or nil.
In order to qualify, the SQLi buffer must be alive, be in
`sql-interactive-mode' and have a process."
(let ((buf sql-buffer)
(sql-for-each-login
(sql-get-product-feature sql-product :sqli-login)
(lambda (token plist)
- (cond
- ((eq token 'user)
+ (pcase token
+ (`user
(unless (string= "" sql-user)
(list "/" sql-user)))
- ((eq token 'port)
+ (`port
(unless (or (not (numberp sql-port))
(= 0 sql-port))
(list ":" (number-to-string sql-port))))
- ((eq token 'server)
+ (`server
(unless (string= "" sql-server)
(list "."
(if (plist-member plist :file)
(file-name-nondirectory sql-server)
sql-server))))
- ((eq token 'database)
+ (`database
(unless (string= "" sql-database)
(list "@"
(if (plist-member plist :file)
(file-name-nondirectory sql-database)
sql-database))))
- ((eq token 'password) nil)
- (t nil))))))))
+ ;; (`password nil)
+ (_ nil))))))))
;; If there's a connection, use it and the name thus far
(if sql-connection
(nreverse results)))
(defun sql-execute (sqlbuf outbuf command enhanced arg)
- "Executes a command in a SQL interactive buffer and captures the output.
+ "Execute a command in a SQL interactive buffer and capture the output.
The commands are run in SQLBUF and the output saved in OUTBUF.
COMMAND must be a string, a function or a list of such elements.
strings are formatted with ARG and executed.
If the results are empty the OUTBUF is deleted, otherwise the
-buffer is popped into a view window. "
+buffer is popped into a view window."
(mapc
(lambda (c)
(cond
(defvar sql-completion-sqlbuf nil)
-(defun sql-try-completion (string collection &optional predicate)
+(defun sql--completion-table (string pred action)
(when sql-completion-sqlbuf
- (with-current-buffer sql-completion-sqlbuf
- (let ((schema (and (string-match "\\`\\(\\sw\\(:?\\sw\\|\\s_\\)*\\)[.]" string)
- (downcase (match-string 1 string)))))
-
- ;; If we haven't loaded any object name yet, load local schema
- (unless sql-completion-object
- (sql-build-completions nil))
-
- ;; If they want another schema, load it if we haven't yet
- (when schema
- (let ((schema-dot (concat schema "."))
- (schema-len (1+ (length schema)))
- (names sql-completion-object)
- has-schema)
-
- (while (and (not has-schema) names)
- (setq has-schema (and
- (>= (length (car names)) schema-len)
- (string= schema-dot
- (downcase (substring (car names)
- 0 schema-len))))
- names (cdr names)))
- (unless has-schema
- (sql-build-completions schema)))))
-
- ;; Try to find the completion
- (cond
- ((not predicate)
- (try-completion string sql-completion-object))
- ((eq predicate t)
- (all-completions string sql-completion-object))
- ((eq predicate 'lambda)
- (test-completion string sql-completion-object))
- ((eq (car predicate) 'boundaries)
- (completion-boundaries string sql-completion-object nil (cdr predicate)))))))
+ (with-current-buffer sql-completion-sqlbuf
+ (let ((schema (and (string-match "\\`\\(\\sw\\(:?\\sw\\|\\s_\\)*\\)[.]" string)
+ (downcase (match-string 1 string)))))
+
+ ;; If we haven't loaded any object name yet, load local schema
+ (unless sql-completion-object
+ (sql-build-completions nil))
+
+ ;; If they want another schema, load it if we haven't yet
+ (when schema
+ (let ((schema-dot (concat schema "."))
+ (schema-len (1+ (length schema)))
+ (names sql-completion-object)
+ has-schema)
+
+ (while (and (not has-schema) names)
+ (setq has-schema (and
+ (>= (length (car names)) schema-len)
+ (string= schema-dot
+ (downcase (substring (car names)
+ 0 schema-len))))
+ names (cdr names)))
+ (unless has-schema
+ (sql-build-completions schema)))))
+
+ ;; Try to find the completion
+ (complete-with-action action sql-completion-object string pred))))
(defun sql-read-table-name (prompt)
"Read the name of a database table."
(completion-ignore-case t))
(if (sql-get-product-feature product :completion-object)
- (completing-read prompt (function sql-try-completion)
+ (completing-read prompt #'sql--completion-table
nil nil tname)
(read-from-minibuffer prompt tname))))
(if sql-mode-menu
(easy-menu-add sql-mode-menu)); XEmacs
+ ;; (smie-setup sql-smie-grammar #'sql-smie-rules)
(set (make-local-variable 'comment-start) "--")
;; Make each buffer in sql-mode remember the "current" SQLi buffer.
(make-local-variable 'sql-buffer)
(set (make-local-variable 'paragraph-separate) "[\f]*$")
(set (make-local-variable 'paragraph-start) "[\n\f]")
;; Abbrevs
- (setq abbrev-all-caps 1)
+ (setq-local abbrev-all-caps 1)
;; Contains the name of database objects
(set (make-local-variable 'sql-contains-names) t)
;; Catch changes to sql-product and highlight accordingly
(setq set-params
(mapcar
(lambda (v)
- (cond
- ((eq (car v) 'sql-user) 'user)
- ((eq (car v) 'sql-password) 'password)
- ((eq (car v) 'sql-server) 'server)
- ((eq (car v) 'sql-database) 'database)
- ((eq (car v) 'sql-port) 'port)
- (t (car v))))
+ (pcase (car v)
+ (`sql-user 'user)
+ (`sql-password 'password)
+ (`sql-server 'server)
+ (`sql-database 'database)
+ (`sql-port 'port)
+ (s s)))
(cdr connect-set)))
;; the remaining params (w/o the connection params)
;; Start the SQLi session with revised list of login parameters
(eval `(let ((,param-var ',rem-params))
- (sql-product-interactive sql-product new-name))))
+ (sql-product-interactive ',sql-product ',new-name))))
(message "SQL Connection <%s> does not exist" connection)
nil)))
(if (assoc name alist)
(message "Connection <%s> already exists" name)
(setq connect
- (append (list name)
- (sql-for-each-login
- `(product ,@login)
- (lambda (token _plist)
- (cond
- ((eq token 'product) `(sql-product ',product))
- ((eq token 'user) `(sql-user ,user))
- ((eq token 'database) `(sql-database ,database))
- ((eq token 'server) `(sql-server ,server))
- ((eq token 'port) `(sql-port ,port)))))))
+ (cons name
+ (sql-for-each-login
+ `(product ,@login)
+ (lambda (token _plist)
+ (pcase token
+ (`product `(sql-product ',product))
+ (`user `(sql-user ,user))
+ (`database `(sql-database ,database))
+ (`server `(sql-server ,server))
+ (`port `(sql-port ,port)))))))
(setq alist (append alist (list connect)))
(customize-set-variable 'sql-connection-alist alist)))))))
(defun sql-connection-menu-filter (tail)
- "Generates menu entries for using each connection."
+ "Generate menu entries for using each connection."
(append
(mapcar
(lambda (conn)
new-sqli-buffer)
;; Get credentials.
- (apply 'sql-get-login (sql-get-product-feature product :sqli-login))
+ (apply #'sql-get-login
+ (sql-get-product-feature product :sqli-login))
;; Connect to database.
(message "Login...")
(sql-comint product parameter)))
(defun sql-oracle-save-settings (sqlbuf)
- "Saves most SQL*Plus settings so they may be reset by \\[sql-redirect]."
+ "Save most SQL*Plus settings so they may be reset by \\[sql-redirect]."
;; Note: does not capture the following settings:
;;
;; APPINFO
;; Restore the changed settings
(sql-redirect sqlbuf saved-settings))
-(defun sql-oracle-list-all (sqlbuf outbuf enhanced table-name)
+(defun sql-oracle-list-all (sqlbuf outbuf enhanced _table-name)
;; Query from USER_OBJECTS or ALL_OBJECTS
(let ((settings (sql-oracle-save-settings sqlbuf))
(simple-sql
(sql-oracle-restore-settings sqlbuf settings)))
-(defun sql-oracle-list-table (sqlbuf outbuf enhanced table-name)
+(defun sql-oracle-list-table (sqlbuf outbuf _enhanced table-name)
"Implements :list-table under Oracle."
(let ((settings (sql-oracle-save-settings sqlbuf)))
"Create comint buffer and connect to Sybase."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params options))
- (if (not (string= "" sql-server))
- (setq params (append (list "-S" sql-server) params)))
- (if (not (string= "" sql-database))
- (setq params (append (list "-D" sql-database) params)))
- (if (not (string= "" sql-password))
- (setq params (append (list "-P" sql-password) params)))
- (if (not (string= "" sql-user))
- (setq params (append (list "-U" sql-user) params)))
+ (let ((params
+ (append
+ (if (not (string= "" sql-user))
+ (list "-U" sql-user))
+ (if (not (string= "" sql-password))
+ (list "-P" sql-password))
+ (if (not (string= "" sql-database))
+ (list "-D" sql-database))
+ (if (not (string= "" sql-server))
+ (list "-S" sql-server))
+ options)))
(sql-comint product params)))
\f
"Create comint buffer and connect to SQLite."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params))
- (if (not (string= "" sql-database))
- (setq params (append (list (expand-file-name sql-database))
- params)))
- (setq params (append options params))
+ (let ((params
+ (append options
+ (if (not (string= "" sql-database))
+ `(,(expand-file-name sql-database))))))
(sql-comint product params)))
-(defun sql-sqlite-completion-object (sqlbuf schema)
+(defun sql-sqlite-completion-object (sqlbuf _schema)
(sql-redirect-value sqlbuf ".tables" "\\sw\\(?:\\sw\\|\\s_\\)*" 0))
\f
"Create comint buffer and connect to MySQL."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params))
- (if (not (string= "" sql-database))
- (setq params (append (list sql-database) params)))
- (if (not (string= "" sql-server))
- (setq params (append (list (concat "--host=" sql-server)) params)))
- (if (not (= 0 sql-port))
- (setq params (append (list (concat "--port=" (number-to-string sql-port))) params)))
- (if (not (string= "" sql-password))
- (setq params (append (list (concat "--password=" sql-password)) params)))
- (if (not (string= "" sql-user))
- (setq params (append (list (concat "--user=" sql-user)) params)))
- (setq params (append options params))
+ (let ((params
+ (append
+ options
+ (if (not (string= "" sql-user))
+ (list (concat "--user=" sql-user)))
+ (if (not (string= "" sql-password))
+ (list (concat "--password=" sql-password)))
+ (if (not (= 0 sql-port))
+ (list (concat "--port=" (number-to-string sql-port))))
+ (if (not (string= "" sql-server))
+ (list (concat "--host=" sql-server)))
+ (if (not (string= "" sql-database))
+ (list sql-database)))))
(sql-comint product params)))
\f
"Create comint buffer and connect to Solid."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params options))
- ;; It only makes sense if both username and password are there.
- (if (not (or (string= "" sql-user)
- (string= "" sql-password)))
- (setq params (append (list sql-user sql-password) params)))
- (if (not (string= "" sql-server))
- (setq params (append (list sql-server) params)))
+ (let ((params
+ (append
+ (if (not (string= "" sql-server))
+ (list sql-server))
+ ;; It only makes sense if both username and password are there.
+ (if (not (or (string= "" sql-user)
+ (string= "" sql-password)))
+ (list sql-user sql-password))
+ options)))
(sql-comint product params)))
\f
"Create comint buffer and connect to Microsoft SQL Server."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params options))
- (if (not (string= "" sql-server))
- (setq params (append (list "-S" sql-server) params)))
- (if (not (string= "" sql-database))
- (setq params (append (list "-d" sql-database) params)))
- (if (not (string= "" sql-user))
- (setq params (append (list "-U" sql-user) params)))
- (if (not (string= "" sql-password))
- (setq params (append (list "-P" sql-password) params))
- (if (string= "" sql-user)
- ;; if neither user nor password is provided, use system
- ;; credentials.
- (setq params (append (list "-E") params))
- ;; If -P is passed to ISQL as the last argument without a
- ;; password, it's considered null.
- (setq params (append params (list "-P")))))
+ (let ((params
+ (append
+ (if (not (string= "" sql-user))
+ (list "-U" sql-user))
+ (if (not (string= "" sql-database))
+ (list "-d" sql-database))
+ (if (not (string= "" sql-server))
+ (list "-S" sql-server))
+ options)))
+ (setq params
+ (if (not (string= "" sql-password))
+ `("-P" ,sql-password ,@params)
+ (if (string= "" sql-user)
+ ;; If neither user nor password is provided, use system
+ ;; credentials.
+ `("-E" ,@params)
+ ;; If -P is passed to ISQL as the last argument without a
+ ;; password, it's considered null.
+ `(,@params "-P"))))
(sql-comint product params)))
\f
(defun sql-comint-postgres (product options)
"Create comint buffer and connect to Postgres."
- ;; username and password are ignored. Mark Stosberg suggest to add
- ;; the database at the end. Jason Beegan suggest using --pset and
+ ;; username and password are ignored. Mark Stosberg suggests to add
+ ;; the database at the end. Jason Beegan suggests using --pset and
;; pager=off instead of \\o|cat. The later was the solution by
;; Gregor Zych. Jason's suggestion is the default value for
;; sql-postgres-options.
- (let ((params options))
- (if (not (string= "" sql-database))
- (setq params (append params (list sql-database))))
- (if (not (string= "" sql-server))
- (setq params (append (list "-h" sql-server) params)))
- (if (not (string= "" sql-user))
- (setq params (append (list "-U" sql-user) params)))
- (if (not (= 0 sql-port))
- (setq params (append (list "-p" (number-to-string sql-port)) params)))
+ (let ((params
+ (append
+ (if (not (= 0 sql-port))
+ (list "-p" (number-to-string sql-port)))
+ (if (not (string= "" sql-user))
+ (list "-U" sql-user))
+ (if (not (string= "" sql-server))
+ (list "-h" sql-server))
+ options
+ (if (not (string= "" sql-database))
+ (list sql-database)))))
(sql-comint product params)))
(defun sql-postgres-completion-object (sqlbuf schema)
- (let (cl re fs a r)
- (sql-redirect sqlbuf "\\t on")
- (setq a (car (sql-redirect-value sqlbuf "\\a" "Output format is \\(.*\\)[.]$" 1)))
- (when (string= a "aligned")
- (sql-redirect sqlbuf "\\a"))
- (setq fs (or (car (sql-redirect-value sqlbuf "\\f" "Field separator is \"\\(.\\)[.]$" 1)) "|"))
-
- (setq re (concat "^\\([^" fs "]*\\)" fs "\\([^" fs "]*\\)" fs "[^" fs "]*" fs "[^" fs "]*$"))
- (setq cl (if (not schema)
- (sql-redirect-value sqlbuf "\\d" re '(1 2))
- (append (sql-redirect-value sqlbuf (format "\\dt %s.*" schema) re '(1 2))
- (sql-redirect-value sqlbuf (format "\\dv %s.*" schema) re '(1 2))
- (sql-redirect-value sqlbuf (format "\\ds %s.*" schema) re '(1 2)))))
-
- ;; Restore tuples and alignment to what they were
- (sql-redirect sqlbuf "\\t off")
- (when (not (string= a "aligned"))
+ (sql-redirect sqlbuf "\\t on")
+ (let ((aligned
+ (string= "aligned"
+ (car (sql-redirect-value
+ sqlbuf "\\a"
+ "Output format is \\(.*\\)[.]$" 1)))))
+ (when aligned
(sql-redirect sqlbuf "\\a"))
-
- ;; Return the list of table names (public schema name can be omitted)
- (mapcar (lambda (tbl)
- (if (string= (car tbl) "public")
- (cadr tbl)
- (format "%s.%s" (car tbl) (cadr tbl))))
- cl)))
+ (let* ((fs (or (car (sql-redirect-value
+ sqlbuf "\\f" "Field separator is \"\\(.\\)[.]$" 1))
+ "|"))
+ (re (concat "^\\([^" fs "]*\\)" fs "\\([^" fs "]*\\)"
+ fs "[^" fs "]*" fs "[^" fs "]*$"))
+ (cl (if (not schema)
+ (sql-redirect-value sqlbuf "\\d" re '(1 2))
+ (append (sql-redirect-value
+ sqlbuf (format "\\dt %s.*" schema) re '(1 2))
+ (sql-redirect-value
+ sqlbuf (format "\\dv %s.*" schema) re '(1 2))
+ (sql-redirect-value
+ sqlbuf (format "\\ds %s.*" schema) re '(1 2))))))
+
+ ;; Restore tuples and alignment to what they were.
+ (sql-redirect sqlbuf "\\t off")
+ (when (not aligned)
+ (sql-redirect sqlbuf "\\a"))
+
+ ;; Return the list of table names (public schema name can be omitted)
+ (mapcar (lambda (tbl)
+ (if (string= (car tbl) "public")
+ (cadr tbl)
+ (format "%s.%s" (car tbl) (cadr tbl))))
+ cl))))
\f
"Create comint buffer and connect to Interbase."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params options))
- (if (not (string= "" sql-user))
- (setq params (append (list "-u" sql-user) params)))
- (if (not (string= "" sql-password))
- (setq params (append (list "-p" sql-password) params)))
- (if (not (string= "" sql-database))
- (setq params (cons sql-database params))) ; add to the front!
+ (let ((params
+ (append
+ (if (not (string= "" sql-database))
+ (list sql-database)) ; Add to the front!
+ (if (not (string= "" sql-password))
+ (list "-p" sql-password))
+ (if (not (string= "" sql-user))
+ (list "-u" sql-user))
+ options)))
(sql-comint product params)))
\f
"Create comint buffer and connect to Linter."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params options)
- (login nil)
- (old-mbx (getenv "LINTER_MBX")))
- (if (not (string= "" sql-user))
- (setq login (concat sql-user "/" sql-password)))
- (setq params (append (list "-u" login) params))
- (if (not (string= "" sql-server))
- (setq params (append (list "-n" sql-server) params)))
- (if (string= "" sql-database)
- (setenv "LINTER_MBX" nil)
- (setenv "LINTER_MBX" sql-database))
- (sql-comint product params)
- (setenv "LINTER_MBX" old-mbx)))
+ (let* ((login
+ (if (not (string= "" sql-user))
+ (concat sql-user "/" sql-password)))
+ (params
+ (append
+ (if (not (string= "" sql-server))
+ (list "-n" sql-server))
+ (list "-u" login)
+ options)))
+ (cl-letf (((getenv "LINTER_MBX")
+ (unless (string= "" sql-database) sql-database)))
+ (sql-comint product params))))
\f
(mapc 'funcall (nreverse commands))
;; If we were told only to open a new client, obey
- ;; `initial-buffer-choice' if it specifies a file.
- (unless (or files commands)
- (if (stringp initial-buffer-choice)
- (find-file initial-buffer-choice)
- (switch-to-buffer (get-buffer-create "*scratch*")
- 'norecord)))
+ ;; `initial-buffer-choice' if it specifies a file
+ ;; or a function.
+ (unless (or files commands)
+ (let ((buf
+ (cond ((stringp initial-buffer-choice)
+ (find-file-noselect initial-buffer-choice))
+ ((functionp initial-buffer-choice)
+ (funcall initial-buffer-choice)))))
+ (switch-to-buffer
+ (if (buffer-live-p buf) buf (get-buffer-create "*scratch*"))
+ 'norecord)))
;; Delete the client if necessary.
(cond
ses--default-printer
ses--deferred-narrow ses--deferred-recalc
ses--deferred-write ses--file-format
+ ses--named-cell-hashmap
(ses--header-hscroll . -1) ; Flag for "initial recalc needed"
ses--header-row ses--header-string ses--linewidth
ses--numcols ses--numrows ses--symbolic-formulas
`(aref ses--col-printers ,col))
(defmacro ses-sym-rowcol (sym)
- "From a cell-symbol SYM, gets the cons (row . col). A1 => (0 . 0).
-Result is nil if SYM is not a symbol that names a cell."
- `(and (symbolp ,sym) (get ,sym 'ses-cell)))
+ "From a cell-symbol SYM, gets the cons (row . col). A1 => (0 . 0). Result
+is nil if SYM is not a symbol that names a cell."
+ `(let ((rc (and (symbolp ,sym) (get ,sym 'ses-cell))))
+ (if (eq rc :ses-named)
+ (gethash ,sym ses--named-cell-hashmap)
+ rc)))
+
+(defun ses-is-cell-sym-p (sym)
+ "Check whether SYM point at a cell of this spread sheet."
+ (let ((rowcol (get sym 'ses-cell)))
+ (and rowcol
+ (if (eq rowcol :ses-named)
+ (and ses--named-cell-hashmap (gethash sym ses--named-cell-hashmap))
+ (and (< (car rowcol) ses--numrows)
+ (< (cdr rowcol) ses--numcols)
+ (eq (ses-cell-symbol (car rowcol) (cdr rowcol)) sym))))))
(defmacro ses-cell (sym value formula printer references)
"Load a cell SYM from the spreadsheet file. Does not recompute VALUE from
"Produce a symbol that names the cell (ROW,COL). (0,0) => 'A1."
(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."
+ (let (case-fold-search)
+ (and (string-match "\\`\\([A-Z]+\\)\\([0-9]+\\)\\'" str)
+ (let* ((col-str (match-string-no-properties 1 str))
+ (col 0)
+ (col-offset 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))
+ col-base (* col-base 26)
+ col-idx (1- col-idx))
+ (and (>= col-idx 0)
+ (setq col (+ col col-base)))))
+ (cons row col)))))))
+
(defun ses-create-cell-variable-range (minrow maxrow mincol maxcol)
"Create buffer-local variables for cells. This is undoable."
(push `(apply ses-destroy-cell-variable-range ,minrow ,maxrow ,mincol ,maxcol)
Return nil in case of failure."
(unless (local-variable-p sym)
(make-local-variable sym)
- (put sym 'ses-cell (cons row col))))
+ (if (let (case-fold-search) (string-match "\\`[A-Z]+[0-9]+\\'" (symbol-name sym)))
+ (put sym 'ses-cell (cons row col))
+ (put sym 'ses-cell :ses-named)
+ (setq ses--named-cell-hashmap (or ses--named-cell-hashmap (make-hash-table :test 'eq)))
+ (puthash sym (cons row col) ses--named-cell-hashmap))))
;; We do not delete the ses-cell properties for the cell-variables, in
;; case a formula that refers to this cell is in the kill-ring and is
;; Cut and paste, import and export
;;----------------------------------------------------------------------------
-(defadvice copy-region-as-kill (around ses-copy-region-as-kill
- activate preactivate)
+(defun ses--advice-copy-region-as-kill (crak-fun beg end &rest args)
+ ;; FIXME: Why doesn't it make sense to copy read-only or
+ ;; intangible attributes? They're removed upon yank!
"It doesn't make sense to copy read-only or intangible attributes into the
kill ring. It probably doesn't make sense to copy keymap properties.
We'll assume copying front-sticky properties doesn't make sense, either.
(let ((temp beg))
(setq beg end
end temp)))
- (if (not (and (eq major-mode 'ses-mode)
+ (if (not (and (derived-mode-p 'ses-mode)
(eq (get-text-property beg 'read-only) 'ses)
(eq (get-text-property (1- end) 'read-only) 'ses)))
- ad-do-it ; Normal copy-region-as-kill.
+ (apply crak-fun beg end args) ; Normal copy-region-as-kill.
(kill-new (ses-copy-region beg end))
(if transient-mark-mode
(setq deactivate-mark t))
nil))
+(advice-add 'copy-region-as-kill :around #'ses--advice-copy-region-as-kill)
(defun ses-copy-region (beg end)
"Treat the region as rectangular. Convert the intangible attributes to
(ses-clear-cell row col))
(ses-jump (car ses--curcell)))
-(defadvice yank (around ses-yank activate preactivate)
+(defun ses--advice-yank (yank-fun &optional arg &rest args)
"In SES mode, the yanked text is inserted as cells.
If the text contains 'ses attributes (meaning it went to the kill-ring from a
make sense as a sexp or would otherwise be considered a symbol. Use 'sym to
explicitly insert a symbol, or use the C-u prefix to treat all unmarked words
as symbols."
- (if (not (and (eq major-mode 'ses-mode)
+ (if (not (and (derived-mode-p 'ses-mode)
(eq (get-text-property (point) 'keymap) 'ses-mode-print-map)))
- ad-do-it ; Normal non-SES yank.
+ (apply yank-fun arg args) ; Normal non-SES yank.
(ses-check-curcell 'end)
(push-mark (point))
(let ((text (current-kill (cond
arg)))
(if (consp arg)
(exchange-point-and-mark))))
+(advice-add 'yank :around #'ses--advice-yank)
(defun ses-yank-pop (arg)
"Replace just-yanked stretch of killed text with a different stretch.
(defun ses-rename-cell (new-name &optional cell)
"Rename current cell."
(interactive "*SEnter new name: ")
- (and (local-variable-p new-name)
- (ses-sym-rowcol new-name)
- ;; this test is needed because ses-cell property of deleted cells
- ;; is not deleted in case of subsequent undo
- (memq new-name ses--renamed-cell-symb-list)
- (error "Already a cell name"))
- (and (boundp new-name)
- (null (yes-or-no-p (format "`%S' is already bound outside this buffer, continue? "
- new-name)))
- (error "Already a bound cell name"))
- (let* ((sym (if (ses-cell-p cell)
+ (or
+ (and (local-variable-p new-name)
+ (ses-is-cell-sym-p new-name)
+ (error "Already a cell name"))
+ (and (boundp new-name)
+ (null (yes-or-no-p (format "`%S' is already bound outside this buffer, continue? "
+ new-name)))
+ (error "Already a bound cell name")))
+ (let* (curcell
+ (sym (if (ses-cell-p cell)
(ses-cell-symbol cell)
- (setq cell nil)
+ (setq cell nil
+ curcell t)
(ses-check-curcell)
ses--curcell))
(rowcol (ses-sym-rowcol sym))
(row (car rowcol))
- (col (cdr rowcol)))
- (setq cell (or cell (ses-get-cell row col)))
- (push `(ses-rename-cell ,(ses-cell-symbol cell) ,cell) buffer-undo-list)
- (put new-name 'ses-cell rowcol)
+ (col (cdr rowcol))
+ new-rowcol old-name)
+ (setq cell (or cell (ses-get-cell row col))
+ old-name (ses-cell-symbol cell)
+ new-rowcol (ses-decode-cell-symbol (symbol-name new-name)))
+ (if new-rowcol
+ (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)))
+ (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
(dolist (ref (ses-cell-references cell))
(let* ((x (ses-sym-rowcol ref))
(push new-name ses--renamed-cell-symb-list)
(set new-name (symbol-value sym))
(aset cell 0 new-name)
- (put sym 'ses-cell nil)
(makunbound sym)
- (setq sym new-name)
+ (and curcell (setq ses--curcell new-name))
(let* ((pos (point))
(inhibit-read-only t)
(col (current-column))
(put-text-property pos end 'intangible new-name))
;; update mode line
(setq mode-line-process (list " cell "
- (symbol-name sym)))
+ (symbol-name new-name)))
(force-mode-line-update)))
;;----------------------------------------------------------------------------
(defun ses-unload-function ()
"Unload the Simple Emacs Spreadsheet."
- (dolist (fun '(copy-region-as-kill yank))
- (ad-remove-advice fun 'around (intern (concat "ses-" (symbol-name fun))))
- (ad-update fun))
- ;; continue standard unloading
+ (advice-remove 'yank #'ses--advice-yank)
+ (advice-remove 'copy-region-as-kill #'ses--advice-copy-region-as-kill)
+ ;; Continue standard unloading.
nil)
(provide 'ses)
;; very inefficient in Shell buffers (e.g. Bug#10835). We use a
;; custom `ansi-color-apply-face-function' to convert color escape
;; sequences into `font-lock-face' properties.
- (set (make-local-variable 'ansi-color-apply-face-function)
- (lambda (beg end face)
- (when face
- (put-text-property beg end 'font-lock-face face))))
+ (setq-local ansi-color-apply-face-function #'shell-apply-ansi-color)
+ (shell-reapply-ansi-color)
;; This is not really correct, since the shell buffer does not really
;; edit this directory. But it is useful in the buffer list and menus.
'shell-filter-ctrl-a-ctrl-b nil t)))
(comint-read-input-ring t)))
+(defun shell-apply-ansi-color (beg end face)
+ "Apply FACE as the ansi-color face for the text between BEG and END."
+ (when face
+ (put-text-property beg end 'ansi-color-face face)
+ (put-text-property beg end 'font-lock-face face)))
+
+(defun shell-reapply-ansi-color ()
+ "Reapply ansi-color faces to the existing contents of the buffer."
+ (save-restriction
+ (widen)
+ (let* ((pos (point-min))
+ (end (or (next-single-property-change pos 'ansi-color-face)
+ (point-max)))
+ face)
+ (while end
+ (if (setq face (get-text-property pos 'ansi-color-face))
+ (put-text-property pos (or end (point-max))
+ 'font-lock-face face))
+ (setq pos end
+ end (next-single-property-change pos 'ansi-color-face))))))
+
(defun shell-filter-ctrl-a-ctrl-b (string)
"Remove `^A' and `^B' characters from comint output.
(and current-prefix-arg
(prog1
(read-buffer "Shell buffer: "
- (generate-new-buffer-name "*shell*"))
+ ;; If the current buffer is an inactive
+ ;; shell buffer, use it as the default.
+ (if (and (eq major-mode 'shell-mode)
+ (null (get-buffer-process (current-buffer))))
+ (buffer-name)
+ (generate-new-buffer-name "*shell*")))
(if (file-remote-p default-directory)
;; It must be possible to declare a local default-directory.
;; FIXME: This can't be right: it changes the default-directory
-;;; simple.el --- basic editing commands for Emacs
+;;; simple.el --- basic editing commands for Emacs -*- lexical-binding: t -*-
;; Copyright (C) 1985-1987, 1993-2013 Free Software Foundation, Inc.
(n (abs n)))
(skip-chars-backward skip-characters)
(constrain-to-field nil orig-pos)
- (dotimes (i n)
+ (dotimes (_ n)
(if (= (following-char) ?\s)
(forward-char 1)
(insert ?\s)))
"Save a function restoring the state of minibuffer history search.
Save `minibuffer-history-position' to the additional state parameter
in the search status stack."
- `(lambda (cmd)
- (minibuffer-history-isearch-pop-state cmd ,minibuffer-history-position)))
+ (let ((pos minibuffer-history-position))
+ (lambda (cmd)
+ (minibuffer-history-isearch-pop-state cmd pos))))
(defun minibuffer-history-isearch-pop-state (_cmd hist-pos)
"Restore the minibuffer history search state.
(if (null pending-undo-list)
(setq pending-undo-list t))))
+(defun primitive-undo (n list)
+ "Undo N records from the front of the list LIST.
+Return what remains of the list."
+
+ ;; This is a good feature, but would make undo-start
+ ;; unable to do what is expected.
+ ;;(when (null (car (list)))
+ ;; ;; If the head of the list is a boundary, it is the boundary
+ ;; ;; preceding this command. Get rid of it and don't count it.
+ ;; (setq list (cdr list))))
+
+ (let ((arg n)
+ ;; In a writable buffer, enable undoing read-only text that is
+ ;; so because of text properties.
+ (inhibit-read-only t)
+ ;; Don't let `intangible' properties interfere with undo.
+ (inhibit-point-motion-hooks t)
+ ;; We use oldlist only to check for EQ. ++kfs
+ (oldlist buffer-undo-list)
+ (did-apply nil)
+ (next nil))
+ (while (> arg 0)
+ (while (setq next (pop list)) ;Exit inner loop at undo boundary.
+ ;; Handle an integer by setting point to that value.
+ (pcase next
+ ((pred integerp) (goto-char next))
+ ;; Element (t . TIME) records previous modtime.
+ ;; Preserve any flag of NONEXISTENT_MODTIME_NSECS or
+ ;; UNKNOWN_MODTIME_NSECS.
+ (`(t . ,time)
+ ;; If this records an obsolete save
+ ;; (not matching the actual disk file)
+ ;; then don't mark unmodified.
+ (when (or (equal time (visited-file-modtime))
+ (and (consp time)
+ (equal (list (car time) (cdr time))
+ (visited-file-modtime))))
+ (when (fboundp 'unlock-buffer)
+ (unlock-buffer))
+ (set-buffer-modified-p nil)))
+ ;; Element (nil PROP VAL BEG . END) is property change.
+ (`(nil . ,(or `(,prop ,val ,beg . ,end) pcase--dontcare))
+ (when (or (> (point-min) beg) (< (point-max) end))
+ (error "Changes to be undone are outside visible portion of buffer"))
+ (put-text-property beg end prop val))
+ ;; Element (BEG . END) means range was inserted.
+ (`(,(and beg (pred integerp)) . ,(and end (pred integerp)))
+ ;; (and `(,beg . ,end) `(,(pred integerp) . ,(pred integerp)))
+ ;; Ideally: `(,(pred integerp beg) . ,(pred integerp end))
+ (when (or (> (point-min) beg) (< (point-max) end))
+ (error "Changes to be undone are outside visible portion of buffer"))
+ ;; Set point first thing, so that undoing this undo
+ ;; does not send point back to where it is now.
+ (goto-char beg)
+ (delete-region beg end))
+ ;; Element (apply FUN . ARGS) means call FUN to undo.
+ (`(apply . ,fun-args)
+ (let ((currbuff (current-buffer)))
+ (if (integerp (car fun-args))
+ ;; Long format: (apply DELTA START END FUN . ARGS).
+ (pcase-let* ((`(,delta ,start ,end ,fun . ,args) fun-args)
+ (start-mark (copy-marker start nil))
+ (end-mark (copy-marker end t)))
+ (when (or (> (point-min) start) (< (point-max) end))
+ (error "Changes to be undone are outside visible portion of buffer"))
+ (apply fun args) ;; Use `save-current-buffer'?
+ ;; Check that the function did what the entry
+ ;; said it would do.
+ (unless (and (= start start-mark)
+ (= (+ delta end) end-mark))
+ (error "Changes to be undone by function different than announced"))
+ (set-marker start-mark nil)
+ (set-marker end-mark nil))
+ (apply fun-args))
+ (unless (eq currbuff (current-buffer))
+ (error "Undo function switched buffer"))
+ (setq did-apply t)))
+ ;; Element (STRING . POS) means STRING was deleted.
+ (`(,(and string (pred stringp)) . ,(and pos (pred integerp)))
+ (when (let ((apos (abs pos)))
+ (or (< apos (point-min)) (> apos (point-max))))
+ (error "Changes to be undone are outside visible portion of buffer"))
+ (if (< pos 0)
+ (progn
+ (goto-char (- pos))
+ (insert string))
+ (goto-char pos)
+ ;; Now that we record marker adjustments
+ ;; (caused by deletion) for undo,
+ ;; we should always insert after markers,
+ ;; so that undoing the marker adjustments
+ ;; put the markers back in the right place.
+ (insert string)
+ (goto-char pos)))
+ ;; (MARKER . OFFSET) means a marker MARKER was adjusted by OFFSET.
+ (`(,(and marker (pred markerp)) . ,(and offset (pred integerp)))
+ (when (marker-buffer marker)
+ (set-marker marker
+ (- marker offset)
+ (marker-buffer marker))))
+ (_ (error "Unrecognized entry in undo list %S" next))))
+ (setq arg (1- arg)))
+ ;; Make sure an apply entry produces at least one undo entry,
+ ;; so the test in `undo' for continuing an undo series
+ ;; will work right.
+ (if (and did-apply
+ (eq oldlist buffer-undo-list))
+ (setq buffer-undo-list
+ (cons (list 'apply 'cdr nil) buffer-undo-list))))
+ list)
+
;; Deep copy of a list
(defun undo-copy-list (list)
"Make a copy of undo list LIST."
(or lc infile)
(if stderr-file (list (car buffer) stderr-file) buffer)
display args)
- (when stderr-file (copy-file stderr-file (cadr buffer)))))
+ (when stderr-file (copy-file stderr-file (cadr buffer) t))))
(when stderr-file (delete-file stderr-file))
(when lc (delete-file lc)))))
(kill-new string nil yank-handler)))
(when (or string (eq last-command 'kill-region))
(setq this-command 'kill-region))
+ (setq deactivate-mark t)
nil)
((buffer-read-only text-read-only)
;; The code above failed because the buffer, or some of the characters
(when (mark t)
(setq mark-active t)
(unless transient-mark-mode
- (setq transient-mark-mode 'lambda))))
+ (setq transient-mark-mode 'lambda))
+ (run-hooks 'activate-mark-hook)))
(defun set-mark (pos)
"Set this buffer's mark to POS. Don't use this function!
:type 'boolean
:group 'editing-basics)
-(defcustom set-mark-default-inactive nil
- "If non-nil, setting the mark does not activate it.
-This option does the same thing as disabling Transient Mark mode,
-and it will be removed in the near future."
- :type 'boolean
- :group 'editing-basics
- :version "23.1")
-(make-obsolete-variable 'set-mark-default-inactive nil "24.3")
-
(defun set-mark-command (arg)
"Set the mark where point is, or jump to the mark.
Setting the mark also alters the region, which is the text
(activate-mark)
(message "Mark activated")))
(t
- (push-mark-command nil)
- (if set-mark-default-inactive (deactivate-mark)))))
+ (push-mark-command nil))))
(defun push-mark (&optional location nomsg activate)
"Set mark at LOCATION (point, by default) and push old mark on mark ring.
(deactivate-mark)
(set-mark (point))
(goto-char omark)
- (if set-mark-default-inactive (deactivate-mark))
(cond (temp-highlight
(setq transient-mark-mode (cons 'only transient-mark-mode)))
((or (and arg (region-active-p)) ; (xor arg (not (region-active-p)))
(setq pos1 pos2 pos2 swap)))
(if (> (cdr pos1) (car pos2)) (error "Don't have two things to transpose"))
(atomic-change-group
- (let (word2)
- ;; FIXME: We first delete the two pieces of text, so markers that
- ;; used to point to after the text end up pointing to before it :-(
- (setq word2 (delete-and-extract-region (car pos2) (cdr pos2)))
- (goto-char (car pos2))
- (insert (delete-and-extract-region (car pos1) (cdr pos1)))
- (goto-char (car pos1))
- (insert word2))))
+ ;; This sequence of insertions attempts to preserve marker
+ ;; positions at the start and end of the transposed objects.
+ (let* ((word (buffer-substring (car pos2) (cdr pos2)))
+ (len1 (- (cdr pos1) (car pos1)))
+ (len2 (length word))
+ (boundary (make-marker)))
+ (set-marker boundary (car pos2))
+ (goto-char (cdr pos1))
+ (insert-before-markers word)
+ (setq word (delete-and-extract-region (car pos1) (+ (car pos1) len1)))
+ (goto-char boundary)
+ (insert word)
+ (goto-char (+ boundary len1))
+ (delete-region (point) (+ (point) len2))
+ (set-marker boundary nil))))
\f
(defun backward-word (&optional arg)
"Move backward until encountering the beginning of a word.
(setq ll (cdr ll)))
(insert (car ll)))))
+;;;###autoload
+(defun delete-duplicate-lines (beg end &optional reverse adjacent interactive)
+ "Delete duplicate lines in the region between BEG and END.
+
+If REVERSE is nil, search and delete duplicates forward keeping the first
+occurrence of duplicate lines. If REVERSE is non-nil (when called
+interactively with C-u prefix), search and delete duplicates backward
+keeping the last occurrence of duplicate lines.
+
+If ADJACENT is non-nil (when called interactively with two C-u prefixes),
+delete repeated lines only if they are adjacent. It works like the utility
+`uniq' and is useful when lines are already sorted in a large file since
+this is more efficient in performance and memory usage than when ADJACENT
+is nil that uses additional memory to remember previous lines.
+
+When called from Lisp and INTERACTIVE is omitted or nil, return the number
+of deleted duplicate lines, do not print it; if INTERACTIVE is t, the
+function behaves in all respects as if it had been called interactively."
+ (interactive
+ (progn
+ (barf-if-buffer-read-only)
+ (list (region-beginning) (region-end)
+ (equal current-prefix-arg '(4))
+ (equal current-prefix-arg '(16))
+ t)))
+ (let ((lines (unless adjacent (make-hash-table :weakness 'key :test 'equal)))
+ line prev-line
+ (count 0)
+ (beg (copy-marker beg))
+ (end (copy-marker end)))
+ (save-excursion
+ (goto-char (if reverse end beg))
+ (if (and reverse (bolp)) (forward-char -1))
+ (while (if reverse
+ (and (> (point) beg) (not (bobp)))
+ (and (< (point) end) (not (eobp))))
+ (setq line (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position)))
+ (if (if adjacent (equal line prev-line) (gethash line lines))
+ (progn
+ (delete-region (progn (forward-line 0) (point))
+ (progn (forward-line 1) (point)))
+ (if reverse (forward-line -1))
+ (setq count (1+ count)))
+ (if adjacent (setq prev-line line) (puthash line t lines))
+ (forward-line (if reverse -1 1)))))
+ (set-marker beg nil)
+ (set-marker end nil)
+ (when interactive
+ (message "Deleted %d %sduplicate line%s%s"
+ count
+ (if adjacent "adjacent " "")
+ (if (= count 1) "" "s")
+ (if reverse " backward" "")))
+ count))
+
(provide 'sort)
;;; sort.el ends here
nil
(eval-when-compile (condition-case nil (require 'imenu) (error nil)))
+(declare-function imenu--make-index-alist "imenu" (&optional no-error))
(defun speedbar-fetch-dynamic-imenu (file)
"Load FILE into a buffer, and generate tags using Imenu.
(defcustom initial-buffer-choice nil
"Buffer to show after starting Emacs.
If the value is nil and `inhibit-startup-screen' is nil, show the
-startup screen. If the value is a string, visit the specified file
-or directory using `find-file'. If t, open the `*scratch*'
-buffer.
+startup screen. If the value is a string, switch to a buffer
+visiting the file or directory specified by that string. If the
+value is a function, switch to the buffer returned by that
+function. If t, open the `*scratch*' buffer.
A string value also causes emacsclient to open the specified file
or directory when no target file is specified."
(const :tag "Startup screen" nil)
(directory :tag "Directory" :value "~/")
(file :tag "File" :value "~/.emacs")
+ (function :tag "Function")
(const :tag "Lisp scratch buffer" t))
- :version "23.1"
+ :version "24.4"
:group 'initialization)
(defcustom inhibit-startup-screen nil
:face '(variable-pitch (:height 0.8))
emacs-copyright
"\n")
- (and auto-save-list-file-prefix
- ;; Don't signal an error if the
- ;; directory for auto-save-list files
- ;; does not yet exist.
- (file-directory-p (file-name-directory
- auto-save-list-file-prefix))
- (directory-files
- (file-name-directory auto-save-list-file-prefix)
- nil
- (concat "\\`"
- (regexp-quote (file-name-nondirectory
- auto-save-list-file-prefix)))
- t)
- (fancy-splash-insert :face '(variable-pitch font-lock-comment-face)
- "\nIf an Emacs session crashed recently, "
- "type "
- :face '(fixed-pitch font-lock-comment-face)
- "Meta-x recover-session RET"
- :face '(variable-pitch font-lock-comment-face)
- "\nto recover"
- " the files you were editing."))
+ (when auto-save-list-file-prefix
+ (let ((dir (file-name-directory auto-save-list-file-prefix))
+ (name (file-name-nondirectory auto-save-list-file-prefix))
+ files)
+ ;; Don't warn if the directory for auto-save-list files does not
+ ;; yet exist.
+ (and (file-directory-p dir)
+ (setq files (directory-files dir nil (concat "\\`" name) t))
+ (fancy-splash-insert :face '(variable-pitch font-lock-comment-face)
+ (if (= (length files) 1)
+ "\nAn auto-save file list was found. "
+ "\nAuto-save file lists were found. ")
+ "If an Emacs session crashed recently,\ntype "
+ :link `("M-x recover-session RET"
+ ,(lambda (_button)
+ (call-interactively
+ 'recover-session)))
+ " to recover the files you were editing."))))
(when concise
(fancy-splash-insert
(set-buffer-modified-p nil))))
(when initial-buffer-choice
- (cond ((eq initial-buffer-choice t)
- (switch-to-buffer (get-buffer-create "*scratch*")))
- ((stringp initial-buffer-choice)
- (find-file initial-buffer-choice))))
+ (let ((buf
+ (cond ((stringp initial-buffer-choice)
+ (find-file-noselect initial-buffer-choice))
+ ((functionp initial-buffer-choice)
+ (funcall initial-buffer-choice)))))
+ (switch-to-buffer
+ (if (buffer-live-p buf) buf (get-buffer-create "*scratch*"))
+ 'norecord)))
(if (or inhibit-startup-screen
initial-buffer-choice
(declare (indent 1) (debug t))
(cons 'if (cons cond (cons nil body))))
-(if (null (featurep 'cl))
- (progn
- ;; If we reload subr.el after having loaded CL, be careful not to
- ;; overwrite CL's extended definition of `dolist', `dotimes', `declare'.
-
(defmacro dolist (spec &rest body)
"Loop over a list.
Evaluate BODY with VAR bound to each car from LIST, in turn.
(let ((,(car spec) (car ,temp)))
,@body
(setq ,temp (cdr ,temp))))
- ,@(if (cdr (cdr spec))
- ;; FIXME: This let often leads to "unused var" warnings.
- `((let ((,(car spec) nil)) ,@(cdr (cdr spec))))))
+ ,@(cdr (cdr spec)))
`(let ((,temp ,(nth 1 spec))
,(car spec))
(while ,temp
`defun-declarations-alist' and `macro-declarations-alist'."
;; FIXME: edebug spec should pay attention to defun-declarations-alist.
nil)
-))
(defmacro ignore-errors (&rest body)
"Execute BODY; if an error occurs, return nil.
(make-obsolete 'unfocus-frame "it does nothing." "22.1")
(make-obsolete 'make-variable-frame-local
"explicitly check for a frame-parameter instead." "22.2")
-(make-obsolete 'interactive-p 'called-interactively-p "23.2")
-(set-advertised-calling-convention 'called-interactively-p '(kind) "23.1")
(set-advertised-calling-convention
'all-completions '(string collection &optional predicate) "23.1")
(set-advertised-calling-convention 'unintern '(name obarray) "23.3")
On those systems, it is automatically local in every buffer.
On other systems, this variable is normally always nil.
-WARNING: This variable is obsolete and will disapper Real Soon Now.
+WARNING: This variable is obsolete and will disappear Real Soon Now.
Don't use it!")
;; The `assert' macro from the cl package signals
(defun locate-user-emacs-file (new-name &optional old-name)
"Return an absolute per-user Emacs-specific file name.
-If OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
+If NEW-NAME exists in `user-emacs-directory', return it.
+Else If OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
Else return NEW-NAME in `user-emacs-directory', creating the
directory if it does not exist."
(convert-standard-filename
(let* ((home (concat "~" (or init-file-user "")))
- (at-home (and old-name (expand-file-name old-name home))))
- (if (and at-home (file-readable-p at-home))
+ (at-home (and old-name (expand-file-name old-name home)))
+ (bestname (abbreviate-file-name
+ (expand-file-name new-name user-emacs-directory))))
+ (if (and at-home (not (file-readable-p bestname))
+ (file-readable-p at-home))
at-home
;; Make sure `user-emacs-directory' exists,
;; unless we're in batch mode or dumping Emacs
(set-default-file-modes ?\700)
(make-directory user-emacs-directory))
(set-default-file-modes umask))))
- (abbreviate-file-name
- (expand-file-name new-name user-emacs-directory))))))
+ bestname))))
\f
;;;; Misc. useful functions.
Otherwise, return nil."
(and (memq object '(nil t)) t))
+(defun special-form-p (object)
+ "Non-nil if and only if OBJECT is a special form."
+ (if (and (symbolp object) (fboundp object))
+ (setq object (indirect-function object t)))
+ (and (subrp object) (eq (cdr (subr-arity object)) 'unevalled)))
+
(defun field-at-pos (pos)
"Return the field at position POS, taking stickiness etc into account."
(let ((raw-field (get-char-property (field-beginning pos) 'field)))
(if (not (re-search-forward
(overlay-get ol1 'text-clone-syntax) cend t))
;; Mark the overlay for deletion.
- (overlay-put ol1 'text-clones nil)
+ (setq end cbeg)
(when (< (match-end 0) cend)
;; Shrink the clone at its end.
(setq end (min end (match-end 0)))
(put symbol 'abortfunc (or abortfunc 'kill-buffer))
(put symbol 'hookvar (or hookvar 'mail-send-hook)))
\f
+(defvar called-interactively-p-functions nil
+ "Special hook called to skip special frames in `called-interactively-p'.
+The functions are called with 3 arguments: (I FRAME1 FRAME2),
+where FRAME1 is a \"current frame\", FRAME2 is the next frame,
+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).")
+
+(defmacro internal--called-interactively-p--get-frame (n)
+ ;; `sym' will hold a global variable, which will be used kind of like C's
+ ;; "static" variables.
+ (let ((sym (make-symbol "base-index")))
+ `(progn
+ (defvar ,sym
+ (let ((i 1))
+ (while (not (eq (indirect-function (nth 1 (backtrace-frame i)) t)
+ (indirect-function 'called-interactively-p)))
+ (setq i (1+ i)))
+ i))
+ ;; (unless (eq (nth 1 (backtrace-frame ,sym)) 'called-interactively-p)
+ ;; (error "called-interactively-p: %s is out-of-sync!" ,sym))
+ (backtrace-frame (+ ,sym ,n)))))
+
+(defun called-interactively-p (&optional kind)
+ "Return t if the containing function was called by `call-interactively'.
+If KIND is `interactive', then only return t if the call was made
+interactively by the user, i.e. not in `noninteractive' mode nor
+when `executing-kbd-macro'.
+If KIND is `any', on the other hand, it will return t for any kind of
+interactive call, including being called as the binding of a key or
+from a keyboard macro, even in `noninteractive' mode.
+
+This function is very brittle, it may fail to return the intended result when
+the code is debugged, advised, or instrumented in some form. Some macros and
+special forms (such as `condition-case') may also sometimes wrap their bodies
+in a `lambda', so any call to `called-interactively-p' from those bodies will
+indicate whether that lambda (rather than the surrounding function) was called
+interactively.
+
+Instead of using this function, it is cleaner and more reliable to give your
+function an extra optional argument whose `interactive' spec specifies
+non-nil unconditionally (\"p\" is a good way to do this), or via
+\(not (or executing-kbd-macro noninteractive)).
+
+The only known proper use of `interactive' for KIND is in deciding
+whether to display a helpful message, or how to display it. If you're
+thinking of using it for any other purpose, it is quite likely that
+you're making a mistake. Think: what do you want to do when the
+command is called from a keyboard macro?"
+ (declare (advertised-calling-convention (kind) "23.1"))
+ (when (not (and (eq kind 'interactive)
+ (or executing-kbd-macro noninteractive)))
+ (let* ((i 1) ;; 0 is the called-interactively-p frame.
+ frame nextframe
+ (get-next-frame
+ (lambda ()
+ (setq frame nextframe)
+ (setq nextframe (internal--called-interactively-p--get-frame i))
+ ;; (message "Frame %d = %S" i nextframe)
+ (setq i (1+ i)))))
+ (funcall get-next-frame) ;; Get the first frame.
+ (while
+ ;; FIXME: The edebug and advice handling should be made modular and
+ ;; provided directly by edebug.el and nadvice.el.
+ (progn
+ ;; frame =(backtrace-frame i-2)
+ ;; nextframe=(backtrace-frame i-1)
+ (funcall get-next-frame)
+ ;; `pcase' would be a fairly good fit here, but it sometimes moves
+ ;; branches within local functions, which then messes up the
+ ;; `backtrace-frame' data we get,
+ (or
+ ;; Skip special forms (from non-compiled code).
+ (and frame (null (car frame)))
+ ;; Skip also `interactive-p' (because we don't want to know if
+ ;; interactive-p was called interactively but if it's caller was)
+ ;; and `byte-code' (idem; this appears in subexpressions of things
+ ;; like condition-case, which are wrapped in a separate bytecode
+ ;; chunk).
+ ;; FIXME: For lexical-binding code, this is much worse,
+ ;; because the frames look like "byte-code -> funcall -> #[...]",
+ ;; which is not a reliable signature.
+ (memq (nth 1 frame) '(interactive-p 'byte-code))
+ ;; Skip package-specific stack-frames.
+ (let ((skip (run-hook-with-args-until-success
+ 'called-interactively-p-functions
+ i frame nextframe)))
+ (pcase skip
+ (`nil nil)
+ (`0 t)
+ (_ (setq i (+ i skip -1)) (funcall get-next-frame)))))))
+ ;; Now `frame' should be "the function from which we were called".
+ (pcase (cons frame nextframe)
+ ;; No subr calls `interactive-p', so we can rule that out.
+ (`((,_ ,(pred (lambda (f) (subrp (indirect-function f)))) . ,_) . ,_) nil)
+ ;; Somehow, I sometimes got `command-execute' rather than
+ ;; `call-interactively' on my stacktrace !?
+ ;;(`(,_ . (t command-execute . ,_)) t)
+ (`(,_ . (t call-interactively . ,_)) t)))))
+
+(defun interactive-p ()
+ "Return t if the containing function was run directly by user input.
+This means that the function was called with `call-interactively'
+\(which includes being called as the binding of a key)
+and input is currently coming from the keyboard (not a keyboard macro),
+and Emacs is not running in batch mode (`noninteractive' is nil).
+
+The only known proper use of `interactive-p' is in deciding whether to
+display a helpful message, or how to display it. If you're thinking
+of using it for any other purpose, it is quite likely that you're
+making a mistake. Think: what do you want to do when the command is
+called from a keyboard macro or in batch mode?
+
+To test whether your function was called with `call-interactively',
+either (i) add an extra optional argument and give it an `interactive'
+spec that specifies non-nil unconditionally (such as \"p\"); or (ii)
+use `called-interactively-p'."
+ (declare (obsolete called-interactively-p "23.2"))
+ (called-interactively-p 'interactive))
+
+(defun function-arity (f &optional num)
+ "Return the (MIN . MAX) arity of F.
+If the maximum arity is infinite, MAX is `many'.
+F can be a function or a macro.
+If NUM is non-nil, return non-nil iff F can be called with NUM args."
+ (if (symbolp f) (setq f (indirect-function f)))
+ (if (eq (car-safe f) 'macro) (setq f (cdr f)))
+ (let ((res
+ (if (subrp f)
+ (let ((x (subr-arity f)))
+ (if (eq (cdr x) 'unevalled) (cons (car x) 'many)))
+ (let* ((args (if (consp f) (cadr f) (aref f 0)))
+ (max (length args))
+ (opt (memq '&optional args))
+ (rest (memq '&rest args))
+ (min (- max (length opt))))
+ (if opt
+ (cons min (if rest 'many (1- max)))
+ (if rest
+ (cons (- max (length rest)) 'many)
+ (cons min max)))))))
+ (if (not num)
+ res
+ (and (>= num (car res))
+ (or (eq 'many (cdr res)) (<= num (cdr res)))))))
+
(defun set-temporary-overlay-map (map &optional keep-pred)
"Set MAP as a temporary keymap taking precedence over most other keymaps.
Note that this does NOT take precedence over the \"overriding\" maps
(progress-reporter-done ,temp2)
nil ,@(cdr (cdr spec)))))
+\f
+;;;; Support for watching filesystem events.
+
+(defun inotify-event-p (event)
+ "Check if EVENT is an inotify event."
+ (and (listp event)
+ (>= (length event) 3)
+ (eq (car event) 'file-inotify)))
+
+;;;###autoload
+(defun inotify-handle-event (event)
+ "Handle inotify file system monitoring event.
+If EVENT is an inotify filewatch event, call its callback.
+Otherwise, signal a `filewatch-error'."
+ (interactive "e")
+ (unless (inotify-event-p event)
+ (signal 'filewatch-error (cons "Not a valid inotify event" event)))
+ (funcall (nth 2 event) (nth 1 event)))
+
+(defun w32notify-handle-event (event)
+ "Handle MS-Windows file system monitoring event.
+If EVENT is an MS-Windows filewatch event, call its callback.
+Otherwise, signal a `filewatch-error'."
+ (interactive "e")
+ (if (and (eq (car event) 'file-w32notify)
+ (= (length event) 3))
+ (funcall (nth 2 event) (nth 1 event))
+ (signal 'filewatch-error
+ (cons "Not a valid MS-Windows file-notify event" event))))
+
\f
;;;; Comparing version strings.
(require 'ring)
(require 'ehelp)
+(declare-function ring-empty-p "ring" (ring))
+(declare-function ring-ref "ring" (ring index))
+(declare-function ring-insert-at-beginning "ring" (ring item))
+(declare-function ring-length "ring" (ring))
+(declare-function ring-insert "ring" (ring item))
+
(defgroup term nil
"General command interpreter in a window."
:group 'processes)
come with OS X.
See the documentation of `create-fontset-from-fontset-spec' for the format.")
-;; Conditional on new-fontset so bootstrapping works on non-GUI compiles.
-(when (fboundp 'new-fontset)
- ;; Setup the default fontset.
- (create-default-fontset)
- ;; Create the standard fontset.
- (condition-case err
- (create-fontset-from-fontset-spec ns-standard-fontset-spec t)
- (error (display-warning
- 'initialization
- (format "Creation of the standard fontset failed: %s" err)
- :error))))
-
(defvar ns-reg-to-script) ; nsfont.m
;; This maps font registries (not exposed by NS APIs for font selection) to
;; PENDING: not needed?
(setq command-line-args (x-handle-args command-line-args))
+ ;; Setup the default fontset.
+ (create-default-fontset)
+ ;; Create the standard fontset.
+ (condition-case err
+ (create-fontset-from-fontset-spec ns-standard-fontset-spec t)
+ (error (display-warning
+ 'initialization
+ (format "Creation of the standard fontset failed: %s" err)
+ :error)))
+
(x-open-connection (system-name) nil t)
(dolist (service (ns-list-services))
(declare-function set-message-beep "w32fns.c")
(declare-function cygwin-convert-file-name-from-windows "cygw32.c"
- (path &optional absolute_p))
+ (path &optional absolute_p))
;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
(if (fboundp 'new-fontset)
"/")
"/")))
(dnd-handle-one-url window 'private
- (concat "file:" file-name)))
+ (concat
+ (if (eq system-type 'cygwin)
+ "file://"
+ "file:")
+ file-name)))
(defun w32-drag-n-drop (event &optional new-frame)
"Edit the files listed in the drag-n-drop EVENT.
;;;###autoload
(define-derived-mode css-mode fundamental-mode "CSS"
"Major mode to edit Cascading Style Sheets."
- (set (make-local-variable 'font-lock-defaults) css-font-lock-defaults)
- (set (make-local-variable 'comment-start) "/*")
- (set (make-local-variable 'comment-start-skip) "/\\*+[ \t]*")
- (set (make-local-variable 'comment-end) "*/")
- (set (make-local-variable 'comment-end-skip) "[ \t]*\\*+/")
- (set (make-local-variable 'forward-sexp-function) 'css-forward-sexp)
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
- (set (make-local-variable 'indent-line-function) 'css-indent-line)
- (set (make-local-variable 'fill-paragraph-function)
- 'css-fill-paragraph)
+ (setq-local font-lock-defaults css-font-lock-defaults)
+ (setq-local comment-start "/*")
+ (setq-local comment-start-skip "/\\*+[ \t]*")
+ (setq-local comment-end "*/")
+ (setq-local comment-end-skip "[ \t]*\\*+/")
+ (setq-local forward-sexp-function 'css-forward-sexp)
+ (setq-local parse-sexp-ignore-comments t)
+ (setq-local indent-line-function 'css-indent-line)
+ (setq-local fill-paragraph-function 'css-fill-paragraph)
+ (setq-local add-log-current-defun-function #'css-current-defun-name)
(when css-electric-keys
(let ((fc (make-char-table 'auto-fill-chars)))
(set-char-table-parent fc auto-fill-chars)
(dolist (c css-electric-keys)
(aset fc c 'indent-according-to-mode))
- (set (make-local-variable 'auto-fill-chars) fc))))
+ (setq-local auto-fill-chars fc))))
(defvar comment-continue)
(save-excursion (indent-line-to indent))
(indent-line-to indent)))))
+(defun css-current-defun-name ()
+ "Return the name of the CSS section at point, or nil."
+ (save-excursion
+ (let ((max (max (point-min) (- (point) 1600)))) ; approx 20 lines back
+ (when (search-backward "{" max t)
+ (skip-chars-backward " \t\r\n")
+ (beginning-of-line)
+ (if (looking-at "^[ \t]*\\([^{\r\n]*[^ {\t\r\n]\\)")
+ (match-string-no-properties 1))))))
+
(provide 'css-mode)
;;; css-mode.el ends here
(move-to-column (current-fill-column))
(if (when (< (point) to)
;; Find the position where we'll break the line.
- (forward-char 1) ;Use an immediately following space, if any.
+ ;; Use an immediately following space, if any.
+ ;; However, note that `move-to-column' may overshoot
+ ;; if there are wide characters (Bug#3234).
+ (unless (> (current-column) (current-fill-column))
+ (forward-char 1))
(fill-move-to-break-point linebeg)
;; Check again to see if we got to the end of
;; the paragraph.
;;*---------------------------------------------------------------------*/
;;* Highlighting */
;;*---------------------------------------------------------------------*/
-(defface flyspell-incorrect '((t :underline t :inherit error))
+(defface flyspell-incorrect
+ '((((supports :underline (:style wave)))
+ :underline (:style wave :color "Red1"))
+ (t
+ :underline t :inherit error))
"Flyspell face for misspelled words."
+ :version "24.4"
:group 'flyspell)
-(defface flyspell-duplicate '((t :underline t :inherit warning))
+(defface flyspell-duplicate
+ '((((supports :underline (:style wave)))
+ :underline (:style wave :color "DarkOrange"))
+ (t
+ :underline t :inherit warning))
"Flyspell face for words that appear twice in a row.
See also `flyspell-duplicate-distance'."
+ :version "24.4"
:group 'flyspell)
(defvar flyspell-overlay nil)
"ispell")
"Program invoked by \\[ispell-word] and \\[ispell-region] commands."
:type 'string
+ :set (lambda (symbol value)
+ (set-default symbol value)
+ (if (featurep 'ispell)
+ (ispell-set-spellchecker-params)))
:group 'ispell)
(defcustom ispell-alternate-dictionary
(setq default-directory (expand-file-name "~/")))
(apply 'call-process-region args)))
+(defun ispell-create-debug-buffer (&optional append)
+ "Create an ispell debug buffer for debugging output.
+Use APPEND to append the info to previous buffer if exists,
+otherwise is reset. Returns name of ispell debug buffer.
+See `ispell-buffer-with-debug' for an example of use."
+ (let ((ispell-debug-buffer (get-buffer-create "*ispell-debug*")))
+ (with-current-buffer ispell-debug-buffer
+ (if append
+ (insert
+ (format "-----------------------------------------------\n"))
+ (erase-buffer)))
+ ispell-debug-buffer))
+
+(defsubst ispell-print-if-debug (string)
+ "Print STRING to `ispell-debug-buffer' buffer if enabled."
+ (if (boundp 'ispell-debug-buffer)
+ (with-current-buffer ispell-debug-buffer
+ (insert string))))
;; The preparation of the menu bar menu must be autoloaded
(defun ispell-start-process ()
"Start the Ispell process, with support for no asynchronous processes.
Keeps argument list for future Ispell invocations for no async support."
- ;; Local dictionary becomes the global dictionary in use.
- (setq ispell-current-dictionary
- (or ispell-local-dictionary ispell-dictionary))
- (setq ispell-current-personal-dictionary
- (or ispell-local-pdict ispell-personal-dictionary))
+ ;; `ispell-current-dictionary' and `ispell-current-personal-dictionary'
+ ;; are properly set in `ispell-internal-change-dictionary'.
(let* ((default-directory
(if (and (file-directory-p default-directory)
(file-readable-p default-directory))
(list "-d" ispell-current-dictionary))
orig-args
(if ispell-current-personal-dictionary ; Use specified pers dict.
- (list "-p"
- (expand-file-name ispell-current-personal-dictionary)))
+ (list "-p" ispell-current-personal-dictionary))
;; If we are using recent aspell or hunspell, make sure we use the
;; right encoding for communication. ispell or older aspell/hunspell
;; does not support this.
(let* (;; Basename of dictionary used by the spell-checker
(dict-bname (or (car (cdr (member "-d" (ispell-get-ispell-args))))
ispell-current-dictionary))
+ ;; The directory where process was started.
+ (current-ispell-directory default-directory)
+ ;; The default directory for the process.
;; Use "~/" as default-directory unless using Ispell with per-dir
;; personal dictionaries and not in a minibuffer under XEmacs
(default-directory
"Update the dictionary and the personal dictionary used by Ispell.
This may kill the Ispell process; if so, a new one will be started
when needed."
- (let ((dict (or ispell-local-dictionary ispell-dictionary))
- (pdict (or ispell-local-pdict ispell-personal-dictionary)))
+ (let* ((dict (or ispell-local-dictionary ispell-dictionary))
+ (pdict (or ispell-local-pdict ispell-personal-dictionary))
+ (expanded-pdict (if pdict (expand-file-name pdict))))
(unless (and (equal ispell-current-dictionary dict)
- (equal ispell-current-personal-dictionary pdict))
+ (equal ispell-current-personal-dictionary
+ expanded-pdict))
(ispell-kill-ispell t)
(setq ispell-current-dictionary dict
- ispell-current-personal-dictionary pdict))))
+ ispell-current-personal-dictionary expanded-pdict))))
;; Avoid error messages when compiling for these dynamic variables.
(defvar ispell-start)
(if (not recheckp)
(ispell-accept-buffer-local-defs)) ; set up dictionary, local words, etc.
(let ((skip-region-start (make-marker))
- (rstart (make-marker)))
- (unwind-protect
- (save-excursion
- (message "Spell-checking %s using %s with %s dictionary..."
- (if (and (= reg-start (point-min)) (= reg-end (point-max)))
- (buffer-name) "region")
- (file-name-nondirectory ispell-program-name)
- (or ispell-current-dictionary "default"))
- ;; Returns cursor to original location.
- (save-window-excursion
- (goto-char reg-start)
- (let ((transient-mark-mode)
- (case-fold-search case-fold-search)
- (query-fcc t)
- in-comment key)
- (let (message-log-max)
- (message "searching for regions to skip"))
- (if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t)
- (progn
- (setq key (match-string-no-properties 0))
- (set-marker skip-region-start (- (point) (length key)))
- (goto-char reg-start)))
- (let (message-log-max)
- (message
- "Continuing spelling check using %s with %s dictionary..."
- (file-name-nondirectory ispell-program-name)
- (or ispell-current-dictionary "default")))
- (set-marker rstart reg-start)
- (set-marker ispell-region-end reg-end)
- (while (and (not ispell-quit)
- (< (point) ispell-region-end))
- ;; spell-check region with skipping
- (if (and (marker-position skip-region-start)
- (<= skip-region-start (point)))
+ (rstart (make-marker))
+ (region-type (if (and (= reg-start (point-min)) (= reg-end (point-max)))
+ (buffer-name) "region"))
+ (program-basename (file-name-nondirectory ispell-program-name))
+ (dictionary (or ispell-current-dictionary "default")))
+ (unwind-protect
+ (save-excursion
+ (message "Spell-checking %s using %s with %s dictionary..."
+ region-type program-basename dictionary)
+ ;; Returns cursor to original location.
+ (save-window-excursion
+ (goto-char reg-start)
+ (let ((transient-mark-mode)
+ (case-fold-search case-fold-search)
+ (query-fcc t)
+ in-comment key)
+ (ispell-print-if-debug
+ (concat
+ (format
+ "ispell-region: (ispell-skip-region-list):\n%s\n"
+ (ispell-skip-region-list))
+ (format
+ "ispell-region: (ispell-begin-skip-region-regexp):\n%s\n"
+ (ispell-begin-skip-region-regexp))
+ "ispell-region: Search for first region to skip after (ispell-begin-skip-region-regexp)\n"))
+ (if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t)
(progn
- ;; If region inside line comment, must keep comment start.
- (setq in-comment (point)
- in-comment
- (and comment-start
- (or (null comment-end) (string= "" comment-end))
- (save-excursion
- (beginning-of-line)
- (re-search-forward comment-start in-comment t))
- comment-start))
- ;; Can change skip-regexps (in ispell-message)
- (ispell-skip-region key) ; moves pt past region.
- (set-marker rstart (point))
- ;; check for saving large attachments...
- (setq query-fcc (and query-fcc
- (ispell-ignore-fcc skip-region-start
- rstart)))
- (if (and (< rstart ispell-region-end)
- (re-search-forward
- (ispell-begin-skip-region-regexp)
- ispell-region-end t))
- (progn
- (setq key (match-string-no-properties 0))
- (set-marker skip-region-start
- (- (point) (length key)))
- (goto-char rstart))
- (set-marker skip-region-start nil))))
- (setq reg-end (max (point)
- (if (marker-position skip-region-start)
- (min skip-region-start ispell-region-end)
- (marker-position ispell-region-end))))
- (let* ((ispell-start (point))
- (ispell-end (min (point-at-eol) reg-end))
- (string (ispell-get-line
- ispell-start ispell-end in-comment)))
- (if in-comment ; account for comment chars added
- (setq ispell-start (- ispell-start (length in-comment))
- in-comment nil))
- (setq ispell-end (point)) ; "end" tracks region retrieved.
- (if string ; there is something to spell check!
- ;; (special start end)
- (setq shift (ispell-process-line string
- (and recheckp shift))))
- (goto-char ispell-end)))))
- (if ispell-quit
- nil
- (or shift 0)))
- ;; protected
- (if (and (not (and recheckp ispell-keep-choices-win))
- (get-buffer ispell-choices-buffer))
- (kill-buffer ispell-choices-buffer))
- (set-marker skip-region-start nil)
- (set-marker rstart nil)
- (if ispell-quit
- (progn
- ;; preserve or clear the region for ispell-continue.
- (if (not (numberp ispell-quit))
- (set-marker ispell-region-end nil)
- ;; Ispell-continue enabled - ispell-region-end is set.
- (goto-char ispell-quit))
- ;; Check for aborting
- (if (and ispell-checking-message (numberp ispell-quit))
- (progn
- (setq ispell-quit nil)
- (error "Message send aborted")))
- (if (not recheckp) (setq ispell-quit nil)))
- (if (not recheckp) (set-marker ispell-region-end nil))
- ;; Only save if successful exit.
- (ispell-pdict-save ispell-silently-savep)
- (message "Spell-checking %s using %s with %s dictionary...done"
- (if (and (= reg-start (point-min)) (= reg-end (point-max)))
- (buffer-name) "region")
- (file-name-nondirectory ispell-program-name)
- (or ispell-current-dictionary "default"))))))
+ (setq key (match-string-no-properties 0))
+ (set-marker skip-region-start (- (point) (length key)))
+ (goto-char reg-start)
+ (ispell-print-if-debug
+ (format "ispell-region: First skip: %s at (pos,line,column): (%s,%s,%s).\n"
+ key
+ (save-excursion (goto-char skip-region-start) (point))
+ (line-number-at-pos skip-region-start)
+ (save-excursion (goto-char skip-region-start) (current-column))))))
+ (ispell-print-if-debug
+ (format
+ "ispell-region: Continue spell-checking with %s and %s dictionary...\n"
+ program-basename dictionary))
+ (set-marker rstart reg-start)
+ (set-marker ispell-region-end reg-end)
+ (while (and (not ispell-quit)
+ (< (point) ispell-region-end))
+ ;; spell-check region with skipping
+ (if (and (marker-position skip-region-start)
+ (<= skip-region-start (point)))
+ (progn
+ ;; If region inside line comment, must keep comment start.
+ (setq in-comment (point)
+ in-comment
+ (and comment-start
+ (or (null comment-end) (string= "" comment-end))
+ (save-excursion
+ (beginning-of-line)
+ (re-search-forward comment-start in-comment t))
+ comment-start))
+ ;; Can change skip-regexps (in ispell-message)
+ (ispell-skip-region key) ; moves pt past region.
+ (set-marker rstart (point))
+ ;; check for saving large attachments...
+ (setq query-fcc (and query-fcc
+ (ispell-ignore-fcc skip-region-start
+ rstart)))
+ (if (and (< rstart ispell-region-end)
+ (re-search-forward
+ (ispell-begin-skip-region-regexp)
+ ispell-region-end t))
+ (progn
+ (setq key (match-string-no-properties 0))
+ (set-marker skip-region-start
+ (- (point) (length key)))
+ (goto-char rstart)
+ (ispell-print-if-debug
+ (format "ispell-region: Next skip: %s at (pos,line,column): (%s,%s,%s).\n"
+ key
+ (save-excursion (goto-char skip-region-start) (point))
+ (line-number-at-pos skip-region-start)
+ (save-excursion (goto-char skip-region-start) (current-column)))))
+ (set-marker skip-region-start nil))))
+ (setq reg-end (max (point)
+ (if (marker-position skip-region-start)
+ (min skip-region-start ispell-region-end)
+ (marker-position ispell-region-end))))
+ (let* ((ispell-start (point))
+ (ispell-end (min (point-at-eol) reg-end))
+ ;; See if line must be prefixed by comment string to let ispell know this is
+ ;; part of a comment string. This is only supported in some modes.
+ ;; In particular, this is not supported in autoconf mode where adding the
+ ;; comment string messes everything up because ispell tries to spellcheck the
+ ;; `dnl' string header causing misalignments in some cases (debbugs.gnu.org: #12768).
+ (add-comment (and in-comment
+ (not (string= in-comment "dnl "))
+ in-comment))
+ (string (ispell-get-line
+ ispell-start ispell-end add-comment)))
+ (ispell-print-if-debug
+ (format
+ "ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [add-comment]: [%s], [string]: [%s]\n"
+ ispell-start ispell-end (point-at-eol) in-comment add-comment string))
+ (if add-comment ; account for comment chars added
+ (setq ispell-start (- ispell-start (length add-comment))
+ add-comment nil))
+ (setq ispell-end (point)) ; "end" tracks region retrieved.
+ (if string ; there is something to spell check!
+ ;; (special start end)
+ (setq shift (ispell-process-line string
+ (and recheckp shift))))
+ (goto-char ispell-end)))))
+ (if ispell-quit
+ nil
+ (or shift 0)))
+ ;; protected
+ (if (and (not (and recheckp ispell-keep-choices-win))
+ (get-buffer ispell-choices-buffer))
+ (kill-buffer ispell-choices-buffer))
+ (set-marker skip-region-start nil)
+ (set-marker rstart nil)
+ (if ispell-quit
+ (progn
+ ;; preserve or clear the region for ispell-continue.
+ (if (not (numberp ispell-quit))
+ (set-marker ispell-region-end nil)
+ ;; Ispell-continue enabled - ispell-region-end is set.
+ (goto-char ispell-quit))
+ ;; Check for aborting
+ (if (and ispell-checking-message (numberp ispell-quit))
+ (progn
+ (setq ispell-quit nil)
+ (error "Message send aborted")))
+ (if (not recheckp) (setq ispell-quit nil)))
+ (if (not recheckp) (set-marker ispell-region-end nil))
+ ;; Only save if successful exit.
+ (ispell-pdict-save ispell-silently-savep)
+ (message "Spell-checking %s using %s with %s dictionary...done"
+ region-type program-basename dictionary)))))
(defun ispell-begin-skip-region-regexp ()
;; Alignment cannot be tracked and this error will occur when
;; `query-replace' makes multiple corrections on the starting line.
(or (ispell-looking-at (car poss))
- ;; This occurs due to filter pipe problems
- (error (concat "Ispell misalignment: word "
- "`%s' point %d; probably incompatible versions")
- (car poss) (marker-position word-start)))
+ ;; This error occurs due to filter pipe problems
+ (let* ((ispell-pipe-word (car poss))
+ (actual-point (marker-position word-start))
+ (actual-line (line-number-at-pos actual-point))
+ (actual-column (save-excursion (goto-char actual-point) (current-column))))
+ (ispell-print-if-debug
+ (concat
+ "ispell-process-line: Ispell misalignment error:\n"
+ (format " [Word from ispell pipe]: [%s], actual (point,line,column): (%s,%s,%s)\n"
+ ispell-pipe-word actual-point actual-line actual-column)))
+ (error (concat "Ispell misalignment: word "
+ "`%s' point %d; probably incompatible versions")
+ ispell-pipe-word actual-point)))
;; ispell-cmd-loop can go recursive & change buffer
(if ispell-keep-choices-win
(setq replace (ispell-command-loop
(interactive)
(ispell-region (point-min) (point-max)))
+;;;###autoload
+(defun ispell-buffer-with-debug (&optional append)
+ "`ispell-buffer' with some output sent to `ispell-debug-buffer' buffer.
+Use APPEND to append the info to previous buffer if exists."
+ (interactive)
+ (let ((ispell-debug-buffer (ispell-create-debug-buffer append)))
+ (ispell-buffer)))
;;;###autoload
(defun ispell-continue ()
;; the next parsing iteration.
(when (eq (char-before) ?\\) (backward-char))
;; Insert in List
- (setq toc-entry (reftex-section-info file))
+ (setq toc-entry (funcall reftex-section-info-function file))
(when toc-entry
;; It can happen that section info returns nil
(setq level (nth 5 toc-entry))
(marker (nth 4 data)))
(with-current-buffer (marker-buffer marker)
(goto-char (marker-position marker))
- (if (looking-at (concat "\\([ \t]*\\\\\\)" (regexp-quote name)))
+ (if (looking-at (concat "\\([ \t]*" reftex-section-pre-regexp "\\)" (regexp-quote name)))
(replace-match (concat "\\1" newname))
(error "Fatal error during %smotion" pro-or-de)))))
(modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
(modify-syntax-entry ?\" "." reftex-syntax-table-for-bib)
(modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib)
- (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib))
+ (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)
+
+ (run-hooks 'reftex-mode-hook))
;; Mode was turned off
(easy-menu-remove reftex-mode-menu)))
(defvar reftex-find-label-regexp-format nil)
(defvar reftex-find-label-regexp-format2 nil)
+;; Constants for making RefTeX open to Texinfo hooking
+(defvar reftex-section-pre-regexp "\\\\")
+;; Including `\' as a character to be matched at the end of the regexp
+;; will allow stuff like \begin{foo}\label{bar} to be matched. This
+;; will make the parser to advance one char too much. Therefore
+;; `reftex-parse-from-file' will step one char back if a section is
+;; found.
+(defvar reftex-section-post-regexp "\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]")
+(defvar reftex-section-info-function 'reftex-section-info)
+
(defvar reftex-memory nil
"Memorizes old variable values to indicate changes in these variables.")
reftex-include-file-commands "\\|")
"\\)[{ \t]+\\([^} \t\n\r]+\\)"))
(section-re
- ;; Including `\' as a character to be matched at the end
- ;; of the regexp will allow stuff like
- ;; \begin{foo}\label{bar} to be matched. This will make
- ;; the parser to advance one char too much. Therefore
- ;; `reftex-parse-from-file' will step one char back if a
- ;; section is found.
- (concat wbol "\\\\\\("
+ (concat wbol reftex-section-pre-regexp "\\("
(mapconcat (lambda (x) (regexp-quote (car x)))
reftex-section-levels-all "\\|")
- "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]"))
+ "\\)" reftex-section-post-regexp))
(appendix-re (concat wbol "\\(\\\\appendix\\)"))
(macro-re
(if macros-with-labels
;; A start or end tag by itself on a line separates a paragraph.
;; This is desirable because SGML discards a newline that appears
;; immediately after a start tag or immediately before an end tag.
- (set (make-local-variable 'paragraph-start) (concat "[ \t]*$\\|\
+ (setq-local paragraph-start (concat "[ \t]*$\\|\
\[ \t]*</?\\(" sgml-name-re sgml-attrs-re "\\)?>"))
- (set (make-local-variable 'paragraph-separate)
- (concat paragraph-start "$"))
- (set (make-local-variable 'adaptive-fill-regexp) "[ \t]*")
+ (setq-local paragraph-separate (concat paragraph-start "$"))
+ (setq-local adaptive-fill-regexp "[ \t]*")
(add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t)
- (set (make-local-variable 'indent-line-function) 'sgml-indent-line)
- (set (make-local-variable 'comment-start) "<!-- ")
- (set (make-local-variable 'comment-end) " -->")
- (set (make-local-variable 'comment-indent-function) 'sgml-comment-indent)
- (set (make-local-variable 'comment-line-break-function)
- 'sgml-comment-indent-new-line)
- (set (make-local-variable 'skeleton-further-elements)
- '((completion-ignore-case t)))
- (set (make-local-variable 'skeleton-end-hook)
- (lambda ()
- (or (eolp)
- (not (or (eq v2 '\n) (eq (car-safe v2) '\n)))
- (newline-and-indent))))
- (set (make-local-variable 'font-lock-defaults)
- '((sgml-font-lock-keywords
- sgml-font-lock-keywords-1
- sgml-font-lock-keywords-2)
- nil t))
- (set (make-local-variable 'syntax-propertize-function)
- sgml-syntax-propertize-function)
- (set (make-local-variable 'facemenu-add-face-function)
- 'sgml-mode-facemenu-add-face-function)
- (set (make-local-variable 'sgml-xml-mode) (sgml-xml-guess))
- (if sgml-xml-mode
- ()
- (set (make-local-variable 'skeleton-transformation-function)
- sgml-transformation-function))
+ (setq-local indent-line-function 'sgml-indent-line)
+ (setq-local comment-start "<!-- ")
+ (setq-local comment-end " -->")
+ (setq-local comment-indent-function 'sgml-comment-indent)
+ (setq-local comment-line-break-function 'sgml-comment-indent-new-line)
+ (setq-local skeleton-further-elements '((completion-ignore-case t)))
+ (setq-local skeleton-end-hook
+ (lambda ()
+ (or (eolp)
+ (not (or (eq v2 '\n) (eq (car-safe v2) '\n)))
+ (newline-and-indent))))
+ (setq font-lock-defaults '((sgml-font-lock-keywords
+ sgml-font-lock-keywords-1
+ sgml-font-lock-keywords-2)
+ nil t))
+ (setq-local syntax-propertize-function sgml-syntax-propertize-function)
+ (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function)
+ (setq-local sgml-xml-mode (sgml-xml-guess))
+ (unless sgml-xml-mode
+ (setq-local skeleton-transformation-function sgml-transformation-function))
;; This will allow existing comments within declarations to be
;; recognized.
;; I can't find a clear description of SGML/XML comments, but it seems that
;; the only reliable ones are <!-- ... --> although it's not clear what
;; "..." can contain. It used to accept -- ... -- as well, but that was
;; apparently a mistake.
- (set (make-local-variable 'comment-start-skip) "<!--[ \t]*")
- (set (make-local-variable 'comment-end-skip) "[ \t]*--[ \t\n]*>")
+ (setq-local comment-start-skip "<!--[ \t]*")
+ (setq-local comment-end-skip "[ \t]*--[ \t\n]*>")
;; This definition has an HTML leaning but probably fits well for other modes.
(setq imenu-generic-expression
`((nil
(if (eq v2 t) (setq v2 nil))
;; We use `identity' to prevent skeleton from passing
;; `str' through `skeleton-transformation-function' a second time.
- '(("") v2 _ v2 "</" (identity ',str) ?>))
+ '(("") v2 _ v2 "</" (identity ',str) ?> >))
((eq (car v2) t)
(cons '("") (cdr v2)))
(t
(append '(("") (car v2))
(cdr v2)
- '(resume: (car v2) _ "</" (identity ',str) ?>))))))
+ '(resume: (car v2) _ "</" (identity ',str) ?> >))))))
(autoload 'skeleton-read "skeleton")
(unwind-protect
(save-excursion
(goto-char (point-min))
- (if (set (make-local-variable 'sgml-tags-invisible)
- (if arg
- (>= (prefix-numeric-value arg) 0)
- (not sgml-tags-invisible)))
+ (if (setq-local sgml-tags-invisible
+ (if arg
+ (>= (prefix-numeric-value arg) 0)
+ (not sgml-tags-invisible)))
(while (re-search-forward sgml-tag-name-re nil t)
(setq string
(cdr (assq (intern-soft (downcase (match-string 1)))
(goto-char (point-min))
(if (re-search-forward "^\\([ \t]+\\)<" 500 'noerror)
(progn
- (set (make-local-variable 'sgml-basic-offset)
- (1- (current-column)))
+ (setq-local sgml-basic-offset (1- (current-column)))
(message "Guessed sgml-basic-offset = %d"
sgml-basic-offset)
))))
(defvar outline-heading-end-regexp)
(defvar outline-level)
+(defun html-current-defun-name ()
+ "Return the name of the last HTML title or heading, or nil."
+ (save-excursion
+ (if (re-search-backward
+ (concat
+ "<[ \t\r\n]*"
+ "\\(?:[hH][0-6]\\|title\\|TITLE\\|Title\\)"
+ "[^>]*>"
+ "[ \t\r\n]*"
+ "\\([^<\r\n]*[^ <\t\r\n]+\\)")
+ nil t)
+ (match-string-no-properties 1))))
+
\f
;;;###autoload
(define-derived-mode html-mode sgml-mode '(sgml-xml-mode "XHTML" "HTML")
(eval-after-load \"sgml-mode\" '(aset sgml-char-names ?' nil))
\\{html-mode-map}"
- (set (make-local-variable 'sgml-display-text) html-display-text)
- (set (make-local-variable 'sgml-tag-face-alist) html-tag-face-alist)
- (make-local-variable 'sgml-tag-alist)
- (make-local-variable 'sgml-face-tag-alist)
- (make-local-variable 'sgml-tag-help)
- (make-local-variable 'outline-regexp)
- (make-local-variable 'outline-heading-end-regexp)
- (make-local-variable 'outline-level)
- (make-local-variable 'sentence-end-base)
- (setq sentence-end-base "[.?!][]\"'”)}]*\\(<[^>]*>\\)*"
- sgml-tag-alist html-tag-alist
- sgml-face-tag-alist html-face-tag-alist
- sgml-tag-help html-tag-help
- outline-regexp "^.*<[Hh][1-6]\\>"
- outline-heading-end-regexp "</[Hh][1-6]>"
- outline-level (lambda ()
- (char-before (match-end 0))))
+ (setq-local sgml-display-text html-display-text)
+ (setq-local sgml-tag-face-alist html-tag-face-alist)
+ (setq-local sgml-tag-alist html-tag-alist)
+ (setq-local sgml-face-tag-alist html-face-tag-alist)
+ (setq-local sgml-tag-help html-tag-help)
+ (setq-local outline-regexp "^.*<[Hh][1-6]\\>")
+ (setq-local outline-heading-end-regexp "</[Hh][1-6]>")
+ (setq-local outline-level
+ (lambda () (char-before (match-end 0))))
+ (setq-local add-log-current-defun-function #'html-current-defun-name)
+ (setq-local sentence-end-base "[.?!][]\"'”)}]*\\(<[^>]*>\\)*")
+
(setq imenu-create-index-function 'html-imenu-index)
- (set (make-local-variable 'sgml-empty-tags)
- ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd',
- ;; plus manual addition of "wbr".
- '("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input"
- "isindex" "link" "meta" "param" "wbr"))
- (set (make-local-variable 'sgml-unclosed-tags)
- ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd'.
- '("body" "colgroup" "dd" "dt" "head" "html" "li" "option"
- "p" "tbody" "td" "tfoot" "th" "thead" "tr"))
+
+ (setq-local sgml-empty-tags
+ ;; From HTML-4.01's loose.dtd, parsed with
+ ;; `sgml-parse-dtd', plus manual addition of "wbr".
+ '("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input"
+ "isindex" "link" "meta" "param" "wbr"))
+ (setq-local sgml-unclosed-tags
+ ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd'.
+ '("body" "colgroup" "dd" "dt" "head" "html" "li" "option"
+ "p" "tbody" "td" "tfoot" "th" "thead" "tr"))
;; It's for the user to decide if it defeats it or not -stef
;; (make-local-variable 'imenu-sort-function)
;; (setq imenu-sort-function nil) ; sorting the menu defeats the purpose
"Update cell face according to the current mode."
(if (featurep 'xemacs)
(set-face-property 'table-cell 'underline table-fixed-width-mode)
- (set-face-inverse-video-p 'table-cell table-fixed-width-mode)))
+ (set-face-inverse-video 'table-cell table-fixed-width-mode)))
(table--update-cell-face)
(if (looking-at latex-outline-regexp)
(1+ (or (cdr (assoc (match-string 1) latex-section-alist)) -1))
1000))
+
+(defun tex-current-defun-name ()
+ "Return the name of the TeX section/paragraph/chapter at point, or nil."
+ (save-excursion
+ (when (re-search-backward
+ "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)"
+ nil t)
+ (goto-char (match-beginning 0))
+ (buffer-substring-no-properties
+ (1+ (point)) ; without initial backslash
+ (line-end-position)))))
\f
;;;;
;;;; Font-Lock support
Entering Plain-tex mode runs the hook `text-mode-hook', then the hook
`tex-mode-hook', and finally the hook `plain-tex-mode-hook'. When the
special subshell is initiated, the hook `tex-shell-hook' is run."
- (set (make-local-variable 'tex-command) tex-run-command)
- (set (make-local-variable 'tex-start-of-header) "%\\*\\*start of header")
- (set (make-local-variable 'tex-end-of-header) "%\\*\\*end of header")
- (set (make-local-variable 'tex-trailer) "\\bye\n"))
+ (setq-local tex-command tex-run-command)
+ (setq-local tex-start-of-header "%\\*\\*start of header")
+ (setq-local tex-end-of-header "%\\*\\*end of header")
+ (setq-local tex-trailer "\\bye\n"))
;;;###autoload
(define-derived-mode latex-mode tex-mode "LaTeX"
Entering Latex mode runs the hook `text-mode-hook', then
`tex-mode-hook', and finally `latex-mode-hook'. When the special
subshell is initiated, `tex-shell-hook' is run."
- (set (make-local-variable 'tex-command) latex-run-command)
- (set (make-local-variable 'tex-start-of-header)
- "\\\\document\\(style\\|class\\)")
- (set (make-local-variable 'tex-end-of-header) "\\\\begin\\s-*{document}")
- (set (make-local-variable 'tex-trailer) "\\end{document}\n")
+ (setq-local tex-command latex-run-command)
+ (setq-local tex-start-of-header "\\\\document\\(style\\|class\\)")
+ (setq-local tex-end-of-header "\\\\begin\\s-*{document}")
+ (setq-local tex-trailer "\\end{document}\n")
;; A line containing just $$ is treated as a paragraph separator.
;; A line starting with $$ starts a paragraph,
;; but does not separate paragraphs if it has more stuff on it.
"marginpar" "parbox" "caption"))
"\\|\\$\\$\\|[a-z]*\\(space\\|skip\\|page[a-z]*\\)"
"\\>\\)[ \t]*\\($\\|%\\)\\)"))
- (set (make-local-variable 'imenu-create-index-function)
- 'latex-imenu-create-index)
- (set (make-local-variable 'tex-face-alist) tex-latex-face-alist)
+ (setq-local imenu-create-index-function 'latex-imenu-create-index)
+ (setq-local tex-face-alist tex-latex-face-alist)
(add-hook 'fill-nobreak-predicate 'latex-fill-nobreak-predicate nil t)
- (set (make-local-variable 'indent-line-function) 'latex-indent)
- (set (make-local-variable 'fill-indent-according-to-mode) t)
+ (setq-local indent-line-function 'latex-indent)
+ (setq-local fill-indent-according-to-mode t)
(add-hook 'completion-at-point-functions
'latex-complete-data nil 'local)
- (set (make-local-variable 'outline-regexp) latex-outline-regexp)
- (set (make-local-variable 'outline-level) 'latex-outline-level)
- (set (make-local-variable 'forward-sexp-function) 'latex-forward-sexp)
- (set (make-local-variable 'skeleton-end-hook) nil))
+ (setq-local outline-regexp latex-outline-regexp)
+ (setq-local outline-level 'latex-outline-level)
+ (setq-local forward-sexp-function 'latex-forward-sexp)
+ (setq-local skeleton-end-hook nil))
;;;###autoload
(define-derived-mode slitex-mode latex-mode "SliTeX"
(defun tex-common-initialization ()
;; Regexp isearch should accept newline and formfeed as whitespace.
- (set (make-local-variable 'search-whitespace-regexp) "[ \t\r\n\f]+")
+ (setq-local search-whitespace-regexp "[ \t\r\n\f]+")
;; A line containing just $$ is treated as a paragraph separator.
- (set (make-local-variable 'paragraph-start)
- "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$")
+ (setq-local paragraph-start "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$")
;; A line starting with $$ starts a paragraph,
;; but does not separate paragraphs if it has more stuff on it.
- (set (make-local-variable 'paragraph-separate)
- "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$[ \t]*$")
- (set (make-local-variable 'comment-start) "%")
- (set (make-local-variable 'comment-add) 1)
- (set (make-local-variable 'comment-start-skip)
- "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)")
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
- (set (make-local-variable 'compare-windows-whitespace)
- 'tex-categorize-whitespace)
- (set (make-local-variable 'facemenu-add-face-function)
- 'tex-facemenu-add-face-function)
- (set (make-local-variable 'facemenu-end-add-face) "}")
- (set (make-local-variable 'facemenu-remove-face-function) t)
- (set (make-local-variable 'font-lock-defaults)
- '((tex-font-lock-keywords tex-font-lock-keywords-1
- tex-font-lock-keywords-2 tex-font-lock-keywords-3)
- nil nil nil nil
- ;; Who ever uses that anyway ???
- (font-lock-mark-block-function . mark-paragraph)
- (font-lock-syntactic-face-function
- . tex-font-lock-syntactic-face-function)
- (font-lock-unfontify-region-function
- . tex-font-lock-unfontify-region)))
- (set (make-local-variable 'syntax-propertize-function)
- (syntax-propertize-rules latex-syntax-propertize-rules))
+ (setq-local paragraph-separate "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$[ \t]*$")
+ (setq-local add-log-current-defun-function #'tex-current-defun-name)
+ (setq-local comment-start "%")
+ (setq-local comment-add 1)
+ (setq-local comment-start-skip
+ "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)")
+ (setq-local parse-sexp-ignore-comments t)
+ (setq-local compare-windows-whitespace 'tex-categorize-whitespace)
+ (setq-local facemenu-add-face-function 'tex-facemenu-add-face-function)
+ (setq-local facemenu-end-add-face "}")
+ (setq-local facemenu-remove-face-function t)
+ (setq-local font-lock-defaults
+ '((tex-font-lock-keywords tex-font-lock-keywords-1
+ tex-font-lock-keywords-2 tex-font-lock-keywords-3)
+ nil nil nil nil
+ ;; Who ever uses that anyway ???
+ (font-lock-mark-block-function . mark-paragraph)
+ (font-lock-syntactic-face-function
+ . tex-font-lock-syntactic-face-function)
+ (font-lock-unfontify-region-function
+ . tex-font-lock-unfontify-region)))
+ (setq-local syntax-propertize-function
+ (syntax-propertize-rules latex-syntax-propertize-rules))
;; TABs in verbatim environments don't do what you think.
- (set (make-local-variable 'indent-tabs-mode) nil)
+ (setq-local indent-tabs-mode nil)
;; Other vars that should be buffer-local.
(make-local-variable 'tex-command)
(make-local-variable 'tex-start-of-header)
(looking-at bibtex-reference-key))
(push (match-string-no-properties 0) keys)))))
;; Fill the cache.
- (set (make-local-variable 'latex-complete-bibtex-cache)
- (list files key keys)))
+ (setq-local latex-complete-bibtex-cache (list files key keys)))
(complete-with-action action keys key pred)))))
(defun latex-complete-envnames ()
;; The utility functions:
(define-derived-mode tex-shell shell-mode "TeX-Shell"
- (set (make-local-variable 'compilation-error-regexp-alist)
- tex-error-regexp-alist)
+ (setq-local compilation-error-regexp-alist tex-error-regexp-alist)
(compilation-shell-minor-mode t))
;;;###autoload
(with-no-warnings
(when (boundp 'TeX-master)
(cond ((stringp TeX-master)
- (make-local-variable 'tex-main-file)
- (setq tex-main-file TeX-master))
+ (setq-local tex-main-file TeX-master))
((and (eq TeX-master t) buffer-file-name)
(file-relative-name buffer-file-name)))))
;; Try to guess the main file.
(cons (car x) 'doctex-font-lock-syntactic-face-function))
(_ x)))
(cdr font-lock-defaults))))
- (set (make-local-variable 'syntax-propertize-function)
- (syntax-propertize-rules doctex-syntax-propertize-rules)))
+ (setq-local syntax-propertize-function
+ (syntax-propertize-rules doctex-syntax-propertize-rules)))
(run-hooks 'tex-mode-load-hook)
;;; Code:
(eval-when-compile (require 'tex-mode))
+(declare-function tex-buffer "tex-mode" ())
+(declare-function tex-region "tex-mode" (beg end))
+(declare-function tex-send-command "tex-mode")
+(declare-function tex-recenter-output-buffer "tex-mode" (linenum))
+(declare-function tex-print "tex-mode" (&optional alt))
+(declare-function tex-view "tex-mode" ())
+(declare-function tex-shell-running "tex-mode" ())
+(declare-function tex-kill-job "tex-mode" ())
+
(defvar outline-heading-alist)
(defgroup texinfo nil
(regexp-opt (texinfo-filter 2 texinfo-section-list))
"Regular expression matching just the Texinfo chapter level headings.")
+(defun texinfo-current-defun-name ()
+ "Return the name of the Texinfo node at point, or nil."
+ (save-excursion
+ (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t)
+ (match-string-no-properties 1))))
+
;;; Texinfo mode
;;;###autoload
Entering Texinfo mode calls the value of `text-mode-hook', and then the
value of `texinfo-mode-hook'."
- (set (make-local-variable 'page-delimiter)
- (concat
- "^@node [ \t]*[Tt]op\\|^@\\("
- texinfo-chapter-level-regexp
- "\\)\\>"))
- (make-local-variable 'require-final-newline)
- (setq require-final-newline mode-require-final-newline)
- (make-local-variable 'indent-tabs-mode)
- (setq indent-tabs-mode nil)
- (make-local-variable 'paragraph-separate)
- (setq paragraph-separate
- (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
- (make-local-variable 'paragraph-start)
- (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
- (set (make-local-variable 'sentence-end-base)
- "\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*")
- (make-local-variable 'fill-column)
- (setq fill-column 70)
- (make-local-variable 'comment-start)
- (setq comment-start "@c ")
- (make-local-variable 'comment-start-skip)
- (setq comment-start-skip "@c +\\|@comment +")
- (make-local-variable 'words-include-escapes)
- (setq words-include-escapes t)
- (make-local-variable 'imenu-generic-expression)
- (setq imenu-generic-expression texinfo-imenu-generic-expression)
+ (setq-local page-delimiter
+ (concat "^@node [ \t]*[Tt]op\\|^@\\("
+ texinfo-chapter-level-regexp
+ "\\)\\>"))
+ (setq-local require-final-newline mode-require-final-newline)
+ (setq-local indent-tabs-mode nil)
+ (setq-local paragraph-separate
+ (concat "\b\\|@[a-zA-Z]*[ \n]\\|"
+ paragraph-separate))
+ (setq-local paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|"
+ paragraph-start))
+ (setq-local sentence-end-base "\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*")
+ (setq-local fill-column 70)
+ (setq-local comment-start "@c ")
+ (setq-local comment-start-skip "@c +\\|@comment +")
+ (setq-local words-include-escapes t)
+ (setq-local imenu-generic-expression texinfo-imenu-generic-expression)
(setq imenu-case-fold-search nil)
- (make-local-variable 'font-lock-defaults)
(setq font-lock-defaults
'(texinfo-font-lock-keywords nil nil nil backward-paragraph))
- (set (make-local-variable 'syntax-propertize-function)
- texinfo-syntax-propertize-function)
- (set (make-local-variable 'parse-sexp-lookup-properties) t)
+ (setq-local syntax-propertize-function texinfo-syntax-propertize-function)
+ (setq-local parse-sexp-lookup-properties t)
+ (setq-local add-log-current-defun-function #'texinfo-current-defun-name)
;; Outline settings.
- (set (make-local-variable 'outline-heading-alist)
- ;; We should merge outline-heading-alist and texinfo-section-list
- ;; but in the mean time, let's just generate one from the other.
- (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
- texinfo-section-list))
- (set (make-local-variable 'outline-regexp)
- (concat (regexp-opt (mapcar 'car outline-heading-alist) t)
- "\\>"))
-
- (make-local-variable 'tex-start-of-header)
- (setq tex-start-of-header "%\\*\\*start")
- (make-local-variable 'tex-end-of-header)
- (setq tex-end-of-header "%\\*\\*end")
- (make-local-variable 'tex-first-line-header-regexp)
- (setq tex-first-line-header-regexp "^\\\\input")
- (make-local-variable 'tex-trailer)
- (setq tex-trailer "@bye\n")
-
- ;; Prevent filling certain lines, in addition to ones specified
- ;; by the user.
- (let ((prevent-filling "^@\\(def\\|multitable\\)"))
- (set (make-local-variable 'auto-fill-inhibit-regexp)
- (if (null auto-fill-inhibit-regexp)
- prevent-filling
- (concat auto-fill-inhibit-regexp "\\|" prevent-filling)))))
+ (setq-local outline-heading-alist
+ ;; We should merge `outline-heading-alist' and
+ ;; `texinfo-section-list'. But in the mean time, let's
+ ;; just generate one from the other.
+ (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
+ texinfo-section-list))
+ (setq-local outline-regexp
+ (concat (regexp-opt (mapcar 'car outline-heading-alist) t)
+ "\\>"))
+
+ (setq-local tex-start-of-header "%\\*\\*start")
+ (setq-local tex-end-of-header "%\\*\\*end")
+ (setq-local tex-first-line-header-regexp "^\\\\input")
+ (setq-local tex-trailer "@bye\n")
+
+ ;; Prevent filling certain lines, in addition to ones specified by
+ ;; the user.
+ (setq-local auto-fill-inhibit-regexp
+ (let ((prevent-filling "^@\\(def\\|multitable\\)"))
+ (if (null auto-fill-inhibit-regexp)
+ prevent-filling
+ (concat auto-fill-inhibit-regexp "\\|" prevent-filling)))))
\f
;; Internal variables used free
(defvar uniquify-possibly-resolvable nil)
-(defvar uniquify-managed nil
+(defvar-local uniquify-managed nil
"Non-nil if the name of this buffer is managed by uniquify.
It actually holds the list of `uniquify-item's corresponding to the conflict.")
-(make-variable-buffer-local 'uniquify-managed)
(put 'uniquify-managed 'permanent-local t)
;; Used in desktop.el to save the non-uniquified buffer name
;; rename-buffer and create-file-buffer. (Setting find-file-hook isn't
;; sufficient.)
-(defadvice rename-buffer (after rename-buffer-uniquify activate)
+(advice-add 'rename-buffer :around #'uniquify--rename-buffer-advice)
+(defun uniquify--rename-buffer-advice (rb-fun newname &optional unique &rest args)
"Uniquify buffer names with parts of directory name."
+ (let ((retval (apply rb-fun newname unique args)))
(uniquify-maybe-rerationalize-w/o-cb)
- (if (null (ad-get-arg 1)) ; no UNIQUE argument.
+ (if (null unique)
;; Mark this buffer so it won't be renamed by uniquify.
(setq uniquify-managed nil)
(when uniquify-buffer-name-style
;; Rerationalize w.r.t the new name.
(uniquify-rationalize-file-buffer-names
- (ad-get-arg 0)
+ newname
(uniquify-buffer-file-name (current-buffer))
(current-buffer))
- (setq ad-return-value (buffer-name (current-buffer))))))
+ (setq retval (buffer-name (current-buffer)))))
+ retval))
-(defadvice create-file-buffer (after create-file-buffer-uniquify activate)
+
+(advice-add 'create-file-buffer :around #'uniquify--create-file-buffer-advice)
+(defun uniquify--create-file-buffer-advice (cfb-fun filename &rest args)
"Uniquify buffer names with parts of directory name."
+ (let ((retval (apply cfb-fun filename args)))
(if uniquify-buffer-name-style
- (let ((filename (expand-file-name (directory-file-name (ad-get-arg 0)))))
+ (let ((filename (expand-file-name (directory-file-name filename))))
(uniquify-rationalize-file-buffer-names
(file-name-nondirectory filename)
- (file-name-directory filename) ad-return-value))))
+ (file-name-directory filename) retval)))
+ retval))
;;; The End
(set-buffer buf)
(when uniquify-managed
(push (cons buf (uniquify-item-base (car uniquify-managed))) buffers)))
- (dolist (fun '(rename-buffer create-file-buffer))
- (ad-remove-advice fun 'after (intern (concat (symbol-name fun) "-uniquify")))
- (ad-update fun))
+ (advice-remove 'rename-buffer #'uniquify--rename-buffer-advice)
+ (advice-remove 'create-file-buffer #'uniquify--create-file-buffer-advice)
(dolist (buf buffers)
(set-buffer (car buf))
(rename-buffer (cdr buf) t))))
+2012-12-22 Takafumi Arakaki <aka.tkf@gmail.com> (tiny change)
+
+ * url-http.el (url-http-end-of-document-sentinel): Bind relevant
+ url-request-* variables around the call to url-http (Bug#11469).
+
+ * url-expand.el (url-default-expander): Don't calculate a default
+ url port before checking url-type (Bug#12374).
+
+2012-12-22 Chong Yidong <cyd@gnu.org>
+
+ * url-parse.el (url-port): Doc fix.
+
+2012-12-03 Chong Yidong <cyd@gnu.org>
+
+ * url-misc.el (url-do-terminal-emulator): Use make-term instead of
+ terminal-emulator.
+
2012-10-13 Liam Stitt <stittl@cuug.ab.ca> (tiny change)
* url-vars.el (url-uncompressor-alist):
;; Well, they told us the scheme, let's just go with it.
nil
(setf (url-type urlobj) (or (url-type urlobj) (url-type defobj)))
- (setf (url-port urlobj) (or (url-port urlobj)
+ (setf (url-port urlobj) (or (url-portspec urlobj)
(and (string= (url-type urlobj)
(url-type defobj))
(url-port defobj))))
(url-http-activate-callback)
;; Call `url-http' again if our connection expired.
(erase-buffer)
- (url-http url-current-object url-callback-function
- url-callback-arguments (current-buffer))))
+ (let ((url-request-method url-http-method)
+ (url-request-extra-headers url-http-extra-headers)
+ (url-request-data url-http-data))
+ (url-http url-current-object url-callback-function
+ url-callback-arguments (current-buffer)))))
((url-http-parse-headers)
(url-http-activate-callback))))))
nil))
(defun url-do-terminal-emulator (type server port user)
- (terminal-emulator
- (generate-new-buffer (format "%s%s" (if user (concat user "@") "") server))
- (pcase type
- (`rlogin "rlogin")
- (`telnet "telnet")
- (`tn3270 "tn3270")
- (_
- (error "Unknown terminal emulator required: %s" type)))
- (pcase type
- (`rlogin
- (if user
- (list server "-l" user)
- (list server)))
- (`telnet
- (if user (message "Please log in as user: %s" user))
- (if port
- (list server port)
- (list server)))
- (`tn3270
- (if user (message "Please log in as user: %s" user))
- (list server)))))
+ (switch-to-buffer
+ (apply
+ 'make-term
+ (format "%s%s" (if user (concat user "@") "") server)
+ (cond ((eq type 'rlogin) "rlogin")
+ ((eq type 'telnet) "telnet")
+ ((eq type 'tn3270) "tn3270")
+ (t (error "Unknown terminal emulator required: %s" type)))
+ nil
+ (cond ((eq type 'rlogin)
+ (if user (list server "-l" user) (list server)))
+ ((eq type 'telnet)
+ (if port (list server port) (list server)))
+ ((eq type 'tn3270)
+ (list server))))))
;;;###autoload
(defun url-generic-emulator-loader (url)
silent (use-cookies t))
(defsubst url-port (urlobj)
- "Return the port number for the URL specified by URLOBJ."
+ "Return the port number for the URL specified by URLOBJ.
+If the port spec is nil (i.e. URLOBJ specifies no port number),
+return the default port number for URLOBJ's scheme."
(declare (gv-setter (lambda (port) `(setf (url-portspec ,urlobj) ,port))))
(or (url-portspec urlobj)
(if (url-type urlobj)
(url-scheme-get-property (url-type urlobj) 'default-port))))
-
(defun url-path-and-query (urlobj)
"Return the path and query components of URLOBJ.
These two components are stored together in the FILENAME slot of
;;;###autoload
(defcustom add-log-current-defun-function nil
"If non-nil, function to guess name of surrounding function.
-It is used by `add-log-current-defun' in preference to built-in rules.
-Returns function's name as a string, or nil if outside a function."
+It is called by `add-log-current-defun' with no argument, and
+should return the function's name as a string, or nil if point is
+outside a function."
:type '(choice (const nil) function)
:group 'change-log)
:type 'regexp
:group 'change-log)
-;;;###autoload
-(defvar add-log-lisp-like-modes
- '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode)
- "Modes that look like Lisp to `add-log-current-defun'.")
-
-;;;###autoload
-(defvar add-log-c-like-modes
- '(c-mode c++-mode c++-c-mode objc-mode)
- "Modes that look like C to `add-log-current-defun'.")
-
-;;;###autoload
-(defvar add-log-tex-like-modes
- '(TeX-mode plain-TeX-mode LaTeX-mode tex-mode)
- "Modes that look like TeX to `add-log-current-defun'.")
-
(declare-function c-cpp-define-name "cc-cmds" ())
(declare-function c-defun-name "cc-cmds" ())
Has a preference of looking backwards."
(condition-case nil
(save-excursion
- (let ((location (point)))
- (cond (add-log-current-defun-function
- (funcall add-log-current-defun-function))
- ((apply 'derived-mode-p add-log-lisp-like-modes)
- ;; If we are now precisely at the beginning of a defun,
- ;; make sure beginning-of-defun finds that one
- ;; rather than the previous one.
- (or (eobp) (forward-char 1))
- (beginning-of-defun)
- ;; Make sure we are really inside the defun found,
- ;; not after it.
- (when (and (looking-at "\\s(")
- (progn (end-of-defun)
- (< location (point)))
- (progn (forward-sexp -1)
- (>= location (point))))
- (if (looking-at "\\s(")
- (forward-char 1))
- ;; Skip the defining construct name, typically "defun"
- ;; or "defvar".
- (forward-sexp 1)
- ;; The second element is usually a symbol being defined.
- ;; If it is not, use the first symbol in it.
- (skip-chars-forward " \t\n'(")
- (buffer-substring-no-properties (point)
- (progn (forward-sexp 1)
- (point)))))
- ((apply 'derived-mode-p add-log-c-like-modes)
- (or (c-cpp-define-name)
- (c-defun-name)))
- ((apply #'derived-mode-p add-log-tex-like-modes)
- (if (re-search-backward
- "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)"
- nil t)
- (progn
- (goto-char (match-beginning 0))
- (buffer-substring-no-properties
- (1+ (point)) ; without initial backslash
- (line-end-position)))))
- ((derived-mode-p 'texinfo-mode)
- (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t)
- (match-string-no-properties 1)))
- ((derived-mode-p 'perl-mode 'cperl-mode)
- (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
- (match-string-no-properties 1)))
- ;; Emacs's autoconf-mode installs its own
- ;; `add-log-current-defun-function'. This applies to
- ;; a different mode apparently for editing .m4
- ;; autoconf source.
- ((derived-mode-p 'autoconf-mode)
- (if (re-search-backward
- "^\\(\\(m4_\\)?define\\|A._DEFUN\\)(\\[?\\([A-Za-z0-9_]+\\)" nil t)
- (match-string-no-properties 3)))
- (t
- ;; If all else fails, try heuristics
- (let (case-fold-search
- result)
- (end-of-line)
- (when (re-search-backward
- add-log-current-defun-header-regexp
- (- (point) 10000)
- t)
- (setq result (or (match-string-no-properties 1)
- (match-string-no-properties 0)))
- ;; Strip whitespace away
- (when (string-match "\\([^ \t\n\r\f].*[^ \t\n\r\f]\\)"
- result)
- (setq result (match-string-no-properties 1 result)))
- result))))))
+ (if add-log-current-defun-function
+ (funcall add-log-current-defun-function)
+ ;; If all else fails, try heuristics
+ (let (case-fold-search
+ result)
+ (end-of-line)
+ (when (re-search-backward add-log-current-defun-header-regexp
+ (- (point) 10000) t)
+ (setq result (or (match-string-no-properties 1)
+ (match-string-no-properties 0)))
+ ;; Strip whitespace away
+ (when (string-match "\\([^ \t\n\r\f].*[^ \t\n\r\f]\\)"
+ result)
+ (setq result (match-string-no-properties 1 result)))
+ result))))
(error nil)))
(defvar change-log-get-method-definition-md)
(easy-mmode-define-navigation
diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view
(when diff-auto-refine-mode
- (setq diff--auto-refine-data (cons (current-buffer) (point-marker)))
- (run-at-time 0.0 nil
- (lambda ()
- (when diff--auto-refine-data
- (let ((buffer (car diff--auto-refine-data))
- (point (cdr diff--auto-refine-data)))
- (setq diff--auto-refine-data nil)
- (with-local-quit
- (when (buffer-live-p buffer)
- (with-current-buffer buffer
- (save-excursion
- (goto-char point)
- (diff-refine-hunk)))))))))))
+ (unless (prog1 diff--auto-refine-data
+ (setq diff--auto-refine-data
+ (cons (current-buffer) (point-marker))))
+ (run-at-time 0.0 nil
+ (lambda ()
+ (when diff--auto-refine-data
+ (let ((buffer (car diff--auto-refine-data))
+ (point (cdr diff--auto-refine-data)))
+ (setq diff--auto-refine-data nil)
+ (with-local-quit
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char point)
+ (diff-refine-hunk))))))))))))
(easy-mmode-define-navigation
diff-file diff-file-header-re "file" diff-end-of-file)
(re-search-forward diff-context-mid-hunk-header-re
nil t)))))
(when (and ;; Don't try to fixup changes in the hunk header.
- (> (car diff-unhandled-changes) start)
+ (>= (car diff-unhandled-changes) start)
;; Don't try to fixup changes in the mid-hunk header either.
(or (not mid)
(< (cdr diff-unhandled-changes) (match-beginning 0))
c-prev c-end)
;; else convert lines to points
(ediff-with-current-buffer A-buffer
- (let ((longlines-mode-val
- (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
- ;; we must disable and then restore longlines-mode
- (if (eq longlines-mode-val 1)
- (longlines-mode 0))
- (goto-char (or a-prev-pt shift-A (point-min)))
- (forward-line (- a-begin a-prev))
- (setq a-begin-pt (point))
- (forward-line (- a-end a-begin))
- (setq a-end-pt (point)
- a-prev a-end
- a-prev-pt a-end-pt)
- (if (eq longlines-mode-val 1)
- (longlines-mode longlines-mode-val))
- ))
+ (goto-char (or a-prev-pt shift-A (point-min)))
+ (forward-line (- a-begin a-prev))
+ (setq a-begin-pt (point))
+ (forward-line (- a-end a-begin))
+ (setq a-end-pt (point)
+ a-prev a-end
+ a-prev-pt a-end-pt))
(ediff-with-current-buffer B-buffer
- (let ((longlines-mode-val
- (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
- (if (eq longlines-mode-val 1)
- (longlines-mode 0))
- (goto-char (or b-prev-pt shift-B (point-min)))
- (forward-line (- b-begin b-prev))
- (setq b-begin-pt (point))
- (forward-line (- b-end b-begin))
- (setq b-end-pt (point)
- b-prev b-end
- b-prev-pt b-end-pt)
- (if (eq longlines-mode-val 1)
- (longlines-mode longlines-mode-val))
- ))
+ (goto-char (or b-prev-pt shift-B (point-min)))
+ (forward-line (- b-begin b-prev))
+ (setq b-begin-pt (point))
+ (forward-line (- b-end b-begin))
+ (setq b-end-pt (point)
+ b-prev b-end
+ b-prev-pt b-end-pt))
(if (ediff-buffer-live-p C-buffer)
(ediff-with-current-buffer C-buffer
- (let ((longlines-mode-val
- (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
- (if (eq longlines-mode-val 1)
- (longlines-mode 0))
- (goto-char (or c-prev-pt (point-min)))
- (forward-line (- c-begin c-prev))
- (setq c-begin-pt (point))
- (forward-line (- c-end c-begin))
- (setq c-end-pt (point)
- c-prev c-end
- c-prev-pt c-end-pt)
- (if (eq longlines-mode-val 1)
- (longlines-mode longlines-mode-val))
- )))
+ (goto-char (or c-prev-pt (point-min)))
+ (forward-line (- c-begin c-prev))
+ (setq c-begin-pt (point))
+ (forward-line (- c-end c-begin))
+ (setq c-end-pt (point)
+ c-prev c-end
+ c-prev-pt c-end-pt)))
(setq diff-list
(nconc
diff-list
c-prev c-end)
;; else convert lines to points
(ediff-with-current-buffer A-buffer
- (let ((longlines-mode-val
- (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
- ;; we must disable and then restore longlines-mode
- (if (eq longlines-mode-val 1)
- (longlines-mode 0))
- (goto-char (or a-prev-pt shift-A (point-min)))
- (forward-line (- a-begin a-prev))
- (setq a-begin-pt (point))
- (forward-line (- a-end a-begin))
- (setq a-end-pt (point)
- a-prev a-end
- a-prev-pt a-end-pt)
- (if (eq longlines-mode-val 1)
- (longlines-mode longlines-mode-val))
- ))
+ (goto-char (or a-prev-pt shift-A (point-min)))
+ (forward-line (- a-begin a-prev))
+ (setq a-begin-pt (point))
+ (forward-line (- a-end a-begin))
+ (setq a-end-pt (point)
+ a-prev a-end
+ a-prev-pt a-end-pt))
(ediff-with-current-buffer B-buffer
- (let ((longlines-mode-val
- (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
- (if (eq longlines-mode-val 1)
- (longlines-mode 0))
- (goto-char (or b-prev-pt shift-B (point-min)))
- (forward-line (- b-begin b-prev))
- (setq b-begin-pt (point))
- (forward-line (- b-end b-begin))
- (setq b-end-pt (point)
- b-prev b-end
- b-prev-pt b-end-pt)
- (if (eq longlines-mode-val 1)
- (longlines-mode longlines-mode-val))
- ))
+ (goto-char (or b-prev-pt shift-B (point-min)))
+ (forward-line (- b-begin b-prev))
+ (setq b-begin-pt (point))
+ (forward-line (- b-end b-begin))
+ (setq b-end-pt (point)
+ b-prev b-end
+ b-prev-pt b-end-pt))
(ediff-with-current-buffer C-buffer
- (let ((longlines-mode-val
- (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
- (if (eq longlines-mode-val 1)
- (longlines-mode 0))
- (goto-char (or c-prev-pt shift-C (point-min)))
- (forward-line (- c-begin c-prev))
- (setq c-begin-pt (point))
- (forward-line (- c-end c-begin))
- (setq c-end-pt (point)
- c-prev c-end
- c-prev-pt c-end-pt)
- (if (eq longlines-mode-val 1)
- (longlines-mode longlines-mode-val))
- ))
+ (goto-char (or c-prev-pt shift-C (point-min)))
+ (forward-line (- c-begin c-prev))
+ (setq c-begin-pt (point))
+ (forward-line (- c-end c-begin))
+ (setq c-end-pt (point)
+ c-prev c-end
+ c-prev-pt c-end-pt))
(if (ediff-buffer-live-p anc-buffer)
(ediff-with-current-buffer anc-buffer
- (let ((longlines-mode-val
- (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
- (if (eq longlines-mode-val 1)
- (longlines-mode 0))
- (forward-line (- c-or-anc-begin anc-prev))
- (setq anc-begin-pt (point))
- (forward-line (- c-or-anc-end c-or-anc-begin))
- (setq anc-end-pt (point)
- anc-prev c-or-anc-end)
- (if (eq longlines-mode-val 1)
- (longlines-mode longlines-mode-val))
- )))
+ (forward-line (- c-or-anc-begin anc-prev))
+ (setq anc-begin-pt (point))
+ (forward-line (- c-or-anc-end c-or-anc-begin))
+ (setq anc-end-pt (point)
+ anc-prev c-or-anc-end)))
(setq diff-list
(nconc
diff-list
;; We usually come up with two candidates and ediff-file-name-sans-prefix
;; resolves this later.
;;
-;; The marker `marker1' delimits the beginning of the corresponding patch and
-;; `marker2' does it for the end.
+;; The marker `mark1' delimits the beginning of the corresponding patch and
+;; `mark2' does it for the end.
;; The result of ediff-map-patch-buffer is a list, which is then assigned
;; to ediff-patch-map.
;; The function returns the number of elements in the list ediff-patch-map
(defun ediff-map-patch-buffer (buf)
(ediff-with-current-buffer buf
(let ((count 0)
- (mark1 (move-marker (make-marker) (point-min)))
+ (mark1 (point-min-marker))
(mark1-end (point-min))
(possible-file-names '("/dev/null" . "/dev/null"))
mark2-end mark2 filenames
(set-window-buffer wind cloned-buff)
cloned-buff))
-(defun ediff-clone-buffer-for-current-diff-comparison (buff buf-type reg-name)
- (let ((cloned-buff (ediff-make-cloned-buffer buff reg-name))
- (reg-start (ediff-get-diff-posn buf-type 'beg))
- (reg-end (ediff-get-diff-posn buf-type 'end)))
+(defun ediff-buffer-type (buffer)
+ (cond ((eq buffer ediff-buffer-A) 'A)
+ ((eq buffer ediff-buffer-B) 'B)
+ ((eq buffer ediff-buffer-C) 'C)
+ ((eq buffer ediff-ancestor-buffer) 'Ancestor)
+ (t nil)))
+
+(defun ediff-clone-buffer-for-current-diff-comparison (buff reg-name)
+ (let* ((cloned-buff (ediff-make-cloned-buffer buff reg-name))
+ (buf-type (ediff-buffer-type buff))
+ (reg-start (ediff-get-diff-posn buf-type 'beg))
+ (reg-end (ediff-get-diff-posn buf-type 'end)))
(ediff-with-current-buffer cloned-buff
;; set region to be the current diff region
(goto-char reg-start)
(defun ediff-inferior-compare-regions ()
"Compare regions in an active Ediff session.
-Like ediff-regions-linewise but is called from under an active Ediff session on
+Like `ediff-regions-linewise' but is called from under an active Ediff session on
the files that belong to that session.
After quitting the session invoked via this function, type C-l to the parent
(setq bufA (if use-current-diff-p
(ediff-clone-buffer-for-current-diff-comparison
- bufA 'A "-Region.A-")
+ bufA "-Region.A-")
(ediff-clone-buffer-for-region-comparison bufA "-Region.A-")))
(ediff-with-current-buffer bufA
(setq begA (region-beginning)
(setq bufB (if use-current-diff-p
(ediff-clone-buffer-for-current-diff-comparison
- bufB 'B "-Region.B-")
+ bufB "-Region.B-")
(ediff-clone-buffer-for-region-comparison bufB "-Region.B-")))
(ediff-with-current-buffer bufB
(setq begB (region-beginning)
(defun cvs-cleanup-collection (c rm-handled rm-dirs rm-msgs)
"Remove undesired entries.
C is the collection
-RM-HANDLED if non-nil means remove handled entries.
+RM-HANDLED if non-nil means remove handled entries (if file is currently
+ visited, only remove if value is `all').
RM-DIRS behaves like `cvs-auto-remove-directories'.
RM-MSGS if non-nil means remove messages."
(let (last-fi first-dir (rerun t))
(subtype (cvs-fileinfo->subtype fi))
(keep
(pcase type
- ;; remove temp messages and keep the others
+ ;; Remove temp messages and keep the others.
(`MESSAGE (not (or rm-msgs (eq subtype 'TEMP))))
- ;; remove entries
+ ;; Remove dead entries.
(`DEAD nil)
- ;; handled also?
+ ;; Handled also?
(`UP-TO-DATE
- (if (find-buffer-visiting (cvs-fileinfo->full-name fi))
- t
- (not rm-handled)))
- ;; keep the rest
+ (not
+ (if (find-buffer-visiting (cvs-fileinfo->full-name fi))
+ (eq rm-handled 'all)
+ rm-handled)))
+ ;; Keep the rest.
(_ (not (run-hook-with-args-until-success
'cvs-cleanup-functions fi))))))
Empty directories are removed."
(interactive)
(cvs-cleanup-collection cvs-cookies
- t (or cvs-auto-remove-directories 'handled) t))
+ 'all (or cvs-auto-remove-directories 'handled) t))
(defun-cvs-mode cvs-mode-acknowledge ()
(defvar use-vc-backend) ;; dynamically bound
+;; Autoload cookie needed by desktop.el.
+;;;###autoload
(define-derived-mode vc-dir-mode special-mode "VC dir"
"Major mode for VC directory buffers.
Marking/Unmarking key bindings and actions:
\\{vc-dir-mode-map}"
(set (make-local-variable 'vc-dir-backend) use-vc-backend)
+ (set (make-local-variable 'desktop-save-buffer)
+ 'vc-dir-desktop-buffer-misc-data)
(setq buffer-read-only t)
(when (boundp 'tool-bar-map)
(set (make-local-variable 'tool-bar-map) vc-dir-tool-bar-map))
"Default absence of extra information returned for a file."
nil)
+\f
+;;; Support for desktop.el (adapted from what dired.el does).
+
+(declare-function desktop-file-name "desktop" (filename dirname))
+
+(defun vc-dir-desktop-buffer-misc-data (dirname)
+ "Auxiliary information to be saved in desktop file."
+ (cons (desktop-file-name default-directory dirname) vc-dir-backend))
+
+(defun vc-dir-restore-desktop-buffer (_filename _buffername misc-data)
+ "Restore a `vc-dir' buffer specified in a desktop file."
+ (let ((dir (car misc-data))
+ (backend (cdr misc-data)))
+ (if (file-directory-p dir)
+ (progn
+ (vc-dir dir backend)
+ (current-buffer))
+ (message "Desktop: Directory %s no longer exists." dir)
+ (when desktop-missing-file-warning (sit-for 1))
+ nil)))
+
+(add-to-list 'desktop-buffer-mode-handlers
+ '(vc-dir-mode . vc-dir-restore-desktop-buffer))
+
+\f
(provide 'vc-dir)
;;; vc-dir.el ends here
The difference to vc-do-command is that this function always invokes
`vc-git-program'."
(apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
- file-or-list flags))
+ file-or-list (cons "--no-pager" flags)))
(defun vc-git--empty-db-p ()
"Check if the git db is empty (no commit done yet)."
;; - clear-headers () ??
;; - delete-file (file) TEST IT
;; - rename-file (old new) OK
-;; - find-file-hook () PROBABLY NOT NEEDED
+;; - find-file-hook () added for bug#10709
;; 2) Implement Stefan Monnier's advice:
;; vc-hg-registered and vc-hg-state
(let ((newrev (1+ (string-to-number rev)))
(tip-revision
(with-temp-buffer
- (vc-hg-command t 0 nil "tip")
+ (vc-hg-command t 0 nil "tip" "--style=default")
(goto-char (point-min))
(re-search-forward "^changeset:[ \t]*\\([0-9]+\\):")
(string-to-number (match-string-no-properties 1)))))
(vc-hg-command t 0 file "cat" "-r" rev)
(vc-hg-command t 0 file "cat")))))
+(defun vc-hg-resolve-when-done ()
+ "Call \"hg resolve -m\" if the conflict markers have been removed."
+ (save-excursion
+ (goto-char (point-min))
+ (unless (re-search-forward "^<<<<<<< " nil t)
+ (vc-hg-command nil 0 buffer-file-name "resolve" "-m")
+ ;; Remove the hook so that it is not called multiple times.
+ (remove-hook 'after-save-hook 'vc-hg-resolve-when-done t))))
+
+(defun vc-hg-find-file-hook ()
+ (when (and buffer-file-name
+ (file-exists-p (concat buffer-file-name ".orig"))
+ ;; Hg does not seem to have a "conflict" status, eg
+ ;; hg http://bz.selenic.com/show_bug.cgi?id=2724
+ (memq (vc-file-getprop buffer-file-name 'vc-state)
+ '(edited conflict))
+ ;; Maybe go on to check that "hg resolve -l" says "U"?
+ ;; If "hg resolve -l" says there's a conflict but there are no
+ ;; conflict markers, it's not clear what we should do.
+ (save-excursion
+ (goto-char (point-min))
+ (re-search-forward "^<<<<<<< " nil t)))
+ ;; Hg may not recognize "conflict" as a state, but we can do better.
+ (vc-file-setprop buffer-file-name 'vc-state 'conflict)
+ (smerge-start-session)
+ (add-hook 'after-save-hook 'vc-hg-resolve-when-done nil t)
+ (message "There are unresolved conflicts in this file")))
+
+
;; Modeled after the similar function in vc-bzr.el
(defun vc-hg-workfile-unchanged-p (file)
(eq 'up-to-date (vc-hg-state file)))
;; the state to 'edited and redisplay the mode line.
(let* ((file buffer-file-name)
(backend (vc-backend file)))
- (and backend
- (or (and (equal (vc-file-getprop file 'vc-checkout-time)
- (nth 5 (file-attributes file)))
- ;; File has been saved in the same second in which
- ;; it was checked out. Clear the checkout-time
- ;; to avoid confusion.
- (vc-file-setprop file 'vc-checkout-time nil))
- t)
- (eq (vc-checkout-model backend (list file)) 'implicit)
- (vc-state-refresh file backend)
- (vc-mode-line file backend))
- ;; Try to avoid unnecessary work, a *vc-dir* buffer is
- ;; present if this is true.
+ (cond
+ ((null backend))
+ ((eq (vc-checkout-model backend (list file)) 'implicit)
+ ;; If the file was saved in the same second in which it was
+ ;; checked out, clear the checkout-time to avoid confusion.
+ (if (equal (vc-file-getprop file 'vc-checkout-time)
+ (nth 5 (file-attributes file)))
+ (vc-file-setprop file 'vc-checkout-time nil))
+ (if (vc-state-refresh file backend)
+ (vc-mode-line file backend)))
+ ;; If we saved an unlocked file on a locking based VCS, that
+ ;; file is not longer up-to-date.
+ ((eq (vc-file-getprop file 'vc-state) 'up-to-date)
+ (vc-file-setprop file 'vc-state nil)))
+ ;; Resynch *vc-dir* buffers, if any are present.
(when vc-dir-buffers
(vc-dir-resynch-file file))))
(set (make-local-variable 'backup-inhibited) t))
;; Let the backend setup any buffer-local things he needs.
(vc-call-backend backend 'find-file-hook))
- ((let ((link-type (and (not (equal buffer-file-name buffer-file-truename))
- (vc-backend buffer-file-truename))))
+ ((let* ((truename (expand-file-name buffer-file-truename))
+ (link-type (and (not (equal buffer-file-name truename))
+ (vc-backend truename))))
(cond ((not link-type) nil) ;Nothing to do.
((eq vc-follow-symlinks nil)
(message
(vc-svn-command t 0 file "status" (if localp "-v" "-u"))
(vc-svn-parse-status file))))
+;; NB this does not handle svn properties, which can be changed
+;; without changing the file timestamp.
+;; Note that unlike vc-cvs-state-heuristic, this is not called from
+;; vc-svn-state. AFAICS, it is only called from vc-state-refresh via
+;; vc-after-save (bug#7850). Therefore the fact that it ignores
+;; properties is irrelevant. If you want to make vc-svn-state call
+;; this, it should be extended to handle svn properties.
(defun vc-svn-state-heuristic (file)
"SVN-specific state heuristic."
- (vc-svn-state file 'local))
+ ;; If the file has not changed since checkout, consider it `up-to-date'.
+ ;; Otherwise consider it `edited'. Copied from vc-cvs-state-heuristic.
+ (let ((checkout-time (vc-file-getprop file 'vc-checkout-time))
+ (lastmod (nth 5 (file-attributes file))))
+ (cond
+ ((equal checkout-time lastmod) 'up-to-date)
+ ((string= (vc-working-revision file) "0") 'added)
+ ((null checkout-time) 'unregistered)
+ (t 'edited))))
;; FIXME it would be better not to have the "remote" argument,
;; but to distinguish the two output formats based on content.
(eval-when-compile
(require 'dired))
+(declare-function dired-get-filename "dired" (&optional localp noerror))
+(declare-function dired-move-to-filename "dired" (&optional err eol))
+(declare-function dired-marker-regexp "dired" ())
+
(unless (assoc 'vc-parent-buffer minor-mode-alist)
(setq minor-mode-alist
(cons '(vc-parent-buffer vc-parent-buffer-name)
;; among all the `files'.
(model (nth 4 vc-fileset)))
+ ;; If a buffer has unsaved changes, a checkout would discard those
+ ;; changes, so treat the buffer as having unlocked changes.
+ (when (and (not (eq model 'implicit)) (eq state 'up-to-date))
+ (let ((files files))
+ (while files
+ (let ((buffer (get-file-buffer (car files))))
+ (and buffer
+ (buffer-modified-p buffer)
+ (setq state 'unlocked-changes
+ files nil))))))
+
;; Do the right thing
(cond
((eq state 'missing)
;; many VCS allow that as well.
(dolist (fname files)
(let ((bname (get-file-buffer fname)))
- (unless fname (setq fname buffer-file-name))
- (when (vc-backend fname)
- (if (vc-registered fname)
- (error "This file is already registered")
- (unless (y-or-n-p "Previous master file has vanished. Make a new one? ")
- (error "Aborted"))))
+ (unless fname
+ (setq fname buffer-file-name))
+ (when (vc-call-backend backend 'registered fname)
+ (error "This file is already registered"))
;; Watch out for new buffers of size 0: the corresponding file
;; does not exist yet, even though buffer-modified-p is nil.
(when bname
;;;###autoload
(defun vc-delete-file (file)
- "Delete file and mark it as such in the version control system."
- (interactive "fVC delete file: ")
+ "Delete file and mark it as such in the version control system.
+If called interactively, read FILE, defaulting to the current
+buffer's file name if it's under version control."
+ (interactive (list (read-file-name "VC delete file: " nil
+ (when (vc-backend buffer-file-name)
+ buffer-file-name) t)))
(setq file (expand-file-name file))
(let ((buf (get-file-buffer file))
(backend (vc-backend file)))
;;;###autoload
(defun vc-rename-file (old new)
- "Rename file OLD to NEW in both work area and repository."
- (interactive "fVC rename file: \nFRename to: ")
+ "Rename file OLD to NEW in both work area and repository.
+If called interactively, read OLD and NEW, defaulting OLD to the
+current buffer's file name if it's under version control."
+ (interactive (list (read-file-name "VC rename file: " nil
+ (when (vc-backend buffer-file-name)
+ buffer-file-name) t)
+ (read-file-name "Rename to: ")))
;; in CL I would have said (setq new (merge-pathnames new old))
(let ((old-base (file-name-nondirectory old)))
(when (and (not (string= "" old-base))
(vcursor-disable -1))))
)
+(declare-function compare-windows-skip-whitespace "compare-w" (start))
+
;; vcursor-compare-windows is copied from compare-w.el with only
;; minor modifications; these are too bound up with the function
;; to make it really useful to call compare-windows itself.
Entry to view-mode runs the normal hook `view-mode-hook'."
:lighter " View" :keymap view-mode-map
- (if view-mode (view-mode-enable) (view-mode-disable)))
+ (if view-mode (view--enable) (view--disable)))
\f
-(defun view-mode-enable ()
- "Turn on View mode."
+(defun view--enable ()
;; Always leave view mode before changing major mode.
;; This is to guarantee that the buffer-read-only variable is restored.
- (add-hook 'change-major-mode-hook 'view-mode-disable nil t)
- (setq view-mode t
- view-page-size nil
+ (add-hook 'change-major-mode-hook 'view--disable nil t)
+ (setq view-page-size nil
view-half-page-size nil
view-old-buffer-read-only buffer-read-only
buffer-read-only t)
(format "continue viewing %s"
(if (buffer-file-name)
(file-name-nondirectory (buffer-file-name))
- (buffer-name)))))
- (force-mode-line-update)
- (run-hooks 'view-mode-hook))
+ (buffer-name))))))
+
+(define-obsolete-function-alias 'view-mode-enable 'view-mode "24.4")
(defun view-mode-disable ()
"Turn off View mode."
- (remove-hook 'change-major-mode-hook 'view-mode-disable t)
+ (declare (obsolete view-mode "24.4"))
+ (view-mode -1))
+
+(defun view--disable ()
+ (remove-hook 'change-major-mode-hook 'view--disable t)
(and view-overlay (delete-overlay view-overlay))
- (force-mode-line-update)
;; Calling toggle-read-only while View mode is enabled
;; sets view-read-only to t as a buffer-local variable
;; after exiting View mode. That arranges that the next toggle-read-only
;; so that View mode stays off if toggle-read-only is called.
(if (local-variable-p 'view-read-only)
(kill-local-variable 'view-read-only))
- (setq view-mode nil)
(if (boundp 'Helper-return-blurb)
(setq Helper-return-blurb view-old-Helper-return-blurb))
(if buffer-read-only
(setq view-exit-action exit-action))
(unless view-mode
- (view-mode-enable)
- (force-mode-line-update)
+ (view-mode 1)
(unless view-inhibit-help-message
(message "%s"
(substitute-command-keys "\
(when view-mode
(let ((buffer (window-buffer)))
(unless view-no-disable-on-exit
- (view-mode-disable))
+ (view-mode -1))
(unless exit-only
(cond
(quit-window)))
(when exit-action
- (funcall exit-action buffer))
- (force-mode-line-update)))))
+ (funcall exit-action buffer))))))
\f
(defun View-exit ()
"Exit View mode but stay in current buffer."
"Extract the default external value of WIDGET."
(widget-apply widget :value-to-external
(or (widget-get widget :value)
- (widget-apply widget :default-get))))
+ (progn
+ (when (widget-get widget :args)
+ (let (args)
+ (dolist (arg (widget-get widget :args))
+ (setq args (append args
+ (if (widget-get arg :inline)
+ (widget-get arg :args)
+ (list arg)))))
+ (widget-put widget :args args)))
+ (widget-apply widget :default-get)))))
(defun widget-match-inline (widget vals)
"In WIDGET, match the start of VALS."
delta))
(t 0)))
-(defun window--resizable-p (window delta &optional horizontal ignore trail noup nodown)
+(defun window-resizable-p (window delta &optional horizontal ignore trail noup nodown)
"Return t if WINDOW can be resized vertically by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
For the meaning of the arguments of this function see the
;; nil or the minibuffer window is active, resize the minibuffer
;; window.
(window--resize-mini-window minibuffer-window (- delta)))
- ((window--resizable-p window delta horizontal ignore)
+ ((window-resizable-p window delta horizontal ignore)
(window--resize-reset frame horizontal)
(window--resize-this-window window delta horizontal ignore t)
(if (and (not window-combination-resize)
(t
(error "Cannot resize window %s" window)))))
+(defun window-resize-no-error (window delta &optional horizontal ignore)
+ "Resize WINDOW vertically if it is resizable by DELTA lines.
+This function is like `window-resize' but does not signal an
+error when WINDOW cannot be resized. For the meaning of the
+optional arguments see the documentation of `window-resize'."
+ (when (window-resizable-p window delta horizontal ignore)
+ (window-resize window delta horizontal ignore)))
+
(defun window--resize-child-windows-skip-p (window)
"Return non-nil if WINDOW shall be skipped by resizing routines."
(memq (window-new-normal window) '(ignore stuck skip)))
;; If the selected window is full height and `resize-mini-windows'
;; is nil, resize the minibuffer window.
(window--resize-mini-window minibuffer-window (- delta)))
- ((window--resizable-p nil delta horizontal)
+ ((window-resizable-p nil delta horizontal)
(window-resize nil delta horizontal))
(t
(window-resize
;; If the selected window is full height and `resize-mini-windows'
;; is nil, resize the minibuffer window.
(window--resize-mini-window minibuffer-window delta))
- ((window--resizable-p nil (- delta) horizontal)
+ ((window-resizable-p nil (- delta) horizontal)
(window-resize nil (- delta) horizontal))
(t
(window-resize
(set-window-new-normal
sibling (+ (window-normal-size sibling horizontal)
(window-normal-size window horizontal))))
- ((window--resizable-p window (- size) horizontal nil nil nil t)
+ ((window-resizable-p window (- size) horizontal nil nil nil t)
;; Can do without resizing fixed-size windows.
(window--resize-siblings window (- size) horizontal))
(t
(let ((delta (- (cdr (assq 'total-height item))
(window-total-height window)))
window-size-fixed)
- (when (window--resizable-p window delta)
+ (when (window-resizable-p window delta)
(window-resize window delta)))
;; Else check whether the window is not high enough.
(let* ((min-size (window-min-size window nil ignore))
(delta (- min-size (window-total-size window))))
(when (and (> delta 0)
- (window--resizable-p window delta nil ignore))
+ (window-resizable-p window delta nil ignore))
(window-resize window delta nil ignore))))
;; Adjust horizontally.
(if (memq window-size-fixed '(t width))
(let ((delta (- (cdr (assq 'total-width item))
(window-total-width window)))
window-size-fixed)
- (when (window--resizable-p window delta)
+ (when (window-resizable-p window delta)
(window-resize window delta)))
;; Else check whether the window is not wide enough.
(let* ((min-size (window-min-size window t ignore))
(delta (- min-size (window-total-size window t))))
(when (and (> delta 0)
- (window--resizable-p window delta t ignore))
+ (window-resizable-p window delta t ignore))
(window-resize window delta t ignore))))
;; Set dedicated status.
(set-window-dedicated-p window (cdr (assq 'dedicated state)))
(* (window-total-size (frame-root-window window))
height))))
(delta (- new-height (window-total-size window))))
- (when (and (window--resizable-p window delta nil 'safe)
+ (when (and (window-resizable-p window delta nil 'safe)
(window-combined-p window))
(window-resize window delta nil 'safe))))
((functionp height)
(* (window-total-size (frame-root-window window) t)
width))))
(delta (- new-width (window-total-size window t))))
- (when (and (window--resizable-p window delta t 'safe)
+ (when (and (window-resizable-p window delta t 'safe)
(window-combined-p window t))
(window-resize window delta t 'safe))))
((functionp width)
(defun woman-default-faces ()
"Set foreground colors of italic and bold faces to their default values."
+ (declare (obsolete choose-completion-guess-base-position "23.2"))
(interactive)
(face-spec-set 'woman-italic (face-user-default-spec 'woman-italic))
(face-spec-set 'woman-bold (face-user-default-spec 'woman-bold)))
(defun woman-monochrome-faces ()
"Set foreground colors of italic and bold faces to that of the default face.
This is usually either black or white."
+ (declare (obsolete choose-completion-guess-base-position "23.2"))
(interactive)
(set-face-foreground 'woman-italic 'unspecified)
(set-face-foreground 'woman-bold 'unspecified))
((null (cdr files)) (car (car files))) ; only 1 file for topic.
(t
;; Multiple files for topic, so must select 1.
- ;; Unread the command event (TAB = ?\t = 9) that runs the command
- ;; `minibuffer-complete' in order to automatically complete the
- ;; minibuffer contents as far as possible.
- (setq unread-command-events '(9)) ; and delete any type-ahead!
- (completing-read "Manual file: " files nil 1
- (try-completion "" files) 'woman-file-history))))))
+ ;; Run the command `minibuffer-complete' in order to automatically
+ ;; complete the minibuffer contents as far as possible.
+ (minibuffer-with-setup-hook
+ (lambda () (let ((this-command this-command)) (minibuffer-complete)))
+ (completing-read "Manual file: " files nil 1
+ (try-completion "" files) 'woman-file-history)))))))
(defun woman-select (predicate list)
"Select unique elements for which PREDICATE is true in LIST.
(woman-dired-define-keys)
(add-hook 'dired-mode-hook 'woman-dired-define-keys))
+(declare-function dired-get-filename "dired"
+ (&optional localp no-error-if-not-filep))
+
;;;###autoload
(defun woman-dired-find-file ()
"In dired, run the WoMan man-page browser on this file."
(interactive)
- ;; dired-get-filename is defined in dired.el
(woman-find-file (dired-get-filename)))
["Use Full Frame Width" woman-toggle-fill-frame
:active t :style toggle :selected woman-fill-frame]
["Reformat Last Man Page" woman-reformat-last-file t]
- ["Use Monochrome Main Faces" woman-monochrome-faces t]
- ["Use Default Main Faces" woman-default-faces t]
["Make Contents Menu" (woman-imenu t) (not woman-imenu-done)]
"--"
["Describe (Wo)Man Mode" describe-mode t]
(message "Woman fill column set to %s."
(if woman-fill-frame "frame width" woman-fill-column)))
+(declare-function apropos-print "apropos"
+ (do-keys spacing &optional text nosubst))
+
(defun woman-mini-help ()
"Display WoMan commands and user options in an `apropos' buffer."
;; Based on apropos-command in apropos.el
-# c-strtod.m4 serial 14
+# c-strtod.m4 serial 15
-# Copyright (C) 2004-2006, 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2006, 2009-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS([strtod_l])
-
- AC_REQUIRE([AC_C_INLINE])
- :
])
dnl Prerequisites of lib/c-strtold.c.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_C99_STRTOLD])
AC_CHECK_FUNCS([strtold_l])
-
- AC_REQUIRE([AC_C_INLINE])
- :
])
--- /dev/null
+#serial 4
+dnl Copyright (C) 2006-2007, 2009-2013 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 Prerequisites of lib/close-stream.c.
+AC_DEFUN([gl_CLOSE_STREAM],
+[
+ :
+])
-#serial 18
-dnl Copyright (C) 2002, 2005, 2007, 2009-2012 Free Software Foundation, Inc.
+#serial 19
+dnl Copyright (C) 2002, 2005, 2007, 2009-2013 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.
/* Many gnulib modules require POSIX conformance of EBADF. */
if (dup2 (2, 1000000) == -1 && errno != EBADF)
result |= 16;
+ /* Flush out a cygwin core dump. */
+ if (dup2 (2, -1) != -1 || errno != EBADF)
+ result |= 32;
return result;
])
],
--- /dev/null
+# euidaccess.m4 serial 15
+dnl Copyright (C) 2002-2013 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.
+
+AC_DEFUN([gl_FUNC_NONREENTRANT_EUIDACCESS],
+[
+ AC_REQUIRE([gl_FUNC_EUIDACCESS])
+ AC_CHECK_DECLS([setregid])
+ AC_DEFINE([PREFER_NONREENTRANT_EUIDACCESS], [1],
+ [Define this if you prefer euidaccess to return the correct result
+ even if this would make it nonreentrant. Define this only if your
+ entire application is safe even if the uid or gid might temporarily
+ change. If your application uses signal handlers or threads it
+ is probably not safe.])
+])
+
+AC_DEFUN([gl_FUNC_EUIDACCESS],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ dnl Persuade glibc <unistd.h> to declare euidaccess().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_FUNCS([euidaccess])
+ if test $ac_cv_func_euidaccess = no; then
+ HAVE_EUIDACCESS=0
+ fi
+])
+
+# Prerequisites of lib/euidaccess.c.
+AC_DEFUN([gl_PREREQ_EUIDACCESS], [
+ dnl Prefer POSIX faccessat over non-standard euidaccess.
+ AC_CHECK_FUNCS_ONCE([faccessat])
+ dnl Try various other non-standard fallbacks.
+ AC_CHECK_HEADERS([libgen.h])
+ AC_FUNC_GETGROUPS
+
+ # Solaris 9 and 10 need -lgen to get the eaccess function.
+ # Save and restore LIBS so -lgen isn't added to it. Otherwise, *all*
+ # programs in the package would end up linked with that potentially-shared
+ # library, inducing unnecessary run-time overhead.
+ LIB_EACCESS=
+ AC_SUBST([LIB_EACCESS])
+ gl_saved_libs=$LIBS
+ AC_SEARCH_LIBS([eaccess], [gen],
+ [test "$ac_cv_search_eaccess" = "none required" ||
+ LIB_EACCESS=$ac_cv_search_eaccess])
+ AC_CHECK_FUNCS([eaccess])
+ LIBS=$gl_saved_libs
+])
dnl 'extern inline' a la ISO C99.
-dnl Copyright 2012 Free Software Foundation, Inc.
+dnl Copyright 2012-2013 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.
AC_DEFUN([gl_EXTERN_INLINE],
[
- AC_REQUIRE([AC_C_INLINE])
AH_VERBATIM([extern_inline],
[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
_GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
when FOO is an inline function in the header; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
_GL_INLINE_HEADER_END contains useful stuff to put
- in the same include file, after uses of _GL_INLINE. */
-#if (__GNUC__ \
- ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
- : 199901L <= __STDC_VERSION__)
+ in the same include file, after uses of _GL_INLINE.
+
+ Suppress the use of extern inline on Apple's platforms,
+ as Libc-825.25 (2012-09-19) is incompatible with it; see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+ Perhaps Apple will fix this some day. */
+#if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : 199901L <= __STDC_VERSION__) \
+ && !defined __APPLE__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
-#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
# if __GNUC_GNU_INLINE__
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
# endif
# define _GL_EXTERN_INLINE extern
#else
-# define _GL_INLINE static inline
-# define _GL_EXTERN_INLINE static inline
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
#endif
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
--- /dev/null
+# serial 6
+# See if we need to provide faccessat replacement.
+
+dnl Copyright (C) 2009-2013 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.
+
+# Written by Eric Blake.
+
+AC_DEFUN([gl_FUNC_FACCESSAT],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ dnl Persuade glibc <unistd.h> to declare faccessat().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_FUNCS_ONCE([faccessat])
+ if test $ac_cv_func_faccessat = no; then
+ HAVE_FACCESSAT=0
+ fi
+])
+
+# Prerequisites of lib/faccessat.m4.
+AC_DEFUN([gl_PREREQ_FACCESSAT],
+[
+ AC_CHECK_FUNCS([access])
+])
--- /dev/null
+# serial 15
+# Configure fcntl.h.
+dnl Copyright (C) 2006-2007, 2009-2013 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 Written by Paul Eggert.
+
+AC_DEFUN([gl_FCNTL_H],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])
+ gl_NEXT_HEADERS([fcntl.h])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
+ ]], [fcntl openat])
+])
+
+AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_FCNTL_H_DEFAULTS],
+[
+ GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
+ GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING])
+ GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
+ GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
+ HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
+ REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
+ REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
+ REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+])
--- /dev/null
+# serial 19
+
+# Copyright (C) 2000-2001, 2004-2013 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering
+dnl Using code from emacs, based on suggestions from Paul Eggert
+dnl and Ulrich Drepper.
+
+dnl Find out how to determine the number of pending output bytes on a stream.
+dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
+dnl we have to grub around in the FILE struct.
+
+AC_DEFUN([gl_FUNC_FPENDING],
+[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
+ AC_CHECK_FUNCS_ONCE([__fpending])
+ fp_headers='
+# include <stdio.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
+'
+ AC_CHECK_DECLS([__fpending], , , $fp_headers)
+])
+
+AC_DEFUN([gl_PREREQ_FPENDING],
+[
+ AC_CACHE_CHECK(
+ [how to determine the number of pending output bytes on a stream],
+ ac_cv_sys_pending_output_n_bytes,
+ [
+ for ac_expr in \
+ \
+ '# glibc2' \
+ 'fp->_IO_write_ptr - fp->_IO_write_base' \
+ \
+ '# traditional Unix' \
+ 'fp->_ptr - fp->_base' \
+ \
+ '# BSD' \
+ 'fp->_p - fp->_bf._base' \
+ \
+ '# SCO, Unixware' \
+ '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \
+ \
+ '# QNX' \
+ '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \
+ \
+ '# old glibc?' \
+ 'fp->__bufp - fp->__buffer' \
+ \
+ '# old glibc iostream?' \
+ 'fp->_pptr - fp->_pbase' \
+ \
+ '# emx+gcc' \
+ 'fp->_ptr - fp->_buffer' \
+ \
+ '# Minix' \
+ 'fp->_ptr - fp->_buf' \
+ \
+ '# Plan9' \
+ 'fp->wp - fp->buf' \
+ \
+ '# VMS' \
+ '(*fp)->_ptr - (*fp)->_base' \
+ \
+ '# e.g., DGUX R4.11; the info is not available' \
+ 1 \
+ ; do
+
+ # Skip each embedded comment.
+ case "$ac_expr" in '#'*) continue;; esac
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+ [[FILE *fp = stdin; (void) ($ac_expr);]])],
+ [fp_done=yes]
+ )
+ test "$fp_done" = yes && break
+ done
+
+ ac_cv_sys_pending_output_n_bytes=$ac_expr
+ ]
+ )
+ AC_DEFINE_UNQUOTED([PENDING_OUTPUT_N_BYTES],
+ $ac_cv_sys_pending_output_n_bytes,
+ [the number of pending output bytes on stream 'fp'])
+])
--- /dev/null
+# serial 18
+
+dnl From Jim Meyering.
+dnl A wrapper around AC_FUNC_GETGROUPS.
+
+# Copyright (C) 1996-1997, 1999-2004, 2008-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+m4_version_prereq([2.70], [] ,[
+
+# This is taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+AC_DEFUN([AC_FUNC_GETGROUPS],
+[
+ AC_REQUIRE([AC_TYPE_GETGROUPS])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+ AC_CHECK_FUNC([getgroups])
+
+ # If we don't yet have getgroups, see if it's in -lbsd.
+ # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
+ ac_save_LIBS=$LIBS
+ if test $ac_cv_func_getgroups = no; then
+ AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd])
+ fi
+
+ # Run the program to test the functionality of the system-supplied
+ # getgroups function only if there is such a function.
+ if test $ac_cv_func_getgroups = yes; then
+ AC_CACHE_CHECK([for working getgroups], [ac_cv_func_getgroups_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT],
+ [[/* On Ultrix 4.3, getgroups (0, 0) always fails. */
+ return getgroups (0, 0) == -1;]])
+ ],
+ [ac_cv_func_getgroups_works=yes],
+ [ac_cv_func_getgroups_works=no],
+ [case "$host_os" in # ((
+ # Guess yes on glibc systems.
+ *-gnu*) ac_cv_func_getgroups_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) ac_cv_func_getgroups_works="guessing no" ;;
+ esac
+ ])
+ ])
+ else
+ ac_cv_func_getgroups_works=no
+ fi
+ case "$ac_cv_func_getgroups_works" in
+ *yes)
+ AC_DEFINE([HAVE_GETGROUPS], [1],
+ [Define to 1 if your system has a working `getgroups' function.])
+ ;;
+ esac
+ LIBS=$ac_save_LIBS
+])# AC_FUNC_GETGROUPS
+
+])
+
+AC_DEFUN([gl_FUNC_GETGROUPS],
+[
+ AC_REQUIRE([AC_TYPE_GETGROUPS])
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_FUNC_GETGROUPS
+ if test $ac_cv_func_getgroups != yes; then
+ HAVE_GETGROUPS=0
+ else
+ if test "$ac_cv_type_getgroups" != gid_t \
+ || { case "$ac_cv_func_getgroups_works" in
+ *yes) false;;
+ *) true;;
+ esac
+ }; then
+ REPLACE_GETGROUPS=1
+ AC_DEFINE([GETGROUPS_ZERO_BUG], [1], [Define this to 1 if
+ getgroups(0,NULL) does not return the number of groups.])
+ else
+ dnl Detect FreeBSD bug; POSIX requires getgroups(-1,ptr) to fail.
+ AC_CACHE_CHECK([whether getgroups handles negative values],
+ [gl_cv_func_getgroups_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+ [[int size = getgroups (0, 0);
+ gid_t *list = malloc (size * sizeof *list);
+ return getgroups (-1, list) != -1;]])],
+ [gl_cv_func_getgroups_works=yes],
+ [gl_cv_func_getgroups_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_getgroups_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_getgroups_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_getgroups_works" in
+ *yes) ;;
+ *) REPLACE_GETGROUPS=1 ;;
+ esac
+ fi
+ fi
+ test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
+])
# gnulib-common.m4 serial 33
-dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2013 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.
# for interoperability with automake-1.9.6 from autoconf-2.62.
# Remove this macro when we can assume autoconf >= 2.62 or
# autoconf >= 2.60 && automake >= 1.10.
+# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
+m4_ifndef([AC_AUTOCONF_VERSION],[
m4_ifdef([AC_PROG_MKDIR_P], [
dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
m4_define([AC_PROG_MKDIR_P],
[AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
MKDIR_P='$(mkdir_p)'
AC_SUBST([MKDIR_P])])])
+])
# AC_C_RESTRICT
# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
# works.
# This definition can be removed once autoconf >= 2.62 can be assumed.
-m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[
+# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
+m4_ifndef([AC_AUTOCONF_VERSION],[
AC_DEFUN([AC_C_RESTRICT],
[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
[ac_cv_c_restrict=no
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Code from module c-strcase:
# Code from module careadlinkat:
# Code from module clock-time:
+ # Code from module close-stream:
# Code from module crypto/md5:
# Code from module crypto/sha1:
# Code from module crypto/sha256:
# Code from module dtotimespec:
# Code from module dup2:
# Code from module environ:
+ # Code from module euidaccess:
# Code from module execinfo:
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# Code from module extern-inline:
+ # Code from module faccessat:
+ # Code from module fcntl-h:
# Code from module filemode:
+ # Code from module fpending:
+ # Code from module getgroups:
# Code from module getloadavg:
# Code from module getopt-gnu:
# Code from module getopt-posix:
# Code from module gettext-h:
# Code from module gettime:
# Code from module gettimeofday:
+ # Code from module group-member:
# Code from module ignore-value:
# Code from module include_next:
# Code from module intprops:
# Code from module pathmax:
# Code from module pselect:
# Code from module pthread_sigmask:
+ # Code from module putenv:
# Code from module readlink:
+ # Code from module root-uid:
+ # Code from module sig2str:
# Code from module signal-h:
# Code from module snippet/_Noreturn:
# Code from module snippet/arg-nonnull:
# Code from module timespec-sub:
# Code from module u64:
# Code from module unistd:
+ # Code from module unsetenv:
# Code from module utimens:
# Code from module verify:
# Code from module warnings:
+ # Code from module xalloc-oversized:
])
# This macro should be invoked from ./configure.ac, in the section
gl_FUNC_ALLOCA
AC_CHECK_FUNCS_ONCE([readlinkat])
gl_CLOCK_TIME
+ gl_CLOSE_STREAM
+ gl_MODULE_INDICATOR([close-stream])
gl_MD5
gl_SHA1
gl_SHA256
gl_UNISTD_MODULE_INDICATOR([environ])
gl_EXECINFO_H
AC_REQUIRE([gl_EXTERN_INLINE])
+ gl_FUNC_FACCESSAT
+ if test $HAVE_FACCESSAT = 0; then
+ AC_LIBOBJ([faccessat])
+ gl_PREREQ_FACCESSAT
+ fi
+ gl_MODULE_INDICATOR([faccessat])
+ gl_UNISTD_MODULE_INDICATOR([faccessat])
+ gl_FCNTL_H
gl_FILEMODE
+ gl_FUNC_FPENDING
+ if test $ac_cv_func___fpending = no; then
+ AC_LIBOBJ([fpending])
+ gl_PREREQ_FPENDING
+ fi
gl_GETLOADAVG
if test $HAVE_GETLOADAVG = 0; then
AC_LIBOBJ([getloadavg])
gl_PREREQ_PTHREAD_SIGMASK
fi
gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
+ gl_FUNC_PUTENV
+ if test $REPLACE_PUTENV = 1; then
+ AC_LIBOBJ([putenv])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([putenv])
gl_FUNC_READLINK
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
AC_LIBOBJ([readlink])
gl_PREREQ_READLINK
fi
gl_UNISTD_MODULE_INDICATOR([readlink])
+ gl_FUNC_SIG2STR
+ if test $ac_cv_func_sig2str = no; then
+ AC_LIBOBJ([sig2str])
+ gl_PREREQ_SIG2STR
+ fi
gl_SIGNAL_H
gl_TYPE_SOCKLEN_T
gt_TYPE_SSIZE_T
gl_TIMER_TIME
gl_TIMESPEC
gl_UNISTD_H
+ gl_FUNC_UNSETENV
+ if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
+ AC_LIBOBJ([unsetenv])
+ gl_PREREQ_UNSETENV
+ fi
+ gl_STDLIB_MODULE_INDICATOR([unsetenv])
gl_UTIMENS
gl_gnulib_enabled_dosname=false
+ gl_gnulib_enabled_euidaccess=false
+ gl_gnulib_enabled_getgroups=false
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
+ gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false
gl_gnulib_enabled_pathmax=false
+ gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
gl_gnulib_enabled_stat=false
gl_gnulib_enabled_strtoll=false
gl_gnulib_enabled_strtoull=false
gl_gnulib_enabled_verify=false
+ gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
func_gl_gnulib_m4code_dosname ()
{
if ! $gl_gnulib_enabled_dosname; then
gl_gnulib_enabled_dosname=true
fi
}
+ func_gl_gnulib_m4code_euidaccess ()
+ {
+ if ! $gl_gnulib_enabled_euidaccess; then
+ gl_FUNC_EUIDACCESS
+ if test $HAVE_EUIDACCESS = 0; then
+ AC_LIBOBJ([euidaccess])
+ gl_PREREQ_EUIDACCESS
+ fi
+ gl_UNISTD_MODULE_INDICATOR([euidaccess])
+ gl_gnulib_enabled_euidaccess=true
+ if test $HAVE_EUIDACCESS = 0; then
+ func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1
+ fi
+ func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c
+ if test $HAVE_EUIDACCESS = 0; then
+ func_gl_gnulib_m4code_stat
+ fi
+ fi
+ }
+ func_gl_gnulib_m4code_getgroups ()
+ {
+ if ! $gl_gnulib_enabled_getgroups; then
+ gl_FUNC_GETGROUPS
+ if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then
+ AC_LIBOBJ([getgroups])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([getgroups])
+ gl_gnulib_enabled_getgroups=true
+ fi
+ }
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 ()
{
if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
fi
}
+ func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1 ()
+ {
+ if ! $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then
+ gl_FUNC_GROUP_MEMBER
+ if test $HAVE_GROUP_MEMBER = 0; then
+ AC_LIBOBJ([group-member])
+ gl_PREREQ_GROUP_MEMBER
+ fi
+ gl_UNISTD_MODULE_INDICATOR([group-member])
+ gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=true
+ if test $HAVE_GROUP_MEMBER = 0; then
+ func_gl_gnulib_m4code_getgroups
+ fi
+ if test $HAVE_GROUP_MEMBER = 0; then
+ func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec
+ fi
+ fi
+ }
func_gl_gnulib_m4code_pathmax ()
{
if ! $gl_gnulib_enabled_pathmax; then
gl_gnulib_enabled_pathmax=true
fi
}
+ func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c ()
+ {
+ if ! $gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c; then
+ gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true
+ fi
+ }
func_gl_gnulib_m4code_stat ()
{
if ! $gl_gnulib_enabled_stat; then
gl_gnulib_enabled_verify=true
fi
}
+ func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec ()
+ {
+ if ! $gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec; then
+ gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=true
+ fi
+ }
+ if test $HAVE_FACCESSAT = 0; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $HAVE_FACCESSAT = 0; then
+ func_gl_gnulib_m4code_euidaccess
+ fi
if test $REPLACE_GETOPT = 1; then
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
fi
fi
m4_pattern_allow([^gl_GNULIB_ENABLED_])
AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups])
AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1])
AM_CONDITIONAL([gl_GNULIB_ENABLED_pathmax], [$gl_gnulib_enabled_pathmax])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat])
AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoull], [$gl_gnulib_enabled_strtoull])
AM_CONDITIONAL([gl_GNULIB_ENABLED_verify], [$gl_gnulib_enabled_verify])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec], [$gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec])
# End of code from modules
m4_ifval(gl_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
lib/alloca.in.h
lib/allocator.c
lib/allocator.h
+ lib/at-func.c
lib/c-ctype.c
lib/c-ctype.h
lib/c-strcase.h
lib/c-strncasecmp.c
lib/careadlinkat.c
lib/careadlinkat.h
+ lib/close-stream.c
+ lib/close-stream.h
lib/dosname.h
lib/dtoastr.c
lib/dtotimespec.c
lib/dup2.c
+ lib/euidaccess.c
lib/execinfo.c
lib/execinfo.in.h
+ lib/faccessat.c
+ lib/fcntl.in.h
lib/filemode.c
lib/filemode.h
+ lib/fpending.c
+ lib/fpending.h
lib/ftoastr.c
lib/ftoastr.h
+ lib/getgroups.c
lib/getloadavg.c
lib/getopt.c
lib/getopt.in.h
lib/gettext.h
lib/gettime.c
lib/gettimeofday.c
+ lib/group-member.c
lib/ignore-value.h
lib/intprops.h
lib/inttypes.in.h
lib/pathmax.h
lib/pselect.c
lib/pthread_sigmask.c
+ lib/putenv.c
lib/readlink.c
+ lib/root-uid.h
lib/sha1.c
lib/sha1.h
lib/sha256.c
lib/sha256.h
lib/sha512.c
lib/sha512.h
+ lib/sig2str.c
+ lib/sig2str.h
lib/signal.in.h
lib/stat-time.c
lib/stat-time.h
lib/timespec.h
lib/u64.c
lib/u64.h
+ lib/unistd.c
lib/unistd.in.h
+ lib/unsetenv.c
lib/utimens.c
lib/utimens.h
lib/verify.h
+ lib/xalloc-oversized.h
m4/00gnulib.m4
m4/alloca.m4
m4/c-strtod.m4
m4/clock_time.m4
+ m4/close-stream.m4
m4/dup2.m4
m4/environ.m4
+ m4/euidaccess.m4
m4/execinfo.m4
m4/extensions.m4
m4/extern-inline.m4
+ m4/faccessat.m4
+ m4/fcntl-o.m4
+ m4/fcntl_h.m4
m4/filemode.m4
+ m4/fpending.m4
+ m4/getgroups.m4
m4/getloadavg.m4
m4/getopt.m4
m4/gettime.m4
m4/gettimeofday.m4
m4/gnulib-common.m4
+ m4/group-member.m4
m4/include_next.m4
m4/inttypes.m4
m4/largefile.m4
m4/pathmax.m4
m4/pselect.m4
m4/pthread_sigmask.m4
+ m4/putenv.m4
m4/readlink.m4
+ m4/setenv.m4
m4/sha1.m4
m4/sha256.m4
m4/sha512.m4
+ m4/sig2str.m4
m4/signal_h.m4
m4/socklen.m4
m4/ssize_t.m4
--- /dev/null
+# serial 14
+
+# Copyright (C) 1999-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl Written by Jim Meyering
+
+AC_DEFUN([gl_FUNC_GROUP_MEMBER],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ dnl Persuade glibc <unistd.h> to declare group_member().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl Do this replacement check manually because I want the hyphen
+ dnl (not the underscore) in the filename.
+ AC_CHECK_FUNC([group_member], , [
+ HAVE_GROUP_MEMBER=0
+ ])
+])
+
+# Prerequisites of lib/group-member.c.
+AC_DEFUN([gl_PREREQ_GROUP_MEMBER],
+[
+ AC_REQUIRE([AC_FUNC_GETGROUPS])
+])
-# serial 25
+# serial 26
-# Copyright (C) 1997-2001, 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
])
# Prerequisites of lib/lstat.c.
-AC_DEFUN([gl_PREREQ_LSTAT],
-[
- AC_REQUIRE([AC_C_INLINE])
- :
-])
+AC_DEFUN([gl_PREREQ_LSTAT], [:])
AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
[
-# md5.m4 serial 12
-dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
+# md5.m4 serial 13
+dnl Copyright (C) 2002-2006, 2008-2013 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 Prerequisites of lib/md5.c.
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
:
])
--- /dev/null
+# putenv.m4 serial 19
+dnl Copyright (C) 2002-2013 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 Jim Meyering.
+dnl
+dnl Check whether putenv ("FOO") removes FOO from the environment.
+dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
+
+AC_DEFUN([gl_FUNC_PUTENV],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([for putenv compatible with GNU and SVID],
+ [gl_cv_func_svid_putenv],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[
+ /* Put it in env. */
+ if (putenv ("CONFTEST_putenv=val"))
+ return 1;
+
+ /* Try to remove it. */
+ if (putenv ("CONFTEST_putenv"))
+ return 2;
+
+ /* Make sure it was deleted. */
+ if (getenv ("CONFTEST_putenv") != 0)
+ return 3;
+
+ return 0;
+ ]])],
+ gl_cv_func_svid_putenv=yes,
+ gl_cv_func_svid_putenv=no,
+ dnl When crosscompiling, assume putenv is broken.
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_svid_putenv="guessing no" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_svid_putenv" in
+ *yes) ;;
+ *)
+ REPLACE_PUTENV=1
+ ;;
+ esac
+])
--- /dev/null
+# setenv.m4 serial 26
+dnl Copyright (C) 2001-2004, 2006-2013 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.
+
+AC_DEFUN([gl_FUNC_SETENV],
+[
+ AC_REQUIRE([gl_FUNC_SETENV_SEPARATE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ if test $ac_cv_func_setenv = no; then
+ HAVE_SETENV=0
+ else
+ AC_CACHE_CHECK([whether setenv validates arguments],
+ [gl_cv_func_setenv_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+ ]], [[
+ int result = 0;
+ {
+ if (setenv ("", "", 0) != -1)
+ result |= 1;
+ else if (errno != EINVAL)
+ result |= 2;
+ }
+ {
+ if (setenv ("a", "=", 1) != 0)
+ result |= 4;
+ else if (strcmp (getenv ("a"), "=") != 0)
+ result |= 8;
+ }
+ return result;
+ ]])],
+ [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_setenv_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_setenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_SETENV=1
+ ;;
+ esac
+ fi
+])
+
+# Like gl_FUNC_SETENV, except prepare for separate compilation
+# (no REPLACE_SETENV, no AC_LIBOBJ).
+AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([setenv])
+ if test $ac_cv_have_decl_setenv = no; then
+ HAVE_DECL_SETENV=0
+ fi
+ AC_CHECK_FUNCS_ONCE([setenv])
+ gl_PREREQ_SETENV
+])
+
+AC_DEFUN([gl_FUNC_UNSETENV],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_DECLS_ONCE([unsetenv])
+ if test $ac_cv_have_decl_unsetenv = no; then
+ HAVE_DECL_UNSETENV=0
+ fi
+ AC_CHECK_FUNCS([unsetenv])
+ if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
+ else
+ HAVE_UNSETENV=1
+ dnl Some BSDs return void, failing to do error checking.
+ AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#undef _BSD
+#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
+#include <stdlib.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int unsetenv (const char *name);
+ ]],
+ [[]])],
+ [gt_cv_func_unsetenv_ret='int'],
+ [gt_cv_func_unsetenv_ret='void'])])
+ if test $gt_cv_func_unsetenv_ret = 'void'; then
+ AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
+ instead of int.])
+ REPLACE_UNSETENV=1
+ fi
+
+ dnl Solaris 10 unsetenv does not remove all copies of a name.
+ dnl Haiku alpha 2 unsetenv gets confused by assignment to environ.
+ dnl OpenBSD 4.7 unsetenv("") does not fail.
+ AC_CACHE_CHECK([whether unsetenv obeys POSIX],
+ [gl_cv_func_unsetenv_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ extern char **environ;
+ ]], [[
+ char entry1[] = "a=1";
+ char entry2[] = "b=2";
+ char *env[] = { entry1, entry2, NULL };
+ if (putenv ((char *) "a=1")) return 1;
+ if (putenv (entry2)) return 2;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 3;
+ if (!unsetenv ("") || errno != EINVAL) return 4;
+ entry2[0] = 'b';
+ environ = env;
+ if (!getenv ("a")) return 5;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 6;
+ ]])],
+ [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_unsetenv_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_unsetenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_UNSETENV=1
+ ;;
+ esac
+ fi
+])
+
+# Prerequisites of lib/setenv.c.
+AC_DEFUN([gl_PREREQ_SETENV],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ AC_REQUIRE([gl_ENVIRON])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_HEADERS([search.h])
+ AC_CHECK_FUNCS([tsearch])
+])
+
+# Prerequisites of lib/unsetenv.c.
+AC_DEFUN([gl_PREREQ_UNSETENV],
+[
+ AC_REQUIRE([gl_ENVIRON])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+])
-# sha1.m4 serial 10
-dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
+# sha1.m4 serial 11
+dnl Copyright (C) 2002-2006, 2008-2013 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 Prerequisites of lib/sha1.c.
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
:
])
-# sha256.m4 serial 5
-dnl Copyright (C) 2005, 2008-2012 Free Software Foundation, Inc.
+# sha256.m4 serial 6
+dnl Copyright (C) 2005, 2008-2013 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 Prerequisites of lib/sha256.c.
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
])
-# sha512.m4 serial 6
-dnl Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
+# sha512.m4 serial 7
+dnl Copyright (C) 2005-2006, 2008-2013 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 Prerequisites of lib/sha512.c.
AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([AC_C_INLINE])
])
--- /dev/null
+# serial 7
+dnl Copyright (C) 2002, 2005-2006, 2009-2013 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.
+
+AC_DEFUN([gl_FUNC_SIG2STR],
+[
+ AC_CHECK_FUNCS([sig2str])
+])
+
+# Prerequisites of lib/sig2str.c.
+AC_DEFUN([gl_PREREQ_SIG2STR], [
+ :
+])
-# serial 10
+# serial 11
-# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
])
# Prerequisites of lib/stat.c.
-AC_DEFUN([gl_PREREQ_STAT],
-[
- AC_REQUIRE([AC_C_INLINE])
- :
-])
+AC_DEFUN([gl_PREREQ_STAT], [:])
-# stdio_h.m4 serial 42
-dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
+# stdio_h.m4 serial 43
+dnl Copyright (C) 2007-2013 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.
AC_DEFUN([gl_STDIO_H],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([AC_C_INLINE])
gl_NEXT_HEADERS([stdio.h])
dnl No need to create extra modules for these functions. Everyone who uses
-# sys_socket_h.m4 serial 22
-dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 23
+dnl Copyright (C) 2005-2013 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.
[
AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([AC_C_INLINE])
dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
dnl old-style declarations (with return type 'int' instead of 'ssize_t')
-# sys_stat_h.m4 serial 27 -*- Autoconf -*-
-dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 28 -*- Autoconf -*-
+dnl Copyright (C) 2006-2013 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.
[
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
- dnl For the mkdir substitute.
- AC_REQUIRE([AC_C_INLINE])
-
dnl Check for broken stat macros.
AC_REQUIRE([AC_HEADER_STAT])
-# unistd_h.m4 serial 65
-dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# unistd_h.m4 serial 66
+dnl Copyright (C) 2006-2013 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 Use AC_REQUIRE here, so that the default behavior below is expanded
dnl once only, before all statements that occur in other macros.
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([AC_C_INLINE])
gl_CHECK_NEXT_HEADERS([unistd.h])
if test $ac_cv_header_unistd_h = yes; then
* sed1v2.inp (TEMACS_LDFLAGS2): Remove editing.
(LIBS_GNUSTEP): Edit to empty.
-2012-12-01 Eli Zaretskii <eliz@gnu.org>
+2012-12-03 Eli Zaretskii <eliz@gnu.org>
* sed1v2.inp: Dump emacs.exe and copy to b-emacs.exe before
generating leim-list.el.
+2012-11-24 Ken Brown <kbrown@cornell.edu>
+
+ * sed2v2.inp (HAVE_MOUSE): Remove.
+
2012-11-03 Eli Zaretskii <eliz@gnu.org>
* sedlibmk.inp: Sync with changes in lib/Makefile.in.
/^#undef HAVE_SYNC *$/s/^.*$/#define HAVE_SYNC 1/
/^#undef HAVE___BUILTIN_UNWIND_INIT *$/s/^.*$/#define HAVE___BUILTIN_UNWIND_INIT 1/
/^#undef HAVE_MENUS *$/s/^.*$/#define HAVE_MENUS 1/
-/^#undef HAVE_MOUSE *$/s/^.*$/#define HAVE_MOUSE 1/
/^#undef DATA_START/s/^.*$/#define DATA_START (\&etext + 1)/
/^#undef GC_SETJMP_WORKS/s/^.*$/#define GC_SETJMP_WORKS 1/
/^#undef ORDINARY_LINK/s/^.*$/#define ORDINARY_LINK 1/
/^#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.2.91"/
+/^#undef VERSION/s/^.*$/#define VERSION "24.3.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/
-2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
+2012-12-24 Eli Zaretskii <eliz@gnu.org>
- Revert recent change for Bug#8855; see ../src/ChangeLog.
+ * inc/sys/stat.h (S_ISMPX): Define to zero, to accommodate changes
+ in lib/filemode.c that broke the MS-Windows build.
+ Suggested by Andy Moreton <andrewjmoreton@gmail.com>.
+
+2012-12-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (BSD4_2): Remove.
+
+2012-12-17 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/sys/acl.h: New file.
+
+ * inc/ms-w32.h (ENOTSUP): Define if undefined.
+
+ * config.nt (HAVE_POSIX_ACL): Define.
+
+2012-12-15 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/ms-w32.h (sys_unlink): Provide prototype.
+
+2012-12-14 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/sys/stat.h: Declare w32_stat_get_owner_group.
+
+2012-12-13 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (HAVE_INOTIFY, HAVE_SYS_INOTIFY_H): New macros.
+
+2012-12-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (HAVE_DECL_UNSETENV, HAVE_SIG2STR, VOID_UNSETENV): New macros.
+ (ULIMIT_BREAK_VALUE): Remove.
+
+2012-12-10 Daniel Colascione <dancol@dancol.org>
+
+ * emacs.rc: Use forward slashes in relative paths in order to
+ avoid complaints from Cygwin. (Forward slashes work perfectly
+ well in the NT build.)
+
+2012-12-09 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/unistd.h (unsetenv): Provide a prototype.
+
+2012-12-08 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/ms-w32.h (putenv): Redirect to sys_putenv.
+ (sys_putenv): Add prototype.
+
+ * config.nt (HAVE_UNSETENV): Define to 1.
+
+2012-12-01 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+
+2012-11-24 Ken Brown <kbrown@cornell.edu>
+
+ * config.nt (HAVE_MOUSE): Remove.
+
+2012-11-23 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (BROKEN_GETWD, HAVE_CLOSEDIR, HAVE_DIRENT_H, HAVE_FCNTL_H, HAVE_GETWD):
+ Remove.
2012-11-23 Eli Zaretskii <eliz@gnu.org>
- Fix a race condition with glib (Bug#8855).
- This is a backport from the trunk, consisting of:
+ * gmake.defs (SWITCHCHAR): Define to // under MSYS, / otherwise.
+ (Bug#12955)
+
+ * nmake.defs (SWITCHCHAR): Define to /.
+
+2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
+ * inc/dirent.h: Rename from ../src/ndir.h, with these changes:
+ (struct dirent): Rename from struct direct. All uses changed.
+ * inc/sys/dir.h: Remove.
+
+2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
+ * config.nt (HAVE_GETCWD): Remove.
+
+2012-11-21 Eli Zaretskii <eliz@gnu.org>
+
+ * nmake.defs: Use !if, not !ifdef. For the details, see
+ http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00027.html
+
+ * inc/stdint.h (INTPTR_MIN):
+ (PTRDIFF_MIN) [!__GNUC__]: Define for MSVC.
+
+2012-11-18 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/unistd.h: Don't include fcntl.h and don't define O_RDWR.
+
+2012-11-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (HAVE_FPATHCONF): Remove.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
+ * inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the
+ POSIX name for this flag is O_NONBLOCK. All uses changed.
+ * inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc.
+ these really should be moved to a replacement <fcntl.h> if and
+ when that gets implemented. In the meantime, include <fcntl.h>
+ to make sure we don't override its definitions.
+
+2012-11-17 Eli Zaretskii <eliz@gnu.org>
* inc/sys/wait.h: New file, with prototype of waitpid and
definitions of macros it needs.
+
* inc/ms-w32.h (wait): Don't define, 'wait' is not used anymore.
(sys_wait): Remove prototype.
+
* config.nt (HAVE_SYS_WAIT_H): Define to 1.
-2012-11-20 Eli Zaretskii <eliz@gnu.org>
+2012-11-17 Dani Moncayo <dmoncayo@gmail.com>
- * nmake.defs: Use !if, not !ifdef. See
- http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00027.html
- for the details.
+ * zipdist.bat (ZIP_CHECK): Remove unused label. When invoking 7z
+ to check if it's installed, redirect standard output and standard
+ error to the null device.
+ (ZIP_DIST): Don't build the "barebin" distribution.
+
+2012-11-15 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (GETGROUPS_T, GETGROUPS_ZERO_BUG, GNULIB_FACCESSAT, HAVE_ACCESS)
+ (HAVE_EACCESS, HAVE_FACCESSAT, HAVE_GETGROUPS, HAVE_LIBGEN_H):
+ New macros.
+
+2012-11-14 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/unistd.h (faccessat): Add prototype.
+ (AT_FDCWD, AT_EACCESS, AT_SYMLINK_NOFOLLOW): New macros; the first
+ 2 moved from ms-w32.h.
+
+ * inc/ms-w32.h (AT_FDCWD, AT_EACCESS, faccessat): Remove macros.
+
+2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
- * inc/stdint.h (INTPTR_MIN): Define for MSVC.
+ Use faccessat, not access, when checking file permissions (Bug#12632).
+ * inc/ms-w32.h (AT_FDCWD, AT_EACCESS): New symbols.
+ (access): Remove.
+ (faccessat): New macro.
+
+2012-11-05 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/unistd.h (tcgetpgrp, setsid): Provide prototypes.
+
+2012-11-05 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (DISPNEW_NEEDS_STDIO_EXT, GETPGRP_VOID, HAVE_SETPGID, HAVE_SETSID)
+ (PENDING_OUTPUT_COUNT, SETPGRP_RELEASES_CTTY): Remove.
+
+2012-11-04 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (GNULIB_CLOSE_STREAM, HAVE_DECL___FPENDING): New macros.
-2012-11-19 Eli Zaretskii <eliz@gnu.org>
+2012-11-03 Eli Zaretskii <eliz@gnu.org>
- * inc/stdint.h (PTRDIFF_MIN) [!__GNUC__]: Define for MSVC.
+ * config.nt (PENDING_OUTPUT_N_BYTES): Define.
2012-11-01 Eli Zaretskii <eliz@gnu.org>
/* Define to the number of bits in type 'wint_t'. */
#undef BITSIZEOF_WINT_T
-/* Define if getwd should not be used. */
-#undef BROKEN_GETWD
-
/* Define if get_current_dir_name should not be used. */
#undef BROKEN_GET_CURRENT_DIR_NAME
/* Define on FreeBSD to work around an issue when reading from a PTY. */
#undef BROKEN_PTY_READ_AFTER_EAGAIN
-/* Define if the system is compatible with BSD 4.2. */
-#undef BSD4_2
-
/* Define if the system is compatible with BSD 4.2. */
#undef BSD_SYSTEM
/* Character that separates directories in a file name. */
#define DIRECTORY_SEP '/'
-/* Define if dispnew.c should include stdio_ext.h. */
-#undef DISPNEW_NEEDS_STDIO_EXT
-
/* Define if process.c does not need to close a pty to make it a controlling
terminal (it is already a controlling terminal of the subprocess, because
we did ioctl TIOCSCTTY). */
setjmp does work. */
#define GC_SETJMP_WORKS 1
-/* Define to 1 if the `getpgrp' function requires zero arguments. */
-#define GETPGRP_VOID 1
+/* Define to the type of elements in the array set by `getgroups'. Usually
+ this is either `int' or `gid_t'. */
+#undef GETGROUPS_T
+
+/* Define this to 1 if getgroups(0,NULL) does not return the number of groups.
+ */
+#undef GETGROUPS_ZERO_BUG
/* Define if gettimeofday clobbers the localtime buffer. */
#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
/* Define this to enable glyphs debugging code. */
/* #undef GLYPH_DEBUG */
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module close-stream shall be considered present. */
+#undef GNULIB_CLOSE_STREAM
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module faccessat shall be considered present. */
+#undef GNULIB_FACCESSAT
+
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module fscanf shall be considered present. */
#undef GNULIB_FSCANF
startup, if using GTK. */
#undef G_SLICE_ALWAYS_MALLOC
+/* Define to 1 if you have the `access' function. */
+#undef HAVE_ACCESS
+
/* Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists. */
#undef HAVE_AIX_SMT_EXP
/* Define to 1 if you have the `clock_settime' function. */
#undef HAVE_CLOCK_SETTIME
-/* Define to 1 if you have the `closedir' function. */
-#define HAVE_CLOSEDIR 1
-
/* Define to 1 if you have the <coff.h> header file. */
#undef HAVE_COFF_H
*/
#define HAVE_DECL_TZNAME 1
+/* Define to 1 if you have the declaration of `unsetenv', and to 0 if you
+ don't. */
+#undef HAVE_DECL_UNSETENV
+
+/* Define to 1 if you have the declaration of `__fpending', and to 0 if you
+ don't. */
+#undef HAVE_DECL___FPENDING
+
/* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you
don't. */
#undef HAVE_DECL___SYS_SIGLIST
/* Define to 1 if you have the `difftime' function. */
#undef HAVE_DIFFTIME
-/* Define to 1 if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
-
/* Define to 1 if you have the 'dup2' function. */
#define HAVE_DUP2 1
+/* Define to 1 if you have the `eaccess' function. */
+#undef HAVE_EACCESS
+
/* Define to 1 if you have the `endgrent' function. */
#undef HAVE_ENDGRENT
/* Define to 1 if you have the <execinfo.h> header file. */
#define HAVE_EXECINFO_H 1
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
+/* Define to 1 if you have the `faccessat' function. */
+#undef HAVE_FACCESSAT
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
-/* Define to 1 if you have the `fpathconf' function. */
-#undef HAVE_FPATHCONF
-
/* Define to 1 if you have the `freeifaddrs' function. */
#undef HAVE_FREEIFADDRS
/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
-/* Define to 1 if you have the `getcwd' function.
- If you think about defining HAVE_GETCWD, don't: the alternative
- getwd is redefined on w32.c, and does not really return the current
- directory, to get the desired results elsewhere in Emacs. */
-#undef HAVE_GETCWD
-
/* Define to 1 if you have the `getdelim' function. */
#undef HAVE_GETDELIM
/* Define to 1 if you have the `getgrent' function. */
#undef HAVE_GETGRENT
+/* Define to 1 if your system has a working `getgroups' function. */
+#undef HAVE_GETGROUPS
+
/* Define to 1 if you have the `gethostname' function. */
#define HAVE_GETHOSTNAME 1
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
-/* Define to 1 if you have the `getwd' function. */
-#undef HAVE_GETWD
-
/* Define to 1 if you have the `get_current_dir_name' function. */
#undef HAVE_GET_CURRENT_DIR_NAME
/* Define to 1 if you have inet sockets. */
#define HAVE_INET_SOCKETS 1
+/* Define to 1 to use inotify. */
+#undef HAVE_INOTIFY
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `dnet' library (-ldnet). */
#undef HAVE_LIBDNET
+/* Define to 1 if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_H
+
/* Define to 1 if you have the hesiod library (-lhesiod). */
#undef HAVE_LIBHESIOD
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
-/* Define if you have mouse support. */
-#define HAVE_MOUSE 1
-
/* Define to 1 if you have the `nanotime' function. */
#undef HAVE_NANOTIME
/* Define to 1 if you have the <png.h> header file. */
#undef HAVE_PNG_H
+/* Define to 1 if using POSIX ACL support. */
+#define HAVE_POSIX_ACL 1
+
/* Define to 1 if you have the `posix_memalign' function. */
#undef HAVE_POSIX_MEMALIGN
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
-/* Define to 1 if you have the `setpgid' function. */
-#undef HAVE_SETPGID
-
/* Define to 1 if you have the `setrlimit' function. */
#undef HAVE_SETRLIMIT
-/* Define to 1 if you have the `setsid' function. */
-#undef HAVE_SETSID
-
/* Define to 1 if you have the `shutdown' function. */
#define HAVE_SHUTDOWN 1
+/* Define to 1 if you have the `sig2str' function. */
+#undef HAVE_SIG2STR
+
/* Define to 1 if 'sig_atomic_t' is a signed integer type. */
#undef HAVE_SIGNED_SIG_ATOMIC_T
/* Define to 1 if you have the <sys/bitypes.h> header file. */
#undef HAVE_SYS_BITYPES_H
+/* Define to 1 if you have the <sys/inotify.h> header file. */
+#undef HAVE_SYS_INOTIFY_H
+
/* Define to 1 if you have the <sys/inttypes.h> header file. */
#undef HAVE_SYS_INTTYPES_H
#undef HAVE_SYS_VLIMIT_H
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
+#define HAVE_SYS_WAIT_H 1
/* Define to 1 if you have the <term.h> header file. */
#undef HAVE_TERM_H
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
+/* Define to 1 if you have the `unsetenv' function. */
+#define HAVE_UNSETENV 1
+
/* Define to 1 if the system has the type 'unsigned long long int'. */
#undef HAVE_UNSIGNED_LONG_LONG_INT
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Number of chars of output in the buffer of a stdio stream. */
-#undef PENDING_OUTPUT_COUNT
+/* the number of pending output bytes on stream 'fp' */
+#define PENDING_OUTPUT_N_BYTES (fp->_ptr - fp->_base)
/* Define to empty to suppress deprecation warnings when building with
--enable-gcc-warnings and with libpng versions before 1.5, which lack
/* Character that separates PATH elements. */
#define SEPCHAR ';'
-/* Define if process.c:child_setup should not call setpgrp. */
-#undef SETPGRP_RELEASES_CTTY
-
/* How to set up a slave PTY, if needed. */
#undef SETUP_SLAVE_PTY
timespec. */
#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
-/* Undocumented. */
-#undef ULIMIT_BREAK_VALUE
-
/* Define to 1 for Encore UMAX. */
#undef UMAX
#undef USG_SUBTTY_WORKS
/* Version number of package */
-#define VERSION "24.2.91"
+#define VERSION "24.3.50"
+
+/* Define to 1 if unsetenv returns void instead of int. */
+#undef VOID_UNSETENV
/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
'wchar_t'. */
when FOO is an inline function in the header; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
_GL_INLINE_HEADER_END contains useful stuff to put
- in the same include file, after uses of _GL_INLINE. */
-#if (__GNUC__ \
- ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
- : 199901L <= __STDC_VERSION__)
+ in the same include file, after uses of _GL_INLINE.
+
+ Suppress the use of extern inline on Apple's platforms,
+ as Libc-825.25 (2012-09-19) is incompatible with it; see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+ Perhaps Apple will fix this some day. */
+#if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : 199901L <= __STDC_VERSION__) \
+ && !defined __APPLE__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
-#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
# if __GNUC_GNU_INLINE__
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
# endif
# define _GL_EXTERN_INLINE extern
#else
-# define _GL_INLINE static inline
-# define _GL_EXTERN_INLINE static inline
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
#endif
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
/* Define to rpl_gmtime if the replacement function should be used. */
#undef gmtime
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#undef inline
-#endif
-
/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
-Emacs ICON icons\emacs.ico
-32649 CURSOR icons\hand.cur
+Emacs ICON icons/emacs.ico
+32649 CURSOR icons/hand.cur
#ifdef WIN64
1 24 "emacs-x64.manifest"
#else
#endif
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 24,2,91,0
- PRODUCTVERSION 24,2,91,0
+ FILEVERSION 24,3,50,0
+ PRODUCTVERSION 24,3,50,0
FILEFLAGSMASK 0x3FL
#ifdef EMACSDEBUG
FILEFLAGS 0x1L
BEGIN
VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "GNU Emacs: The extensible self-documenting text editor\0"
- VALUE "FileVersion", "24, 2, 91, 0\0"
+ VALUE "FileVersion", "24, 3, 50, 0\0"
VALUE "InternalName", "Emacs\0"
VALUE "LegalCopyright", "Copyright (C) 2001-2013\0"
VALUE "OriginalFilename", "emacs.exe"
VALUE "ProductName", "Emacs\0"
- VALUE "ProductVersion", "24, 2, 91, 0\0"
+ VALUE "ProductVersion", "24, 3, 50, 0\0"
VALUE "OLESelfRegister", "\0"
END
END
#endif
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 24,2,91,0
- PRODUCTVERSION 24,2,91,0
+ FILEVERSION 24,3,50,0
+ PRODUCTVERSION 24,3,50,0
FILEFLAGSMASK 0x3FL
#ifdef EMACSDEBUG
FILEFLAGS 0x1L
BEGIN
VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "GNU EmacsClient: Client for the extensible self-documenting text editor\0"
- VALUE "FileVersion", "24, 2, 91, 0\0"
+ VALUE "FileVersion", "24, 3, 50, 0\0"
VALUE "InternalName", "EmacsClient\0"
VALUE "LegalCopyright", "Copyright (C) 2001-2013\0"
VALUE "OriginalFilename", "emacsclientw.exe"
VALUE "ProductName", "EmacsClient\0"
- VALUE "ProductVersion", "24, 2, 91, 0\0"
+ VALUE "ProductVersion", "24, 3, 50, 0\0"
VALUE "OLESelfRegister", "\0"
END
END
ifeq "$(findstring ECHO, $(sh_output))" "ECHO"
THE_SHELL = $(COMSPEC)$(ComSpec)
SHELLTYPE=CMD
+SWITCHCHAR=/
else
USING_SH = 1
THE_SHELL = $(SHELL)
SHELLTYPE=SH
+# MSYS needs to double the slash in cmd-style switches to avoid
+# interpreting /x as a Posix style file name reference
+ifneq ($(MSYSTEM),)
+SWITCHCHAR=//
+else
+SWITCHCHAR=/
+endif
endif
MAKETYPE=gmake
/*
- <dir.h> -- definitions for 4.2BSD-compatible directory access
-
- last edit: 09-Jul-1983 D A Gwyn
+ <dirent.h> -- definitions for POSIX-compatible directory access
* The code here is forced by the interface, and is not subject to
* copyright, constituting the only possible expression of the
#endif /* not WINDOWSNT */
/* NOTE: MAXNAMLEN must be one less than a multiple of 4 */
-struct direct /* data from readdir() */
+struct dirent /* data from readdir() */
{
long d_ino; /* inode number of entry */
unsigned short d_reclen; /* length of this record */
} DIR; /* stream data from opendir() */
extern DIR *opendir (char *);
-extern struct direct *readdir (DIR *);
+extern struct dirent *readdir (DIR *);
extern void seekdir (DIR *, long);
extern void closedir (DIR *);
#define rewinddir( dirp ) seekdir( dirp, 0L )
-
#endif
/* Calls that are emulated or shadowed. */
-#undef access
-#define access sys_access
#undef chdir
#define chdir sys_chdir
#undef chmod
#define strerror sys_strerror
#undef unlink
#define unlink sys_unlink
+/* This prototype is needed because some files include config.h
+ _after_ the standard headers, so sys_unlink gets no prototype from
+ stdio.h or io.h. */
+extern int sys_unlink (const char *);
#undef write
#define write sys_write
/* Subprocess calls that are emulated. */
#define spawnve sys_spawnve
-#define wait sys_wait
#define kill sys_kill
#define signal sys_signal
/* Internal signals. */
#define emacs_raise(sig) emacs_abort()
-extern int sys_wait (int *);
-
/* termcap.c calls that are emulated. */
#define tputs sys_tputs
#define tgetstr sys_tgetstr
#define NSIG 23
#endif
+#ifndef ENOTSUP
+#define ENOTSUP ENOSYS
+#endif
+
#ifdef _MSC_VER
typedef int sigset_t;
typedef int ssize_t;
#define sys_nerr _sys_nerr
#endif
+/* This must be after including stdlib.h, which defines putenv on MinGW. */
+#ifdef putenv
+# undef putenv
+#endif
+#define putenv sys_putenv
+extern int sys_putenv (char *);
+
extern int getloadavg (double *, int);
extern int getpagesize (void);
--- /dev/null
+/* Emulation of Posix ACLs for Windows. */
+
+#ifndef ACL_H
+#define ACL_H
+
+#define NOMINMAX 1 /* don't define min and max */
+#include <windows.h>
+
+typedef PSECURITY_DESCRIPTOR acl_t;
+typedef unsigned acl_type_t;
+
+/* Values of acl_type_t */
+#define ACL_TYPE_ACCESS 0
+#define ACL_TYPE_DEFAULT 1
+
+typedef unsigned acl_perm_t;
+
+extern int acl_valid (acl_t);
+extern acl_t acl_get_file (const char *, acl_type_t);
+extern int acl_set_file (const char *, acl_type_t, acl_t);
+extern char * acl_to_text (acl_t, ssize_t *);
+extern acl_t acl_from_text (const char *);
+extern int acl_free (void *);
+
+#endif /* ACL_H */
+++ /dev/null
-/*
- * map sys\dir.h to ..\..\..\src\ndir.h
- */
-
-#include "..\..\..\src\ndir.h"
-
an fcntl function, for setting sockets to non-blocking mode. */
int fcntl (int s, int cmd, int options);
#define F_SETFL 4
-#define O_NDELAY 04000
+#define O_NONBLOCK 04000
/* we are providing a real h_errno variable */
#undef h_errno
#define S_ISDOOR(m) 0
#define S_ISMPB(m) 0
#define S_ISMPC(m) 0
+#define S_ISMPX(m) 0
#define S_ISNWK(m) 0
#define S_ISPORT(m) 0
#define S_ISWHT(m) 0
char st_gname[260];
};
+/* Internal variable for asking 'stat'/'lstat' to produce accurate
+ info about owner and group of files. */
+extern int w32_stat_get_owner_group;
+
/* Prevent redefinition by other headers, e.g. wchar.h. */
#define _STAT_DEFINED
--- /dev/null
+/* A limited emulation of sys/wait.h on Posix systems.
+
+Copyright (C) 2012-2013 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/>. */
+
+#ifndef INC_SYS_WAIT_H_
+#define INC_SYS_WAIT_H_
+
+#define WNOHANG 1
+#define WUNTRACED 2
+#define WSTOPPED 2 /* same as WUNTRACED */
+#define WEXITED 4
+#define WCONTINUED 8
+
+/* The various WIF* macros are defined in src/syswait.h. */
+
+extern pid_t waitpid (pid_t, int *, int);
+
+#endif /* INC_SYS_WAIT_H_ */
<unistd.h> also includes <stdlib.h>, so there's no need to declare
'environ' here. */
+/* Provide prototypes of library functions that are emulated on w32
+ and whose prototypes are usually found in unistd.h on POSIX
+ platforms. */
extern ssize_t readlink (const char *, char *, size_t);
extern int symlink (char const *, char const *);
extern int setpgid (pid_t, pid_t);
extern pid_t getpgrp (void);
+extern pid_t setsid (void);
+extern pid_t tcgetpgrp (int);
+
+extern int faccessat (int, char const *, int, int);
+
+/* These are normally on fcntl.h, but we don't override that header. */
+/* Use values compatible with gnulib, as there's no reason to differ. */
+#define AT_FDCWD (-3041965)
+#define AT_EACCESS 4
+#define AT_SYMLINK_NOFOLLOW 4096
+
+#define O_NOCTTY 0
+
+/* This is normally on stdlib.h, but we don't override that header. */
+extern int unsetenv (const char *);
#endif /* _UNISTD_H */
# FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out
# (and remove or replace this comment).
-VERSION = 24.2.91
+VERSION = 24.3.50
TMP_DIST_DIR = emacs-$(VERSION)
\r
THE_SHELL = $(COMSPEC)\r
SHELLTYPE=CMD\r
+SWITCHCHAR=/\r
\r
MAKETYPE=nmake\r
\r
set TMP_DIST_DIR=emacs-%EMACS_VER%\r
\r
rem Check, if 7zip is installed and available on path\r
-:ZIP_CHECK\r
-7z\r
-if %ERRORLEVEL% NEQ 0 goto :ZIP_ERROR\r
+7z 1>NUL 2>NUL\r
+if %ERRORLEVEL% NEQ 0 goto ZIP_ERROR\r
goto ZIP_DIST\r
\r
:ZIP_ERROR\r
echo ERROR: Make sure 7zip is installed and available on the Windows Path!\r
goto EXIT\r
\r
-rem Build distributions\r
+rem Build and verify the binary distribution\r
:ZIP_DIST\r
-rem Build and verify full distribution\r
7z a -bd -tZIP -mx=9 -x!.bzrignore -x!.gitignore -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory emacs-%EMACS_VER%-bin-i386.zip %TMP_DIST_DIR%\r
7z t emacs-%EMACS_VER%-bin-i386.zip\r
-rem Build and verify binary only distribution\r
-7z a -bd -tZIP -mx=9 -x!.bzrignore -x!.gitignore -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory emacs-%EMACS_VER%-barebin-i386.zip %TMP_DIST_DIR%/README.W32 %TMP_DIST_DIR%/bin %TMP_DIST_DIR%/etc/DOC-X %TMP_DIST_DIR%/COPYING\r
-7z t emacs-%EMACS_VER%-barebin-i386.zip\r
goto EXIT\r
\r
:EXIT\r
*
*/
-#include <config.h>
#include "XMenuInt.h"
#include <X11/keysym.h>
*
*/
-#include <config.h>
#include "XMenuInt.h"
int
*
*/
-#include <config.h>
#include "XMenuInt.h"
int
+2012-12-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ Include <config.h> uniformly in oldXMenu sources.
+ * Activate.c, AddPane.c, AddSel.c, ChgPane.c, ChgSel.c, Create.c:
+ * InsPane.c, InsSel.c, Internal.c, XMakeAssoc.c:
+ Do not include <config.h>, since XMenuInt.h does that now.
+ * XLookAssoc.c, XMenuInt.h: Include <config.h>.
+ This avoids a build failure when configuring on Fedora 17
+ --with-x-toolkit=no, reported by Dmitry Andropov in
+ <http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00078.html>.
+
2012-10-06 Ulrich Müller <ulm@gentoo.org>
* Makefile.in (AR, ARFLAGS): Get values from configure.
*
*/
-#include <config.h>
#include "XMenuInt.h"
int
_XMErrorCode = XME_NO_ERROR;
return(p_num);
}
-
*
*/
-#include <config.h>
#include "XMenuInt.h"
int
_XMErrorCode = XME_NO_ERROR;
return(s_num);
}
-
*
*/
-#include <config.h>
#include "XMenuInt.h"
#include <stdlib.h>
*
*/
-#include <config.h>
#include "XMenuInt.h"
int
*
*/
-#include <config.h>
#include "XMenuInt.h"
int
*
*/
-#include <config.h>
#include "XMenuInt.h"
/*
#include "copyright.h"
-
+#include <config.h>
#include <X11/Xlib.h>
#include <X11/Xresource.h>
#include "X10.h"
* in the table the routine will return a NULL pointer. All XId's are relative
* to the currently active Display.
*/
-caddr_t XLookUpAssoc(register Display *dpy, register XAssocTable *table, register XID x_id)
-
- /* XAssocTable to search in. */
- /* XId to search for. */
+caddr_t XLookUpAssoc(Display *dpy,
+ XAssocTable *table, /* XAssocTable to search in. */
+ XID x_id) /* XId to search for. */
{
int hash;
register XAssoc *bucket;
/* It is apparently not in the table. */
return(NULL);
}
-
#include "copyright.h"
-#include <config.h>
#include "XMenuInt.h"
#include <X11/Xresource.h>
#include <errno.h>
#ifndef _XMenuInternal_h_
#define _XMenuInternal_h_
+#include <config.h>
+
/* Avoid warnings about redefining NULL by including <stdio.h> first;
the other file which wants to define it (<stddef.h> on Ultrix
systems) can deal if NULL is already defined, but <stdio.h> can't. */
a second line gives the more precise type.
end
+define pvectype
+ set $size = ((struct Lisp_Vector *) $arg0)->header.size
+ if ($size & PSEUDOVECTOR_FLAG)
+ output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS)
+ else
+ output PVEC_NORMAL_VECTOR
+ end
+ echo \n
+end
+document pvectype
+Print the subtype of vectorlike object.
+Takes one argument, a pointer to an object.
+end
+
define xvectype
xgetptr $
- set $size = ((struct Lisp_Vector *) $ptr)->header.size
+ pvectype $ptr
+end
+document xvectype
+Print the subtype of vectorlike object.
+This command assumes that $ is a Lisp_Object.
+end
+
+define pvecsize
+ set $size = ((struct Lisp_Vector *) $arg0)->header.size
if ($size & PSEUDOVECTOR_FLAG)
- output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS)
+ output ($size & PSEUDOVECTOR_SIZE_MASK)
+ echo \n
+ output (($size & PSEUDOVECTOR_REST_MASK) >> PSEUDOVECTOR_SIZE_BITS)
else
- output $size & ~ARRAY_MARK_FLAG
+ output ($size & ~ARRAY_MARK_FLAG)
end
echo \n
end
-document xvectype
-Print the size or vector subtype of $.
-This command assumes that $ is a vector or pseudovector.
+document pvecsize
+Print the size of vectorlike object.
+Takes one argument, a pointer to an object.
+end
+
+define xvecsize
+ xgetptr $
+ pvecsize $ptr
+end
+document xvecsize
+Print the size of $
+This command assumes that $ is a Lisp_Object.
end
define xmisctype
if $type == Lisp_Vectorlike
set $size = ((struct Lisp_Vector *) $ptr)->header.size
if ($size & PSEUDOVECTOR_FLAG)
- set $vec = (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS)
+ set $vec = (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS)
if $vec == PVEC_NORMAL_VECTOR
xvector
end
xgetptr ($bt->function)
set $size = ((struct Lisp_Vector *) $ptr)->header.size
if ($size & PSEUDOVECTOR_FLAG)
- output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS)
+ output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS)
else
output $size & ~ARRAY_MARK_FLAG
end
+2013-01-08 Juri Linkov <juri@jurta.org>
+
+ * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
+ of (supports :underline (:style wave)). (Bug#13000)
+
+2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
+
+ * undo.c (Fprimitive_undo): Move to simple.el.
+ (syms_of_undo): Remove declarations for Sprimitive_undo.
+
+2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * keyboard.c (echo_add_key): Rename from echo_add_char.
+
+2013-01-06 Chong Yidong <cyd@gnu.org>
+
+ * keyboard.c (echo_add_char): New function, factored out from
+ echo_char. Don't add a space if the previous echo string was
+ empty (Bug#13255).
+ (echo_char): Use it.
+ (read_key_sequence): When echoing mock input, ensure that the
+ trailing dash is properly added.
+
2013-01-05 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
of a non-portable "t" to print ptrdiff_t values. Allow up to 9
- digits for buffer positions, before misalignment starts. Display
- "0" for integer "object" field.
+ digits for buffer positions, before misalignment starts.
+ Display "0" for integer "object" field.
(dump_glyph_row): Adapt the header line to changes in dump_glyph.
Display the newline glyph more unambiguously.
* xterm.c (x_draw_glyph_string): Don't use previous underline
thickness and position if previous underline type is underwave.
-2012-12-31 Glenn Morris <rgm@gnu.org>
+2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (Ffile_acl): Undocument return format.
+
+2013-01-02 Glenn Morris <rgm@gnu.org>
* keymap.c (Fkey_description): Doc fix. (Bug#13323)
-2012-12-29 Andreas Schwab <schwab@linux-m68k.org>
+2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify via eabs.
+ * dired.c (file_name_completion):
+ * doc.c (get_doc_string):
+ * floatfns.c (round2):
+ * font.c (font_score, font_delete_unmatched):
+ * fringe.c (compute_fringe_widths):
+ * lread.c (read_list):
+ * minibuf.c (Ftry_completion):
+ * term.c (tty_ins_del_lines):
+ * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
+ Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
+
+2012-12-31 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (unsetenv): Set up the string passed to _putenv
+ correctly.
+ See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
+ for the bug this caused.
+
+2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ * coding.c (Qmac): Now static.
+
+2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
+ (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
+ handlebox_widget. Set toolbar_in_hbox to false/true, set
+ toolbar_is_packed to true.
+ (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
+ (update_frame_tool_bar): Check toolbar_is_packed for packing.
+ Show all on TOOLBAR_TOP_WIDGET.
+ (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
+ by TOOLBAR_TOP_WIDGET.
+ (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
+ Check toolbar_is_packed.
+ (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
+ HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+ (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
+ false.
+ (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+ (xg_update_menubar): Update title only if
+ HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+ (xg_update_submenu): Skip tearoff only if
+ HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+ (xg_initialize): Initialize xg_detached_menus only if
+ HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
+
+ * xterm.h (struct x_output): Surround handlebox_widget with
+ #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
+ toolbar_in_hbox is bool.
+
+2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
* src/Makefile.in (TEMACS_LDFLAGS2): Remove.
(LIBS_GNUSTEP): Define.
(LIBES): Add $(LIBS_GNUSTEP).
(temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
-2012-12-27 Eli Zaretskii <eliz@gnu.org>
+2012-12-30 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (set_cursor_from_row): Don't confuse a truncation or
continuation glyph on a TTY with an indication of an empty line.
(Bug#13277)
+2012-12-29 Eli Zaretskii <eliz@gnu.org>
+
+ * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
+ file's SELinux context or ACLs successfully set, nil otherwise.
+ (Bug#13298)
+ (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
+
+ * w32proc.c (reader_thread): Avoid passing NULL handles to
+ SetEvent and WaitForSingleObject.
+
+2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port EXTERNALLY_VISIBLE to Clang 3.2.
+ * conf_post.h (__has_attribute): New macro.
+ (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
+
2012-12-27 Glenn Morris <rgm@gnu.org>
* cygw32.c (Fcygwin_convert_file_name_to_windows)
(Fcygwin_convert_file_name_from_windows): Doc fixes.
-2012-12-24 Eli Zaretskii <eliz@gnu.org>
+2012-12-27 Eli Zaretskii <eliz@gnu.org>
- * fileio.c (file_name_as_directory, directory_file_name): Accept
- an additional argument MULTIBYTE to indicate whether the input C
+ * fileio.c (file_name_as_directory, directory_file_name):
+ Accept an additional argument MULTIBYTE to indicate whether the input C
came from a multibyte or a unibyte Lisp string; all callers
adjusted. Don't assume the input string is always multibyte.
(Bug#13262)
input strings are multibyte, decode strings obtained from C
library functions.
+2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (toplevel): Add two notices to the comment about
+ defining a new Lisp data type.
+ * print.c (print_object): If Lisp_Save_Value object's pointer
+ is the address of a memory area containing Lisp_Objects, try
+ to print them.
+ * alloc.c (valid_lisp_object_p): Adjust comment.
+
+2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * keyboard.c (record_asynch_buffer_change): Initialize an event
+ only if it's really needed.
+ * frame.h (enum output_method): Remove output_mac member since
+ it's a leftover from the deleted code.
+ * frame.c (Fframep): Adjust user here ...
+ * terminal.c (Fterminal_live_p): ... and here.
+ * coding.c (Qmac): Now here because it's only used to denote
+ end-of-line encoding type.
+ (syms_of_coding): DEFSYM it.
+ * frame.h (Qmac): Remove duplicated declaration.
+
+2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * window.c (select_window_1): Now static, since it's used only here.
+
+2012-12-25 Eli Zaretskii <eliz@gnu.org>
+
+ * window.c (window_body_cols): Subtract display margins from the
+ window body width on TTYs as well. See
+ http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
+ for the original report.
+
+2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (redisplay_window): Remove inner local variable
+ because the outer shadowed one has the same meaning.
+ * xterm.h (struct x_output): Remove toolbar_detached member since it's
+ set but never used.
+ * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
+ (xg_create_tool_bar): Adjust users.
+
+2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * buffer.h (BUF_COMPACT): New macro to follow the common style.
+ * buffer.c (Fget_buffer_create): Use it to set compact field of
+ struct buffer_text to avoid accessing an uninitialized value
+ when compact_buffer is called for the first time.
+ (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
+ (Fset_buffer_modified_p): Use buffer_window_count to check
+ whether the buffer is displayed in some window.
+ * xdisp.c (message_dolog): Likewise.
+
+2012-12-23 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (acl_set_file): If setting the file security descriptor
+ fails, and the new DACL is identical to the existing one, silently
+ return success. This fixes problems for users backing up their
+ own files without having the necessary privileges for setting
+ security descriptors.
+
+ * w32proc.c (reader_thread): Do not index fd_info[] with negative
+ values.
+ (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
+ after WaitForSingleObject returns normally. This expedites reader
+ thread shutdown when delete_child triggers it.
+ (reap_subprocess): More accurate commentary for why we call
+ delete_child only when cp->fd is negative.
+
+ * w32.c (sys_close): Do not call delete_child on a subprocess
+ whose handle is not yet closed. Instead, set its file descriptor
+ to a negative value, so that reap_subprocess will call
+ delete_child on that subprocess when its SIGCHLD arrives.
+ This avoids closing handles used for communications between sys_select
+ and reader_thread, which doesn't give sys_select a chance to
+ notice that the process exited and invoke the SIGCHLD handler for
+ it.
+
+2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfns.m (Fns_do_applescript): Run event loop until script has
+ been executed (Bug#12969).
+ (ns_run_ascript): Chech as_script for nil, set to nil after
+ executing script.
+
2012-12-22 Martin Rudalics <rudalics@gmx.at>
* window.c (Fselect_window): Reword doc-string (Bug#13248).
+2012-12-22 Eli Zaretskii <eliz@gnu.org>
+
+ * w32term.c (w32fullscreen_hook): New function.
+ (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
+
2012-12-21 Eli Zaretskii <eliz@gnu.org>
* fileio.c (Finsert_file_contents): Doc fix.
* buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
-2012-12-15 Chong Yidong <cyd@gnu.org>
-
* fns.c (Fcompare_strings): Doc fix (Bug#13081).
-2012-12-14 Eli Zaretskii <eliz@gnu.org>
+2012-12-21 Eli Zaretskii <eliz@gnu.org>
* w32.c (get_name_and_id): Always pass NULL as the first argument
of lookup_account_sid. Avoids crashes with UNC file names that
(get_file_owner_and_group): Remove now unused argument FNAME; all
callers changed.
-2012-12-11 Eli Zaretskii <eliz@gnu.org>
+2012-12-21 Chong Yidong <cyd@gnu.org>
+
+ * editfns.c (Finsert_char): Since read-char-by-name now signals an
+ error for invalid chars, don't check for a nil return value.
+
+2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Avoid calls to CHAR_TO_BYTE if byte position is known.
+ * editfns.c (make_buffer_string_both): Use move_gap_both.
+ (Fbuffer_string): Use make_buffer_string_both.
+ * marker.c (buf_charpos_to_bytepos): Convert to eassert.
+ Adjust comment.
+ (buf_bytepos_to_charpos): Likewise.
+ (charpos_to_bytepos): Remove.
+ * fileio.c (Finsert_file_contents): Use move_gap_both.
+ * search.c (Freplace_match): Likewise.
+ * process.c (process_send_region): Likewise. Use convenient
+ names for byte positions.
+ * lisp.h (charpos_to_bytepos): Remove prototype.
+ * indent.c (scan_for_column): Use CHAR_TO_BYTE.
+ * insdel.c (move_gap): Likewise.
+
+2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * xdisp.c (redisplay_internal): Remove now-unused local.
+
+2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
+ (redisplay_internal): Don't bother selecting the frame to get the
+ proper value of frame-local variables (bug#13225).
+
+2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * textprop.c (set_text_properties_1): Do not allow NULL interval.
+ Rename 4th argument since it may be buffer or string. Adjust comment.
+ * intervals.c (graft_intervals_info_buffer): Find an interval here.
+
+2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * coding.c (Fdetect_coding_region): Do not check start and end with
+ CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
+ (code_convert_region): Likewise.
+
+2012-12-18 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (acl_get_file, acl_set_file): Run the file name through
+ map_w32_filename, and resolve any symlinks in the file name, like
+ Posix platforms do.
+ (acl_set_file): Call revert_to_self, if any privileges were
+ enabled.
+
+2012-12-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
+ ($(BLD)/w32.$(O)): Update dependencies.
+
+2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
+ propagate redisplay's scrolling (if any) to the right window.
+ (redisplay_internal): Use ensure_selected_frame.
+ (display_mode_lines): Complete last fix.
+ * window.c (select_window_1): New func, extracted from select_window.
+ (select_window): Use it.
+ * window.h (select_window_1): Declare.
+
+2012-12-17 Eli Zaretskii <eliz@gnu.org>
+
+ Emulate Posix ACL APIs on MS-Windows.
+ * w32.c: Include sddl.h and sys/acl.h.
+ (SDDL_REVISION_1): Define if not already defined.
+ (g_b_init_get_security_descriptor_dacl)
+ (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
+ (g_b_init_is_valid_security_descriptor)
+ (g_b_init_set_file_security): New static flags.
+ (globals_of_w32): Initialize them to zero.
+ (SetFileSecurity_Name): New string constant.
+ (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
+ (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
+ (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
+ (IsValidSecurityDescriptor_Proc): New typedefs.
+ (get_file_security, get_security_descriptor_owner)
+ (get_security_descriptor_group): Set errno to ENOTSUP.
+ (set_file_security, get_security_descriptor_dacl)
+ (is_valid_security_descriptor, convert_sd_to_sddl)
+ (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
+ (acl_free, acl_get_file, acl_set_file): New functions.
+
+ * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
+
+2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Don't reraise SIGCHLD, as that can now lose (Bug#13192).
+ With the 2012-12-03 fix for Bug#12980 in place, an old workaround
+ for some of that bug's symptoms can now cause Emacs to abort.
+ Remove the workaround.
+ * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
+ The bug that caused SIGCHLD to get lost has been fixed, and the
+ workaround for it can now cause Emacs to abort.
+
+2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * sysdep.c (emacs_abort): Bump backtrace size to 40.
+ Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
+ <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
+
+2012-12-16 Romain Francoise <romain@orebokech.com>
+
+ * fileio.c (Ffile_acl, Fset_file_acl): New functions.
+ (Fcopy_file): Change last arg to `preserve_extended_attributes'
+ and copy ACL entries of file in addition to SELinux context if set.
+ (syms_of_fileio): Add `file-acl' and `set-file-acl'.
+
+ * Makefile.in (LIBACL_LIBS): New macro.
+ (LIBES): Use it.
+
+2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fileio.c (internal_delete_file): Use bool for boolean.
+
+2012-12-15 Eli Zaretskii <eliz@gnu.org>
+
+ Fix bug #13079 on MS-Windows with temp files not being deleted.
+ * w32.h (_child_process): New members input_file and
+ pending_deletion.
+ (register_child): First argument is now pid_t.
+ (record_infile, record_pending_deletion): New prototypes.
+
+ * w32proc.c (new_child): Initialize input_file and
+ pending_deletion members of the child.
+ (delete_child): Delete the child's temporary input file, if any,
+ that is pending deletion.
+ (register_child): First argument is now pid_t.
+ (record_infile, record_pending_deletion): New functions.
+ (reap_subprocess): Fix a typo in DebPrint string.
+ (sys_spawnve, sys_kill): Use pid_t for PID arguments.
+
+ * fileio.c (internal_delete_file): Return an int again: non-zero
+ if delete-file succeeds, zero otherwise.
+
+ * lisp.h (internal_delete_file): Adjust prototype.
+
+ * callproc.c (Fcall_process): Don't overwrite infile with result
+ of DECODE_FILE.
+ [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
+ asynchronous subprocess, record the name of the input file name,
+ if any.
+ (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
+ delete the file, record it as pending deletion when the subprocess
+ exits.
+
+2012-12-14 Eli Zaretskii <eliz@gnu.org>
+
+ * editfns.c [HAVE_PWD_H]: Include grp.h.
+
+ * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
+
+2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix permissions bugs with setgid directories etc. (Bug#13125)
+ * dired.c (Ffile_attributes): Return t as the 9th attribute,
+ to mark it as a placeholder. The old value was often wrong.
+ The only user of this attribute has been changed to use
+ file-ownership-preserved-p instead, with its new group arg.
+ * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
+
+2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (select_frame_for_redisplay, display_mode_lines):
+ Keep selected_window and selected_frame in sync.
+
+2012-12-14 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
+ try to get accurate owner and group information from NT file
+ security APIs. This is to make most callers of 'stat' and
+ 'lstat', which don't need that information, much faster.
+
+ * dired.c (Ffile_attributes) [WINDOWSNT]:
+ Set w32_stat_get_owner_group to a non-zero value, to request accurate
+ owner and group information from 'lstat'.
+
+2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fileio.c (Finsert_file_contents): Don't put tail into head area,
+ as that confuses set-auto-coding, so insist on the head-read
+ returning the full 1024 bytes. Let lseek compute the tail offset;
+ less work for us. Do not ignore I/O errors when reading the tail.
+
+ * xdisp.c: Minor style fixes.
+ (init_iterator): Hoist assignment out of if-expression.
+ (markpos_of_region): Callers now test for sign, not for -1.
+
+2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Minor redisplay optimization when the region length is zero.
+ * xdisp.c (markpos_of_region): New function.
+ (init_iterator): Do not highlight the region of zero length.
+ (redisplay_window): Check whether the region is of non-zero length.
+ (try_cursor_movement): Allow if the region length is zero.
+ (try_window_reusing_current_matrix, try_window_id): Likewise.
+
+2012-12-13 Eli Zaretskii <eliz@gnu.org>
* search.c (search_buffer): Check the inverse translations of each
character in pattern when the buffer being searched is unibyte.
(Bug#13084)
-2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
+2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
* fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
files, fixing a regression from 24.2.
(Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
-2012-12-08 Jan Djärv <jan.h.d@swipnet.se>
+2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
+ fstat shouldn't fail, and if it does fail copy-file should not proceed.
+ Remove unnecessary S_ISLNK test, as (contra the comments) this
+ function can't copy symlinks. Improve quality of error message
+ when attempting to copy files that are neither regular files nor
+ directories.
+
+2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
+ * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
+ * window.c (Frecenter):
+ * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
+ * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
+
+2012-12-12 Daniel Colascione <dancol@dancol.org>
+
+ * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
+ the dumped Emacs is not a sparse file, greatly improving Cygwin
+ "make bootstrap" performance.
+
+2012-12-11 Michael Albinus <michael.albinus@gmx.de>
+
+ * inotify.c (inotify_callback): Generate an Emacs event for every
+ incoming inotify event.
+
+2012-12-11 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (handle_face_prop): Fix logic of computing
+ it->start_of_box_run_p.
+ (append_space_for_newline): If the glyph row is R2L, reset the
+ iterator's end_of_box_run_p flag before prepending the space glyph.
+ (extend_face_to_end_of_line): If the glyph row is R2L, reset the
+ iterator's start_of_box_run_p flag before prepending the stretch.
+ (append_glyph, produce_image_glyph, append_composite_glyph)
+ (append_stretch_glyph, append_glyphless_glyph): Reverse the
+ left_box_line_p and right_box_line_p flags of the glyph for R2L
+ glyph rows. (Bug#13011)
+
+2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * buffer.c (Fset_buffer_multibyte): Do not force redisplay
+ if changed buffer is not shown in a window.
+ * insdel.c (prepare_to_modify_buffer): Likewise.
+ * window.c (replace_buffer_in_windows_safely): Do nothing
+ if buffer is not shown in a window.
+ (Fforce_window_update): Likewise if string or buffer argument
+ is passed.
+
+2012-12-11 Eli Zaretskii <eliz@gnu.org>
+
+ * inotify.c (Finotify_add_watch): Rename decoded_file_name to
+ encoded_file_name, which is what it is.
+
+2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Consistently use marker_position and marker_byte_position.
+ * fringe.c (Ffringe_bitmaps_at_pos):
+ * indent.c (Fvertical_motion):
+ * insdel.c (prepare_to_modify_buffer):
+ * keyboard.c (make_lispy_position):
+ * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
+ (window_scroll_pixel_based, displayed_window_lines)
+ (Fset_window_configuration):
+ * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
+ (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
+ Replace direct access to marker fields with calls
+ to marker_position and/or marker_byte_position.
+
+2012-12-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in (SIG2STR_H): New macro.
+ (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
+ ($(BLD)/w32notify.$(O)): Update dependencies.
+
+2012-12-10 Daniel Colascione <dancol@dancol.org>
+
+ * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
+ Windows file notification functionality unless WINDOWSNT.
+
+ * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
+ declarations.
+
+ * w32fns.c (cache_system_info): Initialize the global hinst
+ variable here so various initialization calls DTRT.
+
+ * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
+ (hinst): Remove unneeded extern declaration.
+ (_start): Remove initialization of above variables; remove
+ initialization of hinst, as cache_system_info now does that.
+
+ * emacs.c (main): Call cache_system_info early in startup; we
+ previously weren't calling it in Cygwin builds.
+
+ * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
+ Teach the autoconf build system how to compile a Windows resource file
+ and link it to Emacs.
+
+2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Per-buffer window counters.
+ * buffer.h (struct buffer): New member window_count.
+ (buffer_window_count): New function.
+ * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
+ Initialize window_count.
+ (Fkill_buffer): Verify window_count for the buffer being killed.
+ (modify_overlay): Do not force redisplay if buffer is not shown
+ in any window.
+ (init_buffer_once): Initialize window_count for buffer_defaults
+ and buffer_local_symbols.
+ * window.h (buffer_shared): Remove declaration.
+ (wset_buffer): Convert from inline ...
+ * window.c (wset_buffer): ... to an ordinary function.
+ (adjust_window_count): New function.
+ (make_parent_window): Use it.
+ * xdisp.c (buffer_shared): Remove.
+ (redisplay_internal, redisplay_window): Adjust users.
+ (buffer_shared_and_changed): Use per-buffer window counter.
+
+2012-12-10 Eli Zaretskii <eliz@gnu.org>
+
+ Support for filesystem notifications on MS-Windows.
+ * w32proc.c (sys_select): If drain_message_queue returns non-zero,
+ and this is a TTY frame, signal the caller that keyboard input is
+ available.
+
+ * w32xfns.c (drain_message_queue): Now returns an int: an
+ indication whether any WM_EMACS_FILENOTIFY messages were found in
+ the queue.
+
+ * w32inevt.c (handle_file_notifications): New function.
+ (w32_console_read_socket): Call it to process file notifications.
+
+ * w32console.c (initialize_w32_display): Record the main thread ID
+ in dwMainThreadId.
+
+ * deps.mk (inotify.o): New dependency list.
+
+ * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
+
+ * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
+ (WM_EMACS_END): Bump value by 1.
+ (notification_buffer_in_use, file_notifications)
+ (notifications_size, notifications_desc): Declare.
+ (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
+ Add prototypes.
+
+ * w32term.c (lispy_file_action, queue_notifications): New functions.
+ (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
+ <Qrenamed_to>: New symbols.
+ (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
+
+ * w32notify.c: New file, implements file event notifications for
+ MS-Windows.
+
+ * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
+ by posting it to the w32_read_socket queue.
+
+ * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
+
+ * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
+ (GLOBAL_SOURCES): Add w32notify.c
+ ($(BLD)/w32notify.$(O)): New set of dependencies.
+
+ * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
+
+ * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
+ Handle FILE_NOTIFY_EVENT.
+ (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
+ (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
+ w32notify-handle-event by default.
+
+ * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
+ syms_of_w32notify.
+
+2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
+
+ Support for filesystem notifications on GNU/Linux via inotify.
+ * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
+
+ * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
+
+ * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
+ (syms_of_keyboard): DEFSYM it.
+ (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
+ (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
+ Qfile_inotify events.
+ (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
+ special-event-map to inotify-handle-event.
+
+ * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
+
+ * Makefile.in (base_obj): Add inotify.o.
+
+ * inotify.c: New file.
+
+2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
-2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
+2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
* w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
DWORD_PTR, for compatibility with 64-bit builds.
(system_process_attributes): Use SIZE_T rather than DWORD, for
compatibility with 64-bit builds.
-2012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
+2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
* lread.c (Vload_source_file_function): Doc fix (Bug#11647).
-2012-12-07 Eli Zaretskii <eliz@gnu.org>
+2012-12-10 Eli Zaretskii <eliz@gnu.org>
* indent.c (Fvertical_motion): If a display string will be
displayed on the left or the right margin, don't consider it as a
factor in cursor positioning. (Bug#13108)
-2012-12-07 Martin Rudalics <rudalics@gmx.at>
+2012-12-10 Martin Rudalics <rudalics@gmx.at>
* editfns.c (Fcompare_buffer_substrings): Reword doc-string.
-2012-12-05 Eli Zaretskii <eliz@gnu.org>
+2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
+ for string length.
+
+2012-12-08 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (unsetenv): Return 0 if the input string is too long.
+
+2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
+ * alloc.c (xputenv): New function.
+ * dbusbind.c (Fdbus_init_bus):
+ * emacs.c (main):
+ * xterm.c (x_term_init):
+ Use xputenv instead of setenv or putenv, to detect memory exhaustion.
+ * editfns.c (initial_tz): Move static var decl up.
+ (tzvalbuf_in_environ): New static var.
+ (init_editfns): Initialize these two static vars.
+ (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
+ Save old TZ value on stack, if it's small.
+ (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
+ instead, use xputenv+unsetenv to set and restore TZ.
+ (environbuf): Remove static var. All uses removed.
+ (Fset_time_zone_rule): Do not save TZ and environ;
+ no longer needed here.
+ (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
+ Move to inside set_time_zone_rule; they don't need file scope any more.
+ (set_time_zone_rule): Maintain the TZ=value string separately.
+ (syms_of_editfns): Don't initialize initial_tz;
+ init_editfns now does it.
+ * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
+ * lisp.h (xputenv): New decl.
+
+2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
+
+ * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
+
+2012-12-08 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (unsetenv, sys_putenv): New functions.
+
+2012-12-08 Chong Yidong <cyd@gnu.org>
+
+ * editfns.c (Finsert_char): Make the error message more
+ informative (Bug#12992).
+
+2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify get_lim_data.
+ * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
+ Remove USG and vlimit methods; no longer used these days.
+ Add #error catchall just in case.
+
+ Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
+ Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
+ SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
+ * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
+ (deleted_pid_list, Fdelete_process, create_process)
+ (record_child_status_change, handle_child_signal, deliver_child_signal)
+ (init_process_emacs, syms_of_process):
+ Assume SIGCHLD is defined.
+ (parse_signal): Remove. All uses removed.
+ (abbr_to_signal): New static function.
+ (Fsignal_process): Use it to convert signal names to ints.
+ * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
+ kill (getpgrp (), ...).
+ (emacs_sigaction_init): Assume SIGCHLD is defined.
+ (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
+ SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
+ * syssignal.h (EMACS_KILLPG): Remove.
+ All uses replaced by 'kill' with a negative pid.
+ (SIGCHLD): Remove definition, as we now assume SIGCHLD.
+ * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
+
+2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
+ This will cause a production Emacs to dump core instead of
+ infinite-looping.
+
+2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * frame.c (make_frame): Do not set window's buffer to t.
+ * window.c (Fsplit_window_internal): Likewise. Previously it was
+ used to indicate that the window is being set up. Now we use
+ set_window_buffer for all new windows, so the condition in ...
+ (Fset_window_buffer): ... is always true and can be removed.
+
+2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Convenient macro to check whether the buffer is hidden.
+ * buffer.h (BUFFER_HIDDEN_P): New macro.
+ * frame.c (make_frame): Use it. Adjust comment.
+ * buffer.c (candidate_buffer): New function.
+ (Fother_buffer, other_buffer_safely): Use it.
+
+2012-12-06 Eli Zaretskii <eliz@gnu.org>
+
+ * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
+ if the child process is still running. Instead, exit the wait
+ loop and return zero. (Bug#13086)
+
+2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * frame.h (x_char_width, x_char_height): Remove prototypes.
+ * w32term.h (x_char_width, x_char_height): Likewise.
+ * xfns.c (x_char_width, x_char_height): Remove.
+ * w32fns.c (x_char_width, x_char_height): Likewise.
+ * nsfns.c (x_char_width, x_char_height): Likewise.
+ * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
+ all window frames.
+ (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
+ * keyboard.c (command_loop_1): Remove prototype.
+ (command_loop_2, top_level_1): Add static to match prototype.
+
+2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix a recently-introduced delete-process race condition.
+ * callproc.c, process.h (record_kill_process):
+ New function, containing part of the old call_process_kill.
+ (call_process_kill): Use it.
+ This does not change call_process_kill's behavior.
+ * process.c (Fdelete_process): Use record_kill_process to fix a
+ race condition that could cause Emacs to lose track of a child.
+
+2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Avoid code duplication between prev_frame and next_frame.
+ * frame.c (candidate_frame): New function. Add comment.
+ (prev_frame, next_frame): Use it. Adjust comment.
+
+2012-12-06 Eli Zaretskii <eliz@gnu.org>
* callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
fails, signal an error instead of continuing with an empty
Encode expanded temp file pattern before passing it to mkstemp or
mktemp.
-2012-12-04 Eli Zaretskii <eliz@gnu.org>
-
* fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
Encode the file name before passing it to dostounix_filename, in
case it will downcase it (under w32-downcase-file-names).
(Bug#12933)
-2012-12-01 Chong Yidong <cyd@gnu.org>
+2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ Minor call-process cleanups.
+ * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
+ at the same time as other platforms, to simplify analysis.
+ No need for fd0_volatile since we have synch_process_fd.
+ Avoid needless emacs_close; arg is always negative.
+
+2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
+
+ * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
+ processes.
+
+2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
+ member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
+ and mouse_face_hidden members to a bitfields.
+ * frame.h (struct frame): Remove set-but-not-used space_width member.
+ (FRAME_SPACE_WIDTH): Remove.
+ * nsterm.m, w32term.c, xterm.c: Adjust users.
+ * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
+ member. Adjust users. Convert term_initted, delete_in_insert_mode,
+ costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
+ members to a bitfields.
+
+2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ Don't let call-process be a zombie factory (Bug#12980).
+ Fixing this bug required some cleanup of the signal-handling code.
+ As a side effect, this change also fixes a longstanding rare race
+ condition whereby Emacs could mistakenly kill unrelated processes,
+ and it fixes a bug where a second C-g does not kill a recalcitrant
+ synchronous process in GNU/Linux and similar platforms.
+ The patch should also fix the last vestiges of Bug#9488,
+ a bug which has mostly been fixed on the trunk by other changes.
+ * callproc.c, process.h (synch_process_alive, synch_process_death)
+ (synch_process_termsig, sync_process_retcode):
+ Remove. All uses removed, to simplify analysis and so that
+ less consing is done inside critical sections.
+ * callproc.c (call_process_exited): Remove. All uses replaced
+ with !synch_process_pid.
+ * callproc.c (synch_process_pid, synch_process_fd): New static vars.
+ These take the role of what used to be in unwind-protect arg.
+ All uses changed.
+ (block_child_signal, unblock_child_signal):
+ New functions, to avoid races that could kill innocent-victim processes.
+ (call_process_kill, call_process_cleanup, Fcall_process): Use them.
+ (call_process_kill): Record killed processes as deleted, so that
+ zombies do not clutter up the system. Do this inside a critical
+ section, to avoid a race that would allow the clutter.
+ (call_process_cleanup): Fix code so that the second C-g works again
+ on common platforms such as GNU/Linux.
+ (Fcall_process): Create the child process in a critical section,
+ to fix a race condition. If creating an asynchronous process,
+ record it as deleted so that zombies do not clutter up the system.
+ Do unwind-protect for WINDOWSNT too, as that's simpler in the
+ light of these changes. Omit unnecessary call to emacs_close
+ before failure, as the unwind-protect code does that.
+ * callproc.c (call_process_cleanup):
+ * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
+ * process.c (record_deleted_pid): New function, containing
+ code refactored out of Fdelete_process.
+ (Fdelete_process): Use it.
+ (process_status_retrieved): Remove. All callers changed to use
+ child_status_change.
+ (record_child_status_change): Remove, folding its contents into ...
+ (handle_child_signal): ... this signal handler. Now, this
+ function is purely a handler for SIGCHLD, and is not called after
+ a synchronous waitpid returns; the synchronous code is moved to
+ wait_for_termination. There is no need to worry about reaping
+ more than one child now.
+ * sysdep.c (get_child_status, child_status_changed): New functions.
+ (wait_for_termination): Now takes int * status and bool
+ interruptible arguments, too. Do not record child status change;
+ that's now the caller's responsibility. All callers changed.
+ Reimplement in terms of get_child_status.
+ (wait_for_termination_1, interruptible_wait_for_termination):
+ Remove. All callers changed to use wait_for_termination.
+ * syswait.h: Include <stdbool.h>, for bool.
+ (record_child_status_change, interruptible_wait_for_termination):
+ Remove decls.
+ (record_deleted_pid, child_status_changed): New decls.
+ (wait_for_termination): Adjust to API changes noted above.
+
+ * bytecode.c, lisp.h (Qbytecode): Remove.
+ No longer needed after 2012-11-20 interactive-p changes.
+
+2012-12-03 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (redisplay_window): If the cursor is visible, but inside
+ the scroll margin, move point outside the margin. (Bug#13055)
+
+2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (my_log_handler): New function.
+ (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
+
+2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (modify_region): Rename to...
+ (modify_region_1): ...new prototype.
+ * textprop.c (modify_region): Now static. Adjust users.
+ * insdel.c (modify_region): Rename to...
+ (modify_region_1): ...new function to work with current buffer.
+ Adjust comment and users. Use true and false for booleans.
+
+2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * alloc.c (free_save_value): New function.
+ (safe_alloca_unwind): Use it.
+ * lisp.h (free_save_value): New prototype.
+ * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
+ Add comment.
+ (save_excursion_restore): Adjust to match saved data structure.
+ Use free_save_value to offload some work from GC. Drop obsolete
+ #if 0 code.
+
+2012-12-03 Chong Yidong <cyd@gnu.org>
* fileio.c (Vauto_save_list_file_name): Doc fix.
-2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
+2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
* w32fns.c: Remove prototype of atof.
- (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
+ (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
builds.
- (file_dialog_callback): Declared UINT_PTR.
+ (file_dialog_callback): Make it UINT_PTR.
* w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
with 64-bit builds.
(FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
defined.
-2012-11-27 Glenn Morris <rgm@gnu.org>
+2012-12-03 Glenn Morris <rgm@gnu.org>
* data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
-2012-11-26 Eli Zaretskii <eliz@gnu.org>
+2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
- * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
- (Bug#11964)
+ Fix xpalloc confusion after memory is exhausted.
+ * alloc.c (xpalloc): Comment fix.
+ * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
+ and signals an error, do not clear charset_table_size, as
+ charset_table is still valid.
+ * doprnt.c (evxprintf): Clear *BUF after freeing it.
-2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
+ Use execve to avoid need to munge environ (Bug#13054).
+ * callproc.c (Fcall_process):
+ * process.c (create_process):
+ Don't save and restore environ; no longer needed.
+ * callproc.c (child_setup):
+ Use execve, not execvp, to preserve environ.
- Revert recent change for Bug#8855.
- As reported by Harald Hanche-Olsen in
- <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
- the change introduces a further bug, of creating lots of zombie
- processes in some cases. Further work is needed to come up with a
- better fix for Bug#8855.
+2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
-2012-11-24 Eli Zaretskii <eliz@gnu.org>
+ * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
+
+2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
+ display for sliced images (Bug#10500).
+
+ * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
+
+2012-11-30 Juanma Barranquero <lekktu@gmail.com>
+
+ * doc.c (Fdocumentation): Re-add handling of function-documentation,
+ accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
+
+2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (window_outdated): Remove eassert since it hits
+ some suspicious corner cases (see Bug#13007 and Bug#13012).
+ (mode_line_update_needed): New function.
+ (redisplay_internal, redisplay_window): Use it.
+ (ensure_selected_frame): New function.
+ (redisplay_internal, unwind_redisplay): Use it.
+ (redisplay_internal): Move comment about buffer_shared...
+ (buffer_shared_and_changed): ...near to its real use.
+
+2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
+
+ * callproc.c (Fcall_process): Don't misreport vfork failure.
+
+2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ * callproc.c (Fcall_process): Fix vfork portability problems.
+ Do not assume that fd[0], count, filefd, and save_environ survive
+ vfork. Fix bug whereby wrong errno value could be reported for
+ pipe failure. Some minor cleanups, too, as follows. Move buf and
+ bufsize to the context where they're needed. Change new_argv to
+ be of type char **, as this is more convenient and avoids casts.
+ (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
+ Now local constants, not macros.
+
+2012-11-18 Kenichi Handa <handa@gnu.org>
+
+ * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
+ for the variable "f".
+
+2012-11-13 Kenichi Handa <handa@gnu.org>
+
+ * font.c (font_unparse_xlfd): Exclude special characters from the
+ generating XLFD name.
+
+2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
+ * dired.c (stat_uname, stat_gname):
+ * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
+
+ Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
+ * dired.c (directory_files_internal, file_name_completion):
+ Assume EAGAIN and EINTR are defined.
+
+ * fileio.c (Fcopy_file): Assume EISDIR is defined.
+ * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
+ * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
+ * lread.c (readbyte_from_file): Assume EINTR is defined.
+ * process.c (wait_reading_process_output, send_process) [subprocesses]:
+ Assume EIO and EAGAIN are defined.
+ * unexcoff.c (write_segment): Assume EFAULT is defined.
+
+2012-11-27 Eli Zaretskii <eliz@gnu.org>
+
+ * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
+ (Bug#11964)
* xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
highlighting on the frame was cleared. Prevents assertion
violations when repeatedly clicking on the "Top" link of the
"bread-crumbs" in Info buffers.
-2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
- Eli Zaretskii <eliz@gnu.org>
-
- Fix a race condition with glib (Bug#8855).
- The symptom is a diagnostic "GLib-WARNING **: In call to
- g_spawn_sync(), exit status of a child process was requested but
- SIGCHLD action was set to SIG_IGN and ECHILD was received by
- waitpid(), so exit status can't be returned." The diagnostic
- is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
- The real bug is a race condition between Emacs and glib: Emacs
- does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
- so that glib can't find it. Work around the bug by invoking
- waitpid only on subprocesses that Emacs itself creates.
-
- This is a backport from the trunk, consisting of:
+2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
- * w32proc.c (create_child): Don't clip the PID of the child
- process to fit into an Emacs integer, as this is no longer a
- restriction.
- (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
- reaping only the process specified by PID argument, if that is
- positive. Use PID instead of dead_child to know which process to
- reap. Wait for the child to die only if WNOHANG is not in
- OPTIONS.
- (sys_select): Don't set dead_child.
+ * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
- * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
- as it is no longer needed.
+2012-11-24 Ken Brown <kbrown@cornell.edu>
- * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
- no longer needed.
- (create_process, record_child_status_change): Don't use special
- value -1 in pid field, as the caller now must know the pid rather
- than having the callee infer it. The inference was sometimes
- incorrect anyway, due to another race.
- (create_process): Set new 'alive' member if child is created.
- (process_status_retrieved): New function.
- (record_child_status_change): Use it.
- Accept negative 1st argument, which means to wait for the
- processes that Emacs already knows about. Move special-case code
- for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
- processes that have already been waited for, by testing and
- clearing new 'alive' member. Remove the setting of
- record_at_most_one_child for the !WNOHANG case.
- (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
- now does this internally.
- (handle_child_signal): Let record_child_status_change do all
- the work, since we do not want to reap all exited child processes,
- only the child processes that Emacs itself created.
- * process.h (Lisp_Process): New boolean member 'alive'.
+ * keyboard.c (HAVE_MOUSE):
+ * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
+ were always defined.
-2012-11-23 Eli Zaretskii <eliz@gnu.org>
+2012-11-24 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
between bpos_covered and bpos_max. This fixes cursor display when
pointer to string data, rather than the value of the string object
itself (which barfs under CHECK_LISP_OBJECT_TYPE).
-2012-11-21 Eli Zaretskii <eliz@gnu.org>
-
* indent.c (Fvertical_motion): If the starting position is covered
by a display string, return to one position before that, to avoid
overshooting it inside move_it_to. (Bug#12930)
-2012-11-20 Daniel Colascione <dancol@dancol.org>
+2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * frame.h (struct frame): Remove display_preempted member
+ since all users are dead long ago.
+ * nsterm.h (struct x_output): Use the only dummy member.
+ * w32menu.c (pending_menu_activation): Remove since not
+ really used.
+ (set_frame_menubar): Adjust user.
+ * w32term.h (struct x_output): Drop outdated #if 0 code.
+ (struct w32_output): Use bitfields for explicit_parent,
+ asked_for_visible and menubar_active members.
+ Drop unused pending_menu_activation member.
+ * xterm.h (struct x_output): Drop outdated #if 0 code.
+ Use bitfields for explicit_parent, asked_for_visible,
+ has_been_visible and net_wm_state_hidden_seen members.
- * w32fns.c (Fx_file_dialog):
- (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
- cygwin_convert_file_name*.
+2012-11-23 Eli Zaretskii <eliz@gnu.org>
- * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
- Rename cygwin_convert_path* to cygwin_convert_file_name*.
+ * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
+ of a literal "/". (Bug#12955)
+ (gl-stamp): Invoke fc.exe directly, not through cmd.
+
+2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
+ * dired.c: Assume HAVE_DIRENT_H.
+ (NAMLEN): Remove, replacing with ...
+ (dirent_namelen): New function. All uses changed. Use the GNU macro
+ _D_EXACT_NAMELEN if available, as it's faster than strlen.
+ (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
+ (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
+ * makefile.w32-in (DIR_H): Remove. All uses replaced with
+ $(NT_INC)/dirent.h.
+ ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
+ * ndir.h: Rename to ../nt/inc/dirent.h.
+ * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
+ Do not include <dirent.h>; no longer needed.
+ * w32.c: Include <dirent.h> rather than "ndir.h".
+
+2012-11-23 Chong Yidong <cyd@gnu.org>
+
+ * xftfont.c (xftfont_open): Remove duplicate assignment.
+
+2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * alloc.c (Fgarbage_collect): Unblock input after clearing
+ gc_in_progress to avoid note_mouse_highlight glitch with GC.
+ * frame.h (FRAME_MOUSE_UPDATE): New macro.
+ * msdos.c (IT_frame_up_to_date): Use it here...
+ * w32term.c (w32_frame_up_to_date): ...here...
+ * xterm.c (XTframe_up_to_date): ...and here...
+ * nsterm.m (ns_frame_up_to_date): ...but not here.
+ * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
+ Adjust users.
+ * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
+ Do not check whether GC is in progress.
+
+2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
-2012-11-20 Ken Brown <kbrown@cornell.edu>
+ * xdisp.c (window_buffer_changed): New function.
+ (update_menu_bar, update_tool_bar): Use it to
+ simplify large 'if' statements.
+ (redisplay_internal): Generalize commonly used
+ 'tail' and 'frame' local variables.
+
+2012-11-22 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
+ with Windows system header.
+
+2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
+ * alloc.c: Assume unistd.h exists.
+ * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
+ * sysdep.c (get_current_dir_name): Assume getcwd exists.
+ (getwd) [USG]: Remove; no longer needed.
+ (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
+ * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
+ * w32.h (getcwd): Remove decl.
+
+2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
+ Make it set selected_window as well.
+ (update_tool_bar): Use it.
+
+2012-11-21 Ken Brown <kbrown@cornell.edu>
* emacs.c (main): Set the G_SLICE environment variable for all
Cygwin builds, not just GTK builds. See
https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
-2012-11-19 Eli Zaretskii <eliz@gnu.org>
-
- * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
- w32_note_current_window with code. (Backport from trunk.)
+2012-11-21 Eli Zaretskii <eliz@gnu.org>
* w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
(FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
Define for the MSVC compiler.
- * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
- semi-colon.
-
-2012-11-18 Eli Zaretskii <eliz@gnu.org>
+ * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
* fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
(Fexpand_file_name) [DOS_NT]: Pass encoded file name to
dostounix_filename. Prevents crashes down the road, because
- dostounix_filename assumes it gets a unibyte string. Reported by
- Michel de Ruiter <michel@sentient.nl>, see
+ dostounix_filename assumes it gets a unibyte string.
+ Reported by Michel de Ruiter <michel@sentient.nl>, see
http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
-2012-11-17 Eli Zaretskii <eliz@gnu.org>
+2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Conflate Qnil and Qunbound for `symbol-function'.
+ * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
+ * lread.c (init_obarray): Set `function' fields to Qnil.
+ * eval.c (Fcommandp): Ignore Qunbound.
+ (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
+ * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
+ Test NILP rather than Qunbound.
+ (Ffmakunbound): Set to Qnil.
+ (Fsymbol_function): Never signal an error.
+ (Finteractive_form): Ignore Qunbound.
+
+2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * eval.c (interactive_p): Remove no-longer-used decl.
+
+2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (buffer_shared): Adjust comment.
+ (buffer_shared_and_changed): New function.
+ (prepare_menu_bars, redisplay_internal): Use it to
+ decide whether all windows or frames should be updated.
+ (window_outdated): New function.
+ (text_outside_line_unchanged_p, redisplay_window): Use it.
+ (redisplay_internal): Likewise. Fix indentation.
+
+2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
+ (syms_of_eval): Remove corresponding defsubr.
+ * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
+
+2012-11-19 Daniel Colascione <dancol@dancol.org>
+
+ * w32fns.c (Fx_file_dialog):
+ (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
+ cygwin_convert_file_name*.
+
+ * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
+ Rename cygwin_convert_path* to cygwin_convert_file_name*.
+
+2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
+
+2012-11-18 Eli Zaretskii <eliz@gnu.org>
* w32select.c: Include w32common.h before w32term.h, so that
windows.h gets included before w32term.h uses some of its
features, see below.
- * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
- typedefs.
- (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
- prototypes.
+ * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
+ New typedefs.
+ (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
+ New prototypes.
(EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
-2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
+2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
(ns_select): Return at once if events are held (Bug#12834).
-2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
+2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
* unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
Needed following 2012-10-20 change. (Bug#12902)
+2012-11-18 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32proc.c (waitpid): Remove unused label get_result.
+
+2012-11-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in (SYSWAIT_H): New macro.
+ ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
+ ($(BLD)/sysdep.$(O)): Update dependencies.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
+ * callproc.c (relocate_fd): Assume F_DUPFD.
+ * emacs.c, term.c (O_RDWR): Remove.
+ * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
+ O_NDELAY, since O_NONBLOCK is the standard name for this flag.
+ * nsterm.m: Assume <fcntl.h> exists.
+ * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
+ (create_pty, Fmake_network_process, server_accept_connection)
+ (wait_reading_process_output, init_process_emacs):
+ Assume O_NONBLOCK.
+ (wait_reading_process_output): Put in a special case for WINDOWSNT
+ to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
+ It's not clear this is needed, but it's a more-conservative change.
+ (create_process): Assume FD_CLOEXEC.
+ (create_process, create_pty): Assume O_NOCTTY.
+ * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
+ (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
+ Omit if not DOS_NT, since F_GETFL is not defined there.
+ (serial_open): Assume O_NONBLOCK and O_NOCTTY.
+ * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
+ (O_NOCTTY): Remove.
+ (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
+ lack it, since gnulib guarantees this.
+ * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
+
+2012-11-17 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (faccessat): Pretend that directories have the execute bit
+ set. Emacs expects that, e.g., in files.el:cd-absolute.
+
+ * w32proc.c (create_child): Don't clip the PID of the child
+ process to fit into an Emacs integer, as this is no longer a
+ restriction.
+ (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
+ reaping only the process specified by PID argument, if that is
+ positive. Use PID instead of dead_child to know which process to
+ reap. Wait for the child to die only if WNOHANG is not in
+ OPTIONS.
+ (sys_select): Don't set dead_child.
+
+ * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
+ as it is no longer needed.
+
+ * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
+ no longer needed.
+ (record_child_status_change): Remove the setting of
+ record_at_most_one_child for the !WNOHANG case.
+
+2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix problems in ns port found by static checking.
+ * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
+ (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
+ not to process group.
+ (ns_select): Use emacs_write, not write, as that's more robust
+ in the presence of signals.
+ (fd_handler:): Check for read errors.
+
2012-11-16 Glenn Morris <rgm@gnu.org>
* editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
-2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
+2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
* eval.c (Finteractive_p): Revert lexbind-merge mishap.
-2012-11-14 Eli Zaretskii <eliz@gnu.org>
+2012-11-16 Eli Zaretskii <eliz@gnu.org>
* w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
use the same value of thread handle.
(getitimer): Don't duplicate the caller thread's handle here.
(Bug#12832)
-2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
+2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
called (Bug#12834).
-2012-11-12 Eli Zaretskii <eliz@gnu.org>
+2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ Remove no-longer-used pty_max_bytes variable.
+ * process.c (pty_max_bytes): Remove; unused.
+ (send_process): Do not set it.
+
+2012-11-15 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
+ Update dependencies.
+
+2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
+ This follows up on the 2012-09-29 patch that removed indirection
+ for the 'function' field. Reported by Sergey Vinokurov in
+ <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
+
+2012-11-14 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
+ different name, as the MS runtime does not have such a function,
+ and probably never will.) All callers changed. Ignore DIRFD
+ value if PATH is an absolute file name, to match Posix spec
+ better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
+ symlinks.
+
+2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (echo_area_display, redisplay_internal):
+ Omit redundant check whether frame_garbaged is set.
+
+2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use faccessat, not access, when checking file permissions (Bug#12632).
+ This fixes a bug that has been present in Emacs since its creation.
+ It was reported by Chris Torek in 1983 even before GNU Emacs existed,
+ which must set some sort of record. (Torek's bug report was against
+ a predecessor of GNU Emacs, but GNU Emacs happened to have the
+ same common flaw.) See Torek's Usenet posting
+ "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
+ Posted: Fri Apr 8 14:18:56 1983.
+ * Makefile.in (LIB_EACCESS): New macro.
+ (LIBES): Use it.
+ * callproc.c (init_callproc):
+ * charset.c (init_charset):
+ * fileio.c (check_existing, check_executable, check_writable)
+ (Ffile_readable_p):
+ * lread.c (openp, load_path_check):
+ * process.c (allocate_pty):
+ * xrdb.c (file_p):
+ Use effective UID when checking permissions, not real UID.
+ * callproc.c (init_callproc):
+ * charset.c (init_charset):
+ * lread.c (load_path_check, init_lread):
+ Test whether directories are accessible, not merely whether they exist.
+ * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
+ * fileio.c (check_existing, check_executable, check_writable)
+ (Ffile_readable_p):
+ Use symbolic names instead of integers for the flags, as they're
+ portable now.
+ (check_writable): New arg AMODE. All uses changed.
+ Set errno on failure.
+ (Ffile_readable_p): Use faccessat, not stat + open + close.
+ (Ffile_writable_p): No need to call check_existing + check_writable.
+ Just call check_writable and then look at errno. This saves a syscall.
+ dir should never be nil; replace an unnecessary runtime check
+ with an eassert. When checking the parent directory of a nonexistent
+ file, check that the directory is searchable as well as writable, as
+ we can't create files in unsearchable directories.
+ (file_directory_p): New function, which uses 'stat' on most platforms
+ but faccessat with D_OK (for efficiency) if WINDOWSNT.
+ (Ffile_directory_p, Fset_file_times): Use it.
+ (file_accessible_directory_p): New function, which uses a single
+ syscall for efficiency.
+ (Ffile_accessible_directory_p): Use it.
+ * xrdb.c (file_p): Use file_directory_p.
+ * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
+ * lread.c (openp): When opening a file, use fstat rather than
+ stat, as that avoids a permissions race. When not opening a file,
+ use file_directory_p rather than stat.
+ (dir_warning): First arg is now a usage string, not a format.
+ Use errno. All uses changed.
+ * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
+ that merely introduced a race.
+ * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
+ changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
+ and similarly for the other O_* flags.
+ * w32.c (sys_faccessat): Rename from sys_access and switch to
+ faccessat's API. All uses changed.
+ * xrdb.c: Do not include <sys/stat.h>; no longer needed.
+ (magic_db): Rename from magic_file_p.
+ (magic_db, search_magic_path): Return an XrmDatabase rather than a
+ char *, so that we don't have to test for file existence
+ separately from opening the file for reading. This removes a race
+ fixes a permission-checking problem, and simplifies the code.
+ All uses changed.
+ (file_p): Remove; no longer needed.
+
+2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Omit glyphs initialization at startup.
+ * dispnew.c (glyphs_initialized_initially_p): Remove.
+ (adjust_frame_glyphs_initially): Likewise. Adjust users.
+ (Fredraw_frame): Move actual code from here...
+ (redraw_frame): ...to here. Add eassert. Adjust comment.
+ (Fredraw_display): Use redraw_frame.
+ * xdisp.c (clear_garbaged_frames): Likewise.
+
+2012-11-13 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
passed to pint2str and pint2hrstr to be at most the size of the
large values of FIELD_WIDTH argument to decode_mode_spec.
(Bug#12867)
-2012-11-07 Martin Rudalics <rudalics@gmx.at>
+2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix a race with verify-visited-file-modtime (Bug#12863).
+ Since at least 1991 Emacs has ignored an mtime difference of no
+ more than one second, but my guess is that this was to work around
+ file system bugs that were fixed long ago. Since the race is
+ causing problems now, let's remove that code.
+ * fileio.c (Fverify_visited_file_modtime): Do not accept a file
+ whose time stamp is off by no more than a second. Insist that the
+ file time stamps match exactly.
+
+2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * frame.h (struct frame): Convert external_tool_bar member to
+ 1-bit unsigned bitfield.
+ * termhooks.h (struct terminal): Remove mouse_moved member since
+ all users are long dead. Adjust comment on mouse_position_hook.
+
+2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Simplify by using FOR_EACH_FRAME here and there.
+ * frame.c (next_frame, prev_frame, other_visible_frames)
+ (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
+ * w32term.c (x_window_to_scroll_bar): Likewise.
+ * window.c (window_list): Likewise.
+ * xdisp.c (x_consider_frame_title): Likewise.
+ * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
+ * xfns.c (x_window_to_frame, x_any_window_to_frame)
+ (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
+ * xmenu.c (menubar_id_to_frame): Likewise.
+ * xselect.c (frame_for_x_selection): Likewise.
+ * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
+ (x_window_to_menu_bar): Likewise.
+ * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
+
+2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data.c (Qdefalias_fset_function): Now static.
+
+ Another tweak to vectorlike_header change.
+ * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
+ Remove, and replace all uses with ...
+ (next_in_free_list, set_next_in_free_list):
+ New functions, which respect C's aliasing rules better.
+
+2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * window.c (list4i): Rename from 'quad'. All uses changed.
+ Needed because <sys/types.h> defines 'quad' on Solaris 10.
+
+2012-11-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
+ warning about mixing declarations and code in ISO C90.
+
+2012-11-10 Martin Rudalics <rudalics@gmx.at>
* window.c (Fsplit_window_internal): Set combination limit of
new parent window to t iff Vwindow_combination_limit is t;
fixing a regression introduced with the change from 2012-09-22.
- (Fwindow_combination_limit, Fset_window_combination_limit):
- Fix doc-strings.
+ (Fset_window_combination_limit): Fix doc-string.
-2012-11-06 Eli Zaretskii <eliz@gnu.org>
+2012-11-10 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (try_scrolling): Fix correction of aggressive-scroll
amount when the scroll margins are too large. When scrolling
point is positioned many lines beyond the window top/bottom.
(Bug#12811)
-2012-11-05 Eli Zaretskii <eliz@gnu.org>
-
* ralloc.c (relinquish): If real_morecore fails to return memory
to the system, don't crash; instead, leave the last heap
unchanged and return. (Bug#12774)
+2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * lisp.h (AUTOLOADP): New macro.
+ * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
+ * data.c (Ffset): Remove special ad-advice-info handling.
+ (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
+ (Fsubr_arity): CSE.
+ (Finteractive_form): Simplify.
+ (Fquo): Don't insist on having at least 2 arguments.
+ (Qdefalias_fset_function): New var.
+
+2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
+
+ * image.c (xpm_make_color_table_h): Change to hashtest_equal.
+
+ * nsfont.m (Qcondensed, Qexpanded): New variables.
+ (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
+ (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
+
+2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Fix recently introduced crash on MS-Windows (Bug#12839).
+ * w32term.h (struct scroll_bar): Use convenient header.
+ (SCROLL_BAR_VEC_SIZE): Remove.
+ * w32term.c (x_scroll_bar_create): Use VECSIZE.
+
+2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Tweak last vectorlike_header change.
+ * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
+ vectorlike object on the free list. This is introduced to avoid
+ some (but not all) pointer casting and aliasing problems, see
+ http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
+ * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
+ objects.
+ (xvectype, xvecsize): Use them to examine Lisp_Object values.
+
+2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
+ been removed, so remove them here also.
+
+2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * doc.c (Fdocumentation): Handle new property
+ dynamic-docstring-function to replace the old ad-advice-info.
+
+2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fns.c (Qeql, hashtest_eq): Now static.
+
+2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
+ * fns.c (hashfn_eq, hashfn_eql, sxhash):
+ * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
+ * buffer.c (compare_overlays): Use XLI rather than XHASH.
+
+2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use same hash function for hashfn_profiler as for hash_string etc.
+ * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
+ * lisp.h (sxhash_combine): New inline function, with the contents
+ of the old SXHASH_COMBINE.
+ * profiler.c (hashfn_profiler): Use it, instead of having a
+ special hash function containing a comparison that always yields 1.
+
+2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
+ (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
+ (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
+ Remove unused vars.
+
+2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * image.c (xpm_make_color_table_h): Fix compiler error because
+ make_hash_table changed.
+
+2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
+
+ * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
+
+2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Use ad-hoc comparison function for the profiler's hash-tables.
+ * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
+ (make_log): Use them.
+ (handle_profiler_signal): Don't inhibit quit any longer since we don't
+ call Fequal any more.
+ (Ffunction_equal): New function.
+ (cmpfn_profiler, hashfn_profiler): New functions.
+ (syms_of_profiler): Initialize them.
+ * lisp.h (struct hash_table_test): New struct.
+ (struct Lisp_Hash_Table): Use it.
+ * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
+ * fns.c (make_hash_table): Take a struct to describe the test.
+ (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
+ (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
+ (hash_lookup, hash_remove_from_table): Move assertion checking of
+ hashfn result here. Check hash-equality before calling cmpfn.
+ (Fmake_hash_table): Adjust call to make_hash_table.
+ (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
+ (syms_of_fns): Initialize them.
+ * emacs.c (main): Move syms_of_fns earlier.
+ * xterm.c (syms_of_xterm):
+ * category.c (hash_get_category_set): Adjust call to make_hash_table.
+ * print.c (print_object): Adjust to new hash-table struct.
+ * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
+
+2012-11-08 Eli Zaretskii <eliz@gnu.org>
+
+ * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
+ value of w32-scroll-lock-modifier is neither nil nor one of the
+ known key modifiers. (Bug#12806)
+
+2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Shrink struct vectorlike_header to the only size field.
+ * lisp.h (enum pvec_type): Avoid explicit enum member values.
+ Adjust comment.
+ (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
+ PVEC_TYPE_MASK to arrange new bitfield in the vector header.
+ (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
+ (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
+ information from the vector header. Adjust comment.
+ (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
+ (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
+ layout.
+ (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
+ (struct vectorlike_header): Remove next member. Adjust comment.
+ (struct Lisp_Subr): Add convenient header. Adjust comment.
+ (allocate_pseudovector): Adjust prototype.
+ * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
+ (sweep_string, lisp_malloc): Remove useless prototypes.
+ (enum mem_type): Adjust comment.
+ (NEXT_IN_FREE_LIST): New macro.
+ (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
+ (Fmake_bool_vector): Likewise.
+ (struct large_vector): New type to represent allocation unit for
+ the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
+ (large_vectors): Change type to struct large_vector.
+ (allocate_vector_from_block): Simplify.
+ (PSEUDOVECTOR_NBYTES): Replace with...
+ (vector_nbytes): ...new function. Adjust users.
+ (sweep_vectors): Adjust processing of large vectors.
+ (allocate_vectorlike): Likewise.
+ (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
+ Add easserts. Adjust XSETPVECTYPESIZE usage.
+ (allocate_buffer): Use BUFFER_PVEC_INIT.
+ (live_vector_p): Adjust to match large vector.
+ * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
+ * buffer.h (struct buffer): Add next member.
+ (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
+ New macros.
+ (FOR_EACH_BUFFER): Adjust to match struct buffer change.
+ * fns.c (internal_equal): Adjust to match enum pvec_type change.
+ (copy_hash_table): Adjust to match vector header change.
+ * lread.c (defsubr): Use XSETPVECTYPE.
+ * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
+ (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
+ (xvecsize): New command.
+
+2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * keyboard.c (event_to_kboard): Do not dereference
+ frame_or_window field of SELECTION_REQUEST_EVENT
+ and SELECTION_CLEAR_EVENT events (Bug#12814).
+ * xterm.h (struct selection_input_event): Adjust comment.
+
+2012-11-07 Eli Zaretskii <eliz@gnu.org>
+
+ * w32fns.c (modifier_set): Don't report modifiers from toggle key,
+ such as Scroll Lock, if the respective keys are treated as
+ function keys, not as modifiers. This avoids destroying non-ASCII
+ keyboard input when Scroll Lock is toggled ON. (Bug#12806)
+
+2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
+
+2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ Restore some duplicate definitions (Bug#12814).
+ This undoes part of the 2012-11-03 changes. Some people build
+ with plain -g rather than with -g3, and they need the duplicate
+ definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
+ * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
+ Define as macros, as well as as enums or as constants.
+
+2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
+ to keypad keys (Bug#12816).
+
+2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ Minor adjustments of recently-changed frame functions.
+ * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
+ known to be a frame (we're in the FRAMEP branch).
+ * lisp.h (Qframep): Remove decl. frame.h declares this.
+ * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
+ since they're meant for Lisp fixnum values.
+
+2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.c (Fwindow_combination_limit): Revert to the only
+ required argument and adjust docstring as suggested in
+ http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
+ by Martin Rudalics <rudalics@gmx.at>.
+
+2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Widely used frame validity and checking functions.
+ * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
+ * frame.c (decode_live_frame, decode_any_frame): New functions.
+ (delete_frame, Fredirect_frame_focus, Fframe_parameters)
+ (Fframe_parameter, Fframe_char_height, Fframe_char_width)
+ (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
+ (Fframe_pointer_visible_p): Use decode_any_frame.
+ (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
+ (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
+ (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
+ (Fframe_focus): Likewise. Allow zero number of arguments.
+ Adjust docstring.
+ (frame_buffer_list, frame_buffer_predicate): Remove.
+ * lisp.h (frame_buffer_predicate): Remove prototype.
+ * buffer.c (Fother_buffer): Use decode_any_frame.
+ * xdisp.c (Ftool_bar_lines_needed): Likewise.
+ * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
+ * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
+ (Fclose_font, Ffont_info): Use decode_live_frame.
+ * fontset.c (check_fontset_name): Likewise.
+ * terminal.c (Fframe_terminal): Likewise.
+ * w32fns.c (check_x_frame): Likewise.
+ * window.c (Fminibuffer_window, Fwindow_at)
+ (Fcurrent_window_configuration): Likewise.
+ (Frun_window_configuration_change_hook, Fwindow_resize_apply):
+ Likewise. Allow zero number of arguments. Adjust docstring.
+ * dispnew.c (Fredraw_frame): Likewise.
+ * xfaces.c (frame_or_selected_frame): Remove.
+ (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
+ (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
+ (Fframe_face_alist): Use decode_live_frame.
+ * xfns.c (check_x_frame): Likewise.
+
+2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.c (quad): New function.
+ (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
+ (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
+ (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
+ (Fwindow_line_height): Use it.
+ (Fwindow_fringes): Use list3.
+ (Fwindow_scroll_bars): Use list4.
+ (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
+ (Fwindow_combination_limit): Allow zero number of arguments.
+
+2012-11-05 Eli Zaretskii <eliz@gnu.org>
+
+ * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
+
+ * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
+ (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
+ file descriptor 2 for standard error. (Bug#12805)
+
+2012-11-05 Chong Yidong <cyd@gnu.org>
+
+ * process.c (wait_reading_process_output): Revert previous change.
+
+2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
+ This removes code that has been obsolete since around 1990.
+ * callproc.c (Fcall_process):
+ * emacs.c (main):
+ * process.c (create_process):
+ * term.c (dissociate_if_controlling_tty):
+ Assume setsid exists.
+ * callproc.c (child_setup): Assume setpgid exists and behaves as
+ per POSIX.1-1988 or later.
+ * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
+ * emacs.c (shut_down_emacs):
+ * sysdep.c (sys_suspend, init_foreground_group):
+ Assume getpgrp behaves as per POSIX.1-1998 or later.
+ * msdos.c (setpgrp): Remove.
+ (tcgetpgrp, setpgid, setsid): New functions.
+ * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
+ * term.c (no_controlling_tty): Remove; unused.
+ * w32proc.c (setpgrp): Remove.
+ (setsid, tcgetpgrp): New functions.
+
+ Simplify by assuming __fpending.
+ * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
+ (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
+ Do not assume that __fpending's result fits in int.
+
+2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ Remove EMACS_OUTQSIZE+sleep hack.
+ * dispnew.c (update_frame_1): Remove hack for terminals slower
+ than 2400 bps, which throttled Emacs by having it sleep.
+ This code hasn't worked since at least 2007, when the multi-tty stuff
+ was added, and anyway those old terminals are long dead.
+ * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
+ without the dispnew.c change, as dispnew.c doesn't include systty.h.
+
+ Fix data-loss with --version (Bug#9574).
+ * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
+ as we can't assume that emacs_strerror is initialized, and strerror
+ is good enough here.
+ (main): Invoke atexit earlier, to catch earlier instances of
+ sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
+
+2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
+
+ * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
+ (keyDown): Remap keypad keys to X11 virtual key codes.
+
+2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix data-loss with --batch (Bug#9574).
+ * emacs.c: Include <close-stream.h>.
+ (close_output_streams): New function.
+ (main): Pass it to atexit, so that Emacs closes stdout and stderr
+ and handles errors appropriately.
+ (Fkill_emacs): Don't worry about flushing, as close_output_stream
+ does that now.
+
+ Fix a race condition that causes Emacs to mess up glib (Bug#8855).
+ The symptom is a diagnostic "GLib-WARNING **: In call to
+ g_spawn_sync(), exit status of a child process was requested but
+ SIGCHLD action was set to SIG_IGN and ECHILD was received by
+ waitpid(), so exit status can't be returned." The diagnostic
+ is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
+ The real bug is a race condition between Emacs and glib: Emacs
+ does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
+ so that glib can't find it. Work around the bug by invoking
+ waitpid only on subprocesses that Emacs itself creates.
+ * process.c (create_process, record_child_status_change):
+ Don't use special value -1 in pid field, as the caller now must
+ know the pid rather than having the callee infer it.
+ The inference was sometimes incorrect anyway, due to another race.
+ (create_process): Set new 'alive' member if child is created.
+ (process_status_retrieved): New function.
+ (record_child_status_change): Use it.
+ Accept negative 1st argument, which means to wait for the
+ processes that Emacs already knows about. Move special-case code
+ for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
+ processes that have already been waited for, by testing and
+ clearing new 'alive' member.
+ (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
+ now does this internally.
+ (handle_child_signal): Let record_child_status_change do all
+ the work, since we do not want to reap all exited child processes,
+ only the child processes that Emacs itself created.
+ * process.h (Lisp_Process): New boolean member 'alive'.
+
+ Omit duplicate definitions no longer needed with gcc -g3.
+ * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
+ (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
+ Define only as macros. There's no longer any need to also define
+ these symbols as enums or as constants, since we now assume
+ gcc -g3 when debugging.
+
2012-11-03 Eli Zaretskii <eliz@gnu.org>
* lisp.mk: Adjust comments to the fact that term/internal is now
iterator when starting in the middle of a display or overlay
string. (Bug#12745)
-2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
+2012-11-03 Chong Yidong <cyd@gnu.org>
+
+ * process.c (wait_reading_process_output): Clean up the last
+ change.
+
+2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
+
+ * process.c (wait_reading_process_output): Avoid a race condition
+ with SIGIO delivery (Bug#11536).
+
+2012-11-03 Chong Yidong <cyd@gnu.org>
+
+ * buffer.c (cursor_type): Untabify docstring.
+
+2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * frame.h (struct frame): Drop can_have_scroll_bars member
+ which is meaningless for a long time. Adjust comments.
+ (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
+ * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
+
+2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.c (decode_next_window_args): Update window arg after
+ calling decode_live_window and so fix crash reported at
+ http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
+ by Juanma Barranquero <lekktu@gmail.com>.
+ (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
+ * font.c (Ffont_at): Likewise.
+
+2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
* widget.c (resize_cb): New function.
(EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
(EmacsFrameResize): Check if all is up to date before changing frame
size.
+2012-11-02 Eli Zaretskii <eliz@gnu.org>
+
+ Implement backtrace output for fatal errors on MS-Windows.
+ * w32fns.c (CaptureStackBackTrace_proc): New typedef.
+ (BACKTRACE_LIMIT_MAX): New macro.
+ (w32_backtrace): New function.
+ (emacs_abort): Use w32_backtrace when the user chooses not to
+ attach a debugger. Update the text of the abort dialog.
+
+2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Window-related stuff cleanup here and there.
+ * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
+ Use decode_any_window.
+ * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
+ * xdisp.c (Fformat_mode_line): Likewise.
+ * font.c (Ffont_at): Use decode_live_window.
+ * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
+ * window.c (decode_next_window_args): Likewise.
+ (decode_any_window): Remove static.
+ * window.h (decode_any_window): Add prototype.
+ * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
+ * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
+ respectively.
+
+2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Remove pad from struct input_event.
+ * termhooks.h (struct input_event): Remove padding field.
+ Adjust comment.
+ * keyboard.c (event_to_kboard): Simplify because frame_or_window
+ member is never cons for a long time. Adjust comment.
+ (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
+ SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
+ * xterm.c (handle_one_xevent): Do not initialize frame_or_window
+ field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
+
2012-11-01 Eli Zaretskii <eliz@gnu.org>
* w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
- * fns.c (Fnreverse): Include the problem element when signalling an
+ * fns.c (Fnreverse): Include the problem element when signaling an
error (bug#12677).
2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
now a supported configuration.
* Makefile.in: consolidate image variables into LIBIMAGE; add
- W32_OBJ and W32_LIBS. Compile new files.
+ W32_OBJ and W32_LIBS. Compile new files.
* conf_post.h:
(_DebPrint) declare tracing facility for W32 debugging. We need
2012-05-09 Michael Albinus <michael.albinus@gmx.de>
* dbusbind.c (xd_registered_buses): New internal Lisp object.
- Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
+ Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
(syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
Initialize xd_registered_buses.
# 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@
+ntsource = $(srcdir)/../nt
abs_builddir = @abs_builddir@
VPATH = $(srcdir)
CC = @CC@
+WINDRES = @WINDRES@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
M17N_FLT_LIBS = @M17N_FLT_LIBS@
LIB_CLOCK_GETTIME=@LIB_CLOCK_GETTIME@
+LIB_EACCESS=@LIB_EACCESS@
LIB_TIMER_TIME=@LIB_TIMER_TIME@
DBUS_CFLAGS = @DBUS_CFLAGS@
## --lwinspool if HAVE_W32, else empty.
W32_LIBS=@W32_LIBS@
+## emacs.res if HAVE_W32
+W32_RES=@W32_RES@
+## If HAVE_W32, compiler arguments for including
+## the resource file in the binary.
+## XXX -Wl,-b -Wl,pe-i386 -Wl,emacs.res
+W32_RES_LINK=@W32_RES_LINK@
+
## Empty if !HAVE_X_WINDOWS
## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE
LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
+LIBACL_LIBS = @LIBACL_LIBS@
+
LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
INTERVALS_H = dispextern.h intervals.h composite.h
@$(MKDEPDIR)
$(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
-
## lastfile must follow all files whose initialized data areas should
## be dumped as pure by dump-emacs.
base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
syntax.o $(UNEXEC_OBJ) bytecode.o \
process.o gnutls.o callproc.o \
region-cache.o sound.o atimer.o \
- doprnt.o intervals.o textprop.o composite.o xml.o \
+ doprnt.o intervals.o textprop.o composite.o xml.o inotify.o \
profiler.o \
$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
$(W32_OBJ) $(WINDOW_SYSTEM_OBJ)
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
fontset.o dbusbind.o cygw32.o \
nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
- w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
+ w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
xsettings.o xgselect.o termcap.o
LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
$(LIBX_OTHER) $(LIBSOUND) \
$(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \
- $(LIB_TIMER_TIME) $(DBUS_LIBS) \
+ $(LIB_EACCESS) $(LIB_TIMER_TIME) $(DBUS_LIBS) \
$(LIB_EXECINFO) \
$(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) \
+ $(LIBACL_LIBS) $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
$(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
all: emacs$(EXEEXT) $(OTHER_FILES)
$(lib)/libgnu.a: $(config_h)
cd $(lib) && $(MAKE) libgnu.a
-temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) $(lib)/libgnu.a
+temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \
+ $(lib)/libgnu.a $(W32_RES)
$(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
- -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES)
+ -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \
+ $(W32_RES_LINK)
test "$(CANNOT_DUMP)" = "yes" || \
test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
doc.o: buildobj.h
+emacs.res: $(ntsource)/emacs.rc \
+ $(ntsource)/icons/emacs.ico \
+ $(ntsource)/emacs-x86.manifest
+ $(WINDRES) -O COFF -o $@ $(ntsource)/emacs.rc
ns-app: emacs$(EXEEXT)
cd ../nextstep && $(MAKE) $(MFLAGS) all
-
.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
.PHONY: versionclean extraclean frc
#endif
#include <unistd.h>
-#ifndef HAVE_UNISTD_H
-extern void *sbrk ();
-#endif
-
#include <fcntl.h>
#ifdef USE_GTK
static void mark_terminals (void);
static void gc_sweep (void);
static Lisp_Object make_pure_vector (ptrdiff_t);
-static void mark_glyph_matrix (struct glyph_matrix *);
-static void mark_face_cache (struct face_cache *);
static void mark_buffer (struct buffer *);
#if !defined REL_ALLOC || defined SYSTEM_MALLOC
static void refill_memory_reserve (void);
#endif
-static struct Lisp_String *allocate_string (void);
static void compact_small_strings (void);
static void free_large_strings (void);
-static void sweep_strings (void);
static void free_misc (Lisp_Object);
extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE;
-/* When scanning the C stack for live Lisp objects, Emacs keeps track
- of what memory allocated via lisp_malloc is intended for what
- purpose. This enumeration specifies the type of memory. */
+/* When scanning the C stack for live Lisp objects, Emacs keeps track of
+ what memory allocated via lisp_malloc and lisp_align_malloc is intended
+ for what purpose. This enumeration specifies the type of memory. */
enum mem_type
{
MEM_TYPE_MISC,
MEM_TYPE_SYMBOL,
MEM_TYPE_FLOAT,
- /* We used to keep separate mem_types for subtypes of vectors such as
- process, hash_table, frame, terminal, and window, but we never made
- use of the distinction, so it only caused source-code complexity
- and runtime slowdown. Minor but pointless. */
+ /* Since all non-bool pseudovectors are small enough to be
+ allocated from vector blocks, this memory type denotes
+ large regular vectors and large bool pseudovectors. */
MEM_TYPE_VECTORLIKE,
/* Special type to denote vector blocks. */
MEM_TYPE_VECTOR_BLOCK,
MEM_TYPE_SPARE
};
-static void *lisp_malloc (size_t, enum mem_type);
-
-
#if GC_MARK_STACK || defined GC_MALLOC_CHECK
#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
infinity.
If PA is null, then allocate a new array instead of reallocating
- the old one. Thus, to grow an array A without saving its old
- contents, invoke xfree (A) immediately followed by xgrowalloc (0,
- &NITEMS, ...).
+ the old one.
Block interrupt input as needed. If memory exhaustion occurs, set
*NITEMS to zero if PA is null, and signal an error (i.e., do not
- return). */
+ return).
+
+ Thus, to grow an array A without saving its old contents, do
+ { xfree (A); A = NULL; A = xpalloc (NULL, &AITEMS, ...); }.
+ The A = NULL avoids a dangling pointer if xpalloc exhausts memory
+ and signals an error, and later this code is reexecuted and
+ attempts to free A. */
void *
xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min,
return p;
}
+/* Like putenv, but (1) use the equivalent of xmalloc and (2) the
+ argument is a const pointer. */
+
+void
+xputenv (char const *string)
+{
+ if (putenv ((char *) string) != 0)
+ memory_full (0);
+}
/* Unwind for SAFE_ALLOCA */
Lisp_Object
safe_alloca_unwind (Lisp_Object arg)
{
- register struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
-
- p->dogc = 0;
- xfree (p->pointer);
- p->pointer = 0;
- free_misc (arg);
+ free_save_value (arg);
return Qnil;
}
val = Fmake_vector (make_number (length_in_elts + extra_bool_elts), Qnil);
/* No Lisp_Object to trace in there. */
- XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0);
+ XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0, 0);
p = XBOOL_VECTOR (val);
p->size = XFASTINT (length);
#define VINDEX(nbytes) (((nbytes) - VBLOCK_BYTES_MIN) / roundup_size)
+/* Get and set the next field in block-allocated vectorlike objects on
+ the free list. Doing it this way respects C's aliasing rules.
+ We could instead make 'contents' a union, but that would mean
+ changes everywhere that the code uses 'contents'. */
+static struct Lisp_Vector *
+next_in_free_list (struct Lisp_Vector *v)
+{
+ intptr_t i = XLI (v->contents[0]);
+ return (struct Lisp_Vector *) i;
+}
+static void
+set_next_in_free_list (struct Lisp_Vector *v, struct Lisp_Vector *next)
+{
+ v->contents[0] = XIL ((intptr_t) next);
+}
+
/* Common shortcut to setup vector on a free list. */
-#define SETUP_ON_FREE_LIST(v, nbytes, index) \
- do { \
- XSETPVECTYPESIZE (v, PVEC_FREE, nbytes); \
- eassert ((nbytes) % roundup_size == 0); \
- (index) = VINDEX (nbytes); \
- eassert ((index) < VECTOR_MAX_FREE_LIST_INDEX); \
- (v)->header.next.vector = vector_free_lists[index]; \
- vector_free_lists[index] = (v); \
- total_free_vector_slots += (nbytes) / word_size; \
+#define SETUP_ON_FREE_LIST(v, nbytes, tmp) \
+ do { \
+ (tmp) = ((nbytes - header_size) / word_size); \
+ XSETPVECTYPESIZE (v, PVEC_FREE, 0, (tmp)); \
+ eassert ((nbytes) % roundup_size == 0); \
+ (tmp) = VINDEX (nbytes); \
+ eassert ((tmp) < VECTOR_MAX_FREE_LIST_INDEX); \
+ set_next_in_free_list (v, vector_free_lists[tmp]); \
+ vector_free_lists[tmp] = (v); \
+ total_free_vector_slots += (nbytes) / word_size; \
} while (0)
+/* This internal type is used to maintain the list of large vectors
+ which are allocated at their own, e.g. outside of vector blocks. */
+
+struct large_vector
+{
+ union {
+ struct large_vector *vector;
+#if USE_LSB_TAG
+ /* We need to maintain ROUNDUP_SIZE alignment for the vector member. */
+ unsigned char c[vroundup (sizeof (struct large_vector *))];
+#endif
+ } next;
+ struct Lisp_Vector v;
+};
+
+/* This internal type is used to maintain an underlying storage
+ for small vectors. */
+
struct vector_block
{
char data[VECTOR_BLOCK_BYTES];
/* Singly-linked list of large vectors. */
-static struct Lisp_Vector *large_vectors;
+static struct large_vector *large_vectors;
/* The only vector with 0 slots, allocated from pure space. */
static struct Lisp_Vector *
allocate_vector_from_block (size_t nbytes)
{
- struct Lisp_Vector *vector, *rest;
+ struct Lisp_Vector *vector;
struct vector_block *block;
size_t index, restbytes;
if (vector_free_lists[index])
{
vector = vector_free_lists[index];
- vector_free_lists[index] = vector->header.next.vector;
- vector->header.next.nbytes = nbytes;
+ vector_free_lists[index] = next_in_free_list (vector);
total_free_vector_slots -= nbytes / word_size;
return vector;
}
{
/* This vector is larger than requested. */
vector = vector_free_lists[index];
- vector_free_lists[index] = vector->header.next.vector;
- vector->header.next.nbytes = nbytes;
+ vector_free_lists[index] = next_in_free_list (vector);
total_free_vector_slots -= nbytes / word_size;
/* Excess bytes are used for the smaller vector,
which should be set on an appropriate free list. */
restbytes = index * roundup_size + VBLOCK_BYTES_MIN - nbytes;
eassert (restbytes % roundup_size == 0);
- rest = ADVANCE (vector, nbytes);
- SETUP_ON_FREE_LIST (rest, restbytes, index);
+ SETUP_ON_FREE_LIST (ADVANCE (vector, nbytes), restbytes, index);
return vector;
}
/* New vector will be at the beginning of this block. */
vector = (struct Lisp_Vector *) block->data;
- vector->header.next.nbytes = nbytes;
/* If the rest of space from this block is large enough
for one-slot vector at least, set up it on a free list. */
if (restbytes >= VBLOCK_BYTES_MIN)
{
eassert (restbytes % roundup_size == 0);
- rest = ADVANCE (vector, nbytes);
- SETUP_ON_FREE_LIST (rest, restbytes, index);
+ SETUP_ON_FREE_LIST (ADVANCE (vector, nbytes), restbytes, index);
}
return vector;
- }
+}
/* Nonzero if VECTOR pointer is valid pointer inside BLOCK. */
((char *) (vector) <= (block)->data \
+ VECTOR_BLOCK_BYTES - VBLOCK_BYTES_MIN)
-/* Number of bytes used by vector-block-allocated object. This is the only
- place where we actually use the `nbytes' field of the vector-header.
- I.e. we could get rid of the `nbytes' field by computing it based on the
- vector-type. */
+/* Return the memory footprint of V in bytes. */
-#define PSEUDOVECTOR_NBYTES(vector) \
- (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FREE) \
- ? vector->header.size & PSEUDOVECTOR_SIZE_MASK \
- : vector->header.next.nbytes)
+static ptrdiff_t
+vector_nbytes (struct Lisp_Vector *v)
+{
+ ptrdiff_t size = v->header.size & ~ARRAY_MARK_FLAG;
+
+ if (size & PSEUDOVECTOR_FLAG)
+ {
+ if (PSEUDOVECTOR_TYPEP (&v->header, PVEC_BOOL_VECTOR))
+ size = (bool_header_size
+ + (((struct Lisp_Bool_Vector *) v)->size
+ + BOOL_VECTOR_BITS_PER_CHAR - 1)
+ / BOOL_VECTOR_BITS_PER_CHAR);
+ else
+ size = (header_size
+ + ((size & PSEUDOVECTOR_SIZE_MASK)
+ + ((size & PSEUDOVECTOR_REST_MASK)
+ >> PSEUDOVECTOR_SIZE_BITS)) * word_size);
+ }
+ else
+ size = header_size + size * word_size;
+ return vroundup (size);
+}
/* Reclaim space used by unmarked vectors. */
sweep_vectors (void)
{
struct vector_block *block = vector_blocks, **bprev = &vector_blocks;
- struct Lisp_Vector *vector, *next, **vprev = &large_vectors;
+ struct large_vector *lv, **lvprev = &large_vectors;
+ struct Lisp_Vector *vector, *next;
total_vectors = total_vector_slots = total_free_vector_slots = 0;
memset (vector_free_lists, 0, sizeof (vector_free_lists));
for (block = vector_blocks; block; block = *bprev)
{
bool free_this_block = 0;
+ ptrdiff_t nbytes;
for (vector = (struct Lisp_Vector *) block->data;
VECTOR_IN_BLOCK (vector, block); vector = next)
{
VECTOR_UNMARK (vector);
total_vectors++;
- total_vector_slots += vector->header.next.nbytes / word_size;
- next = ADVANCE (vector, vector->header.next.nbytes);
+ nbytes = vector_nbytes (vector);
+ total_vector_slots += nbytes / word_size;
+ next = ADVANCE (vector, nbytes);
}
else
{
- ptrdiff_t nbytes = PSEUDOVECTOR_NBYTES (vector);
- ptrdiff_t total_bytes = nbytes;
+ ptrdiff_t total_bytes;
+ nbytes = vector_nbytes (vector);
+ total_bytes = nbytes;
next = ADVANCE (vector, nbytes);
/* While NEXT is not marked, try to coalesce with VECTOR,
{
if (VECTOR_MARKED_P (next))
break;
- nbytes = PSEUDOVECTOR_NBYTES (next);
+ nbytes = vector_nbytes (next);
total_bytes += nbytes;
next = ADVANCE (next, nbytes);
}
/* Sweep large vectors. */
- for (vector = large_vectors; vector; vector = *vprev)
+ for (lv = large_vectors; lv; lv = *lvprev)
{
+ vector = &lv->v;
if (VECTOR_MARKED_P (vector))
{
VECTOR_UNMARK (vector);
else
total_vector_slots
+= header_size / word_size + vector->header.size;
- vprev = &vector->header.next.vector;
+ lvprev = &lv->next.vector;
}
else
{
- *vprev = vector->header.next.vector;
- lisp_free (vector);
+ *lvprev = lv->next.vector;
+ lisp_free (lv);
}
}
}
p = allocate_vector_from_block (vroundup (nbytes));
else
{
- p = lisp_malloc (nbytes, MEM_TYPE_VECTORLIKE);
- p->header.next.vector = large_vectors;
- large_vectors = p;
+ struct large_vector *lv
+ = lisp_malloc (sizeof (*lv) + (len - 1) * word_size,
+ MEM_TYPE_VECTORLIKE);
+ lv->next.vector = large_vectors;
+ large_vectors = lv;
+ p = &lv->v;
}
#ifdef DOUG_LEA_MALLOC
/* Allocate other vector-like structures. */
struct Lisp_Vector *
-allocate_pseudovector (int memlen, int lisplen, int tag)
+allocate_pseudovector (int memlen, int lisplen, enum pvec_type tag)
{
struct Lisp_Vector *v = allocate_vectorlike (memlen);
int i;
+ /* Catch bogus values. */
+ eassert (tag <= PVEC_FONT);
+ eassert (memlen - lisplen <= (1 << PSEUDOVECTOR_REST_BITS) - 1);
+ eassert (lisplen <= (1 << PSEUDOVECTOR_SIZE_BITS) - 1);
+
/* Only the first lisplen slots will be traced normally by the GC. */
for (i = 0; i < lisplen; ++i)
v->contents[i] = Qnil;
- XSETPVECTYPESIZE (v, tag, lisplen);
+ XSETPVECTYPESIZE (v, tag, lisplen, memlen - lisplen);
return v;
}
{
struct buffer *b = lisp_malloc (sizeof *b, MEM_TYPE_BUFFER);
- XSETPVECTYPESIZE (b, PVEC_BUFFER, (offsetof (struct buffer, own_text)
- - header_size) / word_size);
+ BUFFER_PVEC_INIT (b);
/* Put B on the chain of all buffers including killed ones. */
- b->header.next.buffer = all_buffers;
+ b->next = all_buffers;
all_buffers = b;
/* Note that the rest fields of B are not initialized. */
return b;
DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0,
doc: /* Return a newly allocated uninterned symbol whose name is NAME.
-Its value and function definition are void, and its property list is nil. */)
+Its value is void, and its function definition and property list are nil. */)
(Lisp_Object name)
{
register Lisp_Object val;
set_symbol_plist (val, Qnil);
p->redirect = SYMBOL_PLAINVAL;
SET_SYMBOL_VAL (p, Qunbound);
- set_symbol_function (val, Qunbound);
+ set_symbol_function (val, Qnil);
set_symbol_next (val, NULL);
p->gcmarkbit = 0;
p->interned = SYMBOL_UNINTERNED;
return val;
}
+/* Free a Lisp_Misc_Save_Value object. */
+
+void
+free_save_value (Lisp_Object save)
+{
+ register struct Lisp_Save_Value *p = XSAVE_VALUE (save);
+
+ p->dogc = 0;
+ xfree (p->pointer);
+ p->pointer = NULL;
+ free_misc (save);
+}
+
/* Return a Lisp_Misc_Overlay object with specified START, END and PLIST. */
Lisp_Object
while (VECTOR_IN_BLOCK (vector, block)
&& vector <= (struct Lisp_Vector *) p)
{
- if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FREE))
- vector = ADVANCE (vector, (vector->header.size
- & PSEUDOVECTOR_SIZE_MASK));
- else if (vector == p)
+ if (!PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FREE) && vector == p)
return 1;
else
- vector = ADVANCE (vector, vector->header.next.nbytes);
+ vector = ADVANCE (vector, vector_nbytes (vector));
}
}
- else if (m->type == MEM_TYPE_VECTORLIKE && p == m->start)
+ else if (m->type == MEM_TYPE_VECTORLIKE
+ && (char *) p == ((char *) m->start
+ + offsetof (struct large_vector, v)))
/* This memory node corresponds to a large vector. */
return 1;
return 0;
#endif
}
-/* Return 2 if OBJ is a killed or special buffer object.
- Return 1 if OBJ is a valid lisp object.
- Return 0 if OBJ is NOT a valid lisp object.
- Return -1 if we cannot validate OBJ.
- This function can be quite slow,
- so it should only be used in code for manual debugging. */
+/* Return 2 if OBJ is a killed or special buffer object, 1 if OBJ is a
+ valid lisp object, 0 if OBJ is NOT a valid lisp object, or -1 if we
+ cannot validate OBJ. This function can be quite slow, so its primary
+ use is the manual debugging. The only exception is print_object, where
+ we use it to check whether the memory referenced by the pointer of
+ Lisp_Save_Value object contains valid objects. */
int
valid_lisp_object_p (Lisp_Object obj)
dump_zombies ();
#endif
- unblock_input ();
-
check_cons_list ();
gc_in_progress = 0;
+ unblock_input ();
+
consing_since_gc = 0;
if (gc_cons_threshold < GC_DEFAULT_THRESHOLD / 10)
gc_cons_threshold = GC_DEFAULT_THRESHOLD / 10;
if (ptr->header.size & PSEUDOVECTOR_FLAG)
pvectype = ((ptr->header.size & PVEC_TYPE_MASK)
- >> PSEUDOVECTOR_SIZE_BITS);
+ >> PSEUDOVECTOR_AREA_BITS);
else
pvectype = PVEC_NORMAL_VECTOR;
struct Lisp_Hash_Table *h = (struct Lisp_Hash_Table *) ptr;
mark_vectorlike (ptr);
+ mark_object (h->test.name);
+ mark_object (h->test.user_hash_function);
+ mark_object (h->test.user_cmp_function);
/* If hash table is not weak, mark all keys and values.
For weak tables, mark only the vector. */
if (NILP (h->weak))
for (buffer = all_buffers; buffer; buffer = *bprev)
if (!VECTOR_MARKED_P (buffer))
{
- *bprev = buffer->header.next.buffer;
+ *bprev = buffer->next;
lisp_free (buffer);
}
else
/* Do not use buffer_(set|get)_intervals here. */
buffer->text->intervals = balance_intervals (buffer->text->intervals);
total_buffers++;
- bprev = &buffer->header.next.buffer;
+ bprev = &buffer->next;
}
}
Lisp_Object framelist, prevlist, tail;
Lisp_Object args[3];
- CHECK_FRAME (frame);
framelist = Fcopy_sequence (XFRAME (frame)->buffer_list);
prevlist = Fnreverse (Fcopy_sequence
(XFRAME (frame)->buried_buffer_list));
b->base_buffer = NULL;
/* No one shares the text with us now. */
b->indirections = 0;
+ /* No one shows us now. */
+ b->window_count = 0;
BUF_GAP_SIZE (b) = 20;
block_input ();
BUF_CHARS_MODIFF (b) = 1;
BUF_OVERLAY_MODIFF (b) = 1;
BUF_SAVE_MODIFF (b) = 1;
+ BUF_COMPACT (b) = 1;
set_buffer_intervals (b, NULL);
BUF_UNCHANGED_MODIFIED (b) = 1;
BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1;
b->indirections = -1;
/* Notify base buffer that we share the text now. */
b->base_buffer->indirections++;
+ /* Always -1 for an indirect buffer. */
+ b->window_count = -1;
b->pt = b->base_buffer->pt;
b->begv = b->base_buffer->begv;
A non-nil FLAG means mark the buffer modified. */)
(Lisp_Object flag)
{
- Lisp_Object fn, buffer, window;
+ Lisp_Object fn;
#ifdef CLASH_DETECTION
/* If buffer becoming modified, lock the file.
Ideally, I think there should be another mechanism for fontifying
buffers without "modifying" buffers, or redisplay should be
smarter about updating the `*' in mode lines. --gerd */
- XSETBUFFER (buffer, current_buffer);
- window = Fget_buffer_window (buffer, Qt);
- if (WINDOWP (window))
+ if (buffer_window_count (current_buffer))
{
++update_mode_lines;
current_buffer->prevent_redisplay_optimizations_p = 1;
return BVAR (current_buffer, name);
}
+/* True if B can be used as 'other-than-BUFFER' buffer. */
+
+static bool
+candidate_buffer (Lisp_Object b, Lisp_Object buffer)
+{
+ return (BUFFERP (b) && !EQ (b, buffer)
+ && BUFFER_LIVE_P (XBUFFER (b))
+ && !BUFFER_HIDDEN_P (XBUFFER (b)));
+}
+
DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0,
doc: /* Return most recently selected buffer other than BUFFER.
Buffers not visible in windows are preferred to visible buffers, unless
exists, return the buffer `*scratch*' (creating it if necessary). */)
(register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame)
{
- Lisp_Object tail, buf, pred;
- Lisp_Object notsogood = Qnil;
-
- if (NILP (frame))
- frame = selected_frame;
+ struct frame *f = decode_any_frame (frame);
+ Lisp_Object tail = f->buffer_list, pred = f->buffer_predicate;
+ Lisp_Object buf, notsogood = Qnil;
- CHECK_FRAME (frame);
-
- pred = frame_buffer_predicate (frame);
/* Consider buffers that have been seen in the frame first. */
- tail = XFRAME (frame)->buffer_list;
for (; CONSP (tail); tail = XCDR (tail))
{
buf = XCAR (tail);
- if (BUFFERP (buf) && !EQ (buf, buffer)
- && BUFFER_LIVE_P (XBUFFER (buf))
- && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')
+ if (candidate_buffer (buf, buffer)
/* If the frame has a buffer_predicate, disregard buffers that
don't fit the predicate. */
&& (NILP (pred) || !NILP (call1 (pred, buf))))
for (; CONSP (tail); tail = XCDR (tail))
{
buf = Fcdr (XCAR (tail));
- if (BUFFERP (buf) && !EQ (buf, buffer)
- && BUFFER_LIVE_P (XBUFFER (buf))
- && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')
+ if (candidate_buffer (buf, buffer)
/* If the frame has a buffer_predicate, disregard buffers that
don't fit the predicate. */
&& (NILP (pred) || !NILP (call1 (pred, buf))))
{
Lisp_Object tail, buf;
- tail = Vbuffer_alist;
- for (; CONSP (tail); tail = XCDR (tail))
+ for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
buf = Fcdr (XCAR (tail));
- if (BUFFERP (buf) && !EQ (buf, buffer)
- && BUFFER_LIVE_P (XBUFFER (buf))
- && (SREF (BVAR (XBUFFER (buf), name), 0) != ' '))
+ if (candidate_buffer (buf, buffer))
return buf;
}
which aren't changed since last compaction. */
if (BUFFER_LIVE_P (buffer)
&& (buffer->base_buffer == NULL)
- && (buffer->text->compact != buffer->text->modiff))
+ && (BUF_COMPACT (buffer) != BUF_MODIFF (buffer)))
{
/* If a buffer's undo list is Qt, that means that undo is
turned off in that buffer. Calling truncate_undo_list on
current_buffer = save_current;
}
}
- buffer->text->compact = buffer->text->modiff;
+ BUF_COMPACT (buffer) = BUF_MODIFF (buffer);
}
}
eassert (b->indirections == -1);
b->base_buffer->indirections--;
eassert (b->base_buffer->indirections >= 0);
+ /* Make sure that we wasn't confused. */
+ eassert (b->window_count == -1);
}
else
- /* No one shares our buffer text, can free it. */
- free_buffer_text (b);
+ {
+ /* Make sure that no one shows us. */
+ eassert (b->window_count == 0);
+ /* No one shares our buffer text, can free it. */
+ free_buffer_text (b);
+ }
if (b->newline_cache)
{
return;
BUFFER_CHECK_INDIRECTION (b);
-
+
old_buf = current_buffer;
current_buffer = b;
last_known_column_point = -1; /* invalidate indentation cache */
UNGCPRO;
- /* Changing the multibyteness of a buffer means that all windows
- showing that buffer must be updated thoroughly. */
current_buffer->prevent_redisplay_optimizations_p = 1;
- ++windows_or_buffers_changed;
+
+ /* If buffer is shown in a window, let redisplay consider other windows. */
+ if (buffer_window_count (current_buffer))
+ ++windows_or_buffers_changed;
/* Copy this buffer's new multibyte status
into all of its indirect buffers. */
between "equal" overlays. The result can still change between
invocations of Emacs, but it won't change in the middle of
`find_field' (bug#6830). */
- if (XHASH (s1->overlay) != XHASH (s2->overlay))
- return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1;
+ if (!EQ (s1->overlay, s2->overlay))
+ return XLI (s1->overlay) < XLI (s2->overlay) ? -1 : 1;
return 0;
}
BUF_COMPUTE_UNCHANGED (buf, start, end);
- /* If this is a buffer not in the selected window,
- we must do other windows. */
- if (buf != XBUFFER (XWINDOW (selected_window)->buffer))
- windows_or_buffers_changed = 1;
- /* If multiple windows show this buffer, we must do other windows. */
- else if (buffer_shared > 1)
- windows_or_buffers_changed = 1;
- /* If we modify an overlay at the end of the buffer, we cannot
- be sure that window end is still valid. */
- else if (end >= ZV && start <= ZV)
- windows_or_buffers_changed = 1;
+ /* If BUF is visible, consider updating the display if ... */
+ if (buffer_window_count (buf) > 0)
+ {
+ /* ... it's visible in other window than selected, */
+ if (buf != XBUFFER (XWINDOW (selected_window)->buffer))
+ windows_or_buffers_changed = 1;
+ /* ... or if we modify an overlay at the end of the buffer
+ and so we cannot be sure that window end is still valid. */
+ else if (end >= ZV && start <= ZV)
+ windows_or_buffers_changed = 1;
+ }
++BUF_OVERLAY_MODIFF (buf);
}
init_buffer_once (void)
{
int idx;
- /* If you add, remove, or reorder Lisp_Objects in a struct buffer, make
- sure that this is still correct. Otherwise, mark_vectorlike may not
- trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */
- const int pvecsize
- = (offsetof (struct buffer, own_text) - header_size) / word_size;
memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags);
/* No one will share the text with these buffers, but let's play it safe. */
buffer_defaults.indirections = 0;
buffer_local_symbols.indirections = 0;
+ /* Likewise no one will display them. */
+ buffer_defaults.window_count = 0;
+ buffer_local_symbols.window_count = 0;
set_buffer_intervals (&buffer_defaults, NULL);
set_buffer_intervals (&buffer_local_symbols, NULL);
/* This is not strictly necessary, but let's make them initialized. */
bset_name (&buffer_defaults, build_pure_c_string (" *buffer-defaults*"));
bset_name (&buffer_local_symbols, build_pure_c_string (" *buffer-local-symbols*"));
- XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize);
- XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize);
+ BUFFER_PVEC_INIT (&buffer_defaults);
+ BUFFER_PVEC_INIT (&buffer_local_symbols);
/* Set up the default values of various buffer slots. */
/* Must do these before making the first buffer! */
doc: /* Cursor to use when this buffer is in the selected window.
Values are interpreted as follows:
- t use the cursor specified for the frame
- nil don't display a cursor
- box display a filled box cursor
- hollow display a hollow box cursor
- bar display a vertical bar cursor with default width
- (bar . WIDTH) display a vertical bar cursor with width WIDTH
- hbar display a horizontal bar cursor with default height
+ t use the cursor specified for the frame
+ nil don't display a cursor
+ box display a filled box cursor
+ hollow display a hollow box cursor
+ bar display a vertical bar cursor with default width
+ (bar . WIDTH) display a vertical bar cursor with width WIDTH
+ hbar display a horizontal bar cursor with default height
(hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT
- ANYTHING ELSE display a hollow box cursor
+ ANYTHING ELSE display a hollow box cursor
When the buffer is displayed in a non-selected window, the
cursor's appearance is instead controlled by the variable
/* FIXME: should we move this into ->text->auto_save_modiff? */
#define BUF_AUTOSAVE_MODIFF(buf) ((buf)->auto_save_modified)
+/* Compaction count. */
+#define BUF_COMPACT(buf) ((buf)->text->compact)
+
/* Marker chain of buffer. */
#define BUF_MARKERS(buf) ((buf)->text->markers)
struct buffer
{
- /* HEADER.NEXT is the next buffer, in chain of all buffers, including killed
- buffers. This chain, starting from all_buffers, is used only for garbage
- collection, in order to collect killed buffers properly. Note that large
- vectors and large pseudo-vector objects are all on another chain starting
- from large_vectors. */
struct vectorlike_header header;
/* The name of this buffer. */
In an indirect buffer, this is the own_text field of another buffer. */
struct buffer_text *text;
+ /* Next buffer, in chain of all buffers, including killed ones. */
+ struct buffer *next;
+
/* Char position of point in buffer. */
ptrdiff_t pt;
In an ordinary buffer, it is 0. */
struct buffer *base_buffer;
- /* In an indirect buffer, this is -1. In an ordinary buffer,
+ /* In an indirect buffer, this is -1. In an ordinary buffer,
it's the number of indirect buffers that share our text;
zero means that we're the only owner of this text. */
int indirections;
+ /* Number of windows showing this buffer. Always -1 for
+ an indirect buffer since it counts as its base buffer. */
+ int window_count;
+
/* A non-zero value in slot IDX means that per-buffer variable
with index IDX has a local value in this buffer. The index IDX
for a buffer-local variable is stored in that variable's slot
b->INTERNAL_FIELD (width_table) = val;
}
+/* Number of Lisp_Objects at the beginning of struct buffer.
+ If you add, remove, or reorder Lisp_Objects within buffer
+ structure, make sure that this is still correct. */
+
+#define BUFFER_LISP_SIZE \
+ ((offsetof (struct buffer, own_text) - header_size) / word_size)
+
+/* Size of the struct buffer part beyond leading Lisp_Objects, in word_size
+ units. Rounding is needed for --with-wide-int configuration. */
+
+#define BUFFER_REST_SIZE \
+ ((((sizeof (struct buffer) - offsetof (struct buffer, own_text)) \
+ + (word_size - 1)) & ~(word_size - 1)) / word_size)
+
+/* Initialize the pseudovector header of buffer object. BUFFER_LISP_SIZE
+ is required for GC, but BUFFER_REST_SIZE is set up just to be consistent
+ with other pseudovectors. */
+
+#define BUFFER_PVEC_INIT(b) \
+ XSETPVECTYPESIZE (b, PVEC_BUFFER, BUFFER_LISP_SIZE, BUFFER_REST_SIZE)
+
/* Convenient check whether buffer B is live. */
#define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name)))
+/* Convenient check whether buffer B is hidden (i.e. its name
+ starts with a space). Caller must ensure that B is live. */
+
+#define BUFFER_HIDDEN_P(b) (SREF (BVAR (b, name), 0) == ' ')
+
/* Verify indirection counters. */
#define BUFFER_CHECK_INDIRECTION(b) \
/* Used to iterate over the chain above. */
#define FOR_EACH_BUFFER(b) \
- for ((b) = all_buffers; (b); (b) = (b)->header.next.buffer)
+ for ((b) = all_buffers; (b); (b) = (b)->next)
/* This points to the current buffer. */
+ pos + BUF_BEG_ADDR (buf) - BEG_BYTE);
return STRING_CHAR (p);
}
-\f
+
+/* Return number of windows showing B. */
+
+BUFFER_INLINE int
+buffer_window_count (struct buffer *b)
+{
+ if (b->base_buffer)
+ b = b->base_buffer;
+ eassert (b->window_count >= 0);
+ return b->window_count;
+}
+
/* Overlays */
/* Return the marker that stands for where OV starts in the buffer. */
#endif /* BYTE_CODE_METER */
\f
-Lisp_Object Qbytecode;
-
/* Byte codes: */
#define BYTE_CODES \
NEXT;
CASE (Binteractive_p): /* Obsolete since 24.1. */
- PUSH (Finteractive_p ());
+ BEFORE_POTENTIAL_GC ();
+ PUSH (call0 (intern ("interactive-p")));
+ AFTER_POTENTIAL_GC ();
NEXT;
CASE (Bforward_char):
void
syms_of_bytecode (void)
{
- DEFSYM (Qbytecode, "byte-code");
-
defsubr (&Sbyte_code);
#ifdef BYTE_CODE_METER
/* Pattern used by call-process-region to make temp files. */
static Lisp_Object Vtemp_file_name_pattern;
-/* True if we are about to fork off a synchronous process or if we
- are waiting for it. */
-bool synch_process_alive;
+/* The next two variables are valid only while record-unwind-protect
+ is in place during call-process for a synchronous subprocess. At
+ other times, their contents are irrelevant. Doing this via static
+ C variables is more convenient than putting them into the arguments
+ of record-unwind-protect, as they need to be updated at randomish
+ times in the code, and Lisp cannot always store these values as
+ Emacs integers. It's safe to use static variables here, as the
+ code is never invoked reentrantly. */
+
+/* If nonzero, a process-ID that has not been reaped. */
+static pid_t synch_process_pid;
+
+/* If nonnegative, a file descriptor that has not been closed. */
+static int synch_process_fd;
+\f
+/* Block SIGCHLD. */
-/* Nonzero => this is a string explaining death of synchronous subprocess. */
-const char *synch_process_death;
+static void
+block_child_signal (void)
+{
+ sigset_t blocked;
+ sigemptyset (&blocked);
+ sigaddset (&blocked, SIGCHLD);
+ pthread_sigmask (SIG_BLOCK, &blocked, 0);
+}
-/* Nonzero => this is the signal number that terminated the subprocess. */
-int synch_process_termsig;
+/* Unblock SIGCHLD. */
-/* If synch_process_death is zero,
- this is exit code of synchronous subprocess. */
-int synch_process_retcode;
+static void
+unblock_child_signal (void)
+{
+ pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
+}
-\f
-/* Clean up when exiting Fcall_process.
- On MSDOS, delete the temporary file on any kind of termination.
- On Unix, kill the process and any children on termination by signal. */
+/* If P is reapable, record it as a deleted process and kill it.
+ Do this in a critical section. Unless PID is wedged it will be
+ reaped on receipt of the first SIGCHLD after the critical section. */
+
+void
+record_kill_process (struct Lisp_Process *p)
+{
+ block_child_signal ();
+
+ if (p->alive)
+ {
+ p->alive = 0;
+ record_deleted_pid (p->pid);
+ kill (- p->pid, SIGKILL);
+ }
+
+ unblock_child_signal ();
+}
-/* True if this is termination due to exit. */
-static bool call_process_exited;
+/* Clean up when exiting call_process_cleanup. */
static Lisp_Object
-call_process_kill (Lisp_Object fdpid)
+call_process_kill (Lisp_Object ignored)
{
- int fd;
- pid_t pid;
- CONS_TO_INTEGER (Fcar (fdpid), int, fd);
- CONS_TO_INTEGER (Fcdr (fdpid), pid_t, pid);
- emacs_close (fd);
- EMACS_KILLPG (pid, SIGKILL);
- synch_process_alive = 0;
+ if (0 <= synch_process_fd)
+ emacs_close (synch_process_fd);
+
+ if (synch_process_pid)
+ {
+ struct Lisp_Process proc;
+ proc.alive = 1;
+ proc.pid = synch_process_pid;
+ record_kill_process (&proc);
+ }
+
return Qnil;
}
+/* Clean up when exiting Fcall_process.
+ On MSDOS, delete the temporary file on any kind of termination.
+ On Unix, kill the process and any children on termination by signal. */
+
static Lisp_Object
call_process_cleanup (Lisp_Object arg)
{
- Lisp_Object fdpid = Fcdr (arg);
- int fd;
-#if defined (MSDOS)
- Lisp_Object file;
+#ifdef MSDOS
+ Lisp_Object buffer = Fcar (arg);
+ Lisp_Object file = Fcdr (arg);
#else
- pid_t pid;
+ Lisp_Object buffer = arg;
#endif
- Fset_buffer (Fcar (arg));
- CONS_TO_INTEGER (Fcar (fdpid), int, fd);
+ Fset_buffer (buffer);
-#if defined (MSDOS)
- /* for MSDOS fdpid is really (fd . tempfile) */
- file = Fcdr (fdpid);
- /* FD is -1 and FILE is "" when we didn't actually create a
- temporary file in call-process. */
- if (fd >= 0)
- emacs_close (fd);
- if (!(strcmp (SDATA (file), NULL_DEVICE) == 0 || SREF (file, 0) == '\0'))
- unlink (SDATA (file));
-#else /* not MSDOS */
- CONS_TO_INTEGER (Fcdr (fdpid), pid_t, pid);
-
- if (call_process_exited)
- {
- emacs_close (fd);
- return Qnil;
- }
-
- if (EMACS_KILLPG (pid, SIGINT) == 0)
+#ifndef MSDOS
+ /* If the process still exists, kill its process group. */
+ if (synch_process_pid)
{
ptrdiff_t count = SPECPDL_INDEX ();
- record_unwind_protect (call_process_kill, fdpid);
+ kill (-synch_process_pid, SIGINT);
+ record_unwind_protect (call_process_kill, make_number (0));
message1 ("Waiting for process to die...(type C-g again to kill it instantly)");
immediate_quit = 1;
QUIT;
- wait_for_termination (pid);
+ wait_for_termination (synch_process_pid, 0, 1);
+ synch_process_pid = 0;
immediate_quit = 0;
specpdl_ptr = specpdl + count; /* Discard the unwind protect. */
message1 ("Waiting for process to die...done");
}
- synch_process_alive = 0;
- emacs_close (fd);
-#endif /* not MSDOS */
+#endif
+
+ if (0 <= synch_process_fd)
+ emacs_close (synch_process_fd);
+
+#ifdef MSDOS
+ /* FILE is "" when we didn't actually create a temporary file in
+ call-process. */
+ if (!(strcmp (SDATA (file), NULL_DEVICE) == 0 || SREF (file, 0) == '\0'))
+ unlink (SDATA (file));
+#endif
+
return Qnil;
}
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
- Lisp_Object infile, buffer, current_dir, path, cleanup_info_tail;
+ Lisp_Object infile, buffer, current_dir, path;
bool display_p;
- int fd[2];
- int filefd;
-#define CALLPROC_BUFFER_SIZE_MIN (16 * 1024)
-#define CALLPROC_BUFFER_SIZE_MAX (4 * CALLPROC_BUFFER_SIZE_MIN)
- char buf[CALLPROC_BUFFER_SIZE_MAX];
- int bufsize = CALLPROC_BUFFER_SIZE_MIN;
+ int fd0, fd1, filefd;
+ int status;
ptrdiff_t count = SPECPDL_INDEX ();
USE_SAFE_ALLOCA;
- register const unsigned char **new_argv;
+ char **new_argv;
/* File to use for stderr in the child.
t means use same as standard output. */
Lisp_Object error_file;
#else
pid_t pid;
#endif
+ int child_errno;
int fd_output = -1;
struct coding_system process_coding; /* coding-system of process output */
struct coding_system argument_coding; /* coding-system of arguments */
filefd = emacs_open (SSDATA (infile), O_RDONLY, 0);
if (filefd < 0)
- {
- infile = DECODE_FILE (infile);
- report_file_error ("Opening process input file", Fcons (infile, Qnil));
- }
+ report_file_error ("Opening process input file",
+ Fcons (DECODE_FILE (infile), Qnil));
if (STRINGP (output_file))
{
}
UNGCPRO;
for (i = 4; i < nargs; i++)
- new_argv[i - 3] = SDATA (args[i]);
+ new_argv[i - 3] = SSDATA (args[i]);
new_argv[i - 3] = 0;
}
else
new_argv[1] = 0;
- new_argv[0] = SDATA (path);
+ new_argv[0] = SSDATA (path);
#ifdef MSDOS /* MW, July 1993 */
}
else
outfilefd = fd_output;
- fd[0] = filefd;
- fd[1] = outfilefd;
+ fd0 = filefd;
+ fd1 = outfilefd;
#endif /* MSDOS */
if (INTEGERP (buffer))
- fd[1] = emacs_open (NULL_DEVICE, O_WRONLY, 0), fd[0] = -1;
+ {
+ fd0 = -1;
+ fd1 = emacs_open (NULL_DEVICE, O_WRONLY, 0);
+ }
else
{
#ifndef MSDOS
- errno = 0;
+ int fd[2];
if (pipe (fd) == -1)
{
+ int pipe_errno = errno;
emacs_close (filefd);
+ errno = pipe_errno;
report_file_error ("Creating process pipe", Qnil);
}
+ fd0 = fd[0];
+ fd1 = fd[1];
#endif
}
{
- /* child_setup must clobber environ in systems with true vfork.
- Protect it from permanent change. */
- register char **save_environ = environ;
- register int fd1 = fd[1];
int fd_error = fd1;
if (fd_output >= 0)
fd1 = fd_output;
- /* Record that we're about to create a synchronous process. */
- synch_process_alive = 1;
-
- /* These vars record information from process termination.
- Clear them now before process can possibly terminate,
- to avoid timing error if process terminates soon. */
- synch_process_death = 0;
- synch_process_retcode = 0;
- synch_process_termsig = 0;
-
if (NILP (error_file))
fd_error = emacs_open (NULL_DEVICE, O_WRONLY, 0);
else if (STRINGP (error_file))
if (fd_error < 0)
{
emacs_close (filefd);
- if (fd[0] != filefd)
- emacs_close (fd[0]);
+ if (fd0 != filefd)
+ emacs_close (fd0);
if (fd1 >= 0)
emacs_close (fd1);
#ifdef MSDOS
#ifdef MSDOS /* MW, July 1993 */
/* Note that on MSDOS `child_setup' actually returns the child process
- exit status, not its PID, so we assign it to `synch_process_retcode'
- below. */
- pid = child_setup (filefd, outfilefd, fd_error, (char **) new_argv,
- 0, current_dir);
-
- /* Record that the synchronous process exited and note its
- termination status. */
- synch_process_alive = 0;
- synch_process_retcode = pid;
- if (synch_process_retcode < 0) /* means it couldn't be exec'ed */
- {
- synchronize_system_messages_locale ();
- synch_process_death = strerror (errno);
- }
+ exit status, not its PID, so assign it to status below. */
+ pid = child_setup (filefd, outfilefd, fd_error, new_argv, 0, current_dir);
+ child_errno = errno;
emacs_close (outfilefd);
if (fd_error != outfilefd)
emacs_close (fd_error);
+ if (pid < 0)
+ {
+ synchronize_system_messages_locale ();
+ return
+ code_convert_string_norecord (build_string (strerror (child_errno)),
+ Vlocale_coding_system, 0);
+ }
+ status = pid;
fd1 = -1; /* No harm in closing that one! */
if (tempfile)
{
/* Since CRLF is converted to LF within `decode_coding', we
can always open a file with binary mode. */
- fd[0] = emacs_open (tempfile, O_RDONLY | O_BINARY, 0);
- if (fd[0] < 0)
+ fd0 = emacs_open (tempfile, O_RDONLY | O_BINARY, 0);
+ if (fd0 < 0)
{
unlink (tempfile);
emacs_close (filefd);
}
}
else
- fd[0] = -1; /* We are not going to read from tempfile. */
-#else /* not MSDOS */
-#ifdef WINDOWSNT
- pid = child_setup (filefd, fd1, fd_error, (char **) new_argv,
- 0, current_dir);
-#else /* not WINDOWSNT */
+ fd0 = -1; /* We are not going to read from tempfile. */
+#endif /* MSDOS */
+
+ /* Do the unwind-protect now, even though the pid is not known, so
+ that no storage allocation is done in the critical section.
+ The actual PID will be filled in during the critical section. */
+ synch_process_pid = 0;
+ synch_process_fd = fd0;
+
+#ifdef MSDOS
+ /* MSDOS needs different cleanup information. */
+ record_unwind_protect (call_process_cleanup,
+ Fcons (Fcurrent_buffer (),
+ build_string (tempfile ? tempfile : "")));
+#else
+ record_unwind_protect (call_process_cleanup, Fcurrent_buffer ());
block_input ();
+ block_child_signal ();
+
+#ifdef WINDOWSNT
+ pid = child_setup (filefd, fd1, fd_error, new_argv, 0, current_dir);
+ /* We need to record the input file of this child, for when we are
+ called from call-process-region to create an async subprocess.
+ That's because call-process-region's unwind procedure will
+ attempt to delete the temporary input file, which will fail
+ because that file is still in use. Recording it with the child
+ will allow us to delete the file when the subprocess exits.
+ The second part of this is in delete_temp_file, q.v. */
+ if (pid > 0 && INTEGERP (buffer) && nargs >= 2 && !NILP (args[1]))
+ record_infile (pid, xstrdup (SSDATA (infile)));
+#else /* not WINDOWSNT */
/* vfork, and prevent local vars from being clobbered by the vfork. */
{
int volatile fd1_volatile = fd1;
int volatile fd_error_volatile = fd_error;
int volatile fd_output_volatile = fd_output;
+ int volatile filefd_volatile = filefd;
+ ptrdiff_t volatile count_volatile = count;
ptrdiff_t volatile sa_count_volatile = sa_count;
- unsigned char const **volatile new_argv_volatile = new_argv;
+ char **volatile new_argv_volatile = new_argv;
pid = vfork ();
+ child_errno = errno;
buffer = buffer_volatile;
coding_systems = coding_systems_volatile;
current_dir = current_dir_volatile;
display_p = display_p_volatile;
+ output_to_buffer = output_to_buffer_volatile;
+ sa_must_free = sa_must_free_volatile;
fd1 = fd1_volatile;
fd_error = fd_error_volatile;
fd_output = fd_output_volatile;
- output_to_buffer = output_to_buffer_volatile;
- sa_must_free = sa_must_free_volatile;
+ filefd = filefd_volatile;
+ count = count_volatile;
sa_count = sa_count_volatile;
new_argv = new_argv_volatile;
+
+ fd0 = synch_process_fd;
}
if (pid == 0)
{
- if (fd[0] >= 0)
- emacs_close (fd[0]);
+ unblock_child_signal ();
+
+ if (fd0 >= 0)
+ emacs_close (fd0);
-#ifdef HAVE_SETSID
setsid ();
-#else
- setpgid (0, 0);
-#endif
/* Emacs ignores SIGPIPE, but the child should not. */
signal (SIGPIPE, SIG_DFL);
- child_setup (filefd, fd1, fd_error, (char **) new_argv,
- 0, current_dir);
+ child_setup (filefd, fd1, fd_error, new_argv, 0, current_dir);
}
- unblock_input ();
-
#endif /* not WINDOWSNT */
+ child_errno = errno;
+
+ if (0 < pid)
+ {
+ if (INTEGERP (buffer))
+ record_deleted_pid (pid);
+ else
+ synch_process_pid = pid;
+ }
+
+ unblock_child_signal ();
+ unblock_input ();
+
/* The MSDOS case did this already. */
if (fd_error >= 0)
emacs_close (fd_error);
#endif /* not MSDOS */
- environ = save_environ;
-
- /* Close most of our fd's, but not fd[0]
+ /* Close most of our file descriptors, but not fd0
since we will use that to read input from. */
emacs_close (filefd);
if (fd_output >= 0)
if (pid < 0)
{
- if (fd[0] >= 0)
- emacs_close (fd[0]);
+ errno = child_errno;
report_file_error ("Doing vfork", Qnil);
}
if (INTEGERP (buffer))
- {
- if (fd[0] >= 0)
- emacs_close (fd[0]);
- return Qnil;
- }
-
- /* Enable sending signal if user quits below. */
- call_process_exited = 0;
-
-#if defined (MSDOS)
- /* MSDOS needs different cleanup information. */
- cleanup_info_tail = build_string (tempfile ? tempfile : "");
-#else
- cleanup_info_tail = INTEGER_TO_CONS (pid);
-#endif /* not MSDOS */
- record_unwind_protect (call_process_cleanup,
- Fcons (Fcurrent_buffer (),
- Fcons (INTEGER_TO_CONS (fd[0]),
- cleanup_info_tail)));
+ return unbind_to (count, Qnil);
if (BUFFERP (buffer))
Fset_buffer (buffer);
if (output_to_buffer)
{
+ enum { CALLPROC_BUFFER_SIZE_MIN = 16 * 1024 };
+ enum { CALLPROC_BUFFER_SIZE_MAX = 4 * CALLPROC_BUFFER_SIZE_MIN };
+ char buf[CALLPROC_BUFFER_SIZE_MAX];
+ int bufsize = CALLPROC_BUFFER_SIZE_MIN;
int nread;
bool first = 1;
EMACS_INT total_read = 0;
nread = carryover;
while (nread < bufsize - 1024)
{
- int this_read = emacs_read (fd[0], buf + nread,
+ int this_read = emacs_read (fd0, buf + nread,
bufsize - nread);
if (this_read < 0)
#ifndef MSDOS
/* Wait for it to terminate, unless it already has. */
- if (output_to_buffer)
- wait_for_termination (pid);
- else
- interruptible_wait_for_termination (pid);
+ wait_for_termination (pid, &status, !output_to_buffer);
#endif
immediate_quit = 0;
/* Don't kill any children that the subprocess may have left behind
when exiting. */
- call_process_exited = 1;
+ synch_process_pid = 0;
SAFE_FREE ();
unbind_to (count, Qnil);
- if (synch_process_termsig)
+ if (WIFSIGNALED (status))
{
const char *signame;
synchronize_system_messages_locale ();
- signame = strsignal (synch_process_termsig);
+ signame = strsignal (WTERMSIG (status));
if (signame == 0)
signame = "unknown";
- synch_process_death = signame;
+ return code_convert_string_norecord (build_string (signame),
+ Vlocale_coding_system, 0);
}
- if (synch_process_death)
- return code_convert_string_norecord (build_string (synch_process_death),
- Vlocale_coding_system, 0);
- return make_number (synch_process_retcode);
+ eassert (WIFEXITED (status));
+ return make_number (WEXITSTATUS (status));
}
\f
static Lisp_Object
/* Suppress jka-compr handling, etc. */
ptrdiff_t count = SPECPDL_INDEX ();
specbind (intern ("file-name-handler-alist"), Qnil);
+#ifdef WINDOWSNT
+ /* If this is called when the subprocess didn't exit yet, the
+ attempt to delete its input file will fail. In that case, we
+ schedule the file for deletion when the subprocess exits. This
+ is the 2nd part of handling this situation; see the call to
+ record_infile in call-process above, for the first part. */
+ if (!internal_delete_file (name))
+ {
+ Lisp_Object encoded_file = ENCODE_FILE (name);
+
+ record_pending_deletion (SSDATA (encoded_file));
+ }
+#else
internal_delete_file (name);
+#endif
unbind_to (count, Qnil);
return Qnil;
}
Initialize inferior's priority, pgrp, connected dir and environment.
then exec another program based on new_argv.
- This function may change environ for the superior process.
- Therefore, the superior process must save and restore the value
- of environ around the vfork and the call to this function.
-
If SET_PGRP, put the subprocess into a separate process group.
CURRENT_DIR is an elisp string giving the path of the current
#ifdef WINDOWSNT
prepare_standard_handles (in, out, err, handles);
set_process_dir (SDATA (current_dir));
- /* Spawn the child. (See ntproc.c:Spawnve). */
+ /* Spawn the child. (See w32proc.c:sys_spawnve). */
cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
reset_standard_handles (in, out, err, handles);
if (cpid == -1)
if (err != in && err != out)
emacs_close (err);
-#if defined HAVE_SETPGID || ! (defined USG && defined SETPGRP_RELEASES_CTTY)
- setpgid (pid, pid);
-#endif
-
- /* setpgrp_of_tty is incorrect here; it uses input_fd. */
+ setpgid (0, 0);
tcsetpgrp (0, pid);
- /* execvp does not accept an environment arg so the only way
- to pass this environment is to set environ. Our caller
- is responsible for restoring the ambient value of environ. */
- environ = env;
- execvp (new_argv[0], new_argv);
+ execve (new_argv[0], new_argv, env);
emacs_write (1, "Can't exec program: ", 20);
emacs_write (1, new_argv[0], strlen (new_argv[0]));
return fd;
else
{
- int new;
-#ifdef F_DUPFD
- new = fcntl (fd, F_DUPFD, minfd);
-#else
- new = dup (fd);
- if (new != -1)
- /* Note that we hold the original FD open while we recurse,
- to guarantee we'll get a new FD if we need it. */
- new = relocate_fd (new, minfd);
-#endif
+ int new = fcntl (fd, F_DUPFD, minfd);
if (new == -1)
{
const char *message_1 = "Error while setting up child: ";
#endif
{
tempdir = Fdirectory_file_name (Vexec_directory);
- if (access (SSDATA (tempdir), 0) < 0)
- dir_warning ("Warning: arch-dependent data dir (%s) does not exist.\n",
- Vexec_directory);
+ if (! file_accessible_directory_p (SSDATA (tempdir)))
+ dir_warning ("arch-dependent data dir", Vexec_directory);
}
tempdir = Fdirectory_file_name (Vdata_directory);
- if (access (SSDATA (tempdir), 0) < 0)
- dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n",
- Vdata_directory);
+ if (! file_accessible_directory_p (SSDATA (tempdir)))
+ dir_warning ("arch-independent data dir", Vdata_directory);
sh = (char *) getenv ("SHELL");
Vshell_file_name = build_string (sh ? sh : "/bin/sh");
Vshared_game_score_directory = Qnil;
#else
Vshared_game_score_directory = build_string (PATH_GAME);
- if (NILP (Ffile_directory_p (Vshared_game_score_directory)))
+ if (NILP (Ffile_accessible_directory_p (Vshared_game_score_directory)))
Vshared_game_score_directory = Qnil;
#endif
}
validate_region (&b, &e);
start = XFASTINT (b);
end = XFASTINT (e);
- modify_region (current_buffer, start, end, 0);
+ modify_region_1 (start, end, false);
record_change (start, end - start);
start_byte = CHAR_TO_BYTE (start);
if (NILP (XCHAR_TABLE (table)->extras[1]))
set_char_table_extras
(table, 1,
- make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
+ make_hash_table (hashtest_equal, make_number (DEFAULT_HASH_SIZE),
make_float (DEFAULT_REHASH_SIZE),
make_float (DEFAULT_REHASH_THRESHOLD),
- Qnil, Qnil, Qnil));
+ Qnil));
h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
i = hash_lookup (h, category_set, &hash);
if (i >= 0)
example, the IDs are stuffed into struct
coding_system.charbuf[i] entries, which are 'int'. */
int old_size = charset_table_size;
+ ptrdiff_t new_size = old_size;
struct charset *new_table =
- xpalloc (0, &charset_table_size, 1,
+ xpalloc (0, &new_size, 1,
min (INT_MAX, MOST_POSITIVE_FIXNUM),
sizeof *charset_table);
memcpy (new_table, charset_table, old_size * sizeof *new_table);
charset_table = new_table;
+ charset_table_size = new_size;
/* FIXME: This leaks memory, as the old charset_table becomes
unreachable. If the old charset table is charset_table_init
then this leak is intentional; otherwise, it's unclear.
{
Lisp_Object tempdir;
tempdir = Fexpand_file_name (build_string ("charsets"), Vdata_directory);
- if (access (SSDATA (tempdir), 0) < 0)
+ if (! file_accessible_directory_p (SSDATA (tempdir)))
{
/* This used to be non-fatal (dir_warning), but it should not
happen, and if it does sooner or later it will cause some
static Lisp_Object Qcoding_system, Qeol_type;
static Lisp_Object Qcoding_aliases;
Lisp_Object Qunix, Qdos;
+static Lisp_Object Qmac;
Lisp_Object Qbuffer_file_coding_system;
static Lisp_Object Qpost_read_conversion, Qpre_write_conversion;
static Lisp_Object Qdefault_char;
ptrdiff_t from, to;
ptrdiff_t from_byte, to_byte;
- CHECK_NUMBER_COERCE_MARKER (start);
- CHECK_NUMBER_COERCE_MARKER (end);
-
validate_region (&start, &end);
from = XINT (start), to = XINT (end);
from_byte = CHAR_TO_BYTE (from);
ptrdiff_t from, from_byte, to, to_byte;
Lisp_Object src_object;
- CHECK_NUMBER_COERCE_MARKER (start);
- CHECK_NUMBER_COERCE_MARKER (end);
if (NILP (coding_system))
coding_system = Qno_conversion;
else
DEFSYM (Qeol_type, "eol-type");
DEFSYM (Qunix, "unix");
DEFSYM (Qdos, "dos");
+ DEFSYM (Qmac, "mac");
DEFSYM (Qbuffer_file_coding_system, "buffer-file-coding-system");
DEFSYM (Qpost_read_conversion, "post-read-conversion");
extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided;
extern Lisp_Object Qbuffer_file_coding_system;
-extern Lisp_Object Qunix, Qdos, Qmac;
+extern Lisp_Object Qunix, Qdos;
extern Lisp_Object Qtranslation_table;
extern Lisp_Object Qtranslation_table_id;
ptrdiff_t i;
header = LGSTRING_HEADER (gstring);
- hash = h->hashfn (h, header);
+ hash = h->test.hashfn (&h->test, header);
if (len < 0)
{
ptrdiff_t j, glyph_len = LGSTRING_GLYPH_LEN (gstring);
}
else
{
- /* automatic composition */
+ /* Automatic composition. */
Lisp_Object gstring = composition_gstring_from_id (cmp_it->id);
Lisp_Object glyph;
ptrdiff_t from;
#endif
#endif
+#ifndef __has_attribute
+# define __has_attribute(a) 0 /* non-clang */
+#endif
+
/* This silences a few compilation warnings on FreeBSD. */
#ifdef BSD_SYSTEM_AHB
#undef BSD_SYSTEM_AHB
#define emacs_raise(sig) msdos_fatal_signal (sig)
-#ifndef HAVE_SETPGID
-# ifdef USG
-# define setpgid(pid, pgid) setpgrp ()
-# else
-# define setpgid(pid, pgid) setpgrp (pid, pgid)
-# endif
-#endif
-
/* Define one of these for easier conditionals. */
#ifdef HAVE_X_WINDOWS
/* We need a little extra space, see ../../lisp/loadup.el and the
#endif
#endif
+/* Tell gnulib to omit support for openat-related functions having a
+ first argument other than AT_FDCWD. */
+#define GNULIB_SUPPORT_ONLY_AT_FDCWD
+
#include <string.h>
#include <stdlib.h>
#define NO_INLINE
#endif
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
+#if (__clang__ \
+ ? __has_attribute (externally_visible) \
+ : (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)))
#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
#else
#define EXTERNALLY_VISIBLE
static Lisp_Object Qdefun;
Lisp_Object Qinteractive_form;
+static Lisp_Object Qdefalias_fset_function;
static void swap_in_symval_forwarding (struct Lisp_Symbol *, struct Lisp_Buffer_Local_Value *);
}
\f
-/* Extract and set components of lists */
+/* Extract and set components of lists. */
DEFUN ("car", Fcar, Scar, 1, 1, 0,
doc: /* Return the car of LIST. If arg is nil, return nil.
return (EQ (valcontents, Qunbound) ? Qnil : Qt);
}
+/* FIXME: Make it an alias for function-symbol! */
DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
doc: /* Return t if SYMBOL's function definition is not void. */)
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- return EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt;
+ return NILP (XSYMBOL (symbol)->function) ? Qnil : Qt;
}
DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0,
}
DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0,
- doc: /* Make SYMBOL's function definition be void.
+ doc: /* Make SYMBOL's function definition be nil.
Return SYMBOL. */)
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
if (NILP (symbol) || EQ (symbol, Qt))
xsignal1 (Qsetting_constant, symbol);
- set_symbol_function (symbol, Qunbound);
+ set_symbol_function (symbol, Qnil);
return symbol;
}
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- if (!EQ (XSYMBOL (symbol)->function, Qunbound))
- return XSYMBOL (symbol)->function;
- xsignal1 (Qvoid_function, symbol);
+ return XSYMBOL (symbol)->function;
}
DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
(register Lisp_Object symbol, Lisp_Object definition)
{
register Lisp_Object function;
-
CHECK_SYMBOL (symbol);
- if (NILP (symbol) || EQ (symbol, Qt))
- xsignal1 (Qsetting_constant, symbol);
function = XSYMBOL (symbol)->function;
- if (!NILP (Vautoload_queue) && !EQ (function, Qunbound))
+ if (!NILP (Vautoload_queue) && !NILP (function))
Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
- if (CONSP (function) && EQ (XCAR (function), Qautoload))
+ if (AUTOLOADP (function))
Fput (symbol, Qautoload, XCDR (function));
set_symbol_function (symbol, definition);
- /* Handle automatic advice activation. */
- if (CONSP (XSYMBOL (symbol)->plist)
- && !NILP (Fget (symbol, Qad_advice_info)))
- {
- call2 (Qad_activate_internal, symbol, Qnil);
- definition = XSYMBOL (symbol)->function;
- }
+
return definition;
}
(register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
{
CHECK_SYMBOL (symbol);
- if (CONSP (XSYMBOL (symbol)->function)
- && EQ (XCAR (XSYMBOL (symbol)->function), Qautoload))
- LOADHIST_ATTACH (Fcons (Qt, symbol));
if (!NILP (Vpurify_flag)
/* If `definition' is a keymap, immutable (and copying) is wrong. */
&& !KEYMAPP (definition))
definition = Fpurecopy (definition);
- definition = Ffset (symbol, definition);
- LOADHIST_ATTACH (Fcons (Qdefun, symbol));
+
+ {
+ bool autoload = AUTOLOADP (definition);
+ if (NILP (Vpurify_flag) || !autoload)
+ { /* Only add autoload entries after dumping, because the ones before are
+ not useful and else we get loads of them from the loaddefs.el. */
+
+ if (AUTOLOADP (XSYMBOL (symbol)->function))
+ /* Remember that the function was already an autoload. */
+ LOADHIST_ATTACH (Fcons (Qt, symbol));
+ LOADHIST_ATTACH (Fcons (autoload ? Qautoload : Qdefun, symbol));
+ }
+ }
+
+ { /* Handle automatic advice activation. */
+ Lisp_Object hook = Fget (symbol, Qdefalias_fset_function);
+ if (!NILP (hook))
+ call2 (hook, symbol, definition);
+ else
+ Ffset (symbol, definition);
+ }
+
if (!NILP (docstring))
Fput (symbol, Qfunction_documentation, docstring);
/* We used to return `definition', but now that `defun' and `defmacro' expand
CHECK_SUBR (subr);
minargs = XSUBR (subr)->min_args;
maxargs = XSUBR (subr)->max_args;
- if (maxargs == MANY)
- return Fcons (make_number (minargs), Qmany);
- else if (maxargs == UNEVALLED)
- return Fcons (make_number (minargs), Qunevalled);
- else
- return Fcons (make_number (minargs), make_number (maxargs));
+ return Fcons (make_number (minargs),
+ maxargs == MANY ? Qmany
+ : maxargs == UNEVALLED ? Qunevalled
+ : make_number (maxargs));
}
DEFUN ("subr-name", Fsubr_name, Ssubr_name, 1, 1, 0,
{
Lisp_Object fun = indirect_function (cmd); /* Check cycles. */
- if (NILP (fun) || EQ (fun, Qunbound))
+ if (NILP (fun))
return Qnil;
/* Use an `interactive-form' property if present, analogous to the
- function-documentation property. */
+ function-documentation property. */
fun = cmd;
while (SYMBOLP (fun))
{
if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE)
return list2 (Qinteractive, AREF (fun, COMPILED_INTERACTIVE));
}
+ else if (AUTOLOADP (fun))
+ return Finteractive_form (Fautoload_do_load (fun, cmd, Qnil));
else if (CONSP (fun))
{
Lisp_Object funcar = XCAR (fun);
return Fassq (Qinteractive, Fcdr (Fcdr (XCDR (fun))));
else if (EQ (funcar, Qlambda))
return Fassq (Qinteractive, Fcdr (XCDR (fun)));
- else if (EQ (funcar, Qautoload))
- {
- struct gcpro gcpro1;
- GCPRO1 (cmd);
- Fautoload_do_load (fun, cmd, Qnil);
- UNGCPRO;
- return Finteractive_form (cmd);
- }
}
return Qnil;
}
for (;;)
{
- if (!SYMBOLP (hare) || EQ (hare, Qunbound))
+ if (!SYMBOLP (hare) || NILP (hare))
break;
hare = XSYMBOL (hare)->function;
- if (!SYMBOLP (hare) || EQ (hare, Qunbound))
+ if (!SYMBOLP (hare) || NILP (hare))
break;
hare = XSYMBOL (hare)->function;
/* Optimize for no indirection. */
result = object;
- if (SYMBOLP (result) && !EQ (result, Qunbound)
+ if (SYMBOLP (result) && !NILP (result)
&& (result = XSYMBOL (result)->function, SYMBOLP (result)))
result = indirect_function (result);
- if (!EQ (result, Qunbound))
+ if (!NILP (result))
return result;
if (NILP (noerror))
return arith_driver (Amult, nargs, args);
}
-DEFUN ("/", Fquo, Squo, 2, MANY, 0,
+DEFUN ("/", Fquo, Squo, 1, MANY, 0,
doc: /* Return first argument divided by all the remaining arguments.
The arguments must be numbers or markers.
-usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */)
+usage: (/ DIVIDEND &rest DIVISORS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
ptrdiff_t argnum;
DEFSYM (Qfont_object, "font-object");
DEFSYM (Qinteractive_form, "interactive-form");
+ DEFSYM (Qdefalias_fset_function, "defalias-fset-function");
defsubr (&Sindirect_variable);
defsubr (&Sinteractive_form);
xd_registered_buses = Fcons (Fcons (bus, val), xd_registered_buses);
/* We do not want to abort. */
- putenv ((char *) "DBUS_FATAL_WARNINGS=0");
+ xputenv ("DBUS_FATAL_WARNINGS=0");
/* Cleanup. */
dbus_error_free (&derror);
indent.o: indent.c frame.h window.h indent.h buffer.h lisp.h $(config_h) \
termchar.h termopts.h disptab.h region-cache.h character.h category.h \
keyboard.h systime.h coding.h $(INTERVALS_H) globals.h
+inotify.o: inotify.c lisp.h coding.h process.h keyboard.h frame.h termhooks.h
insdel.o: insdel.c window.h buffer.h $(INTERVALS_H) blockinput.h character.h \
atimer.h systime.h region-cache.h lisp.h globals.h $(config_h)
keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \
#include <errno.h>
#include <unistd.h>
-/* The d_nameln member of a struct dirent includes the '\0' character
- on some systems, but not on others. What's worse, you can't tell
- at compile-time which one it will be, since it really depends on
- the sort of system providing the filesystem you're reading from,
- not the system you are running on. Paul Eggert
- <eggert@bi.twinsun.com> says this occurs when Emacs is running on a
- SunOS 4.1.2 host, reading a directory that is remote-mounted from a
- Solaris 2.1 host and is in a native Solaris 2.1 filesystem.
-
- Since applying strlen to the name always works, we'll just do that. */
-#define NAMLEN(p) strlen (p->d_name)
-
-#ifdef HAVE_DIRENT_H
-
#include <dirent.h>
-#define DIRENTRY struct dirent
-
-#else /* not HAVE_DIRENT_H */
-
-#include <sys/dir.h>
-#include <sys/stat.h>
-
-#define DIRENTRY struct direct
-
-extern DIR *opendir (char *);
-extern struct direct *readdir (DIR *);
-
-#endif /* HAVE_DIRENT_H */
-
#include <filemode.h>
#include <stat-time.h>
-#ifdef MSDOS
-#define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0)
-#else
-#define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
-#endif
-
#include "lisp.h"
#include "systime.h"
#include "character.h"
static ptrdiff_t scmp (const char *, const char *, ptrdiff_t);
\f
+/* Return the number of bytes in DP's name. */
+static ptrdiff_t
+dirent_namelen (struct dirent *dp)
+{
+#ifdef _D_EXACT_NAMLEN
+ return _D_EXACT_NAMLEN (dp);
+#else
+ return strlen (dp->d_name);
+#endif
+}
+
#ifdef WINDOWSNT
Lisp_Object
directory_files_internal_w32_unwind (Lisp_Object arg)
bool needsep = 0;
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
- DIRENTRY *dp;
+ struct dirent *dp;
#ifdef WINDOWSNT
Lisp_Object w32_save = Qnil;
#endif
/* Loop reading blocks until EOF or error. */
for (;;)
{
+ ptrdiff_t len;
+ bool wanted = 0;
+ Lisp_Object name, finalname;
+ struct gcpro gcpro1, gcpro2;
+
errno = 0;
dp = readdir (d);
+ if (!dp)
+ {
+ if (errno == EAGAIN || errno == EINTR)
+ {
+ QUIT;
+ continue;
+ }
+ break;
+ }
- if (dp == NULL && (0
-#ifdef EAGAIN
- || errno == EAGAIN
-#endif
-#ifdef EINTR
- || errno == EINTR
-#endif
- ))
- { QUIT; continue; }
+ len = dirent_namelen (dp);
+ name = finalname = make_unibyte_string (dp->d_name, len);
+ GCPRO2 (finalname, name);
- if (dp == NULL)
- break;
+ /* Note: DECODE_FILE can GC; it should protect its argument,
+ though. */
+ name = DECODE_FILE (name);
+ len = SBYTES (name);
- if (DIRENTRY_NONEMPTY (dp))
+ /* Now that we have unwind_protect in place, we might as well
+ allow matching to be interrupted. */
+ immediate_quit = 1;
+ QUIT;
+
+ if (NILP (match)
+ || (0 <= re_search (bufp, SSDATA (name), len, 0, len, 0)))
+ wanted = 1;
+
+ immediate_quit = 0;
+
+ if (wanted)
{
- ptrdiff_t len;
- bool wanted = 0;
- Lisp_Object name, finalname;
- struct gcpro gcpro1, gcpro2;
+ if (!NILP (full))
+ {
+ Lisp_Object fullname;
+ ptrdiff_t nbytes = len + directory_nbytes + needsep;
+ ptrdiff_t nchars;
- len = NAMLEN (dp);
- name = finalname = make_unibyte_string (dp->d_name, len);
- GCPRO2 (finalname, name);
+ fullname = make_uninit_multibyte_string (nbytes, nbytes);
+ memcpy (SDATA (fullname), SDATA (directory),
+ directory_nbytes);
- /* Note: DECODE_FILE can GC; it should protect its argument,
- though. */
- name = DECODE_FILE (name);
- len = SBYTES (name);
+ if (needsep)
+ SSET (fullname, directory_nbytes, DIRECTORY_SEP);
- /* Now that we have unwind_protect in place, we might as well
- allow matching to be interrupted. */
- immediate_quit = 1;
- QUIT;
+ memcpy (SDATA (fullname) + directory_nbytes + needsep,
+ SDATA (name), len);
- if (NILP (match)
- || (0 <= re_search (bufp, SSDATA (name), len, 0, len, 0)))
- wanted = 1;
+ nchars = chars_in_text (SDATA (fullname), nbytes);
- immediate_quit = 0;
+ /* Some bug somewhere. */
+ if (nchars > nbytes)
+ emacs_abort ();
- if (wanted)
- {
- if (!NILP (full))
- {
- Lisp_Object fullname;
- ptrdiff_t nbytes = len + directory_nbytes + needsep;
- ptrdiff_t nchars;
-
- fullname = make_uninit_multibyte_string (nbytes, nbytes);
- memcpy (SDATA (fullname), SDATA (directory),
- directory_nbytes);
-
- if (needsep)
- SSET (fullname, directory_nbytes, DIRECTORY_SEP);
-
- memcpy (SDATA (fullname) + directory_nbytes + needsep,
- SDATA (name), len);
-
- nchars = chars_in_text (SDATA (fullname), nbytes);
-
- /* Some bug somewhere. */
- if (nchars > nbytes)
- emacs_abort ();
-
- STRING_SET_CHARS (fullname, nchars);
- if (nchars == nbytes)
- STRING_SET_UNIBYTE (fullname);
-
- finalname = fullname;
- }
- else
- finalname = name;
-
- if (attrs)
- {
- /* Construct an expanded filename for the directory entry.
- Use the decoded names for input to Ffile_attributes. */
- Lisp_Object decoded_fullname, fileattrs;
- struct gcpro gcpro1, gcpro2;
-
- decoded_fullname = fileattrs = Qnil;
- GCPRO2 (decoded_fullname, fileattrs);
-
- /* Both Fexpand_file_name and Ffile_attributes can GC. */
- decoded_fullname = Fexpand_file_name (name, directory);
- fileattrs = Ffile_attributes (decoded_fullname, id_format);
-
- list = Fcons (Fcons (finalname, fileattrs), list);
- UNGCPRO;
- }
- else
- list = Fcons (finalname, list);
+ STRING_SET_CHARS (fullname, nchars);
+ if (nchars == nbytes)
+ STRING_SET_UNIBYTE (fullname);
+
+ finalname = fullname;
}
+ else
+ finalname = name;
- UNGCPRO;
+ if (attrs)
+ {
+ /* Construct an expanded filename for the directory entry.
+ Use the decoded names for input to Ffile_attributes. */
+ Lisp_Object decoded_fullname, fileattrs;
+ struct gcpro gcpro1, gcpro2;
+
+ decoded_fullname = fileattrs = Qnil;
+ GCPRO2 (decoded_fullname, fileattrs);
+
+ /* Both Fexpand_file_name and Ffile_attributes can GC. */
+ decoded_fullname = Fexpand_file_name (name, directory);
+ fileattrs = Ffile_attributes (decoded_fullname, id_format);
+
+ list = Fcons (Fcons (finalname, fileattrs), list);
+ UNGCPRO;
+ }
+ else
+ list = Fcons (finalname, list);
}
+
+ UNGCPRO;
}
block_input ();
return file_name_completion (file, directory, 1, Qnil);
}
-static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr);
+static int file_name_completion_stat (Lisp_Object dirname, struct dirent *dp,
+ struct stat *st_addr);
static Lisp_Object Qdefault_directory;
static Lisp_Object
/* (att3b compiler bug requires do a null comparison this way) */
while (1)
{
- DIRENTRY *dp;
+ struct dirent *dp;
ptrdiff_t len;
bool canexclude = 0;
errno = 0;
dp = readdir (d);
- if (dp == NULL && (0
-# ifdef EAGAIN
- || errno == EAGAIN
-# endif
-# ifdef EINTR
- || errno == EINTR
-# endif
- ))
- { QUIT; continue; }
-
- if (!dp) break;
+ if (!dp)
+ {
+ if (errno == EAGAIN || errno == EINTR)
+ {
+ QUIT;
+ continue;
+ }
+ break;
+ }
- len = NAMLEN (dp);
+ len = dirent_namelen (dp);
QUIT;
- if (! DIRENTRY_NONEMPTY (dp)
- || len < SCHARS (encoded_file)
+ if (len < SCHARS (encoded_file)
|| 0 <= scmp (dp->d_name, SSDATA (encoded_file),
SCHARS (encoded_file)))
continue;
name, zero,
make_number (compare),
completion_ignore_case ? Qt : Qnil);
- ptrdiff_t matchsize
- = (EQ (cmp, Qt) ? compare
- : XINT (cmp) < 0 ? - XINT (cmp) - 1
- : XINT (cmp) - 1);
+ ptrdiff_t matchsize = EQ (cmp, Qt) ? compare : eabs (XINT (cmp)) - 1;
if (completion_ignore_case)
{
}
static int
-file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr)
+file_name_completion_stat (Lisp_Object dirname, struct dirent *dp,
+ struct stat *st_addr)
{
- ptrdiff_t len = NAMLEN (dp);
+ ptrdiff_t len = dirent_namelen (dp);
ptrdiff_t pos = SCHARS (dirname);
int value;
USE_SAFE_ALLOCA;
#ifdef WINDOWSNT
return st->st_uname;
#else
- struct passwd *pw = (struct passwd *) getpwuid (st->st_uid);
+ struct passwd *pw = getpwuid (st->st_uid);
if (pw)
return pw->pw_name;
#ifdef WINDOWSNT
return st->st_gname;
#else
- struct group *gr = (struct group *) getgrgid (st->st_gid);
+ struct group *gr = getgrgid (st->st_gid);
if (gr)
return gr->gr_name;
7. Size in bytes.
This is a floating point number if the size is too large for an integer.
8. File modes, as a string of ten letters or dashes as in ls -l.
- 9. t if file's gid would change if file were deleted and recreated.
+ 9. An unspecified value, present only for backward compatibility.
10. inode number. If it is larger than what an Emacs integer can hold,
this is of the form (HIGH . LOW): first the high bits, then the low 16 bits.
If even HIGH is too large for an Emacs integer, this is instead of the form
Lisp_Object values[12];
Lisp_Object encoded;
struct stat s;
-#ifdef BSD4_2
- Lisp_Object dirname;
- struct stat sdir;
-#endif /* BSD4_2 */
+ int lstat_result;
/* An array to hold the mode string generated by filemodestring,
including its terminating space and null byte. */
encoded = ENCODE_FILE (filename);
UNGCPRO;
- if (lstat (SSDATA (encoded), &s) < 0)
+#ifdef WINDOWSNT
+ /* We usually don't request accurate owner and group info, because
+ it can be very expensive on Windows to get that, and most callers
+ of 'lstat' don't need that. But here we do want that information
+ to be accurate. */
+ w32_stat_get_owner_group = 1;
+#endif
+
+ lstat_result = lstat (SSDATA (encoded), &s);
+
+#ifdef WINDOWSNT
+ w32_stat_get_owner_group = 0;
+#endif
+
+ if (lstat_result < 0)
return Qnil;
values[0] = (S_ISLNK (s.st_mode) ? Ffile_symlink_p (filename)
filemodestring (&s, modes);
values[8] = make_string (modes, 10);
-#ifdef BSD4_2 /* file gid will be dir gid */
- dirname = Ffile_name_directory (filename);
- if (! NILP (dirname))
- encoded = ENCODE_FILE (dirname);
- if (! NILP (dirname) && stat (SDATA (encoded), &sdir) == 0)
- values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil;
- else /* if we can't tell, assume worst */
- values[9] = Qt;
-#else /* file gid will be egid */
- values[9] = (s.st_gid != getegid ()) ? Qt : Qnil;
-#endif /* not BSD4_2 */
+ values[9] = Qt;
values[10] = INTEGER_TO_CONS (s.st_ino);
values[11] = INTEGER_TO_CONS (s.st_dev);
/* Pixmap width and height. */
unsigned int pixmap_w, pixmap_h;
- /* Non-zero means characters in this face have a box that thickness
- around them. If it is negative, the absolute value indicates the
- thickness, and the horizontal lines of box (top and bottom) are
- drawn inside of characters glyph area. The vertical lines of box
- (left and right) are drawn as the same way as the case that this
- value is positive. */
+ /* Non-zero means characters in this face have a box of that
+ thickness around them. If this value is negative, its absolute
+ value indicates the thickness, and the horizontal (top and
+ bottom) borders of box are drawn inside of the character glyphs'
+ area. The vertical (left and right) borders of the box are drawn
+ in the same way as when this value is positive. */
int box_line_width;
/* Type of box drawn. A value of FACE_NO_BOX means no box is drawn
#include "systime.h"
#include <errno.h>
-#ifdef DISPNEW_NEEDS_STDIO_EXT
-#include <stdio_ext.h>
-#endif
+#include <fpending.h>
#if defined (HAVE_TERM_H) && defined (GNU_LINUX)
#include <term.h> /* for tgetent */
static bool delayed_size_change;
-/* 1 means glyph initialization has been completed at startup. */
-
-static bool glyphs_initialized_initially_p;
-
/* Updated window if != 0. Set by update_window. */
struct window *updated_window;
unblock_input ();
}
-
-/* Adjust frame glyphs when Emacs is initialized.
-
- To be called from init_display.
-
- We need a glyph matrix because redraw will happen soon.
- Unfortunately, window sizes on selected_frame are not yet set to
- meaningful values. I believe we can assume that there are only two
- windows on the frame---the mini-buffer and the root window. Frame
- height and width seem to be correct so far. So, set the sizes of
- windows to estimated values. */
-
-static void
-adjust_frame_glyphs_initially (void)
-{
- struct frame *sf = SELECTED_FRAME ();
- struct window *root = XWINDOW (sf->root_window);
- struct window *mini = XWINDOW (root->next);
- int frame_lines = FRAME_LINES (sf);
- int frame_cols = FRAME_COLS (sf);
- int top_margin = FRAME_TOP_MARGIN (sf);
-
- /* Do it for the root window. */
- wset_top_line (root, make_number (top_margin));
- wset_total_lines (root, make_number (frame_lines - 1 - top_margin));
- wset_total_cols (root, make_number (frame_cols));
-
- /* Do it for the mini-buffer window. */
- wset_top_line (mini, make_number (frame_lines - 1));
- wset_total_lines (mini, make_number (1));
- wset_total_cols (mini, make_number (frame_cols));
-
- adjust_frame_glyphs (sf);
- glyphs_initialized_initially_p = 1;
-}
-
-
/* Allocate/reallocate glyph matrices of a single frame F. */
static void
Redrawing Frames
**********************************************************************/
-DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
- doc: /* Clear frame FRAME and output again what is supposed to appear on it. */)
- (Lisp_Object frame)
-{
- struct frame *f;
-
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
-
- /* Ignore redraw requests, if frame has no glyphs yet.
- (Implementation note: It still has to be checked why we are
- called so early here). */
- if (!glyphs_initialized_initially_p)
- return Qnil;
+/* Redraw frame F. */
+void
+redraw_frame (struct frame *f)
+{
+ /* Error if F has no glyphs. */
+ eassert (f->glyphs_initialized_p);
update_begin (f);
#ifdef MSDOS
if (FRAME_MSDOS_P (f))
mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0);
set_window_update_flags (XWINDOW (FRAME_ROOT_WINDOW (f)), 1);
f->garbaged = 0;
- return Qnil;
}
-
-/* Redraw frame F. This is nothing more than a call to the Lisp
- function redraw-frame. */
-
-void
-redraw_frame (struct frame *f)
+DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 0, 1, 0,
+ doc: /* Clear frame FRAME and output again what is supposed to appear on it.
+If FRAME is omitted or nil, the selected frame is used. */)
+ (Lisp_Object frame)
{
- Lisp_Object frame;
- XSETFRAME (frame, f);
- Fredraw_frame (frame);
+ redraw_frame (decode_live_frame (frame));
+ return Qnil;
}
-
DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
doc: /* Clear and redisplay all visible frames. */)
(void)
FOR_EACH_FRAME (tail, frame)
if (FRAME_VISIBLE_P (XFRAME (frame)))
- Fredraw_frame (frame);
+ redraw_frame (XFRAME (frame));
return Qnil;
}
vpos = w->cursor.vpos;
}
- /* Window cursor can be out of sync for horizontally split windows. */
- hpos = max (-1, hpos); /* -1 is for when cursor is on the left fringe */
- hpos = min (w->current_matrix->matrix_w - 1, hpos);
- vpos = max (0, vpos);
- vpos = min (w->current_matrix->nrows - 1, vpos);
+ /* Window cursor can be out of sync for horizontally split windows.
+ Horizontal position is -1 when cursor is on the left fringe. */
+ hpos = clip_to_bounds (-1, hpos, w->current_matrix->matrix_w - 1);
+ vpos = clip_to_bounds (0, vpos, w->current_matrix->nrows - 1);
rif->cursor_to (vpos, hpos, cy, cx);
}
FILE *display_output = FRAME_TTY (f)->output;
if (display_output)
{
- int outq = PENDING_OUTPUT_COUNT (display_output);
+ ptrdiff_t outq = __fpending (display_output);
if (outq > 900
|| (outq > 20 && ((i - 1) % preempt_count == 0)))
- {
- fflush (display_output);
- if (preempt_count == 1)
- {
-#ifdef EMACS_OUTQSIZE
- if (EMACS_OUTQSIZE (0, &outq) < 0)
- /* Probably not a tty. Ignore the error and reset
- the outq count. */
- outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f->output));
-#endif
- outq *= 10;
- if (baud_rate <= outq && baud_rate > 0)
- sleep (outq / baud_rate);
- }
- }
+ fflush (display_output);
}
}
So call tgetent. */
{ char b[2044]; tgetent (b, "xterm");}
#endif
- adjust_frame_glyphs_initially ();
return;
}
#endif /* HAVE_X_WINDOWS */
{
Vinitial_window_system = Qw32;
Vwindow_system_version = make_number (1);
- adjust_frame_glyphs_initially ();
return;
}
#endif /* HAVE_NTGUI */
{
Vinitial_window_system = Qns;
Vwindow_system_version = make_number (10);
- adjust_frame_glyphs_initially ();
return;
}
#endif
fatal ("screen size %dx%d too big", width, height);
}
- adjust_frame_glyphs_initially ();
calculate_costs (XFRAME (selected_frame));
/* Set up faces of the initial terminal frame of a dumped Emacs. */
/* Don't change cursor state while redisplaying. This could confuse
output routines. */
if (!redisplaying_p)
- {
- if (NILP (window))
- window = selected_window;
- else
- CHECK_WINDOW (window);
-
- XWINDOW (window)->cursor_off_p = NILP (show);
- }
-
+ decode_any_window (window)->cursor_off_p = NILP (show);
return Qnil;
}
WINDOW nil or omitted means report on the selected window. */)
(Lisp_Object window)
{
- struct window *w;
-
- if (NILP (window))
- window = selected_window;
- else
- CHECK_WINDOW (window);
-
- w = XWINDOW (window);
- return w->cursor_off_p ? Qnil : Qt;
+ return decode_any_window (window)->cursor_off_p ? Qnil : Qt;
}
DEFUN ("last-nonminibuffer-frame", Flast_nonminibuf_frame,
#include <config.h>
#include <sys/types.h>
-#include <sys/file.h> /* Must be after sys/types.h for USG*/
+#include <sys/file.h> /* Must be after sys/types.h for USG. */
#include <fcntl.h>
#include <unistd.h>
static unsigned char *read_bytecode_pointer;
-/* readchar in lread.c calls back here to fetch the next byte.
+/* `readchar' in lread.c calls back here to fetch the next byte.
If UNREADFLAG is 1, we unread a byte. */
int
ptrdiff_t minsize;
int offset;
EMACS_INT position;
- Lisp_Object file, tem;
+ Lisp_Object file, tem, pos;
USE_SAFE_ALLOCA;
if (INTEGERP (filepos))
{
file = Vdoc_file_name;
- position = XINT (filepos);
+ pos = filepos;
}
else if (CONSP (filepos))
{
file = XCAR (filepos);
- position = XINT (XCDR (filepos));
+ pos = XCDR (filepos);
}
else
return Qnil;
- if (position < 0)
- position = - position;
+ position = eabs (XINT (pos));
if (!STRINGP (Vdoc_directory))
return Qnil;
}
fun = Findirect_function (function, Qnil);
+ if (CONSP (fun) && EQ (XCAR (fun), Qmacro))
+ fun = XCDR (fun);
if (SUBRP (fun))
{
if (XSUBR (fun)->doc == 0)
else
return Qnil;
}
- else if (EQ (funcar, Qmacro))
- return Fdocumentation (Fcdr (fun), raw);
else
goto oops;
}
xsignal1 (Qinvalid_function, fun);
}
- /* Check for an advised function. Its doc string
- has an `ad-advice-info' text property. */
+ /* Check for a dynamic docstring. These come with
+ a dynamic-docstring-function text property. */
if (STRINGP (doc))
{
- Lisp_Object innerfunc;
- innerfunc = Fget_text_property (make_number (0),
- intern ("ad-advice-info"),
+ Lisp_Object func
+ = Fget_text_property (make_number (0),
+ intern ("dynamic-docstring-function"),
doc);
- if (! NILP (innerfunc))
- doc = call1 (intern ("ad-make-advised-docstring"), innerfunc);
+ if (!NILP (func))
+ /* Pass both `doc' and `function' since `function' can be needed, and
+ finding `doc' can be annoying: calling `documentation' is not an
+ option because it would infloop. */
+ doc = call2 (func, doc, function);
}
/* If DOC is 0, it's typically because of a dumped file missing
{
tem = Fcdr (Fcdr (fun));
if (CONSP (tem) && INTEGERP (XCAR (tem)))
+ /* FIXME: This modifies typically pure hash-cons'd data, so its
+ correctness is quite delicate. */
XSETCAR (tem, make_number (offset));
}
else if (EQ (tem, Qmacro))
if (nbytes < *bufsize - 1)
return nbytes;
if (*buf != nonheapbuf)
- xfree (*buf);
+ {
+ xfree (*buf);
+ *buf = NULL;
+ }
*buf = xpalloc (NULL, bufsize, 1, bufsize_max, 1);
}
}
#ifdef HAVE_PWD_H
#include <pwd.h>
+#include <grp.h>
#endif
#include <unistd.h>
static Lisp_Object Qboundary;
+/* The startup value of the TZ environment variable so it can be
+ restored if the user calls set-time-zone-rule with a nil
+ argument. If null, the TZ environment variable was unset. */
+static char const *initial_tz;
+
+/* True if the static variable tzvalbuf (defined in
+ set_time_zone_rule) is part of 'environ'. */
+static bool tzvalbuf_in_environ;
+
void
init_editfns (void)
return;
#endif /* not CANNOT_DUMP */
+ initial_tz = getenv ("TZ");
+ tzvalbuf_in_environ = 0;
+
pw = getpwuid (getuid ());
#ifdef MSDOS
/* We let the real user name default to "root" because that's quite
Qnil, Qt, Qnil);
}
-\f
+/* Save current buffer state for `save-excursion' special form.
+ We (ab)use Lisp_Misc_Save_Value to allow explicit free and so
+ offload some work from GC. */
+
Lisp_Object
save_excursion_save (void)
{
- bool visible = (XBUFFER (XWINDOW (selected_window)->buffer)
- == current_buffer);
+ Lisp_Object save, *data = xmalloc (word_size * 4);
+
+ data[0] = Fpoint_marker ();
/* Do not copy the mark if it points to nowhere. */
- Lisp_Object mark = (XMARKER (BVAR (current_buffer, mark))->buffer
- ? Fcopy_marker (BVAR (current_buffer, mark), Qnil)
- : Qnil);
-
- return Fcons (Fpoint_marker (),
- Fcons (mark,
- Fcons (visible ? Qt : Qnil,
- Fcons (BVAR (current_buffer, mark_active),
- selected_window))));
+ data[1] = (XMARKER (BVAR (current_buffer, mark))->buffer
+ ? Fcopy_marker (BVAR (current_buffer, mark), Qnil)
+ : Qnil);
+ /* Selected window if current buffer is shown in it, nil otherwise. */
+ data[2] = ((XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
+ ? selected_window : Qnil);
+ data[3] = BVAR (current_buffer, mark_active);
+
+ save = make_save_value (data, 4);
+ XSAVE_VALUE (save)->dogc = 1;
+ return save;
}
+/* Restore saved buffer before leaving `save-excursion' special form. */
+
Lisp_Object
save_excursion_restore (Lisp_Object info)
{
- Lisp_Object tem, tem1, omark, nmark;
+ Lisp_Object tem, tem1, omark, nmark, *data = XSAVE_VALUE (info)->pointer;
struct gcpro gcpro1, gcpro2, gcpro3;
- bool visible_p;
- tem = Fmarker_buffer (XCAR (info));
- /* If buffer being returned to is now deleted, avoid error */
- /* Otherwise could get error here while unwinding to top level
- and crash */
- /* In that case, Fmarker_buffer returns nil now. */
+ tem = Fmarker_buffer (data[0]);
+ /* If we're unwinding to top level, saved buffer may be deleted. This
+ means that all of its markers are unchained and so tem is nil. */
if (NILP (tem))
- return Qnil;
+ goto out;
omark = nmark = Qnil;
GCPRO3 (info, omark, nmark);
Fset_buffer (tem);
/* Point marker. */
- tem = XCAR (info);
+ tem = data[0];
Fgoto_char (tem);
unchain_marker (XMARKER (tem));
/* Mark marker. */
- info = XCDR (info);
- tem = XCAR (info);
+ tem = data[1];
omark = Fmarker_position (BVAR (current_buffer, mark));
if (NILP (tem))
unchain_marker (XMARKER (BVAR (current_buffer, mark)));
unchain_marker (XMARKER (tem));
}
- /* visible */
- info = XCDR (info);
- visible_p = !NILP (XCAR (info));
-
-#if 0 /* We used to make the current buffer visible in the selected window
- if that was true previously. That avoids some anomalies.
- But it creates others, and it wasn't documented, and it is simpler
- and cleaner never to alter the window/buffer connections. */
- tem1 = Fcar (tem);
- if (!NILP (tem1)
- && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
- Fswitch_to_buffer (Fcurrent_buffer (), Qnil);
-#endif /* 0 */
-
- /* Mark active */
- info = XCDR (info);
- tem = XCAR (info);
+ /* Mark active. */
+ tem = data[3];
tem1 = BVAR (current_buffer, mark_active);
bset_mark_active (current_buffer, tem);
/* If buffer was visible in a window, and a different window was
selected, and the old selected window is still showing this
buffer, restore point in that window. */
- tem = XCDR (info);
- if (visible_p
+ tem = data[2];
+ if (WINDOWP (tem)
&& !EQ (tem, selected_window)
&& (tem1 = XWINDOW (tem)->buffer,
(/* Window is live... */
Fset_window_point (tem, make_number (PT));
UNGCPRO;
+
+ out:
+
+ free_save_value (info);
return Qnil;
}
return make_fixnum_or_float (uid);
}
+DEFUN ("group-gid", Fgroup_gid, Sgroup_gid, 0, 0, 0,
+ doc: /* Return the effective gid of Emacs.
+Value is an integer or a float, depending on the value. */)
+ (void)
+{
+ gid_t egid = getegid ();
+ return make_fixnum_or_float (egid);
+}
+
+DEFUN ("group-real-gid", Fgroup_real_gid, Sgroup_real_gid, 0, 0, 0,
+ doc: /* Return the real gid of Emacs.
+Value is an integer or a float, depending on the value. */)
+ (void)
+{
+ gid_t gid = getgid ();
+ return make_fixnum_or_float (gid);
+}
+
DEFUN ("user-full-name", Fuser_full_name, Suser_full_name, 0, 1, 0,
doc: /* Return the full name of the user logged in, as a string.
If the full name corresponding to Emacs's userid is not known,
}
else
{
- char tzbuf[100];
+ static char const tzbuf_format[] = "XXX%s%"pI"d:%02d:%02d";
+ char tzbuf[sizeof tzbuf_format + INT_STRLEN_BOUND (EMACS_INT)];
+ char *old_tzstring;
const char *tzstring;
- char **oldenv = environ, **newenv;
+ USE_SAFE_ALLOCA;
if (EQ (zone, Qt))
tzstring = "UTC0";
EMACS_INT zone_hr = abszone / (60*60);
int zone_min = (abszone/60) % 60;
int zone_sec = abszone % 60;
- sprintf (tzbuf, "XXX%s%"pI"d:%02d:%02d", "-" + (XINT (zone) < 0),
+ sprintf (tzbuf, tzbuf_format, "-" + (XINT (zone) < 0),
zone_hr, zone_min, zone_sec);
tzstring = tzbuf;
}
else
error ("Invalid time zone specification");
+ old_tzstring = getenv ("TZ");
+ if (old_tzstring)
+ {
+ char *buf = SAFE_ALLOCA (strlen (old_tzstring) + 1);
+ old_tzstring = strcpy (buf, old_tzstring);
+ }
+
block_input ();
/* Set TZ before calling mktime; merely adjusting mktime's returned
value = mktime (&tm);
- /* Restore TZ to previous value. */
- newenv = environ;
- environ = oldenv;
+ set_time_zone_rule (old_tzstring);
#ifdef LOCALTIME_CACHE
tzset ();
#endif
unblock_input ();
-
- xfree (newenv);
+ SAFE_FREE ();
}
if (value == (time_t) -1)
return list2 (zone_offset, zone_name);
}
-/* This holds the value of `environ' produced by the previous
- call to Fset_time_zone_rule, or 0 if Fset_time_zone_rule
- has never been called. */
-static char **environbuf;
-
-/* This holds the startup value of the TZ environment variable so it
- can be restored if the user calls set-time-zone-rule with a nil
- argument. */
-static char *initial_tz;
-
DEFUN ("set-time-zone-rule", Fset_time_zone_rule, Sset_time_zone_rule, 1, 1, 0,
doc: /* Set the local time zone using TZ, a string specifying a time zone rule.
If TZ is nil, use implementation-defined default time zone information.
(Lisp_Object tz)
{
const char *tzstring;
- char **old_environbuf;
if (! (NILP (tz) || EQ (tz, Qt)))
CHECK_STRING (tz);
- block_input ();
-
- /* When called for the first time, save the original TZ. */
- old_environbuf = environbuf;
- if (!old_environbuf)
- initial_tz = (char *) getenv ("TZ");
-
if (NILP (tz))
tzstring = initial_tz;
else if (EQ (tz, Qt))
else
tzstring = SSDATA (tz);
+ block_input ();
set_time_zone_rule (tzstring);
- environbuf = environ;
-
unblock_input ();
- xfree (old_environbuf);
return Qnil;
}
-#ifdef LOCALTIME_CACHE
-
-/* These two values are known to load tz files in buggy implementations,
- i.e. Solaris 1 executables running under either Solaris 1 or Solaris 2.
- Their values shouldn't matter in non-buggy implementations.
- We don't use string literals for these strings,
- since if a string in the environment is in readonly
- storage, it runs afoul of bugs in SVR4 and Solaris 2.3.
- See Sun bugs 1113095 and 1114114, ``Timezone routines
- improperly modify environment''. */
-
-static char set_time_zone_rule_tz1[] = "TZ=GMT+0";
-static char set_time_zone_rule_tz2[] = "TZ=GMT+1";
-
-#endif
-
/* Set the local time zone rule to TZSTRING.
- This allocates memory into `environ', which it is the caller's
- responsibility to free. */
+
+ This function is not thread-safe, partly because putenv, unsetenv
+ and tzset are not, and partly because of the static storage it
+ updates. Other threads that invoke localtime etc. may be adversely
+ affected while this function is executing. */
void
set_time_zone_rule (const char *tzstring)
{
- ptrdiff_t envptrs;
- char **from, **to, **newenv;
+ /* A buffer holding a string of the form "TZ=value", intended
+ to be part of the environment. */
+ static char *tzvalbuf;
+ static ptrdiff_t tzvalbufsize;
+
+ int tzeqlen = sizeof "TZ=" - 1;
- /* Make the ENVIRON vector longer with room for TZSTRING. */
- for (from = environ; *from; from++)
- continue;
- envptrs = from - environ + 2;
- newenv = to = xmalloc (envptrs * sizeof *newenv
- + (tzstring ? strlen (tzstring) + 4 : 0));
+#ifdef LOCALTIME_CACHE
+ /* These two values are known to load tz files in buggy implementations,
+ i.e., Solaris 1 executables running under either Solaris 1 or Solaris 2.
+ Their values shouldn't matter in non-buggy implementations.
+ We don't use string literals for these strings,
+ since if a string in the environment is in readonly
+ storage, it runs afoul of bugs in SVR4 and Solaris 2.3.
+ See Sun bugs 1113095 and 1114114, ``Timezone routines
+ improperly modify environment''. */
+
+ static char set_time_zone_rule_tz[][sizeof "TZ=GMT+0"]
+ = { "TZ=GMT+0", "TZ=GMT+1" };
+
+ /* In SunOS 4.1.3_U1 and 4.1.4, if TZ has a value like
+ "US/Pacific" that loads a tz file, then changes to a value like
+ "XXX0" that does not load a tz file, and then changes back to
+ its original value, the last change is (incorrectly) ignored.
+ Also, if TZ changes twice in succession to values that do
+ not load a tz file, tzset can dump core (see Sun bug#1225179).
+ The following code works around these bugs. */
- /* Add TZSTRING to the end of environ, as a value for TZ. */
if (tzstring)
{
- char *t = (char *) (to + envptrs);
- strcpy (t, "TZ=");
- strcat (t, tzstring);
- *to++ = t;
+ /* Temporarily set TZ to a value that loads a tz file
+ and that differs from tzstring. */
+ bool eq0 = strcmp (tzstring, set_time_zone_rule_tz[0] + tzeqlen) == 0;
+ xputenv (set_time_zone_rule_tz[eq0]);
}
+ else
+ {
+ /* The implied tzstring is unknown, so temporarily set TZ to
+ two different values that each load a tz file. */
+ xputenv (set_time_zone_rule_tz[0]);
+ tzset ();
+ xputenv (set_time_zone_rule_tz[1]);
+ }
+ tzset ();
+#endif
- /* Copy the old environ vector elements into NEWENV,
- but don't copy the TZ variable.
- So we have only one definition of TZ, which came from TZSTRING. */
- for (from = environ; *from; from++)
- if (strncmp (*from, "TZ=", 3) != 0)
- *to++ = *from;
- *to = 0;
-
- environ = newenv;
+ if (!tzstring)
+ {
+ unsetenv ("TZ");
+ tzvalbuf_in_environ = 0;
+ }
+ else
+ {
+ ptrdiff_t tzstringlen = strlen (tzstring);
- /* If we do have a TZSTRING, NEWENV points to the vector slot where
- the TZ variable is stored. If we do not have a TZSTRING,
- TO points to the vector slot which has the terminating null. */
+ if (tzvalbufsize <= tzeqlen + tzstringlen)
+ {
+ unsetenv ("TZ");
+ tzvalbuf_in_environ = 0;
+ tzvalbuf = xpalloc (tzvalbuf, &tzvalbufsize,
+ tzeqlen + tzstringlen - tzvalbufsize + 1, -1, 1);
+ memcpy (tzvalbuf, "TZ=", tzeqlen);
+ }
-#ifdef LOCALTIME_CACHE
- {
- /* In SunOS 4.1.3_U1 and 4.1.4, if TZ has a value like
- "US/Pacific" that loads a tz file, then changes to a value like
- "XXX0" that does not load a tz file, and then changes back to
- its original value, the last change is (incorrectly) ignored.
- Also, if TZ changes twice in succession to values that do
- not load a tz file, tzset can dump core (see Sun bug#1225179).
- The following code works around these bugs. */
-
- if (tzstring)
- {
- /* Temporarily set TZ to a value that loads a tz file
- and that differs from tzstring. */
- char *tz = *newenv;
- *newenv = (strcmp (tzstring, set_time_zone_rule_tz1 + 3) == 0
- ? set_time_zone_rule_tz2 : set_time_zone_rule_tz1);
- tzset ();
- *newenv = tz;
- }
- else
- {
- /* The implied tzstring is unknown, so temporarily set TZ to
- two different values that each load a tz file. */
- *to = set_time_zone_rule_tz1;
- to[1] = 0;
- tzset ();
- *to = set_time_zone_rule_tz2;
- tzset ();
- *to = 0;
- }
+ strcpy (tzvalbuf + tzeqlen, tzstring);
- /* Now TZ has the desired value, and tzset can be invoked safely. */
- }
+ if (!tzvalbuf_in_environ)
+ {
+ xputenv (tzvalbuf);
+ tzvalbuf_in_environ = 1;
+ }
+ }
+#ifdef LOCALTIME_CACHE
tzset ();
#endif
}
\f
DEFUN ("insert-char", Finsert_char, Sinsert_char, 1, 3,
"(list (read-char-by-name \"Insert character (Unicode name or hex): \")\
- (prefix-numeric-value current-prefix-arg)\
- t))",
+ (prefix-numeric-value current-prefix-arg)\
+ t))",
doc: /* Insert COUNT copies of CHARACTER.
Interactively, prompt for CHARACTER. You can specify CHARACTER in one
of these ways:
Lisp_Object result, tem, tem1;
if (start < GPT && GPT < end)
- move_gap (start);
+ move_gap_both (start, start_byte);
if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
result = make_uninit_multibyte_string (end - start, end_byte - start_byte);
of the buffer. */)
(void)
{
- return make_buffer_string (BEGV, ZV, 1);
+ return make_buffer_string_both (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 1);
}
DEFUN ("insert-buffer-substring", Finsert_buffer_substring, Sinsert_buffer_substring,
else if (!changed)
{
changed = -1;
- modify_region (current_buffer, pos, XINT (end), 0);
+ modify_region_1 (pos, XINT (end), false);
if (! NILP (noundo))
{
pos = XINT (start);
pos_byte = CHAR_TO_BYTE (pos);
end_pos = XINT (end);
- modify_region (current_buffer, pos, end_pos, 0);
+ modify_region_1 (pos, end_pos, false);
cnt = 0;
for (; pos < end_pos; )
if (end1 == start2) /* adjacent regions */
{
- modify_region (current_buffer, start1, end2, 0);
+ modify_region_1 (start1, end2, false);
record_change (start1, len1 + len2);
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
{
USE_SAFE_ALLOCA;
- modify_region (current_buffer, start1, end1, 0);
- modify_region (current_buffer, start2, end2, 0);
+ modify_region_1 (start1, end1, false);
+ modify_region_1 (start2, end2, false);
record_change (start1, len1);
record_change (start2, len2);
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
{
USE_SAFE_ALLOCA;
- modify_region (current_buffer, start1, end2, 0);
+ modify_region_1 (start1, end2, false);
record_change (start1, (end2 - start1));
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
USE_SAFE_ALLOCA;
record_change (start1, (end2 - start1));
- modify_region (current_buffer, start1, end2, 0);
+ modify_region_1 (start1, end2, false);
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
void
syms_of_editfns (void)
{
- environbuf = 0;
- initial_tz = 0;
-
DEFSYM (Qbuffer_access_fontify_functions, "buffer-access-fontify-functions");
DEFVAR_LISP ("inhibit-field-text-motion", Vinhibit_field_text_motion,
defsubr (&Suser_real_login_name);
defsubr (&Suser_uid);
defsubr (&Suser_real_uid);
+ defsubr (&Sgroup_gid);
+ defsubr (&Sgroup_real_gid);
defsubr (&Suser_full_name);
defsubr (&Semacs_pid);
defsubr (&Scurrent_time);
#include <sys/file.h>
#include <unistd.h>
+#include <close-stream.h>
#include <ignore-value.h>
#include "lisp.h"
#if defined WINDOWSNT || defined HAVE_NTGUI
#include "w32select.h"
#include "w32font.h"
+#include "w32common.h"
#endif
#if defined HAVE_NTGUI && defined CYGWIN
#include <sys/personality.h>
#endif
-#ifndef O_RDWR
-#define O_RDWR 2
-#endif
-
static const char emacs_version[] = VERSION;
static const char emacs_copyright[] = COPYRIGHT;
#ifdef HAVE_TZSET
/* A valid but unlikely value for the TZ environment value.
It is OK (though a bit slower) if the user actually chooses this value. */
-static char dump_tz[] = "UtC0";
+static char const dump_tz[] = "UtC0";
#endif
#ifndef ORDINARY_LINK
#endif /* DOUG_LEA_MALLOC */
+/* Close standard output and standard error, reporting any write
+ errors as best we can. This is intended for use with atexit. */
+static void
+close_output_streams (void)
+{
+ if (close_stream (stdout) != 0)
+ {
+ fprintf (stderr, "Write error to standard output: %s\n",
+ strerror (errno));
+ fflush (stderr);
+ _exit (EXIT_FAILURE);
+ }
+
+ if (close_stream (stderr) != 0)
+ _exit (EXIT_FAILURE);
+}
/* ARGSUSED */
int
#ifdef G_SLICE_ALWAYS_MALLOC
/* This is used by the Cygwin build. */
- setenv ("G_SLICE", "always-malloc", 1);
+ xputenv ("G_SLICE=always-malloc");
#endif
#ifdef GNU_LINUX
}
#endif
+#if defined WINDOWSNT || defined HAVE_NTGUI
+ /* Set global variables used to detect Windows version. Do this as
+ early as possible. (unexw32.c calls this function as well, but
+ the additional call here is harmless.) */
+ cache_system_info ();
+#endif
+
#ifdef RUN_TIME_REMAP
if (initialized)
run_time_remap (argv[0]);
unexec_init_emacs_zone ();
#endif
+ atexit (close_output_streams);
+
sort_args (argc, argv);
argc = 0;
while (argv[argc]) argc++;
#ifdef HAVE_PERSONALITY_LINUX32
if (dumping && ! getenv ("EMACS_HEAP_EXEC"))
{
- static char heapexec[] = "EMACS_HEAP_EXEC=true";
/* Set this so we only do this once. */
- putenv (heapexec);
+ xputenv ("EMACS_HEAP_EXEC=true");
/* A flag to turn off address randomization which is introduced
in linux kernel shipped with fedora core 4 */
that it is not accessible to programs started from .emacs. */
fcntl (daemon_pipe[1], F_SETFD, FD_CLOEXEC);
-#ifdef HAVE_SETSID
setsid ();
-#endif
#else /* DOS_NT */
fprintf (stderr, "This platform does not support the -daemon flag.\n");
exit (1);
/* Called before syms_of_fileio, because it sets up Qerror_condition. */
syms_of_data ();
+ syms_of_fns (); /* Before syms_of_charset which uses hashtables. */
syms_of_fileio ();
/* Before syms_of_coding to initialize Vgc_cons_threshold. */
syms_of_alloc ();
init_window_once (); /* Init the window system. */
#ifdef HAVE_WINDOW_SYSTEM
- init_fringe_once (); /* Swap bitmaps if necessary. */
+ init_fringe_once (); /* Swap bitmaps if necessary. */
#endif /* HAVE_WINDOW_SYSTEM */
}
#ifdef WINDOWSNT
globals_of_w32 ();
+ globals_of_w32notify ();
/* Initialize environment from registry settings. */
init_environment (argv);
init_ntproc (dumping); /* must precede init_editfns. */
don't pollute Vglobal_environment. */
/* Setting LANG here will defeat the startup locale processing... */
#ifdef AIX
- putenv ("LANG=C");
+ xputenv ("LANG=C");
#endif
init_buffer (); /* Init default directory of main buffer. */
syms_of_lread ();
syms_of_print ();
syms_of_eval ();
- syms_of_fns ();
syms_of_floatfns ();
syms_of_buffer ();
syms_of_gnutls ();
#endif
+#ifdef HAVE_INOTIFY
+ syms_of_inotify ();
+#endif /* HAVE_INOTIFY */
+
#ifdef HAVE_DBUS
syms_of_dbusbind ();
#endif /* HAVE_DBUS */
#ifdef WINDOWSNT
syms_of_ntterm ();
+ syms_of_w32notify ();
#endif /* WINDOWSNT */
syms_of_profiler ();
exit_code = (XINT (arg) < 0
? XINT (arg) | INT_MIN
: XINT (arg) & INT_MAX);
- else if (noninteractive && (fflush (stdout) || ferror (stdout)))
- exit_code = EXIT_FAILURE;
else
exit_code = EXIT_SUCCESS;
exit (exit_code);
/* If we are controlling the terminal, reset terminal modes. */
#ifndef DOS_NT
{
- pid_t pgrp = EMACS_GETPGRP (0);
+ pid_t pgrp = getpgrp ();
pid_t tpgrp = tcgetpgrp (0);
if ((tpgrp != -1) && tpgrp == pgrp)
{
Lisp_Object inhibit_lisp_code;
static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *);
-static bool interactive_p (void);
static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
/* Functions to set Lisp_Object slots of struct specbinding. */
}
-DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0,
- doc: /* Return t if the containing function was run directly by user input.
-This means that the function was called with `call-interactively'
-\(which includes being called as the binding of a key)
-and input is currently coming from the keyboard (not a keyboard macro),
-and Emacs is not running in batch mode (`noninteractive' is nil).
-
-The only known proper use of `interactive-p' is in deciding whether to
-display a helpful message, or how to display it. If you're thinking
-of using it for any other purpose, it is quite likely that you're
-making a mistake. Think: what do you want to do when the command is
-called from a keyboard macro?
-
-To test whether your function was called with `call-interactively',
-either (i) add an extra optional argument and give it an `interactive'
-spec that specifies non-nil unconditionally (such as \"p\"); or (ii)
-use `called-interactively-p'. */)
- (void)
-{
- return (INTERACTIVE && interactive_p ()) ? Qt : Qnil;
-}
-
-
-DEFUN ("called-interactively-p", Fcalled_interactively_p, Scalled_interactively_p, 0, 1, 0,
- doc: /* Return t if the containing function was called by `call-interactively'.
-If KIND is `interactive', then only return t if the call was made
-interactively by the user, i.e. not in `noninteractive' mode nor
-when `executing-kbd-macro'.
-If KIND is `any', on the other hand, it will return t for any kind of
-interactive call, including being called as the binding of a key, or
-from a keyboard macro, or in `noninteractive' mode.
-
-The only known proper use of `interactive' for KIND is in deciding
-whether to display a helpful message, or how to display it. If you're
-thinking of using it for any other purpose, it is quite likely that
-you're making a mistake. Think: what do you want to do when the
-command is called from a keyboard macro?
-
-Instead of using this function, it is sometimes cleaner to give your
-function an extra optional argument whose `interactive' spec specifies
-non-nil unconditionally (\"p\" is a good way to do this), or via
-\(not (or executing-kbd-macro noninteractive)). */)
- (Lisp_Object kind)
-{
- return (((INTERACTIVE || !EQ (kind, intern ("interactive")))
- && interactive_p ())
- ? Qt : Qnil);
-}
-
-
-/* Return true if function in which this appears was called using
- call-interactively and is not a built-in. */
-
-static bool
-interactive_p (void)
-{
- struct backtrace *btp;
- Lisp_Object fun;
-
- btp = backtrace_list;
-
- /* If this isn't a byte-compiled function, there may be a frame at
- the top for Finteractive_p. If so, skip it. */
- fun = Findirect_function (btp->function, Qnil);
- if (SUBRP (fun) && (XSUBR (fun) == &Sinteractive_p
- || XSUBR (fun) == &Scalled_interactively_p))
- btp = btp->next;
-
- /* If we're running an Emacs 18-style byte-compiled function, there
- may be a frame for Fbytecode at the top level. In any version of
- Emacs there can be Fbytecode frames for subexpressions evaluated
- inside catch and condition-case. Skip past them.
-
- If this isn't a byte-compiled function, then we may now be
- looking at several frames for special forms. Skip past them. */
- while (btp
- && (EQ (btp->function, Qbytecode)
- || btp->nargs == UNEVALLED))
- btp = btp->next;
-
- /* `btp' now points at the frame of the innermost function that isn't
- a special form, ignoring frames for Finteractive_p and/or
- Fbytecode at the top. If this frame is for a built-in function
- (such as load or eval-region) return false. */
- fun = Findirect_function (btp->function, Qnil);
- if (SUBRP (fun))
- return 0;
-
- /* `btp' points to the frame of a Lisp function that called interactive-p.
- Return t if that function was called interactively. */
- if (btp && btp->next && EQ (btp->next->function, Qcall_interactively))
- return 1;
- return 0;
-}
-
-
DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0,
doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE.
Aliased variables always have the same value; setting one sets the other.
if (EQ ((--pdl)->symbol, sym) && !pdl->func
&& EQ (pdl->old_value, Qunbound))
{
- message_with_string ("Warning: defvar ignored because %s is let-bound",
- SYMBOL_NAME (sym), 1);
+ message_with_string
+ ("Warning: defvar ignored because %s is let-bound",
+ SYMBOL_NAME (sym), 1);
break;
}
}
/* A simple (defvar foo) with lexical scoping does "nothing" except
declare that var to be dynamically scoped *locally* (i.e. within
the current file or let-block). */
- Vinternal_interpreter_environment =
- Fcons (sym, Vinternal_interpreter_environment);
+ Vinternal_interpreter_environment
+ = Fcons (sym, Vinternal_interpreter_environment);
else
{
/* Simple (defvar <var>) should not count as a definition at all.
if (NILP (tem))
{
def = XSYMBOL (sym)->function;
- if (!EQ (def, Qunbound))
+ if (!NILP (def))
continue;
}
break;
GCPRO1 (form);
def = Fautoload_do_load (def, sym, Qmacro);
UNGCPRO;
- if (EQ (def, Qunbound) || !CONSP (def))
+ if (!CONSP (def))
/* Not defined or definition not suitable. */
break;
if (!EQ (XCAR (def), Qmacro))
fun = function;
- fun = indirect_function (fun); /* Check cycles. */
- if (NILP (fun) || EQ (fun, Qunbound))
+ fun = indirect_function (fun); /* Check cycles. */
+ if (NILP (fun))
return Qnil;
/* Check an `interactive-form' property if present, analogous to the
- function-documentation property. */
+ function-documentation property. */
fun = function;
while (SYMBOLP (fun))
{
CHECK_STRING (file);
/* If function is defined and not as an autoload, don't override. */
- if ((CONSP (XSYMBOL (function)->function)
- && EQ (XCAR (XSYMBOL (function)->function), Qautoload)))
- /* Remember that the function was already an autoload. */
- LOADHIST_ATTACH (Fcons (Qt, function));
- else if (!EQ (XSYMBOL (function)->function, Qunbound))
+ if (!NILP (XSYMBOL (function)->function)
+ && !AUTOLOADP (XSYMBOL (function)->function))
return Qnil;
- if (NILP (Vpurify_flag))
- /* Only add entries after dumping, because the ones before are
- not useful and else we get loads of them from the loaddefs.el. */
- LOADHIST_ATTACH (Fcons (Qautoload, function));
- else if (EQ (docstring, make_number (0)))
+ if (!NILP (Vpurify_flag) && EQ (docstring, make_number (0)))
/* `read1' in lread.c has found the docstring starting with "\
and assumed the docstring will be provided by Snarf-documentation, so it
passed us 0 instead. But that leads to accidental sharing in purecopy's
hash-consing, so we use a (hopefully) unique integer instead. */
- docstring = make_number (XUNTAG (function, Lisp_Symbol));
- return Ffset (function,
- Fpurecopy (list5 (Qautoload, file, docstring,
- interactive, type)));
+ docstring = make_number (XHASH (function));
+ return Fdefalias (function,
+ list5 (Qautoload, file, docstring, interactive, type),
+ Qnil);
}
Lisp_Object
/* Optimize for no indirection. */
fun = original_fun;
- if (SYMBOLP (fun) && !EQ (fun, Qunbound)
+ if (SYMBOLP (fun) && !NILP (fun)
&& (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
fun = indirect_function (fun);
val = apply_lambda (fun, original_args);
else
{
- if (EQ (fun, Qunbound))
+ if (NILP (fun))
xsignal1 (Qvoid_function, original_fun);
if (!CONSP (fun))
xsignal1 (Qinvalid_function, original_fun);
numargs += nargs - 2;
/* Optimize for no indirection. */
- if (SYMBOLP (fun) && !EQ (fun, Qunbound)
+ if (SYMBOLP (fun) && !NILP (fun)
&& (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
fun = indirect_function (fun);
- if (EQ (fun, Qunbound))
+ if (NILP (fun))
{
/* Let funcall get the error. */
fun = args[0];
/* Optimize for no indirection. */
fun = original_fun;
- if (SYMBOLP (fun) && !EQ (fun, Qunbound)
+ if (SYMBOLP (fun) && !NILP (fun)
&& (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
fun = indirect_function (fun);
val = funcall_lambda (fun, numargs, args + 1);
else
{
- if (EQ (fun, Qunbound))
+ if (NILP (fun))
xsignal1 (Qvoid_function, original_fun);
if (!CONSP (fun))
xsignal1 (Qinvalid_function, original_fun);
for (backlist = backtrace_list; backlist; backlist = backlist->next)
{
- mark_object (*backlist->function);
+ mark_object (backlist->function);
if (backlist->nargs == UNEVALLED
|| backlist->nargs == MANY) /* FIXME: Can this happen? */
defsubr (&Sunwind_protect);
defsubr (&Scondition_case);
defsubr (&Ssignal);
- defsubr (&Sinteractive_p);
- defsubr (&Scalled_interactively_p);
defsubr (&Scommandp);
defsubr (&Sautoload);
defsubr (&Sautoload_do_load);
#include <selinux/context.h>
#endif
+#ifdef HAVE_POSIX_ACL
+#include <sys/acl.h>
+#endif
+
#include <c-ctype.h>
#include "lisp.h"
static Lisp_Object Qset_file_times;
static Lisp_Object Qfile_selinux_context;
static Lisp_Object Qset_file_selinux_context;
+static Lisp_Object Qfile_acl;
+static Lisp_Object Qset_file_acl;
static Lisp_Object Qfile_newer_than_file_p;
Lisp_Object Qinsert_file_contents;
Lisp_Object Qwrite_region;
o [p - nm] = 0;
block_input ();
- pw = (struct passwd *) getpwnam (o + 1);
+ pw = getpwnam (o + 1);
unblock_input ();
if (pw)
{
strcpy (adir, "/");
}
else
- getwd (adir);
+ getcwd (adir, MAXPATHLEN + 1);
if (multibyte)
{
Lisp_Object tem = build_string (adir);
{
char *nm, *s, *p, *o, *x, *endp;
char *target = NULL;
- int total = 0;
+ ptrdiff_t total = 0;
bool substituted = 0;
bool multibyte;
char *xnm;
If PRESERVE-UID-GID is non-nil, we try to transfer the
uid and gid of FILE to NEWNAME.
-If PRESERVE-SELINUX-CONTEXT is non-nil and SELinux is enabled
-on the system, we copy the SELinux context of FILE to NEWNAME. */)
- (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_selinux_context)
+If PRESERVE-EXTENDED-ATTRIBUTES is non-nil, we try to copy additional
+attributes of FILE to NEWNAME, such as its SELinux context and ACL
+entries (depending on how Emacs was built). */)
+ (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_extended_attributes)
{
int ifd, ofd;
int n;
Lisp_Object handler;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
ptrdiff_t count = SPECPDL_INDEX ();
- bool input_file_statable_p;
Lisp_Object encoded_file, encoded_newname;
#if HAVE_LIBSELINUX
security_context_t con;
int conlength = 0;
#endif
+#ifdef HAVE_POSIX_ACL
+ acl_t acl = NULL;
+#endif
encoded_file = encoded_newname = Qnil;
GCPRO4 (file, newname, encoded_file, encoded_newname);
if (!NILP (handler))
RETURN_UNGCPRO (call7 (handler, Qcopy_file, file, newname,
ok_if_already_exists, keep_time, preserve_uid_gid,
- preserve_selinux_context));
+ preserve_extended_attributes));
encoded_file = ENCODE_FILE (file);
encoded_newname = ENCODE_FILE (newname);
out_st.st_mode = 0;
#ifdef WINDOWSNT
+ if (!NILP (preserve_extended_attributes))
+ {
+#ifdef HAVE_POSIX_ACL
+ acl = acl_get_file (SDATA (encoded_file), ACL_TYPE_ACCESS);
+ if (acl == NULL && errno != ENOTSUP)
+ report_file_error ("Getting ACL", Fcons (file, Qnil));
+#endif
+ }
if (!CopyFile (SDATA (encoded_file),
SDATA (encoded_newname),
FALSE))
- report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil)));
+ {
+ /* CopyFile doesn't set errno when it fails. By far the most
+ "popular" reason is that the target is read-only. */
+ if (GetLastError () == 5)
+ errno = EACCES;
+ else
+ errno = EPERM;
+ report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil)));
+ }
/* CopyFile retains the timestamp by default. */
else if (NILP (keep_time))
{
/* Restore original attributes. */
SetFileAttributes (filename, attributes);
}
+#ifdef HAVE_POSIX_ACL
+ if (acl != NULL)
+ {
+ bool fail =
+ acl_set_file (SDATA (encoded_newname), ACL_TYPE_ACCESS, acl) != 0;
+ if (fail && errno != ENOTSUP)
+ report_file_error ("Setting ACL", Fcons (newname, Qnil));
+
+ acl_free (acl);
+ }
+#endif
#else /* not WINDOWSNT */
immediate_quit = 1;
ifd = emacs_open (SSDATA (encoded_file), O_RDONLY, 0);
record_unwind_protect (close_file_unwind, make_number (ifd));
- /* We can only copy regular files and symbolic links. Other files are not
- copyable by us. */
- input_file_statable_p = (fstat (ifd, &st) >= 0);
+ if (fstat (ifd, &st) != 0)
+ report_file_error ("Input file status", Fcons (file, Qnil));
-#if HAVE_LIBSELINUX
- if (!NILP (preserve_selinux_context) && is_selinux_enabled ())
+ if (!NILP (preserve_extended_attributes))
{
- conlength = fgetfilecon (ifd, &con);
- if (conlength == -1)
- report_file_error ("Doing fgetfilecon", Fcons (file, Qnil));
- }
+#if HAVE_LIBSELINUX
+ if (is_selinux_enabled ())
+ {
+ conlength = fgetfilecon (ifd, &con);
+ if (conlength == -1)
+ report_file_error ("Doing fgetfilecon", Fcons (file, Qnil));
+ }
+#endif
+
+#ifdef HAVE_POSIX_ACL
+ acl = acl_get_fd (ifd);
+ if (acl == NULL && errno != ENOTSUP)
+ report_file_error ("Getting ACL", Fcons (file, Qnil));
#endif
+ }
if (out_st.st_mode != 0
&& st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino)
Fcons (file, Fcons (newname, Qnil)));
}
- if (input_file_statable_p)
+ /* We can copy only regular files. */
+ if (!S_ISREG (st.st_mode))
{
- if (!(S_ISREG (st.st_mode)) && !(S_ISLNK (st.st_mode)))
- {
-#if defined (EISDIR)
- /* Get a better looking error message. */
- errno = EISDIR;
-#endif /* EISDIR */
- report_file_error ("Non-regular file", Fcons (file, Qnil));
- }
+ /* Get a better looking error message. */
+ errno = S_ISDIR (st.st_mode) ? EISDIR : EINVAL;
+ report_file_error ("Non-regular file", Fcons (file, Qnil));
}
#ifdef MSDOS
S_IREAD | S_IWRITE);
#else /* not MSDOS */
{
- mode_t new_mask = 0666;
- if (input_file_statable_p)
- {
- if (!NILP (preserve_uid_gid))
- new_mask = 0600;
- new_mask &= st.st_mode;
- }
+ mode_t new_mask = !NILP (preserve_uid_gid) ? 0600 : 0666;
+ new_mask &= st.st_mode;
ofd = emacs_open (SSDATA (encoded_newname),
(O_WRONLY | O_TRUNC | O_CREAT
| (NILP (ok_if_already_exists) ? O_EXCL : 0)),
#ifndef MSDOS
/* Preserve the original file modes, and if requested, also its
owner and group. */
- if (input_file_statable_p)
- {
- mode_t mode_mask = 07777;
- if (!NILP (preserve_uid_gid))
- {
- /* Attempt to change owner and group. If that doesn't work
- attempt to change just the group, as that is sometimes allowed.
- Adjust the mode mask to eliminate setuid or setgid bits
- that are inappropriate if the owner and group are wrong. */
- if (fchown (ofd, st.st_uid, st.st_gid) != 0)
- {
- mode_mask &= ~06000;
- if (fchown (ofd, -1, st.st_gid) == 0)
- mode_mask |= 02000;
- }
- }
- if (fchmod (ofd, st.st_mode & mode_mask) != 0)
- report_file_error ("Doing chmod", Fcons (newname, Qnil));
- }
+ {
+ mode_t mode_mask = 07777;
+ if (!NILP (preserve_uid_gid))
+ {
+ /* Attempt to change owner and group. If that doesn't work
+ attempt to change just the group, as that is sometimes allowed.
+ Adjust the mode mask to eliminate setuid or setgid bits
+ that are inappropriate if the owner and group are wrong. */
+ if (fchown (ofd, st.st_uid, st.st_gid) != 0)
+ {
+ mode_mask &= ~06000;
+ if (fchown (ofd, -1, st.st_gid) == 0)
+ mode_mask |= 02000;
+ }
+ }
+ if (fchmod (ofd, st.st_mode & mode_mask) != 0)
+ report_file_error ("Doing chmod", Fcons (newname, Qnil));
+ }
#endif /* not MSDOS */
#if HAVE_LIBSELINUX
}
#endif
- if (input_file_statable_p)
+#ifdef HAVE_POSIX_ACL
+ if (acl != NULL)
{
- if (!NILP (keep_time))
- {
- EMACS_TIME atime = get_stat_atime (&st);
- EMACS_TIME mtime = get_stat_mtime (&st);
- if (set_file_times (ofd, SSDATA (encoded_newname), atime, mtime))
- xsignal2 (Qfile_date_error,
- build_string ("Cannot set file date"), newname);
- }
+ bool fail = acl_set_fd (ofd, acl) != 0;
+ if (fail && errno != ENOTSUP)
+ report_file_error ("Setting ACL", Fcons (newname, Qnil));
+
+ acl_free (acl);
+ }
+#endif
+
+ if (!NILP (keep_time))
+ {
+ EMACS_TIME atime = get_stat_atime (&st);
+ EMACS_TIME mtime = get_stat_mtime (&st);
+ if (set_file_times (ofd, SSDATA (encoded_newname), atime, mtime))
+ xsignal2 (Qfile_date_error,
+ build_string ("Cannot set file date"), newname);
}
if (emacs_close (ofd) < 0)
emacs_close (ifd);
#ifdef MSDOS
- if (input_file_statable_p)
- {
- /* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
- and if it can't, it tells so. Otherwise, under MSDOS we usually
- get only the READ bit, which will make the copied file read-only,
- so it's better not to chmod at all. */
- if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
- chmod (SDATA (encoded_newname), st.st_mode & 07777);
- }
+ /* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
+ and if it can't, it tells so. Otherwise, under MSDOS we usually
+ get only the READ bit, which will make the copied file read-only,
+ so it's better not to chmod at all. */
+ if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
+ chmod (SDATA (encoded_newname), st.st_mode & 07777);
#endif /* MSDOS */
#endif /* not WINDOWSNT */
return Qt;
}
-/* Delete file FILENAME.
+/* Delete file FILENAME, returning true if successful.
This ignores `delete-by-moving-to-trash'. */
-void
+bool
internal_delete_file (Lisp_Object filename)
{
- internal_condition_case_2 (Fdelete_file, filename, Qnil,
- Qt, internal_delete_file_1);
+ Lisp_Object tem;
+
+ tem = internal_condition_case_2 (Fdelete_file, filename, Qnil,
+ Qt, internal_delete_file_1);
+ return NILP (tem);
}
\f
DEFUN ("rename-file", Frename_file, Srename_file, 2, 3,
bool
check_existing (const char *filename)
{
-#ifdef DOS_NT
- /* The full emulation of Posix 'stat' is too expensive on
- DOS/Windows, when all we want to know is whether the file exists.
- So we use 'access' instead, which is much more lightweight. */
- return (access (filename, F_OK) >= 0);
-#else
- struct stat st;
- return (stat (filename, &st) >= 0);
-#endif
+ return faccessat (AT_FDCWD, filename, F_OK, AT_EACCESS) == 0;
}
/* Return true if file FILENAME exists and can be executed. */
static bool
check_executable (char *filename)
{
-#ifdef DOS_NT
- struct stat st;
- if (stat (filename, &st) < 0)
- return 0;
- return ((st.st_mode & S_IEXEC) != 0);
-#else /* not DOS_NT */
-#ifdef HAVE_EUIDACCESS
- return (euidaccess (filename, 1) >= 0);
-#else
- /* Access isn't quite right because it uses the real uid
- and we really want to test with the effective uid.
- But Unix doesn't give us a right way to do it. */
- return (access (filename, 1) >= 0);
-#endif
-#endif /* not DOS_NT */
+ return faccessat (AT_FDCWD, filename, X_OK, AT_EACCESS) == 0;
}
-/* Return true if file FILENAME exists and can be written. */
+/* Return true if file FILENAME exists and can be accessed
+ according to AMODE, which should include W_OK.
+ On failure, return false and set errno. */
static bool
-check_writable (const char *filename)
+check_writable (const char *filename, int amode)
{
#ifdef MSDOS
+ /* FIXME: an faccessat implementation should be added to the
+ DOS/Windows ports and this #ifdef branch should be removed. */
struct stat st;
if (stat (filename, &st) < 0)
return 0;
+ errno = EPERM;
return (st.st_mode & S_IWRITE || S_ISDIR (st.st_mode));
#else /* not MSDOS */
-#ifdef HAVE_EUIDACCESS
- bool res = (euidaccess (filename, 2) >= 0);
+ bool res = faccessat (AT_FDCWD, filename, amode, AT_EACCESS) == 0;
#ifdef CYGWIN
- /* euidaccess may have returned failure because Cygwin couldn't
+ /* faccessat may have returned failure because Cygwin couldn't
determine the file's UID or GID; if so, we return success. */
if (!res)
{
+ int faccessat_errno = errno;
struct stat st;
if (stat (filename, &st) < 0)
return 0;
res = (st.st_uid == -1 || st.st_gid == -1);
+ errno = faccessat_errno;
}
#endif /* CYGWIN */
return res;
-#else /* not HAVE_EUIDACCESS */
- /* Access isn't quite right because it uses the real uid
- and we really want to test with the effective uid.
- But Unix doesn't give us a right way to do it.
- Opening with O_WRONLY could work for an ordinary file,
- but would lose for directories. */
- return (access (filename, 2) >= 0);
-#endif /* not HAVE_EUIDACCESS */
#endif /* not MSDOS */
}
{
Lisp_Object absname;
Lisp_Object handler;
- int desc;
- int flags;
- struct stat statbuf;
CHECK_STRING (filename);
absname = Fexpand_file_name (filename, Qnil);
return call2 (handler, Qfile_readable_p, absname);
absname = ENCODE_FILE (absname);
-
-#if defined (DOS_NT) || defined (macintosh)
- /* Under MS-DOS, Windows, and Macintosh, open does not work for
- directories. */
- if (access (SDATA (absname), 0) == 0)
- return Qt;
- return Qnil;
-#else /* not DOS_NT and not macintosh */
- flags = O_RDONLY;
-#ifdef O_NONBLOCK
- /* Opening a fifo without O_NONBLOCK can wait.
- We don't want to wait. But we don't want to mess wth O_NONBLOCK
- except in the case of a fifo, on a system which handles it. */
- desc = stat (SSDATA (absname), &statbuf);
- if (desc < 0)
- return Qnil;
- if (S_ISFIFO (statbuf.st_mode))
- flags |= O_NONBLOCK;
-#endif
- desc = emacs_open (SSDATA (absname), flags, 0);
- if (desc < 0)
- return Qnil;
- emacs_close (desc);
- return Qt;
-#endif /* not DOS_NT and not macintosh */
+ return (faccessat (AT_FDCWD, SSDATA (absname), R_OK, AT_EACCESS) == 0
+ ? Qt : Qnil);
}
-/* Having this before file-symlink-p mysteriously caused it to be forgotten
- on the RT/PC. */
DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
doc: /* Return t if file FILENAME can be written or created by you. */)
(Lisp_Object filename)
return call2 (handler, Qfile_writable_p, absname);
encoded = ENCODE_FILE (absname);
- if (check_existing (SSDATA (encoded)))
- return (check_writable (SSDATA (encoded))
- ? Qt : Qnil);
+ if (check_writable (SSDATA (encoded), W_OK))
+ return Qt;
+ if (errno != ENOENT)
+ return Qnil;
dir = Ffile_name_directory (absname);
+ eassert (!NILP (dir));
#ifdef MSDOS
- if (!NILP (dir))
- dir = Fdirectory_file_name (dir);
+ dir = Fdirectory_file_name (dir);
#endif /* MSDOS */
dir = ENCODE_FILE (dir);
/* The read-only attribute of the parent directory doesn't affect
whether a file or directory can be created within it. Some day we
should check ACLs though, which do affect this. */
- return (access (SDATA (dir), D_OK) < 0) ? Qnil : Qt;
+ return file_directory_p (SDATA (dir)) ? Qt : Qnil;
#else
- return (check_writable (!NILP (dir) ? SSDATA (dir) : "")
- ? Qt : Qnil);
+ return check_writable (SSDATA (dir), W_OK | X_OK) ? Qt : Qnil;
#endif
}
\f
See `file-symlink-p' to distinguish symlinks. */)
(Lisp_Object filename)
{
- register Lisp_Object absname;
- struct stat st;
+ Lisp_Object absname;
Lisp_Object handler;
absname = expand_and_dir_to_file (filename, BVAR (current_buffer, directory));
absname = ENCODE_FILE (absname);
- if (stat (SSDATA (absname), &st) < 0)
- return Qnil;
- return S_ISDIR (st.st_mode) ? Qt : Qnil;
+ return file_directory_p (SSDATA (absname)) ? Qt : Qnil;
+}
+
+/* Return true if FILE is a directory or a symlink to a directory. */
+bool
+file_directory_p (char const *file)
+{
+#ifdef WINDOWSNT
+ /* This is cheaper than 'stat'. */
+ return faccessat (AT_FDCWD, file, D_OK, AT_EACCESS) == 0;
+#else
+ struct stat st;
+ return stat (file, &st) == 0 && S_ISDIR (st.st_mode);
+#endif
}
DEFUN ("file-accessible-directory-p", Ffile_accessible_directory_p,
searchable directory. */)
(Lisp_Object filename)
{
+ Lisp_Object absname;
Lisp_Object handler;
- bool tem;
- struct gcpro gcpro1;
+
+ CHECK_STRING (filename);
+ absname = Fexpand_file_name (filename, Qnil);
/* If the file name has special constructs in it,
call the corresponding file handler. */
- handler = Ffind_file_name_handler (filename, Qfile_accessible_directory_p);
+ handler = Ffind_file_name_handler (absname, Qfile_accessible_directory_p);
if (!NILP (handler))
- return call2 (handler, Qfile_accessible_directory_p, filename);
+ return call2 (handler, Qfile_accessible_directory_p, absname);
- GCPRO1 (filename);
- tem = (NILP (Ffile_directory_p (filename))
- || NILP (Ffile_executable_p (filename)));
- UNGCPRO;
- return tem ? Qnil : Qt;
+ absname = ENCODE_FILE (absname);
+ return file_accessible_directory_p (SSDATA (absname)) ? Qt : Qnil;
+}
+
+/* If FILE is a searchable directory or a symlink to a
+ searchable directory, return true. Otherwise return
+ false and set errno to an error number. */
+bool
+file_accessible_directory_p (char const *file)
+{
+#ifdef DOS_NT
+ /* There's no need to test whether FILE is searchable, as the
+ searchable/executable bit is invented on DOS_NT platforms. */
+ return file_directory_p (file);
+#else
+ /* On POSIXish platforms, use just one system call; this avoids a
+ race and is typically faster. */
+ ptrdiff_t len = strlen (file);
+ char const *dir;
+ bool ok;
+ int saved_errno;
+ USE_SAFE_ALLOCA;
+
+ /* Normally a file "FOO" is an accessible directory if "FOO/." exists.
+ There are three exceptions: "", "/", and "//". Leave "" alone,
+ as it's invalid. Append only "." to the other two exceptions as
+ "/" and "//" are distinct on some platforms, whereas "/", "///",
+ "////", etc. are all equivalent. */
+ if (! len)
+ dir = file;
+ else
+ {
+ /* Just check for trailing '/' when deciding whether to append '/'.
+ That's simpler than testing the two special cases "/" and "//",
+ and it's a safe optimization here. */
+ char *buf = SAFE_ALLOCA (len + 3);
+ memcpy (buf, file, len);
+ strcpy (buf + len, "/." + (file[len - 1] == '/'));
+ dir = buf;
+ }
+
+ ok = check_existing (dir);
+ saved_errno = errno;
+ SAFE_FREE ();
+ errno = saved_errno;
+ return ok;
+#endif
}
DEFUN ("file-regular-p", Ffile_regular_p, Sfile_regular_p, 1, 1, 0,
CONTEXT should be a list (USER ROLE TYPE RANGE), where the list
elements are strings naming the components of a SELinux context.
-This function does nothing if SELinux is disabled, or if Emacs was not
-compiled with SELinux support. */)
+Value is t if setting of SELinux context was successful, nil otherwise.
+
+This function does nothing and returns nil if SELinux is disabled,
+or if Emacs was not compiled with SELinux support. */)
(Lisp_Object filename, Lisp_Object context)
{
Lisp_Object absname;
context_free (parsed_con);
freecon (con);
+ return fail ? Qnil : Qt;
}
else
report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil));
return Qnil;
}
\f
+DEFUN ("file-acl", Ffile_acl, Sfile_acl, 1, 1, 0,
+ doc: /* Return ACL entries of file named FILENAME.
+The entries are returned in a format suitable for use in `set-file-acl'
+but is otherwise undocumented and subject to change.
+Return nil if file does not exist or is not accessible, or if Emacs
+was unable to determine the ACL entries. */)
+ (Lisp_Object filename)
+{
+ Lisp_Object absname;
+ Lisp_Object handler;
+#ifdef HAVE_POSIX_ACL
+ acl_t acl;
+ Lisp_Object acl_string;
+ char *str;
+#endif
+
+ absname = expand_and_dir_to_file (filename,
+ BVAR (current_buffer, directory));
+
+ /* If the file name has special constructs in it,
+ call the corresponding file handler. */
+ handler = Ffind_file_name_handler (absname, Qfile_acl);
+ if (!NILP (handler))
+ return call2 (handler, Qfile_acl, absname);
+
+#ifdef HAVE_POSIX_ACL
+ absname = ENCODE_FILE (absname);
+
+ acl = acl_get_file (SSDATA (absname), ACL_TYPE_ACCESS);
+ if (acl == NULL)
+ return Qnil;
+
+ str = acl_to_text (acl, NULL);
+ if (str == NULL)
+ {
+ acl_free (acl);
+ return Qnil;
+ }
+
+ acl_string = build_string (str);
+ acl_free (str);
+ acl_free (acl);
+
+ return acl_string;
+#endif
+
+ return Qnil;
+}
+
+DEFUN ("set-file-acl", Fset_file_acl, Sset_file_acl,
+ 2, 2, 0,
+ doc: /* Set ACL of file named FILENAME to ACL-STRING.
+ACL-STRING should contain the textual representation of the ACL
+entries in a format suitable for the platform.
+
+Value is t if setting of ACL was successful, nil otherwise.
+
+Setting ACL for local files requires Emacs to be built with ACL
+support. */)
+ (Lisp_Object filename, Lisp_Object acl_string)
+{
+ Lisp_Object absname;
+ Lisp_Object handler;
+#ifdef HAVE_POSIX_ACL
+ Lisp_Object encoded_absname;
+ acl_t acl;
+ bool fail;
+#endif
+
+ absname = Fexpand_file_name (filename, BVAR (current_buffer, directory));
+
+ /* If the file name has special constructs in it,
+ call the corresponding file handler. */
+ handler = Ffind_file_name_handler (absname, Qset_file_acl);
+ if (!NILP (handler))
+ return call3 (handler, Qset_file_acl, absname, acl_string);
+
+#ifdef HAVE_POSIX_ACL
+ if (STRINGP (acl_string))
+ {
+ acl = acl_from_text (SSDATA (acl_string));
+ if (acl == NULL)
+ {
+ report_file_error ("Converting ACL", Fcons (absname, Qnil));
+ return Qnil;
+ }
+
+ encoded_absname = ENCODE_FILE (absname);
+
+ fail = (acl_set_file (SSDATA (encoded_absname), ACL_TYPE_ACCESS,
+ acl)
+ != 0);
+ if (fail && errno != ENOTSUP)
+ report_file_error ("Setting ACL", Fcons (absname, Qnil));
+
+ acl_free (acl);
+ return fail ? Qnil : Qt;
+ }
+#endif
+
+ return Qnil;
+}
+\f
DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0,
doc: /* Return mode bits of file named FILENAME, as an integer.
Return nil, if file does not exist or is not accessible. */)
if (set_file_times (-1, SSDATA (encoded_absname), t, t))
{
#ifdef MSDOS
- struct stat st;
-
/* Setting times on a directory always fails. */
- if (stat (SSDATA (encoded_absname), &st) == 0 && S_ISDIR (st.st_mode))
+ if (file_directory_p (SSDATA (encoded_absname)))
return Qnil;
#endif
report_file_error ("Setting file times", Fcons (absname, Qnil));
else
{
nread = emacs_read (fd, read_buf, 1024);
- if (nread >= 0)
+ if (nread == 1024)
{
- if (lseek (fd, st.st_size - (1024 * 3), SEEK_SET) < 0)
+ int ntail;
+ if (lseek (fd, - (1024 * 3), SEEK_END) < 0)
report_file_error ("Setting file position",
Fcons (orig_filename, Qnil));
- nread += emacs_read (fd, read_buf + nread, 1024 * 3);
+ ntail = emacs_read (fd, read_buf + nread, 1024 * 3);
+ nread = ntail < 0 ? ntail : nread + ntail;
}
}
prepare_to_modify_buffer (GPT, GPT, NULL);
}
- move_gap (PT);
+ move_gap_both (PT, PT_BYTE);
if (GAP_SIZE < total)
make_gap (total - GAP_SIZE);
struct stat st;
Lisp_Object handler;
Lisp_Object filename;
- EMACS_TIME mtime, diff;
+ EMACS_TIME mtime;
if (NILP (buf))
b = current_buffer;
mtime = (stat (SSDATA (filename), &st) == 0
? get_stat_mtime (&st)
: time_error_value (errno));
- if ((EMACS_TIME_EQ (mtime, b->modtime)
- /* If both exist, accept them if they are off by one second. */
- || (EMACS_TIME_VALID_P (mtime) && EMACS_TIME_VALID_P (b->modtime)
- && ((diff = (EMACS_TIME_LT (mtime, b->modtime)
- ? sub_emacs_time (b->modtime, mtime)
- : sub_emacs_time (mtime, b->modtime))),
- EMACS_TIME_LE (diff, make_emacs_time (1, 0)))))
+ if (EMACS_TIME_EQ (mtime, b->modtime)
&& (b->modtime_size < 0
|| st.st_size == b->modtime_size))
return Qt;
DEFSYM (Qset_file_times, "set-file-times");
DEFSYM (Qfile_selinux_context, "file-selinux-context");
DEFSYM (Qset_file_selinux_context, "set-file-selinux-context");
+ DEFSYM (Qfile_acl, "file-acl");
+ DEFSYM (Qset_file_acl, "set-file-acl");
DEFSYM (Qfile_newer_than_file_p, "file-newer-than-file-p");
DEFSYM (Qinsert_file_contents, "insert-file-contents");
DEFSYM (Qwrite_region, "write-region");
defsubr (&Sset_file_modes);
defsubr (&Sset_file_times);
defsubr (&Sfile_selinux_context);
+ defsubr (&Sfile_acl);
+ defsubr (&Sset_file_acl);
defsubr (&Sset_file_selinux_context);
defsubr (&Sset_default_file_modes);
defsubr (&Sdefault_file_modes);
odd. */
EMACS_INT q = i1 / i2;
EMACS_INT r = i1 % i2;
- EMACS_INT abs_r = r < 0 ? -r : r;
- EMACS_INT abs_r1 = (i2 < 0 ? -i2 : i2) - abs_r;
+ EMACS_INT abs_r = eabs (r);
+ EMACS_INT abs_r1 = eabs (i2) - abs_r;
return q + (abs_r + (q & 1) <= abs_r1 ? 0 : (i2 ^ r) < 0 ? -1 : 1);
}
before it's time to do a QUIT. This must be a power of 2. */
enum { QUIT_COUNT_HEURISTIC = 1 << 16 };
-/* Random data-structure functions */
+/* Random data-structure functions. */
DEFUN ("length", Flength, Slength, 1, 1, 0,
doc: /* Return the length of vector, list or string SEQUENCE.
d1 = extract_float (o1);
d2 = extract_float (o2);
/* If d is a NaN, then d != d. Two NaNs should be `equal' even
- though they are not =. */
+ though they are not =. */
return d1 == d2 || (d1 != d1 && d2 != d2);
}
are sensible to compare, so eliminate the others now. */
if (size & PSEUDOVECTOR_FLAG)
{
- if (!(size & ((PVEC_COMPILED | PVEC_CHAR_TABLE
- | PVEC_SUB_CHAR_TABLE | PVEC_FONT)
- << PSEUDOVECTOR_SIZE_BITS)))
+ if (((size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS)
+ < PVEC_COMPILED)
return 0;
size &= PSEUDOVECTOR_SIZE_MASK;
}
/* Various symbols. */
-static Lisp_Object Qhash_table_p, Qkey, Qvalue;
-Lisp_Object Qeq, Qeql, Qequal;
+static Lisp_Object Qhash_table_p, Qkey, Qvalue, Qeql;
+Lisp_Object Qeq, Qequal;
Lisp_Object QCtest, QCsize, QCrehash_size, QCrehash_threshold, QCweakness;
static Lisp_Object Qhash_table_test, Qkey_or_value, Qkey_and_value;
Low-level Functions
***********************************************************************/
+static struct hash_table_test hashtest_eq;
+struct hash_table_test hashtest_eql, hashtest_equal;
+
/* Compare KEY1 which has hash code HASH1 and KEY2 with hash code
HASH2 in hash table H using `eql'. Value is true if KEY1 and
KEY2 are the same. */
static bool
-cmpfn_eql (struct Lisp_Hash_Table *h,
- Lisp_Object key1, EMACS_UINT hash1,
- Lisp_Object key2, EMACS_UINT hash2)
+cmpfn_eql (struct hash_table_test *ht,
+ Lisp_Object key1,
+ Lisp_Object key2)
{
return (FLOATP (key1)
&& FLOATP (key2)
KEY2 are the same. */
static bool
-cmpfn_equal (struct Lisp_Hash_Table *h,
- Lisp_Object key1, EMACS_UINT hash1,
- Lisp_Object key2, EMACS_UINT hash2)
+cmpfn_equal (struct hash_table_test *ht,
+ Lisp_Object key1,
+ Lisp_Object key2)
{
- return hash1 == hash2 && !NILP (Fequal (key1, key2));
+ return !NILP (Fequal (key1, key2));
}
if KEY1 and KEY2 are the same. */
static bool
-cmpfn_user_defined (struct Lisp_Hash_Table *h,
- Lisp_Object key1, EMACS_UINT hash1,
- Lisp_Object key2, EMACS_UINT hash2)
+cmpfn_user_defined (struct hash_table_test *ht,
+ Lisp_Object key1,
+ Lisp_Object key2)
{
- if (hash1 == hash2)
- {
- Lisp_Object args[3];
+ Lisp_Object args[3];
- args[0] = h->user_cmp_function;
- args[1] = key1;
- args[2] = key2;
- return !NILP (Ffuncall (3, args));
- }
- else
- return 0;
+ args[0] = ht->user_cmp_function;
+ args[1] = key1;
+ args[2] = key2;
+ return !NILP (Ffuncall (3, args));
}
in a Lisp integer. */
static EMACS_UINT
-hashfn_eq (struct Lisp_Hash_Table *h, Lisp_Object key)
+hashfn_eq (struct hash_table_test *ht, Lisp_Object key)
{
- EMACS_UINT hash = XUINT (key) ^ XTYPE (key);
- eassert ((hash & ~INTMASK) == 0);
+ EMACS_UINT hash = XHASH (key) ^ XTYPE (key);
return hash;
}
-
/* Value is a hash code for KEY for use in hash table H which uses
`eql' to compare keys. The hash code returned is guaranteed to fit
in a Lisp integer. */
static EMACS_UINT
-hashfn_eql (struct Lisp_Hash_Table *h, Lisp_Object key)
+hashfn_eql (struct hash_table_test *ht, Lisp_Object key)
{
EMACS_UINT hash;
if (FLOATP (key))
hash = sxhash (key, 0);
else
- hash = XUINT (key) ^ XTYPE (key);
- eassert ((hash & ~INTMASK) == 0);
+ hash = XHASH (key) ^ XTYPE (key);
return hash;
}
-
/* Value is a hash code for KEY for use in hash table H which uses
`equal' to compare keys. The hash code returned is guaranteed to fit
in a Lisp integer. */
static EMACS_UINT
-hashfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key)
+hashfn_equal (struct hash_table_test *ht, Lisp_Object key)
{
EMACS_UINT hash = sxhash (key, 0);
- eassert ((hash & ~INTMASK) == 0);
return hash;
}
-
/* Value is a hash code for KEY for use in hash table H which uses as
user-defined function to compare keys. The hash code returned is
guaranteed to fit in a Lisp integer. */
static EMACS_UINT
-hashfn_user_defined (struct Lisp_Hash_Table *h, Lisp_Object key)
+hashfn_user_defined (struct hash_table_test *ht, Lisp_Object key)
{
Lisp_Object args[2], hash;
- args[0] = h->user_hash_function;
+ args[0] = ht->user_hash_function;
args[1] = key;
hash = Ffuncall (2, args);
if (!INTEGERP (hash))
one of the symbols `key', `value', `key-or-value', or `key-and-value'. */
Lisp_Object
-make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size,
- Lisp_Object rehash_threshold, Lisp_Object weak,
- Lisp_Object user_test, Lisp_Object user_hash)
+make_hash_table (struct hash_table_test test,
+ Lisp_Object size, Lisp_Object rehash_size,
+ Lisp_Object rehash_threshold, Lisp_Object weak)
{
struct Lisp_Hash_Table *h;
Lisp_Object table;
double index_float;
/* Preconditions. */
- eassert (SYMBOLP (test));
+ eassert (SYMBOLP (test.name));
eassert (INTEGERP (size) && XINT (size) >= 0);
eassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0)
|| (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size)));
/* Initialize hash table slots. */
h->test = test;
- if (EQ (test, Qeql))
- {
- h->cmpfn = cmpfn_eql;
- h->hashfn = hashfn_eql;
- }
- else if (EQ (test, Qeq))
- {
- h->cmpfn = NULL;
- h->hashfn = hashfn_eq;
- }
- else if (EQ (test, Qequal))
- {
- h->cmpfn = cmpfn_equal;
- h->hashfn = hashfn_equal;
- }
- else
- {
- h->user_cmp_function = user_test;
- h->user_hash_function = user_hash;
- h->cmpfn = cmpfn_user_defined;
- h->hashfn = hashfn_user_defined;
- }
-
h->weak = weak;
h->rehash_threshold = rehash_threshold;
h->rehash_size = rehash_size;
{
Lisp_Object table;
struct Lisp_Hash_Table *h2;
- struct Lisp_Vector *next;
h2 = allocate_hash_table ();
- next = h2->header.next.vector;
*h2 = *h1;
- h2->header.next.vector = next;
h2->key_and_value = Fcopy_sequence (h1->key_and_value);
h2->hash = Fcopy_sequence (h1->hash);
h2->next = Fcopy_sequence (h1->next);
ptrdiff_t start_of_bucket;
Lisp_Object idx;
- hash_code = h->hashfn (h, key);
+ hash_code = h->test.hashfn (&h->test, key);
+ eassert ((hash_code & ~INTMASK) == 0);
if (hash)
*hash = hash_code;
{
ptrdiff_t i = XFASTINT (idx);
if (EQ (key, HASH_KEY (h, i))
- || (h->cmpfn
- && h->cmpfn (h, key, hash_code,
- HASH_KEY (h, i), XUINT (HASH_HASH (h, i)))))
+ || (h->test.cmpfn
+ && hash_code == XUINT (HASH_HASH (h, i))
+ && h->test.cmpfn (&h->test, key, HASH_KEY (h, i))))
break;
idx = HASH_NEXT (h, i);
}
ptrdiff_t start_of_bucket;
Lisp_Object idx, prev;
- hash_code = h->hashfn (h, key);
+ hash_code = h->test.hashfn (&h->test, key);
+ eassert ((hash_code & ~INTMASK) == 0);
start_of_bucket = hash_code % ASIZE (h->index);
idx = HASH_INDEX (h, start_of_bucket);
prev = Qnil;
ptrdiff_t i = XFASTINT (idx);
if (EQ (key, HASH_KEY (h, i))
- || (h->cmpfn
- && h->cmpfn (h, key, hash_code,
- HASH_KEY (h, i), XUINT (HASH_HASH (h, i)))))
+ || (h->test.cmpfn
+ && hash_code == XUINT (HASH_HASH (h, i))
+ && h->test.cmpfn (&h->test, key, HASH_KEY (h, i))))
{
/* Take entry out of collision chain. */
if (NILP (prev))
#define SXHASH_MAX_LEN 7
-/* Combine two integers X and Y for hashing. The result might not fit
- into a Lisp integer. */
-
-#define SXHASH_COMBINE(X, Y) \
- ((((EMACS_UINT) (X) << 4) + ((EMACS_UINT) (X) >> (BITS_PER_EMACS_INT - 4))) \
- + (EMACS_UINT) (Y))
-
/* Hash X, returning a value that fits into a Lisp integer. */
#define SXHASH_REDUCE(X) \
((((X) ^ (X) >> (BITS_PER_EMACS_INT - FIXNUM_BITS))) & INTMASK)
while (p != end)
{
c = *p++;
- hash = SXHASH_COMBINE (hash, c);
+ hash = sxhash_combine (hash, c);
}
return hash;
u.val = val;
memset (&u.val + 1, 0, sizeof u - sizeof u.val);
for (i = 0; i < WORDS_PER_DOUBLE; i++)
- hash = SXHASH_COMBINE (hash, u.word[i]);
+ hash = sxhash_combine (hash, u.word[i]);
return SXHASH_REDUCE (hash);
}
list = XCDR (list), ++i)
{
EMACS_UINT hash2 = sxhash (XCAR (list), depth + 1);
- hash = SXHASH_COMBINE (hash, hash2);
+ hash = sxhash_combine (hash, hash2);
}
if (!NILP (list))
{
EMACS_UINT hash2 = sxhash (list, depth + 1);
- hash = SXHASH_COMBINE (hash, hash2);
+ hash = sxhash_combine (hash, hash2);
}
return SXHASH_REDUCE (hash);
for (i = 0; i < n; ++i)
{
EMACS_UINT hash2 = sxhash (AREF (vec, i), depth + 1);
- hash = SXHASH_COMBINE (hash, hash2);
+ hash = sxhash_combine (hash, hash2);
}
return SXHASH_REDUCE (hash);
n = min (SXHASH_MAX_LEN, XBOOL_VECTOR (vec)->header.size);
for (i = 0; i < n; ++i)
- hash = SXHASH_COMBINE (hash, XBOOL_VECTOR (vec)->data[i]);
+ hash = sxhash_combine (hash, XBOOL_VECTOR (vec)->data[i]);
return SXHASH_REDUCE (hash);
}
break;
case Lisp_Misc:
- hash = XUINT (obj);
+ hash = XHASH (obj);
break;
case Lisp_Symbol:
else
/* Others are `equal' if they are `eq', so let's take their
address as hash. */
- hash = XUINT (obj);
+ hash = XHASH (obj);
break;
case Lisp_Cons:
(ptrdiff_t nargs, Lisp_Object *args)
{
Lisp_Object test, size, rehash_size, rehash_threshold, weak;
- Lisp_Object user_test, user_hash;
+ struct hash_table_test testdesc;
char *used;
ptrdiff_t i;
/* See if there's a `:test TEST' among the arguments. */
i = get_key_arg (QCtest, nargs, args, used);
test = i ? args[i] : Qeql;
- if (!EQ (test, Qeq) && !EQ (test, Qeql) && !EQ (test, Qequal))
+ if (EQ (test, Qeq))
+ testdesc = hashtest_eq;
+ else if (EQ (test, Qeql))
+ testdesc = hashtest_eql;
+ else if (EQ (test, Qequal))
+ testdesc = hashtest_equal;
+ else
{
/* See if it is a user-defined test. */
Lisp_Object prop;
prop = Fget (test, Qhash_table_test);
if (!CONSP (prop) || !CONSP (XCDR (prop)))
signal_error ("Invalid hash table test", test);
- user_test = XCAR (prop);
- user_hash = XCAR (XCDR (prop));
+ testdesc.name = test;
+ testdesc.user_cmp_function = XCAR (prop);
+ testdesc.user_hash_function = XCAR (XCDR (prop));
+ testdesc.hashfn = hashfn_user_defined;
+ testdesc.cmpfn = cmpfn_user_defined;
}
- else
- user_test = user_hash = Qnil;
/* See if there's a `:size SIZE' argument. */
i = get_key_arg (QCsize, nargs, args, used);
if (!used[i])
signal_error ("Invalid argument list", args[i]);
- return make_hash_table (test, size, rehash_size, rehash_threshold, weak,
- user_test, user_hash);
+ return make_hash_table (testdesc, size, rehash_size, rehash_threshold, weak);
}
doc: /* Return the test TABLE uses. */)
(Lisp_Object table)
{
- return check_hash_table (table)->test;
+ return check_hash_table (table)->test.name;
}
defsubr (&Smd5);
defsubr (&Ssecure_hash);
defsubr (&Slocale_info);
+
+ {
+ struct hash_table_test
+ eq = { Qeq, Qnil, Qnil, NULL, hashfn_eq },
+ eql = { Qeql, Qnil, Qnil, cmpfn_eql, hashfn_eql },
+ equal = { Qequal, Qnil, Qnil, cmpfn_equal, hashfn_equal };
+ hashtest_eq = eq;
+ hashtest_eql = eql;
+ hashtest_equal = equal;
+ }
}
f[j] = "*";
else
{
+ int c, k, l;
+ ptrdiff_t alloc;
+
val = SYMBOL_NAME (val);
- f[j] = SSDATA (val);
+ alloc = SBYTES (val) + 1;
+ if (nbytes <= alloc)
+ return -1;
+ f[j] = p = alloca (alloc);
+ /* Copy the name while excluding '-', '?', ',', and '"'. */
+ for (k = l = 0; k < alloc; k++)
+ {
+ c = SREF (val, k);
+ if (c != '-' && c != '?' && c != ',' && c != '"')
+ p[l++] = c;
+ }
}
}
{
EMACS_INT diff = ((XINT (AREF (entity, i)) >> 8)
- (XINT (spec_prop[i]) >> 8));
- if (diff < 0)
- diff = - diff;
- score |= min (diff, 127) << sort_shift_bits[i];
+ score |= min (eabs (diff), 127) << sort_shift_bits[i];
}
/* Score the size. Maximum difference is 127. */
if (CONSP (Vface_font_rescale_alist))
pixel_size *= font_rescale_ratio (entity);
- diff = pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX));
- if (diff < 0)
- diff = - diff;
- diff <<= 1;
+ diff = eabs (pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX))) << 1;
if (! NILP (spec_prop[FONT_DPI_INDEX])
&& ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX)))
diff |= 1;
{
int diff = XINT (AREF (entity, FONT_SIZE_INDEX)) - size;
- if (diff != 0
- && (diff < 0 ? -diff > FONT_PIXEL_SIZE_QUANTUM
- : diff > FONT_PIXEL_SIZE_QUANTUM))
+ if (eabs (diff) > FONT_PIXEL_SIZE_QUANTUM)
prop = FONT_SPEC_MAX;
}
if (prop < FONT_SPEC_MAX
are to be displayed on. If omitted, the selected frame is used. */)
(Lisp_Object font, Lisp_Object frame)
{
- struct frame *f;
+ struct frame *f = decode_live_frame (frame);
Lisp_Object plist[10];
Lisp_Object val;
int n = 0;
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
-
if (STRINGP (font))
{
int fontset = fs_query_fontset (font, 0);
DEFUN ("font-family-list", Ffont_family_list, Sfont_family_list, 0, 1, 0,
doc: /* List available font families on the current frame.
-Optional argument FRAME, if non-nil, specifies the target frame. */)
+If FRAME is omitted or nil, the selected frame is used. */)
(Lisp_Object frame)
{
- FRAME_PTR f;
+ struct frame *f = decode_live_frame (frame);
struct font_driver_list *driver_list;
- Lisp_Object list;
+ Lisp_Object list = Qnil;
+
+ XSETFRAME (frame, f);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
- list = Qnil;
for (driver_list = f->font_driver_list; driver_list;
driver_list = driver_list->next)
if (driver_list->driver->list_family)
(Lisp_Object font_entity, Lisp_Object size, Lisp_Object frame)
{
EMACS_INT isize;
+ struct frame *f = decode_live_frame (frame);
CHECK_FONT_ENTITY (font_entity);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
if (NILP (size))
isize = XINT (AREF (font_entity, FONT_SIZE_INDEX));
{
CHECK_NUMBER_OR_FLOAT (size);
if (FLOATP (size))
- isize = POINT_TO_PIXEL (XFLOAT_DATA (size), XFRAME (frame)->resy);
+ isize = POINT_TO_PIXEL (XFLOAT_DATA (size), f->resy);
else
isize = XINT (size);
if (! (INT_MIN <= isize && isize <= INT_MAX))
if (isize == 0)
isize = 120;
}
- return font_open_entity (XFRAME (frame), font_entity, isize);
+ return font_open_entity (f, font_entity, isize);
}
DEFUN ("close-font", Fclose_font, Sclose_font, 1, 2, 0,
(Lisp_Object font_object, Lisp_Object frame)
{
CHECK_FONT_OBJECT (font_object);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- font_close_object (XFRAME (frame), font_object);
+ font_close_object (decode_live_frame (frame), font_object);
return Qnil;
}
character at index specified by POSITION. */)
(Lisp_Object position, Lisp_Object window, Lisp_Object string)
{
- struct window *w;
- ptrdiff_t pos;
+ struct window *w = decode_live_window (window);
- if (NILP (window))
- window = selected_window;
- CHECK_LIVE_WINDOW (window);
- w = XWINDOW (window);
if (NILP (string))
{
if (XBUFFER (w->buffer) != current_buffer)
CHECK_NUMBER_COERCE_MARKER (position);
if (! (BEGV <= XINT (position) && XINT (position) < ZV))
args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
- pos = XINT (position);
}
else
{
CHECK_STRING (string);
if (! (0 <= XINT (position) && XINT (position) < SCHARS (string)))
args_out_of_range (string, position);
- pos = XINT (position);
}
- return font_at (-1, pos, NULL, w, string);
+ return font_at (-1, XINT (position), NULL, w, string);
}
#if 0
If the named font is not yet loaded, return nil. */)
(Lisp_Object name, Lisp_Object frame)
{
- FRAME_PTR f;
+ struct frame *f;
struct font *font;
Lisp_Object info;
Lisp_Object font_object;
if (! FONTP (name))
CHECK_STRING (name);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
+ f = decode_live_frame (frame);
if (STRINGP (name))
{
check_fontset_name (Lisp_Object name, Lisp_Object *frame)
{
int id;
+ struct frame *f = decode_live_frame (*frame);
- if (NILP (*frame))
- *frame = selected_frame;
- CHECK_LIVE_FRAME (*frame);
+ XSETFRAME (*frame, f);
if (EQ (name, Qt))
return Vdefault_fontset;
if (NILP (name))
- {
- id = FRAME_FONTSET (XFRAME (*frame));
- }
+ id = FRAME_FONTSET (f);
else
{
CHECK_STRING (name);
Lisp_Object Qframep, Qframe_live_p;
Lisp_Object Qicon, Qmodeline;
Lisp_Object Qonly, Qnone;
-Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
+Lisp_Object Qx, Qw32, Qpc, Qns;
Lisp_Object Qvisible;
Lisp_Object Qdisplay_type;
static Lisp_Object Qbackground_mode;
f->minibuffer_window = val;
}
-\f
+struct frame *
+decode_live_frame (register Lisp_Object frame)
+{
+ if (NILP (frame))
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame);
+ return XFRAME (frame);
+}
+
+struct frame *
+decode_any_frame (register Lisp_Object frame)
+{
+ if (NILP (frame))
+ frame = selected_frame;
+ CHECK_FRAME (frame);
+ return XFRAME (frame);
+}
+
static void
set_menu_bar_lines_1 (Lisp_Object window, int n)
{
return Qw32;
case output_msdos_raw:
return Qpc;
- case output_mac:
- return Qmac;
case output_ns:
return Qns;
default:
/* Choose a buffer for the frame's root window. */
{
- Lisp_Object buf;
+ Lisp_Object buf = Fcurrent_buffer ();
- wset_buffer (XWINDOW (root_window), Qt);
- buf = Fcurrent_buffer ();
- /* If buf is a 'hidden' buffer (i.e. one whose name starts with
- a space), try to find another one. */
- if (SREF (Fbuffer_name (buf), 0) == ' ')
+ /* If current buffer is hidden, try to find another one. */
+ if (BUFFER_HIDDEN_P (XBUFFER (buf)))
buf = other_buffer_safely (buf);
/* Use set_window_buffer, not Fset_window_buffer, and don't let
}
if (mini_p)
- {
- wset_buffer (XWINDOW (mini_window), Qt);
- 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);
fset_root_window (f, root_window);
fset_selected_window (f, root_window);
FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
/* The default value of menu-bar-mode is t. */
FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
#endif /* not MSDOS */
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
FRAME_MENU_BAR_LINES(f) = NILP (Vmenu_bar_mode) ? 0 : 1;
return frames;
}
-/* Return the next frame in the frame list after FRAME.
- If MINIBUF is nil, exclude minibuffer-only frames.
- If MINIBUF is a window, include only its own frame
- and any frame now using that window as the minibuffer.
- If MINIBUF is `visible', include all visible frames.
- If MINIBUF is 0, include all visible and iconified frames.
- Otherwise, include all frames. */
+/* Return CANDIDATE if it can be used as 'other-than-FRAME' frame on the
+ same tty (for tty frames) or among frames which uses FRAME's keyboard.
+ If MINIBUF is nil, do not consider minibuffer-only candidate.
+ If MINIBUF is `visible', do not consider an invisible candidate.
+ If MINIBUF is a window, consider only its own frame and candidate now
+ using that window as the minibuffer.
+ If MINIBUF is 0, consider candidate if it is visible or iconified.
+ Otherwise consider any candidate and return nil if CANDIDATE is not
+ acceptable. */
+
+static Lisp_Object
+candidate_frame (Lisp_Object candidate, Lisp_Object frame, Lisp_Object minibuf)
+{
+ struct frame *c = XFRAME (candidate), *f = XFRAME (frame);
+
+ if ((!FRAME_TERMCAP_P (c) && !FRAME_TERMCAP_P (f)
+ && FRAME_KBOARD (c) == FRAME_KBOARD (f))
+ || (FRAME_TERMCAP_P (c) && FRAME_TERMCAP_P (f)
+ && FRAME_TTY (c) == FRAME_TTY (f)))
+ {
+ if (NILP (minibuf))
+ {
+ if (!FRAME_MINIBUF_ONLY_P (c))
+ return candidate;
+ }
+ else if (EQ (minibuf, Qvisible))
+ {
+ FRAME_SAMPLE_VISIBILITY (c);
+ if (FRAME_VISIBLE_P (c))
+ return candidate;
+ }
+ else if (WINDOWP (minibuf))
+ {
+ if (EQ (FRAME_MINIBUF_WINDOW (c), minibuf)
+ || EQ (WINDOW_FRAME (XWINDOW (minibuf)), candidate)
+ || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
+ FRAME_FOCUS_FRAME (c)))
+ return candidate;
+ }
+ else if (XFASTINT (minibuf) == 0)
+ {
+ FRAME_SAMPLE_VISIBILITY (c);
+ if (FRAME_VISIBLE_P (c) || FRAME_ICONIFIED_P (c))
+ return candidate;
+ }
+ else
+ return candidate;
+ }
+ return Qnil;
+}
+
+/* Return the next frame in the frame list after FRAME. */
static Lisp_Object
next_frame (Lisp_Object frame, Lisp_Object minibuf)
{
- Lisp_Object tail;
+ Lisp_Object f, tail;
int passed = 0;
/* There must always be at least one frame in Vframe_list. */
- if (! CONSP (Vframe_list))
- emacs_abort ();
-
- /* If this frame is dead, it won't be in Vframe_list, and we'll loop
- forever. Forestall that. */
- CHECK_LIVE_FRAME (frame);
+ eassert (CONSP (Vframe_list));
- while (1)
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ while (passed < 2)
+ FOR_EACH_FRAME (tail, f)
{
- Lisp_Object f;
-
- f = XCAR (tail);
-
- if (passed
- && ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
- || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame)))))
+ if (passed)
{
- /* Decide whether this frame is eligible to be returned. */
-
- /* If we've looped all the way around without finding any
- eligible frames, return the original frame. */
- if (EQ (f, frame))
- return f;
-
- /* Let minibuf decide if this frame is acceptable. */
- if (NILP (minibuf))
- {
- if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
- return f;
- }
- else if (EQ (minibuf, Qvisible))
- {
- FRAME_SAMPLE_VISIBILITY (XFRAME (f));
- if (FRAME_VISIBLE_P (XFRAME (f)))
- return f;
- }
- else if (INTEGERP (minibuf) && XINT (minibuf) == 0)
- {
- FRAME_SAMPLE_VISIBILITY (XFRAME (f));
- if (FRAME_VISIBLE_P (XFRAME (f))
- || FRAME_ICONIFIED_P (XFRAME (f)))
- return f;
- }
- else if (WINDOWP (minibuf))
- {
- if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
- || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
- || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
- FRAME_FOCUS_FRAME (XFRAME (f))))
- return f;
- }
- else
+ f = candidate_frame (f, frame, minibuf);
+ if (!NILP (f))
return f;
}
-
if (EQ (frame, f))
passed++;
}
+ return frame;
}
-/* Return the previous frame in the frame list before FRAME.
- If MINIBUF is nil, exclude minibuffer-only frames.
- If MINIBUF is a window, include only its own frame
- and any frame now using that window as the minibuffer.
- If MINIBUF is `visible', include all visible frames.
- If MINIBUF is 0, include all visible and iconified frames.
- Otherwise, include all frames. */
+/* Return the previous frame in the frame list before FRAME. */
static Lisp_Object
prev_frame (Lisp_Object frame, Lisp_Object minibuf)
{
- Lisp_Object tail;
- Lisp_Object prev;
+ Lisp_Object f, tail, prev = Qnil;
/* There must always be at least one frame in Vframe_list. */
- if (! CONSP (Vframe_list))
- emacs_abort ();
+ eassert (CONSP (Vframe_list));
- prev = Qnil;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, f)
{
- Lisp_Object f;
-
- f = XCAR (tail);
- if (!FRAMEP (f))
- emacs_abort ();
-
if (EQ (frame, f) && !NILP (prev))
return prev;
-
- if ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
- || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame))))
- {
- /* Decide whether this frame is eligible to be returned,
- according to minibuf. */
- if (NILP (minibuf))
- {
- if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
- prev = f;
- }
- else if (WINDOWP (minibuf))
- {
- if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
- || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
- || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
- FRAME_FOCUS_FRAME (XFRAME (f))))
- prev = f;
- }
- else if (EQ (minibuf, Qvisible))
- {
- FRAME_SAMPLE_VISIBILITY (XFRAME (f));
- if (FRAME_VISIBLE_P (XFRAME (f)))
- prev = f;
- }
- else if (XFASTINT (minibuf) == 0)
- {
- FRAME_SAMPLE_VISIBILITY (XFRAME (f));
- if (FRAME_VISIBLE_P (XFRAME (f))
- || FRAME_ICONIFIED_P (XFRAME (f)))
- prev = f;
- }
- else
- prev = f;
- }
+ f = candidate_frame (f, frame, minibuf);
+ if (!NILP (f))
+ prev = f;
}
/* We've scanned the entire list. */
{
if (NILP (frame))
frame = selected_frame;
-
CHECK_LIVE_FRAME (frame);
return next_frame (frame, miniframe);
}
static int
other_visible_frames (FRAME_PTR f)
{
- Lisp_Object frames;
+ Lisp_Object frames, this;
- for (frames = Vframe_list; CONSP (frames); frames = XCDR (frames))
+ FOR_EACH_FRAME (frames, this)
{
- Lisp_Object this = XCAR (frames);
if (f == XFRAME (this))
continue;
Lisp_Object
delete_frame (Lisp_Object frame, Lisp_Object force)
{
- struct frame *f;
+ struct frame *f = decode_any_frame (frame);
struct frame *sf = SELECTED_FRAME ();
struct kboard *kb;
int minibuffer_selected, is_tooltip_frame;
- if (EQ (frame, Qnil))
- {
- f = sf;
- XSETFRAME (frame, f);
- }
- else
- {
- CHECK_FRAME (frame);
- f = XFRAME (frame);
- }
-
if (! FRAME_LIVE_P (f))
return Qnil;
if (NILP (XCDR (Vframe_list)) && !EQ (force, Qnoelisp))
error ("Attempt to delete the only frame");
+ XSETFRAME (frame, f);
+
/* Does this frame have a minibuffer, and is it the surrogate
minibuffer for any other frame? */
- if (FRAME_HAS_MINIBUF_P (XFRAME (frame)))
+ if (FRAME_HAS_MINIBUF_P (f))
{
- Lisp_Object frames;
+ Lisp_Object frames, this;
- for (frames = Vframe_list;
- CONSP (frames);
- frames = XCDR (frames))
+ FOR_EACH_FRAME (frames, this)
{
- Lisp_Object this;
- this = XCAR (frames);
-
if (! EQ (this, frame)
&& EQ (frame,
WINDOW_FRAME (XWINDOW
another one. */
if (f == last_nonminibuf_frame)
{
- Lisp_Object frames;
+ Lisp_Object frames, this;
last_nonminibuf_frame = 0;
- for (frames = Vframe_list;
- CONSP (frames);
- frames = XCDR (frames))
+ FOR_EACH_FRAME (frames, this)
{
- f = XFRAME (XCAR (frames));
+ f = XFRAME (this);
if (!FRAME_MINIBUF_ONLY_P (f))
{
last_nonminibuf_frame = f;
single-kboard state if we're in it for this kboard. */
if (kb != NULL)
{
- Lisp_Object frames;
+ Lisp_Object frames, this;
/* Some frame we found on the same kboard, or nil if there are none. */
- Lisp_Object frame_on_same_kboard;
-
- frame_on_same_kboard = Qnil;
-
- for (frames = Vframe_list;
- CONSP (frames);
- frames = XCDR (frames))
- {
- Lisp_Object this;
- struct frame *f1;
-
- this = XCAR (frames);
- if (!FRAMEP (this))
- emacs_abort ();
- f1 = XFRAME (this);
+ Lisp_Object frame_on_same_kboard = Qnil;
- if (kb == FRAME_KBOARD (f1))
- frame_on_same_kboard = this;
- }
+ FOR_EACH_FRAME (frames, this)
+ if (kb == FRAME_KBOARD (XFRAME (this)))
+ frame_on_same_kboard = this;
if (NILP (frame_on_same_kboard))
not_single_kboard_state (kb);
frames with other windows. */
if (kb != NULL && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame)))
{
- Lisp_Object frames;
+ Lisp_Object frames, this;
/* The last frame we saw with a minibuffer, minibuffer-only or not. */
- Lisp_Object frame_with_minibuf;
+ Lisp_Object frame_with_minibuf = Qnil;
/* Some frame we found on the same kboard, or nil if there are none. */
- Lisp_Object frame_on_same_kboard;
+ Lisp_Object frame_on_same_kboard = Qnil;
- frame_on_same_kboard = Qnil;
- frame_with_minibuf = Qnil;
-
- for (frames = Vframe_list;
- CONSP (frames);
- frames = XCDR (frames))
+ FOR_EACH_FRAME (frames, this)
{
- Lisp_Object this;
- struct frame *f1;
-
- this = XCAR (frames);
- if (!FRAMEP (this))
- emacs_abort ();
- f1 = XFRAME (this);
+ struct frame *f1 = XFRAME (this);
/* Consider only frames on the same kboard
and only those with minibuffers. */
f = SELECTED_FRAME ();
x = y = Qnil;
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
/* It's okay for the hook to refrain from storing anything. */
if (FRAME_TERMINAL (f)->mouse_position_hook)
{
XSETINT (x, col);
XSETINT (y, row);
}
-#endif
XSETFRAME (lispy_dummy, f);
retval = Fcons (lispy_dummy, Fcons (x, y));
GCPRO1 (retval);
f = SELECTED_FRAME ();
x = y = Qnil;
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
/* It's okay for the hook to refrain from storing anything. */
if (FRAME_TERMINAL (f)->mouse_position_hook)
{
&time_dummy);
}
-#endif
XSETFRAME (lispy_dummy, f);
return Fcons (lispy_dummy, Fcons (x, y));
}
/* Warping the mouse will cause enternotify and focus events. */
x_set_mouse_position (XFRAME (frame), XINT (x), XINT (y));
#else
-#if defined (MSDOS) && defined (HAVE_MOUSE)
+#if defined (MSDOS)
if (FRAME_MSDOS_P (XFRAME (frame)))
{
Fselect_frame (frame, Qnil);
/* Warping the mouse will cause enternotify and focus events. */
x_set_mouse_pixel_position (XFRAME (frame), XINT (x), XINT (y));
#else
-#if defined (MSDOS) && defined (HAVE_MOUSE)
+#if defined (MSDOS)
if (FRAME_MSDOS_P (XFRAME (frame)))
{
Fselect_frame (frame, Qnil);
If omitted, FRAME defaults to the currently selected frame. */)
(Lisp_Object frame)
{
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
+ struct frame *f = decode_live_frame (frame);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (XFRAME (frame)))
+ if (FRAME_WINDOW_P (f))
{
- FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
- x_make_frame_visible (XFRAME (frame));
+ FRAME_SAMPLE_VISIBILITY (f);
+ x_make_frame_visible (f);
}
#endif
- make_frame_visible_1 (XFRAME (frame)->root_window);
+ make_frame_visible_1 (f->root_window);
/* Make menu bar update for the Buffers and Frames menus. */
windows_or_buffers_changed++;
+ XSETFRAME (frame, f);
return frame;
}
displayed in the terminal. */)
(Lisp_Object frame, Lisp_Object force)
{
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
+ struct frame *f = decode_live_frame (frame);
- if (NILP (force) && !other_visible_frames (XFRAME (frame)))
+ if (NILP (force) && !other_visible_frames (f))
error ("Attempt to make invisible the sole visible or iconified frame");
/* Don't allow minibuf_window to remain on a deleted frame. */
- if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
+ if (EQ (f->minibuffer_window, minibuf_window))
{
struct frame *sf = XFRAME (selected_frame);
/* Use set_window_buffer instead of Fset_window_buffer (see
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (XFRAME (frame)))
- x_make_frame_invisible (XFRAME (frame));
+ if (FRAME_WINDOW_P (f))
+ x_make_frame_invisible (f);
#endif
/* Make menu bar update for the Buffers and Frames menus. */
If omitted, FRAME defaults to the currently selected frame. */)
(Lisp_Object frame)
{
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
-
-#if 0 /* This isn't logically necessary, and it can do GC. */
- /* Don't let the frame remain selected. */
- if (EQ (frame, selected_frame))
- Fhandle_switch_frame (next_frame (frame, Qt));
-#endif
+ struct frame *f = decode_live_frame (frame);
/* Don't allow minibuf_window to remain on an iconified frame. */
- if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
+ if (EQ (f->minibuffer_window, minibuf_window))
{
struct frame *sf = XFRAME (selected_frame);
/* Use set_window_buffer instead of Fset_window_buffer (see
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (XFRAME (frame)))
- x_iconify_frame (XFRAME (frame));
+ if (FRAME_WINDOW_P (f))
+ x_iconify_frame (f);
#endif
/* Make menu bar update for the Buffers and Frames menus. */
doc: /* Return a list of all frames now \"visible\" (being updated). */)
(void)
{
- Lisp_Object tail, frame;
- struct frame *f;
- Lisp_Object value;
+ Lisp_Object tail, frame, value = Qnil;
+
+ FOR_EACH_FRAME (tail, frame)
+ if (FRAME_VISIBLE_P (XFRAME (frame)))
+ value = Fcons (frame, value);
- value = Qnil;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
- {
- frame = XCAR (tail);
- if (!FRAMEP (frame))
- continue;
- f = XFRAME (frame);
- if (FRAME_VISIBLE_P (f))
- value = Fcons (frame, value);
- }
return value;
}
doesn't support multiple overlapping frames, this function selects FRAME. */)
(Lisp_Object frame)
{
- struct frame *f;
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
+ struct frame *f = decode_live_frame (frame);
- f = XFRAME (frame);
+ XSETFRAME (frame, f);
if (FRAME_TERMCAP_P (f))
/* On a text terminal select FRAME. */
doesn't support multiple overlapping frames, this function does nothing. */)
(Lisp_Object frame)
{
- struct frame *f;
-
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
-
- f = XFRAME (frame);
+ struct frame *f = decode_live_frame (frame);
if (FRAME_TERMINAL (f)->frame_raise_lower_hook)
(*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 0);
The redirection lasts until `redirect-frame-focus' is called to change it. */)
(Lisp_Object frame, Lisp_Object focus_frame)
{
- struct frame *f;
-
/* Note that we don't check for a live frame here. It's reasonable
to redirect the focus of a frame you're about to delete, if you
know what other frame should receive those keystrokes. */
- CHECK_FRAME (frame);
+ struct frame *f = decode_any_frame (frame);
if (! NILP (focus_frame))
CHECK_LIVE_FRAME (focus_frame);
- f = XFRAME (frame);
-
fset_focus_frame (f, focus_frame);
if (FRAME_TERMINAL (f)->frame_rehighlight_hook)
}
-DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0,
+DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 0, 1, 0,
doc: /* Return the frame to which FRAME's keystrokes are currently being sent.
-This returns nil if FRAME's focus is not redirected.
+If FRAME is omitted or nil, the selected frame is used.
+Return nil if FRAME's focus is not redirected.
See `redirect-frame-focus'. */)
(Lisp_Object frame)
{
- CHECK_LIVE_FRAME (frame);
-
- return FRAME_FOCUS_FRAME (XFRAME (frame));
+ return FRAME_FOCUS_FRAME (decode_live_frame (frame));
}
}
#endif
-/* Return the buffer-predicate of the selected frame. */
-
-Lisp_Object
-frame_buffer_predicate (Lisp_Object frame)
-{
- return XFRAME (frame)->buffer_predicate;
-}
-
-/* Return the buffer-list of the selected frame. */
-
-static Lisp_Object
-frame_buffer_list (Lisp_Object frame)
-{
- return XFRAME (frame)->buffer_list;
-}
-
/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */
void
doc: /* Return the parameters-alist of frame FRAME.
It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.
The meaningful PARMs depend on the kind of frame.
-If FRAME is omitted, return information on the currently selected frame. */)
+If FRAME is omitted or nil, return information on the currently selected frame. */)
(Lisp_Object frame)
{
Lisp_Object alist;
- FRAME_PTR f;
+ struct frame *f = decode_any_frame (frame);
int height, width;
struct gcpro gcpro1;
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_FRAME (frame);
- f = XFRAME (frame);
-
if (!FRAME_LIVE_P (f))
return Qnil;
: FRAME_MINIBUF_ONLY_P (f) ? Qonly
: FRAME_MINIBUF_WINDOW (f)));
store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
- store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame));
- store_in_alist (&alist, Qburied_buffer_list,
- XFRAME (frame)->buried_buffer_list);
+ store_in_alist (&alist, Qbuffer_list, f->buffer_list);
+ store_in_alist (&alist, Qburied_buffer_list, f->buried_buffer_list);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
If FRAME is nil, describe the currently selected frame. */)
(Lisp_Object frame, Lisp_Object parameter)
{
- struct frame *f;
- Lisp_Object value;
+ struct frame *f = decode_any_frame (frame);
+ Lisp_Object value = Qnil;
- if (NILP (frame))
- frame = selected_frame;
- else
- CHECK_FRAME (frame);
CHECK_SYMBOL (parameter);
- f = XFRAME (frame);
- value = Qnil;
+ XSETFRAME (frame, f);
if (FRAME_LIVE_P (f))
{
use is not recommended. Explicitly check for a frame-parameter instead. */)
(Lisp_Object frame, Lisp_Object alist)
{
- FRAME_PTR f;
+ struct frame *f = decode_live_frame (frame);
register Lisp_Object tail, prop, val;
- if (EQ (frame, Qnil))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
-
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
0, 1, 0,
doc: /* Height in pixels of a line in the font in frame FRAME.
-If FRAME is omitted, the selected frame is used.
+If FRAME is omitted or nil, the selected frame is used.
For a terminal frame, the value is always 1. */)
(Lisp_Object frame)
{
- struct frame *f;
-
- if (NILP (frame))
- frame = selected_frame;
- CHECK_FRAME (frame);
- f = XFRAME (frame);
-
#ifdef HAVE_WINDOW_SYSTEM
+ struct frame *f = decode_any_frame (frame);
+
if (FRAME_WINDOW_P (f))
- return make_number (x_char_height (f));
+ return make_number (FRAME_LINE_HEIGHT (f));
else
#endif
return make_number (1);
DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width,
0, 1, 0,
doc: /* Width in pixels of characters in the font in frame FRAME.
-If FRAME is omitted, the selected frame is used.
+If FRAME is omitted or nil, the selected frame is used.
On a graphical screen, the width is the standard width of the default font.
For a terminal screen, the value is always 1. */)
(Lisp_Object frame)
{
- struct frame *f;
-
- if (NILP (frame))
- frame = selected_frame;
- CHECK_FRAME (frame);
- f = XFRAME (frame);
-
#ifdef HAVE_WINDOW_SYSTEM
+ struct frame *f = decode_any_frame (frame);
+
if (FRAME_WINDOW_P (f))
- return make_number (x_char_width (f));
+ return make_number (FRAME_COLUMN_WIDTH (f));
else
#endif
return make_number (1);
DEFUN ("frame-pixel-height", Fframe_pixel_height,
Sframe_pixel_height, 0, 1, 0,
doc: /* Return a FRAME's height in pixels.
-If FRAME is omitted, the selected frame is used. The exact value
+If FRAME is omitted or nil, the selected frame is used. The exact value
of the result depends on the window-system and toolkit in use:
In the Gtk+ version of Emacs, it includes only any window (including
to `frame-height'). */)
(Lisp_Object frame)
{
- struct frame *f;
-
- if (NILP (frame))
- frame = selected_frame;
- CHECK_FRAME (frame);
- f = XFRAME (frame);
+ struct frame *f = decode_any_frame (frame);
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
Sframe_pixel_width, 0, 1, 0,
doc: /* Return FRAME's width in pixels.
For a terminal frame, the result really gives the width in characters.
-If FRAME is omitted, the selected frame is used. */)
+If FRAME is omitted or nil, the selected frame is used. */)
(Lisp_Object frame)
{
- struct frame *f;
-
- if (NILP (frame))
- frame = selected_frame;
- CHECK_FRAME (frame);
- f = XFRAME (frame);
+ struct frame *f = decode_any_frame (frame);
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
Stool_bar_pixel_width, 0, 1, 0,
doc: /* Return width in pixels of FRAME's tool bar.
The result is greater than zero only when the tool bar is on the left
-or right side of FRAME. If FRAME is omitted, the selected frame is
-used. */)
+or right side of FRAME. If FRAME is omitted or nil, the selected frame
+is used. */)
(Lisp_Object frame)
{
- if (NILP (frame))
- frame = selected_frame;
- CHECK_FRAME (frame);
-
#ifdef FRAME_TOOLBAR_WIDTH
- if (FRAME_WINDOW_P (XFRAME (frame)))
- return make_number (FRAME_TOOLBAR_WIDTH (XFRAME (frame)));
+ struct frame *f = decode_any_frame (frame);
+
+ if (FRAME_WINDOW_P (f))
+ return make_number (FRAME_TOOLBAR_WIDTH (f));
#endif
return make_number (0);
}
but that the idea of the actual height of the frame should not be changed. */)
(Lisp_Object frame, Lisp_Object lines, Lisp_Object pretend)
{
- register struct frame *f;
+ register struct frame *f = decode_live_frame (frame);
CHECK_TYPE_RANGED_INTEGER (int, lines);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
but that the idea of the actual width of the frame should not be changed. */)
(Lisp_Object frame, Lisp_Object cols, Lisp_Object pretend)
{
- register struct frame *f;
+ register struct frame *f = decode_live_frame (frame);
+
CHECK_TYPE_RANGED_INTEGER (int, cols);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
selected frame. This is useful when `make-pointer-invisible' is set. */)
(Lisp_Object frame)
{
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_FRAME (frame);
-
- return (XFRAME (frame)->pointer_invisible ? Qnil : Qt);
+ return decode_any_frame (frame)->pointer_invisible ? Qnil : Qt;
}
\f
output_x_window,
output_msdos_raw,
output_w32,
- output_mac,
output_ns
};
#if defined (USE_GTK) || defined (HAVE_NS)
/* Nonzero means using a tool bar that comes from the toolkit. */
- int external_tool_bar;
+ unsigned external_tool_bar : 1;
#endif
/* Margin at the top of the frame. Used to display the tool-bar. */
/* Canonical X unit. Width of default font, in pixels. */
int column_width;
- /* Width of space glyph of default font, in pixels. */
- int space_width;
-
/* Canonical Y unit. Height of a line, in pixels. */
int line_height;
unsigned int external_menu_bar : 1;
#endif
- /* Nonzero if last attempt at redisplay on this frame was preempted. */
- unsigned display_preempted : 1;
-
/* visible is nonzero if the frame is currently displayed; we check
it to see if we should bother updating the frame's contents.
DON'T SET IT DIRECTLY; instead, use FRAME_SET_VISIBLE.
show no modeline for that window. */
unsigned wants_modeline : 1;
- /* Non-zero if the hardware device this frame is displaying on can
- support scroll bars. */
- char can_have_scroll_bars;
-
/* Non-0 means raise this frame to the top of the heap when selected. */
unsigned auto_raise : 1;
/* Nonzero means that the pointer is invisible. */
unsigned pointer_invisible :1;
- /* If can_have_scroll_bars is non-zero, this is non-zero if we should
- actually display them on this frame. */
+ /* 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?
#define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
#define FRAME_FOCUS_FRAME(f) f->focus_frame
-/* Nonzero if frame F supports scroll bars.
- If this is zero, then it is impossible to enable scroll bars
- on frame F. */
-#define FRAME_CAN_HAVE_SCROLL_BARS(f) ((f)->can_have_scroll_bars)
-
/* 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)
&& (frame_var = XCAR (list_var), 1)); \
list_var = XCDR (list_var))
+/* Reflect mouse movement when a complete frame update is performed. */
+
+#define FRAME_MOUSE_UPDATE(frame) \
+ do { \
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (frame); \
+ if (frame == hlinfo->mouse_face_mouse_frame) \
+ { \
+ block_input (); \
+ if (hlinfo->mouse_face_mouse_frame) \
+ note_mouse_highlight (hlinfo->mouse_face_mouse_frame, \
+ hlinfo->mouse_face_mouse_x, \
+ hlinfo->mouse_face_mouse_y); \
+ unblock_input (); \
+ } \
+ } while (0)
extern Lisp_Object Qframep, Qframe_live_p;
extern Lisp_Object Qtty, Qtty_type;
extern struct frame *last_nonminibuf_frame;
extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
+extern struct frame *decode_live_frame (Lisp_Object);
+extern struct frame *decode_any_frame (Lisp_Object);
extern struct frame *make_initial_frame (void);
extern struct frame *make_frame (int);
#ifdef HAVE_WINDOW_SYSTEM
#define FRAME_COLUMN_WIDTH(F) ((F)->column_width)
-/* Space glyph width of the default font of frame F. */
-
-#define FRAME_SPACE_WIDTH(F) ((F)->space_width)
-
-
/* Pixel width of areas used to display truncation marks, continuation
marks, overlay arrows. This is 0 for terminal frames. */
extern Lisp_Object Qleft_fringe, Qright_fringe;
extern Lisp_Object Qheight, Qwidth;
extern Lisp_Object Qminibuffer, Qmodeline;
-extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
+extern Lisp_Object Qx, Qw32, Qpc, Qns;
extern Lisp_Object Qvisible;
extern Lisp_Object Qdisplay_type;
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 int x_char_width (struct frame *f);
-extern int x_char_height (struct frame *f);
extern int x_pixel_width (struct frame *f);
extern int x_pixel_height (struct frame *f);
extern void x_set_frame_alpha (struct frame *f);
if (left_fringe_width || right_fringe_width)
{
- int left_wid = left_fringe_width >= 0 ? left_fringe_width : -left_fringe_width;
- int right_wid = right_fringe_width >= 0 ? right_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;
struct glyph_row *row;
ptrdiff_t textpos;
- if (NILP (window))
- window = selected_window;
- CHECK_WINDOW (window);
- w = XWINDOW (window);
+ w = decode_any_window (window);
+ XSETWINDOW (window, w);
if (!NILP (pos))
{
else if (w == XWINDOW (selected_window))
textpos = PT;
else
- textpos = XMARKER (w->pointm)->charpos;
+ textpos = marker_position (w->pointm);
row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
row = row_containing_pos (w, textpos, row, NULL, 0);
return result;
}
-#ifndef ENOMEM
-#define ENOMEM 12
-#endif
-
-#ifndef EINVAL
-#define EINVAL 22
-#endif
-
int
posix_memalign (void **memptr, size_t alignment, size_t size)
{
if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
{
-#ifdef EWOULDBLOCK
- errno = EWOULDBLOCK;
-#endif
-#ifdef EAGAIN
errno = EAGAIN;
-#endif
return 0;
}
appropriately so that send_process retries the
correct way instead of erroring out. */
if (rtnval == GNUTLS_E_AGAIN)
- {
-#ifdef EWOULDBLOCK
- errno = EWOULDBLOCK;
-#endif
-#ifdef EAGAIN
- errno = EAGAIN;
-#endif
- }
+ errno = EAGAIN;
break;
}
}
General functions for creating widgets, resizing, events, e.t.c.
***********************************************************************/
+static void
+my_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
+ const gchar *msg, gpointer user_data)
+{
+ if (!strstr (msg, "visible children"))
+ fprintf (stderr, "XX %s-WARNING **: %s\n", log_domain, msg);
+}
+
/* Make a geometry string and pass that to GTK. It seems this is the
only way to get geometry position right if the user explicitly
asked for a position when starting Emacs.
int top = f->top_pos;
int yneg = f->size_hint_flags & YNegative;
char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)];
+ guint id;
if (xneg)
left = -left;
(xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top);
+ /* Silence warning about visible children. */
+ id = g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
+ | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
+
if (!gtk_window_parse_geometry (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
geom_str))
fprintf (stderr, "Failed to parse: '%s'\n", geom_str);
+
+ g_log_remove_handler ("Gtk", id);
}
}
return w;
}
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
+
static int xg_detached_menus;
/* Return true if there are detached menus. */
G_CALLBACK (tearoff_remove), 0);
}
}
-
+#else /* ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW */
+bool
+xg_have_tear_offs (void)
+{
+ return false;
+}
+#endif /* ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW */
/* Create a menu item widget, and connect the callbacks.
ITEM describes the menu item.
HIGHLIGHT_CB is the callback to call when entering/leaving menu items.
If POP_UP_P, create a popup menu.
If MENU_BAR_P, create a menu bar.
- If ADD_TEAROFF_P, add a tearoff menu item. Ignored if MENU_BAR_P.
+ If ADD_TEAROFF_P, add a tearoff menu item. Ignored if MENU_BAR_P or
+ the Gtk+ version used does not have tearoffs.
TOPMENU is the topmost GtkWidget that others shall be placed under.
It may be NULL, in that case we create the appropriate widget
(menu bar or menu item depending on POP_UP_P and MENU_BAR_P)
"selection-done", deactivate_cb, 0);
}
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
if (! menu_bar_p && add_tearoff_p)
{
GtkWidget *tearoff = gtk_tearoff_menu_item_new ();
g_signal_connect (G_OBJECT (tearoff), "activate",
G_CALLBACK (tearoff_activate), 0);
}
+#endif
for (item = data; item; item = item->next)
{
gtk_label_set_text (wlabel, utf8_label);
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
/* If this item has a submenu that has been detached, change
the title in the WM decorations also. */
if (submenu && gtk_menu_get_tearoff_state (GTK_MENU (submenu)))
/* Set the title of the detached window. */
gtk_menu_set_title (GTK_MENU (submenu), utf8_label);
+#endif
if (utf8_label) g_free (utf8_label);
iter = g_list_next (iter);
{
GtkWidget *w = GTK_WIDGET (iter->data);
- /* Skip tearoff items, they have no counterpart in val. */
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
+ /* Skip tearoff items, they have no counterpart in val. */
if (GTK_IS_TEAROFF_MENU_ITEM (w))
{
has_tearoff_p = 1;
if (iter) w = GTK_WIDGET (iter->data);
else break;
}
+#endif
/* Remember first radio button in a group. If we get a mismatch in
a radio group we must rebuild the whole group so that the connections
shown = (gdouble) portion / whole;
}
- size = shown * XG_SB_RANGE;
- size = min (size, XG_SB_RANGE);
- size = max (size, 1);
-
- value = top * XG_SB_RANGE;
- value = min (value, XG_SB_MAX - size);
- value = max (value, XG_SB_MIN);
+ size = clip_to_bounds (1, shown * XG_SB_RANGE, XG_SB_RANGE);
+ value = clip_to_bounds (XG_SB_MIN, top * XG_SB_RANGE, XG_SB_MAX - size);
/* Assume all lines are of equal size. */
new_step = size / max (1, FRAME_LINES (f));
if (f)
{
GtkRequisition req, req2;
- FRAME_X_OUTPUT (f)->toolbar_detached = 1;
+
gtk_widget_get_preferred_size (GTK_WIDGET (wbox), NULL, &req);
gtk_widget_get_preferred_size (w, NULL, &req2);
req.width -= req2.width;
if (f)
{
GtkRequisition req, req2;
- FRAME_X_OUTPUT (f)->toolbar_detached = 0;
+
gtk_widget_get_preferred_size (GTK_WIDGET (wbox), NULL, &req);
gtk_widget_get_preferred_size (w, NULL, &req2);
req.width += req2.width;
gtk_toolbar_set_orientation (GTK_TOOLBAR (w), o)
#endif
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
+#define TOOLBAR_TOP_WIDGET(x) ((x)->handlebox_widget)
+#else
+#define TOOLBAR_TOP_WIDGET(x) ((x)->toolbar_widget)
+#endif
+
/* Attach a tool bar to frame F. */
static void
{
struct x_output *x = f->output_data.x;
bool into_hbox = EQ (pos, Qleft) || EQ (pos, Qright);
+ GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
toolbar_set_orientation (x->toolbar_widget,
into_hbox
? GTK_ORIENTATION_VERTICAL
: GTK_ORIENTATION_HORIZONTAL);
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
if (!x->handlebox_widget)
{
- x->handlebox_widget = gtk_handle_box_new ();
+ top_widget = x->handlebox_widget = gtk_handle_box_new ();
g_signal_connect (G_OBJECT (x->handlebox_widget), "child-detached",
G_CALLBACK (xg_tool_bar_detach_callback), f);
g_signal_connect (G_OBJECT (x->handlebox_widget), "child-attached",
gtk_container_add (GTK_CONTAINER (x->handlebox_widget),
x->toolbar_widget);
}
+#endif
if (into_hbox)
{
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget),
GTK_POS_TOP);
- gtk_box_pack_start (GTK_BOX (x->hbox_widget), x->handlebox_widget,
+#endif
+ gtk_box_pack_start (GTK_BOX (x->hbox_widget), top_widget,
FALSE, FALSE, 0);
if (EQ (pos, Qleft))
gtk_box_reorder_child (GTK_BOX (x->hbox_widget),
- x->handlebox_widget,
+ top_widget,
0);
- x->toolbar_in_hbox = 1;
+ x->toolbar_in_hbox = true;
}
else
{
bool vbox_pos = x->menubar_widget != 0;
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget),
GTK_POS_LEFT);
- gtk_box_pack_start (GTK_BOX (x->vbox_widget), x->handlebox_widget,
+#endif
+ gtk_box_pack_start (GTK_BOX (x->vbox_widget), top_widget,
FALSE, FALSE, 0);
if (EQ (pos, Qtop))
gtk_box_reorder_child (GTK_BOX (x->vbox_widget),
- x->handlebox_widget,
+ top_widget,
vbox_pos);
- x->toolbar_in_hbox = 0;
+ x->toolbar_in_hbox = false;
}
+ x->toolbar_is_packed = true;
}
/* Create a tool bar for frame F. */
}
x->toolbar_widget = gtk_toolbar_new ();
- x->toolbar_detached = 0;
gtk_widget_set_name (x->toolbar_widget, "emacs-toolbar");
struct x_output *x = f->output_data.x;
GtkRequisition req;
int nl = 0, nr = 0, nt = 0, nb = 0;
+ GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
- gtk_widget_get_preferred_size (GTK_WIDGET (x->handlebox_widget), NULL, &req);
+ gtk_widget_get_preferred_size (GTK_WIDGET (top_widget), NULL, &req);
if (x->toolbar_in_hbox)
{
int pos;
gtk_container_child_get (GTK_CONTAINER (x->hbox_widget),
- x->handlebox_widget,
+ top_widget,
"position", &pos, NULL);
if (pos == 0) nl = req.width;
else nr = req.width;
{
int pos;
gtk_container_child_get (GTK_CONTAINER (x->vbox_widget),
- x->handlebox_widget,
+ top_widget,
"position", &pos, NULL);
if (pos == 0 || (pos == 1 && x->menubar_widget)) nt = req.height;
else nb = req.height;
GtkToolbar *wtoolbar;
GtkToolItem *ti;
GtkTextDirection dir;
- bool pack_tool_bar = x->handlebox_widget == NULL;
Lisp_Object style;
bool text_image, horiz;
struct xg_frame_tb_info *tbinfo;
if (f->n_tool_bar_items != 0)
{
- if (pack_tool_bar)
+ if (! x->toolbar_is_packed)
xg_pack_tool_bar (f, f->tool_bar_position);
- gtk_widget_show_all (GTK_WIDGET (x->handlebox_widget));
+ gtk_widget_show_all (TOOLBAR_TOP_WIDGET (x));
if (xg_update_tool_bar_sizes (f))
xg_height_or_width_changed (f);
}
if (x->toolbar_widget)
{
struct xg_frame_tb_info *tbinfo;
- bool is_packed = x->handlebox_widget != 0;
+ GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
+
block_input ();
/* We may have created the toolbar_widget in xg_create_tool_bar, but
not the x->handlebox_widget which is created in xg_pack_tool_bar. */
- if (is_packed)
+ if (x->toolbar_is_packed)
{
if (x->toolbar_in_hbox)
gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
- x->handlebox_widget);
+ top_widget);
else
gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
- x->handlebox_widget);
+ top_widget);
}
else
gtk_widget_destroy (x->toolbar_widget);
x->toolbar_widget = 0;
- x->handlebox_widget = 0;
+ TOOLBAR_TOP_WIDGET (x) = 0;
+ x->toolbar_is_packed = false;
FRAME_TOOLBAR_TOP_HEIGHT (f) = FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = 0;
FRAME_TOOLBAR_LEFT_WIDTH (f) = FRAME_TOOLBAR_RIGHT_WIDTH (f) = 0;
xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos)
{
struct x_output *x = f->output_data.x;
+ GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x);
- if (! x->toolbar_widget || ! x->handlebox_widget)
+ if (! x->toolbar_widget || ! top_widget)
return;
block_input ();
- g_object_ref (x->handlebox_widget);
- if (x->toolbar_in_hbox)
- gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
- x->handlebox_widget);
- else
- gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
- x->handlebox_widget);
+ g_object_ref (top_widget);
+ if (x->toolbar_is_packed)
+ {
+ if (x->toolbar_in_hbox)
+ gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
+ top_widget);
+ else
+ gtk_container_remove (GTK_CONTAINER (x->vbox_widget),
+ top_widget);
+ }
+
xg_pack_tool_bar (f, pos);
- g_object_unref (x->handlebox_widget);
+ g_object_unref (top_widget);
if (xg_update_tool_bar_sizes (f))
xg_height_or_width_changed (f);
gdpy_def = NULL;
xg_ignore_gtk_scrollbar = 0;
+#ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
xg_detached_menus = 0;
+#endif
xg_menu_cb_list.prev = xg_menu_cb_list.next =
xg_menu_item_cb_list.prev = xg_menu_item_cb_list.next = 0;
{
*put_func = xpm_put_color_table_h;
*get_func = xpm_get_color_table_h;
- return make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
+ return make_hash_table (hashtest_equal, make_number (DEFAULT_HASH_SIZE),
make_float (DEFAULT_REHASH_SIZE),
make_float (DEFAULT_REHASH_THRESHOLD),
- Qnil, Qnil, Qnil);
+ Qnil);
}
static void
col += width;
if (endp > scan) /* Avoid infinite loops with 0-width overlays. */
{
- scan = endp; scan_byte = charpos_to_bytepos (scan);
+ scan = endp;
+ scan_byte = CHAR_TO_BYTE (scan);
continue;
}
}
else
hscroll = tab_offset = 0;
- if (NILP (window))
- window = Fselected_window ();
- else
- CHECK_LIVE_WINDOW (window);
- w = XWINDOW (window);
+ w = decode_live_window (window);
if (XINT (from) < BEGV || XINT (from) > ZV)
args_out_of_range_3 (from, make_number (BEGV), make_number (ZV));
1))
: XINT (XCAR (topos))),
(NILP (width) ? -1 : XINT (width)),
- hscroll, tab_offset,
- XWINDOW (window));
+ hscroll, tab_offset, w);
XSETFASTINT (bufpos, pos->bufpos);
XSETINT (hpos, pos->hpos);
}
CHECK_NUMBER (lines);
- if (! NILP (window))
- CHECK_WINDOW (window);
- else
- window = selected_window;
- w = XWINDOW (window);
+ w = decode_live_window (window);
old_buffer = Qnil;
GCPRO3 (old_buffer, old_charpos, old_bytepos);
{
/* Set the window's buffer temporarily to the current buffer. */
old_buffer = w->buffer;
- old_charpos = XMARKER (w->pointm)->charpos;
- old_bytepos = XMARKER (w->pointm)->bytepos;
+ old_charpos = marker_position (w->pointm);
+ old_bytepos = marker_byte_position (w->pointm);
wset_buffer (w, Fcurrent_buffer ());
set_marker_both (w->pointm, w->buffer,
BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));
--- /dev/null
+/* Inotify support for Emacs
+
+Copyright (C) 2012-2013 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>
+
+#ifdef HAVE_INOTIFY
+
+#include "lisp.h"
+#include "coding.h"
+#include "process.h"
+#include "keyboard.h"
+#include "character.h"
+#include "frame.h" /* Required for termhooks.h. */
+#include "termhooks.h"
+
+static Lisp_Object Qaccess; /* IN_ACCESS */
+static Lisp_Object Qattrib; /* IN_ATTRIB */
+static Lisp_Object Qclose_write; /* IN_CLOSE_WRITE */
+static Lisp_Object Qclose_nowrite; /* IN_CLOSE_NOWRITE */
+static Lisp_Object Qcreate; /* IN_CREATE */
+static Lisp_Object Qdelete; /* IN_DELETE */
+static Lisp_Object Qdelete_self; /* IN_DELETE_SELF */
+static Lisp_Object Qmodify; /* IN_MODIFY */
+static Lisp_Object Qmove_self; /* IN_MOVE_SELF */
+static Lisp_Object Qmoved_from; /* IN_MOVED_FROM */
+static Lisp_Object Qmoved_to; /* IN_MOVED_TO */
+static Lisp_Object Qopen; /* IN_OPEN */
+
+static Lisp_Object Qall_events; /* IN_ALL_EVENTS */
+static Lisp_Object Qmove; /* IN_MOVE */
+static Lisp_Object Qclose; /* IN_CLOSE */
+
+static Lisp_Object Qdont_follow; /* IN_DONT_FOLLOW */
+static Lisp_Object Qexcl_unlink; /* IN_EXCL_UNLINK */
+static Lisp_Object Qmask_add; /* IN_MASK_ADD */
+static Lisp_Object Qoneshot; /* IN_ONESHOT */
+static Lisp_Object Qonlydir; /* IN_ONLYDIR */
+
+static Lisp_Object Qignored; /* IN_IGNORED */
+static Lisp_Object Qisdir; /* IN_ISDIR */
+static Lisp_Object Qq_overflow; /* IN_Q_OVERFLOW */
+static Lisp_Object Qunmount; /* IN_UNMOUNT */
+
+#include <sys/inotify.h>
+#include <sys/ioctl.h>
+
+/* Ignore bits that might be undefined on old GNU/Linux systems. */
+#ifndef IN_EXCL_UNLINK
+# define IN_EXCL_UNLINK 0
+#endif
+#ifndef IN_DONT_FOLLOW
+# define IN_DONT_FOLLOW 0
+#endif
+#ifndef IN_ONLYDIR
+# define IN_ONLYDIR 0
+#endif
+
+enum { uninitialized = -100 };
+/* File handle for inotify. */
+static int inotifyfd = uninitialized;
+
+/* Assoc list of files being watched.
+ Format:
+ (watch-descriptor . callback)
+ */
+static Lisp_Object watch_list;
+
+static Lisp_Object
+make_watch_descriptor (int wd)
+{
+ /* TODO replace this with a Misc Object! */
+ return make_number (wd);
+}
+
+static Lisp_Object
+mask_to_aspects (uint32_t mask) {
+ Lisp_Object aspects = Qnil;
+ if (mask & IN_ACCESS)
+ aspects = Fcons (Qaccess, aspects);
+ if (mask & IN_ATTRIB)
+ aspects = Fcons (Qattrib, aspects);
+ if (mask & IN_CLOSE_WRITE)
+ aspects = Fcons (Qclose_write, aspects);
+ if (mask & IN_CLOSE_NOWRITE)
+ aspects = Fcons (Qclose_nowrite, aspects);
+ if (mask & IN_CREATE)
+ aspects = Fcons (Qcreate, aspects);
+ if (mask & IN_DELETE)
+ aspects = Fcons (Qdelete, aspects);
+ if (mask & IN_DELETE_SELF)
+ aspects = Fcons (Qdelete_self, aspects);
+ if (mask & IN_MODIFY)
+ aspects = Fcons (Qmodify, aspects);
+ if (mask & IN_MOVE_SELF)
+ aspects = Fcons (Qmove_self, aspects);
+ if (mask & IN_MOVED_FROM)
+ aspects = Fcons (Qmoved_from, aspects);
+ if (mask & IN_MOVED_TO)
+ aspects = Fcons (Qmoved_to, aspects);
+ if (mask & IN_OPEN)
+ aspects = Fcons (Qopen, aspects);
+ if (mask & IN_IGNORED)
+ aspects = Fcons (Qignored, aspects);
+ if (mask & IN_ISDIR)
+ aspects = Fcons (Qisdir, aspects);
+ if (mask & IN_Q_OVERFLOW)
+ aspects = Fcons (Qq_overflow, aspects);
+ if (mask & IN_UNMOUNT)
+ aspects = Fcons (Qunmount, aspects);
+ return aspects;
+}
+
+static Lisp_Object
+inotifyevent_to_event (Lisp_Object watch_object, struct inotify_event const *ev)
+{
+ Lisp_Object name = Qnil;
+ if (ev->len > 0)
+ {
+ size_t const len = strlen (ev->name);
+ name = make_unibyte_string (ev->name, min (len, ev->len));
+ name = DECODE_FILE (name);
+ }
+
+ return list2 (list4 (make_watch_descriptor (ev->wd),
+ mask_to_aspects (ev->mask),
+ make_number (ev->cookie),
+ name),
+ XCDR (watch_object));
+}
+
+/* This callback is called when the FD is available for read. The inotify
+ events are read from FD and converted into input_events. */
+static void
+inotify_callback (int fd, void *_)
+{
+ struct input_event event;
+ Lisp_Object watch_object;
+ int to_read;
+ char *buffer;
+ ssize_t n;
+ size_t i;
+
+ to_read = 0;
+ if (ioctl (fd, FIONREAD, &to_read) == -1)
+ report_file_error ("Error while trying to retrieve file system events",
+ Qnil);
+ buffer = xmalloc (to_read);
+ n = read (fd, buffer, to_read);
+ if (n < 0)
+ {
+ xfree (buffer);
+ report_file_error ("Error while trying to read file system events",
+ Qnil);
+ }
+
+ EVENT_INIT (event);
+ event.kind = FILE_NOTIFY_EVENT;
+
+ i = 0;
+ while (i < (size_t)n)
+ {
+ struct inotify_event *ev = (struct inotify_event*)&buffer[i];
+
+ watch_object = Fassoc (make_watch_descriptor (ev->wd), watch_list);
+ if (!NILP (watch_object))
+ {
+ event.arg = inotifyevent_to_event (watch_object, ev);
+
+ /* If event was removed automatically: Drop it from watch list. */
+ if (ev->mask & IN_IGNORED)
+ watch_list = Fdelete (watch_object, watch_list);
+
+ if (!NILP (event.arg))
+ kbd_buffer_store_event (&event);
+ }
+
+ i += sizeof (*ev) + ev->len;
+ }
+
+ xfree (buffer);
+}
+
+static uint32_t
+symbol_to_inotifymask (Lisp_Object symb)
+{
+ if (EQ (symb, Qaccess))
+ return IN_ACCESS;
+ else if (EQ (symb, Qattrib))
+ return IN_ATTRIB;
+ else if (EQ (symb, Qclose_write))
+ return IN_CLOSE_WRITE;
+ else if (EQ (symb, Qclose_nowrite))
+ return IN_CLOSE_NOWRITE;
+ else if (EQ (symb, Qcreate))
+ return IN_CREATE;
+ else if (EQ (symb, Qdelete))
+ return IN_DELETE;
+ else if (EQ (symb, Qdelete_self))
+ return IN_DELETE_SELF;
+ else if (EQ (symb, Qmodify))
+ return IN_MODIFY;
+ else if (EQ (symb, Qmove_self))
+ return IN_MOVE_SELF;
+ else if (EQ (symb, Qmoved_from))
+ return IN_MOVED_FROM;
+ else if (EQ (symb, Qmoved_to))
+ return IN_MOVED_TO;
+ else if (EQ (symb, Qopen))
+ return IN_OPEN;
+ else if (EQ (symb, Qmove))
+ return IN_MOVE;
+ else if (EQ (symb, Qclose))
+ return IN_CLOSE;
+
+ else if (EQ (symb, Qdont_follow))
+ return IN_DONT_FOLLOW;
+ else if (EQ (symb, Qexcl_unlink))
+ return IN_EXCL_UNLINK;
+ else if (EQ (symb, Qmask_add))
+ return IN_MASK_ADD;
+ else if (EQ (symb, Qoneshot))
+ return IN_ONESHOT;
+ else if (EQ (symb, Qonlydir))
+ return IN_ONLYDIR;
+
+ else if (EQ (symb, Qt) || EQ (symb, Qall_events))
+ return IN_ALL_EVENTS;
+ else
+ signal_error ("Unknown aspect", symb);
+}
+
+static uint32_t
+aspect_to_inotifymask (Lisp_Object aspect)
+{
+ if (CONSP (aspect))
+ {
+ Lisp_Object x = aspect;
+ uint32_t mask = 0;
+ while (CONSP (x))
+ {
+ mask |= symbol_to_inotifymask (XCAR (x));
+ x = XCDR (x);
+ }
+ return mask;
+ }
+ else
+ return symbol_to_inotifymask (aspect);
+}
+
+DEFUN ("inotify-add-watch", Finotify_add_watch, Sinotify_add_watch, 3, 3, 0,
+ doc: /* Add a watch for FILE-NAME to inotify.
+
+A WATCH-DESCRIPTOR is returned on success. ASPECT might be one of the following
+symbols or a list of those symbols:
+
+access
+attrib
+close-write
+close-nowrite
+create
+delete
+delete-self
+modify
+move-self
+moved-from
+moved-to
+open
+
+all-events or t
+move
+close
+
+The following symbols can also be added to a list of aspects
+
+dont-follow
+excl-unlink
+mask-add
+oneshot
+onlydir
+
+Watching a directory is not recursive. CALLBACK gets called in case of an
+event. It gets passed a single argument EVENT which contains an event structure
+of the format
+
+(WATCH-DESCRIPTOR ASPECTS COOKIE NAME)
+
+WATCH-DESCRIPTOR is the same object that was returned by this function. It can
+be tested for equality using `equal'. ASPECTS describes the event. It is a
+list of ASPECT symbols described above and can also contain one of the following
+symbols
+
+ignored
+isdir
+q-overflow
+unmount
+
+COOKIE is an object that can be compared using `equal' to identify two matching
+renames (moved-from and moved-to).
+
+If a directory is watched then NAME is the name of file that caused the event.
+
+See inotify(7) and inotify_add_watch(2) for further information. The inotify fd
+is managed internally and there is no corresponding inotify_init. Use
+`inotify-rm-watch' to remove a watch.
+ */)
+ (Lisp_Object file_name, Lisp_Object aspect, Lisp_Object callback)
+{
+ uint32_t mask;
+ Lisp_Object watch_object;
+ Lisp_Object encoded_file_name;
+ Lisp_Object watch_descriptor;
+ int watchdesc = -1;
+
+ CHECK_STRING (file_name);
+
+ if (inotifyfd == uninitialized)
+ {
+ inotifyfd = inotify_init1 (IN_NONBLOCK|IN_CLOEXEC);
+ if (inotifyfd == -1)
+ {
+ inotifyfd = uninitialized;
+ report_file_error ("File watching feature (inotify) is not available",
+ Qnil);
+ }
+ watch_list = Qnil;
+ add_read_fd (inotifyfd, &inotify_callback, NULL);
+ }
+
+ mask = aspect_to_inotifymask (aspect);
+ encoded_file_name = ENCODE_FILE (file_name);
+ watchdesc = inotify_add_watch (inotifyfd, SSDATA (encoded_file_name), mask);
+ if (watchdesc == -1)
+ report_file_error ("Could not add watch for file", Fcons (file_name, Qnil));
+
+ watch_descriptor = make_watch_descriptor (watchdesc);
+
+ /* Delete existing watch object. */
+ watch_object = Fassoc (watch_descriptor, watch_list);
+ if (!NILP (watch_object))
+ watch_list = Fdelete (watch_object, watch_list);
+
+ /* Store watch object in watch list. */
+ watch_object = Fcons (watch_descriptor, callback);
+ watch_list = Fcons (watch_object, watch_list);
+
+ return watch_descriptor;
+}
+
+DEFUN ("inotify-rm-watch", Finotify_rm_watch, Sinotify_rm_watch, 1, 1, 0,
+ doc: /* Remove an existing WATCH-DESCRIPTOR.
+
+WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'.
+
+See inotify_rm_watch(2) for more information.
+ */)
+ (Lisp_Object watch_descriptor)
+{
+ Lisp_Object watch_object;
+ int wd = XINT (watch_descriptor);
+
+ if (inotify_rm_watch (inotifyfd, wd) == -1)
+ report_file_error ("Could not rm watch", Fcons (watch_descriptor,
+ Qnil));
+
+ /* Remove watch descriptor from watch list. */
+ watch_object = Fassoc (watch_descriptor, watch_list);
+ if (!NILP (watch_object))
+ watch_list = Fdelete (watch_object, watch_list);
+
+ /* Cleanup if no more files are watched. */
+ if (NILP (watch_list))
+ {
+ close (inotifyfd);
+ delete_read_fd (inotifyfd);
+ inotifyfd = uninitialized;
+ }
+
+ return Qt;
+}
+
+void
+syms_of_inotify (void)
+{
+ DEFSYM (Qaccess, "access");
+ DEFSYM (Qattrib, "attrib");
+ DEFSYM (Qclose_write, "close-write");
+ DEFSYM (Qclose_nowrite, "close-nowrite");
+ DEFSYM (Qcreate, "create");
+ DEFSYM (Qdelete, "delete");
+ DEFSYM (Qdelete_self, "delete-self");
+ DEFSYM (Qmodify, "modify");
+ DEFSYM (Qmove_self, "move-self");
+ DEFSYM (Qmoved_from, "moved-from");
+ DEFSYM (Qmoved_to, "moved-to");
+ DEFSYM (Qopen, "open");
+
+ DEFSYM (Qall_events, "all-events");
+ DEFSYM (Qmove, "move");
+ DEFSYM (Qclose, "close");
+
+ DEFSYM (Qdont_follow, "dont-follow");
+ DEFSYM (Qexcl_unlink, "excl-unlink");
+ DEFSYM (Qmask_add, "mask-add");
+ DEFSYM (Qoneshot, "oneshot");
+ DEFSYM (Qonlydir, "onlydir");
+
+ DEFSYM (Qignored, "ignored");
+ DEFSYM (Qisdir, "isdir");
+ DEFSYM (Qq_overflow, "q-overflow");
+ DEFSYM (Qunmount, "unmount");
+
+ defsubr (&Sinotify_add_watch);
+ defsubr (&Sinotify_rm_watch);
+
+ staticpro (&watch_list);
+
+ Fprovide (intern_c_string ("inotify"), Qnil);
+}
+
+#endif /* HAVE_INOTIFY */
void
move_gap (ptrdiff_t charpos)
{
- move_gap_both (charpos, charpos_to_bytepos (charpos));
+ move_gap_both (charpos, CHAR_TO_BYTE (charpos));
}
/* Move gap to byte position BYTEPOS, which is also char position CHARPOS.
return deletion;
}
-\f
-/* Call this if you're about to change the region of BUFFER from
- character positions START to END. This checks the read-only
+
+/* Call this if you're about to change the region of current buffer
+ from character positions START to END. This checks the read-only
properties of the region, calls the necessary modification hooks,
and warns the next redisplay that it should pay attention to that
area.
Otherwise set CHARS_MODIFF to the new value of MODIFF. */
void
-modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end,
- bool preserve_chars_modiff)
+modify_region_1 (ptrdiff_t start, ptrdiff_t end, bool preserve_chars_modiff)
{
- struct buffer *old_buffer = current_buffer;
-
- set_buffer_internal (buffer);
-
prepare_to_modify_buffer (start, end, NULL);
- BUF_COMPUTE_UNCHANGED (buffer, start - 1, end);
+ BUF_COMPUTE_UNCHANGED (current_buffer, start - 1, end);
if (MODIFF <= SAVE_MODIFF)
record_first_change ();
if (! preserve_chars_modiff)
CHARS_MODIFF = MODIFF;
- bset_point_before_scroll (buffer, Qnil);
-
- set_buffer_internal (old_buffer);
+ bset_point_before_scroll (current_buffer, Qnil);
}
-\f
+
/* Check that it is okay to modify the buffer between START and END,
which are char positions.
if (!NILP (BVAR (current_buffer, read_only)))
Fbarf_if_buffer_read_only ();
- /* Let redisplay consider other windows than selected_window
- if modifying another buffer. */
- if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
+ /* If we're modifying the buffer other than shown in a selected window,
+ let redisplay consider other windows if this buffer is visible. */
+ if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer
+ && buffer_window_count (current_buffer))
++windows_or_buffers_changed;
if (buffer_intervals (current_buffer))
: (!NILP (Vselect_active_regions)
&& !NILP (Vtransient_mark_mode))))
{
- ptrdiff_t b = XMARKER (BVAR (current_buffer, mark))->charpos;
+ ptrdiff_t b = marker_position (BVAR (current_buffer, mark));
ptrdiff_t e = PT;
if (b < e)
Vsaved_region_selection = make_buffer_string (b, e, 0);
XSETBUFFER (buf, buffer);
set_text_properties_1 (make_number (position),
make_number (position + length),
- Qnil, buf, 0);
+ Qnil, buf,
+ find_interval (tree, position));
}
/* Shouldn't be necessary. --Stef */
buffer_balance_intervals (buffer);
static Lisp_Object Qselect_window;
Lisp_Object Qhelp_echo;
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
static Lisp_Object Qmouse_fixup_help_message;
-#endif
/* Symbols to denote kinds of events. */
static Lisp_Object Qfunction_key;
Lisp_Object Qmouse_click;
#ifdef HAVE_NTGUI
Lisp_Object Qlanguage_change;
+#ifdef WINDOWSNT
+Lisp_Object Qfile_w32notify;
+#endif
#endif
static Lisp_Object Qdrag_n_drop;
static Lisp_Object Qsave_session;
#ifdef HAVE_DBUS
static Lisp_Object Qdbus_event;
#endif
+#ifdef HAVE_INOTIFY
+static Lisp_Object Qfile_inotify;
+#endif /* HAVE_INOTIFY */
static Lisp_Object Qconfig_changed_event;
/* Lisp_Object Qmouse_movement; - also an event header */
static Lisp_Object read_char_minibuf_menu_prompt (int, ptrdiff_t,
Lisp_Object *);
static Lisp_Object make_lispy_event (struct input_event *);
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object,
enum scroll_bar_part,
Lisp_Object, Lisp_Object,
Time);
-#endif
static Lisp_Object modify_event_symbol (ptrdiff_t, int, Lisp_Object,
Lisp_Object, const char *const *,
Lisp_Object *, ptrdiff_t);
}
\f
-/* Add C to the echo string, if echoing is going on.
- C can be a character, which is printed prettily ("M-C-x" and all that
- jazz), or a symbol, whose name is printed. */
+/* Add C to the echo string, without echoing it immediately. C can be
+ a character, which is pretty-printed, or a symbol, whose name is
+ printed. */
static void
-echo_char (Lisp_Object c)
+echo_add_key (Lisp_Object c)
{
- if (current_kboard->immediate_echo)
- {
- int size = KEY_DESCRIPTION_SIZE + 100;
- char *buffer = alloca (size);
- char *ptr = buffer;
- Lisp_Object echo_string;
+ int size = KEY_DESCRIPTION_SIZE + 100;
+ char *buffer = alloca (size);
+ char *ptr = buffer;
+ Lisp_Object echo_string;
- echo_string = KVAR (current_kboard, echo_string);
+ echo_string = KVAR (current_kboard, echo_string);
- /* If someone has passed us a composite event, use its head symbol. */
- c = EVENT_HEAD (c);
+ /* If someone has passed us a composite event, use its head symbol. */
+ c = EVENT_HEAD (c);
- if (INTEGERP (c))
+ if (INTEGERP (c))
+ ptr = push_key_description (XINT (c), ptr);
+ else if (SYMBOLP (c))
+ {
+ Lisp_Object name = SYMBOL_NAME (c);
+ int nbytes = SBYTES (name);
+
+ if (size - (ptr - buffer) < nbytes)
{
- ptr = push_key_description (XINT (c), ptr);
+ int offset = ptr - buffer;
+ size = max (2 * size, size + nbytes);
+ buffer = alloca (size);
+ ptr = buffer + offset;
}
- else if (SYMBOLP (c))
- {
- Lisp_Object name = SYMBOL_NAME (c);
- int nbytes = SBYTES (name);
- if (size - (ptr - buffer) < nbytes)
- {
- int offset = ptr - buffer;
- size = max (2 * size, size + nbytes);
- buffer = alloca (size);
- ptr = buffer + offset;
- }
+ ptr += copy_text (SDATA (name), (unsigned char *) ptr, nbytes,
+ STRING_MULTIBYTE (name), 1);
+ }
- ptr += copy_text (SDATA (name), (unsigned char *) ptr, nbytes,
- STRING_MULTIBYTE (name), 1);
- }
+ if ((NILP (echo_string) || SCHARS (echo_string) == 0)
+ && help_char_p (c))
+ {
+ const char *text = " (Type ? for further options)";
+ int len = strlen (text);
- if ((NILP (echo_string) || SCHARS (echo_string) == 0)
- && help_char_p (c))
+ if (size - (ptr - buffer) < len)
{
- const char *text = " (Type ? for further options)";
- int len = strlen (text);
-
- if (size - (ptr - buffer) < len)
- {
- int offset = ptr - buffer;
- size += len;
- buffer = alloca (size);
- ptr = buffer + offset;
- }
-
- memcpy (ptr, text, len);
- ptr += len;
+ int offset = ptr - buffer;
+ size += len;
+ buffer = alloca (size);
+ ptr = buffer + offset;
}
- /* Replace a dash from echo_dash with a space, otherwise
- add a space at the end as a separator between keys. */
- if (STRINGP (echo_string)
- && SCHARS (echo_string) > 1)
- {
- Lisp_Object last_char, prev_char, idx;
+ memcpy (ptr, text, len);
+ ptr += len;
+ }
+
+ /* Replace a dash from echo_dash with a space, otherwise add a space
+ at the end as a separator between keys. */
+ if (STRINGP (echo_string) && SCHARS (echo_string) > 1)
+ {
+ Lisp_Object last_char, prev_char, idx;
- idx = make_number (SCHARS (echo_string) - 2);
- prev_char = Faref (echo_string, idx);
+ idx = make_number (SCHARS (echo_string) - 2);
+ prev_char = Faref (echo_string, idx);
- idx = make_number (SCHARS (echo_string) - 1);
- last_char = Faref (echo_string, idx);
+ idx = make_number (SCHARS (echo_string) - 1);
+ last_char = Faref (echo_string, idx);
- /* We test PREV_CHAR to make sure this isn't the echoing
- of a minus-sign. */
- if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
- Faset (echo_string, idx, make_number (' '));
- else
- echo_string = concat2 (echo_string, build_string (" "));
- }
- else if (STRINGP (echo_string))
+ /* We test PREV_CHAR to make sure this isn't the echoing of a
+ minus-sign. */
+ if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
+ Faset (echo_string, idx, make_number (' '));
+ else
echo_string = concat2 (echo_string, build_string (" "));
+ }
+ else if (STRINGP (echo_string) && SCHARS (echo_string) > 0)
+ echo_string = concat2 (echo_string, build_string (" "));
- kset_echo_string
- (current_kboard,
- concat2 (echo_string, make_string (buffer, ptr - buffer)));
+ kset_echo_string
+ (current_kboard,
+ concat2 (echo_string, make_string (buffer, ptr - buffer)));
+}
+
+/* Add C to the echo string, if echoing is going on. C can be a
+ character or a symbol. */
+static void
+echo_char (Lisp_Object c)
+{
+ if (current_kboard->immediate_echo)
+ {
+ echo_add_key (c);
echo_now ();
}
}
/* Temporarily add a dash to the end of the echo string if it's not
- empty, so that it serves as a mini-prompt for the very next character. */
+ empty, so that it serves as a mini-prompt for the very next
+ character. */
static void
echo_dash (void)
Vsignaling_function = Qnil;
}
-\f
-Lisp_Object command_loop_1 (void);
+
static Lisp_Object command_loop_2 (Lisp_Object);
static Lisp_Object top_level_1 (Lisp_Object);
value to us. A value of nil means that command_loop_1 itself
returned due to end of file (or end of kbd macro). */
-Lisp_Object
+static Lisp_Object
command_loop_2 (Lisp_Object ignore)
{
register Lisp_Object val;
return Feval (Vtop_level, Qnil);
}
-Lisp_Object
+static Lisp_Object
top_level_1 (Lisp_Object ignore)
{
/* On entry to the outer level, run the startup file */
user_error ("No recursive edit is in progress");
}
\f
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
-
/* Restore mouse tracking enablement. See Ftrack_mouse for the only use
of this function. */
return 0;
}
-#endif /* HAVE_MOUSE || HAVE_GPM */
\f
/* This is the actual command reading loop,
sans error-handling encapsulation. */
Vdeactivate_mark = Qnil;
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
-
/* Don't ignore mouse movements for more than a single command
loop. (This flag is set in xdisp.c whenever the tool bar is
resized, because the resize moves text up or down, and would
generate false mouse drag events if we don't ignore them.) */
ignore_mouse_drag_p = 0;
-#endif
/* If minibuffer on and echo area in use,
wait a short time and redraw minibuffer. */
return;
}
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
if (!noninteractive && STRINGP (help))
{
/* The mouse-fixup-help-message Lisp function can call
if (f)
f->mouse_moved = 1;
}
-#endif
if (STRINGP (help) || NILP (help))
{
return 1;
}
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
if (!(flags & READABLE_EVENTS_IGNORE_SQUEEZABLES)
&& !NILP (do_mouse_tracking) && some_mouse_moved ())
return 1;
-#endif
if (single_kboard)
{
if (current_kboard->kbd_queue_has_data)
static KBOARD *
event_to_kboard (struct input_event *event)
{
- Lisp_Object frame;
- frame = event->frame_or_window;
- if (CONSP (frame))
- frame = XCAR (frame);
- else if (WINDOWP (frame))
- frame = WINDOW_FRAME (XWINDOW (frame));
-
- /* There are still some events that don't set this field.
- For now, just ignore the problem.
- Also ignore dead frames here. */
- if (!FRAMEP (frame) || !FRAME_LIVE_P (XFRAME (frame)))
- return 0;
+ /* Not applicable for these special events. */
+ if (event->kind == SELECTION_REQUEST_EVENT
+ || event->kind == SELECTION_CLEAR_EVENT)
+ return NULL;
else
- return FRAME_KBOARD (XFRAME (frame));
+ {
+ Lisp_Object obj = event->frame_or_window;
+ /* There are some events that set this field to nil or string. */
+ if (WINDOWP (obj))
+ obj = WINDOW_FRAME (XWINDOW (obj));
+ /* Also ignore dead frames here. */
+ return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj)))
+ ? FRAME_KBOARD (XFRAME (obj)) : NULL);
+ }
}
#ifdef subprocesses
if (kbd_fetch_ptr != kbd_store_ptr)
break;
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
if (!NILP (do_mouse_tracking) && some_mouse_moved ())
break;
-#endif
/* If the quit flag is set, then read_char will return
quit_char, so that counts as "available input." */
#endif
if (kbd_fetch_ptr != kbd_store_ptr)
break;
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
if (!NILP (do_mouse_tracking) && some_mouse_moved ())
break;
-#endif
if (end_time)
{
EMACS_TIME now = current_emacs_time ();
make_number (event->modifiers)));
kbd_fetch_ptr = event + 1;
}
+#endif
+#ifdef WINDOWSNT
+ else if (event->kind == FILE_NOTIFY_EVENT)
+ {
+ /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */
+ obj = Fcons (Qfile_w32notify,
+ list2 (list3 (make_number (event->code),
+ XCAR (event->arg),
+ XCDR (event->arg)),
+ event->frame_or_window));
+ kbd_fetch_ptr = event + 1;
+ }
#endif
else if (event->kind == SAVE_SESSION_EVENT)
{
obj = make_lispy_event (event);
kbd_fetch_ptr = event + 1;
}
+#endif
+#ifdef HAVE_INOTIFY
+ else if (event->kind == FILE_NOTIFY_EVENT)
+ {
+ obj = make_lispy_event (event);
+ kbd_fetch_ptr = event + 1;
+ }
#endif
else if (event->kind == CONFIG_CHANGED_EVENT)
{
}
}
}
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
/* Try generating a mouse motion event. */
else if (!NILP (do_mouse_tracking) && some_mouse_moved ())
{
if (!NILP (x) && NILP (obj))
obj = make_lispy_movement (f, bar_window, part, x, y, t);
}
-#endif /* HAVE_MOUSE || HAVE GPM */
else
/* We were promised by the above while loop that there was
something for us to read! */
string_info = Fcons (string, make_number (charpos));
textpos = (w == XWINDOW (selected_window)
&& current_buffer == XBUFFER (w->buffer))
- ? PT : XMARKER (w->pointm)->charpos;
+ ? PT : marker_position (w->pointm);
xret = wx;
yret = wy;
return Qnil;
#endif
-#ifdef HAVE_MOUSE
/* A mouse click. Figure out where it is, decide whether it's
a press, click or drag, and build the appropriate structure. */
case MOUSE_CLICK_EVENT:
Fcons (files,
Qnil)));
}
-#endif /* HAVE_MOUSE */
#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
|| defined (HAVE_NS) || defined (USE_GTK)
}
#endif /* HAVE_DBUS */
+#ifdef HAVE_INOTIFY
+ case FILE_NOTIFY_EVENT:
+ {
+ return Fcons (Qfile_inotify, event->arg);
+ }
+#endif /* HAVE_INOTIFY */
+
case CONFIG_CHANGED_EVENT:
return Fcons (Qconfig_changed_event,
Fcons (event->arg,
}
}
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
-
static Lisp_Object
make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part,
Lisp_Object x, Lisp_Object y, Time t)
}
}
-#endif /* HAVE_MOUSE || HAVE GPM */
-
/* Construct a switch frame event. */
static Lisp_Object
make_lispy_switch_frame (Lisp_Object frame)
void
record_asynch_buffer_change (void)
{
- struct input_event event;
- Lisp_Object tem;
- EVENT_INIT (event);
-
- event.kind = BUFFER_SWITCH_EVENT;
- event.frame_or_window = Qnil;
- event.arg = Qnil;
-
/* We don't need a buffer-switch event unless Emacs is waiting for input.
The purpose of the event is to make read_key_sequence look up the
keymaps again. If we aren't in read_key_sequence, we don't need one,
and the event could cause trouble by messing up (input-pending-p).
Note: Fwaiting_for_user_input_p always returns nil when async
subprocesses aren't supported. */
- tem = Fwaiting_for_user_input_p ();
- if (NILP (tem))
- return;
+ if (!NILP (Fwaiting_for_user_input_p ()))
+ {
+ struct input_event event;
+
+ EVENT_INIT (event);
+ event.kind = BUFFER_SWITCH_EVENT;
+ event.frame_or_window = Qnil;
+ event.arg = Qnil;
- /* Make sure no interrupt happens while storing the event. */
+ /* Make sure no interrupt happens while storing the event. */
#ifdef USABLE_SIGIO
- if (interrupt_input)
- kbd_buffer_store_event (&event);
- else
+ if (interrupt_input)
+ kbd_buffer_store_event (&event);
+ else
#endif
- {
- stop_polling ();
- kbd_buffer_store_event (&event);
- start_polling ();
+ {
+ stop_polling ();
+ kbd_buffer_store_event (&event);
+ start_polling ();
+ }
}
}
-\f
+
/* Read any terminal input already buffered up by the system
into the kbd_buffer, but do not wait.
#elif defined USG || defined CYGWIN
/* Read some input if available, but don't wait. */
n_to_read = sizeof cbuf;
- fcntl (fileno (tty->input), F_SETFL, O_NDELAY);
+ fcntl (fileno (tty->input), F_SETFL, O_NONBLOCK);
#else
# error "Cannot read without possibly delaying"
#endif
}
while (
/* We used to retry the read if it was interrupted.
- But this does the wrong thing when O_NDELAY causes
+ But this does the wrong thing when O_NONBLOCK causes
an EAGAIN error. Does anybody know of a situation
where a retry is actually needed? */
#if 0
- nread < 0 && (errno == EAGAIN
-#ifdef EFAULT
- || errno == EFAULT
-#endif
+ nread < 0 && (errno == EAGAIN || errno == EFAULT
#ifdef EBADSLT
|| errno == EBADSLT
#endif
key = keybuf[t];
add_command_key (key);
if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
- && NILP (Fzerop (Vecho_keystrokes)))
- echo_char (key);
+ && NILP (Fzerop (Vecho_keystrokes))
+ && current_kboard->immediate_echo)
+ {
+ echo_add_key (key);
+ echo_dash ();
+ }
}
/* If not, we should actually read a character. */
fflush (stdout);
reset_all_sys_modes ();
-#ifdef SIGTSTP /* Support possible in later USG versions */
+#ifdef SIGTSTP
/*
* On systems which can suspend the current process and return to the original
* shell, this command causes the user to end up back at the shell.
recent_keys_index = 0;
kbd_fetch_ptr = kbd_buffer;
kbd_store_ptr = kbd_buffer;
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
do_mouse_tracking = Qnil;
-#endif
input_pending = 0;
interrupt_input_blocked = 0;
pending_signals = 0;
DEFSYM (Qlanguage_change, "language-change");
#endif
+#ifdef WINDOWSNT
+ DEFSYM (Qfile_w32notify, "file-w32notify");
+#endif
+
#ifdef HAVE_DBUS
DEFSYM (Qdbus_event, "dbus-event");
#endif
+#ifdef HAVE_INOTIFY
+ DEFSYM (Qfile_inotify, "file-inotify");
+#endif /* HAVE_INOTIFY */
+
DEFSYM (QCenable, ":enable");
DEFSYM (QCvisible, ":visible");
DEFSYM (QChelp, ":help");
DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar");
DEFSYM (Qmenu_bar, "menu-bar");
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
DEFSYM (Qmouse_fixup_help_message, "mouse-fixup-help-message");
-#endif
DEFSYM (Qabove_handle, "above-handle");
DEFSYM (Qhandle, "handle");
defsubr (&Sread_key_sequence);
defsubr (&Sread_key_sequence_vector);
defsubr (&Srecursive_edit);
-#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
defsubr (&Strack_mouse);
-#endif
defsubr (&Sinput_pending_p);
defsubr (&Scommand_execute);
defsubr (&Srecent_keys);
"dbus-handle-event");
#endif
+#ifdef HAVE_INOTIFY
+ /* Define a special event which is raised for inotify callback
+ functions. */
+ initial_define_lispy_key (Vspecial_event_map, "file-inotify",
+ "inotify-handle-event");
+#endif /* HAVE_INOTIFY */
+
initial_define_lispy_key (Vspecial_event_map, "config-changed-event",
"ignore");
#if defined (WINDOWSNT)
initial_define_lispy_key (Vspecial_event_map, "language-change",
"ignore");
+ initial_define_lispy_key (Vspecial_event_map, "file-w32notify",
+ "w32notify-handle-event");
#endif
}
{
if (event == kbd_buffer + KBD_BUFFER_SIZE)
event = kbd_buffer;
+ /* These two special event types has no Lisp_Objects to mark. */
if (event->kind != SELECTION_REQUEST_EVENT
&& event->kind != SELECTION_CLEAR_EVENT)
{
mark_object (event->x);
mark_object (event->y);
+ mark_object (event->frame_or_window);
+ mark_object (event->arg);
}
- mark_object (event->frame_or_window);
- mark_object (event->arg);
}
}
}
#define GCTYPEBITS 3
GCTYPEBITS,
- /* 2**GCTYPEBITS. This must also be a macro that expands to a
- literal integer constant, for MSVC. */
- GCALIGNMENT =
+ /* 2**GCTYPEBITS. This must be a macro that expands to a literal
+ integer constant, for MSVC. */
#define GCALIGNMENT 8
- GCALIGNMENT,
/* Number of bits in a Lisp_Object value, not counting the tag. */
VALBITS = BITS_PER_EMACS_INT - GCTYPEBITS,
members that are accessible only from C. A Lisp_Misc object is a
wrapper for a C struct that can contain anything you like.
+ Explicit freeing is discouraged for Lisp objects in general. But if
+ you really need to exploit this, use Lisp_Misc (check free_misc in
+ alloc.c to see why). There is no way to free a vectorlike object.
+
To add a new pseudovector type, extend the pvec_type enumeration;
to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration.
enumeration and a 1-bit GC markbit) and make sure the overall size
of the union is not increased by your addition.
+ For a new pseudovector, it's highly desirable to limit the size
+ of your data type by VBLOCK_BYTES_MAX bytes (defined in alloc.c).
+ Otherwise you will need to change sweep_vectors (also in alloc.c).
+
Then you will need to add switch branches in print.c (in
print_object, to print your object, and possibly also in
print_preprocess) and to alloc.c, to mark your object (in
PVEC_WINDOW_CONFIGURATION,
PVEC_SUBR,
PVEC_OTHER,
- /* These last 4 are special because we OR them in fns.c:internal_equal,
- so they have to use a disjoint bit pattern:
- if (!(size & (PVEC_COMPILED | PVEC_CHAR_TABLE
- | PVEC_SUB_CHAR_TABLE | PVEC_FONT))) */
- PVEC_COMPILED = 0x10,
- PVEC_CHAR_TABLE = 0x20,
- PVEC_SUB_CHAR_TABLE = 0x30,
- PVEC_FONT = 0x40
+ /* These should be last, check internal_equal to see why. */
+ PVEC_COMPILED,
+ PVEC_CHAR_TABLE,
+ PVEC_SUB_CHAR_TABLE,
+ 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
only the number of Lisp_Object fields (that need to be traced by GC).
The distinction is used, e.g., by Lisp_Process, which places extra
non-Lisp_Object fields at the end of the structure. */
- PSEUDOVECTOR_SIZE_BITS = 16,
+ PSEUDOVECTOR_SIZE_BITS = 12,
PSEUDOVECTOR_SIZE_MASK = (1 << PSEUDOVECTOR_SIZE_BITS) - 1,
- PVEC_TYPE_MASK = 0x0fff << PSEUDOVECTOR_SIZE_BITS,
+
+ /* To calculate the memory footprint of the pseudovector, it's useful
+ to store the size of non-Lisp area in word_size units here. */
+ PSEUDOVECTOR_REST_BITS = 12,
+ PSEUDOVECTOR_REST_MASK = (((1 << PSEUDOVECTOR_REST_BITS) - 1)
+ << PSEUDOVECTOR_SIZE_BITS),
+
+ /* Used to extract pseudovector subtype information. */
+ PSEUDOVECTOR_AREA_BITS = PSEUDOVECTOR_SIZE_BITS + PSEUDOVECTOR_REST_BITS,
+ PVEC_TYPE_MASK = 0x3f << PSEUDOVECTOR_AREA_BITS,
/* Number of bits to put in each character in the internal representation
of bool vectors. This should not vary across implementations. */
For example, if tem is a Lisp_Object whose type is Lisp_Cons,
XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */
-/* Return a perfect hash of the Lisp_Object representation. */
-#define XHASH(a) XLI (a)
-
#if USE_LSB_TAG
enum lsb_bits
#endif /* not USE_LSB_TAG */
+/* Return a (Lisp-integer sized) hash of the Lisp_Object value. Happens to be
+ like XUINT right now, but XUINT should only be applied to objects we know
+ are integers. */
+#define XHASH(a) XUINT (a)
+
/* For integers known to be positive, XFASTINT sometimes provides
faster retrieval and XSETFASTINT provides faster storage.
If not, fallback on the non-accelerated path. */
# define XUNTAG(a, type) XPNTR (a)
#endif
-#define EQ(x, y) (XHASH (x) == XHASH (y))
+#define EQ(x, y) (XLI (x) == XLI (y))
/* Largest and smallest representable fixnum values. These are the C
- values. They are macros for use in static initializers, and
- constants for visibility to GDB. */
-static EMACS_INT const MOST_POSITIVE_FIXNUM =
+ values. They are macros for use in static initializers. */
#define MOST_POSITIVE_FIXNUM (EMACS_INT_MAX >> INTTYPEBITS)
- MOST_POSITIVE_FIXNUM;
-static EMACS_INT const MOST_NEGATIVE_FIXNUM =
#define MOST_NEGATIVE_FIXNUM (-1 - MOST_POSITIVE_FIXNUM)
- MOST_NEGATIVE_FIXNUM;
/* Value is non-zero if I doesn't fit into a Lisp fixnum. It is
written this way so that it also works if I is of unsigned
/* Pseudovector types. */
-#define XSETPVECTYPE(v, code) XSETTYPED_PVECTYPE (v, header.size, code)
-#define XSETTYPED_PVECTYPE(v, size_member, code) \
- ((v)->size_member |= PSEUDOVECTOR_FLAG | ((code) << PSEUDOVECTOR_SIZE_BITS))
-#define XSETPVECTYPESIZE(v, code, sizeval) \
+#define XSETPVECTYPE(v, code) \
+ ((v)->header.size |= PSEUDOVECTOR_FLAG | ((code) << PSEUDOVECTOR_AREA_BITS))
+#define XSETPVECTYPESIZE(v, code, lispsize, restsize) \
((v)->header.size = (PSEUDOVECTOR_FLAG \
- | ((code) << PSEUDOVECTOR_SIZE_BITS) \
- | (sizeval)))
+ | ((code) << PSEUDOVECTOR_AREA_BITS) \
+ | ((restsize) << PSEUDOVECTOR_SIZE_BITS) \
+ | (lispsize)))
/* The cast to struct vectorlike_header * avoids aliasing issues. */
#define XSETPSEUDOVECTOR(a, b, code) \
#define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \
(XSETVECTOR (a, b), \
eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
- == (PSEUDOVECTOR_FLAG | (code << PSEUDOVECTOR_SIZE_BITS))))
+ == (PSEUDOVECTOR_FLAG | (code << PSEUDOVECTOR_AREA_BITS))))
#define XSETWINDOW_CONFIGURATION(a, b) \
(XSETPSEUDOVECTOR (a, b, PVEC_WINDOW_CONFIGURATION))
#define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS))
#define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW))
#define XSETTERMINAL(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_TERMINAL))
-/* XSETSUBR is special since Lisp_Subr lacks struct vectorlike_header. */
-#define XSETSUBR(a, b) \
- XSETTYPED_PSEUDOVECTOR (a, b, XSUBR (a)->size, PVEC_SUBR)
+#define XSETSUBR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUBR))
#define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED))
#define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER))
#define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE))
};
/* Header of vector-like objects. This documents the layout constraints on
- vectors and pseudovectors other than struct Lisp_Subr. It also prevents
+ vectors and pseudovectors (objects of PVEC_xxx subtype). It also prevents
compilers from being fooled by Emacs's type punning: the XSETPSEUDOVECTOR
and PSEUDOVECTORP macros cast their pointers to struct vectorlike_header *,
because when two such pointers potentially alias, a compiler won't
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8546>. */
struct vectorlike_header
{
- /* This field contains various pieces of information:
+ /* The only field contains various pieces of information:
- The MSB (ARRAY_MARK_FLAG) holds the gcmarkbit.
- The next bit (PSEUDOVECTOR_FLAG) indicates whether this is a plain
vector (0) or a pseudovector (1).
- If PSEUDOVECTOR_FLAG is 0, the rest holds the size (number
of slots) of the vector.
- - If PSEUDOVECTOR_FLAG is 1, the rest is subdivided into
- a "pvec type" tag held in PVEC_TYPE_MASK and a size held in the lowest
- PSEUDOVECTOR_SIZE_BITS. That size normally indicates the number of
- Lisp_Object slots at the beginning of the object that need to be
- traced by the GC, tho some types use it slightly differently.
- - E.g. if the pvec type is PVEC_FREE it means this is an unallocated
- vector on a free-list and PSEUDOVECTOR_SIZE_BITS indicates its size
- in bytes. */
+ - If PSEUDOVECTOR_FLAG is 1, the rest is subdivided into three fields:
+ - a) pseudovector subtype held in PVEC_TYPE_MASK field;
+ - b) number of Lisp_Objects slots at the beginning of the object
+ held in PSEUDOVECTOR_SIZE_MASK field. These objects are always
+ traced by the GC;
+ - c) size of the rest fields held in PSEUDOVECTOR_REST_MASK and
+ measured in word_size units. Rest fields may also include
+ Lisp_Objects, but these objects usually needs some special treatment
+ during GC.
+ There are some exceptions. For PVEC_FREE, b) is always zero. For
+ PVEC_BOOL_VECTOR and PVEC_SUBR, both b) and c) are always zero.
+ Current layout limits the pseudovectors to 63 PVEC_xxx subtypes,
+ 4095 Lisp_Objects in GC-ed area and 4095 word-sized other slots. */
ptrdiff_t size;
-
- /* When the vector is allocated from a vector block, NBYTES is used
- if the vector is not on a free list, and VECTOR is used otherwise.
- For large vector-like objects, BUFFER or VECTOR is used as a pointer
- to the next vector-like object. It is generally a buffer or a
- Lisp_Vector alias, so for convenience it is a union instead of a
- pointer: this way, one can write P->next.vector instead of ((struct
- Lisp_Vector *) P->next). */
- union {
- /* This is only needed for small vectors that are not free because the
- `size' field only gives us the number of Lisp_Object slots, whereas we
- need to know the total size, including non-Lisp_Object data.
- FIXME: figure out a way to store this info elsewhere so we can
- finally get rid of this extra word of overhead. */
- ptrdiff_t nbytes;
- struct buffer *buffer;
- /* FIXME: This can be removed: For large vectors, this field could be
- placed *before* the vector itself. And for small vectors on a free
- list, this field could be stored in the vector's bytes, since the
- empty vector is handled specially anyway. */
- struct Lisp_Vector *vector;
- } next;
};
/* Regular vector is just a header plus array of Lisp_Objects. */
/* This structure describes a built-in function.
It is generated by the DEFUN macro only.
- defsubr makes it into a Lisp object.
-
- This type is treated in most respects as a pseudovector,
- but since we never dynamically allocate or free them,
- we don't need a struct vectorlike_header and its 'next' field. */
+ defsubr makes it into a Lisp object. */
struct Lisp_Subr
{
- ptrdiff_t size;
+ struct vectorlike_header header;
union {
Lisp_Object (*a0) (void);
Lisp_Object (*a1) (Lisp_Object);
union Lisp_Fwd *fwd;
} val;
- /* Function value of the symbol or Qunbound if not fboundp. */
+ /* Function value of the symbol or Qnil if not fboundp. */
Lisp_Object function;
/* The symbol's property list. */
/* The structure of a Lisp hash table. */
+struct hash_table_test
+{
+ /* Name of the function used to compare keys. */
+ Lisp_Object name;
+
+ /* User-supplied hash function, or nil. */
+ Lisp_Object user_hash_function;
+
+ /* User-supplied key comparison function, or nil. */
+ Lisp_Object user_cmp_function;
+
+ /* C function to compare two keys. */
+ bool (*cmpfn) (struct hash_table_test *t, Lisp_Object, Lisp_Object);
+
+ /* C function to compute hash code. */
+ EMACS_UINT (*hashfn) (struct hash_table_test *t, Lisp_Object);
+};
+
struct Lisp_Hash_Table
{
/* This is for Lisp; the hash table code does not refer to it. */
struct vectorlike_header header;
- /* Function used to compare keys. */
- Lisp_Object test;
-
/* Nil if table is non-weak. Otherwise a symbol describing the
weakness of the table. */
Lisp_Object weak;
hash table size to reduce collisions. */
Lisp_Object index;
- /* User-supplied hash function, or nil. */
- Lisp_Object user_hash_function;
-
- /* User-supplied key comparison function, or nil. */
- Lisp_Object user_cmp_function;
-
/* Only the fields above are traced normally by the GC. The ones below
`count' are special and are either ignored by the GC or traced in
a special way (e.g. because of weakness). */
This is gc_marked specially if the table is weak. */
Lisp_Object key_and_value;
+ /* The comparison and hash functions. */
+ struct hash_table_test test;
+
/* Next weak hash table if this is a weak hash table. The head
of the list is in weak_hash_tables. */
struct Lisp_Hash_Table *next_weak;
-
- /* C function to compare two keys. */
- bool (*cmpfn) (struct Lisp_Hash_Table *,
- Lisp_Object, EMACS_UINT,
- Lisp_Object, EMACS_UINT);
-
- /* C function to compute hash code. */
- EMACS_UINT (*hashfn) (struct Lisp_Hash_Table *, Lisp_Object);
};
static double const DEFAULT_REHASH_SIZE = 1.5;
+/* Combine two integers X and Y for hashing. The result might not fit
+ into a Lisp integer. */
+
+LISP_INLINE EMACS_UINT
+sxhash_combine (EMACS_UINT x, EMACS_UINT y)
+{
+ return (x << 4) + (x >> (BITS_PER_EMACS_INT - 4)) + y;
+}
+
/* These structures are used for various misc types. */
struct Lisp_Misc_Any /* Supertype of all Misc types. */
int mouse_face_beg_x, mouse_face_beg_y;
int mouse_face_end_row, mouse_face_end_col;
int mouse_face_end_x, mouse_face_end_y;
- int mouse_face_past_end;
Lisp_Object mouse_face_window;
int mouse_face_face_id;
Lisp_Object mouse_face_overlay;
- /* 1 if a mouse motion event came and we didn't handle it right away because
- gc was in progress. */
- int mouse_face_deferred_gc;
-
/* FRAME and X, Y position of mouse when last checked for
highlighting. X and Y can be negative or out of range for the frame. */
struct frame *mouse_face_mouse_frame;
int mouse_face_mouse_x, mouse_face_mouse_y;
+ /* Nonzero if part of the text currently shown in
+ its mouse-face is beyond the window end. */
+ unsigned mouse_face_past_end : 1;
+
/* Nonzero means defer mouse-motion highlighting. */
- int mouse_face_defer;
+ unsigned mouse_face_defer : 1;
/* Nonzero means that the mouse highlight should not be shown. */
- int mouse_face_hidden;
-
- int mouse_face_image_state;
+ unsigned mouse_face_hidden : 1;
} Mouse_HLInfo;
\f
/* Data type checking. */
#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
+#define AUTOLOADP(x) (CONSP (x) && EQ (Qautoload, XCAR (x)))
+
#define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int)
#define BOOLFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Bool)
#define OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Obj)
#define PSEUDOVECTOR_TYPEP(v, code) \
(((v)->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
- == (PSEUDOVECTOR_FLAG | ((code) << PSEUDOVECTOR_SIZE_BITS)))
+ == (PSEUDOVECTOR_FLAG | ((code) << PSEUDOVECTOR_AREA_BITS)))
/* True if object X, with internal type struct T *, is a pseudovector whose
code is CODE. */
#define PROCESSP(x) PSEUDOVECTORP (x, PVEC_PROCESS)
#define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW)
#define TERMINALP(x) PSEUDOVECTORP (x, PVEC_TERMINAL)
-/* SUBRP is special since Lisp_Subr lacks struct vectorlike_header. */
-#define SUBRP(x) TYPED_PSEUDOVECTORP (x, Lisp_Subr, PVEC_SUBR)
+#define SUBRP(x) PSEUDOVECTORP (x, PVEC_SUBR)
#define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED)
#define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER)
#define CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
#define CHECK_WINDOW_CONFIGURATION(x) \
CHECK_TYPE (WINDOW_CONFIGURATIONP (x), Qwindow_configuration_p, x)
-/* A window of any sort, leaf or interior, is "valid" if one of its
- buffer, vchild, or hchild members is non-nil. */
-#define CHECK_VALID_WINDOW(x) \
- CHECK_TYPE (WINDOWP (x) \
- && (!NILP (XWINDOW (x)->buffer) \
- || !NILP (XWINDOW (x)->vchild) \
- || !NILP (XWINDOW (x)->hchild)), \
- Qwindow_valid_p, x)
-
-/* A window is "live" if and only if it shows a buffer. */
-#define CHECK_LIVE_WINDOW(x) \
- CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer), \
- Qwindow_live_p, x)
-
#define CHECK_PROCESS(x) \
CHECK_TYPE (PROCESSP (x), Qprocessp, x)
#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_SIZE_BITS) \
- | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
+ { { (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) \
+ | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)) }, \
{ (Lisp_Object (__cdecl *)(void))fnname }, \
minargs, maxargs, lname, intspec, 0}; \
Lisp_Object fnname
#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_SIZE_BITS, \
- { .a ## maxargs = fnname }, \
+ { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \
+ { .a ## maxargs = fnname }, \
minargs, maxargs, lname, intspec, 0}; \
Lisp_Object fnname
#endif
EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST;
-/* Defined in frame.c. */
-extern Lisp_Object Qframep;
-
/* Defined in data.c. */
extern Lisp_Object indirect_function (Lisp_Object);
extern Lisp_Object find_symbol_value (Lisp_Object);
extern void sweep_weak_hash_tables (void);
extern Lisp_Object Qcursor_in_echo_area;
extern Lisp_Object Qstring_lessp;
-extern Lisp_Object QCsize, QCtest, QCweakness, Qequal, Qeq, Qeql;
+extern Lisp_Object QCsize, QCtest, QCweakness, Qequal, Qeq;
EMACS_UINT hash_string (char const *, ptrdiff_t);
EMACS_UINT sxhash (Lisp_Object, int);
-Lisp_Object make_hash_table (Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object);
+Lisp_Object make_hash_table (struct hash_table_test, Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object);
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 Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t);
extern void del_range_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, bool);
extern Lisp_Object del_range_2 (ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t, bool);
-extern void modify_region (struct buffer *, ptrdiff_t, ptrdiff_t, bool);
+extern void modify_region_1 (ptrdiff_t, ptrdiff_t, bool);
extern void prepare_to_modify_buffer (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
extern void signal_after_change (ptrdiff_t, ptrdiff_t, ptrdiff_t);
extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t,
extern Lisp_Object Qautomatic_gc;
extern Lisp_Object Qchar_table_extra_slots;
extern struct Lisp_Vector *allocate_vector (EMACS_INT);
-extern struct Lisp_Vector *allocate_pseudovector (int memlen, int lisplen, int tag);
+extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type);
#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \
((typ*) \
allocate_pseudovector \
extern void display_malloc_warning (void);
extern ptrdiff_t inhibit_garbage_collection (void);
extern Lisp_Object make_save_value (void *, ptrdiff_t);
+extern void free_save_value (Lisp_Object);
extern Lisp_Object build_overlay (Lisp_Object, Lisp_Object, Lisp_Object);
extern void free_marker (Lisp_Object);
extern void free_cons (struct Lisp_Cons *);
extern ptrdiff_t marker_position (Lisp_Object);
extern ptrdiff_t marker_byte_position (Lisp_Object);
extern void clear_charpos_cache (struct buffer *);
-extern ptrdiff_t charpos_to_bytepos (ptrdiff_t);
extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t);
extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t);
extern void unchain_marker (struct Lisp_Marker *marker);
extern Lisp_Object close_file_unwind (Lisp_Object);
extern Lisp_Object restore_point_unwind (Lisp_Object);
extern _Noreturn void report_file_error (const char *, Lisp_Object);
-extern void internal_delete_file (Lisp_Object);
+extern bool internal_delete_file (Lisp_Object);
+extern bool file_directory_p (const char *);
+extern bool file_accessible_directory_p (const char *);
extern void syms_of_fileio (void);
extern Lisp_Object make_temp_name (Lisp_Object, bool);
extern Lisp_Object Qdelete_file;
#if HAVE_NS
extern Lisp_Object get_frame_param (struct frame *, Lisp_Object);
#endif
-extern Lisp_Object frame_buffer_predicate (Lisp_Object);
extern void frames_discard_buffer (Lisp_Object);
extern void syms_of_frame (void);
extern int read_bytecode_char (bool);
/* Defined in bytecode.c. */
-extern Lisp_Object Qbytecode;
extern void syms_of_bytecode (void);
extern struct byte_stack *byte_stack_list;
#if BYTE_MARK_STACK
extern Lisp_Object Qfont_param;
#endif
+#ifdef WINDOWSNT
+/* Defined on w32notify.c. */
+extern void syms_of_w32notify (void);
+#endif
+
+/* Defined in inotify.c */
+#ifdef HAVE_INOTIFY
+extern void syms_of_inotify (void);
+#endif
+
/* Defined in xfaces.c. */
extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t);
extern char *xstrdup (const char *);
+extern void xputenv (const char *);
extern char *egetenv (const char *);
block_input ();
c = getc (instream);
-#ifdef EINTR
/* Interrupted reads have been observed while reading over the network. */
while (c == EOF && ferror (instream) && errno == EINTR)
{
clearerr (instream);
c = getc (instream);
}
-#endif
unblock_input ();
If SUFFIXES is non-nil, it should be a list of suffixes to append to
file name when searching.
If non-nil, PREDICATE is used instead of `file-readable-p'.
-PREDICATE can also be an integer to pass to the access(2) function,
+PREDICATE can also be an integer to pass to the faccessat(2) function,
in which case file-name-handlers are ignored.
This function will normally skip directories, so if you want it to find
directories, make sure the PREDICATE function returns `dir-ok' for them. */)
int
openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *storeptr, Lisp_Object predicate)
{
- int fd;
ptrdiff_t fn_size = 100;
char buf[100];
char *fn = buf;
{
ptrdiff_t fnlen, lsuffix = SBYTES (XCAR (tail));
Lisp_Object handler;
- bool exists;
/* Concatenate path element/specified name with the suffix.
If the directory starts with /:, remove that. */
handler = Ffind_file_name_handler (string, Qfile_exists_p);
if ((!NILP (handler) || !NILP (predicate)) && !NATNUMP (predicate))
{
+ bool exists;
if (NILP (predicate))
exists = !NILP (Ffile_readable_p (string));
else
}
else
{
-#ifndef WINDOWSNT
- struct stat st;
-#endif
+ int fd;
const char *pfn;
encoded_fn = ENCODE_FILE (string);
pfn = SSDATA (encoded_fn);
-#ifdef WINDOWSNT
- exists = access (pfn, F_OK) == 0 && access (pfn, D_OK) < 0;
-#else
- exists = (stat (pfn, &st) == 0 && ! S_ISDIR (st.st_mode));
-#endif
- if (exists)
- {
- /* Check that we can access or open it. */
- if (NATNUMP (predicate))
- fd = (((XFASTINT (predicate) & ~INT_MAX) == 0
- && access (pfn, XFASTINT (predicate)) == 0)
- ? 1 : -1);
- else
- fd = emacs_open (pfn, O_RDONLY, 0);
- if (fd >= 0)
+ /* Check that we can access or open it. */
+ if (NATNUMP (predicate))
+ fd = (((XFASTINT (predicate) & ~INT_MAX) == 0
+ && (faccessat (AT_FDCWD, pfn, XFASTINT (predicate),
+ AT_EACCESS)
+ == 0)
+ && ! file_directory_p (pfn))
+ ? 1 : -1);
+ else
+ {
+ struct stat st;
+ fd = emacs_open (pfn, O_RDONLY, 0);
+ if (0 <= fd
+ && (fstat (fd, &st) != 0 || S_ISDIR (st.st_mode)))
{
- /* We succeeded; return this descriptor and filename. */
- if (storeptr)
- *storeptr = string;
- UNGCPRO;
- return fd;
+ emacs_close (fd);
+ fd = -1;
}
}
+
+ if (fd >= 0)
+ {
+ /* We succeeded; return this descriptor and filename. */
+ if (storeptr)
+ *storeptr = string;
+ UNGCPRO;
+ return fd;
+ }
}
}
if (absolute)
doc string, caller must make it
multibyte. */
- EMACS_INT pos = XINT (XCDR (val));
/* Position is negative for user variables. */
- if (pos < 0) pos = -pos;
+ EMACS_INT pos = eabs (XINT (XCDR (val)));
if (pos >= saved_doc_string_position
&& pos < (saved_doc_string_position
+ saved_doc_string_length))
/* Fmake_symbol inits fields of new symbols with Qunbound and Qnil,
so those two need to be fixed manually. */
SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound);
- set_symbol_function (Qunbound, Qunbound);
+ set_symbol_function (Qunbound, Qnil);
set_symbol_plist (Qunbound, Qnil);
SET_SYMBOL_VAL (XSYMBOL (Qnil), Qnil);
XSYMBOL (Qnil)->constant = 1;
XSYMBOL (Qnil)->declared_special = 1;
set_symbol_plist (Qnil, Qnil);
+ set_symbol_function (Qnil, Qnil);
Qt = intern_c_string ("t");
SET_SYMBOL_VAL (XSYMBOL (Qt), Qt);
{
Lisp_Object sym, tem;
sym = intern_c_string (sname->symbol_name);
- XSETTYPED_PVECTYPE (sname, size, PVEC_SUBR);
+ XSETPVECTYPE (sname, PVEC_SUBR);
XSETSUBR (tem, sname);
set_symbol_function (sym, tem);
}
if (STRINGP (dirfile))
{
dirfile = Fdirectory_file_name (dirfile);
- if (access (SSDATA (dirfile), 0) < 0)
- dir_warning ("Warning: Lisp directory `%s' does not exist.\n",
- XCAR (path_tail));
+ if (! file_accessible_directory_p (SSDATA (dirfile)))
+ dir_warning ("Lisp directory", XCAR (path_tail));
}
}
}
Lisp_Object tem, tem1;
/* Add to the path the lisp subdir of the installation
- dir, if it exists. Note: in out-of-tree builds,
+ dir, if it is accessible. Note: in out-of-tree builds,
this directory is empty save for Makefile. */
tem = Fexpand_file_name (build_string ("lisp"),
Vinstallation_directory);
- tem1 = Ffile_exists_p (tem);
+ tem1 = Ffile_accessible_directory_p (tem);
if (!NILP (tem1))
{
if (NILP (Fmember (tem, Vload_path)))
Lisp dirs instead. */
Vload_path = nconc2 (Vload_path, dump_path);
- /* Add leim under the installation dir, if it exists. */
+ /* Add leim under the installation dir, if it is accessible. */
tem = Fexpand_file_name (build_string ("leim"),
Vinstallation_directory);
- tem1 = Ffile_exists_p (tem);
+ tem1 = Ffile_accessible_directory_p (tem);
if (!NILP (tem1))
{
if (NILP (Fmember (tem, Vload_path)))
{
tem = Fexpand_file_name (build_string ("site-lisp"),
Vinstallation_directory);
- tem1 = Ffile_exists_p (tem);
+ tem1 = Ffile_accessible_directory_p (tem);
if (!NILP (tem1))
{
if (NILP (Fmember (tem, Vload_path)))
{
tem = Fexpand_file_name (build_string ("site-lisp"),
Vsource_directory);
- tem1 = Ffile_exists_p (tem);
+ tem1 = Ffile_accessible_directory_p (tem);
if (!NILP (tem1))
{
if (NILP (Fmember (tem, Vload_path)))
Vloads_in_progress = Qnil;
}
-/* Print a warning, using format string FORMAT, that directory DIRNAME
- does not exist. Print it on stderr and put it in *Messages*. */
+/* Print a warning that directory intended for use USE and with name
+ DIRNAME cannot be accessed. On entry, errno should correspond to
+ the access failure. Print the warning on stderr and put it in
+ *Messages*. */
void
-dir_warning (const char *format, Lisp_Object dirname)
+dir_warning (char const *use, Lisp_Object dirname)
{
- fprintf (stderr, format, SDATA (dirname));
+ static char const format[] = "Warning: %s `%s': %s\n";
+ int access_errno = errno;
+ fprintf (stderr, format, use, SSDATA (dirname), strerror (access_errno));
/* Don't log the warning before we've initialized!! */
if (initialized)
{
+ char const *diagnostic = emacs_strerror (access_errno);
USE_SAFE_ALLOCA;
- char *buffer = SAFE_ALLOCA (SBYTES (dirname)
- + strlen (format) - (sizeof "%s" - 1) + 1);
- ptrdiff_t message_len = esprintf (buffer, format, SDATA (dirname));
+ char *buffer = SAFE_ALLOCA (sizeof format - 3 * (sizeof "%s" - 1)
+ + strlen (use) + SBYTES (dirname)
+ + strlen (diagnostic));
+ ptrdiff_t message_len = esprintf (buffer, format, use, SSDATA (dirname),
+ diagnostic);
message_dolog (buffer, message_len, 0, STRING_MULTIBYTE (dirname));
SAFE_FREE ();
}
$(BLD)/w32menu.$(O) \
$(BLD)/w32reg.$(O) \
$(BLD)/w32font.$(O) \
+ $(BLD)/w32notify.$(O) \
$(BLD)/w32uniscribe.$(O)
LIBS = $(TLIB0) \
fontset.c menu.c dbusbind.c \
w32.c w32console.c w32fns.c w32heap.c w32inevt.c cygw32.c \
w32menu.c w32proc.c w32reg.c w32select.c w32term.c w32xfns.c \
- font.c w32font.c w32uniscribe.c \
+ font.c w32font.c w32uniscribe.c w32notify.c \
dispnew.c frame.c scroll.c xdisp.c window.c bidi.c \
charset.c coding.c category.c ccl.c character.c chartab.c \
cm.c term.c terminal.c xfaces.c \
obj = $(GLOBAL_SOURCES:.c=.o)
globals.h: gl-stamp
- @cmd /c rem true
+ @cmd $(SWITCHCHAR)c rem true
gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES)
- $(DEL) gl-tmp
"$(THISDIR)/../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
- cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h"
+ fc.exe $(SWITCHCHAR)b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h
- $(DEL) gl-tmp
echo timestamp > $@
$(MS_W32_H)
CONFIG_H = $(SRC)/config.h \
$(CONF_POST_H)
-DIR_H = $(NT_INC)/sys/dir.h \
- $(SRC)/ndir.h
W32GUI_H = $(SRC)/w32gui.h \
$(SYSTIME_H)
DISPEXTERN_H = $(SRC)/dispextern.h \
$(NT_INC)/stdint.h
SHA512_H = $(GNU_LIB)/sha512.h \
$(U64_H)
+SIG2STR_H = $(GNU_LIB)/sig2str.h \
+ $(GNU_LIB)/intprops.h
SOCKET_H = $(NT_INC)/sys/socket.h \
$(SRC)/w32.h
STAT_TIME_H = $(GNU_LIB)/stat-time.h \
SYSTTY_H = $(SRC)/systty.h \
$(NT_INC)/sys/ioctl.h \
$(NT_INC)/unistd.h
+SYSWAIT_H = $(SRC)/syswait.h \
+ $(NT_INC)/stdbool.h \
+ $(NT_INC)/sys/wait.h
TERMHOOKS_H = $(SRC)/termhooks.h \
$(SYSTIME_H)
W32FONT_H = $(SRC)/w32font.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
$(SRC)/epaths.h \
- $(SRC)/syswait.h \
$(SRC)/w32.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/unistd.h \
$(PROCESS_H) \
$(SYSSIGNAL_H) \
$(SYSTTY_H) \
+ $(SYSWAIT_H) \
$(TERMHOOKS_H)
$(BLD)/casefiddle.$(O) : \
$(SRC)/blockinput.h \
$(SRC)/commands.h \
$(SRC)/regex.h \
+ $(NT_INC)/dirent.h \
$(NT_INC)/pwd.h \
$(NT_INC)/sys/stat.h \
$(NT_INC)/unistd.h \
$(CHARSET_H) \
$(CODING_H) \
$(CONFIG_H) \
- $(DIR_H) \
$(FILEMODE_H) \
$(GRP_H) \
$(LISP_H) \
$(SRC)/termchar.h \
$(SRC)/w32.h \
$(NT_INC)/unistd.h \
+ $(GNU_LIB)/fpending.h \
$(BUFFER_H) \
$(CHARACTER_H) \
$(CONFIG_H) \
$(CODING_H) \
$(CONFIG_H) \
$(FRAME_H) \
+ $(GRP_H) \
$(INTERVALS_H) \
$(LISP_H) \
$(SYSTIME_H) \
$(SRC)/keymap.h \
$(SRC)/unexec.h \
$(SRC)/w32.h \
+ $(SRC)/w32common.h \
$(SRC)/w32heap.h \
$(SRC)/w32select.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/unistd.h \
+ $(GNU_LIB)/close-stream.h \
$(GNU_LIB)/ignore-value.h \
$(ATIMER_H) \
$(BUFFER_H) \
$(SRC)/commands.h \
$(SRC)/w32.h \
$(NT_INC)/pwd.h \
+ $(NT_INC)/sys/acl.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/sys/stat.h \
$(NT_INC)/unistd.h \
$(BLD)/w32.$(O) : \
$(SRC)/w32.c \
- $(SRC)/ndir.h \
$(SRC)/w32.h \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
$(SRC)/w32select.h \
+ $(NT_INC)/dirent.h \
$(NT_INC)/pwd.h \
+ $(NT_INC)/sys/acl.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/sys/time.h \
$(GNU_LIB)/allocator.h \
$(BLD)/w32proc.$(O) : \
$(SRC)/w32proc.c \
- $(SRC)/syswait.h \
$(SRC)/w32.h \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
$(PROCESS_H) \
$(SYSSIGNAL_H) \
$(SYSTIME_H) \
+ $(SYSWAIT_H) \
$(W32TERM_H)
$(BLD)/w32console.$(O) : \
$(SRC)/composite.h \
$(SRC)/gnutls.h \
$(SRC)/sysselect.h \
- $(SRC)/syswait.h \
$(SRC)/termopts.h \
$(NT_INC)/arpa/inet.h \
$(NT_INC)/netdb.h \
$(CHARACTER_H) \
$(CODING_H) \
$(CONFIG_H) \
+ $(C_CTYPE_H) \
$(DISPEXTERN_H) \
$(FRAME_H) \
$(KEYBOARD_H) \
$(LISP_H) \
$(PROCESS_H) \
+ $(SIG2STR_H) \
$(SOCKET_H) \
$(SYSSIGNAL_H) \
$(SYSTIME_H) \
$(SYSTTY_H) \
+ $(SYSWAIT_H) \
$(TERMHOOKS_H) \
$(W32TERM_H) \
$(WINDOW_H)
$(SRC)/blockinput.h \
$(SRC)/cm.h \
$(SRC)/sysselect.h \
- $(SRC)/syswait.h \
$(SRC)/termchar.h \
$(SRC)/termopts.h \
$(NT_INC)/netdb.h \
$(SYSSIGNAL_H) \
$(SYSTIME_H) \
$(SYSTTY_H) \
+ $(SYSWAIT_H) \
$(TERMHOOKS_H) \
$(WINDOW_H)
$(SRC)/w32.h \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
- $(LISP_H) \
- $(CONFIG_H)
+ $(CONFIG_H) \
+ $(LISP_H)
$(BLD)/vm-limit.$(O) : \
$(SRC)/vm-limit.c \
$(SRC)/w32.h \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
+ $(NT_INC)/unistd.h \
$(BUFFER_H) \
$(CCL_H) \
$(CHARACTER_H) \
$(W32FONT_H) \
$(W32TERM_H)
+$(BLD)/w32notify.$(O) : \
+ $(SRC)/w32notify.c \
+ $(SRC)/w32.h \
+ $(SRC)/w32common.h \
+ $(CODING_H) \
+ $(CONFIG_H) \
+ $(FRAME_H) \
+ $(KEYBOARD_H) \
+ $(LISP_H) \
+ $(TERMHOOKS_H) \
+ $(W32TERM_H)
+
# Each object file depends on stamp_BLD, because in parallel builds we must
# make sure $(BLD) exists before starting compilations.
#
and everywhere there is a marker. So we find the one of these places
that is closest to the specified position, and scan from there. */
-/* charpos_to_bytepos returns the byte position corresponding to CHARPOS. */
-
-/* This macro is a subroutine of charpos_to_bytepos.
+/* This macro is a subroutine of buf_charpos_to_bytepos.
Note that it is desirable that BYTEPOS is not evaluated
except when we really want its value. */
} \
}
-ptrdiff_t
-charpos_to_bytepos (ptrdiff_t charpos)
-{
- return buf_charpos_to_bytepos (current_buffer, charpos);
-}
+/* Return the byte position corresponding to CHARPOS in B. */
ptrdiff_t
buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
ptrdiff_t best_above, best_above_byte;
ptrdiff_t best_below, best_below_byte;
- if (charpos < BUF_BEG (b) || charpos > BUF_Z (b))
- emacs_abort ();
+ eassert (BUF_BEG (b) <= charpos && charpos <= BUF_Z (b));
best_above = BUF_Z (b);
best_above_byte = BUF_Z_BYTE (b);
#undef CONSIDER
-/* buf_bytepos_to_charpos returns the char position corresponding to
- BYTEPOS. */
-
/* This macro is a subroutine of buf_bytepos_to_charpos.
It is used when BYTEPOS is actually the byte position. */
} \
}
+/* Return the character position corresponding to BYTEPOS in B. */
+
ptrdiff_t
buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
{
ptrdiff_t best_above, best_above_byte;
ptrdiff_t best_below, best_below_byte;
- if (bytepos < BUF_BEG_BYTE (b) || bytepos > BUF_Z_BYTE (b))
- emacs_abort ();
+ eassert (BUF_BEG_BYTE (b) <= bytepos && bytepos <= BUF_Z_BYTE (b));
best_above = BUF_Z (b);
best_above_byte = BUF_Z_BYTE (b);
eltstring, zero,
make_number (compare),
completion_ignore_case ? Qt : Qnil);
- if (EQ (tem, Qt))
- matchsize = compare;
- else if (XINT (tem) < 0)
- matchsize = - XINT (tem) - 1;
- else
- matchsize = XINT (tem) - 1;
+ matchsize = EQ (tem, Qt) ? compare : eabs (XINT (tem)) - 1;
if (completion_ignore_case)
{
hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_deferred_gc = 0;
hlinfo->mouse_face_mouse_frame = NULL;
}
static void
IT_frame_up_to_date (struct frame *f)
{
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
Lisp_Object new_cursor, frame_desired_cursor;
struct window *sw;
- if (hlinfo->mouse_face_deferred_gc
- || (f && f == hlinfo->mouse_face_mouse_frame))
- {
- block_input ();
- if (hlinfo->mouse_face_mouse_frame)
- note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
- hlinfo->mouse_face_mouse_x,
- hlinfo->mouse_face_mouse_y);
- hlinfo->mouse_face_deferred_gc = 0;
- unblock_input ();
- }
+ FRAME_MOUSE_UPDATE (f);
/* Set the cursor type to whatever they wanted. In a minibuffer
window, we want the cursor to appear only if we are reading input
FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1];
}
the_only_display_info.mouse_highlight.mouse_face_mouse_frame = NULL;
- the_only_display_info.mouse_highlight.mouse_face_deferred_gc = 0;
the_only_display_info.mouse_highlight.mouse_face_beg_row =
the_only_display_info.mouse_highlight.mouse_face_beg_col = -1;
the_only_display_info.mouse_highlight.mouse_face_end_row =
/*
* A few unimplemented functions that we silently ignore.
*/
-int setpgrp (void) {return 0; }
+pid_t tcgetpgrp (int fd) { return 0; }
+int setpgid (int pid, int pgid) { return 0; }
int setpriority (int x, int y, int z) { return 0; }
+pid_t setsid (void) { return 0; }
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4
ssize_t
f = make_frame (1);
XSETFRAME (frame, f);
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
f->terminal = dpyinfo->terminal;
[panel setDelegate: fileDelegate];
panelOK = 0;
- if (! NILP (dir_only_p))
+ if (! NILP (dir_only_p))
{
[panel setCanChooseDirectories: YES];
[panel setCanChooseFiles: NO];
}
-
+
block_input ();
#if defined (NS_IMPL_COCOA) && \
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
[panel setNameFieldStringValue: [initS lastPathComponent]];
else
[panel setNameFieldStringValue: @""];
-
+
ret = [panel runModal];
#else
if (NILP (mustmatch) && NILP (dir_only_p))
void
ns_run_ascript (void)
{
- as_status = ns_do_applescript (as_script, as_result);
+ if (! NILP (as_script))
+ as_status = ns_do_applescript (as_script, as_result);
+ as_script = Qnil;
}
DEFUN ("ns-do-applescript", Fns_do_applescript, Sns_do_applescript, 1, 1, 0,
data2: NSAPP_DATA2_RUNASSCRIPT];
[NSApp postEvent: nxev atStart: NO];
- [NSApp run];
+
+ // If there are other events, the event loop may exit. Keep running
+ // until the script has been handled. */
+ while (! NILP (as_script))
+ [NSApp run];
status = as_status;
as_status = 0;
- as_script = Qnil;
as_result = 0;
unblock_input ();
if (status == 0)
}
-int
-x_char_width (struct frame *f)
-{
- return FRAME_COLUMN_WIDTH (f);
-}
-
-
-int
-x_char_height (struct frame *f)
-{
- return FRAME_LINE_HEIGHT (f);
-}
-
-
int
x_screen_planes (struct frame *f)
{
#define NSFONT_TRACE 0
extern Lisp_Object Qns;
-extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded;
+extern Lisp_Object Qnormal, Qbold, Qitalic;
static Lisp_Object Qapple, Qroman, Qmedium;
+static Lisp_Object Qcondensed, Qexpanded;
extern Lisp_Object Qappend;
extern float ns_antialias_threshold;
extern int ns_tmp_flags;
make_number (100 + 100
* ns_attribute_fvalue (desc, NSFontSlantTrait)));*/
FONT_SET_STYLE (font_entity, FONT_WIDTH_INDEX,
- traits & NSFontCondensedTrait ? Qcondensed :
- traits & NSFontExpandedTrait ? Qexpanded : Qnormal);
+ traits & NSFontCondensedTrait ? Qcondensed :
+ traits & NSFontExpandedTrait ? Qexpanded : Qnormal);
/* FONT_SET_STYLE (font_entity, FONT_WIDTH_INDEX,
make_number (100 + 100
* ns_attribute_fvalue (desc, NSFontWidthTrait)));*/
if (isMatch)
[fkeys removeObject: NSFontFamilyAttribute];
- matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys];
+ if ([fkeys count] > 0)
+ matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys];
+ else
+ matchingDescs = [NSMutableArray array];
+
if (NSFONT_TRACE)
NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc,
[matchingDescs count]);
{
nsfont_driver.type = Qns;
register_font_driver (&nsfont_driver, NULL);
+ DEFSYM (Qcondensed, "condensed");
+ DEFSYM (Qexpanded, "expanded");
DEFSYM (Qapple, "apple");
DEFSYM (Qroman, "roman");
DEFSYM (Qmedium, "medium");
/* this dummy decl needed to support TTYs */
struct x_output
{
- unsigned long background_pixel;
- unsigned long foreground_pixel;
+ int unused;
};
interpretation of even the system includes. */
#include <config.h>
+#include <fcntl.h>
#include <math.h>
+#include <pthread.h>
#include <sys/types.h>
#include <time.h>
#include <signal.h>
#include <c-strcase.h>
#include <ftoastr.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
#include "lisp.h"
#include "blockinput.h"
#include "sysselect.h"
NSBeginFunctionKey, 0x58,
NSSelectFunctionKey, 0x60,
NSPrintFunctionKey, 0x61,
+ NSClearLineFunctionKey, 0x0B,
NSExecuteFunctionKey, 0x62,
NSInsertFunctionKey, 0x63,
NSUndoFunctionKey, 0x65,
NSNewlineCharacter, 0x0D,
NSEnterCharacter, 0x8D,
+ 0x41|NSNumericPadKeyMask, 0xAE, /* KP_Decimal */
+ 0x43|NSNumericPadKeyMask, 0xAA, /* KP_Multiply */
+ 0x45|NSNumericPadKeyMask, 0xAB, /* KP_Add */
+ 0x4B|NSNumericPadKeyMask, 0xAF, /* KP_Divide */
+ 0x4E|NSNumericPadKeyMask, 0xAD, /* KP_Subtract */
+ 0x51|NSNumericPadKeyMask, 0xBD, /* KP_Equal */
+ 0x52|NSNumericPadKeyMask, 0xB0, /* KP_0 */
+ 0x53|NSNumericPadKeyMask, 0xB1, /* KP_1 */
+ 0x54|NSNumericPadKeyMask, 0xB2, /* KP_2 */
+ 0x55|NSNumericPadKeyMask, 0xB3, /* KP_3 */
+ 0x56|NSNumericPadKeyMask, 0xB4, /* KP_4 */
+ 0x57|NSNumericPadKeyMask, 0xB5, /* KP_5 */
+ 0x58|NSNumericPadKeyMask, 0xB6, /* KP_6 */
+ 0x59|NSNumericPadKeyMask, 0xB7, /* KP_7 */
+ 0x5B|NSNumericPadKeyMask, 0xB8, /* KP_8 */
+ 0x5C|NSNumericPadKeyMask, 0xB9, /* KP_9 */
+
0x1B, 0x1B /* escape */
};
hold_event_q.q[hold_event_q.nr++] = *event;
/* Make sure ns_read_socket is called, i.e. we have input. */
- kill (0, SIGIO);
+ raise (SIGIO);
send_appdefined = YES;
}
hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_deferred_gc = 0;
hlinfo->mouse_face_mouse_frame = 0;
}
ns_frame_up_to_date (struct frame *f)
/* --------------------------------------------------------------------------
External (hook): Fix up mouse highlighting right after a full update.
- Some highlighting was deferred if GC was happening during
- note_mouse_highlight (), while other highlighting was deferred for update.
+ Can't use FRAME_MOUSE_UPDATE due to ns_frame_begin and ns_frame_end calls.
-------------------------------------------------------------------------- */
{
NSTRACE (ns_frame_up_to_date);
if (FRAME_NS_P (f))
{
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- if ((hlinfo->mouse_face_deferred_gc || f ==hlinfo->mouse_face_mouse_frame)
- /*&& hlinfo->mouse_face_mouse_frame*/)
- {
- block_input ();
+ if (f == hlinfo->mouse_face_mouse_frame)
+ {
+ block_input ();
ns_update_begin(f);
- if (hlinfo->mouse_face_mouse_frame)
- note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
- hlinfo->mouse_face_mouse_x,
- hlinfo->mouse_face_mouse_y);
- hlinfo->mouse_face_deferred_gc = 0;
+ if (hlinfo->mouse_face_mouse_frame)
+ note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
+ hlinfo->mouse_face_mouse_x,
+ hlinfo->mouse_face_mouse_y);
ns_update_end(f);
- unblock_input ();
- }
+ unblock_input ();
+ }
}
}
if ([NSApp modalWindow] != nil)
return -1;
- if (hold_event_q.nr > 0)
+ if (hold_event_q.nr > 0)
{
int i;
for (i = 0; i < hold_event_q.nr; ++i)
/* NSTRACE (ns_select); */
- if (hold_event_q.nr > 0)
+ if (hold_event_q.nr > 0)
{
/* We already have events pending. */
- kill (0, SIGIO);
+ raise (SIGIO);
errno = EINTR;
return -1;
}
/* Inform fd_handler that select should be called */
c = 'g';
- write (selfds[1], &c, 1);
+ emacs_write (selfds[1], &c, 1);
}
else if (nr == 0 && timeout)
{
if (nr > 0 && readfds)
{
c = 's';
- write (selfds[1], &c, 1);
+ emacs_write (selfds[1], &c, 1);
}
unblock_input ();
dpyinfo->root_window = 42; /* a placeholder.. */
hlinfo->mouse_face_mouse_frame = NULL;
- hlinfo->mouse_face_deferred_gc = 0;
hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
color_file = Fexpand_file_name (build_string ("rgb.txt"),
Fsymbol_value (intern ("data-directory")));
- if (NILP (Ffile_readable_p (color_file)))
- fatal ("Could not find %s.\n", SDATA (color_file));
color_map = Fx_load_color_file (color_file);
if (NILP (color_map))
FD_ZERO (&fds);
FD_SET (selfds[0], &fds);
result = select (selfds[0]+1, &fds, NULL, NULL, NULL);
- if (result > 0)
- {
- read (selfds[0], &c, 1);
- if (c == 'g') waiting = 0;
- }
+ if (result > 0 && read (selfds[0], &c, 1) == 1 && c == 'g')
+ waiting = 0;
}
else
{
{
if (FD_ISSET (selfds[0], &readfds))
{
- read (selfds[0], &c, 1);
- if (c == 's') waiting = 1;
+ if (read (selfds[0], &c, 1) == 1 && c == 's')
+ waiting = 1;
}
else
{
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe);
int code;
unsigned fnKeysym = 0;
- int flags;
static NSMutableArray *nsEvArray;
#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
static BOOL firstTime = YES;
#endif
int left_is_none;
+ unsigned int flags = [theEvent modifierFlags];
NSTRACE (keyDown);
/* (Carbon way: [theEvent keyCode]) */
/* is it a "function key"? */
- fnKeysym = ns_convert_key (code);
+ fnKeysym = (code < 0x00ff && (flags&NSNumericPadKeyMask))
+ ? ns_convert_key ([theEvent keyCode] | NSNumericPadKeyMask)
+ : ns_convert_key (code);
+
if (fnKeysym)
{
/* COUNTERHACK: map 'Delete' on upper-right main KB to 'Backspace',
/* are there modifiers? */
emacs_event->modifiers = 0;
- flags = [theEvent modifierFlags];
if (flags & NSHelpKeyMask)
emacs_event->modifiers |= hyper_modifier;
/* Events may come here even if the event loop is not running.
If we don't enter the event loop, the scroll bar will not update.
So send SIGIO to ourselves. */
- if (apploopnr == 0) kill (0, SIGIO);
+ if (apploopnr == 0) raise (SIGIO);
return self;
}
FRAME_BASELINE_OFFSET (f) = font->baseline_offset;
FRAME_COLUMN_WIDTH (f) = font->average_width;
- FRAME_SPACE_WIDTH (f) = font->space_width;
FRAME_LINE_HEIGHT (f) = font->height;
compute_fringe_widths (f, 1);
else
fprintf (stderr, "#<%s_LISP_OBJECT 0x%08"pI"x>\r\n",
!valid ? "INVALID" : "SOME",
- XHASH (arg));
+ XLI (arg));
}
\f
#endif
/* Implement a readable output, e.g.:
#s(hash-table size 2 test equal data (k1 v1 k2 v2)) */
- /* Always print the size. */
+ /* Always print the size. */
len = sprintf (buf, "#s(hash-table size %"pD"d", ASIZE (h->next));
strout (buf, len, len, printcharfun);
- if (!NILP (h->test))
+ if (!NILP (h->test.name))
{
strout (" test ", -1, -1, printcharfun);
- print_object (h->test, printcharfun, escapeflag);
+ print_object (h->test.name, printcharfun, escapeflag);
}
if (!NILP (h->weak))
break;
case Lisp_Misc_Save_Value:
- strout ("#<save_value ", -1, -1, printcharfun);
{
- int len = sprintf (buf, "ptr=%p int=%"pD"d",
- XSAVE_VALUE (obj)->pointer,
- XSAVE_VALUE (obj)->integer);
- strout (buf, len, len, printcharfun);
+ int i;
+ struct Lisp_Save_Value *v = XSAVE_VALUE (obj);
+
+ strout ("#<save-value ", -1, -1, printcharfun);
+ if (v->dogc)
+ {
+ int lim = min (v->integer, 8);
+
+ /* Try to print up to 8 objects we have saved. Although
+ valid_lisp_object_p is slow, this shouldn't be a real
+ bottleneck because such a saved values are quite rare. */
+
+ i = sprintf (buf, "with %"pD"d objects", v->integer);
+ strout (buf, i, i, printcharfun);
+
+ for (i = 0; i < lim; i++)
+ {
+ Lisp_Object maybe = ((Lisp_Object *) v->pointer)[i];
+
+ if (valid_lisp_object_p (maybe) > 0)
+ {
+ PRINTCHAR (' ');
+ print_object (maybe, printcharfun, escapeflag);
+ }
+ else
+ strout (" <invalid>", -1, -1, printcharfun);
+ }
+ if (i == lim && i < v->integer)
+ strout (" ...", 4, 4, printcharfun);
+ }
+ else
+ {
+ i = sprintf (buf, "ptr=%p int=%"pD"d", v->pointer, v->integer);
+ strout (buf, i, i, printcharfun);
+ }
+ PRINTCHAR ('>');
}
- PRINTCHAR ('>');
break;
default:
#include <pty.h>
#endif
+#include <c-ctype.h>
+#include <sig2str.h>
+
#endif /* subprocesses */
#include "systime.h"
EMACS_TIME *, void *);
#endif
-#ifndef WNOHANG
-# undef waitpid
-# define waitpid(pid, status, options) wait (status)
-#endif
-#ifndef WUNTRACED
-# define WUNTRACED 0
-#endif
-
/* Work around GCC 4.7.0 bug with strict overflow checking; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
These lines can be removed once the GCC bug is fixed. */
#ifndef NON_BLOCKING_CONNECT
#ifdef HAVE_SELECT
#if defined (HAVE_GETPEERNAME) || defined (GNU_LINUX)
-#if defined (O_NONBLOCK) || defined (O_NDELAY)
#if defined (EWOULDBLOCK) || defined (EINPROGRESS)
#define NON_BLOCKING_CONNECT
#endif /* EWOULDBLOCK || EINPROGRESS */
-#endif /* O_NONBLOCK || O_NDELAY */
#endif /* HAVE_GETPEERNAME || GNU_LINUX */
#endif /* HAVE_SELECT */
#endif /* NON_BLOCKING_CONNECT */
#define DATAGRAM_CONN_P(proc) (0)
#endif
-/* Maximum number of bytes to send to a pty without an eof. */
-static int pty_max_bytes;
-
/* These setters are used only in this file, so they can be private. */
static void
pset_buffer (struct Lisp_Process *p, Lisp_Object val)
#ifdef PTY_OPEN
PTY_OPEN;
#else /* no PTY_OPEN */
- {
-# ifdef O_NONBLOCK
- fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0);
-# else
- fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0);
-# endif
- }
+ fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0);
#endif /* no PTY_OPEN */
if (fd >= 0)
#else
sprintf (pty_name, "/dev/tty%c%x", c, i);
#endif /* no PTY_TTY_NAME_SPRINTF */
- if (access (pty_name, 6) != 0)
+ if (faccessat (AT_FDCWD, pty_name, R_OK | W_OK, AT_EACCESS) != 0)
{
emacs_close (fd);
# ifndef __sgi
}
-#ifdef SIGCHLD
/* Fdelete_process promises to immediately forget about the process, but in
reality, Emacs needs to remember those processes until they have been
- treated by the SIGCHLD handler; otherwise this handler would consider the
- process as being synchronous and say that the synchronous process is
- dead. */
+ treated by the SIGCHLD handler and waitpid has been invoked on them;
+ otherwise they might fill up the kernel's process table.
+
+ Some processes created by call-process are also put onto this list. */
static Lisp_Object deleted_pid_list;
-#endif
+
+void
+record_deleted_pid (pid_t pid)
+{
+ deleted_pid_list = Fcons (make_fixnum_or_float (pid),
+ /* GC treated elements set to nil. */
+ Fdelq (Qnil, deleted_pid_list));
+
+}
DEFUN ("delete-process", Fdelete_process, Sdelete_process, 1, 1, 0,
doc: /* Delete PROCESS: kill it and forget about it immediately.
status_notify (p);
redisplay_preserve_echo_area (13);
}
- else if (p->infd >= 0)
+ else
{
-#ifdef SIGCHLD
- Lisp_Object symbol;
- pid_t pid = p->pid;
-
- /* No problem storing the pid here, as it is still in Vprocess_alist. */
- deleted_pid_list = Fcons (make_fixnum_or_float (pid),
- /* GC treated elements set to nil. */
- Fdelq (Qnil, deleted_pid_list));
- /* If the process has already signaled, remove it from the list. */
- if (p->raw_status_new)
- update_status (p);
- symbol = p->status;
- if (CONSP (p->status))
- symbol = XCAR (p->status);
- if (EQ (symbol, Qsignal) || EQ (symbol, Qexit))
- deleted_pid_list
- = Fdelete (make_fixnum_or_float (pid), deleted_pid_list);
- else
-#endif
+ if (p->alive)
+ record_kill_process (p);
+
+ if (p->infd >= 0)
{
- Fkill_process (process, Qnil);
- /* Do this now, since remove_process will make the
- SIGCHLD handler do nothing. */
- pset_status (p, Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)));
+ /* Update P's status, since record_kill_process will make the
+ SIGCHLD handler update deleted_pid_list, not *P. */
+ Lisp_Object symbol;
+ if (p->raw_status_new)
+ update_status (p);
+ symbol = CONSP (p->status) ? XCAR (p->status) : p->status;
+ if (! (EQ (symbol, Qsignal) || EQ (symbol, Qexit)))
+ pset_status (p, list2 (Qsignal, make_number (SIGKILL)));
+
p->tick = ++process_tick;
status_notify (p);
redisplay_preserve_echo_area (13);
int inchannel, outchannel;
pid_t pid;
int sv[2];
-#if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
+#ifndef WINDOWSNT
int wait_child_setup[2];
#endif
-#ifdef SIGCHLD
sigset_t blocked;
-#endif
/* Use volatile to protect variables from being clobbered by vfork. */
volatile int forkin, forkout;
volatile int pty_flag = 0;
volatile Lisp_Object lisp_pty_name = Qnil;
volatile Lisp_Object encoded_current_dir;
-#if HAVE_WORKING_VFORK
- char **volatile save_environ;
-#endif
inchannel = outchannel = -1;
#if ! defined (USG) || defined (USG_SUBTTY_WORKS)
/* On most USG systems it does not work to open the pty's tty here,
then close it and reopen it in the child. */
-#ifdef O_NOCTTY
/* Don't let this terminal become our controlling terminal
(in case we don't have one). */
forkout = forkin = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0);
-#else
- forkout = forkin = emacs_open (pty_name, O_RDWR, 0);
-#endif
if (forkin < 0)
report_file_error ("Opening pty", Qnil);
#else
forkin = sv[0];
}
-#if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
+#ifndef WINDOWSNT
{
int tem;
}
#endif
-#ifdef O_NONBLOCK
fcntl (inchannel, F_SETFL, O_NONBLOCK);
fcntl (outchannel, F_SETFL, O_NONBLOCK);
-#else
-#ifdef O_NDELAY
- fcntl (inchannel, F_SETFL, O_NDELAY);
- fcntl (outchannel, F_SETFL, O_NDELAY);
-#endif
-#endif
/* Record this as an active process, with its channels.
As a result, child_setup will close Emacs's side of the pipes. */
if (inchannel > max_process_desc)
max_process_desc = inchannel;
- /* Until we store the proper pid, enable the SIGCHLD handler
- to recognize an unknown pid as standing for this process.
- It is very important not to let this `marker' value stay
- in the table after this function has returned; if it does
- it might cause call-process to hang and subsequent asynchronous
- processes to get their return values scrambled. */
- XPROCESS (process)->pid = -1;
-
- /* This must be called after the above line because it may signal an
- error. */
+ /* This may signal an error. */
setup_process_coding_systems (process);
encoded_current_dir = ENCODE_FILE (current_dir);
block_input ();
-#ifdef SIGCHLD
/* Block SIGCHLD until we have a chance to store the new fork's
pid in its process structure. */
sigemptyset (&blocked);
sigaddset (&blocked, SIGCHLD);
pthread_sigmask (SIG_BLOCK, &blocked, 0);
-#endif
-
-#if HAVE_WORKING_VFORK
- /* child_setup must clobber environ on systems with true vfork.
- Protect it from permanent change. */
- save_environ = environ;
-#endif
#ifndef WINDOWSNT
pid = vfork ();
/* Make the pty be the controlling terminal of the process. */
#ifdef HAVE_PTYS
/* First, disconnect its current controlling terminal. */
-#ifdef HAVE_SETSID
/* We tried doing setsid only if pty_flag, but it caused
process_set_signal to fail on SGI when using a pipe. */
setsid ();
ioctl (xforkin, TIOCSCTTY, 0);
#endif
}
-#else /* not HAVE_SETSID */
- /* It's very important to call setpgid here and no time
- afterwards. Otherwise, we lose our controlling tty which
- is set when we open the pty. */
- setpgid (0, 0);
-#endif /* not HAVE_SETSID */
#if defined (LDISC1)
if (pty_flag && xforkin >= 0)
{
ioctl (j, TIOCNOTTY, 0);
emacs_close (j);
}
-#ifndef USG
- /* In order to get a controlling terminal on some versions
- of BSD, it is necessary to put the process in pgrp 0
- before it opens the terminal. */
- setpgid (0, 0);
-#endif
}
#endif /* TIOCNOTTY */
#if !defined (DONT_REOPEN_PTY)
/*** There is a suggestion that this ought to be a
- conditional on TIOCSPGRP,
- or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)).
+ conditional on TIOCSPGRP, or !defined TIOCSCTTY.
Trying the latter gave the wrong results on Debian GNU/Linux 1.1;
that system does seem to need this code, even though
- both HAVE_SETSID and TIOCSCTTY are defined. */
+ both TIOCSCTTY is defined. */
/* Now close the pty (if we had it open) and reopen it.
This makes the pty the controlling terminal of the subprocess. */
if (pty_flag)
/* Emacs ignores SIGPIPE, but the child should not. */
signal (SIGPIPE, SIG_DFL);
-#ifdef SIGCHLD
/* Stop blocking signals in the child. */
pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
-#endif
if (pty_flag)
child_setup_tty (xforkout);
pid = child_setup (xforkin, xforkout, xforkout,
new_argv, 1, encoded_current_dir);
#else /* not WINDOWSNT */
-#ifdef FD_CLOEXEC
emacs_close (wait_child_setup[0]);
-#endif
child_setup (xforkin, xforkout, xforkout,
new_argv, 1, encoded_current_dir);
#endif /* not WINDOWSNT */
/* Back in the parent process. */
-#if HAVE_WORKING_VFORK
- environ = save_environ;
-#endif
-
XPROCESS (process)->pid = pid;
+ if (0 <= pid)
+ XPROCESS (process)->alive = 1;
/* Stop blocking signals in the parent. */
-#ifdef SIGCHLD
pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
-#endif
unblock_input ();
if (pid < 0)
pset_tty_name (XPROCESS (process), lisp_pty_name);
-#if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
+#ifndef WINDOWSNT
/* Wait for child_setup to complete in case that vfork is
actually defined as fork. The descriptor wait_child_setup[1]
of a pipe is closed at the child side either by close-on-exec
- on successful execvp or the _exit call in child_setup. */
+ on successful execve or the _exit call in child_setup. */
{
char dummy;
#if ! defined (USG) || defined (USG_SUBTTY_WORKS)
/* On most USG systems it does not work to open the pty's tty here,
then close it and reopen it in the child. */
-#ifdef O_NOCTTY
/* Don't let this terminal become our controlling terminal
(in case we don't have one). */
int forkout = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0);
-#else
- int forkout = emacs_open (pty_name, O_RDWR, 0);
-#endif
if (forkout < 0)
report_file_error ("Opening pty", Qnil);
#if defined (DONT_REOPEN_PTY)
}
#endif /* HAVE_PTYS */
-#ifdef O_NONBLOCK
fcntl (inchannel, F_SETFL, O_NONBLOCK);
fcntl (outchannel, F_SETFL, O_NONBLOCK);
-#else
-#ifdef O_NDELAY
- fcntl (inchannel, F_SETFL, O_NDELAY);
- fcntl (outchannel, F_SETFL, O_NDELAY);
-#endif
-#endif
/* Record this as an active process, with its channels.
As a result, child_setup will close Emacs's side of the pipes. */
{
/* Don't support network sockets when non-blocking mode is
not available, since a blocked Emacs is not useful. */
-#if !defined (O_NONBLOCK) && !defined (O_NDELAY)
- error ("Network servers not supported");
-#else
is_server = 1;
if (TYPE_RANGED_INTEGERP (int, tem))
backlog = XINT (tem);
-#endif
}
/* Make QCaddress an alias for :local (server) or :remote (client). */
#ifdef NON_BLOCKING_CONNECT
if (is_non_blocking_client)
{
-#ifdef O_NONBLOCK
ret = fcntl (s, F_SETFL, O_NONBLOCK);
-#else
- ret = fcntl (s, F_SETFL, O_NDELAY);
-#endif
if (ret < 0)
{
xerrno = errno;
chan_process[inch] = proc;
-#ifdef O_NONBLOCK
fcntl (inch, F_SETFL, O_NONBLOCK);
-#else
-#ifdef O_NDELAY
- fcntl (inch, F_SETFL, O_NDELAY);
-#endif
-#endif
p = XPROCESS (proc);
chan_process[s] = proc;
-#ifdef O_NONBLOCK
fcntl (s, F_SETFL, O_NONBLOCK);
-#else
-#ifdef O_NDELAY
- fcntl (s, F_SETFL, O_NDELAY);
-#endif
-#endif
p = XPROCESS (proc);
if (EMACS_TIME_LT (timer_delay, timeout))
{
timeout = timer_delay;
- timeout_reduced_for_timers = 1;
+ timeout_reduced_for_timers = 1;
}
}
else
total_nread += nread;
got_some_input = 1;
}
-#ifdef EIO
- else if (nread == -1 && EIO == errno)
+ else if (nread == -1 && (errno == EIO || errno == EAGAIN))
break;
-#endif
-#ifdef EAGAIN
- else if (nread == -1 && EAGAIN == errno)
- break;
-#endif
#ifdef EWOULDBLOCK
else if (nread == -1 && EWOULDBLOCK == errno)
break;
yielding EBADF here or at select() call above.
So, SIGHUP is ignored (see def of PTY_TTY_NAME_SPRINTF
in m/ibmrt-aix.h), and here we just ignore the select error.
- Cleanup occurs c/o status_notify after SIGCLD. */
+ Cleanup occurs c/o status_notify after SIGCHLD. */
no_avail = 1; /* Cannot depend on values returned */
#else
emacs_abort ();
else if (nread == -1 && errno == EWOULDBLOCK)
;
#endif
- /* ISC 4.1 defines both EWOULDBLOCK and O_NONBLOCK,
- and Emacs uses O_NONBLOCK, so what we get is EAGAIN. */
-#ifdef O_NONBLOCK
- else if (nread == -1 && errno == EAGAIN)
- ;
-#else
-#ifdef O_NDELAY
else if (nread == -1 && errno == EAGAIN)
;
+#ifdef WINDOWSNT
+ /* FIXME: Is this special case still needed? */
/* Note that we cannot distinguish between no input
available now and a closed pipe.
With luck, a closed pipe will be accompanied by
subprocess termination and SIGCHLD. */
else if (nread == 0 && !NETCONN_P (proc) && !SERIALCONN_P (proc))
;
-#endif /* O_NDELAY */
-#endif /* O_NONBLOCK */
+#endif
#ifdef HAVE_PTYS
/* On some OSs with ptys, when the process on one end of
a pty exits, the other end gets an error reading with
Therefore, if we get an error reading and errno =
EIO, just continue, because the child process has
exited and should clean itself up soon (e.g. when we
- get a SIGCHLD).
-
- However, it has been known to happen that the SIGCHLD
- got lost. So raise the signal again just in case.
- It can't hurt. */
+ get a SIGCHLD). */
else if (nread == -1 && errno == EIO)
{
struct Lisp_Process *p = XPROCESS (proc);
p->tick = ++process_tick;
pset_status (p, Qfailed);
}
- else
- handle_child_signal (SIGCHLD);
}
#endif /* HAVE_PTYS */
/* If we can detect process termination, don't consider the
process gone just because its pipe is closed. */
-#ifdef SIGCHLD
else if (nread == 0 && !NETCONN_P (proc) && !SERIALCONN_P (proc))
;
-#endif
else
{
/* Preserve status of processes already terminated. */
buf = SSDATA (object);
}
- if (pty_max_bytes == 0)
- {
-#if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON)
- pty_max_bytes = fpathconf (p->outfd, _PC_MAX_CANON);
- if (pty_max_bytes < 0)
- pty_max_bytes = 250;
-#else
- pty_max_bytes = 250;
-#endif
- /* Deduct one, to leave space for the eof. */
- pty_max_bytes--;
- }
-
/* If there is already data in the write_queue, put the new data
in the back of queue. Otherwise, ignore it. */
if (!NILP (p->write_queue))
if (rv < 0)
{
- if (0
+ if (errno == EAGAIN
#ifdef EWOULDBLOCK
|| errno == EWOULDBLOCK
-#endif
-#ifdef EAGAIN
- || errno == EAGAIN
#endif
)
/* Buffer is full. Wait, accepting input;
Output from processes can arrive in between bunches. */)
(Lisp_Object process, Lisp_Object start, Lisp_Object end)
{
- Lisp_Object proc;
- ptrdiff_t start1, end1;
+ Lisp_Object proc = get_process (process);
+ ptrdiff_t start_byte, end_byte;
- proc = get_process (process);
validate_region (&start, &end);
+ start_byte = CHAR_TO_BYTE (XINT (start));
+ end_byte = CHAR_TO_BYTE (XINT (end));
+
if (XINT (start) < GPT && XINT (end) > GPT)
- move_gap (XINT (start));
+ move_gap_both (XINT (start), start_byte);
- start1 = CHAR_TO_BYTE (XINT (start));
- end1 = CHAR_TO_BYTE (XINT (end));
- send_process (proc, (char *) BYTE_POS_ADDR (start1), end1 - start1,
- Fcurrent_buffer ());
+ send_process (proc, (char *) BYTE_POS_ADDR (start_byte),
+ end_byte - start_byte, Fcurrent_buffer ());
return Qnil;
}
If we can, we try to signal PROCESS by sending control characters
down the pty. This allows us to signal inferiors who have changed
- their uid, for which killpg would return an EPERM error. */
+ their uid, for which kill would return an EPERM error. */
static void
process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
if (!NILP (current_group))
{
if (ioctl (p->infd, TIOCSIGSEND, signo) == -1)
- EMACS_KILLPG (gid, signo);
+ kill (-gid, signo);
}
else
{
kill (gid, signo);
}
#else /* ! defined (TIOCSIGSEND) */
- EMACS_KILLPG (gid, signo);
+ kill (-gid, signo);
#endif /* ! defined (TIOCSIGSEND) */
}
return process;
}
+/* Return the integer value of the signal whose abbreviation is ABBR,
+ or a negative number if there is no such signal. */
+static int
+abbr_to_signal (char const *name)
+{
+ int i, signo;
+ char sigbuf[20]; /* Large enough for all valid signal abbreviations. */
+
+ if (!strncmp (name, "SIG", 3) || !strncmp (name, "sig", 3))
+ name += 3;
+
+ for (i = 0; i < sizeof sigbuf; i++)
+ {
+ sigbuf[i] = c_toupper (name[i]);
+ if (! sigbuf[i])
+ return str2sig (sigbuf, &signo) == 0 ? signo : -1;
+ }
+
+ return -1;
+}
+
DEFUN ("signal-process", Fsignal_process, Ssignal_process,
2, 2, "sProcess (name or number): \nnSignal code: ",
doc: /* Send PROCESS the signal with code SIGCODE.
(Lisp_Object process, Lisp_Object sigcode)
{
pid_t pid;
+ int signo;
if (STRINGP (process))
{
error ("Cannot signal process %s", SDATA (XPROCESS (process)->name));
}
-#define parse_signal(NAME, VALUE) \
- else if (!xstrcasecmp (name, NAME)) \
- XSETINT (sigcode, VALUE)
-
if (INTEGERP (sigcode))
- CHECK_TYPE_RANGED_INTEGER (int, sigcode);
+ {
+ CHECK_TYPE_RANGED_INTEGER (int, sigcode);
+ signo = XINT (sigcode);
+ }
else
{
char *name;
CHECK_SYMBOL (sigcode);
name = SSDATA (SYMBOL_NAME (sigcode));
- if (!strncmp (name, "SIG", 3) || !strncmp (name, "sig", 3))
- name += 3;
-
- if (0)
- ;
-#ifdef SIGUSR1
- parse_signal ("usr1", SIGUSR1);
-#endif
-#ifdef SIGUSR2
- parse_signal ("usr2", SIGUSR2);
-#endif
- parse_signal ("term", SIGTERM);
-#ifdef SIGHUP
- parse_signal ("hup", SIGHUP);
-#endif
- parse_signal ("int", SIGINT);
-#ifdef SIGQUIT
- parse_signal ("quit", SIGQUIT);
-#endif
- parse_signal ("ill", SIGILL);
- parse_signal ("abrt", SIGABRT);
-#ifdef SIGEMT
- parse_signal ("emt", SIGEMT);
-#endif
-#ifdef SIGKILL
- parse_signal ("kill", SIGKILL);
-#endif
- parse_signal ("fpe", SIGFPE);
-#ifdef SIGBUS
- parse_signal ("bus", SIGBUS);
-#endif
- parse_signal ("segv", SIGSEGV);
-#ifdef SIGSYS
- parse_signal ("sys", SIGSYS);
-#endif
-#ifdef SIGPIPE
- parse_signal ("pipe", SIGPIPE);
-#endif
-#ifdef SIGALRM
- parse_signal ("alrm", SIGALRM);
-#endif
-#ifdef SIGURG
- parse_signal ("urg", SIGURG);
-#endif
-#ifdef SIGSTOP
- parse_signal ("stop", SIGSTOP);
-#endif
-#ifdef SIGTSTP
- parse_signal ("tstp", SIGTSTP);
-#endif
-#ifdef SIGCONT
- parse_signal ("cont", SIGCONT);
-#endif
-#ifdef SIGCHLD
- parse_signal ("chld", SIGCHLD);
-#endif
-#ifdef SIGTTIN
- parse_signal ("ttin", SIGTTIN);
-#endif
-#ifdef SIGTTOU
- parse_signal ("ttou", SIGTTOU);
-#endif
-#ifdef SIGIO
- parse_signal ("io", SIGIO);
-#endif
-#ifdef SIGXCPU
- parse_signal ("xcpu", SIGXCPU);
-#endif
-#ifdef SIGXFSZ
- parse_signal ("xfsz", SIGXFSZ);
-#endif
-#ifdef SIGVTALRM
- parse_signal ("vtalrm", SIGVTALRM);
-#endif
-#ifdef SIGPROF
- parse_signal ("prof", SIGPROF);
-#endif
-#ifdef SIGWINCH
- parse_signal ("winch", SIGWINCH);
-#endif
-#ifdef SIGINFO
- parse_signal ("info", SIGINFO);
-#endif
- else
+ signo = abbr_to_signal (name);
+ if (signo < 0)
error ("Undefined signal name %s", name);
}
-#undef parse_signal
-
- return make_number (kill (pid, XINT (sigcode)));
+ return make_number (kill (pid, signo));
}
DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0,
return process;
}
\f
-/* On receipt of a signal that a child status has changed, loop asking
- about children with changed statuses until the system says there
- are no more.
+/* The main Emacs thread records child processes in three places:
+
+ - Vprocess_alist, for asynchronous subprocesses, which are child
+ processes visible to Lisp.
+
+ - deleted_pid_list, for child processes invisible to Lisp,
+ typically because of delete-process. These are recorded so that
+ the processes can be reaped when they exit, so that the operating
+ system's process table is not cluttered by zombies.
+
+ - the local variable PID in Fcall_process, call_process_cleanup and
+ call_process_kill, for synchronous subprocesses.
+ record_unwind_protect is used to make sure this process is not
+ forgotten: if the user interrupts call-process and the child
+ process refuses to exit immediately even with two C-g's,
+ call_process_kill adds PID's contents to deleted_pid_list before
+ returning.
+
+ The main Emacs thread invokes waitpid only on child processes that
+ it creates and that have not been reaped. This avoid races on
+ platforms such as GTK, where other threads create their own
+ subprocesses which the main thread should not reap. For example,
+ if the main thread attempted to reap an already-reaped child, it
+ might inadvertently reap a GTK-created process that happened to
+ have the same process ID. */
+
+/* Handle a SIGCHLD signal by looking for known child processes of
+ Emacs whose status have changed. For each one found, record its
+ new status.
All we do is change the status; we do not run sentinels or print
notifications. That is saved for the next time keyboard input is
** Malloc WARNING: This should never call malloc either directly or
indirectly; if it does, that is a bug */
-/* Record the changed status of the child process PID with wait status W. */
-void
-record_child_status_change (pid_t pid, int w)
+static void
+handle_child_signal (int sig)
{
-#ifdef SIGCHLD
- Lisp_Object proc;
- struct Lisp_Process *p;
Lisp_Object tail;
/* Find the process that signaled us, and record its status. */
- /* The process can have been deleted by Fdelete_process. */
+ /* The process can have been deleted by Fdelete_process, or have
+ been started asynchronously by Fcall_process. */
for (tail = deleted_pid_list; CONSP (tail); tail = XCDR (tail))
{
+ bool all_pids_are_fixnums
+ = (MOST_NEGATIVE_FIXNUM <= TYPE_MINIMUM (pid_t)
+ && TYPE_MAXIMUM (pid_t) <= MOST_POSITIVE_FIXNUM);
Lisp_Object xpid = XCAR (tail);
- if ((INTEGERP (xpid) && pid == XINT (xpid))
- || (FLOATP (xpid) && pid == XFLOAT_DATA (xpid)))
+ if (all_pids_are_fixnums ? INTEGERP (xpid) : NUMBERP (xpid))
{
- XSETCAR (tail, Qnil);
- return;
+ pid_t deleted_pid;
+ if (INTEGERP (xpid))
+ deleted_pid = XINT (xpid);
+ else
+ deleted_pid = XFLOAT_DATA (xpid);
+ if (child_status_changed (deleted_pid, 0, 0))
+ XSETCAR (tail, Qnil);
}
}
/* Otherwise, if it is asynchronous, it is in Vprocess_alist. */
- p = 0;
for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
{
- proc = XCDR (XCAR (tail));
- p = XPROCESS (proc);
- if (EQ (p->type, Qreal) && p->pid == pid)
- break;
- p = 0;
- }
-
- /* Look for an asynchronous process whose pid hasn't been filled
- in yet. */
- if (! p)
- for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
- {
- proc = XCDR (XCAR (tail));
- p = XPROCESS (proc);
- if (p->pid == -1)
- break;
- p = 0;
- }
-
- /* Change the status of the process that was found. */
- if (p)
- {
- int clear_desc_flag = 0;
-
- p->tick = ++process_tick;
- p->raw_status = w;
- p->raw_status_new = 1;
-
- /* If process has terminated, stop waiting for its output. */
- if ((WIFSIGNALED (w) || WIFEXITED (w))
- && p->infd >= 0)
- clear_desc_flag = 1;
-
- /* We use clear_desc_flag to avoid a compiler bug in Microsoft C. */
- if (clear_desc_flag)
- {
- FD_CLR (p->infd, &input_wait_mask);
- FD_CLR (p->infd, &non_keyboard_wait_mask);
- }
-
- /* Tell wait_reading_process_output that it needs to wake up and
- look around. */
- if (input_available_clear_time)
- *input_available_clear_time = make_emacs_time (0, 0);
- }
- /* There was no asynchronous process found for that pid: we have
- a synchronous process. */
- else
- {
- synch_process_alive = 0;
-
- /* Report the status of the synchronous process. */
- if (WIFEXITED (w))
- synch_process_retcode = WEXITSTATUS (w);
- else if (WIFSIGNALED (w))
- synch_process_termsig = WTERMSIG (w);
-
- /* Tell wait_reading_process_output that it needs to wake up and
- look around. */
- if (input_available_clear_time)
- *input_available_clear_time = make_emacs_time (0, 0);
- }
-#endif
-}
-
-#ifdef SIGCHLD
-
-/* On some systems, the SIGCHLD handler must return right away. If
- any more processes want to signal us, we will get another signal.
- Otherwise, loop around to use up all the processes that have
- something to tell us. */
-#if (defined WINDOWSNT \
- || (defined USG && !defined GNU_LINUX \
- && !(defined HPUX && defined WNOHANG)))
-enum { CAN_HANDLE_MULTIPLE_CHILDREN = 0 };
-#else
-enum { CAN_HANDLE_MULTIPLE_CHILDREN = 1 };
-#endif
-
-static void
-handle_child_signal (int sig)
-{
- do
- {
- pid_t pid;
+ Lisp_Object proc = XCDR (XCAR (tail));
+ struct Lisp_Process *p = XPROCESS (proc);
int status;
- do
- pid = waitpid (-1, &status, WNOHANG | WUNTRACED);
- while (pid < 0 && errno == EINTR);
+ if (p->alive && child_status_changed (p->pid, &status, WUNTRACED))
+ {
+ /* Change the status of the process that was found. */
+ p->tick = ++process_tick;
+ p->raw_status = status;
+ p->raw_status_new = 1;
- /* PID == 0 means no processes found, PID == -1 means a real failure.
- Either way, we have done all our job. */
- if (pid <= 0)
- break;
+ /* If process has terminated, stop waiting for its output. */
+ if (WIFSIGNALED (status) || WIFEXITED (status))
+ {
+ int clear_desc_flag = 0;
+ p->alive = 0;
+ if (p->infd >= 0)
+ clear_desc_flag = 1;
- record_child_status_change (pid, status);
+ /* clear_desc_flag avoids a compiler bug in Microsoft C. */
+ if (clear_desc_flag)
+ {
+ FD_CLR (p->infd, &input_wait_mask);
+ FD_CLR (p->infd, &non_keyboard_wait_mask);
+ }
+ }
+ }
}
- while (CAN_HANDLE_MULTIPLE_CHILDREN);
}
static void
{
deliver_process_signal (sig, handle_child_signal);
}
-
-#endif /* SIGCHLD */
\f
static Lisp_Object
inhibit_sentinels = 0;
-#ifdef SIGCHLD
#ifndef CANNOT_DUMP
if (! noninteractive || initialized)
#endif
emacs_sigaction_init (&action, deliver_child_signal);
sigaction (SIGCHLD, &action, 0);
}
-#endif
FD_ZERO (&input_wait_mask);
FD_ZERO (&non_keyboard_wait_mask);
#endif
Vprocess_alist = Qnil;
-#ifdef SIGCHLD
deleted_pid_list = Qnil;
-#endif
for (i = 0; i < MAXDESC; i++)
{
chan_process[i] = Qnil;
#ifdef HAVE_GETSOCKNAME
ADD_SUBFEATURE (QCservice, Qt);
#endif
-#if defined (O_NONBLOCK) || defined (O_NDELAY)
ADD_SUBFEATURE (QCserver, Qt);
-#endif
for (sopt = socket_options; sopt->name; sopt++)
subfeatures = pure_cons (intern_c_string (sopt->name), subfeatures);
DEFSYM (Qlast_nonmenu_event, "last-nonmenu-event");
staticpro (&Vprocess_alist);
-#ifdef SIGCHLD
staticpro (&deleted_pid_list);
-#endif
#endif /* subprocesses */
/* Flag to set coding-system of the process buffer from the
coding_system used to decode process output. */
unsigned int inherit_coding_system_flag : 1;
+ /* Whether the process is alive, i.e., can be waited for. Running
+ processes can be waited for, but exited and fake processes cannot. */
+ unsigned int alive : 1;
/* Record the process status in the raw form in which it comes from `wait'.
This is to avoid consing in a signal handler. The `raw_status_new'
flag indicates that `raw_status' contains a new status that still
}
#endif
-/* True if we are about to fork off a synchronous process or if we
- are waiting for it. */
-extern bool synch_process_alive;
-
-/* Communicate exit status of sync process to from sigchld_handler
- to Fcall_process. */
-
-/* Nonzero => this is a string explaining death of synchronous subprocess. */
-extern const char *synch_process_death;
-
-/* Nonzero => this is the signal number that terminated the subprocess. */
-extern int synch_process_termsig;
-
-/* If synch_process_death is zero,
- this is exit code of synchronous subprocess. */
-extern int synch_process_retcode;
-
/* Nonzero means don't run process sentinels. This is used
when exiting. */
extern int inhibit_sentinels;
extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven;
extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
+/* Defined in callproc.c. */
+
+extern void record_kill_process (struct Lisp_Process *);
+
+/* Defined in process.c. */
+
extern Lisp_Object list_system_processes (void);
extern Lisp_Object system_process_attributes (Lisp_Object);
typedef struct Lisp_Hash_Table log_t;
+static Lisp_Object Qprofiler_backtrace_equal;
+static struct hash_table_test hashtest_profiler;
+
static Lisp_Object
make_log (int heap_size, int max_stack_depth)
{
a special way. This is OK as long as the object is not exposed
to Elisp, i.e. until it is returned by *-profiler-log, after which
it can't be used any more. */
- Lisp_Object log = make_hash_table (Qequal, make_number (heap_size),
+ Lisp_Object log = make_hash_table (hashtest_profiler,
+ make_number (heap_size),
make_float (DEFAULT_REHASH_SIZE),
make_float (DEFAULT_REHASH_THRESHOLD),
- Qnil, Qnil, Qnil);
+ Qnil);
struct Lisp_Hash_Table *h = XHASH_TABLE (log);
/* What is special about our hash-tables is that the keys are pre-filled
cpu_gc_count = saturated_add (cpu_gc_count, 1);
else
{
- Lisp_Object oquit;
- bool saved_pending_signals;
EMACS_INT count = 1;
#ifdef HAVE_ITIMERSPEC
if (profiler_timer_ok)
count += overruns;
}
#endif
- /* record_backtrace uses hash functions that call Fequal, which
- uses QUIT, which can call malloc, which can cause disaster in
- a signal handler. So inhibit QUIT. */
- oquit = Vinhibit_quit;
- saved_pending_signals = pending_signals;
- Vinhibit_quit = Qt;
- pending_signals = 0;
-
eassert (HASH_TABLE_P (cpu_log));
record_backtrace (XHASH_TABLE (cpu_log), count);
-
- Vinhibit_quit = oquit;
- pending_signals = saved_pending_signals;
}
}
record_backtrace (XHASH_TABLE (memory_log), min (size, MOST_POSITIVE_FIXNUM));
}
+DEFUN ("function-equal", Ffunction_equal, Sfunction_equal, 2, 2, 0,
+ doc: /* Return non-nil if F1 and F2 come from the same source.
+Used to determine if different closures are just different instances of
+the same lambda expression, or are really unrelated function. */)
+ (Lisp_Object f1, Lisp_Object f2)
+{
+ bool res;
+ if (EQ (f1, f2))
+ res = true;
+ else if (COMPILEDP (f1) && COMPILEDP (f2))
+ res = EQ (AREF (f1, COMPILED_BYTECODE), AREF (f2, COMPILED_BYTECODE));
+ else if (CONSP (f1) && CONSP (f2) && CONSP (XCDR (f1)) && CONSP (XCDR (f2))
+ && EQ (Qclosure, XCAR (f1))
+ && EQ (Qclosure, XCAR (f2)))
+ res = EQ (XCDR (XCDR (f1)), XCDR (XCDR (f2)));
+ else
+ res = false;
+ return res ? Qt : Qnil;
+}
+
+static bool
+cmpfn_profiler (struct hash_table_test *t,
+ Lisp_Object bt1, Lisp_Object bt2)
+{
+ if (VECTORP (bt1) && VECTORP (bt2))
+ {
+ ptrdiff_t i, l = ASIZE (bt1);
+ if (l != ASIZE (bt2))
+ return false;
+ for (i = 0; i < l; i++)
+ if (NILP (Ffunction_equal (AREF (bt1, i), AREF (bt2, i))))
+ return false;
+ return true;
+ }
+ else
+ return EQ (bt1, bt2);
+}
+
+static EMACS_UINT
+hashfn_profiler (struct hash_table_test *ht, Lisp_Object bt)
+{
+ if (VECTORP (bt))
+ {
+ EMACS_UINT hash = 0;
+ ptrdiff_t i, l = ASIZE (bt);
+ for (i = 0; i < l; i++)
+ {
+ Lisp_Object f = AREF (bt, i);
+ EMACS_UINT hash1
+ = (COMPILEDP (f) ? XHASH (AREF (f, COMPILED_BYTECODE))
+ : (CONSP (f) && CONSP (XCDR (f)) && EQ (Qclosure, XCAR (f)))
+ ? XHASH (XCDR (XCDR (f))) : XHASH (f));
+ hash = sxhash_combine (hash, hash1);
+ }
+ return (hash & INTMASK);
+ }
+ else
+ return XHASH (bt);
+}
+
void
syms_of_profiler (void)
{
to make room for new entries. */);
profiler_log_size = 10000;
+ DEFSYM (Qprofiler_backtrace_equal, "profiler-backtrace-equal");
+ {
+ struct hash_table_test test
+ = { Qprofiler_backtrace_equal, Qnil, Qnil,
+ cmpfn_profiler, hashfn_profiler };
+ hashtest_profiler = test;
+ }
+
+ defsubr (&Sfunction_equal);
+
#ifdef PROFILER_CPU_SUPPORT
profiler_cpu_running = NOT_RUNNING;
cpu_log = Qnil;
rather than at run-time, so that re_match can be reentrant.
*/
-/* AIX requires this to be the first thing in the file. */
+/* AIX requires this to be the first thing in the file. */
#if defined _AIX && !defined REGEX_MALLOC
#pragma alloca
#endif
ptrdiff_t begbyte = CHAR_TO_BYTE (search_regs.start[idx]);
add_len = CHAR_TO_BYTE (search_regs.end[idx]) - begbyte;
if (search_regs.start[idx] < GPT && GPT < search_regs.end[idx])
- move_gap (search_regs.start[idx]);
+ move_gap_both (search_regs.start[idx], begbyte);
add_stuff = BYTE_POS_ADDR (begbyte);
}
#define _P_WAIT 0
int _cdecl _spawnlp (int, const char *, const char *, ...);
int _cdecl _getpid (void);
-extern char *getwd (char *);
#endif
#include "syssignal.h"
get_current_dir_name (void)
{
char *buf;
- char *pwd;
+ char *pwd = getenv ("PWD");
struct stat dotstat, pwdstat;
- /* If PWD is accurate, use it instead of calling getwd. PWD is
+ /* If PWD is accurate, use it instead of calling getcwd. PWD is
sometimes a nicer name, and using it may avoid a fatal error if a
parent directory is searchable but not readable. */
- if ((pwd = getenv ("PWD")) != 0
+ if (pwd
&& (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
&& stat (pwd, &pwdstat) == 0
&& stat (".", &dotstat) == 0
return NULL;
strcpy (buf, pwd);
}
-#ifdef HAVE_GETCWD
else
{
size_t buf_size = 1024;
return NULL;
}
}
-#else
- else
- {
- /* We need MAXPATHLEN here. */
- buf = malloc (MAXPATHLEN + 1);
- if (!buf)
- return NULL;
- if (getwd (buf) == NULL)
- {
- int tmp_errno = errno;
- free (buf);
- errno = tmp_errno;
- return NULL;
- }
- }
-#endif
return buf;
}
#endif
#ifndef MSDOS
-static void
-wait_for_termination_1 (pid_t pid, int interruptible)
+/* Wait for the subprocess with process id CHILD to terminate or change status.
+ CHILD must be a child process that has not been reaped.
+ If STATUS is non-null, store the waitpid-style exit status into *STATUS
+ and tell wait_reading_process_output that it needs to look around.
+ Use waitpid-style OPTIONS when waiting.
+ If INTERRUPTIBLE, this function is interruptible by a signal.
+
+ Return CHILD if successful, 0 if no status is available;
+ the latter is possible only when options & NOHANG. */
+static pid_t
+get_child_status (pid_t child, int *status, int options, bool interruptible)
{
- while (1)
- {
-#ifdef WINDOWSNT
- wait (0);
- break;
-#else /* not WINDOWSNT */
- int status;
- int wait_result = waitpid (pid, &status, 0);
- if (wait_result < 0)
- {
- if (errno != EINTR)
- break;
- }
- else
- {
- record_child_status_change (wait_result, status);
- break;
- }
+ pid_t pid;
-#endif /* not WINDOWSNT */
+ /* Invoke waitpid only with a known process ID; do not invoke
+ waitpid with a nonpositive argument. Otherwise, Emacs might
+ reap an unwanted process by mistake. For example, invoking
+ waitpid (-1, ...) can mess up glib by reaping glib's subprocesses,
+ so that another thread running glib won't find them. */
+ eassert (0 < child);
+
+ while ((pid = waitpid (child, status, options)) < 0)
+ {
+ /* Check that CHILD is a child process that has not been reaped,
+ and that STATUS and OPTIONS are valid. Otherwise abort,
+ as continuing after this internal error could cause Emacs to
+ become confused and kill innocent-victim processes. */
+ if (errno != EINTR)
+ emacs_abort ();
+
+ /* Note: the MS-Windows emulation of waitpid calls QUIT
+ internally. */
if (interruptible)
QUIT;
}
-}
-/* Wait for subprocess with process id `pid' to terminate and
- make sure it will get eliminated (not remain forever as a zombie) */
+ /* If successful and status is requested, tell wait_reading_process_output
+ that it needs to wake up and look around. */
+ if (pid && status && input_available_clear_time)
+ *input_available_clear_time = make_emacs_time (0, 0);
+
+ return pid;
+}
+/* Wait for the subprocess with process id CHILD to terminate.
+ CHILD must be a child process that has not been reaped.
+ If STATUS is non-null, store the waitpid-style exit status into *STATUS
+ and tell wait_reading_process_output that it needs to look around.
+ If INTERRUPTIBLE, this function is interruptible by a signal. */
void
-wait_for_termination (pid_t pid)
+wait_for_termination (pid_t child, int *status, bool interruptible)
{
- wait_for_termination_1 (pid, 0);
+ get_child_status (child, status, 0, interruptible);
}
-/* Like the above, but allow keyboard interruption. */
-void
-interruptible_wait_for_termination (pid_t pid)
+/* Report whether the subprocess with process id CHILD has changed status.
+ Termination counts as a change of status.
+ CHILD must be a child process that has not been reaped.
+ If STATUS is non-null, store the waitpid-style exit status into *STATUS
+ and tell wait_reading_process_output that it needs to look around.
+ Use waitpid-style OPTIONS to check status, but do not wait.
+
+ Return CHILD if successful, 0 if no status is available because
+ the process's state has not changed. */
+pid_t
+child_status_changed (pid_t child, int *status, int options)
{
- wait_for_termination_1 (pid, 1);
+ return get_child_status (child, status, WNOHANG | options, 0);
}
/*
void
sys_suspend (void)
{
-#if defined (SIGTSTP) && !defined (MSDOS)
-
- {
- pid_t pgrp = EMACS_GETPGRP (0);
- EMACS_KILLPG (pgrp, SIGTSTP);
- }
-
-#else /* No SIGTSTP */
+#ifndef DOS_NT
+ kill (0, SIGTSTP);
+#else
/* On a system where suspending is not implemented,
instead fork a subshell and let it talk directly to the terminal
while we wait. */
sys_subshell ();
-#endif /* no SIGTSTP */
+#endif
}
/* Fork a subshell. */
int st;
char oldwd[MAXPATHLEN+1]; /* Fixed length is safe on MSDOS. */
#endif
- int pid;
+ pid_t pid;
+ int status;
struct save_signal saved_handlers[5];
Lisp_Object dir;
unsigned char *volatile str_volatile = 0;
#ifdef DOS_NT
pid = 0;
save_signal_handlers (saved_handlers);
- synch_process_alive = 1;
#else
pid = vfork ();
if (pid == -1)
const char *sh = 0;
#ifdef DOS_NT /* MW, Aug 1993 */
- getwd (oldwd);
+ getcwd (oldwd, sizeof oldwd);
if (sh == 0)
sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */
#endif
/* Do this now if we did not do it before. */
#ifndef MSDOS
save_signal_handlers (saved_handlers);
- synch_process_alive = 1;
#endif
#ifndef DOS_NT
- wait_for_termination (pid);
+ wait_for_termination (pid, &status, 0);
#endif
restore_signal_handlers (saved_handlers);
- synch_process_alive = 0;
}
static void
void
init_foreground_group (void)
{
- pid_t pgrp = EMACS_GETPGRP (0);
+ pid_t pgrp = getpgrp ();
inherited_pgroup = getpid () == pgrp ? 0 : pgrp;
}
#endif
#endif
-#ifdef F_SETFL
-#ifdef F_GETOWN /* F_SETFL does not imply existence of F_GETOWN */
+#ifdef F_GETOWN
if (interrupt_input)
{
old_fcntl_owner[fileno (tty_out->input)] =
#endif /* HAVE_GPM */
}
#endif /* F_GETOWN */
-#endif /* F_SETFL */
#ifdef _IOFBF
/* This symbol is defined on recent USG systems.
fsync (fileno (tty_out->output));
#endif
-#ifdef F_SETFL
-#ifdef F_SETOWN /* F_SETFL does not imply existence of F_SETOWN */
+#ifndef DOS_NT
+#ifdef F_SETOWN
if (interrupt_input)
{
reset_sigio (fileno (tty_out->input));
old_fcntl_owner[fileno (tty_out->input)]);
}
#endif /* F_SETOWN */
-#ifdef O_NDELAY
fcntl (fileno (tty_out->input), F_SETFL,
- fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NDELAY);
+ fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NONBLOCK);
#endif
-#endif /* F_SETFL */
if (tty_out->old_tty)
while (emacs_set_tty (fileno (tty_out->input),
/* When handling a signal, block nonfatal system signals that are caught
by Emacs. This makes race conditions less likely. */
sigaddset (&action->sa_mask, SIGALRM);
-#ifdef SIGCHLD
sigaddset (&action->sa_mask, SIGCHLD);
-#endif
#ifdef SIGDANGER
sigaddset (&action->sa_mask, SIGDANGER);
#endif
# ifdef SIGAIO
sys_siglist[SIGAIO] = "LAN I/O interrupt";
# endif
-# ifdef SIGALRM
sys_siglist[SIGALRM] = "Alarm clock";
-# endif
# ifdef SIGBUS
sys_siglist[SIGBUS] = "Bus error";
# endif
-# ifdef SIGCLD
- sys_siglist[SIGCLD] = "Child status changed";
-# endif
-# ifdef SIGCHLD
sys_siglist[SIGCHLD] = "Child status changed";
-# endif
# ifdef SIGCONT
sys_siglist[SIGCONT] = "Continued";
# endif
# ifdef SIGGRANT
sys_siglist[SIGGRANT] = "Monitor mode granted";
# endif
-# ifdef SIGHUP
sys_siglist[SIGHUP] = "Hangup";
-# endif
sys_siglist[SIGILL] = "Illegal instruction";
sys_siglist[SIGINT] = "Interrupt";
# ifdef SIGIO
# ifdef SIGIOT
sys_siglist[SIGIOT] = "IOT trap";
# endif
-# ifdef SIGKILL
sys_siglist[SIGKILL] = "Killed";
-# endif
# ifdef SIGLOST
sys_siglist[SIGLOST] = "Resource lost";
# endif
# ifdef SIGPHONE
sys_siglist[SIGWIND] = "SIGPHONE";
# endif
-# ifdef SIGPIPE
sys_siglist[SIGPIPE] = "Broken pipe";
-# endif
# ifdef SIGPOLL
sys_siglist[SIGPOLL] = "Pollable event occurred";
# endif
# ifdef SIGPWR
sys_siglist[SIGPWR] = "Power-fail restart";
# endif
-# ifdef SIGQUIT
sys_siglist[SIGQUIT] = "Quit";
-# endif
# ifdef SIGRETRACT
sys_siglist[SIGRETRACT] = "Need to relinquish monitor mode";
# endif
void
emacs_abort (void)
{
- terminate_due_to_signal (SIGABRT, 10);
+ terminate_due_to_signal (SIGABRT, 40);
}
#endif
return careadlinkat (AT_FDCWD, filename, initial_buf, READLINK_BUFSIZE,
&emacs_norealloc_allocator, careadlinkatcwd);
}
-\f
-#ifdef USG
-/*
- * All of the following are for USG.
- *
- * On USG systems the system calls are INTERRUPTIBLE by signals
- * that the user program has elected to catch. Thus the system call
- * must be retried in these cases. To handle this without massive
- * changes in the source code, we remap the standard system call names
- * to names for our own functions in sysdep.c that do the system call
- * with retries. Actually, for portability reasons, it is good
- * programming practice, as this example shows, to limit all actual
- * system calls to a single occurrence in the source. Sure, this
- * adds an extra level of function call overhead but it is almost
- * always negligible. Fred Fish, Unisoft Systems Inc.
- */
-
-/*
- * Warning, this function may not duplicate 4.2 action properly
- * under error conditions.
- */
-
-#if !defined (HAVE_GETWD) || defined (BROKEN_GETWD)
-
-#ifndef MAXPATHLEN
-/* In 4.1, param.h fails to define this. */
-#define MAXPATHLEN 1024
-#endif
-
-char *
-getwd (char *pathname)
-{
- char *npath, *spath;
- extern char *getcwd (char *, size_t);
-
- block_input (); /* getcwd uses malloc */
- spath = npath = getcwd ((char *) 0, MAXPATHLEN);
- if (spath == 0)
- {
- unblock_input ();
- return spath;
- }
- /* On Altos 3068, getcwd can return @hostname/dir, so discard
- up to first slash. Should be harmless on other systems. */
- while (*npath && *npath != '/')
- npath++;
- strcpy (pathname, npath);
- free (spath); /* getcwd uses malloc */
- unblock_input ();
- return pathname;
-}
-
-#endif /* !defined (HAVE_GETWD) || defined (BROKEN_GETWD) */
-#endif /* USG */
-\f
-/* Directory routines for systems that don't have them. */
-
-#ifdef HAVE_DIRENT_H
-
-#include <dirent.h>
-
-#if !defined (HAVE_CLOSEDIR)
-
-int
-closedir (DIR *dirp /* stream from opendir */)
-{
- int rtnval;
-
- rtnval = emacs_close (dirp->dd_fd);
- xfree (dirp);
-
- return rtnval;
-}
-#endif /* not HAVE_CLOSEDIR */
-#endif /* HAVE_DIRENT_H */
-
\f
/* Return a struct timeval that is roughly equivalent to T.
Use the least timeval not less than T.
int
serial_open (char *port)
{
- int fd = -1;
-
- fd = emacs_open ((char*) port,
- O_RDWR
-#ifdef O_NONBLOCK
- | O_NONBLOCK
-#else
- | O_NDELAY
-#endif
-#ifdef O_NOCTTY
- | O_NOCTTY
-#endif
- , 0);
+ int fd = emacs_open (port, O_RDWR | O_NOCTTY | O_NONBLOCK, 0);
if (fd < 0)
{
error ("Could not open %s: %s",
# define emacs_raise(sig) raise (sig)
#endif
-/* On bsd, [man says] kill does not accept a negative number to kill a pgrp.
- Must do that using the killpg call. */
-#ifdef BSD_SYSTEM
-#define EMACS_KILLPG(gid, signo) (killpg ( (gid), (signo)))
-#else
-#ifdef WINDOWSNT
-#define EMACS_KILLPG(gid, signo) (kill (gid, signo))
-#else
-#define EMACS_KILLPG(gid, signo) (kill (-(gid), (signo)))
-#endif
-#endif
-
-/* Define SIGCHLD as an alias for SIGCLD. There are many conditionals
- testing SIGCHLD. */
-#ifdef SIGCLD
-#ifndef SIGCHLD
-#define SIGCHLD SIGCLD
-#endif /* SIGCHLD */
-#endif /* ! defined (SIGCLD) */
-
#ifndef HAVE_STRSIGNAL
# define strsignal(sig) safe_strsignal (sig)
#endif
#endif /* not CDEL */
#endif /* not _POSIX_VDISABLE */
\f
-/* Get the number of characters queued for output. */
-
-/* EMACS_OUTQSIZE(FD, int *SIZE) stores the number of characters
- queued for output to the terminal FD in *SIZE, if FD is a tty.
- Returns -1 if there was an error (i.e. FD is not a tty), 0
- otherwise. */
-#ifdef TIOCOUTQ
-#define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TIOCOUTQ, (size)))
-#endif
-
-\f
-/* Manipulate a terminal's current process group. */
-
-/* EMACS_GETPGRP (arg) returns the process group of the process. */
-
-#if defined (GETPGRP_VOID)
-# define EMACS_GETPGRP(x) getpgrp()
-#else /* !GETPGRP_VOID */
-# define EMACS_GETPGRP(x) getpgrp(x)
-#endif /* !GETPGRP_VOID */
-\f
/* Manipulate a TTY's input/output processing parameters. */
/* struct emacs_tty is a structure used to hold the current tty
#ifndef EMACS_SYSWAIT_H
#define EMACS_SYSWAIT_H
+#include <stdbool.h>
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */
#endif
/* Defined in process.c. */
-extern void record_child_status_change (pid_t, int);
+extern void record_deleted_pid (pid_t);
/* Defined in sysdep.c. */
-extern void wait_for_termination (pid_t);
-extern void interruptible_wait_for_termination (pid_t);
+extern void wait_for_termination (pid_t, int *, bool);
+extern pid_t child_status_changed (pid_t, int *, int);
#endif /* EMACS_SYSWAIT_H */
/* New redisplay, TTY faces by Gerd Moellmann <gerd@gnu.org>. */
#include <config.h>
-#include <stdio.h>
#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
#include <sys/file.h>
#include <sys/time.h>
#include <unistd.h>
#include "xterm.h"
#endif
-#ifndef O_RDWR
-#define O_RDWR 2
-#endif
-
-#ifndef O_NOCTTY
-#define O_NOCTTY 0
-#endif
-
/* The name of the default console device. */
#ifdef WINDOWSNT
#define DEV_TTY "CONOUT$"
static int max_frame_cols;
-/* Non-zero if we have dropped our controlling tty and therefore
- should not open a frame on stdout. */
-static int no_controlling_tty;
-
\f
#ifdef HAVE_GPM
const char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
const char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll;
- register int i = n > 0 ? n : -n;
- register char *buf;
+ int i = eabs (n);
+ char *buf;
/* If the lines below the insertion are being pushed
into the end of the window, this is the same as clearing;
static void
dissociate_if_controlling_tty (int fd)
{
-#ifndef DOS_NT
pid_t pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */
- if (pgid != -1)
- {
-#if defined (USG5)
- setpgrp ();
- no_controlling_tty = 1;
-#elif defined (CYGWIN)
- setsid ();
- no_controlling_tty = 1;
-#else
-#ifdef TIOCNOTTY /* Try BSD ioctls. */
- sigset_t blocked;
- sigemptyset (&blocked);
- sigaddset (&blocked, SIGTTOU);
- pthread_sigmask (SIG_BLOCK, &blocked, 0);
- fd = emacs_open (DEV_TTY, O_RDWR, 0);
- if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1)
- {
- no_controlling_tty = 1;
- }
- if (fd != -1)
- emacs_close (fd);
- pthread_sigmask (SIG_UNBLOCK, &blocked, 0);
-#else
-# error "Unknown system."
-#endif /* ! TIOCNOTTY */
-#endif /* ! USG */
- }
-#endif /* !DOS_NT */
+ if (0 <= pgid)
+ setsid ();
}
/* Create a termcap display on the tty device with the given name and
set_tty_hooks (terminal);
{
- int fd;
+ /* Open the terminal device. */
FILE *file;
-#ifdef O_IGNORE_CTTY
- if (!ctty)
- /* Open the terminal device. Don't recognize it as our
- controlling terminal, and don't make it the controlling tty
- if we don't have one at the moment. */
- fd = emacs_open (name, O_RDWR | O_IGNORE_CTTY | O_NOCTTY, 0);
- else
-#endif /* O_IGNORE_CTTY */
- /* Alas, O_IGNORE_CTTY is a GNU extension that seems to be only
- defined on Hurd. On other systems, we need to explicitly
- dissociate ourselves from the controlling tty when we want to
- open a frame on the same terminal. */
- fd = emacs_open (name, O_RDWR | O_NOCTTY, 0);
+ /* If !ctty, don't recognize it as our controlling terminal, and
+ don't make it the controlling tty if we don't have one now.
+
+ Alas, O_IGNORE_CTTY is a GNU extension that seems to be only
+ defined on Hurd. On other systems, we need to explicitly
+ dissociate ourselves from the controlling tty when we want to
+ open a frame on the same terminal. */
+ int flags = O_RDWR | O_NOCTTY | (ctty ? 0 : O_IGNORE_CTTY);
+ int fd = emacs_open (name, flags, 0);
tty->name = xstrdup (name);
terminal->name = xstrdup (name);
name);
}
-#ifndef O_IGNORE_CTTY
- if (!ctty)
+ if (!O_IGNORE_CTTY && !ctty)
dissociate_if_controlling_tty (fd);
-#endif
file = fdopen (fd, "w+");
tty->input = file;
FrameCols (tty) = FRAME_COLS (f);
tty->specified_window = FRAME_LINES (f);
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
terminal->char_ins_del_ok = 1;
baud_rate = 19200;
= tty->TS_delete_mode && tty->TS_insert_mode
&& !strcmp (tty->TS_delete_mode, tty->TS_insert_mode);
- tty->se_is_so = (tty->TS_standout_mode
- && tty->TS_end_standout_mode
- && !strcmp (tty->TS_standout_mode, tty->TS_end_standout_mode));
-
UseTabs (tty) = tabs_safe_p (fileno (tty->input)) && TabWidth (tty) == 8;
terminal->scroll_region_ok
struct emacs_tty *old_tty; /* The initial tty mode bits */
- int term_initted; /* 1 if we have been through init_sys_modes. */
-
+ unsigned term_initted : 1; /* 1 if we have been through init_sys_modes. */
int reference_count; /* Number of frames that are on this display. */
int RPov; /* # chars to start a TS_repeat */
- int delete_in_insert_mode; /* delete mode == insert mode */
-
- int se_is_so; /* 1 if same string both enters and leaves
- standout mode */
-
- int costs_set; /* Nonzero if costs have been calculated. */
-
- int insert_mode; /* Nonzero when in insert mode. */
- int standout_mode; /* Nonzero when in standout mode. */
+ unsigned delete_in_insert_mode : 1; /* delete mode == insert mode */
+ unsigned costs_set : 1; /* Nonzero if costs have been calculated. */
+ unsigned insert_mode : 1; /* Nonzero when in insert mode. */
+ unsigned standout_mode : 1; /* Nonzero when in standout mode. */
/* 1 if should obey 0200 bit in input chars as "Meta", 2 if should
keep 0200 bit in input chars. 0 to ignore the 0200 bit. */
/* Flag used in tty_show/hide_cursor. */
- int cursor_hidden;
+ unsigned cursor_hidden : 1;
/* Nonzero means use ^S/^Q for flow control. */
- int flow_control;
+ unsigned flow_control : 1;
};
/* A chain of structures for all tty devices currently in use. */
, NS_NONKEY_EVENT
#endif
+#if defined (HAVE_INOTIFY) || defined (HAVE_NTGUI)
+ /* File or directory was changed. */
+ , FILE_NOTIFY_EVENT
+#endif
+
};
/* If a struct input_event has a kind which is SELECTION_REQUEST_EVENT
Lisp_Object x, y;
Time timestamp;
- /* This is padding just to put the frame_or_window field
- past the size of struct selection_input_event. */
- int *padding[2];
-
- /* This field is copied into a vector while the event is in the queue,
- so that garbage collections won't kill it. */
- /* In a menu_bar_event, this is a cons cell whose car is the frame
- and whose cdr is the Lisp object that is the event's value. */
- /* This field is last so that struct selection_input_event
- does not overlap with it. */
+ /* This field is copied into a vector while the event is in
+ the queue, so that garbage collections won't kill it. */
Lisp_Object frame_or_window;
/* Additional event argument. This is used for TOOL_BAR_EVENTs and
int memory_below_frame; /* Terminal remembers lines scrolled
off bottom */
-#if 0 /* These are not used anywhere. */
- /* EMACS_INT baud_rate; */ /* Output speed in baud */
- int min_padding_speed; /* Speed below which no padding necessary. */
- int dont_calculate_costs; /* Nonzero means don't bother computing
- various cost tables; we won't use them. */
-#endif
-
-\f
/* Window-based redisplay interface for this device (0 for tty
devices). */
struct redisplay_interface *rif;
Otherwise, set *bar_window to Qnil, and *x and *y to the column and
row of the character cell the mouse is over.
- Set *time to the time the mouse was at the returned position.
-
- This should clear mouse_moved until the next motion
- event arrives. */
+ Set *time to the time the mouse was at the returned position. */
void (*mouse_position_hook) (struct frame **f, int,
Lisp_Object *bar_window,
enum scroll_bar_part *part,
Lisp_Object *y,
Time *);
- /* The window system handling code should set this if the mouse has
- moved since the last call to the mouse_position_hook. Calling that
- hook should clear this. */
- int mouse_moved;
-
/* When a frame's focus redirection is changed, this hook tells the
window system code to re-decide where to put the highlight. Under
X, this means that Emacs lies about where the focus is. */
The terminal device is represented by its integer identifier. */)
(Lisp_Object frame)
{
- struct terminal *t;
-
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
-
- t = FRAME_TERMINAL (XFRAME (frame));
+ struct terminal *t = FRAME_TERMINAL (decode_live_frame (frame));
if (!t)
return Qnil;
return Qw32;
case output_msdos_raw:
return Qpc;
- case output_mac:
- return Qmac;
case output_ns:
return Qns;
default:
xsignal0 (Qtext_read_only);
}
+/* Prepare to modify the region of BUFFER from START to END. */
+
+static void
+modify_region (Lisp_Object buffer, Lisp_Object start, Lisp_Object end)
+{
+ struct buffer *buf = XBUFFER (buffer), *old = current_buffer;
+
+ set_buffer_internal (buf);
+ modify_region_1 (XINT (start), XINT (end), true);
+ set_buffer_internal (old);
+}
-\f
/* Extract the interval at the position pointed to by BEGIN from
OBJECT, a string or buffer. Additionally, check that the positions
pointed to by BEGIN and END are within the bounds of OBJECT, and
}
if (BUFFERP (object))
- modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
+ modify_region (object, start, end);
/* We are at the beginning of interval I, with LEN chars to scan. */
for (;;)
}
if (BUFFERP (object) && !NILP (coherent_change_p))
- modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
+ modify_region (object, start, end);
set_text_properties_1 (start, end, properties, object, i);
}
/* Replace properties of text from START to END with new list of
- properties PROPERTIES. BUFFER is the buffer containing
+ properties PROPERTIES. OBJECT is the buffer or string containing
the text. This does not obey any hooks.
- You can provide the interval that START is located in as I,
- or pass NULL for I and this function will find it.
+ You should provide the interval that START is located in as I.
START and END can be in any order. */
void
-set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i)
+set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object, INTERVAL i)
{
register INTERVAL prev_changed = NULL;
register ptrdiff_t s, len;
else
return;
- if (i == NULL)
- i = find_interval (buffer_intervals (XBUFFER (buffer)), s);
+ eassert (i);
if (i->position != s)
{
{
copy_properties (unchanged, i);
i = split_interval_left (i, len);
- set_properties (properties, i, buffer);
+ set_properties (properties, i, object);
return;
}
- set_properties (properties, i, buffer);
+ set_properties (properties, i, object);
if (LENGTH (i) == len)
return;
/* We have to call set_properties even if we are going to
merge the intervals, so as to make the undo records
and cause redisplay to happen. */
- set_properties (properties, i, buffer);
+ set_properties (properties, i, object);
if (prev_changed)
merge_interval_left (i);
return;
/* We have to call set_properties even if we are going to
merge the intervals, so as to make the undo records
and cause redisplay to happen. */
- set_properties (properties, i, buffer);
+ set_properties (properties, i, object);
if (!prev_changed)
prev_changed = i;
else
}
if (BUFFERP (object))
- modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
+ modify_region (object, start, end);
/* We are at the beginning of an interval, with len to scan */
for (;;)
else if (LENGTH (i) == len)
{
if (!modified && BUFFERP (object))
- modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
+ modify_region (object, start, end);
remove_properties (Qnil, properties, i, object);
if (BUFFERP (object))
signal_after_change (XINT (start), XINT (end) - XINT (start),
i = split_interval_left (i, len);
copy_properties (unchanged, i);
if (!modified && BUFFERP (object))
- modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
+ modify_region (object, start, end);
remove_properties (Qnil, properties, i, object);
if (BUFFERP (object))
signal_after_change (XINT (start), XINT (end) - XINT (start),
if (interval_has_some_properties_list (properties, i))
{
if (!modified && BUFFERP (object))
- modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
+ modify_region (object, start, end);
remove_properties (Qnil, properties, i, object);
modified = 1;
}
xsignal1 (Quser_error, build_string (msg));
}
-\f
-DEFUN ("primitive-undo", Fprimitive_undo, Sprimitive_undo, 2, 2, 0,
- doc: /* Undo N records from the front of the list LIST.
-Return what remains of the list. */)
- (Lisp_Object n, Lisp_Object list)
-{
- struct gcpro gcpro1, gcpro2;
- Lisp_Object next;
- ptrdiff_t count = SPECPDL_INDEX ();
- register EMACS_INT arg;
- Lisp_Object oldlist;
- int did_apply = 0;
-
-#if 0 /* This is a good feature, but would make undo-start
- unable to do what is expected. */
- Lisp_Object tem;
-
- /* If the head of the list is a boundary, it is the boundary
- preceding this command. Get rid of it and don't count it. */
- tem = Fcar (list);
- if (NILP (tem))
- list = Fcdr (list);
-#endif
-
- CHECK_NUMBER (n);
- arg = XINT (n);
- next = Qnil;
- GCPRO2 (next, list);
- /* I don't think we need to gcpro oldlist, as we use it only
- to check for EQ. ++kfs */
-
- /* In a writable buffer, enable undoing read-only text that is so
- because of text properties. */
- if (NILP (BVAR (current_buffer, read_only)))
- specbind (Qinhibit_read_only, Qt);
-
- /* Don't let `intangible' properties interfere with undo. */
- specbind (Qinhibit_point_motion_hooks, Qt);
-
- oldlist = BVAR (current_buffer, undo_list);
-
- while (arg > 0)
- {
- while (CONSP (list))
- {
- next = XCAR (list);
- list = XCDR (list);
- /* Exit inner loop at undo boundary. */
- if (NILP (next))
- break;
- /* Handle an integer by setting point to that value. */
- if (INTEGERP (next))
- SET_PT (clip_to_bounds (BEGV, XINT (next), ZV));
- else if (CONSP (next))
- {
- Lisp_Object car, cdr;
-
- car = XCAR (next);
- cdr = XCDR (next);
- if (EQ (car, Qt))
- {
- /* Element (t . TIME) records previous modtime.
- Preserve any flag of NONEXISTENT_MODTIME_NSECS or
- UNKNOWN_MODTIME_NSECS. */
- struct buffer *base_buffer = current_buffer;
- EMACS_TIME mod_time;
-
- if (CONSP (cdr)
- && CONSP (XCDR (cdr))
- && CONSP (XCDR (XCDR (cdr)))
- && CONSP (XCDR (XCDR (XCDR (cdr))))
- && INTEGERP (XCAR (XCDR (XCDR (XCDR (cdr)))))
- && XINT (XCAR (XCDR (XCDR (XCDR (cdr))))) < 0)
- mod_time =
- (make_emacs_time
- (0, XINT (XCAR (XCDR (XCDR (XCDR (cdr))))) / 1000));
- else
- mod_time = lisp_time_argument (cdr);
-
- if (current_buffer->base_buffer)
- base_buffer = current_buffer->base_buffer;
-
- /* If this records an obsolete save
- (not matching the actual disk file)
- then don't mark unmodified. */
- if (EMACS_TIME_NE (mod_time, base_buffer->modtime))
- continue;
-#ifdef CLASH_DETECTION
- Funlock_buffer ();
-#endif /* CLASH_DETECTION */
- Fset_buffer_modified_p (Qnil);
- }
- else if (EQ (car, Qnil))
- {
- /* Element (nil PROP VAL BEG . END) is property change. */
- Lisp_Object beg, end, prop, val;
-
- prop = Fcar (cdr);
- cdr = Fcdr (cdr);
- val = Fcar (cdr);
- cdr = Fcdr (cdr);
- beg = Fcar (cdr);
- end = Fcdr (cdr);
-
- if (XINT (beg) < BEGV || XINT (end) > ZV)
- user_error ("Changes to be undone are outside visible portion of buffer");
- Fput_text_property (beg, end, prop, val, Qnil);
- }
- else if (INTEGERP (car) && INTEGERP (cdr))
- {
- /* Element (BEG . END) means range was inserted. */
-
- if (XINT (car) < BEGV
- || XINT (cdr) > ZV)
- user_error ("Changes to be undone are outside visible portion of buffer");
- /* Set point first thing, so that undoing this undo
- does not send point back to where it is now. */
- Fgoto_char (car);
- Fdelete_region (car, cdr);
- }
- else if (EQ (car, Qapply))
- {
- /* Element (apply FUN . ARGS) means call FUN to undo. */
- struct buffer *save_buffer = current_buffer;
-
- car = Fcar (cdr);
- cdr = Fcdr (cdr);
- if (INTEGERP (car))
- {
- /* Long format: (apply DELTA START END FUN . ARGS). */
- Lisp_Object delta = car;
- Lisp_Object start = Fcar (cdr);
- Lisp_Object end = Fcar (Fcdr (cdr));
- Lisp_Object start_mark = Fcopy_marker (start, Qnil);
- Lisp_Object end_mark = Fcopy_marker (end, Qt);
-
- cdr = Fcdr (Fcdr (cdr));
- apply1 (Fcar (cdr), Fcdr (cdr));
-
- /* Check that the function did what the entry said it
- would do. */
- if (!EQ (start, Fmarker_position (start_mark))
- || (XINT (delta) + XINT (end)
- != marker_position (end_mark)))
- error ("Changes to be undone by function different than announced");
- Fset_marker (start_mark, Qnil, Qnil);
- Fset_marker (end_mark, Qnil, Qnil);
- }
- else
- apply1 (car, cdr);
-
- if (save_buffer != current_buffer)
- error ("Undo function switched buffer");
- did_apply = 1;
- }
- else if (STRINGP (car) && INTEGERP (cdr))
- {
- /* Element (STRING . POS) means STRING was deleted. */
- Lisp_Object membuf;
- EMACS_INT pos = XINT (cdr);
-
- membuf = car;
- if (pos < 0)
- {
- if (-pos < BEGV || -pos > ZV)
- user_error ("Changes to be undone are outside visible portion of buffer");
- SET_PT (-pos);
- Finsert (1, &membuf);
- }
- else
- {
- if (pos < BEGV || pos > ZV)
- user_error ("Changes to be undone are outside visible portion of buffer");
- SET_PT (pos);
-
- /* Now that we record marker adjustments
- (caused by deletion) for undo,
- we should always insert after markers,
- so that undoing the marker adjustments
- put the markers back in the right place. */
- Finsert (1, &membuf);
- SET_PT (pos);
- }
- }
- else if (MARKERP (car) && INTEGERP (cdr))
- {
- /* (MARKER . INTEGER) means a marker MARKER
- was adjusted by INTEGER. */
- if (XMARKER (car)->buffer)
- Fset_marker (car,
- make_number (marker_position (car) - XINT (cdr)),
- Fmarker_buffer (car));
- }
- }
- }
- arg--;
- }
-
-
- /* Make sure an apply entry produces at least one undo entry,
- so the test in `undo' for continuing an undo series
- will work right. */
- if (did_apply
- && EQ (oldlist, BVAR (current_buffer, undo_list)))
- bset_undo_list
- (current_buffer,
- Fcons (list3 (Qapply, Qcdr, Qnil), BVAR (current_buffer, undo_list)));
-
- UNGCPRO;
- return unbind_to (count, list);
-}
\f
void
syms_of_undo (void)
last_undo_buffer = NULL;
last_boundary_buffer = NULL;
- defsubr (&Sprimitive_undo);
defsubr (&Sundo_boundary);
DEFVAR_INT ("undo-limit", undo_limit,
a gap between the old text segment and the old data segment.
This gap has probably been remapped into part of the text segment.
So write zeros for it. */
- if (ret == -1
-#ifdef EFAULT
- && errno == EFAULT
-#endif
- )
+ if (ret == -1 && errno == EFAULT)
{
/* Write only a page of zeros at once,
so that we don't overshoot the start
exe_header->file_optional_header.FileAlignment *
exe_header->file_optional_header.FileAlignment;
+ /* Make sure the generated bootstrap binary isn't
+ * sparse. NT doesn't use a file cache for sparse
+ * executables, so if we bootstrap Emacs using a sparse
+ * bootstrap-emacs.exe, bootstrap takes about twenty
+ * times longer than it would otherwise. */
+
+ ret = posix_fallocate (fd,
+ ( exe_header->section_header[i].s_scnptr +
+ exe_header->section_header[i].s_size ),
+ 1);
+
+ assert (ret != -1);
+
ret =
lseek (fd,
(long) (exe_header->section_header[i].s_scnptr +
PIMAGE_SECTION_HEADER heap_section;
-#ifdef HAVE_NTGUI
-extern HINSTANCE hinst;
-HINSTANCE hprevinst = NULL;
-LPSTR lpCmdLine = "";
-int nCmdShow = 0;
-#endif /* HAVE_NTGUI */
-
/* Startup code for running on NT. When we are running as the dumped
version, we need to bootstrap our heap and .bss section into our
address space before we can actually hand off control to the startup
/* Prevent Emacs from being locked up (eg. in batch mode) when
accessing devices that aren't mounted (eg. removable media drives). */
SetErrorMode (SEM_FAILCRITICALERRORS);
-
- /* Invoke the NT CRT startup routine now that our housecleaning
- is finished. */
-#ifdef HAVE_NTGUI
- /* determine WinMain args like crt0.c does */
- hinst = GetModuleHandle (NULL);
- lpCmdLine = GetCommandLine ();
- nCmdShow = SW_SHOWDEFAULT;
-#endif
mainCRTStartup ();
}
static size_t lim_data;
\f
-#if defined (HAVE_GETRLIMIT) && defined (RLIMIT_AS)
-static void
-get_lim_data (void)
-{
- struct rlimit rlimit;
-
- getrlimit (RLIMIT_AS, &rlimit);
- if (rlimit.rlim_cur == RLIM_INFINITY)
- lim_data = -1;
- else
- lim_data = rlimit.rlim_cur;
-}
+#ifdef HAVE_GETRLIMIT
-#else /* not HAVE_GETRLIMIT */
-
-#ifdef USG
+# ifndef RLIMIT_AS
+# define RLIMIT_AS RLIMIT_DATA
+# endif
static void
get_lim_data (void)
{
- extern long ulimit ();
-
- lim_data = -1;
-
- /* Use the ulimit call, if we seem to have it. */
-#if !defined (ULIMIT_BREAK_VALUE) || defined (GNU_LINUX)
- lim_data = ulimit (3, 0);
-#endif
-
- /* If that didn't work, just use the macro's value. */
-#ifdef ULIMIT_BREAK_VALUE
- if (lim_data == -1)
- lim_data = ULIMIT_BREAK_VALUE;
-#endif
-
- lim_data -= (long) data_space_start;
+ /* Set LIM_DATA to the minimum of the maximum object size and the
+ maximum address space. Don't bother to check for values like
+ RLIM_INFINITY since in practice they are not much less than SIZE_MAX. */
+ struct rlimit rlimit;
+ lim_data
+ = (getrlimit (RLIMIT_AS, &rlimit) == 0 && rlimit.rlim_cur <= SIZE_MAX
+ ? rlimit.rlim_cur
+ : SIZE_MAX);
}
-#else /* not USG */
-#ifdef WINDOWSNT
+#elif defined WINDOWSNT
#include "w32heap.h"
lim_data = reserved_heap_size;
}
-#else
-#if !defined (BSD4_2) && !defined (CYGWIN)
+#elif defined MSDOS
-#ifdef MSDOS
void
get_lim_data (void)
{
get_lim_data ();
return lim_data;
}
-#else /* not MSDOS */
-static void
-get_lim_data (void)
-{
- lim_data = vlimit (LIM_DATA, -1);
-}
-#endif /* not MSDOS */
-
-#else /* BSD4_2 || CYGWIN */
-
-static void
-get_lim_data (void)
-{
- struct rlimit XXrlimit;
-
- getrlimit (RLIMIT_DATA, &XXrlimit);
-#ifdef RLIM_INFINITY
- lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
#else
- lim_data = XXrlimit.rlim_cur; /* soft limit */
+# error "get_lim_data not implemented on this machine"
#endif
-}
-#endif /* BSD4_2 */
-#endif /* not WINDOWSNT */
-#endif /* not USG */
-#endif /* not HAVE_GETRLIMIT */
\f
/* Verify amount of memory available, complaining if we're near the end. */
#include <winioctl.h>
#include <aclapi.h>
+#include <sddl.h>
+
+#include <sys/acl.h>
+
+/* This is not in MinGW's sddl.h (but they are in MSVC headers), so we
+ define them by hand if not already defined. */
+#ifndef SDDL_REVISION_1
+#define SDDL_REVISION_1 1
+#endif /* SDDL_REVISION_1 */
#ifdef _MSC_VER
/* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER and the
#undef sendto
#include "w32.h"
-#include "ndir.h"
+#include <dirent.h>
#include "w32common.h"
#include "w32heap.h"
#include "w32select.h"
static BOOL g_b_init_get_native_system_info;
static BOOL g_b_init_get_system_times;
static BOOL g_b_init_create_symbolic_link;
+static BOOL g_b_init_get_security_descriptor_dacl;
+static BOOL g_b_init_convert_sd_to_sddl;
+static BOOL g_b_init_convert_sddl_to_sd;
+static BOOL g_b_init_is_valid_security_descriptor;
+static BOOL g_b_init_set_file_security;
/*
BEGIN: Wrapper functions around OpenProcessToken
#ifdef _UNICODE
const char * const LookupAccountSid_Name = "LookupAccountSidW";
const char * const GetFileSecurity_Name = "GetFileSecurityW";
+const char * const SetFileSecurity_Name = "SetFileSecurityW";
#else
const char * const LookupAccountSid_Name = "LookupAccountSidA";
const char * const GetFileSecurity_Name = "GetFileSecurityA";
+const char * const SetFileSecurity_Name = "SetFileSecurityA";
#endif
typedef BOOL (WINAPI * LookupAccountSid_Proc) (
LPCTSTR lpSystemName,
PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD nLength,
LPDWORD lpnLengthNeeded);
+typedef BOOL (WINAPI *SetFileSecurity_Proc) (
+ LPCTSTR lpFileName,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor);
typedef BOOL (WINAPI * GetSecurityDescriptorOwner_Proc) (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pOwner,
PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pGroup,
LPBOOL lpbGroupDefaulted);
+typedef BOOL (WINAPI *GetSecurityDescriptorDacl_Proc) (
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ LPBOOL lpbDaclPresent,
+ PACL *pDacl,
+ LPBOOL lpbDaclDefaulted);
typedef BOOL (WINAPI * IsValidSid_Proc) (
PSID sid);
typedef HANDLE (WINAPI * CreateToolhelp32Snapshot_Proc) (
LPTSTR lpSymlinkFileName,
LPTSTR lpTargetFileName,
DWORD dwFlags);
+typedef BOOL (WINAPI *ConvertStringSecurityDescriptorToSecurityDescriptor_Proc) (
+ LPCTSTR StringSecurityDescriptor,
+ DWORD StringSDRevision,
+ PSECURITY_DESCRIPTOR *SecurityDescriptor,
+ PULONG SecurityDescriptorSize);
+typedef BOOL (WINAPI *ConvertSecurityDescriptorToStringSecurityDescriptor_Proc) (
+ PSECURITY_DESCRIPTOR SecurityDescriptor,
+ DWORD RequestedStringSDRevision,
+ SECURITY_INFORMATION SecurityInformation,
+ LPTSTR *StringSecurityDescriptor,
+ PULONG StringSecurityDescriptorLen);
+typedef BOOL (WINAPI *IsValidSecurityDescriptor_Proc) (PSECURITY_DESCRIPTOR);
/* ** A utility function ** */
static BOOL
HMODULE hm_advapi32 = NULL;
if (is_windows_9x () == TRUE)
{
+ errno = ENOTSUP;
return FALSE;
}
if (g_b_init_get_file_security == 0)
}
if (s_pfn_Get_File_Security == NULL)
{
+ errno = ENOTSUP;
return FALSE;
}
return (s_pfn_Get_File_Security (lpFileName, RequestedInformation,
lpnLengthNeeded));
}
+static BOOL WINAPI
+set_file_security (LPCTSTR lpFileName,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor)
+{
+ static SetFileSecurity_Proc s_pfn_Set_File_Security = NULL;
+ HMODULE hm_advapi32 = NULL;
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+ if (g_b_init_set_file_security == 0)
+ {
+ g_b_init_set_file_security = 1;
+ hm_advapi32 = LoadLibrary ("Advapi32.dll");
+ s_pfn_Set_File_Security =
+ (SetFileSecurity_Proc) GetProcAddress (
+ hm_advapi32, SetFileSecurity_Name);
+ }
+ if (s_pfn_Set_File_Security == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+ return (s_pfn_Set_File_Security (lpFileName, SecurityInformation,
+ pSecurityDescriptor));
+}
+
static BOOL WINAPI
get_security_descriptor_owner (PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pOwner,
HMODULE hm_advapi32 = NULL;
if (is_windows_9x () == TRUE)
{
+ errno = ENOTSUP;
return FALSE;
}
if (g_b_init_get_security_descriptor_owner == 0)
}
if (s_pfn_Get_Security_Descriptor_Owner == NULL)
{
+ errno = ENOTSUP;
return FALSE;
}
return (s_pfn_Get_Security_Descriptor_Owner (pSecurityDescriptor, pOwner,
HMODULE hm_advapi32 = NULL;
if (is_windows_9x () == TRUE)
{
+ errno = ENOTSUP;
return FALSE;
}
if (g_b_init_get_security_descriptor_group == 0)
}
if (s_pfn_Get_Security_Descriptor_Group == NULL)
{
+ errno = ENOTSUP;
return FALSE;
}
return (s_pfn_Get_Security_Descriptor_Group (pSecurityDescriptor, pGroup,
lpbGroupDefaulted));
}
+static BOOL WINAPI
+get_security_descriptor_dacl (PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ LPBOOL lpbDaclPresent,
+ PACL *pDacl,
+ LPBOOL lpbDaclDefaulted)
+{
+ static GetSecurityDescriptorDacl_Proc s_pfn_Get_Security_Descriptor_Dacl = NULL;
+ HMODULE hm_advapi32 = NULL;
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+ if (g_b_init_get_security_descriptor_dacl == 0)
+ {
+ g_b_init_get_security_descriptor_dacl = 1;
+ hm_advapi32 = LoadLibrary ("Advapi32.dll");
+ s_pfn_Get_Security_Descriptor_Dacl =
+ (GetSecurityDescriptorDacl_Proc) GetProcAddress (
+ hm_advapi32, "GetSecurityDescriptorDacl");
+ }
+ if (s_pfn_Get_Security_Descriptor_Dacl == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+ return (s_pfn_Get_Security_Descriptor_Dacl (pSecurityDescriptor,
+ lpbDaclPresent, pDacl,
+ lpbDaclDefaulted));
+}
+
static BOOL WINAPI
is_valid_sid (PSID sid)
{
}
return retval;
}
+
+static BOOL WINAPI
+is_valid_security_descriptor (PSECURITY_DESCRIPTOR pSecurityDescriptor)
+{
+ static IsValidSecurityDescriptor_Proc s_pfn_Is_Valid_Security_Descriptor_Proc = NULL;
+
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ if (g_b_init_is_valid_security_descriptor == 0)
+ {
+ g_b_init_is_valid_security_descriptor = 1;
+ s_pfn_Is_Valid_Security_Descriptor_Proc =
+ (IsValidSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "IsValidSecurityDescriptor");
+ }
+ if (s_pfn_Is_Valid_Security_Descriptor_Proc == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ return s_pfn_Is_Valid_Security_Descriptor_Proc (pSecurityDescriptor);
+}
+
+static BOOL WINAPI
+convert_sd_to_sddl (PSECURITY_DESCRIPTOR SecurityDescriptor,
+ DWORD RequestedStringSDRevision,
+ SECURITY_INFORMATION SecurityInformation,
+ LPTSTR *StringSecurityDescriptor,
+ PULONG StringSecurityDescriptorLen)
+{
+ static ConvertSecurityDescriptorToStringSecurityDescriptor_Proc s_pfn_Convert_SD_To_SDDL = NULL;
+ BOOL retval;
+
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ if (g_b_init_convert_sd_to_sddl == 0)
+ {
+ g_b_init_convert_sd_to_sddl = 1;
+#ifdef _UNICODE
+ s_pfn_Convert_SD_To_SDDL =
+ (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "ConvertSecurityDescriptorToStringSecurityDescriptorW");
+#else
+ s_pfn_Convert_SD_To_SDDL =
+ (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "ConvertSecurityDescriptorToStringSecurityDescriptorA");
+#endif
+ }
+ if (s_pfn_Convert_SD_To_SDDL == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ retval = s_pfn_Convert_SD_To_SDDL (SecurityDescriptor,
+ RequestedStringSDRevision,
+ SecurityInformation,
+ StringSecurityDescriptor,
+ StringSecurityDescriptorLen);
+
+ return retval;
+}
+
+static BOOL WINAPI
+convert_sddl_to_sd (LPCTSTR StringSecurityDescriptor,
+ DWORD StringSDRevision,
+ PSECURITY_DESCRIPTOR *SecurityDescriptor,
+ PULONG SecurityDescriptorSize)
+{
+ static ConvertStringSecurityDescriptorToSecurityDescriptor_Proc s_pfn_Convert_SDDL_To_SD = NULL;
+ BOOL retval;
+
+ if (is_windows_9x () == TRUE)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ if (g_b_init_convert_sddl_to_sd == 0)
+ {
+ g_b_init_convert_sddl_to_sd = 1;
+#ifdef _UNICODE
+ s_pfn_Convert_SDDL_To_SD =
+ (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "ConvertStringSecurityDescriptorToSecurityDescriptorW");
+#else
+ s_pfn_Convert_SDDL_To_SD =
+ (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
+ "ConvertStringSecurityDescriptorToSecurityDescriptorA");
+#endif
+ }
+ if (s_pfn_Convert_SDDL_To_SD == NULL)
+ {
+ errno = ENOTSUP;
+ return FALSE;
+ }
+
+ retval = s_pfn_Convert_SDDL_To_SD (StringSecurityDescriptor,
+ StringSDRevision,
+ SecurityDescriptor,
+ SecurityDescriptorSize);
+
+ return retval;
+}
+
\f
/* Return 1 if P is a valid pointer to an object of size SIZE. Return
/* Get the current working directory. */
char *
-getwd (char *dir)
+getcwd (char *dir, int dirsize)
{
+ if (!dirsize)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+ if (dirsize <= strlen (startup_dir))
+ {
+ errno = ERANGE;
+ return NULL;
+ }
#if 0
if (GetCurrentDirectory (MAXPATHLEN, dir) > 0)
return dir;
return 1;
}
+/* Emulate the Posix unsetenv. */
+int
+unsetenv (const char *name)
+{
+ char *var;
+ size_t name_len;
+ int retval;
+
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ name_len = strlen (name);
+ /* MS docs says an environment variable cannot be longer than 32K. */
+ if (name_len > 32767)
+ {
+ errno = ENOMEM;
+ return 0;
+ }
+ /* It is safe to use 'alloca' with 32K size, since the stack is at
+ least 2MB, and we set it to 8MB in the link command line. */
+ var = alloca (name_len + 2);
+ strncpy (var, name, name_len);
+ var[name_len++] = '=';
+ var[name_len] = '\0';
+ return _putenv (var);
+}
+
+/* MS _putenv doesn't support removing a variable when the argument
+ does not include the '=' character, so we fix that here. */
+int
+sys_putenv (char *str)
+{
+ const char *const name_end = strchr (str, '=');
+
+ if (name_end == NULL)
+ {
+ /* Remove the variable from the environment. */
+ return unsetenv (str);
+ }
+
+ return _putenv (str);
+}
+
#define REG_ROOT "SOFTWARE\\GNU\\Emacs"
LPBYTE
see if it succeeds. But I think that's too much to ask. */
/* MSVCRT's _access crashes with D_OK. */
- if (tmp && sys_access (tmp, D_OK) == 0)
+ if (tmp && faccessat (AT_FDCWD, tmp, D_OK, AT_EACCESS) == 0)
{
char * var = alloca (strlen (tmp) + 8);
sprintf (var, "TMPDIR=%s", tmp);
memcpy (*envp, "COMSPEC=", 8);
}
- /* Remember the initial working directory for getwd. */
+ /* Remember the initial working directory for getcwd. */
/* FIXME: Do we need to resolve possible symlinks in startup_dir?
Does it matter anywhere in Emacs? */
if (!GetCurrentDirectory (MAXPATHLEN, startup_dir))
and readdir. We can't use the procedures supplied in sysdep.c,
so we provide them here. */
-struct direct dir_static; /* simulated directory contents */
+struct dirent dir_static; /* simulated directory contents */
static HANDLE dir_find_handle = INVALID_HANDLE_VALUE;
static int dir_is_fat;
static char dir_pathname[MAXPATHLEN+1];
xfree ((char *) dirp);
}
-struct direct *
+struct dirent *
readdir (DIR *dirp)
{
int downcase = !NILP (Vw32_downcase_file_names);
downcase = 1; /* 8+3 aliases are returned in all caps */
}
dir_static.d_namlen = strlen (dir_static.d_name);
- dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 +
+ dir_static.d_reclen = sizeof (struct dirent) - MAXNAMLEN + 3 +
dir_static.d_namlen - dir_static.d_namlen % 4;
/* If the file name in cFileName[] includes `?' characters, it means
WNetAddConnection2 (&resource, NULL, NULL, CONNECT_INTERACTIVE);
}
-/* Shadow some MSVC runtime functions to map requests for long filenames
- to reasonable short names if necessary. This was originally added to
- permit running Emacs on NT 3.1 on a FAT partition, which doesn't support
- long file names. */
-
+/* Emulate faccessat(2). */
int
-sys_access (const char * path, int mode)
+faccessat (int dirfd, const char * path, int mode, int flags)
{
DWORD attributes;
+ if (dirfd != AT_FDCWD
+ && !(IS_DIRECTORY_SEP (path[0])
+ || IS_DEVICE_SEP (path[1])))
+ {
+ errno = EBADF;
+ return -1;
+ }
+
/* MSVCRT implementation of 'access' doesn't recognize D_OK, and its
newer versions blow up when passed D_OK. */
path = map_w32_filename (path, NULL);
to get the attributes of its target file. Note: any symlinks in
PATH elements other than the last one are transparently resolved
by GetFileAttributes below. */
- if ((volume_info.flags & FILE_SUPPORTS_REPARSE_POINTS) != 0)
+ if ((volume_info.flags & FILE_SUPPORTS_REPARSE_POINTS) != 0
+ && (flags & AT_SYMLINK_NOFOLLOW) == 0)
path = chase_symlinks (path);
if ((attributes = GetFileAttributes (path)) == -1)
}
return -1;
}
- if ((mode & X_OK) != 0 && !is_exec (path))
+ if ((mode & X_OK) != 0
+ && !(is_exec (path) || (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0))
{
errno = EACCES;
return -1;
return 0;
}
+/* Shadow some MSVC runtime functions to map requests for long filenames
+ to reasonable short names if necessary. This was originally added to
+ permit running Emacs on NT 3.1 on a FAT partition, which doesn't support
+ long file names. */
+
int
sys_chdir (const char * path)
{
{
int save_errno = errno;
p[0] = first_char[i];
- if (sys_access (template, 0) < 0)
+ if (faccessat (AT_FDCWD, template, F_OK, AT_EACCESS) < 0)
{
errno = save_errno;
return template;
return !(devtype == DRIVE_FIXED || devtype == DRIVE_RAMDISK);
}
+/* If this is non-zero, the caller wants accurate information about
+ file's owner and group, which could be expensive to get. */
+int w32_stat_get_owner_group;
+
/* MSVC stat function can't cope with UNC names and has other bugs, so
replace it with our own. This also allows us to calculate consistent
inode values and owner/group without hacks in the main Emacs code. */
/* We produce the fallback owner and group data, based on the
current user that runs Emacs, in the following cases:
+ . caller didn't request owner and group info
. this is Windows 9X
. getting security by handle failed, and we need to produce
information for the target of a symlink (this is better
If getting security by handle fails, and we don't need to
resolve symlinks, we try getting security by name. */
- if (is_windows_9x () != TRUE)
- psd = get_file_security_desc_by_handle (fh);
- if (psd)
- {
- get_file_owner_and_group (psd, buf);
- LocalFree (psd);
- }
- else if (is_windows_9x () == TRUE)
+ if (!w32_stat_get_owner_group || is_windows_9x () == TRUE)
get_file_owner_and_group (NULL, buf);
- else if (!(is_a_symlink && follow_symlinks))
+ else
{
- psd = get_file_security_desc_by_name (name);
- get_file_owner_and_group (psd, buf);
- xfree (psd);
+ psd = get_file_security_desc_by_handle (fh);
+ if (psd)
+ {
+ get_file_owner_and_group (psd, buf);
+ LocalFree (psd);
+ }
+ else if (!(is_a_symlink && follow_symlinks))
+ {
+ psd = get_file_security_desc_by_name (name);
+ get_file_owner_and_group (psd, buf);
+ xfree (psd);
+ }
+ else
+ get_file_owner_and_group (NULL, buf);
}
- else
- get_file_owner_and_group (NULL, buf);
CloseHandle (fh);
}
else
{
/* Non-absolute FILENAME is understood as being relative to
LINKNAME's directory. We need to prepend that directory to
- FILENAME to get correct results from sys_access below, since
+ FILENAME to get correct results from faccessat below, since
otherwise it will interpret FILENAME relative to the
directory where the Emacs process runs. Note that
make-symbolic-link always makes sure LINKNAME is a fully
strncpy (tem, linkfn, p - linkfn);
tem[p - linkfn] = '\0';
strcat (tem, filename);
- dir_access = sys_access (tem, D_OK);
+ dir_access = faccessat (AT_FDCWD, tem, D_OK, AT_EACCESS);
}
else
- dir_access = sys_access (filename, D_OK);
+ dir_access = faccessat (AT_FDCWD, filename, D_OK, AT_EACCESS);
/* Since Windows distinguishes between symlinks to directories and
to files, we provide a kludgy feature: if FILENAME doesn't
errno = EINVAL;
else
{
- /* Copy the link target name, in wide characters, fro
+ /* Copy the link target name, in wide characters, from
reparse_data, then convert it to multibyte encoding in
the current locale's codepage. */
WCHAR *lwname;
return target;
}
+\f
+/* Posix ACL emulation. */
+
+int
+acl_valid (acl_t acl)
+{
+ return is_valid_security_descriptor ((PSECURITY_DESCRIPTOR)acl) ? 0 : -1;
+}
+
+char *
+acl_to_text (acl_t acl, ssize_t *size)
+{
+ LPTSTR str_acl;
+ SECURITY_INFORMATION flags =
+ OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ DACL_SECURITY_INFORMATION;
+ char *retval = NULL;
+ ULONG local_size;
+ int e = errno;
+
+ errno = 0;
+
+ if (convert_sd_to_sddl ((PSECURITY_DESCRIPTOR)acl, SDDL_REVISION_1, flags, &str_acl, &local_size))
+ {
+ errno = e;
+ /* We don't want to mix heaps, so we duplicate the string in our
+ heap and free the one allocated by the API. */
+ retval = xstrdup (str_acl);
+ if (size)
+ *size = local_size;
+ LocalFree (str_acl);
+ }
+ else if (errno != ENOTSUP)
+ errno = EINVAL;
+
+ return retval;
+}
+
+acl_t
+acl_from_text (const char *acl_str)
+{
+ PSECURITY_DESCRIPTOR psd, retval = NULL;
+ ULONG sd_size;
+ int e = errno;
+
+ errno = 0;
+
+ if (convert_sddl_to_sd (acl_str, SDDL_REVISION_1, &psd, &sd_size))
+ {
+ errno = e;
+ retval = xmalloc (sd_size);
+ memcpy (retval, psd, sd_size);
+ LocalFree (psd);
+ }
+ else if (errno != ENOTSUP)
+ errno = EINVAL;
+
+ return retval;
+}
+
+int
+acl_free (void *ptr)
+{
+ xfree (ptr);
+ return 0;
+}
+
+acl_t
+acl_get_file (const char *fname, acl_type_t type)
+{
+ PSECURITY_DESCRIPTOR psd = NULL;
+ const char *filename;
+
+ if (type == ACL_TYPE_ACCESS)
+ {
+ DWORD sd_len, err;
+ SECURITY_INFORMATION si =
+ OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ DACL_SECURITY_INFORMATION ;
+ int e = errno;
+
+ filename = map_w32_filename (fname, NULL);
+ if ((volume_info.flags & FILE_SUPPORTS_REPARSE_POINTS) != 0)
+ fname = chase_symlinks (filename);
+ else
+ fname = filename;
+
+ errno = 0;
+ if (!get_file_security (fname, si, psd, 0, &sd_len)
+ && errno != ENOTSUP)
+ {
+ err = GetLastError ();
+ if (err == ERROR_INSUFFICIENT_BUFFER)
+ {
+ psd = xmalloc (sd_len);
+ if (!get_file_security (fname, si, psd, sd_len, &sd_len))
+ {
+ xfree (psd);
+ errno = EIO;
+ psd = NULL;
+ }
+ }
+ else if (err == ERROR_FILE_NOT_FOUND
+ || err == ERROR_PATH_NOT_FOUND)
+ errno = ENOENT;
+ else
+ errno = EIO;
+ }
+ else if (!errno)
+ errno = e;
+ }
+ else if (type != ACL_TYPE_DEFAULT)
+ errno = EINVAL;
+
+ return psd;
+}
+
+int
+acl_set_file (const char *fname, acl_type_t type, acl_t acl)
+{
+ TOKEN_PRIVILEGES old1, old2;
+ DWORD err;
+ BOOL res;
+ int st = 0, retval = -1;
+ SECURITY_INFORMATION flags = 0;
+ PSID psid;
+ PACL pacl;
+ BOOL dflt;
+ BOOL dacl_present;
+ int e;
+ const char *filename;
+
+ if (acl_valid (acl) != 0
+ || (type != ACL_TYPE_DEFAULT && type != ACL_TYPE_ACCESS))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (type == ACL_TYPE_DEFAULT)
+ {
+ errno = ENOSYS;
+ return -1;
+ }
+
+ filename = map_w32_filename (fname, NULL);
+ if ((volume_info.flags & FILE_SUPPORTS_REPARSE_POINTS) != 0)
+ fname = chase_symlinks (filename);
+ else
+ fname = filename;
+
+ if (get_security_descriptor_owner ((PSECURITY_DESCRIPTOR)acl, &psid, &dflt)
+ && psid)
+ flags |= OWNER_SECURITY_INFORMATION;
+ if (get_security_descriptor_group ((PSECURITY_DESCRIPTOR)acl, &psid, &dflt)
+ && psid)
+ flags |= GROUP_SECURITY_INFORMATION;
+ if (get_security_descriptor_dacl ((PSECURITY_DESCRIPTOR)acl, &dacl_present,
+ &pacl, &dflt)
+ && dacl_present)
+ flags |= DACL_SECURITY_INFORMATION;
+ if (!flags)
+ return 0;
+
+ /* According to KB-245153, setting the owner will succeed if either:
+ (1) the caller is the user who will be the new owner, and has the
+ SE_TAKE_OWNERSHIP privilege, or
+ (2) the caller has the SE_RESTORE privilege, in which case she can
+ set any valid user or group as the owner
+
+ We request below both SE_TAKE_OWNERSHIP and SE_RESTORE
+ privileges, and disregard any failures in obtaining them. If
+ these privileges cannot be obtained, and do not already exist in
+ the calling thread's security token, this function could fail
+ with EPERM. */
+ if (enable_privilege (SE_TAKE_OWNERSHIP_NAME, TRUE, &old1))
+ st++;
+ if (enable_privilege (SE_RESTORE_NAME, TRUE, &old2))
+ st++;
+
+ e = errno;
+ errno = 0;
+ set_file_security ((char *)fname, flags, (PSECURITY_DESCRIPTOR)acl);
+ err = GetLastError ();
+ if (st)
+ {
+ if (st >= 2)
+ restore_privilege (&old2);
+ restore_privilege (&old1);
+ revert_to_self ();
+ }
+
+ if (errno == ENOTSUP)
+ ;
+ else if (err == ERROR_SUCCESS)
+ {
+ retval = 0;
+ errno = e;
+ }
+ else if (err == ERROR_INVALID_OWNER || err == ERROR_NOT_ALL_ASSIGNED)
+ {
+ /* Maybe the requested ACL and the one the file already has are
+ identical, in which case we can silently ignore the
+ failure. (And no, Windows doesn't.) */
+ acl_t current_acl = acl_get_file (fname, ACL_TYPE_ACCESS);
+
+ errno = EPERM;
+ if (current_acl)
+ {
+ char *acl_from = acl_to_text (current_acl, NULL);
+ char *acl_to = acl_to_text (acl, NULL);
+
+ if (acl_from && acl_to && xstrcasecmp (acl_from, acl_to) == 0)
+ {
+ retval = 0;
+ errno = e;
+ }
+ if (acl_from)
+ acl_free (acl_from);
+ if (acl_to)
+ acl_free (acl_to);
+ acl_free (current_acl);
+ }
+ }
+ else if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)
+ errno = ENOENT;
+
+ return retval;
+}
+
+\f
/* MS-Windows version of careadlinkat (cf. ../lib/careadlinkat.c). We
have a fixed max size for file names, so we don't need the kind of
alloc/malloc/realloc dance the gnulib version does. We also don't
check_errno ();
if (fd_info[s].flags & FILE_SOCKET)
{
- if (cmd == F_SETFL && options == O_NDELAY)
+ if (cmd == F_SETFL && options == O_NONBLOCK)
{
unsigned long nblock = 1;
int rc = pfn_ioctlsocket (SOCK_HANDLE (s), FIONBIO, &nblock);
winsock_inuse--; /* count open sockets */
}
- delete_child (cp);
+ /* If the process handle is NULL, it's either a socket
+ or serial connection, or a subprocess that was
+ already reaped by reap_subprocess, but whose
+ resources were not yet freed, because its output was
+ not fully read yet by the time it was reaped. (This
+ usually happens with async subprocesses whose output
+ is being read by Emacs.) Otherwise, this process was
+ not reaped yet, so we set its FD to a negative value
+ to make sure sys_select will eventually get to
+ calling the SIGCHLD handler for it, which will then
+ invoke waitpid and reap_subprocess. */
+ if (cp->procinfo.hProcess == NULL)
+ delete_child (cp);
+ else
+ cp->fd = -1;
}
}
}
}
/* Function to do blocking read of one byte, needed to implement
- select. It is only allowed on sockets and pipes. */
+ select. It is only allowed on communication ports, sockets, or
+ pipes. */
int
_sys_read_ahead (int fd)
{
g_b_init_get_native_system_info = 0;
g_b_init_get_system_times = 0;
g_b_init_create_symbolic_link = 0;
+ g_b_init_get_security_descriptor_dacl = 0;
+ g_b_init_convert_sd_to_sddl = 0;
+ g_b_init_convert_sddl_to_sd = 0;
+ g_b_init_is_valid_security_descriptor = 0;
+ g_b_init_set_file_security = 0;
num_of_processors = 0;
/* The following sets a handler for shutdown notifications for
console apps. This actually applies to Emacs in both console and
/* "None" is the default group name on standalone workstations. */
strcpy (dflt_group_name, "None");
+
+ /* Reset, in case it has some value inherited from dump time. */
+ w32_stat_get_owner_group = 0;
}
/* For make-serial-process */
a socket, the process handle in pi is NULL. */
typedef struct _child_process
{
- int fd;
- int pid;
- HANDLE char_avail;
- HANDLE char_consumed;
- HANDLE thrd;
- HWND hwnd;
- PROCESS_INFORMATION procinfo;
- volatile int status;
- char chr;
- OVERLAPPED ovl_read;
- OVERLAPPED ovl_write;
+ /* File descriptor for sockets and serial port connections, and for
+ reading output from async subprocesses; otherwise -1. */
+ int fd;
+ /* PID for subprocess, either async or not; otherwise -1. */
+ int pid;
+ /* Handle to an event object that is signaled when a read operation
+ is completed, either successfully (in which case there're indeed
+ "characters available") or not. Used by sys_select to wait for
+ output from subprocesses or socket/serial connections. */
+ HANDLE char_avail;
+ /* Handle to an event that is signaled to wake up the reader thread
+ and tell it to try reading more output from a subprocess. */
+ HANDLE char_consumed;
+ /* Handle to the reader thread to read output from a subprocess or a
+ socket or a comm port. */
+ HANDLE thrd;
+ /* Handle to the console window of a subprocess. Used to forcibly
+ terminate it by sys_kill. */
+ HWND hwnd;
+ /* Information about subprocess returned by CreateProcess. Includes
+ handles to the subprocess and its primary thread, and the
+ corresponding process ID and thread ID numbers. The PID is
+ mirrored by the 'pid' member above. The process handle is used
+ to wait on it. */
+ PROCESS_INFORMATION procinfo;
+ /* Status of subprocess/connection and of reading its output. For
+ values, see the enumeration above. */
+ volatile int status;
+ /* Holds a single character read by _sys_read_ahead, when a
+ subprocess has some output ready. */
+ char chr;
+ /* Used for async read operations on serial comm ports. */
+ OVERLAPPED ovl_read;
+ /* Used for async write operations on serial comm ports. */
+ OVERLAPPED ovl_write;
+ /* Input file, if any, for this subprocess. Should only be non-NULL
+ for async subprocesses. */
+ char *input_file;
+ /* If non-zero, the subprocess input file is temporary and should be
+ deleted when the subprocess exits. */
+ int pending_deletion;
} child_process;
#define MAXDESC FD_SETSIZE
extern void set_process_dir (char *);
extern int sys_spawnve (int, char *, char **, char **);
-extern void register_child (int, int);
+extern void register_child (pid_t, int);
+extern void record_infile (pid_t, char *);
+extern void record_pending_deletion (char *);
extern void sys_sleep (int);
-extern char *getwd (char *);
extern int sys_link (const char *, const char *);
#endif /* HAVE_GNUTLS */
#endif /* EMACS_W32_H */
-
else
w32_console_unicode_input = 0;
+ /* This is needed by w32notify.c:send_notifications. */
+ dwMainThreadId = GetCurrentThreadId ();
+
/* Setup w32_display_info structure for this frame. */
w32_initialize_display_info (build_string ("Console"));
#include <limits.h>
#include <errno.h>
#include <math.h>
+#include <fcntl.h>
+#include <unistd.h>
#include "lisp.h"
#include "w32term.h"
FRAME_PTR
check_x_frame (Lisp_Object frame)
{
- FRAME_PTR f;
+ struct frame *f = decode_live_frame (frame);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
if (! FRAME_W32_P (f))
error ("Non-W32 frame used");
return f;
/* Return the Emacs frame-object corresponding to an w32 window.
It could be the frame's main window or an icon window. */
-/* This function can be called during GC, so use GC_xxx type test macros. */
-
struct frame *
x_window_to_frame (struct w32_display_info *dpyinfo, HWND wdesc)
{
Lisp_Object tail, frame;
struct frame *f;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- frame = XCAR (tail);
- if (!FRAMEP (frame))
- continue;
f = XFRAME (frame);
if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo)
continue;
static BOOL
w32_init_class (HINSTANCE hinst)
{
-
if (w32_unicode_gui)
{
WNDCLASSW uwc;
static int
modifier_set (int vkey)
{
- if (vkey == VK_CAPITAL || vkey == VK_SCROLL)
- return (GetKeyState (vkey) & 0x1);
+ /* Warning: The fact that VK_NUMLOCK is not treated as the other 2
+ toggle keys is not an omission! If you want to add it, you will
+ have to make changes in the default sub-case of the WM_KEYDOWN
+ switch, because if the NUMLOCK modifier is set, the code there
+ will directly convert any key that looks like an ASCII letter,
+ and also downcase those that look like upper-case ASCII. */
+ if (vkey == VK_CAPITAL)
+ {
+ if (NILP (Vw32_enable_caps_lock))
+ return 0;
+ else
+ return (GetKeyState (vkey) & 0x1);
+ }
+ if (vkey == VK_SCROLL)
+ {
+ if (NILP (Vw32_scroll_lock_modifier)
+ /* w32-scroll-lock-modifier can be any non-nil value that is
+ not one of the modifiers, in which case it shall be ignored. */
+ || !( EQ (Vw32_scroll_lock_modifier, Qhyper)
+ || EQ (Vw32_scroll_lock_modifier, Qsuper)
+ || EQ (Vw32_scroll_lock_modifier, Qmeta)
+ || EQ (Vw32_scroll_lock_modifier, Qalt)
+ || EQ (Vw32_scroll_lock_modifier, Qcontrol)
+ || EQ (Vw32_scroll_lock_modifier, Qshift)))
+ return 0;
+ else
+ return (GetKeyState (vkey) & 0x1);
+ }
+
if (!modifiers_recorded)
return (GetKeyState (vkey) & 0x8000);
return retval;
}
+ case WM_EMACS_FILENOTIFY:
+ my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ return 1;
default:
/* Check for messages registered at runtime. */
XSETFRAME (frame, f);
- /* Note that Windows does support scroll bars. */
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
-
/* By default, make scrollbars the system standard width. */
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
return FRAME_PIXEL_HEIGHT (f);
}
-int
-x_char_width (register struct frame *f)
-{
- return FRAME_COLUMN_WIDTH (f);
-}
-
-int
-x_char_height (register struct frame *f)
-{
- return FRAME_LINE_HEIGHT (f);
-}
-
int
x_screen_planes (register struct frame *f)
{
Finsert (1, &text);
set_buffer_internal_1 (old_buffer);
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
record_unwind_protect (unwind_create_tip_frame, frame);
/* By setting the output method, we're essentially saying that
DWORD data;
} version;
+ /* Cache the module handle of Emacs itself. */
+ hinst = GetModuleHandle (NULL);
+
/* Cache the version of the operating system. */
version.data = GetVersion ();
w32_major_version = version.info.major;
syms_of_w32uniscribe ();
}
+typedef USHORT (WINAPI * CaptureStackBackTrace_proc) (ULONG, ULONG, PVOID *,
+ PULONG);
+
+#define BACKTRACE_LIMIT_MAX 62
+
+int
+w32_backtrace (void **buffer, int limit)
+{
+ static CaptureStackBackTrace_proc s_pfn_CaptureStackBackTrace = NULL;
+ HMODULE hm_kernel32 = NULL;
+
+ if (!s_pfn_CaptureStackBackTrace)
+ {
+ hm_kernel32 = LoadLibrary ("Kernel32.dll");
+ s_pfn_CaptureStackBackTrace =
+ (CaptureStackBackTrace_proc) GetProcAddress (hm_kernel32,
+ "RtlCaptureStackBackTrace");
+ }
+ if (s_pfn_CaptureStackBackTrace)
+ return s_pfn_CaptureStackBackTrace (0, min (BACKTRACE_LIMIT_MAX, limit),
+ buffer, NULL);
+ return 0;
+}
+
void
emacs_abort (void)
{
button = MessageBox (NULL,
"A fatal error has occurred!\n\n"
"Would you like to attach a debugger?\n\n"
- "Select YES to debug, NO to abort Emacs"
+ "Select:\n"
+ "YES -- to debug Emacs, or\n"
+ "NO -- to abort Emacs and produce a backtrace\n"
+ " (emacs_backtrace.txt in current directory)."
#if __GNUC__
"\n\n(type \"gdb -p <emacs-PID>\" and\n"
"\"continue\" inside GDB before clicking YES.)"
exit (2); /* tell the compiler we will never return */
case IDNO:
default:
- abort ();
- break;
+ {
+ void *stack[BACKTRACE_LIMIT_MAX + 1];
+ int i = w32_backtrace (stack, BACKTRACE_LIMIT_MAX + 1);
+
+ if (i)
+ {
+#ifdef CYGWIN
+ int stderr_fd = 2;
+#else
+ HANDLE errout = GetStdHandle (STD_ERROR_HANDLE);
+ int stderr_fd = -1;
+#endif
+ int errfile_fd = -1;
+ int j;
+
+#ifndef CYGWIN
+ if (errout && errout != INVALID_HANDLE_VALUE)
+ stderr_fd = _open_osfhandle ((intptr_t)errout, O_APPEND | O_BINARY);
+#endif
+ if (stderr_fd >= 0)
+ write (stderr_fd, "\r\nBacktrace:\r\n", 14);
+ errfile_fd = _open ("emacs_backtrace.txt", O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE);
+ if (errfile_fd >= 0)
+ {
+ lseek (errfile_fd, 0L, SEEK_END);
+ write (errfile_fd, "\r\nBacktrace:\r\n", 14);
+ }
+
+ for (j = 0; j < i; j++)
+ {
+ char buf[INT_BUFSIZE_BOUND (void *)];
+
+ /* stack[] gives the return addresses, whereas we want
+ the address of the call, so decrease each address
+ by approximate size of 1 CALL instruction. */
+ sprintf (buf, "0x%p\r\n", (char *)stack[j] - sizeof(void *));
+ if (stderr_fd >= 0)
+ write (stderr_fd, buf, strlen (buf));
+ if (errfile_fd >= 0)
+ write (errfile_fd, buf, strlen (buf));
+ }
+ if (i == BACKTRACE_LIMIT_MAX)
+ {
+ if (stderr_fd >= 0)
+ write (stderr_fd, "...\r\n", 5);
+ if (errfile_fd >= 0)
+ write (errfile_fd, "...\r\n", 5);
+ }
+ if (errfile_fd >= 0)
+ close (errfile_fd);
+ }
+ abort ();
+ break;
+ }
}
}
#define FACE_DEFAULT (~0)
extern HINSTANCE hinst;
-extern HINSTANCE hprevinst;
-extern LPSTR lpCmdLine;
-extern int nCmdShow;
/* Bit Gravity */
0, 0, 0);
}
+static int
+handle_file_notifications (struct input_event *hold_quit)
+{
+ BYTE *p = file_notifications;
+ FILE_NOTIFY_INFORMATION *fni = (PFILE_NOTIFY_INFORMATION)p;
+ const DWORD min_size
+ = offsetof (FILE_NOTIFY_INFORMATION, FileName) + sizeof(wchar_t);
+ struct input_event inev;
+ int nevents = 0;
+
+ /* We cannot process notification before Emacs is fully initialized,
+ since we need the UTF-16LE coding-system to be set up. */
+ if (!initialized)
+ {
+ notification_buffer_in_use = 0;
+ return nevents;
+ }
+
+ enter_crit ();
+ if (notification_buffer_in_use)
+ {
+ DWORD info_size = notifications_size;
+ Lisp_Object cs = intern ("utf-16le");
+ Lisp_Object obj = w32_get_watch_object (notifications_desc);
+
+ /* notifications_size could be zero when the buffer of
+ notifications overflowed on the OS level, or when the
+ directory being watched was itself deleted. Do nothing in
+ that case. */
+ if (info_size
+ && !NILP (obj) && CONSP (obj))
+ {
+ Lisp_Object callback = XCDR (obj);
+
+ EVENT_INIT (inev);
+
+ while (info_size >= min_size)
+ {
+ Lisp_Object utf_16_fn
+ = make_unibyte_string ((char *)fni->FileName,
+ fni->FileNameLength);
+ /* Note: mule-conf is preloaded, so utf-16le must
+ already be defined at this point. */
+ Lisp_Object fname
+ = code_convert_string_norecord (utf_16_fn, cs, 0);
+ Lisp_Object action = lispy_file_action (fni->Action);
+
+ inev.kind = FILE_NOTIFY_EVENT;
+ inev.code = (ptrdiff_t)XINT (XIL ((EMACS_INT)notifications_desc));
+ inev.timestamp = GetTickCount ();
+ inev.modifiers = 0;
+ inev.frame_or_window = callback;
+ inev.arg = Fcons (action, fname);
+ kbd_buffer_store_event_hold (&inev, hold_quit);
+
+ if (!fni->NextEntryOffset)
+ break;
+ p += fni->NextEntryOffset;
+ fni = (PFILE_NOTIFY_INFORMATION)p;
+ info_size -= fni->NextEntryOffset;
+ }
+ }
+ notification_buffer_in_use = 0;
+ }
+ leave_crit ();
+ return nevents;
+}
+
/* Here's an overview of how Emacs input works in non-GUI sessions on
MS-Windows. (For description of the GUI input, see the commentary
before w32_msg_pump in w32fns.c.)
for (;;)
{
+ int nfnotify = handle_file_notifications (hold_quit);
+
nev = fill_queue (0);
if (nev <= 0)
{
/* If nev == -1, there was some kind of error
- If nev == 0 then waitp must be zero and no events were available
+ If nev == 0 then no events were available
so return. */
+ if (nfnotify)
+ nev = 0;
break;
}
void w32_free_menu_strings (HWND);
-\f
-
-/* This is set nonzero after the user activates the menu bar, and set
- to zero again after the menu bars are redisplayed by prepare_menu_bar.
- While it is nonzero, all calls to set_frame_menubar go deep.
-
- I don't understand why this is needed, but it does seem to be
- needed on Motif, according to Marcus Daniels <marcus@sysc.pdx.edu>. */
-
-int pending_menu_activation;
-\f
#ifdef HAVE_MENUS
DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0,
if (! menubar_widget)
deep_p = 1;
- else if (pending_menu_activation && !deep_p)
- deep_p = 1;
if (deep_p)
{
--- /dev/null
+/* Filesystem notifications support for GNU Emacs on the Microsoft Windows API.
+ Copyright (C) 2012-2013 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 Eli Zaretskii <eliz@gnu.org>.
+
+ Design overview:
+
+ For each watch request, we launch a separate worker thread. The
+ worker thread runs the watch_worker function, which issues an
+ asynchronous call to ReadDirectoryChangesW, and then waits in
+ SleepEx for that call to complete. Waiting in SleepEx puts the
+ thread in an "alertable" state, so it wakes up when either (a) the
+ call to ReadDirectoryChangesW completes, or (b) the main thread
+ instructs the worker thread to terminate by sending it an APC, see
+ below.
+
+ When the ReadDirectoryChangesW call completes, its completion
+ routine watch_completion is automatically called. watch_completion
+ stashes the received file events in a buffer used to communicate
+ them to the main thread (using a critical section, so that several
+ threads could use the same buffer), posts a special message,
+ WM_EMACS_FILENOTIFY, to the Emacs's message queue, and returns.
+ That causes the SleepEx function call inside watch_worker to
+ return, and watch_worker then issues another call to
+ ReadDirectoryChangesW. (Except when it does not, see below.)
+
+ In a GUI session, The WM_EMACS_FILENOTIFY message, posted to the
+ message queue gets dispatched to the main Emacs window procedure,
+ which queues it for processing by w32_read_socket. When
+ w32_read_socket sees this message, it accesses the buffer with file
+ notifications (using a critical section), extracts the information,
+ converts it to a series of FILE_NOTIFY_EVENT events, and stuffs
+ them into the input event queue to be processed by keyboard.c input
+ machinery (read_char via a call to kbd_buffer_get_event).
+
+ In a non-GUI session, we send the WM_EMACS_FILENOTIFY message to
+ the main (a.k.a. "Lisp") thread instead, since there are no window
+ procedures in console programs. That message wakes up
+ MsgWaitForMultipleObjects inside sys_select, which then signals to
+ its caller that some keyboard input is available. This causes
+ w32_console_read_socket to be called, which accesses the buffer
+ with file notifications and stuffs them into the input event queue
+ for keyboard.c to process.
+
+ When the FILE_NOTIFY_EVENT event is processed by keyboard.c's
+ kbd_buffer_get_event, it is converted to a Lispy event that can be
+ bound to a command. The default binding is w32notify-handle-event,
+ defined on subr.el.
+
+ After w32_read_socket or w32_console_read_socket are done
+ processing the notifications, they reset a flag signaling to all
+ watch worker threads that the notifications buffer is available for
+ more input.
+
+ When the watch is removed by a call to w32notify-rm-watch, the main
+ thread requests that the worker thread terminates by queuing an APC
+ for the worker thread. The APC specifies the watch_end function to
+ be called. watch_end calls CancelIo on the outstanding
+ ReadDirectoryChangesW call and closes the handle on which the
+ watched directory was open. When watch_end returns, the
+ watch_completion function is called one last time with the
+ ERROR_OPERATION_ABORTED status, which causes it to clean up and set
+ a flag telling watch_worker to exit without issuing another
+ ReadDirectoryChangesW call. Since watch_worker is the thread
+ procedure of the worker thread, exiting it causes the thread to
+ exit. The main thread waits for some time for the worker thread to
+ exit, and if it doesn't, terminates it forcibly. */
+
+#include <stddef.h>
+#include <errno.h>
+
+/* must include CRT headers *before* config.h */
+#include <config.h>
+
+#include <windows.h>
+
+#include "lisp.h"
+#include "w32term.h" /* for enter_crit/leave_crit and WM_EMACS_FILENOTIFY */
+#include "w32common.h" /* for OS version data */
+#include "w32.h" /* for w32_strerror */
+#include "coding.h"
+#include "keyboard.h"
+#include "frame.h" /* needed by termhooks.h */
+#include "termhooks.h" /* for FILE_NOTIFY_EVENT */
+
+#define DIRWATCH_SIGNATURE 0x01233210
+
+struct notification {
+ BYTE *buf; /* buffer for ReadDirectoryChangesW */
+ OVERLAPPED *io_info; /* the OVERLAPPED structure for async I/O */
+ BOOL subtree; /* whether to watch subdirectories */
+ DWORD filter; /* bit mask for events to watch */
+ char *watchee; /* the file we are interested in */
+ HANDLE dir; /* handle to the watched directory */
+ HANDLE thr; /* handle to the thread that watches */
+ volatile int terminate; /* if non-zero, request for the thread to terminate */
+ unsigned signature;
+};
+
+/* Used for communicating notifications to the main thread. */
+volatile int notification_buffer_in_use;
+BYTE file_notifications[16384];
+DWORD notifications_size;
+void *notifications_desc;
+
+static Lisp_Object Qfile_name, Qdirectory_name, Qattributes, Qsize;
+static Lisp_Object Qlast_write_time, Qlast_access_time, Qcreation_time;
+static Lisp_Object Qsecurity_desc, Qsubtree, watch_list;
+
+/* Signal to the main thread that we have file notifications for it to
+ process. */
+static void
+send_notifications (BYTE *info, DWORD info_size, void *desc,
+ volatile int *terminate)
+{
+ int done = 0;
+ FRAME_PTR f = SELECTED_FRAME ();
+
+ /* A single buffer is used to communicate all notifications to the
+ main thread. Since both the main thread and several watcher
+ threads could be active at the same time, we use a critical area
+ and an "in-use" flag to synchronize them. A watcher thread can
+ only put its notifications in the buffer if it acquires the
+ critical area and finds the "in-use" flag reset. The main thread
+ resets the flag after it is done processing notifications.
+
+ FIXME: is there a better way of dealing with this? */
+ while (!done && !*terminate)
+ {
+ enter_crit ();
+ if (!notification_buffer_in_use)
+ {
+ if (info_size)
+ memcpy (file_notifications, info, info_size);
+ notifications_size = info_size;
+ notifications_desc = desc;
+ /* If PostMessage fails, the message queue is full. If that
+ happens, the last thing they will worry about is file
+ notifications. So we effectively discard the
+ notification in that case. */
+ if ((FRAME_TERMCAP_P (f)
+ /* We send the message to the main (a.k.a. "Lisp")
+ thread, where it will wake up MsgWaitForMultipleObjects
+ inside sys_select, causing it to report that there's
+ some keyboard input available. This will in turn cause
+ w32_console_read_socket to be called, which will pick
+ up the file notifications. */
+ && PostThreadMessage (dwMainThreadId, WM_EMACS_FILENOTIFY, 0, 0))
+ || (FRAME_W32_P (f)
+ && PostMessage (FRAME_W32_WINDOW (f),
+ WM_EMACS_FILENOTIFY, 0, 0)))
+ notification_buffer_in_use = 1;
+ done = 1;
+ }
+ leave_crit ();
+ if (!done)
+ Sleep (5);
+ }
+}
+
+/* An APC routine to cancel outstanding directory watch. Invoked by
+ the main thread via QueueUserAPC. This is needed because only the
+ thread that issued the ReadDirectoryChangesW call can call CancelIo
+ to cancel that. (CancelIoEx is only available since Vista, so we
+ cannot use it on XP.) */
+VOID CALLBACK
+watch_end (ULONG_PTR arg)
+{
+ HANDLE hdir = (HANDLE)arg;
+
+ if (hdir && hdir != INVALID_HANDLE_VALUE)
+ {
+ CancelIo (hdir);
+ CloseHandle (hdir);
+ }
+}
+
+/* A completion routine (a.k.a. "APC function") for handling events
+ read by ReadDirectoryChangesW. Called by the OS when the thread
+ which issued the asynchronous ReadDirectoryChangesW call is in the
+ "alertable state", i.e. waiting inside SleepEx call. */
+VOID CALLBACK
+watch_completion (DWORD status, DWORD bytes_ret, OVERLAPPED *io_info)
+{
+ struct notification *dirwatch;
+
+ /* Who knows what happened? Perhaps the OVERLAPPED structure was
+ freed by someone already? In any case, we cannot do anything
+ with this request, so just punt and skip it. FIXME: should we
+ raise the 'terminate' flag in this case? */
+ if (!io_info)
+ return;
+
+ /* We have a pointer to our dirwatch structure conveniently stashed
+ away in the hEvent member of the OVERLAPPED struct. According to
+ MSDN documentation of ReadDirectoryChangesW: "The hEvent member
+ of the OVERLAPPED structure is not used by the system, so you can
+ use it yourself." */
+ dirwatch = (struct notification *)io_info->hEvent;
+ if (status == ERROR_OPERATION_ABORTED)
+ {
+ /* We've been called because the main thread told us to issue
+ CancelIo on the directory we watch, and watch_end did so.
+ The directory handle is already closed. We should clean up
+ and exit, signaling to the thread worker routine not to
+ issue another call to ReadDirectoryChangesW. Note that we
+ don't free the dirwatch object itself nor the memory consumed
+ by its buffers; this is done by the main thread in
+ remove_watch. Calling malloc/free from a thread other than
+ the main thread is a no-no. */
+ dirwatch->dir = NULL;
+ dirwatch->terminate = 1;
+ }
+ else
+ {
+ /* Tell the main thread we have notifications for it. */
+ send_notifications (dirwatch->buf, bytes_ret, dirwatch,
+ &dirwatch->terminate);
+ }
+}
+
+/* Worker routine for the watch thread. */
+static DWORD WINAPI
+watch_worker (LPVOID arg)
+{
+ struct notification *dirwatch = (struct notification *)arg;
+
+ do {
+ BOOL status;
+ DWORD sleep_result;
+ DWORD bytes_ret = 0;
+
+ if (dirwatch->dir)
+ {
+ status = ReadDirectoryChangesW (dirwatch->dir, dirwatch->buf, 16384,
+ dirwatch->subtree, dirwatch->filter,
+ &bytes_ret,
+ dirwatch->io_info, watch_completion);
+ if (!status)
+ {
+ DebPrint (("watch_worker, abnormal exit: %lu\n", GetLastError ()));
+ /* We cannot remove the dirwatch object from watch_list,
+ because we are in a separate thread. For the same
+ reason, we also cannot free memory consumed by the
+ buffers allocated for the dirwatch object. So we close
+ the directory handle, but do not free the object itself
+ or its buffers. We also don't touch the signature.
+ This way, remove_watch can still identify the object,
+ remove it, and free its memory. */
+ CloseHandle (dirwatch->dir);
+ dirwatch->dir = NULL;
+ return 1;
+ }
+ }
+ /* 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);
+ } while (!dirwatch->terminate);
+
+ return 0;
+}
+
+/* Launch a thread to watch changes to FILE in a directory open on
+ handle HDIR. */
+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);
+ dirwatch->io_info = xzalloc (sizeof(OVERLAPPED));
+ /* Stash a pointer to dirwatch structure for use by the completion
+ routine. According to MSDN documentation of ReadDirectoryChangesW:
+ "The hEvent member of the OVERLAPPED structure is not used by the
+ system, so you can use it yourself." */
+ dirwatch->io_info->hEvent = dirwatch;
+ dirwatch->subtree = subdirs;
+ dirwatch->filter = flags;
+ dirwatch->watchee = xstrdup (file);
+ dirwatch->terminate = 0;
+ dirwatch->dir = hdir;
+
+ /* See w32proc.c where it calls CreateThread for the story behind
+ the 2nd and 5th argument in the call to CreateThread. */
+ dirwatch->thr = CreateThread (NULL, 64 * 1024, watch_worker, (void *)dirwatch,
+ 0x00010000, NULL);
+
+ if (!dirwatch->thr)
+ {
+ xfree (dirwatch->buf);
+ xfree (dirwatch->io_info);
+ xfree (dirwatch->watchee);
+ xfree (dirwatch);
+ dirwatch = NULL;
+ }
+ return dirwatch;
+}
+
+/* Called from the main thread to start watching FILE in PARENT_DIR,
+ subject to FLAGS. If SUBDIRS is TRUE, watch the subdirectories of
+ PARENT_DIR as well. Value is a pointer to 'struct notification'
+ used by the thread that watches the changes. */
+static struct notification *
+add_watch (const char *parent_dir, const char *file, BOOL subdirs, DWORD flags)
+{
+ HANDLE hdir;
+ struct notification *dirwatch = NULL;
+
+ if (!file || !*file)
+ return NULL;
+
+ hdir = CreateFile (parent_dir,
+ FILE_LIST_DIRECTORY,
+ /* FILE_SHARE_DELETE doesn't preclude other
+ processes from deleting files inside
+ parent_dir. */
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
+ NULL);
+ if (hdir == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ if ((dirwatch = start_watching (file, hdir, subdirs, flags)) == NULL)
+ CloseHandle (hdir);
+
+ return dirwatch;
+}
+
+/* Stop watching a directory specified by a pointer to its dirwatch object. */
+static int
+remove_watch (struct notification *dirwatch)
+{
+ if (dirwatch && dirwatch->signature == DIRWATCH_SIGNATURE)
+ {
+ int i;
+ BOOL status;
+ DWORD exit_code, err;
+
+ /* Only the thread that issued the outstanding I/O call can call
+ CancelIo on it. (CancelIoEx is available only since Vista.)
+ So we need to queue an APC for the worker thread telling it
+ to terminate. */
+ if (!QueueUserAPC (watch_end, dirwatch->thr, (ULONG_PTR)dirwatch->dir))
+ DebPrint (("QueueUserAPC failed (%lu)!\n", GetLastError ()));
+ /* We also set the terminate flag, for when the thread is
+ waiting on the critical section that never gets acquired.
+ FIXME: is there a cleaner method? Using SleepEx there is a
+ no-no, as that will lead to recursive APC invocations and
+ stack overflow. */
+ dirwatch->terminate = 1;
+ /* Wait for the thread to exit. FIXME: is there a better method
+ that is not overly complex? */
+ for (i = 0; i < 50; i++)
+ {
+ if (!((status = GetExitCodeThread (dirwatch->thr, &exit_code))
+ && exit_code == STILL_ACTIVE))
+ break;
+ Sleep (10);
+ }
+ if ((status == FALSE && (err = GetLastError ()) == ERROR_INVALID_HANDLE)
+ || exit_code == STILL_ACTIVE)
+ {
+ if (!(status == FALSE && err == ERROR_INVALID_HANDLE))
+ {
+ TerminateThread (dirwatch->thr, 0);
+ if (dirwatch->dir)
+ CloseHandle (dirwatch->dir);
+ }
+ }
+
+ /* Clean up. */
+ if (dirwatch->thr)
+ {
+ CloseHandle (dirwatch->thr);
+ dirwatch->thr = NULL;
+ }
+ xfree (dirwatch->buf);
+ xfree (dirwatch->io_info);
+ xfree (dirwatch->watchee);
+ xfree (dirwatch);
+
+ return 0;
+ }
+ else
+ {
+ DebPrint (("Unknown dirwatch object!\n"));
+ return -1;
+ }
+}
+
+static DWORD
+filter_list_to_flags (Lisp_Object filter_list)
+{
+ DWORD flags = 0;
+
+ if (NILP (filter_list))
+ return flags;
+
+ if (!NILP (Fmember (Qfile_name, filter_list)))
+ flags |= FILE_NOTIFY_CHANGE_FILE_NAME;
+ if (!NILP (Fmember (Qdirectory_name, filter_list)))
+ flags |= FILE_NOTIFY_CHANGE_DIR_NAME;
+ if (!NILP (Fmember (Qattributes, filter_list)))
+ flags |= FILE_NOTIFY_CHANGE_ATTRIBUTES;
+ if (!NILP (Fmember (Qsize, filter_list)))
+ flags |= FILE_NOTIFY_CHANGE_SIZE;
+ if (!NILP (Fmember (Qlast_write_time, filter_list)))
+ flags |= FILE_NOTIFY_CHANGE_LAST_WRITE;
+ if (!NILP (Fmember (Qlast_access_time, filter_list)))
+ flags |= FILE_NOTIFY_CHANGE_LAST_ACCESS;
+ if (!NILP (Fmember (Qcreation_time, filter_list)))
+ flags |= FILE_NOTIFY_CHANGE_CREATION;
+ if (!NILP (Fmember (Qsecurity_desc, filter_list)))
+ flags |= FILE_NOTIFY_CHANGE_SECURITY;
+
+ return flags;
+}
+
+DEFUN ("w32notify-add-watch", Fw32notify_add_watch,
+ Sw32notify_add_watch, 3, 3, 0,
+ doc: /* Add a watch for filesystem events pertaining to FILE.
+
+This arranges for filesystem events pertaining to FILE to be reported
+to Emacs. Use `w32notify-rm-watch' to cancel the watch.
+
+Value is a descriptor for the added watch, or nil if the file
+cannot be watched.
+
+FILTER is a list of conditions for reporting an event. It can include
+the following symbols:
+
+ 'file-name' -- report file creation, deletion, or renaming
+ 'directory-name' -- report directory creation, deletion, or renaming
+ 'attributes' -- report changes in attributes
+ 'size' -- report changes in file-size
+ 'last-write-time' -- report changes in last-write time
+ 'last-access-time' -- report changes in last-access time
+ 'creation-time' -- report changes in creation time
+ 'security-desc' -- report changes in security descriptor
+
+If FILE is a directory, and FILTER includes 'subtree', then all the
+subdirectories will also be watched and changes in them reported.
+
+When any event happens that satisfies the conditions specified by
+FILTER, Emacs will call the CALLBACK function passing it a single
+argument EVENT, which is of the form
+
+ (DESCRIPTOR ACTION FILE)
+
+DESCRIPTOR is the same object as the one returned by this function.
+ACTION is the description of the event. It could be any one of the
+following:
+
+ 'added' -- FILE was added
+ 'removed' -- FILE was deleted
+ 'modified' -- FILE's contents or its attributes were modified
+ 'renamed-from' -- a file was renamed whose old name was FILE
+ 'renamed-to' -- a file was renamed and its new name is FILE
+
+FILE is the name of the file whose event is being reported. */)
+ (Lisp_Object file, Lisp_Object filter, Lisp_Object callback)
+{
+ Lisp_Object encoded_file, watch_object, watch_descriptor;
+ char parent_dir[MAX_PATH], *basename;
+ size_t fn_len;
+ DWORD flags;
+ BOOL subdirs = FALSE;
+ struct notification *dirwatch = NULL;
+ Lisp_Object lisp_errstr;
+ char *errstr;
+
+ CHECK_LIST (filter);
+
+ /* The underlying features are available only since XP. */
+ if (os_subtype == OS_9X
+ || (w32_major_version == 5 && w32_major_version < 1))
+ {
+ errno = ENOSYS;
+ report_file_error ("Watching filesystem events is not supported",
+ Qnil);
+ }
+
+ /* We need a full absolute file name of FILE, and we need to remove
+ any trailing slashes from it, so that GetFullPathName below gets
+ the basename part correctly. */
+ file = Fdirectory_file_name (Fexpand_file_name (file, Qnil));
+ encoded_file = ENCODE_FILE (file);
+
+ fn_len = GetFullPathName (SDATA (encoded_file), MAX_PATH, parent_dir,
+ &basename);
+ if (!fn_len)
+ {
+ errstr = w32_strerror (0);
+ errno = EINVAL;
+ if (!NILP (Vlocale_coding_system))
+ lisp_errstr
+ = code_convert_string_norecord (build_unibyte_string (errstr),
+ Vlocale_coding_system, 0);
+ else
+ lisp_errstr = build_string (errstr);
+ report_file_error ("GetFullPathName failed",
+ Fcons (lisp_errstr, Fcons (file, Qnil)));
+ }
+ /* We need the parent directory without the slash that follows it.
+ If BASENAME is NULL, the argument was the root directory on its
+ drive. */
+ if (basename)
+ basename[-1] = '\0';
+ else
+ subdirs = TRUE;
+
+ if (!NILP (Fmember (Qsubtree, filter)))
+ subdirs = TRUE;
+
+ flags = filter_list_to_flags (filter);
+
+ dirwatch = add_watch (parent_dir, basename, subdirs, flags);
+ if (!dirwatch)
+ {
+ DWORD err = GetLastError ();
+
+ errno = EINVAL;
+ if (err)
+ {
+ errstr = w32_strerror (err);
+ if (!NILP (Vlocale_coding_system))
+ lisp_errstr
+ = code_convert_string_norecord (build_unibyte_string (errstr),
+ Vlocale_coding_system, 0);
+ else
+ lisp_errstr = build_string (errstr);
+ report_file_error ("Cannot watch file",
+ Fcons (lisp_errstr, Fcons (file, Qnil)));
+ }
+ else
+ report_file_error ("Cannot watch file", Fcons (file, Qnil));
+ }
+ /* Store watch object in watch list. */
+ watch_descriptor = XIL ((EMACS_INT)dirwatch);
+ watch_object = Fcons (watch_descriptor, callback);
+ watch_list = Fcons (watch_object, watch_list);
+
+ return watch_descriptor;
+}
+
+DEFUN ("w32notify-rm-watch", Fw32notify_rm_watch,
+ Sw32notify_rm_watch, 1, 1, 0,
+ doc: /* Remove an existing watch specified by its WATCH-DESCRIPTOR.
+
+WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. */)
+ (Lisp_Object watch_descriptor)
+{
+ Lisp_Object watch_object;
+ struct notification *dirwatch;
+ int status = -1;
+
+ /* Remove the watch object from watch list. Do this before freeing
+ the object, do that even if we fail to free it, watch_list is
+ kept free of junk. */
+ watch_object = Fassoc (watch_descriptor, watch_list);
+ if (!NILP (watch_object))
+ {
+ watch_list = Fdelete (watch_object, watch_list);
+ dirwatch = (struct notification *)XLI (watch_descriptor);
+ if (w32_valid_pointer_p (dirwatch, sizeof(struct notification)))
+ status = remove_watch (dirwatch);
+ }
+
+ if (status == -1)
+ report_file_error ("Invalid watch descriptor", Fcons (watch_descriptor,
+ Qnil));
+
+ return Qnil;
+}
+
+Lisp_Object
+w32_get_watch_object (void *desc)
+{
+ Lisp_Object descriptor = XIL ((EMACS_INT)desc);
+
+ /* This is called from the input queue handling code, inside a
+ critical section, so we cannot possibly QUIT if watch_list is not
+ in the right condition. */
+ return NILP (watch_list) ? Qnil : assoc_no_quit (descriptor, watch_list);
+}
+
+void
+globals_of_w32notify (void)
+{
+ watch_list = Qnil;
+}
+
+void
+syms_of_w32notify (void)
+{
+ DEFSYM (Qfile_name, "file-name");
+ DEFSYM (Qdirectory_name, "directory-name");
+ DEFSYM (Qattributes, "attributes");
+ DEFSYM (Qsize, "size");
+ DEFSYM (Qlast_write_time, "last-write-time");
+ DEFSYM (Qlast_access_time, "last-access-time");
+ DEFSYM (Qcreation_time, "creation-time");
+ DEFSYM (Qsecurity_desc, "security-desc");
+ DEFSYM (Qsubtree, "subtree");
+
+ defsubr (&Sw32notify_add_watch);
+ defsubr (&Sw32notify_rm_watch);
+
+ staticpro (&watch_list);
+
+ Fprovide (intern_c_string ("w32notify"), Qnil);
+}
return (*set & (1U << signo)) != 0;
}
-int
-setpgrp (int pid, int gid)
+pid_t
+getpgrp (void)
{
- return 0;
+ return getpid ();
}
pid_t
-getpgrp (void)
+tcgetpgrp (int fd)
{
return getpid ();
}
return 0;
}
+pid_t
+setsid (void)
+{
+ return getpid ();
+}
+
/* Emulations of interval timers.
Limitations: only ITIMER_REAL and ITIMER_PROF are supported.
/* Child process management list. */
int child_proc_count = 0;
child_process child_procs[ MAX_CHILDREN ];
-child_process *dead_child = NULL;
static DWORD WINAPI reader_thread (void *arg);
cp->pid = -1;
cp->procinfo.hProcess = NULL;
cp->status = STATUS_READ_ERROR;
+ cp->input_file = NULL;
+ cp->pending_deletion = 0;
/* use manual reset event so that select() will function properly */
cp->char_avail = CreateEvent (NULL, TRUE, FALSE, NULL);
if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL)
return;
+ /* Delete the child's temporary input file, if any, that is pending
+ deletion. */
+ if (cp->input_file)
+ {
+ if (cp->pending_deletion)
+ {
+ if (unlink (cp->input_file))
+ DebPrint (("delete_child.unlink (%s) failed, errno: %d\n",
+ cp->input_file, errno));
+ cp->pending_deletion = 0;
+ }
+ xfree (cp->input_file);
+ cp->input_file = NULL;
+ }
+
/* reap thread if necessary */
if (cp->thrd)
{
{
int rc;
- if (fd_info[cp->fd].flags & FILE_LISTEN)
+ if (cp->fd >= 0 && fd_info[cp->fd].flags & FILE_LISTEN)
rc = _sys_wait_accept (cp->fd);
else
rc = _sys_read_ahead (cp->fd);
+ /* Don't bother waiting for the event if we already have been
+ told to exit by delete_child. */
+ if (cp->status == STATUS_READ_ERROR || !cp->char_avail)
+ break;
+
/* The name char_avail is a misnomer - it really just means the
read-ahead has completed, whether successfully or not. */
if (!SetEvent (cp->char_avail))
if (rc == STATUS_READ_FAILED)
break;
+ /* Don't bother waiting for the acknowledge if we already have
+ been told to exit by delete_child. */
+ if (cp->status == STATUS_READ_ERROR || !cp->char_consumed)
+ break;
+
/* Wait until our input is acknowledged before reading again */
if (WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0)
{
"%lu for fd %ld\n", GetLastError (), cp->fd));
break;
}
+ /* delete_child sets status to STATUS_READ_ERROR when it wants
+ us to exit. */
+ if (cp->status == STATUS_READ_ERROR)
+ break;
}
return 0;
}
if (cp->pid < 0)
cp->pid = -cp->pid;
- /* pid must fit in a Lisp_Int */
- cp->pid = cp->pid & INTMASK;
-
*pPid = cp->pid;
return TRUE;
This way the select emulator knows how to match file handles with
entries in child_procs. */
void
-register_child (int pid, int fd)
+register_child (pid_t pid, int fd)
{
child_process *cp;
- cp = find_child_pid (pid);
+ cp = find_child_pid ((DWORD)pid);
if (cp == NULL)
{
DebPrint (("register_child unable to find pid %lu\n", pid));
fd_info[fd].cp = cp;
}
-/* When a process dies its pipe will break so the reader thread will
- signal failure to the select emulator.
- The select emulator then calls this routine to clean up.
- Since the thread signaled failure we can assume it is exiting. */
+/* Record INFILE as an input file for process PID. */
+void
+record_infile (pid_t pid, char *infile)
+{
+ child_process *cp;
+
+ /* INFILE should never be NULL, since xstrdup would have signaled
+ memory full condition in that case, see callproc.c where this
+ function is called. */
+ eassert (infile);
+
+ cp = find_child_pid ((DWORD)pid);
+ if (cp == NULL)
+ {
+ DebPrint (("record_infile is unable to find pid %lu\n", pid));
+ return;
+ }
+
+ cp->input_file = infile;
+}
+
+/* Mark the input file INFILE of the corresponding subprocess as
+ temporary, to be deleted when the subprocess exits. */
+void
+record_pending_deletion (char *infile)
+{
+ child_process *cp;
+
+ eassert (infile);
+
+ for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
+ if (CHILD_ACTIVE (cp)
+ && cp->input_file && xstrcasecmp (cp->input_file, infile) == 0)
+ {
+ cp->pending_deletion = 1;
+ break;
+ }
+}
+
+/* Called from waitpid when a process exits. */
static void
reap_subprocess (child_process *cp)
{
#ifdef FULL_DEBUG
/* Process should have already died before we are called. */
if (WaitForSingleObject (cp->procinfo.hProcess, 0) != WAIT_OBJECT_0)
- DebPrint (("reap_subprocess: child fpr fd %d has not died yet!", cp->fd));
+ DebPrint (("reap_subprocess: child for fd %d has not died yet!", cp->fd));
#endif
CloseHandle (cp->procinfo.hProcess);
cp->procinfo.hProcess = NULL;
cp->procinfo.hThread = NULL;
}
- /* For asynchronous children, the child_proc resources will be freed
- when the last pipe read descriptor is closed; for synchronous
- children, we must explicitly free the resources now because
- register_child has not been called. */
- if (cp->fd == -1)
+ /* If cp->fd was not closed yet, we might be still reading the
+ process output, so don't free its resources just yet. The call
+ to delete_child on behalf of this subprocess will be made by
+ sys_read when the subprocess output is fully read. */
+ if (cp->fd < 0)
delete_child (cp);
}
-/* Wait for any of our existing child processes to die
- When it does, close its handle
- Return the pid and fill in the status if non-NULL. */
+/* Wait for a child process specified by PID, or for any of our
+ existing child processes (if PID is nonpositive) to die. When it
+ does, close its handle. Return the pid of the process that died
+ and fill in STATUS if non-NULL. */
-int
-sys_wait (int *status)
+pid_t
+waitpid (pid_t pid, int *status, int options)
{
DWORD active, retval;
int nh;
- int pid;
child_process *cp, *cps[MAX_CHILDREN];
HANDLE wait_hnd[MAX_CHILDREN];
+ DWORD timeout_ms;
+ int dont_wait = (options & WNOHANG) != 0;
nh = 0;
- if (dead_child != NULL)
+ /* According to Posix:
+
+ PID = -1 means status is requested for any child process.
+
+ PID > 0 means status is requested for a single child process
+ whose pid is PID.
+
+ PID = 0 means status is requested for any child process whose
+ process group ID is equal to that of the calling process. But
+ since Windows has only a limited support for process groups (only
+ for console processes and only for the purposes of passing
+ Ctrl-BREAK signal to them), and since we have no documented way
+ of determining whether a given process belongs to our group, we
+ treat 0 as -1.
+
+ PID < -1 means status is requested for any child process whose
+ process group ID is equal to the absolute value of PID. Again,
+ since we don't support process groups, we treat that as -1. */
+ if (pid > 0)
{
- /* We want to wait for a specific child */
- wait_hnd[nh] = dead_child->procinfo.hProcess;
- cps[nh] = dead_child;
- if (!wait_hnd[nh]) emacs_abort ();
- nh++;
- active = 0;
- goto get_result;
+ int our_child = 0;
+
+ /* We are requested to wait for a specific child. */
+ for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
+ {
+ /* Some child_procs might be sockets; ignore them. Also
+ ignore subprocesses whose output is not yet completely
+ read. */
+ if (CHILD_ACTIVE (cp)
+ && cp->procinfo.hProcess
+ && cp->pid == pid)
+ {
+ our_child = 1;
+ break;
+ }
+ }
+ if (our_child)
+ {
+ if (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0)
+ {
+ wait_hnd[nh] = cp->procinfo.hProcess;
+ cps[nh] = cp;
+ nh++;
+ }
+ else if (dont_wait)
+ {
+ /* PID specifies our subprocess, but its status is not
+ yet available. */
+ return 0;
+ }
+ }
+ if (nh == 0)
+ {
+ /* No such child process, or nothing to wait for, so fail. */
+ errno = ECHILD;
+ return -1;
+ }
}
else
{
for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
- /* some child_procs might be sockets; ignore them */
- if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess
- && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0))
- {
- wait_hnd[nh] = cp->procinfo.hProcess;
- cps[nh] = cp;
- nh++;
- }
+ {
+ if (CHILD_ACTIVE (cp)
+ && cp->procinfo.hProcess
+ && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0))
+ {
+ wait_hnd[nh] = cp->procinfo.hProcess;
+ cps[nh] = cp;
+ nh++;
+ }
+ }
+ if (nh == 0)
+ {
+ /* Nothing to wait on, so fail. */
+ errno = ECHILD;
+ return -1;
+ }
}
- if (nh == 0)
- {
- /* Nothing to wait on, so fail */
- errno = ECHILD;
- return -1;
- }
+ if (dont_wait)
+ timeout_ms = 0;
+ else
+ timeout_ms = 1000; /* check for quit about once a second. */
do
{
- /* Check for quit about once a second. */
QUIT;
- active = WaitForMultipleObjects (nh, wait_hnd, FALSE, 1000);
- } while (active == WAIT_TIMEOUT);
+ active = WaitForMultipleObjects (nh, wait_hnd, FALSE, timeout_ms);
+ } while (active == WAIT_TIMEOUT && !dont_wait);
if (active == WAIT_FAILED)
{
errno = EBADF;
return -1;
}
+ else if (active == WAIT_TIMEOUT && dont_wait)
+ {
+ /* PID specifies our subprocess, but it didn't exit yet, so its
+ status is not yet available. */
+#ifdef FULL_DEBUG
+ DebPrint (("Wait: PID %d not reap yet\n", cp->pid));
+#endif
+ return 0;
+ }
else if (active >= WAIT_OBJECT_0
&& active < WAIT_OBJECT_0+MAXIMUM_WAIT_OBJECTS)
{
else
emacs_abort ();
-get_result:
if (!GetExitCodeProcess (wait_hnd[active], &retval))
{
DebPrint (("Wait.GetExitCodeProcess failed with %lu\n",
}
if (retval == STILL_ACTIVE)
{
- /* Should never happen */
+ /* Should never happen. */
DebPrint (("Wait.WaitForMultipleObjects returned an active process\n"));
+ if (pid > 0 && dont_wait)
+ return 0;
errno = EINVAL;
return -1;
}
else
retval <<= 8;
+ if (pid > 0 && active != 0)
+ emacs_abort ();
cp = cps[active];
pid = cp->pid;
#ifdef FULL_DEBUG
#endif
if (status)
- {
- *status = retval;
- }
- else if (synch_process_alive)
- {
- synch_process_alive = 0;
-
- /* Report the status of the synchronous process. */
- if (WIFEXITED (retval))
- synch_process_retcode = WEXITSTATUS (retval);
- else if (WIFSIGNALED (retval))
- {
- int code = WTERMSIG (retval);
- const char *signame;
-
- synchronize_system_messages_locale ();
- signame = strsignal (code);
-
- if (signame == 0)
- signame = "unknown";
-
- synch_process_death = signame;
- }
-
- reap_subprocess (cp);
- }
-
+ *status = retval;
reap_subprocess (cp);
return pid;
Lisp_Object program, full;
char *cmdline, *env, *parg, **targ;
int arglen, numenv;
- int pid;
+ pid_t pid;
child_process *cp;
int is_dos_app, is_cygnus_app, is_gui_app;
int do_quoting = 0;
}
else
{
- /* Child process and socket input */
+ /* Child process and socket/comm port input. */
cp = fd_info[i].cp;
if (cp)
{
/* Wake up the reader thread for this process */
cp->status = STATUS_READ_READY;
if (!SetEvent (cp->char_consumed))
- DebPrint (("nt_select.SetEvent failed with "
+ DebPrint (("sys_select.SetEvent failed with "
"%lu for fd %ld\n", GetLastError (), i));
}
(*) Note that MsgWaitForMultipleObjects above is an
internal dispatch point for messages that are sent to
windows created by this thread. */
- drain_message_queue ();
+ if (drain_message_queue ()
+ /* If drain_message_queue returns non-zero, that means
+ we received a WM_EMACS_FILENOTIFY message. If this
+ is a TTY frame, we must signal the caller that keyboard
+ input is available, so that w32_console_read_socket
+ will be called to pick up the notifications. If we
+ don't do that, file notifications will only work when
+ the Emacs TTY frame has focus. */
+ && FRAME_TERMCAP_P (SELECTED_FRAME ())
+ /* they asked for stdin reads */
+ && FD_ISSET (0, &orfds)
+ /* the stdin handle is valid */
+ && keyboard_handle)
+ {
+ FD_SET (0, rfds);
+ if (nr == 0)
+ nr = 1;
+ }
}
else if (active >= nh)
{
DebPrint (("select calling SIGCHLD handler for pid %d\n",
cp->pid));
#endif
- dead_child = cp;
sig_handlers[SIGCHLD] (SIGCHLD);
- dead_child = NULL;
}
}
else if (fdindex[active] == -1)
/* Emulate 'kill', but only for other processes. */
int
-sys_kill (int pid, int sig)
+sys_kill (pid_t pid, int sig)
{
child_process *cp;
HANDLE proc_hand;
int need_to_free = 0;
int rc = 0;
+ /* Each process is in its own process group. */
+ if (pid < 0)
+ pid = -pid;
+
/* Only handle signals that will result in the process dying */
if (sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP)
{
#endif
static Lisp_Object Qvendor_specific_keysyms;
+static Lisp_Object Qadded, Qremoved, Qmodified;
+static Lisp_Object Qrenamed_from, Qrenamed_to;
\f
/***********************************************************************
w32_frame_up_to_date (struct frame *f)
{
if (FRAME_W32_P (f))
- {
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
-
- if (hlinfo->mouse_face_deferred_gc
- || f == hlinfo->mouse_face_mouse_frame)
- {
- block_input ();
- if (hlinfo->mouse_face_mouse_frame)
- note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
- hlinfo->mouse_face_mouse_x,
- hlinfo->mouse_face_mouse_y);
- hlinfo->mouse_face_deferred_gc = 0;
- unblock_input ();
- }
- }
+ FRAME_MOUSE_UPDATE (f);
}
if (left_p)
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
- left_x + i, top_y + i, 1,
- bottom_y - top_y - 2 * i + 1);
+ left_x + i, top_y + (i + 1) * top_p, 1,
+ bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1);
if (raised_p)
gc.foreground = f->output_data.w32->black_relief.gc->foreground;
if (right_p)
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
- right_x - i, top_y + i + 1, 1,
- bottom_y - top_y - 2 * i - 1);
+ right_x - i, top_y + (i + 1) * top_p, 1,
+ bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1);
w32_set_clip_rectangle (hdc, NULL);
static void
x_draw_image_relief (struct glyph_string *s)
{
- int x0, y0, x1, y1, thick, raised_p;
+ int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
RECT r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
raised_p = s->img->relief > 0;
}
- x0 = x - thick;
- y0 = y - thick;
- x1 = x + s->slice.width + thick - 1;
- y1 = y + s->slice.height + thick - 1;
+ x1 = x + s->slice.width - 1;
+ y1 = y + s->slice.height - 1;
+ top_p = bot_p = left_p = right_p = 0;
+
+ if (s->slice.x == 0)
+ x -= thick, left_p = 1;
+ if (s->slice.y == 0)
+ y -= thick, top_p = 1;
+ if (s->slice.x + s->slice.width == s->img->width)
+ x1 += thick, right_p = 1;
+ if (s->slice.y + s->slice.height == s->img->height)
+ y1 += thick, bot_p = 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
- w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
- s->slice.y == 0,
- s->slice.y + s->slice.height == s->img->height,
- s->slice.x == 0,
- s->slice.x + s->slice.width == s->img->width,
- &r);
+ w32_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p,
+ top_p, bot_p, left_p, right_p, &r);
}
return Qnil;
}
+\f
+/* File event notifications (see w32notify.c). */
+
+Lisp_Object
+lispy_file_action (DWORD action)
+{
+ static char unknown_fmt[] = "unknown-action(%d)";
+ Lisp_Object retval;
+
+ switch (action)
+ {
+ case FILE_ACTION_ADDED:
+ retval = Qadded;
+ break;
+ case FILE_ACTION_REMOVED:
+ retval = Qremoved;
+ break;
+ case FILE_ACTION_MODIFIED:
+ retval = Qmodified;
+ break;
+ case FILE_ACTION_RENAMED_OLD_NAME:
+ retval = Qrenamed_from;
+ break;
+ case FILE_ACTION_RENAMED_NEW_NAME:
+ retval = Qrenamed_to;
+ break;
+ default:
+ {
+ char buf[sizeof(unknown_fmt) - 1 + INT_STRLEN_BOUND (DWORD)];
+
+ sprintf (buf, unknown_fmt, action);
+ retval = intern (buf);
+ }
+ break;
+ }
+
+ return retval;
+}
+
+#ifdef WINDOWSNT
+/* Put file notifications into the Emacs input event queue. This
+ function runs when the WM_EMACS_FILENOTIFY message arrives from a
+ watcher thread. */
+static void
+queue_notifications (struct input_event *event, W32Msg *msg, struct frame *f,
+ int *evcount)
+{
+ BYTE *p = file_notifications;
+ FILE_NOTIFY_INFORMATION *fni = (PFILE_NOTIFY_INFORMATION)p;
+ const DWORD min_size
+ = offsetof (FILE_NOTIFY_INFORMATION, FileName) + sizeof(wchar_t);
+ Lisp_Object frame;
+
+ /* We cannot process notification before Emacs is fully initialized,
+ since we need the UTF-16LE coding-system to be set up. */
+ if (!initialized)
+ {
+ notification_buffer_in_use = 0;
+ return;
+ }
+
+ XSETFRAME (frame, f);
+
+ enter_crit ();
+ if (notification_buffer_in_use)
+ {
+ DWORD info_size = notifications_size;
+ Lisp_Object cs = intern ("utf-16le");
+ Lisp_Object obj = w32_get_watch_object (notifications_desc);
+
+ /* notifications_size could be zero when the buffer of
+ notifications overflowed on the OS level, or when the
+ directory being watched was itself deleted. Do nothing in
+ that case. */
+ if (info_size
+ && !NILP (obj) && CONSP (obj))
+ {
+ Lisp_Object callback = XCDR (obj);
+
+ while (info_size >= min_size)
+ {
+ Lisp_Object utf_16_fn
+ = make_unibyte_string ((char *)fni->FileName,
+ fni->FileNameLength);
+ /* Note: mule-conf is preloaded, so utf-16le must
+ already be defined at this point. */
+ Lisp_Object fname
+ = code_convert_string_norecord (utf_16_fn, cs, 0);
+ Lisp_Object action = lispy_file_action (fni->Action);
+
+ event->kind = FILE_NOTIFY_EVENT;
+ event->code
+ = (ptrdiff_t)XINT (XIL ((EMACS_INT)notifications_desc));
+ event->timestamp = msg->msg.time;
+ event->modifiers = 0;
+ event->frame_or_window = callback;
+ event->arg = Fcons (action, fname);
+ kbd_buffer_store_event (event);
+ (*evcount)++;
+
+ if (!fni->NextEntryOffset)
+ break;
+ p += fni->NextEntryOffset;
+ fni = (PFILE_NOTIFY_INFORMATION)p;
+ info_size -= fni->NextEntryOffset;
+ }
+ }
+ notification_buffer_in_use = 0;
+ }
+ else
+ DebPrint (("We were promised notifications, but in-use flag is zero!\n"));
+ leave_crit ();
+
+ /* We've stuffed all the events ourselves, so w32_read_socket shouldn't. */
+ event->kind = NO_EVENT;
+}
+#endif
+
\f
/* Function to report a mouse movement to the mainstream Emacs code.
The input handler calls this.
static struct scroll_bar *
x_window_to_scroll_bar (Window window_id)
{
- Lisp_Object tail;
+ Lisp_Object tail, frame;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- Lisp_Object frame, bar, condemned;
-
- frame = XCAR (tail);
- /* All elements of Vframe_list should be frames. */
- if (! FRAMEP (frame))
- emacs_abort ();
+ Lisp_Object bar, condemned;
/* Scan this frame's scroll bar list for a scroll bar with the
right window ID. */
HWND hwnd;
SCROLLINFO si;
struct scroll_bar *bar
- = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil));
+ = XSCROLL_BAR (Fmake_vector (make_number (VECSIZE (struct scroll_bar)), Qnil));
Lisp_Object barobj;
block_input ();
check_visibility = 1;
break;
+#ifdef WINDOWSNT
+ case WM_EMACS_FILENOTIFY:
+ f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ if (f)
+ queue_notifications (&inev, &msg, f, &count);
+ break;
+#endif
+
default:
/* Check for messages registered at runtime. */
if (msg.msg.message == msh_mousewheel)
FRAME_FONT (f) = font;
FRAME_BASELINE_OFFSET (f) = font->baseline_offset;
FRAME_COLUMN_WIDTH (f) = font->average_width;
- FRAME_SPACE_WIDTH (f) = font->space_width;
FRAME_LINE_HEIGHT (f) = font->height;
compute_fringe_widths (f, 1);
}
}
+static void
+w32fullscreen_hook (FRAME_PTR f)
+{
+ static int normal_width, normal_height, normal_top, normal_left;
+
+ if (f->async_visible)
+ {
+ int width, height, top_pos, left_pos, pixel_height, pixel_width;
+ int cur_w = FRAME_COLS (f), cur_h = FRAME_LINES (f);
+ RECT workarea_rect;
+
+ block_input ();
+ if (normal_height <= 0)
+ normal_height = cur_h;
+ if (normal_width <= 0)
+ normal_width = cur_w;
+ x_real_positions (f, &f->left_pos, &f->top_pos);
+ x_fullscreen_adjust (f, &width, &height, &top_pos, &left_pos);
+
+ SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0);
+ pixel_height = workarea_rect.bottom - workarea_rect.top;
+ pixel_width = workarea_rect.right - workarea_rect.left;
+
+ switch (f->want_fullscreen)
+ {
+ /* No difference between these two when there is no WM */
+ case FULLSCREEN_MAXIMIZED:
+ PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0);
+ break;
+ case FULLSCREEN_BOTH:
+ height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
+ width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
+ left_pos = workarea_rect.left;
+ top_pos = workarea_rect.top;
+ break;
+ case FULLSCREEN_WIDTH:
+ width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
+ if (normal_height > 0)
+ height = normal_height;
+ left_pos = workarea_rect.left;
+ break;
+ case FULLSCREEN_HEIGHT:
+ height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
+ if (normal_width > 0)
+ width = normal_width;
+ top_pos = workarea_rect.top;
+ break;
+ case FULLSCREEN_NONE:
+ if (normal_height > 0)
+ height = normal_height;
+ else
+ normal_height = height;
+ if (normal_width > 0)
+ width = normal_width;
+ else
+ normal_width = width;
+ /* FIXME: Should restore the original position of the frame. */
+ top_pos = left_pos = 0;
+ break;
+ }
+
+ if (cur_w != width || cur_h != height)
+ {
+ x_set_offset (f, left_pos, top_pos, 1);
+ x_set_window_size (f, 1, width, height);
+ do_pending_window_change (0);
+ }
+ unblock_input ();
+ }
+}
+
/* Call this to change the size of frame F's x-window.
If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
for this size change and subsequent size changes.
hlinfo->mouse_face_end_row
= hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_deferred_gc = 0;
hlinfo->mouse_face_mouse_frame = 0;
}
terminal->mouse_position_hook = w32_mouse_position;
terminal->frame_rehighlight_hook = w32_frame_rehighlight;
terminal->frame_raise_lower_hook = w32_frame_raise_lower;
- /* terminal->fullscreen_hook = XTfullscreen_hook; */
+ terminal->fullscreen_hook = w32fullscreen_hook;
terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms");
+ DEFSYM (Qadded, "added");
+ DEFSYM (Qremoved, "removed");
+ DEFSYM (Qmodified, "modified");
+ DEFSYM (Qrenamed_from, "renamed-from");
+ DEFSYM (Qrenamed_to, "renamed-to");
+
DEFVAR_INT ("w32-num-mouse-buttons",
w32_num_mouse_buttons,
doc: /* Number of physical mouse buttons. */);
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 int x_char_width (struct frame *f);
-extern int x_char_height (struct frame *f);
extern int x_pixel_width (struct frame *f);
extern int x_pixel_height (struct frame *f);
extern void x_set_frame_alpha (struct frame *f);
diffs between X and w32 code. */
struct x_output
{
-#if 0 /* These are also defined in struct frame. Use that instead. */
- PIX_TYPE background_pixel;
- PIX_TYPE foreground_pixel;
-#endif
-
/* Keep track of focus. May be EXPLICIT if we received a FocusIn for this
frame, or IMPLICIT if we received an EnterNotify.
FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */
int focus_state;
-
};
enum
/* Nonzero means our parent is another application's window
and was explicitly specified. */
- char explicit_parent;
+ unsigned explicit_parent : 1;
/* Nonzero means tried already to make this frame visible. */
- char asked_for_visible;
+ unsigned asked_for_visible : 1;
/* Nonzero means menubar is currently active. */
- char menubar_active;
-
- /* Nonzero means menubar is about to become active, but should be
- brought up to date first. */
- volatile char pending_menu_activation;
+ unsigned menubar_active : 1;
/* Relief GCs, colors etc. */
struct relief
struct scroll_bar {
- /* These fields are shared by all vectors. */
- EMACS_INT size_from_Lisp_Vector_struct;
- struct Lisp_Vector *next_from_Lisp_Vector_struct;
+ /* This field is shared by all vectors. */
+ struct vectorlike_header header;
/* The window we're a scroll bar for. */
Lisp_Object window;
Lisp_Object fringe_extended_p;
};
-/* The number of elements a vector holding a struct scroll_bar needs. */
-#define SCROLL_BAR_VEC_SIZE \
- ((sizeof (struct scroll_bar) \
- - sizeof (EMACS_INT) - sizeof (struct Lisp_Vector *)) \
- / word_size)
-
/* Turning a lisp vector value into a pointer to a struct scroll_bar. */
#define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))
#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_END (WM_EMACS_START + 23)
+#define WM_EMACS_FILENOTIFY (WM_EMACS_START + 23)
+#define WM_EMACS_END (WM_EMACS_START + 24)
#define WND_FONTWIDTH_INDEX (0)
#define WND_LINEHEIGHT_INDEX (4)
extern HDC get_frame_dc (struct frame * f);
extern int release_frame_dc (struct frame * f, HDC hDC);
-extern void drain_message_queue (void);
+extern int drain_message_queue (void);
extern BOOL get_next_msg (W32Msg *, BOOL);
extern BOOL post_msg (W32Msg *);
extern void w32_sys_ring_bell (struct frame *f);
extern void x_delete_display (struct w32_display_info *dpyinfo);
+
+extern volatile int notification_buffer_in_use;
+extern BYTE file_notifications[16384];
+extern DWORD notifications_size;
+extern void *notifications_desc;
+extern Lisp_Object w32_get_watch_object (void *);
+extern Lisp_Object lispy_file_action (DWORD);
+
extern void w32_initialize_display_info (Lisp_Object);
extern void initialize_w32_display (struct terminal *);
-
/* Keypad command key support. W32 doesn't have virtual keys defined
for the function keys on the keypad (they are mapped to the standard
function keys), so we define our own. */
extern void globals_of_w32menu (void);
extern void globals_of_w32fns (void);
+extern void globals_of_w32notify (void);
#ifdef CYGWIN
extern int w32_message_fd;
return (TRUE);
}
-/* Process all messages in the current thread's queue. */
-void
+/* Process all messages in the current thread's queue. Value is 1 if
+ one of these messages was WM_EMACS_FILENOTIFY, zero otherwise. */
+int
drain_message_queue (void)
{
MSG msg;
+ int retval = 0;
+
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
+ if (msg.message == WM_EMACS_FILENOTIFY)
+ retval = 1;
TranslateMessage (&msg);
DispatchMessage (&msg);
}
+ return retval;
}
/* x_sync is a no-op on W32. */
static int window_resize_check (struct window *, int);
static void window_resize_apply (struct window *, int);
static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
+static void select_window_1 (Lisp_Object, bool);
/* This is the window in which the terminal's cursor should
be left when nothing is being done with it. This must
return XWINDOW (window);
}
-static struct window *
+struct window *
decode_any_window (register Lisp_Object window)
{
struct window *w;
return w;
}
+/* Called when W's buffer slot is changed. ARG -1 means that W is about to
+ cease its buffer, and 1 means that W is about to set up the new one. */
+
+static void
+adjust_window_count (struct window *w, int arg)
+{
+ eassert (eabs (arg) == 1);
+ if (BUFFERP (w->buffer))
+ {
+ struct buffer *b = XBUFFER (w->buffer);
+
+ if (b->base_buffer)
+ b = b->base_buffer;
+ b->window_count += arg;
+ eassert (b->window_count >= 0);
+ }
+}
+
+/* Set W's buffer slot to VAL and recompute number
+ of windows showing VAL if it is a buffer. */
+
+void
+wset_buffer (struct window *w, Lisp_Object val)
+{
+ adjust_window_count (w, -1);
+ w->buffer = val;
+ adjust_window_count (w, 1);
+}
+
+/* Build a frequently used 4-integer (X Y W H) list. */
+
+static Lisp_Object
+list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h)
+{
+ return list4 (make_number (x), make_number (y),
+ make_number (w), make_number (h));
+}
+
DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0,
doc: /* Return t if OBJECT is a window and nil otherwise. */)
(Lisp_Object object)
}
\f
/* Frames and windows. */
-DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
+DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 0, 1, 0,
doc: /* Return the frame that window WINDOW is on.
WINDOW must be a valid window and defaults to the selected one. */)
(Lisp_Object window)
If FRAME is omitted or nil, it defaults to the selected frame. */)
(Lisp_Object frame)
{
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- return FRAME_MINIBUF_WINDOW (XFRAME (frame));
+ return FRAME_MINIBUF_WINDOW (decode_live_frame (frame));
}
DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p,
select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
{
register struct window *w;
- register struct window *ow;
struct frame *sf;
CHECK_LIVE_WINDOW (window);
else
fset_selected_window (sf, window);
+ select_window_1 (window, inhibit_point_swap);
+
+ bset_last_selected_window (XBUFFER (w->buffer), window);
+ windows_or_buffers_changed++;
+ return window;
+}
+
+/* Select window with a minimum of fuss, i.e. don't record the change anywhere
+ (not even for redisplay's benefit), and assume that the window's frame is
+ already selected. */
+static void
+select_window_1 (Lisp_Object window, bool inhibit_point_swap)
+{
/* Store the old selected window's buffer's point in pointm of the old
selected window. It belongs to that window, and when the window is
not selected, must be in the window. */
if (!inhibit_point_swap)
{
- ow = XWINDOW (selected_window);
+ struct window *ow = XWINDOW (selected_window);
if (! NILP (ow->buffer))
set_marker_both (ow->pointm, ow->buffer,
BUF_PT (XBUFFER (ow->buffer)),
}
selected_window = window;
- bset_last_selected_window (XBUFFER (w->buffer), window);
/* Go to the point recorded in the window.
This is important when the buffer is in more
redisplay_window has altered point after scrolling,
because it makes the change only in the window. */
{
- register ptrdiff_t new_point = marker_position (w->pointm);
+ register ptrdiff_t new_point = marker_position (XWINDOW (window)->pointm);
if (new_point < BEGV)
SET_PT (BEGV);
else if (new_point > ZV)
else
SET_PT (new_point);
}
-
- windows_or_buffers_changed++;
- return window;
}
DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
return decode_valid_window (window)->parent;
}
-DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0,
+DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 0, 1, 0,
doc: /* Return the topmost child window of window WINDOW.
WINDOW must be a valid window and defaults to the selected one.
Return nil if WINDOW is a live window (live windows have no children).
horizontal combination. */)
(Lisp_Object window)
{
- CHECK_WINDOW (window);
return decode_valid_window (window)->vchild;
}
-DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0,
+DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 0, 1, 0,
doc: /* Return the leftmost child window of window WINDOW.
WINDOW must be a valid window and defaults to the selected one.
Return nil if WINDOW is a live window (live windows have no children).
vertical combination. */)
(Lisp_Object window)
{
- CHECK_WINDOW (window);
return decode_valid_window (window)->hchild;
}
DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0,
doc: /* Return combination limit of window WINDOW.
-If the return value is nil, child windows of WINDOW can be recombined
-with WINDOW's siblings. A return value of t means that child windows of
+If the return value is nil, child windows of WINDOW can be recombined with
+WINDOW's siblings. A return value of t means that child windows of
WINDOW are never \(re-)combined with WINDOW's siblings.
WINDOW must be a valid window. The return value is meaningful for
internal windows only. */)
(Lisp_Object window)
{
- return decode_valid_window (window)->combination_limit;
+ CHECK_VALID_WINDOW (window);
+ return XWINDOW (window)->combination_limit;
}
DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
occupies one column only. */
width -= 1;
+ /* Display margins cannot be used for normal text. */
+ width -= WINDOW_LEFT_MARGIN_COLS (w) + WINDOW_RIGHT_MARGIN_COLS (w);
+
if (FRAME_WINDOW_P (f))
- /* On window-systems, fringes and display margins cannot be
- used for normal text. */
- width -= (WINDOW_FRINGE_COLS (w)
- + WINDOW_LEFT_MARGIN_COLS (w)
- + WINDOW_RIGHT_MARGIN_COLS (w));
+ /* On window-systems, fringes cannot be used for normal text. */
+ width -= WINDOW_FRINGE_COLS (w);
return width;
}
exclude partially-visible lines, use `window-text-height'. */)
(Lisp_Object window)
{
- struct window *w = decode_live_window (window);
- return make_number (window_body_lines (w));
+ return make_number (window_body_lines (decode_live_window (window)));
}
DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0,
expressed as an integer multiple of the default character width. */)
(Lisp_Object window)
{
- struct window *w = decode_live_window (window);
- return make_number (window_body_cols (w));
+ return make_number (window_body_cols (decode_live_window (window)));
}
DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
window so that the location of point moves off-window. */)
(Lisp_Object window, Lisp_Object ncol)
{
- struct window *w = decode_live_window (window);
-
CHECK_NUMBER (ncol);
- return set_window_hscroll (w, XINT (ncol));
+ return set_window_hscroll (decode_live_window (window), XINT (ncol));
}
DEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger,
{
register struct window *w = decode_valid_window (window);
- return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)),
- Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)),
- Fcons (make_number (WINDOW_RIGHT_EDGE_COL (w)),
- Fcons (make_number (WINDOW_BOTTOM_EDGE_LINE (w)),
- Qnil))));
+ return list4i (WINDOW_LEFT_EDGE_COL (w), WINDOW_TOP_EDGE_LINE (w),
+ WINDOW_RIGHT_EDGE_COL (w), WINDOW_BOTTOM_EDGE_LINE (w));
}
DEFUN ("window-pixel-edges", Fwindow_pixel_edges, Swindow_pixel_edges, 0, 1, 0,
{
register struct window *w = decode_valid_window (window);
- return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)),
- Fcons (make_number (WINDOW_TOP_EDGE_Y (w)),
- Fcons (make_number (WINDOW_RIGHT_EDGE_X (w)),
- Fcons (make_number (WINDOW_BOTTOM_EDGE_Y (w)),
- Qnil))));
+ return list4i (WINDOW_LEFT_EDGE_X (w), WINDOW_TOP_EDGE_Y (w),
+ WINDOW_RIGHT_EDGE_X (w), WINDOW_BOTTOM_EDGE_Y (w));
}
static void
{
register struct window *w = decode_valid_window (window);
int add_x, add_y;
+
calc_absolute_offset (w, &add_x, &add_y);
- return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x),
- Fcons (make_number (WINDOW_TOP_EDGE_Y (w) + add_y),
- Fcons (make_number (WINDOW_RIGHT_EDGE_X (w) + add_x),
- Fcons (make_number (WINDOW_BOTTOM_EDGE_Y (w) + add_y),
- Qnil))));
+ return list4i (WINDOW_LEFT_EDGE_X (w) + add_x,
+ WINDOW_TOP_EDGE_Y (w) + add_y,
+ WINDOW_RIGHT_EDGE_X (w) + add_x,
+ WINDOW_BOTTOM_EDGE_Y (w) + add_y);
}
DEFUN ("window-inside-edges", Fwindow_inside_edges, Swindow_inside_edges, 0, 1, 0,
{
register struct window *w = decode_live_window (window);
- return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w)
- + WINDOW_LEFT_MARGIN_COLS (w)
- + WINDOW_LEFT_FRINGE_COLS (w)),
- make_number (WINDOW_TOP_EDGE_LINE (w)
- + WINDOW_HEADER_LINE_LINES (w)),
- make_number (WINDOW_BOX_RIGHT_EDGE_COL (w)
- - WINDOW_RIGHT_MARGIN_COLS (w)
- - WINDOW_RIGHT_FRINGE_COLS (w)),
- make_number (WINDOW_BOTTOM_EDGE_LINE (w)
- - WINDOW_MODE_LINE_LINES (w)));
+ return list4i ((WINDOW_BOX_LEFT_EDGE_COL (w)
+ + WINDOW_LEFT_MARGIN_COLS (w)
+ + WINDOW_LEFT_FRINGE_COLS (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_BOTTOM_EDGE_LINE (w)
+ - WINDOW_MODE_LINE_LINES (w)));
}
DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0,
{
register struct window *w = decode_live_window (window);
- return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w)
- + WINDOW_LEFT_MARGIN_WIDTH (w)
- + WINDOW_LEFT_FRINGE_WIDTH (w)),
- make_number (WINDOW_TOP_EDGE_Y (w)
- + WINDOW_HEADER_LINE_HEIGHT (w)),
- make_number (WINDOW_BOX_RIGHT_EDGE_X (w)
- - WINDOW_RIGHT_MARGIN_WIDTH (w)
- - WINDOW_RIGHT_FRINGE_WIDTH (w)),
- make_number (WINDOW_BOTTOM_EDGE_Y (w)
- - WINDOW_MODE_LINE_HEIGHT (w)));
+ return list4i ((WINDOW_BOX_LEFT_EDGE_X (w)
+ + WINDOW_LEFT_MARGIN_WIDTH (w)
+ + WINDOW_LEFT_FRINGE_WIDTH (w)),
+ (WINDOW_TOP_EDGE_Y (w)
+ + WINDOW_HEADER_LINE_HEIGHT (w)),
+ (WINDOW_BOX_RIGHT_EDGE_X (w)
+ - WINDOW_RIGHT_MARGIN_WIDTH (w)
+ - WINDOW_RIGHT_FRINGE_WIDTH (w)),
+ (WINDOW_BOTTOM_EDGE_Y (w)
+ - WINDOW_MODE_LINE_HEIGHT (w)));
}
DEFUN ("window-inside-absolute-pixel-edges",
{
register struct window *w = decode_live_window (window);
int add_x, add_y;
+
calc_absolute_offset (w, &add_x, &add_y);
- return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w)
- + WINDOW_LEFT_MARGIN_WIDTH (w)
- + WINDOW_LEFT_FRINGE_WIDTH (w) + add_x),
- make_number (WINDOW_TOP_EDGE_Y (w)
- + WINDOW_HEADER_LINE_HEIGHT (w) + add_y),
- make_number (WINDOW_BOX_RIGHT_EDGE_X (w)
- - WINDOW_RIGHT_MARGIN_WIDTH (w)
- - WINDOW_RIGHT_FRINGE_WIDTH (w) + add_x),
- make_number (WINDOW_BOTTOM_EDGE_Y (w)
- - WINDOW_MODE_LINE_HEIGHT (w) + add_y));
+ return list4i ((WINDOW_BOX_LEFT_EDGE_X (w)
+ + WINDOW_LEFT_MARGIN_WIDTH (w)
+ + WINDOW_LEFT_FRINGE_WIDTH (w) + add_x),
+ (WINDOW_TOP_EDGE_Y (w)
+ + WINDOW_HEADER_LINE_HEIGHT (w) + add_y),
+ (WINDOW_BOX_RIGHT_EDGE_X (w)
+ - WINDOW_RIGHT_MARGIN_WIDTH (w)
+ - WINDOW_RIGHT_FRINGE_WIDTH (w) + add_x),
+ (WINDOW_BOTTOM_EDGE_Y (w)
+ - WINDOW_MODE_LINE_HEIGHT (w) + add_y));
}
/* Test if the character at column X, row Y is within window W.
column 0. */)
(Lisp_Object x, Lisp_Object y, Lisp_Object frame)
{
- struct frame *f;
-
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
+ struct frame *f = decode_live_frame (frame);
/* Check that arguments are integers or floats. */
CHECK_NUMBER_OR_FLOAT (x);
&& !noninteractive)
{
struct text_pos startp;
+ ptrdiff_t charpos = marker_position (w->start);
struct it it;
struct buffer *old_buffer = NULL;
void *itdata = NULL;
`-l' containing a call to `rmail' with subsequent other
commands. At the end, W->start happened to be BEG, while
rmail had already narrowed the buffer. */
- if (XMARKER (w->start)->charpos < BEGV)
+ if (charpos < BEGV)
SET_TEXT_POS (startp, BEGV, BEGV_BYTE);
- else if (XMARKER (w->start)->charpos > ZV)
+ else if (charpos > ZV)
SET_TEXT_POS (startp, ZV, ZV_BYTE);
else
SET_TEXT_POS_FROM_MARKER (startp, w->start);
else if (w == XWINDOW (selected_window))
posint = PT;
else
- posint = XMARKER (w->pointm)->charpos;
+ posint = marker_position (w->pointm);
/* If position is above window start or outside buffer boundaries,
or if window start is out of range, position is not visible. */
{
Lisp_Object part = Qnil;
if (!fully_p)
- part = list4 (make_number (rtop), make_number (rbot),
- make_number (rowh), make_number (vpos));
+ part = list4i (rtop, rbot, rowh, vpos);
in_window = Fcons (make_number (x),
Fcons (make_number (y), part));
}
if (!WINDOW_WANTS_HEADER_LINE_P (w))
return Qnil;
row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
- if (!row->enabled_p)
- return Qnil;
- return list4 (make_number (row->height),
- make_number (0), make_number (0),
- make_number (0));
+ return row->enabled_p ? list4i (row->height, 0, 0, 0) : Qnil;
}
if (EQ (line, Qmode_line))
{
row = MATRIX_MODE_LINE_ROW (w->current_matrix);
- if (!row->enabled_p)
- return Qnil;
- return list4 (make_number (row->height),
- make_number (0), /* not accurate */
- make_number (WINDOW_HEADER_LINE_HEIGHT (w)
- + window_text_bottom_y (w)),
- make_number (0));
+ return (row->enabled_p ?
+ list4i (row->height,
+ 0, /* not accurate */
+ (WINDOW_HEADER_LINE_HEIGHT (w)
+ + window_text_bottom_y (w)),
+ 0)
+ : Qnil);
}
CHECK_NUMBER (line);
found_row:
crop = max (0, (row->y + row->height) - max_y);
- return list4 (make_number (row->height + min (0, row->y) - crop),
- make_number (i),
- make_number (row->y),
- make_number (crop));
+ return list4i (row->height + min (0, row->y) - crop, i, row->y, crop);
}
DEFUN ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p,
&& EQ (buf, XWINDOW (BVAR (b, last_selected_window))->buffer)))
temp_set_point_both (b,
clip_to_bounds (BUF_BEGV (b),
- XMARKER (w->pointm)->charpos,
+ marker_position (w->pointm),
BUF_ZV (b)),
clip_to_bounds (BUF_BEGV_BYTE (b),
marker_byte_position (w->pointm),
{
if (!CONSP (Vwindow_list))
{
- Lisp_Object tail;
+ Lisp_Object tail, frame;
Vwindow_list = Qnil;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
Lisp_Object args[2];
new windows at the front of args[1], which means we
have to reverse this list at the end. */
args[1] = Qnil;
- foreach_window (XFRAME (XCAR (tail)), add_window_to_list, &args[1]);
+ foreach_window (XFRAME (frame), add_window_to_list, &args[1]);
args[0] = Vwindow_list;
args[1] = Fnreverse (args[1]);
Vwindow_list = Fnconc (2, args);
static void
decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object *all_frames)
{
- if (NILP (*window))
- *window = selected_window;
- else
- CHECK_LIVE_WINDOW (*window);
+ struct window *w = decode_live_window (*window);
+ XSETWINDOW (*window, w);
/* MINIBUF nil may or may not include minibuffers. Decide if it
does. */
if (NILP (*minibuf))
if (NILP (*all_frames))
*all_frames
= (!EQ (*minibuf, Qlambda)
- ? FRAME_MINIBUF_WINDOW (XFRAME (XWINDOW (*window)->frame))
+ ? FRAME_MINIBUF_WINDOW (XFRAME (w->frame))
: Qnil);
else if (EQ (*all_frames, Qvisible))
;
call1 (Qreplace_buffer_in_windows, buffer);
}
-
-/* Safely replace BUFFER with some other buffer in all windows of all
- frames, even those on other keyboards. */
+/* If BUFFER is shown in a window, safely replace it with some other
+ buffer in all windows of all frames, even those on other keyboards. */
void
replace_buffer_in_windows_safely (Lisp_Object buffer)
{
- Lisp_Object tail, frame;
+ if (buffer_window_count (XBUFFER (buffer)))
+ {
+ Lisp_Object tail, frame;
- /* A single call to window_loop won't do the job because it only
- considers frames on the current keyboard. So loop manually over
- frames, and handle each one. */
- FOR_EACH_FRAME (tail, frame)
- window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, 1, frame);
+ /* A single call to window_loop won't do the job because it only
+ considers frames on the current keyboard. So loop manually over
+ frames, and handle each one. */
+ FOR_EACH_FRAME (tail, frame)
+ window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, 1, frame);
+ }
}
-\f
+
/* If *ROWS or *COLS are too small a size for FRAME, set them to the
minimum allowable size. */
}
DEFUN ("run-window-configuration-change-hook", Frun_window_configuration_change_hook,
- Srun_window_configuration_change_hook, 1, 1, 0,
- doc: /* Run `window-configuration-change-hook' for FRAME. */)
+ Srun_window_configuration_change_hook, 0, 1, 0,
+ doc: /* Run `window-configuration-change-hook' for FRAME.
+If FRAME is omitted or nil, it defaults to the selected frame. */)
(Lisp_Object frame)
{
- CHECK_LIVE_FRAME (frame);
- run_window_configuration_change_hook (XFRAME (frame));
+ run_window_configuration_change_hook (decode_live_frame (frame));
return Qnil;
}
tem = w->buffer;
if (NILP (tem))
error ("Window is deleted");
- else if (!EQ (tem, Qt))
- /* w->buffer is t when the window is first being set up. */
+ else
{
if (!EQ (tem, buffer))
{
if (STRINGP (object))
object = Fget_buffer (object);
- if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object)))
+ if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))
+ && buffer_window_count (XBUFFER (object)))
{
- /* Walk all windows looking for buffer, and force update
- of each of those windows. */
-
+ /* If buffer is live and shown in at least one window, find
+ all windows showing this buffer and force update of them. */
object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, 0, Qvisible);
return NILP (object) ? Qnil : Qt;
}
memcpy ((char *) p + sizeof (struct vectorlike_header),
(char *) o + sizeof (struct vectorlike_header),
word_size * VECSIZE (struct window));
+ /* P's buffer slot may change from nil to a buffer. */
+ adjust_window_count (p, 1);
XSETWINDOW (parent, p);
p->sequence_number = ++sequence_number;
}
-DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 1, 2, 0,
+DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 0, 2, 0,
doc: /* Apply requested size values for window-tree of FRAME.
-Optional argument HORIZONTAL omitted or nil means apply requested height
-values. HORIZONTAL non-nil means apply requested width values.
+If FRAME is omitted or nil, it defaults to the selected frame.
+
+Optional argument HORIZONTAL omitted or nil means apply requested
+height values. HORIZONTAL non-nil means apply requested width values.
This function checks whether the requested values sum up to a valid
window layout, recursively assigns the new sizes of all child windows
be applied on the Elisp level. */)
(Lisp_Object frame, Lisp_Object horizontal)
{
- struct frame *f;
- struct window *r;
+ struct frame *f = decode_live_frame (frame);
+ struct window *r = XWINDOW (FRAME_ROOT_WINDOW (f));
int horflag = !NILP (horizontal);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
-
- f = XFRAME (frame);
- r = XWINDOW (FRAME_ROOT_WINDOW (f));
-
if (!window_resize_check (r, horflag)
|| ! EQ (r->new_total,
(horflag ? r->total_cols : r->total_lines)))
wset_next (o, new);
}
- wset_buffer (n, Qt);
wset_window_end_valid (n, Qnil);
memset (&n->last_cursor, 0, sizeof n->last_cursor);
/* Set the window start, and set up the window for redisplay. */
set_marker_restricted (w->start, make_number (pos),
w->buffer);
- bytepos = XMARKER (w->start)->bytepos;
+ bytepos = marker_byte_position (w->start);
w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
w->update_mode_line = 1;
w->last_modified = 0;
{
struct it it;
struct text_pos start;
+ ptrdiff_t charpos = marker_position (w->start);
int height = window_box_height (w);
struct buffer *old_buffer;
int bottom_y;
/* In case W->start is out of the accessible range, do something
reasonable. This happens in Info mode when Info-scroll-down
calls (recenter -1) while W->start is 1. */
- if (XMARKER (w->start)->charpos < BEGV)
+ if (charpos < BEGV)
SET_TEXT_POS (start, BEGV, BEGV_BYTE);
- else if (XMARKER (w->start)->charpos > ZV)
+ else if (charpos > ZV)
SET_TEXT_POS (start, ZV, ZV_BYTE);
else
SET_TEXT_POS_FROM_MARKER (start, w->start);
iarg += ht;
/* Don't let it get into the margin at either top or bottom. */
- iarg = max (iarg, this_scroll_margin);
- iarg = min (iarg, ht - this_scroll_margin - 1);
+ iarg = clip_to_bounds (this_scroll_margin, iarg,
+ ht - this_scroll_margin - 1);
pos = *vmotion (PT, - iarg, w);
charpos = pos.bufpos;
&& WINDOWP (selected_window)
&& EQ (XWINDOW (selected_window)->buffer, new_current_buffer)
&& !EQ (selected_window, data->current_window))
- old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
+ old_point = marker_position (XWINDOW (data->current_window)->pointm);
else
old_point = PT;
else
if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)
/* If current_window = selected_window, its point is in BUF_PT. */
&& !EQ (selected_window, data->current_window))
- old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
+ old_point = marker_position (XWINDOW (data->current_window)->pointm);
else
old_point = BUF_PT (XBUFFER (new_current_buffer));
}
register int n_windows;
register struct save_window_data *data;
register int i;
- FRAME_PTR f;
-
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
+ struct frame *f = decode_live_frame (frame);
n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
data = ALLOCATE_PSEUDOVECTOR (struct save_window_data, frame_cols,
{
struct window *w = decode_live_window (window);
- return Fcons (make_number (WINDOW_LEFT_FRINGE_WIDTH (w)),
- Fcons (make_number (WINDOW_RIGHT_FRINGE_WIDTH (w)),
- Fcons ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
- ? Qt : Qnil), Qnil)));
+ return list3 (make_number (WINDOW_LEFT_FRINGE_WIDTH (w)),
+ make_number (WINDOW_RIGHT_FRINGE_WIDTH (w)),
+ WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) ? Qt : Qnil);
}
(Lisp_Object window)
{
struct window *w = decode_live_window (window);
- return Fcons (make_number ((WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
+
+ return list4 (make_number ((WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
: WINDOW_SCROLL_BAR_AREA_WIDTH (w))),
- Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)),
- Fcons (w->vertical_scroll_bar_type,
- Fcons (Qnil, Qnil))));
+ make_number (WINDOW_SCROLL_BAR_COLS (w)),
+ w->vertical_scroll_bar_type, Qnil);
}
EMACS_INT last_overlay_modified;
/* Value of point at that time. Since this is a position in a buffer,
- it should be positive. */
+ it should be positive. */
ptrdiff_t last_point;
/* Scaling factor for the glyph_matrix size calculation in this window.
/* Non-zero if this window is a minibuffer window. */
unsigned mini : 1;
- /* Non-zero means must regenerate mode line of this window */
+ /* Non-zero means must regenerate mode line of this window. */
unsigned update_mode_line : 1;
/* Non-nil if the buffer was "modified" when the window
y-direction (smooth scrolling). */
int vscroll;
- /* Z_BYTE - the buffer position of the last glyph in the current matrix of W.
+ /* Z_BYTE - Buffer position of the last glyph in the current matrix of W.
Should be nonnegative, and only valid if window_end_valid is not nil. */
ptrdiff_t window_end_bytepos;
};
/* Most code should use these functions to set Lisp fields in struct
window. */
WINDOW_INLINE void
-wset_buffer (struct window *w, Lisp_Object val)
-{
- w->buffer = val;
-}
-WINDOW_INLINE void
wset_frame (struct window *w, Lisp_Object val)
{
w->frame = val;
extern int update_mode_lines;
/* Nonzero if window sizes or contents have changed since last
- redisplay that finished */
+ redisplay that finished. */
extern int windows_or_buffers_changed;
extern int cursor_type_changed;
-/* Number of windows displaying the selected buffer. Normally this is
- 1, but it can be more. */
-
-extern int buffer_shared;
-
/* If *ROWS or *COLS are too small a size for FRAME, set them to the
minimum allowable size. */
|| !NILP (XWINDOW (WINDOW)->vchild) \
|| !NILP (XWINDOW (WINDOW)->hchild)))
+/* A window of any sort, leaf or interior, is "valid" if one
+ of its buffer, vchild, or hchild members is non-nil. */
+#define CHECK_VALID_WINDOW(WINDOW) \
+ CHECK_TYPE (WINDOW_VALID_P (WINDOW), Qwindow_valid_p, WINDOW)
/* Value is non-zero if WINDOW is a live window. */
#define WINDOW_LIVE_P(WINDOW) \
(WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer))
+/* A window is "live" if and only if it shows a buffer. */
+#define CHECK_LIVE_WINDOW(WINDOW) \
+ CHECK_TYPE (WINDOW_LIVE_P (WINDOW), Qwindow_live_p, WINDOW)
+
/* These used to be in lisp.h. */
extern Lisp_Object Qwindowp, Qwindow_live_p;
extern Lisp_Object Vwindow_list;
extern struct window *decode_live_window (Lisp_Object);
+extern struct window *decode_any_window (Lisp_Object);
extern bool compare_window_configurations (Lisp_Object, Lisp_Object, bool);
extern void mark_window_cursors_off (struct window *);
extern int window_internal_height (struct window *);
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);
+/* This looks like a setter, but it is a bit special. */
+extern void wset_buffer (struct window *, Lisp_Object);
extern void init_window_once (void);
extern void init_window (void);
extern void syms_of_window (void);
static int overlay_arrow_seen;
-/* Number of windows showing the buffer of the selected window (or
- another buffer with the same base buffer). keyboard.c refers to
- this. */
-
-int buffer_shared;
-
/* Vector containing glyphs for an ellipsis `...'. */
static Lisp_Object default_invis_vector[3];
static void iterate_out_of_display_property (struct it *);
static void pop_it (struct it *);
static void sync_frame_with_window_matrix_rows (struct window *);
-static void select_frame_for_redisplay (Lisp_Object);
static void redisplay_internal (void);
static int echo_area_display (int);
static void redisplay_windows (Lisp_Object);
BVAR (current_buffer, header_line_format));
start_display (&it, w, top);
- move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
+ move_it_to (&it, charpos, -1, it.last_visible_y - 1, -1,
(charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y);
if (charpos >= 0
&& IT_CHARPOS (it) >= charpos)
/* When scanning backwards under bidi iteration, move_it_to
stops at or _before_ CHARPOS, because it stops at or to
- the _right_ of the character at CHARPOS. */
+ the _right_ of the character at CHARPOS. */
|| (it.bidi_p && it.bidi_it.scan_dir == -1
&& IT_CHARPOS (it) <= charpos)))
{
#endif /* GLYPH_DEBUG and ENABLE_CHECKING */
+/* Return mark position if current buffer has the region of non-zero length,
+ or -1 otherwise. */
+
+static ptrdiff_t
+markpos_of_region (void)
+{
+ if (!NILP (Vtransient_mark_mode)
+ && !NILP (BVAR (current_buffer, mark_active))
+ && XMARKER (BVAR (current_buffer, mark))->buffer != NULL)
+ {
+ ptrdiff_t markpos = XMARKER (BVAR (current_buffer, mark))->charpos;
+
+ if (markpos != PT)
+ return markpos;
+ }
+ return -1;
+}
-\f
/***********************************************************************
Iterator initialization
***********************************************************************/
ptrdiff_t charpos, ptrdiff_t bytepos,
struct glyph_row *row, enum face_id base_face_id)
{
- int highlight_region_p;
+ ptrdiff_t markpos;
enum face_id remapped_base_face_id = base_face_id;
/* Some precondition checks. */
/* Are multibyte characters enabled in current_buffer? */
it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
- /* Non-zero if we should highlight the region. */
- highlight_region_p
- = (!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (current_buffer, mark_active))
- && XMARKER (BVAR (current_buffer, mark))->buffer != 0);
-
- /* Set IT->region_beg_charpos and IT->region_end_charpos to the
- start and end of a visible region in window IT->w. Set both to
- -1 to indicate no region. */
- if (highlight_region_p
+ /* If visible region is of non-zero length, set IT->region_beg_charpos
+ and IT->region_end_charpos to the start and end of a visible region
+ in window IT->w. Set both to -1 to indicate no region. */
+ markpos = markpos_of_region ();
+ if (0 <= markpos
/* Maybe highlight only in selected window. */
&& (/* Either show region everywhere. */
highlight_nonselected_windows
&& WINDOWP (minibuf_selected_window)
&& w == XWINDOW (minibuf_selected_window))))
{
- ptrdiff_t markpos = marker_position (BVAR (current_buffer, mark));
it->region_beg_charpos = min (PT, markpos);
it->region_end_charpos = max (PT, markpos);
}
if (new_face_id != it->face_id)
{
struct face *new_face = FACE_FROM_ID (it->f, new_face_id);
+ /* If it->face_id is -1, old_face below will be NULL, see
+ the definition of FACE_FROM_ID. This will happen if this
+ is the initial call that gets the face. */
+ struct face *old_face = FACE_FROM_ID (it->f, it->face_id);
- /* If new face has a box but old face has not, this is
- the start of a run of characters with box, i.e. it has
- a shadow on the left side. The value of face_id of the
- iterator will be -1 if this is the initial call that gets
- the face. In this case, we have to look in front of IT's
- position and see whether there is a face != new_face_id. */
- it->start_of_box_run_p
- = (new_face->box != FACE_NO_BOX
- && (it->face_id >= 0
- || IT_CHARPOS (*it) == BEG
- || new_face_id != face_before_it_pos (it)));
+ /* If the value of face_id of the iterator is -1, we have to
+ look in front of IT's position and see whether there is a
+ face there that's different from new_face_id. */
+ if (!old_face && IT_CHARPOS (*it) > BEG)
+ {
+ int prev_face_id = face_before_it_pos (it);
+
+ old_face = FACE_FROM_ID (it->f, prev_face_id);
+ }
+
+ /* If the new face has a box, but the old face does not,
+ this is the start of a run of characters with box face,
+ i.e. this character has a shadow on the left side. */
+ it->start_of_box_run_p = (new_face->box != FACE_NO_BOX
+ && (old_face == NULL || !old_face->box));
it->face_box_p = new_face->box != FACE_NO_BOX;
}
}
int old_windows_or_buffers_changed = windows_or_buffers_changed;
ptrdiff_t point_at_end = 0;
ptrdiff_t zv_at_end = 0;
- Lisp_Object old_deactivate_mark, tem;
+ Lisp_Object old_deactivate_mark;
+ bool shown;
struct gcpro gcpro1;
old_deactivate_mark = Vdeactivate_mark;
del_range_both (BEG, BEG_BYTE, PT, PT_BYTE, 0);
}
}
- BEGV = XMARKER (oldbegv)->charpos;
+ BEGV = marker_position (oldbegv);
BEGV_BYTE = marker_byte_position (oldbegv);
if (zv_at_end)
}
else
{
- ZV = XMARKER (oldzv)->charpos;
+ ZV = marker_position (oldzv);
ZV_BYTE = marker_byte_position (oldzv);
}
else
/* We can't do Fgoto_char (oldpoint) because it will run some
Lisp code. */
- TEMP_SET_PT_BOTH (XMARKER (oldpoint)->charpos,
- XMARKER (oldpoint)->bytepos);
+ TEMP_SET_PT_BOTH (marker_position (oldpoint),
+ marker_byte_position (oldpoint));
UNGCPRO;
unchain_marker (XMARKER (oldpoint));
unchain_marker (XMARKER (oldbegv));
unchain_marker (XMARKER (oldzv));
- tem = Fget_buffer_window (Fcurrent_buffer (), Qt);
+ shown = buffer_window_count (current_buffer) > 0;
set_buffer_internal (oldbuf);
- if (NILP (tem))
+ if (!shown)
windows_or_buffers_changed = old_windows_or_buffers_changed;
message_log_need_newline = !nlflag;
Vdeactivate_mark = old_deactivate_mark;
do_pending_window_change (0);
echo_area_display (1);
do_pending_window_change (0);
- if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
+ if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
(*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
}
}
do_pending_window_change (0);
echo_area_display (1);
do_pending_window_change (0);
- if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
+ if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
(*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
}
}
{
XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i;
ASET (vector, i, w->buffer); ++i;
- ASET (vector, i, make_number (XMARKER (w->pointm)->charpos)); ++i;
- ASET (vector, i, make_number (XMARKER (w->pointm)->bytepos)); ++i;
+ ASET (vector, i, make_number (marker_position (w->pointm))); ++i;
+ ASET (vector, i, make_number (marker_byte_position (w->pointm))); ++i;
}
else
{
max_height = total_height / 4;
/* Correct that max. height if it's bogus. */
- max_height = max (1, max_height);
- max_height = min (total_height, max_height);
+ max_height = clip_to_bounds (1, max_height, total_height);
/* Find out the height of the text in the window. */
if (it.line_wrap == TRUNCATE)
{
if (f->resized_p)
{
- Fredraw_frame (frame);
+ redraw_frame (f);
f->force_flush_display_p = 1;
}
clear_current_matrices (f);
#endif /* HAVE_WINDOW_SYSTEM */
/* Redraw garbaged frames. */
- if (frame_garbaged)
- clear_garbaged_frames ();
+ clear_garbaged_frames ();
if (!NILP (echo_area_buffer[0]) || minibuf_level == 0)
{
return window_height_changed_p;
}
+/* Nonzero if the current window's buffer is shown in more than one
+ window and was modified since last redisplay. */
+
+static int
+buffer_shared_and_changed (void)
+{
+ return (buffer_window_count (current_buffer) > 1
+ && UNCHANGED_MODIFIED < MODIFF);
+}
+
+/* Nonzero if W doesn't reflect the actual state of current buffer due
+ to its text or overlays change. FIXME: this may be called when
+ XBUFFER (w->buffer) != current_buffer, which looks suspicious. */
+
+static int
+window_outdated (struct window *w)
+{
+ return (w->last_modified < MODIFF
+ || w->last_overlay_modified < OVERLAY_MODIFF);
+}
+
+/* Nonzero if W's buffer was changed but not saved or Transient Mark mode
+ is enabled and mark of W's buffer was changed since last W's update. */
+
+static int
+window_buffer_changed (struct window *w)
+{
+ struct buffer *b = XBUFFER (w->buffer);
+
+ eassert (BUFFER_LIVE_P (b));
+
+ return (((BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) != w->last_had_star)
+ || ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (b, mark_active)))
+ != !NILP (w->region_showing)));
+}
+
+/* Nonzero if W has %c in its mode line and mode line should be updated. */
+
+static int
+mode_line_update_needed (struct window *w)
+{
+ return (!NILP (w->column_number_displayed)
+ && !(PT == w->last_point && !window_outdated (w))
+ && (XFASTINT (w->column_number_displayed) != current_column ()));
+}
-\f
/***********************************************************************
Mode Lines and Frame Titles
***********************************************************************/
|| f->explicit_name)
{
/* Do we have more than one visible frame on this X display? */
- Lisp_Object tail;
- Lisp_Object fmt;
+ Lisp_Object tail, other_frame, fmt;
ptrdiff_t title_start;
char *title;
ptrdiff_t len;
struct it it;
ptrdiff_t count = SPECPDL_INDEX ();
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, other_frame)
{
- Lisp_Object other_frame = XCAR (tail);
struct frame *tf = XFRAME (other_frame);
if (tf != f
/* Update the menu bar item lists, if appropriate. This has to be
done before any actual redisplay or generation of display lines. */
all_windows = (update_mode_lines
- || buffer_shared > 1
+ || buffer_shared_and_changed ()
|| windows_or_buffers_changed);
if (all_windows)
{
/* This used to test w->update_mode_line, but we believe
there is no need to recompute the menu in that case. */
|| update_mode_lines
- || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
- < BUF_MODIFF (XBUFFER (w->buffer)))
- != w->last_had_star)
- || ((!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
- != !NILP (w->region_showing)))
+ || window_buffer_changed (w))
{
struct buffer *prev = current_buffer;
ptrdiff_t count = SPECPDL_INDEX ();
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
+ when `norecord' is set. */
static Lisp_Object
-update_tool_bar_unwind (Lisp_Object frame)
+fast_set_selected_frame (Lisp_Object frame)
{
- selected_frame = frame;
+ if (!EQ (selected_frame, frame))
+ {
+ selected_frame = frame;
+ selected_window = XFRAME (frame)->selected_window;
+ }
return Qnil;
}
if (windows_or_buffers_changed
|| w->update_mode_line
|| update_mode_lines
- || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
- < BUF_MODIFF (XBUFFER (w->buffer)))
- != w->last_had_star)
- || ((!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
- != !NILP (w->region_showing)))
+ || window_buffer_changed (w))
{
struct buffer *prev = current_buffer;
ptrdiff_t count = SPECPDL_INDEX ();
before calling tool_bar_items, because the calculation of
the tool-bar keymap uses the selected frame (see
`tool-bar-make-keymap' in tool-bar.el). */
- record_unwind_protect (update_tool_bar_unwind, selected_frame);
+ eassert (EQ (selected_window,
+ /* Since we only explicitly preserve selected_frame,
+ check that selected_window would be redundant. */
+ XFRAME (selected_frame)->selected_window));
+ record_unwind_protect (fast_set_selected_frame, selected_frame);
XSETFRAME (frame, f);
- selected_frame = frame;
+ fast_set_selected_frame (frame);
/* Build desired tool-bar items from keymaps. */
new_tool_bar
DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
0, 1, 0,
- doc: /* Return the number of lines occupied by the tool bar of FRAME. */)
+ doc: /* Return the number of lines occupied by the tool bar of FRAME.
+If FRAME is nil or omitted, use the selected frame. */)
(Lisp_Object frame)
{
- struct frame *f;
+ struct frame *f = decode_any_frame (frame);
struct window *w;
int nlines = 0;
- if (NILP (frame))
- frame = selected_frame;
- else
- CHECK_FRAME (frame);
- f = XFRAME (frame);
-
if (WINDOWP (f->tool_bar_window)
&& (w = XWINDOW (f->tool_bar_window),
WINDOW_TOTAL_LINES (w) > 0))
{
/* Show item in pressed state. */
show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
- hlinfo->mouse_face_image_state = DRAW_IMAGE_SUNKEN;
last_tool_bar_item = prop_idx;
}
else
/* Show item in released state. */
show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
- hlinfo->mouse_face_image_state = DRAW_IMAGE_RAISED;
key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY);
&& last_tool_bar_item != prop_idx)
return;
- hlinfo->mouse_face_image_state = DRAW_NORMAL_TEXT;
draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
/* If tool-bar item is not enabled, don't highlight it. */
/* Display it as active. */
show_mouse_face (hlinfo, draw);
- hlinfo->mouse_face_image_state = draw;
}
set_help_echo:
if (w == XWINDOW (selected_window))
pt = PT;
else
- {
- pt = marker_position (w->pointm);
- pt = max (BEGV, pt);
- pt = min (ZV, pt);
- }
+ pt = clip_to_bounds (BEGV, marker_position (w->pointm), ZV);
/* Move iterator to pt starting at cursor_row->start in
a line with infinite width. */
int unchanged_p = 1;
/* If text or overlays have changed, see where. */
- if (w->last_modified < MODIFF
- || w->last_overlay_modified < OVERLAY_MODIFF)
+ if (window_outdated (w))
{
/* Gap in the line? */
if (GPT < start || Z - GPT < end)
}
\f
-/* Select FRAME to forward the values of frame-local variables into C
- variables so that the redisplay routines can access those values
- directly. */
-
-static void
-select_frame_for_redisplay (Lisp_Object frame)
-{
- Lisp_Object tail, tem;
- Lisp_Object old = selected_frame;
- struct Lisp_Symbol *sym;
-
- eassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame)));
-
- selected_frame = frame;
-
- do {
- for (tail = XFRAME (frame)->param_alist;
- CONSP (tail); tail = XCDR (tail))
- if (CONSP (XCAR (tail))
- && (tem = XCAR (XCAR (tail)),
- SYMBOLP (tem))
- && (sym = indirect_variable (XSYMBOL (tem)),
- sym->redirect == SYMBOL_LOCALIZED)
- && sym->val.blv->frame_local)
- /* Use find_symbol_value rather than Fsymbol_value
- to avoid an error if it is void. */
- find_symbol_value (tem);
- } while (!EQ (frame, old) && (frame = old, 1));
-}
-
-
#define STOP_POLLING \
do { if (! polling_stopped_here) stop_polling (); \
polling_stopped_here = 1; } while (0)
ptrdiff_t count, count1;
struct frame *sf;
int polling_stopped_here = 0;
- Lisp_Object old_frame = selected_frame;
+ Lisp_Object tail, frame;
struct backtrace backtrace;
/* Non-zero means redisplay has to consider all windows on all
backtrace.debug_on_exit = 0;
backtrace_list = &backtrace;
- {
- Lisp_Object tail, frame;
-
- FOR_EACH_FRAME (tail, frame)
- {
- struct frame *f = XFRAME (frame);
- f->already_hscrolled_p = 0;
- }
- }
+ FOR_EACH_FRAME (tail, frame)
+ XFRAME (frame)->already_hscrolled_p = 0;
retry:
/* Remember the currently selected window. */
sw = w;
- if (!EQ (old_frame, selected_frame)
- && FRAME_LIVE_P (XFRAME (old_frame)))
- /* When running redisplay, we play a bit fast-and-loose and allow e.g.
- selected_frame and selected_window to be temporarily out-of-sync so
- when we come back here via `goto retry', we need to resync because we
- may need to run Elisp code (via prepare_menu_bars). */
- select_frame_for_redisplay (old_frame);
-
pending = 0;
reconsider_clip_changes (w, current_buffer);
last_escape_glyph_frame = NULL;
FRAME_TTY (sf)->previous_frame = sf;
}
- /* Set the visible flags for all frames. Do this before checking
- for resized or garbaged frames; they want to know if their frames
- are visible. See the comment in frame.h for
- FRAME_SAMPLE_VISIBILITY. */
- {
- Lisp_Object tail, frame;
-
- number_of_visible_frames = 0;
+ /* Set the visible flags for all frames. Do this before checking for
+ resized or garbaged frames; they want to know if their frames are
+ visible. See the comment in frame.h for FRAME_SAMPLE_VISIBILITY. */
+ number_of_visible_frames = 0;
- FOR_EACH_FRAME (tail, frame)
- {
- struct frame *f = XFRAME (frame);
+ FOR_EACH_FRAME (tail, frame)
+ {
+ struct frame *f = XFRAME (frame);
- FRAME_SAMPLE_VISIBILITY (f);
- if (FRAME_VISIBLE_P (f))
- ++number_of_visible_frames;
- clear_desired_matrices (f);
- }
- }
+ FRAME_SAMPLE_VISIBILITY (f);
+ if (FRAME_VISIBLE_P (f))
+ ++number_of_visible_frames;
+ clear_desired_matrices (f);
+ }
/* Notice any pending interrupt request to change frame size. */
do_pending_window_change (1);
}
/* Clear frames marked as garbaged. */
- if (frame_garbaged)
- clear_garbaged_frames ();
+ clear_garbaged_frames ();
/* Build menubar and tool-bar items. */
if (NILP (Vmemory_full))
if ((SAVE_MODIFF < MODIFF) != w->last_had_star)
{
w->update_mode_line = 1;
- if (buffer_shared > 1)
+ if (buffer_shared_and_changed ())
update_mode_lines++;
}
count1 = SPECPDL_INDEX ();
specbind (Qinhibit_point_motion_hooks, Qt);
- /* If %c is in the mode line, update it if needed. */
- if (!NILP (w->column_number_displayed)
- /* This alternative quickly identifies a common case
- where no change is needed. */
- && !(PT == w->last_point
- && w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF)
- && (XFASTINT (w->column_number_displayed) != current_column ()))
+ if (mode_line_update_needed (w))
w->update_mode_line = 1;
unbind_to (count1, Qnil);
FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1;
- /* The variable buffer_shared is set in redisplay_window and
- indicates that we redisplay a buffer in different windows. See
- there. */
- consider_all_windows_p = (update_mode_lines || buffer_shared > 1
+ consider_all_windows_p = (update_mode_lines
+ || buffer_shared_and_changed ()
|| cursor_type_changed);
/* If specs for an arrow have changed, do thorough redisplay
/* If window configuration was changed, frames may have been
marked garbaged. Clear them or we will experience
surprises wrt scrolling. */
- if (frame_garbaged)
- clear_garbaged_frames ();
+ clear_garbaged_frames ();
}
}
else if (EQ (selected_window, minibuf_window)
- && (current_buffer->clip_changed
- || w->last_modified < MODIFF
- || w->last_overlay_modified < OVERLAY_MODIFF)
+ && (current_buffer->clip_changed || window_outdated (w))
&& resize_mini_window (w, 0))
{
/* Resized active mini-window to fit the size of what it is
showing if its contents might have changed. */
must_finish = 1;
-/* FIXME: this causes all frames to be updated, which seems unnecessary
- since only the current frame needs to be considered. This function needs
- to be rewritten with two variables, consider_all_windows and
- consider_all_frames. */
+ /* FIXME: this causes all frames to be updated, which seems unnecessary
+ since only the current frame needs to be considered. This function
+ needs to be rewritten with two variables, consider_all_windows and
+ consider_all_frames. */
consider_all_windows_p = 1;
++windows_or_buffers_changed;
++update_mode_lines;
/* If window configuration was changed, frames may have been
marked garbaged. Clear them or we will experience
surprises wrt scrolling. */
- if (frame_garbaged)
- clear_garbaged_frames ();
+ clear_garbaged_frames ();
}
|| FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n'))
/* Former continuation line has disappeared by becoming empty. */
goto cancel;
- else if (w->last_modified < MODIFF
- || w->last_overlay_modified < OVERLAY_MODIFF
- || MINI_WINDOW_P (w))
+ else if (window_outdated (w) || MINI_WINDOW_P (w))
{
/* We have to handle the case of continuation around a
wide-column character (see the comment in indent.c around
}
CHARPOS (this_line_start_pos) = 0;
- consider_all_windows_p |= buffer_shared > 1;
+ consider_all_windows_p |= buffer_shared_and_changed ();
++clear_face_cache_count;
#ifdef HAVE_WINDOW_SYSTEM
++clear_image_cache_count;
if (consider_all_windows_p)
{
- Lisp_Object tail, frame;
-
FOR_EACH_FRAME (tail, frame)
XFRAME (frame)->updated_p = 0;
- /* Recompute # windows showing selected buffer. This will be
- incremented each time such a window is displayed. */
- buffer_shared = 0;
-
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
{
- if (! EQ (frame, selected_frame))
- /* Select the frame, for the sake of frame-local
- variables. */
- select_frame_for_redisplay (frame);
-
/* Mark all the scroll bars to be removed; we'll redeem
the ones we want when we redisplay their windows. */
if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
}
}
- if (!EQ (old_frame, selected_frame)
- && FRAME_LIVE_P (XFRAME (old_frame)))
- /* We played a bit fast-and-loose above and allowed selected_frame
- and selected_window to be temporarily out-of-sync but let's make
- sure this stays contained. */
- select_frame_for_redisplay (old_frame);
- eassert (EQ (XFRAME (selected_frame)->selected_window,
- selected_window));
+ eassert (EQ (XFRAME (selected_frame)->selected_window, selected_window));
if (!pending)
{
frames here explicitly. */
if (!pending)
{
- Lisp_Object tail, frame;
int new_count = 0;
FOR_EACH_FRAME (tail, frame)
/* Function registered with record_unwind_protect in redisplay_internal.
- Clear redisplaying_p. Also, select the previously
- selected frame, unless it has been deleted (by an X connection
- failure during redisplay, for example). */
+ Clear redisplaying_p. Also select the previously selected frame. */
static Lisp_Object
unwind_redisplay (Lisp_Object old_frame)
{
redisplaying_p = 0;
- if (! EQ (old_frame, selected_frame)
- && FRAME_LIVE_P (XFRAME (old_frame)))
- select_frame_for_redisplay (old_frame);
return Qnil;
}
{
struct buffer *b = XBUFFER (w->buffer);
- w->last_modified = accurate_p ? BUF_MODIFF(b) : 0;
- w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0;
+ w->last_modified = accurate_p ? BUF_MODIFF (b) : 0;
+ w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF (b) : 0;
w->last_had_star
= BUF_MODIFF (b) > BUF_SAVE_MODIFF (b);
if (w == XWINDOW (selected_window))
w->last_point = BUF_PT (b);
else
- w->last_point = XMARKER (w->pointm)->charpos;
+ w->last_point = marker_position (w->pointm);
}
}
/* Can't use this case if highlighting a region. When a
region exists, cursor movement has to do more than just
set the cursor. */
- && !(!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (current_buffer, mark_active)))
+ && markpos_of_region () < 0
&& NILP (w->region_showing)
&& NILP (Vshow_trailing_whitespace)
/* This code is not used for mini-buffer for the sake of the case
= (!NILP (w->window_end_valid)
&& !current_buffer->clip_changed
&& !current_buffer->prevent_redisplay_optimizations_p
- && w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF);
+ && !window_outdated (w));
/* Run the window-bottom-change-functions
if it is possible that the text on the screen has changed
buffer_unchanged_p
= (!NILP (w->window_end_valid)
&& !current_buffer->clip_changed
- && w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF);
+ && !window_outdated (w));
/* When windows_or_buffers_changed is non-zero, we can't rely on
the window end being valid, so set it to nil there. */
if (BYTEPOS (opoint) < CHARPOS (opoint))
emacs_abort ();
- /* If %c is in mode line, update it if needed. */
- if (!NILP (w->column_number_displayed)
- /* This alternative quickly identifies a common case
- where no change is needed. */
- && !(PT == w->last_point
- && w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF)
- && (XFASTINT (w->column_number_displayed) != current_column ()))
+ if (mode_line_update_needed (w))
update_mode_line = 1;
- /* Count number of windows showing the selected buffer. An indirect
- buffer counts as its base buffer. */
- if (!just_this_one_p)
- {
- struct buffer *current_base, *window_base;
- current_base = current_buffer;
- window_base = XBUFFER (XWINDOW (selected_window)->buffer);
- if (current_base->base_buffer)
- current_base = current_base->base_buffer;
- if (window_base->base_buffer)
- window_base = window_base->base_buffer;
- if (current_base == window_base)
- buffer_shared++;
- }
-
/* Point refers normally to the selected window. For any other
window, set up appropriate value. */
if (!EQ (window, selected_window))
{
- ptrdiff_t new_pt = XMARKER (w->pointm)->charpos;
+ ptrdiff_t new_pt = marker_position (w->pointm);
ptrdiff_t new_pt_byte = marker_byte_position (w->pointm);
if (new_pt < BEGV)
{
Move it back to a fully-visible line. */
new_vpos = window_box_height (w);
}
+ else if (w->cursor.vpos >=0)
+ {
+ /* Some people insist on not letting point enter the scroll
+ margin, even though this part handles windows that didn't
+ scroll at all. */
+ int margin = min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4);
+ int pixel_margin = margin * FRAME_LINE_HEIGHT (f);
+ bool header_line = WINDOW_WANTS_HEADER_LINE_P (w);
+
+ /* Note: We add an extra FRAME_LINE_HEIGHT, because the loop
+ below, which finds the row to move point to, advances by
+ the Y coordinate of the _next_ row, see the definition of
+ MATRIX_ROW_BOTTOM_Y. */
+ if (w->cursor.vpos < margin + header_line)
+ new_vpos
+ = pixel_margin + (header_line
+ ? CURRENT_HEADER_LINE_HEIGHT (w)
+ : 0) + FRAME_LINE_HEIGHT (f);
+ else
+ {
+ int window_height = window_box_height (w);
+
+ if (header_line)
+ window_height += CURRENT_HEADER_LINE_HEIGHT (w);
+ if (w->cursor.y >= window_height - pixel_margin)
+ new_vpos = window_height - pixel_margin;
+ }
+ }
/* If we need to move point for either of the above reasons,
now actually do it. */
/* If we are highlighting the region, then we just changed
the region, so redisplay to show it. */
- if (!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (current_buffer, mark_active)))
+ if (0 <= markpos_of_region ())
{
clear_glyph_matrix (w->desired_matrix);
if (!try_window (window, startp, 0))
&& (CHARPOS (startp) < ZV
/* Avoid starting at end of buffer. */
|| CHARPOS (startp) == BEGV
- || (w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF)))
+ || !window_outdated (w)))
{
int d1, d2, d3, d4, d5, d6;
return 0;
/* Can't do this if region may have changed. */
- if ((!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (current_buffer, mark_active)))
+ if (0 <= markpos_of_region ()
|| !NILP (w->region_showing)
|| !NILP (Vshow_trailing_whitespace))
return 0;
/* Can't use this if highlighting a region because a cursor movement
will do more than just set the cursor. */
- if (!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (current_buffer, mark_active)))
+ if (0 <= markpos_of_region ())
GIVE_UP (9);
/* Likewise if highlighting trailing whitespace. */
int saved_char_to_display = it->char_to_display;
int saved_x = it->current_x;
int saved_face_id = it->face_id;
+ int saved_box_end = it->end_of_box_run_p;
struct text_pos saved_pos;
Lisp_Object saved_object;
struct face *face;
it->face_id = it->saved_face_id;
face = FACE_FROM_ID (it->f, it->face_id);
it->face_id = FACE_FOR_CHAR (it->f, face, 0, -1, Qnil);
+ /* In R2L rows, we will prepend a stretch glyph that will
+ have the end_of_box_run_p flag set for it, so there's no
+ need for the appended newline glyph to have that flag
+ set. */
+ if (it->glyph_row->reversed_p
+ /* But if the appended newline glyph goes all the way to
+ the end of the row, there will be no stretch glyph,
+ so leave the box flag set. */
+ && saved_x + FRAME_COLUMN_WIDTH (it->f) < it->last_visible_x)
+ it->end_of_box_run_p = 0;
PRODUCE_GLYPHS (it);
it->len = saved_len;
it->c = saved_c;
it->char_to_display = saved_char_to_display;
+ it->end_of_box_run_p = saved_box_end;
return 1;
}
}
struct glyph *g;
int row_width, stretch_ascent, stretch_width;
struct text_pos saved_pos;
- int saved_face_id, saved_avoid_cursor;
+ int saved_face_id, saved_avoid_cursor, saved_box_start;
for (row_width = 0, g = row_start; g < row_end; g++)
row_width += g->pixel_width;
saved_avoid_cursor = it->avoid_cursor_p;
it->avoid_cursor_p = 1;
saved_face_id = it->face_id;
+ saved_box_start = it->start_of_box_run_p;
/* The last row's stretch glyph should get the default
face, to avoid painting the rest of the window with
the region face, if the region ends at ZV. */
it->face_id = default_face->id;
else
it->face_id = face->id;
+ it->start_of_box_run_p = 0;
append_stretch_glyph (it, make_number (0), stretch_width,
it->ascent + it->descent, stretch_ascent);
it->position = saved_pos;
it->avoid_cursor_p = saved_avoid_cursor;
it->face_id = saved_face_id;
+ it->start_of_box_run_p = saved_box_start;
}
}
#endif /* HAVE_WINDOW_SYSTEM */
static int
display_mode_lines (struct window *w)
{
- Lisp_Object old_selected_window, old_selected_frame;
+ Lisp_Object old_selected_window = selected_window;
+ Lisp_Object old_selected_frame = selected_frame;
+ Lisp_Object new_frame = w->frame;
+ Lisp_Object old_frame_selected_window = XFRAME (new_frame)->selected_window;
int n = 0;
- old_selected_frame = selected_frame;
- selected_frame = w->frame;
- old_selected_window = selected_window;
+ selected_frame = new_frame;
+ /* FIXME: If we were to allow the mode-line's computation changing the buffer
+ or window's point, then we'd need select_window_1 here as well. */
XSETWINDOW (selected_window, w);
+ XFRAME (new_frame)->selected_window = selected_window;
/* These will be set while the mode line specs are processed. */
line_number_displayed = 0;
++n;
}
+ XFRAME (new_frame)->selected_window = old_frame_selected_window;
selected_frame = old_selected_frame;
selected_window = old_selected_window;
return n;
Lisp_Object str;
int string_start = 0;
- if (NILP (window))
- window = selected_window;
- CHECK_WINDOW (window);
- w = XWINDOW (window);
+ w = decode_any_window (window);
+ XSETWINDOW (window, w);
if (NILP (buffer))
buffer = w->buffer;
and set that to nil so that we don't alter the outer value. */
record_unwind_protect (unwind_format_mode_line,
format_mode_line_unwind_data
- (XFRAME (WINDOW_FRAME (XWINDOW (window))),
+ (XFRAME (WINDOW_FRAME (w)),
old_buffer, selected_window, 1));
mode_line_proptrans_alist = Qnil;
register int i;
/* Let lots_of_dashes be a string of infinite length. */
- if (mode_line_target == MODE_LINE_NOPROP ||
- mode_line_target == MODE_LINE_STRING)
+ if (mode_line_target == MODE_LINE_NOPROP
+ || mode_line_target == MODE_LINE_STRING)
return "--";
if (field_width <= 0
|| field_width > sizeof (lots_of_dashes))
if (mode_line_target == MODE_LINE_TITLE)
return "";
- startpos = XMARKER (w->start)->charpos;
+ startpos = marker_position (w->start);
startpos_byte = marker_byte_position (w->start);
height = WINDOW_TOTAL_LINES (w);
/* Let's rather be paranoid than getting a SEGV. */
end = min (end, row->used[area]);
- start = max (0, start);
- start = min (end, start);
+ start = clip_to_bounds (0, start, end);
/* Translate X to frame coordinates. Set last_x to the right
end of the drawing area. */
glyph->type = CHAR_GLYPH;
glyph->avoid_cursor_p = it->avoid_cursor_p;
glyph->multibyte_p = it->multibyte_p;
- glyph->left_box_line_p = it->start_of_box_run_p;
- glyph->right_box_line_p = it->end_of_box_run_p;
+ if (it->glyph_row->reversed_p && area == TEXT_AREA)
+ {
+ /* In R2L rows, the left and the right box edges need to be
+ drawn in reverse direction. */
+ glyph->right_box_line_p = it->start_of_box_run_p;
+ glyph->left_box_line_p = it->end_of_box_run_p;
+ }
+ else
+ {
+ glyph->left_box_line_p = it->start_of_box_run_p;
+ glyph->right_box_line_p = it->end_of_box_run_p;
+ }
glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent
|| it->phys_descent > it->descent);
glyph->glyph_not_available_p = it->glyph_not_available_p;
}
glyph->avoid_cursor_p = it->avoid_cursor_p;
glyph->multibyte_p = it->multibyte_p;
- glyph->left_box_line_p = it->start_of_box_run_p;
- glyph->right_box_line_p = it->end_of_box_run_p;
+ if (it->glyph_row->reversed_p && area == TEXT_AREA)
+ {
+ /* In R2L rows, the left and the right box edges need to be
+ drawn in reverse direction. */
+ glyph->right_box_line_p = it->start_of_box_run_p;
+ glyph->left_box_line_p = it->end_of_box_run_p;
+ }
+ else
+ {
+ glyph->left_box_line_p = it->start_of_box_run_p;
+ glyph->right_box_line_p = it->end_of_box_run_p;
+ }
glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent
|| it->phys_descent > it->descent);
glyph->padding_p = 0;
glyph->type = IMAGE_GLYPH;
glyph->avoid_cursor_p = it->avoid_cursor_p;
glyph->multibyte_p = it->multibyte_p;
- glyph->left_box_line_p = it->start_of_box_run_p;
- glyph->right_box_line_p = it->end_of_box_run_p;
+ if (it->glyph_row->reversed_p && area == TEXT_AREA)
+ {
+ /* In R2L rows, the left and the right box edges need to be
+ drawn in reverse direction. */
+ glyph->right_box_line_p = it->start_of_box_run_p;
+ glyph->left_box_line_p = it->end_of_box_run_p;
+ }
+ else
+ {
+ glyph->left_box_line_p = it->start_of_box_run_p;
+ glyph->right_box_line_p = it->end_of_box_run_p;
+ }
glyph->overlaps_vertically_p = 0;
glyph->padding_p = 0;
glyph->glyph_not_available_p = 0;
glyph->type = STRETCH_GLYPH;
glyph->avoid_cursor_p = it->avoid_cursor_p;
glyph->multibyte_p = it->multibyte_p;
- glyph->left_box_line_p = it->start_of_box_run_p;
- glyph->right_box_line_p = it->end_of_box_run_p;
+ if (it->glyph_row->reversed_p && area == TEXT_AREA)
+ {
+ /* In R2L rows, the left and the right box edges need to be
+ drawn in reverse direction. */
+ glyph->right_box_line_p = it->start_of_box_run_p;
+ glyph->left_box_line_p = it->end_of_box_run_p;
+ }
+ else
+ {
+ glyph->left_box_line_p = it->start_of_box_run_p;
+ glyph->right_box_line_p = it->end_of_box_run_p;
+ }
glyph->overlaps_vertically_p = 0;
glyph->padding_p = 0;
glyph->glyph_not_available_p = 0;
glyph->slice.glyphless.lower_yoff = lower_yoff;
glyph->avoid_cursor_p = it->avoid_cursor_p;
glyph->multibyte_p = it->multibyte_p;
- glyph->left_box_line_p = it->start_of_box_run_p;
- glyph->right_box_line_p = it->end_of_box_run_p;
+ if (it->glyph_row->reversed_p && area == TEXT_AREA)
+ {
+ /* In R2L rows, the left and the right box edges need to be
+ drawn in reverse direction. */
+ glyph->right_box_line_p = it->start_of_box_run_p;
+ glyph->left_box_line_p = it->end_of_box_run_p;
+ }
+ else
+ {
+ glyph->left_box_line_p = it->start_of_box_run_p;
+ glyph->right_box_line_p = it->end_of_box_run_p;
+ }
glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent
|| it->phys_descent > it->descent);
glyph->padding_p = 0;
if (hlinfo->mouse_face_defer)
return;
- if (gc_in_progress)
- {
- hlinfo->mouse_face_deferred_gc = 1;
- return;
- }
-
/* Which window is that in? */
window = window_from_coordinates (f, x, y, &part, 1);
Lisp_Object Qnormal;
Lisp_Object Qbold;
static Lisp_Object Qline, Qwave;
-static Lisp_Object Qultra_light, Qreverse_oblique, Qreverse_italic;
Lisp_Object Qextra_light, Qlight;
Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold;
Lisp_Object Qoblique;
Lisp_Object Qitalic;
-static Lisp_Object Qultra_condensed, Qextra_condensed;
-Lisp_Object Qcondensed;
-static Lisp_Object Qsemi_condensed, Qsemi_expanded, Qextra_expanded;
-Lisp_Object Qexpanded;
-static Lisp_Object Qultra_expanded;
static Lisp_Object Qreleased_button, Qpressed_button;
static Lisp_Object QCstyle, QCcolor, QCline_width;
Lisp_Object Qunspecified; /* used in dosfns.c */
}
#endif /* HAVE_NS */
-/* If FRAME is nil, return a pointer to the selected frame.
- Otherwise, check that FRAME is a live frame, and return a pointer
- to it. NPARAM is the parameter number of FRAME, for
- CHECK_LIVE_FRAME. This is here because it's a frequent pattern in
- Lisp function definitions. */
-
-static struct frame *
-frame_or_selected_frame (Lisp_Object frame, int nparam)
-{
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
- return XFRAME (frame);
-}
-
-\f
/***********************************************************************
Frames and faces
***********************************************************************/
If FRAME is nil or omitted, use the selected frame. */)
(Lisp_Object color, Lisp_Object frame)
{
- struct frame *f;
-
CHECK_STRING (color);
- if (NILP (frame))
- frame = selected_frame;
- else
- CHECK_FRAME (frame);
- f = XFRAME (frame);
- return face_color_gray_p (f, SSDATA (color)) ? Qt : Qnil;
+ return (face_color_gray_p (decode_any_frame (frame), SSDATA (color))
+ ? Qt : Qnil);
}
COLOR must be a valid color name. */)
(Lisp_Object color, Lisp_Object frame, Lisp_Object background_p)
{
- struct frame *f;
-
CHECK_STRING (color);
- if (NILP (frame))
- frame = selected_frame;
- else
- CHECK_FRAME (frame);
- f = XFRAME (frame);
- if (face_color_supported_p (f, SSDATA (color), !NILP (background_p)))
- return Qt;
- return Qnil;
+ return (face_color_supported_p (decode_any_frame (frame),
+ SSDATA (color), !NILP (background_p))
+ ? Qt : Qnil);
}
/* We can't simply call check_x_frame because this function may be
called before any frame is created. */
- if (NILP (frame))
- frame = selected_frame;
- f = frame_or_selected_frame (frame, 2);
+ f = decode_live_frame (frame);
if (! FRAME_WINDOW_P (f))
{
/* Perhaps we have not yet created any frame. */
frame = Qnil;
face = Qnil;
}
+ else
+ XSETFRAME (frame, f);
/* Determine the width standard for comparison with the fonts we find. */
frames). If FRAME is omitted or nil, use the selected frame. */)
(Lisp_Object symbol, Lisp_Object keyword, Lisp_Object frame)
{
- Lisp_Object lface, value = Qnil;
+ struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame);
+ Lisp_Object lface = lface_from_face_name (f, symbol, 1), value = Qnil;
CHECK_SYMBOL (symbol);
CHECK_SYMBOL (keyword);
- if (EQ (frame, Qt))
- lface = lface_from_face_name (NULL, symbol, 1);
- else
- {
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- lface = lface_from_face_name (XFRAME (frame), symbol, 1);
- }
-
if (EQ (keyword, QCfamily))
value = LFACE_FAMILY (lface);
else if (EQ (keyword, QCfoundry))
}
else
{
- struct frame *f = frame_or_selected_frame (frame, 1);
+ struct frame *f = decode_live_frame (frame);
int face_id = lookup_named_face (f, face, 1);
struct face *fface = FACE_FROM_ID (f, face_id);
struct frame *f;
Lisp_Object lface1, lface2;
- if (EQ (frame, Qt))
- f = NULL;
- else
- /* Don't use check_x_frame here because this function is called
- before X frames exist. At that time, if FRAME is nil,
- selected_frame will be used which is the frame dumped with
- Emacs. That frame is not an X frame. */
- f = frame_or_selected_frame (frame, 2);
+ /* Don't use check_x_frame here because this function is called
+ before X frames exist. At that time, if FRAME is nil,
+ selected_frame will be used which is the frame dumped with
+ Emacs. That frame is not an X frame. */
+ f = EQ (frame, Qt) ? NULL : decode_live_frame (frame);
lface1 = lface_from_face_name (f, face1, 1);
lface2 = lface_from_face_name (f, face2, 1);
If FRAME is omitted or nil, use the selected frame. */)
(Lisp_Object face, Lisp_Object frame)
{
- struct frame *f;
- Lisp_Object lface;
+ struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame);
+ Lisp_Object lface = lface_from_face_name (f, face, 1);
int i;
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
-
- if (EQ (frame, Qt))
- lface = lface_from_face_name (NULL, face, 1);
- else
- lface = lface_from_face_name (f, face, 1);
-
for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
if (!UNSPECIFIEDP (AREF (lface, i)))
break;
For internal use only. */)
(Lisp_Object frame)
{
- struct frame *f = frame_or_selected_frame (frame, 0);
- return f->face_alist;
+ return decode_live_frame (frame)->face_alist;
}
If FRAME is unspecified or nil, the current frame is used. */)
(Lisp_Object color1, Lisp_Object color2, Lisp_Object frame)
{
- struct frame *f;
+ struct frame *f = decode_live_frame (frame);
XColor cdef1, cdef2;
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
-
if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1))
&& !(STRINGP (color1) && defined_color (f, SSDATA (color1), &cdef1, 0)))
signal_error ("Invalid color", color1);
{
if (STRINGP (val))
return 0; /* ttys can't use colored underlines */
+ else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))
+ return 0; /* ttys can't use wave underlines */
else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX]))
return 0; /* same as default */
else
else
{
/* Find any frame on DISPLAY. */
- Lisp_Object fl_tail;
+ Lisp_Object tail;
frame = Qnil;
- for (fl_tail = Vframe_list; CONSP (fl_tail); fl_tail = XCDR (fl_tail))
- {
- frame = XCAR (fl_tail);
- if (!NILP (Fequal (Fcdr (Fassq (Qdisplay,
- XFRAME (frame)->param_alist)),
- display)))
- break;
- }
+ FOR_EACH_FRAME (tail, frame)
+ if (!NILP (Fequal (Fcdr (Fassq (Qdisplay,
+ XFRAME (frame)->param_alist)),
+ display)))
+ break;
}
CHECK_LIVE_FRAME (frame);
DEFSYM (Qreleased_button, "released-button");
DEFSYM (Qpressed_button, "pressed-button");
DEFSYM (Qnormal, "normal");
- DEFSYM (Qultra_light, "ultra-light");
DEFSYM (Qextra_light, "extra-light");
DEFSYM (Qlight, "light");
DEFSYM (Qsemi_light, "semi-light");
DEFSYM (Qultra_bold, "ultra-bold");
DEFSYM (Qoblique, "oblique");
DEFSYM (Qitalic, "italic");
- DEFSYM (Qreverse_oblique, "reverse-oblique");
- DEFSYM (Qreverse_italic, "reverse-italic");
- DEFSYM (Qultra_condensed, "ultra-condensed");
- DEFSYM (Qextra_condensed, "extra-condensed");
- DEFSYM (Qcondensed, "condensed");
- DEFSYM (Qsemi_condensed, "semi-condensed");
- DEFSYM (Qsemi_expanded, "semi-expanded");
- DEFSYM (Qexpanded, "expanded");
- DEFSYM (Qextra_expanded, "extra-expanded");
- DEFSYM (Qultra_expanded, "ultra-expanded");
DEFSYM (Qbackground_color, "background-color");
DEFSYM (Qforeground_color, "foreground-color");
DEFSYM (Qunspecified, "unspecified");
FRAME_PTR
check_x_frame (Lisp_Object frame)
{
- FRAME_PTR f;
+ struct frame *f = decode_live_frame (frame);
- if (NILP (frame))
- frame = selected_frame;
- CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
if (! FRAME_X_P (f))
error ("Non-X frame used");
return f;
Lisp_Object tail, frame;
struct frame *f;
- if (wdesc == None) return 0;
+ if (wdesc == None)
+ return NULL;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- frame = XCAR (tail);
- if (!FRAMEP (frame))
- continue;
f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
continue;
x_any_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
{
Lisp_Object tail, frame;
- struct frame *f, *found;
+ struct frame *f, *found = NULL;
struct x_output *x;
- if (wdesc == None) return NULL;
+ if (wdesc == None)
+ return NULL;
- found = NULL;
- for (tail = Vframe_list; CONSP (tail) && !found; tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- frame = XCAR (tail);
- if (!FRAMEP (frame))
- continue;
-
+ if (found)
+ break;
f = XFRAME (frame);
if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo)
{
struct frame *f;
struct x_output *x;
- if (wdesc == None) return 0;
+ if (wdesc == None)
+ return NULL;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- frame = XCAR (tail);
- if (!FRAMEP (frame))
- continue;
f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
continue;
struct frame *f;
struct x_output *x;
- if (wdesc == None) return 0;
+ if (wdesc == None)
+ return NULL;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- frame = XCAR (tail);
- if (!FRAMEP (frame))
- continue;
f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
continue;
DEFUN ("x-wm-set-size-hint", Fx_wm_set_size_hint, Sx_wm_set_size_hint,
0, 1, 0,
doc: /* Send the size hints for frame FRAME to the window manager.
-If FRAME is nil, use the selected frame. */)
+If FRAME is omitted or nil, use the selected frame.
+Signal error if FRAME is not an X frame. */)
(Lisp_Object frame)
{
- struct frame *f;
- if (NILP (frame))
- frame = selected_frame;
- f = XFRAME (frame);
+ struct frame *f = check_x_frame (frame);
+
block_input ();
- if (FRAME_X_P (f))
- x_wm_set_size_hint (f, 0, 0);
+ x_wm_set_size_hint (f, 0, 0);
unblock_input ();
return Qnil;
}
XSETFRAME (frame, f);
- /* Note that X Windows does support scroll bars. */
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
-
f->terminal = dpyinfo->terminal;
f->output_method = output_x_window;
return FRAME_PIXEL_HEIGHT (f);
}
-int
-x_char_width (register struct frame *f)
-{
- return FRAME_COLUMN_WIDTH (f);
-}
-
-int
-x_char_height (register struct frame *f)
-{
- return FRAME_LINE_HEIGHT (f);
-}
-
-
-\f
/************************************************************************
X Displays
************************************************************************/
Finsert (1, &text);
set_buffer_internal_1 (old_buffer);
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
record_unwind_protect (unwind_create_tip_frame, frame);
f->terminal = dpyinfo->terminal;
ASET (font_object, FONT_FORMAT_INDEX,
ftfont_font_format (xftfont->pattern, filename));
font = XFONT_OBJECT (font_object);
- font->pixel_size = pixel_size;
+ font->pixel_size = size;
font->driver = &xftfont_driver;
font->encoding_charset = font->repertory_charset = -1;
xftfont_info->matrix.xy = 0x10000L * matrix->xy;
xftfont_info->matrix.yx = 0x10000L * matrix->yx;
}
- font->pixel_size = size;
- font->driver = &xftfont_driver;
if (INTEGERP (AREF (entity, FONT_SPACING_INDEX)))
spacing = XINT (AREF (entity, FONT_SPACING_INDEX));
else
Lisp_Object tail, frame;
FRAME_PTR f;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- frame = XCAR (tail);
- if (!FRAMEP (frame))
- continue;
f = XFRAME (frame);
if (!FRAME_WINDOW_P (f))
continue;
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
-#include <sys/stat.h>
#ifdef USE_MOTIF
/* For Vdouble_click_time. */
char *x_get_string_resource (XrmDatabase rdb, const char *name,
const char *class);
-static int file_p (const char *filename);
\f
/* X file search path processing. */
database associated with display.
(This is x_customization_string.)
- Return the expanded file name if it exists and is readable, and
+ Return the resource database if its file was read successfully, and
refers to %L only when the LANG environment variable is set, or
otherwise provided by X.
Return NULL otherwise. */
-static char *
-magic_file_p (const char *string, ptrdiff_t string_len, const char *class,
- const char *escaped_suffix)
+static XrmDatabase
+magic_db (const char *string, ptrdiff_t string_len, const char *class,
+ const char *escaped_suffix)
{
+ XrmDatabase db;
char *lang = getenv ("LANG");
ptrdiff_t path_size = 100;
}
path[path_len] = '\0';
-
- if (! file_p (path))
- {
- xfree (path);
- return NULL;
- }
-
- return path;
+ db = XrmGetFileDatabase (path);
+ xfree (path);
+ return db;
}
}
-static int
-file_p (const char *filename)
-{
- struct stat status;
-
- return (access (filename, 4) == 0 /* exists and is readable */
- && stat (filename, &status) == 0 /* get the status */
- && (S_ISDIR (status.st_mode)) == 0); /* not a directory */
-}
-
-
/* Find the first element of SEARCH_PATH which exists and is readable,
after expanding the %-escapes. Return 0 if we didn't find any, and
the path name of the one we found otherwise. */
-static char *
+static XrmDatabase
search_magic_path (const char *search_path, const char *class,
const char *escaped_suffix)
{
if (p > s)
{
- char *path = magic_file_p (s, p - s, class, escaped_suffix);
- if (path)
- return path;
+ XrmDatabase db = magic_db (s, p - s, class, escaped_suffix);
+ if (db)
+ return db;
}
else if (*p == ':')
{
- char *path;
-
- s = "%N%S";
- path = magic_file_p (s, strlen (s), class, escaped_suffix);
- if (path)
- return path;
+ static char const ns[] = "%N%S";
+ XrmDatabase db = magic_db (ns, strlen (ns), class, escaped_suffix);
+ if (db)
+ return db;
}
if (*p == ':')
static XrmDatabase
get_system_app (const char *class)
{
- XrmDatabase db = NULL;
const char *path;
- char *p;
path = getenv ("XFILESEARCHPATH");
if (! path) path = PATH_X_DEFAULTS;
- p = search_magic_path (path, class, 0);
- if (p)
- {
- db = XrmGetFileDatabase (p);
- xfree (p);
- }
-
- return db;
+ return search_magic_path (path, class, 0);
}
static XrmDatabase
get_user_app (const char *class)
{
+ XrmDatabase db = 0;
const char *path;
- char *file = 0;
- char *free_it = 0;
/* Check for XUSERFILESEARCHPATH. It is a path of complete file
names, not directories. */
- if (((path = getenv ("XUSERFILESEARCHPATH"))
- && (file = search_magic_path (path, class, 0)))
+ path = getenv ("XUSERFILESEARCHPATH");
+ if (path)
+ db = search_magic_path (path, class, 0);
+ if (! db)
+ {
/* Check for APPLRESDIR; it is a path of directories. In each,
we have to search for LANG/CLASS and then CLASS. */
- || ((path = getenv ("XAPPLRESDIR"))
- && ((file = search_magic_path (path, class, "/%L/%N"))
- || (file = search_magic_path (path, class, "/%N"))))
+ path = getenv ("XAPPLRESDIR");
+ if (path)
+ {
+ db = search_magic_path (path, class, "/%L/%N");
+ if (!db)
+ db = search_magic_path (path, class, "/%N");
+ }
+ }
+ if (! db)
+ {
/* Check in the home directory. This is a bit of a hack; let's
hope one's home directory doesn't contain any %-escapes. */
- || (free_it = gethomedir (),
- ((file = search_magic_path (free_it, class, "%L/%N"))
- || (file = search_magic_path (free_it, class, "%N")))))
- {
- XrmDatabase db = XrmGetFileDatabase (file);
- xfree (file);
- xfree (free_it);
- return db;
+ char *home = gethomedir ();
+ db = search_magic_path (home, class, "%L/%N");
+ if (! db)
+ db = search_magic_path (home, class, "%N");
+ xfree (home);
}
- xfree (free_it);
- return NULL;
+ return db;
}
static struct frame *
frame_for_x_selection (Lisp_Object object)
{
- Lisp_Object tail;
+ Lisp_Object tail, frame;
struct frame *f;
if (NILP (object))
if (FRAME_X_P (f) && FRAME_LIVE_P (f))
return f;
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- f = XFRAME (XCAR (tail));
+ f = XFRAME (frame);
if (FRAME_X_P (f) && FRAME_LIVE_P (f))
return f;
}
else if (TERMINALP (object))
{
struct terminal *t = get_terminal (object, 1);
+
if (t->type == output_x_window)
- {
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
- {
- f = XFRAME (XCAR (tail));
- if (FRAME_LIVE_P (f) && f->terminal == t)
- return f;
- }
- }
+ FOR_EACH_FRAME (tail, frame)
+ {
+ f = XFRAME (frame);
+ if (FRAME_LIVE_P (f) && f->terminal == t)
+ return f;
+ }
}
else if (FRAMEP (object))
{
XTframe_up_to_date (struct frame *f)
{
if (FRAME_X_P (f))
- {
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
-
- if (hlinfo->mouse_face_deferred_gc
- || f == hlinfo->mouse_face_mouse_frame)
- {
- block_input ();
- if (hlinfo->mouse_face_mouse_frame)
- note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
- hlinfo->mouse_face_mouse_x,
- hlinfo->mouse_face_mouse_y);
- hlinfo->mouse_face_deferred_gc = 0;
- unblock_input ();
- }
- }
+ FRAME_MOUSE_UPDATE (f);
}
x_frame_of_widget (Widget widget)
{
struct x_display_info *dpyinfo;
- Lisp_Object tail;
+ Lisp_Object tail, frame;
struct frame *f;
dpyinfo = x_display_info_for_display (XtDisplay (widget));
/* Look for a frame with that top-level widget. Allocate the color
on that frame to get the right gamma correction value. */
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
- if (FRAMEP (XCAR (tail))
- && (f = XFRAME (XCAR (tail)),
- (FRAME_X_P (f)
- && f->output_data.nothing != 1
- && FRAME_X_DISPLAY_INFO (f) == dpyinfo))
- && f->output_data.x->widget == widget)
- return f;
-
+ FOR_EACH_FRAME (tail, frame)
+ {
+ f = XFRAME (frame);
+ if (FRAME_X_P (f)
+ && f->output_data.nothing != 1
+ && FRAME_X_DISPLAY_INFO (f) == dpyinfo
+ && f->output_data.x->widget == widget)
+ return f;
+ }
emacs_abort ();
}
for (i = (width > 1 ? 1 : 0); i < width; ++i)
XDrawLine (dpy, window, gc,
- left_x + i, top_y + i, left_x + i, bottom_y - i + 1);
+ left_x + i, top_y + (i + 1) * top_p,
+ left_x + i, bottom_y + 1 - (i + 1) * bot_p);
}
XSetClipMask (dpy, gc, None);
XClearArea (dpy, window, right_x, bottom_y, 1, 1, False);
for (i = 0; i < width; ++i)
XDrawLine (dpy, window, gc,
- right_x - i, top_y + i + 1, right_x - i, bottom_y - i);
+ right_x - i, top_y + (i + 1) * top_p,
+ right_x - i, bottom_y + 1 - (i + 1) * bot_p);
}
XSetClipMask (dpy, gc, None);
nothing here for mouse-face. */
if (s->hl == DRAW_CURSOR)
{
- int relief = s->img->relief;
- if (relief < 0) relief = -relief;
+ int relief = eabs (s->img->relief);
XDrawRectangle (s->display, s->window, s->gc,
x - relief, y - relief,
s->slice.width + relief*2 - 1,
static void
x_draw_image_relief (struct glyph_string *s)
{
- int x0, y0, x1, y1, thick, raised_p;
- int extra_x, extra_y;
+ int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
XRectangle r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
raised_p = s->img->relief > 0;
}
- extra_x = extra_y = 0;
- if (s->face->id == TOOL_BAR_FACE_ID)
- {
- if (CONSP (Vtool_bar_button_margin)
- && INTEGERP (XCAR (Vtool_bar_button_margin))
- && INTEGERP (XCDR (Vtool_bar_button_margin)))
- {
- extra_x = XINT (XCAR (Vtool_bar_button_margin));
- extra_y = XINT (XCDR (Vtool_bar_button_margin));
- }
- else if (INTEGERP (Vtool_bar_button_margin))
- extra_x = extra_y = XINT (Vtool_bar_button_margin);
- }
+ x1 = x + s->slice.width - 1;
+ y1 = y + s->slice.height - 1;
+ top_p = bot_p = left_p = right_p = 0;
- x0 = x - thick - extra_x;
- y0 = y - thick - extra_y;
- x1 = x + s->slice.width + thick - 1 + extra_x;
- y1 = y + s->slice.height + thick - 1 + extra_y;
+ if (s->slice.x == 0)
+ x -= thick, left_p = 1;
+ if (s->slice.y == 0)
+ y -= thick, top_p = 1;
+ if (s->slice.x + s->slice.width == s->img->width)
+ x1 += thick, right_p = 1;
+ if (s->slice.y + s->slice.height == s->img->height)
+ y1 += thick, bot_p = 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
- x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
- s->slice.y == 0,
- s->slice.y + s->slice.height == s->img->height,
- s->slice.x == 0,
- s->slice.x + s->slice.width == s->img->width,
- &r);
+ x_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p,
+ top_p, bot_p, left_p, right_p, &r);
}
nothing here for mouse-face. */
if (s->hl == DRAW_CURSOR)
{
- int r = s->img->relief;
- if (r < 0) r = -r;
+ int r = eabs (s->img->relief);
XDrawRectangle (s->display, s->window, s->gc, x - r, y - r,
s->slice.width + r*2 - 1,
s->slice.height + r*2 - 1);
static struct scroll_bar *
x_window_to_scroll_bar (Display *display, Window window_id)
{
- Lisp_Object tail;
+ Lisp_Object tail, frame;
#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
window_id = (Window) xg_get_scroll_id_for_window (display, window_id);
#endif /* USE_GTK && USE_TOOLKIT_SCROLL_BARS */
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_FRAME (tail, frame)
{
- Lisp_Object frame, bar, condemned;
-
- frame = XCAR (tail);
- /* All elements of Vframe_list should be frames. */
- if (! FRAMEP (frame))
- emacs_abort ();
+ Lisp_Object bar, condemned;
if (! FRAME_X_P (XFRAME (frame)))
continue;
static Widget
x_window_to_menu_bar (Window window)
{
- Lisp_Object tail;
-
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
- {
- if (FRAME_X_P (XFRAME (XCAR (tail))))
- {
- Lisp_Object frame = XCAR (tail);
- Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget;
+ Lisp_Object tail, frame;
- if (menu_bar && xlwmenu_window_p (menu_bar, window))
- return menu_bar;
- }
- }
+ FOR_EACH_FRAME (tail, frame)
+ if (FRAME_X_P (XFRAME (frame)))
+ {
+ Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget;
+ if (menu_bar && xlwmenu_window_p (menu_bar, window))
+ return menu_bar;
+ }
return NULL;
}
/* 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 = shown * XM_SB_MAX;
- size = min (size, XM_SB_MAX);
- size = max (size, 1);
+ 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;
SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection;
SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
- inev.ie.frame_or_window = Qnil;
}
break;
SELECTION_EVENT_TARGET (&inev.sie) = eventp->target;
SELECTION_EVENT_PROPERTY (&inev.sie) = eventp->property;
SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
- inev.ie.frame_or_window = Qnil;
}
break;
FRAME_FONT (f) = font;
FRAME_BASELINE_OFFSET (f) = font->baseline_offset;
FRAME_COLUMN_WIDTH (f) = font->average_width;
- FRAME_SPACE_WIDTH (f) = font->space_width;
FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (font);
compute_fringe_widths (f, 1);
hlinfo->mouse_face_end_row
= hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_deferred_gc = 0;
hlinfo->mouse_face_mouse_frame = 0;
}
/* Emacs can only handle core input events, so make sure
Gtk doesn't use Xinput or Xinput2 extensions. */
- {
- static char fix_events[] = "GDK_CORE_DEVICE_EVENTS=1";
- putenv (fix_events);
- }
+ xputenv ("GDK_CORE_DEVICE_EVENTS=1");
/* Work around GLib bug that outputs a faulty warning. See
https://bugzilla.gnome.org/show_bug.cgi?id=563627. */
dpyinfo->bitmaps_last = 0;
dpyinfo->scratch_cursor_gc = 0;
hlinfo->mouse_face_mouse_frame = 0;
- hlinfo->mouse_face_deferred_gc = 0;
hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
DEFVAR_LISP ("x-keysym-table", Vx_keysym_table,
doc: /* Hash table of character codes indexed by X keysym codes. */);
- Vx_keysym_table = make_hash_table (Qeql, make_number (900),
+ Vx_keysym_table = make_hash_table (hashtest_eql, make_number (900),
make_float (DEFAULT_REHASH_SIZE),
make_float (DEFAULT_REHASH_THRESHOLD),
- Qnil, Qnil, Qnil);
+ Qnil);
}
#endif /* HAVE_X_WINDOWS */
GtkWidget *menubar_widget;
/* The tool bar in this frame */
GtkWidget *toolbar_widget;
- /* The handle box that makes the tool bar detachable. */
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
+/* The handle box that makes the tool bar detachable. */
GtkWidget *handlebox_widget;
- /* Non-zero if the tool bar is detached. */
- int toolbar_detached;
+#endif
/* Non-zero if tool bar is packed into the hbox widget (i.e. vertical). */
- int toolbar_in_hbox;
+ bool toolbar_in_hbox;
+ bool toolbar_is_packed;
/* The last size hints set. */
GdkGeometry size_hints;
value contains an ID of the fontset, else -1. */
int fontset;
- /* Pixel values used for various purposes.
- border_pixel may be -1 meaning use a gray tile. */
-#if 0 /* These are also defined in struct frame. Use that instead. */
- unsigned long background_pixel;
- unsigned long foreground_pixel;
-#endif
unsigned long cursor_pixel;
unsigned long border_pixel;
unsigned long mouse_pixel;
/* Nonzero means our parent is another application's window
and was explicitly specified. */
- char explicit_parent;
+ unsigned explicit_parent : 1;
/* Nonzero means tried already to make this frame visible. */
- char asked_for_visible;
+ unsigned asked_for_visible : 1;
/* Nonzero if this frame was ever previously visible. */
- char has_been_visible;
+ unsigned has_been_visible : 1;
#ifdef HAVE_X_I18N
/* Input context (currently, this means Compose key handler setup). */
int top_before_move;
/* Non-zero if _NET_WM_STATE_HIDDEN is set for this frame. */
- int net_wm_state_hidden_seen;
+ unsigned net_wm_state_hidden_seen : 1;
};
#define No_Cursor (None)
by this structure. */
/* For an event of kind SELECTION_REQUEST_EVENT,
- this structure really describes the contents.
- **Don't make this struct longer!**
- If it overlaps the frame_or_window field of struct input_event,
- that will cause GC to crash. */
+ this structure really describes the contents. */
+
struct selection_input_event
{
int kind;
-2012-12-26 Dmitry Gutov <dgutov@yandex.ru>
+2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
+
+ * automated/undo-tests.el: New file.
+
+2012-12-27 Dmitry Gutov <dgutov@yandex.ru>
* automated/ruby-mode-tests.el
(ruby-indent-after-block-in-continued-expression): New test.
+2012-12-14 Dmitry Gutov <dgutov@yandex.ru>
+
+ * automated/ruby-mode-tests.el
+ Rename one interpolation test; add three more.
+ (ruby-with-temp-buffer): New macro, use it where appropriate.
+ (ruby-add-log-current-method-examples): Use "_" for target point.
+ Add four new tests for ruby-add-log-current-method.
+
+2012-12-11 Glenn Morris <rgm@gnu.org>
+
+ * automated/f90.el (f90-test-bug13138): New test.
+
+2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
+
+ * automated/inotify-test.el: New test.
+
+2012-12-02 Chong Yidong <cyd@gnu.org>
+
+ * automated/ruby-mode-tests.el
+ (ruby-add-log-current-method-examples): Don't use loop macro, to
+ allow automated testing to work.
+
+2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * automated/advice-tests.el (advice-tests--data): Remove.
+ (advice-tests): Move the tests directly here instead.
+ Add called-interactively-p tests.
+
+2012-11-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * automated/ert-x-tests.el: Use cl-lib.
+ * automated/ert-tests.el: Use lexical-binding and cl-lib.
+
+2012-11-14 Dmitry Gutov <dgutov@yandex.ru>
+
+ * automated/ruby-mode-tests.el (ruby-indent-singleton-class): Pass.
+ (ruby-indent-inside-heredoc-after-operator)
+ (ruby-indent-inside-heredoc-after-space): New tests.
+ Change direct font-lock face references to var references.
+ (ruby-interpolation-suppresses-syntax-inside): New test.
+ (ruby-interpolation-inside-percent-literal-with-paren):
+ New failing test.
+
+2012-11-13 Dmitry Gutov <dgutov@yandex.ru>
+
+ * automated/ruby-mode-tests.el (ruby-heredoc-font-lock)
+ (ruby-singleton-class-no-heredoc-font-lock)
+ (ruby-add-log-current-method-examples): New tests.
+ (ruby-test-string): Extract from ruby-should-indent-buffer.
+ (ruby-deftest-move-to-block): New macro.
+ Add several move-to-block tests.
+
+2012-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * automated/advice-tests.el: New tests.
+
2012-10-14 Eli Zaretskii <eliz@gnu.org>
* automated/compile-tests.el (compile-tests--test-regexps-data):
--- /dev/null
+;;; advice-tests.el --- Test suite for the new advice thingy.
+
+;; Copyright (C) 2012-2013 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/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(ert-deftest advice-tests ()
+ "Test advice code."
+ (with-temp-buffer
+ (defun sm-test1 (x) (+ x 4))
+ (should (equal (sm-test1 6) 10))
+ (advice-add 'sm-test1 :around (lambda (f y) (* (funcall f y) 5)))
+ (should (equal (sm-test1 6) 50))
+ (defun sm-test1 (x) (+ x 14))
+ (should (equal (sm-test1 6) 100))
+ (should (equal (null (get 'sm-test1 'defalias-fset-function)) nil))
+ (advice-remove 'sm-test1 (lambda (f y) (* (funcall f y) 5)))
+ (should (equal (sm-test1 6) 20))
+ (should (equal (null (get 'sm-test1 'defalias-fset-function)) t))
+
+ (defun sm-test2 (x) (+ x 4))
+ (should (equal (sm-test2 6) 10))
+ (defadvice sm-test2 (around sm-test activate)
+ ad-do-it (setq ad-return-value (* ad-return-value 5)))
+ (should (equal (sm-test2 6) 50))
+ (ad-deactivate 'sm-test2)
+ (should (equal (sm-test2 6) 10))
+ (ad-activate 'sm-test2)
+ (should (equal (sm-test2 6) 50))
+ (defun sm-test2 (x) (+ x 14))
+ (should (equal (sm-test2 6) 100))
+ (should (equal (null (get 'sm-test2 'defalias-fset-function)) nil))
+ (ad-remove-advice 'sm-test2 'around 'sm-test)
+ (should (equal (sm-test2 6) 100))
+ (ad-activate 'sm-test2)
+ (should (equal (sm-test2 6) 20))
+ (should (equal (null (get 'sm-test2 'defalias-fset-function)) t))
+
+ (advice-add 'sm-test3 :around
+ (lambda (f &rest args) `(toto ,(apply f args)))
+ '((name . wrap-with-toto)))
+ (defmacro sm-test3 (x) `(call-test3 ,x))
+ (should (equal (macroexpand '(sm-test3 56)) '(toto (call-test3 56))))
+
+ (defadvice sm-test4 (around wrap-with-toto activate)
+ ad-do-it (setq ad-return-value `(toto ,ad-return-value)))
+ (defmacro sm-test4 (x) `(call-test4 ,x))
+ (should (equal (macroexpand '(sm-test4 56)) '(toto (call-test4 56))))
+ (defmacro sm-test4 (x) `(call-testq ,x))
+ (should (equal (macroexpand '(sm-test4 56)) '(toto (call-testq 56))))
+
+ ;; Combining old style and new style advices.
+ (defun sm-test5 (x) (+ x 4))
+ (should (equal (sm-test5 6) 10))
+ (advice-add 'sm-test5 :around (lambda (f y) (* (funcall f y) 5)))
+ (should (equal (sm-test5 6) 50))
+ (defadvice sm-test5 (around test activate)
+ ad-do-it (setq ad-return-value (+ ad-return-value 0.1)))
+ (should (equal (sm-test5 5) 45.1))
+ (ad-deactivate 'sm-test5)
+ (should (equal (sm-test5 6) 50))
+ (ad-activate 'sm-test5)
+ (should (equal (sm-test5 6) 50.1))
+ (defun sm-test5 (x) (+ x 14))
+ (should (equal (sm-test5 6) 100.1))
+ (advice-remove 'sm-test5 (lambda (f y) (* (funcall f y) 5)))
+ (should (equal (sm-test5 6) 20.1))
+
+ ;; This used to signal an error (bug#12858).
+ (autoload 'sm-test6 "foo")
+ (defadvice sm-test6 (around test activate)
+ ad-do-it)
+
+ ;; Check interaction between advice and called-interactively-p.
+ (defun sm-test7 (&optional x) (interactive) (+ (or x 7) 4))
+ (advice-add 'sm-test7 :around
+ (lambda (f &rest args)
+ (list (cons 1 (called-interactively-p)) (apply f args))))
+ (should (equal (sm-test7) '((1 . nil) 11)))
+ (should (equal (call-interactively 'sm-test7) '((1 . t) 11)))
+ (let ((smi 7))
+ (advice-add 'sm-test7 :before
+ (lambda (&rest args)
+ (setq smi (called-interactively-p))))
+ (should (equal (list (sm-test7) smi)
+ '(((1 . nil) 11) nil)))
+ (should (equal (list (call-interactively 'sm-test7) smi)
+ '(((1 . t) 11) t))))
+ (advice-add 'sm-test7 :around
+ (lambda (f &rest args)
+ (cons (cons 2 (called-interactively-p)) (apply f args))))
+ (should (equal (call-interactively 'sm-test7) '((2 . t) (1 . t) 11)))
+
+ ;; Check handling of interactive spec.
+ (defun sm-test8 (a) (interactive "p") a)
+ (defadvice sm-test8 (before adv1 activate) nil)
+ (defadvice sm-test8 (before adv2 activate) (interactive "P") nil)
+ (should (equal (interactive-form 'sm-test8) '(interactive "P")))
+ ))
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
+;;; advice-tests.el ends here.
-;;; ert-tests.el --- ERT's self-tests
+;;; ert-tests.el --- ERT's self-tests -*- lexical-binding: t -*-
;; Copyright (C) 2007-2008, 2010-2013 Free Software Foundation, Inc.
;;; Code:
(eval-when-compile
- (require 'cl))
+ (require 'cl-lib))
(require 'ert)
;; The buffer name chosen here should not compete with the default
;; results buffer name for completion in `switch-to-buffer'.
(let ((stats (ert-run-tests-interactively "^ert-" " *ert self-tests*")))
- (assert ert--test-body-was-run)
+ (cl-assert ert--test-body-was-run)
(if (zerop (ert-stats-completed-unexpected stats))
;; Hide results window only when everything went well.
(set-window-configuration window-configuration)
(ert-deftest ert-test-nested-test-body-runs ()
"Test that nested test bodies run."
- (lexical-let ((was-run nil))
+ (let ((was-run nil))
(let ((test (make-ert-test :body (lambda ()
(setq was-run t)))))
- (assert (not was-run))
+ (cl-assert (not was-run))
(ert-run-test test)
- (assert was-run))))
+ (cl-assert was-run))))
;;; Test that pass/fail works.
(ert-deftest ert-test-pass ()
(let ((test (make-ert-test :body (lambda ()))))
(let ((result (ert-run-test test)))
- (assert (ert-test-passed-p result)))))
+ (cl-assert (ert-test-passed-p result)))))
(ert-deftest ert-test-fail ()
(let ((test (make-ert-test :body (lambda () (ert-fail "failure message")))))
(let ((result (let ((ert-debug-on-error nil))
(ert-run-test test))))
- (assert (ert-test-failed-p result) t)
- (assert (equal (ert-test-result-with-condition-condition result)
+ (cl-assert (ert-test-failed-p result) t)
+ (cl-assert (equal (ert-test-result-with-condition-condition result)
'(ert-test-failed "failure message"))
t))))
(progn
(let ((ert-debug-on-error t))
(ert-run-test test))
- (assert nil))
+ (cl-assert nil))
((error)
- (assert (equal condition '(ert-test-failed "failure message")) t)))))
+ (cl-assert (equal condition '(ert-test-failed "failure message")) t)))))
(ert-deftest ert-test-fail-debug-with-debugger-1 ()
(let ((test (make-ert-test :body (lambda () (ert-fail "failure message")))))
- (let ((debugger (lambda (&rest debugger-args)
- (assert nil))))
+ (let ((debugger (lambda (&rest _args)
+ (cl-assert nil))))
(let ((ert-debug-on-error nil))
(ert-run-test test)))))
(ert-deftest ert-test-fail-debug-with-debugger-2 ()
(let ((test (make-ert-test :body (lambda () (ert-fail "failure message")))))
- (block nil
- (let ((debugger (lambda (&rest debugger-args)
- (return-from nil nil))))
+ (cl-block nil
+ (let ((debugger (lambda (&rest _args)
+ (cl-return-from nil nil))))
(let ((ert-debug-on-error t))
(ert-run-test test))
- (assert nil)))))
+ (cl-assert nil)))))
(ert-deftest ert-test-fail-debug-nested-with-debugger ()
(let ((test (make-ert-test :body (lambda ()
(let ((ert-debug-on-error t))
(ert-fail "failure message"))))))
- (let ((debugger (lambda (&rest debugger-args)
- (assert nil nil "Assertion a"))))
+ (let ((debugger (lambda (&rest _args)
+ (cl-assert nil nil "Assertion a"))))
(let ((ert-debug-on-error nil))
(ert-run-test test))))
(let ((test (make-ert-test :body (lambda ()
(let ((ert-debug-on-error nil))
(ert-fail "failure message"))))))
- (block nil
- (let ((debugger (lambda (&rest debugger-args)
- (return-from nil nil))))
+ (cl-block nil
+ (let ((debugger (lambda (&rest _args)
+ (cl-return-from nil nil))))
(let ((ert-debug-on-error t))
(ert-run-test test))
- (assert nil nil "Assertion b")))))
+ (cl-assert nil nil "Assertion b")))))
(ert-deftest ert-test-error ()
(let ((test (make-ert-test :body (lambda () (error "Error message")))))
(let ((result (let ((ert-debug-on-error nil))
(ert-run-test test))))
- (assert (ert-test-failed-p result) t)
- (assert (equal (ert-test-result-with-condition-condition result)
+ (cl-assert (ert-test-failed-p result) t)
+ (cl-assert (equal (ert-test-result-with-condition-condition result)
'(error "Error message"))
t))))
(progn
(let ((ert-debug-on-error t))
(ert-run-test test))
- (assert nil))
+ (cl-assert nil))
((error)
- (assert (equal condition '(error "Error message")) t)))))
+ (cl-assert (equal condition '(error "Error message")) t)))))
;;; Test that `should' works.
(let ((test (make-ert-test :body (lambda () (should nil)))))
(let ((result (let ((ert-debug-on-error nil))
(ert-run-test test))))
- (assert (ert-test-failed-p result) t)
- (assert (equal (ert-test-result-with-condition-condition result)
+ (cl-assert (ert-test-failed-p result) t)
+ (cl-assert (equal (ert-test-result-with-condition-condition result)
'(ert-test-failed ((should nil) :form nil :value nil)))
t)))
(let ((test (make-ert-test :body (lambda () (should t)))))
(let ((result (ert-run-test test)))
- (assert (ert-test-passed-p result) t))))
+ (cl-assert (ert-test-passed-p result) t))))
(ert-deftest ert-test-should-value ()
(should (eql (should 'foo) 'foo))
(let ((test (make-ert-test :body (lambda () (should-not t)))))
(let ((result (let ((ert-debug-on-error nil))
(ert-run-test test))))
- (assert (ert-test-failed-p result) t)
- (assert (equal (ert-test-result-with-condition-condition result)
+ (cl-assert (ert-test-failed-p result) t)
+ (cl-assert (equal (ert-test-result-with-condition-condition result)
'(ert-test-failed ((should-not t) :form t :value t)))
t)))
(let ((test (make-ert-test :body (lambda () (should-not nil)))))
(let ((result (ert-run-test test)))
- (assert (ert-test-passed-p result)))))
+ (cl-assert (ert-test-passed-p result)))))
+
(ert-deftest ert-test-should-with-macrolet ()
(let ((test (make-ert-test :body (lambda ()
- (macrolet ((foo () `(progn t nil)))
+ (cl-macrolet ((foo () `(progn t nil)))
(should (foo)))))))
(let ((result (let ((ert-debug-on-error nil))
(ert-run-test test))))
(ert-deftest ert-test-should-failure-debugging ()
"Test that `should' errors contain the information we expect them to."
- (loop for (body expected-condition) in
- `((,(lambda () (let ((x nil)) (should x)))
- (ert-test-failed ((should x) :form x :value nil)))
- (,(lambda () (let ((x t)) (should-not x)))
- (ert-test-failed ((should-not x) :form x :value t)))
- (,(lambda () (let ((x t)) (should (not x))))
- (ert-test-failed ((should (not x)) :form (not t) :value nil)))
- (,(lambda () (let ((x nil)) (should-not (not x))))
- (ert-test-failed ((should-not (not x)) :form (not nil) :value t)))
- (,(lambda () (let ((x t) (y nil)) (should-not
- (ert--test-my-list x y))))
- (ert-test-failed
- ((should-not (ert--test-my-list x y))
- :form (list t nil)
- :value (t nil))))
- (,(lambda () (let ((x t)) (should (error "Foo"))))
- (error "Foo")))
- do
- (let ((test (make-ert-test :body body)))
- (condition-case actual-condition
- (progn
- (let ((ert-debug-on-error t))
- (ert-run-test test))
- (assert nil))
- ((error)
- (should (equal actual-condition expected-condition)))))))
+ (cl-loop
+ for (body expected-condition) in
+ `((,(lambda () (let ((x nil)) (should x)))
+ (ert-test-failed ((should x) :form x :value nil)))
+ (,(lambda () (let ((x t)) (should-not x)))
+ (ert-test-failed ((should-not x) :form x :value t)))
+ (,(lambda () (let ((x t)) (should (not x))))
+ (ert-test-failed ((should (not x)) :form (not t) :value nil)))
+ (,(lambda () (let ((x nil)) (should-not (not x))))
+ (ert-test-failed ((should-not (not x)) :form (not nil) :value t)))
+ (,(lambda () (let ((x t) (y nil)) (should-not
+ (ert--test-my-list x y))))
+ (ert-test-failed
+ ((should-not (ert--test-my-list x y))
+ :form (list t nil)
+ :value (t nil))))
+ (,(lambda () (let ((_x t)) (should (error "Foo"))))
+ (error "Foo")))
+ do
+ (let ((test (make-ert-test :body body)))
+ (condition-case actual-condition
+ (progn
+ (let ((ert-debug-on-error t))
+ (ert-run-test test))
+ (cl-assert nil))
+ ((error)
+ (should (equal actual-condition expected-condition)))))))
(ert-deftest ert-test-deftest ()
(should (equal (macroexpand '(ert-deftest abc () "foo" :tags '(bar)))
(setf (cdr (last a)) (cddr a))
(should (not (ert--proper-list-p a))))
(let ((a (list 1 2 3 4)))
- (setf (cdr (last a)) (cdddr a))
+ (setf (cdr (last a)) (cl-cdddr a))
(should (not (ert--proper-list-p a)))))
(ert-deftest ert-test-parse-keys-and-body ()
(i 0))
(let ((result (ert--remove-if-not (lambda (x)
(should (eql x (nth i list)))
- (incf i)
+ (cl-incf i)
(member i '(2 3)))
list)))
(should (equal i 4))
(should (equal result '(b c)))
(should (equal list '(a b c d)))))
(should (equal '()
- (ert--remove-if-not (lambda (x) (should nil)) '()))))
+ (ert--remove-if-not (lambda (_x) (should nil)) '()))))
(ert-deftest ert-test-remove* ()
(let ((list (list 'a 'b 'c 'd))
(should (eql x (nth key-index list)))
(prog1
(list key-index x)
- (incf key-index)))
+ (cl-incf key-index)))
:test
(lambda (a b)
(should (eql a 'foo))
(should (equal b (list test-index
(nth test-index list))))
- (incf test-index)
+ (cl-incf test-index)
(member test-index '(2 3))))))
(should (equal key-index 4))
(should (equal test-index 4))
;;; Code:
(eval-when-compile
- (require 'cl))
+ (require 'cl-lib))
(require 'ert)
(require 'ert-x)
(should (equal (buffer-string) ""))
(let ((message-log-max 2))
(let ((message-log-max t))
- (loop for i below 4 do
- (message "%s" i))
+ (cl-loop for i below 4 do
+ (message "%s" i))
(should (equal (buffer-string) "0\n1\n2\n3\n")))
(should (equal (buffer-string) "0\n1\n2\n3\n"))
(message "")
(ert-deftest ert-test-force-message-log-buffer-truncation ()
:tags '(:causes-redisplay)
- (labels ((body ()
- (loop for i below 3 do
- (message "%s" i)))
- ;; Uses the implicit messages buffer truncation implemented
- ;; in Emacs' C core.
- (c (x)
- (ert-with-buffer-renamed ("*Messages*")
- (let ((message-log-max x))
- (body))
- (with-current-buffer "*Messages*"
- (buffer-string))))
- ;; Uses our lisp reimplementation.
- (lisp (x)
- (ert-with-buffer-renamed ("*Messages*")
- (let ((message-log-max t))
- (body))
- (let ((message-log-max x))
- (ert--force-message-log-buffer-truncation))
- (with-current-buffer "*Messages*"
- (buffer-string)))))
- (loop for x in '(0 1 2 3 4 t) do
- (should (equal (c x) (lisp x))))))
+ (cl-labels ((body ()
+ (cl-loop for i below 3 do
+ (message "%s" i)))
+ ;; Uses the implicit messages buffer truncation implemented
+ ;; in Emacs' C core.
+ (c (x)
+ (ert-with-buffer-renamed ("*Messages*")
+ (let ((message-log-max x))
+ (body))
+ (with-current-buffer "*Messages*"
+ (buffer-string))))
+ ;; Uses our lisp reimplementation.
+ (lisp (x)
+ (ert-with-buffer-renamed ("*Messages*")
+ (let ((message-log-max t))
+ (body))
+ (let ((message-log-max x))
+ (ert--force-message-log-buffer-truncation))
+ (with-current-buffer "*Messages*"
+ (buffer-string)))))
+ (cl-loop for x in '(0 1 2 3 4 t) do
+ (should (equal (c x) (lisp x))))))
(provide 'ert-x-tests)
(f90-indent-line)
(should (= 0 (current-indentation)))))
+(ert-deftest f90-test-bug13138 ()
+ "Test for http://debbugs.gnu.org/13138 ."
+ (with-temp-buffer
+ (f90-mode)
+ (insert "program prog
+ integer :: i = &
+#ifdef foo
+ & 1
+#else
+ & 2
+#endif
+
+ write(*,*) i
+end program prog")
+ (goto-char (point-min))
+ (forward-line 2)
+ (f90-indent-subprogram)
+ (should (= 0 (current-indentation)))))
;;; f90.el ends here
--- /dev/null
+;;; inotify-tests.el --- Test suite for inotify. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
+
+;; Author: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
+;; Keywords: internal
+;; Human-Keywords: internal
+
+;; 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/>.
+
+;;; Code:
+
+(require 'ert)
+
+(when (featurep 'inotify)
+
+ ;; (ert-deftest filewatch-file-watch-aspects-check ()
+ ;; "Test whether `file-watch' properly checks the aspects."
+ ;; (let ((temp-file (make-temp-file "filewatch-aspects")))
+ ;; (should (stringp temp-file))
+ ;; (should-error (file-watch temp-file 'wrong nil)
+ ;; :type 'error)
+ ;; (should-error (file-watch temp-file '(modify t) nil)
+ ;; :type 'error)
+ ;; (should-error (file-watch temp-file '(modify all-modify) nil)
+ ;; :type 'error)
+ ;; (should-error (file-watch temp-file '(access wrong modify) nil)
+ ;; :type 'error)))
+
+ (ert-deftest inotify-file-watch-simple ()
+ "Test if watching a normal file works."
+ (let ((temp-file (make-temp-file "inotify-simple"))
+ (events 0))
+ (let ((wd
+ (inotify-add-watch temp-file t (lambda (ev)
+ (setq events (1+ events))))))
+ (unwind-protect
+ (progn
+ (with-temp-file temp-file
+ (insert "Foo\n"))
+ (sit-for 5) ;; Hacky. Wait for 5s until events are processed
+ (should (> events 0)))
+ (inotify-rm-watch wd)))))
+)
+
+(provide 'inotify-tests)
+;;; inotify-tests.el ends here.
(defun ruby-should-indent (content column)
"Assert indentation COLUMN on the last line of CONTENT."
- (with-temp-buffer
- (insert content)
- (ruby-mode)
+ (ruby-with-temp-buffer content
(ruby-indent-line)
(should (= (current-indentation) column))))
"Assert that CONTENT turns into EXPECTED after the buffer is re-indented.
The whitespace before and including \"|\" on each line is removed."
- (with-temp-buffer
- (cl-flet ((fix-indent (s) (replace-regexp-in-string "^[ \t]*|" "" s)))
- (insert (fix-indent content))
- (ruby-mode)
- (indent-region (point-min) (point-max))
- (should (string= (fix-indent expected) (buffer-string))))))
+ (ruby-with-temp-buffer (ruby-test-string content)
+ (indent-region (point-min) (point-max))
+ (should (string= (ruby-test-string expected) (buffer-string)))))
+
+(defmacro ruby-with-temp-buffer (contents &rest body)
+ (declare (indent 1) (debug t))
+ `(with-temp-buffer
+ (insert ,contents)
+ (ruby-mode)
+ ,@body))
+
+(defun ruby-test-string (s &rest args)
+ (apply 'format (replace-regexp-in-string "^[ \t]*|" "" s) args))
(defun ruby-assert-state (content &rest values-plist)
"Assert syntax state values at the end of CONTENT.
VALUES-PLIST is a list with alternating index and value elements."
- (with-temp-buffer
- (insert content)
- (ruby-mode)
+ (ruby-with-temp-buffer content
(syntax-propertize (point))
(while values-plist
(should (eq (nth (car values-plist)
(setq values-plist (cddr values-plist)))))
(defun ruby-assert-face (content pos face)
- (with-temp-buffer
- (insert content)
- (ruby-mode)
+ (ruby-with-temp-buffer content
(font-lock-fontify-buffer)
(should (eq face (get-text-property pos 'face)))))
(ruby-assert-state "foo <<asd\n" 3 ?\n)
(ruby-assert-state "class <<asd\n" 3 nil))
+(ert-deftest ruby-heredoc-font-lock ()
+ (let ((s "foo <<eos.gsub('^ *', '')"))
+ (ruby-assert-face s 9 font-lock-string-face)
+ (ruby-assert-face s 10 nil)))
+
+(ert-deftest ruby-singleton-class-no-heredoc-font-lock ()
+ (ruby-assert-face "class<<a" 8 nil))
+
(ert-deftest ruby-deep-indent ()
(let ((ruby-deep-arglist nil)
(ruby-deep-indent-paren '(?\( ?\{ ?\[ ?\] t)))
|"))
(ert-deftest ruby-indent-singleton-class ()
- :expected-result :failed ; Doesn't work yet, when no space before "<<".
(ruby-should-indent-buffer
"class<<bar
| foo
| end
|"))
+(ert-deftest ruby-indent-inside-heredoc-after-operator ()
+ (ruby-should-indent-buffer
+ "b=<<eos
+ | 42"
+ "b=<<eos
+ | 42"))
+
+(ert-deftest ruby-indent-inside-heredoc-after-space ()
+ (ruby-should-indent-buffer
+ "foo <<eos.gsub(' ', '*')
+ | 42"
+ "foo <<eos.gsub(' ', '*')
+ | 42"))
+
(ert-deftest ruby-indent-array-literal ()
(let ((ruby-deep-indent-paren nil))
(ruby-should-indent-buffer
|statement"))
(ert-deftest ruby-move-to-block-stops-at-indentation ()
- (with-temp-buffer
- (insert "def f\nend")
+ (ruby-with-temp-buffer "def f\nend"
(beginning-of-line)
- (ruby-mode)
(ruby-move-to-block -1)
(should (looking-at "^def"))))
(ert-deftest ruby-toggle-block-to-do-end ()
- (with-temp-buffer
- (insert "foo {|b|\n}")
- (ruby-mode)
+ (ruby-with-temp-buffer "foo {|b|\n}"
(beginning-of-line)
(ruby-toggle-block)
(should (string= "foo do |b|\nend" (buffer-string)))))
(should (string= (cdr pair) (buffer-string))))))))
(ert-deftest ruby-toggle-block-to-multiline ()
- (with-temp-buffer
- (insert "foo {|b| b + 1}")
- (ruby-mode)
+ (ruby-with-temp-buffer "foo {|b| b + 1}"
(beginning-of-line)
(ruby-toggle-block)
(should (string= "foo do |b|\n b + 1\nend" (buffer-string)))))
(ert-deftest ruby-recognize-symbols-starting-with-at-character ()
- (ruby-assert-face ":@abc" 3 'font-lock-constant-face))
+ (ruby-assert-face ":@abc" 3 font-lock-constant-face))
(ert-deftest ruby-hash-character-not-interpolation ()
(ruby-assert-face "\"This is #{interpolation}\"" 15
- 'font-lock-variable-name-face)
+ font-lock-variable-name-face)
(ruby-assert-face "\"This is \\#{no interpolation} despite the #\""
- 15 'font-lock-string-face)
- (ruby-assert-face "\n#@comment, not ruby code" 5 'font-lock-comment-face)
+ 15 font-lock-string-face)
+ (ruby-assert-face "\n#@comment, not ruby code" 5 font-lock-comment-face)
(ruby-assert-state "\n#@comment, not ruby code" 4 t)
(ruby-assert-face "# A comment cannot have #{an interpolation} in it"
- 30 'font-lock-comment-face)
+ 30 font-lock-comment-face)
(ruby-assert-face "# #{comment}\n \"#{interpolation}\"" 16
- 'font-lock-variable-name-face))
+ font-lock-variable-name-face))
+
+(ert-deftest ruby-interpolation-suppresses-quotes-inside ()
+ (let ((s "\"<ul><li>#{@files.join(\"</li><li>\")}</li></ul>\""))
+ (ruby-assert-state s 8 nil)
+ (ruby-assert-face s 9 font-lock-string-face)
+ (ruby-assert-face s 10 font-lock-variable-name-face)
+ (ruby-assert-face s 41 font-lock-string-face)))
+
+(ert-deftest ruby-interpolation-suppresses-one-double-quote ()
+ (let ((s "\"foo#{'\"'}\""))
+ (ruby-assert-state s 8 nil)
+ (ruby-assert-face s 8 font-lock-variable-name-face)
+ (ruby-assert-face s 11 font-lock-string-face)))
+
+(ert-deftest ruby-interpolation-suppresses-one-backtick ()
+ (let ((s "`as#{'`'}das`"))
+ (ruby-assert-state s 8 nil)))
+
+(ert-deftest ruby-interpolation-keeps-non-quote-syntax ()
+ (let ((s "\"foo#{baz.tee}bar\""))
+ (ruby-with-temp-buffer s
+ (goto-char (point-min))
+ (ruby-mode)
+ (font-lock-fontify-buffer)
+ (search-forward "tee")
+ (should (string= (thing-at-point 'symbol) "tee")))))
+
+(ert-deftest ruby-interpolation-inside-percent-literal-with-paren ()
+ :expected-result :failed
+ (let ((s "%(^#{\")\"}^)"))
+ (ruby-assert-face s 3 font-lock-string-face)
+ (ruby-assert-face s 4 font-lock-variable-name-face)
+ (ruby-assert-face s 10 font-lock-string-face)
+ ;; It's confused by the closing paren in the middle.
+ (ruby-assert-state s 8 nil)))
+
+(ert-deftest ruby-add-log-current-method-examples ()
+ (let ((pairs '(("foo" . "#foo")
+ ("C.foo" . ".foo")
+ ("self.foo" . ".foo"))))
+ (dolist (pair pairs)
+ (let ((name (car pair))
+ (value (cdr pair)))
+ (ruby-with-temp-buffer (ruby-test-string
+ "module M
+ | class C
+ | def %s
+ | _
+ | end
+ | end
+ |end"
+ name)
+ (search-backward "_")
+ (forward-line)
+ (should (string= (ruby-add-log-current-method)
+ (format "M::C%s" value))))))))
+
+(ert-deftest ruby-add-log-current-method-outside-of-method ()
+ (ruby-with-temp-buffer (ruby-test-string
+ "module M
+ | class C
+ | def foo
+ | end
+ | _
+ | end
+ |end")
+ (search-backward "_")
+ (should (string= (ruby-add-log-current-method)"M::C"))))
+
+(ert-deftest ruby-add-log-current-method-in-singleton-class ()
+ (ruby-with-temp-buffer (ruby-test-string
+ "class C
+ | class << self
+ | def foo
+ | _
+ | end
+ | end
+ |end")
+ (search-backward "_")
+ (should (string= (ruby-add-log-current-method) "C.foo"))))
+
+(ert-deftest ruby-add-log-current-method-namespace-shorthand ()
+ (ruby-with-temp-buffer (ruby-test-string
+ "class C::D
+ | def foo
+ | _
+ | end
+ |end")
+ (search-backward "_")
+ (should (string= (ruby-add-log-current-method) "C::D#foo"))))
+
+(ert-deftest ruby-add-log-current-method-after-inner-class ()
+ (ruby-with-temp-buffer (ruby-test-string
+ "module M
+ | class C
+ | class D
+ | end
+ | _
+ | end
+ |end")
+ (search-backward "_")
+ (should (string= (ruby-add-log-current-method) "M::C"))))
+
+(defvar ruby-block-test-example
+ (ruby-test-string
+ "class C
+ | def foo
+ | 1
+ | end
+ |
+ | def bar
+ | 2
+ | end
+ |
+ | def baz
+ | some do
+ | end
+ | end
+ |end"))
+
+(defmacro ruby-deftest-move-to-block (name &rest body)
+ `(ert-deftest ,(intern (format "ruby-move-to-block-%s" name)) ()
+ (with-temp-buffer
+ (insert ruby-block-test-example)
+ (ruby-mode)
+ ,@body)))
+
+(put 'ruby-deftest-move-to-block 'lisp-indent-function 'defun)
+
+(ruby-deftest-move-to-block works-on-do
+ (goto-line 11)
+ (ruby-end-of-block)
+ (should (= 12 (line-number-at-pos)))
+ (ruby-beginning-of-block)
+ (should (= 11 (line-number-at-pos))))
+
+(ruby-deftest-move-to-block zero-is-noop
+ (goto-line 5)
+ (ruby-move-to-block 0)
+ (should (= 5 (line-number-at-pos))))
+
+(ruby-deftest-move-to-block ok-with-three
+ (goto-line 2)
+ (ruby-move-to-block 3)
+ (should (= 13 (line-number-at-pos))))
+
+(ruby-deftest-move-to-block ok-with-minus-two
+ (goto-line 10)
+ (ruby-move-to-block -2)
+ (should (= 2 (line-number-at-pos))))
(provide 'ruby-mode-tests)
--- /dev/null
+;;; undo-tests.el --- Tests of primitive-undo
+
+;; Copyright (C) 2012 Aaron S. Hawley
+
+;; Author: Aaron S. Hawley <aaron.s.hawley@gmail.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 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:
+
+;; Profiling when the code was translate from C to Lisp on 2012-12-24.
+
+;;; C
+
+;; (elp-instrument-function 'primitive-undo)
+;; (load-file "undo-test.elc")
+;; (benchmark 100 '(let ((undo-test5-error nil)) (undo-test-all)))
+;; Elapsed time: 305.218000s (104.841000s in 14804 GCs)
+;; M-x elp-results
+;; Function Name Call Count Elapsed Time Average Time
+;; primitive-undo 2600 3.4889999999 0.0013419230
+
+;;; Lisp
+
+;; (load-file "primundo.elc")
+;; (elp-instrument-function 'primitive-undo)
+;; (benchmark 100 '(undo-test-all))
+;; Elapsed time: 295.974000s (104.582000s in 14704 GCs)
+;; M-x elp-results
+;; Function Name Call Count Elapsed Time Average Time
+;; primitive-undo 2700 3.6869999999 0.0013655555
+
+;;; Code:
+
+(require 'ert)
+
+(ert-deftest undo-test0 ()
+ "Test basics of \\[undo]."
+ (with-temp-buffer
+ (buffer-enable-undo)
+ (condition-case err
+ (undo)
+ (error
+ (unless (string= "No further undo information"
+ (cadr err))
+ (error err))))
+ (undo-boundary)
+ (insert "This")
+ (undo-boundary)
+ (erase-buffer)
+ (undo-boundary)
+ (insert "That")
+ (undo-boundary)
+ (forward-word -1)
+ (undo-boundary)
+ (insert "With ")
+ (undo-boundary)
+ (forward-word -1)
+ (undo-boundary)
+ (kill-word 1)
+ (undo-boundary)
+ (put-text-property (point-min) (point-max) 'face 'bold)
+ (undo-boundary)
+ (remove-text-properties (point-min) (point-max) '(face default))
+ (undo-boundary)
+ (set-buffer-multibyte (not enable-multibyte-characters))
+ (undo-boundary)
+ (undo)
+ (should
+ (equal (should-error (undo-more nil))
+ '(wrong-type-argument integerp nil)))
+ (undo-more 7)
+ (should (string-equal "" (buffer-string)))))
+
+(ert-deftest undo-test1 ()
+ "Test undo of \\[undo] command (redo)."
+ (with-temp-buffer
+ (buffer-enable-undo)
+ (undo-boundary)
+ (insert "This")
+ (undo-boundary)
+ (erase-buffer)
+ (undo-boundary)
+ (insert "That")
+ (undo-boundary)
+ (forward-word -1)
+ (undo-boundary)
+ (insert "With ")
+ (undo-boundary)
+ (forward-word -1)
+ (undo-boundary)
+ (kill-word 1)
+ (undo-boundary)
+ (facemenu-add-face 'bold (point-min) (point-max))
+ (undo-boundary)
+ (set-buffer-multibyte (not enable-multibyte-characters))
+ (undo-boundary)
+ (should
+ (string-equal (buffer-string)
+ (progn
+ (undo)
+ (undo-more 4)
+ (undo)
+ ;(undo-more -4)
+ (buffer-string))))))
+
+(ert-deftest undo-test2 ()
+ "Test basic redoing with \\[undo] command."
+ (with-temp-buffer
+ (buffer-enable-undo)
+ (undo-boundary)
+ (insert "One")
+ (undo-boundary)
+ (insert " Zero")
+ (undo-boundary)
+ (push-mark)
+ (delete-region (save-excursion
+ (forward-word -1)
+ (point)) (point))
+ (undo-boundary)
+ (beginning-of-line)
+ (insert "Zero")
+ (undo-boundary)
+ (undo)
+ (should
+ (string-equal (buffer-string)
+ (progn
+ (undo-more 2)
+ (undo)
+ (buffer-string))))))
+
+(ert-deftest undo-test3 ()
+ "Test modtime with \\[undo] command."
+ (let ((tmpfile (make-temp-file "undo-test3")))
+ (with-temp-file tmpfile
+ (let ((buffer-file-name tmpfile))
+ (buffer-enable-undo)
+ (set (make-local-variable 'make-backup-files) nil)
+ (undo-boundary)
+ (insert ?\s)
+ (undo-boundary)
+ (basic-save-buffer)
+ (insert ?\t)
+ (undo)
+ (should
+ (string-equal (buffer-string)
+ (progn
+ (undo)
+ (buffer-string)))))
+ (delete-file tmpfile))))
+
+(ert-deftest undo-test4 ()
+ "Test \\[undo] of \\[flush-lines]."
+ (with-temp-buffer
+ (buffer-enable-undo)
+ (dotimes (i 1048576)
+ (if (zerop (% i 2))
+ (insert "Evenses")
+ (insert "Oddses")))
+ (undo-boundary)
+ (should
+ ;; Avoid string-equal because ERT will save the `buffer-string'
+ ;; to the explanation. Using `not' will record nil or non-nil.
+ (not
+ (null
+ (string-equal (buffer-string)
+ (progn
+ (flush-lines "oddses" (point-min) (point-max))
+ (undo-boundary)
+ (undo)
+ (undo)
+ (buffer-string))))))))
+
+(ert-deftest undo-test5 ()
+ "Test basic redoing with \\[undo] command."
+ (with-temp-buffer
+ (buffer-enable-undo)
+ (undo-boundary)
+ (insert "AYE")
+ (undo-boundary)
+ (insert " BEE")
+ (undo-boundary)
+ (setq buffer-undo-list (cons '(0.0 bogus) buffer-undo-list))
+ (push-mark)
+ (delete-region (save-excursion
+ (forward-word -1)
+ (point)) (point))
+ (undo-boundary)
+ (beginning-of-line)
+ (insert "CEE")
+ (undo-boundary)
+ (undo)
+ (setq buffer-undo-list (cons "bogus" buffer-undo-list))
+ (should
+ (string-equal
+ (buffer-string)
+ (progn
+ (if (and (boundp 'undo-test5-error) (not undo-test5-error))
+ (progn
+ (should (null (undo-more 2)))
+ (should (undo)))
+ ;; Errors are generated by new Lisp version of
+ ;; `primitive-undo' not by built-in C version.
+ (should
+ (equal (should-error (undo-more 2))
+ '(error "Unrecognized entry in undo list (0.0 bogus)")))
+ (should
+ (equal (should-error (undo))
+ '(error "Unrecognized entry in undo list \"bogus\""))))
+ (buffer-string))))))
+
+(defun undo-test-all (&optional interactive)
+ "Run all tests for \\[undo]."
+ (interactive "p")
+ (if interactive
+ (ert-run-tests-interactively "^undo-")
+ (ert-run-tests-batch "^undo-")))
+
+(provide 'undo-tests)
+;;; undo-tests.el ends here
# adsgsdg
+case $X in
+ foo)
+ do_something
+ ;;
+ arg=*) # bug#12953
+ do_something_else_based_on_arg
+ ;;
+ *)
+ default
+ ;;
+esac
+
echo -n $(( 5 << 2 ))
# This should not be treated as a heredoc (bug#12770).
2