-2013-01-16 Glenn Morris <rgm@gnu.org>
+2013-02-12 Eli Zaretskii <eliz@gnu.org>
+
+ * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/memrchr.$(O).
+ ($(BLD)/memrchr.$(O)): New dependency.
+
+2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ Tune by using memchr and memrchr.
+ * .bzrignore: Add string.h.
+ * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
+ * lib/memrchr.c, lib/string.in.h, m4/memrchr.m4, m4/string_h.m4:
+ New files, from gnulib.
+
+ Merge from gnulib, incorporating:
+ 2013-02-11 unsetenv etc.: port to Solaris 11 + GNU Emacs
+ 2013-02-09 secure_getenv: fix C++ declaration typo
+
+2013-02-11 Glenn Morris <rgm@gnu.org>
+
+ * configure.ac (emacs_config_options): Record some env vars.
+
+2013-02-10 Glenn Morris <rgm@gnu.org>
+
+ * configure.ac (emacs_config_options): Strip out the (internal)
+ arguments --no-create and --no-recursion.
+
+2013-02-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2013-02-08 careadlinkat: stop exporting careadlinkatcwd
+ The MS-Windows port can remove careadlinkatcwd at its convenience.
+ 2013-02-08 extensions: port better to HP-UX
+ 2013-02-06 extensions: port better to MINIX 3, HP-UX, autoheader 2.62
+ 2013-02-06 unistd: avoid namespace pollution on non-glibc systems
+ 2013-02-04 secure_getenv: new module [module not used by Emacs]
+ 2013-01-30 sys_time: port to Solaris 2.6
+
+2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+ On my host, this speeds up directory-files-and-attributes by a
+ factor of 3, when applied to Emacs's src directory.
+ These functions are standardized by POSIX and are common these
+ days; fall back on a (slower) gnulib implementation if the host
+ is too old to supply them.
+ * .bzrignore: Add lib/dirent.h.
+ * lib/Makefile.am (libgnu_a_SOURCES): Add openat-die.c, save-cwd.c.
+ * lib/careadlinkat.c, lib/careadlinkat.h: Merge from gnulib,
+ incorporating: 2013-01-29 careadlinkat: do not provide careadlinkatcwd.
+ * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
+ * lib/dirent.in.h, lib/fdopendir.c, lib/fstatat.c, lib/openat-priv.h:
+ * lib/openat-proc.c, lib/openat.h, m4/dirent_h.m4, m4/fdopendir.m4:
+ * m4/fstatat.m4: New files, from gnulib.
+ * lib/openat-die.c, lib/save-cwd.c, lib/save-cwd.h: New files.
+ These last three are specific to Emacs and are not copied from gnulib.
+ They are simpler than the gnulib versions and are tuned for Emacs.
+
+2013-02-01 Glenn Morris <rgm@gnu.org>
+
+ * make-dist: Only README files exist in lisp/ now, not README*.
+
+2013-01-23 Giorgos Keramidas <gkeramidas@gmail.com> (tiny change)
+
+ * .bzrignore: add lib-src/blessmail.
+
+2013-01-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2013-01-16 unistd: port to recent mingw
+
+2013-01-19 Glenn Morris <rgm@gnu.org>
* Makefile.in (install-arch-indep): Put back a chmod that was
removed 2012-05-19. (Bug#13430)
-2013-01-10 Glenn Morris <rgm@gnu.org>
+2013-01-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2013-01-16 largefile: port better to Mac OS X 10.5
+ 2013-01-15 stdint: fix build with Android's Bionic fox x86
+
+2013-01-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * configure.ac: Document that --enable-gcc-warnings emits errors.
+ (Bug#13448)
+
+2013-01-13 Glenn Morris <rgm@gnu.org>
* make-dist: Add options for xz compression and no compression.
+2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ Enable conservative stack scanning for all architectures.
+ Suggested by Stefan Monnier in
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00183.html>.
+ * configure.ac (GC_MARK_STACK): Remove.
+
+2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/getopt_.h: Remove trailing CRs that crept in.
+
+2013-01-11 Eli Zaretskii <eliz@gnu.org>
+
+ * lib/getopt_.h: Regenerate.
+
+2013-01-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2013-01-09 stdlib: port to Solaris 2.6
+
2013-01-04 Glenn Morris <rgm@gnu.org>
* 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.
+
+ * 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.
+
+2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
+
+ * configure.ac (inotify): New option.
+ (HAVE_INOTIFY): Test for inotify.
-2012-12-12 Glenn Morris <rgm@gnu.org>
+2012-12-09 Andreas Schwab <schwab@linux-m68k.org>
- * info/dir: Add srecode.
+ * configure.ac: Fix source command in .gdbinit.
+ Don't quote $MAKEINFO.
-2012-12-11 Nicolas Richard <theonewiththeevillook@yahoo.fr> (tiny change)
+2012-12-09 Paul Eggert <eggert@cs.ucla.edu>
- * Makefile.in (install-info, uninstall): Ensure make's messages
- about changing directories are in English. (Bug#13143)
+ 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-05 Glenn Morris <rgm@gnu.org>
+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.
+
+2012-12-08 Eli Zaretskii <eliz@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.93 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-02-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ Tune by using memchr and memrchr.
+ * merge-gnulib (GNULIB_MODULES): Add memrchr.
+
+2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+ * merge-gnulib (GNULIB_MODULES): Add fdopendir, fstatat, readlinkat.
+ (GNULIB_TOOL_FLAGS): Do not avoid at-internal, openat-h.
+ Avoid dup, open, opendir.
+
+2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * coccinelle/xsave.cocci: Semantic patch to adjust users of
+ XSAVE_POINTER and XSAVE_INTEGER macros.
+
+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
+// Adjust users of XSAVE_POINTER and XSAVE_INTEGER.
+@@
+expression E;
+@@
+(
+- XSAVE_POINTER (E)
++ XSAVE_POINTER (E, 0)
+|
+- XSAVE_INTEGER (E)
++ XSAVE_INTEGER (E, 1)
+)
+++ /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"
-
-- originally written by Gerd Moellmann, amended by Francesco Potortì
with the initial help of Eli Zaretskii
-For each step, check for possible errors.
+
+Steps to take before starting on the first pretest in any release sequence:
+
+1. Decide on versions of automake and autoconf, and ensure you will
+ have them available for the duration of the release process.
+
+2. Consider increasing the value of the variable
+ `customize-changed-options-previous-release' in cus-edit.el to
+ refer to a newer version of Emacs. (This is probably needed only
+ when preparing the first pretest for a major Emacs release.)
+ Commit cus-edit.el if changed.
+
+
+General steps (for each step, check for possible errors):
1. `bzr update' (for a bound branch), or `bzr pull'.
- bzr status # check for locally modified files
+ bzr status # check for locally modified files
2. Bootstrap to make 100% sure all elc files are up-to-date, and to
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
+
+ There is almost guaranteed to be an "*Authors Errors*" buffer with
+ problems caused by certain bad ChangeLog entries. You can ignore
+ the very old ones (eg lisp/erc has a lot). If there are errors
+ related to new entries (especially entries that are new since the
+ last pretest), see if you can fix them. If there was a ChangeLog
+ typo, fix it. If a file was deleted or renamed, consider adding
+ an appropriate entry to authors-ignored-files, authors-valid-file-names,
+ or authors-renamed-files-alist.
+
+ If necessary, repeat M-x authors after making those changes.
+ Save the "*Authors*" buffer as etc/AUTHORS.
+ Check the diff looks reasonable. Maybe add entries to
+ authors-ambiguous-files or authors-aliases, and repeat.
+ Commit any fixes to ChangeLogs or authors.el.
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
it sorts).
- If needed, increment the value of the variable
- `customize-changed-options-previous-release' in cus-edit.el to
- refer to a newer release of Emacs. (This is probably needed only
- when preparing a major Emacs release, or branching for it.)
-
5. autoreconf -i -I m4 --force
make bootstrap
-6. Commit etc/AUTHORS, all the files changed by M-x set-version, and
- lisp/cus-edit.el (if modified).
- Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit lisp/ldefs-boot.el.
+6. Copy lisp/loaddefs.el to lisp/ldefs-boot.el.
+
+ Commit etc/AUTHORS, lisp/ldefs-boot.el, and the files changed
+ by M-x set-version.
For a release, also commit the ChangeLog files in all directories.
-7. make-dist --snapshot. Check the contents of the new tar with
+7. ./make-dist --snapshot --no-compress
+
+ Check the contents of the new tar with
admin/diff-tar-files against an older tar file. Some old pretest
tarballs may be found at <ftp://alpha.gnu.org/gnu/emacs/pretest>;
old release tarballs are at <ftp://ftp.gnu.org/pub/gnu/emacs/>.
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
- ./configure && make && make -n install
+8. tar -xf emacs-NEW.tar; cd emacs-NEW
+ ./configure --prefix=/tmp/emacs && make && make 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
to do that is to visit the old log in Emacs, change the version
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. Decide what compression schemes to offer.
+ For a release, at least gz and xz:
+ gzip --best -c emacs-NEW.tar > emacs-NEW.tar.gz
+ xz -c emacs-NEW.tar > emacs-NEW.tar.xz
+
+ 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.
+ GPG key acknowledged by the ftp people. For instructions, see
+ http://www.gnu.org/prep/maintain/html_node/Automated-Upload-Registration.html
+ The simplest method is to use the gnulib <http://www.gnu.org/s/gnulib/>
+ script "build-aux/gnupload" to upload each FILE, like this:
+
+ For a pretest:
+ gnupload [--user your@gpg.key.email] --to alpha.gnu.org:emacs/pretest \
+ FILE.gz FILE.xz ...
+
+ For a release:
+ gnupload [--user your@gpg.key.email] --to ftp.gnu.org:emacs \
+ FILE.gz FILE.xz ...
+
+ You only need the --user part if you have multiple GPG keys and do
+ not want to use the default.
+ Obviously, if you do not have a fast uplink, be prepared for the
+ upload to take a while.
- You can use the gnupload script 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)
- Instead of using gnupload, for each FILE, create a detached GPG
- binary signature and a clearsigned directive file like this:
+ If you prefer to do it yourself rather than use gnupload:
+
+ For each FILE, create a detached GPG binary signature and a
+ clearsigned directive file like this:
+
gpg -b FILE
echo directory: emacs/pretest > FILE.directive (for a pretest)
echo directory: emacs > FILE.directive (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
- of bandwidth.
-
-12. After five minutes, verify that the files are visible at
- ftp://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, at
+11. After five minutes, verify that the files are visible at
+ ftp://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, or
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.
+ Download them and check the signatures. Check they build.
+
+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.
+ Maybe regenerate the html manuals, update the FAQ, etc, etc.
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 fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday
ignore-value intprops largefile lstat
- manywarnings mktime pselect pthread_sigmask readlink
- socklen stat-time stdalign stdarg stdbool stdio
+ manywarnings memrchr mktime
+ pselect pthread_sigmask putenv readlink readlinkat
+ sig2str socklen stat-time stdalign stdarg stdbool stdio
strftime strtoimax strtoumax symlink sys_stat
- sys_time time timer-time timespec-add timespec-sub 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=dup
+ --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat
+ --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow
+ --avoid=open --avoid=openat-die --avoid=opendir
+ --avoid=raise
+ --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=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:
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/>.
+along with GNU Emacs. If not, see http://www.gnu.org/licenses/.
@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=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=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 fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv 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/clock_time.m4 \
+ $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/dirent_h.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/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/extern-inline.m4 \
+ $(top_srcdir)/m4/faccessat.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+ $(top_srcdir)/m4/fdopendir.m4 $(top_srcdir)/m4/filemode.m4 \
+ $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fstatat.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/md5.m4 $(top_srcdir)/m4/mktime.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/md5.m4 $(top_srcdir)/m4/memrchr.m4 \
+ $(top_srcdir)/m4/mktime.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/putenv.m4 \
+ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/readlinkat.m4 \
+ $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sha1.m4 \
$(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.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 \
- $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
- $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
- $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \
- $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strftime.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 $(top_srcdir)/m4/stdalign.m4 \
+ $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \
+ $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/string_h.m4 \
$(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtoll.m4 \
$(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \
$(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_select_h.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 openat-die.c save-cwd.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) openat-die.$(OBJEXT) save-cwd.$(OBJEXT)
libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
GETOPT_H = @GETOPT_H@
GMALLOC_OBJ = @GMALLOC_OBJ@
+GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
GNULIB_ATOLL = @GNULIB_ATOLL@
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
GNULIB_CHDIR = @GNULIB_CHDIR@
GNULIB_CHOWN = @GNULIB_CHOWN@
GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
+GNULIB_DIRFD = @GNULIB_DIRFD@
GNULIB_DPRINTF = @GNULIB_DPRINTF@
GNULIB_DUP = @GNULIB_DUP@
GNULIB_DUP2 = @GNULIB_DUP2@
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_FDOPENDIR = @GNULIB_FDOPENDIR@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
GNULIB_FGETC = @GNULIB_FGETC@
GNULIB_FGETS = @GNULIB_FGETS@
GNULIB_FOPEN = @GNULIB_FOPEN@
GNULIB_LSEEK = @GNULIB_LSEEK@
GNULIB_LSTAT = @GNULIB_LSTAT@
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
GNULIB_MKFIFO = @GNULIB_MKFIFO@
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_OPENDIR = @GNULIB_OPENDIR@
GNULIB_PCLOSE = @GNULIB_PCLOSE@
GNULIB_PERROR = @GNULIB_PERROR@
GNULIB_PIPE = @GNULIB_PIPE@
GNULIB_RAISE = @GNULIB_RAISE@
GNULIB_RANDOM = @GNULIB_RANDOM@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READ = @GNULIB_READ@
+GNULIB_READDIR = @GNULIB_READDIR@
GNULIB_READLINK = @GNULIB_READLINK@
GNULIB_READLINKAT = @GNULIB_READLINKAT@
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
GNULIB_REMOVE = @GNULIB_REMOVE@
GNULIB_RENAME = @GNULIB_RENAME@
GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
GNULIB_RMDIR = @GNULIB_RMDIR@
GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANDIR = @GNULIB_SCANDIR@
GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
GNULIB_SELECT = @GNULIB_SELECT@
GNULIB_SETENV = @GNULIB_SETENV@
GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
GNULIB_STAT = @GNULIB_STAT@
GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
GNULIB_STRTOD = @GNULIB_STRTOD@
GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
GNULIB_STRTOLL = @GNULIB_STRTOLL@
GNULIB_STRTOULL = @GNULIB_STRTOULL@
GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
GNULIB_SYMLINK = @GNULIB_SYMLINK@
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
GTK_OBJ = @GTK_OBJ@
GZIP_INFO = @GZIP_INFO@
GZIP_PROG = @GZIP_PROG@
+HAVE_ALPHASORT = @HAVE_ALPHASORT@
HAVE_ATOLL = @HAVE_ATOLL@
HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
+HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DIRENT_H = @HAVE_DIRENT_H@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP2 = @HAVE_DUP2@
HAVE_DUP3 = @HAVE_DUP3@
HAVE_FCHDIR = @HAVE_FCHDIR@
HAVE_FCHMODAT = @HAVE_FCHMODAT@
HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
HAVE_FSEEKO = @HAVE_FSEEKO@
HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_FSYNC = @HAVE_FSYNC@
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
HAVE_LSTAT = @HAVE_LSTAT@
HAVE_MAKEINFO = @HAVE_MAKEINFO@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
HAVE_MKDIRAT = @HAVE_MKDIRAT@
HAVE_MKDTEMP = @HAVE_MKDTEMP@
HAVE_MKFIFO = @HAVE_MKFIFO@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OPENDIR = @HAVE_OPENDIR@
HAVE_OS_H = @HAVE_OS_H@
HAVE_PCLOSE = @HAVE_PCLOSE@
HAVE_PIPE = @HAVE_PIPE@
HAVE_RANDOM = @HAVE_RANDOM@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READDIR = @HAVE_READDIR@
HAVE_READLINK = @HAVE_READLINK@
HAVE_READLINKAT = @HAVE_READLINKAT@
HAVE_REALPATH = @HAVE_REALPATH@
HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_REWINDDIR = @HAVE_REWINDDIR@
HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SCANDIR = @HAVE_SCANDIR@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
HAVE_SETENV = @HAVE_SETENV@
HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
HAVE_SIGACTION = @HAVE_SIGACTION@
HAVE_SIGSET_T = @HAVE_SIGSET_T@
HAVE_SLEEP = @HAVE_SLEEP@
HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
HAVE_STRTOD = @HAVE_STRTOD@
HAVE_STRTOLL = @HAVE_STRTOLL@
HAVE_STRTOULL = @HAVE_STRTOULL@
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
HAVE_SYMLINK = @HAVE_SYMLINK@
HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
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_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
+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_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_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_DIRENT_H = @NEXT_DIRENT_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@
NEXT_STDINT_H = @NEXT_STDINT_H@
NEXT_STDIO_H = @NEXT_STDIO_H@
NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
REPLACE_CHOWN = @REPLACE_CHOWN@
REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
+REPLACE_DIRFD = @REPLACE_DIRFD@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
REPLACE_DUP = @REPLACE_DUP@
REPLACE_DUP2 = @REPLACE_DUP2@
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FOPEN = @REPLACE_FOPEN@
REPLACE_FPRINTF = @REPLACE_FPRINTF@
REPLACE_LSTAT = @REPLACE_LSTAT@
REPLACE_MALLOC = @REPLACE_MALLOC@
REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
REPLACE_MKDIR = @REPLACE_MKDIR@
REPLACE_MKFIFO = @REPLACE_MKFIFO@
REPLACE_MKNOD = @REPLACE_MKNOD@
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_OPENDIR = @REPLACE_OPENDIR@
REPLACE_PERROR = @REPLACE_PERROR@
REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_STAT = @REPLACE_STAT@
REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
TOOLKIT_LIBW = @TOOLKIT_LIBW@
UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
UNEXEC_OBJ = @UNEXEC_OBJ@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
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) dirent.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 string.h sys/select.h sys/stat.h sys/time.h \
+ time.h unistd.h
+EXTRA_DIST = alloca.in.h allocator.h openat-priv.h openat-proc.c \
+ careadlinkat.h close-stream.h md5.h sha1.h sha256.h sha512.h \
+ dirent.in.h dosname.h ftoastr.c ftoastr.h dup2.c euidaccess.c \
+ execinfo.c execinfo.in.h at-func.c faccessat.c fcntl.in.h \
+ fdopendir.c filemode.h fpending.c fpending.h at-func.c \
+ fstatat.c 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 memrchr.c \
+ mktime-internal.h mktime.c openat.h pathmax.h pselect.c \
+ pthread_sigmask.c putenv.c readlink.c at-func.c readlinkat.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 \
$(top_srcdir)/build-aux/snippet/warn-on-use.h stat.c \
stat-time.h stdalign.in.h stdarg.in.h stdbool.in.h stddef.in.h \
- stdint.in.h stdio.in.h stdlib.in.h strftime.h strtoimax.c \
- 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
+ stdint.in.h stdio.in.h stdlib.in.h strftime.h string.in.h \
+ strtoimax.c 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 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 \
- 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 \
- sys/stat.h-t sys/time.h sys/time.h-t time.h time.h-t unistd.h \
- unistd.h-t
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \
+ dirent.h-t execinfo.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 string.h \
+ string.h-t sys/select.h sys/select.h-t sys/stat.h sys/stat.h-t \
+ sys/time.h sys/time.h-t time.h time.h-t unistd.h unistd.h-t
noinst_LIBRARIES = libgnu.a
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 openat-die.c save-cwd.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 \
+EXTRA_libgnu_a_SOURCES = openat-proc.c ftoastr.c dup2.c euidaccess.c \
+ execinfo.c at-func.c faccessat.c fdopendir.c fpending.c \
+ at-func.c fstatat.c getgroups.c getloadavg.c getopt.c \
+ getopt1.c gettimeofday.c group-member.c lstat.c memrchr.c \
+ mktime.c pselect.c pthread_sigmask.c putenv.c readlink.c \
+ at-func.c readlinkat.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
+ 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)/fdopendir.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)/fstatat.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)/memrchr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.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)/readlinkat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save-cwd.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_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@
+# We need the following in order to create <dirent.h> when the system
+# doesn't have one that works with the given compiler.
+dirent.h: dirent.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|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|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_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+ -e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
+ -e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
+ -e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
+ -e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
+ -e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
+ -e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
+ -e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
+ -e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
+ -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+ -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+ -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+ -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
+ -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+ -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
+ -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
+ -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
+ -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
+ -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
+ -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
+ -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
+ -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|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)/dirent.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+
# We need the following in order to create <execinfo.h> when the system
# doesn't have one that works.
@GL_GENERATE_EXECINFO_H_TRUE@execinfo.h: execinfo.in.h $(top_builddir)/config.status
@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)
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
-e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
-e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+ -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
-e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
-e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
-e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
+ -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
-e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
} > $@-t && \
mv $@-t $@
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string.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_STRING_H''@|$(NEXT_STRING_H)|g' \
+ -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
+ -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
+ -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
+ -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
+ -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
+ -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
+ -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
+ -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
+ -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
+ -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
+ -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
+ -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
+ -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
+ -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
+ -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
+ -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
+ -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
+ -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
+ -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
+ -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
+ -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
+ -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
+ -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
+ -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
+ -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
+ -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
+ -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
+ -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
+ -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
+ -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
+ -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
+ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
+ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
+ -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
+ < $(srcdir)/string.in.h | \
+ sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
+ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
+ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+ -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
+ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
+ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
+ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+ -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
+ -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+ -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
+ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|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)/string.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+
# We need the following in order to create <sys/select.h> when the system
# doesn't have one that works with the given compiler.
sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_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/dirent_h.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/fdopendir.m4])
m4_include([m4/filemode.m4])
+m4_include([m4/fpending.m4])
+m4_include([m4/fstatat.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/lstat.m4])
m4_include([m4/manywarnings.m4])
m4_include([m4/md5.m4])
+m4_include([m4/memrchr.m4])
m4_include([m4/mktime.m4])
m4_include([m4/multiarch.m4])
m4_include([m4/nocrash.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/readlinkat.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])
m4_include([m4/stdio_h.m4])
m4_include([m4/stdlib_h.m4])
m4_include([m4/strftime.m4])
+m4_include([m4/string_h.m4])
m4_include([m4/strtoimax.m4])
m4_include([m4/strtoll.m4])
m4_include([m4/strtoull.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). */
/* Mark a secondary stack, like the register stack on the ia64. */
#undef GC_MARK_SECONDARY_STACK
-/* Define to GC_USE_GCPROS_AS_BEFORE if conservative garbage collection is not
- known to work. */
-#undef GC_MARK_STACK
-
/* Define if setjmp is known to save all registers relevant for conservative
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 fdopendir shall be considered present. */
+#undef GNULIB_FDOPENDIR
+
/* 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
/* Define to 1 if you have the `dbus_watch_get_unix_fd' function. */
#undef HAVE_DBUS_WATCH_GET_UNIX_FD
+/* Define to 1 if you have the declaration of `fdopendir', and to 0 if you
+ don't. */
+#undef HAVE_DECL_FDOPENDIR
+
/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
*/
#undef HAVE_DECL_GETENV
don't. */
#undef HAVE_DECL_LOCALTIME_R
+/* Define to 1 if you have the declaration of `memrchr', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MEMRCHR
+
/* Define to 1 if you have the declaration of `strmode', and to 0 if you
don't. */
#undef HAVE_DECL_STRMODE
*/
#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 '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 `fdopendir' function. */
+#undef HAVE_FDOPENDIR
/* 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 fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
+/* Define to 1 if you have the `fstatat' function. */
+#undef HAVE_FSTATAT
+
/* Define to 1 if you have the `fsync' function. */
#undef HAVE_FSYNC
/* 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 the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `memrchr' function. */
+#undef HAVE_MEMRCHR
+
/* Define to 1 if you have mouse menus. (This is automatic if you use X, but
the option to specify it remains.) It is also defined with other window
systems that support xmenu.c. */
/* 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 1 if `fork' works. */
#undef HAVE_WORKING_FORK
+/* Define to 1 if fstatat (..., 0) works. For example, it does not work in AIX
+ 7.1. */
+#undef HAVE_WORKING_FSTATAT_ZERO_FLAG
+
/* Define if utimes works properly. */
#undef HAVE_WORKING_UTIMES
/* 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
/* Define to 1 if using the Motif X toolkit. */
#undef USE_MOTIF
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable general extensions on OS X. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
/* Define to 1 if we should use toolkit scroll bars. */
#undef USE_TOOLKIT_SCROLL_BARS
/* 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
/* Define if the system is AIX. */
#undef _AIX
-/* Enable large inode numbers on Mac OS X. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
+/* Enable large inode numbers on Mac OS X 10.5. */
+#undef _DARWIN_USE_64_BIT_INODE
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define if GNUstep uses ObjC exceptions. */
#undef _NATIVE_OBJC_EXCEPTIONS
+/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */
+#undef _NETBSD_SOURCE
+
/* The _Noreturn keyword of C11. */
#if ! (defined _Noreturn \
|| (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
/* Needed for system_process_attributes on Solaris. */
#undef _STRUCTURED_PROC
-/* Define to 500 only on HP-UX. */
-#undef _XOPEN_SOURCE
-
-/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable general extensions on Mac OS X. */
-#ifndef _DARWIN_C_SOURCE
-# undef _DARWIN_C_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
/* Define to rpl_ if the getopt replacement functions and variables should be
used. */
#undef __GETOPT_PREFIX
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.93.
+# 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.93'
-PACKAGE_STRING='emacs 24.2.93'
+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_03e0aaad4cb89ca757653bd367a6ccb7_FALSE
+gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7_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
+gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_FALSE
+gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_TRUE
LTLIBINTL
LIBINTL
+LIB_EACCESS
WINDOWS_64_BIT_OFF_T
HAVE_UNISTD_H
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
WINDOWS_64_BIT_ST_SIZE
NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
NEXT_SYS_STAT_H
+NEXT_AS_FIRST_DIRECTIVE_STRING_H
+NEXT_STRING_H
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
NEXT_STDLIB_H
NEXT_AS_FIRST_DIRECTIVE_STDIO_H
GNULIB_STRPTIME
GNULIB_NANOSLEEP
GNULIB_MKTIME
-REPLACE_UTIMENSAT
-REPLACE_STAT
-REPLACE_MKNOD
-REPLACE_MKFIFO
-REPLACE_MKDIR
-REPLACE_LSTAT
-REPLACE_FUTIMENS
-REPLACE_FSTATAT
-REPLACE_FSTAT
-HAVE_UTIMENSAT
-HAVE_MKNODAT
-HAVE_MKNOD
-HAVE_MKFIFOAT
-HAVE_MKFIFO
-HAVE_MKDIRAT
-HAVE_LSTAT
-HAVE_LCHMOD
-HAVE_FUTIMENS
-HAVE_FSTATAT
-HAVE_FCHMODAT
-GNULIB_UTIMENSAT
-GNULIB_STAT
-GNULIB_MKNODAT
-GNULIB_MKNOD
-GNULIB_MKFIFOAT
-GNULIB_MKFIFO
-GNULIB_MKDIRAT
-GNULIB_LSTAT
-GNULIB_LCHMOD
-GNULIB_FUTIMENS
-GNULIB_FSTATAT
-GNULIB_FSTAT
-GNULIB_FCHMODAT
+UNDEFINE_STRTOK_R
+REPLACE_STRTOK_R
+REPLACE_STRSIGNAL
+REPLACE_STRNLEN
+REPLACE_STRNDUP
+REPLACE_STRNCAT
+REPLACE_STRERROR_R
+REPLACE_STRERROR
+REPLACE_STRCHRNUL
+REPLACE_STRCASESTR
+REPLACE_STRSTR
+REPLACE_STRDUP
+REPLACE_STPNCPY
+REPLACE_MEMMEM
+REPLACE_MEMCHR
+HAVE_STRVERSCMP
+HAVE_DECL_STRSIGNAL
+HAVE_DECL_STRERROR_R
+HAVE_DECL_STRTOK_R
+HAVE_STRCASESTR
+HAVE_STRSEP
+HAVE_STRPBRK
+HAVE_DECL_STRNLEN
+HAVE_DECL_STRNDUP
+HAVE_DECL_STRDUP
+HAVE_STRCHRNUL
+HAVE_STPNCPY
+HAVE_STPCPY
+HAVE_RAWMEMCHR
+HAVE_DECL_MEMRCHR
+HAVE_MEMPCPY
+HAVE_DECL_MEMMEM
+HAVE_MEMCHR
+HAVE_FFSLL
+HAVE_FFSL
+HAVE_MBSLEN
+GNULIB_STRVERSCMP
+GNULIB_STRSIGNAL
+GNULIB_STRERROR_R
+GNULIB_STRERROR
+GNULIB_MBSTOK_R
+GNULIB_MBSSEP
+GNULIB_MBSSPN
+GNULIB_MBSPBRK
+GNULIB_MBSCSPN
+GNULIB_MBSCASESTR
+GNULIB_MBSPCASECMP
+GNULIB_MBSNCASECMP
+GNULIB_MBSCASECMP
+GNULIB_MBSSTR
+GNULIB_MBSRCHR
+GNULIB_MBSCHR
+GNULIB_MBSNLEN
+GNULIB_MBSLEN
+GNULIB_STRTOK_R
+GNULIB_STRCASESTR
+GNULIB_STRSTR
+GNULIB_STRSEP
+GNULIB_STRPBRK
+GNULIB_STRNLEN
+GNULIB_STRNDUP
+GNULIB_STRNCAT
+GNULIB_STRDUP
+GNULIB_STRCHRNUL
+GNULIB_STPNCPY
+GNULIB_STPCPY
+GNULIB_RAWMEMCHR
+GNULIB_MEMRCHR
+GNULIB_MEMPCPY
+GNULIB_MEMMEM
+GNULIB_MEMCHR
+GNULIB_FFSLL
+GNULIB_FFSL
NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
NEXT_INTTYPES_H
UINT64_MAX_EQ_ULONG_MAX
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
HAVE_STRTOD
HAVE_DECL_SETENV
HAVE_SETENV
+HAVE_SECURE_GETENV
HAVE_RPMATCH
HAVE_REALPATH
HAVE_RANDOM_R
GNULIB_STRTOLL
GNULIB_STRTOD
GNULIB_SETENV
+GNULIB_SECURE_GETENV
GNULIB_RPMATCH
GNULIB_REALPATH
GNULIB_REALLOC_POSIX
GNULIB_CALLOC_POSIX
GNULIB_ATOLL
GNULIB__EXIT
+REPLACE_UTIMENSAT
+REPLACE_STAT
+REPLACE_MKNOD
+REPLACE_MKFIFO
+REPLACE_MKDIR
+REPLACE_LSTAT
+REPLACE_FUTIMENS
+REPLACE_FSTATAT
+REPLACE_FSTAT
+HAVE_UTIMENSAT
+HAVE_MKNODAT
+HAVE_MKNOD
+HAVE_MKFIFOAT
+HAVE_MKFIFO
+HAVE_MKDIRAT
+HAVE_LSTAT
+HAVE_LCHMOD
+HAVE_FUTIMENS
+HAVE_FSTATAT
+HAVE_FCHMODAT
+GNULIB_UTIMENSAT
+GNULIB_STAT
+GNULIB_MKNODAT
+GNULIB_MKNOD
+GNULIB_MKFIFOAT
+GNULIB_MKFIFO
+GNULIB_MKDIRAT
+GNULIB_LSTAT
+GNULIB_LCHMOD
+GNULIB_FUTIMENS
+GNULIB_FSTATAT
+GNULIB_FSTAT
+GNULIB_FCHMODAT
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
+NEXT_FCNTL_H
+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
EXECINFO_H
+HAVE_DIRENT_H
+NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
+NEXT_DIRENT_H
+PRAGMA_COLUMNS
+PRAGMA_SYSTEM_HEADER
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE
+INCLUDE_NEXT
+REPLACE_FDOPENDIR
+REPLACE_DIRFD
+REPLACE_CLOSEDIR
+REPLACE_OPENDIR
+HAVE_ALPHASORT
+HAVE_SCANDIR
+HAVE_FDOPENDIR
+HAVE_DECL_FDOPENDIR
+HAVE_DECL_DIRFD
+HAVE_CLOSEDIR
+HAVE_REWINDDIR
+HAVE_READDIR
+HAVE_OPENDIR
+GNULIB_ALPHASORT
+GNULIB_SCANDIR
+GNULIB_FDOPENDIR
+GNULIB_DIRFD
+GNULIB_CLOSEDIR
+GNULIB_REWINDDIR
+GNULIB_READDIR
+GNULIB_OPENDIR
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
UNISTD_H_HAVE_WINSOCK2_H
REPLACE_WRITE
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.93 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.93:";;
+ 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.93
+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.93, 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_header_list " sys/un.h"
as_fn_append ac_func_list " tzset"
as_fn_append ac_func_list " readlinkat"
+as_fn_append ac_header_list " dirent.h"
as_fn_append ac_header_list " execinfo.h"
+as_fn_append ac_func_list " faccessat"
+as_fn_append ac_func_list " fdopendir"
+as_fn_append ac_header_list " stdio_ext.h"
+as_fn_append ac_func_list " __fpending"
+as_fn_append ac_func_list " fstatat"
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="$@"
+## Add some environment variables, if they were passed via the environment
+## rather than on the command-line.
+for var in CFLAGS CPPFLAGS LDFLAGS; do
+ case "$emacs_config_options" in
+ *$var=*) continue ;;
+ esac
+ eval val="\$${var}"
+ test x"$val" = x && continue
+ emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=\"$val\""
+done
+
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.93'
+ 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.
-
-
ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
if test "x$ac_cv_header_minix_config_h" = x""yes; then :
MINIX=yes
$as_echo "#define _MINIX 1" >>confdefs.h
- fi
-
- case "$host_os" in
- hpux*)
-$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
- ;;
- esac
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
$as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
+$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
+if test "${ac_cv_should_define__xopen_source+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_should_define__xopen_source=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <wchar.h>
+ mbstate_t x;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_should_define__xopen_source=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
+$as_echo "$ac_cv_should_define__xopen_source" >&6; }
+ test $ac_cv_should_define__xopen_source = yes &&
+ $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+
fi
+$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
+
fi
case $ac_cv_prog_cc_stdc in #(
# Code from module alloca-opt:
# Code from module allocator:
+ # Code from module at-internal:
# Code from module c-ctype:
# 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 crypto/sha512:
+ # Code from module dirent:
# Code from module dosname:
# Code from module dtoastr:
# 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 fdopendir:
# Code from module filemode:
+ # Code from module fpending:
+ # Code from module fstatat:
+ # 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 lstat:
# Code from module manywarnings:
+ # Code from module memrchr:
# Code from module mktime:
# Code from module multiarch:
# Code from module nocrash:
+ # Code from module openat-h:
# Code from module pathmax:
# Code from module pselect:
# Code from module pthread_sigmask:
+ # Code from module putenv:
# Code from module readlink:
+ # Code from module readlinkat:
+ # 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 stdio:
# Code from module stdlib:
# Code from module strftime:
+ # Code from module string:
# Code from module strtoimax:
# Code from module strtoll:
# Code from module strtoull:
# 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
-HAVE_XAW3D=no
-LUCID_LIBW=
-if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
- if test "$with_xaw3d" != no; then
- if test "${emacs_cv_xaw3d+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+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
-#include <X11/Intrinsic.h>
-#include <X11/Xaw3d/Simple.h>
+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
+ if test "$with_xaw3d" != no; then
+ if test "${emacs_cv_xaw3d+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <X11/Intrinsic.h>
+#include <X11/Xaw3d/Simple.h>
int
main ()
{
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
-
-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; }
-
-if test $emacs_glibc = yes; then
-
- emacs_pending_output=unknown
-
- 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)
-
case $opsys in
darwin) $as_echo "#define TAB3 OXTABS" >>confdefs.h
;;
;;
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 | hpux* | unixware)
- $as_echo "#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE" >>confdefs.h
-
- ;;
-
gnu-linux | gnu-kfreebsd )
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
if ac_fn_c_try_cpp "$LINENO"; then :
$as_echo "#define GC_SETJMP_WORKS 1" >>confdefs.h
-else
- $as_echo "#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE" >>confdefs.h
-
fi
rm -f conftest.err conftest.$ac_ext
;;
-
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/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -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; }
-if test "${gl_cv_func_c99_strtold+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* On HP-UX before 11.23, strtold returns a struct instead of
- long double. Reject implementations like that, by requiring
- compatibility with the C99 prototype. */
- #include <stdlib.h>
- static long double (*p) (char const *, char **) = strtold;
- static long double
- test (char const *nptr, char **endptr)
- {
- long double r;
- r = strtold (nptr, endptr);
- return r;
- }
-int
-main ()
-{
-return test ("1.0", NULL) != 1 || p ("1.0", NULL) != 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- gl_cv_func_c99_strtold=yes
-else
- gl_cv_func_c99_strtold=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_c99_strtold" >&5
-$as_echo "$gl_cv_func_c99_strtold" >&6; }
- if test $gl_cv_func_c99_strtold = yes; then
-
-$as_echo "#define HAVE_C99_STRTOLD 1" >>confdefs.h
-
- fi
-
GNULIB_CHDIR=0;
GNULIB_CHOWN=0;
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
-$as_echo_n "checking if environ is properly declared... " >&6; }
- if test "${gt_cv_var_environ_declaration+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if HAVE_UNISTD_H
- #include <unistd.h>
- #endif
- /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
- #include <stdlib.h>
-
- extern struct { int foo; } environ;
-int
-main ()
-{
-environ.foo = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gt_cv_var_environ_declaration=no
-else
- gt_cv_var_environ_declaration=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
-$as_echo "$gt_cv_var_environ_declaration" >&6; }
- if test $gt_cv_var_environ_declaration = yes; then
-
-$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
-
- fi
-
-
- if test $gt_cv_var_environ_declaration != yes; then
- HAVE_DECL_ENVIRON=0
- 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;
+ GNULIB_OPENDIR=0;
+ GNULIB_READDIR=0;
+ GNULIB_REWINDDIR=0;
+ GNULIB_CLOSEDIR=0;
+ GNULIB_DIRFD=0;
+ GNULIB_FDOPENDIR=0;
+ GNULIB_SCANDIR=0;
+ GNULIB_ALPHASORT=0;
+ HAVE_OPENDIR=1;
+ HAVE_READDIR=1;
+ HAVE_REWINDDIR=1;
+ HAVE_CLOSEDIR=1;
+ HAVE_DECL_DIRFD=1;
+ HAVE_DECL_FDOPENDIR=1;
+ HAVE_FDOPENDIR=1;
+ HAVE_SCANDIR=1;
+ HAVE_ALPHASORT=1;
+ REPLACE_OPENDIR=0;
+ REPLACE_CLOSEDIR=0;
+ REPLACE_DIRFD=0;
+ REPLACE_FDOPENDIR=0;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtold conforms to C99" >&5
+$as_echo_n "checking whether strtold conforms to C99... " >&6; }
+if test "${gl_cv_func_c99_strtold+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* On HP-UX before 11.23, strtold returns a struct instead of
+ long double. Reject implementations like that, by requiring
+ compatibility with the C99 prototype. */
+ #include <stdlib.h>
+ static long double (*p) (char const *, char **) = strtold;
+ static long double
+ test (char const *nptr, char **endptr)
+ {
+ long double r;
+ r = strtold (nptr, endptr);
+ return r;
+ }
+int
+main ()
+{
+return test ("1.0", NULL) != 1 || p ("1.0", NULL) != 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_c99_strtold=yes
+else
+ gl_cv_func_c99_strtold=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_c99_strtold" >&5
+$as_echo "$gl_cv_func_c99_strtold" >&6; }
+ if test $gl_cv_func_c99_strtold = yes; then
+$as_echo "#define HAVE_C99_STRTOLD 1" >>confdefs.h
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
+$as_echo_n "checking if environ is properly declared... " >&6; }
+ if test "${gt_cv_var_environ_declaration+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
+ #include <stdlib.h>
- if test $gl_cv_have_include_next = yes; then
- gl_cv_next_getopt_h='<'getopt.h'>'
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
-$as_echo_n "checking absolute name of <getopt.h>... " >&6; }
-if test "${gl_cv_next_getopt_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
+ extern struct { int foo; } environ;
+int
+main ()
+{
+environ.foo = 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_var_environ_declaration=no
else
+ gt_cv_var_environ_declaration=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
- if test $ac_cv_header_getopt_h = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
+$as_echo "$gt_cv_var_environ_declaration" >&6; }
+ if test $gt_cv_var_environ_declaration = yes; then
+$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <getopt.h>
+ fi
-_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'
+ if test $gt_cv_var_environ_declaration != yes; then
+ HAVE_DECL_ENVIRON=0
+ fi
- gl_header_literal_regex=`echo 'getopt.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_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
- sed -n "$gl_absolute_header_sed"`'"'
- else
- gl_cv_next_getopt_h='<'getopt.h'>'
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
-$as_echo "$gl_cv_next_getopt_h" >&6; }
- fi
- NEXT_GETOPT_H=$gl_cv_next_getopt_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='<'getopt.h'>'
- else
- # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_getopt_h
- fi
- NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive
- if test $ac_cv_header_getopt_h = yes; then
- HAVE_GETOPT_H=1
- else
- HAVE_GETOPT_H=0
- fi
+ 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;
- gl_replace_getopt=
- if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
- for ac_header in getopt.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
-if test "x$ac_cv_header_getopt_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_H 1
+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
- gl_replace_getopt=yes
+ 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; }
-done
+ if test $ac_cv_struct_st_dm_mode = yes; then
+
+$as_echo "#define HAVE_ST_DM_MODE 1" >>confdefs.h
fi
- if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
- for ac_func in getopt_long_only
-do :
- ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
-if test "x$ac_cv_func_getopt_long_only" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_LONG_ONLY 1
-_ACEOF
+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
- gl_replace_getopt=yes
+ ac_have_decl=0
fi
-done
- fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRMODE $ac_have_decl
+_ACEOF
- if test -z "$gl_replace_getopt"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
-$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
-if test "${gl_cv_func_getopt_posix+set}" = set; then :
+
+
+
+
+
+ GNULIB_FCHMODAT=0;
+ GNULIB_FSTAT=0;
+ GNULIB_FSTATAT=0;
+ GNULIB_FUTIMENS=0;
+ GNULIB_LCHMOD=0;
+ GNULIB_LSTAT=0;
+ GNULIB_MKDIRAT=0;
+ GNULIB_MKFIFO=0;
+ GNULIB_MKFIFOAT=0;
+ GNULIB_MKNOD=0;
+ GNULIB_MKNODAT=0;
+ GNULIB_STAT=0;
+ GNULIB_UTIMENSAT=0;
+ HAVE_FCHMODAT=1;
+ HAVE_FSTATAT=1;
+ HAVE_FUTIMENS=1;
+ HAVE_LCHMOD=1;
+ HAVE_LSTAT=1;
+ HAVE_MKDIRAT=1;
+ HAVE_MKFIFO=1;
+ HAVE_MKFIFOAT=1;
+ HAVE_MKNOD=1;
+ HAVE_MKNODAT=1;
+ HAVE_UTIMENSAT=1;
+ REPLACE_FSTAT=0;
+ REPLACE_FSTATAT=0;
+ REPLACE_FUTIMENS=0;
+ REPLACE_LSTAT=0;
+ REPLACE_MKDIR=0;
+ REPLACE_MKFIFO=0;
+ REPLACE_MKNOD=0;
+ REPLACE_STAT=0;
+ REPLACE_UTIMENSAT=0;
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
+if test "${gl_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
$as_echo_n "(cached) " >&6
else
+ rm -f conftest.sym conftest.file
+ echo >conftest.file
+ if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+ esac
- if test $cross_compiling = no; then
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run test program while cross compiling
-See \`config.log' for more details." "$LINENO" 5; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
+$ac_includes_default
int
main ()
{
- static char program[] = "program";
- static char a[] = "-a";
- static char foo[] = "foo";
- static char bar[] = "bar";
- char *argv[] = { program, a, foo, bar, NULL };
- int c;
+struct stat sbuf;
+ /* Linux will dereference the symlink and fail, as required by
+ POSIX. That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
+ return lstat ("conftest.sym/", &sbuf) == 0;
- c = getopt (4, argv, "ab");
- if (!(c == 'a'))
- return 1;
- c = getopt (4, argv, "ab");
- if (!(c == -1))
- return 2;
- if (!(optind == 2))
- return 3;
+ ;
return 0;
}
-
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_getopt_posix=maybe
+ gl_cv_func_lstat_dereferences_slashed_symlink=yes
else
- gl_cv_func_getopt_posix=no
+ gl_cv_func_lstat_dereferences_slashed_symlink=no
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 $gl_cv_func_getopt_posix = maybe; then
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ else
+ # If the 'ln -s' command failed, then we probably don't even
+ # have an lstat function.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
+ fi
+ rm -f conftest.sym conftest.file
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+ case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *yes)
+
+cat >>confdefs.h <<_ACEOF
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+_ACEOF
+
+ ;;
+ esac
+
+
+
+
+ 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_SECURE_GETENV=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_SECURE_GETENV=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;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_getopt_h='<'getopt.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
+$as_echo_n "checking absolute name of <getopt.h>... " >&6; }
+if test "${gl_cv_next_getopt_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_getopt_h = yes; then
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <getopt.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 'getopt.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_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`'"'
+ else
+ gl_cv_next_getopt_h='<'getopt.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
+$as_echo "$gl_cv_next_getopt_h" >&6; }
+ fi
+ NEXT_GETOPT_H=$gl_cv_next_getopt_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='<'getopt.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_getopt_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_getopt_h = yes; then
+ HAVE_GETOPT_H=1
+ else
+ HAVE_GETOPT_H=0
+ fi
+
+
+ gl_replace_getopt=
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ for ac_header in getopt.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
+if test "x$ac_cv_header_getopt_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_H 1
+_ACEOF
+
+else
+ gl_replace_getopt=yes
+fi
+
+done
+
+ fi
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ for ac_func in getopt_long_only
+do :
+ ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
+if test "x$ac_cv_func_getopt_long_only" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_LONG_ONLY 1
+_ACEOF
+
+else
+ gl_replace_getopt=yes
+fi
+done
+
+ fi
+
+ if test -z "$gl_replace_getopt"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
+$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
+if test "${gl_cv_func_getopt_posix+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $cross_compiling = no; then
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot run test program while cross compiling
See \`config.log' for more details." "$LINENO" 5; }
else
main ()
{
static char program[] = "program";
- static char donald[] = "donald";
- static char p[] = "-p";
- static char billy[] = "billy";
- static char duck[] = "duck";
static char a[] = "-a";
+ static char foo[] = "foo";
static char bar[] = "bar";
- char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+ char *argv[] = { program, a, foo, bar, NULL };
int c;
- c = getopt (7, argv, "+abp:q:");
+ c = getopt (4, argv, "ab");
+ if (!(c == 'a'))
+ return 1;
+ c = getopt (4, argv, "ab");
if (!(c == -1))
- return 4;
- if (!(strcmp (argv[0], "program") == 0))
- return 5;
- if (!(strcmp (argv[1], "donald") == 0))
- return 6;
- if (!(strcmp (argv[2], "-p") == 0))
- return 7;
- if (!(strcmp (argv[3], "billy") == 0))
- return 8;
- if (!(strcmp (argv[4], "duck") == 0))
- return 9;
- if (!(strcmp (argv[5], "-a") == 0))
- return 10;
+ return 2;
+ if (!(optind == 2))
+ return 3;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getopt_posix=maybe
+else
+ gl_cv_func_getopt_posix=no
+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 $gl_cv_func_getopt_posix = maybe; then
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run test program while cross compiling
+See \`config.log' for more details." "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+ int c;
+
+ c = getopt (7, argv, "+abp:q:");
+ if (!(c == -1))
+ return 4;
+ if (!(strcmp (argv[0], "program") == 0))
+ return 5;
+ if (!(strcmp (argv[1], "donald") == 0))
+ return 6;
+ if (!(strcmp (argv[2], "-p") == 0))
+ return 7;
+ if (!(strcmp (argv[3], "billy") == 0))
+ return 8;
+ if (!(strcmp (argv[4], "duck") == 0))
+ return 9;
+ if (!(strcmp (argv[5], "-a") == 0))
+ return 10;
if (!(strcmp (argv[6], "bar") == 0))
return 11;
if (!(optind == 1))
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_getopt_gnu=yes
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getopt_gnu=yes
+else
+ gl_cv_func_getopt_gnu=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ case $gl_had_POSIXLY_CORRECT in
+ exported) ;;
+ yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;;
+ *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
+$as_echo "$gl_cv_func_getopt_gnu" >&6; }
+ if test "$gl_cv_func_getopt_gnu" != yes; then
+ gl_replace_getopt=yes
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5
+$as_echo_n "checking for working GNU getopt_long function... " >&6; }
+if test "${gl_cv_func_getopt_long_gnu+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+ *) gl_cv_func_getopt_long_gnu="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+
+int
+main ()
+{
+static const struct option long_options[] =
+ {
+ { "xtremely-",no_argument, NULL, 1003 },
+ { "xtra", no_argument, NULL, 1001 },
+ { "xtreme", no_argument, NULL, 1002 },
+ { "xtremely", no_argument, NULL, 1003 },
+ { NULL, 0, NULL, 0 }
+ };
+ /* This code fails on OpenBSD 5.0. */
+ {
+ static char program[] = "program";
+ static char xtremel[] = "--xtremel";
+ char *argv[] = { program, xtremel, NULL };
+ int option_index;
+ optind = 1; opterr = 0;
+ if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+ return 1;
+ }
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getopt_long_gnu=yes
+else
+ gl_cv_func_getopt_long_gnu=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_getopt_long_gnu" >&5
+$as_echo "$gl_cv_func_getopt_long_gnu" >&6; }
+ case "$gl_cv_func_getopt_long_gnu" in
+ *yes) ;;
+ *) gl_replace_getopt=yes ;;
+ esac
+ fi
+ fi
+
+
+
+
+
+
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+
+ if test $REPLACE_GETOPT = 1; then
+
+ GETOPT_H=getopt.h
+
+$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+
+
+
+ fi
+
+ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getenv" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETENV $ac_have_decl
+_ACEOF
+
+:
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
+if test "${ac_cv_c_restrict+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_restrict=no
+ # The order here caters to the fact that C++ does not require restrict.
+ for ac_kw in __restrict __restrict__ _Restrict restrict; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+typedef int * int_ptr;
+ int foo (int_ptr $ac_kw ip) {
+ return ip[0];
+ }
+int
+main ()
+{
+int s[1];
+ int * $ac_kw t = s;
+ t[0] = 0;
+ return foo(t)
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_restrict=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_restrict" != no && break
+ done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+$as_echo "$ac_cv_c_restrict" >&6; }
+
+ case $ac_cv_c_restrict in
+ restrict) ;;
+ no) $as_echo "#define restrict /**/" >>confdefs.h
+ ;;
+ *) cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
+_ACEOF
+ ;;
+ esac
+
+
+ GNULIB_GETTIMEOFDAY=0;
+ HAVE_GETTIMEOFDAY=1;
+ HAVE_STRUCT_TIMEVAL=1;
+ HAVE_SYS_TIME_H=1;
+ REPLACE_GETTIMEOFDAY=0;
+ REPLACE_STRUCT_TIMEVAL=0;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_time_h='<'sys/time.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
+$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
+if test "${gl_cv_next_sys_time_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_time_h = yes; then
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.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 'sys/time.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_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`'"'
+ else
+ gl_cv_next_sys_time_h='<'sys/time.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
+$as_echo "$gl_cv_next_sys_time_h" >&6; }
+ fi
+ NEXT_SYS_TIME_H=$gl_cv_next_sys_time_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='<'sys/time.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_time_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
+
+
+
+
+
+ if test $ac_cv_header_sys_time_h != yes; then
+ HAVE_SYS_TIME_H=0
+ fi
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
+$as_echo_n "checking for struct timeval... " >&6; }
+if test "${gl_cv_sys_struct_timeval+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #include <time.h>
+ #if HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif
+
+int
+main ()
+{
+static struct timeval x; x.tv_sec = x.tv_usec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timeval=yes
+else
+ gl_cv_sys_struct_timeval=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
+$as_echo "$gl_cv_sys_struct_timeval" >&6; }
+ if test $gl_cv_sys_struct_timeval != yes; then
+ HAVE_STRUCT_TIMEVAL=0
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
+$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
+if test "${gl_cv_sys_struct_timeval_tv_sec+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #include <time.h>
+ #if HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif
+
+int
+main ()
+{
+static struct timeval x;
+ typedef int verify_tv_sec_type[
+ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+ ];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timeval_tv_sec=yes
+else
+ gl_cv_sys_struct_timeval_tv_sec=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
+$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
+ if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+ REPLACE_STRUCT_TIMEVAL=1
+ fi
+ fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_unsigned_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
+int
+main ()
+{
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ ac_cv_type_unsigned_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if test "${ac_cv_type_long_long_int+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+ if test $ac_cv_type_long_long_int = yes; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ #ifndef LLONG_MAX
+ # define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ # define LLONG_MAX (HALF - 1 + HALF)
+ #endif
+int
+main ()
+{
+long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_type_long_long_int=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
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
+$as_echo "$ac_cv_type_long_long_int" >&6; }
+ if test $ac_cv_type_long_long_int = yes; then
+
+$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+ gl_cv_c_multiarch=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$arch" || test "$arch" = "$word"; then
+ arch="$word"
+ else
+ gl_cv_c_multiarch=yes
+ fi
+ ;;
+ esac
+ prev=
+ else
+ if test "x$word" = "x-arch"; then
+ prev=arch
+ fi
+ fi
+ done
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $gl_cv_c_multiarch = yes; then
+ APPLE_UNIVERSAL_BUILD=1
+ else
+ APPLE_UNIVERSAL_BUILD=0
+ fi
+
+
+
+
+
+ if test $ac_cv_type_long_long_int = yes; then
+ HAVE_LONG_LONG_INT=1
+ else
+ HAVE_LONG_LONG_INT=0
+ fi
+
+
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+ HAVE_UNSIGNED_LONG_LONG_INT=1
+ else
+ HAVE_UNSIGNED_LONG_LONG_INT=0
+ fi
+
+
+
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+
+
+ if test $ac_cv_header_inttypes_h = yes; then
+ HAVE_INTTYPES_H=1
+ else
+ HAVE_INTTYPES_H=0
+ fi
+
+
+ if test $ac_cv_header_sys_types_h = yes; then
+ HAVE_SYS_TYPES_H=1
+ else
+ HAVE_SYS_TYPES_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdint_h='<'stdint.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
+$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
+if test "${gl_cv_next_stdint_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_stdint_h = yes; then
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.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 'stdint.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_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`'"'
+ else
+ gl_cv_next_stdint_h='<'stdint.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
+$as_echo "$gl_cv_next_stdint_h" >&6; }
+ fi
+ NEXT_STDINT_H=$gl_cv_next_stdint_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='<'stdint.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdint_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_stdint_h = yes; then
+ HAVE_STDINT_H=1
+ else
+ HAVE_STDINT_H=0
+ fi
+
+
+ if test $ac_cv_header_stdint_h = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
+$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
+if test "${gl_cv_header_working_stdint_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_header_working_stdint_h=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
+
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+
+#ifdef INT8_MAX
+int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
+#endif
+#ifdef INT16_MAX
+int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
+#endif
+#ifdef INT32_MAX
+int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
+#endif
+#ifdef INT64_MAX
+int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
+#endif
+#ifdef UINT8_MAX
+uint8_t b1 = UINT8_MAX;
+#else
+typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+#endif
+#ifdef UINT16_MAX
+uint16_t b2 = UINT16_MAX;
+#endif
+#ifdef UINT32_MAX
+uint32_t b3 = UINT32_MAX;
+#endif
+#ifdef UINT64_MAX
+uint64_t b4 = UINT64_MAX;
+#endif
+int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
+int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
+int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
+int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
+uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
+uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
+uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
+uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
+int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
+int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
+int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
+int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
+uint_fast8_t f1 = UINT_FAST8_MAX;
+uint_fast16_t f2 = UINT_FAST16_MAX;
+uint_fast32_t f3 = UINT_FAST32_MAX;
+uint_fast64_t f4 = UINT_FAST64_MAX;
+#ifdef INTPTR_MAX
+intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
+#endif
+#ifdef UINTPTR_MAX
+uintptr_t h = UINTPTR_MAX;
+#endif
+intmax_t i = INTMAX_MAX;
+uintmax_t j = UINTMAX_MAX;
+
+#include <limits.h> /* for CHAR_BIT */
+#define TYPE_MINIMUM(t) \
+ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t) \
+ ((t) ((t) 0 < (t) -1 \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+struct s {
+ int check_PTRDIFF:
+ PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
+ && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
+ ? 1 : -1;
+ /* Detect bug in FreeBSD 6.0 / ia64. */
+ int check_SIG_ATOMIC:
+ SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
+ && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
+ ? 1 : -1;
+ int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
+ int check_WCHAR:
+ WCHAR_MIN == TYPE_MINIMUM (wchar_t)
+ && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
+ ? 1 : -1;
+ /* Detect bug in mingw. */
+ int check_WINT:
+ WINT_MIN == TYPE_MINIMUM (wint_t)
+ && WINT_MAX == TYPE_MAXIMUM (wint_t)
+ ? 1 : -1;
+
+ /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
+ int check_UINT8_C:
+ (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+ int check_UINT16_C:
+ (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+
+ /* Detect bugs in OpenBSD 3.9 stdint.h. */
+#ifdef UINT8_MAX
+ int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+#endif
+#ifdef UINT16_MAX
+ int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+#endif
+#ifdef UINT32_MAX
+ int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#endif
+#ifdef UINT64_MAX
+ int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#endif
+ int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+ int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+ int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+ int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+ int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+ int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+ int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+ int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+ int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+ int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+ int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+};
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if test "$cross_compiling" = yes; then :
+ gl_cv_header_working_stdint_h=yes
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+
+#include <stdio.h>
+#include <string.h>
+#define MVAL(macro) MVAL1(macro)
+#define MVAL1(expression) #expression
+static const char *macro_values[] =
+ {
+#ifdef INT8_MAX
+ MVAL (INT8_MAX),
+#endif
+#ifdef INT16_MAX
+ MVAL (INT16_MAX),
+#endif
+#ifdef INT32_MAX
+ MVAL (INT32_MAX),
+#endif
+#ifdef INT64_MAX
+ MVAL (INT64_MAX),
+#endif
+#ifdef UINT8_MAX
+ MVAL (UINT8_MAX),
+#endif
+#ifdef UINT16_MAX
+ MVAL (UINT16_MAX),
+#endif
+#ifdef UINT32_MAX
+ MVAL (UINT32_MAX),
+#endif
+#ifdef UINT64_MAX
+ MVAL (UINT64_MAX),
+#endif
+ NULL
+ };
+
+int
+main ()
+{
+
+ const char **mv;
+ for (mv = macro_values; *mv != NULL; mv++)
+ {
+ const char *value = *mv;
+ /* Test whether it looks like a cast expression. */
+ if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
+ || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
+ || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
+ || strncmp (value, "((int)"/*)*/, 6) == 0
+ || strncmp (value, "((signed short)"/*)*/, 15) == 0
+ || strncmp (value, "((signed char)"/*)*/, 14) == 0)
+ return mv - macro_values + 1;
+ }
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_header_working_stdint_h=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
+$as_echo "$gl_cv_header_working_stdint_h" >&6; }
+ fi
+ if test "$gl_cv_header_working_stdint_h" = yes; then
+ STDINT_H=
+ else
+ for ac_header in sys/inttypes.h sys/bitypes.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_sys_inttypes_h = yes; then
+ HAVE_SYS_INTTYPES_H=1
+ else
+ HAVE_SYS_INTTYPES_H=0
+ fi
+
+ if test $ac_cv_header_sys_bitypes_h = yes; then
+ HAVE_SYS_BITYPES_H=1
+ else
+ HAVE_SYS_BITYPES_H=0
+ fi
+
+
+
+
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+
+
+ for gltype in ptrdiff_t size_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+$as_echo_n "checking for bit size of $gltype... " >&6; }
+if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+#include <limits.h>"; then :
+
+else
+ result=unknown
+fi
+
+ eval gl_cv_bitsizeof_${gltype}=\$result
+
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval result=\$gl_cv_bitsizeof_${gltype}
+ if test $result = unknown; then
+ result=0
+ fi
+ GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
+_ACEOF
+
+ eval BITSIZEOF_${GLTYPE}=\$result
+ done
+
+
+ fi
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+$as_echo_n "checking for bit size of $gltype... " >&6; }
+if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+#include <limits.h>"; then :
+
+else
+ result=unknown
+fi
+
+ eval gl_cv_bitsizeof_${gltype}=\$result
+
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval result=\$gl_cv_bitsizeof_${gltype}
+ if test $result = unknown; then
+ result=0
+ fi
+ GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
+_ACEOF
+
+ eval BITSIZEOF_${GLTYPE}=\$result
+ done
+
+
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
+$as_echo_n "checking whether $gltype is signed... " >&6; }
+if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ result=yes
+else
+ result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval gl_cv_type_${gltype}_signed=\$result
+
+fi
+eval ac_res=\$gl_cv_type_${gltype}_signed
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval result=\$gl_cv_type_${gltype}_signed
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ if test "$result" = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGNED_${GLTYPE} 1
+_ACEOF
+
+ eval HAVE_SIGNED_${GLTYPE}=1
+ else
+ eval HAVE_SIGNED_${GLTYPE}=0
+ fi
+ done
+
+
+ gl_cv_type_ptrdiff_t_signed=yes
+ gl_cv_type_size_t_signed=no
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+
+
+ for gltype in ptrdiff_t size_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
+if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval gl_cv_type_${gltype}_suffix=no
+ eval result=\$gl_cv_type_${gltype}_signed
+ if test "$result" = yes; then
+ glsufu=
+ else
+ glsufu=u
+ fi
+ for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+ case $glsuf in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ i64) gltype1='__int64';;
+ u) gltype1='unsigned int';;
+ ul) gltype1='unsigned long int';;
+ ull) gltype1='unsigned long long int';;
+ ui64)gltype1='unsigned __int64';;
+ esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+ extern $gltype foo;
+ extern $gltype1 foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval gl_cv_type_${gltype}_suffix=\$glsuf
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
+ done
+fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" = no && result=
+ eval ${GLTYPE}_SUFFIX=\$result
+ cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
+
+ done
+
+
+ fi
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
+if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval gl_cv_type_${gltype}_suffix=no
+ eval result=\$gl_cv_type_${gltype}_signed
+ if test "$result" = yes; then
+ glsufu=
+ else
+ glsufu=u
+ fi
+ for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+ case $glsuf in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ i64) gltype1='__int64';;
+ u) gltype1='unsigned int';;
+ ul) gltype1='unsigned long int';;
+ ull) gltype1='unsigned long long int';;
+ ui64)gltype1='unsigned __int64';;
+ esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <stdio.h>
+ # include <time.h>
+ # include <wchar.h>
+ #endif
+
+ extern $gltype foo;
+ extern $gltype1 foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval gl_cv_type_${gltype}_suffix=\$glsuf
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
+ done
+fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" = no && result=
+ eval ${GLTYPE}_SUFFIX=\$result
+ cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
+
+ done
+
+
+
+ if test $BITSIZEOF_WINT_T -lt 32; then
+ BITSIZEOF_WINT_T=32
+ fi
+
+ STDINT_H=stdint.h
+ fi
+
+ if test -n "$STDINT_H"; then
+ GL_GENERATE_STDINT_H_TRUE=
+ GL_GENERATE_STDINT_H_FALSE='#'
+else
+ GL_GENERATE_STDINT_H_TRUE='#'
+ GL_GENERATE_STDINT_H_FALSE=
+fi
+
+
+
+
+
+ GNULIB_IMAXABS=0;
+ GNULIB_IMAXDIV=0;
+ GNULIB_STRTOIMAX=0;
+ GNULIB_STRTOUMAX=0;
+ HAVE_DECL_IMAXABS=1;
+ HAVE_DECL_IMAXDIV=1;
+ HAVE_DECL_STRTOIMAX=1;
+ HAVE_DECL_STRTOUMAX=1;
+ REPLACE_STRTOIMAX=0;
+ INT32_MAX_LT_INTMAX_MAX=1;
+ INT64_MAX_EQ_LONG_MAX='defined _LP64';
+ PRI_MACROS_BROKEN=0;
+ PRIPTR_PREFIX=__PRIPTR_PREFIX;
+ UINT32_MAX_LT_UINTMAX_MAX=1;
+ UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_inttypes_h='<'inttypes.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
+$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
+if test "${gl_cv_next_inttypes_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_inttypes_h = yes; then
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <inttypes.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 'inttypes.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_inttypes_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`'"'
+ else
+ gl_cv_next_inttypes_h='<'inttypes.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
+$as_echo "$gl_cv_next_inttypes_h" >&6; }
+ fi
+ NEXT_INTTYPES_H=$gl_cv_next_inttypes_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='<'inttypes.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_inttypes_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+ case "$host_os" in
+ mingw*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
+$as_echo_n "checking for 64-bit off_t... " >&6; }
+if test "${gl_cv_type_off_t_64+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_type_off_t_64=yes
+else
+ gl_cv_type_off_t_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
+$as_echo "$gl_cv_type_off_t_64" >&6; }
+ if test $gl_cv_type_off_t_64 = no; then
+ WINDOWS_64_BIT_OFF_T=1
+ else
+ WINDOWS_64_BIT_OFF_T=0
+ fi
+ WINDOWS_64_BIT_ST_SIZE=1
+ ;;
+ *)
+ WINDOWS_64_BIT_OFF_T=0
+ WINDOWS_64_BIT_ST_SIZE=0
+ ;;
+ esac
+
+
+
+
+ GNULIB_FFSL=0;
+ GNULIB_FFSLL=0;
+ GNULIB_MEMCHR=0;
+ GNULIB_MEMMEM=0;
+ GNULIB_MEMPCPY=0;
+ GNULIB_MEMRCHR=0;
+ GNULIB_RAWMEMCHR=0;
+ GNULIB_STPCPY=0;
+ GNULIB_STPNCPY=0;
+ GNULIB_STRCHRNUL=0;
+ GNULIB_STRDUP=0;
+ GNULIB_STRNCAT=0;
+ GNULIB_STRNDUP=0;
+ GNULIB_STRNLEN=0;
+ GNULIB_STRPBRK=0;
+ GNULIB_STRSEP=0;
+ GNULIB_STRSTR=0;
+ GNULIB_STRCASESTR=0;
+ GNULIB_STRTOK_R=0;
+ GNULIB_MBSLEN=0;
+ GNULIB_MBSNLEN=0;
+ GNULIB_MBSCHR=0;
+ GNULIB_MBSRCHR=0;
+ GNULIB_MBSSTR=0;
+ GNULIB_MBSCASECMP=0;
+ GNULIB_MBSNCASECMP=0;
+ GNULIB_MBSPCASECMP=0;
+ GNULIB_MBSCASESTR=0;
+ GNULIB_MBSCSPN=0;
+ GNULIB_MBSPBRK=0;
+ GNULIB_MBSSPN=0;
+ GNULIB_MBSSEP=0;
+ GNULIB_MBSTOK_R=0;
+ GNULIB_STRERROR=0;
+ GNULIB_STRERROR_R=0;
+ GNULIB_STRSIGNAL=0;
+ GNULIB_STRVERSCMP=0;
+ HAVE_MBSLEN=0;
+ HAVE_FFSL=1;
+ HAVE_FFSLL=1;
+ HAVE_MEMCHR=1;
+ HAVE_DECL_MEMMEM=1;
+ HAVE_MEMPCPY=1;
+ HAVE_DECL_MEMRCHR=1;
+ HAVE_RAWMEMCHR=1;
+ HAVE_STPCPY=1;
+ HAVE_STPNCPY=1;
+ HAVE_STRCHRNUL=1;
+ HAVE_DECL_STRDUP=1;
+ HAVE_DECL_STRNDUP=1;
+ HAVE_DECL_STRNLEN=1;
+ HAVE_STRPBRK=1;
+ HAVE_STRSEP=1;
+ HAVE_STRCASESTR=1;
+ HAVE_DECL_STRTOK_R=1;
+ HAVE_DECL_STRERROR_R=1;
+ HAVE_DECL_STRSIGNAL=1;
+ HAVE_STRVERSCMP=1;
+ REPLACE_MEMCHR=0;
+ REPLACE_MEMMEM=0;
+ REPLACE_STPNCPY=0;
+ REPLACE_STRDUP=0;
+ REPLACE_STRSTR=0;
+ REPLACE_STRCASESTR=0;
+ REPLACE_STRCHRNUL=0;
+ REPLACE_STRERROR=0;
+ REPLACE_STRERROR_R=0;
+ REPLACE_STRNCAT=0;
+ REPLACE_STRNDUP=0;
+ REPLACE_STRNLEN=0;
+ REPLACE_STRSIGNAL=0;
+ REPLACE_STRTOK_R=0;
+ UNDEFINE_STRTOK_R=0;
+
+ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
+if test "x$ac_cv_have_decl_memrchr" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MEMRCHR $ac_have_decl
+_ACEOF
+
+
+ GNULIB_MKTIME=0;
+ GNULIB_NANOSLEEP=0;
+ GNULIB_STRPTIME=0;
+ GNULIB_TIMEGM=0;
+ GNULIB_TIME_R=0;
+ HAVE_DECL_LOCALTIME_R=1;
+ HAVE_NANOSLEEP=1;
+ HAVE_STRPTIME=1;
+ HAVE_TIMEGM=1;
+ REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
+ REPLACE_MKTIME=GNULIB_PORTCHECK;
+ REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
+ REPLACE_TIMEGM=GNULIB_PORTCHECK;
+
+
+
+
+ GNULIB_PSELECT=0;
+ GNULIB_SELECT=0;
+ HAVE_PSELECT=1;
+ REPLACE_PSELECT=0;
+ REPLACE_SELECT=0;
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5
+$as_echo_n "checking whether <sys/select.h> is self-contained... " >&6; }
+if test "${gl_cv_header_sys_select_h_selfcontained+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main ()
+{
+struct timeval b;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_sys_select_h_selfcontained=yes
+else
+ gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $gl_cv_header_sys_select_h_selfcontained = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main ()
+{
+int memset; int bzero;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main ()
+{
+
+ #undef memset
+ #define memset nonexistent_memset
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ void *memset (void *, int, unsigned long);
+ #undef bzero
+ #define bzero nonexistent_bzero
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ void bzero (void *, unsigned long);
+ fd_set fds;
+ FD_ZERO (&fds);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5
+$as_echo "$gl_cv_header_sys_select_h_selfcontained" >&6; }
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_select_h='<'sys/select.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5
+$as_echo_n "checking absolute name of <sys/select.h>... " >&6; }
+if test "${gl_cv_next_sys_select_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_select_h = yes; then
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.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 'sys/select.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_sys_select_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`'"'
+ else
+ gl_cv_next_sys_select_h='<'sys/select.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5
+$as_echo "$gl_cv_next_sys_select_h" >&6; }
+ fi
+ NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_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='<'sys/select.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_select_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_sys_select_h = yes; then
+ HAVE_SYS_SELECT_H=1
+ else
+ HAVE_SYS_SELECT_H=0
+ fi
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+
+
+
+
+
+
+
+ GNULIB_PTHREAD_SIGMASK=0;
+ GNULIB_RAISE=0;
+ GNULIB_SIGNAL_H_SIGPIPE=0;
+ GNULIB_SIGPROCMASK=0;
+ GNULIB_SIGACTION=0;
+ HAVE_POSIX_SIGNALBLOCKING=1;
+ HAVE_PTHREAD_SIGMASK=1;
+ HAVE_RAISE=1;
+ HAVE_SIGSET_T=1;
+ HAVE_SIGINFO_T=1;
+ HAVE_SIGACTION=1;
+ HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
+
+ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
+
+ HAVE_SIGHANDLER_T=1;
+ REPLACE_PTHREAD_SIGMASK=0;
+ REPLACE_RAISE=0;
+
+
+
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
+ #include <signal.h>
+ /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
+ #include <sys/types.h>
+
+"
+if test "x$ac_cv_type_sigset_t" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGSET_T 1
+_ACEOF
+
+gl_cv_type_sigset_t=yes
+else
+ gl_cv_type_sigset_t=no
+fi
+
+ if test $gl_cv_type_sigset_t != yes; then
+ HAVE_SIGSET_T=0
+ fi
+
+
+
+ if test $ac_cv_header_sys_socket_h = no; then
+ for ac_header in ws2tcpip.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
+if test "x$ac_cv_header_ws2tcpip_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WS2TCPIP_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if test "${ac_cv_header_stdbool_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdbool.h>
+ #ifndef bool
+ "error: bool is not defined"
+ #endif
+ #ifndef false
+ "error: false is not defined"
+ #endif
+ #if false
+ "error: false is not 0"
+ #endif
+ #ifndef true
+ "error: true is not defined"
+ #endif
+ #if true != 1
+ "error: true is not 1"
+ #endif
+ #ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+ #endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
+int
+main ()
+{
+
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdbool_h=yes
else
- gl_cv_func_getopt_gnu=no
+ ac_cv_header_stdbool_h=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+ ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
- case $gl_had_POSIXLY_CORRECT in
- exported) ;;
- yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;;
- *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;;
- esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
-$as_echo "$gl_cv_func_getopt_gnu" >&6; }
- if test "$gl_cv_func_getopt_gnu" != yes; then
- gl_replace_getopt=yes
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5
-$as_echo_n "checking for working GNU getopt_long function... " >&6; }
-if test "${gl_cv_func_getopt_long_gnu+set}" = set; then :
+
+
+
+ REPLACE_NULL=0;
+ HAVE_WCHAR_T=1;
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
+$as_echo_n "checking for wchar_t... " >&6; }
+if test "${gt_cv_c_wchar_t+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then :
- case "$host_os" in
- openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
- *) gl_cv_func_getopt_long_gnu="guessing yes";;
- esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+ wchar_t foo = (wchar_t)'\0';
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_c_wchar_t=yes
+else
+ gt_cv_c_wchar_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
+$as_echo "$gt_cv_c_wchar_t" >&6; }
+ if test $gt_cv_c_wchar_t = yes; then
+
+$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
+
+ fi
+
+
+ GNULIB_DPRINTF=0;
+ GNULIB_FCLOSE=0;
+ GNULIB_FDOPEN=0;
+ GNULIB_FFLUSH=0;
+ GNULIB_FGETC=0;
+ GNULIB_FGETS=0;
+ GNULIB_FOPEN=0;
+ GNULIB_FPRINTF=0;
+ GNULIB_FPRINTF_POSIX=0;
+ GNULIB_FPURGE=0;
+ GNULIB_FPUTC=0;
+ GNULIB_FPUTS=0;
+ GNULIB_FREAD=0;
+ GNULIB_FREOPEN=0;
+ GNULIB_FSCANF=0;
+ GNULIB_FSEEK=0;
+ GNULIB_FSEEKO=0;
+ GNULIB_FTELL=0;
+ GNULIB_FTELLO=0;
+ GNULIB_FWRITE=0;
+ GNULIB_GETC=0;
+ GNULIB_GETCHAR=0;
+ GNULIB_GETDELIM=0;
+ GNULIB_GETLINE=0;
+ GNULIB_OBSTACK_PRINTF=0;
+ GNULIB_OBSTACK_PRINTF_POSIX=0;
+ GNULIB_PCLOSE=0;
+ GNULIB_PERROR=0;
+ GNULIB_POPEN=0;
+ GNULIB_PRINTF=0;
+ GNULIB_PRINTF_POSIX=0;
+ GNULIB_PUTC=0;
+ GNULIB_PUTCHAR=0;
+ GNULIB_PUTS=0;
+ GNULIB_REMOVE=0;
+ GNULIB_RENAME=0;
+ GNULIB_RENAMEAT=0;
+ GNULIB_SCANF=0;
+ GNULIB_SNPRINTF=0;
+ GNULIB_SPRINTF_POSIX=0;
+ GNULIB_STDIO_H_NONBLOCKING=0;
+ GNULIB_STDIO_H_SIGPIPE=0;
+ GNULIB_TMPFILE=0;
+ GNULIB_VASPRINTF=0;
+ GNULIB_VFSCANF=0;
+ GNULIB_VSCANF=0;
+ GNULIB_VDPRINTF=0;
+ GNULIB_VFPRINTF=0;
+ GNULIB_VFPRINTF_POSIX=0;
+ GNULIB_VPRINTF=0;
+ GNULIB_VPRINTF_POSIX=0;
+ GNULIB_VSNPRINTF=0;
+ GNULIB_VSPRINTF_POSIX=0;
+ HAVE_DECL_FPURGE=1;
+ HAVE_DECL_FSEEKO=1;
+ HAVE_DECL_FTELLO=1;
+ HAVE_DECL_GETDELIM=1;
+ HAVE_DECL_GETLINE=1;
+ HAVE_DECL_OBSTACK_PRINTF=1;
+ HAVE_DECL_SNPRINTF=1;
+ HAVE_DECL_VSNPRINTF=1;
+ HAVE_DPRINTF=1;
+ HAVE_FSEEKO=1;
+ HAVE_FTELLO=1;
+ HAVE_PCLOSE=1;
+ HAVE_POPEN=1;
+ HAVE_RENAMEAT=1;
+ HAVE_VASPRINTF=1;
+ HAVE_VDPRINTF=1;
+ REPLACE_DPRINTF=0;
+ REPLACE_FCLOSE=0;
+ REPLACE_FDOPEN=0;
+ REPLACE_FFLUSH=0;
+ REPLACE_FOPEN=0;
+ REPLACE_FPRINTF=0;
+ REPLACE_FPURGE=0;
+ REPLACE_FREOPEN=0;
+ REPLACE_FSEEK=0;
+ REPLACE_FSEEKO=0;
+ REPLACE_FTELL=0;
+ REPLACE_FTELLO=0;
+ REPLACE_GETDELIM=0;
+ REPLACE_GETLINE=0;
+ REPLACE_OBSTACK_PRINTF=0;
+ REPLACE_PERROR=0;
+ REPLACE_POPEN=0;
+ REPLACE_PRINTF=0;
+ REPLACE_REMOVE=0;
+ REPLACE_RENAME=0;
+ REPLACE_RENAMEAT=0;
+ REPLACE_SNPRINTF=0;
+ REPLACE_SPRINTF=0;
+ REPLACE_STDIO_READ_FUNCS=0;
+ REPLACE_STDIO_WRITE_FUNCS=0;
+ REPLACE_TMPFILE=0;
+ REPLACE_VASPRINTF=0;
+ REPLACE_VDPRINTF=0;
+ REPLACE_VFPRINTF=0;
+ REPLACE_VPRINTF=0;
+ REPLACE_VSNPRINTF=0;
+ REPLACE_VSPRINTF=0;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if test "${ac_cv_struct_tm+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <getopt.h>
- #include <stddef.h>
- #include <string.h>
+#include <sys/types.h>
+#include <time.h>
int
main ()
{
-static const struct option long_options[] =
- {
- { "xtremely-",no_argument, NULL, 1003 },
- { "xtra", no_argument, NULL, 1001 },
- { "xtreme", no_argument, NULL, 1002 },
- { "xtremely", no_argument, NULL, 1003 },
- { NULL, 0, NULL, 0 }
- };
- /* This code fails on OpenBSD 5.0. */
- {
- static char program[] = "program";
- static char xtremel[] = "--xtremel";
- char *argv[] = { program, xtremel, NULL };
- int option_index;
- optind = 1; opterr = 0;
- if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
- return 1;
- }
- return 0;
-
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_getopt_long_gnu=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_struct_tm=time.h
else
- gl_cv_func_getopt_long_gnu=no
+ ac_cv_struct_tm=sys/time.h
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5
-$as_echo "$gl_cv_func_getopt_long_gnu" >&6; }
- case "$gl_cv_func_getopt_long_gnu" in
- *yes) ;;
- *) gl_replace_getopt=yes ;;
- esac
- fi
- fi
-
-
-
-
+ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
+#include <$ac_cv_struct_tm>
- REPLACE_GETOPT=0
- if test -n "$gl_replace_getopt"; then
- REPLACE_GETOPT=1
- fi
-
- if test $REPLACE_GETOPT = 1; then
+"
+if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
- GETOPT_H=getopt.h
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TM_TM_ZONE 1
+_ACEOF
-$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+fi
+if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
- fi
+$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
-ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getenv" = x""yes; then :
+else
+ ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
+"
+if test "x$ac_cv_have_decl_tzname" = x""yes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETENV $ac_have_decl
+#define HAVE_DECL_TZNAME $ac_have_decl
_ACEOF
-:
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
-$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
-if test "${ac_cv_c_restrict+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
+$as_echo_n "checking for tzname... " >&6; }
+if test "${ac_cv_var_tzname+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- ac_cv_c_restrict=no
- # The order here caters to the fact that C++ does not require restrict.
- for ac_kw in __restrict __restrict__ _Restrict restrict; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-typedef int * int_ptr;
- int foo (int_ptr $ac_kw ip) {
- return ip[0];
- }
+#include <time.h>
+#if !HAVE_DECL_TZNAME
+extern char *tzname[];
+#endif
+
int
main ()
{
-int s[1];
- int * $ac_kw t = s;
- t[0] = 0;
- return foo(t)
+return tzname[0][0];
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_restrict=$ac_kw
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_var_tzname=yes
+else
+ ac_cv_var_tzname=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_restrict" != no && break
- done
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
-$as_echo "$ac_cv_c_restrict" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
+$as_echo "$ac_cv_var_tzname" >&6; }
+ if test $ac_cv_var_tzname = yes; then
- case $ac_cv_c_restrict in
- restrict) ;;
- no) $as_echo "#define restrict /**/" >>confdefs.h
- ;;
- *) cat >>confdefs.h <<_ACEOF
-#define restrict $ac_cv_c_restrict
-_ACEOF
- ;;
- esac
+$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
+ fi
+fi
- GNULIB_GETTIMEOFDAY=0;
- HAVE_GETTIMEOFDAY=1;
- HAVE_STRUCT_TIMEVAL=1;
- HAVE_SYS_TIME_H=1;
- REPLACE_GETTIMEOFDAY=0;
- REPLACE_STRUCT_TIMEVAL=0;
+ ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
+"
+if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then :
+$as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h
+fi
if test $gl_cv_have_include_next = yes; then
- gl_cv_next_sys_time_h='<'sys/time.h'>'
+ gl_cv_next_string_h='<'string.h'>'
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
-$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
-if test "${gl_cv_next_sys_time_h+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
+$as_echo_n "checking absolute name of <string.h>... " >&6; }
+if test "${gl_cv_next_string_h+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- if test $ac_cv_header_sys_time_h = yes; then
-
-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/time.h>
+#include <string.h>
_ACEOF
case "$host_os" in
esac
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- gl_header_literal_regex=`echo 'sys/time.h' \
+ gl_header_literal_regex=`echo 'string.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/
p
q
}'
- gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
sed -n "$gl_absolute_header_sed"`'"'
- else
- gl_cv_next_sys_time_h='<'sys/time.h'>'
- fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
-$as_echo "$gl_cv_next_sys_time_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
+$as_echo "$gl_cv_next_string_h" >&6; }
fi
- NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
+ NEXT_STRING_H=$gl_cv_next_string_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='<'sys/time.h'>'
+ gl_next_as_first_directive='<'string.h'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_sys_time_h
+ gl_next_as_first_directive=$gl_cv_next_string_h
fi
- NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
+ NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
- if test $ac_cv_header_sys_time_h != yes; then
- HAVE_SYS_TIME_H=0
- fi
+ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strtoimax" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
- if test $ac_cv_header_sys_socket_h != yes; then
- for ac_header in winsock2.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
-if test "x$ac_cv_header_winsock2_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_WINSOCK2_H 1
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRTOIMAX $ac_have_decl
_ACEOF
+
+
+ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strtoumax" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
fi
-done
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRTOUMAX $ac_have_decl
+_ACEOF
- fi
- if test "$ac_cv_header_winsock2_h" = yes; then
- HAVE_WINSOCK2_H=1
- UNISTD_H_HAVE_WINSOCK2_H=1
- SYS_IOCTL_H_HAVE_WINSOCK2_H=1
- else
- HAVE_WINSOCK2_H=0
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
-$as_echo_n "checking for struct timeval... " >&6; }
-if test "${gl_cv_sys_struct_timeval+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
+$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
+if test "${ac_cv_header_stat_broken+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif
- #include <time.h>
- #if HAVE_WINSOCK2_H
- # include <winsock2.h>
- #endif
+#include <sys/types.h>
+#include <sys/stat.h>
-int
-main ()
-{
-static struct timeval x; x.tv_sec = x.tv_usec;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_sys_struct_timeval=yes
-else
- gl_cv_sys_struct_timeval=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+#if defined S_ISBLK && defined S_IFDIR
+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
+#endif
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
-$as_echo "$gl_cv_sys_struct_timeval" >&6; }
- if test $gl_cv_sys_struct_timeval != yes; then
- HAVE_STRUCT_TIMEVAL=0
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
-$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
-if test "${gl_cv_sys_struct_timeval_tv_sec+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif
- #include <time.h>
- #if HAVE_WINSOCK2_H
- # include <winsock2.h>
- #endif
+#if defined S_ISBLK && defined S_IFCHR
+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
+#endif
-int
-main ()
-{
-static struct timeval x;
- typedef int verify_tv_sec_type[
- sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
- ];
+#if defined S_ISLNK && defined S_IFREG
+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
+#endif
+
+#if defined S_ISSOCK && defined S_IFREG
+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
+#endif
- ;
- return 0;
-}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_sys_struct_timeval_tv_sec=yes
+ ac_cv_header_stat_broken=no
else
- gl_cv_sys_struct_timeval_tv_sec=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
-$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
- if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
- REPLACE_STRUCT_TIMEVAL=1
- fi
- fi
+ ac_cv_header_stat_broken=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
+$as_echo "$ac_cv_header_stat_broken" >&6; }
+if test $ac_cv_header_stat_broken = yes; then
+$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
-$as_echo_n "checking for unsigned long long int... " >&6; }
-if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
+$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
+if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- ac_cv_type_unsigned_long_long_int=yes
- if test "x${ac_cv_prog_cc_c99-no}" = xno; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <time.h>
- /* For now, do not test the preprocessor; as of 2007 there are too many
- implementations with broken preprocessors. Perhaps this can
- be revisited in 2012. In the meantime, code should not expect
- #if to work with literals wider than 32 bits. */
- /* Test literals. */
- long long int ll = 9223372036854775807ll;
- long long int nll = -9223372036854775807LL;
- unsigned long long int ull = 18446744073709551615ULL;
- /* Test constant expressions. */
- typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
- ? 1 : -1)];
- typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
- ? 1 : -1)];
- int i = 63;
int
main ()
{
-/* Test availability of runtime routines for shift and division. */
- long long int llmax = 9223372036854775807ll;
- unsigned long long int ullmax = 18446744073709551615ull;
- return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
- | (llmax / ll) | (llmax % ll)
- | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
- | (ullmax / ull) | (ullmax % ull));
+static struct timespec x; x.tv_sec = x.tv_nsec;
;
return 0;
}
-
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timespec_in_time_h=yes
else
- ac_cv_type_unsigned_long_long_int=no
+ gl_cv_sys_struct_timespec_in_time_h=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
-$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
- if test $ac_cv_type_unsigned_long_long_int = yes; then
-
-$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
-
- fi
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
-$as_echo_n "checking for long long int... " >&6; }
-if test "${ac_cv_type_long_long_int+set}" = set; then :
+ TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
+ if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
+ TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
+$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
+if test "${gl_cv_sys_struct_timespec_in_sys_time_h+set}" = set; then :
$as_echo_n "(cached) " >&6
-else
- ac_cv_type_long_long_int=yes
- if test "x${ac_cv_prog_cc_c99-no}" = xno; then
- ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
- if test $ac_cv_type_long_long_int = yes; then
- if test "$cross_compiling" = yes; then :
- :
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <limits.h>
- #ifndef LLONG_MAX
- # define HALF \
- (1LL << (sizeof (long long int) * CHAR_BIT - 2))
- # define LLONG_MAX (HALF - 1 + HALF)
- #endif
+#include <sys/time.h>
+
int
main ()
{
-long long int n = 1;
- int i;
- for (i = 0; ; i++)
- {
- long long int m = n << i;
- if (m >> i != n)
- return 1;
- if (LLONG_MAX / 2 < m)
- break;
- }
- return 0;
+static struct timespec x; x.tv_sec = x.tv_nsec;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timespec_in_sys_time_h=yes
else
- ac_cv_type_long_long_int=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+ gl_cv_sys_struct_timespec_in_sys_time_h=no
fi
-
- fi
- fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
-$as_echo "$ac_cv_type_long_long_int" >&6; }
- if test $ac_cv_type_long_long_int = yes; then
-
-$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
-
- fi
-
-
-
-
-
-
- gl_cv_c_multiarch=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
+$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
+if test "${gl_cv_sys_struct_timespec_in_pthread_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
+#include <pthread.h>
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
-
- arch=
- prev=
- for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
- if test -n "$prev"; then
- case $word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$arch" || test "$arch" = "$word"; then
- arch="$word"
- else
- gl_cv_c_multiarch=yes
- fi
- ;;
- esac
- prev=
- else
- if test "x$word" = "x-arch"; then
- prev=arch
- fi
- fi
- done
-
+ gl_cv_sys_struct_timespec_in_pthread_h=yes
+else
+ gl_cv_sys_struct_timespec_in_pthread_h=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $gl_cv_c_multiarch = yes; then
- APPLE_UNIVERSAL_BUILD=1
- else
- APPLE_UNIVERSAL_BUILD=0
- fi
-
-
-
-
-
- if test $ac_cv_type_long_long_int = yes; then
- HAVE_LONG_LONG_INT=1
- else
- HAVE_LONG_LONG_INT=0
- fi
-
-
- if test $ac_cv_type_unsigned_long_long_int = yes; then
- HAVE_UNSIGNED_LONG_LONG_INT=1
- else
- HAVE_UNSIGNED_LONG_LONG_INT=0
- fi
-
-
-
- if test $ac_cv_header_wchar_h = yes; then
- HAVE_WCHAR_H=1
- else
- HAVE_WCHAR_H=0
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+ fi
+ fi
fi
- if test $ac_cv_header_inttypes_h = yes; then
- HAVE_INTTYPES_H=1
- else
- HAVE_INTTYPES_H=0
- fi
- if test $ac_cv_header_sys_types_h = yes; then
- HAVE_SYS_TYPES_H=1
- else
- HAVE_SYS_TYPES_H=0
- fi
if test $gl_cv_have_include_next = yes; then
- gl_cv_next_stdint_h='<'stdint.h'>'
+ gl_cv_next_time_h='<'time.h'>'
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
-$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
-if test "${gl_cv_next_stdint_h+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
+$as_echo_n "checking absolute name of <time.h>... " >&6; }
+if test "${gl_cv_next_time_h+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- if test $ac_cv_header_stdint_h = yes; then
-
-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdint.h>
+#include <time.h>
_ACEOF
case "$host_os" in
esac
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- gl_header_literal_regex=`echo 'stdint.h' \
+ gl_header_literal_regex=`echo 'time.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/
p
q
}'
- gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
sed -n "$gl_absolute_header_sed"`'"'
- else
- gl_cv_next_stdint_h='<'stdint.h'>'
- fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
-$as_echo "$gl_cv_next_stdint_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
+$as_echo "$gl_cv_next_time_h" >&6; }
fi
- NEXT_STDINT_H=$gl_cv_next_stdint_h
+ NEXT_TIME_H=$gl_cv_next_time_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='<'stdint.h'>'
+ gl_next_as_first_directive='<'time.h'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_stdint_h
+ gl_next_as_first_directive=$gl_cv_next_time_h
fi
- NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
+ NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
+
+
- if test $ac_cv_header_stdint_h = yes; then
- HAVE_STDINT_H=1
- else
- HAVE_STDINT_H=0
- fi
- if test $ac_cv_header_stdint_h = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
-$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
-if test "${gl_cv_header_working_stdint_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- gl_cv_header_working_stdint_h=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
-#include <stdint.h>
-/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
-#if !(defined WCHAR_MIN && defined WCHAR_MAX)
-#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
-#endif
- /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
- #include <stddef.h>
- #include <signal.h>
- #if HAVE_WCHAR_H
- # include <stdio.h>
- # include <time.h>
- # include <wchar.h>
- #endif
-#ifdef INT8_MAX
-int8_t a1 = INT8_MAX;
-int8_t a1min = INT8_MIN;
-#endif
-#ifdef INT16_MAX
-int16_t a2 = INT16_MAX;
-int16_t a2min = INT16_MIN;
-#endif
-#ifdef INT32_MAX
-int32_t a3 = INT32_MAX;
-int32_t a3min = INT32_MIN;
-#endif
-#ifdef INT64_MAX
-int64_t a4 = INT64_MAX;
-int64_t a4min = INT64_MIN;
-#endif
-#ifdef UINT8_MAX
-uint8_t b1 = UINT8_MAX;
-#else
-typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
-#endif
-#ifdef UINT16_MAX
-uint16_t b2 = UINT16_MAX;
-#endif
-#ifdef UINT32_MAX
-uint32_t b3 = UINT32_MAX;
-#endif
-#ifdef UINT64_MAX
-uint64_t b4 = UINT64_MAX;
-#endif
-int_least8_t c1 = INT8_C (0x7f);
-int_least8_t c1max = INT_LEAST8_MAX;
-int_least8_t c1min = INT_LEAST8_MIN;
-int_least16_t c2 = INT16_C (0x7fff);
-int_least16_t c2max = INT_LEAST16_MAX;
-int_least16_t c2min = INT_LEAST16_MIN;
-int_least32_t c3 = INT32_C (0x7fffffff);
-int_least32_t c3max = INT_LEAST32_MAX;
-int_least32_t c3min = INT_LEAST32_MIN;
-int_least64_t c4 = INT64_C (0x7fffffffffffffff);
-int_least64_t c4max = INT_LEAST64_MAX;
-int_least64_t c4min = INT_LEAST64_MIN;
-uint_least8_t d1 = UINT8_C (0xff);
-uint_least8_t d1max = UINT_LEAST8_MAX;
-uint_least16_t d2 = UINT16_C (0xffff);
-uint_least16_t d2max = UINT_LEAST16_MAX;
-uint_least32_t d3 = UINT32_C (0xffffffff);
-uint_least32_t d3max = UINT_LEAST32_MAX;
-uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
-uint_least64_t d4max = UINT_LEAST64_MAX;
-int_fast8_t e1 = INT_FAST8_MAX;
-int_fast8_t e1min = INT_FAST8_MIN;
-int_fast16_t e2 = INT_FAST16_MAX;
-int_fast16_t e2min = INT_FAST16_MIN;
-int_fast32_t e3 = INT_FAST32_MAX;
-int_fast32_t e3min = INT_FAST32_MIN;
-int_fast64_t e4 = INT_FAST64_MAX;
-int_fast64_t e4min = INT_FAST64_MIN;
-uint_fast8_t f1 = UINT_FAST8_MAX;
-uint_fast16_t f2 = UINT_FAST16_MAX;
-uint_fast32_t f3 = UINT_FAST32_MAX;
-uint_fast64_t f4 = UINT_FAST64_MAX;
-#ifdef INTPTR_MAX
-intptr_t g = INTPTR_MAX;
-intptr_t gmin = INTPTR_MIN;
-#endif
-#ifdef UINTPTR_MAX
-uintptr_t h = UINTPTR_MAX;
-#endif
-intmax_t i = INTMAX_MAX;
-uintmax_t j = UINTMAX_MAX;
+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
-#include <limits.h> /* for CHAR_BIT */
-#define TYPE_MINIMUM(t) \
- ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
-#define TYPE_MAXIMUM(t) \
- ((t) ((t) 0 < (t) -1 \
- ? (t) -1 \
- : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
-struct s {
- int check_PTRDIFF:
- PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
- && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
- ? 1 : -1;
- /* Detect bug in FreeBSD 6.0 / ia64. */
- int check_SIG_ATOMIC:
- SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
- && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
- ? 1 : -1;
- int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
- int check_WCHAR:
- WCHAR_MIN == TYPE_MINIMUM (wchar_t)
- && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
- ? 1 : -1;
- /* Detect bug in mingw. */
- int check_WINT:
- WINT_MIN == TYPE_MINIMUM (wint_t)
- && WINT_MAX == TYPE_MAXIMUM (wint_t)
- ? 1 : -1;
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_UNSETENV $ac_have_decl
+_ACEOF
- /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
- int check_UINT8_C:
- (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
- int check_UINT16_C:
- (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
- /* Detect bugs in OpenBSD 3.9 stdint.h. */
-#ifdef UINT8_MAX
- int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
-#endif
-#ifdef UINT16_MAX
- int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
-#endif
-#ifdef UINT32_MAX
- int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
-#endif
-#ifdef UINT64_MAX
- int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
-#endif
- int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
- int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
- int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
- int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
- int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
- int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
- int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
- int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
- int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
- int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
- int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
-};
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the utimes function works" >&5
+$as_echo_n "checking whether the utimes function works... " >&6; }
+if test "${gl_cv_func_working_utimes+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ gl_cv_func_working_utimes=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <time.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <utime.h>
+
+static int
+inorder (time_t a, time_t b, time_t c)
+{
+ return a <= b && b <= c;
+}
int
main ()
{
+ int result = 0;
+ char const *file = "conftest.utimes";
+ static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
+
+ /* Test whether utimes() essentially works. */
+ {
+ struct stat sbuf;
+ FILE *f = fopen (file, "w");
+ if (f == NULL)
+ result |= 1;
+ else if (fclose (f) != 0)
+ result |= 1;
+ else if (utimes (file, timeval) != 0)
+ result |= 2;
+ else if (lstat (file, &sbuf) != 0)
+ result |= 1;
+ else if (!(sbuf.st_atime == timeval[0].tv_sec
+ && sbuf.st_mtime == timeval[1].tv_sec))
+ result |= 4;
+ if (unlink (file) != 0)
+ result |= 1;
+ }
+
+ /* Test whether utimes() with a NULL argument sets the file's timestamp
+ to the current time. Use 'fstat' as well as 'time' to
+ determine the "current" time, to accommodate NFS file systems
+ if there is a time skew between the host and the NFS server. */
+ {
+ int fd = open (file, O_WRONLY|O_CREAT, 0644);
+ if (fd < 0)
+ result |= 1;
+ else
+ {
+ time_t t0, t2;
+ struct stat st0, st1, st2;
+ if (time (&t0) == (time_t) -1)
+ result |= 1;
+ else if (fstat (fd, &st0) != 0)
+ result |= 1;
+ else if (utimes (file, timeval) != 0)
+ result |= 2;
+ else if (utimes (file, NULL) != 0)
+ result |= 8;
+ else if (fstat (fd, &st1) != 0)
+ result |= 1;
+ else if (write (fd, "\n", 1) != 1)
+ result |= 1;
+ else if (fstat (fd, &st2) != 0)
+ result |= 1;
+ else if (time (&t2) == (time_t) -1)
+ result |= 1;
+ else
+ {
+ int m_ok_POSIX = inorder (t0, st1.st_mtime, t2);
+ int m_ok_NFS = inorder (st0.st_mtime, st1.st_mtime, st2.st_mtime);
+ if (! (st1.st_atime == st1.st_mtime))
+ result |= 16;
+ if (! (m_ok_POSIX || m_ok_NFS))
+ result |= 32;
+ }
+ if (close (fd) != 0)
+ result |= 1;
+ }
+ if (unlink (file) != 0)
+ result |= 1;
+ }
- ;
- return 0;
+ /* Test whether utimes() with a NULL argument works on read-only files. */
+ {
+ int fd = open (file, O_WRONLY|O_CREAT, 0444);
+ if (fd < 0)
+ result |= 1;
+ else if (close (fd) != 0)
+ result |= 1;
+ else if (utimes (file, NULL) != 0)
+ result |= 64;
+ if (unlink (file) != 0)
+ result |= 1;
+ }
+
+ return result;
}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if test "$cross_compiling" = yes; then :
- gl_cv_header_working_stdint_h=yes
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_working_utimes=yes
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ gl_cv_func_working_utimes=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_working_utimes" >&5
+$as_echo "$gl_cv_func_working_utimes" >&6; }
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
-#include <stdint.h>
+ if test $gl_cv_func_working_utimes = yes; then
+$as_echo "#define HAVE_WORKING_UTIMES 1" >>confdefs.h
- /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
- #include <stddef.h>
- #include <signal.h>
- #if HAVE_WCHAR_H
- # include <stdio.h>
- # include <time.h>
- # include <wchar.h>
- #endif
+ fi
-#include <stdio.h>
-#include <string.h>
-#define MVAL(macro) MVAL1(macro)
-#define MVAL1(expression) #expression
-static const char *macro_values[] =
- {
-#ifdef INT8_MAX
- MVAL (INT8_MAX),
-#endif
-#ifdef INT16_MAX
- MVAL (INT16_MAX),
-#endif
-#ifdef INT32_MAX
- MVAL (INT32_MAX),
-#endif
-#ifdef INT64_MAX
- MVAL (INT64_MAX),
-#endif
-#ifdef UINT8_MAX
- MVAL (UINT8_MAX),
-#endif
-#ifdef UINT16_MAX
- MVAL (UINT16_MAX),
-#endif
-#ifdef UINT32_MAX
- MVAL (UINT32_MAX),
-#endif
-#ifdef UINT64_MAX
- MVAL (UINT64_MAX),
-#endif
- NULL
- };
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utimbuf" >&5
+$as_echo_n "checking for struct utimbuf... " >&6; }
+if test "${gl_cv_sys_struct_utimbuf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #include <time.h>
+ #ifdef HAVE_UTIME_H
+ #include <utime.h>
+ #endif
int
main ()
{
-
- const char **mv;
- for (mv = macro_values; *mv != NULL; mv++)
- {
- const char *value = *mv;
- /* Test whether it looks like a cast expression. */
- if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
- || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
- || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
- || strncmp (value, "((int)"/*)*/, 6) == 0
- || strncmp (value, "((signed short)"/*)*/, 15) == 0
- || strncmp (value, "((signed char)"/*)*/, 14) == 0)
- return mv - macro_values + 1;
- }
- return 0;
-
+static struct utimbuf x; x.actime = x.modtime;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_header_working_stdint_h=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_utimbuf=yes
+else
+ gl_cv_sys_struct_utimbuf=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_utimbuf" >&5
+$as_echo "$gl_cv_sys_struct_utimbuf" >&6; }
+ if test $gl_cv_sys_struct_utimbuf = yes; then
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+$as_echo "#define HAVE_STRUCT_UTIMBUF 1" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
-$as_echo "$gl_cv_header_working_stdint_h" >&6; }
fi
- if test "$gl_cv_header_working_stdint_h" = yes; then
- STDINT_H=
- else
- for ac_header in sys/inttypes.h sys/bitypes.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
- if test $ac_cv_header_sys_inttypes_h = yes; then
- HAVE_SYS_INTTYPES_H=1
- else
- HAVE_SYS_INTTYPES_H=0
- fi
- if test $ac_cv_header_sys_bitypes_h = yes; then
- HAVE_SYS_BITYPES_H=1
- else
- HAVE_SYS_BITYPES_H=0
- fi
- if test $APPLE_UNIVERSAL_BUILD = 0; then
- for gltype in ptrdiff_t size_t ; do
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
-$as_echo_n "checking for bit size of $gltype... " >&6; }
-if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
+
+{ $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 ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
- /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
- #include <stddef.h>
- #include <signal.h>
- #if HAVE_WCHAR_H
- # include <stdio.h>
- # include <time.h>
- # include <wchar.h>
- #endif
-
-#include <limits.h>"; then :
+ 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
- result=unknown
+ 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
- eval gl_cv_bitsizeof_${gltype}=\$result
+if test $ac_cv_type_getgroups = cross; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
-fi
-eval ac_res=\$gl_cv_bitsizeof_${gltype}
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval result=\$gl_cv_bitsizeof_${gltype}
- if test $result = unknown; then
- result=0
- fi
- GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
- cat >>confdefs.h <<_ACEOF
-#define BITSIZEOF_${GLTYPE} $result
_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*
- eval BITSIZEOF_${GLTYPE}=\$result
- done
-
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5
+$as_echo "$ac_cv_type_getgroups" >&6; }
- fi
+cat >>confdefs.h <<_ACEOF
+#define GETGROUPS_T $ac_cv_type_getgroups
+_ACEOF
- for gltype in sig_atomic_t wchar_t wint_t ; do
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
-$as_echo_n "checking for bit size of $gltype... " >&6; }
-if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
- /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
- #include <stddef.h>
- #include <signal.h>
- #if HAVE_WCHAR_H
- # include <stdio.h>
- # include <time.h>
- # include <wchar.h>
- #endif
-#include <limits.h>"; then :
+ if false; then
+ GL_COND_LIBTOOL_TRUE=
+ GL_COND_LIBTOOL_FALSE='#'
else
- result=unknown
+ GL_COND_LIBTOOL_TRUE='#'
+ GL_COND_LIBTOOL_FALSE=
fi
- eval gl_cv_bitsizeof_${gltype}=\$result
+ gl_cond_libtool=false
+ gl_libdeps=
+ gl_ltlibdeps=
+ gl_m4_base='m4'
+
-fi
-eval ac_res=\$gl_cv_bitsizeof_${gltype}
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval result=\$gl_cv_bitsizeof_${gltype}
- if test $result = unknown; then
- result=0
- fi
- GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
- cat >>confdefs.h <<_ACEOF
-#define BITSIZEOF_${GLTYPE} $result
-_ACEOF
- eval BITSIZEOF_${GLTYPE}=\$result
- done
- for gltype in sig_atomic_t wchar_t wint_t ; do
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
-$as_echo_n "checking whether $gltype is signed... " >&6; }
-if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then :
+
+
+ gl_source_base='lib'
+
+
+ if test $ac_cv_func_alloca_works = no; then
+ :
+ fi
+
+ # Define an additional variable used in the Makefile substitution.
+ if test $ac_cv_working_alloca_h = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
+$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
+if test "${gl_cv_rpl_alloca+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
- #include <stddef.h>
- #include <signal.h>
- #if HAVE_WCHAR_H
- # include <stdio.h>
- # include <time.h>
- # include <wchar.h>
- #endif
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
-int
-main ()
-{
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+ Need own alloca
+#endif
- ;
- return 0;
-}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- result=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Need own alloca" >/dev/null 2>&1; then :
+ gl_cv_rpl_alloca=yes
else
- result=no
+ gl_cv_rpl_alloca=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- eval gl_cv_type_${gltype}_signed=\$result
+rm -f conftest*
+
fi
-eval ac_res=\$gl_cv_type_${gltype}_signed
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval result=\$gl_cv_type_${gltype}_signed
- GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
- if test "$result" = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGNED_${GLTYPE} 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
+$as_echo "$gl_cv_rpl_alloca" >&6; }
+ if test $gl_cv_rpl_alloca = yes; then
- eval HAVE_SIGNED_${GLTYPE}=1
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+ ALLOCA_H=alloca.h
else
- eval HAVE_SIGNED_${GLTYPE}=0
+ ALLOCA_H=
fi
- done
-
-
- gl_cv_type_ptrdiff_t_signed=yes
- gl_cv_type_size_t_signed=no
- if test $APPLE_UNIVERSAL_BUILD = 0; then
-
+ else
+ ALLOCA_H=alloca.h
+ fi
- for gltype in ptrdiff_t size_t ; do
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
-$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
- $as_echo_n "(cached) " >&6
+ if test -n "$ALLOCA_H"; then
+ GL_GENERATE_ALLOCA_H_TRUE=
+ GL_GENERATE_ALLOCA_H_FALSE='#'
else
- eval gl_cv_type_${gltype}_suffix=no
- eval result=\$gl_cv_type_${gltype}_signed
- if test "$result" = yes; then
- glsufu=
- else
- glsufu=u
- fi
- for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
- case $glsuf in
- '') gltype1='int';;
- l) gltype1='long int';;
- ll) gltype1='long long int';;
- i64) gltype1='__int64';;
- u) gltype1='unsigned int';;
- ul) gltype1='unsigned long int';;
- ull) gltype1='unsigned long long int';;
- ui64)gltype1='unsigned __int64';;
- esac
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ GL_GENERATE_ALLOCA_H_TRUE='#'
+ GL_GENERATE_ALLOCA_H_FALSE=
+fi
- /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
- #include <stddef.h>
- #include <signal.h>
- #if HAVE_WCHAR_H
- # include <stdio.h>
- # include <time.h>
- # include <wchar.h>
- #endif
- extern $gltype foo;
- extern $gltype1 foo;
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval gl_cv_type_${gltype}_suffix=\$glsuf
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- eval result=\$gl_cv_type_${gltype}_suffix
- test "$result" != no && break
- done
-fi
-eval ac_res=\$gl_cv_type_${gltype}_suffix
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
- eval result=\$gl_cv_type_${gltype}_suffix
- test "$result" = no && result=
- eval ${GLTYPE}_SUFFIX=\$result
- cat >>confdefs.h <<_ACEOF
-#define ${GLTYPE}_SUFFIX $result
-_ACEOF
- done
- fi
+ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
+ # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
+ # Save and restore LIBS so e.g., -lrt, 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_CLOCK_GETTIME=
- for gltype in sig_atomic_t wchar_t wint_t ; do
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
-$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
+ gl_saved_libs=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if test "${ac_cv_search_clock_gettime+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- eval gl_cv_type_${gltype}_suffix=no
- eval result=\$gl_cv_type_${gltype}_signed
- if test "$result" = yes; then
- glsufu=
- else
- glsufu=u
- fi
- for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
- case $glsuf in
- '') gltype1='int';;
- l) gltype1='long int';;
- ll) gltype1='long long int';;
- i64) gltype1='__int64';;
- u) gltype1='unsigned int';;
- ul) gltype1='unsigned long int';;
- ull) gltype1='unsigned long long int';;
- ui64)gltype1='unsigned __int64';;
- esac
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
- /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
- #include <stddef.h>
- #include <signal.h>
- #if HAVE_WCHAR_H
- # include <stdio.h>
- # include <time.h>
- # include <wchar.h>
- #endif
-
- extern $gltype foo;
- extern $gltype1 foo;
+/* 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 clock_gettime ();
int
main ()
{
-
+return clock_gettime ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval gl_cv_type_${gltype}_suffix=\$glsuf
+for ac_lib in '' rt posix4; 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_clock_gettime=$ac_res
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- eval result=\$gl_cv_type_${gltype}_suffix
- test "$result" != no && break
- done
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test "${ac_cv_search_clock_gettime+set}" = set; then :
+ break
fi
-eval ac_res=\$gl_cv_type_${gltype}_suffix
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
- eval result=\$gl_cv_type_${gltype}_suffix
- test "$result" = no && result=
- eval ${GLTYPE}_SUFFIX=\$result
- cat >>confdefs.h <<_ACEOF
-#define ${GLTYPE}_SUFFIX $result
+done
+if test "${ac_cv_search_clock_gettime+set}" = set; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ test "$ac_cv_search_clock_gettime" = "none required" ||
+ LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
+fi
+
+ for ac_func in clock_gettime clock_settime
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
- done
+fi
+done
+ LIBS=$gl_saved_libs
- if test $BITSIZEOF_WINT_T -lt 32; then
- BITSIZEOF_WINT_T=32
- fi
+ :
- STDINT_H=stdint.h
- fi
- if test -n "$STDINT_H"; then
- GL_GENERATE_STDINT_H_TRUE=
- GL_GENERATE_STDINT_H_FALSE='#'
-else
- GL_GENERATE_STDINT_H_TRUE='#'
- GL_GENERATE_STDINT_H_FALSE=
-fi
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_CLOSE_STREAM 1
+_ACEOF
+
+
+
+
+ :
+
+
+
+ :
- GNULIB_IMAXABS=0;
- GNULIB_IMAXDIV=0;
- GNULIB_STRTOIMAX=0;
- GNULIB_STRTOUMAX=0;
- HAVE_DECL_IMAXABS=1;
- HAVE_DECL_IMAXDIV=1;
- HAVE_DECL_STRTOIMAX=1;
- HAVE_DECL_STRTOUMAX=1;
- REPLACE_STRTOIMAX=0;
- INT32_MAX_LT_INTMAX_MAX=1;
- INT64_MAX_EQ_LONG_MAX='defined _LP64';
- PRI_MACROS_BROKEN=0;
- PRIPTR_PREFIX=__PRIPTR_PREFIX;
- UINT32_MAX_LT_UINTMAX_MAX=1;
- UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
if test $gl_cv_have_include_next = yes; then
- gl_cv_next_inttypes_h='<'inttypes.h'>'
+ gl_cv_next_dirent_h='<'dirent.h'>'
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
-$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
-if test "${gl_cv_next_inttypes_h+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
+$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
+if test "${gl_cv_next_dirent_h+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- if test $ac_cv_header_inttypes_h = yes; then
+ if test $ac_cv_header_dirent_h = yes; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <inttypes.h>
+#include <dirent.h>
_ACEOF
case "$host_os" in
esac
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- gl_header_literal_regex=`echo 'inttypes.h' \
+ gl_header_literal_regex=`echo 'dirent.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/
p
q
}'
- gl_cv_next_inttypes_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ gl_cv_next_dirent_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
sed -n "$gl_absolute_header_sed"`'"'
else
- gl_cv_next_inttypes_h='<'inttypes.h'>'
+ gl_cv_next_dirent_h='<'dirent.h'>'
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
-$as_echo "$gl_cv_next_inttypes_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
+$as_echo "$gl_cv_next_dirent_h" >&6; }
fi
- NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
+ NEXT_DIRENT_H=$gl_cv_next_dirent_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='<'inttypes.h'>'
+ gl_next_as_first_directive='<'dirent.h'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_inttypes_h
+ gl_next_as_first_directive=$gl_cv_next_dirent_h
fi
- NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
-
-
-
-
+ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
+ if test $ac_cv_header_dirent_h = yes; then
+ HAVE_DIRENT_H=1
+ else
+ HAVE_DIRENT_H=0
+ fi
- case "$host_os" in
- mingw*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
-$as_echo_n "checking for 64-bit off_t... " >&6; }
-if test "${gl_cv_type_off_t_64+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_type_off_t_64=yes
-else
- gl_cv_type_off_t_64=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
-$as_echo "$gl_cv_type_off_t_64" >&6; }
- if test $gl_cv_type_off_t_64 = no; then
- WINDOWS_64_BIT_OFF_T=1
- else
- WINDOWS_64_BIT_OFF_T=0
- fi
- WINDOWS_64_BIT_ST_SIZE=1
- ;;
- *)
- WINDOWS_64_BIT_OFF_T=0
- WINDOWS_64_BIT_ST_SIZE=0
- ;;
- esac
- GNULIB_FCHMODAT=0;
- GNULIB_FSTAT=0;
- GNULIB_FSTATAT=0;
- GNULIB_FUTIMENS=0;
- GNULIB_LCHMOD=0;
- GNULIB_LSTAT=0;
- GNULIB_MKDIRAT=0;
- GNULIB_MKFIFO=0;
- GNULIB_MKFIFOAT=0;
- GNULIB_MKNOD=0;
- GNULIB_MKNODAT=0;
- GNULIB_STAT=0;
- GNULIB_UTIMENSAT=0;
- HAVE_FCHMODAT=1;
- HAVE_FSTATAT=1;
- HAVE_FUTIMENS=1;
- HAVE_LCHMOD=1;
- HAVE_LSTAT=1;
- HAVE_MKDIRAT=1;
- HAVE_MKFIFO=1;
- HAVE_MKFIFOAT=1;
- HAVE_MKNOD=1;
- HAVE_MKNODAT=1;
- HAVE_UTIMENSAT=1;
- REPLACE_FSTAT=0;
- REPLACE_FSTATAT=0;
- REPLACE_FUTIMENS=0;
- REPLACE_LSTAT=0;
- REPLACE_MKDIR=0;
- REPLACE_MKFIFO=0;
- REPLACE_MKNOD=0;
- REPLACE_STAT=0;
- REPLACE_UTIMENSAT=0;
+$as_echo "#define HAVE_DUP2 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
-$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if test "${gl_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
+ if test $HAVE_DUP2 = 1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
+$as_echo_n "checking whether dup2 works... " >&6; }
+if test "${gl_cv_func_dup2_works+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- rm -f conftest.sym conftest.file
- echo >conftest.file
- if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then :
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
- esac
-
+ mingw*) # on this platform, dup2 always returns 0 for success
+ gl_cv_func_dup2_works="guessing no" ;;
+ cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+ gl_cv_func_dup2_works="guessing no" ;;
+ linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
+ # closed fd may yield -EBADF instead of -1 / errno=EBADF.
+ gl_cv_func_dup2_works="guessing no" ;;
+ freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
+ gl_cv_func_dup2_works="guessing no" ;;
+ haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *) gl_cv_func_dup2_works="guessing yes" ;;
+ esac
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
+
+ #include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
int
main ()
{
-struct stat sbuf;
- /* Linux will dereference the symlink and fail, as required by
- POSIX. That is better in the sense that it means we will not
- have to compile and use the lstat wrapper. */
- return lstat ("conftest.sym/", &sbuf) == 0;
+int result = 0;
+#ifdef FD_CLOEXEC
+ if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+ result |= 1;
+#endif
+ if (dup2 (1, 1) == 0)
+ result |= 2;
+#ifdef FD_CLOEXEC
+ if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+ result |= 4;
+#endif
+ close (0);
+ if (dup2 (0, 0) != -1)
+ result |= 8;
+ /* 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;
;
return 0;
}
+
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_lstat_dereferences_slashed_symlink=yes
+ gl_cv_func_dup2_works=yes
else
- gl_cv_func_lstat_dereferences_slashed_symlink=no
+ gl_cv_func_dup2_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
- else
- # If the 'ln -s' command failed, then we probably don't even
- # have an lstat function.
- gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
- fi
- rm -f conftest.sym conftest.file
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
- case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
- *yes)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
+$as_echo "$gl_cv_func_dup2_works" >&6; }
+ case "$gl_cv_func_dup2_works" in
+ *yes) ;;
+ *)
+ REPLACE_DUP2=1
+ ;;
+ esac
+ fi
+
+
+ if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
+
+
+ fi
+
+
+
+
+
+ GNULIB_DUP2=1
+
+
+
+
+
+
-cat >>confdefs.h <<_ACEOF
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-_ACEOF
- ;;
- esac
- GNULIB_MKTIME=0;
- GNULIB_NANOSLEEP=0;
- GNULIB_STRPTIME=0;
- GNULIB_TIMEGM=0;
- GNULIB_TIME_R=0;
- HAVE_DECL_LOCALTIME_R=1;
- HAVE_NANOSLEEP=1;
- HAVE_STRPTIME=1;
- HAVE_TIMEGM=1;
- REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
- REPLACE_MKTIME=GNULIB_PORTCHECK;
- REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
- REPLACE_TIMEGM=GNULIB_PORTCHECK;
+ GNULIB_ENVIRON=1
- GNULIB_PSELECT=0;
- GNULIB_SELECT=0;
- HAVE_PSELECT=1;
- REPLACE_PSELECT=0;
- REPLACE_SELECT=0;
+ LIB_EXECINFO=''
+ EXECINFO_H='execinfo.h'
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5
-$as_echo_n "checking whether <sys/select.h> is self-contained... " >&6; }
-if test "${gl_cv_header_sys_select_h_selfcontained+set}" = set; then :
+ if test $ac_cv_header_execinfo_h = yes; then
+ gl_saved_libs=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace_symbols_fd" >&5
+$as_echo_n "checking for library containing backtrace_symbols_fd... " >&6; }
+if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then :
$as_echo_n "(cached) " >&6
else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/select.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 backtrace_symbols_fd ();
int
main ()
{
-struct timeval b;
+return backtrace_symbols_fd ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_header_sys_select_h_selfcontained=yes
+for ac_lib in '' execinfo; 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_backtrace_symbols_fd=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then :
+ break
+fi
+done
+if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then :
+
else
- gl_cv_header_sys_select_h_selfcontained=no
+ ac_cv_search_backtrace_symbols_fd=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_backtrace_symbols_fd" >&5
+$as_echo "$ac_cv_search_backtrace_symbols_fd" >&6; }
+ac_res=$ac_cv_search_backtrace_symbols_fd
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ test "$ac_cv_search_backtrace_symbols_fd" = "none required" ||
+ LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $gl_cv_header_sys_select_h_selfcontained = yes; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/select.h>
-int
-main ()
-{
-int memset; int bzero;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/select.h>
-int
-main ()
-{
+ LIBS=$gl_saved_libs
+ test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H=''
+ fi
- #undef memset
- #define memset nonexistent_memset
- extern
- #ifdef __cplusplus
- "C"
- #endif
- void *memset (void *, int, unsigned long);
- #undef bzero
- #define bzero nonexistent_bzero
- extern
- #ifdef __cplusplus
- "C"
- #endif
- void bzero (void *, unsigned long);
- fd_set fds;
- FD_ZERO (&fds);
+ if test -n "$EXECINFO_H"; then
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-else
- gl_cv_header_sys_select_h_selfcontained=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5
-$as_echo "$gl_cv_header_sys_select_h_selfcontained" >&6; }
+ gl_LIBOBJS="$gl_LIBOBJS execinfo.$ac_objext"
+ fi
+ if test -n "$EXECINFO_H"; then
+ GL_GENERATE_EXECINFO_H_TRUE=
+ GL_GENERATE_EXECINFO_H_FALSE='#'
+else
+ GL_GENERATE_EXECINFO_H_TRUE='#'
+ GL_GENERATE_EXECINFO_H_FALSE=
+fi
- if test $gl_cv_have_include_next = yes; then
- gl_cv_next_sys_select_h='<'sys/select.h'>'
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5
-$as_echo_n "checking absolute name of <sys/select.h>... " >&6; }
-if test "${gl_cv_next_sys_select_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test $ac_cv_header_sys_select_h = yes; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/select.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 'sys/select.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_sys_select_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
- sed -n "$gl_absolute_header_sed"`'"'
- else
- gl_cv_next_sys_select_h='<'sys/select.h'>'
- fi
+ if test $ac_cv_func_faccessat = no; then
+ HAVE_FACCESSAT=0
+ fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5
-$as_echo "$gl_cv_next_sys_select_h" >&6; }
- fi
- NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h
+ if test $HAVE_FACCESSAT = 0; then
- 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='<'sys/select.h'>'
- else
- # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_sys_select_h
- fi
- NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive
- if test $ac_cv_header_sys_select_h = yes; then
- HAVE_SYS_SELECT_H=1
- else
- HAVE_SYS_SELECT_H=0
- fi
+ gl_LIBOBJS="$gl_LIBOBJS faccessat.$ac_objext"
- if test $ac_cv_header_sys_socket_h != yes; then
- for ac_header in winsock2.h
+ for ac_func in access
do :
- ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
-if test "x$ac_cv_header_winsock2_h" = x""yes; then :
+ 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_WINSOCK2_H 1
+#define HAVE_ACCESS 1
_ACEOF
fi
-
done
- fi
- if test "$ac_cv_header_winsock2_h" = yes; then
- HAVE_WINSOCK2_H=1
- UNISTD_H_HAVE_WINSOCK2_H=1
- SYS_IOCTL_H_HAVE_WINSOCK2_H=1
- else
- HAVE_WINSOCK2_H=0
+
fi
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FACCESSAT 1
+_ACEOF
- GNULIB_PTHREAD_SIGMASK=0;
- GNULIB_RAISE=0;
- GNULIB_SIGNAL_H_SIGPIPE=0;
- GNULIB_SIGPROCMASK=0;
- GNULIB_SIGACTION=0;
- HAVE_POSIX_SIGNALBLOCKING=1;
- HAVE_PTHREAD_SIGMASK=1;
- HAVE_RAISE=1;
- HAVE_SIGSET_T=1;
- HAVE_SIGINFO_T=1;
- HAVE_SIGACTION=1;
- HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
- HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
+ GNULIB_FACCESSAT=1
- HAVE_SIGHANDLER_T=1;
- REPLACE_PTHREAD_SIGMASK=0;
- REPLACE_RAISE=0;
- ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
- #include <signal.h>
- /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
- #include <sys/types.h>
-"
-if test "x$ac_cv_type_sigset_t" = x""yes; then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGSET_T 1
-_ACEOF
-gl_cv_type_sigset_t=yes
+
+
+
+
+
+ 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
- gl_cv_type_sigset_t=no
-fi
- if test $gl_cv_type_sigset_t != yes; then
- HAVE_SIGSET_T=0
- fi
+ 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"`'"'
- if test $ac_cv_header_sys_socket_h = no; then
- for ac_header in ws2tcpip.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
-if test "x$ac_cv_header_ws2tcpip_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_WS2TCPIP_H 1
-_ACEOF
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
-done
+ 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
- fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdbool.h>
- #ifndef bool
- "error: bool is not defined"
- #endif
- #ifndef false
- "error: false is not defined"
- #endif
- #if false
- "error: false is not 0"
- #endif
- #ifndef true
- "error: true is not defined"
- #endif
- #if true != 1
- "error: true is not 1"
- #endif
- #ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
- #endif
- struct s { _Bool s: 1; _Bool t; } s;
- char a[true == 1 ? 1 : -1];
- char b[false == 0 ? 1 : -1];
- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) 0.5 == true ? 1 : -1];
- /* See body of main program for 'e'. */
- char f[(_Bool) 0.0 == false ? 1 : -1];
- char g[true];
- char h[sizeof (_Bool)];
- char i[sizeof s.t];
- enum { j = false, k = true, l = false * true, m = true * 256 };
- /* The following fails for
- HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
- _Bool n[m];
- char o[sizeof n == m * sizeof n[0] ? 1 : -1];
- char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
- /* Catch a bug in an HP-UX C compiler. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
- */
- _Bool q = true;
- _Bool *pq = &q;
-int
-main ()
-{
- bool e = &s;
- *pq |= q;
- *pq |= ! q;
- /* Refer to every declared value, to avoid compiler optimizations. */
- return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p + !q + !pq);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdbool_h=yes
-else
- ac_cv_header_stdbool_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
- ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = x""yes; then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE__BOOL 1
-_ACEOF
-fi
- REPLACE_NULL=0;
- HAVE_WCHAR_T=1;
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
-$as_echo_n "checking for wchar_t... " >&6; }
-if test "${gt_cv_c_wchar_t+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stddef.h>
- wchar_t foo = (wchar_t)'\0';
-int
-main ()
-{
+ ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
+#include <dirent.h>
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gt_cv_c_wchar_t=yes
+"
+if test "x$ac_cv_have_decl_fdopendir" = x""yes; then :
+ ac_have_decl=1
else
- gt_cv_c_wchar_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_have_decl=0
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
-$as_echo "$gt_cv_c_wchar_t" >&6; }
- if test $gt_cv_c_wchar_t = yes; then
-
-$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
-
- fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FDOPENDIR $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
- GNULIB_DPRINTF=0;
- GNULIB_FCLOSE=0;
- GNULIB_FDOPEN=0;
- GNULIB_FFLUSH=0;
- GNULIB_FGETC=0;
- GNULIB_FGETS=0;
- GNULIB_FOPEN=0;
- GNULIB_FPRINTF=0;
- GNULIB_FPRINTF_POSIX=0;
- GNULIB_FPURGE=0;
- GNULIB_FPUTC=0;
- GNULIB_FPUTS=0;
- GNULIB_FREAD=0;
- GNULIB_FREOPEN=0;
- GNULIB_FSCANF=0;
- GNULIB_FSEEK=0;
- GNULIB_FSEEKO=0;
- GNULIB_FTELL=0;
- GNULIB_FTELLO=0;
- GNULIB_FWRITE=0;
- GNULIB_GETC=0;
- GNULIB_GETCHAR=0;
- GNULIB_GETDELIM=0;
- GNULIB_GETLINE=0;
- GNULIB_OBSTACK_PRINTF=0;
- GNULIB_OBSTACK_PRINTF_POSIX=0;
- GNULIB_PCLOSE=0;
- GNULIB_PERROR=0;
- GNULIB_POPEN=0;
- GNULIB_PRINTF=0;
- GNULIB_PRINTF_POSIX=0;
- GNULIB_PUTC=0;
- GNULIB_PUTCHAR=0;
- GNULIB_PUTS=0;
- GNULIB_REMOVE=0;
- GNULIB_RENAME=0;
- GNULIB_RENAMEAT=0;
- GNULIB_SCANF=0;
- GNULIB_SNPRINTF=0;
- GNULIB_SPRINTF_POSIX=0;
- GNULIB_STDIO_H_NONBLOCKING=0;
- GNULIB_STDIO_H_SIGPIPE=0;
- GNULIB_TMPFILE=0;
- GNULIB_VASPRINTF=0;
- GNULIB_VFSCANF=0;
- GNULIB_VSCANF=0;
- GNULIB_VDPRINTF=0;
- GNULIB_VFPRINTF=0;
- GNULIB_VFPRINTF_POSIX=0;
- GNULIB_VPRINTF=0;
- GNULIB_VPRINTF_POSIX=0;
- GNULIB_VSNPRINTF=0;
- GNULIB_VSPRINTF_POSIX=0;
- HAVE_DECL_FPURGE=1;
- HAVE_DECL_FSEEKO=1;
- HAVE_DECL_FTELLO=1;
- HAVE_DECL_GETDELIM=1;
- HAVE_DECL_GETLINE=1;
- HAVE_DECL_OBSTACK_PRINTF=1;
- HAVE_DECL_SNPRINTF=1;
- HAVE_DECL_VSNPRINTF=1;
- HAVE_DPRINTF=1;
- HAVE_FSEEKO=1;
- HAVE_FTELLO=1;
- HAVE_PCLOSE=1;
- HAVE_POPEN=1;
- HAVE_RENAMEAT=1;
- HAVE_VASPRINTF=1;
- HAVE_VDPRINTF=1;
- REPLACE_DPRINTF=0;
- REPLACE_FCLOSE=0;
- REPLACE_FDOPEN=0;
- REPLACE_FFLUSH=0;
- REPLACE_FOPEN=0;
- REPLACE_FPRINTF=0;
- REPLACE_FPURGE=0;
- REPLACE_FREOPEN=0;
- REPLACE_FSEEK=0;
- REPLACE_FSEEKO=0;
- REPLACE_FTELL=0;
- REPLACE_FTELLO=0;
- REPLACE_GETDELIM=0;
- REPLACE_GETLINE=0;
- REPLACE_OBSTACK_PRINTF=0;
- REPLACE_PERROR=0;
- REPLACE_POPEN=0;
- REPLACE_PRINTF=0;
- REPLACE_REMOVE=0;
- REPLACE_RENAME=0;
- REPLACE_RENAMEAT=0;
- REPLACE_SNPRINTF=0;
- REPLACE_SPRINTF=0;
- REPLACE_STDIO_READ_FUNCS=0;
- REPLACE_STDIO_WRITE_FUNCS=0;
- REPLACE_TMPFILE=0;
- REPLACE_VASPRINTF=0;
- REPLACE_VDPRINTF=0;
- REPLACE_VFPRINTF=0;
- REPLACE_VPRINTF=0;
- REPLACE_VSNPRINTF=0;
- REPLACE_VSPRINTF=0;
+else
+ HAVE_DECL_FDOPENDIR=0
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
-$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if test "${ac_cv_struct_tm+set}" = set; then :
+
+ if test $ac_cv_func_fdopendir = no; then
+ HAVE_FDOPENDIR=0
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
+$as_echo_n "checking whether fdopendir works... " >&6; }
+if test "${gl_cv_func_fdopendir_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_fdopendir_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_fdopendir_works="guessing no" ;;
+ esac
+
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/types.h>
-#include <time.h>
+
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
+#if !HAVE_DECL_FDOPENDIR
+extern
+# ifdef __cplusplus
+"C"
+# endif
+DIR *fdopendir (int);
+#endif
int
main ()
{
-struct tm tm;
- int *p = &tm.tm_sec;
- return !p;
+int result = 0;
+ int fd = open ("conftest.c", O_RDONLY);
+ if (fd < 0) result |= 1;
+ if (fdopendir (fd)) result |= 2;
+ if (close (fd)) result |= 4;
+ return result;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_struct_tm=time.h
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fdopendir_works=yes
else
- ac_cv_struct_tm=sys/time.h
+ gl_cv_func_fdopendir_works=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: $ac_cv_struct_tm" >&5
-$as_echo "$ac_cv_struct_tm" >&6; }
-if test $ac_cv_struct_tm = sys/time.h; then
-
-$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
+$as_echo "$gl_cv_func_fdopendir_works" >&6; }
+ case "$gl_cv_func_fdopendir_works" in
+ *yes) ;;
+ *)
+ REPLACE_FDOPENDIR=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_FDOPENDIR=1
+
+
+
+
-ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
-#include <$ac_cv_struct_tm>
-"
-if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_TM_TM_ZONE 1
+#define GNULIB_FDOPENDIR 1
_ACEOF
-fi
-if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
-$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
-else
- ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
+
+
+
+
+ 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_tzname" = x""yes; then :
+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_TZNAME $ac_have_decl
+#define HAVE_DECL___FPENDING $ac_have_decl
_ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
-$as_echo_n "checking for tzname... " >&6; }
-if test "${ac_cv_var_tzname+set}" = set; then :
+
+ 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
+
+
+
+
+
+
+ if test $ac_cv_func_fstatat = no; then
+ HAVE_FSTATAT=0
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
+$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
+if test "${gl_cv_func_fstatat_zero_flag+set}" = set; then :
$as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
+ *) gl_cv_func_fstatat_zero_flag="guessing yes";;
+ esac
+
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <time.h>
-#if !HAVE_DECL_TZNAME
-extern char *tzname[];
+
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ int
+ main (void)
+ {
+ struct stat a;
+ return fstatat (AT_FDCWD, ".", &a, 0) != 0;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fstatat_zero_flag=yes
+else
+ gl_cv_func_fstatat_zero_flag=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_fstatat_zero_flag" >&5
+$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
+
+ case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
+ *yes+*yes) ;;
+ *) REPLACE_FSTATAT=1
+ case $gl_cv_func_fstatat_zero_flag in
+ *yes)
+
+$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
+
+ ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
+
+ fi
+
+
+
+
+
+ GNULIB_FSTATAT=1
+
+
+
+
+
+
+
+# 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; }
+if test "x$ac_cv_lib_elf_elf_begin" = x""yes; then :
+ LIBS="-lelf $LIBS"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5
+$as_echo_n "checking for kvm_open in -lkvm... " >&6; }
+if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkvm $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 kvm_open ();
int
main ()
{
-return tzname[0][0];
+return kvm_open ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_var_tzname=yes
+ ac_cv_lib_kvm_kvm_open=yes
else
- ac_cv_var_tzname=no
+ ac_cv_lib_kvm_kvm_open=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_var_tzname" >&5
-$as_echo "$ac_cv_var_tzname" >&6; }
- if test $ac_cv_var_tzname = yes; then
-
-$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
-
- fi
-fi
-
-
- ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
-"
-if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then :
-
-$as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h
-
-fi
-
-
-
-
-ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strtoimax" = x""yes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRTOIMAX $ac_have_decl
-_ACEOF
-
-
-
-ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strtoumax" = x""yes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5
+$as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
+if test "x$ac_cv_lib_kvm_kvm_open" = x""yes; then :
+ LIBS="-lkvm $LIBS"
fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRTOUMAX $ac_have_decl
-_ACEOF
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
-$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
-if test "${ac_cv_header_stat_broken+set}" = set; then :
+ # Check for the 4.4BSD definition of getloadavg.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lutil" >&5
+$as_echo_n "checking for getloadavg in -lutil... " >&6; }
+if test "${ac_cv_lib_util_getloadavg+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lutil $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if defined S_ISBLK && defined S_IFDIR
-extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
-#endif
-
-#if defined S_ISBLK && defined S_IFCHR
-extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
-#endif
-
-#if defined S_ISLNK && defined S_IFREG
-extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
-#endif
-#if defined S_ISSOCK && defined S_IFREG
-extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
+/* 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 getloadavg ();
+int
+main ()
+{
+return getloadavg ();
+ ;
+ return 0;
+}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stat_broken=no
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_util_getloadavg=yes
else
- ac_cv_header_stat_broken=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_lib_util_getloadavg=no
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
-$as_echo "$ac_cv_header_stat_broken" >&6; }
-if test $ac_cv_header_stat_broken = yes; then
-
-$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
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
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_getloadavg" >&5
+$as_echo "$ac_cv_lib_util_getloadavg" >&6; }
+if test "x$ac_cv_lib_util_getloadavg" = x""yes; then :
+ LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes
fi
+ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
-$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
-if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then :
+ if test $gl_func_getloadavg_done = no; then
+ # There is a commonly available library for RS/6000 AIX.
+ # Since it is not a standard part of AIX, it might be installed locally.
+ gl_getloadavg_LIBS=$LIBS
+ LIBS="-L/usr/local/lib $LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lgetloadavg" >&5
+$as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; }
+if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgetloadavg $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <time.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 getloadavg ();
int
main ()
{
-static struct timespec x; x.tv_sec = x.tv_nsec;
+return getloadavg ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_sys_struct_timespec_in_time_h=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_getloadavg_getloadavg=yes
else
- gl_cv_sys_struct_timespec_in_time_h=no
+ ac_cv_lib_getloadavg_getloadavg=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+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_getloadavg_getloadavg" >&5
+$as_echo "$ac_cv_lib_getloadavg_getloadavg" >&6; }
+if test "x$ac_cv_lib_getloadavg_getloadavg" = x""yes; then :
+ LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes
+else
+ LIBS=$gl_getloadavg_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
-$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
- TIME_H_DEFINES_STRUCT_TIMESPEC=0
- SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
- PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
- if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
- TIME_H_DEFINES_STRUCT_TIMESPEC=1
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
-$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
-if test "${gl_cv_sys_struct_timespec_in_sys_time_h+set}" = set; then :
+ fi
+
+ # Set up the replacement function if necessary.
+ if test $gl_func_getloadavg_done = no; then
+ HAVE_GETLOADAVG=0
+
+ # Solaris has libkstat which does not require root.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5
+$as_echo_n "checking for kstat_open in -lkstat... " >&6; }
+if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkstat $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/time.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 kstat_open ();
int
main ()
{
-static struct timespec x; x.tv_sec = x.tv_nsec;
+return kstat_open ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_sys_struct_timespec_in_sys_time_h=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_kstat_kstat_open=yes
else
- gl_cv_sys_struct_timespec_in_sys_time_h=no
+ ac_cv_lib_kstat_kstat_open=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+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: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
-$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
- if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
- SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
-$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
-if test "${gl_cv_sys_struct_timespec_in_pthread_h+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5
+$as_echo "$ac_cv_lib_kstat_kstat_open" >&6; }
+if test "x$ac_cv_lib_kstat_kstat_open" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKSTAT 1
+_ACEOF
+
+ LIBS="-lkstat $LIBS"
+
+fi
+
+ test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
+
+ # AIX has libperfstat which does not require root
+ if test $gl_func_getloadavg_done = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perfstat_cpu_total in -lperfstat" >&5
+$as_echo_n "checking for perfstat_cpu_total in -lperfstat... " >&6; }
+if test "${ac_cv_lib_perfstat_perfstat_cpu_total+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lperfstat $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <pthread.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 perfstat_cpu_total ();
int
main ()
{
-static struct timespec x; x.tv_sec = x.tv_nsec;
+return perfstat_cpu_total ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_sys_struct_timespec_in_pthread_h=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_perfstat_perfstat_cpu_total=yes
else
- gl_cv_sys_struct_timespec_in_pthread_h=no
+ ac_cv_lib_perfstat_perfstat_cpu_total=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+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: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
-$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
- if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
- PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
- fi
- fi
- fi
-
-
-
-
-
-
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perfstat_perfstat_cpu_total" >&5
+$as_echo "$ac_cv_lib_perfstat_perfstat_cpu_total" >&6; }
+if test "x$ac_cv_lib_perfstat_perfstat_cpu_total" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPERFSTAT 1
+_ACEOF
+ LIBS="-lperfstat $LIBS"
+fi
+ test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
+ fi
+ if test $gl_func_getloadavg_done = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/dg_sys_info.h" "ac_cv_header_sys_dg_sys_info_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_dg_sys_info_h" = x""yes; then :
+ gl_func_getloadavg_done=yes
+$as_echo "#define DGUX 1" >>confdefs.h
- if test $gl_cv_have_include_next = yes; then
- gl_cv_next_time_h='<'time.h'>'
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
-$as_echo_n "checking absolute name of <time.h>... " >&6; }
-if test "${gl_cv_next_time_h+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dg_sys_info in -ldgc" >&5
+$as_echo_n "checking for dg_sys_info in -ldgc... " >&6; }
+if test "${ac_cv_lib_dgc_dg_sys_info+set}" = set; then :
$as_echo_n "(cached) " >&6
else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldgc $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <time.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 dg_sys_info ();
+int
+main ()
+{
+return dg_sys_info ();
+ ;
+ return 0;
+}
_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 'time.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_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
- sed -n "$gl_absolute_header_sed"`'"'
-
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dgc_dg_sys_info=yes
+else
+ ac_cv_lib_dgc_dg_sys_info=no
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
-$as_echo "$gl_cv_next_time_h" >&6; }
- fi
- NEXT_TIME_H=$gl_cv_next_time_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='<'time.h'>'
- else
- # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_time_h
- fi
- NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
-
-
-
+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_dgc_dg_sys_info" >&5
+$as_echo "$ac_cv_lib_dgc_dg_sys_info" >&6; }
+if test "x$ac_cv_lib_dgc_dg_sys_info" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDGC 1
+_ACEOF
+ LIBS="-ldgc $LIBS"
+fi
+fi
+ fi
+ fi
+fi
+if test "x$gl_save_LIBS" = x; then
+ GETLOADAVG_LIBS=$LIBS
+else
+ GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
+fi
+LIBS=$gl_save_LIBS
+# Test whether the system declares getloadavg. Solaris has the function
+# but declares it in <sys/loadavg.h>, not <stdlib.h>.
+for ac_header in sys/loadavg.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/loadavg.h" "ac_cv_header_sys_loadavg_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_loadavg_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_LOADAVG_H 1
+_ACEOF
+fi
+done
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the utimes function works" >&5
-$as_echo_n "checking whether the utimes function works... " >&6; }
-if test "${gl_cv_func_working_utimes+set}" = set; then :
- $as_echo_n "(cached) " >&6
+if test $ac_cv_header_sys_loadavg_h = yes; then
+ HAVE_SYS_LOADAVG_H=1
else
+ HAVE_SYS_LOADAVG_H=0
+fi
+ac_fn_c_check_decl "$LINENO" "getloadavg" "ac_cv_have_decl_getloadavg" "#if HAVE_SYS_LOADAVG_H
+ # include <sys/loadavg.h>
+ #endif
+ #include <stdlib.h>
+"
+if test "x$ac_cv_have_decl_getloadavg" = x""yes; then :
- if test "$cross_compiling" = yes; then :
- gl_cv_func_working_utimes=no
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <utime.h>
-
-static int
-inorder (time_t a, time_t b, time_t c)
-{
- return a <= b && b <= c;
-}
-
-int
-main ()
-{
- int result = 0;
- char const *file = "conftest.utimes";
- static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
+ HAVE_DECL_GETLOADAVG=0
+fi
- /* Test whether utimes() essentially works. */
- {
- struct stat sbuf;
- FILE *f = fopen (file, "w");
- if (f == NULL)
- result |= 1;
- else if (fclose (f) != 0)
- result |= 1;
- else if (utimes (file, timeval) != 0)
- result |= 2;
- else if (lstat (file, &sbuf) != 0)
- result |= 1;
- else if (!(sbuf.st_atime == timeval[0].tv_sec
- && sbuf.st_mtime == timeval[1].tv_sec))
- result |= 4;
- if (unlink (file) != 0)
- result |= 1;
- }
- /* Test whether utimes() with a NULL argument sets the file's timestamp
- to the current time. Use 'fstat' as well as 'time' to
- determine the "current" time, to accommodate NFS file systems
- if there is a time skew between the host and the NFS server. */
- {
- int fd = open (file, O_WRONLY|O_CREAT, 0644);
- if (fd < 0)
- result |= 1;
- else
- {
- time_t t0, t2;
- struct stat st0, st1, st2;
- if (time (&t0) == (time_t) -1)
- result |= 1;
- else if (fstat (fd, &st0) != 0)
- result |= 1;
- else if (utimes (file, timeval) != 0)
- result |= 2;
- else if (utimes (file, NULL) != 0)
- result |= 8;
- else if (fstat (fd, &st1) != 0)
- result |= 1;
- else if (write (fd, "\n", 1) != 1)
- result |= 1;
- else if (fstat (fd, &st2) != 0)
- result |= 1;
- else if (time (&t2) == (time_t) -1)
- result |= 1;
- else
- {
- int m_ok_POSIX = inorder (t0, st1.st_mtime, t2);
- int m_ok_NFS = inorder (st0.st_mtime, st1.st_mtime, st2.st_mtime);
- if (! (st1.st_atime == st1.st_mtime))
- result |= 16;
- if (! (m_ok_POSIX || m_ok_NFS))
- result |= 32;
- }
- if (close (fd) != 0)
- result |= 1;
- }
- if (unlink (file) != 0)
- result |= 1;
- }
+ if test $HAVE_GETLOADAVG = 0; then
+
- /* Test whether utimes() with a NULL argument works on read-only files. */
- {
- int fd = open (file, O_WRONLY|O_CREAT, 0444);
- if (fd < 0)
- result |= 1;
- else if (close (fd) != 0)
- result |= 1;
- else if (utimes (file, NULL) != 0)
- result |= 64;
- if (unlink (file) != 0)
- result |= 1;
- }
- return result;
-}
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS getloadavg.$ac_objext"
+
+
+# Figure out what our getloadavg.c needs.
+
+
+
+# On HPUX9, an unprivileged user can get load averages this way.
+if test $gl_func_getloadavg_done = no; then
+ for ac_func in pstat_getdynamic
+do :
+ ac_fn_c_check_func "$LINENO" "pstat_getdynamic" "ac_cv_func_pstat_getdynamic"
+if test "x$ac_cv_func_pstat_getdynamic" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PSTAT_GETDYNAMIC 1
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_working_utimes=yes
-else
- gl_cv_func_working_utimes=no
+ gl_func_getloadavg_done=yes
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+done
+
fi
+# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
+# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
+# Irix 4.0.5F has the header but not the library.
+if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
+ && test "$ac_cv_lib_kvm_kvm_open" = yes; then
+ gl_func_getloadavg_done=yes
+
+$as_echo "#define SVR4 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_utimes" >&5
-$as_echo "$gl_cv_func_working_utimes" >&6; }
- if test $gl_cv_func_working_utimes = yes; then
+if test $gl_func_getloadavg_done = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "inq_stats/cpustats.h" "ac_cv_header_inq_stats_cpustats_h" "$ac_includes_default"
+if test "x$ac_cv_header_inq_stats_cpustats_h" = x""yes; then :
+ gl_func_getloadavg_done=yes
-$as_echo "#define HAVE_WORKING_UTIMES 1" >>confdefs.h
+$as_echo "#define UMAX 1" >>confdefs.h
- fi
+$as_echo "#define UMAX4_3 1" >>confdefs.h
+
+fi
+fi
+if test $gl_func_getloadavg_done = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/cpustats.h" "ac_cv_header_sys_cpustats_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_cpustats_h" = x""yes; then :
+ gl_func_getloadavg_done=yes; $as_echo "#define UMAX 1" >>confdefs.h
+
+fi
+
+
+fi
+
+if test $gl_func_getloadavg_done = no; then
+ for ac_header in mach/mach.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default"
+if test "x$ac_cv_header_mach_mach_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MACH_MACH_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+for ac_header in nlist.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "$ac_includes_default"
+if test "x$ac_cv_header_nlist_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NLIST_H 1
+_ACEOF
+ ac_fn_c_check_member "$LINENO" "struct nlist" "n_un.n_name" "ac_cv_member_struct_nlist_n_un_n_name" "#include <nlist.h>
+"
+if test "x$ac_cv_member_struct_nlist_n_un_n_name" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_NLIST_N_UN_N_NAME 1
+_ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utimbuf" >&5
-$as_echo_n "checking for struct utimbuf... " >&6; }
-if test "${gl_cv_sys_struct_utimbuf+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif
- #include <time.h>
- #ifdef HAVE_UTIME_H
- #include <utime.h>
- #endif
+fi
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <nlist.h>
int
main ()
{
-static struct utimbuf x; x.actime = x.modtime;
+struct nlist x;
+ #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
+ x.n_un.n_name = "";
+ #else
+ x.n_name = "";
+ #endif
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_sys_struct_utimbuf=yes
-else
- gl_cv_sys_struct_utimbuf=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"; then :
+
+$as_echo "#define N_NAME_POINTER 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_utimbuf" >&5
-$as_echo "$gl_cv_sys_struct_utimbuf" >&6; }
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
- if test $gl_cv_sys_struct_utimbuf = yes; then
+fi
-$as_echo "#define HAVE_STRUCT_UTIMBUF 1" >>confdefs.h
+done
fi
+ GNULIB_GETLOADAVG=1
- if false; then
- GL_COND_LIBTOOL_TRUE=
- GL_COND_LIBTOOL_FALSE='#'
-else
- GL_COND_LIBTOOL_TRUE='#'
- GL_COND_LIBTOOL_FALSE=
-fi
- gl_cond_libtool=false
- gl_libdeps=
- gl_ltlibdeps=
- gl_m4_base='m4'
+ if test $REPLACE_GETOPT = 1; then
- gl_source_base='lib'
+ gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
- if test $ac_cv_func_alloca_works = no; then
- :
- fi
- # Define an additional variable used in the Makefile substitution.
- if test $ac_cv_working_alloca_h = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
-$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
-if test "${gl_cv_rpl_alloca+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if defined __GNUC__ || defined _AIX || defined _MSC_VER
- Need own alloca
-#endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "Need own alloca" >/dev/null 2>&1; then :
- gl_cv_rpl_alloca=yes
-else
- gl_cv_rpl_alloca=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
-$as_echo "$gl_cv_rpl_alloca" >&6; }
- if test $gl_cv_rpl_alloca = yes; then
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
- ALLOCA_H=alloca.h
- else
- ALLOCA_H=
- fi
- else
- ALLOCA_H=alloca.h
+ gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+
+
+
+
+ GNULIB_GL_UNISTD_H_GETOPT=1
fi
- if test -n "$ALLOCA_H"; then
- GL_GENERATE_ALLOCA_H_TRUE=
- GL_GENERATE_ALLOCA_H_FALSE='#'
-else
- GL_GENERATE_ALLOCA_H_TRUE='#'
- GL_GENERATE_ALLOCA_H_FALSE=
-fi
- # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
- # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+
+ if test $REPLACE_GETOPT = 1; then
+
+ GETOPT_H=getopt.h
+
+$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
- # Save and restore LIBS so e.g., -lrt, 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_CLOCK_GETTIME=
- gl_saved_libs=$LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
-$as_echo_n "checking for library containing clock_gettime... " >&6; }
-if test "${ac_cv_search_clock_gettime+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 clock_gettime ();
-int
-main ()
-{
-return clock_gettime ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' rt posix4; 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_clock_gettime=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_clock_gettime+set}" = set; then :
- break
-fi
-done
-if test "${ac_cv_search_clock_gettime+set}" = set; then :
-else
- ac_cv_search_clock_gettime=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
-$as_echo "$ac_cv_search_clock_gettime" >&6; }
-ac_res=$ac_cv_search_clock_gettime
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- test "$ac_cv_search_clock_gettime" = "none required" ||
- LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
-fi
+ if test $REPLACE_GETOPT = 1; then
- for ac_func in clock_gettime clock_settime
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
- LIBS=$gl_saved_libs
- :
+ gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
- :
+ gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+ GNULIB_GL_UNISTD_H_GETOPT=1
+ fi
-$as_echo "#define HAVE_DUP2 1" >>confdefs.h
- if test $HAVE_DUP2 = 1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
-$as_echo_n "checking whether dup2 works... " >&6; }
-if test "${gl_cv_func_dup2_works+set}" = set; then :
+
+
+
+
+
+ gl_gettimeofday_timezone=void
+ if test $ac_cv_func_gettimeofday != yes; then
+ HAVE_GETTIMEOFDAY=0
+ else
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
+$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
+if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- case "$host_os" in
- mingw*) # on this platform, dup2 always returns 0 for success
- gl_cv_func_dup2_works="guessing no" ;;
- cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
- gl_cv_func_dup2_works="guessing no" ;;
- linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
- # closed fd may yield -EBADF instead of -1 / errno=EBADF.
- gl_cv_func_dup2_works="guessing no" ;;
- freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
- gl_cv_func_dup2_works="guessing no" ;;
- haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
- gl_cv_func_dup2_works="guessing no" ;;
- *) gl_cv_func_dup2_works="guessing yes" ;;
- esac
+ # When cross-compiling:
+ case "$host_os" in
+ # Guess all is fine on glibc systems.
+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ esac
+
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <string.h>
+ #include <sys/time.h>
+ #include <time.h>
+ #include <stdlib.h>
- #include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
int
main ()
{
-int result = 0;
-#ifdef FD_CLOEXEC
- if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
- result |= 1;
-#endif
- if (dup2 (1, 1) == 0)
- result |= 2;
-#ifdef FD_CLOEXEC
- if (fcntl (1, F_GETFD) != FD_CLOEXEC)
- result |= 4;
-#endif
- close (0);
- if (dup2 (0, 0) != -1)
- result |= 8;
- /* Many gnulib modules require POSIX conformance of EBADF. */
- if (dup2 (2, 1000000) == -1 && errno != EBADF)
- result |= 16;
- return result;
+
+ time_t t = 0;
+ struct tm *lt;
+ struct tm saved_lt;
+ struct timeval tv;
+ lt = localtime (&t);
+ saved_lt = *lt;
+ gettimeofday (&tv, NULL);
+ return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
;
return 0;
}
-
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_dup2_works=yes
+ gl_cv_func_gettimeofday_clobber=no
else
- gl_cv_func_dup2_works=no
+ gl_cv_func_gettimeofday_clobber=yes
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_dup2_works" >&5
-$as_echo "$gl_cv_func_dup2_works" >&6; }
- case "$gl_cv_func_dup2_works" in
- *yes) ;;
- *)
- REPLACE_DUP2=1
- ;;
- esac
- fi
-
-
- if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
-
-
-
-
-
-
-
-
- gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
+$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
+ case "$gl_cv_func_gettimeofday_clobber" in
+ *yes)
+ REPLACE_GETTIMEOFDAY=1
- fi
+$as_echo "#define gmtime rpl_gmtime" >>confdefs.h
+$as_echo "#define localtime rpl_localtime" >>confdefs.h
- GNULIB_DUP2=1
+$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
+$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
+if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+ struct timeval c;
+ int gettimeofday (struct timeval *restrict, void *restrict);
+int
+main ()
+{
+/* glibc uses struct timezone * rather than the POSIX void *
+ if _GNU_SOURCE is defined. However, since the only portable
+ use of gettimeofday uses NULL as the second parameter, and
+ since the glibc definition is actually more typesafe, it is
+ not worth wrapping this to get a compliant signature. */
+ int (*f) (struct timeval *restrict, void *restrict)
+ = gettimeofday;
+ int x = f (&c, 0);
+ return !(x | c.tv_sec | c.tv_usec);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_gettimeofday_posix_signature=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_gettimeofday_posix_signature=almost
+else
+ gl_cv_func_gettimeofday_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
+$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
+ if test $gl_cv_func_gettimeofday_posix_signature = almost; then
+ gl_gettimeofday_timezone='struct timezone'
+ elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
+ REPLACE_GETTIMEOFDAY=1
+ fi
+ if test $REPLACE_STRUCT_TIMEVAL = 1; then
+ REPLACE_GETTIMEOFDAY=1
+ fi
+ fi
+cat >>confdefs.h <<_ACEOF
+#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
+_ACEOF
- GNULIB_ENVIRON=1
+ if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
- LIB_EXECINFO=''
- EXECINFO_H='execinfo.h'
+ gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
- if test $ac_cv_header_execinfo_h = yes; then
- gl_saved_libs=$LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace_symbols_fd" >&5
-$as_echo_n "checking for library containing backtrace_symbols_fd... " >&6; }
-if test "${ac_cv_search_backtrace_symbols_fd+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 backtrace_symbols_fd ();
-int
-main ()
-{
-return backtrace_symbols_fd ();
- ;
- return 0;
-}
+ for ac_header in sys/timeb.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_timeb_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TIMEB_H 1
_ACEOF
-for ac_lib in '' execinfo; 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_backtrace_symbols_fd=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then :
- break
+
fi
+
done
-if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then :
-else
- ac_cv_search_backtrace_symbols_fd=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_backtrace_symbols_fd" >&5
-$as_echo "$ac_cv_search_backtrace_symbols_fd" >&6; }
-ac_res=$ac_cv_search_backtrace_symbols_fd
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- test "$ac_cv_search_backtrace_symbols_fd" = "none required" ||
- LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd
+ for ac_func in _ftime
+do :
+ ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime"
+if test "x$ac_cv_func__ftime" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE__FTIME 1
+_ACEOF
+
fi
+done
+
- LIBS=$gl_saved_libs
- test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H=''
fi
- if test -n "$EXECINFO_H"; then
+ GNULIB_GETTIMEOFDAY=1
+
- gl_LIBOBJS="$gl_LIBOBJS execinfo.$ac_objext"
+
+
+
+
+ if test $ac_cv_func_lstat = yes; then
+
+ case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *no)
+ REPLACE_LSTAT=1
+ ;;
+ esac
+ else
+ HAVE_LSTAT=0
fi
+ if test $REPLACE_LSTAT = 1; then
- if test -n "$EXECINFO_H"; then
- GL_GENERATE_EXECINFO_H_TRUE=
- GL_GENERATE_EXECINFO_H_FALSE='#'
-else
- GL_GENERATE_EXECINFO_H_TRUE='#'
- GL_GENERATE_EXECINFO_H_FALSE=
-fi
+ gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
+ :
+ 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 :
+ GNULIB_LSTAT=1
-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; }
-if test "x$ac_cv_lib_elf_elf_begin" = x""yes; then :
- LIBS="-lelf $LIBS"
-fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5
-$as_echo_n "checking for kvm_open in -lkvm... " >&6; }
-if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkvm $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 kvm_open ();
-int
-main ()
-{
-return kvm_open ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_kvm_kvm_open=yes
-else
- ac_cv_lib_kvm_kvm_open=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_kvm_kvm_open" >&5
-$as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
-if test "x$ac_cv_lib_kvm_kvm_open" = x""yes; then :
- LIBS="-lkvm $LIBS"
-fi
- # Check for the 4.4BSD definition of getloadavg.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lutil" >&5
-$as_echo_n "checking for getloadavg in -lutil... " >&6; }
-if test "${ac_cv_lib_util_getloadavg+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lutil $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 getloadavg ();
-int
-main ()
-{
-return getloadavg ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_util_getloadavg=yes
-else
- ac_cv_lib_util_getloadavg=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_util_getloadavg" >&5
-$as_echo "$ac_cv_lib_util_getloadavg" >&6; }
-if test "x$ac_cv_lib_util_getloadavg" = x""yes; then :
- LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes
-fi
- fi
- if test $gl_func_getloadavg_done = no; then
- # There is a commonly available library for RS/6000 AIX.
- # Since it is not a standard part of AIX, it might be installed locally.
- gl_getloadavg_LIBS=$LIBS
- LIBS="-L/usr/local/lib $LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lgetloadavg" >&5
-$as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; }
-if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgetloadavg $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 getloadavg ();
-int
-main ()
-{
-return getloadavg ();
- ;
- return 0;
-}
+ if test $ac_cv_have_decl_memrchr = no; then
+ HAVE_DECL_MEMRCHR=0
+ fi
+
+ for ac_func in memrchr
+do :
+ ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
+if test "x$ac_cv_func_memrchr" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MEMRCHR 1
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_getloadavg_getloadavg=yes
-else
- ac_cv_lib_getloadavg_getloadavg=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_getloadavg_getloadavg" >&5
-$as_echo "$ac_cv_lib_getloadavg_getloadavg" >&6; }
-if test "x$ac_cv_lib_getloadavg_getloadavg" = x""yes; then :
- LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes
-else
- LIBS=$gl_getloadavg_LIBS
+
fi
+done
+
+
+ if test $ac_cv_func_memrchr = no; then
+
- fi
- # Set up the replacement function if necessary.
- if test $gl_func_getloadavg_done = no; then
- HAVE_GETLOADAVG=0
- # Solaris has libkstat which does not require root.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5
-$as_echo_n "checking for kstat_open in -lkstat... " >&6; }
-if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkstat $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 kstat_open ();
-int
-main ()
-{
-return kstat_open ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_kstat_kstat_open=yes
-else
- ac_cv_lib_kstat_kstat_open=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_kstat_kstat_open" >&5
-$as_echo "$ac_cv_lib_kstat_kstat_open" >&6; }
-if test "x$ac_cv_lib_kstat_kstat_open" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBKSTAT 1
-_ACEOF
- LIBS="-lkstat $LIBS"
-fi
- test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
+ gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
- # AIX has libperfstat which does not require root
- if test $gl_func_getloadavg_done = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perfstat_cpu_total in -lperfstat" >&5
-$as_echo_n "checking for perfstat_cpu_total in -lperfstat... " >&6; }
-if test "${ac_cv_lib_perfstat_perfstat_cpu_total+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lperfstat $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ :
+ fi
-/* 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 perfstat_cpu_total ();
-int
-main ()
-{
-return perfstat_cpu_total ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_perfstat_perfstat_cpu_total=yes
-else
- ac_cv_lib_perfstat_perfstat_cpu_total=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_perfstat_perfstat_cpu_total" >&5
-$as_echo "$ac_cv_lib_perfstat_perfstat_cpu_total" >&6; }
-if test "x$ac_cv_lib_perfstat_perfstat_cpu_total" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPERFSTAT 1
-_ACEOF
- LIBS="-lperfstat $LIBS"
-fi
- test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
- fi
- if test $gl_func_getloadavg_done = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/dg_sys_info.h" "ac_cv_header_sys_dg_sys_info_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_dg_sys_info_h" = x""yes; then :
- gl_func_getloadavg_done=yes
+ GNULIB_MEMRCHR=1
-$as_echo "#define DGUX 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dg_sys_info in -ldgc" >&5
-$as_echo_n "checking for dg_sys_info in -ldgc... " >&6; }
-if test "${ac_cv_lib_dgc_dg_sys_info+set}" = set; then :
+
+
+
+
+
+
+
+
+
+ if test $APPLE_UNIVERSAL_BUILD = 1; then
+ # A universal build on Apple Mac OS X platforms.
+ # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
+ # But we need a configuration result that is valid in both modes.
+ gl_cv_func_working_mktime=no
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
+$as_echo_n "checking for working mktime... " >&6; }
+if test "${gl_cv_func_working_mktime+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldgc $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "$cross_compiling" = yes; then :
+ gl_cv_func_working_mktime=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+/* Test program from Paul Eggert and Tony Leneis. */
+#include <limits.h>
+#include <stdlib.h>
+#include <time.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"
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
#endif
-char dg_sys_info ();
-int
-main ()
+
+#ifndef HAVE_ALARM
+# define alarm(X) /* empty */
+#endif
+
+/* Work around redefinition to rpl_putenv by other config tests. */
+#undef putenv
+
+static time_t time_t_max;
+static time_t time_t_min;
+
+/* Values we'll use to set the TZ environment variable. */
+static char *tz_strings[] = {
+ (char *) 0, "TZ=GMT0", "TZ=JST-9",
+ "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+static int
+spring_forward_gap ()
{
-return dg_sys_info ();
- ;
- return 0;
+ /* glibc (up to about 1998-10-07) failed this test. */
+ struct tm tm;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+ tm.tm_year = 98;
+ tm.tm_mon = 3;
+ tm.tm_mday = 5;
+ tm.tm_hour = 2;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ return mktime (&tm) != (time_t) -1;
}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dgc_dg_sys_info=yes
-else
- ac_cv_lib_dgc_dg_sys_info=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_dgc_dg_sys_info" >&5
-$as_echo "$ac_cv_lib_dgc_dg_sys_info" >&6; }
-if test "x$ac_cv_lib_dgc_dg_sys_info" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDGC 1
-_ACEOF
- LIBS="-ldgc $LIBS"
+static int
+mktime_test1 (time_t now)
+{
+ struct tm *lt;
+ return ! (lt = localtime (&now)) || mktime (lt) == now;
+}
+
+static int
+mktime_test (time_t now)
+{
+ return (mktime_test1 (now)
+ && mktime_test1 ((time_t) (time_t_max - now))
+ && mktime_test1 ((time_t) (time_t_min + now)));
+}
+
+static int
+irix_6_4_bug ()
+{
+ /* Based on code from Ariel Faigon. */
+ struct tm tm;
+ tm.tm_year = 96;
+ tm.tm_mon = 3;
+ tm.tm_mday = 0;
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+ return tm.tm_mon == 2 && tm.tm_mday == 31;
+}
+
+static int
+bigtime_test (int j)
+{
+ struct tm tm;
+ time_t now;
+ tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+ now = mktime (&tm);
+ if (now != (time_t) -1)
+ {
+ struct tm *lt = localtime (&now);
+ if (! (lt
+ && lt->tm_year == tm.tm_year
+ && lt->tm_mon == tm.tm_mon
+ && lt->tm_mday == tm.tm_mday
+ && lt->tm_hour == tm.tm_hour
+ && lt->tm_min == tm.tm_min
+ && lt->tm_sec == tm.tm_sec
+ && lt->tm_yday == tm.tm_yday
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+ return 0;
+ }
+ return 1;
+}
-fi
+static int
+year_2050_test ()
+{
+ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+ ignoring leap seconds. */
+ unsigned long int answer = 2527315200UL;
-fi
+ struct tm tm;
+ time_t t;
+ tm.tm_year = 2050 - 1900;
+ tm.tm_mon = 2 - 1;
+ tm.tm_mday = 1;
+ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
- fi
- fi
-fi
+ t = mktime (&tm);
+ /* Check that the result is either a failure, or close enough
+ to the correct answer that we can assume the discrepancy is
+ due to leap seconds. */
+ return (t == (time_t) -1
+ || (0 < t && answer - 120 <= t && t <= answer + 120));
+}
-if test "x$gl_save_LIBS" = x; then
- GETLOADAVG_LIBS=$LIBS
-else
- GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
-fi
-LIBS=$gl_save_LIBS
+int
+main ()
+{
+ int result = 0;
+ time_t t, delta;
+ int i, j;
+ int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
+ int time_t_signed = ! ((time_t) 0 < (time_t) -1);
+ /* This test makes some buggy mktime implementations loop.
+ Give up after 60 seconds; a mktime slower than that
+ isn't worth using anyway. */
+ alarm (60);
-# Test whether the system declares getloadavg. Solaris has the function
-# but declares it in <sys/loadavg.h>, not <stdlib.h>.
-for ac_header in sys/loadavg.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/loadavg.h" "ac_cv_header_sys_loadavg_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_loadavg_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_LOADAVG_H 1
-_ACEOF
+ time_t_max = (! time_t_signed
+ ? (time_t) -1
+ : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
+ * 2 + 1));
+ time_t_min = (! time_t_signed
+ ? (time_t) 0
+ : time_t_signed_magnitude
+ ? ~ (time_t) 0
+ : ~ time_t_max);
-fi
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+ if (tz_strings[i])
+ putenv (tz_strings[i]);
-done
+ for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
+ if (! mktime_test (t))
+ result |= 1;
+ if ((result & 2) == 0
+ && ! (mktime_test ((time_t) 1)
+ && mktime_test ((time_t) (60 * 60))
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ result |= 2;
-if test $ac_cv_header_sys_loadavg_h = yes; then
- HAVE_SYS_LOADAVG_H=1
+ for (j = 1; (result & 4) == 0; j <<= 1)
+ {
+ if (! bigtime_test (j))
+ result |= 4;
+ if (INT_MAX / 2 < j)
+ break;
+ }
+ if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
+ result |= 8;
+ }
+ if (! irix_6_4_bug ())
+ result |= 16;
+ if (! spring_forward_gap ())
+ result |= 32;
+ if (! year_2050_test ())
+ result |= 64;
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_working_mktime=yes
else
- HAVE_SYS_LOADAVG_H=0
+ gl_cv_func_working_mktime=no
fi
-ac_fn_c_check_decl "$LINENO" "getloadavg" "ac_cv_have_decl_getloadavg" "#if HAVE_SYS_LOADAVG_H
- # include <sys/loadavg.h>
- #endif
- #include <stdlib.h>
-"
-if test "x$ac_cv_have_decl_getloadavg" = x""yes; then :
-
-else
- HAVE_DECL_GETLOADAVG=0
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
- if test $HAVE_GETLOADAVG = 0; then
-
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5
+$as_echo "$gl_cv_func_working_mktime" >&6; }
+ if test $gl_cv_func_working_mktime = no; then
+ REPLACE_MKTIME=1
+ else
+ REPLACE_MKTIME=0
+ fi
+ if test $REPLACE_MKTIME = 1; then
- gl_LIBOBJS="$gl_LIBOBJS getloadavg.$ac_objext"
-# Figure out what our getloadavg.c needs.
+ gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
+ :
+ fi
-# On HPUX9, an unprivileged user can get load averages this way.
-if test $gl_func_getloadavg_done = no; then
- for ac_func in pstat_getdynamic
-do :
- ac_fn_c_check_func "$LINENO" "pstat_getdynamic" "ac_cv_func_pstat_getdynamic"
-if test "x$ac_cv_func_pstat_getdynamic" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_PSTAT_GETDYNAMIC 1
-_ACEOF
- gl_func_getloadavg_done=yes
-fi
-done
-fi
-# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
-# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
-# Irix 4.0.5F has the header but not the library.
-if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
- && test "$ac_cv_lib_kvm_kvm_open" = yes; then
- gl_func_getloadavg_done=yes
-$as_echo "#define SVR4 1" >>confdefs.h
-fi
+ GNULIB_MKTIME=1
-if test $gl_func_getloadavg_done = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "inq_stats/cpustats.h" "ac_cv_header_inq_stats_cpustats_h" "$ac_includes_default"
-if test "x$ac_cv_header_inq_stats_cpustats_h" = x""yes; then :
- gl_func_getloadavg_done=yes
-$as_echo "#define UMAX 1" >>confdefs.h
-$as_echo "#define UMAX4_3 1" >>confdefs.h
-fi
-fi
-if test $gl_func_getloadavg_done = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/cpustats.h" "ac_cv_header_sys_cpustats_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_cpustats_h" = x""yes; then :
- gl_func_getloadavg_done=yes; $as_echo "#define UMAX 1" >>confdefs.h
-fi
-fi
+ if test $ac_cv_func_pselect = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether signature of pselect conforms to POSIX" >&5
+$as_echo_n "checking whether signature of pselect conforms to POSIX... " >&6; }
+if test "${gl_cv_sig_pselect+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
-if test $gl_func_getloadavg_done = no; then
- for ac_header in mach/mach.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default"
-if test "x$ac_cv_header_mach_mach_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_MACH_MACH_H 1
+int
+main ()
+{
+int (*p) (int, fd_set *, fd_set *, fd_set *restrict,
+ struct timespec const *restrict,
+ sigset_t const *restrict) = pselect;
+ return !p;
+ ;
+ return 0;
+}
_ACEOF
-
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_sig_pselect=yes
+else
+ gl_cv_sig_pselect=no
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sig_pselect" >&5
+$as_echo "$gl_cv_sig_pselect" >&6; }
-done
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pselect detects invalid fds" >&5
+$as_echo_n "checking whether pselect detects invalid fds... " >&6; }
+if test "${gl_cv_func_pselect_detects_ebadf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
-fi
+ if test "$cross_compiling" = yes; then :
-for ac_header in nlist.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "$ac_includes_default"
-if test "x$ac_cv_header_nlist_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_NLIST_H 1
-_ACEOF
- ac_fn_c_check_member "$LINENO" "struct nlist" "n_un.n_name" "ac_cv_member_struct_nlist_n_un_n_name" "#include <nlist.h>
-"
-if test "x$ac_cv_member_struct_nlist_n_un_n_name" = x""yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_pselect_detects_ebadf="guessing no" ;;
+ esac
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_NLIST_N_UN_N_NAME 1
-_ACEOF
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <unistd.h>
+#include <errno.h>
+int
+main ()
+{
-fi
+ fd_set set;
+ dup2(0, 16);
+ FD_ZERO(&set);
+ FD_SET(16, &set);
+ close(16);
+ struct timespec timeout;
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 5000;
+ return pselect (17, &set, NULL, NULL, &timeout, NULL) != -1 || errno != EBADF;
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <nlist.h>
-int
-main ()
-{
-struct nlist x;
- #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
- x.n_un.n_name = "";
- #else
- x.n_name = "";
- #endif
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_pselect_detects_ebadf=yes
+else
+ gl_cv_func_pselect_detects_ebadf=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
-$as_echo "#define N_NAME_POINTER 1" >>confdefs.h
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pselect_detects_ebadf" >&5
+$as_echo "$gl_cv_func_pselect_detects_ebadf" >&6; }
+ case $gl_cv_func_pselect_detects_ebadf in
+ *yes) ;;
+ *) REPLACE_PSELECT=1 ;;
+ esac
+ fi
-fi
+ if test $ac_cv_func_pselect = no || test $gl_cv_sig_pselect = no; then
+ REPLACE_PSELECT=1
+ fi
-done
+ if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then
- fi
- GNULIB_GETLOADAVG=1
+ gl_LIBOBJS="$gl_LIBOBJS pselect.$ac_objext"
+ fi
+ GNULIB_PSELECT=1
- if test $REPLACE_GETOPT = 1; then
+ LIB_PTHREAD_SIGMASK=
- gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
+ if test "$gl_threads_api" = posix; then
+ if test $ac_cv_func_pthread_sigmask = yes; then
+ :
+ else
+ if test -n "$LIBMULTITHREAD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_sigmask in $LIBMULTITHREAD" >&5
+$as_echo_n "checking for pthread_sigmask in $LIBMULTITHREAD... " >&6; }
+if test "${gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+ #include <signal.h>
+int
+main ()
+{
+return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes
+else
+ gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gl_save_LIBS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&5
+$as_echo "$gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&6; }
+ if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
+ LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
+ else
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ else
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ fi
+ else
+ if test $ac_cv_func_pthread_sigmask = yes; then
+ REPLACE_PTHREAD_SIGMASK=1
+ else
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ fi
- gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+ if test $HAVE_PTHREAD_SIGMASK = 1; then
+ if test -z "$LIB_PTHREAD_SIGMASK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask works without -lpthread" >&5
+$as_echo_n "checking whether pthread_sigmask works without -lpthread... " >&6; }
+if test "${gl_cv_func_pthread_sigmask_in_libc_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
- GNULIB_GL_UNISTD_H_GETOPT=1
- fi
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ freebsd* | hpux* | solaris | solaris2.[2-9]*)
+ gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
+int main ()
+{
+ sigset_t set;
+ sigemptyset (&set);
+ return pthread_sigmask (1729, &set, NULL) != 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_pthread_sigmask_in_libc_works=no
+else
+ gl_cv_func_pthread_sigmask_in_libc_works=yes
+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_pthread_sigmask_in_libc_works" >&5
+$as_echo "$gl_cv_func_pthread_sigmask_in_libc_works" >&6; }
+ case "$gl_cv_func_pthread_sigmask_in_libc_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+$as_echo "#define PTHREAD_SIGMASK_INEFFECTIVE 1" >>confdefs.h
- REPLACE_GETOPT=0
- if test -n "$gl_replace_getopt"; then
- REPLACE_GETOPT=1
+ ;;
+ esac
fi
- if test $REPLACE_GETOPT = 1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask returns error numbers" >&5
+$as_echo_n "checking whether pthread_sigmask returns error numbers... " >&6; }
+if test "${gl_cv_func_pthread_sigmask_return_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
- GETOPT_H=getopt.h
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ cygwin*)
+ gl_cv_func_pthread_sigmask_return_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_return_works="guessing yes";;
+ esac
-$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
+int main ()
+{
+ sigset_t set;
+ sigemptyset (&set);
+ if (pthread_sigmask (1729, &set, NULL) == -1)
+ return 1;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_pthread_sigmask_return_works=yes
+else
+ gl_cv_func_pthread_sigmask_return_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
+ LIBS="$gl_save_LIBS"
- fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_return_works" >&5
+$as_echo "$gl_cv_func_pthread_sigmask_return_works" >&6; }
+ case "$gl_cv_func_pthread_sigmask_return_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
- if test $REPLACE_GETOPT = 1; then
+$as_echo "#define PTHREAD_SIGMASK_FAILS_WITH_ERRNO 1" >>confdefs.h
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask unblocks signals correctly" >&5
+$as_echo_n "checking whether pthread_sigmask unblocks signals correctly... " >&6; }
+if test "${gl_cv_func_pthread_sigmask_unblock_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ irix*)
+ gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
+ esac
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+static volatile int sigint_occurred;
+static void
+sigint_handler (int sig)
+{
+ sigint_occurred++;
+}
+int main ()
+{
+ sigset_t set;
+ int pid = getpid ();
+ char command[80];
+ signal (SIGINT, sigint_handler);
+ sigemptyset (&set);
+ sigaddset (&set, SIGINT);
+ if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
+ return 1;
+ sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+ if (!(system (command) == 0))
+ return 2;
+ sleep (2);
+ if (!(sigint_occurred == 0))
+ return 3;
+ if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
+ return 4;
+ if (!(sigint_occurred == 1)) /* This fails on IRIX. */
+ return 5;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ :
+else
+ gl_cv_func_pthread_sigmask_unblock_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
+ LIBS="$gl_save_LIBS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_unblock_works" >&5
+$as_echo "$gl_cv_func_pthread_sigmask_unblock_works" >&6; }
+ case "$gl_cv_func_pthread_sigmask_unblock_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+$as_echo "#define PTHREAD_SIGMASK_UNBLOCK_BUG 1" >>confdefs.h
- gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
+ ;;
+ esac
+ fi
+ if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
- gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+ gl_LIBOBJS="$gl_LIBOBJS pthread_sigmask.$ac_objext"
+ if test $HAVE_PTHREAD_SIGMASK = 1; then
+$as_echo "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h
- GNULIB_GL_UNISTD_H_GETOPT=1
fi
+ fi
+ GNULIB_PTHREAD_SIGMASK=1
- gl_gettimeofday_timezone=void
- if test $ac_cv_func_gettimeofday != yes; then
- HAVE_GETTIMEOFDAY=0
- else
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
-$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
-if test "${gl_cv_func_gettimeofday_clobber+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 :
- # When cross-compiling:
- case "$host_os" in
- # Guess all is fine on glibc systems.
- *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
- esac
+ 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 <string.h>
- #include <sys/time.h>
- #include <time.h>
- #include <stdlib.h>
-
+$ac_includes_default
int
main ()
{
- time_t t = 0;
- struct tm *lt;
- struct tm saved_lt;
- struct timeval tv;
- lt = localtime (&t);
- saved_lt = *lt;
- gettimeofday (&tv, NULL);
- return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
+ /* 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_run "$LINENO"; then :
- gl_cv_func_gettimeofday_clobber=no
+ gl_cv_func_svid_putenv=yes
else
- gl_cv_func_gettimeofday_clobber=yes
+ gl_cv_func_svid_putenv=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_gettimeofday_clobber" >&5
-$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
+{ $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
- case "$gl_cv_func_gettimeofday_clobber" in
- *yes)
- REPLACE_GETTIMEOFDAY=1
+ if test $REPLACE_PUTENV = 1; then
-$as_echo "#define gmtime rpl_gmtime" >>confdefs.h
-$as_echo "#define localtime rpl_localtime" >>confdefs.h
-$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
- ;;
- esac
+ gl_LIBOBJS="$gl_LIBOBJS putenv.$ac_objext"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
-$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
-if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then :
+ 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 <sys/time.h>
- struct timeval c;
- int gettimeofday (struct timeval *restrict, void *restrict);
-
+#include <unistd.h>
+ /* Cause compilation failure if original declaration has wrong type. */
+ ssize_t readlink (const char *, char *, size_t);
int
main ()
{
-/* glibc uses struct timezone * rather than the POSIX void *
- if _GNU_SOURCE is defined. However, since the only portable
- use of gettimeofday uses NULL as the second parameter, and
- since the glibc definition is actually more typesafe, it is
- not worth wrapping this to get a compliant signature. */
- int (*f) (struct timeval *restrict, void *restrict)
- = gettimeofday;
- int x = f (&c, 0);
- return !(x | c.tv_sec | c.tv_usec);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_func_gettimeofday_posix_signature=yes
+ 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 <sys/time.h>
-int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+#include <unistd.h>
int
main ()
{
-
+char buf[20];
+ return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_func_gettimeofday_posix_signature=almost
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_readlink_works=yes
else
- gl_cv_func_gettimeofday_posix_signature=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ gl_cv_func_readlink_works=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_func_gettimeofday_posix_signature" >&5
-$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
- if test $gl_cv_func_gettimeofday_posix_signature = almost; then
- gl_gettimeofday_timezone='struct timezone'
- elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
- REPLACE_GETTIMEOFDAY=1
- fi
- if test $REPLACE_STRUCT_TIMEVAL = 1; then
- REPLACE_GETTIMEOFDAY=1
- fi
-
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
-_ACEOF
-
-
- if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
-
+ rm -f conftest.link conftest.lnk2
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
+$as_echo "$gl_cv_func_readlink_works" >&6; }
+ case "$gl_cv_func_readlink_works" in
+ *yes)
+ if test "$gl_cv_decl_readlink_works" != yes; then
+ REPLACE_READLINK=1
+ fi
+ ;;
+ *)
+$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
+ REPLACE_READLINK=1
+ ;;
+ esac
+ fi
+ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
- gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
- for ac_header in sys/timeb.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_timeb_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_TIMEB_H 1
-_ACEOF
-fi
-done
- for ac_func in _ftime
-do :
- ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime"
-if test "x$ac_cv_func__ftime" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE__FTIME 1
-_ACEOF
+ gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
-fi
-done
+ :
fi
- GNULIB_GETTIMEOFDAY=1
-
-
+ GNULIB_READLINK=1
- if test $ac_cv_func_lstat = yes; then
- case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
- *no)
- REPLACE_LSTAT=1
- ;;
- esac
- else
- HAVE_LSTAT=0
+ if test $ac_cv_func_readlinkat = no; then
+ HAVE_READLINKAT=0
fi
- if test $REPLACE_LSTAT = 1; then
-
-
-
+ if test $HAVE_READLINKAT = 0; then
- gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
- :
+ gl_LIBOBJS="$gl_LIBOBJS readlinkat.$ac_objext"
fi
- GNULIB_LSTAT=1
-
-
-
-
-
+ GNULIB_READLINKAT=1
- if test $APPLE_UNIVERSAL_BUILD = 1; then
- # A universal build on Apple Mac OS X platforms.
- # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
- # But we need a configuration result that is valid in both modes.
- gl_cv_func_working_mktime=no
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
-$as_echo_n "checking for working mktime... " >&6; }
-if test "${gl_cv_func_working_mktime+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- gl_cv_func_working_mktime=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Test program from Paul Eggert and Tony Leneis. */
-#include <limits.h>
-#include <stdlib.h>
-#include <time.h>
+ 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
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+fi
+done
-#ifndef HAVE_ALARM
-# define alarm(X) /* empty */
-#endif
-/* Work around redefinition to rpl_putenv by other config tests. */
-#undef putenv
+ if test $ac_cv_func_sig2str = no; then
-static time_t time_t_max;
-static time_t time_t_min;
-/* Values we'll use to set the TZ environment variable. */
-static char *tz_strings[] = {
- (char *) 0, "TZ=GMT0", "TZ=JST-9",
- "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
-};
-#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
-/* Return 0 if mktime fails to convert a date in the spring-forward gap.
- Based on a problem report from Andreas Jaeger. */
-static int
-spring_forward_gap ()
-{
- /* glibc (up to about 1998-10-07) failed this test. */
- struct tm tm;
- /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
- instead of "TZ=America/Vancouver" in order to detect the bug even
- on systems that don't support the Olson extension, or don't have the
- full zoneinfo tables installed. */
- putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
- tm.tm_year = 98;
- tm.tm_mon = 3;
- tm.tm_mday = 5;
- tm.tm_hour = 2;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- return mktime (&tm) != (time_t) -1;
-}
-static int
-mktime_test1 (time_t now)
-{
- struct tm *lt;
- return ! (lt = localtime (&now)) || mktime (lt) == now;
-}
-static int
-mktime_test (time_t now)
-{
- return (mktime_test1 (now)
- && mktime_test1 ((time_t) (time_t_max - now))
- && mktime_test1 ((time_t) (time_t_min + now)));
-}
-static int
-irix_6_4_bug ()
-{
- /* Based on code from Ariel Faigon. */
- struct tm tm;
- tm.tm_year = 96;
- tm.tm_mon = 3;
- tm.tm_mday = 0;
- tm.tm_hour = 0;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- mktime (&tm);
- return tm.tm_mon == 2 && tm.tm_mday == 31;
-}
+ gl_LIBOBJS="$gl_LIBOBJS sig2str.$ac_objext"
-static int
-bigtime_test (int j)
-{
- struct tm tm;
- time_t now;
- tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
- now = mktime (&tm);
- if (now != (time_t) -1)
- {
- struct tm *lt = localtime (&now);
- if (! (lt
- && lt->tm_year == tm.tm_year
- && lt->tm_mon == tm.tm_mon
- && lt->tm_mday == tm.tm_mday
- && lt->tm_hour == tm.tm_hour
- && lt->tm_min == tm.tm_min
- && lt->tm_sec == tm.tm_sec
- && lt->tm_yday == tm.tm_yday
- && lt->tm_wday == tm.tm_wday
- && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
- == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
- return 0;
- }
- return 1;
-}
-static int
-year_2050_test ()
-{
- /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
- ignoring leap seconds. */
- unsigned long int answer = 2527315200UL;
+ :
- struct tm tm;
- time_t t;
- tm.tm_year = 2050 - 1900;
- tm.tm_mon = 2 - 1;
- tm.tm_mday = 1;
- tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
- tm.tm_isdst = -1;
+ fi
- /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
- instead of "TZ=America/Vancouver" in order to detect the bug even
- on systems that don't support the Olson extension, or don't have the
- full zoneinfo tables installed. */
- putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
- t = mktime (&tm);
- /* Check that the result is either a failure, or close enough
- to the correct answer that we can assume the discrepancy is
- due to leap seconds. */
- return (t == (time_t) -1
- || (0 < t && answer - 120 <= t && t <= answer + 120));
-}
-int
-main ()
-{
- int result = 0;
- time_t t, delta;
- int i, j;
- int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
- int time_t_signed = ! ((time_t) 0 < (time_t) -1);
- /* This test makes some buggy mktime implementations loop.
- Give up after 60 seconds; a mktime slower than that
- isn't worth using anyway. */
- alarm (60);
- time_t_max = (! time_t_signed
- ? (time_t) -1
- : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
- * 2 + 1));
- time_t_min = (! time_t_signed
- ? (time_t) 0
- : time_t_signed_magnitude
- ? ~ (time_t) 0
- : ~ time_t_max);
- delta = time_t_max / 997; /* a suitable prime number */
- for (i = 0; i < N_STRINGS; i++)
- {
- if (tz_strings[i])
- putenv (tz_strings[i]);
- for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
- if (! mktime_test (t))
- result |= 1;
- if ((result & 2) == 0
- && ! (mktime_test ((time_t) 1)
- && mktime_test ((time_t) (60 * 60))
- && mktime_test ((time_t) (60 * 60 * 24))))
- result |= 2;
- for (j = 1; (result & 4) == 0; j <<= 1)
- {
- if (! bigtime_test (j))
- result |= 4;
- if (INT_MAX / 2 < j)
- break;
- }
- if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
- result |= 8;
- }
- if (! irix_6_4_bug ())
- result |= 16;
- if (! spring_forward_gap ())
- result |= 32;
- if (! year_2050_test ())
- result |= 64;
- return result;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_working_mktime=yes
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_signal_h='<'signal.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
+$as_echo_n "checking absolute name of <signal.h>... " >&6; }
+if test "${gl_cv_next_signal_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- gl_cv_func_working_mktime=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <signal.h>
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5
-$as_echo "$gl_cv_func_working_mktime" >&6; }
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
- if test $gl_cv_func_working_mktime = no; then
- REPLACE_MKTIME=1
- else
- REPLACE_MKTIME=0
- fi
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- if test $REPLACE_MKTIME = 1; then
+ gl_header_literal_regex=`echo 'signal.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_signal_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_signal_h" >&5
+$as_echo "$gl_cv_next_signal_h" >&6; }
+ fi
+ NEXT_SIGNAL_H=$gl_cv_next_signal_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='<'signal.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_signal_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
- gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
+# AIX declares sig_atomic_t to already include volatile, and C89 compilers
+# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
+ ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
+#include <signal.h>
- :
- fi
+"
+if test "x$ac_cv_type_volatile_sig_atomic_t" = x""yes; then :
+else
+ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
+fi
- GNULIB_MKTIME=1
+ ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
+#include <signal.h>
+"
+if test "x$ac_cv_type_sighandler_t" = x""yes; then :
+else
+ HAVE_SIGHANDLER_T=0
+fi
+ ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
+/* <sys/types.h> is not needed according to POSIX, but the
+ <sys/socket.h> in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
+"
+if test "x$ac_cv_type_socklen_t" = x""yes; then :
- if test $ac_cv_func_pselect = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether signature of pselect conforms to POSIX" >&5
-$as_echo_n "checking whether signature of pselect conforms to POSIX... " >&6; }
-if test "${gl_cv_sig_pselect+set}" = set; then :
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
+$as_echo_n "checking for socklen_t equivalent... " >&6; }
+ if test "${gl_cv_socklen_t_equiv+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ # Systems have either "struct sockaddr *" or
+ # "void *" as the second argument to getpeername
+ gl_cv_socklen_t_equiv=
+ for arg2 in "struct sockaddr" void; do
+ for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/select.h>
+#include <sys/types.h>
+ #include <sys/socket.h>
+ int getpeername (int, $arg2 *, $t *);
int
main ()
{
-int (*p) (int, fd_set *, fd_set *, fd_set *restrict,
- struct timespec const *restrict,
- sigset_t const *restrict) = pselect;
- return !p;
+$t len;
+ getpeername (0, 0, &len);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- gl_cv_sig_pselect=yes
-else
- gl_cv_sig_pselect=no
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_socklen_t_equiv="$t"
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sig_pselect" >&5
-$as_echo "$gl_cv_sig_pselect" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pselect detects invalid fds" >&5
-$as_echo_n "checking whether pselect detects invalid fds... " >&6; }
-if test "${gl_cv_func_pselect_detects_ebadf+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
+ if test "$gl_cv_socklen_t_equiv" = ""; then
+ as_fn_error "Cannot find a type to use in place of socklen_t" "$LINENO" 5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
+$as_echo "$gl_cv_socklen_t_equiv" >&6; }
- if test "$cross_compiling" = yes; then :
+cat >>confdefs.h <<_ACEOF
+#define socklen_t $gl_cv_socklen_t_equiv
+_ACEOF
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_pselect_detects_ebadf="guessing no" ;;
- esac
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
+$as_echo_n "checking for ssize_t... " >&6; }
+if test "${gt_cv_ssize_t+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/time.h>
-#if HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#endif
-#include <unistd.h>
-#include <errno.h>
-
int
main ()
{
-
- fd_set set;
- dup2(0, 16);
- FD_ZERO(&set);
- FD_SET(16, &set);
- close(16);
- struct timespec timeout;
- timeout.tv_sec = 0;
- timeout.tv_nsec = 5000;
- return pselect (17, &set, NULL, NULL, &timeout, NULL) != -1 || errno != EBADF;
-
+int x = sizeof (ssize_t *) + sizeof (ssize_t);
+ return !x;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_pselect_detects_ebadf=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_ssize_t=yes
else
- gl_cv_func_pselect_detects_ebadf=no
+ gt_cv_ssize_t=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
+$as_echo "$gt_cv_ssize_t" >&6; }
+ if test $gt_cv_ssize_t = no; then
+$as_echo "#define ssize_t int" >>confdefs.h
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pselect_detects_ebadf" >&5
-$as_echo "$gl_cv_func_pselect_detects_ebadf" >&6; }
- case $gl_cv_func_pselect_detects_ebadf in
- *yes) ;;
- *) REPLACE_PSELECT=1 ;;
- esac
- fi
-
- if test $ac_cv_func_pselect = no || test $gl_cv_sig_pselect = no; then
- REPLACE_PSELECT=1
fi
- if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then
-
-
-
-
-
-
-
- gl_LIBOBJS="$gl_LIBOBJS pselect.$ac_objext"
- fi
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = x""yes; then :
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
+_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
+$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
+if test "${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- GNULIB_PSELECT=1
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #include <time.h>
+ struct timespec ts;
+ struct stat st;
+int
+main ()
+{
+ st.st_atim = ts;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
+else
+ ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
+$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
+ if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
+ fi
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = x""yes; then :
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
+_ACEOF
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimensec" = x""yes; then :
- LIB_PTHREAD_SIGMASK=
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
+_ACEOF
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = x""yes; then :
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
+_ACEOF
- if test "$gl_threads_api" = posix; then
- if test $ac_cv_func_pthread_sigmask = yes; then
- :
- else
- if test -n "$LIBMULTITHREAD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_sigmask in $LIBMULTITHREAD" >&5
-$as_echo_n "checking for pthread_sigmask in $LIBMULTITHREAD... " >&6; }
-if test "${gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBMULTITHREAD"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <pthread.h>
- #include <signal.h>
-int
-main ()
-{
-return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);
- ;
- return 0;
-}
+fi
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes
-else
- gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="$gl_save_LIBS"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&5
-$as_echo "$gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&6; }
- if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
- LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
- else
- HAVE_PTHREAD_SIGMASK=0
- fi
- else
- HAVE_PTHREAD_SIGMASK=0
- fi
- fi
- else
- if test $ac_cv_func_pthread_sigmask = yes; then
- REPLACE_PTHREAD_SIGMASK=1
- else
- HAVE_PTHREAD_SIGMASK=0
- fi
- fi
+fi
- if test $HAVE_PTHREAD_SIGMASK = 1; then
- if test -z "$LIB_PTHREAD_SIGMASK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask works without -lpthread" >&5
-$as_echo_n "checking whether pthread_sigmask works without -lpthread... " >&6; }
-if test "${gl_cv_func_pthread_sigmask_in_libc_works+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = x""yes; then :
- if test "$cross_compiling" = yes; then :
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
+_ACEOF
- case "$host_os" in
- freebsd* | hpux* | solaris | solaris2.[2-9]*)
- gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
- *)
- gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
- esac
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimensec" = x""yes; then :
-#include <pthread.h>
-#include <signal.h>
-#include <stddef.h>
-int main ()
-{
- sigset_t set;
- sigemptyset (&set);
- return pthread_sigmask (1729, &set, NULL) != 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_pthread_sigmask_in_libc_works=no
+
+
else
- gl_cv_func_pthread_sigmask_in_libc_works=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
+_ACEOF
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_in_libc_works" >&5
-$as_echo "$gl_cv_func_pthread_sigmask_in_libc_works" >&6; }
- case "$gl_cv_func_pthread_sigmask_in_libc_works" in
- *no)
- REPLACE_PTHREAD_SIGMASK=1
-$as_echo "#define PTHREAD_SIGMASK_INEFFECTIVE 1" >>confdefs.h
+fi
- ;;
- esac
- fi
+fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask returns error numbers" >&5
-$as_echo_n "checking whether pthread_sigmask returns error numbers... " >&6; }
-if test "${gl_cv_func_pthread_sigmask_return_works+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
- if test "$cross_compiling" = yes; then :
- case "$host_os" in
- cygwin*)
- gl_cv_func_pthread_sigmask_return_works="guessing no";;
- *)
- gl_cv_func_pthread_sigmask_return_works="guessing yes";;
- esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
+$as_echo_n "checking for working stdalign.h... " >&6; }
+if test "${gl_cv_header_working_stdalign_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdalign.h>
+ #include <stddef.h>
-#include <pthread.h>
-#include <signal.h>
-#include <stddef.h>
-int main ()
+ /* Test that alignof yields a result consistent with offsetof.
+ This catches GCC bug 52023
+ <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+ #ifdef __cplusplus
+ template <class t> struct alignof_helper { char a; t b; };
+ # define ao(type) offsetof (alignof_helper<type>, b)
+ #else
+ # define ao(type) offsetof (struct { char a; type b; }, b)
+ #endif
+ char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
+ char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
+ char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
+
+ /* Test _Alignas only on platforms where gnulib can help. */
+ #if \
+ (__GNUC__ || __IBMC__ || __IBMCPP__ \
+ || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
+ int alignas (8) alignas_int = 1;
+ char test_alignas[_Alignof (alignas_int) == 8 ? 1 : -1];
+ #endif
+
+int
+main ()
{
- sigset_t set;
- sigemptyset (&set);
- if (pthread_sigmask (1729, &set, NULL) == -1)
- return 1;
+
+ ;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_pthread_sigmask_return_works=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_working_stdalign_h=yes
else
- gl_cv_func_pthread_sigmask_return_works=no
+ gl_cv_header_working_stdalign_h=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
+$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
+
+ if test $gl_cv_header_working_stdalign_h = yes; then
+ STDALIGN_H=''
+ else
+ STDALIGN_H='stdalign.h'
+ fi
- LIBS="$gl_save_LIBS"
+ if test -n "$STDALIGN_H"; then
+ GL_GENERATE_STDALIGN_H_TRUE=
+ GL_GENERATE_STDALIGN_H_FALSE='#'
+else
+ GL_GENERATE_STDALIGN_H_TRUE='#'
+ GL_GENERATE_STDALIGN_H_FALSE=
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_return_works" >&5
-$as_echo "$gl_cv_func_pthread_sigmask_return_works" >&6; }
- case "$gl_cv_func_pthread_sigmask_return_works" in
- *no)
- REPLACE_PTHREAD_SIGMASK=1
-$as_echo "#define PTHREAD_SIGMASK_FAILS_WITH_ERRNO 1" >>confdefs.h
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask unblocks signals correctly" >&5
-$as_echo_n "checking whether pthread_sigmask unblocks signals correctly... " >&6; }
-if test "${gl_cv_func_pthread_sigmask_unblock_works+set}" = set; then :
+ STDARG_H=''
+ NEXT_STDARG_H='<stdarg.h>'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5
+$as_echo_n "checking for va_copy... " >&6; }
+ if test "${gl_cv_func_va_copy+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- case "$host_os" in
- irix*)
- gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
- *)
- gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
- esac
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBMULTITHREAD"
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-#include <pthread.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-static volatile int sigint_occurred;
-static void
-sigint_handler (int sig)
-{
- sigint_occurred++;
-}
-int main ()
+#include <stdarg.h>
+int
+main ()
{
- sigset_t set;
- int pid = getpid ();
- char command[80];
- signal (SIGINT, sigint_handler);
- sigemptyset (&set);
- sigaddset (&set, SIGINT);
- if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
- return 1;
- sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
- if (!(system (command) == 0))
- return 2;
- sleep (2);
- if (!(sigint_occurred == 0))
- return 3;
- if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
- return 4;
- if (!(sigint_occurred == 1)) /* This fails on IRIX. */
- return 5;
+
+#ifndef va_copy
+void (*func) (va_list, va_list) = va_copy;
+#endif
+
+ ;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- :
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_va_copy=yes
else
- gl_cv_func_pthread_sigmask_unblock_works=no
+ gl_cv_func_va_copy=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- LIBS="$gl_save_LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5
+$as_echo "$gl_cv_func_va_copy" >&6; }
+ if test $gl_cv_func_va_copy = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined _AIX && !defined __GNUC__
+ AIX vaccine
+ #endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "vaccine" >/dev/null 2>&1; then :
+ gl_aixcc=yes
+else
+ gl_aixcc=no
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_unblock_works" >&5
-$as_echo "$gl_cv_func_pthread_sigmask_unblock_works" >&6; }
- case "$gl_cv_func_pthread_sigmask_unblock_works" in
- *no)
- REPLACE_PTHREAD_SIGMASK=1
-
-$as_echo "#define PTHREAD_SIGMASK_UNBLOCK_BUG 1" >>confdefs.h
-
- ;;
- esac
- fi
-
- if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
-
-
-
-
-
+rm -f conftest*
+ if test $gl_aixcc = yes; then
+ STDARG_H=stdarg.h
- gl_LIBOBJS="$gl_LIBOBJS pthread_sigmask.$ac_objext"
- if test $HAVE_PTHREAD_SIGMASK = 1; then
-$as_echo "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h
- fi
- fi
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdarg_h='<'stdarg.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5
+$as_echo_n "checking absolute name of <stdarg.h>... " >&6; }
+if test "${gl_cv_next_stdarg_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.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'
- GNULIB_PTHREAD_SIGMASK=1
+ gl_header_literal_regex=`echo 'stdarg.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_stdarg_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_stdarg_h" >&5
+$as_echo "$gl_cv_next_stdarg_h" >&6; }
+ fi
+ NEXT_STDARG_H=$gl_cv_next_stdarg_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='<'stdarg.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdarg_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive
+ if test "$gl_cv_next_stdarg_h" = '""'; then
+ gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
+ NEXT_STDARG_H="$gl_cv_next_stdarg_h"
+ fi
+ else
- 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 :
+ saved_as_echo_n="$as_echo_n"
+ as_echo_n=':'
+ if test "${gl_cv_func___va_copy+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+ 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);
+#include <stdarg.h>
int
main ()
{
+#ifndef __va_copy
+error, bail out
+#endif
+
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_decl_readlink_works=yes
+ gl_cv_func___va_copy=yes
else
- gl_cv_decl_readlink_works=no
+ gl_cv_func___va_copy=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
+
+ as_echo_n="$saved_as_echo_n"
+
+ if test $gl_cv_func___va_copy = yes; then
+
+$as_echo "#define va_copy __va_copy" >>confdefs.h
+
+ else
+
+
+$as_echo "#define va_copy gl_va_copy" >>confdefs.h
+
+ fi
+ fi
+ fi
+
+ if test -n "$STDARG_H"; then
+ GL_GENERATE_STDARG_H_TRUE=
+ GL_GENERATE_STDARG_H_FALSE='#'
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
+ GL_GENERATE_STDARG_H_TRUE='#'
+ GL_GENERATE_STDARG_H_FALSE=
+fi
+
+
+
+
+
+ # Define two additional variables used in the Makefile substitution.
+
+ if test "$ac_cv_header_stdbool_h" = yes; then
+ STDBOOL_H=''
+ else
+ STDBOOL_H='stdbool.h'
+ fi
+
+ if test -n "$STDBOOL_H"; then
+ GL_GENERATE_STDBOOL_H_TRUE=
+ GL_GENERATE_STDBOOL_H_FALSE='#'
+else
+ GL_GENERATE_STDBOOL_H_TRUE='#'
+ GL_GENERATE_STDBOOL_H_FALSE=
+fi
+
+
+ if test "$ac_cv_type__Bool" = yes; then
+ HAVE__BOOL=1
+ else
+ HAVE__BOOL=0
+ fi
+
+
+
+
+
+ STDDEF_H=
+ if test $gt_cv_c_wchar_t = no; then
+ HAVE_WCHAR_T=0
+ STDDEF_H=stddef.h
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
+$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
+if test "${gl_cv_decl_null_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <unistd.h>
+#include <stddef.h>
+ int test[2 * (sizeof NULL == sizeof (void *)) -1];
int
main ()
{
-char buf[20];
- return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_readlink_works=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_decl_null_works=yes
else
- gl_cv_func_readlink_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+ gl_cv_decl_null_works=no
fi
-
- rm -f conftest.link conftest.lnk2
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
-$as_echo "$gl_cv_func_readlink_works" >&6; }
- case "$gl_cv_func_readlink_works" in
- *yes)
- if test "$gl_cv_decl_readlink_works" != yes; then
- REPLACE_READLINK=1
- fi
- ;;
- *)
-
-$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
-
- REPLACE_READLINK=1
- ;;
- esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
+$as_echo "$gl_cv_decl_null_works" >&6; }
+ if test $gl_cv_decl_null_works = no; then
+ REPLACE_NULL=1
+ STDDEF_H=stddef.h
fi
- if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
+ if test -n "$STDDEF_H"; then
+ GL_GENERATE_STDDEF_H_TRUE=
+ GL_GENERATE_STDDEF_H_FALSE='#'
+else
+ GL_GENERATE_STDDEF_H_TRUE='#'
+ GL_GENERATE_STDDEF_H_FALSE=
+fi
+ if test -n "$STDDEF_H"; then
- gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stddef_h='<'stddef.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
+$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
+if test "${gl_cv_next_stddef_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
- :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
- fi
+_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 'stddef.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_stddef_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_stddef_h" >&5
+$as_echo "$gl_cv_next_stddef_h" >&6; }
+ fi
+ NEXT_STDDEF_H=$gl_cv_next_stddef_h
- GNULIB_READLINK=1
+ 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='<'stddef.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stddef_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
+ fi
if test $gl_cv_have_include_next = yes; then
- gl_cv_next_signal_h='<'signal.h'>'
+ gl_cv_next_stdio_h='<'stdio.h'>'
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
-$as_echo_n "checking absolute name of <signal.h>... " >&6; }
-if test "${gl_cv_next_signal_h+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
+$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
+if test "${gl_cv_next_stdio_h+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <signal.h>
+#include <stdio.h>
_ACEOF
case "$host_os" in
esac
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- gl_header_literal_regex=`echo 'signal.h' \
+ gl_header_literal_regex=`echo 'stdio.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/
p
q
}'
- gl_cv_next_signal_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ gl_cv_next_stdio_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_signal_h" >&5
-$as_echo "$gl_cv_next_signal_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
+$as_echo "$gl_cv_next_stdio_h" >&6; }
fi
- NEXT_SIGNAL_H=$gl_cv_next_signal_h
+ NEXT_STDIO_H=$gl_cv_next_stdio_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='<'signal.h'>'
+ gl_next_as_first_directive='<'stdio.h'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_signal_h
+ gl_next_as_first_directive=$gl_cv_next_stdio_h
fi
- NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
-
-
-
-
-
-# AIX declares sig_atomic_t to already include volatile, and C89 compilers
-# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
- ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
-#include <signal.h>
-
-"
-if test "x$ac_cv_type_volatile_sig_atomic_t" = x""yes; then :
-
-else
- HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
-fi
-
-
-
-
-
-
-
- ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
-#include <signal.h>
-
-"
-if test "x$ac_cv_type_sighandler_t" = x""yes; then :
-
-else
- HAVE_SIGHANDLER_T=0
-fi
+ NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
- ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
-/* <sys/types.h> is not needed according to POSIX, but the
- <sys/socket.h> in i386-unknown-freebsd4.10 and
- powerpc-apple-darwin5.5 required it. */
-#include <sys/types.h>
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#elif HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-#endif
-"
-if test "x$ac_cv_type_socklen_t" = x""yes; then :
+ GNULIB_FSCANF=1
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
-$as_echo_n "checking for socklen_t equivalent... " >&6; }
- if test "${gl_cv_socklen_t_equiv+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- # Systems have either "struct sockaddr *" or
- # "void *" as the second argument to getpeername
- gl_cv_socklen_t_equiv=
- for arg2 in "struct sockaddr" void; do
- for t in int size_t "unsigned int" "long int" "unsigned long int"; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/socket.h>
- int getpeername (int, $arg2 *, $t *);
-int
-main ()
-{
-$t len;
- getpeername (0, 0, &len);
- ;
- return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FSCANF 1
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_socklen_t_equiv="$t"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$gl_cv_socklen_t_equiv" != "" && break
- done
- test "$gl_cv_socklen_t_equiv" != "" && break
- done
-fi
- if test "$gl_cv_socklen_t_equiv" = ""; then
- as_fn_error "Cannot find a type to use in place of socklen_t" "$LINENO" 5
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
-$as_echo "$gl_cv_socklen_t_equiv" >&6; }
+ GNULIB_SCANF=1
+
cat >>confdefs.h <<_ACEOF
-#define socklen_t $gl_cv_socklen_t_equiv
+#define GNULIB_SCANF 1
_ACEOF
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
-$as_echo_n "checking for ssize_t... " >&6; }
-if test "${gt_cv_ssize_t+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-int
-main ()
-{
-int x = sizeof (ssize_t *) + sizeof (ssize_t);
- return !x;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gt_cv_ssize_t=yes
-else
- gt_cv_ssize_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
-$as_echo "$gt_cv_ssize_t" >&6; }
- if test $gt_cv_ssize_t = no; then
-$as_echo "#define ssize_t int" >>confdefs.h
+ GNULIB_FGETC=1
+ GNULIB_GETC=1
+ GNULIB_GETCHAR=1
+ GNULIB_FGETS=1
+ GNULIB_FREAD=1
- fi
+ GNULIB_FPRINTF=1
+ GNULIB_PRINTF=1
+ GNULIB_VFPRINTF=1
+ GNULIB_VPRINTF=1
+ GNULIB_FPUTC=1
+ GNULIB_PUTC=1
+ GNULIB_PUTCHAR=1
+ GNULIB_FPUTS=1
+ GNULIB_PUTS=1
+ GNULIB_FWRITE=1
- ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
- #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = x""yes; then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
-_ACEOF
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
-$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
-if test "${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+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>
- #if HAVE_SYS_TIME_H
- # include <sys/time.h>
- #endif
- #include <time.h>
- struct timespec ts;
- struct stat st;
-int
-main ()
-{
- st.st_atim = ts;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
-else
- ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
-$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
- if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
-$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
- fi
-else
- ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
- #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = x""yes; then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
-_ACEOF
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdlib_h='<'stdlib.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
+$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
+if test "${gl_cv_next_stdlib_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
- #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_atimensec" = x""yes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
-_ACEOF
-
-else
- ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
- #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = x""yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
_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'
-fi
-
-fi
+ gl_header_literal_regex=`echo 'stdlib.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_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`'"'
-fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
+$as_echo "$gl_cv_next_stdlib_h" >&6; }
+ fi
+ NEXT_STDLIB_H=$gl_cv_next_stdlib_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='<'stdlib.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdlib_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
- ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
- #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = x""yes; then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
-_ACEOF
-else
- ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
- #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_birthtimensec" = x""yes; then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
-_ACEOF
+ # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
-else
- ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h>
- #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = x""yes; then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
-_ACEOF
-fi
-fi
-fi
+$as_echo "#define my_strftime nstrftime" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
-$as_echo_n "checking for working stdalign.h... " >&6; }
-if test "${gl_cv_header_working_stdalign_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdalign.h>
- #include <stddef.h>
- /* Test that alignof yields a result consistent with offsetof.
- This catches GCC bug 52023
- <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
- #ifdef __cplusplus
- template <class t> struct alignof_helper { char a; t b; };
- # define ao(type) offsetof (alignof_helper<type>, b)
- #else
- # define ao(type) offsetof (struct { char a; type b; }, b)
- #endif
- char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
- char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
- char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
- /* Test _Alignas only on platforms where gnulib can help. */
- #if \
- (__GNUC__ || __IBMC__ || __IBMCPP__ \
- || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
- int alignas (8) alignas_int = 1;
- char test_alignas[_Alignof (alignas_int) == 8 ? 1 : -1];
- #endif
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_header_working_stdalign_h=yes
-else
- gl_cv_header_working_stdalign_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
-$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
- if test $gl_cv_header_working_stdalign_h = yes; then
- STDALIGN_H=''
- else
- STDALIGN_H='stdalign.h'
- fi
- if test -n "$STDALIGN_H"; then
- GL_GENERATE_STDALIGN_H_TRUE=
- GL_GENERATE_STDALIGN_H_FALSE='#'
-else
- GL_GENERATE_STDALIGN_H_TRUE='#'
- GL_GENERATE_STDALIGN_H_FALSE=
-fi
+ if test "$ac_cv_have_decl_strtoimax" != yes; then
+ HAVE_DECL_STRTOIMAX=0
+ fi
- STDARG_H=''
- NEXT_STDARG_H='<stdarg.h>'
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5
-$as_echo_n "checking for va_copy... " >&6; }
- if test "${gl_cv_func_va_copy+set}" = set; then :
+ if test $ac_cv_func_strtoimax = yes; then
+ HAVE_STRTOIMAX=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtoimax works" >&5
+$as_echo_n "checking whether strtoimax works... " >&6; }
+if test "${gl_cv_func_strtoimax+set}" = set; then :
$as_echo_n "(cached) " >&6
else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on AIX 5.
+ aix5*) gl_cv_func_strtoimax="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_strtoimax="guessing yes" ;;
+ esac
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdarg.h>
-int
-main ()
-{
-
-#ifndef va_copy
-void (*func) (va_list, va_list) = va_copy;
-#endif
- ;
+#include <errno.h>
+#include <string.h>
+#include <inttypes.h>
+int main ()
+{
+ if (sizeof (intmax_t) > sizeof (int))
+ {
+ const char *s = "4294967295";
+ char *p;
+ intmax_t res;
+ errno = 0;
+ res = strtoimax (s, &p, 10);
+ if (p != s + strlen (s))
+ return 1;
+ if (errno != 0)
+ return 2;
+ if (res != (intmax_t) 65535 * (intmax_t) 65537)
+ return 3;
+ }
+ else
+ {
+ const char *s = "2147483647";
+ char *p;
+ intmax_t res;
+ errno = 0;
+ res = strtoimax (s, &p, 10);
+ if (p != s + strlen (s))
+ return 1;
+ if (errno != 0)
+ return 2;
+ if (res != 2147483647)
+ return 3;
+ }
return 0;
}
+
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_func_va_copy=yes
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_strtoimax=yes
else
- gl_cv_func_va_copy=no
+ gl_cv_func_strtoimax=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_func_va_copy" >&5
-$as_echo "$gl_cv_func_va_copy" >&6; }
- if test $gl_cv_func_va_copy = no; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if defined _AIX && !defined __GNUC__
- AIX vaccine
- #endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "vaccine" >/dev/null 2>&1; then :
- gl_aixcc=yes
-else
- gl_aixcc=no
fi
-rm -f conftest*
-
- if test $gl_aixcc = yes; then
- STDARG_H=stdarg.h
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtoimax" >&5
+$as_echo "$gl_cv_func_strtoimax" >&6; }
+ case "$gl_cv_func_strtoimax" in
+ *no) REPLACE_STRTOIMAX=1 ;;
+ esac
+ else
+ HAVE_STRTOIMAX=0
+ fi
+ if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
- if test $gl_cv_have_include_next = yes; then
- gl_cv_next_stdarg_h='<'stdarg.h'>'
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5
-$as_echo_n "checking absolute name of <stdarg.h>... " >&6; }
-if test "${gl_cv_next_stdarg_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-_ACEOF
- case "$host_os" in
- aix*) gl_absname_cpp="$ac_cpp -C" ;;
- *) gl_absname_cpp="$ac_cpp" ;;
- esac
+ gl_LIBOBJS="$gl_LIBOBJS strtoimax.$ac_objext"
- case "$host_os" in
- mingw*)
- gl_dirsep_regex='[/\\]'
- ;;
- *)
- gl_dirsep_regex='\/'
- ;;
- esac
- gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- gl_header_literal_regex=`echo 'stdarg.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_stdarg_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
- sed -n "$gl_absolute_header_sed"`'"'
+ ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strtoll" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRTOLL $ac_have_decl
+_ACEOF
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5
-$as_echo "$gl_cv_next_stdarg_h" >&6; }
- fi
- NEXT_STDARG_H=$gl_cv_next_stdarg_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='<'stdarg.h'>'
- else
- # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_stdarg_h
- fi
- NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive
+ fi
- if test "$gl_cv_next_stdarg_h" = '""'; then
- gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
- NEXT_STDARG_H="$gl_cv_next_stdarg_h"
- fi
- else
- saved_as_echo_n="$as_echo_n"
- as_echo_n=':'
- if test "${gl_cv_func___va_copy+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-int
-main ()
-{
+ GNULIB_STRTOIMAX=1
-#ifndef __va_copy
-error, bail out
-#endif
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_func___va_copy=yes
-else
- gl_cv_func___va_copy=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
- as_echo_n="$saved_as_echo_n"
- if test $gl_cv_func___va_copy = yes; then
-$as_echo "#define va_copy __va_copy" >>confdefs.h
- else
-$as_echo "#define va_copy gl_va_copy" >>confdefs.h
- fi
- fi
+ if test "$ac_cv_have_decl_strtoumax" != yes; then
+ HAVE_DECL_STRTOUMAX=0
fi
- if test -n "$STDARG_H"; then
- GL_GENERATE_STDARG_H_TRUE=
- GL_GENERATE_STDARG_H_FALSE='#'
-else
- GL_GENERATE_STDARG_H_TRUE='#'
- GL_GENERATE_STDARG_H_FALSE=
-fi
+ if test $ac_cv_func_strtoumax = no; then
- # Define two additional variables used in the Makefile substitution.
- if test "$ac_cv_header_stdbool_h" = yes; then
- STDBOOL_H=''
- else
- STDBOOL_H='stdbool.h'
- fi
- if test -n "$STDBOOL_H"; then
- GL_GENERATE_STDBOOL_H_TRUE=
- GL_GENERATE_STDBOOL_H_FALSE='#'
+ gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext"
+
+
+ ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strtoull" = x""yes; then :
+ ac_have_decl=1
else
- GL_GENERATE_STDBOOL_H_TRUE='#'
- GL_GENERATE_STDBOOL_H_FALSE=
+ ac_have_decl=0
fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRTOULL $ac_have_decl
+_ACEOF
+
+
- if test "$ac_cv_type__Bool" = yes; then
- HAVE__BOOL=1
- else
- HAVE__BOOL=0
fi
- STDDEF_H=
- if test $gt_cv_c_wchar_t = no; then
- HAVE_WCHAR_T=0
- STDDEF_H=stddef.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
-$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
-if test "${gl_cv_decl_null_works+set}" = set; then :
+ GNULIB_STRTOUMAX=1
+
+
+
+
+
+
+
+ if test $ac_cv_func_symlink = no; then
+ HAVE_SYMLINK=0
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5
+$as_echo_n "checking whether symlink handles trailing slash correctly... " >&6; }
+if test "${gl_cv_func_symlink_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_symlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_symlink_works="guessing no" ;;
+ esac
+
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stddef.h>
- int test[2 * (sizeof NULL == sizeof (void *)) -1];
+#include <unistd.h>
int
main ()
{
+int result = 0;
+ if (!symlink ("a", "conftest.link/"))
+ result |= 1;
+ if (symlink ("conftest.f", "conftest.lnk2"))
+ result |= 2;
+ else if (!symlink ("a", "conftest.lnk2/"))
+ result |= 4;
+ return result;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_decl_null_works=yes
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_symlink_works=yes
else
- gl_cv_decl_null_works=no
+ gl_cv_func_symlink_works=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_null_works" >&5
-$as_echo "$gl_cv_decl_null_works" >&6; }
- if test $gl_cv_decl_null_works = no; then
- REPLACE_NULL=1
- STDDEF_H=stddef.h
- fi
- if test -n "$STDDEF_H"; then
- GL_GENERATE_STDDEF_H_TRUE=
- GL_GENERATE_STDDEF_H_FALSE='#'
-else
- GL_GENERATE_STDDEF_H_TRUE='#'
- GL_GENERATE_STDDEF_H_FALSE=
+ rm -f conftest.f conftest.link conftest.lnk2
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5
+$as_echo "$gl_cv_func_symlink_works" >&6; }
+ case "$gl_cv_func_symlink_works" in
+ *yes) ;;
+ *)
+ REPLACE_SYMLINK=1
+ ;;
+ esac
+ fi
- if test -n "$STDDEF_H"; then
+ if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
- if test $gl_cv_have_include_next = yes; then
- gl_cv_next_stddef_h='<'stddef.h'>'
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
-$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
-if test "${gl_cv_next_stddef_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
+ gl_LIBOBJS="$gl_LIBOBJS symlink.$ac_objext"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stddef.h>
+ fi
-_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 'stddef.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_stddef_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_stddef_h" >&5
-$as_echo "$gl_cv_next_stddef_h" >&6; }
- fi
- NEXT_STDDEF_H=$gl_cv_next_stddef_h
+ GNULIB_SYMLINK=1
+
+
+
+
- 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='<'stddef.h'>'
- else
- # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_stddef_h
- fi
- NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5
+$as_echo_n "checking whether <sys/select.h> is self-contained... " >&6; }
+if test "${gl_cv_header_sys_select_h_selfcontained+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main ()
+{
+struct timeval b;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_sys_select_h_selfcontained=yes
+else
+ gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $gl_cv_header_sys_select_h_selfcontained = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main ()
+{
+int memset; int bzero;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/select.h>
+int
+main ()
+{
+
+ #undef memset
+ #define memset nonexistent_memset
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ void *memset (void *, int, unsigned long);
+ #undef bzero
+ #define bzero nonexistent_bzero
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ void bzero (void *, unsigned long);
+ fd_set fds;
+ FD_ZERO (&fds);
- fi
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+else
+ gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5
+$as_echo "$gl_cv_header_sys_select_h_selfcontained" >&6; }
if test $gl_cv_have_include_next = yes; then
- gl_cv_next_stdio_h='<'stdio.h'>'
+ gl_cv_next_sys_select_h='<'sys/select.h'>'
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
-$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
-if test "${gl_cv_next_stdio_h+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5
+$as_echo_n "checking absolute name of <sys/select.h>... " >&6; }
+if test "${gl_cv_next_sys_select_h+set}" = set; then :
$as_echo_n "(cached) " >&6
else
+ if test $ac_cv_header_sys_select_h = yes; then
+
+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
+#include <sys/select.h>
_ACEOF
case "$host_os" in
esac
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- gl_header_literal_regex=`echo 'stdio.h' \
+ gl_header_literal_regex=`echo 'sys/select.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/
p
q
}'
- gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ gl_cv_next_sys_select_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
sed -n "$gl_absolute_header_sed"`'"'
+ else
+ gl_cv_next_sys_select_h='<'sys/select.h'>'
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
-$as_echo "$gl_cv_next_stdio_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5
+$as_echo "$gl_cv_next_sys_select_h" >&6; }
fi
- NEXT_STDIO_H=$gl_cv_next_stdio_h
+ NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_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='<'stdio.h'>'
+ gl_next_as_first_directive='<'sys/select.h'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_stdio_h
+ gl_next_as_first_directive=$gl_cv_next_sys_select_h
fi
- NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
+ NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive
+
+ if test $ac_cv_header_sys_select_h = yes; then
+ HAVE_SYS_SELECT_H=1
+ else
+ HAVE_SYS_SELECT_H=0
+ fi
+
- GNULIB_FSCANF=1
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_FSCANF 1
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
_ACEOF
+fi
- GNULIB_SCANF=1
+done
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_SCANF 1
-_ACEOF
- GNULIB_FGETC=1
- GNULIB_GETC=1
- GNULIB_GETCHAR=1
- GNULIB_FGETS=1
- GNULIB_FREAD=1
- GNULIB_FPRINTF=1
- GNULIB_PRINTF=1
- GNULIB_VFPRINTF=1
- GNULIB_VPRINTF=1
- GNULIB_FPUTC=1
- GNULIB_PUTC=1
- GNULIB_PUTCHAR=1
- GNULIB_FPUTS=1
- GNULIB_PUTS=1
- GNULIB_FWRITE=1
if test $gl_cv_have_include_next = yes; then
- gl_cv_next_stdlib_h='<'stdlib.h'>'
+ gl_cv_next_sys_stat_h='<'sys/stat.h'>'
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
-$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
-if test "${gl_cv_next_stdlib_h+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
+$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
+if test "${gl_cv_next_sys_stat_h+set}" = set; then :
$as_echo_n "(cached) " >&6
else
+ if test $ac_cv_header_sys_stat_h = yes; then
+
+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdlib.h>
+#include <sys/stat.h>
_ACEOF
case "$host_os" in
esac
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- gl_header_literal_regex=`echo 'stdlib.h' \
+ gl_header_literal_regex=`echo 'sys/stat.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_stdlib_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_stdlib_h" >&5
-$as_echo "$gl_cv_next_stdlib_h" >&6; }
- fi
- NEXT_STDLIB_H=$gl_cv_next_stdlib_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='<'stdlib.h'>'
- else
- # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_stdlib_h
- fi
- NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
-
-
-
-
-
-
-
-
-
- # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
-
-
-
-
-
-
-
-$as_echo "#define my_strftime nstrftime" >>confdefs.h
-
-
-
-
-
-
-
-
- if test "$ac_cv_have_decl_strtoimax" != yes; then
- HAVE_DECL_STRTOIMAX=0
- fi
-
- if test $ac_cv_func_strtoimax = yes; then
- HAVE_STRTOIMAX=1
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtoimax works" >&5
-$as_echo_n "checking whether strtoimax works... " >&6; }
-if test "${gl_cv_func_strtoimax+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- case "$host_os" in
- # Guess no on AIX 5.
- aix5*) gl_cv_func_strtoimax="guessing no" ;;
- # Guess yes otherwise.
- *) gl_cv_func_strtoimax="guessing yes" ;;
- esac
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <errno.h>
-#include <string.h>
-#include <inttypes.h>
-int main ()
-{
- if (sizeof (intmax_t) > sizeof (int))
- {
- const char *s = "4294967295";
- char *p;
- intmax_t res;
- errno = 0;
- res = strtoimax (s, &p, 10);
- if (p != s + strlen (s))
- return 1;
- if (errno != 0)
- return 2;
- if (res != (intmax_t) 65535 * (intmax_t) 65537)
- return 3;
- }
- else
- {
- const char *s = "2147483647";
- char *p;
- intmax_t res;
- errno = 0;
- res = strtoimax (s, &p, 10);
- if (p != s + strlen (s))
- return 1;
- if (errno != 0)
- return 2;
- if (res != 2147483647)
- return 3;
- }
- return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_strtoimax=yes
-else
- gl_cv_func_strtoimax=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_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_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`'"'
+ else
+ gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtoimax" >&5
-$as_echo "$gl_cv_func_strtoimax" >&6; }
- case "$gl_cv_func_strtoimax" in
- *no) REPLACE_STRTOIMAX=1 ;;
- esac
- else
- HAVE_STRTOIMAX=0
- fi
-
- if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
+$as_echo "$gl_cv_next_sys_stat_h" >&6; }
+ fi
+ NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_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='<'sys/stat.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_stat_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
- gl_LIBOBJS="$gl_LIBOBJS strtoimax.$ac_objext"
- ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strtoll" = x""yes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRTOLL $ac_have_decl
-_ACEOF
+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h
fi
+ ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_type_nlink_t" = x""yes; then :
+else
+$as_echo "#define nlink_t int" >>confdefs.h
-
- GNULIB_STRTOIMAX=1
-
-
+fi
- if test "$ac_cv_have_decl_strtoumax" != yes; then
- HAVE_DECL_STRTOUMAX=0
- fi
- if test $ac_cv_func_strtoumax = no; then
- gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext"
- ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strtoull" = x""yes; then :
+ ac_fn_c_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include <time.h>
+"
+if test "x$ac_cv_have_decl_localtime_r" = x""yes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRTOULL $ac_have_decl
+#define HAVE_DECL_LOCALTIME_R $ac_have_decl
_ACEOF
-
-
+ if test $ac_cv_have_decl_localtime_r = no; then
+ HAVE_DECL_LOCALTIME_R=0
fi
-
-
-
- GNULIB_STRTOUMAX=1
-
-
-
-
-
-
-
- if test $ac_cv_func_symlink = no; then
- HAVE_SYMLINK=0
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5
-$as_echo_n "checking whether symlink handles trailing slash correctly... " >&6; }
-if test "${gl_cv_func_symlink_works+set}" = set; then :
+ if test $ac_cv_func_localtime_r = yes; then
+ HAVE_LOCALTIME_R=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
+$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
+if test "${gl_cv_time_r_posix+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_symlink_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_symlink_works="guessing no" ;;
- esac
-
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <unistd.h>
-
+#include <time.h>
int
main ()
{
-int result = 0;
- if (!symlink ("a", "conftest.link/"))
- result |= 1;
- if (symlink ("conftest.f", "conftest.lnk2"))
- result |= 2;
- else if (!symlink ("a", "conftest.lnk2/"))
- result |= 4;
- return result;
-
+/* We don't need to append 'restrict's to the argument types,
+ even though the POSIX signature has the 'restrict's,
+ since C99 says they can't affect type compatibility. */
+ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
+ if (ptr) return 0;
+ /* Check the return type is a pointer.
+ On HP-UX 10 it is 'int'. */
+ *localtime_r (0, 0);
;
return 0;
}
+
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_symlink_works=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_time_r_posix=yes
else
- gl_cv_func_symlink_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+ gl_cv_time_r_posix=no
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- rm -f conftest.f conftest.link conftest.lnk2
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5
-$as_echo "$gl_cv_func_symlink_works" >&6; }
- case "$gl_cv_func_symlink_works" in
- *yes) ;;
- *)
- REPLACE_SYMLINK=1
- ;;
- esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
+$as_echo "$gl_cv_time_r_posix" >&6; }
+ if test $gl_cv_time_r_posix = yes; then
+ REPLACE_LOCALTIME_R=0
+ else
+ REPLACE_LOCALTIME_R=1
+ fi
+ else
+ HAVE_LOCALTIME_R=0
fi
- if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
+ if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
- gl_LIBOBJS="$gl_LIBOBJS symlink.$ac_objext"
+ gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
+
+
+ :
fi
- GNULIB_SYMLINK=1
+ GNULIB_TIME_R=1
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5
-$as_echo_n "checking whether <sys/select.h> is self-contained... " >&6; }
-if test "${gl_cv_header_sys_select_h_selfcontained+set}" = set; then :
+
+
+ LIB_TIMER_TIME=
+
+ gl_saved_libs=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing timer_settime" >&5
+$as_echo_n "checking for library containing timer_settime... " >&6; }
+if test "${ac_cv_search_timer_settime+set}" = set; then :
$as_echo_n "(cached) " >&6
else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/select.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 timer_settime ();
int
main ()
{
-struct timeval b;
+return timer_settime ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_header_sys_select_h_selfcontained=yes
+for ac_lib in '' rt posix4; 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_timer_settime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test "${ac_cv_search_timer_settime+set}" = set; then :
+ break
+fi
+done
+if test "${ac_cv_search_timer_settime+set}" = set; then :
+
else
- gl_cv_header_sys_select_h_selfcontained=no
+ ac_cv_search_timer_settime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_timer_settime" >&5
+$as_echo "$ac_cv_search_timer_settime" >&6; }
+ac_res=$ac_cv_search_timer_settime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ test "$ac_cv_search_timer_settime" = "none required" ||
+ LIB_TIMER_TIME=$ac_cv_search_timer_settime
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $gl_cv_header_sys_select_h_selfcontained = yes; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/select.h>
-int
-main ()
-{
-int memset; int bzero;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/select.h>
-int
-main ()
-{
- #undef memset
- #define memset nonexistent_memset
- extern
- #ifdef __cplusplus
- "C"
- #endif
- void *memset (void *, int, unsigned long);
- #undef bzero
- #define bzero nonexistent_bzero
- extern
- #ifdef __cplusplus
- "C"
- #endif
- void bzero (void *, unsigned long);
- fd_set fds;
- FD_ZERO (&fds);
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
+ && !defined __UCLIBC__
+ Thread emulation available
+ #endif
+#endif
- ;
- return 0;
-}
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Thread" >/dev/null 2>&1; then :
+ LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"
+fi
+rm -f conftest*
+ for ac_func in timer_settime
+do :
+ ac_fn_c_check_func "$LINENO" "timer_settime" "ac_cv_func_timer_settime"
+if test "x$ac_cv_func_timer_settime" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TIMER_SETTIME 1
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-else
- gl_cv_header_sys_select_h_selfcontained=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+done
+
+ LIBS=$gl_saved_libs
+
+ :
+
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5
-$as_echo "$gl_cv_header_sys_select_h_selfcontained" >&6; }
if test $gl_cv_have_include_next = yes; then
- gl_cv_next_sys_select_h='<'sys/select.h'>'
+ gl_cv_next_unistd_h='<'unistd.h'>'
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5
-$as_echo_n "checking absolute name of <sys/select.h>... " >&6; }
-if test "${gl_cv_next_sys_select_h+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
+$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
+if test "${gl_cv_next_unistd_h+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- if test $ac_cv_header_sys_select_h = yes; then
+ if test $ac_cv_header_unistd_h = yes; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <sys/select.h>
+#include <unistd.h>
_ACEOF
case "$host_os" in
esac
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
- gl_header_literal_regex=`echo 'sys/select.h' \
+ gl_header_literal_regex=`echo 'unistd.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/
p
q
}'
- gl_cv_next_sys_select_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
sed -n "$gl_absolute_header_sed"`'"'
else
- gl_cv_next_sys_select_h='<'sys/select.h'>'
+ gl_cv_next_unistd_h='<'unistd.h'>'
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5
-$as_echo "$gl_cv_next_sys_select_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
+$as_echo "$gl_cv_next_unistd_h" >&6; }
fi
- NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h
+ NEXT_UNISTD_H=$gl_cv_next_unistd_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='<'sys/select.h'>'
+ gl_next_as_first_directive='<'unistd.h'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_sys_select_h
+ gl_next_as_first_directive=$gl_cv_next_unistd_h
fi
- NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive
+ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
- if test $ac_cv_header_sys_select_h = yes; then
- HAVE_SYS_SELECT_H=1
+ if test $ac_cv_header_unistd_h = yes; then
+ HAVE_UNISTD_H=1
else
- HAVE_SYS_SELECT_H=0
+ HAVE_UNISTD_H=0
fi
- if test $ac_cv_header_sys_socket_h != yes; then
- for ac_header in winsock2.h
+
+
+
+
+
+
+ if test $ac_cv_have_decl_unsetenv = no; then
+ HAVE_DECL_UNSETENV=0
+ fi
+ for ac_func in unsetenv
do :
- ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
-if test "x$ac_cv_header_winsock2_h" = x""yes; then :
+ 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_WINSOCK2_H 1
+#define HAVE_UNSETENV 1
_ACEOF
fi
-
done
- fi
- if test "$ac_cv_header_winsock2_h" = yes; then
- HAVE_WINSOCK2_H=1
- UNISTD_H_HAVE_WINSOCK2_H=1
- SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
else
- HAVE_WINSOCK2_H=0
+ 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
- if test $gl_cv_have_include_next = yes; then
- gl_cv_next_sys_stat_h='<'sys/stat.h'>'
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
-$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
-if test "${gl_cv_next_sys_stat_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test $ac_cv_header_sys_stat_h = yes; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/stat.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 'sys/stat.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_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
- sed -n "$gl_absolute_header_sed"`'"'
- else
- gl_cv_next_sys_stat_h='<'sys/stat.h'>'
- fi
+ if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether futimesat handles NULL file" >&5
+$as_echo_n "checking whether futimesat handles NULL file... " >&6; }
+if test "${gl_cv_func_futimesat_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ touch conftest.file
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_futimesat_works="guessing no" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stddef.h>
+#include <sys/times.h>
+#include <fcntl.h>
+
+int
+main ()
+{
+ int fd = open ("conftest.file", O_RDWR);
+ if (fd < 0) return 1;
+ if (futimesat (fd, NULL, NULL)) return 2;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_futimesat_works=yes
+else
+ gl_cv_func_futimesat_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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
-$as_echo "$gl_cv_next_sys_stat_h" >&6; }
- fi
- NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_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='<'sys/stat.h'>'
- else
- # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_sys_stat_h
- fi
- NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
+ rm -f conftest.file
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_futimesat_works" >&5
+$as_echo "$gl_cv_func_futimesat_works" >&6; }
+ case "$gl_cv_func_futimesat_works" in
+ *yes) ;;
+ *)
+$as_echo "#define FUTIMESAT_NULL_BUG 1" >>confdefs.h
+
+ ;;
+ esac
+ fi
+ gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false
+ 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_03e0aaad4cb89ca757653bd367a6ccb7=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_260941c0e5dc67ec9e87d1fb321c300b ()
+ {
+ if ! $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then
+ gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext"
- if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+ gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true
+ fi
+ }
+ 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
-$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h
- fi
- ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
- #include <sys/stat.h>
-"
-if test "x$ac_cv_type_nlink_t" = x""yes; then :
-else
-$as_echo "#define nlink_t int" >>confdefs.h
+ 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
+ if test $HAVE_EUIDACCESS = 0; then
+ 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
- ac_fn_c_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include <time.h>
-"
-if test "x$ac_cv_have_decl_localtime_r" = x""yes; then :
- ac_have_decl=1
+
+ # 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_have_decl=0
-fi
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_LOCALTIME_R $ac_have_decl
+/* 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
- if test $ac_cv_have_decl_localtime_r = no; then
- HAVE_DECL_LOCALTIME_R=0
fi
-
- if test $ac_cv_func_localtime_r = yes; then
- HAVE_LOCALTIME_R=1
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
-$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
-if test "${gl_cv_time_r_posix+set}" = set; then :
+ # 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. */
-#include <time.h>
+$ac_includes_default
int
main ()
{
-/* We don't need to append 'restrict's to the argument types,
- even though the POSIX signature has the 'restrict's,
- since C99 says they can't affect type compatibility. */
- struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
- if (ptr) return 0;
- /* Check the return type is a pointer.
- On HP-UX 10 it is 'int'. */
- *localtime_r (0, 0);
+/* On Ultrix 4.3, getgroups (0, 0) always fails. */
+ return getgroups (0, 0) == -1;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_time_r_posix=yes
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_getgroups_works=yes
else
- gl_cv_time_r_posix=no
+ ac_cv_func_getgroups_works=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
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
-$as_echo "$gl_cv_time_r_posix" >&6; }
- if test $gl_cv_time_r_posix = yes; then
- REPLACE_LOCALTIME_R=0
- else
- REPLACE_LOCALTIME_R=1
- fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getgroups_works" >&5
+$as_echo "$ac_cv_func_getgroups_works" >&6; }
else
- HAVE_LOCALTIME_R=0
+ ac_cv_func_getgroups_works=no
fi
+ case "$ac_cv_func_getgroups_works" in
+ *yes)
- if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
+$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
- gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
+ LIBS=$gl_saved_libs
+ fi
- :
- fi
+ GNULIB_EUIDACCESS=1
- GNULIB_TIME_R=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
- LIB_TIMER_TIME=
- gl_saved_libs=$LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing timer_settime" >&5
-$as_echo_n "checking for library containing timer_settime... " >&6; }
-if test "${ac_cv_search_timer_settime+set}" = set; then :
+ # 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_func_search_save_LIBS=$LIBS
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __cplusplus
extern "C"
#endif
-char timer_settime ();
+char getgroups ();
int
main ()
{
-return timer_settime ();
+return getgroups ();
;
return 0;
}
_ACEOF
-for ac_lib in '' rt posix4; 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_timer_settime=$ac_res
+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
- if test "${ac_cv_search_timer_settime+set}" = set; then :
- break
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-done
-if test "${ac_cv_search_timer_settime+set}" = set; then :
+{ $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
- ac_cv_search_timer_settime=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+ 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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_timer_settime" >&5
-$as_echo "$ac_cv_search_timer_settime" >&6; }
-ac_res=$ac_cv_search_timer_settime
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- test "$ac_cv_search_timer_settime" = "none required" ||
- LIB_TIMER_TIME=$ac_cv_search_timer_settime
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+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"
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
- && !defined __UCLIBC__
- Thread emulation available
- #endif
-#endif
+ if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "Thread" >/dev/null 2>&1; then :
- LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"
-fi
-rm -f conftest*
- for ac_func in timer_settime
-do :
- ac_fn_c_check_func "$LINENO" "timer_settime" "ac_cv_func_timer_settime"
-if test "x$ac_cv_func_timer_settime" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_TIMER_SETTIME 1
-_ACEOF
-fi
-done
- LIBS=$gl_saved_libs
- :
+ gl_LIBOBJS="$gl_LIBOBJS getgroups.$ac_objext"
+ fi
+ GNULIB_GETGROUPS=1
- if test $gl_cv_have_include_next = yes; then
- gl_cv_next_unistd_h='<'unistd.h'>'
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
-$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
-if test "${gl_cv_next_unistd_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test $ac_cv_header_unistd_h = yes; then
+ gl_gnulib_enabled_getgroups=true
+ fi
+ }
+ func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 ()
+ {
+ if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <unistd.h>
+ gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
+ fi
+ }
+ func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1 ()
+ {
+ if ! $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then
-_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 'unistd.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_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
- sed -n "$gl_absolute_header_sed"`'"'
- else
- gl_cv_next_unistd_h='<'unistd.h'>'
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
-$as_echo "$gl_cv_next_unistd_h" >&6; }
- fi
- NEXT_UNISTD_H=$gl_cv_next_unistd_h
+ ac_fn_c_check_func "$LINENO" "group_member" "ac_cv_func_group_member"
+if test "x$ac_cv_func_group_member" = x""yes; then :
- 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='<'unistd.h'>'
- else
- # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=$gl_cv_next_unistd_h
- fi
- NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
+else
+ HAVE_GROUP_MEMBER=0
+fi
- if test $ac_cv_header_unistd_h = yes; then
- HAVE_UNISTD_H=1
- else
- HAVE_UNISTD_H=0
- fi
+ if test $HAVE_GROUP_MEMBER = 0; then
+ gl_LIBOBJS="$gl_LIBOBJS group-member.$ac_objext"
+ fi
- if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether futimesat handles NULL file" >&5
-$as_echo_n "checking whether futimesat handles NULL file... " >&6; }
-if test "${gl_cv_func_futimesat_works+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- touch conftest.file
- if test "$cross_compiling" = yes; then :
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_futimesat_works="guessing no" ;;
- esac
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stddef.h>
-#include <sys/times.h>
-#include <fcntl.h>
-int
-main ()
-{
- int fd = open ("conftest.file", O_RDWR);
- if (fd < 0) return 1;
- if (futimesat (fd, NULL, NULL)) return 2;
+ GNULIB_GROUP_MEMBER=1
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- gl_cv_func_futimesat_works=yes
-else
- gl_cv_func_futimesat_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
- rm -f conftest.file
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_futimesat_works" >&5
-$as_echo "$gl_cv_func_futimesat_works" >&6; }
- case "$gl_cv_func_futimesat_works" in
- *yes) ;;
- *)
-$as_echo "#define FUTIMESAT_NULL_BUG 1" >>confdefs.h
- ;;
- esac
- fi
- gl_gnulib_enabled_dosname=false
- gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
- gl_gnulib_enabled_pathmax=false
- gl_gnulib_enabled_stat=false
- gl_gnulib_enabled_strtoll=false
- gl_gnulib_enabled_strtoull=false
- gl_gnulib_enabled_verify=false
- func_gl_gnulib_m4code_dosname ()
- {
- if ! $gl_gnulib_enabled_dosname; then
- gl_gnulib_enabled_dosname=true
+ 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_be453cec5eecf5731a274f2de7f2db36 ()
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7 ()
{
- if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then
-
-
- gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
+ if ! $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then
+ gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=true
fi
}
func_gl_gnulib_m4code_pathmax ()
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_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_260941c0e5dc67ec9e87d1fb321c300b
+ 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 $HAVE_FACCESSAT = 0; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
+ if test $HAVE_FDOPENDIR = 0; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
if test $REPLACE_GETOPT = 1; then
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
fi
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
func_gl_gnulib_m4code_stat
fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
if { test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
func_gl_gnulib_m4code_strtoll
fi
func_gl_gnulib_m4code_verify
fi
+ if $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then
+ gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_TRUE=
+ gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_FALSE='#'
+else
+ gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_TRUE='#'
+ gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_FALSE=
+fi
+
if $gl_gnulib_enabled_dosname; then
gl_GNULIB_ENABLED_dosname_TRUE=
gl_GNULIB_ENABLED_dosname_FALSE='#'
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_03e0aaad4cb89ca757653bd367a6ccb7; then
+ gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7_TRUE=
+ gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7_FALSE='#'
+else
+ gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7_TRUE='#'
+ gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7_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_GENERATE_STDDEF_H\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_TRUE}" && test -z "${gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_FALSE}"; then
+ as_fn_error "conditional \"gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${gl_GNULIB_ENABLED_dosname_TRUE}" && test -z "${gl_GNULIB_ENABLED_dosname_FALSE}"; then
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_03e0aaad4cb89ca757653bd367a6ccb7_TRUE}" && test -z "${gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7_FALSE}"; then
+ as_fn_error "conditional \"gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7\" 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.93, 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.93
+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.93)
+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="$@"
+## Add some environment variables, if they were passed via the environment
+## rather than on the command-line.
+for var in CFLAGS CPPFLAGS LDFLAGS; do
+ case "$emacs_config_options" in
+ *$var=*) continue ;;
+ esac
+ eval val="\$${var}"
+ test x"$val" = x && continue
+ emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=\"$val\""
+done
+
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 These won't be used automatically yet. We also need to know, at least,
+dnl This won't be used automatically yet. We also need to know, at least,
dnl that the stack is continuous.
AH_TEMPLATE(GC_SETJMP_WORKS, [Define if setjmp is known to save all
registers relevant for conservative garbage collection in the jmp_buf.])
-AH_TEMPLATE(GC_MARK_STACK, [Define to GC_USE_GCPROS_AS_BEFORE if
- conservative garbage collection is not known to work.])
-
case $opsys in
- aix4-2 | hpux* | unixware)
- dnl Conservative garbage collection has not been tested, so for now
- dnl play it safe and stick with the old-fashioned way of marking.
- AC_DEFINE(GC_MARK_STACK, [GC_USE_GCPROS_AS_BEFORE])
- ;;
-
dnl Not all the architectures are tested, but there are Debian packages
dnl for SCM and/or Guile on them, so the technique must work. See also
dnl comments in alloc.c concerning setjmp and gcc.
#else
# error "setjmp not known to work on this arch"
#endif
- ]], [[]])], AC_DEFINE(GC_SETJMP_WORKS, 1),
- AC_DEFINE(GC_MARK_STACK, [GC_USE_GCPROS_AS_BEFORE]) )
+ ]], [[]])], AC_DEFINE(GC_SETJMP_WORKS, 1))
;;
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/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -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-02-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * cmdargs.texi (General Variables):
+ Fix TMPDIR documentation to match the code's behavior.
+
2013-02-10 Glenn Morris <rgm@gnu.org>
* trouble.texi (Checklist): Update bug keybinding.
-2013-01-18 Glenn Morris <rgm@gnu.org>
+2013-02-09 Eli Zaretskii <eliz@gnu.org>
- * custom.texi (Directory Variables): Fix paren typo.
+ * msdog.texi (Text and Binary): Delete the description of
+ file-name-buffer-file-type-alist.
-2013-01-16 Glenn Morris <rgm@gnu.org>
+2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * trouble.texi (Crashing): Suggest -p for newer addr2line. (Bug#13445)
+ Without it, I don't see function names. Older addr2line
+ implementations will die out sooner or later, so tailor the
+ first suggestion to recent addr2line, with a followup about
+ older ones.
+
+2013-01-19 Glenn Morris <rgm@gnu.org>
+
+ * custom.texi (Directory Variables): Fix paren typo.
* trouble.texi (Crashing): Not all addr2line have -p. (Bug#13445)
* custom.texi (Custom Themes): Fix typo.
+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).
These environment variables are used to initialize the variable
@code{temporary-file-directory}, which specifies a directory in which
to put temporary files (@pxref{Backup}). Emacs tries to use
-@env{TMPDIR} first; if that is unset, it tries @env{TMP}, then
-@env{TEMP}, and finally @file{/tmp}. But on MS-Windows and MS-DOS,
-Emacs tries @env{TEMP}, then @env{TMPDIR}, then @env{TMP}, and finally
-@file{c:/temp}.
+@env{TMPDIR} first. If that is unset, Emacs normally falls back on
+@file{/tmp}, but on MS-Windows and MS-DOS it instead falls back on
+@env{TMP}, then @env{TEMP}, and finally @file{c:/temp}.
@item TZ
This specifies the current time zone and possibly also daylight
-@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.93
+@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
Emacs to create new files with the Unix-style convention of using
newline at the end of a line. @xref{Coding Systems}.
-@vindex file-name-buffer-file-type-alist
-@cindex binary files, on MS-DOS/MS-Windows
- Some kinds of files should not be converted at all, because their
-contents are not really text. Therefore, Emacs on MS-Windows distinguishes
-certain files as @dfn{binary files}. (This distinction is not part of
-MS-Windows; it is made by Emacs only.) Binary files include executable
-programs, compressed archives, etc. Emacs uses the file name to decide
-whether to treat a file as binary: the variable
-@code{file-name-buffer-file-type-alist} defines the file-name patterns
-that indicate binary files. If a file name matches one of the patterns
-for binary files (those whose associations are of the type
-@code{(@var{pattern} . t)}, Emacs reads and writes that file using the
-@code{no-conversion} coding system (@pxref{Coding Systems}) which turns
-off @emph{all} coding-system conversions, not only the EOL conversion.
-@code{file-name-buffer-file-type-alist} also includes file-name patterns
-for files which are known to be Windows-style text files with
-carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs
-always writes those files with Windows-style EOLs.
-
- If a file that belongs to an untranslated file system matches one of
-the file-name patterns in @code{file-name-buffer-file-type-alist}, the
-EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
-
@node Windows Files
@section File Names on MS-Windows
@cindex file names on MS-Windows
@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 -C -f -i -e @var{bindir}/emacs
+ addr2line -C -f -i -p -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.@footnote{You may wish to add the
-@option{-p} option, if your version of @command{addr2line} supports it.}
+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. Omit the
+@option{-p} option if your version of @command{addr2line} is too old
+to have it.
@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
* modes.texi (Minor Mode Conventions): Fix typo.
-2013-02-12 Glenn Morris <rgm@gnu.org>
-
* keymaps.texi (Scanning Keymaps): Remove obsolete sentence about
meta characters; this changed in 22.1. (Bug#13684)
-2013-02-11 Glenn Morris <rgm@gnu.org>
-
* objects.texi (Char-Table Type): Add cindex.
* keymaps.texi (Key Binding Commands): Trivial rephrasing.
-2013-02-09 Glenn Morris <rgm@gnu.org>
+2013-02-10 Glenn Morris <rgm@gnu.org>
* keymaps.texi (Creating Keymaps): Update make-keymap result.
+2013-02-09 Eli Zaretskii <eliz@gnu.org>
+
+ * modes.texi (%-Constructs): Remove the description of %t.
+
+ * nonascii.texi (MS-DOS File Types): Delete node.
+
2013-02-08 Glenn Morris <rgm@gnu.org>
* keymaps.texi (Active Keymaps, Searching Keymaps):
Remove confusing mention of "symbolic prefix". (Bug#13643)
-2013-01-16 Glenn Morris <rgm@gnu.org>
+2013-01-19 Glenn Morris <rgm@gnu.org>
* macros.texi (Indenting Macros): Fix order of an indent
symbol's arguments. (Bug#13450)
+2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ Allow floating-point file offsets.
+ * files.texi (Reading from Files, Writing to Files):
+ Say that file offsets can be numbers, not just integers.
+
2013-01-09 Glenn Morris <rgm@gnu.org>
* commands.texi (Interactive Codes):
* 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-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-06 Stefan Monnier <monnier@iro.umontreal.ca>
+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:
for a single file operation.
* Explicit Encoding:: Encoding or decoding text without doing I/O.
* Terminal I/O Encoding:: Use of encoding for terminal I/O.
-* MS-DOS File Types:: How DOS "text" and "binary" files
- relate to coding systems.
Searching and Matching
@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
file name and its last save file modtime. This feature is used by
@code{find-file-noselect} and you probably should not use it yourself.
-If @var{beg} and @var{end} are non-@code{nil}, they should be integers
-specifying the portion of the file to insert. In this case, @var{visit}
-must be @code{nil}. For example,
+If @var{beg} and @var{end} are non-@code{nil}, they should be numbers
+that are byte offsets specifying the portion of the file to insert.
+In this case, @var{visit} must be @code{nil}. For example,
@example
(insert-file-contents filename nil 0 500)
this case.
If @var{append} is non-@code{nil}, then the specified text is appended
-to the existing file contents (if any). If @var{append} is an
-integer, @code{write-region} seeks to that byte offset from the start
+to the existing file contents (if any). If @var{append} is a
+number, @code{write-region} seeks to that byte offset from the start
of the file and writes the data from there.
If @var{mustbenew} is non-@code{nil}, then @code{write-region} asks
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 status of the subprocess belonging to the current buffer, obtained with
@code{process-status}. @xref{Process Information}.
-@item %t
-Whether the visited file is a text file or a binary file. This is a
-meaningful distinction only on certain operating systems (@pxref{MS-DOS
-File Types}).
-
@item %z
The mnemonics of keyboard, terminal, and buffer coding systems.
for a single file operation.
* Explicit Encoding:: Encoding or decoding text without doing I/O.
* Terminal I/O Encoding:: Use of encoding for terminal I/O.
-* MS-DOS File Types:: How DOS "text" and "binary" files
- relate to coding systems.
@end menu
@node Coding System Basics
@code{nil}, that means the currently selected frame's terminal.
@end deffn
-@node MS-DOS File Types
-@subsection MS-DOS File Types
-@cindex DOS file types
-@cindex MS-DOS file types
-@cindex Windows file types
-@cindex file types on MS-DOS and Windows
-@cindex text files and binary files
-@cindex binary files and text files
-
- On MS-DOS and Microsoft Windows, Emacs guesses the appropriate
-end-of-line conversion for a file by looking at the file's name. This
-feature classifies files as @dfn{text files} and @dfn{binary files}. By
-``binary file'' we mean a file of literal byte values that are not
-necessarily meant to be characters; Emacs does no end-of-line conversion
-and no character code conversion for them. On the other hand, the bytes
-in a text file are intended to represent characters; when you create a
-new file whose name implies that it is a text file, Emacs uses DOS
-end-of-line conversion.
-
-@defvar buffer-file-type
-This variable, automatically buffer-local in each buffer, records the
-file type of the buffer's visited file. When a buffer does not specify
-a coding system with @code{buffer-file-coding-system}, this variable is
-used to determine which coding system to use when writing the contents
-of the buffer. It should be @code{nil} for text, @code{t} for binary.
-If it is @code{t}, the coding system is @code{no-conversion}.
-Otherwise, @code{undecided-dos} is used.
-
-Normally this variable is set by visiting a file; it is set to
-@code{nil} if the file was visited without any actual conversion.
-
-Its default value is used to decide how to handle files for which
-@code{file-name-buffer-file-type-alist} says nothing about the type:
-If the default value is non-@code{nil}, then these files are treated as
-binary: the coding system @code{no-conversion} is used. Otherwise,
-nothing special is done for them---the coding system is deduced solely
-from the file contents, in the usual Emacs fashion.
-@end defvar
-
-@defopt file-name-buffer-file-type-alist
-This variable holds an alist for recognizing text and binary files.
-Each element has the form (@var{regexp} . @var{type}), where
-@var{regexp} is matched against the file name, and @var{type} may be
-@code{nil} for text, @code{t} for binary, or a function to call to
-compute which. If it is a function, then it is called with a single
-argument (the file name) and should return @code{t} or @code{nil}.
-
-When running on MS-DOS or MS-Windows, Emacs checks this alist to decide
-which coding system to use when reading a file. For a text file,
-@code{undecided-dos} is used. For a binary file, @code{no-conversion}
-is used.
-
-If no element in this alist matches a given file name, then
-the default value of @code{buffer-file-type} says how to treat the file.
-@end defopt
-
@node Input Methods
@section Input Methods
@cindex input methods
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.93"
+.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-02-09 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc.texi (Basic Operations on Units):
+ (Customizing Calc): Mention the variable `calc-allow-units-as-numbers'.
+
2013-02-08 Aidan Gauland <aidalgol@no8wireless.co.nz>
* eshell.texi: Fill most of the missing sections.
(Org-Plot): Fix link.
(Checkboxes, Radio lists): Fix typos.
-2013-02-06 Glenn Morris <rgm@gnu.org>
+2013-02-07 Glenn Morris <rgm@gnu.org>
* cl.texi (Equality Predicates): Mention memql.
-2013-02-03 Eric Ludlam <zappo@gnu.org>
+2013-02-07 Eric Ludlam <zappo@gnu.org>
* doc/misc/ede.texi (Creating a project): Make ede-new doc less
specific, and only about items it supports, indicating that there
from ede new.
(Simple projects): Re-write to not talk about ede-simple-project
which is deprecated, and instead use the term to mean projects
- that don't do much management, just project wrapping.
- Add ede-generic-project link.
+ that don't do much management, just project wrapping. Add
+ ede-generic-project link.
(ede-generic-project): New node (bug#11441).
-2013-02-03 Glenn Morris <rgm@gnu.org>
+2013-02-07 Glenn Morris <rgm@gnu.org>
* cl.texi (Equality Predicates): Fix eq/eql pedantry.
+2013-02-01 Glenn Morris <rgm@gnu.org>
+
+ * calc.texi (Help Commands): Update calc-view-news description.
+ Mention etc/CALC-NEWS.
+
+2013-01-24 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (Filename Syntax): Filenames must be unibyte strings.
+
2013-01-13 Bastien Guerry <bzg@gnu.org>
* org.texi (Installation): Simplify.
variable `org-id-link-to-org-use-id'. Mention the need to load
the org-id library.
-2013-01-08 Bastien Guerry <bzg@gnu.org>
+2013-01-10 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (Default Host): Introduce `tramp-default-host-alist'.
+
+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.
* ede.texi (Top): Rename from top, all uses changed.
* eshell.texi: Add missing argument to @sp.
* forms.texi (Top): Reorder menu to match structure.
- * htmlfontify.texi (Customisation): Add missing @item in @enumerate.
+ * htmlfontify.texi (Customisation): Add missing @item in
+ @enumerate.
* org.texi (Advanced features): Add missing argument for @item.
(Property searches): Use @backslashchar{} in macro argument.
* pcl-cvs.texi: Add missing argument to @sp.
* 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)
* 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.
-2012-12-02 Michael Albinus <michael.albinus@gmx.de>
+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-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.
- * trampver.texi: Downgrade version to 2.2.6-24.3, in order to
- distinguish from trunk.
+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>
+
+ * 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.
+ * 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>
2012-10-26 Bastien Guerry <bzg@gnu.org>
- * org.texi (Installation): Update the link to Org's ELPA.
- Also don't mention org-install.el anymore as the replacement file
+ * org.texi (Installation): Update the link to Org's ELPA. Also
+ don't mention org-install.el anymore as the replacement file
org-loaddefs.el is now loaded by org.el.
2012-10-25 Michael Albinus <michael.albinus@gmx.de>
- * tramp.texi (Frequently Asked Questions):
- Mention `tramp-completion-reread-directory-timeout' for performance
+ * tramp.texi (Frequently Asked Questions): Mention
+ `tramp-completion-reread-directory-timeout' for performance
improvement.
2012-10-25 Glenn Morris <rgm@gnu.org>
(Imprint): Mention Wolfgang in list of contributors.
(Creating Citations): Give a hint about how to
auto-revert the BibTeX database file when using external editors.
- (Referencing Labels): Simplify section about reference macro cycling.
+ (Referencing Labels): Simplify section about reference macro
+ cycling.
(Options (Referencing Labels)): Adapt to new structure of
`reftex-ref-style-alist'.
(Referencing Labels, Reference Styles): Document changes in the
(Referencing Labels): Update regarding reference styles.
(Citation Styles): Mention support for ConTeXt.
(Options (Defining Label Environments)): Fix typo.
- (Options (Creating Citations)):
- Document `reftex-cite-key-separator'.
+ (Options (Creating Citations)): Document
+ `reftex-cite-key-separator'.
2012-09-30 Achim Gratz <Stromeko@Stromeko.DE>
2012-09-30 Bastien Guerry <bzg@gnu.org>
- * org.texi (Installation, Feedback, Batch execution):
- Use (add-to-list 'load-path ... t) for the contrib dir.
+ * org.texi (Installation, Feedback, Batch execution): Use
+ (add-to-list 'load-path ... t) for the contrib dir.
* org.texi (results): Update documentation for ":results drawer"
and ":results org".
* org.texi (History and Acknowledgments): Fix typo.
- * org.texi (History and Acknowledgments): Add my own acknowledgments.
+ * org.texi (History and Acknowledgments): Add my own
+ acknowledgments.
* org.texi (Agenda commands): Document the new command and the new
option.
* org.texi (Agenda commands): Delete `org-agenda-action' section.
- (Agenda commands): Reorder. Document `*' to toggle persistent marks.
+ (Agenda commands): Reorder. Document `*' to toggle persistent
+ marks.
- * org.texi (Agenda dispatcher):
- Mention `org-toggle-agenda-sticky'.
+ * org.texi (Agenda dispatcher): Mention
+ `org-toggle-agenda-sticky'.
(Agenda commands, Exporting Agenda Views): Fix typo.
* org.texi (Templates in contexts, Setting Options): Update to
* org.texi (Formula syntax for Lisp): Reformat.
* org.texi (Special properties, Column attributes)
- (Agenda column view): Document the new special property CLOCKSUM_T.
+ (Agenda column view): Document the new special property
+ CLOCKSUM_T.
* org.texi (Template expansion): Document the new %l template.
(Unsafe Simplifications): Mention `m E'.
(Simplification of Units): Mention `m U'.
(Trigonometric/Hyperbolic Functions, Reducing and Mapping)
- (Kinds of Declarations, Functions for Declarations):
- Mention "algebraic simplifications" instead of `a s'.
+ (Kinds of Declarations, Functions for Declarations): Mention
+ "algebraic simplifications" instead of `a s'.
(Algebraic Entry): Remove mention of default simplifications.
2012-07-30 Jay Belanger <jay.p.belanger@gmail.com>
2012-07-06 Michael Albinus <michael.albinus@gmx.de>
- * tramp.texi (Multi-hops):
- Introduce `tramp-restricted-shell-hosts-alist'.
+ * tramp.texi (Multi-hops): Introduce
+ `tramp-restricted-shell-hosts-alist'.
2012-06-26 Lars Magne Ingebrigtsen <larsi@gnus.org>
(Synchronous Methods): Remove obsolete dbus-call-method-non-blocking.
(Asynchronous Methods): Fix description of
dbus-call-method-asynchronously.
- (Receiving Method Calls): Fix some minor errors.
- Add dbus-interface-emacs.
+ (Receiving Method Calls): Fix some minor errors. Add
+ dbus-interface-emacs.
(Signals): Describe unicast signals and the new match rules.
(Alternative Buses): Add the PRIVATE optional argument to
dbus-init-bus. Describe its new return value. Add dbus-setenv.
2012-04-09 Eli Zaretskii <eliz@gnu.org>
- * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean):
- Add emacs-gnutls.
+ * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add
+ emacs-gnutls.
($(infodir)/emacs-gnutls, emacs-gnutls.dvi): New targets.
2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
2012-04-01 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (MobileOrg): Change the wording to reflect that the
- Android Version is no longer just the little brother of the iOS version.
+ Android Version is no longer just the little brother of the iOS
+ version.
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
- * org.texi (Key bindings and useful functions): Update babel key
+ * org.texi (Key bindings and useful functions): Updated babel key
binding documentation in manual.
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
- * gnus.texi (Customizing the IMAP Connection):
- Mention nnimap-record-commands.
+ * gnus.texi (Customizing the IMAP Connection): Mention
+ nnimap-record-commands.
2012-02-10 Glenn Morris <rgm@gnu.org>
2012-01-03 Eric Schulte <eric.schulte@gmx.com>
* org.texi (Noweb reference syntax): Adding documentation of
- the `*org-babel-use-quick-and-dirty-noweb-expansion*' variable.
+ the `*org-babel-use-quick-and-dirty-noweb-expansion*'
+ variable.
2012-01-03 Bastien Guerry <bzg@gnu.org>
2012-01-03 Bernt Hansen <bernt@norang.ca>
- * org.texi (Agenda commands):
- Document `org-clock-report-include-clocking-task'.
+ * org.texi (Agenda commands): Document
+ `org-clock-report-include-clocking-task'.
2012-01-03 Bastien Guerry <bzg@gnu.org>
2012-01-03 Thomas Dye <dk@poto.local>
- * org.texi: Changed DATA to NAME in Working With Source Code section.
+ * org.texi: Changed DATA to NAME in Working With Source Code
+ section.
2012-01-03 Tom Dye <tsd@tsdye.com>
2012-01-03 Eric Schulte <schulte.eric@gmail.com>
- * org.texi (Buffer-wide header arguments):
- Update documentation to reflect removal of #+PROPERTIES.
+ * org.texi (Buffer-wide header arguments): Update
+ documentation to reflect removal of #+PROPERTIES.
2012-01-03 Carsten Dominik <carsten.dominik@gmail.com>
2012-01-03 Tom Dye <tsd@tsdye.com>
- * org.texi: Added a line to specify that header arguments are lowercase.
+ * org.texi: Added a line to specify that header arguments are
+ lowercase.
2012-01-03 Tom Dye <tsd@tsdye.com>
2012-01-03 David Maus <dmaus@ictsoc.de>
- * org.texi (Exporting Agenda Views, Extracting agenda information):
- Fix command line syntax, quote symbol parameter values.
+ * org.texi (Exporting Agenda Views, Extracting agenda
+ information): Fix command line syntax, quote symbol parameter
+ values.
2012-01-03 David Maus <dmaus@ictsoc.de>
* mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
release 8.3.
- (Preface): Update support information.
+ (Preface): Updated support information.
(From Bill Wohler): Reset text to original version. As a
historical quote, the tense should be correct in the time that it
was written.
2011-08-15 Bastien Guerry <bzg@gnu.org>
- * org.texi (Languages): Add Lilypond and Awk as supported languages.
+ * org.texi (Languages): Add Lilypond and Awk as supported
+ languages.
2011-08-15 Achim Gratz <stromeko@nexgo.de>
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
* org.texi (Results of evaluation): More explicit about the
- mechanism through which interactive evaluation of code is performed.
+ mechanism through which interactive evaluation of code is
+ performed.
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
2011-08-15 Puneeth Chaganti <punchagan@gmail.com>
- * org.texi (Agenda commands): Doc for function option to bulk action.
+ * org.texi (Agenda commands): Doc for function option to bulk
+ action.
2011-08-15 Carsten Dominik <carsten.dominik@gmail.com>
- * org.texi (Template expansion): Document new %<...> template escape.
+ * org.texi (Template expansion): Document new %<...> template
+ escape.
2011-08-15 Carsten Dominik <carsten.dominik@gmail.com>
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
- * org.texi (padline): Documentation of the new padline header argument.
+ * org.texi (padline): Documentation of the new padline header
+ argument.
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
- * org.texi (var): Clarification of indexing into tabular variables.
+ * org.texi (var): Clarification of indexing into tabular
+ variables.
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
2011-08-15 Bastien Guerry <bzg@gnu.org>
- * org.texi (Dynamic blocks, Structure editing):
- Mention the function `org-narrow-to-block'.
+ * org.texi (Dynamic blocks, Structure editing): Mention
+ the function `org-narrow-to-block'.
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
- * org.texi (Conflicts): Change "yasnippets" to "yasnippet" and
+ * org.texi (Conflicts): Changed "yasnippets" to "yasnippet" and
added extra whitespace around functions to be consistent with the
rest of the section.
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
- * org.texi (Evaluating code blocks): Expand discussion of
+ * org.texi (Evaluating code blocks): Expanded discussion of
#+call: line syntax.
- (Header arguments in function calls): Expand discussion of
+ (Header arguments in function calls): Expanded discussion of
#+call: line syntax.
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
2011-08-15 Tom Dye <tsd@tsdye.com>
- * org.texi (cache): Improve documentation of code block caches.
+ * org.texi (cache): Improved documentation of code block caches.
2011-08-15 Tom Dye <tsd@tsdye.com>
- * org.texi (Code block specific header arguments):
- Documentation of multi-line header arguments.
+ * org.texi (Code block specific header arguments): Documentation
+ of multi-line header arguments.
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
- * org.texi (Code evaluation security): Add example for using a function.
+ * org.texi (Code evaluation security): Add example for using a
+ function.
2011-08-15 Eric Schulte <schulte.eric@gmail.com>
2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
* widget.texi (Setting Up the Buffer): Remove mention of the
- global keymap parent, which doesn't seem to be accurate (bug#7045).
+ global keymap parent, which doesn't seem to be accurate
+ (bug#7045).
2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2011-07-04 Michael Albinus <michael.albinus@gmx.de>
- * tramp.texi (Cleanup remote connections):
- Add `tramp-cleanup-this-connection'.
+ * tramp.texi (Cleanup remote connections): Add
+ `tramp-cleanup-this-connection'.
2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Subscription Methods): Link to "Group Levels" to explain
zombies.
(Checking New Groups): Ditto (bug#8974).
- (Checking New Groups): Move the reference to the right place.
+ (Checking New Groups): Moved the reference to the right place.
2011-07-03 Dave Abrahams <dave@boostpro.com> (tiny change)
2011-06-26 Lars Magne Ingebrigtsen <larsi@gnus.org>
- * gnus.texi (Summary Mail Commands):
- Document `gnus-summary-reply-to-list-with-original'.
+ * gnus.texi (Summary Mail Commands): Document
+ `gnus-summary-reply-to-list-with-original'.
2011-06-20 Stefan Monnier <monnier@iro.umontreal.ca>
* gnus.texi (nnmairix caveats, Setup, Registry Article Refer Method)
(Fancy splitting to parent, Store arbitrary data):
- Update gnus-registry docs.
+ Updated gnus-registry docs.
2011-04-13 Juanma Barranquero <lekktu@gmail.com>
2011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
- * calc.texi (Logarithmic Units): Rename calc-logunits-dblevel and
- calc-logunits-nplevel to calc-dblevel and calc-nplevel, respectively.
+ * calc.texi (Logarithmic Units): Rename calc-logunits-dblevel
+ and calc-logunits-nplevel to calc-dblevel and calc-nplevel,
+ respectively.
(Musical Notes): New section.
(Customizing Calc): Mention the customizable variable
calc-note-threshold.
Sync with Tramp 2.1.19.
- * tramp.texi (Inline methods, Default Method):
- Mention `tramp-inline-compress-start-size'. Remove "kludgy" phrase.
+ * tramp.texi (Inline methods, Default Method): Mention
+ `tramp-inline-compress-start-size'. Remove "kludgy" phrase.
Remove remark about doubled "-t" argument.
(Auto-save and Backup): Remove reference to Emacs 21.
(Filename Syntax): Describe port numbers.
2007-10-28 Kevin Greiner <kevin.greiner@compsol.cc>
* gnus.texi (nntp-open-via-telnet-and-telnet): Fix grammar.
- (Agent Parameters): Update parameter names to match code.
+ (Agent Parameters): Updated parameter names to match code.
(Group Agent Commands): Corrected 'gnus-agent-fetch-series' as
'gnus-agent-summary-fetch-series'.
(Agent and flags): New section providing a generalized discussion
(Tag searches): Document regular expression search for tags.
(Stuck projects): New section.
(In-buffer settings): New keywords.
- (History and Acknowledgments): Update description.
+ (History and Acknowledgments): Updated description.
2007-02-24 Alan Mackenzie <acm@muc.de>
(Custom agenda views): Section completely rewritten.
(Summary): Compare with Planner.
(Feedback): More info about creating backtraces.
- (Plain lists): Modify example.
+ (Plain lists): Modified example.
(Breaking down tasks): New section.
(Custom time format): New section.
(Time stamps): Document inactive timestamps.
## 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)}.
@kindex h n
The @kbd{h n} or @kbd{h C-n} (@code{calc-view-news}) command displays
-the ``news'' or change history of Calc. This is kept in the file
-@file{README}, which Calc looks for in the same directory as the Calc
-source files.
+the ``news'' or change history of Emacs, and jumps to the most recent
+portion concerning Calc (if present). For older history, see the file
+@file{etc/CALC-NEWS} in the Emacs distribution.
@kindex h C-c
@kindex h C-d
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
``fundamental'' units like @samp{m} and @samp{s}, regardless of the
input units.
-If you want to disallow using inconsistent units, you can set the customizable variable
-@code{calc-ensure-consistent-units} to @code{t} (@pxref{Customizing Calc}). In this case,
-if you request units which are inconsistent with the original units, you will be warned about
-it and no conversion will occur.
-
One special exception is that if you specify a single unit name, and
a compatible unit appears somewhere in the units expression, then
that compatible unit will be converted to the new unit and the
The ``remainder unit'' @samp{cm} is left alone rather than being
changed to the base unit @samp{m}.
+If you want to disallow using inconsistent units, you can set the
+customizable variable @code{calc-ensure-consistent-units} to @code{t}
+(@pxref{Customizing Calc}). In this case, if you request units which
+are inconsistent with the original units, you will be warned about it
+and no conversion will occur.
+
You can use explicit unit conversion instead of the @kbd{u s} command
to gain more control over the units of the result of an expression.
For example, given @samp{5 m + 23 mm}, you can type @kbd{u c m} or
If the value on the stack does not contain any units, @kbd{u c} will
prompt first for the old units which this value should be considered
-to have, then for the new units. Assuming the old and new units you
-give are consistent with each other, the result also will not contain
-any units. For example, @kbd{@w{u c} cm @key{RET} in @key{RET}}
-converts the number 2 on the stack to 5.08.
+to have, then for the new units. (If the value on the stack can be
+simplified so that it doesn't contain any units, like @samp{ft/in} can
+be simplified to 12, then @kbd{u c} will still prompt for both old
+units and new units. You can ignore the prompt for old units with
+@key{RET}, or turn off the prompt by setting the customizable variable
+@code{calc-allow-units-as-numbers} to @code{nil}.
+@pxref{Customizing Calc}) Assuming the old and new units you give are
+consistent with each other, the result also will not contain any
+units. For example, @kbd{@w{u c} cm @key{RET} in @key{RET}} converts
+the number 2 on the stack to 5.08.
@kindex u b
@pindex calc-base-units
is @code{nil}.
@end defvar
+@defvar calc-allow-units-as-numbers
+When converting units, the variable @code{calc-allow-units-as-numbers}
+determines whether or not values which can be simplified so that
+they don't contain units (such as @samp{ft/in} can be simplified to 12)
+can be regarded as not containing units. If
+@code{calc-allow-units-as-numbers} is non-@code{nil}, then @kbd{u c}
+will prompt for both old units and new units when converting an expression
+like @samp{ft/in}, otherwise @kbd{u c} will only prompt for the new units.
+The default value of @code{calc-allow-units-as-numbers} is @code{t}.
+@end defvar
+
@defvar calc-undo-length
The variable @code{calc-undo-length} determines the number of undo
steps that Calc will keep track of when @code{calc-quit} is called.
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-02-01.11}
%
% 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:
\let-\codedash
\let_\codeunder
\else
- \let-\realdash
+ \let-\normaldash
\let_\realunder
\fi
\codex
\def\codex #1{\tclose{#1}\endgroup}
-\def\realdash{-}
+\def\normaldash{-}
\def\codedash{-\discretionary{}{}{}}
\def\codeunder{%
% this is all so @math{@code{var_name}+1} can work. In math mode, _
}
% An additional complication: the above will allow breaks after, e.g.,
-% each of the four underscores in __typeof__. This is undesirable in
-% some manuals, especially if they don't have long identifiers in
-% general. @allowcodebreaks provides a way to control this.
+% each of the four underscores in __typeof__. This is bad.
+% @allowcodebreaks provides a document-level way to turn breaking at -
+% and _ on and off.
%
\newif\ifallowcodebreaks \allowcodebreakstrue
% ..., but we might end up with active ones in the argument if
% we're called from @code, as @code{@value{foo-bar_}}, though.
% So \let them to their normal equivalents.
- \let-\realdash \let_\normalunderscore
+ \let-\normaldash \let_\normalunderscore
}
}
\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,
@gdef@otherbackslash{@let\=@realbackslash}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'.
-%
-@def@normalturnoffactive{%
- @let"=@normaldoublequote
- @let$=@normaldollar %$ font-lock fix
- @let+=@normalplus
- @let<=@normalless
- @let>=@normalgreater
- @let\=@normalbackslash
- @let^=@normalcaret
- @let_=@normalunderscore
- @let|=@normalverticalbar
- @let~=@normaltilde
- @markupsetuplqdefault
- @markupsetuprqdefault
- @unsepspaces
+% the literal character `\'. Also revert - to its normal character, in
+% case the active - from code has slipped in.
+%
+{@catcode`- = @active
+ @gdef@normalturnoffactive{%
+ @let-=@normaldash
+ @let"=@normaldoublequote
+ @let$=@normaldollar %$ font-lock fix
+ @let+=@normalplus
+ @let<=@normalless
+ @let>=@normalgreater
+ @let\=@normalbackslash
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let~=@normaltilde
+ @markupsetuplqdefault
+ @markupsetuprqdefault
+ @unsepspaces
+ }
}
% Make _ and + \other characters, temporarily.
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
@end lisp
@noindent
-See the documentation for the variable
-@code{tramp-default-user-alist} for more details.
+See the documentation for the variable @code{tramp-default-user-alist}
+for more details.
One trap to fall in must be known. If @value{tramp} finds a default
user, this user will be passed always to the connection command as
because @samp{/:} is the prefix for quoted file names.
@end ifset
+@vindex tramp-default-host-alist
+Like with methods and users, you can also specify different default
+hosts for certain method/user combinations via the variable
+@code{tramp-default-host-alist}. Usually, this isn't necessary,
+because @code{tramp-default-host} should be sufficient. For some
+methods, like @code{adb}, that default value must be overwritten,
+which is already the initial value of @code{tramp-default-host-alist}.
+
+@noindent
+See the documentation for the variable @code{tramp-default-host-alist}
+for more details.
+
@node Multi-hops
@section Connecting to a remote host using multiple hops
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,
by adding @file{#<port>} to the host name, like in @file{@trampfn{ssh,
daniel, melancholia#42, .emacs}}.
+Note that @value{tramp} supports only filenames encoded in unibyte.
+
@node Alternative Syntax
@section URL-like filename syntax
@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: <2013-02-12 09:05:54 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
- org-agenda.el ob-R.el ob.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-faces.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
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
Agustín Martín: changed ispell.el flyspell.el fixit.texi
Aki Vehtari: changed bibtex.el gnus-art.el gnus-score.el gnus-sum.el
nnmail.el tar-mode.el
-Akinori Musha: changed Makefile.in ruby-mode.el
+Akinori Musha: changed ruby-mode.el
Alakazam Petrofsky: changed hanoi.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
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
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
- coding.c process.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 625 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
Andrew Schein: changed sql.el
-Andrew W. Nosenko: changed tramp.el
-
Andrew Zhilin: changed emacs22.png emacs22.ico
Andrey Slusar: changed gnus-async.el gnus.el
Andrey Zhdanov: changed gud.el
-Andrzej Lichnerowicz: wrote ob-io.el ob-scala.el
-
Andy Moreton: changed 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 hash.texi mule.texi startup.el
- time-date.el
+Ari Roponen: changed atimer.c doc.c mule.texi startup.el time-date.el
Arisawa Akihiro: changed characters.el coding.c epa-file.el japan-util.el
language/tibetan.el message.el mm-decode.el mm-view.el ps-print.el
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-mobile.el org-colview.el org-compat.el org-odt.el
- org-archive.el org-ascii.el org-faces.el org-id.el org-pcomplete.el
- org-export-latex.el and 85 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 windows.texi and 939 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 emacs.c image.c Makefile.in cygw32.h
- 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 771 other files
+ keyboard.c byte-opt.el info.el and 770 other files
Dave Pearson: wrote 5x5.el quickurl.el
David A. Capello: changed etags.c
-David Abrahams: changed gnus-int.el gnus-sum.el 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 64 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 14 other files
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 118 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 sed1v2.inp config.bat 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
frames.texi ibuf-ext.el ispell.el ldap.el make-dist tramp.texi
window.el
+Éric Jacoboni: changed fr-refcard.tex
+
Eric Knauel: changed gnus.el spam-report.el spam.el
Eric M. Ludlam: wrote analyze.el analyze/complete.el analyze/debug.el
srt.el symref.el symref/grep.el system.el tag-file.el tag-ls.el
tag-write.el tag.el test.el
and co-wrote db-ebrowse.el srecode/cpp.el util-modes.el
-and changed ede.texi info.el rmail.el speedbspec.el cedet.el 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 29 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 imenu.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
gnus.png gnus.svg macterm.c splash.png splash.svg splash8.xpm w32term.c
xdisp.c xterm.c
-Francesco Pizzolante: changed org-clock.el org-macs.el
-
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
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
+ 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 makefile.w32-in
- appt.el bytecomp.el cal-hebrew.el make-dist holidays.el fortran.el
- ack.texi calendar.texi cal-tex.el simple.el sed1v2.inp
- and 1360 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
Gwern Branwen: changed browse-url.el
-Gábor Vida: changed gnus-demon.el auth-source.el ido.el
-
Göran Uddeborg: changed isc4-1.h
Hallvard B. Furuseth: co-wrote byte-opt.el byte-run.el bytecomp.el
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
+İsmail Dönmez: changed nsfont.m nsterm.m url-auth.el xterm.c
+
Istvan Marko: changed gnus-agent.el xfns.c
Itai Zukerman: changed mm-decode.el
-Ivan Andrus: changed 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
and changed w32fns.c w32term.c w32font.c makefile.w32-in w32menu.c
w32-win.el w32term.h w32.c w32uniscribe.c w32-fns.el makefile.nt
w32console.c w32bdf.c configure.bat keyboard.c w32proc.c w32select.c
- font.c image.c w32font.h w32gui.h and 161 other files
+ 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
John J Foerch: changed display.texi erc-stamp.el org.el
progmodes/compile.el
-John K. Luebs: changed org.el
-
John Mongan: changed progmodes/f90.el
John Paul Wallington: changed ibuffer.el ibuf-ext.el subr.el help-fns.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 keyboard.c windmove.el window.el
- xdisp.c
+Jérémy Compostella: changed battery.el windmove.el window.el
-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 79 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
-Lewis Perin: changed emacs-x86.manifest
+Lewis Perin: changed emacs.manifest
Liam Healy: changed outline.el
-Liam Stitt: changed url-file.el url-vars.el
-
Liang Wang: changed etags.el
Litvinov Sergey: changed ob-maxima.el ob-octave.el
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
+Łukasz Demianiuk: changed erc.el
+
+Łukasz Stelmach: changed cookie1.el message.el org-agenda.el org-bbdb.el
+ org-exp.el org-html.el org.el
+
Lute Kamstra: changed modes.texi emacs-lisp/debug.el generic-x.el
generic.el font-lock.el simple.el subr.el Makefile.in battery.el
debugging.texi easy-mmode.el elisp.texi emacs-lisp/generic.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 Lambert: changed process.c process.h
-Mark Lillibridge: changed rmail.el mail-utils.el mail/rmailmm.el
- unrmail.el
+Mark Lillibridge: changed rmail.el mail-utils.el unrmail.el
Mark Mitchell: changed font-lock.el
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
-
-Matt Fidler: changed package.el
+Mats Lidell: changed TUTORIAL.sv european.el gnus-art.el
Matt Hodges: changed textmodes/table.el faces.el iswitchb.el simple.el
tmm.el cal-menu.el calendar.el calendar.texi diary-lib.el easymenu.el
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 82 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 Downes: changed gnus-sum.el
-Michael Gauland: changed org-src.el
-
Michael Gschwind: wrote iso-cvt.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-agenda.el org-timer.el
-
Murata Shuuichirou: changed coding.c
-Myles English: changed org-clock.el
-
N. Raghavendra: changed timezone.el
Nachum Dershowitz: co-wrote cal-hebrew.el
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 emacsclient.c vc-bzr.el
+
P. E. Jareth Hein: changed gnus-util.el
Pascal Dupuis: changed octave-inf.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 eval.c buffer.c xfns.c xfaces.c
- and 712 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
Raffael Mancini: changed misc.el
-Rainer Orth: changed Makefile.in gtkutil.c
+Rainer Orth: changed Makefile.in
Rainer Schoepf: wrote alpha.h unexalpha.c
and changed osf1.h alloc.c buffer.c callint.c data.c dispextern.h doc.c
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 emacs.py progmodes/python.el TUTORIAL.pl
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 1092 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
+ font-lock.el loading.texi maps.texi mark.texi message.texi mini.texi
+ minibuf.texi misc.texi programs.texi subr.el tips.texi url-vars.el
+ url.texi vc-git.el window.c windows.texi
+
Stephan Stahl: changed which-func.el buff-menu.el buffer.c dired-x.texi
ediff-mult.el
Stephen 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
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
-and changed org-agenda.el
Tom Breton: changed autoinsert.el cus-edit.el gnus-agent.el lread.c
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
+
Viktor Rosenfeld: changed ob-sql.el
Ville Skyttä: changed mh-comp.el pgg.el tcl.el
easymenu.el loading.texi menu-bar.el misc.texi progmodes/compile.el
ps-print-def.el ps-print.ps ps-vars.el
-Vitalie Spinu: changed comint.el ob-R.el
+Vitalie Spinu: changed ob-R.el
Vivek Dasmohapatra: wrote hfy-cmap.el htmlfontify.el
-and changed erc.el erc-backend.el erc-services.el hexl.el emacs.c
- erc-join.el htmlfontify.texi sh-script.el xterm.c xterm.h
+and changed erc.el erc-backend.el emacs.c erc-join.el erc-services.el
+ sh-script.el xterm.c xterm.h
Vladimir Alexiev: changed arc-mode.el nnvirtual.el tmm.el
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 functions.texi gnus-picon.el gnus-start.el
- gnus-sum.el gnus.texi intro.texi lread.c network-stream.el nntp.el
- pcvs.el pop3.el progmodes/grep.el syntax.texi variables.texi
+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 w32term.c emacs.c darwin.h dispnew.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
Zoran Milojevic: changed avoid.el
-Ævar Arnfjörð Bjarmason: changed rcirc.el
-
-Éric Jacoboni: changed fr-refcard.tex
-
-Óscar Fuentes: changed ido.el cmdproxy.c diff-mode.el emacsclient.c
- vc-bzr.el
-
-İsmail Dönmez: changed nsfont.m nsterm.m url-auth.el xterm.c
-
-Łukasz Demianiuk: changed erc.el
-
-Łukasz Stelmach: changed cookie1.el message.el org-agenda.el org-bbdb.el
- org-exp.el org-html.el org.el
-
-Štěpán Němec: changed INSTALL calc-ext.el cl.texi comint.el edebug.texi
- font-lock.el loading.texi maps.texi mark.texi message.texi mini.texi
- minibuf.texi misc.texi programs.texi subr.el tips.texi url-vars.el
- url.texi vc-git.el window.c windows.texi
-
Йордан Миладинов: changed quail/cyrillic.el
Local Variables:
--- /dev/null
+Copyright (C) 2001-2013 Free Software Foundation, Inc.
+See the end of the file for license conditions.
+
+Calc is an advanced desk calculator for GNU Emacs.
+
+Originally written by:
+ Dave Gillespie
+ c/o Synaptics, Inc.
+ 2698 Orchard Parkway
+ San Jose CA 95134
+ daveg@synaptics.com, uunet!synaptx!daveg
+
+Currently maintained by:
+ Jay Belanger <jay.p.belanger@gmail.com>
+
+I am anxious to hear about your experiences using Calc. Send mail to
+"jay.p.belanger@gmail.com". A bug report is most useful if you include the
+exact input and output that occurred, any modes in effect (such as the
+current precision), and so on. If you find Calc is difficult to operate
+in any way, or if you have other suggestions, don't hesitate to let me
+know. If you find errors (including simple typos) in the manual, let me
+know. Even if you find no bugs at all I would love to hear your opinions.
+
+
+Summary of changes to "Calc"
+------- -- ------- -- ----
+
+For changes in Emacs 23.1 and later, see the main Emacs NEWS file.
+
+* Version 2.1:
+
+** New matrix mode for square matrices. Improved handling of
+ non-commutative products.
+
+** New functions: powerexpand and ldiv.
+
+** Added new functions: sec, csc, cot, sech, csch, coth.
+
+** 0^0 now evaluates to 1.
+
+** Added a new language mode for LaTeX.
+
+** Calc now tries to use an appropriate language mode in embedded mode.
+
+** Calc now restores original modes when leaving embedded mode.
+
+** User settable variables which are not set with keystrokes are now
+ customizable.
+
+** Made ~/.calc.el the default Calc settings file.
+
+** Miscellaneous updates and bugfixes.
+
+\f
+* Version 2.02f:
+
+** Fixed a bug which broke `I', `H', `K' prefix keys in recent Emacs.
+
+** Fixed a bug in calc.texinfo which prevented "make tex2" from working.
+
+** Updated `C-y' (calc-yank) to understand Emacs 19 generalized kill ring.
+
+** Added a copy of "calccard.tex", the Calc quick reference card.
+
+\f
+* Version 2.02e:
+
+** Fixed an installation bug caused by recent changes to `write-region'.
+
+\f
+* Version 2.02d:
+
+** Fixed a minor installation problem with a Emacs 19.29 byte-compiler bug.
+
+** Removed archaic "macedit" package (superseded by "edmacro").
+
+\f
+* Version 2.02c:
+
+** Patch to port Calc to Lucid Emacs 19; still works with GNU 18 and GNU 19.
+
+** Fixed a bug that broke `C-x C-c' after Calc graphics had been used.
+
+\f
+* Version 2.02b:
+
+** Minor patch to port Calc to GNU Emacs 19. Will be superseded by Calc 3.00.
+
+\f
+* Version 2.02:
+
+** Revamped the manual a bit; rearranged some sections.
+
+** Added marginal notes for Key/Function Index refs in printed manual.
+
+** Changed `M-# r' to deal more gracefully with blank lines.
+
+** Made reductions like `V R +' and `M-# :' considerably faster.
+
+** Improved parsing and display of cases like "[a + b]".
+
+** Added `t +' and `t -' for doing business date arithmetic.
+
+** Added "syntax tables," the opposite of compositions.
+
+** Added another Rewrites Tutorial exercise.
+
+** Added the "vmatches" function.
+
+** Added the `Modes' variable and `m g' command.
+
+** Improved `u s' to cancel, e.g., "11 mph hr / yd" to get a number.
+
+** Added "quick units" commands "u 0" through "u 9".
+
+** Moved `M-%' to calc.el to avoid autoloading problems.
+
+** Added `M-=' during algebraic entry, acts like `RET ='.
+
+** Made `LFD' prevent evaluation when finishing a calc-edit command.
+
+** Changed calc-store commands to use `t .' mode for trail display.
+
+** Improved integrator to understand forms involving "erf".
+
+** Fixed parser to make sense of "[1....1e2]" input.
+
+** Fixed FORTRAN parser to treat a(i,j) as a_i_j if a is declared matrix.
+
+** Got rid of some version number stamps to reduce size of patches.
+
+** Fixed a bug in defmath treating "<=" and ">=" predicates.
+
+** Fixed a bug in which Calc crashed multiplying two date forms.
+
+** Fixed a bug in line breaker that crashed for large, nested formulas.
+
+** Fixed a bug using ` to edit string("foo").
+
+** Fixed a bug where `M-# y' in Big mode copied stack level number.
+
+** Fixed a bug where `g O' used wrong default directory, no completion.
+
+** Fixed a bug where "foo_bar(i)" parsed in C mode but showed as foo#bar.
+
+** Fixed several bugs where large calculations got "computation too long."
+
+\f
+* Version 2.01:
+
+** Added percentage commands `M-%', `b %', and `c %'.
+
+** Changed Big mode to force radix-10 in superscripts.
+
+** Improved display of fractions in various language modes.
+
+** Changed `a n' to work properly with equations and inequalities.
+
+** The problem with cross references to Index nodes in TeX has been fixed.
+
+** Fixed a bug where recursive esc-maps make calc-ext/-aent unloadable.
+
+** Fixed a bug in `M-# k', then `OFF' right away, with fresh Emacs.
+
+** Fixed a bug in which "S_i_j" was formatted wrong after `j s'.
+
+** Fixed a bug in which `h k u c' positioned cursor on wrong line.
+
+** Fixed a bug where `z ?' crashed if `z %' was defined.
+
+** Fixed a bug in `j O' (calc-select-once-maybe).
+
+** Fixed "make private" not to ask "Delete excess versions" and crash.
+
+\f
+* Version 2.00:
+
+** First complete posting of Calc since 1.01.
+
+** Most parts of Calc have seen changes since version 1.07. See
+ section "New for Calc 2.00" in the manual for a summary.
+
+** Changed to compile calc-macs/-maint, to allow "cp *.elc new-dir".
+
+** Improved calc-describe-bindings to avoid showing redundant ESC maps.
+
+\f
+* Version 2.00 beta 3:
+
+** Removed version numbers from most .el files to reduce size of patches.
+
+** Added a "calc-version" command.
+
+** Changed `M-# ? ?' to allow for modified describe-function.
+
+** Changed date parser to accept "Sept" as an alternative for "Sep".
+
+** Inhibited answers to exercise from showing up in table of contents.
+
+** Changed Makefile to say "texindex calc.[cfkptv]?" to avoid "calc.el".
+
+** Fixed up the Makefile in various other ways.
+
+** Rearranged banner at top of `h h' command's output.
+
+** Changed "make summary" to print "Calc Summary" on the title page.
+
+** Added "IntegSimpRules".
+
+** Added `M-# :', `M-# _', and `M-# Z' options.
+
+** Changed `^' to evaluate "[-3..-1]^-2" properly.
+
+** Improved `f g' to give symbolic answers for, e.g., 101:2 and -3:2.
+
+** Fixed a bug where `h k RET' didn't find the right place on the page.
+
+** Fixed a bug that formatted "x*(y ? a : b)" as "x y ? a : b".
+
+** Fixed a bug where defmath translated (< x 0) as (math-posp x)!
+
+** Fixed a bug that prevented quick-calc from working sometimes.
+
+** Fixed the `z ?' bug again (maybe this time for good?).
+
+** Fixed a bug in which `V ^' (vint) was just plain wrong, wrong, wrong!
+
+** Scanned for and fixed remaining bugs relating to autoloading.
+
+\f
+* Version 2.00 beta 2:
+
+** Changed "make info" to try "make texinfo" if "makeinfo" not found.
+
+** Changed to "New for Calc 2.00"; texinfo.tex chokes on apostrophes.
+
+** Added List Tutorial Exercise 14 (just in case there weren't enough!).
+
+** Added a discussion of the `Z F' command to the Programming Tutorial.
+
+** Improved `H a f' not to lose info if input is partially pre-factored.
+
+** Improved simplification of expressions like sqrt(3) + 3^3:2.
+
+** Changed Big mode to omit "*" in expressions like 2 sqrt(3) 5^3:4.
+
+** Replaced European date format D/M/Y with D.M.Y.
+
+** Changed `a N' and `a X' to consider the endpoints of the interval.
+
+** Fixed a bug where TeX mode made c*(1+a/b) look like a function call.
+
+** Fixed a bug formatting top-level evalto's while using selections.
+
+** Fixed a bug that caused `z ?' to crash.
+
+** Fixed a bug where `Z F' broke for argument names "t" and "nil".
+
+** Fixed several bugs relating to autoloading.
+
+\f
+* Version 2.00 beta 1:
+
+** Added "What's new in Calc 2.00" to the manual (summary of info below).
+
+** Added support for many GNUPLOT 3.0 features.
+
+** Tweaked the Makefile and calc-compile a bit more.
+
+** Modified to work with Zawinski's/Furuseth's optimizing byte compiler.
+
+** Modified Calc to garbage-collect less often (raised gc-cons-threshold).
+
+** Changed quick-calc to avoid autoloading so many parts of Calc.
+
+** Changed Calc subfiles to work properly if not byte-compiled.
+
+** Renamed `M-# s' to `M-# j', made `M-# s' be equivalent to `h s'.
+
+** Changed calc-quit to avoid reapportioning space among other windows.
+
+** Added `M-DEL' (calc-pop-above) key, to DEL as LFD is to RET.
+
+** Added `{' and `}' to scroll vertically, analogous to `<' and `>'.
+
+** Added `m t' for "total" algebraic mode.
+
+** Added `d , \' option to group digits with "\,".
+
+** Improved support of "prime" accent in "eqn" language mode.
+
+** Changed macedit's read-kbd-macro to accept a string argument in Lisp.
+
+** Changed calc-check-defines to use a more concise run-hooks linkage.
+
+** Changed auto-why mode not to say [w=more] if next msg is not urgent.
+
+** Made `a d' able to differentiate "a?b:c" and "a_i" formulas.
+
+** Changed probability dist. functions to work with `a f' and `a d'.
+
+** Added special constants "phi" and "gamma".
+
+** Added "poly" function, simpler cousin of "gpoly".
+
+** Added "pdeg", "plead", "pcont", "pprim"; cleaned up "pdiv" and "pgcd".
+
+** Added `a p' command for polynomial interpolation.
+
+** Added `a I' command for numerical integration; made IntegLimit variable.
+
+** Added `a f' to factor polynomials; moved old `a f' to `a "'.
+
+** Added `a a' to do partial fraction decompositions.
+
+** Improved `a i' to integrate many more kinds of formulas.
+
+** Modified `a P' to find numerical roots of high-degree polynomials.
+
+** Modified `c 0' through `c 9' to convert int-valued floats to integers.
+
+** Made sinh, arctanh, etc., expandable into exps/logs by `a f'.
+
+** Added more algebraic simplifications having to do with logs and exps.
+
+** Changed `s s', `s t', `s x', `s l' to accept an equation at prompt.
+
+** Changed `s i' not to store Decls if its value is the default, [].
+
+** Changed `s i' to store in `d O' language mode if in Normal or Big mode.
+
+** Rearranged `V M'/`V R' matrix mapping modes.
+
+** Added <#1+#2> notation for lambda expressions.
+
+** Extended `b l' and other binary shifts to have a 2-argument version.
+
+** Changed `u c' and `u t' to give unitless result for unitless input.
+
+** Changed sqrt(1-cos(x)^2)-to-sin(x) to be an unsafe simplification.
+
+** Improved simplification of sqrts, e.g., sqrt(a^2 x + a^2 y).
+
+** Changed solver to treat (x-a)(x-b)(x-c) more intelligently.
+
+** Changed Pascal language mode to use "$FFFF" for hexadecimal numbers.
+
+** Added support for non-decimal display of floats.
+
+** Changed `p' to refresh stack display if current float format uses it.
+
+** Changed Big mode to use subscript notation for log10(x), log(x,b), r#nnn.
+
+** Changed Big mode to format deriv(u,x) and tderiv(u,x) as du/dx.
+
+** Changed Big mode to format integ(1/x,x) as "dx/x" instead of "1/x dx".
+
+** Added "tty" output type for graphics commands.
+
+** Documented Calc's random number generation algorithm in the manual.
+
+** Fixed a bug involving having "(setq calc-timing t)" in .emacs.
+
+** Fixed a bug that incorrectly parsed "|x| - 1" in TeX mode.
+
+** Fixed bugs and made improvements in `a R' when widening the guess.
+
+** Fixed a bug that where `a S' didn't solve (x - a)^2 = (x - b)^2.
+
+** Fixed a bug that sometimes crashed `a P' on systems of equations.
+
+** Fixed a bug that prevented `b p' (calc-pack-bits) from working.
+
+** Fixed some bugs in which certain functions didn't get autoloaded.
+
+** Fixed a bug in which the date <1/1/13> was incorrectly parsed.
+
+** Fixed a bug which prevented `j D' from expanding (a+b)/c.
+
+** Fixed a bug in solver: bad inverses for sinh and cosh.
+
+** Fixed a bug in math-possible-signs that failed for x*0.
+
+** Fixed a bug where sqrt(-a) was rewritten sqrt(a)*i even if a<0.
+
+** Fixed a bug in line breaker when first "word" of line was too long.
+
+** Worked around a makeinfo bug that handled @end group/@group badly.
+
+\f
+* Version 2.00 alpha 3:
+
+** Changed logic for locating component .elc files to be even smarter.
+
+** Changed "make install" to "make compile"; added different "make install".
+
+** Improved "make compile" to check file dates and compile only when needed.
+
+** Made output of "make compile" in batch mode more compact and readable.
+
+** Replaced "Quick Overview" in manual with "Demonstration of Calc".
+
+** Changed to use keymaps for dispatching M-# and h prefix keys.
+
+** Added TAGS target to the Calc Makefile.
+
+** Removed most doc strings from functions; new help commands are better.
+
+** Got rid of some crufty "fset" calls that were cluttering the code.
+
+** Split calc-grab-region into two functions, calc-grab-region/-rectangle.
+
+** Swapped positions of stack and trail in full-calc-keypad display.
+
+** Improved line-breaking algorithm for displaying long formulas.
+
+** Improved display of control characters in vectors shown as strings.
+
+** Changed `d o' to allow fraction format to specify desired denominator.
+
+** Changed `M-# y' to respect overwrite mode in target buffer.
+
+** Added `H' prefix to display-mode commands to suppress stack refresh.
+
+** Changed "calc-why" mechanism to display urgent messages automatically.
+
+** Handled taking derivatives of symbolic integrals and vice-versa.
+
+** Handled integrating vectors of formulas.
+
+** Incorporated Ewerlid's polynomial division and GCD functions into Calc.
+
+** Improved algebraic operations on "mod" forms, esp. polynomials.
+
+** Added some more financial functions (sln, syd, ddb).
+
+** Added nest, anest, fixp, and afixp (`H V R' and `H V U') functions.
+
+** Added `a .' (calc-remove-equal) command to take apart equations.
+
+** Generalized dfact to work for negative odd integers; added !! syntax.
+
+** Changed `k f' to factor 1, 0, and negative integers.
+
+** Changed `u M', etc., to accept +/- and [ .. ] forms as distributions.
+
+** Changed `g q' to remove *Gnuplot Commands/Trail* window if present.
+
+** Added support for Francois Pinard's "dumb terminal" driver for GNUPLOT.
+
+** Added ":: remember" feature for rewrite rules.
+
+** Changed rewrites to let pattern "a*b" match "x/2" with a=x, b=1/2.
+
+** Added ability to put function names like "simplify" in rewrite schedule.
+
+** Added "Rewrites Tutorial" to the manual.
+
+** Changed ` to bind RET as newline instead of finish if editing a vector.
+
+** Added some new exercises to the List Tutorial.
+
+** Changed `Z F', `V M', etc. not to remove stored vars from def arg list.
+
+** Added parsing for /1, 2, 3/ notation for Fortran mode vectors.
+
+** Added a "%%" syntax for comments in formulas being read.
+
+** Fixed a bug in which failing `h k' removed an existing Info window.
+
+** Fixed a bug in `j /' operating on subformulas like "a + b".
+
+** Fixed a bug in which "inf = inf" undesirably evaluated to 1.
+
+** Fixed a bug that simplified "0 = 1 + a + 2" to "0 = a".
+
+** Fixed a bug that failed for rewrite patterns like "fib(1 ||| 2)".
+
+** Fixed a bug that arose because rewrite programs are non-reentrant.
+
+\f
+* Version 2.00 alpha 2:
+
+** Changed LFD terminating algebraic entry to push in no-simplify mode.
+
+** Changed so that `K -' interprets `-' as calc-minus, not neg prefix arg.
+
+** Improved `h c' command to understand all Calc key sequences.
+
+** Fixed problems with DistribRules, NegateRules, and FitRules.
+
+** Fixed several bad node pointers in the manual.
+
+** Fixed a bug in `h C-w' when used with makeinfo-formatted manuals.
+
+** Fixed a bug in sqrt(-1) when Polar and HMS modes are enabled.
+
+** Fixed/improved dscalar and deven functions; added dodd.
+
+** Fixed a bug in polynomial handling that also affected sum(sin(k),k,1,n).
+
+** Fixed various other glitches in the manual.
+
+\f
+* Version 2.00 alpha 1:
+
+** Calc's tar file now creates a calc-(version) directory to unpack into.
+
+** Calc now comes with a Makefile; install with "make install".
+
+** Calc now comes already split into many files; installation is much simpler.
+
+** Changed base file name of the manual from "calc-info" to "calc.info".
+
+** Key binding for `M-# w' was documented but not implemented.
+
+** Bound M-# ' to be synonymous with `M-# f' (used to be `M-# q').
+
+** Changed M-# M-# to use last interface of C or K; E no longer counts.
+
+** Changed `i' (and `M-# i') not to return to Top node unnecessarily.
+
+** Changed `h' to be a prefix key with various help commands.
+
+** Changed `s' to be a prefix key with various store and recall commands.
+
+** Keys `i', `r', and `l' are obsolete (moved to `h' and `s' prefixes).
+
+** Rearranged `K', `X', and `M-RET' keys; `K' is now calc-keep-args.
+
+** Changed quick-calc to display input formula as well as output if room.
+
+** Changed quick-calc to interact with the editing buffer and kill ring.
+
+** Created pack, unpack, unpackt function equivalents of `v p', `v u'.
+
+** Changed to expand (a/b)^x to a^x/b^x only if b > 0 (not if a > 0).
+
+** Changed math-possible-signs to understand sqrt function.
+
+** Changed Z [, rewrites to consider any provably non-zero value as true.
+
+** Changed normal language modes to accept ** as a synonym for ^.
+
+** Added "maple" language mode.
+
+** Changed, e.g., Mathematica "(2 + 3 I)^(1.23*10^20)" to include parens.
+
+** Generalized math-compose-big properties for all language modes.
+
+** Introduced "string" and other function for composing expressions.
+
+** Changed many recursive vector routines to use loops instead.
+
+** Added evalv, evalvn function equivalents to `=', `N'.
+
+** Changed "expr =>" not to evaluate at all if in no-simplify mode.
+
+** Redesigned user interface of `a F' (calc-curve-fit) command.
+
+** Added "phase" feature to the rewrite rule system.
+
+** Added "&&&", "|||", "!!!" to the rewrite rule system.
+
+** Introduced a new notation for rewrites: LHS := RHS :: COND.
+
+** Changed `a r' (but not `j r') to repeat 100 times by default.
+
+** Integrated EvalRules more cleanly into the default simplifications.
+
+** Added `H v l' [mdims] to measure the dimensions of a matrix.
+
+** Changed `u c' to interpret "/units" as "1/units".
+
+** Added `u a' to adjust unit prefix letters automatically.
+
+** Changed `u s' to enable scalar mode while simplifying.
+
+** Changed `c f' [pfloat] not to float integer powers or subscripts.
+
+** Added a three-argument form for the "hms" function.
+
+** Changed, e.g., sin(90) degrees to produce 1 instead of 1.0.
+
+** Changed symbolic mode to prefer sqrt(int): abs([1 2 3]) => sqrt(14).
+
+** Enhanced solver to handle, e.g., x + 1/x = a; exp(x) + exp(-x) = a.
+
+** Enhanced simplifier to handle, e.g., exp(a+2) / e^a => e^2.
+
+** Enhanced `a s' to simplify sqrt(x) - x^1:2 and exp(x) - e^x to 0.
+
+** Added -(a + b) to -a - b as a default simplification.
+
+** Added rules for differentiating sum() and prod() functions.
+
+** Added a few more energy units (due to Przemek Klosowski).
+
+** Added overflow/underflow checking for all floating-point arithmetic.
+
+** Extended error forms to work with complex numbers.
+
+** Generalized GCD to handle fractional arguments.
+
+** Changed graphics routines to evaluate "x" values, e.g., [-pi .. pi].
+
+** Added `g q', like `g K' but without viewing the Gnuplot Trail.
+
+** Changed `g p' and `V M' to display better "Working..." messages.
+
+** Modified `M-# g' to be more robust about grabbing formulas.
+
+** Added `Y' prefix key reserved for user-written extensions.
+
+** Added calc-load-hook and calc-ext-load-hook.
+
+** Prevented calc-install from leaving large ~ files behind.
+
+** Changed @bullet to @bullet{} in manual to conform to texinfo spec.
+
+** Rearranged some chapters in the manual to be a bit more logical.
+
+** Added calc-split-summary command.
+
+** Fixed several bugs in embedded mode.
+
+** Fixed a bug in calc-vector-covariance that required a prefix arg.
+
+** Fixed a bug that prevented parsing "a=>" with no right-hand side.
+
+** Fixed a bug which allowed incorrectly dividing a vector by a vector.
+
+** Fixed a bug formatting sum(...)^2 in Big mode.
+
+** Fixed a bug that prevented Calc from deleting old graphics temp files.
+
+** Fixed some typos calling calc-inverse-func instead of calc-invert-func.
+
+** Fixed bugs in the derivatives of conj, deg, and rad; added re, im.
+
+** Fixed a bug where (r;theta) parsed as r exp(theta i) even in Deg mode.
+
+** Fixed a bug which gave wrong answer for exp of a polar complex number.
+
+** Fixed a bug in `Z F' that failed if formula used non-arg variables.
+
+** Fixed a bad pointer to Info node "Assignments in Embedded Mode".
+
+** Fixed several errors in the Calc Summary.
+
+\f
+* Version 1.08 beta 1:
+
+** Calc's copyright has been assigned to FSF, for inclusion in Emacs 19!
+
+** Changed M-# to be a two-key sequence; use M-# M-# to start Calc now.
+
+** Rewrote and expanded the introductory chapter of the manual.
+
+** Added a key and function summary to the manual.
+
+** Changed the manual to take better advantage of TeX's math formatting.
+
+** Changed manual to be printable in @smallbook format.
+
+** Added "calc-embedded" mode.
+
+** Added "=>" [evalto] operator.
+
+** Added facilities for date and date/time arithmetic.
+
+** Added a set of financial functions (pv, fv, etc.).
+
+** Added infinite quantities inf, uinf, and nan (plus infinite intervals).
+
+** Added "EvalRules", "SimpRules", and "ExtSimpRules" variables.
+
+** Added sum and product commands `a +', `a -', `a *', `a T'.
+
+** Enhanced `a S' and `a P' to solve systems of equations.
+
+** Enhanced solver to handle eqns like sin(x) = cos(2 x), sqrt(x) + x = 1.
+
+** Added `a M' (calc-map-equation) command.
+
+** Added new statistical functions: mean, standard deviation, etc.
+
+** Added line, polynomial, and curve fitting commands (`a L' and `a F').
+
+** Added support for composite units, e.g., "mi+ft+in".
+
+** Enhanced "Big" mode to format square roots, choose, and powers better.
+
+** Enhanced "Big" mode to display fractions in large notation.
+
+** Added several alternate formats for matrix display.
+
+** Changed TeX mode to write "(1 + x^2)" instead of "\left(1 + x^2\right)".
+
+** Added support for relational operators in TeX and FORTRAN modes.
+
+** Added recognition of accents like \dot, \tilde, \underline in TeX mode.
+
+** Added "eqn" language mode.
+
+** Added extra control over display justification with `d <', `d =', `d >'.
+
+** Added calc-left-label and calc-right-label (`d {', `d }').
+
+** Added "nn%" syntax for algebraic formulas; equivalent to "nn * .01".
+
+** Added input syntaxes like a = b = c, a != b != c, a <= b < c.
+
+** Changed "_" to mean subscripts; old use of "_" in vars is now "#".
+
+** Introduced "matrix mode" and "scalar mode" (`m v').
+
+** Introduced generic identity matrices (idn(1)).
+
+** Added a method for declaring variables to be real, integer, > 0, etc.
+
+** Added `Z S' command for editing stored value of a variable.
+
+** Added "subst" algebraic function equivalent to the `a b' command.
+
+** Added `a f' command, changed deriv/integ/solve-for to use it.
+
+** Improved `a s' to simplify (x + y) (y + x) to (x + y)^2.
+
+** Improved `a s' to simplify i^2 to -1.
+
+** Improved `a s' to simplify, e.g., sin(pi/3) in Symbolic mode.
+
+** Improved `a s' to simplify sqrt(8) to 2 sqrt(2), 1/sqrt(2) to sqrt(2)/2.
+
+** Moved sin(arccos(x)) from `a e' to `a s'; not unsafe after all!
+
+** Changed (x y)^z => x^z y^z to be a usually-unsafe simplification.
+
+** Added thorough documentation of `a s' and `a e' to the manual.
+
+** Improved `a c' to collect "f(a)" even if "a" also appears elsewhere.
+
+** Introduced lin, linnt, islin, islinnt functions for linearity testing.
+
+** Improved `a x' to use binomial theorem to give simpler answers.
+
+** Improved `j D' to distribute powers of sums: (a + b)^n.
+
+** Improved `j M' to merge products of powers (may need no-simplify mode).
+
+** Changed to use defvar for DistribRules etc. so `Z V' works with them.
+
+** Improved `j *' and `j /' to work properly in a few more cases.
+
+** Improved `V R' to use identity value when reducing empty vectors.
+
+** Improved `v p' and `v u' to support more complex packing operations.
+
+** Disabled automatic simplification of sqrt(2)/2 to 1/sqrt(2).
+
+** Bound SPC and RET to press, TAB to next-menu in *Calc Keypad* buffer.
+
+** Added C-u ' to do algebraic entry with language mode forced to normal.
+
+** Added "$1", "$2", etc. input notation for algebraic entry.
+
+** Changed unary operators like `n', `&' to treat neg prefix args like RET.
+
+** Changed ` (calc-edit) to show full precision regardless of float format.
+
+** Enhanced quick-calc to display integers in several formats.
+
+** Documented `g H' (calc-graph-hide) command (had been left from manual).
+
+** Enhanced floor/ceil/trunc/round in several ways.
+
+** Added rounde and roundu functions.
+
+** Changed `c 1' through `c 9' to change small floats to 0.0; added `c 0'.
+
+** Enhanced set operations to work on sets of intervals.
+
+** Fixed erf(0), utpn(x,x,y), and arccosh(-1) to work properly.
+
+** Changed complex arctan and arctanh to follow Steele 2nd edition.
+
+** Expanded "Branch Cuts" section of the manual with some useful tables.
+
+** Rearranged order of words in mode line to be a bit more logical.
+
+** Changed `m N' (num-simplify) mode to evaluate constant vectors, too.
+
+** Changed `a r'/`j r' to prompt twice for separate LHS/RHS if necessary.
+
+** Enhanced `let(v,x)' in rewrites by allowing arbitrary patterns for v.
+
+** Changed cursor positioning in second prompt for `a b' (calc-substitute).
+
+** Changed `y' to omit line numbers more consistently.
+
+** Changed `o' (calc-realign) to reset horizontal scrolling to zero, also.
+
+** Added "pred" mode for calc-eval.
+
+** Added "calc-report-bug" as an alias for "report-calc-bug".
+
+** Added `Z T' and "calc-pass-errors" to aid debugging Calc-related code.
+
+** Added "calc-load-everything" (`m X' or `M-# L') command.
+
+** Enhanced calc-install to pre-build units table, CommuteRules, etc.
+
+** Changed Calc to interact more gracefully with load-path.
+
+** Changed Lisp Variable Index in manual to include user variables, too.
+
+** Fixed a bug that prevented calc-install from working under VMS.
+
+** Fixed a bug that sometimes crashed rewrites dealing with subtractions.
+
+** Fixed a bug that prevented `a S' from solving "3 - x = 1 + x"!
+
+** Fixed a bug in solver that crashed for certain cubics and quartics.
+
+** Fixed a bug in calc-simplify that crashed for equations and ineqs.
+
+** Fixed a bug which placed the "[" oddly in `d B' + `v /' mode.
+
+** Fixed a bug where finishing calc-edit improperly obeyed language mode.
+
+** Fixed a bug formatting (-1)^n in Big mode after selection commands.
+
+** Fixed a bug that got ">=" and "<=" backwards in rewrite conditions.
+
+** Fixed a bug that broke the `"x"' key in calc-keypad mode.
+
+** Fixed a bug in which `MAP$' in calc-keypad didn't display "Working...".
+
+** Fixed a bug where matrix division gave bad result for singular matrix.
+
+** Fixed a bug which closed Calc window if calc-grab-region got an error.
+
+** Fixed a bug where `a s' failed on formulas containing dimension errors.
+
+** Fixed a bug that caused `m F' to hang.
+
+** Fixed a bug in complex arithmetic that caused problems with solver.
+
+** Fixed a bug which raised intervals to interval powers incorrectly.
+
+** Fixed a bug in utpp/ltpp (order of arguments did not match the manual).
+
+** Fixed a bug in which `t y' rounded yanked data with old precision.
+
+** Fixed a bug in which "in(3, [3 .. 3))" returned true.
+
+** Fixed a bug which simplified abs(abs(x)) incorrectly.
+
+** Fixed a bug in which (a^2)^1:3 was unsafely simplified to a^2:3.
+
+** Fixed a bug in rewrite system which missed pattern "2 sin(x) cos(x)".
+
+** Fixed a bug in rewrite system which missed pattern "a - a cos(x)^2".
+
+** Fixed obsolete trail tags gsmp, gneg, ginv to jsmp, jneg, jinv.
+
+** Fixed some errors and made improvements in units table [Ulrich Mueller].
+
+\f
+* Version 1.07:
+
+** Added `m F' (calc-settings-file-name) command.
+
+** Added calc-autoload-directory variable.
+
+** Extended Z ` to accept a prefix argument.
+
+** Added keystrokes (v h, v k) for head, tail, cons.
+
+** Extended `v e' to accept a vector as the filler.
+
+** Changed `V M', `V R' to accept mapping-mode keys in uppercase, too.
+
+** Changed V M ' etc. to accept $, $$, ... as argument indicators.
+
+** Changed `t y' to accept a prefix argument.
+
+** Put in a cleaner and safer random number generator for `k r' et al.
+
+** Fixed a bug which completely broke `a r' command!
+
+** Fixed "0 * matrix" to generate a zero matrix instead of 0.
+
+** Fixed a bug in `a R' which sometimes caused it to crash.
+
+** Fixed a fatal typo in the TeX version of the manual.
+
+** Fixed a bug that prevented C-k, C-w, M-w from working in Trail buffer.
+
+** Fixed another bug in `Z P' command.
+
+** Fixed a bug in `u s' which incorrectly simplified subtractions.
+
+** Fixed an argument-name aliasing bug evaluating lambda( ) formulas.
+
+** Fixed overfull hboxes in the manual.
+
+** Fixed various other bugs in the manual.
+
+\f
+* Version 1.06:
+
+** Added "calc-keypad" mode for X window system users (try it!).
+
+** Improved "calc-eval" for calling/operating Calc from user-written Lisp.
+
+** Moved vector accumulate command to `V U' (old `H V R' still supported).
+
+** Added right-to-left reductions: `I V R' and `I V U'.
+
+** Added set operations on vectors: intersect, union, diff, xor.
+
+** Added `I v s' to remove a subvector from a vector.
+
+** Introduced `H |' to append two vectors with no magical special cases.
+
+** Introduced rhead, rtail, and rcons for isolating last vector element.
+
+** Changed `g p' to keep temp files around until data actually change.
+
+** Improved `a S' to solve many higher-order polynomial equations.
+
+** Added `a P' to produce a vector of all solutions to an equation.
+
+** Enhanced `a v' and `j v' to allow top-level-only evaluation.
+
+** Changed `j DEL' to delete a side of an eqn or ineq, leaving other side.
+
+** Fixed binding for keys `j 1' through `j 9'.
+
+** Introduced "let" marker in rewrite rules.
+
+** Enhanced the "sign" function to provide a two-argument version.
+
+** Changed "max-specpdl-size exceeded" error message to be user-friendly.
+
+** Put "<Aborted>" in the trail in above case and when user presses C-g.
+
+** Changed TeX mode to generate \ldots instead of \dots, recognize both.
+
+** Changed "sin(0)" etc. (for integer 0) to generate "0" instead of "0.".
+
+** Enhanced Programming Tutorial exercise 2.
+
+** Fixed an error in the answer to Types Tutorial exercise 3.
+
+** Fixed several bugs relating to head, tail, and cons functions.
+
+** Fixed some other minor typos in the manual.
+
+** Fixed several bugs in `Z P' (calc-user-define-permanent).
+
+** Fixed several bugs that broke the `g P' command.
+
+\f
+* Version 1.05:
+
+** Created a calc-install command to ease installation.
+
+** Added lots of exercises to the Tutorial section of the manual.
+
+** Added ability to select and operate on sub-formulas.
+
+** Substantially improved the algebraic rewrite-rule system.
+
+** Added a set of graphing commands that use GNUPLOT.
+
+** Added a command (`a R') for finding numerical roots to equations.
+
+** Added several new math functions, such as erf and Bessel functions.
+
+** Added key bindings for miscellaneous commands using the "f" prefix key.
+
+** Added lots of new vector operations, many of them in the spirit of APL.
+
+** Added more control over vector display, including an abbreviated mode.
+
+** Improved keyboard macro editing; added read-kbd-macro to macedit.el.
+
+** Introduced the `m S' (calc-shift-prefix) command.
+
+** Enhanced the calc-edit command in several ways.
+
+** Made it possible to hit ` (calc-edit) during numeric/algebraic entry.
+
+** Enhanced the calc-solve-for command to handle inequalities.
+
+** Enhanced calc-simplify to handle equations and inequalities.
+
+** Taught log10 and log to look for exact integer or rational results.
+
+** Added ability to take Nth roots directly.
+
+** Added "increment" and "decrement" commands for integers and floats.
+
+** Added "full-help" command, changed "h" key to invoke it.
+
+** Added special help for Inverse and Hyperbolic prefixes.
+
+** Added an optional prefix argument to `o' (calc-realign).
+
+** Changed `t s' and `t r' to use RET as the search exit key.
+
+** Made handling of operator keys for V M, V R, etc. more regular.
+
+** Improved TeX mode; added support for \matrix format.
+
+** Added a variant of `m a' mode that only affects ( and [ keys.
+
+** Fixed "Mismatch" message for algebraic entry of semi-open intervals.
+
+** Trimmed fat from calc.el to speed loading, moved more to calc-ext.el.
+
+** Fixed a bug in which minibuffer entry rounded to out-of-date precision.
+
+** Fixed a bug which crashed Calc 1.04 under Epoch.
+
+** Fixed a bug which messed up Calc Trail's mode line, among other things.
+
+** Fixed a bug which caused trail ">" to show only when in Trail buffer.
+
+** Fixed a bug in which "calc" called "calc-grab-region" with too few args.
+
+** Fixed bugs in both implementation and documentation of calc-perm.
+
+** Fixed a bug in which calc-simplify-extended always used radians.
+
+** Fixed a bug where calc-comma failed to override "polar" mode.
+
+** Fixed a bug doing mixed arithmetic on rectangular+polar complex numbers.
+
+** Fixed several bugs in transcendental functions with complex arguments.
+
+** Fixed a bug in which `a s' simplified "x / .5" to ".5 x".
+
+** Fixed numerous other bugs in various parts of Calc.
+
+** Completed the "Hooks" section of the "Internals" chapter of the manual.
+
+\f
+* Version 1.04:
+
+** Included a copy of revision history (from README) in calc.el.
+
+** Added the "calc-split" feature to split calc-ext.el into smaller bits.
+
+** Changed calc-unpack to unpack floats and fractions, too.
+
+** Added "mant", "xpon", and "scf" functions for decomposing floats.
+
+** Fixed a bug in the "y" command with positive prefix arguments.
+
+** Rearranged binary shift/rotate command keys to be a bit more convenient.
+
+** Fixed a bug in which simplifying "(0/0) * 2" crashed with a Lisp error.
+
+** Made `H F' [ffloor] and friends faster for very large arguments.
+
+** Made calc-define-del more robust.
+
+** Handled pasting of data into the Calculator using the mouse under X.
+
+** Made overlay-arrow variables buffer-local to avoid interference.
+
+** Fixed a problem in which Calc Trail buffer got stuck after a C-x C-w.
+
+\f
+* Version 1.03:
+
+** Changed math-choose to compute n-choose-m faster when m is large.
+
+** Fixed some problems with TeX mode.
+
+** Fixed a bug that prevented `b s' from working without a prefix argument.
+
+** Added "calc-eval" function.
+
+** Improved calc-grab-region.
+
+\f
+* Version 1.02:
+
+** Fixed a bug in Tutorial: telephone pole height/distance were switched!
+
+** Fixed a few other things in the manual.
+
+** Added "full-calc" command.
+
+** Added "calc-insert-variables" (`Z I') command.
+
+** Quick Calc now works even if you are already in the minibuffer.
+
+** Fixed a bug in math-mul-bignum-digit which affected math-and, etc.
+
+** Definition of "Hectares" was wrong in units table.
+
+** Fixed a bug in calc-execute-kbd-macro concerning undo and refresh.
+
+** Bound "calc-undo" to `C-x u' as well as `C-_' and `U'.
+\f
+* Version 1.01:
+
+** Added a tutorial section to the manual.
+
+** Next and Prev for node Strings in the manual were reversed; fixed.
+
+** Changed "'bignum" in calc-isqrt-bignum-iter to "'bigpos".
+
+** Fixed a bug that prevented "$" from working during algebraic entry.
+
+** Fixed a bug caused by an X (last-X) command following a K (macro) cmd.
+
+** Fixed a bug in which K command incorrectly formatted stack in Big mode.
+
+** Added space between unary operators and non-flat compositions.
+ (Otherwise, "-(a/b)" in Big mode blended the minus sign into the rule!)
+
+** Fixed formatting of (-1)^n in Big mode.
+
+** Fixed some problems relating to "not" operator in Pascal language mode.
+
+** Fixed several bugs relating to V M ' and V M $ sequences.
+
+** Fixed matrix-vector multiplication to produce a vector.
+
+** Introduced Z ` ... Z ' commands; renamed old Z ' to Z #.
+
+** Fixed various other bugs.
+
+** Added calc-settings-file variable suggested by C. Witty.
+
+\f
+* Version 1.00:
+
+** First official release of Calc.
+
+** If you used the Beta test version (0.01), you will find that this
+ version of Calc is over 50% larger than the original release.
+ General areas of improvement include much better algebra features;
+ operations on units; language modes; simplification modes; interval
+ arithmetic; vector mapping and reduction. Other new commands include
+ calc-fraction and calc-grab-region. The program has been split into
+ two parts for faster loading, and the manual is more complete.
+
+\f
+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/>.
+
+\f
+Local variables:
+mode: outline
+end:
+2013-02-11 Michael Albinus <michael.albinus@gmx.de>
+
+ * NEWS: Add autorevert changes.
+
+2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
+
+ * NEWS: Mention ns-use-native-fullscreen.
+
+2013-02-01 Glenn Morris <rgm@gnu.org>
+
+ * CALC-NEWS: Move here from lisp/calc/README, README.prev.
+
+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'.
+
+\f
+* Startup Changes in Emacs 24.4
+
+\f
+* 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.
+
+** If the new variable `enable-dir-local-variables' is nil,
+directory local variables are ignored. May be useful for some modes
+that want to ignore directory-locals while still respecting file-locals.
+
+** 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.
+
+** New option `scroll-bar-adjust-thumb-portion'.
+Available only on X, this option allows to control over-scrolling
+using the scroll bar (i.e. dragging the thumb down even when the end
+of the buffer is visible).
+
+\f
+* Editing Changes in Emacs 24.4
+
+** New commands `toggle-frame-fullscreen' and `toggle-frame-maximized',
+bound to <f11> and M-<f10>, respectively.
+
+** In keymaps where SPC scrolls, S-SPC now scrolls in the reverse direction.
+Eg View mode, etc.
+
+\f
+* Changes in Specialized Modes and Packages in Emacs 24.4
+
+** Delphi mode is now called OPascal mode.
+*** All delphi-* variables and functions have been renamed to opascal-*.
+*** `delphi-newline-always-indents' is not supported any more
+use `electric-indent-mode' instead.
+*** `delphi-tab' is gone, replaced by `indent-for-tab-command'.
+
+** jit-lock-debug-mode lets you use the debuggers on code run via jit-lock.
+
+** completing-read-multiple's separator can now be a regexp.
+The default separator is changed to allow surrounding spaces around the comma.
+
+** 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.
+
+*** Support for ISO 8601 dates.
+
+** 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.
+
+** Image mode
+
+*** New commands `n' (`image-next-file') and `p' (`image-previous-file')
+visit the next image file and the previous image file in the same
+directory, respectively.
+
+---
+*** The command `image-mode-fit-frame' deletes other windows.
+When toggling, it restores the frame's previous window configuration.
+It also has an optional frame argument, which can be used by Lisp
+callers to fit the image to a frame other than the selected frame.
+
+** 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.
+
+** New `cycle-spacing' command allows cycling between having just one
+space, no spaces, or reverting to the original spacing. Like
+`just-one-space' command it can handle or ignore newlines and
+leave different number of spaces.
+
+** 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.
+
+\f
+* Incompatible Lisp Changes in Emacs 24.4
+
+** Removed inhibit-local-menu-bar-menus.
+
+** 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'.
+
+\f
+* 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.
+
+** Changes in autorevert.el
+
+---
+*** If Emacs is compiled with file notification support, notifications
+are used instead of checking the time stamp of the files. You can
+disable this by setting the user option `auto-revert-use-notify' to
+nil. Alternatively, a regular expression of directories to be
+excluded from file notifications can be specified by
+`auto-revert-notify-exclude-dir-regexp'.
+
+---
+*** The new user option `auto-revert-remote-files' enables reversion
+of remote files when set to non-nil.
+
+** 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.
+
+\f
+* 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.
+
++++
+** The variable `buffer-file-type' is no longer supported.
+Setting it has no effect, and %t in the mode-line format is ignored.
+Likewise, `file-name-buffer-file-type-alist' is now obsolete, and
+modifying it has no effect.
+
+** Improved fullscreen support on Mac OS X.
+Both native (>= OSX 10.7) and "old style" fullscreen are supported.
+Customize `ns-use-native-fullscreen' to change style. For >= 10.7
+native is the default.
+
\f
* Installation Changes in Emacs 24.3
*** Option `Buffer-menu-buffer+size-width' is now obsolete.
Use `Buffer-menu-name-width' and `Buffer-menu-size-width' instead.
+** Calc
+
+*** Algebraic simplification mode is now the default.
+To restrict to the limited simplifications given by the former
+default simplification mode, use `m I'.
+
** Calendar
*** You can customize the header text that appears above each calendar month.
*** The default browser used by the package is now the "xdg-open" program,
on platforms that support it. This calls your desktop's preferred browser.
+** Calc
+
+*** Support for musical notes.
+
+*** Support for logarithmic units.
+
+*** No longer uses the tex prefix for TeX specific unit names when
+using TeX or LaTeX mode.
+
+*** New option to highlight selections using faces.
+
+*** `calc-histogram' has the option of using a vector to determine the bins.
+
+*** New "O" option prefix.
+
+*** Use the "O" prefix to "d r" (`calc-radix') to turn on twos-complement mode.
+
** Calendar, Diary, and Appt
*** Diary entries can contain non-printing "comments".
user-emacs-directory; but the old location, ~/.calc.el, is used if
that file exists.
+*** New twos-complement display.
+
*** Graphing commands (`g f' etc.) now work on MS-Windows, if you have
the native Windows port of Gnuplot version 3.8 or later installed.
bookmark.el can read a .emacs.bmk file saved by an older Emacs, but an
older Emacs cannot read one saved by Emacs 23.
+** Calc
+
+*** `j *' (cal-sel-mult-both-sides) has an option to expand the denominator.
+
+*** `calc-embedded-word-regexp' is used for finding words in
+`calc-embedded-word' in place of delimiters.
+
+*** The separate Calc version number has been removed; use the Emacs
+version for reference.
+
+*** Support for using registers.
+
+*** Support for Yacas, Maxima and Giac languages.
+
+*** Addition of a menu.
+
+*** Logistic non-linear curves have been added to curve-fitting.
+
+*** New option to plot data points and curve when curve-fitting.
+
+*** Unit conversions are now exact when possible.
+
+*** The precedence of negation has been lowered.
+
** Calendar and diary
*** There is a new date style, `iso', essentially year/month/day.
This seems to be due to a GCC bug; it is fixed in GCC 2.8.1.
-** Vax C compiler bugs affecting Emacs.
-
-You may get one of these problems compiling Emacs:
-
- foo.c line nnn: compiler error: no table entry for op STASG
- foo.c: fatal error in /lib/ccom
-
-These are due to bugs in the C compiler; the code is valid C.
-Unfortunately, the bugs are unpredictable: the same construct
-may compile properly or trigger one of these bugs, depending
-on what else is in the source file being compiled. Even changes
-in header files that should not affect the file being compiled
-can affect whether the bug happens. In addition, sometimes files
-that compile correctly on one machine get this bug on another machine.
-
-As a result, it is hard for me to make sure this bug will not affect
-you. I have attempted to find and alter these constructs, but more
-can always appear. However, I can tell you how to deal with it if it
-should happen. The bug comes from having an indexed reference to an
-array of Lisp_Objects, as an argument in a function call:
- Lisp_Object *args;
- ...
- ... foo (5, args[i], ...)...
-putting the argument into a temporary variable first, as in
- Lisp_Object *args;
- Lisp_Object tem;
- ...
- tem = args[i];
- ... foo (r, tem, ...)...
-causes the problem to go away.
-The `contents' field of a Lisp vector is an array of Lisp_Objects,
-so you may see the problem happening with indexed references to that.
-
\f
This file is part of GNU Emacs.
*** 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.
[As of trunk r109635, 2012-08-15, the event loop no longer polls.]
--- /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)
+2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * quail/latin-ltx.el: Add greek superscripts.
+
+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.
(string (if (match-end 2) ?^ ?_) basechar))))
"\\(.*\\)SU\\(?:B\\|\\(PER\\)\\)SCRIPT \\(.*\\)")
- ("^\\gamma" ?ˠ)
-
((lambda (name char)
- (let* ((base (format "LATIN %s LETTER %s"
- (match-string 1 name) (match-string 2 name)))
- (basechar (cdr (assoc base (ucs-names)))))
- (when (latin-ltx--ascii-p basechar)
- (string ?^ basechar))))
+ (let* ((basename (match-string 2 name))
+ (lbase (format "LATIN %s LETTER %s"
+ (match-string 1 name) basename))
+ (gbase (format "GREEK %s LETTER %s"
+ (match-string 1 name) basename))
+ tmp)
+ (cond
+ ((assoc gbase (ucs-names)) (concat "^\\" (downcase basename)))
+ ((latin-ltx--ascii-p (setq tmp (cdr (assoc lbase (ucs-names)))))
+ (string ?^ tmp))
+ (t (message "Unknown modifier letter %s" basename)))))
"MODIFIER LETTER \\(SMALL\\|CAPITAL\\) \\(.*\\)")
;; ((lambda (name char) (format "^%s" (downcase (match-string 1 name))))
("\\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-02-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * movemail.c (getenv): Remove decl (unused since 1994).
+
+2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * make-docfile.c (write_globals): Make it a bit clearer (Bug#13448).
+ This pacifies GCC 4.7.2 when Emacs is configured with
+ --enable-link-time-optimization and --enable-gcc-warnings.
+
+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
qsort (globals, num_globals, sizeof (struct global), compare_globals);
for (i = 0; i < num_globals; ++i)
{
- char const *type;
+ char const *type = 0;
switch (globals[i].type)
{
fatal ("not a recognized DEFVAR_", 0);
}
- if (globals[i].type != FUNCTION)
+ if (type)
{
fprintf (outfile, " %s f_%s;\n", type, globals[i].name);
fprintf (outfile, "#define %s globals.f_%s\n",
#
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);
register int i;
int mbfi;
FILE *mbf;
- char *getenv (const char *);
popserver server;
int start, end, increment;
char *user, *hostname;
#include <time.h>
#include <pwd.h>
#include <ctype.h>
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif
#include <sys/stat.h>
#include <getopt.h>
DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src
include gnulib.mk
+
+libgnu_a_SOURCES += openat-die.c save-cwd.c
--- /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
#include <errno.h>
#include <limits.h>
-#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "allocator.h"
-/* Get the symbolic link value of FILENAME and put it into BUFFER, with
- size BUFFER_SIZE. This function acts like readlink but has
- readlinkat's signature. */
-ssize_t
-careadlinkatcwd (int fd, char const *filename, char *buffer,
- size_t buffer_size)
-{
- /* FD must be AT_FDCWD here, otherwise the caller is using this
- function in contexts for which it was not meant for. */
- if (fd != AT_FDCWD)
- abort ();
- return readlink (filename, buffer, buffer_size);
-}
-
/* Assuming the current directory is FD, get the symbolic link value
of FILENAME as a null-terminated string and put it into a buffer.
If FD is AT_FDCWD, FILENAME is interpreted relative to the current
ssize_t (*preadlinkat) (int, char const *,
char *, size_t));
-/* Suitable values for careadlinkat's FD and PREADLINKAT arguments,
- when doing a plain readlink:
- Pass FD = AT_FDCWD and PREADLINKAT = careadlinkatcwd. */
+/* Suitable value for careadlinkat's FD argument. */
#if HAVE_READLINKAT
/* AT_FDCWD is declared in <fcntl.h>. */
#else
/* Define AT_FDCWD independently, so that the careadlinkat module does
- not depend on the fcntl-h module. The value does not matter, since
- careadlinkatcwd ignores it, but we might as well use the same value
+ not depend on the fcntl-h module. We might as well use the same value
as fcntl-h. */
# ifndef AT_FDCWD
# define AT_FDCWD (-3041965)
# endif
#endif
-ssize_t careadlinkatcwd (int fd, char const *filename,
- char *buffer, size_t buffer_size);
#endif /* _GL_CAREADLINKAT_H */
--- /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);
--- /dev/null
+/* A GNU-like <dirent.h>.
+ 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/>. */
+
+#ifndef _@GUARD_PREFIX@_DIRENT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_DIRENT_H@
+# @INCLUDE_NEXT@ @NEXT_DIRENT_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_DIRENT_H
+#define _@GUARD_PREFIX@_DIRENT_H
+
+/* Get ino_t. Needed on some systems, including glibc 2.8. */
+#include <sys/types.h>
+
+#if !@HAVE_DIRENT_H@
+/* Define types DIR and 'struct dirent'. */
+# if !GNULIB_defined_struct_dirent
+struct dirent
+{
+ char d_type;
+ char d_name[1];
+};
+/* Possible values for 'd_type'. */
+# define DT_UNKNOWN 0
+# define DT_FIFO 1 /* FIFO */
+# define DT_CHR 2 /* character device */
+# define DT_DIR 4 /* directory */
+# define DT_BLK 6 /* block device */
+# define DT_REG 8 /* regular file */
+# define DT_LNK 10 /* symbolic link */
+# define DT_SOCK 12 /* socket */
+# define DT_WHT 14 /* whiteout */
+typedef struct gl_directory DIR;
+# define GNULIB_defined_struct_dirent 1
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#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_OPENDIR@
+# if @REPLACE_OPENDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef opendir
+# define opendir rpl_opendir
+# endif
+_GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
+# else
+# if !@HAVE_OPENDIR@
+_GL_FUNCDECL_SYS (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
+# endif
+_GL_CXXALIASWARN (opendir);
+#elif defined GNULIB_POSIXCHECK
+# undef opendir
+# if HAVE_RAW_DECL_OPENDIR
+_GL_WARN_ON_USE (opendir, "opendir is not portable - "
+ "use gnulib module opendir for portability");
+# endif
+#endif
+
+#if @GNULIB_READDIR@
+# if !@HAVE_READDIR@
+_GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
+_GL_CXXALIASWARN (readdir);
+#elif defined GNULIB_POSIXCHECK
+# undef readdir
+# if HAVE_RAW_DECL_READDIR
+_GL_WARN_ON_USE (readdir, "readdir is not portable - "
+ "use gnulib module readdir for portability");
+# endif
+#endif
+
+#if @GNULIB_REWINDDIR@
+# if !@HAVE_REWINDDIR@
+_GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
+_GL_CXXALIASWARN (rewinddir);
+#elif defined GNULIB_POSIXCHECK
+# undef rewinddir
+# if HAVE_RAW_DECL_REWINDDIR
+_GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
+ "use gnulib module rewinddir for portability");
+# endif
+#endif
+
+#if @GNULIB_CLOSEDIR@
+# if @REPLACE_CLOSEDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef closedir
+# define closedir rpl_closedir
+# endif
+_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
+# else
+# if !@HAVE_CLOSEDIR@
+_GL_FUNCDECL_SYS (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (closedir, int, (DIR *dirp));
+# endif
+_GL_CXXALIASWARN (closedir);
+#elif defined GNULIB_POSIXCHECK
+# undef closedir
+# if HAVE_RAW_DECL_CLOSEDIR
+_GL_WARN_ON_USE (closedir, "closedir is not portable - "
+ "use gnulib module closedir for portability");
+# endif
+#endif
+
+#if @GNULIB_DIRFD@
+/* Return the file descriptor associated with the given directory stream,
+ or -1 if none exists. */
+# if @REPLACE_DIRFD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dirfd
+# define dirfd rpl_dirfd
+# endif
+_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
+# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
+ /* dirfd is defined as a macro and not as a function.
+ Turn it into a function and get rid of the macro. */
+static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
+# undef dirfd
+# endif
+# if !(@HAVE_DECL_DIRFD@ || defined dirfd)
+_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (dirfd, int, (DIR *));
+# endif
+_GL_CXXALIASWARN (dirfd);
+#elif defined GNULIB_POSIXCHECK
+# undef dirfd
+# if HAVE_RAW_DECL_DIRFD
+_GL_WARN_ON_USE (dirfd, "dirfd is unportable - "
+ "use gnulib module dirfd for portability");
+# endif
+#endif
+
+#if @GNULIB_FDOPENDIR@
+/* Open a directory stream visiting the given directory file
+ descriptor. Return NULL and set errno if fd is not visiting a
+ directory. On success, this function consumes fd (it will be
+ implicitly closed either by this function or by a subsequent
+ closedir). */
+# if @REPLACE_FDOPENDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopendir
+# define fdopendir rpl_fdopendir
+# endif
+_GL_FUNCDECL_RPL (fdopendir, DIR *, (int fd));
+_GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
+# else
+# if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@
+_GL_FUNCDECL_SYS (fdopendir, DIR *, (int fd));
+# endif
+_GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
+# endif
+_GL_CXXALIASWARN (fdopendir);
+#elif defined GNULIB_POSIXCHECK
+# undef fdopendir
+# if HAVE_RAW_DECL_FDOPENDIR
+_GL_WARN_ON_USE (fdopendir, "fdopendir is unportable - "
+ "use gnulib module fdopendir for portability");
+# endif
+#endif
+
+#if @GNULIB_SCANDIR@
+/* Scan the directory DIR, calling FILTER on each directory entry.
+ Entries for which FILTER returns nonzero are individually malloc'd,
+ sorted using qsort with CMP, and collected in a malloc'd array in
+ *NAMELIST. Returns the number of entries selected, or -1 on error. */
+# if !@HAVE_SCANDIR@
+_GL_FUNCDECL_SYS (scandir, int,
+ (const char *dir, struct dirent ***namelist,
+ int (*filter) (const struct dirent *),
+ int (*cmp) (const struct dirent **, const struct dirent **))
+ _GL_ARG_NONNULL ((1, 2, 4)));
+# endif
+/* Need to cast, because on glibc systems, the fourth parameter is
+ int (*cmp) (const void *, const void *). */
+_GL_CXXALIAS_SYS_CAST (scandir, int,
+ (const char *dir, struct dirent ***namelist,
+ int (*filter) (const struct dirent *),
+ int (*cmp) (const struct dirent **, const struct dirent **)));
+_GL_CXXALIASWARN (scandir);
+#elif defined GNULIB_POSIXCHECK
+# undef scandir
+# if HAVE_RAW_DECL_SCANDIR
+_GL_WARN_ON_USE (scandir, "scandir is unportable - "
+ "use gnulib module scandir for portability");
+# endif
+#endif
+
+#if @GNULIB_ALPHASORT@
+/* Compare two 'struct dirent' entries alphabetically. */
+# if !@HAVE_ALPHASORT@
+_GL_FUNCDECL_SYS (alphasort, int,
+ (const struct dirent **, const struct dirent **)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+/* Need to cast, because on glibc systems, the parameters are
+ (const void *, const void *). */
+_GL_CXXALIAS_SYS_CAST (alphasort, int,
+ (const struct dirent **, const struct dirent **));
+_GL_CXXALIASWARN (alphasort);
+#elif defined GNULIB_POSIXCHECK
+# undef alphasort
+# if HAVE_RAW_DECL_ALPHASORT
+_GL_WARN_ON_USE (alphasort, "alphasort is unportable - "
+ "use gnulib module alphasort for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_DIRENT_H */
+#endif /* _@GUARD_PREFIX@_DIRENT_H */
/* 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
--- /dev/null
+/* provide a replacement fdopendir function
+ Copyright (C) 2004-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 <dirent.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#if !HAVE_FDOPENDIR
+
+# include "openat.h"
+# include "openat-priv.h"
+# include "save-cwd.h"
+
+# if GNULIB_DIRENT_SAFER
+# include "dirent--.h"
+# endif
+
+# ifndef REPLACE_FCHDIR
+# define REPLACE_FCHDIR 0
+# endif
+
+static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
+static DIR *fd_clone_opendir (int, struct saved_cwd const *);
+
+/* Replacement for POSIX fdopendir.
+
+ First, try to simulate it via opendir ("/proc/self/fd/..."). Failing
+ that, simulate it by using fchdir metadata, or by doing
+ save_cwd/fchdir/opendir(".")/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+
+ If successful, the resulting stream is based on FD in
+ implementations where streams are based on file descriptors and in
+ applications where no other thread or signal handler allocates or
+ frees file descriptors. In other cases, consult dirfd on the result
+ to find out whether FD is still being used.
+
+ Otherwise, this function works just like POSIX fdopendir.
+
+ W A R N I N G:
+
+ Unlike other fd-related functions, this one places constraints on FD.
+ If this function returns successfully, FD is under control of the
+ dirent.h system, and the caller should not close or modify the state of
+ FD other than by the dirent.h functions. */
+DIR *
+fdopendir (int fd)
+{
+ DIR *dir = fdopendir_with_dup (fd, -1, NULL);
+
+ if (! REPLACE_FCHDIR && ! dir)
+ {
+ int saved_errno = errno;
+ if (EXPECTED_ERRNO (saved_errno))
+ {
+ struct saved_cwd cwd;
+ if (save_cwd (&cwd) != 0)
+ openat_save_fail (errno);
+ dir = fdopendir_with_dup (fd, -1, &cwd);
+ saved_errno = errno;
+ free_cwd (&cwd);
+ errno = saved_errno;
+ }
+ }
+
+ return dir;
+}
+
+/* Like fdopendir, except that if OLDER_DUPFD is not -1, it is known
+ to be a dup of FD which is less than FD - 1 and which will be
+ closed by the caller and not otherwise used by the caller. This
+ function makes sure that FD is closed and all file descriptors less
+ than FD are open, and then calls fd_clone_opendir on a dup of FD.
+ That way, barring race conditions, fd_clone_opendir returns a
+ stream whose file descriptor is FD.
+
+ If REPLACE_CHDIR or CWD is null, use opendir ("/proc/self/fd/...",
+ falling back on fchdir metadata. Otherwise, CWD is a saved version
+ of the working directory; use fchdir/opendir(".")/restore_cwd(CWD). */
+static DIR *
+fdopendir_with_dup (int fd, int older_dupfd, struct saved_cwd const *cwd)
+{
+ int dupfd = dup (fd);
+ if (dupfd < 0 && errno == EMFILE)
+ dupfd = older_dupfd;
+ if (dupfd < 0)
+ return NULL;
+ else
+ {
+ DIR *dir;
+ int saved_errno;
+ if (dupfd < fd - 1 && dupfd != older_dupfd)
+ {
+ dir = fdopendir_with_dup (fd, dupfd, cwd);
+ saved_errno = errno;
+ }
+ else
+ {
+ close (fd);
+ dir = fd_clone_opendir (dupfd, cwd);
+ saved_errno = errno;
+ if (! dir)
+ {
+ int fd1 = dup (dupfd);
+ if (fd1 != fd)
+ openat_save_fail (fd1 < 0 ? errno : EBADF);
+ }
+ }
+
+ if (dupfd != older_dupfd)
+ close (dupfd);
+ errno = saved_errno;
+ return dir;
+ }
+}
+
+/* Like fdopendir, except the result controls a clone of FD. It is
+ the caller's responsibility both to close FD and (if the result is
+ not null) to closedir the result. */
+static DIR *
+fd_clone_opendir (int fd, struct saved_cwd const *cwd)
+{
+ if (REPLACE_FCHDIR || ! cwd)
+ {
+ DIR *dir = NULL;
+ int saved_errno = EOPNOTSUPP;
+ char buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (buf, fd, ".");
+ if (proc_file)
+ {
+ dir = opendir (proc_file);
+ saved_errno = errno;
+ if (proc_file != buf)
+ free (proc_file);
+ }
+# if REPLACE_FCHDIR
+ if (! dir && EXPECTED_ERRNO (saved_errno))
+ {
+ char const *name = _gl_directory_name (fd);
+ return (name ? opendir (name) : NULL);
+ }
+# endif
+ errno = saved_errno;
+ return dir;
+ }
+ else
+ {
+ if (fchdir (fd) != 0)
+ return NULL;
+ else
+ {
+ DIR *dir = opendir (".");
+ int saved_errno = errno;
+ if (restore_cwd (cwd) != 0)
+ openat_restore_fail (errno);
+ errno = saved_errno;
+ return dir;
+ }
+ }
+}
+
+#else /* HAVE_FDOPENDIR */
+
+# include <errno.h>
+# include <sys/stat.h>
+
+# undef fdopendir
+
+/* Like fdopendir, but work around GNU/Hurd bug by validating FD. */
+
+DIR *
+rpl_fdopendir (int fd)
+{
+ struct stat st;
+ if (fstat (fd, &st))
+ return NULL;
+ if (!S_ISDIR (st.st_mode))
+ {
+ errno = ENOTDIR;
+ return NULL;
+ }
+ return fdopendir (fd);
+}
+
+#endif /* HAVE_FDOPENDIR */
/* 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
+/* Work around an fstatat bug on Solaris 9.
+
+ 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 Paul Eggert and Jim Meyering. */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+ the system's <sys/stat.h> here, so that orig_fstatat doesn't recurse to
+ rpl_fstatat. */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of fstatat. It might be defined as a macro. */
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+#if HAVE_FSTATAT
+static int
+orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
+{
+ return fstatat (fd, filename, buf, flags);
+}
+#endif
+
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+ eliminates this include because of the preliminary #include <sys/stat.h>
+ above. */
+#include "sys/stat.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+
+#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG
+
+# ifndef LSTAT_FOLLOWS_SLASHED_SYMLINK
+# define LSTAT_FOLLOWS_SLASHED_SYMLINK 0
+# endif
+
+/* fstatat should always follow symbolic links that end in /, but on
+ Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified.
+ Likewise, trailing slash on a non-directory should be an error.
+ These are the same problems that lstat.c and stat.c address, so
+ solve it in a similar way.
+
+ AIX 7.1 fstatat (AT_FDCWD, ..., 0) always fails, which is a bug.
+ Work around this bug if FSTATAT_AT_FDCWD_0_BROKEN is nonzero. */
+
+int
+rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
+{
+ int result = orig_fstatat (fd, file, st, flag);
+ size_t len;
+
+ if (LSTAT_FOLLOWS_SLASHED_SYMLINK || result != 0)
+ return result;
+ len = strlen (file);
+ if (flag & AT_SYMLINK_NOFOLLOW)
+ {
+ /* Fix lstat behavior. */
+ if (file[len - 1] != '/' || S_ISDIR (st->st_mode))
+ return 0;
+ if (!S_ISLNK (st->st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ result = orig_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
+ }
+ /* Fix stat behavior. */
+ if (result == 0 && !S_ISDIR (st->st_mode) && file[len - 1] == '/')
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ return result;
+}
+
+#else /* ! (HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG) */
+
+/* On mingw, the gnulib <sys/stat.h> defines 'stat' as a function-like
+ macro; but using it in AT_FUNC_F2 causes compilation failure
+ because the preprocessor sees a use of a macro that requires two
+ arguments but is only given one. Hence, we need an inline
+ forwarder to get past the preprocessor. */
+static int
+stat_func (char const *name, struct stat *st)
+{
+ return stat (name, st);
+}
+
+/* Likewise, if there is no native 'lstat', then the gnulib
+ <sys/stat.h> defined it as stat, which also needs adjustment. */
+# if !HAVE_LSTAT
+# undef lstat
+# define lstat stat_func
+# endif
+
+/* Replacement for Solaris' function by the same name.
+ <http://www.google.com/search?q=fstatat+site:docs.sun.com>
+ First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
+ Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+ Otherwise, this function works just like Solaris' fstatat. */
+
+# define AT_FUNC_NAME fstatat
+# define AT_FUNC_F1 lstat
+# define AT_FUNC_F2 stat_func
+# define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
+# define AT_FUNC_POST_FILE_PARAM_DECLS , struct stat *st, int flag
+# define AT_FUNC_POST_FILE_ARGS , st
+# include "at-func.c"
+# undef AT_FUNC_NAME
+# undef AT_FUNC_F1
+# undef AT_FUNC_F2
+# undef AT_FUNC_USE_F1_COND
+# undef AT_FUNC_POST_FILE_PARAM_DECLS
+# undef AT_FUNC_POST_FILE_ARGS
+
+#endif /* !HAVE_FSTATAT */
--- /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 */
linkers. */
#if defined __GETOPT_PREFIX && !defined __need_getopt
# if !@HAVE_GETOPT_H@
+# define __need_system_stdlib_h
# include <stdlib.h>
+# undef __need_system_stdlib_h
# include <stdio.h>
# include <unistd.h>
# endif
/* Declarations for getopt.
- Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2013 Free
- Software Foundation, Inc.
+ Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-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
linkers. */
#if defined __GETOPT_PREFIX && !defined __need_getopt
# if !HAVE_GETOPT_H
+# define __need_system_stdlib_h
# include <stdlib.h>
+# undef __need_system_stdlib_h
# include <stdio.h>
# include <unistd.h>
# endif
/* The definition of _GL_ARG_NONNULL is copied here. */
/* A C macro for declaring that specific arguments must not be NULL.
- 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
## 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=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=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 fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings
MOSTLYCLEANFILES += core *.stackdump
## end gnulib module allocator
+## begin gnulib module at-internal
+
+if gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b
+
+endif
+EXTRA_DIST += openat-priv.h openat-proc.c
+
+EXTRA_libgnu_a_SOURCES += openat-proc.c
+
+## end gnulib module at-internal
+
## begin gnulib module c-ctype
libgnu_a_SOURCES += c-ctype.h c-ctype.c
## 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 crypto/sha512
+## begin gnulib module dirent
+
+BUILT_SOURCES += dirent.h
+
+# We need the following in order to create <dirent.h> when the system
+# doesn't have one that works with the given compiler.
+dirent.h: dirent.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|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|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_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+ -e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
+ -e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
+ -e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
+ -e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
+ -e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
+ -e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
+ -e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
+ -e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
+ -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+ -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+ -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+ -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
+ -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+ -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
+ -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
+ -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
+ -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
+ -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
+ -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
+ -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
+ -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|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)/dirent.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += dirent.h dirent.h-t
+
+EXTRA_DIST += dirent.in.h
+
+## end gnulib module dirent
+
## begin gnulib module dosname
if gl_GNULIB_ENABLED_dosname
## 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 fdopendir
+
+
+EXTRA_DIST += fdopendir.c
+
+EXTRA_libgnu_a_SOURCES += fdopendir.c
+
+## end gnulib module fdopendir
+
## 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 fstatat
+
+
+EXTRA_DIST += at-func.c fstatat.c
+
+EXTRA_libgnu_a_SOURCES += at-func.c fstatat.c
+
+## end gnulib module fstatat
+
+## 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 lstat
+## begin gnulib module memrchr
+
+
+EXTRA_DIST += memrchr.c
+
+EXTRA_libgnu_a_SOURCES += memrchr.c
+
+## end gnulib module memrchr
+
## begin gnulib module mktime
## end gnulib module mktime
+## begin gnulib module openat-h
+
+if gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7
+
+endif
+EXTRA_DIST += openat.h
+
+## end gnulib module openat-h
+
## begin gnulib module pathmax
if gl_GNULIB_ENABLED_pathmax
## 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 readlinkat
+
+
+EXTRA_DIST += at-func.c readlinkat.c
+
+EXTRA_libgnu_a_SOURCES += at-func.c readlinkat.c
+
+## end gnulib module readlinkat
+
+## 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
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
-e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
-e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+ -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
-e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
-e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
-e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
+ -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
-e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
## end gnulib module strftime
+## begin gnulib module string
+
+BUILT_SOURCES += string.h
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string.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_STRING_H''@|$(NEXT_STRING_H)|g' \
+ -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
+ -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
+ -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
+ -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
+ -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
+ -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
+ -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
+ -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
+ -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
+ -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
+ -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
+ -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
+ -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
+ -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
+ -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
+ -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
+ -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
+ -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
+ -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
+ -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
+ -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
+ -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
+ -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
+ -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
+ -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
+ -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
+ -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
+ -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
+ -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
+ -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
+ -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
+ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
+ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
+ -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
+ < $(srcdir)/string.in.h | \
+ sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
+ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
+ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+ -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
+ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
+ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
+ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+ -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
+ -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+ -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
+ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|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)/string.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += string.h string.h-t
+
+EXTRA_DIST += string.in.h
+
+## end gnulib module string
+
## begin gnulib module strtoimax
## 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)/memrchr.$(O) \
$(BLD)/strftime.$(O) \
$(BLD)/time_r.$(O) \
$(BLD)/timespec-add.$(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) \
$(MD5_H)
+$(BLD)/memrchr.$(O) : \
+ $(GNU_LIB)/memrchr.c \
+ $(CONFIG_H)
+
$(BLD)/sha1.$(O) : \
$(GNU_LIB)/sha1.c \
$(NT_INC)/stdalign.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
+/* memrchr -- find the last occurrence of a byte in a memory block
+
+ Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2013 Free Software
+ Foundation, Inc.
+
+ Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
+ with help from Dan Sahlin (dan@sics.se) and
+ commentary by Jim Blandy (jimb@ai.mit.edu);
+ adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
+ and implemented by Roland McGrath (roland@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
+ (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/>. */
+
+#if defined _LIBC
+# include <memcopy.h>
+#else
+# include <config.h>
+# define reg_char char
+#endif
+
+#include <string.h>
+#include <limits.h>
+
+#undef __memrchr
+#ifdef _LIBC
+# undef memrchr
+#endif
+
+#ifndef weak_alias
+# define __memrchr memrchr
+#endif
+
+/* Search no more than N bytes of S for C. */
+void *
+__memrchr (void const *s, int c_in, size_t n)
+{
+ /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+ long instead of a 64-bit uintmax_t tends to give better
+ performance. On 64-bit hardware, unsigned long is generally 64
+ bits already. Change this typedef to experiment with
+ performance. */
+ typedef unsigned long int longword;
+
+ const unsigned char *char_ptr;
+ const longword *longword_ptr;
+ longword repeated_one;
+ longword repeated_c;
+ unsigned reg_char c;
+
+ c = (unsigned char) c_in;
+
+ /* Handle the last few bytes by reading one byte at a time.
+ Do this until CHAR_PTR is aligned on a longword boundary. */
+ for (char_ptr = (const unsigned char *) s + n;
+ n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
+ --n)
+ if (*--char_ptr == c)
+ return (void *) char_ptr;
+
+ longword_ptr = (const longword *) char_ptr;
+
+ /* All these elucidatory comments refer to 4-byte longwords,
+ but the theory applies equally well to any size longwords. */
+
+ /* Compute auxiliary longword values:
+ repeated_one is a value which has a 1 in every byte.
+ repeated_c has c in every byte. */
+ repeated_one = 0x01010101;
+ repeated_c = c | (c << 8);
+ repeated_c |= repeated_c << 16;
+ if (0xffffffffU < (longword) -1)
+ {
+ repeated_one |= repeated_one << 31 << 1;
+ repeated_c |= repeated_c << 31 << 1;
+ if (8 < sizeof (longword))
+ {
+ size_t i;
+
+ for (i = 64; i < sizeof (longword) * 8; i *= 2)
+ {
+ repeated_one |= repeated_one << i;
+ repeated_c |= repeated_c << i;
+ }
+ }
+ }
+
+ /* Instead of the traditional loop which tests each byte, we will test a
+ longword at a time. The tricky part is testing if *any of the four*
+ bytes in the longword in question are equal to c. We first use an xor
+ with repeated_c. This reduces the task to testing whether *any of the
+ four* bytes in longword1 is zero.
+
+ We compute tmp =
+ ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+ That is, we perform the following operations:
+ 1. Subtract repeated_one.
+ 2. & ~longword1.
+ 3. & a mask consisting of 0x80 in every byte.
+ Consider what happens in each byte:
+ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+ and step 3 transforms it into 0x80. A carry can also be propagated
+ to more significant bytes.
+ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
+ the byte ends in a single bit of value 0 and k bits of value 1.
+ After step 2, the result is just k bits of value 1: 2^k - 1. After
+ step 3, the result is 0. And no carry is produced.
+ So, if longword1 has only non-zero bytes, tmp is zero.
+ Whereas if longword1 has a zero byte, call j the position of the least
+ significant zero byte. Then the result has a zero at positions 0, ...,
+ j-1 and a 0x80 at position j. We cannot predict the result at the more
+ significant bytes (positions j+1..3), but it does not matter since we
+ already have a non-zero bit at position 8*j+7.
+
+ So, the test whether any byte in longword1 is zero is equivalent to
+ testing whether tmp is nonzero. */
+
+ while (n >= sizeof (longword))
+ {
+ longword longword1 = *--longword_ptr ^ repeated_c;
+
+ if ((((longword1 - repeated_one) & ~longword1)
+ & (repeated_one << 7)) != 0)
+ {
+ longword_ptr++;
+ break;
+ }
+ n -= sizeof (longword);
+ }
+
+ char_ptr = (const unsigned char *) longword_ptr;
+
+ /* At this point, we know that either n < sizeof (longword), or one of the
+ sizeof (longword) bytes starting at char_ptr is == c. On little-endian
+ machines, we could determine the first such byte without any further
+ memory accesses, just by looking at the tmp result from the last loop
+ iteration. But this does not work on big-endian machines. Choose code
+ that works in both cases. */
+
+ while (n-- > 0)
+ {
+ if (*--char_ptr == c)
+ return (void *) char_ptr;
+ }
+
+ return NULL;
+}
+#ifdef weak_alias
+weak_alias (__memrchr, memrchr)
+#endif
--- /dev/null
+/* Respond to a save- or restore-cwd failure.
+ This should never happen with Emacs. */
+#include <config.h>
+#include "openat.h"
+void openat_save_fail (int errnum) { abort (); }
+void openat_restore_fail (int errnum) { abort (); }
--- /dev/null
+/* Internals for openat-like functions.
+
+ Copyright (C) 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 */
+
+#ifndef _GL_HEADER_OPENAT_PRIV
+#define _GL_HEADER_OPENAT_PRIV
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+/* Maximum number of bytes that it is safe to allocate as a single
+ array on the stack, and that is known as a compile-time constant.
+ The assumption is that we'll touch the array very quickly, or a
+ temporary very near the array, provoking an out-of-memory trap. On
+ some operating systems, there is only one guard page for the stack,
+ and a page size can be as small as 4096 bytes. Subtract 64 in the
+ hope that this will let the compiler touch a nearby temporary and
+ provoke a trap. */
+#define SAFER_ALLOCA_MAX (4096 - 64)
+
+#define SAFER_ALLOCA(m) ((m) < SAFER_ALLOCA_MAX ? (m) : SAFER_ALLOCA_MAX)
+
+#if defined PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (PATH_MAX)
+#elif defined _XOPEN_PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (_XOPEN_PATH_MAX)
+#else
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (1024)
+#endif
+
+char *openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file);
+
+/* Trying to access a BUILD_PROC_NAME file will fail on systems without
+ /proc support, and even on systems *with* ProcFS support. Return
+ nonzero if the failure may be legitimate, e.g., because /proc is not
+ readable, or the particular .../fd/N directory is not present. */
+#define EXPECTED_ERRNO(Errno) \
+ ((Errno) == ENOTDIR || (Errno) == ENOENT \
+ || (Errno) == EPERM || (Errno) == EACCES \
+ || (Errno) == ENOSYS /* Solaris 8 */ \
+ || (Errno) == EOPNOTSUPP /* FreeBSD */)
+
+/* Wrapper function shared among linkat and renameat. */
+int at_func2 (int fd1, char const *file1,
+ int fd2, char const *file2,
+ int (*func) (char const *file1, char const *file2));
+
+#endif /* _GL_HEADER_OPENAT_PRIV */
--- /dev/null
+/* Create /proc/self/fd-related names for subfiles of open directories.
+
+ 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 Paul Eggert. */
+
+#include <config.h>
+
+#include "openat-priv.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "intprops.h"
+
+/* The results of open() in this file are not used with fchdir,
+ and we do not leak fds to any single-threaded code that could use stdio,
+ therefore save some unnecessary work in fchdir.c.
+ FIXME - if the kernel ever adds support for multi-thread safety for
+ avoiding standard fds, then we should use open_safer. */
+#undef open
+#undef close
+
+#define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/%s"
+
+#define PROC_SELF_FD_NAME_SIZE_BOUND(len) \
+ (sizeof PROC_SELF_FD_FORMAT - sizeof "%d%s" \
+ + INT_STRLEN_BOUND (int) + (len) + 1)
+
+
+/* Set BUF to the expansion of PROC_SELF_FD_FORMAT, using FD and FILE
+ respectively for %d and %s. If successful, return BUF if the
+ result fits in BUF, dynamically allocated memory otherwise. But
+ return NULL if /proc is not reliable, either because the operating
+ system support is lacking or because memory is low. */
+char *
+openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
+{
+ static int proc_status = 0;
+
+ /* Make sure the caller gets ENOENT when appropriate. */
+ if (!*file)
+ {
+ buf[0] = '\0';
+ return buf;
+ }
+
+ if (! proc_status)
+ {
+ /* Set PROC_STATUS to a positive value if /proc/self/fd is
+ reliable, and a negative value otherwise. Solaris 10
+ /proc/self/fd mishandles "..", and any file name might expand
+ to ".." after symbolic link expansion, so avoid /proc/self/fd
+ if it mishandles "..". Solaris 10 has openat, but this
+ problem is exhibited on code that built on Solaris 8 and
+ running on Solaris 10. */
+
+ int proc_self_fd = open ("/proc/self/fd",
+ O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
+ if (proc_self_fd < 0)
+ proc_status = -1;
+ else
+ {
+ /* Detect whether /proc/self/fd/%i/../fd exists, where %i is the
+ number of a file descriptor open on /proc/self/fd. On Linux,
+ that name resolves to /proc/self/fd, which was opened above.
+ However, on Solaris, it may resolve to /proc/self/fd/fd, which
+ cannot exist, since all names in /proc/self/fd are numeric. */
+ char dotdot_buf[PROC_SELF_FD_NAME_SIZE_BOUND (sizeof "../fd" - 1)];
+ sprintf (dotdot_buf, PROC_SELF_FD_FORMAT, proc_self_fd, "../fd");
+ proc_status = access (dotdot_buf, F_OK) ? -1 : 1;
+ close (proc_self_fd);
+ }
+ }
+
+ if (proc_status < 0)
+ return NULL;
+ else
+ {
+ size_t bufsize = PROC_SELF_FD_NAME_SIZE_BOUND (strlen (file));
+ char *result = buf;
+ if (OPENAT_BUFFER_SIZE < bufsize)
+ {
+ result = malloc (bufsize);
+ if (! result)
+ return NULL;
+ }
+ sprintf (result, PROC_SELF_FD_FORMAT, fd, file);
+ return result;
+ }
+}
--- /dev/null
+/* provide a replacement openat function
+ Copyright (C) 2004-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 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 */
+
+#ifndef _GL_HEADER_OPENAT
+#define _GL_HEADER_OPENAT
+
+#include <fcntl.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+_GL_INLINE_HEADER_BEGIN
+
+#if !HAVE_OPENAT
+
+int openat_permissive (int fd, char const *file, int flags, mode_t mode,
+ int *cwd_errno);
+bool openat_needs_fchdir (void);
+
+#else
+
+# define openat_permissive(Fd, File, Flags, Mode, Cwd_errno) \
+ openat (Fd, File, Flags, Mode)
+# define openat_needs_fchdir() false
+
+#endif
+
+_Noreturn void openat_restore_fail (int);
+_Noreturn void openat_save_fail (int);
+
+/* Using these function names makes application code
+ slightly more readable than it would be with
+ fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */
+
+#if GNULIB_FCHOWNAT
+
+# ifndef FCHOWNAT_INLINE
+# define FCHOWNAT_INLINE _GL_INLINE
+# endif
+
+FCHOWNAT_INLINE int
+chownat (int fd, char const *file, uid_t owner, gid_t group)
+{
+ return fchownat (fd, file, owner, group, 0);
+}
+
+FCHOWNAT_INLINE int
+lchownat (int fd, char const *file, uid_t owner, gid_t group)
+{
+ return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+#if GNULIB_FCHMODAT
+
+# ifndef FCHMODAT_INLINE
+# define FCHMODAT_INLINE _GL_INLINE
+# endif
+
+FCHMODAT_INLINE int
+chmodat (int fd, char const *file, mode_t mode)
+{
+ return fchmodat (fd, file, mode, 0);
+}
+
+FCHMODAT_INLINE int
+lchmodat (int fd, char const *file, mode_t mode)
+{
+ return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+#if GNULIB_STATAT
+
+# ifndef STATAT_INLINE
+# define STATAT_INLINE _GL_INLINE
+# endif
+
+STATAT_INLINE int
+statat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, 0);
+}
+
+STATAT_INLINE int
+lstatat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+/* For now, there are no wrappers named laccessat or leuidaccessat,
+ since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
+ since access rights on symlinks are of limited utility. Likewise,
+ wrappers are not provided for accessat or euidaccessat, so as to
+ avoid dragging in -lgen on some platforms. */
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_HEADER_OPENAT */
--- /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
+/* Read a symlink 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>
+
+/* Gnulib provides a readlink stub for mingw; use it for distinction
+ between EINVAL and ENOENT, rather than always failing with ENOSYS. */
+
+/* POSIX 2008 says that unlike readlink, readlinkat returns 0 for
+ success instead of the buffer length. But this would render
+ readlinkat worthless since readlink does not guarantee a
+ NUL-terminated buffer. Assume this was a bug in POSIX. */
+
+/* Read the contents of symlink FILE into buffer BUF of size LEN, in the
+ directory open on descriptor FD. If possible, do it without changing
+ the working directory. Otherwise, resort to using save_cwd/fchdir,
+ then readlink/restore_cwd. If either the save_cwd or the restore_cwd
+ fails, then give a diagnostic and exit nonzero. */
+
+#define AT_FUNC_NAME readlinkat
+#define AT_FUNC_F1 readlink
+#define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len
+#define AT_FUNC_POST_FILE_ARGS , buf, len
+#define AT_FUNC_RESULT ssize_t
+#include "at-func.c"
+#undef AT_FUNC_NAME
+#undef AT_FUNC_F1
+#undef AT_FUNC_POST_FILE_PARAM_DECLS
+#undef AT_FUNC_POST_FILE_ARGS
+#undef AT_FUNC_RESULT
--- /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
--- /dev/null
+#include <config.h>
+#define SAVE_CWD_INLINE _GL_EXTERN_INLINE
+#include "save-cwd.h"
--- /dev/null
+/* Do not save and restore the current working directory.
+
+ Copyright 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/>. */
+
+/* Gnulib needs to save and restore the current working directory to
+ fully emulate functions like fstatat. But Emacs doesn't care what
+ the current working directory is; it always uses absolute file
+ names. This module replaces the Gnulib module by omitting the code
+ that Emacs does not need. */
+
+#ifndef SAVE_CWD_H
+#define SAVE_CWD_H 1
+
+_GL_INLINE_HEADER_BEGIN
+#ifndef SAVE_CWD_INLINE
+# define SAVE_CWD_INLINE _GL_INLINE
+#endif
+
+struct saved_cwd { int desc; };
+
+SAVE_CWD_INLINE int
+save_cwd (struct saved_cwd *cwd)
+{
+ cwd->desc = -1;
+ return 0;
+}
+
+SAVE_CWD_INLINE int restore_cwd (struct saved_cwd const *cwd) { return 0; }
+SAVE_CWD_INLINE void free_cwd (struct saved_cwd *cwd) { }
+
+_GL_INLINE_HEADER_END
+
+#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);
Ideally we should test __BIONIC__ here, but it is only defined after
<sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
#if defined __ANDROID__ \
- && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
+ && defined _SYS_TYPES_H_ && !defined __need_size_t
# @INCLUDE_NEXT@ @NEXT_STDINT_H@
#else
/* 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
#endif
@PRAGMA_COLUMNS@
-#if defined __need_malloc_and_calloc
-/* Special invocation convention inside glibc header files. */
+#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+/* Special invocation conventions inside some gnulib header files,
+ and inside some glibc header files, respectively. */
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
# endif
#endif
+#if @GNULIB_SECURE_GETENV@
+/* Look up NAME in the environment, returning 0 in insecure situations. */
+# if !@HAVE_SECURE_GETENV@
+_GL_FUNCDECL_SYS (secure_getenv, char *,
+ (char const *name) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
+_GL_CXXALIASWARN (secure_getenv);
+#elif defined GNULIB_POSIXCHECK
+# undef secure_getenv
+# if HAVE_RAW_DECL_SECURE_GETENV
+_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
+ "use gnulib module secure_getenv for portability");
+# endif
+#endif
+
#if @GNULIB_SETENV@
/* Set NAME to VALUE in the environment.
If REPLACE is nonzero, overwrite an existing value. */
#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) \
--- /dev/null
+/* A GNU-like <string.h>.
+
+ Copyright (C) 1995-1996, 2001-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, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_STRING_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
+
+#ifndef _@GUARD_PREFIX@_STRING_H
+#define _@GUARD_PREFIX@_STRING_H
+
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
+
+/* MirBSD defines mbslen as a macro. */
+#if @GNULIB_MBSLEN@ && defined __MirBSD__
+# include <wchar.h>
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
+ && ! defined __GLIBC__
+# include <unistd.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. */
+
+
+/* Find the index of the least-significant set bit. */
+#if @GNULIB_FFSL@
+# if !@HAVE_FFSL@
+_GL_FUNCDECL_SYS (ffsl, int, (long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsl, int, (long int i));
+_GL_CXXALIASWARN (ffsl);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsl
+# if HAVE_RAW_DECL_FFSL
+_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
+# endif
+#endif
+
+
+/* Find the index of the least-significant set bit. */
+#if @GNULIB_FFSLL@
+# if !@HAVE_FFSLL@
+_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+_GL_CXXALIASWARN (ffsll);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsll
+# if HAVE_RAW_DECL_FFSLL
+_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
+# endif
+#endif
+
+
+/* Return the first instance of C within N bytes of S, or NULL. */
+#if @GNULIB_MEMCHR@
+# if @REPLACE_MEMCHR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define memchr rpl_memchr
+# endif
+_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
+# else
+# if ! @HAVE_MEMCHR@
+_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C" { const void * std::memchr (const void *, int, size_t); }
+ extern "C++" { void * std::memchr (void *, int, size_t); } */
+_GL_CXXALIAS_SYS_CAST2 (memchr,
+ void *, (void const *__s, int __c, size_t __n),
+ void const *, (void const *__s, int __c, size_t __n));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
+_GL_CXXALIASWARN1 (memchr, void const *,
+ (void const *__s, int __c, size_t __n));
+# else
+_GL_CXXALIASWARN (memchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memchr
+/* Assume memchr is always declared. */
+_GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
+ "use gnulib module memchr for portability" );
+#endif
+
+/* Return the first occurrence of NEEDLE in HAYSTACK. */
+#if @GNULIB_MEMMEM@
+# if @REPLACE_MEMMEM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define memmem rpl_memmem
+# endif
+_GL_FUNCDECL_RPL (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len));
+# else
+# if ! @HAVE_DECL_MEMMEM@
+_GL_FUNCDECL_SYS (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
+# endif
+_GL_CXXALIAS_SYS (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len));
+# endif
+_GL_CXXALIASWARN (memmem);
+#elif defined GNULIB_POSIXCHECK
+# undef memmem
+# if HAVE_RAW_DECL_MEMMEM
+_GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
+ "use gnulib module memmem-simple for portability, "
+ "and module memmem for speed" );
+# endif
+#endif
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+#if @GNULIB_MEMPCPY@
+# if ! @HAVE_MEMPCPY@
+_GL_FUNCDECL_SYS (mempcpy, void *,
+ (void *restrict __dest, void const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (mempcpy, void *,
+ (void *restrict __dest, void const *restrict __src,
+ size_t __n));
+_GL_CXXALIASWARN (mempcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef mempcpy
+# if HAVE_RAW_DECL_MEMPCPY
+_GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
+ "use gnulib module mempcpy for portability");
+# endif
+#endif
+
+/* Search backwards through a block for a byte (specified as an int). */
+#if @GNULIB_MEMRCHR@
+# if ! @HAVE_DECL_MEMRCHR@
+_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const void * std::memrchr (const void *, int, size_t); }
+ extern "C++" { void * std::memrchr (void *, int, size_t); } */
+_GL_CXXALIAS_SYS_CAST2 (memrchr,
+ void *, (void const *, int, size_t),
+ void const *, (void const *, int, size_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
+_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
+# else
+_GL_CXXALIASWARN (memrchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memrchr
+# if HAVE_RAW_DECL_MEMRCHR
+_GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
+ "use gnulib module memrchr for portability");
+# endif
+#endif
+
+/* Find the first occurrence of C in S. More efficient than
+ memchr(S,C,N), at the expense of undefined behavior if C does not
+ occur within N bytes. */
+#if @GNULIB_RAWMEMCHR@
+# if ! @HAVE_RAWMEMCHR@
+_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const void * std::rawmemchr (const void *, int); }
+ extern "C++" { void * std::rawmemchr (void *, int); } */
+_GL_CXXALIAS_SYS_CAST2 (rawmemchr,
+ void *, (void const *__s, int __c_in),
+ void const *, (void const *__s, int __c_in));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
+_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
+# else
+_GL_CXXALIASWARN (rawmemchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rawmemchr
+# if HAVE_RAW_DECL_RAWMEMCHR
+_GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
+ "use gnulib module rawmemchr for portability");
+# endif
+#endif
+
+/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */
+#if @GNULIB_STPCPY@
+# if ! @HAVE_STPCPY@
+_GL_FUNCDECL_SYS (stpcpy, char *,
+ (char *restrict __dst, char const *restrict __src)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (stpcpy, char *,
+ (char *restrict __dst, char const *restrict __src));
+_GL_CXXALIASWARN (stpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef stpcpy
+# if HAVE_RAW_DECL_STPCPY
+_GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
+ "use gnulib module stpcpy for portability");
+# endif
+#endif
+
+/* Copy no more than N bytes of SRC to DST, returning a pointer past the
+ last non-NUL byte written into DST. */
+#if @GNULIB_STPNCPY@
+# if @REPLACE_STPNCPY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
+# define stpncpy rpl_stpncpy
+# endif
+_GL_FUNCDECL_RPL (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n));
+# else
+# if ! @HAVE_STPNCPY@
+_GL_FUNCDECL_SYS (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n));
+# endif
+_GL_CXXALIASWARN (stpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef stpncpy
+# if HAVE_RAW_DECL_STPNCPY
+_GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
+ "use gnulib module stpncpy for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strchr() does not work with multibyte strings if the locale encoding is
+ GB18030 and the character to be searched is a digit. */
+# undef strchr
+/* Assume strchr is always declared. */
+_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
+ "in some multibyte locales - "
+ "use mbschr if you care about internationalization");
+#endif
+
+/* Find the first occurrence of C in S or the final NUL byte. */
+#if @GNULIB_STRCHRNUL@
+# if @REPLACE_STRCHRNUL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strchrnul rpl_strchrnul
+# endif
+_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strchrnul, char *,
+ (const char *str, int ch));
+# else
+# if ! @HAVE_STRCHRNUL@
+_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * std::strchrnul (const char *, int); }
+ extern "C++" { char * std::strchrnul (char *, int); } */
+_GL_CXXALIAS_SYS_CAST2 (strchrnul,
+ char *, (char const *__s, int __c_in),
+ char const *, (char const *__s, int __c_in));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
+_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
+# else
+_GL_CXXALIASWARN (strchrnul);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strchrnul
+# if HAVE_RAW_DECL_STRCHRNUL
+_GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
+ "use gnulib module strchrnul for portability");
+# endif
+#endif
+
+/* Duplicate S, returning an identical malloc'd string. */
+#if @GNULIB_STRDUP@
+# if @REPLACE_STRDUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strdup
+# define strdup rpl_strdup
+# endif
+_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
+# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+ /* strdup exists as a function and as a macro. Get rid of the macro. */
+# undef strdup
+# endif
+# if !(@HAVE_DECL_STRDUP@ || defined strdup)
+_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
+#elif defined GNULIB_POSIXCHECK
+# undef strdup
+# if HAVE_RAW_DECL_STRDUP
+_GL_WARN_ON_USE (strdup, "strdup is unportable - "
+ "use gnulib module strdup for portability");
+# endif
+#endif
+
+/* Append no more than N characters from SRC onto DEST. */
+#if @GNULIB_STRNCAT@
+# if @REPLACE_STRNCAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strncat
+# define strncat rpl_strncat
+# endif
+_GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n));
+# else
+_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n));
+# endif
+_GL_CXXALIASWARN (strncat);
+#elif defined GNULIB_POSIXCHECK
+# undef strncat
+# if HAVE_RAW_DECL_STRNCAT
+_GL_WARN_ON_USE (strncat, "strncat is unportable - "
+ "use gnulib module strncat for portability");
+# endif
+#endif
+
+/* Return a newly allocated copy of at most N bytes of STRING. */
+#if @GNULIB_STRNDUP@
+# if @REPLACE_STRNDUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strndup
+# define strndup rpl_strndup
+# endif
+_GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
+# else
+# if ! @HAVE_DECL_STRNDUP@
+_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n));
+# endif
+_GL_CXXALIASWARN (strndup);
+#elif defined GNULIB_POSIXCHECK
+# undef strndup
+# if HAVE_RAW_DECL_STRNDUP
+_GL_WARN_ON_USE (strndup, "strndup is unportable - "
+ "use gnulib module strndup for portability");
+# endif
+#endif
+
+/* Find the length (number of bytes) of STRING, but scan at most
+ MAXLEN bytes. If no '\0' terminator is found in that many bytes,
+ return MAXLEN. */
+#if @GNULIB_STRNLEN@
+# if @REPLACE_STRNLEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strnlen
+# define strnlen rpl_strnlen
+# endif
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
+# else
+# if ! @HAVE_DECL_STRNLEN@
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
+# endif
+_GL_CXXALIASWARN (strnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef strnlen
+# if HAVE_RAW_DECL_STRNLEN
+_GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
+ "use gnulib module strnlen for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strcspn() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it does not work with multibyte strings if the
+ locale encoding is GB18030 and one of the characters to be searched is a
+ digit. */
+# undef strcspn
+/* Assume strcspn is always declared. */
+_GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbscspn if you care about internationalization");
+#endif
+
+/* Find the first occurrence in S of any character in ACCEPT. */
+#if @GNULIB_STRPBRK@
+# if ! @HAVE_STRPBRK@
+_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C" { const char * strpbrk (const char *, const char *); }
+ extern "C++" { char * strpbrk (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strpbrk,
+ char *, (char const *__s, char const *__accept),
+ const char *, (char const *__s, char const *__accept));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
+_GL_CXXALIASWARN1 (strpbrk, char const *,
+ (char const *__s, char const *__accept));
+# else
+_GL_CXXALIASWARN (strpbrk);
+# endif
+# if defined GNULIB_POSIXCHECK
+/* strpbrk() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it does not work with multibyte strings if the
+ locale encoding is GB18030 and one of the characters to be searched is a
+ digit. */
+# undef strpbrk
+_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbspbrk if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strpbrk
+# if HAVE_RAW_DECL_STRPBRK
+_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - "
+ "use gnulib module strpbrk for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strspn() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it cannot work with multibyte strings. */
+# undef strspn
+/* Assume strspn is always declared. */
+_GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbsspn if you care about internationalization");
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strrchr() does not work with multibyte strings if the locale encoding is
+ GB18030 and the character to be searched is a digit. */
+# undef strrchr
+/* Assume strrchr is always declared. */
+_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
+ "in some multibyte locales - "
+ "use mbsrchr if you care about internationalization");
+#endif
+
+/* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
+ If one is found, overwrite it with a NUL, and advance *STRINGP
+ to point to the next char after it. Otherwise, set *STRINGP to NULL.
+ If *STRINGP was already NULL, nothing happens.
+ Return the old value of *STRINGP.
+
+ This is a variant of strtok() that is multithread-safe and supports
+ empty fields.
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+ Caveat: It doesn't work with multibyte strings unless all of the delimiter
+ characters are ASCII characters < 0x30.
+
+ See also strtok_r(). */
+#if @GNULIB_STRSEP@
+# if ! @HAVE_STRSEP@
+_GL_FUNCDECL_SYS (strsep, char *,
+ (char **restrict __stringp, char const *restrict __delim)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (strsep, char *,
+ (char **restrict __stringp, char const *restrict __delim));
+_GL_CXXALIASWARN (strsep);
+# if defined GNULIB_POSIXCHECK
+# undef strsep
+_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbssep if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strsep
+# if HAVE_RAW_DECL_STRSEP
+_GL_WARN_ON_USE (strsep, "strsep is unportable - "
+ "use gnulib module strsep for portability");
+# endif
+#endif
+
+#if @GNULIB_STRSTR@
+# if @REPLACE_STRSTR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strstr rpl_strstr
+# endif
+_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
+# else
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * strstr (const char *, const char *); }
+ extern "C++" { char * strstr (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strstr,
+ char *, (const char *haystack, const char *needle),
+ const char *, (const char *haystack, const char *needle));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
+_GL_CXXALIASWARN1 (strstr, const char *,
+ (const char *haystack, const char *needle));
+# else
+_GL_CXXALIASWARN (strstr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+/* strstr() does not work with multibyte strings if the locale encoding is
+ different from UTF-8:
+ POSIX says that it operates on "strings", and "string" in POSIX is defined
+ as a sequence of bytes, not of characters. */
+# undef strstr
+/* Assume strstr is always declared. */
+_GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
+ "work correctly on character strings in most "
+ "multibyte locales - "
+ "use mbsstr if you care about internationalization, "
+ "or use strstr if you care about speed");
+#endif
+
+/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
+ comparison. */
+#if @GNULIB_STRCASESTR@
+# if @REPLACE_STRCASESTR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strcasestr rpl_strcasestr
+# endif
+_GL_FUNCDECL_RPL (strcasestr, char *,
+ (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strcasestr, char *,
+ (const char *haystack, const char *needle));
+# else
+# if ! @HAVE_STRCASESTR@
+_GL_FUNCDECL_SYS (strcasestr, char *,
+ (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * strcasestr (const char *, const char *); }
+ extern "C++" { char * strcasestr (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strcasestr,
+ char *, (const char *haystack, const char *needle),
+ const char *, (const char *haystack, const char *needle));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
+_GL_CXXALIASWARN1 (strcasestr, const char *,
+ (const char *haystack, const char *needle));
+# else
+_GL_CXXALIASWARN (strcasestr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+/* strcasestr() does not work with multibyte strings:
+ It is a glibc extension, and glibc implements it only for unibyte
+ locales. */
+# undef strcasestr
+# if HAVE_RAW_DECL_STRCASESTR
+_GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
+ "strings in multibyte locales - "
+ "use mbscasestr if you care about "
+ "internationalization, or use c-strcasestr if you want "
+ "a locale independent function");
+# endif
+#endif
+
+/* Parse S into tokens separated by characters in DELIM.
+ If S is NULL, the saved pointer in SAVE_PTR is used as
+ the next starting point. For example:
+ char s[] = "-abc-=-def";
+ char *sp;
+ x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def"
+ x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL
+ x = strtok_r(NULL, "=", &sp); // x = NULL
+ // s = "abc\0-def\0"
+
+ This is a variant of strtok() that is multithread-safe.
+
+ For the POSIX documentation for this function, see:
+ http://www.opengroup.org/susv3xsh/strtok.html
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+ Caveat: It doesn't work with multibyte strings unless all of the delimiter
+ characters are ASCII characters < 0x30.
+
+ See also strsep(). */
+#if @GNULIB_STRTOK_R@
+# if @REPLACE_STRTOK_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strtok_r
+# define strtok_r rpl_strtok_r
+# endif
+_GL_FUNCDECL_RPL (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr));
+# else
+# if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
+# undef strtok_r
+# endif
+# if ! @HAVE_DECL_STRTOK_R@
+_GL_FUNCDECL_SYS (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr));
+# endif
+_GL_CXXALIASWARN (strtok_r);
+# if defined GNULIB_POSIXCHECK
+_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
+ "strings in multibyte locales - "
+ "use mbstok_r if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtok_r
+# if HAVE_RAW_DECL_STRTOK_R
+_GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
+ "use gnulib module strtok_r for portability");
+# endif
+#endif
+
+
+/* The following functions are not specified by POSIX. They are gnulib
+ extensions. */
+
+#if @GNULIB_MBSLEN@
+/* Return the number of multibyte characters in the character string STRING.
+ This considers multibyte characters, unlike strlen, which counts bytes. */
+# ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */
+# undef mbslen
+# endif
+# if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbslen rpl_mbslen
+# endif
+_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
+# else
+_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
+# endif
+_GL_CXXALIASWARN (mbslen);
+#endif
+
+#if @GNULIB_MBSNLEN@
+/* Return the number of multibyte characters in the character string starting
+ at STRING and ending at STRING + LEN. */
+_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1));
+#endif
+
+#if @GNULIB_MBSCHR@
+/* Locate the first single-byte character C in the character string STRING,
+ and return a pointer to it. Return NULL if C is not found in STRING.
+ Unlike strchr(), this function works correctly in multibyte locales with
+ encodings such as GB18030. */
+# if defined __hpux
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
+# endif
+_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbschr);
+#endif
+
+#if @GNULIB_MBSRCHR@
+/* Locate the last single-byte character C in the character string STRING,
+ and return a pointer to it. Return NULL if C is not found in STRING.
+ Unlike strrchr(), this function works correctly in multibyte locales with
+ encodings such as GB18030. */
+# if defined __hpux || defined __INTERIX
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbsrchr rpl_mbsrchr /* avoid collision with system function */
+# endif
+_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbsrchr);
+#endif
+
+#if @GNULIB_MBSSTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+ string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK.
+ Unlike strstr(), this function works correctly in multibyte locales with
+ encodings different from UTF-8. */
+_GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCASECMP@
+/* Compare the character strings S1 and S2, ignoring case, returning less than,
+ equal to or greater than zero if S1 is lexicographically less than, equal to
+ or greater than S2.
+ Note: This function may, in multibyte locales, return 0 for strings of
+ different lengths!
+ Unlike strcasecmp(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSNCASECMP@
+/* Compare the initial segment of the character string S1 consisting of at most
+ N characters with the initial segment of the character string S2 consisting
+ of at most N characters, ignoring case, returning less than, equal to or
+ greater than zero if the initial segment of S1 is lexicographically less
+ than, equal to or greater than the initial segment of S2.
+ Note: This function may, in multibyte locales, return 0 for initial segments
+ of different lengths!
+ Unlike strncasecmp(), this function works correctly in multibyte locales.
+ But beware that N is not a byte count but a character count! */
+_GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSPCASECMP@
+/* Compare the initial segment of the character string STRING consisting of
+ at most mbslen (PREFIX) characters with the character string PREFIX,
+ ignoring case. If the two match, return a pointer to the first byte
+ after this prefix in STRING. Otherwise, return NULL.
+ Note: This function may, in multibyte locales, return non-NULL if STRING
+ is of smaller length than PREFIX!
+ Unlike strncasecmp(), this function works correctly in multibyte
+ locales. */
+_GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCASESTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+ string HAYSTACK, using case-insensitive comparison.
+ Note: This function may, in multibyte locales, return success even if
+ strlen (haystack) < strlen (needle) !
+ Unlike strcasestr(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCSPN@
+/* Find the first occurrence in the character string STRING of any character
+ in the character string ACCEPT. Return the number of bytes from the
+ beginning of the string to this occurrence, or to the end of the string
+ if none exists.
+ Unlike strcspn(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSPBRK@
+/* Find the first occurrence in the character string STRING of any character
+ in the character string ACCEPT. Return the pointer to it, or NULL if none
+ exists.
+ Unlike strpbrk(), this function works correctly in multibyte locales. */
+# if defined __hpux
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
+# endif
+_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
+# else
+_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
+# endif
+_GL_CXXALIASWARN (mbspbrk);
+#endif
+
+#if @GNULIB_MBSSPN@
+/* Find the first occurrence in the character string STRING of any character
+ not in the character string REJECT. Return the number of bytes from the
+ beginning of the string to this occurrence, or to the end of the string
+ if none exists.
+ Unlike strspn(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSSEP@
+/* Search the next delimiter (multibyte character listed in the character
+ string DELIM) starting at the character string *STRINGP.
+ If one is found, overwrite it with a NUL, and advance *STRINGP to point
+ to the next multibyte character after it. Otherwise, set *STRINGP to NULL.
+ If *STRINGP was already NULL, nothing happens.
+ Return the old value of *STRINGP.
+
+ This is a variant of mbstok_r() that supports empty fields.
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+
+ See also mbstok_r(). */
+_GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSTOK_R@
+/* Parse the character string STRING into tokens separated by characters in
+ the character string DELIM.
+ If STRING is NULL, the saved pointer in SAVE_PTR is used as
+ the next starting point. For example:
+ char s[] = "-abc-=-def";
+ char *sp;
+ x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def"
+ x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL
+ x = mbstok_r(NULL, "=", &sp); // x = NULL
+ // s = "abc\0-def\0"
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+
+ See also mbssep(). */
+_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
+ _GL_ARG_NONNULL ((2, 3));
+#endif
+
+/* Map any int, typically from errno, into an error message. */
+#if @GNULIB_STRERROR@
+# if @REPLACE_STRERROR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strerror
+# define strerror rpl_strerror
+# endif
+_GL_FUNCDECL_RPL (strerror, char *, (int));
+_GL_CXXALIAS_RPL (strerror, char *, (int));
+# else
+_GL_CXXALIAS_SYS (strerror, char *, (int));
+# endif
+_GL_CXXALIASWARN (strerror);
+#elif defined GNULIB_POSIXCHECK
+# undef strerror
+/* Assume strerror is always declared. */
+_GL_WARN_ON_USE (strerror, "strerror is unportable - "
+ "use gnulib module strerror to guarantee non-NULL result");
+#endif
+
+/* Map any int, typically from errno, into an error message. Multithread-safe.
+ Uses the POSIX declaration, not the glibc declaration. */
+#if @GNULIB_STRERROR_R@
+# if @REPLACE_STRERROR_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strerror_r
+# define strerror_r rpl_strerror_r
+# endif
+_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
+# else
+# if !@HAVE_DECL_STRERROR_R@
+_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
+# endif
+# if @HAVE_DECL_STRERROR_R@
+_GL_CXXALIASWARN (strerror_r);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strerror_r
+# if HAVE_RAW_DECL_STRERROR_R
+_GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
+ "use gnulib module strerror_r-posix for portability");
+# endif
+#endif
+
+#if @GNULIB_STRSIGNAL@
+# if @REPLACE_STRSIGNAL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strsignal rpl_strsignal
+# endif
+_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
+_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
+# else
+# if ! @HAVE_DECL_STRSIGNAL@
+_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
+# endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is
+ 'const char *'. */
+_GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
+# endif
+_GL_CXXALIASWARN (strsignal);
+#elif defined GNULIB_POSIXCHECK
+# undef strsignal
+# if HAVE_RAW_DECL_STRSIGNAL
+_GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
+ "use gnulib module strsignal for portability");
+# endif
+#endif
+
+#if @GNULIB_STRVERSCMP@
+# if !@HAVE_STRVERSCMP@
+_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
+_GL_CXXALIASWARN (strverscmp);
+#elif defined GNULIB_POSIXCHECK
+# undef strverscmp
+# if HAVE_RAW_DECL_STRVERSCMP
+_GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
+ "use gnulib module strverscmp for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
# endif
@PRAGMA_COLUMNS@
-/* On OSF/1, <sys/types.h> and <sys/time.h> include <sys/select.h>.
+/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h>
+ both include <sys/select.h>.
Simply delegate to the system's header in this case. */
-#if @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TYPES_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) && defined _OSF_SOURCE
+#if (@HAVE_SYS_SELECT_H@ \
+ && ((defined __osf__ && defined _SYS_TYPES_H_ && defined _OSF_SOURCE) \
+ || (defined __sun && defined _SYS_TYPES_H \
+ && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \
+ || defined __EXTENSIONS__))) \
+ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H)
# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
-#elif @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TIME_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) && defined _OSF_SOURCE
+#elif (@HAVE_SYS_SELECT_H@ \
+ && ((defined __osf__ && defined _SYS_TIME_H_ && defined _OSF_SOURCE) \
+ || (defined __sun && defined _SYS_TIME_H \
+ && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \
+ || defined __EXTENSIONS__))) \
+ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H)
# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
/* 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);
/* Written by Paul Eggert. */
+#ifndef _@GUARD_PREFIX@_SYS_TIME_H
+
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
-#if defined _@GUARD_PREFIX@_SYS_TIME_H
-
-/* Simply delegate to the system's header, without adding anything. */
-# if @HAVE_SYS_TIME_H@
-# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
-# endif
-
-#else
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_SYS_TIME_H@
+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+#endif
-# define _@GUARD_PREFIX@_SYS_TIME_H
+#ifndef _@GUARD_PREFIX@_SYS_TIME_H
+#define _@GUARD_PREFIX@_SYS_TIME_H
-# if @HAVE_SYS_TIME_H@
-# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
-# else
-# include <time.h>
-# endif
+#if ! @HAVE_SYS_TIME_H@
+# include <time.h>
+#endif
/* On native Windows with MSVC, get the 'struct timeval' type.
Also, on native Windows with a 64-bit time_t, where we are overriding the
'struct timeval' type, get all declarations of system functions whose
signature contains 'struct timeval'. */
-# if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
-# define _GL_INCLUDING_WINSOCK2_H
-# include <winsock2.h>
-# undef _GL_INCLUDING_WINSOCK2_H
-# endif
+#if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
+# define _GL_INCLUDING_WINSOCK2_H
+# include <winsock2.h>
+# undef _GL_INCLUDING_WINSOCK2_H
+#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
-# ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
-# endif
+#endif
-# if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
+#if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
-# if @REPLACE_STRUCT_TIMEVAL@
-# define timeval rpl_timeval
-# endif
+# if @REPLACE_STRUCT_TIMEVAL@
+# define timeval rpl_timeval
+# endif
-# if !GNULIB_defined_struct_timeval
+# if !GNULIB_defined_struct_timeval
struct timeval
{
time_t tv_sec;
long int tv_usec;
};
-# define GNULIB_defined_struct_timeval 1
-# endif
-
+# define GNULIB_defined_struct_timeval 1
# endif
-# ifdef __cplusplus
+#endif
+
+#ifdef __cplusplus
}
-# endif
+#endif
-# if @GNULIB_GETTIMEOFDAY@
-# if @REPLACE_GETTIMEOFDAY@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef gettimeofday
-# define gettimeofday rpl_gettimeofday
-# endif
+#if @GNULIB_GETTIMEOFDAY@
+# if @REPLACE_GETTIMEOFDAY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gettimeofday
+# define gettimeofday rpl_gettimeofday
+# endif
_GL_FUNCDECL_RPL (gettimeofday, int,
(struct timeval *restrict, void *restrict)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gettimeofday, int,
(struct timeval *restrict, void *restrict));
-# else
-# if !@HAVE_GETTIMEOFDAY@
+# else
+# if !@HAVE_GETTIMEOFDAY@
_GL_FUNCDECL_SYS (gettimeofday, int,
(struct timeval *restrict, void *restrict)
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
/* Need to cast, because on glibc systems, by default, the second argument is
struct timezone *. */
_GL_CXXALIAS_SYS_CAST (gettimeofday, int,
(struct timeval *restrict, void *restrict));
-# endif
+# endif
_GL_CXXALIASWARN (gettimeofday);
-# elif defined GNULIB_POSIXCHECK
-# undef gettimeofday
-# if HAVE_RAW_DECL_GETTIMEOFDAY
+#elif defined GNULIB_POSIXCHECK
+# undef gettimeofday
+# if HAVE_RAW_DECL_GETTIMEOFDAY
_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
"use gnulib module gettimeofday for portability");
-# endif
# endif
+#endif
/* Hide some function declarations from <winsock2.h>. */
-# if defined _MSC_VER && @HAVE_WINSOCK2_H@
-# if !defined _@GUARD_PREFIX@_UNISTD_H
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef close
-# define close close_used_without_including_unistd_h
-# else
+#if defined _MSC_VER && @HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_UNISTD_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close close_used_without_including_unistd_h
+# else
_GL_WARN_ON_USE (close,
"close() used without including <unistd.h>");
-# endif
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef gethostname
-# define gethostname gethostname_used_without_including_unistd_h
-# else
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gethostname
+# define gethostname gethostname_used_without_including_unistd_h
+# else
_GL_WARN_ON_USE (gethostname,
"gethostname() used without including <unistd.h>");
-# endif
# endif
-# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef socket
-# define socket socket_used_without_including_sys_socket_h
-# undef connect
-# define connect connect_used_without_including_sys_socket_h
-# undef accept
-# define accept accept_used_without_including_sys_socket_h
-# undef bind
-# define bind bind_used_without_including_sys_socket_h
-# undef getpeername
-# define getpeername getpeername_used_without_including_sys_socket_h
-# undef getsockname
-# define getsockname getsockname_used_without_including_sys_socket_h
-# undef getsockopt
-# define getsockopt getsockopt_used_without_including_sys_socket_h
-# undef listen
-# define listen listen_used_without_including_sys_socket_h
-# undef recv
-# define recv recv_used_without_including_sys_socket_h
-# undef send
-# define send send_used_without_including_sys_socket_h
-# undef recvfrom
-# define recvfrom recvfrom_used_without_including_sys_socket_h
-# undef sendto
-# define sendto sendto_used_without_including_sys_socket_h
-# undef setsockopt
-# define setsockopt setsockopt_used_without_including_sys_socket_h
-# undef shutdown
-# define shutdown shutdown_used_without_including_sys_socket_h
-# else
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef socket
+# define socket socket_used_without_including_sys_socket_h
+# undef connect
+# define connect connect_used_without_including_sys_socket_h
+# undef accept
+# define accept accept_used_without_including_sys_socket_h
+# undef bind
+# define bind bind_used_without_including_sys_socket_h
+# undef getpeername
+# define getpeername getpeername_used_without_including_sys_socket_h
+# undef getsockname
+# define getsockname getsockname_used_without_including_sys_socket_h
+# undef getsockopt
+# define getsockopt getsockopt_used_without_including_sys_socket_h
+# undef listen
+# define listen listen_used_without_including_sys_socket_h
+# undef recv
+# define recv recv_used_without_including_sys_socket_h
+# undef send
+# define send send_used_without_including_sys_socket_h
+# undef recvfrom
+# define recvfrom recvfrom_used_without_including_sys_socket_h
+# undef sendto
+# define sendto sendto_used_without_including_sys_socket_h
+# undef setsockopt
+# define setsockopt setsockopt_used_without_including_sys_socket_h
+# undef shutdown
+# define shutdown shutdown_used_without_including_sys_socket_h
+# else
_GL_WARN_ON_USE (socket,
"socket() used without including <sys/socket.h>");
_GL_WARN_ON_USE (connect,
"setsockopt() used without including <sys/socket.h>");
_GL_WARN_ON_USE (shutdown,
"shutdown() used without including <sys/socket.h>");
-# endif
# endif
-# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef select
-# define select select_used_without_including_sys_select_h
-# else
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef select
+# define select select_used_without_including_sys_select_h
+# else
_GL_WARN_ON_USE (select,
"select() used without including <sys/select.h>");
-# endif
# endif
# endif
+#endif
#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
+#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
--- /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
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+#ifndef _@GUARD_PREFIX@_UNISTD_H
+
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
-/* Special invocation convention:
- - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
- but we need to ensure that both the system <unistd.h> and <winsock2.h>
- are completely included before we replace gethostname. */
-#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
- && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
-/* <unistd.h> is being indirectly included for the first time from
- <winsock2.h>; avoid declaring any overrides. */
-# if @HAVE_UNISTD_H@
-# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
-# else
-# error unexpected; report this to bug-gnulib@gnu.org
-# endif
-# define _GL_WINSOCK2_H_WITNESS
-
-/* Normal invocation. */
-#elif !defined _@GUARD_PREFIX@_UNISTD_H
-
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_UNISTD_H@
# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
/* But avoid namespace pollution on glibc systems. */
#ifndef __GLIBC__
+# define __need_system_stdlib_h
# include <stdlib.h>
+# undef __need_system_stdlib_h
#endif
/* Native Windows platforms declare chdir, getcwd, rmdir in
/* Get getopt(), optarg, optind, opterr, optopt.
But avoid namespace pollution on glibc systems. */
#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
+# define __need_getopt
# 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/>. */
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the name == NULL test below. */
+#define _GL_ARG_NONNULL(params)
+
+#include <config.h>
+
+/* 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-02-10 Michael Albinus <michael.albinus@gmx.de>
+2013-02-13 Michael Albinus <michael.albinus@gmx.de>
* net/ange-ftp.el (ange-ftp-make-directory): Don't raise an error,
if DIR exists and PARENTS is non-nil.
-2013-02-09 Chong Yidong <cyd@gnu.org>
+2013-02-13 Juanma Barranquero <lekktu@gmail.com>
+
+ * progmodes/js.el (js--multi-line-declaration-indentation):
+ Silence byte-compiler warning.
+
+2013-02-12 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-adb.el (tramp-adb-handle-start-file-process): Rewrite.
+
+ * net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache'
+ only if it doesn't exist.
+
+ * net/tramp-sh.el (tramp-sh-handle-start-file-process): Set
+ process marker.
+
+2013-02-12 Tassilo Horn <tsdh@gnu.org>
+
+ * doc-view.el (doc-view-odf->pdf-converter-soffice): Use separate
+ UserInstallation when calling soffice to work around LibreOffice
+ bug 37531.
+
+2013-02-12 Glenn Morris <rgm@gnu.org>
+
+ * files.el (basic-save-buffer):
+ Offer to create a non-existing directory. (Bug#3016)
+
+ * calc/calc-graph.el (calc-graph-show-dumb):
+ * calendar/calendar.el (calendar-mode-map):
+ * cus-edit.el (custom-mode-map):
+ * ehelp.el (electric-help-map):
+ * emulation/vip.el (vip-mode-map):
+ * epa.el (epa-key-list-mode-map):
+ * info.el (Info-mode-map):
+ * mail/rmail.el (rmail-mode-map):
+ * mail/rmailsum.el (rmail-summary-mode-map):
+ * man.el (Man-mode-map):
+ * net/newst-plainview.el (newsticker-mode-map):
+ * progmodes/cpp.el (cpp-edit-mode-map):
+ * progmodes/grep.el (grep-mode-map):
+ * progmodes/idlw-help.el (idlwave-help-mode-map):
+ * simple.el (special-mode-map):
+ * startup.el (splash-screen-keymap):
+ * view.el (view-mode-map):
+ Make S-SPC scroll in the opposite sense to SPC. (Bug#2145)
+
+2013-02-11 Elias Pipping <pipping@lavabit.com>
+
+ * doc-view.el (doc-view-current-cache-dir): Beware % escapes
+ (bug#13679).
+
+2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * cus-start.el (all): Remove inhibit-local-menu-bar-menus.
+
+2013-02-11 Glenn Morris <rgm@gnu.org>
+
+ * vc/diff.el (diff-use-labels): New variable.
+ (diff-no-select): Use --label rather than -L, and first
+ check that it is supported. (Bug#11067)
+
+ * files.el (enable-dir-local-variables): New variable.
+ (hack-dir-local-variables): Respect enable-dir-local-variables.
+ * tutorial.el (help-with-tutorial):
+ Ignore directory-local variables. (Bug#11127)
+
+ * vc/vc-svn.el (vc-svn-command): Move --non-interactive from here...
+ (vc-svn-global-switches): ... to here. (Bug#13513)
+
+2013-02-10 Christopher Schmidt <christopher@ch.ristopher.com>
+
+ * minibuf-eldef.el (minibuffer-default--in-prompt-regexps):
+ Handle "foo (bar, default: xxx): " prompts.
+
+2013-02-10 Chong Yidong <cyd@gnu.org>
+
+ * files.el (basic-save-buffer-1): Do not set
+ buffer-file-coding-system-explicit (Bug#4533).
* mail/emacsbug.el (report-emacs-bug): Change binding of
report-emacs-bug-insert-to-mailer to C-c M-i (Bug#13510).
-2013-02-02 Alan Mackenzie <acm@muc.de>
+2013-02-09 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc.el (calc-allow-units-as-numbers): New variable.
+ * calc/calc-units.el (calc-convert-units): Use new variable.
+
+2013-02-09 Eli Zaretskii <eliz@gnu.org>
+
+ * subr.el (buffer-file-type, default-buffer-file-type): Remove.
+
+ * net/ange-ftp.el (ange-ftp-insert-file-contents): Don't reference
+ buffer-file-type.
+
+ * mail/feedmail.el (feedmail-force-binary-write): Doc fix.
+ (feedmail-run-the-queue, feedmail-dump-message-to-queue)
+ (feedmail-send-it-immediately): Don't bind buffer-file-type, bind
+ coding-system-for-write instead.
+
+ * jka-compr.el (jka-compr-write-region): Don't bind
+ buffer-file-type.
+
+ * emacs-lisp/bytecomp.el (byte-compile-file): Don't bind
+ buffer-file-type.
+
+ * files.el (file-name-buffer-file-type-alist): Remove defvar.
+ (insert-file-contents-literally): Remove reference to
+ file-name-buffer-file-type-alist.
+
+ * dos-w32.el (file-name-buffer-file-type-alist): Deprecate and
+ make-obsolete.
+ (find-buffer-file-type-match, find-buffer-file-type): Remove.
+ (find-buffer-file-type-coding-system): Remove references to
+ find-buffer-file-type-match, find-buffer-file-type, and
+ buffer-file-type.
+ Don't put find-buffer-file-type-coding-system into
+ file-coding-system-alist.
+ (find-file-binary, find-file-text): Bind coding-system-for-read
+ instead of file-name-buffer-file-type-alist.
+
+2013-02-09 Jambunathan K <kjambunathan@gmail.com>
+
+ * doc-view.el: Use (and prefer) soffice as default ODF->PDF
+ converter (Bug#13622).
+ (doc-view-unoconv-program): Make obsolete alias.
+ (doc-view-odf->pdf-converter-program): New variable.
+ (doc-view-odf->pdf-converter-function): New variable.
+ (doc-view-mode-p): Use it.
+ (doc-view-odf->pdf-converter-unoconv):
+ Rename from `doc-view-odf->pdf-converter-unoconv'.
+ (doc-view-odf->pdf-converter-soffice): New function.
+ (doc-view-convert-current-doc):
+ Use `doc-view-odf->pdf-converter-function'.
+
+2013-02-09 Chong Yidong <cyd@gnu.org>
+
+ * minibuffer.el (minibuffer-inactive-mode-map): Bind mouse-1 to
+ view-echo-area-messages (Bug#13340).
+
+ * help.el (view-echo-area-messages): Use display-buffer.
+
+ * dired-x.el (dired-do-run-mail): Prompt for confirmation
+ (Bug#13561).
+
+2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/byte-run.el (eval-when-compile, eval-and-compile):
+ Eval body right away, now that we do eager macroexpansion (bug#13605).
+
+ * simple.el (end-of-buffer): Don't touch unrelated windows (bug#13466).
+ (fundamental-mode): Use run-mode-hooks.
+
+ * eshell/esh-proc.el (eshell/kill): Fix last change.
+ * eshell/em-ls.el (eshell-ls-dir): Fix use of CL in last change.
+
+2013-02-08 Aidan Gauland <aidalgol@no8wireless.co.nz>
+
+ * eshell/esh-proc.el (eshell/kill): Rewrite.
+
+ * eshell/em-ls.el (show-almost-all): Declare.
+ (eshell-do-ls): Add support for -A argument.
+
+2013-02-08 Jambunathan K <kjambunathan@gmail.com>
+
+ * icomplete.el (icomplete-forward-completions)
+ (icomplete-backward-completions): Handle corner case (bug#13602).
+
+2013-02-07 Michael Albinus <michael.albinus@gmx.de>
+
+ * vc/vc-hooks.el (vc-find-file-hook): `buffer-file-truename' can
+ be nil. Handle this. (Bug#13636)
+
+2013-02-07 Richard Stallman <rms@gnu.org>
+
+ * mail/rmail.el (rmail-variables): Specify `no-conversion' for
+ `save-buffer-coding-system'.
+
+2013-02-07 Alan Mackenzie <acm@muc.de>
- Fix bug in the state cache mechanism. Remove 'BOD "strategy". Refactor.
+ Fix bug in state cache mechanism. Remove 'BOD "strategy". Refactor.
* progmodes/cc-engine.el (c-get-fallback-scan-pos): Remove.
(c-parse-state-get-strategy): Don't return 'BOD any more.
- (c-append-lower-brace-pair-to-state-cache): Extra parameter HERE
- instead of narrowing. Widen to top of buffer before searching
- backwards for a brace pair.
- (c-state-push-any-brace-pair): Add HERE parameter to function
- call.
- (c-append-to-state-cache): Extra parameter HERE in place of
- narrowing. Narrow to parameter HERE, in place of being called
- narrowed.
+ (c-append-lower-brace-pair-to-state-cache):
+ Extra parameter HERE instead of narrowing.
+ Widen to top of buffer before searching backwards for a brace pair.
+ (c-state-push-any-brace-pair): Add HERE parameter to function call.
+ (c-append-to-state-cache): Extra parameter HERE in place of narrowing.
+ Narrow to parameter HERE, in place of being called narrowed.
(c-remove-stale-state-cache): Extra parameter HERE in place of
narrowing. Check there's an open brace in the cache before
searching for its match.
(c-invalidate-state-cache-1): Add HERE parameter to function call.
(c-parse-state-1): Don't narrow here for 'forward strategy,
- instead passing extra parameter HERE to several functions. Remove
- 'BOD strategy.
+ instead passing extra parameter HERE to several functions.
+ Remove 'BOD strategy.
-2013-02-01 Stefan Monnier <monnier@iro.umontreal.ca>
+2013-02-06 Nicolas Richard <theonewiththeevillook@yahoo.fr> (tiny change)
+
+ * emacs-lisp/package.el (describe-package-1): Tell what archive is
+ used to install the package.
+
+2013-02-06 Glenn Morris <rgm@gnu.org>
+
+ * vc/vc-hooks.el (vc-find-file-hook): Don't ask about following links
+ if we can't get user input. (Bug#6567)
+
+ * startup.el (command-line): If simple.el is missing,
+ test and warn about for some possible causes.
+
+2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
+
+ * cus-start.el (all): Add ns-use-native-fullscreen.
+
+2013-02-05 Glenn Morris <rgm@gnu.org>
+
+ * profiler.el (profiler-report-mode-map): Add a restart menu entry.
+
+ * play/gamegrid.el (gamegrid-add-score-with-update-game-score):
+ Fix directory creation in fallback case.
+
+2013-02-04 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+
+ * vc/vc.el (vc-next-action): Fix inf-loop (bug#13610).
+ (vc-update-change-log): Use dolist.
+
+2013-02-04 Chong Yidong <cyd@gnu.org>
+
+ * thingatpt.el: Rewrite the URL detection routines, absorbing some
+ code from ffap.el.
+ (thing-at-point-beginning-of-url-regexp): New var.
+ (thing-at-point-uri-schemes): Update list of URI schemes.
+ (thing-at-point-url-regexp): Variable deleted.
+ (thing-at-point-markedup-url-regexp): Disallow newlines.
+ (thing-at-point-newsgroup-regexp)
+ (thing-at-point-newsgroup-heads)
+ (thing-at-point-default-mail-uri-scheme): New variables.
+ (thing-at-point-bounds-of-url-at-point): Rewrite. Use ffap's
+ method to find the possible bounds of the URI at point.
+ New optional argument to find ill-formed URIs.
+ (thing-at-point-url-at-point): Rewrite. New arguments for finding
+ ill-formed URIs. Use thing-at-point-bounds-of-url-at-point, and
+ the scheme-adding heuristics from ffap-url-at-point.
+ (thing-at-point--bounds-of-well-formed-url): New function.
+ Do parens matching to decide whether to include parens in the URI
+ (Bug#9153).
+
+ * ffap.el: Require thingatpt.
+ (ffap-url-at-point): Delegate URI detection to thing-at-point.
+ All URI-valid characters are now recognized (Bug#5673).
+ (ffap-string-at-point): Use use-region-p.
+ (ffap-url-regexp): Extra character is handled by thing-at-point.
+ (ffap-string-at-point-mode-alist): Allow parentheses.
+ (ffap-newsgroup-regexp, ffap-newsgroup-heads, ffap-newsgroup-p):
+ Convert to aliases; code moved to thingatpt.el.
+ (ffap-gnus-hook): Use setq-local.
+
+2013-02-04 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/ert.el (ert--explain-format-atom):
+ Don't try to print non-characters as characters. (Bug#13543)
+
+2013-02-03 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-debug-message): Extend function exclude list.
+ (tramp-backtrace): New defun.
+ (tramp-handle-insert-file-contents): Use `visit' when inserting
+ the local copy.
+
+ * net/tramp-sh.el (tramp-sh-handle-set-visited-file-modtime):
+ Use `remote-file-name-inhibit-cache'.
+
+2013-02-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/cperl-mode.el (cperl-mode): Avoid byte-compile warning
+ (bug#13614).
+
+ * subr.el (internal--called-interactively-p--get-frame): Avoid filling
+ current-load-list (bug#13366).
+
+2013-02-02 Christopher Schmidt <christopher@ch.ristopher.com>
+
+ * progmodes/compile.el (compilation-error-regexp-alist-alist):
+ Identify g++ template instantiation trace. (Bug#12287)
+ (compilation-mode-hook, compilation-start-hook)
+ (compilation-window-height): Simplify docstrings. (Bug#13379)
+
+2013-02-02 Stefan Monnier <monnier@iro.umontreal.ca>
* mouse.el (mouse-drag-track): Always deactivate the mark before
running the final event's command since that command is in charge of
activating the mark if needed (bug#13523).
-2013-02-01 Juri Linkov <juri@jurta.org>
+2013-02-02 Juri Linkov <juri@jurta.org>
* replace.el (perform-replace): Move let-bindings of isearch-*
variables deeper to the loop that searches for the next match.
first element of isearch-cmds as a precaution when it's used
with inactive isearch.
-2013-02-01 Andrew W. Nosenko <andrew.w.nosenko@gmail.com> (tiny change)
+2013-02-02 Andrew W. Nosenko <andrew.w.nosenko@gmail.com> (tiny change)
* net/tramp.el (tramp-check-for-regexp): Avoid "Args out of range"
error when buffer in question is narrowed so position 1 is out of
visible part.
-2013-01-31 Glenn Morris <rgm@gnu.org>
+2013-02-02 Glenn Morris <rgm@gnu.org>
* textmodes/remember.el (remember-clipboard): Doc fix.
-2013-01-30 Stefan Monnier <monnier@iro.umontreal.ca>
+2013-02-02 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/make-mode.el (makefile-fill-paragraph): Reset syntax-table
properties (bug#13179).
+2013-02-02 Juri Linkov <juri@jurta.org>
+
+ * progmodes/grep.el (grep-regexp-alist): Use variable grep-match-face
+ instead of hard-coded default face `match'. (Bug#9438)
+
+2012-02-01 Christopher Schmidt <christopher@ch.ristopher.com>
+
+ * vc/vc-arch.el (vc-arch-registered):
+ * vc/vc-bzr.el (vc-bzr-registered):
+ * vc/vc-cvs.el (vc-cvs-registered):
+ * vc/vc-git.el (vc-git-registered):
+ * vc/vc-hg.el (vc-hg-registered):
+ * vc/vc-mtn.el (vc-mtn-registered):
+ * vc/vc-svn.el (vc-svn-registered): Suppress load messages.
+ (Bug#13139)
+
+ * info.el (Info-next-reference, Info-prev-reference): Add numeric
+ prefix argument. (Bug#11656)
+
+2013-02-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * help-fns.el (help-split-fundoc): Don't insert byte-compiled body.
+
+2013-02-01 Glenn Morris <rgm@gnu.org>
+
+ * vc/vc-hooks.el (vc-menu-map): Disable vc-rollback menu item
+ if the backend is known not to support it.
+
+ * imenu.el (imenu-default-create-index-function):
+ Tweak infinite loop test to check for forward motion as well as none.
+
+2013-02-01 Alex Harsanyi <AlexHarsanyi@gmail.com>
+
+ * net/soap-client.el (soap-invoke): Encode the string for
+ `url-request-data' as UTF-8.
+ Fixes <http://code.google.com/p/emacs-soap-client/issues/detail?id=16>.
+
+2013-02-01 Glenn Morris <rgm@gnu.org>
+
+ * calc/calc-help.el (calc-view-news): Use view-emacs-news.
+
+ * calc/README, calc/README.prev: Rename/merge to etc/CALC-NEWS.
+
+2013-01-31 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-tramp-file-p): Comment check for
+ `string-as-unibyte'. The function does not exist on XEmacs, and
+ likely we need another approach.
+
+ * net/tramp-sh.el (tramp-compute-multi-hops): Check, whether
+ `tramp-gw-*' variables are bound.
+
+2013-01-31 Glenn Morris <rgm@gnu.org>
+
+ * files.el (basic-save-buffer-2): Choose coding system for
+ writing the file before backing it up, to reduce delay between
+ backing up and writing the new version. (Bug#13522)
+
+2013-01-31 Michal Nazarewicz <mina86@mina86.com>
+
+ * simple.el (cycle-spacing): New command.
+ (just-one-space): Use it.
+
+2013-01-31 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/opascal.el: Rename from delphi.el. Use lexical-binding.
+ (opascal-newline-always-indents): Remove custom.
+ (opascal-tab, opascal-newline): Remove commands.
+ (opascal-new-comment-line): Insert "\n" instead of calling newline.
+ (opascal-mode-map): Keep default bindings for RET and TAB and DEL.
+ (opascal-save-match-data): Remove, use save-match-data instead.
+ (opascal-save-state): Use with-silent-modifications.
+
+ * progmodes/pascal.el (pascal-mode-syntax-table): Accept //..\n comments
+ (bug#13585).
+
+2013-01-30 Juri Linkov <juri@jurta.org>
+
+ * frame.el (toggle-frame-maximized, toggle-frame-fullscreen):
+ Use fullboth as an alias for fullscreen. Suggested by Jan Djärv in
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00203.html>.
+
+2013-01-30 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/make-mode.el (makefile-backslash-region): Don't compute
+ column if we're just deleting the backslashes.
+ (makefile-fill-paragraph): Use eolp.
+
+2013-01-30 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (auto-revert-use-notify): Fix docstring.
+
+2013-01-30 Leo Liu <sdl.web@gmail.com>
+
+ * imenu.el (imenu--truncate-items): Fix subalist checking (bug#13576).
+
2013-01-30 Glenn Morris <rgm@gnu.org>
* mouse.el (mouse-drag-line): Avoid pushing same event onto
(python-pdbtrack-comint-output-filter-function): Enhancements on
stacktrace detection. (thanks @gnovak)
+2013-01-30 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * jit-lock.el (jit-lock-stealth-chunk-start): Don't widen (bug#13542).
+ (jit-lock-mode, jit-lock-functions, jit-lock-context-unfontify-pos):
+ Use defvar-local.
+ (jit-lock-register): Use setq-local.
+
+2013-01-30 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc-units.el (math-default-units-table): Remove initial value.
+ (calc-convert-units): Treat expressions where all the units cancel as
+ if they didn't have units.
+
+2013-01-30 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-process-connection-type): Fix docstring.
+ (tramp-completion-reread-directory-timeout): Fix type.
+ (tramp-connection-min-time-diff): New defcustom.
+
+ * net/tramp-sh.el (tramp-maybe-open-connection): Use it.
+
2013-01-30 Glenn Morris <rgm@gnu.org>
* imenu.el (imenu-default-create-index-function):
Put back a version of the infinite loop test removed 2013-01-23.
-2013-01-28 Fabián Ezequiel Gallina <fgallina@cuca>
+2013-01-30 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (python-shell-parse-command):
Find python-shell-interpreter with modified environment.
-2013-01-26 Stefan Monnier <monnier@iro.umontreal.ca>
+2013-01-30 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl.el (cl-set-getf): Add compatibility alias.
-2013-01-24 Fabián Ezequiel Gallina <fgallina@cuca>
+2013-01-29 Alan Mackenzie <acm@muc.de>
+
+ Amend to fontify /regexp/s in actions correctly.
+ * cc-awk.el (c-awk-harmless-char-re, c-awk-harmless-string*-re):
+ (c-awk-harmless-string*-here-re): Braces, parens and semicolons
+ are no longer included.
+ (c-awk-harmless-line-char-re, c-awk-harmless-line-string*-re):
+ What used to be these variables without "-line" in the name.
+ (c-awk-neutral-re): { is no longer neutral. Escaped newlines now are.
+ (c-awk-non-arith-op-bra-re): Now also matches {.
+ (c-awk-pre-exp-alphanum-kwd-re): New regexp to match "print",
+ "return", and "case".
+ (c-awk-kwd-regexp-sign-re): New, to match "print", etc., followed
+ by /.
+ (c-awk-syntax-tablify-/): Check special cases "print /re/", etc.
+ (c-awk-set-syntax-table-properties): Extend FSM to handle {,},(,),;.
+
+2013-01-29 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (auto-revert-use-notify):
+ Use `custom-initialize-default' for initialization. (Bug#13583)
+
+ * net/ange-ftp.el (ange-ftp-skip-msgs): Add another message.
+
+ * net/tramp-sh.el (tramp-sh-handle-start-file-process):
+ Catch `suppress'. Otherwise, `tramp-run-real-handler' might be called
+ in `tramp-file-name-handler'.
+ (tramp-gw-tunnel-method, tramp-gw-socks-method): Declare for
+ compatibility.
+ (tramp-compute-multi-hops): Check, whether
+ `tramp-gw-tunnel-method' and `tramp-gw-socks-method' are non-nil.
+
+2013-01-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * hi-lock.el (hi-lock-unface-buffer): Don't assume `face' is a symbol
+ (bug#13297).
+
+2013-01-27 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-font-lock-keywords): Remove some
+ checks made superfluous by the \_< operator.
+ * progmodes/ruby-mode.el (ruby-move-to-block): Work with (maybe
+ temporarily) broken indentation.
+ * progmodes/ruby-mode.el (ruby-font-lock-keywords):
+ Highlight nested constants, too. \_< broke that.
+
+2013-01-27 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * progmodes/ruby-mode.el (ruby-font-lock-keywords): Use "\\_<"
+ instead of "\\b".
+
+2013-01-27 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (auto-revert-handler): Notifications which result
+ from a saved file shall not be taken into account. (Bug#13557)
+
+2013-01-26 Andreas Schwab <schwab@linux-m68k.org>
+
+ * emacs-lisp/lisp-mode.el (lisp-mode-variables): Add optional
+ parameter BAR-NOT-SYMBOL to control syntax of | for font-lock.
+ (lisp-mode): Pass t for it. (Bug#13556)
+
+2013-01-25 Alan Mackenzie <acm@muc.de>
+
+ AWK Mode: Fix indentation bug at top level. Bug #12274.
+
+ * progmodes/cc-engine.el (c-guess-basic-syntax): Move CASE 5P to
+ just before CASE 5D.
+
+2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * net/socks.el (socks-nslookup-host): Use string-to-number.
+
+2013-01-25 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (auto-revert-remote-files)
+ (auto-revert-notify-exclude-dir-regexp): New defcustoms.
+ (auto-revert-notify-enabled, auto-revert-use-notify)
+ (auto-revert-notify-watch-descriptor-hash-list)
+ (auto-revert-notify-modified-p, auto-revert-notify-event-p)
+ (auto-revert-notify-event-descriptor)
+ (auto-revert-notify-event-action)
+ (auto-revert-notify-event-file-name): Doc fix.
+ (global-auto-revert-mode): Reorder checks.
+ (auto-revert-notify-rm-watch): Respect changed values of
+ `auto-revert-notify-watch-descriptor-hash-list'.
+ (auto-revert-notify-add-watch): Check for
+ `auto-revert-notify-exclude-dir-regexp'. Adapt filters for
+ `inotify-add-watch'. Watch `default-directory' instead of
+ `buffer-file-name'. `auto-revert-notify-watch-descriptor-hash-list'
+ has a changed meaning now. (Bug#13540)
+ (auto-revert-notify-handler): Change implementation wrt events
+ returning from a directory.
+ (auto-revert-handler): Reorder implementation for checks of remote
+ files.
+ (auto-revert-buffers): Fix parentheses error.
+
+2013-01-25 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el: Enhancements to header documentation about
skeletons. (Bug#5716)
-2013-01-23 Fabián Ezequiel Gallina <fgallina@cuca>
-
* imenu.el (imenu-default-create-index-function): Remove useless
infinite loop check. (Bug#13438)
-2013-01-23 Alan Mackenzie <acm@muc.de>
+2013-01-25 Alan Mackenzie <acm@muc.de>
Fix a bug in the state cache mechanism. Refactor this a bit.
(c-parse-state-1): Change the calling conventions to the two
defuns involving `cache-pos'.
-2013-01-23 Chong Yidong <cyd@gnu.org>
+2013-01-25 Chong Yidong <cyd@gnu.org>
* xml.el (xml-entity-or-char-ref-re): Fix regexp.
-2013-01-18 Leo Liu <sdl.web@gmail.com>
+2013-01-24 Aaron Ecay <aaronecay@gmail.com> (tiny change)
+
+ * paren.el (show-paren-function): Make sure to set 'priority and
+ 'face only if the overlay does exist.
+
+2013-01-24 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-tramp-file-p): Check, whether NAME is unibyte.
+
+ * net/tramp-sh.el (tramp-sh-handle-set-file-acl): Do not suppress
+ basic attributes.
+ (tramp-sh-handle-set-file-acl): Improve error checking.
+
+2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * doc-view.el (doc-view-display): Force mode line update until all
+ document is converted. Suggested by Stefan Monnier (Bug#13164).
+
+2013-01-23 Bastien Guerry <bzg@gnu.org>
+
+ * paren.el (show-paren-function): Make sure an overlay exists
+ before trying to delete it. Also use `pos' as a position only
+ when it is an integer.
+
+2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * play/gametree.el (gametree-break-line-here): Use point-marker.
+
+2013-01-22 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-cmds.el (tramp-bug, tramp-append-tramp-buffers):
+ Mark descriptive parts with `display' property.
+
+2013-01-21 Agustín Martín Domingo <agustin.martin@hispalinux.es>
+
+ * textmodes/ispell.el (ispell-hunspell-dictionary-equivs-alist):
+ New variable to map standard dict names to hunspell ones.
+ (ispell-set-spellchecker-params): Make sure specific dict names
+ are used for standard dicts with hunspell.
+
+2013-01-21 Tassilo Horn <tsdh@gnu.org>
+
+ * textmodes/reftex-cite.el (reftex-format-citation): Add format
+ chars for note (%N) and url (%U).
+ * textmodes/reftex-vars.el (reftex-cite-format): Document them.
+
+2013-01-21 Juri Linkov <juri@jurta.org>
+
+ * frame.el: Bind `f10' in `esc-map' to `toggle-frame-maximized'
+ in addition to existing separate binding `meta f10' in `global-map'.
+ (Bug#13484)
+
+2013-01-21 Michael Albinus <michael.albinus@gmx.de>
+
+ Improve XEmacs compatibility.
+
+ * net/tramp.el (tramp-replace-environment-variables): Make it a defun.
+
+ * net/tramp-adb.el (top): Require `time-date'.
+ (tramp-adb-ls-output-time-less-p): Use `tramp-time-less-p'.
+ (tramp-adb-handle-copy-file, tramp-adb-handle-rename-file):
+ Use `tramp-file-name-handler'.
+ (tramp-adb-maybe-open-connection):
+ Use `tramp-compat-set-process-query-on-exit-flag'.
+
+ * net/tramp-sh.el (tramp-sh-handle-file-acl):
+ Use `tramp-compat-funcall'.
+
+ * net/tramp-smb.el (tramp-smb-handle-file-acl): Use `looking-at' and
+ `tramp-compat-funcall'.
+
+2013-01-21 Jürgen Hötzel <juergen@archlinux.org>
+
+ * net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete
+ reimplementation using "adb shell command ..." instead of running
+ remote shell interactively.
+
+2013-01-20 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/lisp-mode.el (emacs-lisp-mode-map):
+ Add native profiler menu entries.
+
+ * profiler.el (profiler-running-p): New function.
+ (profiler-cpu-profile): Use profiler-running-p.
+ (profiler-report-mode-map): Add some more menu entries.
+
+2013-01-19 Glenn Morris <rgm@gnu.org>
+
+ * mail/unrmail.el (unrmail): Do not mangle the mbox From line;
+ fixes 2012-12-07 change. (Bug#13499)
+
+2013-01-19 Leo Liu <sdl.web@gmail.com>
* dired.el (dired-get-marked-files): Prune erroneous values due to
last change. (Bug#13152)
-2013-01-17 Glenn Morris <rgm@gnu.org>
+2013-01-19 Glenn Morris <rgm@gnu.org>
* progmodes/etags.el (tags-table-check-computed-list):
Preserve point in tags buffer. (Bug#13412)
-2013-01-16 Glenn Morris <rgm@gnu.org>
-
* emacs-lisp/lisp-mode.el (lisp-indent-function): Doc fix.
- * mail/rmailmm.el (rmail-insert-mime-forwarded-message):
- Revert 2012-12-29 change. Ref:
- <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00360.html>
+2013-01-19 Christian Wittern <cwittern@gmail.com> (tiny change)
+ Chong Yidong <cyd@gnu.org>
+
+ * image-mode.el (image-next-file, image-previous-file):
+ New commands (Bug#8453).
+ (image-mode-map): Bind them to n and p.
+ (image-mode--images-in-directory): New helper function.
+
+2013-01-19 Chong Yidong <cyd@gnu.org>
+
+ * image-mode.el (image-mode-fit-frame): Add a frame argument.
+ Suggested by Drew Adams (Bug#7730). Handle window decorations;
+ save and restore the old window configuration.
+
+2013-01-18 Leo Liu <sdl.web@gmail.com>
+
+ * progmodes/js.el: Tweak autoload cookie for alias.
+
+2013-01-17 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (auto-revert-notify-watch-descriptor): Make it
+ buffer local, again. This was lost with the fix on 2013-01-12.
+
+2013-01-17 Jürgen Hötzel <juergen@archlinux.org>
+
+ * eshell/esh-util.el (eshell-path-env): Make it buffer local, in
+ order to support several eshell buffers in parallel.
+
+2013-01-17 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (auto-revert-use-notify): In the :set function, do
+ not modify `kill-buffer-hook'.
+ (auto-revert-notify-rm-watch):
+ Remove `auto-revert-notify-rm-watch' from `kill-buffer-hook'.
+ (auto-revert-notify-add-watch): Do not call
+ `auto-revert-notify-rm-watch', but add it to a buffer local
+ `kill-buffer-hook'.
+
+2013-01-16 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/trace.el (trace--read-args): Use a closure and an honest
+ call to `eval' rather than a backquoted lambda.
+
+2013-01-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/nadvice.el (advice--tweak): Make it possible for `tweak'
+ to return an explicit nil.
+ (advice--remove-function): Change accordingly.
+
+ * emacs-lisp/advice.el (ad-preactivate-advice): Adjust the cleanup to
+ the use of nadvice.el.
+
+ * progmodes/which-func.el (which-function): Silence imenu errors
+ (bug#13433).
+
+2013-01-15 Michael R. Mauger <mmaug@yahoo.com>
+
+ * progmodes/sql.el: (sql-imenu-generic-expression):
+ (sql-mode-font-lock-object-name): Match schema qualified names.
+ (sql-connect): Use string keys.
+ (sql-product-interactive): Wait for interpreter prompt.
+ (sql-comint-oracle): Set process coding based on NLS_LANG.
+
+2013-01-15 Michael R. Mauger <mmaug@yahoo.com>
-2013-01-10 Fabián Ezequiel Gallina <fgallina@cuca>
+ * progmodes/sql.el (sql-output-to-send): Remove, unused.
+ (sql-interactive-remove-continuation-prompt):
+ (sql-send-magic-terminator, sql-interactive-mode): Remove references.
+
+2013-01-14 Leo Liu <sdl.web@gmail.com>
+
+ * calendar/calendar.el (calendar-redraw): Sync window-point and point.
+ (Bug#13420)
+
+2013-01-14 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/compile.el (compilation-error-regexp-alist-alist):
+ Fix interpretation of gnu line.col1-col2 format. (Bug#13335)
+
+2013-01-13 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (python-nav-end-of-statement):
Fix cornercase when handling multiline strings.
+2013-01-13 Richard Stallman <rms@gnu.org>
+
+ * mail/sendmail.el (mail-position-on-field): Add doc string.
+
+ * mail/rmailmm.el (rmail-insert-mime-forwarded-message):
+ Get current message boundaries and pass them to
+ message-forward-make-body-mime. Minor style changes.
+
+2013-01-13 Eli Zaretskii <eliz@gnu.org>
+
+ * cus-start.el (all): Avoid warnings about
+ scroll-bar-adjust-thumb-portion on platforms where it is not defined.
+
+2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
+
+ * cus-start.el (all): Add scroll-bar-adjust-thumb-portion.
+
+2013-01-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * jit-lock.el (jit-lock-debug-mode): New minor mode.
+ (jit-lock--debug-fontifying): New var.
+ (jit-lock--debug-fontify): New function.
+ * subr.el (condition-case-unless-debug): Don't prevent catching the
+ error, just let the debbugger run.
+ * emacs-lisp/timer.el (timer-event-handler): Don't prevent debugging
+ timer code and don't drop errors silently.
+
+2013-01-12 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (auto-revert-notify-watch-descriptor): Give it
+ `permanent-local' property.
+ (auto-revert-notify-handler): Use `file-equal-p'.
+
+2013-01-12 Eli Zaretskii <eliz@gnu.org>
+
+ * autorevert.el (auto-revert-notify-handler): Fix filtering of
+ file notification by ACTION. For filtering by file name, compare
+ only the non-directory part of the file name.
+
+2013-01-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * autorevert.el: Use cl-lib instead of cl.
+
+ * vc/vc-bzr.el (vc-bzr--sanitize-header): New function (bug#13307).
+ (vc-bzr-checkin): Use it.
+ * vc/log-edit.el (log-edit-extract-headers): Don't presume FUNCTION
+ will preserve match-data.
+
+2013-01-11 Felix H. Dahlke <fhd@ubercode.de>
+
+ * progmodes/js.el: Fix multiline declarations's indentation (bug#8576).
+ (js--declaration-keyword-re): New var.
+ (js--multi-line-declaration-indentation): New function.
+ (js--proper-indentation): Use it.
+
+2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
+
+ * calc/calc.el (calc-highlight-selections-with-faces)
+ (calc-dispatch):
+ * comint.el (comint-history-isearch-message):
+ * emacs-lisp/edebug.el (edebug-read, edebug-eval-defun):
+ * ffap.el (ffap-string-at-point-region, ffap-next)
+ (ffap-string-at-point, ffap-string-around)
+ (ffap-copy-string-as-kill, ffap-highlight-overlay)
+ (ffap-literally):
+ * font-lock.el (font-lock-keywords-alist)
+ (font-lock-removed-keywords-alist):
+ * help-mode.el (help-xref-symbol-regexp):
+ * info.el (Info-find-emacs-command-nodes):
+ * international/mule.el (add-to-coding-system-list):
+ * isearch.el (isearch-message-function, isearch-fail-pos):
+ * misearch.el (multi-isearch-next-buffer-function):
+ * newcomment.el (comment-box):
+ * printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
+ (pr-setting-database):
+ * progmodes/cc-fonts.el (c-font-lock-keywords-3)
+ (c++-font-lock-keywords-3, objc-font-lock-keywords-3)
+ (java-font-lock-keywords-3, idl-font-lock-keywords-3)
+ (pike-font-lock-keywords-3):
+ * progmodes/compile.el (compile):
+ * progmodes/etags.el (tags-table-files)
+ (tags-table-files-function, tags-included-tables-function):
+ * progmodes/gdb-mi.el (gdb, gdb-setup-windows)
+ (gdb-restore-windows):
+ * ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
+ (ps-n-up-filling-database):
+ * server.el (server-buffer, server-log):
+ * simple.el (newline, delete-backward-char, delete-forward-char)
+ (minibuffer-history-isearch-message, kill-line, track-eol)
+ (temporary-goal-column):
+ * textmodes/flyspell.el (flyspell-mark-duplications-flag)
+ (flyspell-default-deplacement-commands):
+ * textmodes/ispell.el (ispell-accept-output):
+ * textmodes/sgml-mode.el (html-tag-help):
+ * vc/compare-w.el (compare-ignore-whitespace)
+ (compare-ignore-case, compare-windows-dehighlight):
+ * vc/diff.el (diff):
+ * whitespace.el (whitespace-point)
+ (whitespace-font-lock-refontify, whitespace-bob-marker)
+ (whitespace-eob-marker): Fix ambiguous doc string cross-reference(s).
+
+2013-01-11 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (top): Require 'cl in order to pacify byte compiler.
+ (auto-revert-notify-rm-watch): Ignore errors.
+ (auto-revert-notify-add-watch): Ignore errors. Use '(modify) for
+ inotify, and '(size last-write-time) for w32notify.
+ Set buffer-local `auto-revert-use-notify' to nil when adding a file
+ watch fails - this is a fallback to the file modification check.
+ (auto-revert-notify-event-p, auto-revert-notify-event-descriptor)
+ (auto-revert-notify-event-action)
+ (auto-revert-notify-event-file-name): New defuns.
+ (auto-revert-notify-handler): Use them. Implement first
+ plausibility checks.
+ (auto-revert-handler): Handle also `auto-revert-tail-mode'.
+
+2013-01-11 Julien Danjou <julien@danjou.info>
+
+ * color.el (color-rgb-to-hsv): Fix conversion computing in case min and
+ max are almost equal. Also return the correct value for V which is
+ already between 0 and 1.
+
+2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * emacs-lisp/ert.el (ert-run-test): Use point-max-marker.
+
+2013-01-11 Eli Zaretskii <eliz@gnu.org>
+
+ * autorevert.el (auto-revert-notify-rm-watch)
+ (auto-revert-notify-add-watch): Fix typos in w32notify function
+ names.
+
+2013-01-10 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el (auto-revert-notify-enabled): Move up.
+ (auto-revert-use-notify): New defcustom.
+ (auto-revert-mode, global-auto-revert-mode)
+ (auto-revert-notify-add-watch, auto-revert-handler)
+ (auto-revert-buffers): Use `auto-revert-use-notify' instead of
+ `auto-revert-notify-enabled'.
+
+2013-01-10 Elias Pipping <pipping@exherbo.org>
+
+ * files.el (auto-mode-alist): Use doc-view for djvu files (bug#13164).
+ * doc-view.el (doc-view-document->bitmap):
+ Use doc-view-single-page-converter-function instead of
+ single-page-converter arg; adjust callers.
+
+2013-01-10 Feng Li <fengli@gmail.com> (tiny change)
+
+ * progmodes/which-func.el (which-function): Understand Semantic's use
+ of overlays in imenu--index-alist.
+
+2013-01-10 Wolfgang Jenkner <wjenkner@inode.at>
+
+ * man.el: Handle different "man -k" behaviors (bug#13160). Use utf-8.
+ (Man-man-k-use-anchor): New var.
+ (Man-parse-man-k): New function.
+ (Man-completion-table): Use it.
+ (man): Flush the completion cache between uses.
+
+2013-01-10 Michael Albinus <michael.albinus@gmx.de>
+
+ * autorevert.el: Add file watch support.
+ (auto-revert-notify-enabled): New defconst.
+ (auto-revert-notify-watch-descriptor-hash-list)
+ (auto-revert-notify-watch-descriptor)
+ (auto-revert-notify-modified-p): New defvars.
+ (auto-revert-notify-rm-watch, auto-revert-notify-add-watch)
+ (auto-revert-notify-handler): New defuns.
+ (auto-revert-mode, global-auto-revert-mode): Remove file watches
+ when mode is disabled.
+ (auto-revert-handler): Check for `auto-revert-notify-modified-p'.
+ (auto-revert-buffers): Add file watches for active buffers.
+
+2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * cus-start.el (toplevel): Only allow float values for
+ scroll-up-aggressively and scroll-down-aggressively.
+ Allow any number for line-spacing.
+
+2013-01-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * doc-view.el (doc-view-pdfdraw-program): Allow "pdfdraw" name.
+ (doc-view-pdf->png-converter-function): Use mupdf if available.
+ (doc-view-djvu->png-converter-function)
+ (doc-view-ps->png-converter-function): Remove.
+ (doc-view--image-file-pattern): Replace doc-view--image-file-extension.
+ (doc-view-goto-page, doc-view-convert-current-doc, doc-view-display)
+ (doc-view-already-converted-p): Adjust accordingly.
+ (doc-view-mode-p): Simplify.
+ (doc-view-enlarge): Use setq-local.
+ (doc-view-pdf->png-converter-ghostscript)
+ (doc-view-djvu->png-converter-ddjvu)
+ (doc-view-pdf->png-converter-mupdf): Rework to call
+ doc-view-start-process directly.
+ (doc-view-pdf/ps->png): Simplify accordingly.
+ (doc-view-pdf->png-1, doc-view-djvu->png-1): Remove.
+ (doc-view-document->bitmap): Rename from doc-view-document->png.
+ (doc-view-convert-current-doc): Merge pdf and djvu cases.
+ (doc-view-set-slice-from-bounding-box): Fix completion table.
+ (doc-view-mode): Use add-hook for after-revert-hook.
+
2013-01-10 Glenn Morris <rgm@gnu.org>
* emacs-lisp/authors.el (authors-ignored-files)
(authors-valid-file-names, authors-renamed-files-alist):
Add some more entries.
-2013-01-09 Stefan Monnier <monnier@iro.umontreal.ca>
+2013-01-10 Stefan Monnier <monnier@iro.umontreal.ca>
* image-mode.el (image-mode-winprops): Don't throw away the fallback
`t' pseudo-window entry.
-2013-01-09 Alan Mackenzie <acm@muc.de>
+2013-01-10 Alan Mackenzie <acm@muc.de>
Fix bugs in the c-parse-state mechanism. Reuse some markers
instead of continually generating new ones.
(c-state-maybe-marker): New macro.
(c-parse-state): Reuse markers when appropriate.
-2013-01-09 Glenn Morris <rgm@gnu.org>
+2013-01-10 Glenn Morris <rgm@gnu.org>
* simple.el (execute-extended-command): Doc fix.
Bind prefix-arg around read-extended-command, for prompt. (Bug#13395)
-2013-01-09 Chong Yidong <cyd@gnu.org>
+2013-01-10 Chong Yidong <cyd@gnu.org>
* faces.el (read-face-name): Doc fix.
+2013-01-10 Roland Winkler <winkler@gnu.org>
+
+ * emacs-lisp/crm.el: Allow any regexp for separators.
+ (crm-default-separator): All spaces around the default comma separator.
+ (crm--completion-command): New macro.
+ (crm-completion-help, crm-complete, crm-complete-word): Use it.
+ (crm-complete-and-exit): Handle non-single-char separators.
+
+2013-01-09 Elias Pipping <pipping@lavabit.com>
+
+ * doc-view.el: Add support for DjVu (bug#13164).
+ (doc-view-djvu->png-converter-function): New config var.
+ (doc-view-single-page-converter-function, doc-view--image-type)
+ (doc-view--image-file-extension): New vars.
+ (doc-view-mode): Initialize them.
+ (doc-view-goto-page): Use them.
+ (doc-view-mode-p): Add support for ddjvu.
+ (doc-view-djvu->png-converter-ddjvu, doc-view-djvu->png-1)
+ (doc-view-set-up-single-converter): New funs.
+ (doc-view-pdf/ps->png): Extend for djvu.
+ (doc-view-document->png): Rename from doc-view-pdf->png.
+ (doc-view-convert-current-doc): Handle djvu.
+ (doc-view-insert-image, doc-view-display)
+ (doc-view-already-converted-p): Don't hardcode png.
+ (doc-view-set-doc-type): Recognize djvu docs.
+
+2013-01-09 Elias Pipping <pipping@lavabit.com>
+
+ * doc-view.el: Add support for mupdf converter (bug#13164).
+ (doc-view-pdfdraw-program, doc-view-pdf->png-converter-function)
+ (doc-view-ps->png-converter-function): New config vars.
+ (doc-view-pdf->png-converter-ghostscript)
+ (doc-view-ps->png-converter-ghostscript)
+ (doc-view-pdf->png-converter-mupdf): New functions.
+ (doc-view-pdf/ps->png, doc-view-pdf->png-1): Use them.
+
+2013-01-09 Jürgen Hötzel <juergen@archlinux.org>
+
+ * net/tramp.el (tramp-eshell-directory-change): Check remote-path
+ first in session cache: When `tramp-own-remote-path' is in
+ `tramp-remote-path', the remote path is only set in the session
+ cache.
+
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)
-2012-12-31 Andreas Schwab <schwab@linux-m68k.org>
+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>
+
+ * 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)
(save-excursion
(funcall set-auto-coding-function
filename (- (point-max) (point-min)))))
- ;; dos-w32.el defines the function
- ;; find-buffer-file-type-coding-system for DOS/Windows
- ;; systems which preserves the coding-system of existing files.
- ;; (That function is called via file-coding-system-alist.)
- ;; Here, we want it to act as if the extracted file existed.
;; The following let-binding of file-name-handler-alist forces
;; find-file-not-found-set-buffer-file-coding-system to ignore
;; the file's name (see dos-w32.el).
;; Auto-Revert Mode applies to all file buffers. (If the user option
;; `global-auto-revert-non-file-buffers' is non-nil, it also applies
;; to some non-file buffers. This option is disabled by default.)
-;; Since checking a remote file is too slow, these modes do not check
-;; or revert remote files.
+;;
+;; Since checking a remote file is slow, these modes check or revert
+;; remote files only if the user option `auto-revert-remote-files' is
+;; non-nil. It is recommended to disable version control for remote
+;; files.
;;
;; Both modes operate by checking the time stamp of all files at
;; intervals of `auto-revert-interval'. The default is every five
;; Emacs. You should never even notice that this package is active
;; (except that your buffers will be reverted, of course).
;;
+;; If Emacs is compiled with file notification support, notifications
+;; are used instead of checking the time stamp of the files. You can
+;; disable this by setting the user option `auto-revert-use-notify' to
+;; nil. Alternatively, a regular expression of directories to be
+;; excluded from file notifications can be specified by
+;; `auto-revert-notify-exclude-dir-regexp'.
+;;
;; After reverting a file buffer, Auto Revert Mode normally puts point
;; at the same position that a regular manual revert would. However,
;; there is one exception to this rule. If point is at the end of the
;; change by growing at the end. It only appends the new output,
;; instead of reverting the entire buffer. It does so even if the
;; buffer contains unsaved changes. (Because they will not be lost.)
-;; Auto Revert Tail Mode works also for remote files.
;; Usage:
;;
;; Dependencies:
+(eval-when-compile (require 'cl-lib))
(require 'timer)
;; Custom Group:
This variable becomes buffer local when set in any fashion.")
(make-variable-buffer-local 'global-auto-revert-ignore-buffer)
+(defcustom auto-revert-remote-files nil
+ "If non-nil remote files are also reverted."
+ :group 'auto-revert
+ :type 'boolean
+ :version "24.4")
+
+(defconst auto-revert-notify-enabled
+ (or (featurep 'inotify) (featurep 'w32notify))
+ "Non-nil when Emacs has been compiled with file notification support.")
+
+(defcustom auto-revert-use-notify auto-revert-notify-enabled
+ "If non-nil Auto Revert Mode uses file notification functions.
+This requires Emacs being compiled with file notification
+support (see `auto-revert-notify-enabled'). You should set this
+variable through Custom."
+ :group 'auto-revert
+ :type 'boolean
+ :set (lambda (variable value)
+ (set-default variable (and auto-revert-notify-enabled value))
+ (unless (symbol-value variable)
+ (when auto-revert-notify-enabled
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (when (symbol-value 'auto-revert-notify-watch-descriptor)
+ (auto-revert-notify-rm-watch)))))))
+ :initialize 'custom-initialize-default
+ :version "24.4")
+
+(defcustom auto-revert-notify-exclude-dir-regexp
+ (concat
+ ;; No mounted file systems.
+ "^" (regexp-opt '("/afs/" "/media/" "/mnt" "/net/" "/tmp_mnt/"))
+ ;; No remote files.
+ (unless auto-revert-remote-files "\\|^/[^/|:][^/|]+:"))
+ "Regular expression of directories to be excluded from file notifications."
+ :group 'auto-revert
+ :type 'regexp
+ :version "24.4")
+
;; Internal variables:
(defvar auto-revert-buffer-list ()
(set (make-local-variable 'auto-revert-tail-pos)
(nth 7 (file-attributes buffer-file-name)))))
+(defvar auto-revert-notify-watch-descriptor-hash-list
+ (make-hash-table :test 'equal)
+ "A hash table collecting all file watch descriptors.
+Hash key is a watch descriptor, hash value is a list of buffers
+which are related to files being watched and carrying the same
+default directory.")
+
+(defvar auto-revert-notify-watch-descriptor nil
+ "The file watch descriptor active for the current buffer.")
+(make-variable-buffer-local 'auto-revert-notify-watch-descriptor)
+(put 'auto-revert-notify-watch-descriptor 'permanent-local t)
+
+(defvar auto-revert-notify-modified-p nil
+ "Non-nil when file has been modified on the file system.
+This has been reported by a file notification event.")
+(make-variable-buffer-local 'auto-revert-notify-modified-p)
+
;; Functions:
;;;###autoload
(if auto-revert-mode
(if (not (memq (current-buffer) auto-revert-buffer-list))
(push (current-buffer) auto-revert-buffer-list))
+ (when auto-revert-use-notify (auto-revert-notify-rm-watch))
(setq auto-revert-buffer-list
(delq (current-buffer) auto-revert-buffer-list)))
(auto-revert-set-timer)
specifies in the mode line."
:global t :group 'auto-revert :lighter global-auto-revert-mode-text
(auto-revert-set-timer)
- (when global-auto-revert-mode
- (auto-revert-buffers)))
-
+ (if global-auto-revert-mode
+ (auto-revert-buffers)
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (when auto-revert-use-notify
+ (auto-revert-notify-rm-watch))))))
(defun auto-revert-set-timer ()
"Restart or cancel the timer used by Auto-Revert Mode.
auto-revert-interval
'auto-revert-buffers))))
+(defun auto-revert-notify-rm-watch ()
+ "Disable file notification for current buffer's associated file."
+ (when auto-revert-notify-watch-descriptor
+ (maphash
+ (lambda (key value)
+ (when (equal key auto-revert-notify-watch-descriptor)
+ (setq value (delete (current-buffer) value))
+ (if value
+ (puthash key value auto-revert-notify-watch-descriptor-hash-list)
+ (remhash key auto-revert-notify-watch-descriptor-hash-list)
+ (ignore-errors
+ (funcall (if (fboundp 'inotify-rm-watch)
+ 'inotify-rm-watch 'w32notify-rm-watch)
+ auto-revert-notify-watch-descriptor)))))
+ auto-revert-notify-watch-descriptor-hash-list)
+ (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch))
+ (setq auto-revert-notify-watch-descriptor nil
+ auto-revert-notify-modified-p nil))
+
+(defun auto-revert-notify-add-watch ()
+ "Enable file notification for current buffer's associated file."
+ (when (string-match auto-revert-notify-exclude-dir-regexp
+ (expand-file-name default-directory))
+ ;; Fallback to file checks.
+ (set (make-local-variable 'auto-revert-use-notify) nil))
+
+ (when (and buffer-file-name auto-revert-use-notify
+ (not auto-revert-notify-watch-descriptor))
+ (let ((func (if (fboundp 'inotify-add-watch)
+ 'inotify-add-watch 'w32notify-add-watch))
+ (aspect (if (fboundp 'inotify-add-watch)
+ '(create modify moved-to) '(size last-write-time))))
+ (setq auto-revert-notify-watch-descriptor
+ (ignore-errors
+ (funcall
+ func (directory-file-name (expand-file-name default-directory))
+ aspect 'auto-revert-notify-handler)))
+ (if auto-revert-notify-watch-descriptor
+ (progn
+ (puthash
+ auto-revert-notify-watch-descriptor
+ (cons (current-buffer)
+ (gethash auto-revert-notify-watch-descriptor
+ auto-revert-notify-watch-descriptor-hash-list))
+ auto-revert-notify-watch-descriptor-hash-list)
+ (add-hook (make-local-variable 'kill-buffer-hook)
+ 'auto-revert-notify-rm-watch))
+ ;; Fallback to file checks.
+ (set (make-local-variable 'auto-revert-use-notify) nil)))))
+
+(defun auto-revert-notify-event-p (event)
+ "Check that event is a file notification event."
+ (cond ((featurep 'inotify)
+ (and (listp event) (= (length event) 4)))
+ ((featurep 'w32notify)
+ (and (listp event) (= (length event) 3) (stringp (nth 2 event))))))
+
+(defun auto-revert-notify-event-descriptor (event)
+ "Return watch descriptor of file notification event, or nil."
+ (and (auto-revert-notify-event-p event) (car event)))
+
+(defun auto-revert-notify-event-action (event)
+ "Return action of file notification event, or nil."
+ (and (auto-revert-notify-event-p event) (nth 1 event)))
+
+(defun auto-revert-notify-event-file-name (event)
+ "Return file name of file notification event, or nil."
+ (and (auto-revert-notify-event-p event)
+ (cond ((featurep 'inotify) (nth 3 event))
+ ((featurep 'w32notify) (nth 2 event)))))
+
+(defun auto-revert-notify-handler (event)
+ "Handle an event returned from file notification."
+ (when (auto-revert-notify-event-p event)
+ (let* ((descriptor (auto-revert-notify-event-descriptor event))
+ (action (auto-revert-notify-event-action event))
+ (file (auto-revert-notify-event-file-name event))
+ (buffers (gethash descriptor
+ auto-revert-notify-watch-descriptor-hash-list)))
+ (ignore-errors
+ ;; Check, that event is meant for us.
+ ;; TODO: Filter events which stop watching, like `move' or `removed'.
+ (cl-assert descriptor)
+ (when (featurep 'inotify)
+ (cl-assert (or (memq 'create action)
+ (memq 'modify action)
+ (memq 'moved-to action))))
+ (when (featurep 'w32notify) (cl-assert (eq 'modified action)))
+ ;; Since we watch a directory, a file name must be returned.
+ (cl-assert (stringp file))
+ (dolist (buffer buffers)
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (when (and (stringp buffer-file-name)
+ (string-equal
+ (file-name-nondirectory file)
+ (file-name-nondirectory buffer-file-name)))
+ ;; Mark buffer modified.
+ (setq auto-revert-notify-modified-p t)
+ ;; No need to check other buffers.
+ (cl-return)))))))))
+
(defun auto-revert-active-p ()
"Check if auto-revert is active (in current buffer or globally)."
(or auto-revert-mode
This is an internal function used by Auto-Revert Mode."
(when (or auto-revert-tail-mode (not (buffer-modified-p)))
(let* ((buffer (current-buffer)) size
+ ;; Tramp caches the file attributes. Setting
+ ;; `remote-file-name-inhibit-cache' forces Tramp to reread
+ ;; the values.
+ (remote-file-name-inhibit-cache t)
(revert
(or (and buffer-file-name
+ (or auto-revert-remote-files
+ (not (file-remote-p buffer-file-name)))
+ (or (not auto-revert-use-notify)
+ auto-revert-notify-modified-p)
(if auto-revert-tail-mode
- ;; Tramp caches the file attributes. Setting
- ;; `remote-file-name-inhibit-cache' forces Tramp
- ;; to reread the values.
- (let ((remote-file-name-inhibit-cache t))
- (and (file-readable-p buffer-file-name)
- (/= auto-revert-tail-pos
- (setq size
- (nth 7 (file-attributes
- buffer-file-name))))))
- (and (not (file-remote-p buffer-file-name))
- (file-readable-p buffer-file-name)
+ (and (file-readable-p buffer-file-name)
+ (/= auto-revert-tail-pos
+ (setq size
+ (nth 7 (file-attributes
+ buffer-file-name)))))
+ (and (file-readable-p buffer-file-name)
(not (verify-visited-file-modtime buffer)))))
(and (or auto-revert-mode
global-auto-revert-non-file-buffers)
(functionp buffer-stale-function)
(funcall buffer-stale-function t))))
eob eoblist)
+ (setq auto-revert-notify-modified-p nil)
(when revert
(when (and auto-revert-verbose
(not (eq revert 'fast)))
(memq buf auto-revert-buffer-list))
(setq auto-revert-buffer-list
(delq buf auto-revert-buffer-list)))
- (when (auto-revert-active-p) (auto-revert-handler)))
+ (when (auto-revert-active-p)
+ ;; Enable file notification.
+ (when (and auto-revert-use-notify buffer-file-name
+ (not auto-revert-notify-watch-descriptor))
+ (auto-revert-notify-add-watch))
+ (auto-revert-handler)))
;; Remove dead buffer from `auto-revert-buffer-list'.
(setq auto-revert-buffer-list
(delq buf auto-revert-buffer-list))))
(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))))
+++ /dev/null
-Copyright (C) 2001-2013 Free Software Foundation, Inc.
-See the end of the file for license conditions.
-
-
-This directory contains Calc, an advanced desk calculator for GNU
-Emacs.
-
-"Calc" Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc.
-
-Written by:
- Dave Gillespie
- c/o Synaptics, Inc.
- 2698 Orchard Parkway
- San Jose CA 95134
- daveg@synaptics.com, uunet!synaptx!daveg
-
-Currently maintained by:
- Jay Belanger <jay.p.belanger@gmail.com>
-
-From the introduction to the manual:
-
- "Calc" is an advanced calculator and mathematical tool that runs as
- part of the GNU Emacs environment. Very roughly based on the HP-28/48
- series of calculators, its many features include:
-
- * Choice of algebraic or RPN (stack-based) entry of calculations.
-
- * Arbitrary precision integers and floating-point numbers.
-
- * Arithmetic on rational numbers, complex numbers (rectangular and
- polar), error forms with standard deviations, open and closed
- intervals, vectors and matrices, dates and times, infinities,
- sets, quantities with units, and algebraic formulas.
-
- * Mathematical operations such as logarithms and trigonometric functions.
-
- * Programmer's features (bitwise operations, non-decimal numbers).
-
- * Financial functions such as future value and internal rate of return.
-
- * Number theoretical features such as prime factorization and
- arithmetic modulo M for any M.
-
- * Algebraic manipulation features, including symbolic calculus.
-
- * Moving data to and from regular editing buffers.
-
- * "Embedded mode" for manipulating Calc formulas and data directly
- inside any editing buffer.
-
- * Graphics using GNUPLOT, a versatile (and free) plotting program.
-
- * Easy programming using keyboard macros, algebraic formulas,
- algebraic rewrite rules, or extended Emacs Lisp.
-
-
-Calc is written entirely in Emacs Lisp, for maximum portability.
-
-I am anxious to hear about your experiences using Calc. Send mail to
-"jay.p.belanger@gmail.com". A bug report is most useful if you include the
-exact input and output that occurred, any modes in effect (such as the
-current precision), and so on. If you find Calc is difficult to operate
-in any way, or if you have other suggestions, don't hesitate to let me
-know. If you find errors (including simple typos) in the manual, let
-me know. Even if you find no bugs at all I would love to hear your
-opinions.
-
-
-
-Summary of changes to "Calc"
-------- -- ------- -- ----
-
-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'.
-
-Emacs 24.1
-
-* Support for musical notes added.
-
-* Support for logarithmic units added.
-
-* Calc no longer uses the tex prefix for TeX specific unit
-names when using TeX or LaTeX mode.
-
-* Added option to highlight selections using faces.
-
-* Gave `calc-histogram' the option of using a vector to determine the bins.
-
-* Added "O" option prefix.
-
-* Used "O" prefix to "d r" (`calc-radix') to turn on twos-complement mode.
-
-Emacs 23.2
-
-* Added twos-complement display.
-
-Emacs 23.1:
-
-* Gave `j *' (cal-sel-mult-both-sides) an option to expand the
- denominator.
-
-* Use `calc-embedded-word-regexp' for finding words in
- `calc-embedded-word' in place of delimiters.
-
-* Remove version numbering; use Emacs version for reference.
-
-* Added support for using registers.
-
-* Added support for Yacas, Maxima and Giac languages.
-
-* Added a menu.
-
-* Added logistic non-linear curves to curve-fitting.
-
-* Added option of plotting data points and curve when curve-fitting.
-
-* Made unit conversions exact when possible.
-
-* Lowered the precedence of negation.
-
-Version 2.1:
-
-* New matrix mode for square matrices. Improved handling of
- non-commutative products.
-
-* New functions: powerexpand and ldiv.
-
-* Added new functions: sec, csc, cot, sech, csch, coth.
-
-* 0^0 now evaluates to 1.
-
-* Added a new language mode for LaTeX.
-
-* Calc now tries to use an appropriate language mode in embedded mode.
-
-* Calc now restores original modes when leaving embedded mode.
-
-* User settable variables which are not set with keystrokes are now
- customizable.
-
-* Made ~/.calc.el the default Calc settings file.
-
-* Miscellaneous updates and bugfixes.
-
-\f
-Version 2.02f:
-
- * Fixed a bug which broke `I', `H', `K' prefix keys in recent Emacs.
-
- * Fixed a bug in calc.texinfo which prevented "make tex2" from working.
-
- * Updated `C-y' (calc-yank) to understand Emacs 19 generalized kill ring.
-
- * Added a copy of "calccard.tex", the Calc quick reference card.
-
-\f
-Version 2.02e:
-
- * Fixed an installation bug caused by recent changes to `write-region'.
-
-\f
-Version 2.02d:
-
- * Fixed a minor installation problem with a Emacs 19.29 byte-compiler bug.
-
- * Removed archaic "macedit" package (superseded by "edmacro").
-
-\f
-Version 2.02c:
-
- * Patch to port Calc to Lucid Emacs 19; still works with GNU 18 and GNU 19.
-
- * Fixed a bug that broke `C-x C-c' after Calc graphics had been used.
-
-\f
-Version 2.02b:
-
- * Minor patch to port Calc to GNU Emacs 19. Will be superseded by Calc 3.00.
-
-\f
-Version 2.02:
-
- * Revamped the manual a bit; rearranged some sections.
-
- * Added marginal notes for Key/Function Index refs in printed manual.
-
- * Changed `M-# r' to deal more gracefully with blank lines.
-
- * Made reductions like `V R +' and `M-# :' considerably faster.
-
- * Improved parsing and display of cases like "[a + b]".
-
- * Added `t +' and `t -' for doing business date arithmetic.
-
- * Added "syntax tables," the opposite of compositions.
-
- * Added another Rewrites Tutorial exercise.
-
- * Added the "vmatches" function.
-
- * Added the `Modes' variable and `m g' command.
-
- * Improved `u s' to cancel, e.g., "11 mph hr / yd" to get a number.
-
- * Added "quick units" commands "u 0" through "u 9".
-
- * Moved `M-%' to calc.el to avoid autoloading problems.
-
- * Added `M-=' during algebraic entry, acts like `RET ='.
-
- * Made `LFD' prevent evaluation when finishing a calc-edit command.
-
- * Changed calc-store commands to use `t .' mode for trail display.
-
- * Improved integrator to understand forms involving "erf".
-
- * Fixed parser to make sense of "[1....1e2]" input.
-
- * Fixed FORTRAN parser to treat a(i,j) as a_i_j if a is declared matrix.
-
- * Got rid of some version number stamps to reduce size of patches.
-
- * Fixed a bug in defmath treating "<=" and ">=" predicates.
-
- * Fixed a bug in which Calc crashed multiplying two date forms.
-
- * Fixed a bug in line breaker that crashed for large, nested formulas.
-
- * Fixed a bug using ` to edit string("foo").
-
- * Fixed a bug where `M-# y' in Big mode copied stack level number.
-
- * Fixed a bug where `g O' used wrong default directory, no completion.
-
- * Fixed a bug where "foo_bar(i)" parsed in C mode but showed as foo#bar.
-
- * Fixed several bugs where large calculations got "computation too long."
-
-\f
-Version 2.01:
-
- * Added percentage commands `M-%', `b %', and `c %'.
-
- * Changed Big mode to force radix-10 in superscripts.
-
- * Improved display of fractions in various language modes.
-
- * Changed `a n' to work properly with equations and inequalities.
-
- * The problem with cross references to Index nodes in TeX has been fixed.
-
- * Fixed a bug where recursive esc-maps make calc-ext/-aent unloadable.
-
- * Fixed a bug in `M-# k', then `OFF' right away, with fresh Emacs.
-
- * Fixed a bug in which "S_i_j" was formatted wrong after `j s'.
-
- * Fixed a bug in which `h k u c' positioned cursor on wrong line.
-
- * Fixed a bug where `z ?' crashed if `z %' was defined.
-
- * Fixed a bug in `j O' (calc-select-once-maybe).
-
- * Fixed "make private" not to ask "Delete excess versions" and crash.
-
-\f
-Version 2.00:
-
- * First complete posting of Calc since 1.01.
-
- * Most parts of Calc have seen changes since version 1.07. See
- section "New for Calc 2.00" in the manual for a summary. In
- the FTP version of the Calc distribution, the file README.prev
- contains a detailed change history from 1.00 up to 2.00.
-
-\f
-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/>.
+++ /dev/null
-Copyright (C) 2001-2013 Free Software Foundation, Inc.
-See the end of the file for license conditions.
-
-
-Summary of changes to "Calc" Preceding 2.00
-------- -- ------- -- ---- --------- ----
-
-
-Version 2.00:
-
- * Changed to compile calc-macs/-maint, to allow "cp *.elc new-dir".
-
- * Improved calc-describe-bindings to avoid showing redundant ESC maps.
-
-\f
-Version 2.00 beta 3:
-
- * Removed version numbers from most .el files to reduce size of patches.
-
- * Added a "calc-version" command.
-
- * Changed `M-# ? ?' to allow for modified describe-function.
-
- * Changed date parser to accept "Sept" as an alternative for "Sep".
-
- * Inhibited answers to exercise from showing up in table of contents.
-
- * Changed Makefile to say "texindex calc.[cfkptv]?" to avoid "calc.el".
-
- * Fixed up the Makefile in various other ways.
-
- * Rearranged banner at top of `h h' command's output.
-
- * Changed "make summary" to print "Calc Summary" on the title page.
-
- * Added "IntegSimpRules".
-
- * Added `M-# :', `M-# _', and `M-# Z' options.
-
- * Changed `^' to evaluate "[-3..-1]^-2" properly.
-
- * Improved `f g' to give symbolic answers for, e.g., 101:2 and -3:2.
-
- * Fixed a bug where `h k RET' didn't find the right place on the page.
-
- * Fixed a bug that formatted "x*(y ? a : b)" as "x y ? a : b".
-
- * Fixed a bug where defmath translated (< x 0) as (math-posp x)!
-
- * Fixed a bug that prevented quick-calc from working sometimes.
-
- * Fixed the `z ?' bug again (maybe this time for good?).
-
- * Fixed a bug in which `V ^' (vint) was just plain wrong, wrong, wrong!
-
- * Scanned for and fixed remaining bugs relating to autoloading.
-
-\f
-Version 2.00 beta 2:
-
- * Changed "make info" to try "make texinfo" if "makeinfo" not found.
-
- * Changed to "New for Calc 2.00"; texinfo.tex chokes on apostrophes.
-
- * Added List Tutorial Exercise 14 (just in case there weren't enough!).
-
- * Added a discussion of the `Z F' command to the Programming Tutorial.
-
- * Improved `H a f' not to lose info if input is partially pre-factored.
-
- * Improved simplification of expressions like sqrt(3) + 3^3:2.
-
- * Changed Big mode to omit "*" in expressions like 2 sqrt(3) 5^3:4.
-
- * Replaced European date format D/M/Y with D.M.Y.
-
- * Changed `a N' and `a X' to consider the endpoints of the interval.
-
- * Fixed a bug where TeX mode made c*(1+a/b) look like a function call.
-
- * Fixed a bug formatting top-level evalto's while using selections.
-
- * Fixed a bug that caused `z ?' to crash.
-
- * Fixed a bug where `Z F' broke for argument names "t" and "nil".
-
- * Fixed several bugs relating to autoloading.
-
-\f
-Version 2.00 beta 1:
-
- * Added "What's new in Calc 2.00" to the manual (summary of info below).
-
- * Added support for many GNUPLOT 3.0 features.
-
- * Tweaked the Makefile and calc-compile a bit more.
-
- * Modified to work with Zawinski's/Furuseth's optimizing byte compiler.
-
- * Modified Calc to garbage-collect less often (raised gc-cons-threshold).
-
- * Changed quick-calc to avoid autoloading so many parts of Calc.
-
- * Changed Calc subfiles to work properly if not byte-compiled.
-
- * Renamed `M-# s' to `M-# j', made `M-# s' be equivalent to `h s'.
-
- * Changed calc-quit to avoid reapportioning space among other windows.
-
- * Added `M-DEL' (calc-pop-above) key, to DEL as LFD is to RET.
-
- * Added `{' and `}' to scroll vertically, analogous to `<' and `>'.
-
- * Added `m t' for "total" algebraic mode.
-
- * Added `d , \' option to group digits with "\,".
-
- * Improved support of "prime" accent in "eqn" language mode.
-
- * Changed macedit's read-kbd-macro to accept a string argument in Lisp.
-
- * Changed calc-check-defines to use a more concise run-hooks linkage.
-
- * Changed auto-why mode not to say [w=more] if next msg is not urgent.
-
- * Made `a d' able to differentiate "a?b:c" and "a_i" formulas.
-
- * Changed probability dist. functions to work with `a f' and `a d'.
-
- * Added special constants "phi" and "gamma".
-
- * Added "poly" function, simpler cousin of "gpoly".
-
- * Added "pdeg", "plead", "pcont", "pprim"; cleaned up "pdiv" and "pgcd".
-
- * Added `a p' command for polynomial interpolation.
-
- * Added `a I' command for numerical integration; made IntegLimit variable.
-
- * Added `a f' to factor polynomials; moved old `a f' to `a "'.
-
- * Added `a a' to do partial fraction decompositions.
-
- * Improved `a i' to integrate many more kinds of formulas.
-
- * Modified `a P' to find numerical roots of high-degree polynomials.
-
- * Modified `c 0' through `c 9' to convert int-valued floats to integers.
-
- * Made sinh, arctanh, etc., expandable into exps/logs by `a f'.
-
- * Added more algebraic simplifications having to do with logs and exps.
-
- * Changed `s s', `s t', `s x', `s l' to accept an equation at prompt.
-
- * Changed `s i' not to store Decls if its value is the default, [].
-
- * Changed `s i' to store in `d O' language mode if in Normal or Big mode.
-
- * Rearranged `V M'/`V R' matrix mapping modes.
-
- * Added <#1+#2> notation for lambda expressions.
-
- * Extended `b l' and other binary shifts to have a 2-argument version.
-
- * Changed `u c' and `u t' to give unitless result for unitless input.
-
- * Changed sqrt(1-cos(x)^2)-to-sin(x) to be an unsafe simplification.
-
- * Improved simplification of sqrts, e.g., sqrt(a^2 x + a^2 y).
-
- * Changed solver to treat (x-a)(x-b)(x-c) more intelligently.
-
- * Changed Pascal language mode to use "$FFFF" for hexadecimal numbers.
-
- * Added support for non-decimal display of floats.
-
- * Changed `p' to refresh stack display if current float format uses it.
-
- * Changed Big mode to use subscript notation for log10(x), log(x,b), r#nnn.
-
- * Changed Big mode to format deriv(u,x) and tderiv(u,x) as du/dx.
-
- * Changed Big mode to format integ(1/x,x) as "dx/x" instead of "1/x dx".
-
- * Added "tty" output type for graphics commands.
-
- * Documented Calc's random number generation algorithm in the manual.
-
- * Fixed a bug involving having "(setq calc-timing t)" in .emacs.
-
- * Fixed a bug that incorrectly parsed "|x| - 1" in TeX mode.
-
- * Fixed bugs and made improvements in `a R' when widening the guess.
-
- * Fixed a bug that where `a S' didn't solve (x - a)^2 = (x - b)^2.
-
- * Fixed a bug that sometimes crashed `a P' on systems of equations.
-
- * Fixed a bug that prevented `b p' (calc-pack-bits) from working.
-
- * Fixed some bugs in which certain functions didn't get autoloaded.
-
- * Fixed a bug in which the date <1/1/13> was incorrectly parsed.
-
- * Fixed a bug which prevented `j D' from expanding (a+b)/c.
-
- * Fixed a bug in solver: bad inverses for sinh and cosh.
-
- * Fixed a bug in math-possible-signs that failed for x*0.
-
- * Fixed a bug where sqrt(-a) was rewritten sqrt(a)*i even if a<0.
-
- * Fixed a bug in line breaker when first "word" of line was too long.
-
- * Worked around a makeinfo bug that handled @end group/@group badly.
-
-\f
-Version 2.00 alpha 3:
-
- * Changed logic for locating component .elc files to be even smarter.
-
- * Changed "make install" to "make compile"; added different "make install".
-
- * Improved "make compile" to check file dates and compile only when needed.
-
- * Made output of "make compile" in batch mode more compact and readable.
-
- * Replaced "Quick Overview" in manual with "Demonstration of Calc".
-
- * Changed to use keymaps for dispatching M-# and h prefix keys.
-
- * Added TAGS target to the Calc Makefile.
-
- * Removed most doc strings from functions; new help commands are better.
-
- * Got rid of some crufty "fset" calls that were cluttering the code.
-
- * Split calc-grab-region into two functions, calc-grab-region/-rectangle.
-
- * Swapped positions of stack and trail in full-calc-keypad display.
-
- * Improved line-breaking algorithm for displaying long formulas.
-
- * Improved display of control characters in vectors shown as strings.
-
- * Changed `d o' to allow fraction format to specify desired denominator.
-
- * Changed `M-# y' to respect overwrite mode in target buffer.
-
- * Added `H' prefix to display-mode commands to suppress stack refresh.
-
- * Changed "calc-why" mechanism to display urgent messages automatically.
-
- * Handled taking derivatives of symbolic integrals and vice-versa.
-
- * Handled integrating vectors of formulas.
-
- * Incorporated Ewerlid's polynomial division and GCD functions into Calc.
-
- * Improved algebraic operations on "mod" forms, esp. polynomials.
-
- * Added some more financial functions (sln, syd, ddb).
-
- * Added nest, anest, fixp, and afixp (`H V R' and `H V U') functions.
-
- * Added `a .' (calc-remove-equal) command to take apart equations.
-
- * Generalized dfact to work for negative odd integers; added !! syntax.
-
- * Changed `k f' to factor 1, 0, and negative integers.
-
- * Changed `u M', etc., to accept +/- and [ .. ] forms as distributions.
-
- * Changed `g q' to remove *Gnuplot Commands/Trail* window if present.
-
- * Added support for Francois Pinard's "dumb terminal" driver for GNUPLOT.
-
- * Added ":: remember" feature for rewrite rules.
-
- * Changed rewrites to let pattern "a*b" match "x/2" with a=x, b=1/2.
-
- * Added ability to put function names like "simplify" in rewrite schedule.
-
- * Added "Rewrites Tutorial" to the manual.
-
- * Changed ` to bind RET as newline instead of finish if editing a vector.
-
- * Added some new exercises to the List Tutorial.
-
- * Changed `Z F', `V M', etc. not to remove stored vars from def arg list.
-
- * Added parsing for /1, 2, 3/ notation for Fortran mode vectors.
-
- * Added a "%%" syntax for comments in formulas being read.
-
- * Fixed a bug in which failing `h k' removed an existing Info window.
-
- * Fixed a bug in `j /' operating on subformulas like "a + b".
-
- * Fixed a bug in which "inf = inf" undesirably evaluated to 1.
-
- * Fixed a bug that simplified "0 = 1 + a + 2" to "0 = a".
-
- * Fixed a bug that failed for rewrite patterns like "fib(1 ||| 2)".
-
- * Fixed a bug that arose because rewrite programs are non-reentrant.
-
-\f
-Version 2.00 alpha 2:
-
- * Changed LFD terminating algebraic entry to push in no-simplify mode.
-
- * Changed so that `K -' interprets `-' as calc-minus, not neg prefix arg.
-
- * Improved `h c' command to understand all Calc key sequences.
-
- * Fixed problems with DistribRules, NegateRules, and FitRules.
-
- * Fixed several bad node pointers in the manual.
-
- * Fixed a bug in `h C-w' when used with makeinfo-formatted manuals.
-
- * Fixed a bug in sqrt(-1) when Polar and HMS modes are enabled.
-
- * Fixed/improved dscalar and deven functions; added dodd.
-
- * Fixed a bug in polynomial handling that also affected sum(sin(k),k,1,n).
-
- * Fixed various other glitches in the manual.
-
-\f
-Version 2.00 alpha 1:
-
- * Calc's tar file now creates a calc-(version) directory to unpack into.
-
- * Calc now comes with a Makefile; install with "make install".
-
- * Calc now comes already split into many files; installation is much simpler.
-
- * Changed base file name of the manual from "calc-info" to "calc.info".
-
- * Key binding for `M-# w' was documented but not implemented.
-
- * Bound M-# ' to be synonymous with `M-# f' (used to be `M-# q').
-
- * Changed M-# M-# to use last interface of C or K; E no longer counts.
-
- * Changed `i' (and `M-# i') not to return to Top node unnecessarily.
-
- * Changed `h' to be a prefix key with various help commands.
-
- * Changed `s' to be a prefix key with various store and recall commands.
-
- * Keys `i', `r', and `l' are obsolete (moved to `h' and `s' prefixes).
-
- * Rearranged `K', `X', and `M-RET' keys; `K' is now calc-keep-args.
-
- * Changed quick-calc to display input formula as well as output if room.
-
- * Changed quick-calc to interact with the editing buffer and kill ring.
-
- * Created pack, unpack, unpackt function equivalents of `v p', `v u'.
-
- * Changed to expand (a/b)^x to a^x/b^x only if b > 0 (not if a > 0).
-
- * Changed math-possible-signs to understand sqrt function.
-
- * Changed Z [, rewrites to consider any provably non-zero value as true.
-
- * Changed normal language modes to accept ** as a synonym for ^.
-
- * Added "maple" language mode.
-
- * Changed, e.g., Mathematica "(2 + 3 I)^(1.23*10^20)" to include parens.
-
- * Generalized math-compose-big properties for all language modes.
-
- * Introduced "string" and other function for composing expressions.
-
- * Changed many recursive vector routines to use loops instead.
-
- * Added evalv, evalvn function equivalents to `=', `N'.
-
- * Changed "expr =>" not to evaluate at all if in no-simplify mode.
-
- * Redesigned user interface of `a F' (calc-curve-fit) command.
-
- * Added "phase" feature to the rewrite rule system.
-
- * Added "&&&", "|||", "!!!" to the rewrite rule system.
-
- * Introduced a new notation for rewrites: LHS := RHS :: COND.
-
- * Changed `a r' (but not `j r') to repeat 100 times by default.
-
- * Integrated EvalRules more cleanly into the default simplifications.
-
- * Added `H v l' [mdims] to measure the dimensions of a matrix.
-
- * Changed `u c' to interpret "/units" as "1/units".
-
- * Added `u a' to adjust unit prefix letters automatically.
-
- * Changed `u s' to enable scalar mode while simplifying.
-
- * Changed `c f' [pfloat] not to float integer powers or subscripts.
-
- * Added a three-argument form for the "hms" function.
-
- * Changed, e.g., sin(90) degrees to produce 1 instead of 1.0.
-
- * Changed symbolic mode to prefer sqrt(int): abs([1 2 3]) => sqrt(14).
-
- * Enhanced solver to handle, e.g., x + 1/x = a; exp(x) + exp(-x) = a.
-
- * Enhanced simplifier to handle, e.g., exp(a+2) / e^a => e^2.
-
- * Enhanced `a s' to simplify sqrt(x) - x^1:2 and exp(x) - e^x to 0.
-
- * Added -(a + b) to -a - b as a default simplification.
-
- * Added rules for differentiating sum() and prod() functions.
-
- * Added a few more energy units (due to Przemek Klosowski).
-
- * Added overflow/underflow checking for all floating-point arithmetic.
-
- * Extended error forms to work with complex numbers.
-
- * Generalized GCD to handle fractional arguments.
-
- * Changed graphics routines to evaluate "x" values, e.g., [-pi .. pi].
-
- * Added `g q', like `g K' but without viewing the Gnuplot Trail.
-
- * Changed `g p' and `V M' to display better "Working..." messages.
-
- * Modified `M-# g' to be more robust about grabbing formulas.
-
- * Added `Y' prefix key reserved for user-written extensions.
-
- * Added calc-load-hook and calc-ext-load-hook.
-
- * Prevented calc-install from leaving large ~ files behind.
-
- * Changed @bullet to @bullet{} in manual to conform to texinfo spec.
-
- * Rearranged some chapters in the manual to be a bit more logical.
-
- * Added calc-split-summary command.
-
- * Fixed several bugs in embedded mode.
-
- * Fixed a bug in calc-vector-covariance that required a prefix arg.
-
- * Fixed a bug that prevented parsing "a=>" with no right-hand side.
-
- * Fixed a bug which allowed incorrectly dividing a vector by a vector.
-
- * Fixed a bug formatting sum(...)^2 in Big mode.
-
- * Fixed a bug that prevented Calc from deleting old graphics temp files.
-
- * Fixed some typos calling calc-inverse-func instead of calc-invert-func.
-
- * Fixed bugs in the derivatives of conj, deg, and rad; added re, im.
-
- * Fixed a bug where (r;theta) parsed as r exp(theta i) even in Deg mode.
-
- * Fixed a bug which gave wrong answer for exp of a polar complex number.
-
- * Fixed a bug in `Z F' that failed if formula used non-arg variables.
-
- * Fixed a bad pointer to Info node "Assignments in Embedded Mode".
-
- * Fixed several errors in the Calc Summary.
-
-\f
-Version 1.08 beta 1:
-
- * Calc's copyright has been assigned to FSF, for inclusion in Emacs 19!
-
- * Changed M-# to be a two-key sequence; use M-# M-# to start Calc now.
-
- * Rewrote and expanded the introductory chapter of the manual.
-
- * Added a key and function summary to the manual.
-
- * Changed the manual to take better advantage of TeX's math formatting.
-
- * Changed manual to be printable in @smallbook format.
-
- * Added "calc-embedded" mode.
-
- * Added "=>" [evalto] operator.
-
- * Added facilities for date and date/time arithmetic.
-
- * Added a set of financial functions (pv, fv, etc.).
-
- * Added infinite quantities inf, uinf, and nan (plus infinite intervals).
-
- * Added "EvalRules", "SimpRules", and "ExtSimpRules" variables.
-
- * Added sum and product commands `a +', `a -', `a *', `a T'.
-
- * Enhanced `a S' and `a P' to solve systems of equations.
-
- * Enhanced solver to handle eqns like sin(x) = cos(2 x), sqrt(x) + x = 1.
-
- * Added `a M' (calc-map-equation) command.
-
- * Added new statistical functions: mean, standard deviation, etc.
-
- * Added line, polynomial, and curve fitting commands (`a L' and `a F').
-
- * Added support for composite units, e.g., "mi+ft+in".
-
- * Enhanced "Big" mode to format square roots, choose, and powers better.
-
- * Enhanced "Big" mode to display fractions in large notation.
-
- * Added several alternate formats for matrix display.
-
- * Changed TeX mode to write "(1 + x^2)" instead of "\left(1 + x^2\right)".
-
- * Added support for relational operators in TeX and FORTRAN modes.
-
- * Added recognition of accents like \dot, \tilde, \underline in TeX mode.
-
- * Added "eqn" language mode.
-
- * Added extra control over display justification with `d <', `d =', `d >'.
-
- * Added calc-left-label and calc-right-label (`d {', `d }').
-
- * Added "nn%" syntax for algebraic formulas; equivalent to "nn * .01".
-
- * Added input syntaxes like a = b = c, a != b != c, a <= b < c.
-
- * Changed "_" to mean subscripts; old use of "_" in vars is now "#".
-
- * Introduced "matrix mode" and "scalar mode" (`m v').
-
- * Introduced generic identity matrices (idn(1)).
-
- * Added a method for declaring variables to be real, integer, > 0, etc.
-
- * Added `Z S' command for editing stored value of a variable.
-
- * Added "subst" algebraic function equivalent to the `a b' command.
-
- * Added `a f' command, changed deriv/integ/solve-for to use it.
-
- * Improved `a s' to simplify (x + y) (y + x) to (x + y)^2.
-
- * Improved `a s' to simplify i^2 to -1.
-
- * Improved `a s' to simplify, e.g., sin(pi/3) in Symbolic mode.
-
- * Improved `a s' to simplify sqrt(8) to 2 sqrt(2), 1/sqrt(2) to sqrt(2)/2.
-
- * Moved sin(arccos(x)) from `a e' to `a s'; not unsafe after all!
-
- * Changed (x y)^z => x^z y^z to be a usually-unsafe simplification.
-
- * Added thorough documentation of `a s' and `a e' to the manual.
-
- * Improved `a c' to collect "f(a)" even if "a" also appears elsewhere.
-
- * Introduced lin, linnt, islin, islinnt functions for linearity testing.
-
- * Improved `a x' to use binomial theorem to give simpler answers.
-
- * Improved `j D' to distribute powers of sums: (a + b)^n.
-
- * Improved `j M' to merge products of powers (may need no-simplify mode).
-
- * Changed to use defvar for DistribRules etc. so `Z V' works with them.
-
- * Improved `j *' and `j /' to work properly in a few more cases.
-
- * Improved `V R' to use identity value when reducing empty vectors.
-
- * Improved `v p' and `v u' to support more complex packing operations.
-
- * Disabled automatic simplification of sqrt(2)/2 to 1/sqrt(2).
-
- * Bound SPC and RET to press, TAB to next-menu in *Calc Keypad* buffer.
-
- * Added C-u ' to do algebraic entry with language mode forced to normal.
-
- * Added "$1", "$2", etc. input notation for algebraic entry.
-
- * Changed unary operators like `n', `&' to treat neg prefix args like RET.
-
- * Changed ` (calc-edit) to show full precision regardless of float format.
-
- * Enhanced quick-calc to display integers in several formats.
-
- * Documented `g H' (calc-graph-hide) command (had been left from manual).
-
- * Enhanced floor/ceil/trunc/round in several ways.
-
- * Added rounde and roundu functions.
-
- * Changed `c 1' through `c 9' to change small floats to 0.0; added `c 0'.
-
- * Enhanced set operations to work on sets of intervals.
-
- * Fixed erf(0), utpn(x,x,y), and arccosh(-1) to work properly.
-
- * Changed complex arctan and arctanh to follow Steele 2nd edition.
-
- * Expanded "Branch Cuts" section of the manual with some useful tables.
-
- * Rearranged order of words in mode line to be a bit more logical.
-
- * Changed `m N' (num-simplify) mode to evaluate constant vectors, too.
-
- * Changed `a r'/`j r' to prompt twice for separate LHS/RHS if necessary.
-
- * Enhanced `let(v,x)' in rewrites by allowing arbitrary patterns for v.
-
- * Changed cursor positioning in second prompt for `a b' (calc-substitute).
-
- * Changed `y' to omit line numbers more consistently.
-
- * Changed `o' (calc-realign) to reset horizontal scrolling to zero, also.
-
- * Added "pred" mode for calc-eval.
-
- * Added "calc-report-bug" as an alias for "report-calc-bug".
-
- * Added `Z T' and "calc-pass-errors" to aid debugging Calc-related code.
-
- * Added "calc-load-everything" (`m X' or `M-# L') command.
-
- * Enhanced calc-install to pre-build units table, CommuteRules, etc.
-
- * Changed Calc to interact more gracefully with load-path.
-
- * Changed Lisp Variable Index in manual to include user variables, too.
-
- * Fixed a bug that prevented calc-install from working under VMS.
-
- * Fixed a bug that sometimes crashed rewrites dealing with subtractions.
-
- * Fixed a bug that prevented `a S' from solving "3 - x = 1 + x"!
-
- * Fixed a bug in solver that crashed for certain cubics and quartics.
-
- * Fixed a bug in calc-simplify that crashed for equations and ineqs.
-
- * Fixed a bug which placed the "[" oddly in `d B' + `v /' mode.
-
- * Fixed a bug where finishing calc-edit improperly obeyed language mode.
-
- * Fixed a bug formatting (-1)^n in Big mode after selection commands.
-
- * Fixed a bug that got ">=" and "<=" backwards in rewrite conditions.
-
- * Fixed a bug that broke the `"x"' key in calc-keypad mode.
-
- * Fixed a bug in which `MAP$' in calc-keypad didn't display "Working...".
-
- * Fixed a bug where matrix division gave bad result for singular matrix.
-
- * Fixed a bug which closed Calc window if calc-grab-region got an error.
-
- * Fixed a bug where `a s' failed on formulas containing dimension errors.
-
- * Fixed a bug that caused `m F' to hang.
-
- * Fixed a bug in complex arithmetic that caused problems with solver.
-
- * Fixed a bug which raised intervals to interval powers incorrectly.
-
- * Fixed a bug in utpp/ltpp (order of arguments did not match the manual).
-
- * Fixed a bug in which `t y' rounded yanked data with old precision.
-
- * Fixed a bug in which "in(3, [3 .. 3))" returned true.
-
- * Fixed a bug which simplified abs(abs(x)) incorrectly.
-
- * Fixed a bug in which (a^2)^1:3 was unsafely simplified to a^2:3.
-
- * Fixed a bug in rewrite system which missed pattern "2 sin(x) cos(x)".
-
- * Fixed a bug in rewrite system which missed pattern "a - a cos(x)^2".
-
- * Fixed obsolete trail tags gsmp, gneg, ginv to jsmp, jneg, jinv.
-
- * Fixed some errors and made improvements in units table [Ulrich Mueller].
-
-\f
-Version 1.07:
-
- * Added `m F' (calc-settings-file-name) command.
-
- * Added calc-autoload-directory variable.
-
- * Extended Z ` to accept a prefix argument.
-
- * Added keystrokes (v h, v k) for head, tail, cons.
-
- * Extended `v e' to accept a vector as the filler.
-
- * Changed `V M', `V R' to accept mapping-mode keys in uppercase, too.
-
- * Changed V M ' etc. to accept $, $$, ... as argument indicators.
-
- * Changed `t y' to accept a prefix argument.
-
- * Put in a cleaner and safer random number generator for `k r' et al.
-
- * Fixed a bug which completely broke `a r' command!
-
- * Fixed "0 * matrix" to generate a zero matrix instead of 0.
-
- * Fixed a bug in `a R' which sometimes caused it to crash.
-
- * Fixed a fatal typo in the TeX version of the manual.
-
- * Fixed a bug that prevented C-k, C-w, M-w from working in Trail buffer.
-
- * Fixed another bug in `Z P' command.
-
- * Fixed a bug in `u s' which incorrectly simplified subtractions.
-
- * Fixed an argument-name aliasing bug evaluating lambda( ) formulas.
-
- * Fixed overfull hboxes in the manual.
-
- * Fixed various other bugs in the manual.
-
-\f
-Version 1.06:
-
- * Added "calc-keypad" mode for X window system users (try it!).
-
- * Improved "calc-eval" for calling/operating Calc from user-written Lisp.
-
- * Moved vector accumulate command to `V U' (old `H V R' still supported).
-
- * Added right-to-left reductions: `I V R' and `I V U'.
-
- * Added set operations on vectors: intersect, union, diff, xor.
-
- * Added `I v s' to remove a subvector from a vector.
-
- * Introduced `H |' to append two vectors with no magical special cases.
-
- * Introduced rhead, rtail, and rcons for isolating last vector element.
-
- * Changed `g p' to keep temp files around until data actually change.
-
- * Improved `a S' to solve many higher-order polynomial equations.
-
- * Added `a P' to produce a vector of all solutions to an equation.
-
- * Enhanced `a v' and `j v' to allow top-level-only evaluation.
-
- * Changed `j DEL' to delete a side of an eqn or ineq, leaving other side.
-
- * Fixed binding for keys `j 1' through `j 9'.
-
- * Introduced "let" marker in rewrite rules.
-
- * Enhanced the "sign" function to provide a two-argument version.
-
- * Changed "max-specpdl-size exceeded" error message to be user-friendly.
-
- * Put "<Aborted>" in the trail in above case and when user presses C-g.
-
- * Changed TeX mode to generate \ldots instead of \dots, recognize both.
-
- * Changed "sin(0)" etc. (for integer 0) to generate "0" instead of "0.".
-
- * Enhanced Programming Tutorial exercise 2.
-
- * Fixed an error in the answer to Types Tutorial exercise 3.
-
- * Fixed several bugs relating to head, tail, and cons functions.
-
- * Fixed some other minor typos in the manual.
-
- * Fixed several bugs in `Z P' (calc-user-define-permanent).
-
- * Fixed several bugs that broke the `g P' command.
-
-\f
-Version 1.05:
-
- * Created a calc-install command to ease installation.
-
- * Added lots of exercises to the Tutorial section of the manual.
-
- * Added ability to select and operate on sub-formulas.
-
- * Substantially improved the algebraic rewrite-rule system.
-
- * Added a set of graphing commands that use GNUPLOT.
-
- * Added a command (`a R') for finding numerical roots to equations.
-
- * Added several new math functions, such as erf and Bessel functions.
-
- * Added key bindings for miscellaneous commands using the "f" prefix key.
-
- * Added lots of new vector operations, many of them in the spirit of APL.
-
- * Added more control over vector display, including an abbreviated mode.
-
- * Improved keyboard macro editing; added read-kbd-macro to macedit.el.
-
- * Introduced the `m S' (calc-shift-prefix) command.
-
- * Enhanced the calc-edit command in several ways.
-
- * Made it possible to hit ` (calc-edit) during numeric/algebraic entry.
-
- * Enhanced the calc-solve-for command to handle inequalities.
-
- * Enhanced calc-simplify to handle equations and inequalities.
-
- * Taught log10 and log to look for exact integer or rational results.
-
- * Added ability to take Nth roots directly.
-
- * Added "increment" and "decrement" commands for integers and floats.
-
- * Added "full-help" command, changed "h" key to invoke it.
-
- * Added special help for Inverse and Hyperbolic prefixes.
-
- * Added an optional prefix argument to `o' (calc-realign).
-
- * Changed `t s' and `t r' to use RET as the search exit key.
-
- * Made handling of operator keys for V M, V R, etc. more regular.
-
- * Improved TeX mode; added support for \matrix format.
-
- * Added a variant of `m a' mode that only affects ( and [ keys.
-
- * Fixed "Mismatch" message for algebraic entry of semi-open intervals.
-
- * Trimmed fat from calc.el to speed loading, moved more to calc-ext.el.
-
- * Fixed a bug in which minibuffer entry rounded to out-of-date precision.
-
- * Fixed a bug which crashed Calc 1.04 under Epoch.
-
- * Fixed a bug which messed up Calc Trail's mode line, among other things.
-
- * Fixed a bug which caused trail ">" to show only when in Trail buffer.
-
- * Fixed a bug in which "calc" called "calc-grab-region" with too few args.
-
- * Fixed bugs in both implementation and documentation of calc-perm.
-
- * Fixed a bug in which calc-simplify-extended always used radians.
-
- * Fixed a bug where calc-comma failed to override "polar" mode.
-
- * Fixed a bug doing mixed arithmetic on rectangular+polar complex numbers.
-
- * Fixed several bugs in transcendental functions with complex arguments.
-
- * Fixed a bug in which `a s' simplified "x / .5" to ".5 x".
-
- * Fixed numerous other bugs in various parts of Calc.
-
- * Completed the "Hooks" section of the "Internals" chapter of the manual.
-
-\f
-Version 1.04:
-
- * Included a copy of revision history (from README) in calc.el.
-
- * Added the "calc-split" feature to split calc-ext.el into smaller bits.
-
- * Changed calc-unpack to unpack floats and fractions, too.
-
- * Added "mant", "xpon", and "scf" functions for decomposing floats.
-
- * Fixed a bug in the "y" command with positive prefix arguments.
-
- * Rearranged binary shift/rotate command keys to be a bit more convenient.
-
- * Fixed a bug in which simplifying "(0/0) * 2" crashed with a Lisp error.
-
- * Made `H F' [ffloor] and friends faster for very large arguments.
-
- * Made calc-define-del more robust.
-
- * Handled pasting of data into the Calculator using the mouse under X.
-
- * Made overlay-arrow variables buffer-local to avoid interference.
-
- * Fixed a problem in which Calc Trail buffer got stuck after a C-x C-w.
-
-\f
-Version 1.03:
-
- * Changed math-choose to compute n-choose-m faster when m is large.
-
- * Fixed some problems with TeX mode.
-
- * Fixed a bug that prevented `b s' from working without a prefix argument.
-
- * Added "calc-eval" function.
-
- * Improved calc-grab-region.
-
-\f
-Version 1.02:
-
- * Fixed a bug in Tutorial: telephone pole height/distance were switched!
-
- * Fixed a few other things in the manual.
-
- * Added "full-calc" command.
-
- * Added "calc-insert-variables" (`Z I') command.
-
- * Quick Calc now works even if you are already in the minibuffer.
-
- * Fixed a bug in math-mul-bignum-digit which affected math-and, etc.
-
- * Definition of "Hectares" was wrong in units table.
-
- * Fixed a bug in calc-execute-kbd-macro concerning undo and refresh.
-
- * Bound "calc-undo" to `C-x u' as well as `C-_' and `U'.
-\f
-Version 1.01:
-
- * Added a tutorial section to the manual.
-
- * Next and Prev for node Strings in the manual were reversed; fixed.
-
- * Changed "'bignum" in calc-isqrt-bignum-iter to "'bigpos".
-
- * Fixed a bug that prevented "$" from working during algebraic entry.
-
- * Fixed a bug caused by an X (last-X) command following a K (macro) cmd.
-
- * Fixed a bug in which K command incorrectly formatted stack in Big mode.
-
- * Added space between unary operators and non-flat compositions.
- (Otherwise, "-(a/b)" in Big mode blended the minus sign into the rule!)
-
- * Fixed formatting of (-1)^n in Big mode.
-
- * Fixed some problems relating to "not" operator in Pascal language mode.
-
- * Fixed several bugs relating to V M ' and V M $ sequences.
-
- * Fixed matrix-vector multiplication to produce a vector.
-
- * Introduced Z ` ... Z ' commands; renamed old Z ' to Z #.
-
- * Fixed various other bugs.
-
- * Added calc-settings-file variable suggested by C. Witty.
-
-\f
-Version 1.00:
-
- * First official release of Calc.
-
- * If you used the Beta test version (0.01), you will find that this
- version of Calc is over 50% larger than the original release.
- General areas of improvement include much better algebra features;
- operations on units; language modes; simplification modes; interval
- arithmetic; vector mapping and reduction. Other new commands include
- calc-fraction and calc-grab-region. The program has been split into
- two parts for faster loading, and the manual is more complete.
-
-\f
-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/>.
(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))
(setq calc-dumb-map (make-sparse-keymap))
(define-key calc-dumb-map "\n" 'scroll-up-command)
(define-key calc-dumb-map " " 'scroll-up-command)
+ (define-key calc-dump-map [?\S-\ ] 'scroll-down-command)
(define-key calc-dumb-map "\177" 'scroll-down-command)
(define-key calc-dumb-map "<" 'scroll-left)
(define-key calc-dumb-map ">" 'scroll-right)
(defun calc-view-news ()
(interactive)
- (let ((path load-path))
- (while (and path
- (not (file-exists-p (expand-file-name "calc.el" (car path)))))
- (setq path (cdr path)))
- (or (and path
- (file-exists-p (expand-file-name "README" (car path))))
- (error "Can't locate Calc sources"))
- (calc-quit)
- (switch-to-buffer "*Help*")
- (let ((inhibit-read-only t))
- (erase-buffer)
- (insert-file-contents (expand-file-name "README" (car path)))
- (search-forward "Summary of changes")
- (forward-line -1)
- (delete-region (point-min) (point))
- (goto-char (point-min)))
- (help-mode)))
+ (calc-quit)
+ (view-emacs-news)
+ (re-search-forward "^\*+ .*\\<Calc\\>" nil t))
(defvar calc-help-long-names '((?b . "binary/business")
(?g . "graphics")
(math-composition-to-string cexpr))))))
(defvar math-default-units-table
- #s(hash-table test equal data (1 (1)))
+ (make-hash-table :test 'equal)
"A table storing previously converted units.")
(defun math-get-default-units (expr)
(list new-units (car default-units))
math-default-units-table))))))
+(defvar calc-allow-units-as-numbers)
+
(defun calc-convert-units (&optional old-units new-units)
(interactive)
(calc-slow-wrapper
(let ((expr (calc-top-n 1))
(uoldname nil)
+ (unitscancel nil)
+ (nouold nil)
unew
units
defunits)
- (unless (math-units-in-expr-p expr t)
+ (if (or (not (math-units-in-expr-p expr t))
+ (setq unitscancel (and
+ calc-allow-units-as-numbers
+ (eq (math-get-standard-units expr) 1))))
(let ((uold (or old-units
(progn
- (setq uoldname (read-string "Old units: "))
+ (setq uoldname
+ (if unitscancel
+ (read-string
+ "(The expression is unitless when simplified) Old Units: ")
+ (read-string "Old units: ")))
(if (equal uoldname "")
(progn
+ (setq nouold unitscancel)
(setq uoldname "1")
1)
(if (string-match "\\` */" uoldname)
(error "Bad format in units expression: %s" (nth 1 uold)))
(setq expr (math-mul expr uold))))
(setq defunits (math-get-default-units expr))
- (if (equal defunits "1")
- (progn
- (calc-enter-result 1 "cvun" (math-simplify-units expr))
- (message "All units in expression cancel"))
- (unless new-units
- (setq new-units
- (read-string (concat
- (if uoldname
- (concat "Old units: "
- uoldname
- ", new units")
- "New units")
- (if defunits
- (concat
- " (default "
- defunits
- "): ")
- ": "))))
- (if (and
- (string= new-units "")
- defunits)
- (setq new-units defunits)))
- (when (string-match "\\` */" new-units)
- (setq new-units (concat "1" new-units)))
- (setq units (math-read-expr new-units))
- (when (eq (car-safe units) 'error)
- (error "Bad format in units expression: %s" (nth 2 units)))
- (if calc-ensure-consistent-units
- (math-check-unit-consistency expr units))
- (let ((unew (math-units-in-expr-p units t))
- (std (and (eq (car-safe units) 'var)
- (assq (nth 1 units) math-standard-units-systems)))
- (comp (eq (car-safe units) '+)))
- (unless (or unew std)
- (error "No units specified"))
- (let ((res
- (if std
- (math-simplify-units (math-to-standard-units expr (nth 1 std)))
- (math-convert-units expr units (and uoldname (not (equal uoldname "1")))))))
- (math-put-default-units res (if comp units))
- (calc-enter-result 1 "cvun" res)))))))
+ (unless new-units
+ (setq new-units
+ (read-string (concat
+ (if (and uoldname (not nouold))
+ (concat "Old units: "
+ uoldname
+ ", new units")
+ "New units")
+ (if defunits
+ (concat
+ " (default "
+ defunits
+ "): ")
+ ": "))))
+ (if (and
+ (string= new-units "")
+ defunits)
+ (setq new-units defunits)))
+ (when (string-match "\\` */" new-units)
+ (setq new-units (concat "1" new-units)))
+ (setq units (math-read-expr new-units))
+ (when (eq (car-safe units) 'error)
+ (error "Bad format in units expression: %s" (nth 2 units)))
+ (if calc-ensure-consistent-units
+ (math-check-unit-consistency expr units))
+ (let ((unew (math-units-in-expr-p units t))
+ (std (and (eq (car-safe units) 'var)
+ (assq (nth 1 units) math-standard-units-systems)))
+ (comp (eq (car-safe units) '+)))
+ (unless (or unew std)
+ (error "No units specified"))
+ (let ((res
+ (if std
+ (math-simplify-units (math-to-standard-units expr (nth 1 std)))
+ (math-convert-units expr units (and uoldname (not (equal uoldname "1")))))))
+ (math-put-default-units res (if comp units))
+ (calc-enter-result 1 "cvun" res))))))
(defun calc-autorange-units (arg)
(interactive "P")
:version "24.3"
:type 'boolean)
+(defcustom calc-allow-units-as-numbers
+ t
+ "If non-nil, allow unit expressions to be treated like numbers
+when converting units, if the expression can be simplified to be unitless."
+ :group 'calc
+ :version "24.4"
+ :type 'boolean)
+
(defcustom calc-undo-length
100
"The number of undo steps that will be preserved when Calc is quit."
(defcustom calc-highlight-selections-with-faces
nil
"If non-nil, use a separate face to indicate selected sub-formulas.
-If `calc-show-selections' is non-nil, then selected sub-formulas are shown
-by displaying the rest of the formula in `calc-nonselected-face'.
-If `calc-show-selections' is nil, then selected sub-formulas are shown
+If option `calc-show-selections' is non-nil, then selected sub-formulas are
+shown by displaying the rest of the formula in `calc-nonselected-face'.
+If option `calc-show-selections' is nil, then selected sub-formulas are shown
by displaying the sub-formula in `calc-selected-face'."
:version "24.1"
:group 'calc
: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.")
;;;###autoload
(defun calc-dispatch (&optional arg)
- "Invoke the GNU Emacs Calculator. See `calc-dispatch-help' for details."
+ "Invoke the GNU Emacs Calculator. See \\[calc-dispatch-help] for details."
(interactive "P")
; (sit-for echo-keystrokes)
(condition-case err ; look for other keys bound to calc-dispatch
(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 ()
(defun calendar-redraw ()
"Redraw the calendar display, if `calendar-buffer' is live."
(interactive)
- (if (get-buffer calendar-buffer)
- (with-current-buffer calendar-buffer
- (let ((cursor-date (calendar-cursor-to-nearest-date)))
- (calendar-generate-window displayed-month displayed-year)
- (calendar-cursor-to-visible-date cursor-date)))))
+ (when (get-buffer calendar-buffer)
+ (with-current-buffer calendar-buffer
+ (let ((cursor-date (calendar-cursor-to-nearest-date)))
+ (calendar-generate-window displayed-month displayed-year)
+ (calendar-cursor-to-visible-date cursor-date))
+ (when (window-live-p (get-buffer-window))
+ (set-window-point (get-buffer-window) (point))))))
(defvar calendar-mode-map
(let ((map (make-keymap)))
(define-key map "S" 'calendar-sunrise-sunset)
(define-key map "M" 'calendar-lunar-phases)
(define-key map " " 'scroll-other-window)
+ (define-key map [?\S-\ ] 'scroll-other-window-down)
(define-key map "\d" 'scroll-other-window-down)
(define-key map "\C-c\C-l" 'calendar-redraw)
(define-key map "." 'calendar-goto-today)
;;;###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.
(max (max r g b))
(min (min r g b)))
(if (< (- max min) 1e-8)
- (list 0.0 0.0 0.0)
+ (list 0.0 0.0 min)
(list
(/ (* 2 float-pi
(cond ((and (= r g) (= g b)) 0)
(+ 240 (* 60 (/ (- r g) (- max min)))))))
360)
(if (= max 0) 0 (- 1 (/ min max)))
- (/ max 255.0)))))
+ max))))
(defun color-rgb-to-hsl (red green blue)
"Convert RGB colors to their HSL representation.
If there are no search errors, this function displays an overlay with
the Isearch prompt which replaces the original comint prompt.
Otherwise, it displays the standard Isearch message returned from
-`isearch-message'."
+the function `isearch-message'."
(if (not (and isearch-success (not isearch-error)))
;; Use standard function `isearch-message' when not in comint prompt,
;; or search fails, or has an error (like incomplete regexp).
((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
(define-key map [remap self-insert-command] 'Custom-no-edit)
(define-key map "\^m" 'Custom-newline)
(define-key map " " 'scroll-up-command)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map "\177" 'scroll-down-command)
(define-key map "\C-c\C-c" 'Custom-set)
(define-key map "\C-x\C-s" 'Custom-save)
(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)
(const :tag "On the right" (down . right))))
(other :tag "On left, no arrows" t)))
(scroll-up-aggressively windows
- (choice (const :tag "off" nil) number)
+ (choice (const :tag "off" nil) float)
"21.1")
(scroll-down-aggressively windows
- (choice (const :tag "off" nil) number)
+ (choice (const :tag "off" nil) float)
"21.1")
- (line-spacing display (choice (const :tag "none" nil) integer)
+ (line-spacing display (choice (const :tag "none" nil) number)
"22.1")
(cursor-in-non-selected-windows
cursor boolean nil
(double-click-time mouse (restricted-sexp
:match-alternatives (integerp 'nil 't)))
(double-click-fuzz mouse integer "22.1")
- (inhibit-local-menu-bar-menus menu boolean)
(help-char keyboard character)
(help-event-list keyboard (repeat (sexp :format "%v")))
(menu-prompting menu boolean)
(const :tag "When sent SIGUSR2" sigusr2))
"24.1")
-;; This is not good news because it will use the wrong
-;; version-specific directories when you upgrade. We need
-;; customization of the front of the list, maintaining the standard
-;; value intact at the back.
-;;; (load-path environment
-;;; (repeat (choice :tag "[Current dir?]"
-;;; :format "%[Current dir?%] %v"
-;;; (const :tag " current dir" nil)
-;;; (directory :format "%v"))))
+ ;; This is not good news because it will use the wrong
+ ;; version-specific directories when you upgrade. We need
+ ;; customization of the front of the list, maintaining the
+ ;; standard value intact at the back.
+ ;;(load-path environment
+ ;; (repeat (choice :tag "[Current dir?]"
+ ;; :format "%[Current dir?%] %v"
+ ;; (const :tag " current dir" nil)
+ ;; (directory :format "%v"))))
;; minibuf.c
(enable-recursive-minibuffers minibuffer boolean)
(history-length minibuffer
(const super)) "23.1")
(ns-antialias-text ns boolean "23.1")
(ns-auto-hide-menu-bar ns boolean "24.0")
+ (ns-use-native-fullscreen ns boolean "24.4")
;; process.c
(delete-exited-processes processes-basics boolean)
;; syntax.c
(x-use-underline-position-properties display boolean "22.1")
(x-underline-at-descent-line display boolean "22.1")
(x-stretch-cursor display boolean "21.1")
+ (scroll-bar-adjust-thumb-portion windows boolean "24.4")
;; xselect.c
(x-select-enable-clipboard-manager killing boolean "24.1")
;; xsettings.c
(symbol-name symbol))
;; Any function from fontset.c will do.
(fboundp 'new-fontset))
+ ((equal "scroll-bar-adjust-thumb-portion"
+ (symbol-name symbol))
+ (featurep 'x))
(t t))))
(if (not (boundp symbol))
;; If variables are removed from C code, give an error here!
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
(rmail (dired-get-filename)))
(defun dired-do-run-mail ()
- "If `dired-bind-vm' is non-nil, call `dired-vm', else call `dired-rmail'."
+ "Visit the current file as a mailbox, using VM or RMAIL.
+Prompt for confirmation first; if the user says yes, call
+`dired-vm' if `dired-bind-vm' is non-nil, `dired-rmail'
+otherwise."
(interactive)
- (if dired-bind-vm
- ;; Read mail folder using vm.
- (dired-vm)
- ;; Read mail folder using rmail.
- (dired-rmail)))
+ (let ((file (dired-get-filename t)))
+ (if dired-bind-vm
+ (if (y-or-n-p (concat "Visit `" file
+ "' as a mail folder with VM?"))
+ (dired-vm))
+ ;; Read mail folder using rmail.
+ (if (y-or-n-p (concat "Visit `" file
+ "' as a mailbox with RMAIL?"))
+ (dired-rmail)))))
\f
;;; MISCELLANEOUS INTERNAL FUNCTIONS.
;;;; 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" "90ba5245f6f5df3bdbda6303c725ef45")
;;; 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.
;;;; Customization Options
(defgroup doc-view nil
- "In-buffer viewer for PDF, PostScript and DVI files."
+ "In-buffer viewer for PDF, PostScript, DVI, and DJVU files."
:link '(function-link doc-view)
:version "22.2"
:group 'applications
:type 'file
:group 'doc-view)
+(defcustom doc-view-pdfdraw-program
+ (cond
+ ((executable-find "pdfdraw") "pdfdraw")
+ (t "mudraw"))
+ "Name of MuPDF's program to convert PDF files to PNG."
+ :type 'file
+ :version "24.4")
+
+(defcustom doc-view-pdf->png-converter-function
+ (if (executable-find doc-view-pdfdraw-program)
+ #'doc-view-pdf->png-converter-mupdf
+ #'doc-view-pdf->png-converter-ghostscript)
+ "Function to call to convert a PDF file into a PNG file."
+ :type '(radio
+ (function-item doc-view-pdf->png-converter-ghostscript
+ :doc "Use ghostscript")
+ (function-item doc-view-pdf->png-converter-mupdf
+ :doc "Use mupdf")
+ function)
+ :version "24.4")
+
(defcustom doc-view-ghostscript-options
'("-dSAFER" ;; Avoid security problems when rendering files from untrusted
;; sources.
: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)
:type 'file
:group 'doc-view)
-(defcustom doc-view-unoconv-program "unoconv"
+(define-obsolete-variable-alias 'doc-view-unoconv-program
+ 'doc-view-odf->pdf-converter-program
+ "24.4")
+
+(defcustom doc-view-odf->pdf-converter-program
+ (cond
+ ((executable-find "soffice") "soffice")
+ ((executable-find "unoconv") "unoconv")
+ (t "soffice"))
"Program to convert any file type readable by OpenOffice.org to PDF.
Needed for viewing OpenOffice.org (and MS Office) files."
- :version "24.1"
+ :version "24.4"
:type 'file
:group 'doc-view)
+(defcustom doc-view-odf->pdf-converter-function
+ (cond
+ ((string-match "unoconv\\'" doc-view-odf->pdf-converter-program)
+ #'doc-view-odf->pdf-converter-unoconv)
+ ((string-match "soffice\\'" doc-view-odf->pdf-converter-program)
+ #'doc-view-odf->pdf-converter-soffice))
+ "Function to call to convert a ODF file into a PDF file."
+ :type '(radio
+ (function-item doc-view-odf->pdf-converter-unoconv
+ :doc "Use unoconv")
+ (function-item doc-view-odf->pdf-converter-soffice
+ :doc "Use LibreOffice")
+ function)
+ :version "24.4")
+
(defcustom doc-view-ps2pdf-program "ps2pdf"
"Program to convert PS files to PDF.
"The type of document in the current buffer.
Can be `dvi', `pdf', or `ps'.")
+(defvar doc-view-single-page-converter-function nil
+ "Function to call to convert a single page of the document to a bitmap file.
+May operate on the source document or on some intermediate (typically PDF)
+conversion of it.")
+
+(defvar-local doc-view--image-type nil
+ "The type of image in the current buffer.
+Can be `png' or `tiff'.")
+
+(defvar-local doc-view--image-file-pattern nil
+ "The `format' pattern of image file names.
+Typically \"page-%s.png\".")
+
;;;; DocView Keymaps
(defvar doc-view-mode-map
;; We used to find the file name from doc-view-current-files but
;; that's not right if the pages are not generated sequentially
;; or if the page isn't in doc-view-current-files yet.
- (let ((file (expand-file-name (format "page-%d.png" page)
- (doc-view-current-cache-dir))))
+ (let ((file (expand-file-name
+ (format doc-view--image-file-pattern page)
+ (doc-view-current-cache-dir))))
(doc-view-insert-image file :pointer 'arrow)
(set-window-hscroll (selected-window) hscroll)
(when (and (not (file-exists-p file))
doc-view-current-converter-processes)
;; The PNG file hasn't been generated yet.
- (doc-view-pdf->png-1 doc-view-buffer-file-name file page
- (let ((win (selected-window)))
- (lambda ()
- (and (eq (current-buffer) (window-buffer win))
- ;; If we changed page in the mean
- ;; time, don't mess things up.
- (eq (doc-view-current-page win) page)
- ;; Make sure we don't infloop.
- (file-readable-p file)
- (with-selected-window win
- (doc-view-goto-page page))))))))
+ (funcall doc-view-single-page-converter-function
+ doc-view-buffer-file-name file page
+ (let ((win (selected-window)))
+ (lambda ()
+ (and (eq (current-buffer) (window-buffer win))
+ ;; If we changed page in the mean
+ ;; time, don't mess things up.
+ (eq (doc-view-current-page win) page)
+ ;; Make sure we don't infloop.
+ (file-readable-p file)
+ (with-selected-window win
+ (doc-view-goto-page page))))))))
(overlay-put (doc-view-current-overlay)
'help-echo (doc-view-current-info))))
(setq doc-view-current-cache-dir
(file-name-as-directory
(expand-file-name
- (concat (file-name-nondirectory doc-view-buffer-file-name)
+ (concat (subst-char-in-string ?% ?_ ;; bug#13679
+ (file-name-nondirectory doc-view-buffer-file-name))
"-"
(let ((file doc-view-buffer-file-name))
(with-temp-buffer
(executable-find doc-view-dvipdf-program))
(and doc-view-dvipdfm-program
(executable-find doc-view-dvipdfm-program)))))
- ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps)
- (eq type 'pdf))
+ ((memq type '(postscript ps eps pdf))
+ ;; FIXME: allow mupdf here
(and doc-view-ghostscript-program
(executable-find doc-view-ghostscript-program)))
((eq type 'odf)
- (and doc-view-unoconv-program
- (executable-find doc-view-unoconv-program)
+ (and doc-view-odf->pdf-converter-program
+ (executable-find doc-view-odf->pdf-converter-program)
(doc-view-mode-p 'pdf)))
+ ((eq type 'djvu)
+ (executable-find "ddjvu"))
(t ;; unknown image type
nil))))
(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)
- (set (make-local-variable 'doc-view-image-width) new)
+ (setq-local doc-view-image-width new)
(doc-view-insert-image
(plist-get (cdr (doc-view-current-image)) :file)
:width doc-view-image-width)))
(let ((new (ceiling (* factor doc-view-resolution))))
(unless (equal new doc-view-resolution)
- (set (make-local-variable 'doc-view-resolution) new)
+ (setq-local doc-view-resolution new)
(doc-view-reconvert-doc)))))
(defun doc-view-shrink (factor)
(list "-o" pdf dvi)
callback)))
-(defun doc-view-odf->pdf (odf callback)
+(defun doc-view-pdf->png-converter-ghostscript (pdf png page callback)
+ (doc-view-start-process
+ "pdf/ps->png" doc-view-ghostscript-program
+ `(,@doc-view-ghostscript-options
+ ,(format "-r%d" (round doc-view-resolution))
+ ,@(if page `(,(format "-dFirstPage=%d" page)))
+ ,@(if page `(,(format "-dLastPage=%d" page)))
+ ,(concat "-sOutputFile=" png)
+ ,pdf)
+ callback))
+
+(defalias 'doc-view-ps->png-converter-ghostscript
+ 'doc-view-pdf->png-converter-ghostscript)
+
+(defun doc-view-djvu->tiff-converter-ddjvu (djvu tiff page callback)
+ "Convert PAGE of a DJVU file to bitmap(s) asynchronously.
+Call CALLBACK with no arguments when done.
+If PAGE is nil, convert the whole document."
+ (doc-view-start-process
+ "djvu->tiff" "ddjvu"
+ `("-format=tiff"
+ ;; ddjvu only accepts the range 1-999.
+ ,(format "-scale=%d" (round doc-view-resolution))
+ ;; -eachpage was only added after djvulibre-3.5.25.3!
+ ,@(unless page '("-eachpage"))
+ ,@(if page `(,(format "-page=%d" page)))
+ ,djvu
+ ,tiff)
+ callback))
+
+(defun doc-view-pdf->png-converter-mupdf (pdf png page callback)
+ (doc-view-start-process
+ "pdf->png" doc-view-pdfdraw-program
+ `(,(concat "-o" png)
+ ,(format "-r%d" (round doc-view-resolution))
+ ,pdf
+ ,@(if page `(,(format "%d" page))))
+ callback))
+
+(defun doc-view-odf->pdf-converter-unoconv (odf callback)
"Convert ODF to PDF asynchronously and call CALLBACK when finished.
The converted PDF is put into the current cache directory, and it
is named like ODF with the extension turned to pdf."
- (doc-view-start-process "odf->pdf" doc-view-unoconv-program
+ (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program
(list "-f" "pdf" "-o" (doc-view-current-cache-dir) odf)
callback))
+(defun doc-view-odf->pdf-converter-soffice (odf callback)
+ "Convert ODF to PDF asynchronously and call CALLBACK when finished.
+The converted PDF is put into the current cache directory, and it
+is named like ODF with the extension turned to pdf."
+ ;; FIXME: soffice doesn't work when there's another running
+ ;; LibreOffice instance, in which case it returns success without
+ ;; actually doing anything. See LibreOffice bug
+ ;; https://bugs.freedesktop.org/show_bug.cgi?id=37531. A workaround
+ ;; is to start soffice with a separate UserInstallation directory.
+ (let ((tmp-user-install-dir (make-temp-file "libreoffice-docview" t)))
+ (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program
+ (list
+ (concat "-env:UserInstallation=file://"
+ tmp-user-install-dir)
+ "--headless" "--convert-to" "pdf"
+ "--outdir" (doc-view-current-cache-dir) odf)
+ (lambda ()
+ (delete-directory tmp-user-install-dir t)
+ (funcall callback)))))
+
(defun doc-view-pdf/ps->png (pdf-ps png)
+ ;; FIXME: Fix name and docstring to account for djvu&tiff.
"Convert PDF-PS to PNG asynchronously."
- (doc-view-start-process
- "pdf/ps->png" doc-view-ghostscript-program
- (append doc-view-ghostscript-options
- (list (format "-r%d" (round doc-view-resolution))
- (concat "-sOutputFile=" png)
- pdf-ps))
+ (funcall
+ (pcase doc-view-doc-type
+ (`pdf doc-view-pdf->png-converter-function)
+ (`djvu #'doc-view-djvu->tiff-converter-ddjvu)
+ (_ #'doc-view-ps->png-converter-ghostscript))
+ pdf-ps png nil
(let ((resolution doc-view-resolution))
(lambda ()
;; Only create the resolution file when it's all done, so it also
(cancel-timer doc-view-current-timer)
(setq doc-view-current-timer nil))
(doc-view-display (current-buffer) 'force))))
+
;; Update the displayed pages as soon as they're done generating.
(when doc-view-conversion-refresh-interval
(setq doc-view-current-timer
'doc-view-display
(current-buffer)))))
-(defun doc-view-pdf->png-1 (pdf png page callback)
- "Convert a PAGE of a PDF file to PNG asynchronously.
-Call CALLBACK with no arguments when done."
- (doc-view-start-process
- "pdf->png-1" doc-view-ghostscript-program
- (append doc-view-ghostscript-options
- (list (format "-r%d" (round doc-view-resolution))
- ;; Sadly, `gs' only supports the page-range
- ;; for PDF files.
- (format "-dFirstPage=%d" page)
- (format "-dLastPage=%d" page)
- (concat "-sOutputFile=" png)
- pdf))
- callback))
-
(declare-function clear-image-cache "image.c" (&optional filter))
-(defun doc-view-pdf->png (pdf png pages)
- "Convert a PDF file to PNG asynchronously.
+(defun doc-view-document->bitmap (pdf png pages)
+ "Convert a document file to bitmap images asynchronously.
Start by converting PAGES, and then the rest."
(if (null pages)
(doc-view-pdf/ps->png pdf png)
;; a single page anyway, and of the remaining 1%, few cases will have
;; consecutive pages, it's not worth the trouble.
(let ((rest (cdr pages)))
- (doc-view-pdf->png-1
- pdf (format png (car pages)) (car pages)
+ (funcall doc-view-single-page-converter-function
+ pdf (format png (car pages)) (car pages)
(lambda ()
(if rest
- (doc-view-pdf->png pdf png rest)
+ (doc-view-document->bitmap pdf png rest)
;; Yippie, the important pages are done, update the display.
(clear-image-cache)
;; For the windows that have a message (like "Welcome to
;; not sufficient.
(dolist (win (get-buffer-window-list (current-buffer) nil 'visible))
(with-selected-window win
- (when (stringp (get-char-property (point-min) 'display))
- (doc-view-goto-page (doc-view-current-page)))))
+ (when (stringp (get-char-property (point-min) 'display))
+ (doc-view-goto-page (doc-view-current-page)))))
;; Convert the rest of the pages.
(doc-view-pdf/ps->png pdf png)))))))
;; preserves the horizontal/vertical scroll settings (which are otherwise
;; resets during the redisplay).
(setq doc-view-pending-cache-flush t)
- (let ((png-file (expand-file-name "page-%d.png"
- (doc-view-current-cache-dir))))
+ (let ((png-file (expand-file-name
+ (format doc-view--image-file-pattern "%d")
+ (doc-view-current-cache-dir))))
(make-directory (doc-view-current-cache-dir) t)
(pcase doc-view-doc-type
(`dvi
;; ODF files have to be converted to PDF before Ghostscript can
;; process it.
(let ((pdf (doc-view-current-cache-doc-pdf))
- (opdf (expand-file-name (concat (file-name-base doc-view-buffer-file-name)
- ".pdf")
- doc-view-current-cache-dir))
+ (opdf (expand-file-name
+ (concat (file-name-base doc-view-buffer-file-name)
+ ".pdf")
+ doc-view-current-cache-dir))
(png-file png-file))
- ;; The unoconv tool only supports a output directory, but no
+ ;; The unoconv tool only supports an output directory, but no
;; file name. It's named like the input file with the
;; extension replaced by pdf.
- (doc-view-odf->pdf doc-view-buffer-file-name
+ (funcall doc-view-odf->pdf-converter-function doc-view-buffer-file-name
(lambda ()
;; Rename to doc.pdf
(rename-file opdf pdf)
(doc-view-pdf/ps->png pdf png-file)))))
- (`pdf
+ ((or `pdf `djvu)
(let ((pages (doc-view-active-pages)))
- ;; Convert PDF to PNG images starting with the active pages.
- (doc-view-pdf->png doc-view-buffer-file-name png-file pages)))
+ ;; Convert doc to bitmap images starting with the active pages.
+ (doc-view-document->bitmap doc-view-buffer-file-name png-file pages)))
(_
;; Convert to PNG images.
(doc-view-pdf/ps->png doc-view-buffer-file-name png-file)))))
(let* ((is (image-size (doc-view-current-image) t))
(iw (car is))
(ih (cdr is))
- (ps (or (and (null force-paper-size) (doc-view-guess-paper-size iw ih))
+ (ps (or (and (null force-paper-size)
+ (doc-view-guess-paper-size iw ih))
(intern (completing-read "Paper size: "
- (mapcar #'car doc-view-paper-sizes)
+ doc-view-paper-sizes
nil t))))
(bb (doc-view-scale-bounding-box ps iw ih bb))
(x1 (nth 0 bb))
(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))
- (apply 'create-image file 'png nil args)
+ (if (not (and doc-view-scale-internally
+ (fboundp 'imagemagick-types)))
+ (apply 'create-image file doc-view--image-type 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)
(let ((prev-pages doc-view-current-files))
(setq doc-view-current-files
(sort (directory-files (doc-view-current-cache-dir) t
- "page-[0-9]+\\.png" t)
+ (format doc-view--image-file-pattern
+ "[0-9]+")
+ t)
'doc-view-sort))
+ (unless (eq (length prev-pages) (length doc-view-current-files))
+ (force-mode-line-update))
(dolist (win (or (get-buffer-window-list buffer nil t)
(list t)))
(let* ((page (doc-view-current-page win))
- (pagefile (expand-file-name (format "page-%d.png" page)
- (doc-view-current-cache-dir))))
+ (pagefile (expand-file-name
+ (format doc-view--image-file-pattern page)
+ (doc-view-current-cache-dir))))
(when (or force
(and (not (member pagefile prev-pages))
(member pagefile doc-view-current-files)))
(doc-view-kill-proc)
(setq buffer-read-only nil)
(remove-overlays (point-min) (point-max) 'doc-view t)
- (set (make-local-variable 'image-mode-winprops-alist) t)
+ (setq-local image-mode-winprops-alist t)
;; Switch to the previously used major mode or fall back to
;; normal mode.
(doc-view-fallback-mode)
;; the conversion is incomplete.
(file-readable-p (expand-file-name "resolution.el"
(doc-view-current-cache-dir)))
- (> (length (directory-files (doc-view-current-cache-dir)
- nil "\\.png\\'"))
+ (> (length (directory-files
+ (doc-view-current-cache-dir)
+ nil (format doc-view--image-file-pattern "[0-9]+")))
0)))
(defun doc-view-initiate-display ()
- ;; Switch to image display if possible
+ ;; Switch to image display if possible.
(if (doc-view-mode-p doc-view-doc-type)
(progn
(doc-view-buffer-message)
(if (doc-view-already-converted-p)
(progn
(message "DocView: using cached files!")
- ;; Load the saved resolution
+ ;; Load the saved resolution.
(let* ((res-file (expand-file-name "resolution.el"
(doc-view-current-cache-dir)))
(res
(insert-file-contents res-file)
(read (current-buffer))))))
(when (numberp res)
- (set (make-local-variable 'doc-view-resolution) res)))
+ (setq-local doc-view-resolution res)))
(doc-view-display (current-buffer) 'force))
(doc-view-convert-current-doc))
(message
("pdf" pdf) ("epdf" pdf)
;; PostScript
("ps" ps) ("eps" ps)
+ ;; DjVu
+ ("djvu" djvu)
;; OpenDocument formats
("odt" odf) ("ods" odf) ("odp" odf) ("odg" odf)
("odc" odf) ("odi" odf) ("odm" odf) ("ott" odf)
(cond
((looking-at "%!") '(ps))
((looking-at "%PDF") '(pdf))
- ((looking-at "\367\002") '(dvi))))))
- (set (make-local-variable 'doc-view-doc-type)
- (car (or (doc-view-intersection name-types content-types)
- (when (and name-types content-types)
- (error "Conflicting types: name says %s but content says %s"
- name-types content-types))
- name-types content-types
- (error "Cannot determine the document type"))))))
+ ((looking-at "\367\002") '(dvi))
+ ((looking-at "AT&TFORM") '(djvu))))))
+ (setq-local doc-view-doc-type
+ (car (or (doc-view-intersection name-types content-types)
+ (when (and name-types content-types)
+ (error "Conflicting types: name says %s but content says %s"
+ name-types content-types))
+ name-types content-types
+ (error "Cannot determine the document type"))))))
+
+(defun doc-view-set-up-single-converter ()
+ "Find the right single-page converter for the current document type"
+ (pcase-let ((`(,conv-function ,type ,extension)
+ (pcase doc-view-doc-type
+ (`djvu (list #'doc-view-djvu->tiff-converter-ddjvu 'tiff "tif"))
+ (_ (list doc-view-pdf->png-converter-function 'png "png")))))
+ (setq-local doc-view-single-page-converter-function conv-function)
+ (setq-local doc-view--image-type type)
+ (setq-local doc-view--image-file-pattern (concat "page-%s." extension))))
;;;###autoload
(defun doc-view-mode ()
(unless (eq major-mode 'fundamental-mode)
major-mode))))
(kill-all-local-variables)
- (set (make-local-variable 'doc-view-previous-major-mode)
- prev-major-mode))
+ (setq-local doc-view-previous-major-mode prev-major-mode))
(dolist (var doc-view-saved-settings)
(set (make-local-variable (car var)) (cdr var)))
;; Figure out the document type.
(unless doc-view-doc-type
(doc-view-set-doc-type))
+ (doc-view-set-up-single-converter)
(doc-view-make-safe-dir doc-view-cache-directory)
;; Handle compressed files, remote files, files inside archives
- (set (make-local-variable 'doc-view-buffer-file-name)
+ (setq-local doc-view-buffer-file-name
(cond
(jka-compr-really-do-compress
;; FIXME: there's a risk of name conflicts here.
'doc-view-new-window-function nil t)
(image-mode-setup-winprops)
- (set (make-local-variable 'mode-line-position)
- '(" P" (:eval (number-to-string (doc-view-current-page)))
- "/" (:eval (number-to-string (doc-view-last-page-number)))))
+ (setq-local mode-line-position
+ '(" P" (:eval (number-to-string (doc-view-current-page)))
+ "/" (:eval (number-to-string (doc-view-last-page-number)))))
;; Don't scroll unless the user specifically asked for it.
- (set (make-local-variable 'auto-hscroll-mode) nil)
- (set (make-local-variable 'mwheel-scroll-up-function)
- 'doc-view-scroll-up-or-next-page)
- (set (make-local-variable 'mwheel-scroll-down-function)
- 'doc-view-scroll-down-or-previous-page)
- (set (make-local-variable 'cursor-type) nil)
+ (setq-local auto-hscroll-mode nil)
+ (setq-local mwheel-scroll-up-function #'doc-view-scroll-up-or-next-page)
+ (setq-local mwheel-scroll-down-function
+ #'doc-view-scroll-down-or-previous-page)
+ (setq-local cursor-type nil)
(use-local-map doc-view-mode-map)
- (set (make-local-variable 'after-revert-hook) 'doc-view-reconvert-doc)
- (set (make-local-variable 'bookmark-make-record-function)
- 'doc-view-bookmark-make-record)
+ (add-hook 'after-revert-hook 'doc-view-reconvert-doc nil t)
+ (setq-local bookmark-make-record-function
+ #'doc-view-bookmark-make-record)
(setq mode-name "DocView"
buffer-read-only t
major-mode 'doc-view-mode)
;; canonical view mode for PDF/PS/DVI files. This could be
;; switched on automatically depending on the value of
;; `view-read-only'.
- (set (make-local-variable 'view-read-only) nil)
+ (setq-local view-read-only nil)
(run-mode-hooks 'doc-view-mode-hook)))
(defun doc-view-fallback-mode ()
;; Set the null device (for compile.el).
(setq null-device "NUL")
-;; For distinguishing file types based upon suffixes.
+;; For distinguishing file types based upon suffixes. DEPRECATED, DO NOT USE!
(defcustom file-name-buffer-file-type-alist
'(("[:/].*config.sys$" . nil) ; config.sys text
("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|bin\\|ico\\|pif\\|class\\)$" . t)
("\\.tp[ulpw]$" . t) ; borland Pascal stuff
("[:/]tags$" . nil) ; emacs TAGS file
)
- "Alist for distinguishing text files from binary files.
+ "Alist used in the past for distinguishing text files from binary files.
Each element has the form (REGEXP . TYPE), where REGEXP is matched
-against the file name, and TYPE is nil for text, t for binary."
+against the file name, and TYPE is nil for text, t for binary.
+
+This variable is deprecated, not used anywhere, and will soon be deleted."
:type '(repeat (cons regexp boolean))
:group 'dos-fns
:group 'w32)
-;; Return the pair matching filename on file-name-buffer-file-type-alist,
-;; or nil otherwise.
-(defun find-buffer-file-type-match (filename)
- (let ((alist file-name-buffer-file-type-alist)
- (found nil))
- (let ((case-fold-search t))
- (setq filename (file-name-sans-versions filename))
- (while (and (not found) alist)
- (if (string-match (car (car alist)) filename)
- (setq found (car alist)))
- (setq alist (cdr alist)))
- found)))
-
-;; Don't check for untranslated file systems here.
-(defun find-buffer-file-type (filename)
- (let ((match (find-buffer-file-type-match filename))
- (code))
- (if (not match)
- (default-value 'buffer-file-type)
- (setq code (cdr match))
- (cond ((memq code '(nil t)) code)
- ((and (symbolp code) (fboundp code))
- (funcall code filename))))))
+(make-obsolete-variable 'file-name-buffer-file-type-alist
+ 'file-coding-system-alist
+ "24.4")
(setq-default buffer-file-coding-system 'undecided-dos)
If it matches in `untranslated-filesystem-list':
If the file exists: `undecided'
If the file does not exist: `undecided-unix'
- If it matches in `file-name-buffer-file-type-alist':
- If the match is t (for binary): `no-conversion'
- If the match is nil (for dos-text): `undecided-dos'
Otherwise:
If the file exists: `undecided'
If the file does not exist default value of `buffer-file-coding-system'
be a cons cell of the form \(FILENAME . BUFFER\), where BUFFER is a buffer
into which the file's contents were already read, but not yet decoded.
-If operation is `write-region', the coding system is chosen based upon
-the value of `buffer-file-coding-system' and `buffer-file-type'. If
-`buffer-file-coding-system' is non-nil, its value is used. If it is
-nil and `buffer-file-type' is t, the coding system is `no-conversion'.
+If operation is `write-region', the coding system is chosen based
+upon the value of `buffer-file-coding-system'. If
+`buffer-file-coding-system' is non-nil, its value is used.
Otherwise, it is `undecided-dos'.
-The two most common situations are when DOS and Unix files are read
-and written, and their names do not match in
-`untranslated-filesystem-list' and `file-name-buffer-file-type-alist'.
-In these cases, the coding system initially will be `undecided'. As
-the file is read in the DOS case, the coding system will be changed to
-`undecided-dos' as CR/LFs are detected. As the file is read in the
-Unix case, the coding system will be changed to `undecided-unix' as
-LFs are detected. In both cases, `buffer-file-coding-system' will be
-set to the appropriate coding system, and the value of
-`buffer-file-coding-system' will be used when writing the file."
+The most common situation is when DOS and Unix files are read and
+written, and their names do not match in `untranslated-filesystem-list'.
+In these cases, the coding system initially will be `undecided'.
+As the file is read in the DOS case, the coding system will be
+changed to `undecided-dos' as CR/LFs are detected. As the file
+is read in the Unix case, the coding system will be changed to
+`undecided-unix' as LFs are detected. In both cases,
+`buffer-file-coding-system' will be set to the appropriate coding
+system, and the value of `buffer-file-coding-system' will be used
+when writing the file."
(let ((op (nth 0 command))
- (binary nil) (text nil)
(undecided nil) (undecided-unix nil)
target target-buf)
(cond ((eq op 'insert-file-contents)
(and (bufferp (cdr target))
(buffer-name (cdr target))))
(setq target (car target)))
- ;; First check for a file name that indicates
- ;; it is truly binary.
- (setq binary (find-buffer-file-type target))
- (cond (binary)
- ;; Next check for files that MUST use DOS eol conversion.
- ((find-buffer-file-type-match target)
- (setq text t))
- ;; For any other existing file, decide based on contents.
- ((or
+ (cond ((or
+ ;; For any existing file, decide based on contents.
(file-exists-p target)
;; If TARGET does not exist as a file, replace its
;; base name with TARGET-BUF and try again. This
;; Next check for a non-DOS file system.
((untranslated-file-p target)
(setq undecided-unix t)))
- (cond (binary '(no-conversion . no-conversion))
- (text '(undecided-dos . undecided-dos))
- (undecided-unix '(undecided-unix . undecided-unix))
+ (cond (undecided-unix '(undecided-unix . undecided-unix))
(undecided '(undecided . undecided))
(t (cons (default-value 'buffer-file-coding-system)
(default-value 'buffer-file-coding-system)))))
;; Normally this is used only in a non-file-visiting
;; buffer, because normally buffer-file-coding-system is non-nil
;; in a file-visiting buffer.
- (if buffer-file-type
- '(no-conversion . no-conversion)
- '(undecided-dos . undecided-dos)))))))
-
-(modify-coding-system-alist 'file "" 'find-buffer-file-type-coding-system)
+ '(undecided-dos . undecided-dos))))))
(defun find-file-binary (filename)
"Visit file FILENAME and treat it as binary."
(interactive "FFind file binary: ")
- (let ((file-name-buffer-file-type-alist '(("" . t))))
+ (let ((coding-system-for-read 'no-conversion))
(find-file filename)))
(defun find-file-text (filename)
"Visit file FILENAME and treat it as a text file."
(interactive "FFind file text: ")
- (let ((file-name-buffer-file-type-alist '(("" . nil))))
+ (let ((coding-system-for-read 'undecided-dos))
(find-file filename)))
(defun find-file-not-found-set-buffer-file-coding-system ()
(define-key map (char-to-string help-char) 'electric-help-help)
(define-key map "?" 'electric-help-help)
(define-key map " " 'scroll-up)
+ (define-key map [?\S-\ ] 'scroll-down)
(define-key map "\^?" 'scroll-down)
(define-key map "." 'beginning-of-buffer)
(define-key map "<" 'beginning-of-buffer)
-;;; 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'.
-
-;; 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)
-
-;; 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)
-
-;; 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))
+(defalias 'ad-activate-internal 'ad-activate)
-(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)))
+(defun ad-make-advicefunname (function)
+ "Make name to be used to call the assembled advice function."
+ (intern (format "ad-Advice-%s" function)))
+(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)
-;; @@ 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)
(defun ad-preactivate-advice (function advice class position)
"Preactivate FUNCTION and returns the constructed cache."
- (let* ((function-defined-p (fboundp function))
- (old-definition
- (if function-defined-p
- (symbol-function function)))
+ (let* ((advicefunname (ad-get-advice-info-field function 'advicefunname))
+ (old-advice (symbol-function advicefunname))
(old-advice-info (ad-copy-advice-info function))
(ad-advised-functions ad-advised-functions))
(unwind-protect
(list (ad-get-cache-definition function)
(ad-get-cache-id function))))
(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)
- (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))))))
+ (advice-remove function advicefunname)
+ (fset advicefunname old-advice)
+ (if old-advice (advice-add function :around advicefunname)))))
;; @@ 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))))
Thus, the result of the body appears to the compiler as a quoted constant.
In interpreted code, this is entirely equivalent to `progn'."
(declare (debug t) (indent 0))
- ;; Not necessary because we have it in b-c-initial-macro-environment
- ;; (list 'quote (eval (cons 'progn body)))
- (cons 'progn body))
+ (list 'quote (eval (cons 'progn body) lexical-binding)))
(defmacro eval-and-compile (&rest body)
"Like `progn', but evaluates the body at compile time and at load time."
(declare (debug t) (indent 0))
- ;; Remember, it's magic.
- (cons 'progn body))
+ ;; When the byte-compiler expands code, this macro is not used, so we're
+ ;; either about to run `body' (plain interpretation) or we're doing eager
+ ;; macroexpansion.
+ (list 'quote (eval (cons 'progn body) lexical-binding)))
(put 'with-no-warnings 'lisp-indent-function 0)
(defun with-no-warnings (&rest body)
(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)
(kill-emacs-hook
(cons (lambda () (ignore-errors (delete-file tempfile)))
kill-emacs-hook)))
- (if (memq system-type '(ms-dos 'windows-nt))
- (setq buffer-file-type t))
(write-region (point-min) (point-max) tempfile nil 1)
;; This has the intentional side effect that any
;; hard-links to target-file continue to
(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.
;; a single prompt, optionally using completion.
;; Multiple strings are specified by separating each of the strings
-;; with a prespecified separator character. For example, if the
-;; separator character is a comma, the strings 'alice', 'bob', and
+;; with a prespecified separator regexp. For example, if the
+;; separator regexp is ",", the strings 'alice', 'bob', and
;; 'eve' would be specified as 'alice,bob,eve'.
-;; The default value for the separator character is the value of
-;; `crm-default-separator' (comma). The separator character may be
+;; The default value for the separator regexp is the value of
+;; `crm-default-separator' (comma). The separator regexp may be
;; changed by modifying the value of `crm-separator'.
;; Contiguous strings of non-separator-characters are referred to as
;; first revamped version
;;; Code:
-(defconst crm-default-separator ","
- "Default separator for `completing-read-multiple'.")
+(defconst crm-default-separator "[ \t]*,[ \t]*"
+ "Default separator regexp for `completing-read-multiple'.")
(defvar crm-separator crm-default-separator
- "Separator used for separating strings in `completing-read-multiple'.
-It should be a single character string that doesn't appear in the list of
-completion candidates. Modify this value to make `completing-read-multiple'
-use a separator other than `crm-default-separator'.")
+ "Separator regexp used for separating strings in `completing-read-multiple'.
+It should be a regexp that does not match the list of completion candidates.
+Modify this value to make `completing-read-multiple' use a separator other
+than `crm-default-separator'.")
(defvar crm-local-completion-map
(let ((map (make-sparse-keymap)))
(overlay-put ol 'field (make-symbol "crm"))
ol))
+(defmacro crm--completion-command (command)
+ "Make COMMAND a completion command for `completing-read-multiple'."
+ `(let ((ol (crm--select-current-element)))
+ (unwind-protect
+ ,command
+ (delete-overlay ol))))
+
(defun crm-completion-help ()
"Display a list of possible completions of the current minibuffer element."
(interactive)
- (let ((ol (crm--select-current-element)))
- (unwind-protect
- (minibuffer-completion-help)
- (delete-overlay ol)))
+ (crm--completion-command (minibuffer-completion-help))
nil)
(defun crm-complete ()
Return t if the current element is now a valid match; otherwise return nil."
(interactive)
- (let ((ol (crm--select-current-element)))
- (unwind-protect
- (minibuffer-complete)
- (delete-overlay ol))))
+ (crm--completion-command (minibuffer-complete)))
(defun crm-complete-word ()
"Complete the current element at most a single word.
Like `minibuffer-complete-word' but for `completing-read-multiple'."
(interactive)
- (let ((ol (crm--select-current-element)))
- (unwind-protect
- (minibuffer-complete-word)
- (delete-overlay ol))))
+ (crm--completion-command (minibuffer-complete-word)))
(defun crm-complete-and-exit ()
"If all of the minibuffer elements are valid completions then exit.
(setq doexit nil))
(goto-char (overlay-end ol))
(delete-overlay ol))
- (not (eobp))))
+ (not (eobp)))
+ (looking-at crm-separator))
;; Skip to the next element.
- (forward-char 1))
+ (goto-char (match-end 0)))
(if doexit (exit-minibuffer))))
(defun crm--choose-completion-string (choice buffer base-position
single prompt, optionally using completion.
Multiple strings are specified by separating each of the strings with
-a prespecified separator character. For example, if the separator
-character is a comma, the strings 'alice', 'bob', and 'eve' would be
+a prespecified separator regexp. For example, if the separator
+regexp is \",\", the strings 'alice', 'bob', and 'eve' would be
specified as 'alice,bob,eve'.
-The default value for the separator character is the value of
-`crm-default-separator' (comma). The separator character may be
+The default value for the separator regexp is the value of
+`crm-default-separator' (comma). The separator regexp may be
changed by modifying the value of `crm-separator'.
Contiguous strings of non-separator-characters are referred to as
(map (if require-match
crm-local-must-match-map
crm-local-completion-map))
- ;; If the user enters empty input, read-from-minibuffer returns
- ;; the empty string, not DEF.
+ ;; If the user enters empty input, `read-from-minibuffer'
+ ;; returns the empty string, not DEF.
(input (read-from-minibuffer
prompt initial-input map
nil hist def inherit-input-method)))
-;;; 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.
This version, from Edebug, maybe instruments the expression. But the
STREAM must be the current buffer to do so. Whether it instruments is
-also dependent on the values of `edebug-all-defs' and
-`edebug-all-forms'."
+also dependent on the values of the option `edebug-all-defs' and
+the option `edebug-all-forms'."
(or stream (setq stream standard-input))
(if (eq stream (current-buffer))
(edebug-read-and-maybe-wrap-form)
With a prefix argument, instrument the code for Edebug.
-Setting `edebug-all-defs' to a non-nil value reverses the meaning of
-the prefix argument. Code is then instrumented when this function is
+Setting option `edebug-all-defs' to a non-nil value reverses the meaning
+of the prefix argument. Code is then instrumented when this function is
invoked without a prefix argument
If acting on a `defun' for FUNCTION, and the function was instrumented,
;;; 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
- (fixnum (list x (format "#x%x" x) (format "?%c" x)))
+ (cl-typecase x
+ (character (list x (format "#x%x" x) (format "?%c" x)))
+ (fixnum (list x (format "#x%x" x)))
(t x)))
(defun ert--explain-equal-rec (a b)
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*")
+ (point-max-marker))))
(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-string-face))))
font-lock-comment-face))
-(defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive)
+(defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive
+ bar-not-symbol)
"Common initialization routine for lisp modes.
The LISP-SYNTAX argument is used by code in inf-lisp.el and is
\(uselessly) passed from pp.el, chistory.el, gnus-kill.el and
score-mode.el. KEYWORDS-CASE-INSENSITIVE non-nil means that for
-font-lock keywords will not be case sensitive."
+font-lock keywords will not be case sensitive. BAR-NOT-SYMBOL
+non-nil means that | is not a symbol character."
(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)
- nil ,keywords-case-insensitive (("+-*/.<>=!?$%_&~^:@" . "w")) nil
+ nil ,keywords-case-insensitive
+ ((,(concat "+-*/.<>=!?$%_&~^:@" (if bar-not-symbol "" "|")) . "w"))
+ nil
(font-lock-mark-block-function . mark-defun)
(font-lock-syntactic-face-function
. lisp-font-lock-syntactic-face-function))))
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)
(bindings--define-key prof-map [prof-func]
'(menu-item "Instrument Function..." elp-instrument-function
:help "Instrument a function for profiling"))
+ ;; Maybe this should be in a separate submenu from the ELP stuff?
+ (bindings--define-key prof-map [sep-natprof] menu-bar-separator)
+ (bindings--define-key prof-map [prof-natprof-stop]
+ '(menu-item "Stop Native Profiler" profiler-stop
+ :help "Stop recording profiling information"
+ :enable (and (featurep 'profiler)
+ (profiler-running-p))))
+ (bindings--define-key prof-map [prof-natprof-report]
+ '(menu-item "Show Profiler Report" profiler-report
+ :help "Show the current profiler report"
+ :enable (and (featurep 'profiler)
+ (profiler-running-p))))
+ (bindings--define-key prof-map [prof-natprof-start]
+ '(menu-item "Start Native Profiler..." profiler-start
+ :help "Start recording profiling information"))
+
(bindings--define-key menu-map [lint] (cons "Linting" lint-map))
(bindings--define-key lint-map [lint-di]
'(menu-item "Lint Directory..." elint-directory
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]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
+ (lisp-mode-variables nil t t)
+ (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)))
+ (let ((val (funcall tweaker first rest props)))
+ (if val (car val)
+ (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)
+ (cond ((not first) rest)
+ ((or (equal function first)
+ (equal function (cdr (assq 'name props))))
+ (list 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
(require 'lisp-mnt)
(let ((package-name (symbol-name package))
(built-in (assq package package--builtins))
- desc pkg-dir reqs version installable)
+ desc pkg-dir reqs version installable archive)
(prin1 package)
(princ " is ")
(cond
;; Available packages are in `package-archive-contents'.
((setq desc (cdr (assq package package-archive-contents)))
(setq version (package-version-join (package-desc-vers desc))
+ archive (aref desc (- (length desc) 1))
installable t)
(if built-in
(insert "a built-in package.\n\n")
(installable
(if built-in
(insert (propertize "Built-in." 'font-lock-face 'font-lock-builtin-face)
- " Alternate version available -- ")
- (insert "Available -- "))
+ " Alternate version available")
+ (insert "Available"))
+ (insert " from " archive)
+ (insert " -- ")
(let ((button-text (if (display-graphic-p) "Install" "[Install]"))
(button-face (if (display-graphic-p)
'(:box (:line-width 2 :color "dark grey")
(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."
;; Run handler.
;; We do this after rescheduling so that the handler function
;; can cancel its own timer successfully with cancel-timer.
- (condition-case nil
+ (condition-case-unless-debug err
;; Timer functions should not change the current buffer.
;; If they do, all kinds of nasty surprises can happen,
;; and it can be hellish to track down their source.
(save-current-buffer
(apply (timer--function timer) (timer--args timer)))
- (error nil))
+ (error (message "Error in timer: %S" err)))
(if retrigger
(setf (timer--triggered timer) nil)))
(error "Bogus timer event"))))
-;;; 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
+ ;; FIXME: Make it so we can click the function name to jump to its
+ ;; definition and/or untrace it.
+ (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 (eval exp t)) "]"))))))))
;;;###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)
-into BUFFER. This function generates advice to trace FUNCTION
-and activates it together with any other advice there might be.
-The trace output goes to BUFFER quietly, without changing
-the window or buffer configuration.
-
-BUFFER defaults to `trace-buffer'.
+Like `trace-function-foreground' but without popping up the trace BUFFER or
+changing the window configuration."
+ (interactive (trace--read-args "Trace function in background: "))
+ (trace-function-internal function buffer t context))
-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))
+;;;###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)
(define-key map "\C-z" 'vip-change-mode-to-emacs)
(define-key map "\e" 'vip-ESC)
+ (define-key map [?\S-\ ] 'vip-scroll-back)
(define-key map " " 'vip-scroll)
(define-key map "!" 'vip-command-argument)
(define-key map "\"" 'vip-command-argument)
;; 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
(define-key keymap "n" 'next-line)
(define-key keymap "p" 'previous-line)
(define-key keymap " " 'scroll-up-command)
+ (define-key keymap [?\S-\ ] 'scroll-down-command)
(define-key keymap [delete] 'scroll-down-command)
(define-key keymap "q" 'epa-exit-buffer)
(define-key keymap [menu-bar epa-key-list-mode] (cons "Keys" menu-map))
(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-02-13 Aidan Gauland <aidalgol@no8wireless.co.nz>
+
+ * erc-match.el (erc-match-message): Fix last commit.
+
+2013-02-12 Aidan Gauland <aidalgol@no8wireless.co.nz>
+
+ * erc-match.el (erc-match-message):
+ Don't truncate action messages. (Bug#13689)
+
+2013-02-09 Eli Zaretskii <eliz@gnu.org>
+
+ * erc-dcc.el (erc-dcc-get-file): Don't reference buffer-file-type.
+
+2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * erc-dcc.el (erc-dcc-send-file): Use point-min-marker.
+ (erc-dcc-chat-setup): Use point-max-marker.
+
+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
(let* ((buffer (erc-dcc-find-file file))
(size (buffer-size buffer))
(start (with-current-buffer buffer
- (set-marker (make-marker) (point-min))))
+ (point-min-marker)))
(sproc (erc-dcc-server "dcc-send"
'erc-dcc-send-filter
'erc-dcc-send-sentinel))
(set-buffer-multibyte nil))
(setq mode-line-process '(":%s")
- buffer-file-type t
buffer-read-only t)
(setq erc-dcc-file-name file)
(setq erc-dcc-from nick)
(setq erc-dcc-entry-data entry)
(setq erc-dcc-unprocessed-output "")
- (setq erc-insert-marker (set-marker (make-marker) (point-max)))
+ (setq erc-insert-marker (point-max-marker))
(setq erc-input-marker (make-marker))
(erc-display-prompt buffer (point-max))
(set-process-buffer proc buffer)
(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:
(match-beginning 0)))
(nick-end (when nick-beg
(match-end 0)))
- (message (buffer-substring (if (and nick-end
- (<= (+ 2 nick-end) (point-max)))
- (+ 2 nick-end)
- (point-min))
- (point-max))))
+ (message (buffer-substring
+ (if (and nick-end
+ (<= (+ 2 nick-end) (point-max)))
+ ;; Message starts 2 characters after the nick
+ ;; except for CTCP ACTION messages. Nick
+ ;; surrounded by angle brackets only in normal
+ ;; messages.
+ (+ nick-end
+ (if (eq ?> (char-after nick-end))
+ 2
+ 1))
+ (point-min))
+ (point-max))))
(when (and vector
(not (and erc-match-exclude-server-buffer
(erc-server-buffer-p))))
;;; 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))))
;;; Code:
-(eval-when-compile
- (require 'cl-lib)
- (require 'eshell))
+(eval-when-compile (require 'eshell))
+(require 'cl-lib)
(require 'esh-util)
(require 'esh-opt)
(defvar numeric-uid-gid)
(defvar reverse-list)
(defvar show-all)
+(defvar show-almost-all)
(defvar show-recursive)
(defvar show-size)
(defvar sort-method)
(defun eshell-do-ls (&rest args)
"Implementation of \"ls\" in Lisp, passing ARGS."
(funcall flush-func -1)
- ;; process the command arguments, and begin listing files
+ ;; Process the command arguments, and begin listing files.
(eshell-eval-using-options
"ls" (if eshell-ls-initial-args
(list eshell-ls-initial-args args)
args)
`((?a "all" nil show-all
- "show all files in directory")
+ "do not ignore entries starting with .")
+ (?A "almost-all" nil show-almost-all
+ "do not list implied . and ..")
(?c nil by-ctime sort-method
"sort by last status change time")
(?d "directory" nil dir-literal
;; later when we are going to
;; display user and group names.
(if numeric-uid-gid 'integer 'string))))
- (when (and (not show-all) eshell-ls-exclude-regexp)
+ (when (and show-almost-all
+ (not show-all))
+ (setq entries
+ (cl-remove-if
+ (lambda (entry)
+ (member (caar entry) '("." "..")))
+ entries)))
+ (when (and (not show-all)
+ eshell-ls-exclude-regexp)
(while (and entries (string-match eshell-ls-exclude-regexp
(caar entries)))
(setq entries (cdr entries)))
(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))
(list-processes)))
(defun eshell/kill (&rest args)
- "Kill processes, buffers, symbol or files."
- (let ((ptr args)
- (signum 'SIGINT))
- (while ptr
- (if (or (eshell-processp (car ptr))
- (and (stringp (car ptr))
- (string-match "^[A-Za-z/][A-Za-z0-9<>/]+$"
- (car ptr))))
- ;; What about when $lisp-variable is possible here?
- ;; It could very well name a process.
- (setcar ptr (get-process (car ptr))))
- (setq ptr (cdr ptr)))
+ "Kill processes.
+Usage: kill [-<signal>] <pid>|<process> ...
+Accepts PIDs and process objects."
+ ;; If the first argument starts with a dash, treat it as the signal
+ ;; specifier.
+ (let ((signum 'SIGINT))
+ (let ((arg (car args))
+ (case-fold-search nil))
+ (when (stringp arg)
+ (cond
+ ((string-match "\\`-[[:digit:]]+\\'" arg)
+ (setq signum (abs (string-to-number arg))))
+ ((string-match "\\`-\\([[:upper:]]+\\|[[:lower:]]+\\)\\'" arg)
+ (setq signum (abs (string-to-number arg)))))
+ (setq args (cdr args))))
(while args
- (let ((id (if (eshell-processp (car args))
- (process-id (car args))
- (car args))))
- (when id
- (cond
- ((null id)
- (error "kill: bad signal spec"))
- ((and (numberp id) (= id 0))
- (error "kill: bad signal spec `%d'" id))
- ((and (stringp id)
- (string-match "^-?[0-9]+$" id))
- (setq signum (abs (string-to-number id))))
- ((stringp id)
- (let (case-fold-search)
- (if (string-match "^-\\([A-Z]+[12]?\\)$" id)
- (setq signum
- (intern (concat "SIG" (match-string 1 id))))
- (error "kill: bad signal spec `%s'" id))))
- ((< id 0)
- (setq signum (abs id)))
- (t
- (signal-process id signum)))))
- (setq args (cdr args)))
- nil))
+ (let ((arg (if (eshell-processp (car args))
+ (process-id (car args))
+ (car args))))
+ (when arg
+ (cond
+ ((null arg)
+ (error "kill: null pid. Process may actually be a network connection."))
+ ((not (numberp arg))
+ (error "kill: invalid argument type: %s" (type-of arg)))
+ ((and (numberp arg)
+ (<= arg 0))
+ (error "kill: bad pid: %d" arg))
+ (t
+ (signal-process arg signum)))))
+ (setq args (cdr args))))
+ nil)
(defun eshell-read-process-name (prompt)
"Read the name of a process from the minibuffer, using completion.
"Content of $PATH.
It might be different from \(getenv \"PATH\"\), when
`default-directory' points to a remote host.")
+(make-variable-buffer-local 'eshell-path-env)
(defun eshell-parse-colon-path (path-env)
"Split string with `parse-colon-path'.
(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."
;;; Code:
(require 'url-parse)
+(require 'thingatpt)
(define-obsolete-variable-alias 'ffap-version 'emacs-version "23.2")
:group 'ffap)
(defvar ffap-url-regexp
- ;; 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
- "\\)." ; require one more character
- )
- "Regexp matching URLs. Use nil to disable URL features in ffap.")
+ "\\)")
+ "Regexp matching the beginning of a URI, for FFAP.
+If the value is nil, disable URL-matching features in ffap.")
(defcustom ffap-foo-at-bar-prefix "mailto"
"Presumed URL prefix type of strings like \"<foo.9z@bar>\".
"Last value returned by `ffap-next-guess'.")
(defvar ffap-string-at-point-region '(1 1)
- "List (BEG END), last region returned by `ffap-string-at-point'.")
+ "List (BEG END), last region returned by the function `ffap-string-at-point'.")
(defun ffap-next-guess (&optional back lim)
"Move point to next file or URL, and return it as a string.
Optional argument WRAP says to try wrapping around if necessary.
Interactively: use a single prefix to search backwards,
double prefix to wrap forward, triple to wrap backwards.
-Actual search is done by `ffap-next-guess'."
+Actual search is done by the function `ffap-next-guess'."
(interactive
(cdr (assq (prefix-numeric-value current-prefix-arg)
'((1) (4 t) (16 nil t) (64 t t)))))
(ffap-ftp-regexp (ffap-host-to-filename mach))
))
-(defvar ffap-newsgroup-regexp "^[[:lower:]]+\\.[-+[:lower:]_0-9.]+$"
- "Strings not matching this fail `ffap-newsgroup-p'.")
-(defvar ffap-newsgroup-heads ; entirely inadequate
- '("alt" "comp" "gnu" "misc" "news" "sci" "soc" "talk")
- "Used by `ffap-newsgroup-p' if gnus is not running.")
-
-(defun ffap-newsgroup-p (string)
- "Return STRING if it looks like a newsgroup name, else nil."
- (and
- (string-match ffap-newsgroup-regexp string)
- (let ((htbs '(gnus-active-hashtb gnus-newsrc-hashtb gnus-killed-hashtb))
- (heads ffap-newsgroup-heads)
- htb ret)
- (while htbs
- (setq htb (car htbs) htbs (cdr htbs))
- (condition-case nil
- (progn
- ;; errs: htb symbol may be unbound, or not a hash-table.
- ;; gnus-gethash is just a macro for intern-soft.
- (and (symbol-value htb)
- (intern-soft string (symbol-value htb))
- (setq ret string htbs nil))
- ;; If we made it this far, gnus is running, so ignore "heads":
- (setq heads nil))
- (error nil)))
- (or ret (not heads)
- (let ((head (string-match "\\`\\([[:lower:]]+\\)\\." string)))
- (and head (setq head (substring string 0 (match-end 1)))
- (member head heads)
- (setq ret string))))
- ;; Is there ever a need to modify string as a newsgroup name?
- ret)))
+(defvaralias 'ffap-newsgroup-regexp 'thing-at-point-newsgroup-regexp)
+(defvaralias 'ffap-newsgroup-heads 'thing-at-point-newsgroup-heads)
+(defalias 'ffap-newsgroup-p 'thing-at-point-newsgroup-p)
(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)
;; * no commas (good for latex)
(file "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
;; An url, or maybe a email/news message-id:
- (url "--:=&?$+@-Z_[:alpha:]~#,%;*" "^[:alnum:]" ":;.,!?")
+ (url "--:=&?$+@-Z_[:alpha:]~#,%;*()!'" "^[0-9a-zA-Z]" ":;.,!?")
;; Find a string that does *not* contain a colon:
(nocolon "--9$+<>@-Z_[:alpha:]~" "<@" "@>;.,!?")
;; A machine:
"Alist of \(MODE CHARS BEG END\), where MODE is a symbol,
possibly a major-mode name, or one of the symbol
`file', `url', `machine', and `nocolon'.
-`ffap-string-at-point' uses the data fields as follows:
+Function `ffap-string-at-point' uses the data fields as follows:
1. find a maximal string of CHARS around point,
2. strip BEG chars before point from the beginning,
-3. Strip END chars after point from the end.")
+3. strip END chars after point from the end.")
(defvar ffap-string-at-point nil
;; Added at suggestion of RHOGEE (for ff-paths), 7/24/95.
- "Last string returned by `ffap-string-at-point'.")
+ "Last string returned by the function `ffap-string-at-point'.")
(defun ffap-string-at-point (&optional mode)
"Return a string of characters from around point.
syntax parameters in `ffap-string-at-point-mode-alist'.
If MODE is not found, we use `file' instead of MODE.
If the region is active, return a string from the region.
-Sets `ffap-string-at-point' and `ffap-string-at-point-region'."
+Sets the variable `ffap-string-at-point' and the variable
+`ffap-string-at-point-region'."
(let* ((args
(cdr
(or (assq (or mode major-mode) ffap-string-at-point-mode-alist)
(assq 'file ffap-string-at-point-mode-alist))))
(pt (point))
- (str
- (if (and transient-mark-mode mark-active)
- (buffer-substring
- (setcar ffap-string-at-point-region (region-beginning))
- (setcar (cdr ffap-string-at-point-region) (region-end)))
- (buffer-substring
- (save-excursion
- (skip-chars-backward (car args))
- (skip-chars-forward (nth 1 args) pt)
- (setcar ffap-string-at-point-region (point)))
- (save-excursion
- (skip-chars-forward (car args))
- (skip-chars-backward (nth 2 args) pt)
- (setcar (cdr ffap-string-at-point-region) (point)))))))
- (set-text-properties 0 (length str) nil str)
- (setq ffap-string-at-point str)))
+ (beg (if (use-region-p)
+ (region-beginning)
+ (save-excursion
+ (skip-chars-backward (car args))
+ (skip-chars-forward (nth 1 args) pt)
+ (point))))
+ (end (if (use-region-p)
+ (region-end)
+ (save-excursion
+ (skip-chars-forward (car args))
+ (skip-chars-backward (nth 2 args) pt)
+ (point)))))
+ (setq ffap-string-at-point
+ (buffer-substring-no-properties
+ (setcar ffap-string-at-point-region beg)
+ (setcar (cdr ffap-string-at-point-region) end)))))
(defun ffap-string-around ()
;; Sometimes useful to decide how to treat a string.
- "Return string of two chars around last `ffap-string-at-point'.
+ "Return string of two chars around last result of function
+`ffap-string-at-point'.
Assumes the buffer has not changed."
(save-excursion
(format "%c%c"
(defun ffap-copy-string-as-kill (&optional mode)
;; Requested by MCOOK. Useful?
- "Call `ffap-string-at-point', and copy result to `kill-ring'."
+ "Call function `ffap-string-at-point', and copy result to `kill-ring'."
(interactive)
(let ((str (ffap-string-at-point mode)))
(if (equal "" str)
(defun ffap-url-at-point ()
"Return URL from around point if it exists, or nil."
- ;; Could use w3's url-get-url-at-point instead. Both handle "URL:",
- ;; ignore non-relative links, trim punctuation. The other will
- ;; actually look back if point is in whitespace, but I would rather
- ;; ffap be less aggressive in such situations.
(when ffap-url-regexp
(or (and (eq major-mode 'w3-mode) ; In a w3 buffer button?
(w3-view-this-url t))
- ;; Is there a reason not to strip trailing colon?
- (let ((name (ffap-string-at-point 'url)))
- (cond
- ((string-match "^url:" name) (setq name (substring name 4)))
- ((and (string-match "\\`[^:</>@]+@[^:</>@]+[[:alnum:]]\\'" name)
- ;; "foo@bar": could be "mailto" or "news" (a Message-ID).
- ;; Without "<>" it must be "mailto". Otherwise could be
- ;; either, so consult `ffap-foo-at-bar-prefix'.
- (let ((prefix (if (and (equal (ffap-string-around) "<>")
- ;; Expect some odd characters:
- (string-match "[$.0-9].*[$.0-9].*@" name))
- ;; Could be news:
- ffap-foo-at-bar-prefix
- "mailto")))
- (and prefix (setq name (concat prefix ":" name))))))
- ((ffap-newsgroup-p name) (setq name (concat "news:" name)))
- ((and (string-match "\\`[[:alnum:]]+\\'" name) ; <mic> <root> <nobody>
- (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)))))
+ (let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp)
+ (thing-at-point-default-mail-scheme ffap-foo-at-bar-prefix))
+ (thing-at-point-url-at-point t
+ (if (use-region-p)
+ (cons (region-beginning)
+ (region-end))))))))
(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.
:version "22.1")
(defvar ffap-highlight-overlay nil
- "Overlay used by `ffap-highlight'.")
+ "Overlay used by function `ffap-highlight'.")
(defun ffap-highlight (&optional remove)
"If `ffap-highlight' is set, highlight the guess in this buffer.
(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
(call-interactively 'ffap)))
(defun ffap-literally ()
- "Like `ffap' and `find-file-literally'.
+ "Like `ffap' and command `find-file-literally'.
Only intended for interactive use."
(interactive)
(let ((ffap-file-finder 'find-file-literally))
(defun ffap-gnus-hook ()
"Bind `ffap-gnus-next' and `ffap-gnus-menu' to M-l and M-m, resp."
- (set (make-local-variable 'ffap-foo-at-bar-prefix) "news") ; message-id's
+ ;; message-id's
+ (setq-local thing-at-point-default-mail-uri-scheme "news")
;; Note "l", "L", "m", "M" are taken:
(local-set-key "\M-l" 'ffap-gnus-next)
(local-set-key "\M-m" 'ffap-gnus-menu))
(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
(other :tag "Query" other))
:group 'find-file)
+(defvar enable-dir-local-variables t
+ "Non-nil means enable use of directory-local variables.
+Some modes may wish to set this to nil to prevent directory-local
+settings being applied, but still respect file-local ones.")
+
;; This is an odd variable IMO.
;; You might wonder why it is needed, when we could just do:
;; (set (make-local-variable 'enable-local-variables) nil)
;; 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)
(after-find-file error (not nowarn)))
(current-buffer))))
\f
-(defvar file-name-buffer-file-type-alist) ;From dos-w32.el.
-
(defun insert-file-contents-literally (filename &optional visit beg end replace)
"Like `insert-file-contents', but only reads in the file literally.
A buffer may be modified in several ways after reading into the buffer,
(after-insert-file-functions nil)
(coding-system-for-read 'no-conversion)
(coding-system-for-write 'no-conversion)
- (file-name-buffer-file-type-alist '(("" . t)))
(inhibit-file-name-handlers
;; FIXME: Yuck!! We should turn insert-file-contents-literally
;; into a file operation instead!
(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))
("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode)
("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG
("\\.[eE]?[pP][sS]\\'" . ps-mode)
- ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe)
+ ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe)
("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode)
("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode)
("BROWSE\\'" . ebrowse-tree-mode)
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.
(defun hack-dir-local-variables ()
"Read per-directory local variables for the current buffer.
Store the directory-local variables in `dir-local-variables-alist'
-and `file-local-variables-alist', without applying them."
+and `file-local-variables-alist', without applying them.
+
+This does nothing if either `enable-local-variables' or
+`enable-dir-local-variables' are nil."
(when (and enable-local-variables
+ enable-dir-local-variables
(or enable-remote-dir-locals
(not (file-remote-p (or (buffer-file-name)
default-directory)))))
(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\".
(not (file-exists-p buffer-file-name))))
(let ((recent-save (recent-auto-save-p))
setmodes)
- ;; If buffer has no file name, ask user for one.
- (or buffer-file-name
- (let ((filename
- (expand-file-name
- (read-file-name "File to save in: "
- nil (expand-file-name (buffer-name))))))
- (if (file-exists-p filename)
- (if (file-directory-p filename)
- ;; Signal an error if the user specified the name of an
- ;; existing directory.
- (error "%s is a directory" filename)
- (unless (y-or-n-p (format "File `%s' exists; overwrite? "
- filename))
- (error "Canceled")))
- ;; Signal an error if the specified name refers to a
- ;; non-existing directory.
- (let ((dir (file-name-directory filename)))
- (unless (file-directory-p dir)
- (if (file-exists-p dir)
- (error "%s is not a directory" dir)
- (error "%s: no such directory" dir)))))
- (set-visited-file-name filename)))
+ (if buffer-file-name
+ (let ((dir (file-name-directory
+ (expand-file-name buffer-file-name))))
+ (unless (file-exists-p dir)
+ (if (y-or-n-p
+ (format "Directory `%s' does not exist; create? " dir))
+ (make-directory dir t)
+ (error "Canceled"))))
+ ;; If buffer has no file name, ask user for one.
+ (let ((filename
+ (expand-file-name
+ (read-file-name "File to save in: "
+ nil (expand-file-name (buffer-name))))))
+ (if (file-exists-p filename)
+ (if (file-directory-p filename)
+ ;; Signal an error if the user specified the name of an
+ ;; existing directory.
+ (error "%s is a directory" filename)
+ (unless (y-or-n-p (format "File `%s' exists; overwrite? "
+ filename))
+ (error "Canceled")))
+ ;; Signal an error if the specified name refers to a
+ ;; non-existing directory.
+ (let ((dir (file-name-directory filename)))
+ (unless (file-directory-p dir)
+ (if (file-exists-p dir)
+ (error "%s is not a directory" dir)
+ (if (y-or-n-p
+ (format "Directory `%s' does not exist; create? "
+ dir))
+ (make-directory dir t)
+ (error "Canceled"))))))
+ (set-visited-file-name filename)))
(or (verify-visited-file-modtime (current-buffer))
(not (file-exists-p buffer-file-name))
(yes-or-no-p
(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
(basic-save-buffer-2))
(basic-save-buffer-2))
(if buffer-file-coding-system-explicit
- (setcar buffer-file-coding-system-explicit last-coding-system-used)
- (setq buffer-file-coding-system-explicit
- (cons last-coding-system-used nil)))))
+ (setcar buffer-file-coding-system-explicit last-coding-system-used))))
-;; 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)
+ (let (tempsetmodes setmodes writecoding)
(if (not (file-writable-p buffer-file-name))
(let ((dir (file-name-directory buffer-file-name)))
(if (not (file-directory-p dir))
buffer-file-name)))
(setq tempsetmodes t)
(error "Attempt to save to a file which you aren't allowed to write"))))))
+ ;; This may involve prompting, so do it now before backing up the file.
+ ;; Otherwise there can be a delay while the user answers the
+ ;; prompt during which the original file has been renamed. (Bug#13522)
+ (setq writecoding
+ ;; Args here should match write-region call below around
+ ;; which we use writecoding.
+ (choose-write-coding-system nil nil buffer-file-name nil t
+ buffer-file-truename))
(or buffer-backed-up
(setq setmodes (backup-buffer)))
(let* ((dir (file-name-directory 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
;; Pass in nil&nil rather than point-min&max to indicate
;; we're saving the buffer rather than just a region.
;; write-region-annotate-functions may make us of it.
+ (let ((coding-system-for-write writecoding)
+ (coding-system-require-warning nil))
(write-region nil nil
buffer-file-name nil t buffer-file-truename)
(setq success t))
(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))
"Alist of additional `font-lock-keywords' elements for major modes.
Each element has the form (MODE KEYWORDS . HOW).
-`font-lock-set-defaults' adds the elements in the list KEYWORDS to
+Function `font-lock-set-defaults' adds the elements in the list KEYWORDS to
`font-lock-keywords' when Font Lock is turned on in major mode MODE.
If HOW is nil, KEYWORDS are added at the beginning of
(defvar font-lock-removed-keywords-alist nil
"Alist of `font-lock-keywords' elements to be removed for major modes.
-Each element has the form (MODE . KEYWORDS). `font-lock-set-defaults'
+Each element has the form (MODE . KEYWORDS). Function `font-lock-set-defaults'
removes the elements in the list KEYWORDS from `font-lock-keywords'
when Font Lock is turned on in major mode MODE.
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 (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
+ (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 (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
+ (frame-parameter nil 'fullscreen)))
+ (fullscreen
+ . ,(if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
+ (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)
+(define-key esc-map [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)
* auth-source.el (auth-source-format-prompt): Don't get confused by
any "\" in replacement text. (Bug#13637)
+2013-01-30 Christopher Schmidt <christopher@ch.ristopher.com>
+
+ * gnus-int.el (gnus-backend-trace-elapsed): New variable.
+ (gnus-backend-trace): Honour gnus-backend-trace.
+
+ * mml.el (mml-insert-part): Insert closing tag.
+
+ * mm-decode.el (mm-save-part): Handle invalid read-file-name results.
+
+2013-01-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-sum.el (gnus-summary-read-group-1): Protect against not being
+ able to find the article, which can happen in debbugs groups,
+ apparently.
+
+2013-01-16 Glenn Morris <rgm@gnu.org>
+
+ * smiley.el (smiley-style): Make the file loadable in batch mode.
+
+2013-01-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * nnimap.el (nnimap-keepalive): Don't throw an error if there's no more
+ imap process running.
+
+2013-01-14 Julien Danjou <julien@danjou.info>
+
+ * gnus-sum.el (gnus-summary-from-or-to-or-newsgroups):
+ Compare addresses against addresses, not against the full From field.
+
+2013-01-13 Richard Stallman <rms@gnu.org>
+
+ * message.el (message-forward-make-body-mime): New args BEG, END
+ specify what part of FORWARD-BUFFER to use. Do the work directly
+ instead of calling `mml-insert-buffer'.
+
+2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
+
+ * gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
+ cross-reference(s).
+
+ * gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
+ cross-reference(s).
+
+2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * gnus-art.el (gnus-mime-display-security): Use point-min-marker
+ and point-max-marker.
+ * gnus-async.el (gnus-async-article-callback): Use point-max-marker.
+
+2013-01-10 Uwe Brauer <oub@mat.ucm.es> (tiny change)
+
+ * mml-smime.el (mml-smime-encrypt-to-self): New user option analogous
+ to mml2015-encrypt-to-self.
+ (mml-smime-epg-encrypt): Respect mml-smime-encrypt-to-self.
+
+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-24 Andreas Schwab <schwab@linux-m68k.org>
+2012-12-27 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)
gnus-mime-security-button-end-line-format))
(gnus-insert-mime-security-button handle)))
(mm-set-handle-multipart-parameter
- handle 'gnus-region
- (cons (set-marker (make-marker) (point-min))
- (set-marker (make-marker) (point-max))))
+ handle 'gnus-region (cons (point-min-marker) (point-max-marker)))
(goto-char (point-max))))
(defun gnus-mime-security-run-function (function)
gnus-async-article-alist
(cons (list (intern (format "%s-%d" group article)
gnus-async-hashtb)
- mark (set-marker (make-marker) (point-max))
+ mark (point-max-marker)
group article)
gnus-async-article-alist))))
(if (not (gnus-buffer-live-p summary))
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.
'denied))
(defvar gnus-backend-trace nil)
+(defvar gnus-backend-trace-elapsed nil)
-(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)))
+(defun gnus-backend-trace (type form)
(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))))
+ (format " %.2fs %s %S\n"
+ (if (numberp gnus-backend-trace-elapsed)
+ (- (float-time) gnus-backend-trace-elapsed)
+ 0)
+ type form))
+ (setq gnus-backend-trace-elapsed (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)))
+ (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)
groups since the last time it checked:
1. This variable is `ask-server'.
2. This variable is a list of select methods (see below).
- 3. `gnus-read-active-file' is nil or `some'.
+ 3. Option `gnus-read-active-file' is nil or `some'.
4. A prefix argument is given to `gnus-find-new-newsgroups' interactively.
Thus, if this variable is `ask-server' or a list of select methods or
(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)
(defcustom gnus-summary-newsgroup-prefix "=> "
"*String prefixed to the Newsgroup field in the summary
-line when using `gnus-ignored-from-addresses'."
+line when using the option `gnus-ignored-from-addresses'."
:version "22.1"
:group 'gnus-summary
:type 'string)
(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."
(or (car (funcall gnus-extract-address-components from))
from))
-(defun gnus-summary-from-or-to-or-newsgroups (header gnus-tmp-from)
+(defun gnus-summary-from-or-to-or-newsgroups (header from)
(let ((mail-parse-charset gnus-newsgroup-charset)
- (ignored-from-addresses (gnus-ignored-from-addresses))
- ; Is it really necessary to do this next part for each summary line?
- ; Luckily, doesn't seem to slow things down much.
- (mail-parse-ignored-charsets
- (with-current-buffer gnus-summary-buffer
- gnus-newsgroup-ignored-charsets)))
+ (ignored-from-addresses (gnus-ignored-from-addresses))
+ ;; Is it really necessary to do this next part for each summary line?
+ ;; Luckily, doesn't seem to slow things down much.
+ (mail-parse-ignored-charsets
+ (with-current-buffer gnus-summary-buffer
+ gnus-newsgroup-ignored-charsets))
+ (address (cadr (gnus-extract-address-components from))))
(or
(and ignored-from-addresses
- (string-match ignored-from-addresses gnus-tmp-from)
+ (string-match ignored-from-addresses address)
(let ((extra-headers (mail-header-extra header))
to
newsgroups)
gnus-newsgroup-name)) 'nntp)
(gnus-group-real-name gnus-newsgroup-name))))
(concat gnus-summary-newsgroup-prefix newsgroups)))))
- (gnus-string-mark-left-to-right
- (inline
- (gnus-summary-extract-address-component gnus-tmp-from))))))
+ (gnus-string-mark-left-to-right (gnus-summary-extract-address-component from)))))
(defun gnus-summary-insert-line (gnus-tmp-header
gnus-tmp-level gnus-tmp-current
gnus-auto-select-first)
(progn
(let ((art (gnus-summary-article-number)))
- (unless (and (not gnus-plugged)
- (or (memq art gnus-newsgroup-undownloaded)
- (memq art gnus-newsgroup-downloadable)))
+ (when (and art
+ gnus-plugged
+ (not (memq art gnus-newsgroup-undownloaded))
+ (not (memq art gnus-newsgroup-downloadable)))
(gnus-summary-goto-article art))))
;; Don't select any articles.
(gnus-summary-position-point)
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
(dolist (elem ignored)
(message-remove-header elem t))))))
-(defun message-forward-make-body-mime (forward-buffer)
+(defun message-forward-make-body-mime (forward-buffer &optional beg end)
(let ((b (point)))
(insert "\n\n<#part type=message/rfc822 disposition=inline raw=t>\n")
(save-restriction
(narrow-to-region (point) (point))
- (mml-insert-buffer forward-buffer)
+ (insert-buffer-substring forward-buffer beg end)
+ (mml-quote-region (point-min) (point-max))
(goto-char (point-min))
(when (looking-at "From ")
(replace-match "X-From-Line: "))
(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))))
(when filename
(setq filename (gnus-map-function mm-file-name-rewrite-functions
(file-name-nondirectory filename))))
- (setq file
- (read-file-name
- (or prompt
- (format "Save MIME part to (default %s): "
- (or filename "")))
- (or mm-default-directory default-directory)
- (expand-file-name (or filename "")
- (or mm-default-directory default-directory))))
+ (while
+ (progn
+ (setq file
+ (read-file-name
+ (or prompt
+ (format "Save MIME part to (default %s): "
+ (or filename "")))
+ (or mm-default-directory default-directory)
+ (expand-file-name (or filename "")
+ (or mm-default-directory default-directory))))
+ (cond ((or (not file) (equal file ""))
+ (message "Please enter a file name")
+ t)
+ ((and (file-directory-p file)
+ (not filename))
+ (message "Please enter a non-directory file name")
+ t)
+ (t nil)))
+ (sit-for 2)
+ (discard-input))
(if (file-directory-p file)
(setq file (expand-file-name filename file))
(setq file (expand-file-name
: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)
+
+(defcustom mml-smime-encrypt-to-self nil
+ "If t, add your own key ID to recipient list when encryption."
+ :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
(goto-char (point-max))))
(defun mml-smime-epg-encrypt (cont)
- (let ((inhibit-redisplay t)
- (context (epg-make-context 'CMS))
- (config (epg-configuration))
- (recipients (message-options-get 'mml-smime-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key)
+ (let* ((inhibit-redisplay t)
+ (context (epg-make-context 'CMS))
+ (config (epg-configuration))
+ (recipients (message-options-get 'mml-smime-epg-recipients))
+ cipher signers
+ (sender (message-options-get 'message-sender))
+ (signer-names (or mml-smime-signers
+ (if (and mml-smime-sign-with-sender sender)
+ (list (concat "<" sender ">")))))
+ (boundary (mml-compute-boundary cont))
+ recipient-key)
(unless recipients
(setq recipients
(apply #'nconc
(message-options-set 'message-recipients
(read-string "Recipients: ")))
"[ \f\t\n\r\v,]+"))))
+ (when mml-smime-encrypt-to-self
+ (unless signer-names
+ (error "Neither message sender nor mml-smime-signers are set"))
+ (setq recipients (nconc recipients signer-names)))
(if (eq mm-encrypt-option 'guided)
(setq recipients
(epa-select-keys context "\
;; when you send the message.
(or (eq mail-user-agent 'message-user-agent)
(setq mail-encode-mml t))
- (mml-insert-tag 'part 'type type 'disposition "inline"))
+ (mml-insert-tag 'part 'type type 'disposition "inline")
+ (save-excursion
+ (mml-insert-tag '/part)))
(declare-function message-subscribed-p "message" ())
(declare-function message-make-mail-followup-to "message"
(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.
(nnimap-last-command-time nnimap-object)))
;; More than five minutes since the last command.
(* 5 60)))
- (nnimap-send-command "NOOP")))))))
+ (ignore-errors ;E.g. "buffer foo has no process".
+ (nnimap-send-command "NOOP"))))))))
(defun nnimap-open-connection (buffer)
;; Be backwards-compatible -- the earlier value of nnimap-stream was
(defun nnimap-open-connection-1 (buffer)
(unless nnimap-keepalive-timer
(setq nnimap-keepalive-timer (run-at-time (* 60 15) (* 60 15)
- 'nnimap-keepalive)))
+ #'nnimap-keepalive)))
(with-current-buffer (nnimap-make-process-buffer buffer)
(let* ((coding-system-for-read 'binary)
(coding-system-for-write 'binary)
;; 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))))
(defcustom smiley-style
(if (or (and (fboundp 'face-attribute)
- (>= (face-attribute 'default :height) 160))
+ ;; In batch mode, attributes can be unspecified.
+ (condition-case nil
+ (>= (face-attribute 'default :height) 160)
+ (error nil)))
(and (fboundp 'face-height)
(>= (face-height 'default) 14)))
'medium
(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))
(when (and docstring (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring))
(cons (format "(%s%s"
;; Replace `fn' with the actual function name.
- (if (consp def) "anonymous" def)
+ (if (symbolp def) def "anonymous")
(match-string 1 docstring))
(unless (zerop (match-beginning 0))
(substring docstring 0 (match-beginning 0))))))
(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))
(defconst help-xref-symbol-regexp
(purecopy (concat "\\(\\<\\(\\(variable\\|option\\)\\|" ; Link to var
- "\\(function\\|command\\)\\|" ; Link to function
+ "\\(function\\|command\\|call\\)\\|" ; Link to function
"\\(face\\)\\|" ; Link to face
"\\(symbol\\|program\\|property\\)\\|" ; Don't link
"\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)"
" 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
The number of messages retained in that buffer
is specified by the variable `message-log-max'."
(interactive)
- (switch-to-buffer (get-buffer-create "*Messages*")))
+ (with-current-buffer (get-buffer-create "*Messages*")
+ (goto-char (point-max))
+ (display-buffer (current-buffer))))
(defun view-order-manuals ()
"Display the Emacs ORDERS file."
-;;; 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.
+ (when (symbolp face) ;Don't add it if it's a list (bug#13297).
+ (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)))
+ (when 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 (consp last) ; At least two elements in comps
+ (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.
;; Adjust frame and image size.
-(defun image-mode-fit-frame ()
- "Toggle whether to fit the frame to the current image.
-This function assumes the current frame has only one window."
- ;; FIXME: This does not take into account decorations like mode-line,
- ;; minibuffer, header-line, ...
- (interactive)
- (let* ((saved (frame-parameter nil 'image-mode-saved-size))
+(defun image-mode-fit-frame (&optional frame toggle)
+ "Fit FRAME to the current image.
+If FRAME is omitted or nil, it defaults to the selected frame.
+All other windows on the frame are deleted.
+
+If called interactively, or if TOGGLE is non-nil, toggle between
+fitting FRAME to the current image and restoring the size and
+window configuration prior to the last `image-mode-fit-frame'
+call."
+ (interactive (list nil t))
+ (let* ((buffer (current-buffer))
(display (image-get-display-property))
- (size (image-display-size display)))
- (if (and saved
- (eq (caar saved) (frame-width))
- (eq (cdar saved) (frame-height)))
- (progn ;; Toggle back to previous non-fitted size.
- (set-frame-parameter nil 'image-mode-saved-size nil)
- (setq size (cdr saved)))
- ;; Round up size, and save current size so we can toggle back to it.
- (setcar size (ceiling (car size)))
- (setcdr size (ceiling (cdr size)))
- (set-frame-parameter nil 'image-mode-saved-size
- (cons size (cons (frame-width) (frame-height)))))
- (set-frame-width (selected-frame) (car size))
- (set-frame-height (selected-frame) (cdr size))))
+ (size (image-display-size display))
+ (saved (frame-parameter frame 'image-mode-saved-params))
+ (window-configuration (current-window-configuration frame))
+ (width (frame-width frame))
+ (height (frame-height frame)))
+ (with-selected-frame (or frame (selected-frame))
+ (if (and toggle saved
+ (= (caar saved) width)
+ (= (cdar saved) height))
+ (progn
+ (set-frame-width frame (car (nth 1 saved)))
+ (set-frame-height frame (cdr (nth 1 saved)))
+ (set-window-configuration (nth 2 saved))
+ (set-frame-parameter frame 'image-mode-saved-params nil))
+ (delete-other-windows)
+ (switch-to-buffer buffer t t)
+ (let* ((edges (window-inside-edges))
+ (inner-width (- (nth 2 edges) (nth 0 edges)))
+ (inner-height (- (nth 3 edges) (nth 1 edges))))
+ (set-frame-width frame (+ (ceiling (car size))
+ width (- inner-width)))
+ (set-frame-height frame (+ (ceiling (cdr size))
+ height (- inner-height)))
+ ;; The frame size after the above `set-frame-*' calls may
+ ;; differ from what we specified, due to window manager
+ ;; interference. We have to call `frame-width' and
+ ;; `frame-height' to get the actual results.
+ (set-frame-parameter frame 'image-mode-saved-params
+ (list (cons (frame-width)
+ (frame-height))
+ (cons width height)
+ window-configuration)))))))
;;; Image Mode setup
(define-key map (kbd "SPC") 'image-scroll-up)
(define-key map (kbd "DEL") 'image-scroll-down)
(define-key map (kbd "RET") 'image-toggle-animation)
+ (define-key map "n" 'image-next-file)
+ (define-key map "p" 'image-previous-file)
(define-key map [remap forward-char] 'image-forward-hscroll)
(define-key map [remap backward-char] 'image-backward-hscroll)
(define-key map [remap right-char] 'image-forward-hscroll)
(image-animate image index
(if image-animate-loop t)))))))))
+\f
+;;; Switching to the next/previous image
+
+(defun image-next-file (&optional n)
+ "Visit the next image in the same directory as the current image file.
+With optional argument N, visit the Nth image file after the
+current one, in cyclic alphabetical order.
+
+This command visits the specified file via `find-alternate-file',
+replacing the current Image mode buffer."
+ (interactive "p")
+ (unless (derived-mode-p 'image-mode)
+ (error "The buffer is not in Image mode"))
+ (unless buffer-file-name
+ (error "The current image is not associated with a file"))
+ (let* ((file (file-name-nondirectory buffer-file-name))
+ (images (image-mode--images-in-directory file))
+ (idx 0))
+ (catch 'image-visit-next-file
+ (dolist (f images)
+ (if (string= f file)
+ (throw 'image-visit-next-file (1+ idx)))
+ (setq idx (1+ idx))))
+ (setq idx (mod (+ idx (or n 1)) (length images)))
+ (find-alternate-file (nth idx images))))
+
+(defun image-previous-file (&optional n)
+ "Visit the preceding image in the same directory as the current file.
+With optional argument N, visit the Nth image file preceding the
+current one, in cyclic alphabetical order.
+
+This command visits the specified file via `find-alternate-file',
+replacing the current Image mode buffer."
+ (interactive "p")
+ (image-next-file (- n)))
+
+(defun image-mode--images-in-directory (file)
+ (let* ((dir (file-name-directory buffer-file-name))
+ (files (directory-files dir nil
+ (image-file-name-regexp) t)))
+ ;; Add the current file to the list of images if necessary, in
+ ;; case it does not match `image-file-name-regexp'.
+ (unless (member file files)
+ (push file files))
+ (sort files 'string-lessp)))
+
\f
;;; Support for bookmark.el
(declare-function bookmark-make-record-default
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)
Simple elements in the alist look like (INDEX-NAME . POSITION).
POSITION is the buffer position of the item; to go to the item
is simply to move point to that position.
+POSITION is passed to `imenu-default-goto-function', so it can be a non-number
+if that variable has been changed (e.g. Semantic uses overlays for POSITIONs).
Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...).
To \"go to\" a special element means applying FUNCTION
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))
(defun imenu--truncate-items (menulist)
"Truncate all strings in MENULIST to `imenu-max-item-length'."
- (mapcar (lambda (item)
- (cond
- ((consp (cdr item))
- (imenu--truncate-items (cdr item)))
- ;; truncate if necessary
- ((and (numberp imenu-max-item-length)
- (> (length (car item)) imenu-max-item-length))
- (setcar item (substring (car item) 0 imenu-max-item-length)))))
- menulist))
-
+ (mapc (lambda (item)
+ ;; truncate if necessary
+ (when (and (numberp imenu-max-item-length)
+ (> (length (car item)) imenu-max-item-length))
+ (setcar item (substring (car item) 0 imenu-max-item-length)))
+ (when (imenu--subalist-p item)
+ (imenu--truncate-items (cdr item))))
+ menulist))
(defun imenu--make-index-alist (&optional noerror)
"Create an index alist for the definitions in the current buffer.
;; in these major modes. But save that change for later.
(cond ((and imenu-prev-index-position-function
imenu-extract-index-name-function)
- (let ((index-alist '()) (pos -1)
+ (let ((index-alist '()) (pos (point-max))
name)
- (goto-char (point-max))
+ (goto-char pos)
;; Search for the function
(while (funcall imenu-prev-index-position-function)
- (when (= pos (point))
+ (unless (< (point) pos)
(error "Infinite loop at %s:%d: imenu-prev-index-position-function does not move point" (buffer-name) pos))
(setq pos (point))
(save-excursion
(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."
(select-window (posn-window (event-start e))))
(Info-scroll-down)))
-(defun Info-next-reference (&optional recur)
- "Move cursor to the next cross-reference or menu item in the node."
- (interactive)
- (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
- (old-pt (point))
- (case-fold-search t))
- (or (eobp) (forward-char 1))
- (or (re-search-forward pat nil t)
- (progn
- (goto-char (point-min))
- (or (re-search-forward pat nil t)
- (progn
- (goto-char old-pt)
- (user-error "No cross references in this node")))))
- (goto-char (or (match-beginning 1) (match-beginning 0)))
- (if (looking-at "\\* Menu:")
- (if recur
- (user-error "No cross references in this node")
- (Info-next-reference t))
- (if (looking-at "^\\* ")
- (forward-char 2)))))
-
-(defun Info-prev-reference (&optional recur)
- "Move cursor to the previous cross-reference or menu item in the node."
- (interactive)
- (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
- (old-pt (point))
- (case-fold-search t))
- (or (re-search-backward pat nil t)
- (progn
- (goto-char (point-max))
- (or (re-search-backward pat nil t)
- (progn
- (goto-char old-pt)
- (user-error "No cross references in this node")))))
- (goto-char (or (match-beginning 1) (match-beginning 0)))
- (if (looking-at "\\* Menu:")
- (if recur
- (user-error "No cross references in this node")
- (Info-prev-reference t))
- (if (looking-at "^\\* ")
- (forward-char 2)))))
+(defun Info-next-reference (&optional recur count)
+ "Move cursor to the next cross-reference or menu item in the node.
+If COUNT is non-nil (interactively with a prefix arg), jump over
+COUNT cross-references."
+ (interactive "i\np")
+ (unless count
+ (setq count 1))
+ (if (< count 0)
+ (Info-prev-reference recur (- count))
+ (while (unless (zerop count) (setq count (1- count)))
+ (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
+ (old-pt (point))
+ (case-fold-search t))
+ (or (eobp) (forward-char 1))
+ (or (re-search-forward pat nil t)
+ (progn
+ (goto-char (point-min))
+ (or (re-search-forward pat nil t)
+ (progn
+ (goto-char old-pt)
+ (user-error "No cross references in this node")))))
+ (goto-char (or (match-beginning 1) (match-beginning 0)))
+ (if (looking-at "\\* Menu:")
+ (if recur
+ (user-error "No cross references in this node")
+ (Info-next-reference t))
+ (if (looking-at "^\\* ")
+ (forward-char 2)))))))
+
+(defun Info-prev-reference (&optional recur count)
+ "Move cursor to the previous cross-reference or menu item in the node.
+If COUNT is non-nil (interactively with a prefix arg), jump over
+COUNT cross-references."
+ (interactive "i\np")
+ (unless count
+ (setq count 1))
+ (if (< count 0)
+ (Info-next-reference recur (- count))
+ (while (unless (zerop count) (setq count (1- count)))
+ (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
+ (old-pt (point))
+ (case-fold-search t))
+ (or (re-search-backward pat nil t)
+ (progn
+ (goto-char (point-max))
+ (or (re-search-backward pat nil t)
+ (progn
+ (goto-char old-pt)
+ (user-error "No cross references in this node")))))
+ (goto-char (or (match-beginning 1) (match-beginning 0)))
+ (if (looking-at "\\* Menu:")
+ (if recur
+ (user-error "No cross references in this node")
+ (Info-prev-reference t))
+ (if (looking-at "^\\* ")
+ (forward-char 2)))))))
\f
(defun Info-index-nodes (&optional file)
"Return a list of names of all index nodes in Info FILE.
(suppress-keymap map)
(define-key map "." 'beginning-of-buffer)
(define-key map " " 'Info-scroll-up)
+ (define-key map [?\S-\ ] 'Info-scroll-down)
(define-key map "\C-m" 'Info-follow-nearest-node)
(define-key map "\t" 'Info-next-reference)
(define-key map "\e\t" 'Info-prev-reference)
(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 "\")")))
The `info-file' property of COMMAND says which Info manual to search.
If COMMAND has no property, the variable `Info-file-list-for-emacs'
defines heuristics for which Info manual to try.
-The locations are of the format used in `Info-history', i.e.
+The locations are of the format used in the variable `Info-history', i.e.
\(FILENAME NODENAME BUFFERPOS), where BUFFERPOS is the line number
in the first element of the returned list (which is treated specially in
`Info-goto-emacs-command-node'), and 0 for the rest elements of a list."
(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)
(and (vectorp eol-type-1) (vectorp eol-type-2)))))))
(defun add-to-coding-system-list (coding-system)
- "Add CODING-SYSTEM to `coding-system-list' while keeping it sorted."
+ "Add CODING-SYSTEM to variable `coding-system-list' while keeping it sorted."
(if (or (null coding-system-list)
(coding-system-lessp coding-system (car coding-system-list)))
(setq coding-system-list (cons coding-system coding-system-list))
(put (intern name) 'coding-system-define-form form)
(setq coding-system-alist (cons (list name) coding-system-alist)))))
-;; This variable is set in these three cases:
+;; This variable is set in these two cases:
;; (1) A file is read by a coding system specified explicitly.
-;; after-insert-file-set-coding sets the car of this value to
-;; coding-system-for-read, and sets the cdr to nil.
-;; (2) A buffer is saved.
-;; After writing, basic-save-buffer-1 sets the car of this value
-;; to last-coding-system-used.
-;; (3) set-buffer-file-coding-system is called.
+;; `after-insert-file-set-coding' sets the car of this value to
+;; `coding-system-for-read', and sets the cdr to nil.
+;; (2) `set-buffer-file-coding-system' is called.
;; The cdr of this value is set to the specified coding system.
-;; This variable is used for decoding in revert-buffer and encoding in
-;; select-safe-coding-system.
+;; This variable is used for decoding in `revert-buffer' and encoding
+;; in `select-safe-coding-system'.
+;;
+;; When saving a buffer, if `buffer-file-coding-system-explicit' is
+;; already non-nil, `basic-save-buffer-1' sets its CAR to the value of
+;; `last-coding-system-used'. (It used to set it unconditionally, but
+;; that seems unnecessary; see Bug#4533.)
+
(defvar buffer-file-coding-system-explicit nil
"The file coding system explicitly specified for the current buffer.
The value is a cons of coding systems for reading (decoding) and
(defvar isearch-message-function nil
"Function to call to display the search prompt.
-If nil, use `isearch-message'.")
+If nil, use function `isearch-message'.")
(defvar isearch-wrap-function nil
"Function to call to wrap the search when search is failed.
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'.")
(defun isearch-fail-pos (&optional msg)
"Return position of first mismatch in search string, or nil if none.
-If MSG is non-nil, use `isearch-message', otherwise `isearch-string'."
+If MSG is non-nil, use variable `isearch-message', otherwise `isearch-string'."
(let ((cmds isearch-cmds)
(curr-msg (if msg isearch-message isearch-string))
succ-msg)
(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
\f
;;; Variables that are not customizable.
-(defvar jit-lock-mode nil
+(defvar-local jit-lock-mode nil
"Non-nil means Just-in-time Lock mode is active.")
-(make-variable-buffer-local 'jit-lock-mode)
-(defvar jit-lock-functions nil
+(defvar-local jit-lock-functions nil
"Functions to do the actual fontification.
They are called with two arguments: the START and END of the region to fontify.")
-(make-variable-buffer-local 'jit-lock-functions)
-(defvar jit-lock-context-unfontify-pos nil
+(defvar-local jit-lock-context-unfontify-pos nil
"Consider text after this position as contextually unfontified.
If nil, contextual fontification is disabled.")
-(make-variable-buffer-local 'jit-lock-context-unfontify-pos)
-
(defvar jit-lock-stealth-timer nil
"Timer for stealth fontification in Just-in-time Lock mode.")
(remove-hook 'after-change-functions 'jit-lock-after-change t)
(remove-hook 'fontification-functions 'jit-lock-function))))
+(define-minor-mode jit-lock-debug-mode
+ "Minor mode to help debug code run from jit-lock.
+When this minor mode is enabled, jit-lock runs as little code as possible
+during redisplay and moves the rest to a timer, where things
+like `debug-on-error' and Edebug can be used."
+ :global t
+ (when jit-lock-defer-timer
+ (cancel-timer jit-lock-defer-timer)
+ (setq jit-lock-defer-timer nil))
+ (when jit-lock-debug-mode
+ (setq jit-lock-defer-timer
+ (run-with-idle-timer 0 t #'jit-lock--debug-fontify))))
+
+(defvar jit-lock--debug-fontifying nil)
+
+(defun jit-lock--debug-fontify ()
+ "Fontify what was deferred for debugging."
+ (when (and (not jit-lock--debug-fontifying)
+ jit-lock-defer-buffers (not memory-full))
+ (let ((jit-lock--debug-fontifying t)
+ (inhibit-debugger nil)) ;FIXME: Not sufficient!
+ ;; Mark the deferred regions back to `fontified = nil'
+ (dolist (buffer jit-lock-defer-buffers)
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ ;; (message "Jit-Debug %s" (buffer-name))
+ (with-buffer-prepared-for-jit-lock
+ (let ((pos (point-min)))
+ (while
+ (progn
+ (when (eq (get-text-property pos 'fontified) 'defer)
+ (let ((beg pos)
+ (end (setq pos (next-single-property-change
+ pos 'fontified
+ nil (point-max)))))
+ (put-text-property beg end 'fontified nil)
+ (jit-lock-fontify-now beg end)))
+ (setq pos (next-single-property-change
+ pos 'fontified)))))))))
+ (setq jit-lock-defer-buffers nil))))
+
(defun jit-lock-register (fun &optional contextual)
"Register FUN as a fontification function to be called in this buffer.
FUN will be called with two arguments START and END indicating the region
If non-nil, CONTEXTUAL means that a contextual fontification would be useful."
(add-hook 'jit-lock-functions fun nil t)
(when (and contextual jit-lock-contextually)
- (set (make-local-variable 'jit-lock-contextually) t))
+ (setq-local jit-lock-contextually t))
(jit-lock-mode t))
(defun jit-lock-unregister (fun)
Value is nil if there is nothing more to fontify."
(if (zerop (buffer-size))
nil
- (save-restriction
- (widen)
- (let* ((next (text-property-not-all around (point-max) 'fontified t))
- (prev (previous-single-property-change around 'fontified))
- (prop (get-text-property (max (point-min) (1- around))
- 'fontified))
- (start (cond
- ((null prev)
- ;; There is no property change between AROUND
- ;; and the start of the buffer. If PROP is
- ;; non-nil, everything in front of AROUND is
- ;; fontified, otherwise nothing is fontified.
- (if (eq prop t)
- nil
- (max (point-min)
- (- around (/ jit-lock-chunk-size 2)))))
- ((eq prop t)
- ;; PREV is the start of a region of fontified
- ;; text containing AROUND. Start fontifying a
- ;; chunk size before the end of the unfontified
- ;; region in front of that.
- (max (or (previous-single-property-change prev 'fontified)
- (point-min))
- (- prev jit-lock-chunk-size)))
- (t
- ;; PREV is the start of a region of unfontified
- ;; text containing AROUND. Start at PREV or
- ;; chunk size in front of AROUND, whichever is
- ;; nearer.
- (max prev (- around jit-lock-chunk-size)))))
- (result (cond ((null start) next)
- ((null next) start)
- ((< (- around start) (- next around)) start)
- (t next))))
- result))))
+ (let* ((next (text-property-not-all around (point-max) 'fontified t))
+ (prev (previous-single-property-change around 'fontified))
+ (prop (get-text-property (max (point-min) (1- around))
+ 'fontified))
+ (start (cond
+ ((null prev)
+ ;; There is no property change between AROUND
+ ;; and the start of the buffer. If PROP is
+ ;; non-nil, everything in front of AROUND is
+ ;; fontified, otherwise nothing is fontified.
+ (if (eq prop t)
+ nil
+ (max (point-min)
+ (- around (/ jit-lock-chunk-size 2)))))
+ ((eq prop t)
+ ;; PREV is the start of a region of fontified
+ ;; text containing AROUND. Start fontifying a
+ ;; chunk size before the end of the unfontified
+ ;; region in front of that.
+ (max (or (previous-single-property-change prev 'fontified)
+ (point-min))
+ (- prev jit-lock-chunk-size)))
+ (t
+ ;; PREV is the start of a region of unfontified
+ ;; text containing AROUND. Start at PREV or
+ ;; chunk size in front of AROUND, whichever is
+ ;; nearer.
+ (max prev (- around jit-lock-chunk-size)))))
+ (result (cond ((null start) next)
+ ((null next) start)
+ ((< (- around start) (- next around)) start)
+ (t next))))
+ result)))
(defun jit-lock-stealth-fontify (&optional repeat)
"Fontify buffers stealthily.
pos (setq pos (next-single-property-change
pos 'fontified nil (point-max)))
'fontified nil))
- (setq pos (next-single-property-change pos 'fontified)))))))))
+ (setq pos (next-single-property-change
+ pos 'fontified)))))))))
(setq jit-lock-defer-buffers nil)
;; Force fontification of the visible parts.
(let ((jit-lock-defer-timer nil))
(when jit-lock-context-unfontify-pos
;; (message "Jit-Context %s" (buffer-name))
(save-restriction
- (widen)
+ ;; Don't be blindsided by narrowing that starts in the middle
+ ;; of a jit-lock-defer-multiline.
+ (widen)
(when (and (>= jit-lock-context-unfontify-pos (point-min))
(< jit-lock-context-unfontify-pos (point-max)))
;; If we're in text that matches a complex multi-line
(with-current-buffer temp-buffer
(let ((coding-system-for-write 'no-conversion))
- (if (memq system-type '(ms-dos windows-nt))
- (setq buffer-file-type t) )
(jka-compr-run-real-handler 'write-region
(list (point-min) (point-max)
filename
;; 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" (20707 18685 911514 0))
+;;;;;; "play/5x5.el" (20709 26818 907104 0))
;;; Generated autoloads from play/5x5.el
(autoload '5x5 "5x5" "\
;;;***
\f
;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/ada-mode.el
(autoload 'ada-add-extensions "ada-mode" "\
;;;***
\f
;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/ada-stmt.el
(autoload 'ada-header "ada-stmt" "\
;;;***
\f
;;;### (autoloads (ada-find-file) "ada-xref" "progmodes/ada-xref.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "advice" "emacs-lisp/advice.el" (20725 15032 264919 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" (20707 18685 911514 0))
+;;;;;; align) "align" "align.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "net/ange-ftp.el" (20743 44982 104196 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" (20707 18685 911514 0))
+;;;;;; "animate" "play/animate.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "ansi-color" "ansi-color.el" (20709 26818 907104 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" (20707 18685 911514
+;;;;;; "antlr-mode" "progmodes/antlr-mode.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from progmodes/antlr-mode.el
;;;***
\f
;;;### (autoloads (appt-activate appt-add) "appt" "calendar/appt.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; apropos-user-option apropos-read-pattern) "apropos" "apropos.el"
+;;;;;; (20716 56 356960 0))
;;; Generated autoloads from apropos.el
(autoload 'apropos-read-pattern "apropos" "\
\(fn SUBJECT)" nil nil)
-(autoload 'apropos-variable "apropos" "\
-Show user variables that match PATTERN.
+(autoload 'apropos-user-option "apropos" "\
+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.
\(fn PATTERN &optional DO-ALL)" t nil)
+(autoload 'apropos-variable "apropos" "\
+Show variables that match PATTERN.
+When DO-NOT-ALL is not-nil, show user options only, i.e. behave
+like `apropos-user-option'.
+
+\(fn PATTERN &optional DO-NOT-ALL)" t nil)
+
(defalias 'command-apropos 'apropos-command)
(autoload 'apropos-command "apropos" "\
;;;***
\f
-;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from arc-mode.el
(autoload 'archive-mode "arc-mode" "\
;;;***
\f
-;;;### (autoloads (array-mode) "array" "array.el" (20707 18685 911514
+;;;### (autoloads (array-mode) "array" "array.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from array.el
;;;***
\f
-;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from textmodes/artist.el
(autoload 'artist-mode "artist" "\
;;;***
\f
-;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20755 17565 391628 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from gnus/auth-source.el
(defvar auth-source-cache-expiry 7200 "\
;;;***
\f
;;;### (autoloads (autoarg-kp-mode autoarg-mode) "autoarg" "autoarg.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from autoarg.el
(defvar autoarg-mode nil "\
;;;***
\f
;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/autoconf.el
(autoload 'autoconf-mode "autoconf" "\
;;;***
\f
;;;### (autoloads (auto-insert-mode define-auto-insert auto-insert)
-;;;;;; "autoinsert" "autoinsert.el" (20707 18685 911514 0))
+;;;;;; "autoinsert" "autoinsert.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "autorevert" "autorevert.el" (20746 21181 635406 0))
;;; Generated autoloads from autorevert.el
(autoload 'auto-revert-mode "autorevert" "\
;;;***
\f
;;;### (autoloads (mouse-avoidance-mode mouse-avoidance-mode) "avoid"
-;;;;;; "avoid.el" (20707 18685 911514 0))
+;;;;;; "avoid.el" (20709 26818 907104 0))
;;; Generated autoloads from avoid.el
(defvar mouse-avoidance-mode nil "\
;;;***
\f
;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514
+;;;;;; "benchmark" "emacs-lisp/benchmark.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from emacs-lisp/benchmark.el
;;;***
\f
;;;### (autoloads (bibtex-search-entry bibtex-mode bibtex-initialize)
-;;;;;; "bibtex" "textmodes/bibtex.el" (20707 18685 911514 0))
+;;;;;; "bibtex" "textmodes/bibtex.el" (20709 26818 907104 0))
;;; Generated autoloads from textmodes/bibtex.el
(autoload 'bibtex-initialize "bibtex" "\
;;;***
\f
;;;### (autoloads (bibtex-style-mode) "bibtex-style" "textmodes/bibtex-style.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from mail/binhex.el
(defconst binhex-begin-line "^:...............................................................$" "\
;;;***
\f
-;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "bookmark.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "browse-url" "net/browse-url.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "bs" "bs.el" (20709 26818 907104 0))
;;; Generated autoloads from bs.el
(autoload 'bs-cycle-next "bs" "\
;;;***
\f
-;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "progmodes/bug-reference.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (20709
+;;;;;; 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; full-calc calc calc-dispatch) "calc" "calc/calc.el" (20721
+;;;;;; 17977 14204 0))
;;; Generated autoloads from calc/calc.el
(define-key ctl-x-map "*" 'calc-dispatch)
(autoload 'calc-dispatch "calc" "\
-Invoke the GNU Emacs Calculator. See `calc-dispatch-help' for details.
+Invoke the GNU Emacs Calculator. See \\[calc-dispatch-help] for details.
\(fn &optional ARG)" t nil)
;;;***
\f
-;;;### (autoloads (calc-undo) "calc-undo" "calc/calc-undo.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (calc-undo) "calc-undo" "calc/calc-undo.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from calc/calc-undo.el
(autoload 'calc-undo "calc-undo" "\
;;;***
\f
-;;;### (autoloads (calculator) "calculator" "calculator.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (calculator) "calculator" "calculator.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from calculator.el
(autoload 'calculator "calculator" "\
;;;***
\f
-;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (20725
+;;;;;; 15032 264919 0))
;;; Generated autoloads from calendar/calendar.el
(autoload 'calendar "calendar" "\
;;;***
\f
;;;### (autoloads (canlock-verify canlock-insert-header) "canlock"
-;;;;;; "gnus/canlock.el" (20707 18685 911514 0))
+;;;;;; "gnus/canlock.el" (20709 26818 907104 0))
;;; Generated autoloads from gnus/canlock.el
(autoload 'canlock-insert-header "canlock" "\
;;;***
\f
;;;### (autoloads (capitalized-words-mode) "cap-words" "progmodes/cap-words.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/cap-words.el
(autoload 'capitalized-words-mode "cap-words" "\
;;;***
\f
-;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20750 47885 906996 0))
+;;;;;; (20739 47925 957834 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; c-guess) "cc-guess" "progmodes/cc-guess.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "progmodes/cc-styles.el" (20709 26818 907104 0))
;;; Generated autoloads from progmodes/cc-styles.el
(autoload 'c-set-style "cc-styles" "\
;;;***
\f
-;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from international/ccl.el
(autoload 'ccl-compile "ccl" "\
;;;***
\f
;;;### (autoloads (cconv-closure-convert) "cconv" "emacs-lisp/cconv.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "cfengine" "progmodes/cfengine.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "emacs-lisp/check-declare.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "checkdoc" "emacs-lisp/checkdoc.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "language/china-util.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "chistory" "chistory.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/cmacexp.el
(autoload 'c-macro-expand "cmacexp" "\
;;;***
\f
-;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from cmuscheme.el
(autoload 'run-scheme "cmuscheme" "\
;;;***
\f
-;;;### (autoloads (color-name-to-rgb) "color" "color.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (color-name-to-rgb) "color" "color.el" (20721 17977
+;;;;;; 14204 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"
-;;;;;; (20714 7872 790163 728000))
+;;;;;; (20721 17977 14204 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20721 17977 14204 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" (20718
-;;;;;; 7971 773710 0))
+;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (20723
+;;;;;; 59703 12265 0))
;;; Generated autoloads from progmodes/compile.el
(defvar compilation-mode-hook nil "\
If optional second arg COMINT is t the buffer will be in Comint mode with
`compilation-shell-minor-mode'.
-Interactively, prompts for the command if `compilation-read-command' is
-non-nil; otherwise uses `compile-command'. With prefix arg, always prompts.
+Interactively, prompts for the command if the variable
+`compilation-read-command' is non-nil; otherwise uses`compile-command'.
+With prefix arg, always prompts.
Additionally, with universal prefix arg, compilation buffer will be in
comint mode, i.e. interactive.
;;;***
\f
;;;### (autoloads (dynamic-completion-mode) "completion" "completion.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "cookie1" "play/cookie1.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514
+;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20709 26818 907104
;;;;;; 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/cpp.el
(autoload 'cpp-highlight-buffer "cpp" "\
;;;***
\f
;;;### (autoloads (crisp-mode crisp-mode) "crisp" "emulation/crisp.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emulation/crisp.el
(defvar crisp-mode nil "\
;;;***
\f
;;;### (autoloads (completing-read-multiple) "crm" "emacs-lisp/crm.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20718 41783 713368 0))
;;; Generated autoloads from emacs-lisp/crm.el
(autoload 'completing-read-multiple "crm" "\
single prompt, optionally using completion.
Multiple strings are specified by separating each of the strings with
-a prespecified separator character. For example, if the separator
-character is a comma, the strings 'alice', 'bob', and 'eve' would be
+a prespecified separator regexp. For example, if the separator
+regexp is \",\", the strings 'alice', 'bob', and 'eve' would be
specified as 'alice,bob,eve'.
-The default value for the separator character is the value of
-`crm-default-separator' (comma). The separator character may be
+The default value for the separator regexp is the value of
+`crm-default-separator' (comma). The separator regexp may be
changed by modifying the value of `crm-separator'.
Contiguous strings of non-separator-characters are referred to as
;;;***
\f
-;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "cus-edit" "cus-edit.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; customize-create-theme) "cus-theme" "cus-theme.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from cus-theme.el
(autoload 'customize-create-theme "cus-theme" "\
;;;***
\f
;;;### (autoloads (cvs-status-mode) "cvs-status" "vc/cvs-status.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from cedet/data-debug.el
(autoload 'data-debug-new-buffer "data-debug" "\
;;;***
\f
-;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from net/dbus.el
(autoload 'dbus-handle-event "dbus" "\
;;;***
\f
-;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "emacs-lisp/debug.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; delimit-columns-customize) "delim-col" "delim-col.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from delim-col.el
(autoload 'delimit-columns-customize "delim-col" "\
;;;***
\f
-;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (20707
-;;;;;; 18685 911514 0))
-;;; Generated autoloads from progmodes/delphi.el
-
-(autoload 'delphi-mode "delphi" "\
-Major mode for editing Delphi code. \\<delphi-mode-map>
-\\[delphi-tab] - Indents the current line (or region, if Transient Mark mode
- is enabled and the region is active) of Delphi code.
-\\[delphi-find-unit] - Search for a Delphi source file.
-\\[delphi-fill-comment] - Fill the current comment.
-\\[delphi-new-comment-line] - If in a // comment, do a new comment line.
-
-\\[indent-region] also works for indenting a whole region.
-
-Customization:
-
- `delphi-indent-level' (default 3)
- Indentation of Delphi statements with respect to containing block.
- `delphi-compound-block-indent' (default 0)
- Extra indentation for blocks in compound statements.
- `delphi-case-label-indent' (default 0)
- Extra indentation for case statement labels.
- `delphi-tab-always-indents' (default t)
- Non-nil means TAB in Delphi mode should always reindent the current line,
- regardless of where in the line point is when the TAB command is used.
- `delphi-newline-always-indents' (default t)
- Non-nil means NEWLINE in Delphi mode should always reindent the current
- line, insert a blank line and move to the default indent column of the
- blank line.
- `delphi-search-path' (default .)
- Directories to search when finding external units.
- `delphi-verbose' (default nil)
- If true then Delphi token processing progress is reported to the user.
-
-Coloring:
-
- `delphi-comment-face' (default font-lock-comment-face)
- Face used to color Delphi comments.
- `delphi-string-face' (default font-lock-string-face)
- Face used to color Delphi strings.
- `delphi-keyword-face' (default font-lock-keyword-face)
- Face used to color Delphi keywords.
- `delphi-other-face' (default nil)
- Face used to color everything else.
-
-Turning on Delphi mode calls the value of the variable `delphi-mode-hook'
-with no args, if that value is non-nil.
-
-\(fn)" t nil)
-
-;;;***
-\f
-;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "derived" "emacs-lisp/derived.el" (20709 26818 907104 0))
;;; Generated autoloads from emacs-lisp/derived.el
(autoload 'define-derived-mode "derived" "\
;;;***
\f
;;;### (autoloads (describe-char describe-text-properties) "descr-text"
-;;;;;; "descr-text.el" (20707 18685 911514 0))
+;;;;;; "descr-text.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "desktop.el" (20709 26818 907104 0))
;;; 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" (20707 18685 911514 0))
+;;;;;; "deuglify" "gnus/deuglify.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "calendar/diary-lib.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20721 17977 14204 0))
;;; Generated autoloads from vc/diff.el
(defvar diff-switches (purecopy "-c") "\
When called interactively with a prefix argument, prompt
interactively for diff switches. Otherwise, the switches
-specified in `diff-switches' are passed to the diff command.
+specified in the variable `diff-switches' are passed to the diff command.
\(fn OLD NEW &optional SWITCHES NO-ASYNC)" t nil)
;;;***
\f
;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "vc/diff-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from vc/diff-mode.el
(autoload 'diff-mode "diff-mode" "\
;;;***
\f
-;;;### (autoloads (dig) "dig" "net/dig.el" (20707 18685 911514 0))
+;;;### (autoloads (dig) "dig" "net/dig.el" (20709 26818 907104 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" (20730 4700
-;;;;;; 471174 0))
+;;;;;; dired dired-listing-switches) "dired" "dired.el" (20731 53823
+;;;;;; 676680 0))
;;; Generated autoloads from dired.el
(defvar dired-listing-switches (purecopy "-al") "\
;;;***
\f
;;;### (autoloads (dirtrack dirtrack-mode) "dirtrack" "dirtrack.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from dirtrack.el
(autoload 'dirtrack-mode "dirtrack" "\
;;;***
\f
-;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "disp-table" "disp-table.el" (20709 26818 907104 0))
;;; Generated autoloads from disp-table.el
(autoload 'make-display-table "disp-table" "\
;;;***
\f
;;;### (autoloads (dissociated-press) "dissociate" "play/dissociate.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from play/dissociate.el
(autoload 'dissociated-press "dissociate" "\
;;;***
\f
-;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "textmodes/dns-mode.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (20737
+;;;;;; 6202 609148 0))
;;; Generated autoloads from doc-view.el
(autoload 'doc-view-mode-p "doc-view" "\
;;;***
\f
-;;;### (autoloads (doctor) "doctor" "play/doctor.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (doctor) "doctor" "play/doctor.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from play/doctor.el
(autoload 'doctor "doctor" "\
;;;***
\f
-;;;### (autoloads (double-mode) "double" "double.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (double-mode) "double" "double.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from double.el
(autoload 'double-mode "double" "\
;;;***
\f
-;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "emacs-lisp/easy-mmode.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "progmodes/ebnf2ps.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from progmodes/ebrowse.el
(autoload 'ebrowse-tree-mode "ebrowse" "\
;;;***
\f
;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from ebuff-menu.el
(autoload 'electric-buffer-list "ebuff-menu" "\
;;;***
\f
;;;### (autoloads (Electric-command-history-redo-expression) "echistory"
-;;;;;; "echistory.el" (20707 18685 911514 0))
+;;;;;; "echistory.el" (20709 26818 907104 0))
;;; Generated autoloads from echistory.el
(autoload 'Electric-command-history-redo-expression "echistory" "\
;;;***
\f
;;;### (autoloads (ecomplete-setup) "ecomplete" "gnus/ecomplete.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from gnus/ecomplete.el
(autoload 'ecomplete-setup "ecomplete" "\
;;;***
\f
-;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (20748 34276
-;;;;;; 6200 0))
+;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "emacs-lisp/edebug.el" (20721 17977 14204 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; ediff-files3 ediff-files) "ediff" "vc/ediff.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from vc/ediff.el
(autoload 'ediff-files "ediff" "\
;;;***
\f
;;;### (autoloads (ediff-customize) "ediff-help" "vc/ediff-help.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from vc/ediff-help.el
(autoload 'ediff-customize "ediff-help" "\
;;;***
\f
;;;### (autoloads (ediff-show-registry) "ediff-mult" "vc/ediff-mult.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "ediff-util" "vc/ediff-util.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from edmacro.el
(autoload 'edit-kbd-macro "edmacro" "\
;;;***
\f
;;;### (autoloads (edt-emulation-on edt-set-scroll-margins) "edt"
-;;;;;; "emulation/edt.el" (20707 18685 911514 0))
+;;;;;; "emulation/edt.el" (20709 26818 907104 0))
;;; Generated autoloads from emulation/edt.el
(autoload 'edt-set-scroll-margins "edt" "\
;;;***
\f
;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from ehelp.el
(autoload 'with-electric-help "ehelp" "\
;;;***
\f
;;;### (autoloads (customize-object) "eieio-custom" "emacs-lisp/eieio-custom.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "eldoc" "emacs-lisp/eldoc.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "electric" "electric.el" (20709 26818 907104 0))
;;; Generated autoloads from electric.el
(defvar electric-indent-chars '(10) "\
;;;***
\f
-;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; elp-instrument-function) "elp" "emacs-lisp/elp.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from emacs-lisp/elp.el
(autoload 'elp-instrument-function "elp" "\
;;;***
\f
;;;### (autoloads (emacs-lock-mode) "emacs-lock" "emacs-lock.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emacs-lock.el
(autoload 'emacs-lock-mode "emacs-lock" "\
;;;***
\f
;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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 28531 447943 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" (20707 18685 911514 0))
+;;;;;; "enriched" "textmodes/enriched.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; epa-list-secret-keys epa-list-keys) "epa" "epa.el" (20709
+;;;;;; 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "epa-file" "epa-file.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "epa-mail" "epa-mail.el" (20709 26818 907104 0))
;;; Generated autoloads from epa-mail.el
(autoload 'epa-mail-mode "epa-mail" "\
;;;***
\f
-;;;### (autoloads (epg-make-context) "epg" "epg.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (epg-make-context) "epg" "epg.el" (20712 3008 596088
+;;;;;; 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" (20707 18685 911514 0))
+;;;;;; "epg-config" "epg-config.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "erc" "erc/erc.el" (20709 26818 907104 0))
;;; Generated autoloads from erc/erc.el
(autoload 'erc-select-read-args "erc" "\
;;;***
\f
-;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from erc/erc-autoaway.el
(autoload 'erc-autoaway-mode "erc-autoaway")
;;;***
\f
-;;;### (autoloads nil "erc-button" "erc/erc-button.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "erc-button" "erc/erc-button.el" (20709 26818
+;;;;;; 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (20709 26818
+;;;;;; 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (20709 26818
+;;;;;; 907104 0))
;;; 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" (20707 18685 911514 0))
+;;;;;; "erc-dcc" "erc/erc-dcc.el" (20719 62656 824443 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from erc/erc-ezbounce.el
(autoload 'erc-cmd-ezb "erc-ezbounce" "\
;;;***
\f
-;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (20709
+;;;;;; 26818 907104 0))
;;; 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" (20707 18685 911514 0))
+;;;;;; "erc/erc-identd.el" (20709 26818 907104 0))
;;; 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from erc/erc-imenu.el
(autoload 'erc-create-imenu-index "erc-imenu" "\
;;;***
\f
-;;;### (autoloads nil "erc-join" "erc/erc-join.el" (20707 18685 911514
+;;;### (autoloads nil "erc-join" "erc/erc-join.el" (20709 26818 907104
;;;;;; 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" (20707 18685 911514
+;;;### (autoloads nil "erc-list" "erc/erc-list.el" (20709 26818 907104
;;;;;; 0))
;;; 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" (20707 18685 911514 0))
+;;;;;; "erc/erc-log.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from erc/erc-match.el
(autoload 'erc-match-mode "erc-match")
;;;***
\f
-;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (20707 18685 911514
+;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (20709 26818 907104
;;;;;; 0))
;;; 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "erc/erc-networks.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "erc/erc-notify.el" (20709 26818 907104 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" (20707 18685 911514
+;;;### (autoloads nil "erc-page" "erc/erc-page.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from erc/erc-page.el
(autoload 'erc-page-mode "erc-page")
;;;***
\f
-;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (20709
+;;;;;; 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from erc/erc-replace.el
(autoload 'erc-replace-mode "erc-replace")
;;;***
\f
-;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (20707 18685 911514
+;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (20709 26818 907104
;;;;;; 0))
;;; 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" (20707 18685 911514
+;;;;;; "erc-services" "erc/erc-services.el" (20709 26818 907104
;;;;;; 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from erc/erc-sound.el
(autoload 'erc-sound-mode "erc-sound")
;;;***
\f
;;;### (autoloads (erc-speedbar-browser) "erc-speedbar" "erc/erc-speedbar.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from erc/erc-speedbar.el
(autoload 'erc-speedbar-browser "erc-speedbar" "\
;;;***
\f
-;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from erc/erc-spelling.el
(autoload 'erc-spelling-mode "erc-spelling" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514
+;;;;;; "erc-truncate" "erc/erc-truncate.el" (20709 26818 907104
;;;;;; 0))
;;; 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; 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" (20707 18685 911514 0))
+;;;;;; "ert" "emacs-lisp/ert.el" (20719 62656 824443 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "eshell/eshell.el" (20709 26818 907104 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"
-;;;;;; (20728 47414 952831 0))
+;;;;;; (20731 53823 676680 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "eudc-bob" "net/eudc-bob.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "eudc-export" "net/eudc-export.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from net/eudc-hotlist.el
(autoload 'eudc-edit-hotlist "eudc-hotlist" "\
;;;***
\f
-;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from expand.el
(autoload 'expand-add-abbrevs "expand" "\
;;;***
\f
-;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (20709 26818
+;;;;;; 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; face-remap-add-relative) "face-remap" "face-remap.el" (20709
+;;;;;; 26818 907104 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 28531
-;;;;;; 447943 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" (20707 18685 911514 0))
+;;;;;; "ffap.el" (20721 17977 14204 0))
;;; Generated autoloads from ffap.el
(autoload 'ffap-next "ffap" "\
Optional argument WRAP says to try wrapping around if necessary.
Interactively: use a single prefix to search backwards,
double prefix to wrap forward, triple to wrap backwards.
-Actual search is done by `ffap-next-guess'.
+Actual search is done by the function `ffap-next-guess'.
\(fn &optional BACK WRAP)" t nil)
;;;### (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" (20707 18685 911514 0))
+;;;;;; "filecache" "filecache.el" (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; add-file-local-variable) "files-x" "files-x.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from files-x.el
(autoload 'add-file-local-variable "files-x" "\
;;;***
\f
-;;;### (autoloads (filesets-init) "filesets" "filesets.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (filesets-init) "filesets" "filesets.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from filesets.el
(autoload 'filesets-init "filesets" "\
;;;***
\f
-;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "find-dired.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "find-file" "find-file.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "emacs-lisp/find-func.el" (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; find-lisp-find-dired) "find-lisp" "find-lisp.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "finder" "finder.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "flow-ctrl.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; flymake-mode) "flymake" "progmodes/flymake.el" (20717 20920
+;;;;;; 410005 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" (20707 18685 911514 0))
+;;;;;; "flyspell" "textmodes/flyspell.el" (20721 17977 14204 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from follow.el
(autoload 'turn-on-follow-mode "follow" "\
;;;***
\f
-;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "forms" "forms.el" (20709 26818 907104 0))
;;; Generated autoloads from forms.el
(autoload 'forms-mode "forms" "\
;;;***
\f
;;;### (autoloads (fortran-mode) "fortran" "progmodes/fortran.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; fortune-add-fortune) "fortune" "play/fortune.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from play/fortune.el
(autoload 'fortune-add-fortune "fortune" "\
;;;***
\f
;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20721 17977 14204 0))
;;; Generated autoloads from progmodes/gdb-mi.el
(defvar gdb-enable-debug nil "\
options should include \"-i=mi\" to use gdb's MI text interface.
Note that the old \"--annotate\" option is no longer supported.
-If `gdb-many-windows' is nil (the default value) then gdb just
+If option `gdb-many-windows' is nil (the default value) then gdb just
pops up the GUD buffer unless `gdb-show-main' is t. In this case
it starts with two windows: one displaying the GUD buffer and the
other with the source file with the main routine of the inferior.
-If `gdb-many-windows' is t, regardless of the value of
+If option `gdb-many-windows' is t, regardless of the value of
`gdb-show-main', the layout below will appear. Keybindings are
shown in some of the buffers.
;;;***
\f
;;;### (autoloads (generic-make-keywords-list generic-mode generic-mode-internal
-;;;;;; define-generic-mode) "generic" "emacs-lisp/generic.el" (20707
-;;;;;; 18685 911514 0))
+;;;;;; define-generic-mode) "generic" "emacs-lisp/generic.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from emacs-lisp/generic.el
(defvar generic-mode-list nil "\
;;;***
\f
;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus/gnus-agent.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20719 62656 824443 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" (20707 18685 911514
+;;;;;; "gnus-bookmark" "gnus/gnus-bookmark.el" (20709 26818 907104
;;;;;; 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus-delay" "gnus/gnus-delay.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus-diary" "gnus/gnus-diary.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514
+;;;;;; "gnus-gravatar" "gnus/gnus-gravatar.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from gnus/gnus-gravatar.el
;;;***
\f
;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
-;;;;;; "gnus-group" "gnus/gnus-group.el" (20707 18685 911514 0))
+;;;;;; "gnus-group" "gnus/gnus-group.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus/gnus-html.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus-msg" "gnus/gnus-msg.el" (20709 26818 907104 0))
;;; Generated autoloads from gnus/gnus-msg.el
(autoload 'gnus-msg-mail "gnus-msg" "\
;;;***
\f
;;;### (autoloads (gnus-notifications) "gnus-notifications" "gnus/gnus-notifications.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus/gnus-range.el" (20709 26818 907104 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" (20707 18685 911514
+;;;;;; "gnus-registry" "gnus/gnus-registry.el" (20709 26818 907104
;;;;;; 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20721 17977 14204 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20734 30007 218637 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" (20707 18685 911514 0))
+;;;;;; "gnus-sync" "gnus/gnus-sync.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from gnus/gnus-win.el
(autoload 'gnus-add-configuration "gnus-win" "\
;;;***
\f
;;;### (autoloads (gnutls-min-prime-bits) "gnutls" "net/gnutls.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from net/gnutls.el
(defvar gnutls-min-prime-bits 256 "\
;;;***
\f
-;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (20709 26818
+;;;;;; 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; goto-address-at-point) "goto-addr" "net/goto-addr.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gravatar" "gnus/gravatar.el" (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; grep-window-height) "grep" "progmodes/grep.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from progmodes/grep.el
(defvar grep-window-height nil "\
;;;***
\f
-;;;### (autoloads (gs-load-image) "gs" "gs.el" (20707 18685 911514
+;;;### (autoloads (gs-load-image) "gs" "gs.el" (20709 26818 907104
;;;;;; 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" (20712 38790
-;;;;;; 413794 0))
+;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (20709 26818
+;;;;;; 907104 0))
;;; 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" (20707 18685 911514 0))
+;;;;;; "gv" "emacs-lisp/gv.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from play/handwrite.el
(autoload 'handwrite "handwrite" "\
;;;***
\f
;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
-;;;;;; (20627 28531 447943 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" (20707 18685 911514 0))
+;;;;;; "hashcash" "mail/hashcash.el" (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; help-at-pt-string) "help-at-pt" "help-at-pt.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "help-fns" "help-fns.el" (20709 26818 907104 0))
;;; Generated autoloads from help-fns.el
(autoload 'describe-function "help-fns" "\
;;;***
\f
;;;### (autoloads (three-step-help) "help-macro" "help-macro.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20721 17977 14204 0))
;;; Generated autoloads from help-mode.el
(autoload 'help-mode "help-mode" "\
;;;***
\f
;;;### (autoloads (Helper-help Helper-describe-bindings) "helper"
-;;;;;; "emacs-lisp/helper.el" (20707 18685 911514 0))
+;;;;;; "emacs-lisp/helper.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "hexl.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20743 44982 104196 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/hideif.el
(autoload 'hide-ifdef-mode "hideif" "\
;;;***
\f
;;;### (autoloads (turn-off-hideshow hs-minor-mode) "hideshow" "progmodes/hideshow.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; highlight-changes-mode) "hilit-chg" "hilit-chg.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "hippie-exp" "hippie-exp.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "calendar/holidays.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from gnus/html2text.el
(autoload 'html2text "html2text" "\
;;;***
\f
;;;### (autoloads (htmlfontify-copy-and-link-dir htmlfontify-buffer)
-;;;;;; "htmlfontify" "htmlfontify.el" (20707 18685 911514 0))
+;;;;;; "htmlfontify" "htmlfontify.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "ibuffer" "ibuffer.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "calendar/icalendar.el" (20709 26818 907104 0))
;;; Generated autoloads from calendar/icalendar.el
(autoload 'icalendar-export-file "icalendar" "\
;;;***
\f
-;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (20710
+;;;;;; 47669 981323 0))
;;; Generated autoloads from icomplete.el
(defvar icomplete-mode nil "\
;;;***
\f
-;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from progmodes/icon.el
(autoload 'icon-mode "icon" "\
;;;***
\f
;;;### (autoloads (idlwave-shell) "idlw-shell" "progmodes/idlw-shell.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/idlw-shell.el
(autoload 'idlwave-shell "idlw-shell" "\
;;;***
\f
;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from ido.el
(defvar ido-mode nil "\
;;;***
\f
-;;;### (autoloads (ielm) "ielm" "ielm.el" (20707 18685 911514 0))
+;;;### (autoloads (ielm) "ielm" "ielm.el" (20709 26818 907104 0))
;;; Generated autoloads from ielm.el
(autoload 'ielm "ielm" "\
;;;***
\f
-;;;### (autoloads (iimage-mode) "iimage" "iimage.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (iimage-mode) "iimage" "iimage.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "image-dired" "image-dired.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "image-file.el" (20709 26818 907104 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" (20718 7922 212742
+;;;;;; image-mode) "image-mode" "image-mode.el" (20731 53823 676680
;;;;;; 0))
;;; Generated autoloads from image-mode.el
;;;***
\f
;;;### (autoloads (imenu imenu-add-menubar-index imenu-add-to-menubar
-;;;;;; imenu-sort-function) "imenu" "imenu.el" (20744 53127 564979
-;;;;;; 207000))
+;;;;;; imenu-sort-function) "imenu" "imenu.el" (20747 42040 139863
+;;;;;; 0))
;;; Generated autoloads from imenu.el
(defvar imenu-sort-function nil "\
\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" (20707 18685 911514 0))
+;;;;;; "ind-util" "language/ind-util.el" (20709 26818 907104 0))
;;; Generated autoloads from language/ind-util.el
(autoload 'indian-compose-region "ind-util" "\
;;;***
\f
;;;### (autoloads (inferior-lisp) "inf-lisp" "progmodes/inf-lisp.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514
+;;;;;; info info-other-window) "info" "info.el" (20721 17977 14204
;;;;;; 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514
+;;;;;; Info-tagify) "informat" "informat.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from informat.el
;;;***
\f
;;;### (autoloads (inversion-require-emacs) "inversion" "cedet/inversion.el"
-;;;;;; (20741 50977 527555 250000))
+;;;;;; (20745 310 425822 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from international/isearch-x.el
(autoload 'isearch-toggle-specified-input-method "isearch-x" "\
;;;***
\f
-;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "international/iso-cvt.el" (20709 26818 907104 0))
;;; Generated autoloads from international/iso-cvt.el
(autoload 'iso-spanish "iso-cvt" "\
;;;***
\f
;;;### (autoloads nil "iso-transl" "international/iso-transl.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 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"
+;;;;;; (20734 30007 218637 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514
+;;;;;; "japan-util" "language/japan-util.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from language/japan-util.el
;;;***
\f
;;;### (autoloads (jka-compr-uninstall jka-compr-handler) "jka-compr"
-;;;;;; "jka-compr.el" (20707 18685 911514 0))
+;;;;;; "jka-compr.el" (20709 26818 907104 0))
;;; Generated autoloads from jka-compr.el
(defvar jka-compr-inhibit nil "\
;;;***
\f
-;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20707 18685 911514
+;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20730 32949 736763
;;;;;; 0))
;;; Generated autoloads from progmodes/js.el
Major mode for editing JavaScript.
\(fn)" t nil)
-
-(defalias 'javascript-mode 'js-mode)
+ (defalias 'javascript-mode 'js-mode)
;;;***
\f
;;;### (autoloads (keypad-setup keypad-numlock-shifted-setup keypad-shifted-setup
;;;;;; keypad-numlock-setup keypad-setup) "keypad" "emulation/keypad.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emulation/keypad.el
(defvar keypad-setup nil "\
;;;***
\f
;;;### (autoloads (kinsoku) "kinsoku" "international/kinsoku.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from international/kinsoku.el
(autoload 'kinsoku "kinsoku" "\
;;;***
\f
-;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "kmacro" "kmacro.el" (20709 26818 907104 0))
;;; 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" (20707 18685 911514 0))
+;;;;;; "language/korea-util.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "lao-util" "language/lao-util.el" (20709 26818 907104 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" (20707 18685 911514
+;;;;;; "latexenc" "international/latexenc.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from international/latexenc.el
;;;***
\f
;;;### (autoloads (latin1-display-ucs-per-lynx latin1-display latin1-display)
-;;;;;; "latin1-disp" "international/latin1-disp.el" (20707 18685
-;;;;;; 911514 0))
+;;;;;; "latin1-disp" "international/latin1-disp.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from international/latin1-disp.el
(defvar latin1-display nil "\
;;;***
\f
;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/ld-script.el
(autoload 'ld-script-mode "ld-script" "\
;;;***
\f
-;;;### (autoloads (life) "life" "play/life.el" (20707 18685 911514
+;;;### (autoloads (life) "life" "play/life.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from play/life.el
;;;***
\f
;;;### (autoloads (global-linum-mode linum-mode) "linum" "linum.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from linum.el
(autoload 'linum-mode "linum" "\
;;;***
\f
-;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from loadhist.el
(autoload 'unload-feature "loadhist" "\
;;;***
\f
;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;; "locate" "locate.el" (20707 18685 911514 0))
+;;;;;; "locate" "locate.el" (20709 26818 907104 0))
;;; Generated autoloads from locate.el
(defvar locate-ls-subdir-switches (purecopy "-al") "\
;;;***
\f
-;;;### (autoloads (log-edit) "log-edit" "vc/log-edit.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (log-edit) "log-edit" "vc/log-edit.el" (20721 17977
+;;;;;; 14204 0))
;;; Generated autoloads from vc/log-edit.el
(autoload 'log-edit "log-edit" "\
;;;***
\f
-;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from vc/log-view.el
(autoload 'log-view-mode "log-view" "\
\(fn)" t nil)
-;;;***
-\f
-;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (20707
-;;;;;; 18685 911514 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; lpr-command lpr-switches printer-name) "lpr" "lpr.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from ls-lisp.el
(defvar ls-lisp-support-shell-wildcards t "\
;;;***
\f
-;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from calendar/lunar.el
(autoload 'lunar-phases "lunar" "\
;;;***
\f
-;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514
+;;;;;; name-last-kbd-macro) "macros" "macros.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from macros.el
;;;***
\f
;;;### (autoloads (what-domain mail-extract-address-components) "mail-extr"
-;;;;;; "mail/mail-extr.el" (20707 18685 911514 0))
+;;;;;; "mail/mail-extr.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "mail-utils" "mail/mail-utils.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "mailalias" "mail/mailalias.el" (20709 26818 907104 0))
;;; Generated autoloads from mail/mailalias.el
(defvar mail-complete-style 'angles "\
;;;***
\f
;;;### (autoloads (mailclient-send-it) "mailclient" "mail/mailclient.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20746 5161 430619 0))
+;;;;;; "make-mode" "progmodes/make-mode.el" (20746 21181 635406
+;;;;;; 0))
;;; Generated autoloads from progmodes/make-mode.el
(autoload 'makefile-mode "make-mode" "\
;;;***
\f
-;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from makesum.el
(autoload 'make-command-summary "makesum" "\
;;;***
\f
;;;### (autoloads (Man-bookmark-jump man-follow man) "man" "man.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20719 62656 824443 0))
;;; Generated autoloads from man.el
(defalias 'manual-entry 'man)
;;;***
\f
-;;;### (autoloads (master-mode) "master" "master.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (master-mode) "master" "master.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from master.el
(autoload 'master-mode "master" "\
;;;***
\f
;;;### (autoloads (minibuffer-depth-indicate-mode) "mb-depth" "mb-depth.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus/message.el" (20723 59703 12265 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "mh-e/mh-comp.el" (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "mh-e/mh-folder.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "midnight.el" (20709 26818 907104 0))
;;; Generated autoloads from midnight.el
(autoload 'clean-buffer-list "midnight" "\
;;;***
\f
;;;### (autoloads (minibuffer-electric-default-mode) "minibuf-eldef"
-;;;;;; "minibuf-eldef.el" (20707 18685 911514 0))
+;;;;;; "minibuf-eldef.el" (20709 26818 907104 0))
;;; Generated autoloads from minibuf-eldef.el
(defvar minibuffer-electric-default-mode nil "\
;;;***
\f
;;;### (autoloads (list-dynamic-libraries butterfly) "misc" "misc.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "misearch" "misearch.el" (20721 17977 14204 0))
;;; Generated autoloads from misearch.el
(add-hook 'isearch-mode-hook 'multi-isearch-setup)
The first argument of this function is the current buffer where the
search is currently searching. It defines the base buffer relative to
which this function should find the next buffer. When the isearch
-direction is backward (when `isearch-forward' is nil), this function
+direction is backward (when option `isearch-forward' is nil), this function
should return the previous buffer to search.
If the second argument of this function WRAP is non-nil, then it
;;;***
\f
;;;### (autoloads (mixal-mode) "mixal-mode" "progmodes/mixal-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "mm-extern" "gnus/mm-extern.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "mm-url" "gnus/mm-url.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus/mm-uu.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20745 310 425822 0))
;;; Generated autoloads from gnus/mml.el
(autoload 'mml-to-mime "mml" "\
;;;***
\f
;;;### (autoloads (mml1991-sign mml1991-encrypt) "mml1991" "gnus/mml1991.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "mml2015" "gnus/mml2015.el" (20709 26818 907104 0))
;;; Generated autoloads from gnus/mml2015.el
(autoload 'mml2015-decrypt "mml2015" "\
;;;***
\f
-;;;### (autoloads nil "mode-local" "cedet/mode-local.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "mode-local" "cedet/mode-local.el" (20709 26818
+;;;;;; 907104 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
-;;;;;; 28531 447943 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" (20707 18685 911514 0))
+;;;;;; "morse" "play/morse.el" (20709 26818 907104 0))
;;; Generated autoloads from play/morse.el
(autoload 'morse-region "morse" "\
;;;***
\f
;;;### (autoloads (mouse-drag-drag mouse-drag-throw) "mouse-drag"
-;;;;;; "mouse-drag.el" (20707 18685 911514 0))
+;;;;;; "mouse-drag.el" (20709 26818 907104 0))
;;; Generated autoloads from mouse-drag.el
(autoload 'mouse-drag-throw "mouse-drag" "\
;;;***
\f
-;;;### (autoloads (mpc) "mpc" "mpc.el" (20707 18685 911514 0))
+;;;### (autoloads (mpc) "mpc" "mpc.el" (20709 26818 907104 0))
;;; Generated autoloads from mpc.el
(autoload 'mpc "mpc" "\
;;;***
\f
-;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (20707 18685 911514
+;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from play/mpuz.el
;;;***
\f
-;;;### (autoloads (msb-mode) "msb" "msb.el" (20707 18685 911514 0))
+;;;### (autoloads (msb-mode) "msb" "msb.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20725 15032 264919 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; iwconfig ifconfig) "net-utils" "net/net-utils.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from net/net-utils.el
(autoload 'ifconfig "net-utils" "\
;;;***
\f
-;;;### (autoloads (netrc-credentials) "netrc" "net/netrc.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (netrc-credentials) "netrc" "net/netrc.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from net/netrc.el
(autoload 'netrc-credentials "netrc" "\
;;;***
\f
;;;### (autoloads (open-network-stream) "network-stream" "net/network-stream.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "net/newst-backend.el" (20709 26818 907104 0))
;;; Generated autoloads from net/newst-backend.el
(autoload 'newsticker-running-p "newst-backend" "\
;;;***
\f
;;;### (autoloads (newsticker-plainview) "newst-plainview" "net/newst-plainview.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from net/newst-plainview.el
(autoload 'newsticker-plainview "newst-plainview" "\
;;;***
\f
;;;### (autoloads (newsticker-show-news) "newst-reader" "net/newst-reader.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514
+;;;;;; "newst-ticker" "net/newst-ticker.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from net/newst-ticker.el
;;;***
\f
;;;### (autoloads (newsticker-treeview) "newst-treeview" "net/newst-treeview.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from net/newst-treeview.el
(autoload 'newsticker-treeview "newst-treeview" "\
;;;***
\f
;;;### (autoloads (nndiary-generate-nov-databases) "nndiary" "gnus/nndiary.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from gnus/nndiary.el
(autoload 'nndiary-generate-nov-databases "nndiary" "\
;;;***
\f
-;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from gnus/nndoc.el
(autoload 'nndoc-add-type "nndoc" "\
;;;***
\f
;;;### (autoloads (nnfolder-generate-active-file) "nnfolder" "gnus/nnfolder.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from gnus/nnfolder.el
(autoload 'nnfolder-generate-active-file "nnfolder" "\
;;;***
\f
;;;### (autoloads (nnml-generate-nov-databases) "nnml" "gnus/nnml.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "novice" "novice.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "nxml/nxml-uchnm.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/octave-inf.el
(autoload 'inferior-octave "octave-inf" "\
;;;***
\f
;;;### (autoloads (octave-mode) "octave-mod" "progmodes/octave-mod.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/octave-mod.el
(autoload 'octave-mode "octave-mod" "\
\(fn)" t nil)
+;;;***
+\f
+;;;### (autoloads (opascal-mode) "opascal" "progmodes/opascal.el"
+;;;;;; (20746 21181 635406 0))
+;;; Generated autoloads from progmodes/opascal.el
+
+(define-obsolete-function-alias 'delphi-mode 'opascal-mode "24.4")
+
+(autoload 'opascal-mode "opascal" "\
+Major mode for editing OPascal code. \\<opascal-mode-map>
+\\[opascal-find-unit] - Search for a OPascal source file.
+\\[opascal-fill-comment] - Fill the current comment.
+\\[opascal-new-comment-line] - If in a // comment, do a new comment line.
+
+\\[indent-region] also works for indenting a whole region.
+
+Customization:
+
+ `opascal-indent-level' (default 3)
+ Indentation of OPascal statements with respect to containing block.
+ `opascal-compound-block-indent' (default 0)
+ Extra indentation for blocks in compound statements.
+ `opascal-case-label-indent' (default 0)
+ Extra indentation for case statement labels.
+ `opascal-tab-always-indents' (default `tab-always-indents')
+ Non-nil means TAB in OPascal mode should always reindent the current line,
+ regardless of where in the line point is when the TAB command is used.
+ `opascal-search-path' (default .)
+ Directories to search when finding external units.
+ `opascal-verbose' (default nil)
+ If true then OPascal token processing progress is reported to the user.
+
+Coloring:
+
+ `opascal-comment-face' (default font-lock-comment-face)
+ Face used to color OPascal comments.
+ `opascal-string-face' (default font-lock-string-face)
+ Face used to color OPascal strings.
+ `opascal-keyword-face' (default font-lock-keyword-face)
+ Face used to color OPascal keywords.
+ `opascal-other-face' (default nil)
+ Face used to color everything else.
+
+Turning on OPascal mode calls the value of the variable `opascal-mode-hook'
+with no args, if that value is non-nil.
+
+\(fn)" t nil)
+
;;;***
\f
;;;### (autoloads (org-customize org-reload org-submit-bug-report
;;;;;; 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" (20755 21797 420152 0))
+;;;;;; "org/org.el" (20723 59703 12265 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"
-;;;;;; (20755 21797 420152 0))
+;;;;;; (20723 59703 12265 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" (20707 18685 911514 0))
+;;;;;; "org/org-beamer.el" (20709 26818 907104 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" (20723
-;;;;;; 1786 641767 0))
+;;;;;; 59703 12265 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" (20716 21904
-;;;;;; 19206 0))
+;;;;;; org-columns) "org-colview" "org/org-colview.el" (20717 20920
+;;;;;; 410005 0))
;;; Generated autoloads from org/org-colview.el
(autoload 'org-columns "org-colview" "\
;;;***
\f
;;;### (autoloads (org-check-version) "org-compat" "org/org-compat.el"
-;;;;;; (20723 1786 641767 0))
+;;;;;; (20723 59703 12265 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"
-;;;;;; (20755 21797 420152 0))
+;;;;;; (20723 59703 12265 0))
;;; Generated autoloads from org/org-version.el
(autoload 'org-release "org-version" "\
;;;***
\f
;;;### (autoloads (outline-minor-mode outline-mode) "outline" "outline.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emacs-lisp/package.el
(defvar package-enable-at-startup t "\
;;;***
\f
-;;;### (autoloads (show-paren-mode) "paren" "paren.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (show-paren-mode) "paren" "paren.el" (20738 27061
+;;;;;; 124069 0))
;;; Generated autoloads from paren.el
(defvar show-paren-mode nil "\
;;;***
\f
;;;### (autoloads (parse-time-string) "parse-time" "calendar/parse-time.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from calendar/parse-time.el
(put 'parse-time-rules 'risky-local-variable t)
;;;***
\f
-;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (20746
+;;;;;; 21181 635406 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" (20707 18685 911514
+;;;;;; "password-cache" "password-cache.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from password-cache.el
;;;***
\f
;;;### (autoloads (pcase-let pcase-let* pcase) "pcase" "emacs-lisp/pcase.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20717 20920 410005 0))
;;; Generated autoloads from emacs-lisp/pcase.el
(autoload 'pcase "pcase" "\
;;;***
\f
-;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "pcmpl-gnu" "pcmpl-gnu.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "pcmpl-linux" "pcmpl-linux.el" (20709 26818 907104 0))
;;; Generated autoloads from pcmpl-linux.el
(autoload 'pcomplete/kill "pcmpl-linux" "\
;;;***
\f
-;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514
+;;;;;; pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (20709 26818 907104
;;;;;; 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "vc/pcvs.el" (20717 20920 410005 0))
;;; Generated autoloads from vc/pcvs.el
(autoload 'cvs-checkout "pcvs" "\
;;;***
\f
-;;;### (autoloads nil "pcvs-defs" "vc/pcvs-defs.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads nil "pcvs-defs" "vc/pcvs-defs.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from textmodes/picture.el
(autoload 'picture-mode "picture" "\
;;;***
\f
;;;### (autoloads (plstore-mode plstore-open) "plstore" "gnus/plstore.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from gnus/plstore.el
(autoload 'plstore-open "plstore" "\
;;;***
\f
;;;### (autoloads (po-find-file-coding-system) "po" "textmodes/po.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from textmodes/po.el
(autoload 'po-find-file-coding-system "po" "\
;;;***
\f
-;;;### (autoloads (pong) "pong" "play/pong.el" (20707 18685 911514
+;;;### (autoloads (pong) "pong" "play/pong.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from play/pong.el
;;;***
\f
-;;;### (autoloads (pop3-movemail) "pop3" "gnus/pop3.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (pop3-movemail) "pop3" "gnus/pop3.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20721 17977 14204 0))
;;; Generated autoloads from printing.el
(autoload 'pr-interface "printing" "\
;;;***
\f
-;;;### (autoloads (proced) "proced" "proced.el" (20707 18685 911514
+;;;### (autoloads (proced) "proced" "proced.el" (20709 26818 907104
;;;;;; 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"
-;;;;;; (20731 13121 306545 521000))
+;;;;;; (20738 27061 124069 0))
;;; Generated autoloads from profiler.el
(autoload 'profiler-start "profiler" "\
;;;***
\f
;;;### (autoloads (run-prolog mercury-mode prolog-mode) "prolog"
-;;;;;; "progmodes/prolog.el" (20707 18685 911514 0))
+;;;;;; "progmodes/prolog.el" (20709 26818 907104 0))
;;; Generated autoloads from progmodes/prolog.el
(autoload 'prolog-mode "prolog" "\
;;;***
\f
-;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (20709
+;;;;;; 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (20709
+;;;;;; 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; ps-page-dimensions-database) "ps-print" "ps-print.el" (20721
+;;;;;; 17977 14204 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"))) "\
(autoload 'ps-spool-buffer-with-faces "ps-print" "\
Generate and spool a PostScript image of the buffer.
-Like `ps-spool-buffer', but includes font, color, and underline information in
-the generated image. This command works only if you are using a window system,
-so it has a way to determine color values.
+Like the command `ps-spool-buffer', but includes font, color, and underline
+information in the generated image. This command works only if you are using
+a window system, so it has a way to determine color values.
Use the command `ps-despool' to send the spooled images to the printer.
;;;***
\f
;;;### (autoloads (python-mode run-python) "python" "progmodes/python.el"
-;;;;;; (20745 21595 25221 0))
+;;;;;; (20746 21181 635406 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "international/quail.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; quickurl-ask quickurl) "quickurl" "net/quickurl.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "net/rcirc.el" (20709 26818 907104 0))
;;; Generated autoloads from net/rcirc.el
(autoload 'rcirc "rcirc" "\
;;;***
\f
-;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from net/rcompile.el
(autoload 'remote-compile "rcompile" "\
;;;***
\f
;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emacs-lisp/re-builder.el
(defalias 'regexp-builder 're-builder)
;;;***
\f
-;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "rect" "rect.el" (20709 26818 907104 0))
;;; Generated autoloads from rect.el
(autoload 'delete-rectangle "rect" "\
;;;***
\f
-;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (20709
+;;;;;; 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from textmodes/reftex.el
(autoload 'turn-on-reftex "reftex" "\
;;;***
\f
;;;### (autoloads (reftex-citation) "reftex-cite" "textmodes/reftex-cite.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20734 30007 218637 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from textmodes/reftex-parse.el
(autoload 'reftex-all-document-files "reftex-parse" "\
;;;***
\f
-;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (20734
+;;;;;; 30007 218637 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20746 41950 779927 439000))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from textmodes/remember.el
(autoload 'remember "remember" "\
(autoload 'remember-clipboard "remember" "\
Remember the contents of the current clipboard.
-Most useful for remembering things from other applications.
+Most useful for remembering things from Netscape or other X Windows
+application.
\(fn)" t nil)
;;;***
\f
-;;;### (autoloads (repeat) "repeat" "repeat.el" (20707 18685 911514
+;;;### (autoloads (repeat) "repeat" "repeat.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from repeat.el
;;;***
\f
;;;### (autoloads (reporter-submit-bug-report) "reporter" "mail/reporter.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from mail/reporter.el
(autoload 'reporter-submit-bug-report "reporter" "\
;;;***
\f
;;;### (autoloads (reposition-window) "reposition" "reposition.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from reposition.el
(autoload 'reposition-window "reposition" "\
;;;***
\f
;;;### (autoloads (global-reveal-mode reveal-mode) "reveal" "reveal.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from reveal.el
(autoload 'reveal-mode "reveal" "\
;;;***
\f
;;;### (autoloads (make-ring ring-p) "ring" "emacs-lisp/ring.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emacs-lisp/ring.el
(autoload 'ring-p "ring" "\
;;;***
\f
-;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (20709 26818
+;;;;;; 907104 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" (20728 47414 952831
-;;;;;; 0))
+;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20723 59924 854722
+;;;;;; 212000))
;;; Generated autoloads from mail/rmail.el
(defvar rmail-file-name (purecopy "~/RMAIL") "\
;;;***
\f
;;;### (autoloads (rmail-output-body-to-file rmail-output-as-seen
-;;;;;; rmail-output) "rmailout" "mail/rmailout.el" (20707 18685
-;;;;;; 911514 0))
+;;;;;; rmail-output) "rmailout" "mail/rmailout.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (20709
+;;;;;; 26818 907104 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 28531 447943 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" (20707 18685 911514
+;;;;;; rot13-string rot13) "rot13" "rot13.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from rot13.el
;;;***
\f
;;;### (autoloads (rst-minor-mode rst-mode) "rst" "textmodes/rst.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20742 24117 440849 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from ruler-mode.el
(defvar ruler-mode nil "\
;;;***
\f
-;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from emacs-lisp/rx.el
(autoload 'rx-to-string "rx" "\
;;;***
\f
-;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from savehist.el
(defvar savehist-mode nil "\
;;;***
\f
;;;### (autoloads (dsssl-mode scheme-mode) "scheme" "progmodes/scheme.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/scheme.el
(autoload 'scheme-mode "scheme" "\
;;;***
\f
;;;### (autoloads (gnus-score-mode) "score-mode" "gnus/score-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from gnus/score-mode.el
(autoload 'gnus-score-mode "score-mode" "\
;;;***
\f
;;;### (autoloads (scroll-all-mode) "scroll-all" "scroll-all.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from scroll-all.el
(defvar scroll-all-mode nil "\
;;;***
\f
;;;### (autoloads (scroll-lock-mode) "scroll-lock" "scroll-lock.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from scroll-lock.el
(autoload 'scroll-lock-mode "scroll-lock" "\
;;;***
\f
-;;;### (autoloads nil "secrets" "net/secrets.el" (20707 18685 911514
+;;;### (autoloads nil "secrets" "net/secrets.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from net/secrets.el
(when (featurep 'dbusbind)
;;;***
\f
;;;### (autoloads (semantic-mode semantic-default-submodes) "semantic"
-;;;;;; "cedet/semantic.el" (20748 34276 6200 0))
+;;;;;; "cedet/semantic.el" (20745 310 425822 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" (20707 18685 911514 0))
+;;;;;; "cedet/semantic/bovine/grammar.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "cedet/semantic/wisent/grammar.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "sendmail" "mail/sendmail.el" (20723 59703 12265 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; server-force-delete server-start) "server" "server.el" (20721
+;;;;;; 17977 14204 0))
;;; Generated autoloads from server.el
(put 'server-host 'risky-local-variable t)
;;;***
\f
-;;;### (autoloads (ses-mode) "ses" "ses.el" (20707 18685 911514 0))
+;;;### (autoloads (ses-mode) "ses" "ses.el" (20709 26818 907104 0))
;;; Generated autoloads from ses.el
(autoload 'ses-mode "ses" "\
;;;***
\f
;;;### (autoloads (html-mode sgml-mode) "sgml-mode" "textmodes/sgml-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20721 17977 14204 0))
;;; Generated autoloads from textmodes/sgml-mode.el
(autoload 'sgml-mode "sgml-mode" "\
;;;***
\f
;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; shadow-define-cluster) "shadowfile" "shadowfile.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from shadowfile.el
(autoload 'shadow-define-cluster "shadowfile" "\
;;;***
\f
;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from shell.el
(defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\
;;;***
\f
-;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514
+;;;;;; sieve-manage) "sieve" "gnus/sieve.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from gnus/sieve.el
;;;***
\f
;;;### (autoloads (sieve-mode) "sieve-mode" "gnus/sieve-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from gnus/sieve-mode.el
(autoload 'sieve-mode "sieve-mode" "\
;;;***
\f
-;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514
+;;;;;; define-skeleton) "skeleton" "skeleton.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from skeleton.el
;;;***
\f
;;;### (autoloads (smerge-start-session smerge-mode smerge-ediff)
-;;;;;; "smerge-mode" "vc/smerge-mode.el" (20707 18685 911514 0))
+;;;;;; "smerge-mode" "vc/smerge-mode.el" (20709 26818 907104 0))
;;; Generated autoloads from vc/smerge-mode.el
(autoload 'smerge-ediff "smerge-mode" "\
;;;***
\f
;;;### (autoloads (smiley-buffer smiley-region) "smiley" "gnus/smiley.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20726 5184 974741 509000))
;;; Generated autoloads from gnus/smiley.el
(autoload 'smiley-region "smiley" "\
;;;***
\f
;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
-;;;;;; "mail/smtpmail.el" (20707 18685 911514 0))
+;;;;;; "mail/smtpmail.el" (20709 26818 907104 0))
;;; Generated autoloads from mail/smtpmail.el
(autoload 'smtpmail-send-it "smtpmail" "\
;;;***
\f
-;;;### (autoloads (snake) "snake" "play/snake.el" (20707 18685 911514
+;;;### (autoloads (snake) "snake" "play/snake.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from play/snake.el
;;;***
\f
;;;### (autoloads (snmpv2-mode snmp-mode) "snmp-mode" "net/snmp-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from net/snmp-mode.el
(autoload 'snmp-mode "snmp-mode" "\
;;;***
\f
-;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from calendar/solar.el
(autoload 'sunrise-sunset "solar" "\
;;;***
\f
-;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514
-;;;;;; 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" (20709
+;;;;;; 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "gnus/spam-report.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "speedbar.el" (20709 26818 907104 0))
;;; Generated autoloads from speedbar.el
(defalias 'speedbar 'speedbar-frame-mode)
;;;***
\f
-;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; sql-mode sql-add-product-keywords) "sql" "progmodes/sql.el"
+;;;;;; (20725 15032 264919 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; strokes-global-set-stroke) "strokes" "strokes.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from strokes.el
(autoload 'strokes-global-set-stroke "strokes" "\
;;;***
\f
;;;### (autoloads (studlify-buffer studlify-word studlify-region)
-;;;;;; "studly" "play/studly.el" (20360 54279 565993 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/subword.el
(autoload 'subword-mode "subword" "\
;;;***
\f
;;;### (autoloads (sc-cite-original) "supercite" "mail/supercite.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from mail/supercite.el
(autoload 'sc-cite-original "supercite" "\
;;;***
\f
-;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (20709
+;;;;;; 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "table" "textmodes/table.el" (20709 26818 907104 0))
;;; Generated autoloads from textmodes/table.el
(defvar table-cell-map-hook nil "\
;;;***
\f
-;;;### (autoloads (talk talk-connect) "talk" "talk.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (talk talk-connect) "talk" "talk.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from talk.el
(autoload 'talk-connect "talk" "\
;;;***
\f
-;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "progmodes/tcl.el" (20709 26818 907104 0))
;;; Generated autoloads from progmodes/tcl.el
(autoload 'tcl-mode "tcl" "\
;;;***
\f
-;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from net/telnet.el
(autoload 'telnet "telnet" "\
;;;***
\f
;;;### (autoloads (serial-term ansi-term term make-term) "term" "term.el"
-;;;;;; (20709 10021 126382 806000))
+;;;;;; (20712 3008 596088 0))
;;; Generated autoloads from term.el
(autoload 'make-term "term" "\
\(fn PORT SPEED)" t nil)
-;;;***
-\f
-;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (20707
-;;;;;; 18685 911514 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emacs-lisp/testcover.el
(autoload 'testcover-this-defun "testcover" "\
;;;***
\f
-;;;### (autoloads (tetris) "tetris" "play/tetris.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (tetris) "tetris" "play/tetris.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "texinfmt" "textmodes/texinfmt.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "texinfo" "textmodes/texinfo.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "thingatpt" "thingatpt.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; tibetan-char-p) "tibet-util" "language/tibet-util.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from language/tibet-util.el
(autoload 'tibetan-char-p "tibet-util" "\
;;;***
\f
;;;### (autoloads (tildify-buffer tildify-region) "tildify" "textmodes/tildify.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "time" "time.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "time-stamp.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "international/titdic-cnv.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "tmm.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "todo-mode" "calendar/todo-mode.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "tool-bar" "tool-bar.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emulation/tpu-edt.el
(defvar tpu-edt-mode nil "\
;;;***
\f
;;;### (autoloads (tpu-mapper) "tpu-mapper" "emulation/tpu-mapper.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emulation/tpu-mapper.el
(autoload 'tpu-mapper "tpu-mapper" "\
;;;***
\f
-;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (20709 26818
+;;;;;; 907104 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" (20716 60089 50197 777000))
+;;;### (autoloads (trace-function-background trace-function-foreground
+;;;;;; trace-buffer) "trace" "emacs-lisp/trace.el" (20727 56759
+;;;;;; 628211 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
To untrace a function, use `untrace-function' or `untrace-all'.
-\(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.
-When this tracing is enabled, every call to FUNCTION writes
-a Lisp-style trace message (showing the arguments and return value)
-into BUFFER. This function generates advice to trace FUNCTION
-and activates it together with any other advice there might be.
-The trace output goes to BUFFER quietly, without changing
-the window or buffer configuration.
+Like `trace-function-foreground' but without popping up the trace BUFFER or
+changing the window configuration.
-BUFFER defaults to `trace-buffer'.
+\(fn FUNCTION &optional BUFFER CONTEXT)" t nil)
-To untrace a function, use `untrace-function' or `untrace-all'.
-
-\(fn FUNCTION &optional BUFFER)" 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" (20748 34276 6200 0))
+;;;;;; "net/tramp.el" (20746 21181 635406 0))
;;; Generated autoloads from net/tramp.el
(defvar tramp-mode t "\
;;;***
\f
;;;### (autoloads (tramp-ftp-enable-ange-ftp) "tramp-ftp" "net/tramp-ftp.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from net/tramp-ftp.el
(autoload 'tramp-ftp-enable-ange-ftp "tramp-ftp" "\
;;;***
\f
-;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from tutorial.el
(autoload 'help-with-tutorial "tutorial" "\
;;;***
\f
;;;### (autoloads (tai-viet-composition-function) "tv-util" "language/tv-util.el"
-;;;;;; (20360 54279 565993 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" (20707 18685 911514 0))
+;;;;;; "textmodes/two-column.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from type-break.el
(defvar type-break-mode nil "\
;;;***
\f
-;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "international/ucs-normalize.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "textmodes/underline.el" (20709 26818 907104 0))
;;; Generated autoloads from textmodes/underline.el
(autoload 'underline-region "underline" "\
;;;***
\f
;;;### (autoloads (unrmail batch-unrmail) "unrmail" "mail/unrmail.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20731 53823 676680 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from emacs-lisp/unsafep.el
(autoload 'unsafep "unsafep" "\
;;;***
\f
;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
-;;;;;; "url/url.el" (20707 18685 911514 0))
+;;;;;; "url/url.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "url-auth" "url/url-auth.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "url-cache" "url/url-cache.el" (20709 26818 907104 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" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514 0))
+;;;;;; "url-dav" "url/url-dav.el" (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (url-file) "url-file" "url/url-file.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "url/url-gw.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from url/url-handlers.el
(defvar url-handler-mode nil "\
;;;***
\f
-;;;### (autoloads nil "url-http" "url/url-http.el" (20707 18685 911514
+;;;### (autoloads nil "url-http" "url/url-http.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from url/url-http.el
(autoload 'url-default-expander "url-expand")
;;;***
\f
-;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from url/url-irc.el
(autoload 'url-irc "url-irc" "\
;;;***
\f
-;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (20709
+;;;;;; 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514
+;;;;;; url-man) "url-misc" "url/url-misc.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from url/url-misc.el
;;;***
\f
;;;### (autoloads (url-snews url-news) "url-news" "url/url-news.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "url/url-parse.el" (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; url-debug url-debug) "url-util" "url/url-util.el" (20709
+;;;;;; 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "userlock" "userlock.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "utf-7" "international/utf-7.el" (20709 26818 907104 0))
;;; Generated autoloads from international/utf-7.el
(autoload 'utf-7-post-read-conversion "utf-7" "\
;;;***
\f
-;;;### (autoloads (utf7-encode) "utf7" "gnus/utf7.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (utf7-encode) "utf7" "gnus/utf7.el" (20709 26818
+;;;;;; 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (20713
+;;;;;; 23861 754849 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from vc/vc-annotate.el
(autoload 'vc-annotate "vc-annotate" "\
;;;***
\f
-;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (20707 18685 911514
+;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from vc/vc-arch.el
(defun vc-arch-registered (file)
;;;***
\f
-;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (20707 18685 911514
+;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (20721 17977 14204
;;;;;; 0))
;;; Generated autoloads from vc/vc-bzr.el
;;;***
\f
-;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20707 18685 911514
+;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from vc/vc-cvs.el
(defun vc-cvs-registered (f)
;;;***
\f
-;;;### (autoloads (vc-dir) "vc-dir" "vc/vc-dir.el" (20707 18685 911514
-;;;;;; 0))
+;;;### (autoloads (vc-dir vc-dir-mode) "vc-dir" "vc/vc-dir.el" (20709
+;;;;;; 26818 907104 0))
;;; 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from vc/vc-dispatcher.el
(autoload 'vc-do-command "vc-dispatcher" "\
;;;***
\f
-;;;### (autoloads nil "vc-git" "vc/vc-git.el" (20707 18685 911514
+;;;### (autoloads nil "vc-git" "vc/vc-git.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from vc/vc-git.el
(defun vc-git-registered (file)
;;;***
\f
-;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (20707 18685 911514 0))
+;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (20709 26818 907104 0))
;;; 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" (20707 18685 911514
+;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from vc/vc-mtn.el
;;;***
\f
;;;### (autoloads (vc-rcs-master-templates) "vc-rcs" "vc/vc-rcs.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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" (20707 18685 911514
+;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from vc/vc-svn.el
(defun vc-svn-registered (f)
;;;***
\f
;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 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"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/verilog-mode.el
(autoload 'verilog-mode "verilog-mode" "\
;;;***
\f
;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from progmodes/vhdl-mode.el
(autoload 'vhdl-mode "vhdl-mode" "\
;;;***
\f
-;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (20627 28531 447943
+;;;### (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" (20707 18685 911514 0))
+;;;;;; "language/viet-util.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; "view" "view.el" (20710 47669 981323 0))
;;; Generated autoloads from view.el
(defvar view-remove-frame-by-deleting t "\
;;;***
\f
-;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from emulation/vip.el
(autoload 'vip-setup "vip" "\
;;;***
\f
;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "emulation/viper.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emulation/viper.el
(autoload 'toggle-viper-mode "viper" "\
;;;***
\f
;;;### (autoloads (warn lwarn display-warning) "warnings" "emacs-lisp/warnings.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emacs-lisp/warnings.el
(defvar warning-prefix-function nil "\
;;;***
\f
;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from wdired.el
(autoload 'wdired-change-to-wdired-mode "wdired" "\
;;;***
\f
-;;;### (autoloads (webjump) "webjump" "net/webjump.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (webjump) "webjump" "net/webjump.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from net/webjump.el
(autoload 'webjump "webjump" "\
;;;***
\f
;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20725 15032 264919 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; whitespace-mode) "whitespace" "whitespace.el" (20721 17977
+;;;;;; 14204 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" (20707 18685
-;;;;;; 911514 0))
+;;;;;; widget-browse-at) "wid-browse" "wid-browse.el" (20709 26818
+;;;;;; 907104 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (20716
+;;;;;; 56 356960 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" (20707
-;;;;;; 18685 911514 0))
+;;;;;; windmove-up windmove-left) "windmove" "windmove.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from windmove.el
(autoload 'windmove-left "windmove" "\
;;;***
\f
-;;;### (autoloads (winner-mode) "winner" "winner.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (winner-mode) "winner" "winner.el" (20709 26818
+;;;;;; 907104 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" (20707 18685 911514
+;;;;;; woman woman-locale) "woman" "woman.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from woman.el
;;;***
\f
;;;### (autoloads (wordstar-mode) "ws-mode" "emulation/ws-mode.el"
-;;;;;; (20707 18685 911514 0))
+;;;;;; (20709 26818 907104 0))
;;; Generated autoloads from emulation/ws-mode.el
(autoload 'wordstar-mode "ws-mode" "\
;;;***
\f
-;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (20707 18685
-;;;;;; 911514 0))
+;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (20709 26818
+;;;;;; 907104 0))
;;; Generated autoloads from net/xesam.el
(autoload 'xesam-search "xesam" "\
;;;***
\f
;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el"
-;;;;;; (20738 3139 627868 0))
+;;;;;; (20738 27061 124069 0))
;;; Generated autoloads from xml.el
(autoload 'xml-parse-file "xml" "\
;;;***
\f
;;;### (autoloads (xmltok-get-declared-encoding-position) "xmltok"
-;;;;;; "nxml/xmltok.el" (20707 18685 911514 0))
+;;;;;; "nxml/xmltok.el" (20709 26818 907104 0))
;;; Generated autoloads from nxml/xmltok.el
(autoload 'xmltok-get-declared-encoding-position "xmltok" "\
;;;***
\f
-;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (20707
-;;;;;; 18685 911514 0))
+;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (20709
+;;;;;; 26818 907104 0))
;;; Generated autoloads from xt-mouse.el
(defvar xterm-mouse-mode nil "\
;;;***
\f
;;;### (autoloads (yenc-extract-filename yenc-decode-region) "yenc"
-;;;;;; "gnus/yenc.el" (20707 18685 911514 0))
+;;;;;; "gnus/yenc.el" (20709 26818 907104 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" (20707 18685 911514 0))
+;;;;;; yow) "yow" "play/yow.el" (20709 26818 907104 0))
;;; Generated autoloads from play/yow.el
(autoload 'yow "yow" "\
;;;***
\f
-;;;### (autoloads (zone) "zone" "play/zone.el" (20707 18685 911514
+;;;### (autoloads (zone) "zone" "play/zone.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from play/zone.el
;;;;;; "calc/calc-fin.el" "calc/calc-forms.el" "calc/calc-frac.el"
;;;;;; "calc/calc-funcs.el" "calc/calc-graph.el" "calc/calc-help.el"
;;;;;; "calc/calc-incom.el" "calc/calc-keypd.el" "calc/calc-lang.el"
-;;;;;; "calc/calc-macs.el" "calc/calc-map.el" "calc/calc-math.el"
-;;;;;; "calc/calc-menu.el" "calc/calc-misc.el" "calc/calc-mode.el"
-;;;;;; "calc/calc-mtx.el" "calc/calc-nlfit.el" "calc/calc-poly.el"
-;;;;;; "calc/calc-prog.el" "calc/calc-rewr.el" "calc/calc-rules.el"
-;;;;;; "calc/calc-sel.el" "calc/calc-stat.el" "calc/calc-store.el"
-;;;;;; "calc/calc-stuff.el" "calc/calc-trail.el" "calc/calc-units.el"
-;;;;;; "calc/calc-vec.el" "calc/calc-yank.el" "calc/calcalg2.el"
-;;;;;; "calc/calcalg3.el" "calc/calccomp.el" "calc/calcsel2.el"
-;;;;;; "calendar/cal-bahai.el" "calendar/cal-coptic.el" "calendar/cal-french.el"
-;;;;;; "calendar/cal-html.el" "calendar/cal-islam.el" "calendar/cal-iso.el"
-;;;;;; "calendar/cal-julian.el" "calendar/cal-loaddefs.el" "calendar/cal-mayan.el"
-;;;;;; "calendar/cal-menu.el" "calendar/cal-move.el" "calendar/cal-persia.el"
-;;;;;; "calendar/cal-tex.el" "calendar/cal-x.el" "calendar/diary-loaddefs.el"
-;;;;;; "calendar/hol-loaddefs.el" "cdl.el" "cedet/cedet-cscope.el"
-;;;;;; "cedet/cedet-files.el" "cedet/cedet-global.el" "cedet/cedet-idutils.el"
-;;;;;; "cedet/cedet.el" "cedet/ede/auto.el" "cedet/ede/autoconf-edit.el"
-;;;;;; "cedet/ede/base.el" "cedet/ede/cpp-root.el" "cedet/ede/custom.el"
-;;;;;; "cedet/ede/dired.el" "cedet/ede/emacs.el" "cedet/ede/files.el"
-;;;;;; "cedet/ede/generic.el" "cedet/ede/linux.el" "cedet/ede/locate.el"
-;;;;;; "cedet/ede/make.el" "cedet/ede/makefile-edit.el" "cedet/ede/pconf.el"
-;;;;;; "cedet/ede/pmake.el" "cedet/ede/proj-archive.el" "cedet/ede/proj-aux.el"
-;;;;;; "cedet/ede/proj-comp.el" "cedet/ede/proj-elisp.el" "cedet/ede/proj-info.el"
-;;;;;; "cedet/ede/proj-misc.el" "cedet/ede/proj-obj.el" "cedet/ede/proj-prog.el"
-;;;;;; "cedet/ede/proj-scheme.el" "cedet/ede/proj-shared.el" "cedet/ede/proj.el"
-;;;;;; "cedet/ede/project-am.el" "cedet/ede/shell.el" "cedet/ede/simple.el"
-;;;;;; "cedet/ede/source.el" "cedet/ede/speedbar.el" "cedet/ede/srecode.el"
-;;;;;; "cedet/ede/system.el" "cedet/ede/util.el" "cedet/pulse.el"
-;;;;;; "cedet/semantic/analyze.el" "cedet/semantic/analyze/complete.el"
-;;;;;; "cedet/semantic/analyze/debug.el" "cedet/semantic/analyze/fcn.el"
-;;;;;; "cedet/semantic/analyze/refs.el" "cedet/semantic/bovine.el"
-;;;;;; "cedet/semantic/bovine/c-by.el" "cedet/semantic/bovine/c.el"
-;;;;;; "cedet/semantic/bovine/debug.el" "cedet/semantic/bovine/el.el"
-;;;;;; "cedet/semantic/bovine/gcc.el" "cedet/semantic/bovine/make-by.el"
-;;;;;; "cedet/semantic/bovine/make.el" "cedet/semantic/bovine/scm-by.el"
-;;;;;; "cedet/semantic/bovine/scm.el" "cedet/semantic/chart.el"
-;;;;;; "cedet/semantic/complete.el" "cedet/semantic/ctxt.el" "cedet/semantic/db-debug.el"
-;;;;;; "cedet/semantic/db-ebrowse.el" "cedet/semantic/db-el.el"
-;;;;;; "cedet/semantic/db-file.el" "cedet/semantic/db-find.el" "cedet/semantic/db-global.el"
-;;;;;; "cedet/semantic/db-javascript.el" "cedet/semantic/db-mode.el"
-;;;;;; "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
+;;;;;; "calc/calc-loaddefs.el" "calc/calc-macs.el" "calc/calc-map.el"
+;;;;;; "calc/calc-math.el" "calc/calc-menu.el" "calc/calc-misc.el"
+;;;;;; "calc/calc-mode.el" "calc/calc-mtx.el" "calc/calc-nlfit.el"
+;;;;;; "calc/calc-poly.el" "calc/calc-prog.el" "calc/calc-rewr.el"
+;;;;;; "calc/calc-rules.el" "calc/calc-sel.el" "calc/calc-stat.el"
+;;;;;; "calc/calc-store.el" "calc/calc-stuff.el" "calc/calc-trail.el"
+;;;;;; "calc/calc-units.el" "calc/calc-vec.el" "calc/calc-yank.el"
+;;;;;; "calc/calcalg2.el" "calc/calcalg3.el" "calc/calccomp.el"
+;;;;;; "calc/calcsel2.el" "calendar/cal-bahai.el" "calendar/cal-coptic.el"
+;;;;;; "calendar/cal-french.el" "calendar/cal-html.el" "calendar/cal-islam.el"
+;;;;;; "calendar/cal-iso.el" "calendar/cal-julian.el" "calendar/cal-loaddefs.el"
+;;;;;; "calendar/cal-mayan.el" "calendar/cal-menu.el" "calendar/cal-move.el"
+;;;;;; "calendar/cal-persia.el" "calendar/cal-tex.el" "calendar/cal-x.el"
+;;;;;; "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el" "cdl.el"
+;;;;;; "cedet/cedet-cscope.el" "cedet/cedet-files.el" "cedet/cedet-global.el"
+;;;;;; "cedet/cedet-idutils.el" "cedet/cedet.el" "cedet/ede/auto.el"
+;;;;;; "cedet/ede/autoconf-edit.el" "cedet/ede/base.el" "cedet/ede/cpp-root.el"
+;;;;;; "cedet/ede/custom.el" "cedet/ede/dired.el" "cedet/ede/emacs.el"
+;;;;;; "cedet/ede/files.el" "cedet/ede/generic.el" "cedet/ede/linux.el"
+;;;;;; "cedet/ede/loaddefs.el" "cedet/ede/locate.el" "cedet/ede/make.el"
+;;;;;; "cedet/ede/makefile-edit.el" "cedet/ede/pconf.el" "cedet/ede/pmake.el"
+;;;;;; "cedet/ede/proj-archive.el" "cedet/ede/proj-aux.el" "cedet/ede/proj-comp.el"
+;;;;;; "cedet/ede/proj-elisp.el" "cedet/ede/proj-info.el" "cedet/ede/proj-misc.el"
+;;;;;; "cedet/ede/proj-obj.el" "cedet/ede/proj-prog.el" "cedet/ede/proj-scheme.el"
+;;;;;; "cedet/ede/proj-shared.el" "cedet/ede/proj.el" "cedet/ede/project-am.el"
+;;;;;; "cedet/ede/shell.el" "cedet/ede/simple.el" "cedet/ede/source.el"
+;;;;;; "cedet/ede/speedbar.el" "cedet/ede/srecode.el" "cedet/ede/system.el"
+;;;;;; "cedet/ede/util.el" "cedet/pulse.el" "cedet/semantic/analyze.el"
+;;;;;; "cedet/semantic/analyze/complete.el" "cedet/semantic/analyze/debug.el"
+;;;;;; "cedet/semantic/analyze/fcn.el" "cedet/semantic/analyze/refs.el"
+;;;;;; "cedet/semantic/bovine.el" "cedet/semantic/bovine/c-by.el"
+;;;;;; "cedet/semantic/bovine/c.el" "cedet/semantic/bovine/debug.el"
+;;;;;; "cedet/semantic/bovine/el.el" "cedet/semantic/bovine/gcc.el"
+;;;;;; "cedet/semantic/bovine/make-by.el" "cedet/semantic/bovine/make.el"
+;;;;;; "cedet/semantic/bovine/scm-by.el" "cedet/semantic/bovine/scm.el"
+;;;;;; "cedet/semantic/chart.el" "cedet/semantic/complete.el" "cedet/semantic/ctxt.el"
+;;;;;; "cedet/semantic/db-debug.el" "cedet/semantic/db-ebrowse.el"
+;;;;;; "cedet/semantic/db-el.el" "cedet/semantic/db-file.el" "cedet/semantic/db-find.el"
+;;;;;; "cedet/semantic/db-global.el" "cedet/semantic/db-javascript.el"
+;;;;;; "cedet/semantic/db-mode.el" "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
;;;;;; "cedet/semantic/db.el" "cedet/semantic/debug.el" "cedet/semantic/decorate.el"
;;;;;; "cedet/semantic/decorate/include.el" "cedet/semantic/decorate/mode.el"
;;;;;; "cedet/semantic/dep.el" "cedet/semantic/doc.el" "cedet/semantic/ede-grammar.el"
;;;;;; "cedet/semantic/fw.el" "cedet/semantic/grammar-wy.el" "cedet/semantic/grammar.el"
;;;;;; "cedet/semantic/html.el" "cedet/semantic/ia-sb.el" "cedet/semantic/ia.el"
;;;;;; "cedet/semantic/idle.el" "cedet/semantic/imenu.el" "cedet/semantic/java.el"
-;;;;;; "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" "cedet/semantic/mru-bookmark.el"
-;;;;;; "cedet/semantic/sb.el" "cedet/semantic/scope.el" "cedet/semantic/senator.el"
-;;;;;; "cedet/semantic/sort.el" "cedet/semantic/symref.el" "cedet/semantic/symref/cscope.el"
-;;;;;; "cedet/semantic/symref/filter.el" "cedet/semantic/symref/global.el"
-;;;;;; "cedet/semantic/symref/grep.el" "cedet/semantic/symref/idutils.el"
-;;;;;; "cedet/semantic/symref/list.el" "cedet/semantic/tag-file.el"
-;;;;;; "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
+;;;;;; "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" "cedet/semantic/loaddefs.el"
+;;;;;; "cedet/semantic/mru-bookmark.el" "cedet/semantic/sb.el" "cedet/semantic/scope.el"
+;;;;;; "cedet/semantic/senator.el" "cedet/semantic/sort.el" "cedet/semantic/symref.el"
+;;;;;; "cedet/semantic/symref/cscope.el" "cedet/semantic/symref/filter.el"
+;;;;;; "cedet/semantic/symref/global.el" "cedet/semantic/symref/grep.el"
+;;;;;; "cedet/semantic/symref/idutils.el" "cedet/semantic/symref/list.el"
+;;;;;; "cedet/semantic/tag-file.el" "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
;;;;;; "cedet/semantic/tag.el" "cedet/semantic/texi.el" "cedet/semantic/util-modes.el"
;;;;;; "cedet/semantic/util.el" "cedet/semantic/wisent.el" "cedet/semantic/wisent/comp.el"
;;;;;; "cedet/semantic/wisent/java-tags.el" "cedet/semantic/wisent/javascript.el"
;;;;;; "cedet/srecode/el.el" "cedet/srecode/expandproto.el" "cedet/srecode/extract.el"
;;;;;; "cedet/srecode/fields.el" "cedet/srecode/filters.el" "cedet/srecode/find.el"
;;;;;; "cedet/srecode/getset.el" "cedet/srecode/insert.el" "cedet/srecode/java.el"
-;;;;;; "cedet/srecode/map.el" "cedet/srecode/mode.el" "cedet/srecode/semantic.el"
-;;;;;; "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el" "cedet/srecode/table.el"
-;;;;;; "cedet/srecode/template.el" "cedet/srecode/texi.el" "cus-dep.el"
-;;;;;; "dframe.el" "dired-aux.el" "dired-x.el" "dos-fns.el" "dos-vars.el"
-;;;;;; "dos-w32.el" "dynamic-setting.el" "emacs-lisp/authors.el"
+;;;;;; "cedet/srecode/loaddefs.el" "cedet/srecode/map.el" "cedet/srecode/mode.el"
+;;;;;; "cedet/srecode/semantic.el" "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el"
+;;;;;; "cedet/srecode/table.el" "cedet/srecode/template.el" "cedet/srecode/texi.el"
+;;;;;; "cus-dep.el" "dframe.el" "dired-aux.el" "dired-x.el" "dos-fns.el"
+;;;;;; "dos-vars.el" "dos-w32.el" "dynamic-setting.el" "emacs-lisp/authors.el"
;;;;;; "emacs-lisp/avl-tree.el" "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el"
;;;;;; "emacs-lisp/chart.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-loaddefs.el"
;;;;;; "emacs-lisp/cl-macs.el" "emacs-lisp/cl-seq.el" "emacs-lisp/cl.el"
;;;;;; "eshell/em-pred.el" "eshell/em-prompt.el" "eshell/em-rebind.el"
;;;;;; "eshell/em-script.el" "eshell/em-smart.el" "eshell/em-term.el"
;;;;;; "eshell/em-unix.el" "eshell/em-xtra.el" "eshell/esh-arg.el"
-;;;;;; "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-io.el"
-;;;;;; "eshell/esh-module.el" "eshell/esh-opt.el" "eshell/esh-proc.el"
-;;;;;; "eshell/esh-util.el" "eshell/esh-var.el" "ezimage.el" "foldout.el"
-;;;;;; "format-spec.el" "fringe.el" "generic-x.el" "gnus/compface.el"
-;;;;;; "gnus/gnus-async.el" "gnus/gnus-bcklg.el" "gnus/gnus-cite.el"
-;;;;;; "gnus/gnus-cus.el" "gnus/gnus-demon.el" "gnus/gnus-dup.el"
-;;;;;; "gnus/gnus-eform.el" "gnus/gnus-ems.el" "gnus/gnus-int.el"
-;;;;;; "gnus/gnus-logic.el" "gnus/gnus-mh.el" "gnus/gnus-salt.el"
-;;;;;; "gnus/gnus-score.el" "gnus/gnus-setup.el" "gnus/gnus-srvr.el"
-;;;;;; "gnus/gnus-topic.el" "gnus/gnus-undo.el" "gnus/gnus-util.el"
-;;;;;; "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/gssapi.el" "gnus/ietf-drums.el"
-;;;;;; "gnus/legacy-gnus-agent.el" "gnus/mail-parse.el" "gnus/mail-prsvr.el"
-;;;;;; "gnus/mail-source.el" "gnus/mailcap.el" "gnus/messcompat.el"
-;;;;;; "gnus/mm-archive.el" "gnus/mm-bodies.el" "gnus/mm-decode.el"
-;;;;;; "gnus/mm-util.el" "gnus/mm-view.el" "gnus/mml-sec.el" "gnus/mml-smime.el"
-;;;;;; "gnus/nnagent.el" "gnus/nnbabyl.el" "gnus/nndir.el" "gnus/nndraft.el"
-;;;;;; "gnus/nneething.el" "gnus/nngateway.el" "gnus/nnheader.el"
-;;;;;; "gnus/nnimap.el" "gnus/nnir.el" "gnus/nnmail.el" "gnus/nnmaildir.el"
-;;;;;; "gnus/nnmairix.el" "gnus/nnmbox.el" "gnus/nnmh.el" "gnus/nnnil.el"
-;;;;;; "gnus/nnoo.el" "gnus/nnregistry.el" "gnus/nnrss.el" "gnus/nnspool.el"
-;;;;;; "gnus/nntp.el" "gnus/nnvirtual.el" "gnus/nnweb.el" "gnus/registry.el"
-;;;;;; "gnus/rfc1843.el" "gnus/rfc2045.el" "gnus/rfc2047.el" "gnus/rfc2104.el"
-;;;;;; "gnus/rfc2231.el" "gnus/rtree.el" "gnus/shr-color.el" "gnus/sieve-manage.el"
-;;;;;; "gnus/smime.el" "gnus/spam-stat.el" "gnus/spam-wash.el" "hex-util.el"
-;;;;;; "hfy-cmap.el" "ibuf-ext.el" "international/cp51932.el" "international/eucjp-ms.el"
-;;;;;; "international/fontset.el" "international/iso-ascii.el" "international/ja-dic-cnv.el"
+;;;;;; "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-groups.el"
+;;;;;; "eshell/esh-io.el" "eshell/esh-module.el" "eshell/esh-opt.el"
+;;;;;; "eshell/esh-proc.el" "eshell/esh-util.el" "eshell/esh-var.el"
+;;;;;; "ezimage.el" "foldout.el" "format-spec.el" "fringe.el" "generic-x.el"
+;;;;;; "gnus/compface.el" "gnus/gnus-async.el" "gnus/gnus-bcklg.el"
+;;;;;; "gnus/gnus-cite.el" "gnus/gnus-cus.el" "gnus/gnus-demon.el"
+;;;;;; "gnus/gnus-dup.el" "gnus/gnus-eform.el" "gnus/gnus-ems.el"
+;;;;;; "gnus/gnus-int.el" "gnus/gnus-logic.el" "gnus/gnus-mh.el"
+;;;;;; "gnus/gnus-salt.el" "gnus/gnus-score.el" "gnus/gnus-setup.el"
+;;;;;; "gnus/gnus-srvr.el" "gnus/gnus-topic.el" "gnus/gnus-undo.el"
+;;;;;; "gnus/gnus-util.el" "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/gssapi.el"
+;;;;;; "gnus/ietf-drums.el" "gnus/legacy-gnus-agent.el" "gnus/mail-parse.el"
+;;;;;; "gnus/mail-prsvr.el" "gnus/mail-source.el" "gnus/mailcap.el"
+;;;;;; "gnus/messcompat.el" "gnus/mm-archive.el" "gnus/mm-bodies.el"
+;;;;;; "gnus/mm-decode.el" "gnus/mm-util.el" "gnus/mm-view.el" "gnus/mml-sec.el"
+;;;;;; "gnus/mml-smime.el" "gnus/nnagent.el" "gnus/nnbabyl.el" "gnus/nndir.el"
+;;;;;; "gnus/nndraft.el" "gnus/nneething.el" "gnus/nngateway.el"
+;;;;;; "gnus/nnheader.el" "gnus/nnimap.el" "gnus/nnir.el" "gnus/nnmail.el"
+;;;;;; "gnus/nnmaildir.el" "gnus/nnmairix.el" "gnus/nnmbox.el" "gnus/nnmh.el"
+;;;;;; "gnus/nnnil.el" "gnus/nnoo.el" "gnus/nnregistry.el" "gnus/nnrss.el"
+;;;;;; "gnus/nnspool.el" "gnus/nntp.el" "gnus/nnvirtual.el" "gnus/nnweb.el"
+;;;;;; "gnus/registry.el" "gnus/rfc1843.el" "gnus/rfc2045.el" "gnus/rfc2047.el"
+;;;;;; "gnus/rfc2104.el" "gnus/rfc2231.el" "gnus/rtree.el" "gnus/shr-color.el"
+;;;;;; "gnus/sieve-manage.el" "gnus/smime.el" "gnus/spam-stat.el"
+;;;;;; "gnus/spam-wash.el" "hex-util.el" "hfy-cmap.el" "ibuf-ext.el"
+;;;;;; "international/cp51932.el" "international/eucjp-ms.el" "international/fontset.el"
+;;;;;; "international/iso-ascii.el" "international/ja-dic-cnv.el"
;;;;;; "international/ja-dic-utl.el" "international/ogonek.el" "international/uni-bidi.el"
;;;;;; "international/uni-category.el" "international/uni-combining.el"
;;;;;; "international/uni-comment.el" "international/uni-decimal.el"
;;;;;; "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") (20755 24213 662096
-;;;;;; 604000))
+;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (20747 42275 915429
+;;;;;; 589000))
;;;***
\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)
(defcustom feedmail-force-binary-write t
"If non-nil, force writing file as binary (this applies to queues and Fcc:).
On systems where there is a difference between binary and text files,
-feedmail will temporarily manipulate the value of `buffer-file-type'
+feedmail will temporarily manipulate the value of `coding-system-for-write'
to make the writing as binary. If nil, writing will be in text mode.
On systems where there is no distinction or where it is controlled by other
variables or other means, this option has no effect."
(setq buffer-offer-save nil)
(buffer-disable-undo blobby-buffer)
(insert-file-contents-literally maybe-file)
- (setq buffer-file-type t) ; binary
(goto-char (point-min))
;; if at least two line-endings with CRLF, translate the file
(if (looking-at ".*\r\n.*\r\n")
(setq filename buffer-file-name)
(setq filename (feedmail-create-queue-filename queue-directory)))
;; make binary file on DOS/Windows 95/Windows NT, etc
- (let ((buffer-file-type feedmail-force-binary-write))
+ (let ((coding-system-for-write
+ (if feedmail-force-binary-write
+ 'no-conversion
+ coding-system-for-write)))
(write-file filename))
;; convenient for moving from draft to q, for example
(if (and previous-buffer-file-name (or (not is-fqm) (not is-in-this-dir))
;; Re-insert and handle any Fcc fields (and, optionally,
;; any Bcc).
(when fcc
- (let ((old (default-value 'buffer-file-type)))
+ (let ((coding-system-for-write
+ (if (and (memq system-type '(ms-dos windows-nt))
+ feedmail-force-binary-write)
+ 'no-conversion
+ coding-system-for-write)))
(unwind-protect
(progn
- (setq-default buffer-file-type
- feedmail-force-binary-write)
(insert fcc)
(unless feedmail-nuke-bcc-in-fcc
(if bcc-holder (insert bcc-holder))
(if resent-bcc-holder
(insert resent-bcc-holder)))
-
+
(run-hooks 'feedmail-before-fcc-hook)
-
+
(when feedmail-nuke-body-in-fcc
(goto-char eoh-marker)
(if (natnump feedmail-nuke-body-in-fcc)
(forward-line feedmail-nuke-body-in-fcc))
(delete-region (point) (point-max)))
- (mail-do-fcc eoh-marker))
- (setq-default buffer-file-type old)))))
+ (mail-do-fcc eoh-marker))))))
;; User bailed out of one-last-look.
(if feedmail-queue-runner-is-active
(throw 'skip-me-q 'skip-me-q)
(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)
(define-key map "<" 'rmail-first-message)
(define-key map ">" 'rmail-last-message)
(define-key map " " 'scroll-up-command)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map "\177" 'scroll-down-command)
(define-key map "?" 'describe-mode)
(define-key map "\C-c\C-s\C-d" 'rmail-sort-by-date)
(setq file-precious-flag t)
(make-local-variable 'desktop-save-buffer)
(setq desktop-save-buffer t)
+ (make-local-variable 'save-buffer-coding-system)
+ (setq save-buffer-coding-system 'no-conversion)
(setq next-error-move-function 'rmail-next-error-move))
\f
;; Handle M-x revert-buffer done in an rmail-mode buffer.
(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" "\
;;;***
\f
-;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "da37981a8295ba2411fdfb77488b1cc3")
+;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "93951f748e43e1015da1b485088970ca")
;;; Generated autoloads from rmailmm.el
(autoload 'rmail-mime "rmailmm" "\
\f
;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic
;;;;;; rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels
-;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "341825201e892b8fc875c1ae49ffd560")
+;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "119ce8b431f01e7f54bb6fa99603b3d9")
;;; Generated autoloads from rmailsum.el
(autoload 'rmail-summary "rmailsum" "\
(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)
(defun rmail-insert-mime-forwarded-message (forward-buffer)
"Insert the message in FORWARD-BUFFER as a forwarded message.
This is the usual value of `rmail-insert-mime-forwarded-message-function'."
- (let ((message-buffer
- (with-current-buffer forward-buffer
- (if rmail-buffer-swapped
- forward-buffer
- rmail-view-buffer))))
- (save-restriction
- (narrow-to-region (point) (point))
- (message-forward-make-body-mime message-buffer))))
+ (let (contents-buffer start end)
+ (with-current-buffer forward-buffer
+ (setq contents-buffer
+ (if rmail-buffer-swapped
+ rmail-view-buffer
+ forward-buffer)
+ start (rmail-msgbeg rmail-current-message)
+ end (rmail-msgend rmail-current-message)))
+ (message-forward-make-body-mime contents-buffer start end)))
(setq rmail-insert-mime-forwarded-message-function
'rmail-insert-mime-forwarded-message)
(define-key map "<" 'rmail-summary-first-message)
(define-key map ">" 'rmail-summary-last-message)
(define-key map " " 'rmail-summary-scroll-msg-up)
+ (define-key map [?\S-\ ] 'rmail-summary-scroll-msg-down)
(define-key map "\177" 'rmail-summary-scroll-msg-down)
(define-key map "?" 'describe-mode)
(define-key map "\C-c\C-n" 'rmail-summary-next-same-subject)
(insert "\nMail-Followup-To: "))))
(defun mail-position-on-field (field &optional soft)
+ "Move to the start of the contents of header field FIELD.
+If there is none, insert one, unless SOFT is non-nil.
+If there are multiple FIELD fields, this goes to the first."
(let (end
(case-fold-search t))
(setq end (mail-header-end))
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.
(insert "X-RMAIL-ATTRIBUTES: " (apply 'string attrs) "\n")
(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.
#
-;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*-
+;;; man.el --- browse UNIX manual pages -*- coding: utf-8 -*-
;; Copyright (C) 1993-1994, 1996-1997, 2001-2013 Free Software
;; Foundation, Inc.
:type 'hook
:group 'man)
-(defvar Man-name-regexp "[-a-zA-Z0-9_+][-a-zA-Z0-9_.:+]*"
+(defvar Man-name-regexp "[-a-zA-Z0-9_Â+][-a-zA-Z0-9_.:Â+]*"
"Regular expression describing the name of a manpage (without section).")
(defvar Man-section-regexp "[0-9][a-zA-Z0-9+]*\\|[LNln]"
(suppress-keymap map)
(set-keymap-parent map button-buffer-map)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map " " 'scroll-up-command)
(define-key map "\177" 'scroll-down-command)
(define-key map "n" 'Man-next-section)
;; but apparently that's not the case in all cases, so let's add a cache.
"Cache of completion table of the form (PREFIX . TABLE).")
+(defvar Man-man-k-use-anchor
+ ;; man-db or man-1.*
+ (memq system-type '(gnu gnu/linux gnu/kfreebsd))
+ "If non-nil prepend ^ to the prefix passed to \"man -k\" for completion.
+The value should be nil if \"man -k ^PREFIX\" may omit some man
+pages whose names start with PREFIX.
+
+Currently, the default value depends on `system-type' and is
+non-nil where the standard man programs are known to behave
+properly. Setting the value to nil always gives correct results
+but computing the list of completions may take a bit longer.")
+
+(defun Man-parse-man-k ()
+ "Parse \"man -k\" output and return the list of page names.
+
+The current buffer should contain the output of a command of the
+form \"man -k keyword\", which is traditionally also available with
+apropos(1).
+
+While POSIX man(1p) is a bit vague about what to expect here,
+this function tries to parse some commonly used formats, which
+can be described in the following informal way, with square brackets
+indicating optional parts and whitespace being interpreted
+somewhat loosely.
+
+foo[, bar [, ...]] [other stuff] (sec) - description
+foo(sec)[, bar(sec) [, ...]] [other stuff] - description
+
+For more details and some regression tests, please see
+test/automated/man-tests.el in the emacs bzr repository."
+ (goto-char (point-min))
+ ;; See man-tests for data about which systems use which format (hopefully we
+ ;; will be able to simplify the code if/when some of those formats aren't
+ ;; used any more).
+ (let (table)
+ (while (search-forward-regexp "^\\([^ \t,\n]+\\)\\(.*?\\)\
+\\(?:[ \t]\\(([^ \t,\n]+?)\\)\\)?\\(?:[ \t]+- ?\\(.*\\)\\)?$" nil t)
+ (let ((section (match-string 3))
+ (description (match-string 4))
+ (bound (match-end 2)))
+ (goto-char (match-end 1))
+ (while
+ (progn
+ ;; The first regexp grouping may already match the section
+ ;; tacked on to the name, which is ok since for the formats we
+ ;; claim to support the third (non-shy) grouping does not
+ ;; match in this case, i.e., section is nil.
+ (push (propertize (concat (match-string 1) section)
+ 'help-echo description)
+ table)
+ (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t)))))
+ (nreverse table)))
+
(defun Man-completion-table (string pred action)
(cond
;; This ends up returning t for pretty much any string, and hence leads to
;; run differently in Man-getpage-in-background, an error
;; here may not necessarily mean that we'll also get an
;; error later.
- (ignore-errors
- (call-process manual-program nil '(t nil) nil
- "-k" (concat "^" prefix))))
- (goto-char (point-min))
- (while (re-search-forward "^\\([^ \t\n]+\\)\\(?: ?\\((.+?)\\)\\(?:[ \t]+- \\(.*\\)\\)?\\)?" nil t)
- (push (propertize (concat (match-string 1) (match-string 2))
- 'help-echo (match-string 3))
- table)))
- ;; Cache the table for later reuse.
- (setq Man-completion-cache (cons prefix table)))
+ (ignore-errors
+ (call-process manual-program nil '(t nil) nil
+ "-k" (concat (when (or Man-man-k-use-anchor
+ (string-equal prefix ""))
+ "^")
+ prefix))))
+ (setq table (Man-parse-man-k)))
+ ;; Cache the table for later reuse.
+ (setq Man-completion-cache (cons prefix table)))
;; The table may contain false positives since the match is made
;; by "man -k" not just on the manpage's name.
(if section
;; ("man -k" is case-insensitive similarly, so the
;; table has everything available to complete)
(completion-ignore-case t)
+ Man-completion-cache ;Don't cache across calls.
(input (completing-read
(format "Manual entry%s"
(if (string= default-entry "")
;; Update len, in case a reference spans
;; more than two lines (paranoia).
len (1- (length word))))
- (if (memq (aref word len) '(?- ?))
+ (if (memq (aref word len) '(?- ?Â))
(setq hyphenated (substring word 0 len)))
(and (string-match Man-reference-regexp word)
(not (member word Man--refpages))
'(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"))
+2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * mh-acros.el (mh-do-at-event-location): Use point-marker.
+ * mh-search.el (mh-index-create-imenu-index): Likewise.
+ * mh-xface.el (mh-x-image-url-display): Likewise.
+
+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.
(,original-window (selected-window))
(,original-position (progn
(set-buffer (window-buffer ,event-window))
- (set-marker (make-marker) (point))))
+ (point-marker)))
(,modified-flag (buffer-modified-p))
(buffer-read-only nil))
(unwind-protect (progn
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
(beginning-of-line)
(push (cons (buffer-substring-no-properties
(point) (mh-line-end-position))
- (set-marker (make-marker) (point)))
+ (point-marker))
alist)))
(setq imenu--index-alist (nreverse alist)))))
;;;###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.
If the URL isn't present in the cache then it is fetched with wget."
(let* ((cache-filename (mh-x-image-url-cache-canonicalize url))
(state (mh-x-image-get-download-state cache-filename))
- (marker (set-marker (make-marker) (point))))
+ (marker (point-marker)))
(set (make-local-variable 'mh-x-image-marker) marker)
(cond ((not (mh-x-image-url-sane-p url)))
((eq state 'ok)
(defun minibuffer-default--in-prompt-regexps ()
`(("\\( (default\\(?: is\\)? \\(.*\\))\\):? \\'"
1 ,(if minibuffer-eldef-shorten-default " [\\2]"))
+ ("([^(]+?\\(, default\\(?: is\\)? \\(.*\\)\\)):? \\'" 1)
("\\( \\[.*\\]\\):? *\\'" 1)))
(defcustom minibuffer-eldef-shorten-default nil
(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)))
(define-key map "i" 'info)
(define-key map "m" 'mail)
(define-key map "n" 'make-frame)
- (define-key map [mouse-1] (lambda () (interactive)
- (with-current-buffer "*Messages*"
- (goto-char (point-max))
- (display-buffer (current-buffer)))))
+ (define-key map [mouse-1] 'view-echo-area-messages)
;; So the global down-mouse-1 binding doesn't clutter the execution of the
;; above mouse-1 binding.
(define-key map [down-mouse-1] #'ignore)
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:]_]*\\|{\\([^}]*\\)\\)\\'"))
The first argument of this function is the current buffer where the
search is currently searching. It defines the base buffer relative to
which this function should find the next buffer. When the isearch
-direction is backward (when `isearch-forward' is nil), this function
+direction is backward (when option `isearch-forward' is nil), this function
should return the previous buffer to search.
If the second argument of this function WRAP is non-nil, then it
;; Find its binding.
(let* ((fun (key-binding (vector (car event))))
+ ;; FIXME This doesn't make sense, because
+ ;; event-click-count always returns something >= 1.
(do-multi-click (and (> (event-click-count event) 0)
(functionp fun)
(not (memq fun '(mouse-set-point
(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.
"^Data connection \\|"
"^local:\\|^Trying\\|^125 \\|^550-\\|^221 .*oodbye\\|"
"^500 .*AUTH\\|^KERBEROS\\|"
+ "^500 This security scheme is not implemented\\|"
"^504 Unknown security mechanism\\|"
"^530 Please login with USER and PASS\\|" ; non kerberized vsFTPd
"^534 Kerberos Authentication not enabled\\|"
(name (ange-ftp-quote-string (nth 2 parsed)))
(temp (ange-ftp-make-tmp-name host))
(binary (ange-ftp-binary-file filename))
- (buffer-file-type buffer-file-type)
(abbr (ange-ftp-abbreviate-filename filename))
(coding-system-used last-coding-system-used)
size)
size
(nth 1 (ange-ftp-real-insert-file-contents
temp visit beg end replace))
- coding-system-used last-coding-system-used
- ;; override autodetection of buffer file type
- ;; to ensure buffer is saved in DOS format
- buffer-file-type binary)
+ coding-system-used last-coding-system-used)
(signal 'ftp-error
(list
"Opening input file:"
(forward-line 1))
;; Would like to look for a "Total" line, or a "Directory" line to
;; make sure that the listing isn't complete garbage before putting
- ;; in "." and "..", but we can't even count on all VAX's giving us
+ ;; in "." and "..", but we can't count on VMS giving us
;; either of these.
(puthash "." t tbl)
(puthash ".." t tbl))
;; Author: Ulf Jasper <ulf.jasper@web.de>
;; Filename: newst-plainview.el
;; URL: http://www.nongnu.org/newsticker
-;; Time-stamp: "13. Mai 2011, 19:28:34 (ulf)"
+;; Time-stamp: "Mon 11-Feb-2013 20:27:11 gm on skiddaw"
;; Package: newsticker
;; ======================================================================
(define-key map "sx" 'newsticker-show-extra)
(define-key map "hx" 'newsticker-hide-extra)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map " " 'scroll-up-command)
(define-key map "q" 'newsticker-close-buffer)
(define-key map "p" 'newsticker-previous-item)
"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")
(url-package-name "soap-client.el")
(url-package-version "1.0")
(url-http-version "1.0")
- (url-request-data (soap-create-envelope operation parameters wsdl))
+ (url-request-data
+ ;; url-request-data expects a unibyte string already encoded...
+ (encode-coding-string
+ (soap-create-envelope operation parameters wsdl)
+ 'utf-8))
(url-mime-charset-string "utf-8;q=1, iso-8859-1;q=0.5")
(url-request-coding-system 'utf-8)
(url-http-attempt-keepalives t)
(progn
(setq res (buffer-substring (match-beginning 2)
(match-end 2))
- res (mapcar 'string-to-int (split-string res "\\.")))))
+ res (mapcar 'string-to-number (split-string res "\\.")))))
(kill-buffer (current-buffer)))
res)
host))
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)
+(require 'time-date)
+
+(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))))
+ (tramp-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)
+ (tramp-file-name-handler '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"
+ (tramp-file-name-handler '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 should provide a tty. This is not
+ ;; possible here.
+ (unless (stringp program)
+ (tramp-error v 'file-error "PROGRAM must be a string"))
+
+ (let ((command
+ (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))
+
+ (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)
+
+ (with-current-buffer (tramp-get-connection-buffer v)
+ (unwind-protect
+ ;; We catch this event. Otherwise, `start-process' could
+ ;; be called on the local host.
+ (save-excursion
+ (save-restriction
+ ;; Activate narrowing in order to save BUFFER
+ ;; contents. Clear also the modification time;
+ ;; otherwise we might be interrupted by
+ ;; `verify-visited-file-modtime'.
+ (let ((buffer-undo-list t)
+ (buffer-read-only nil)
+ (mark (point)))
+ (clear-visited-file-modtime)
+ (narrow-to-region (point-max) (point-max))
+ ;; We call `tramp-adb-maybe-open-connection', in
+ ;; order to cleanup the prompt afterwards.
+ (tramp-adb-maybe-open-connection v)
+ (widen)
+ (delete-region mark (point))
+ (narrow-to-region (point-max) (point-max))
+ ;; Send the command.
+ (let ((tramp-adb-prompt (regexp-quote command)))
+ (tramp-adb-send-command v command))
+ (let ((p (tramp-get-connection-process v)))
+ ;; Set query flag and process marker for this
+ ;; process. We ignore errors, because the process
+ ;; could have finished already.
+ (ignore-errors
+ (tramp-compat-set-process-query-on-exit-flag p t)
+ (set-marker (process-mark p) (point)))
+ ;; Return process.
+ p))))
+
+ ;; Save exit.
+ (if (string-match tramp-temp-buffer-name (buffer-name))
+ (ignore-errors
+ (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!"))
+ (tramp-compat-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
'tramp-load-report-modules ; pre-hook
'tramp-append-tramp-buffers ; post-hook
- "\
+ (propertize "\n" 'display "\
Enter your bug report in this message, including as much detail
as you possibly can about the problem, what you did to cause it
and what the local and remote machines are.
buffer in your bug report.
--bug report follows this line--
-"))))
+")))))
(defun tramp-reporter-dump-variable (varsym mailbuf)
"Pretty-print the value of the variable in symbol VARSYM."
(kill-buffer nil)
(switch-to-buffer curbuf)
(goto-char (point-max))
- (insert "\n\
+ (insert (propertize "\n" 'display "\n\
This is a special notion of the `gnus/message' package. If you
use another mail agent (by copying the contents of this buffer)
-please ensure that the buffers are attached to your email.\n\n")
+please ensure that the buffers are attached to your email.\n\n"))
(dolist (buffer buffer-list)
(tramp-compat-funcall
'mml-insert-empty-tag 'part 'type "text/plain"
(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)
;; `remote-file-name-inhibit-cache' has been introduced with Emacs 24.1.
;; Besides `t', `nil', and integer, we use also timestamps (as
;; returned by `current-time') internally.
- (defvar remote-file-name-inhibit-cache nil)
+ (unless (boundp 'remote-file-name-inhibit-cache)
+ (defvar remote-file-name-inhibit-cache nil))
;; For not existing functions, or functions with a changed argument
;; list, there are compiler warnings. We want to avoid them in
;; 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.")
(let ((f (buffer-file-name))
coding-system-used)
(with-parsed-tramp-file-name f nil
- (let* ((attr (file-attributes f))
+ (let* ((remote-file-name-inhibit-cache t)
+ (attr (file-attributes f))
;; '(-1 65535) means file doesn't exists yet.
(modtime (or (nth 5 attr) '(-1 65535))))
(when (boundp 'last-coding-system-used)
(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 -ac %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))
+ (tramp-compat-funcall
+ '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 (expand-file-name filename) nil
+ (if (and (stringp acl-string) (tramp-remote-acl-p v)
+ (progn
+ (tramp-send-command
+ v (format "setfacl --set-file=- %s <<'EOF'\n%s\nEOF\n"
+ (tramp-shell-quote-argument localname) acl-string))
+ (tramp-send-command-and-check v nil)))
+ ;; Success.
+ (progn
+ (tramp-set-file-property v localname "file-acl" acl-string)
+ t)
+ ;; In case of errors, we return `nil'.
+ (tramp-set-file-property v localname "file-acl-string" '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))
(with-current-buffer (tramp-get-connection-buffer v)
(unwind-protect
+ ;; We catch this event. Otherwise, `start-process' could
+ ;; be called on the local host.
(save-excursion
(save-restriction
;; Activate narrowing in order to save BUFFER
(narrow-to-region (point-max) (point-max))
;; We call `tramp-maybe-open-connection', in order
;; to cleanup the prompt afterwards.
- (tramp-maybe-open-connection v)
- (widen)
- (delete-region mark (point))
- (narrow-to-region (point-max) (point-max))
- ;; Now do it.
- (if command
- ;; Send the command.
- (tramp-send-command v command nil t) ; nooutput
- ;; Check, whether a pty is associated.
- (unless (tramp-compat-process-get
- (tramp-get-connection-process v) 'remote-tty)
- (tramp-error
- v 'file-error
- "pty association is not supported for `%s'" name))))
- (let ((p (tramp-get-connection-process v)))
- ;; Set query flag for this process. We ignore errors,
- ;; because the process could have finished already.
- (ignore-errors
- (tramp-compat-set-process-query-on-exit-flag p t))
- ;; Return process.
- p)))
+ (catch 'suppress
+ (tramp-maybe-open-connection v)
+ (widen)
+ (delete-region mark (point))
+ (narrow-to-region (point-max) (point-max))
+ ;; Now do it.
+ (if command
+ ;; Send the command.
+ (tramp-send-command v command nil t) ; nooutput
+ ;; Check, whether a pty is associated.
+ (unless (tramp-compat-process-get
+ (tramp-get-connection-process v) 'remote-tty)
+ (tramp-error
+ v 'file-error
+ "pty association is not supported for `%s'" name))))
+ (let ((p (tramp-get-connection-process v)))
+ ;; Set query flag and process marker for this
+ ;; process. We ignore errors, because the process
+ ;; could have finished already.
+ (ignore-errors
+ (tramp-compat-set-process-query-on-exit-flag p t)
+ (set-marker (process-mark p) (point)))
+ ;; Return process.
+ p))))
;; Save exit.
(if (string-match tramp-temp-buffer-name (buffer-name))
- (progn
+ (ignore-errors
(set-process-buffer (tramp-get-connection-process v) nil)
(kill-buffer (current-buffer)))
(set-buffer-modified-p bmp))
(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
(tramp-message
vec 2 "Couldn't find an inline transfer compress command")))))
+(defvar tramp-gw-tunnel-method)
+(defvar tramp-gw-socks-method)
+
(defun tramp-compute-multi-hops (vec)
"Expands VEC according to `tramp-default-proxies-alist'.
Gateway hops are already opened."
(setq choices tramp-default-proxies-alist)))))
;; Handle gateways.
- (when (string-match
- (format
- "^\\(%s\\|%s\\)$" tramp-gw-tunnel-method tramp-gw-socks-method)
- (tramp-file-name-method (car target-alist)))
+ (when (and (boundp 'tramp-gw-tunnel-method) (boundp 'tramp-gw-socks-method)
+ (string-match
+ (format
+ "^\\(%s\\|%s\\)$" tramp-gw-tunnel-method tramp-gw-socks-method)
+ (tramp-file-name-method (car target-alist))))
(let ((gw (pop target-alist))
(hop (pop target-alist)))
;; Is the method prepared for gateways?
(car tramp-current-connection)))
(> (tramp-time-diff
(current-time) (cdr tramp-current-connection))
- 5))
+ (or tramp-connection-min-time-diff 0)))
(throw 'suppress 'suppress))
;; If too much time has passed since last command was sent, look
(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 "^#")
+ (forward-line)
+ (delete-region (point-min) (point)))
+ (goto-char (point-max))
+ (delete-blank-lines)
+ (when (> (point-max) (point-min))
+ (tramp-compat-funcall
+ '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.
;; for an override of the system default.
(defcustom tramp-process-connection-type t
"Overrides `process-connection-type' for connections from Tramp.
-Tramp binds process-connection-type to the value given here before
+Tramp binds `process-connection-type' to the value given here before
opening a connection to a remote host."
:group 'tramp
:type '(choice (const nil) (const t) (const pty)))
+(defcustom tramp-connection-min-time-diff 5
+ "Defines seconds between two consecutive connection attempts.
+This is necessary as self defense mechanism, in order to avoid
+yo-yo connection attempts when the remote host is unavailable.
+
+A value of 0 or `nil' suppresses this check. This might be
+necessary, when several out-of-order copy operations are
+performed, or when several asynchronous processes will be started
+in a short time frame. In those cases it is recommended to
+let-bind this variable."
+ :group 'tramp
+ :version "24.4"
+ :type '(choice (const nil) integer))
+
(defcustom tramp-completion-reread-directory-timeout 10
"Defines seconds since last remote command before rereading a directory.
A remote directory might have changed its contents. In order to
would require an immediate reread during filename completion, `nil'
means to use always cached values for the directory contents."
:group 'tramp
- :type '(choice (const nil) integer))
+ :type '(choice (const nil) (const t) integer))
;;; Internal Variables:
;;;###tramp-autoload
(defun tramp-tramp-file-p (name)
- "Return t if NAME is a string with Tramp file name syntax."
+ "Return t if NAME is a string with Tramp file name syntax.
+It checks also, whether NAME is unibyte encoded."
(save-match-data
- (and (stringp name) (string-match tramp-file-name-regexp name))))
+ (and (stringp name)
+; (string-equal name (string-as-unibyte name))
+ (string-match tramp-file-name-regexp name))))
(defun tramp-find-method (method user host)
"Return the right method string to use.
"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)
(concat
"^"
(regexp-opt
- '("tramp-compat-funcall"
+ '("tramp-backtrace"
+ "tramp-compat-condition-case-unless-debug"
+ "tramp-compat-funcall"
"tramp-compat-with-temp-message"
"tramp-debug-message"
"tramp-error"
(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))))))
+(defsubst tramp-backtrace (vec-or-proc)
+ "Dump a backtrace into the debug buffer.
+This function is meant for debugging purposes."
+ (tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))))
+
(defmacro with-parsed-tramp-file-name (filename var &rest body)
"Parse a Tramp filename and make components available in the body.
(logand (default-file-modes) (tramp-compat-octal-to-decimal "0666"))))
(defun tramp-replace-environment-variables (filename)
- "Replace environment variables in 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)))
+ (or (ignore-errors
+ (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
+ ;; We need an own implementation.
+ (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))))
(setq tramp-temp-buffer-file-name local-copy))
;; We must ensure that `file-coding-system-alist'
- ;; matches `local-copy'.
+ ;; matches `local-copy'. We must also use `visit',
+ ;; otherwise there might be an error in the
+ ;; `revert-buffer' function under XEmacs.
(let ((file-coding-system-alist
(tramp-find-file-name-coding-system-alist
filename local-copy)))
(setq result
(insert-file-contents
- local-copy nil nil nil replace)))))
+ local-copy visit nil nil replace)))))
;; Save exit.
(progn
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
+ (or
+ ;; When `tramp-own-remote-path' is in `tramp-remote-path',
+ ;; the remote path is only set in the session cache.
+ (tramp-get-connection-property
+ (tramp-get-connection-process v) "remote-path" nil)
+ (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)))
(defun comment-box (beg end &optional arg)
"Comment out the BEG .. END region, putting it inside a box.
The numeric prefix ARG specifies how many characters to add to begin- and
-end- comment markers additionally to what `comment-add' already specifies."
+end- comment markers additionally to what variable `comment-add' already
+specifies."
(interactive "*r\np")
(comment-normalize-vars)
(let ((comment-style (if (cadr (assoc comment-style comment-styles))
(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:
* ob-eval.el (org-babel-shell-command-on-region): Use
`executable-find' for local `shell-file-name'.
-2013-01-08 Achim Gratz <Stromeko@Stromeko.de>
+2013-01-09 Achim Gratz <Stromeko@Stromeko.de>
* 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))))))
;;
;; Turn on highlighting for the matching paren, if found.
;; If it's an unmatched paren, turn off any such highlighting.
- (unless (integerp pos)
- (delete-overlay show-paren-overlay))
- (let ((to (if (or (eq show-paren-style 'expression)
- (and (eq show-paren-style 'mixed)
- (not (pos-visible-in-window-p pos))))
- (point)
- pos))
- (from (if (or (eq show-paren-style 'expression)
+ (if (not (integerp pos))
+ (when show-paren-overlay (delete-overlay show-paren-overlay))
+ (let ((to (if (or (eq show-paren-style 'expression)
(and (eq show-paren-style 'mixed)
(not (pos-visible-in-window-p pos))))
- pos
- (save-excursion
- (goto-char pos)
- (- (point) dir)))))
- (if show-paren-overlay
- (move-overlay show-paren-overlay from to (current-buffer))
- (setq show-paren-overlay (make-overlay from to nil t))))
- ;;
- ;; Always set the overlay face, since it varies.
- (overlay-put show-paren-overlay 'priority show-paren-priority)
- (overlay-put show-paren-overlay 'face face)))
+ (point)
+ pos))
+ (from (if (or (eq show-paren-style 'expression)
+ (and (eq show-paren-style 'mixed)
+ (not (pos-visible-in-window-p pos))))
+ pos
+ (save-excursion
+ (goto-char pos)
+ (- (point) dir)))))
+ (if show-paren-overlay
+ (move-overlay show-paren-overlay from to (current-buffer))
+ (setq show-paren-overlay (make-overlay from to nil t))))
+ ;; Always set the overlay face, since it varies.
+ (overlay-put show-paren-overlay 'priority show-paren-priority)
+ (overlay-put show-paren-overlay 'face face))))
;; show-paren-mode is nil in this buffer.
(and show-paren-overlay
(delete-overlay show-paren-overlay))
(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)
(make-directory gamegrid-user-score-file-directory t))
(gamegrid-add-score-insecure file score
gamegrid-user-score-file-directory))
- (t (let ((f (expand-file-name
- gamegrid-user-score-file-directory)))
- (when (file-writable-p f)
- (unless (eq (car-safe (file-attributes f))
- t)
- (make-directory f))
- (setq f (expand-file-name file f))
- (unless (file-exists-p f)
- (write-region "" nil f nil 'silent nil 'excl)))
- (gamegrid-add-score-with-update-game-score-1 file f score))))))
+ (t
+ (unless (file-exists-p
+ (directory-file-name gamegrid-user-score-file-directory))
+ (make-directory gamegrid-user-score-file-directory t))
+ (let ((f (expand-file-name file
+ gamegrid-user-score-file-directory)))
+ (unless (file-exists-p f)
+ (write-region "" nil f nil 'silent nil 'excl))
+ (gamegrid-add-score-with-update-game-score-1 file f score))))))
(defun gamegrid-add-score-with-update-game-score-1 (file target score)
(let ((default-directory "/")
(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)
gametree-half-ply-regexp)) limit))
(goto-char (match-beginning 0))))
(gametree-transpose-following-leaves)
- (let* ((pt (set-marker (make-marker) (point)))
+ (let* ((pt (point-marker))
(plys (gametree-current-branch-ply))
(depth (gametree-current-branch-depth))
(old-depth depth))
(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)
Where:
SYMBOL It's a symbol to identify a text printer. It's for
- `pr-txt-name' variable setting and for menu selection.
+ setting option `pr-txt-name' and for menu selection.
Examples:
'prt_06a
'my_printer
Where:
SYMBOL It's a symbol to identify a PostScript printer. It's for
- `pr-ps-name' variable setting and for menu selection.
+ setting option `pr-ps-name' and for menu selection.
Examples:
'prt_06a
'my_printer
The example above has two setting groups: no-duplex and
no-duplex-and-landscape. When setting no-duplex is activated
- through `inherits-from:' (see `pr-ps-utility', `pr-mode-alist'
- and `pr-ps-printer-alist'), the variables pr-file-duplex and
- pr-file-tumble are both set to nil.
+ through `inherits-from:' (see option `pr-ps-utility',
+ `pr-mode-alist' and `pr-ps-printer-alist'), the variables
+ pr-file-duplex and pr-file-tumble are both set to nil.
Now when setting no-duplex-and-landscape is activated through
`inherits-from:', the variable pr-file-landscape is set to nil
(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:
(goto-char (point-min))
(read (current-buffer))))
+(defun profiler-running-p (&optional mode)
+ "Return non-nil if the profiler is running.
+Optional argument MODE means only check for the specified mode (cpu or mem)."
+ (cond ((eq mode 'cpu) (and (fboundp 'profiler-cpu-running-p)
+ (profiler-cpu-running-p)))
+ ((eq mode 'mem) (profiler-memory-running-p))
+ (t (or (profiler-running-p 'cpu)
+ (profiler-running-p 'mem)))))
+
(defun profiler-cpu-profile ()
"Return CPU profile."
- (when (and (fboundp 'profiler-cpu-running-p)
- (fboundp 'profiler-cpu-log)
- (profiler-cpu-running-p))
+ (when (profiler-running-p 'cpu)
(profiler-make-profile
:type 'cpu
:timestamp (current-time)
(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"]
+ "--"
+ ["Start Profiler" profiler-start :active (not (profiler-running-p))
+ :help "Start profiling"]
+ ["Stop Profiler" profiler-stop :active (profiler-running-p)
+ :help "Stop profiling"]
+ ["New Report" profiler-report :active (profiler-running-p)
+ :help "Make a new report"]))
+ 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)
;; escaped EOL.
;; REGEXPS FOR "HARMLESS" STRINGS/LINES.
-(defconst c-awk-harmless-char-re "[^_#/\"\\\\\n\r]")
-;; Matches any character but a _, #, /, ", \, or newline. N.B. _" starts a
-;; localization string in gawk 3.1
(defconst c-awk-harmless-_ "_\\([^\"]\\|\\'\\)")
;; Matches an underline NOT followed by ".
+(defconst c-awk-harmless-char-re "[^_#/\"{}();\\\\\n\r]")
+;; Matches any character not significant in the state machine applying
+;; syntax-table properties to "s and /s.
(defconst c-awk-harmless-string*-re
(concat "\\(" c-awk-harmless-char-re "\\|" c-awk-esc-pair-re "\\|" c-awk-harmless-_ "\\)*"))
-;; Matches a (possibly empty) sequence of chars without unescaped /, ", \,
-;; #, or newlines.
+;; Matches a (possibly empty) sequence of characters insignificant in the
+;; state machine applying syntax-table properties to "s and /s.
(defconst c-awk-harmless-string*-here-re
(concat "\\=" c-awk-harmless-string*-re))
-;; Matches the (possibly empty) sequence of chars without unescaped /, ", \,
-;; at point.
+;; Matches the (possibly empty) sequence of "insignificant" chars at point.
+
+(defconst c-awk-harmless-line-char-re "[^_#/\"\\\\\n\r]")
+;; Matches any character but a _, #, /, ", \, or newline. N.B. _" starts a
+;; localization string in gawk 3.1
+(defconst c-awk-harmless-line-string*-re
+ (concat "\\(" c-awk-harmless-line-char-re "\\|" c-awk-esc-pair-re "\\|" c-awk-harmless-_ "\\)*"))
+;; Matches a (possibly empty) sequence of chars without unescaped /, ", \,
+;; #, or newlines.
(defconst c-awk-harmless-line-re
- (concat c-awk-harmless-string*-re
- "\\(" c-awk-comment-without-nl "\\)?" c-awk-nl-or-eob))
+ (concat c-awk-harmless-line-string*-re
+ "\\(" c-awk-comment-without-nl "\\)?" c-awk-nl-or-eob))
;; Matches (the tail of) an AWK \"logical\" line not containing an unescaped
;; " or /. "logical" means "possibly containing escaped newlines". A comment
;; is matched as part of the line even if it contains a " or a /. The End of
;; division sign.
(defconst c-awk-neutral-re
; "\\([{}@` \t]\\|\\+\\+\\|--\\|\\\\.\\)+") ; changed, 2003/6/7
- "\\([{}@` \t]\\|\\+\\+\\|--\\|\\\\.\\)")
+ "\\([}@` \t]\\|\\+\\+\\|--\\|\\\\\\(.\\|[\n\r]\\)\\)")
;; A "neutral" char(pair). Doesn't change the "state" of a subsequent /.
-;; This is space/tab, braces, an auto-increment/decrement operator or an
+;; This is space/tab, close brace, an auto-increment/decrement operator or an
;; escaped character. Or one of the (invalid) characters @ or `. But NOT an
-;; end of line (even if escaped).
+;; end of line (unless escaped).
(defconst c-awk-neutrals*-re
(concat "\\(" c-awk-neutral-re "\\)*"))
;; A (possibly empty) string of neutral characters (or character pairs).
;; will only work when there won't be a preceding " or / before the sought /
;; to foul things up.
(defconst c-awk-non-arith-op-bra-re
- "[[\(&=:!><,?;'~|]")
-;; Matches an opening BRAcket, round or square, or any operator character
+ "[[\({&=:!><,?;'~|]")
+;; Matches an opening BRAcket (of any sort), or any operator character
;; apart from +,-,/,*,%. For the purpose at hand (detecting a / which is a
;; regexp bracket) these arith ops are unnecessary and a pain, because of "++"
;; and "--".
;; bracket, in a context where an immediate / would be a division sign. This
;; will only work when there won't be a preceding " or / before the sought /
;; to foul things up.
+(defconst c-awk-pre-exp-alphanum-kwd-re
+ (concat "\\(^\\|\\=\\|[^_\n\r]\\)\\<"
+ (regexp-opt '("print" "return" "case") t)
+ "\\>\\([^_\n\r]\\|$\\)"))
+;; Matches all AWK keywords which can precede expressions (including
+;; /regexp/).
+(defconst c-awk-kwd-regexp-sign-re
+ (concat c-awk-pre-exp-alphanum-kwd-re c-awk-escaped-nls*-with-space* "/"))
+;; Matches a piece of AWK buffer ending in <kwd> /, where <kwd> is a keyword
+;; which can precede an expression.
;; REGEXPS USED FOR FINDING THE POSITION OF A "virtual semicolon"
(defconst c-awk-_-harmless-nonws-char-re "[^#/\"\\\\\n\r \t]")
(goto-char anchor)
;; Analyze the line to find out what the / is.
(if (if anchor-state-/div
- (not (search-forward-regexp c-awk-regexp-sign-re (1+ /point) t))
- (search-forward-regexp c-awk-div-sign-re (1+ /point) t))
- ;; A division sign.
+ (not (search-forward-regexp c-awk-regexp-sign-re (1+ /point) t))
+ (and (not (search-forward-regexp c-awk-kwd-regexp-sign-re (1+ /point) t))
+ (search-forward-regexp c-awk-div-sign-re (1+ /point) t)))
+ ;; A division sign.
(progn (goto-char (1+ /point)) nil)
;; A regexp opener
;; Jump over the regexp innards, setting the match data.
(< (point) lim))
(setq anchor (point))
(search-forward-regexp c-awk-harmless-string*-here-re nil t)
- ;; We are now looking at either a " or a /.
- ;; Do our thing on the string, regexp or division sign.
+ ;; We are now looking at either a " or a / or a brace/paren/semicolon.
+ ;; Do our thing on the string, regexp or division sign or update
+ ;; our state.
(setq anchor-state-/div
- (if (looking-at "_?\"")
- (c-awk-syntax-tablify-string)
- (c-awk-syntax-tablify-/ anchor anchor-state-/div))))
+ (cond
+ ((looking-at "_?\"")
+ (c-awk-syntax-tablify-string))
+ ((eq (char-after) ?/)
+ (c-awk-syntax-tablify-/ anchor anchor-state-/div))
+ ((memq (char-after) '(?{ ?} ?\( ?\;))
+ (forward-char)
+ nil)
+ (t ; ?\)
+ (forward-char)
+ t))))
nil))
;; ACM, 2002/07/21: Thoughts: We need an AWK Mode after-change function to set
;; contains any class offset
)))
+ ;; CASE 5P: AWK pattern or function or continuation
+ ;; thereof.
+ ((c-major-mode-is 'awk-mode)
+ (setq placeholder (point))
+ (c-add-stmt-syntax
+ (if (and (eq (c-beginning-of-statement-1) 'same)
+ (/= (point) placeholder))
+ 'topmost-intro-cont
+ 'topmost-intro)
+ nil nil
+ containing-sexp paren-state))
+
;; CASE 5D: this could be a top-level initialization, a
;; member init list continuation, or a template argument
;; list continuation.
(goto-char (point-min)))
(c-add-syntax 'objc-method-intro (c-point 'boi)))
- ;; CASE 5P: AWK pattern or function or continuation
- ;; thereof.
- ((c-major-mode-is 'awk-mode)
- (setq placeholder (point))
- (c-add-stmt-syntax
- (if (and (eq (c-beginning-of-statement-1) 'same)
- (/= (point) placeholder))
- 'topmost-intro-cont
- 'topmost-intro)
- nil nil
- containing-sexp paren-state))
-
;; CASE 5N: At a variable declaration that follows a class
;; definition or some other block declaration that doesn't
;; end at the closing '}'. C.f. case 5D.5.
(defconst c-font-lock-keywords-3 (c-lang-const c-matchers-3 c)
"Accurate normal font locking for C mode.
-Like `c-font-lock-keywords-2' but detects declarations in a more
+Like the variable `c-font-lock-keywords-2' but detects declarations in a more
accurate way that works in most cases for arbitrary types without the
need for `c-font-lock-extra-types'.")
(defconst c++-font-lock-keywords-3 (c-lang-const c-matchers-3 c++)
"Accurate normal font locking for C++ mode.
-Like `c++-font-lock-keywords-2' but detects declarations in a more
+Like the variable `c++-font-lock-keywords-2' but detects declarations in a more
accurate way that works in most cases for arbitrary types without the
need for `c++-font-lock-extra-types'.")
(defconst objc-font-lock-keywords-3 (c-lang-const c-matchers-3 objc)
"Accurate normal font locking for Objective-C mode.
-Like `objc-font-lock-keywords-2' but detects declarations in a more
+Like the variable `objc-font-lock-keywords-2' but detects declarations in a more
accurate way that works in most cases for arbitrary types without the
need for `objc-font-lock-extra-types'.")
(defconst java-font-lock-keywords-3 (c-lang-const c-matchers-3 java)
"Accurate normal font locking for Java mode.
-Like `java-font-lock-keywords-2' but detects declarations in a more
+Like variable `java-font-lock-keywords-2' but detects declarations in a more
accurate way that works in most cases for arbitrary types without the
need for `java-font-lock-extra-types'.")
(defconst idl-font-lock-keywords-3 (c-lang-const c-matchers-3 idl)
"Accurate normal font locking for CORBA IDL mode.
-Like `idl-font-lock-keywords-2' but detects declarations in a more
+Like the variable `idl-font-lock-keywords-2' but detects declarations in a more
accurate way that works in most cases for arbitrary types without the
need for `idl-font-lock-extra-types'.")
(defconst pike-font-lock-keywords-3 (c-lang-const c-matchers-3 pike)
"Accurate normal font locking for Pike mode.
-Like `pike-font-lock-keywords-2' but detects declarations in a more
+Like the variable `pike-font-lock-keywords-2' but detects declarations in a more
accurate way that works in most cases for arbitrary types without the
need for `pike-font-lock-extra-types'.")
(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)
;;;###autoload
(defcustom compilation-mode-hook nil
- "List of hook functions run by `compilation-mode' (see `run-mode-hooks')."
+ "List of hook functions run by `compilation-mode'."
:type 'hook
:group 'compilation)
;;;###autoload
(defcustom compilation-start-hook nil
- "List of hook functions run by `compilation-start' on the compilation process.
-\(See `run-hook-with-args').
-If you use \"omake -P\" and do not want \\[save-buffers-kill-terminal] to ask whether you want
-the compilation to be killed, you can use this hook:
- (add-hook 'compilation-start-hook
- (lambda (process) (set-process-query-on-exit-flag process nil)) nil t)"
+ "Hook run after starting a new compilation process.
+The hook is run with one argument, the new process."
:type 'hook
:group 'compilation)
;;;###autoload
(defcustom compilation-window-height nil
- "Number of lines in a compilation window. If nil, use Emacs default."
+ "Number of lines in a compilation window.
+If nil, use Emacs default."
:type '(choice (const :tag "Default" nil)
integer)
:group 'compilation)
;; If you make any changes to `compilation-error-regexp-alist-alist',
;; be sure to run the ERT test in test/automated/compile-tests.el.
+;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit
(defvar compilation-error-regexp-alist-alist
'((absoft
;; The "in \\|from " exception was added to handle messages from Ruby.
"^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\
\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\
-\\([0-9]+\\)\\(?:[.:]\\([0-9]+\\)\\)?\
-\\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\
+\\([0-9]+\\)\\(?:-\\(?4:[0-9]+\\)\\(?:\\.\\(?5:[0-9]+\\)\\)?\
+\\|[.:]\\(?3:[0-9]+\\)\\(?:-\\(?:\\(?4:[0-9]+\\)\\.\\)?\\(?5:[0-9]+\\)\\)?\\)?:\
\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
- *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\
- *[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
+ *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|\\[ skipping .+ \\]\\|\
+\\(?:instantiated\\|required\\) from\\|[Nn]ote\\)\\|\
+ *[Ee]rror\\|[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
1 (2 . 4) (3 . 5) (6 . 7))
(lcc
If optional second arg COMINT is t the buffer will be in Comint mode with
`compilation-shell-minor-mode'.
-Interactively, prompts for the command if `compilation-read-command' is
-non-nil; otherwise uses `compile-command'. With prefix arg, always prompts.
+Interactively, prompts for the command if the variable
+`compilation-read-command' is non-nil; otherwise uses`compile-command'.
+With prefix arg, always prompts.
Additionally, with universal prefix arg, compilation buffer will be in
comint mode, i.e. interactive.
(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)
(make-local-variable 'cperl-syntax-state)
(setq cperl-syntax-state nil) ; reset syntaxification cache
(if cperl-use-syntax-table-text-property
- (if (boundp 'syntax-propertize-function)
+ (if (eval-when-compile (fboundp 'syntax-propertize-rules))
(progn
;; Reset syntaxification cache.
(set (make-local-variable 'cperl-syntax-done-to) nil)
((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
(define-key map [ down-mouse-2 ] 'cpp-push-button)
(define-key map [ mouse-2 ] 'ignore)
(define-key map " " 'scroll-up-command)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map "\C-?" 'scroll-down-command)
(define-key map [ delete ] 'scroll-down)
(define-key map "\C-c\C-c" 'cpp-edit-apply)
(defvar tags-table-files nil
"List of file names covered by current tags table.
-nil means it has not yet been computed; use `tags-table-files' to do so.")
+nil means it has not yet been computed;
+use function `tags-table-files' to do so.")
(defvar tags-completion-table nil
"Obarray of tag names defined in current tags table.")
One optional argument, a boolean specifying to return complete path (nil) or
relative path (non-nil).")
(defvar tags-table-files-function nil
- "Function to do the work of `tags-table-files' (which see).")
+ "Function to do the work of function `tags-table-files' (which see).")
(defvar tags-completion-table-function nil
"Function to build the `tags-completion-table'.")
(defvar snarf-tag-function nil
(defvar tags-apropos-function nil
"Function to do the work of `tags-apropos' (which see).")
(defvar tags-included-tables-function nil
- "Function to do the work of `tags-included-tables' (which see).")
+ "Function to do the work of function `tags-included-tables' (which see).")
(defvar verify-tags-table-function nil
"Function to return t if current buffer contains valid tags file.")
\f
(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)
options should include \"-i=mi\" to use gdb's MI text interface.
Note that the old \"--annotate\" option is no longer supported.
-If `gdb-many-windows' is nil (the default value) then gdb just
+If option `gdb-many-windows' is nil (the default value) then gdb just
pops up the GUD buffer unless `gdb-show-main' is t. In this case
it starts with two windows: one displaying the GUD buffer and the
other with the source file with the main routine of the inferior.
-If `gdb-many-windows' is t, regardless of the value of
+If option `gdb-many-windows' is t, regardless of the value of
`gdb-show-main', the layout below will appear. Keybindings are
shown in some of the buffers.
(set-window-dedicated-p window t))
(defun gdb-setup-windows ()
- "Layout the window pattern for `gdb-many-windows'."
+ "Layout the window pattern for option `gdb-many-windows'."
(gdb-get-buffer-create 'gdb-locals-buffer)
(gdb-get-buffer-create 'gdb-stack-buffer)
(gdb-get-buffer-create 'gdb-breakpoints-buffer)
(defun gdb-restore-windows ()
"Restore the basic arrangement of windows used by gdb.
-This arrangement depends on the value of `gdb-many-windows'."
+This arrangement depends on the value of option `gdb-many-windows'."
(interactive)
(switch-to-buffer gud-comint-buffer) ;Select the right window and frame.
(delete-other-windows)
(let ((map (make-sparse-keymap)))
(set-keymap-parent map compilation-minor-mode-map)
(define-key map " " 'scroll-up-command)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map "\^?" 'scroll-down-command)
(define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
(when grep-highlight-matches
(let* ((beg (match-end 0))
(end (save-excursion (goto-char beg) (line-end-position)))
- (mbeg (text-property-any beg end 'font-lock-face 'match)))
+ (mbeg (text-property-any beg end 'font-lock-face grep-match-face)))
(when mbeg
(- mbeg beg)))))
.
(when grep-highlight-matches
(let* ((beg (match-end 0))
(end (save-excursion (goto-char beg) (line-end-position)))
- (mbeg (text-property-any beg end 'font-lock-face 'match))
+ (mbeg (text-property-any beg end 'font-lock-face grep-match-face))
(mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end))))
(when mend
(- mend beg)))))))
'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 "))))))
(interactive "p")
(scroll-up arg)))
(define-key map " " 'scroll-up-command)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map [delete] 'scroll-down-command)
(define-key map "h" 'idlwave-help-find-header)
(define-key map "H" 'idlwave-help-find-first-header)
"each"))
"Regexp matching keywords optionally followed by an opening brace.")
+(defconst js--declaration-keyword-re
+ (regexp-opt '("var" "let" "const") 'words)
+ "Regular expression matching variable declaration keywords.")
+
(defconst js--indent-operator-re
(concat "[-+*/%<>=&^|?:.]\\([^-+*/]\\|$\\)\\|"
(js--regexp-opt-symbol '("in" "instanceof")))
"Regexp matching operators that affect indentation of continued expressions.")
-
(defun js--looking-at-operator-p ()
"Return non-nil if point is on a JavaScript operator, other than a comma."
(save-match-data
(list (cons 'c js-comment-lineup-func))))
(c-get-syntactic-indentation (list (cons symbol anchor)))))
+(defun js--multi-line-declaration-indentation ()
+ "Helper function for `js--proper-indentation'.
+Return the proper indentation of the current line if it belongs to a declaration
+statement spanning multiple lines; otherwise, return nil."
+ (let (at-opening-bracket)
+ (save-excursion
+ (back-to-indentation)
+ (when (not (looking-at js--declaration-keyword-re))
+ (when (looking-at js--indent-operator-re)
+ (goto-char (match-end 0)))
+ (while (and (not at-opening-bracket)
+ (not (bobp))
+ (let ((pos (point)))
+ (save-excursion
+ (js--backward-syntactic-ws)
+ (or (eq (char-before) ?,)
+ (and (not (eq (char-before) ?\;))
+ (prog2
+ (skip-chars-backward "[[:punct:]]")
+ (looking-at js--indent-operator-re)
+ (js--backward-syntactic-ws))
+ (not (eq (char-before) ?\;)))
+ (and (>= pos (point-at-bol))
+ (<= pos (point-at-eol)))))))
+ (condition-case nil
+ (backward-sexp)
+ (scan-error (setq at-opening-bracket t))))
+ (when (looking-at js--declaration-keyword-re)
+ (goto-char (match-end 0))
+ (1+ (current-column)))))))
+
(defun js--proper-indentation (parse-status)
"Return the proper indentation for the current line."
(save-excursion
(js--get-c-offset 'c (nth 8 parse-status)))
((nth 8 parse-status) 0) ; inside string
((js--ctrl-statement-indentation))
+ ((js--multi-line-declaration-indentation))
((eq (char-after) ?#) 0)
((save-excursion (js--beginning-of-macro)) 4)
((nth 1 parse-status)
;;; 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
;; calls to syntax-propertize wherever it's really needed.
(syntax-propertize (point-max)))
-;;;###autoload
-(defalias 'javascript-mode 'js-mode)
+;;;###autoload (defalias 'javascript-mode 'js-mode)
(eval-after-load 'folding
'(when (fboundp 'folding-add-to-marks-list)
"*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))))
(save-excursion
(goto-char from)
(let ((column makefile-backslash-column)
- (endmark (make-marker)))
- (move-marker endmark to)
+ (endmark (copy-marker to)))
;; Compute the smallest column number past the ends of all the lines.
- (if makefile-backslash-align
- (progn
- (if (not delete-flag)
- (while (< (point) to)
- (end-of-line)
- (if (= (preceding-char) ?\\)
- (progn (forward-char -1)
- (skip-chars-backward " \t")))
- (setq column (max column (1+ (current-column))))
- (forward-line 1)))
- ;; Adjust upward to a tab column, if that doesn't push
- ;; past the margin.
- (if (> (% column tab-width) 0)
- (let ((adjusted (* (/ (+ column tab-width -1) tab-width)
- tab-width)))
- (if (< adjusted (window-width))
- (setq column adjusted))))))
+ (when (and makefile-backslash-align (not delete-flag))
+ (while (< (point) to)
+ (end-of-line)
+ (if (= (preceding-char) ?\\)
+ (progn (forward-char -1)
+ (skip-chars-backward " \t")))
+ (setq column (max column (1+ (current-column))))
+ (forward-line 1))
+ ;; Adjust upward to a tab column, if that doesn't push
+ ;; past the margin.
+ (if (> (% column tab-width) 0)
+ (let ((adjusted (* (/ (+ column tab-width -1) tab-width)
+ tab-width)))
+ (if (< adjusted (window-width))
+ (setq column adjusted)))))
;; Don't modify blank lines at start of region.
(goto-char from)
(while (and (< (point) endmark) (eolp))
;; 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)
- (point)))
+ ;; Maybe we hit bobp, in which case we are not at EOL.
+ (if (eolp)
+ (1+ (point))
+ (point))))
(end
(save-excursion
(while (= (preceding-char) ?\\)
(save-restriction
(narrow-to-region beginning end)
(makefile-backslash-region (point-min) (point-max) t)
- ;; Backslashed newlines are marked as puncutations, so when
+ ;; Backslashed newlines are marked as punctuation, so when
;; fill-delete-newlines turns the LF into SPC, we end up with spaces
;; which back-to-indentation (called via fill-newline ->
;; fill-indent-to-left-margin -> indent-line-to) thinks are real code
(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 ()
-;;; delphi.el --- major mode for editing Delphi source (Object Pascal) in Emacs
+;;; opascal.el --- major mode for editing Object Pascal source in Emacs -*- lexical-binding: t -*-
;; Copyright (C) 1998-1999, 2001-2013 Free Software Foundation, Inc.
;;; Commentary:
-;; To enter Delphi mode when you find a Delphi source file, one must override
-;; the auto-mode-alist to associate Delphi with .pas (and .dpr and .dpk)
-;; files. Emacs, by default, will otherwise enter Pascal mode. E.g.
+;; To enter OPascal mode when you find an Object Pascal source file, one must
+;; override the auto-mode-alist to associate OPascal with .pas (and .dpr and
+;; .dpk) files. Emacs, by default, will otherwise enter Pascal mode. E.g.
;;
-;; (autoload 'delphi-mode "delphi")
-;; (setq auto-mode-alist
-;; (cons '("\\.\\(pas\\|dpr\\|dpk\\)$" . delphi-mode) auto-mode-alist))
+;; (autoload 'opascal-mode "opascal")
+;; (add-to-list 'auto-mode-alist
+;; '("\\.\\(pas\\|dpr\\|dpk\\)\\'" . opascal-mode))
-;; To get keyword, comment, and string literal coloring, be sure that font-lock
-;; is running. One can manually do M-x font-lock-mode in a Delphi buffer, or
-;; one can put in .emacs:
-;;
-;; (add-hook 'delphi-mode-hook 'turn-on-font-lock)
-
-;; If font-lock is not loaded by default, you might have to do:
-;;
-;; (autoload 'font-lock-mode "font-lock")
-;; (autoload 'turn-on-font-lock "font-lock")
-;; (setq font-lock-support-mode 'lazy-lock-mode)
-;;
-;; Lazy lock is very necessary for faster screen updates.
-
-;; For good performance, be sure to byte-compile delphi.el, e.g.
-;;
-;; M-x byte-compile-file <give the path to delphi.el when prompted>
-
-;; This will generate delphi.elc, which will be loaded instead of delphi.el
-;; when delphi-mode is autoloaded.
-
-;; When you have entered Delphi mode, you may get more info by pressing
+;; When you have entered OPascal mode, you may get more info by pressing
;; C-h m.
-;; This Delphi mode implementation is fairly tolerant of syntax errors, relying
-;; as much as possible on the indentation of the previous statement. This also
-;; makes it faster and simpler, since there is less searching for properly
-;; constructed beginnings.
+;; This OPascal mode implementation is fairly tolerant of syntax errors,
+;; relying as much as possible on the indentation of the previous statement.
+;; This also makes it faster and simpler, since there is less searching for
+;; properly constructed beginnings.
;;; Code:
-(provide 'delphi)
-
-(defgroup delphi nil
- "Major mode for editing Delphi source in Emacs."
- :version "21.1"
+(defgroup opascal nil
+ "Major mode for editing OPascal source in Emacs."
+ :version "24.4"
:group 'languages)
-(defconst delphi-debug nil
+(defconst opascal-debug nil
"True if in debug mode.")
-(defcustom delphi-search-path "."
+(define-obsolete-variable-alias
+ 'delphi-search-path 'opascal-search-path "24.4")
+(defcustom opascal-search-path "."
"Directories to search when finding external units.
It is a list of directory strings. If only a single directory,
it can be a single string instead of a list. If a directory
ends in \"...\" then that directory is recursively searched."
- :type 'string
- :group 'delphi)
+ :type 'string)
-(defcustom delphi-indent-level 3
- "Indentation of Delphi statements with respect to containing block.
+(define-obsolete-variable-alias
+ 'delphi-indent-level 'opascal-indent-level "24.4")
+(defcustom opascal-indent-level 3
+ "Indentation of OPascal statements with respect to containing block.
E.g.
begin
// This is an indent of 3.
end;"
- :type 'integer
- :group 'delphi)
+ :type 'integer)
-(defcustom delphi-compound-block-indent 0
+(define-obsolete-variable-alias
+ 'delphi-compound-block-indent 'opascal-compound-block-indent "24.4")
+(defcustom opascal-compound-block-indent 0
"Extra indentation for blocks in compound statements. E.g.
// block indent = 0 vs // block indent = 2
end; else
begin
end;"
- :type 'integer
- :group 'delphi)
+ :type 'integer)
-(defcustom delphi-case-label-indent delphi-indent-level
+(define-obsolete-variable-alias
+ 'delphi-case-label-indent 'opascal-case-label-indent "24.4")
+(defcustom opascal-case-label-indent opascal-indent-level
"Extra indentation for case statement labels. E.g.
// case indent = 0 vs // case indent = 3
else else
process_else; process_else;
end; end;"
- :type 'integer
- :group 'delphi)
+ :type 'integer)
-(defcustom delphi-verbose t ; nil
- "If true then Delphi token processing progress is reported to the user."
- :type 'boolean
- :group 'delphi)
+(define-obsolete-variable-alias 'delphi-verbose 'opascal-verbose "24.4")
+(defcustom opascal-verbose t ; nil
+ "If true then OPascal token processing progress is reported to the user."
+ :type 'boolean)
-(defcustom delphi-tab-always-indents t
- "Non-nil means TAB in Delphi mode should always reindent the current line,
+(define-obsolete-variable-alias
+ 'delphi-tab-always-indents 'opascal-tab-always-indents "24.4")
+(defcustom opascal-tab-always-indents tab-always-indent
+ "Non-nil means TAB in OPascal mode should always reindent the current line,
regardless of where in the line point is when the TAB command is used."
- :type 'boolean
- :group 'delphi)
-
-(defcustom delphi-newline-always-indents t
- "Non-nil means NEWLINE in Delphi mode should always reindent the current
-line, insert a blank line and move to the default indent column of the blank
-line. If nil, then no indentation occurs, and NEWLINE does the usual
-behavior. This is useful when one needs to do customized indentation that
-differs from the default."
- :type 'boolean
- :group 'delphi)
-
-(defcustom delphi-comment-face 'font-lock-comment-face
- "Face used to color Delphi comments."
- :type 'face
- :group 'delphi)
-
-(defcustom delphi-string-face 'font-lock-string-face
- "Face used to color Delphi strings."
- :type 'face
- :group 'delphi)
-
-(defcustom delphi-keyword-face 'font-lock-keyword-face
- "Face used to color Delphi keywords."
- :type 'face
- :group 'delphi)
-
-(defcustom delphi-other-face nil
+ :type 'boolean)
+
+(define-obsolete-variable-alias
+ 'delphi-comment-face 'opascal-comment-face "24.4")
+(defcustom opascal-comment-face 'font-lock-comment-face
+ "Face used to color OPascal comments."
+ :type 'face)
+
+(define-obsolete-variable-alias
+ 'delphi-string-face 'opascal-string-face "24.4")
+(defcustom opascal-string-face 'font-lock-string-face
+ "Face used to color OPascal strings."
+ :type 'face)
+
+(define-obsolete-variable-alias
+ 'delphi-keyword-face 'opascal-keyword-face "24.4")
+(defcustom opascal-keyword-face 'font-lock-keyword-face
+ "Face used to color OPascal keywords."
+ :type 'face)
+
+(define-obsolete-variable-alias 'delphi-other-face 'opascal-other-face "24.4")
+(defcustom opascal-other-face nil
"Face used to color everything else."
- :type '(choice (const :tag "None" nil) face)
- :group 'delphi)
+ :type '(choice (const :tag "None" nil) face))
-(defconst delphi-directives
+(defconst opascal-directives
'(absolute abstract assembler automated cdecl default dispid dynamic
export external far forward index inline message name near nodefault
overload override pascal private protected public published read readonly
register reintroduce resident resourcestring safecall stdcall stored
virtual write writeonly)
- "Delphi4 directives.")
+ "OPascal4 directives.")
-(defconst delphi-keywords
+(defconst opascal-keywords
(append
'(;; Keywords.
and array as asm at begin case class const constructor contains
break exit)
;; We want directives to look like keywords.
- delphi-directives)
- "Delphi4 keywords.")
+ opascal-directives)
+ "OPascal4 keywords.")
-(defconst delphi-previous-terminators `(semicolon comma)
+(defconst opascal-previous-terminators `(semicolon comma)
"Expression/statement terminators that denote a previous expression.")
-(defconst delphi-comments
+(defconst opascal-comments
'(comment-single-line comment-multi-line-1 comment-multi-line-2)
"Tokens that represent comments.")
-(defconst delphi-strings
+(defconst opascal-strings
'(string double-quoted-string)
"Tokens that represent string literals.")
-(defconst delphi-whitespace `(space newline ,@delphi-comments)
+(defconst opascal-whitespace `(space newline ,@opascal-comments)
"Tokens that are considered whitespace.")
-(defconst delphi-routine-statements
+(defconst opascal-routine-statements
'(procedure function constructor destructor property)
"Marks the start of a routine, or routine-ish looking expression.")
-(defconst delphi-body-expr-statements '(if while for on)
+(defconst opascal-body-expr-statements '(if while for on)
"Statements that have either a single statement or a block as a body and also
are followed by an expression.")
-(defconst delphi-expr-statements `(case ,@delphi-body-expr-statements)
+(defconst opascal-expr-statements `(case ,@opascal-body-expr-statements)
"Expression statements contain expressions after their keyword.")
-(defconst delphi-body-statements `(else ,@delphi-body-expr-statements)
+(defconst opascal-body-statements `(else ,@opascal-body-expr-statements)
"Statements that have either a single statement or a block as a body.")
-(defconst delphi-expr-delimiters '(then do of)
+(defconst opascal-expr-delimiters '(then do of)
"Expression delimiter tokens.")
-(defconst delphi-binary-ops
+(defconst opascal-binary-ops
'(plus minus equals not-equals times divides div mod and or xor)
- "Delphi binary operations.")
+ "OPascal binary operations.")
-(defconst delphi-visibilities '(public private protected published automated)
+(defconst opascal-visibilities '(public private protected published automated)
"Class visibilities.")
-(defconst delphi-block-statements
+(defconst opascal-block-statements
'(begin try case repeat initialization finalization asm)
"Statements that contain multiple substatements.")
-(defconst delphi-mid-block-statements
- `(except finally ,@delphi-visibilities)
+(defconst opascal-mid-block-statements
+ `(except finally ,@opascal-visibilities)
"Statements that mark mid sections of the enclosing block.")
-(defconst delphi-end-block-statements `(end until)
+(defconst opascal-end-block-statements `(end until)
"Statements that end block sections.")
-(defconst delphi-match-block-statements
- `(,@delphi-end-block-statements ,@delphi-mid-block-statements)
+(defconst opascal-match-block-statements
+ `(,@opascal-end-block-statements ,@opascal-mid-block-statements)
"Statements that match the indentation of the parent block.")
-(defconst delphi-decl-sections '(type const var label resourcestring)
+(defconst opascal-decl-sections '(type const var label resourcestring)
"Denotes the start of a declaration section.")
-(defconst delphi-interface-types '(dispinterface interface)
+(defconst opascal-interface-types '(dispinterface interface)
"Interface types.")
-(defconst delphi-class-types '(class object)
+(defconst opascal-class-types '(class object)
"Class types.")
-(defconst delphi-composite-types
- `(,@delphi-class-types ,@delphi-interface-types record)
+(defconst opascal-composite-types
+ `(,@opascal-class-types ,@opascal-interface-types record)
"Types that contain declarations within them.")
-(defconst delphi-unit-sections
+(defconst opascal-unit-sections
'(interface implementation program library package)
"Unit sections within which the indent is 0.")
-(defconst delphi-use-clauses `(uses requires exports contains)
+(defconst opascal-use-clauses `(uses requires exports contains)
"Statements that refer to foreign symbols.")
-(defconst delphi-unit-statements
- `(,@delphi-use-clauses ,@delphi-unit-sections initialization finalization)
+(defconst opascal-unit-statements
+ `(,@opascal-use-clauses ,@opascal-unit-sections initialization finalization)
"Statements indented at level 0.")
-(defconst delphi-decl-delimiters
- `(,@delphi-decl-sections ,@delphi-unit-statements
- ,@delphi-routine-statements)
+(defconst opascal-decl-delimiters
+ `(,@opascal-decl-sections ,@opascal-unit-statements
+ ,@opascal-routine-statements)
"Statements that a declaration statement should align with.")
-(defconst delphi-decl-matchers
- `(begin ,@delphi-decl-sections)
+(defconst opascal-decl-matchers
+ `(begin ,@opascal-decl-sections)
"Statements that should match to declaration statement indentation.")
-(defconst delphi-enclosing-statements
- `(,@delphi-block-statements ,@delphi-mid-block-statements
- ,@delphi-decl-sections ,@delphi-use-clauses ,@delphi-routine-statements)
+(defconst opascal-enclosing-statements
+ `(,@opascal-block-statements ,@opascal-mid-block-statements
+ ,@opascal-decl-sections ,@opascal-use-clauses ,@opascal-routine-statements)
"Delimits an enclosing statement.")
-(defconst delphi-previous-statements
- `(,@delphi-unit-statements ,@delphi-routine-statements)
+(defconst opascal-previous-statements
+ `(,@opascal-unit-statements ,@opascal-routine-statements)
"Delimits a previous statement.")
-(defconst delphi-previous-enclosing-statements
- `(,@delphi-block-statements ,@delphi-mid-block-statements
- ,@delphi-decl-sections)
+(defconst opascal-previous-enclosing-statements
+ `(,@opascal-block-statements ,@opascal-mid-block-statements
+ ,@opascal-decl-sections)
"Delimits a previous enclosing statement.")
-(defconst delphi-begin-enclosing-tokens
- `(,@delphi-block-statements ,@delphi-mid-block-statements)
+(defconst opascal-begin-enclosing-tokens
+ `(,@opascal-block-statements ,@opascal-mid-block-statements)
"Tokens that a begin token indents from.")
-(defconst delphi-begin-previous-tokens
- `(,@delphi-decl-sections ,@delphi-routine-statements)
+(defconst opascal-begin-previous-tokens
+ `(,@opascal-decl-sections ,@opascal-routine-statements)
"Tokens that a begin token aligns with, but only if not part of a nested
routine.")
-(defconst delphi-space-chars "\000-\011\013- ") ; all except \n
-(defconst delphi-non-space-chars (concat "^" delphi-space-chars))
-(defconst delphi-spaces-re (concat "[" delphi-space-chars "]*"))
-(defconst delphi-leading-spaces-re (concat "^" delphi-spaces-re))
-(defconst delphi-word-chars "a-zA-Z0-9_")
-
-(defmacro delphi-save-match-data (&rest forms)
- ;; Executes the forms such that the current match data is preserved, so as
- ;; not to disturb any existing search results.
- `(let ((data (match-data)))
- (unwind-protect
- (progn ,@forms)
- (set-match-data data))))
-
-(defmacro delphi-save-excursion (&rest forms)
+(defconst opascal-space-chars "\000-\011\013- ") ; all except \n
+(defconst opascal-non-space-chars (concat "^" opascal-space-chars))
+(defconst opascal-spaces-re (concat "[" opascal-space-chars "]*"))
+(defconst opascal-leading-spaces-re (concat "^" opascal-spaces-re))
+(defconst opascal-word-chars "a-zA-Z0-9_")
+
+(defmacro opascal-save-excursion (&rest forms)
;; Executes the forms such that any movements have no effect, including
;; searches.
`(save-excursion
- (delphi-save-match-data
+ (save-match-data
(let ((inhibit-point-motion-hooks t)
(deactivate-mark nil))
(progn ,@forms)))))
-(defmacro delphi-save-state (&rest forms)
+(defmacro opascal-save-state (&rest forms)
;; Executes the forms such that any buffer modifications do not have any side
;; effects beyond the buffer's actual content changes.
- `(let ((delphi-ignore-changes t)
- (old-supersession-threat
- (symbol-function 'ask-user-about-supersession-threat))
- (buffer-read-only nil)
- (inhibit-read-only t)
- (buffer-undo-list t)
- (before-change-functions nil)
- (after-change-functions nil)
- (modified (buffer-modified-p)))
- ;; Disable any queries about editing obsolete files.
- (fset 'ask-user-about-supersession-threat (lambda (_fn)))
- (unwind-protect
- (progn ,@forms)
- (set-buffer-modified-p modified)
- (fset 'ask-user-about-supersession-threat old-supersession-threat))))
-
-(defsubst delphi-is (element in-set)
+ `(let ((opascal--ignore-changes t))
+ (with-silent-modifications
+ ,@forms)))
+
+(defsubst opascal-is (element in-set)
;; If the element is in the set, the element cdr is returned, otherwise nil.
(memq element in-set))
-(defun delphi-string-of (start end)
+(defun opascal-string-of (start end)
;; Returns the buffer string from start to end.
(buffer-substring-no-properties start end))
-(defun delphi-looking-at-string (p s)
+(defun opascal-looking-at-string (p s)
;; True if point p marks the start of string s. s is not a regular
;; expression.
(let ((limit (+ p (length s))))
(and (<= limit (point-max))
- (string= s (delphi-string-of p limit)))))
+ (string= s (opascal-string-of p limit)))))
-(defun delphi-token-of (kind start end)
+(defun opascal-token-of (kind start end)
;; Constructs a token from a kind symbol and its start/end points.
`[,kind ,start ,end])
-(defsubst delphi-token-kind (token)
+(defsubst opascal-token-kind (token)
;; Returns the kind symbol of the token.
(if token (aref token 0) nil))
-(defun delphi-set-token-kind (token to-kind)
+(defun opascal-set-token-kind (token to-kind)
;; Sets the kind symbol of the token.
(if token (aset token 0 to-kind)))
-(defsubst delphi-token-start (token)
+(defsubst opascal-token-start (token)
;; Returns the start point of the token.
(if token (aref token 1) (point-min)))
-(defsubst delphi-token-end (token)
+(defsubst opascal-token-end (token)
;; Returns the end point of the token.
(if token (aref token 2) (point-min)))
-(defun delphi-set-token-start (token start)
+(defun opascal-set-token-start (token start)
;; Sets the start point of the token.
(if token (aset token 1 start)))
-(defun delphi-set-token-end (token end)
+(defun opascal-set-token-end (token end)
;; Sets the end point of the token.
(if token (aset token 2 end)))
-(defun delphi-token-string (token)
+(defun opascal-token-string (token)
;; Returns the string image of the token.
(if token
- (delphi-string-of (delphi-token-start token) (delphi-token-end token))
+ (opascal-string-of (opascal-token-start token) (opascal-token-end token))
""))
-(defun delphi-in-token (p token)
+(defun opascal-in-token (p token)
;; Returns true if the point p is within the token's start/end points.
- (and (<= (delphi-token-start token) p) (< p (delphi-token-end token))))
+ (and (<= (opascal-token-start token) p) (< p (opascal-token-end token))))
-(defun delphi-column-of (p)
+(defun opascal-column-of (p)
;; Returns the column of the point p.
(save-excursion (goto-char p) (current-column)))
-(defun delphi-face-of (token-kind)
+(defun opascal-face-of (token-kind)
;; Returns the face property appropriate for the token kind.
- (cond ((delphi-is token-kind delphi-comments) delphi-comment-face)
- ((delphi-is token-kind delphi-strings) delphi-string-face)
- ((delphi-is token-kind delphi-keywords) delphi-keyword-face)
- (delphi-other-face)))
+ (cond ((opascal-is token-kind opascal-comments) opascal-comment-face)
+ ((opascal-is token-kind opascal-strings) opascal-string-face)
+ ((opascal-is token-kind opascal-keywords) opascal-keyword-face)
+ (opascal-other-face)))
-(defvar delphi-progress-last-reported-point nil
+(defvar opascal-progress-last-reported-point nil
"The last point at which progress was reported.")
-(defconst delphi-parsing-progress-step 16384
+(defconst opascal-parsing-progress-step 16384
"Number of chars to process before the next parsing progress report.")
-(defconst delphi-scanning-progress-step 2048
+(defconst opascal-scanning-progress-step 2048
"Number of chars to process before the next scanning progress report.")
-(defconst delphi-fontifying-progress-step delphi-scanning-progress-step
+(defconst opascal-fontifying-progress-step opascal-scanning-progress-step
"Number of chars to process before the next fontification progress report.")
-(defun delphi-progress-start ()
+(defun opascal-progress-start ()
;; Initializes progress reporting.
- (setq delphi-progress-last-reported-point nil))
+ (setq opascal-progress-last-reported-point nil))
-(defun delphi-progress-done (&rest msgs)
+(defun opascal-progress-done (&rest msgs)
;; Finalizes progress reporting.
- (setq delphi-progress-last-reported-point nil)
- (when delphi-verbose
+ (setq opascal-progress-last-reported-point nil)
+ (when opascal-verbose
(if (null msgs)
(message "")
(apply #'message msgs))))
-(defun delphi-step-progress (p desc step-size)
+(defun opascal-step-progress (p desc step-size)
;; If enough distance has elapsed since the last reported point, then report
;; the current progress to the user.
- (cond ((null delphi-progress-last-reported-point)
+ (cond ((null opascal-progress-last-reported-point)
;; This is the first progress step.
- (setq delphi-progress-last-reported-point p))
+ (setq opascal-progress-last-reported-point p))
- ((and delphi-verbose
- (>= (abs (- p delphi-progress-last-reported-point)) step-size))
+ ((and opascal-verbose
+ (>= (abs (- p opascal-progress-last-reported-point)) step-size))
;; Report the percentage complete.
- (setq delphi-progress-last-reported-point p)
+ (setq opascal-progress-last-reported-point p)
(message "%s %s ... %d%%"
desc (buffer-name) (/ (* 100 p) (point-max))))))
-(defun delphi-next-line-start (&optional from-point)
+(defun opascal-next-line-start (&optional from-point)
;; Returns the first point of the next line.
(let ((curr-point (point))
(next nil))
(goto-char curr-point)
next))
-(defvar delphi-ignore-changes t
- "Internal flag to control if the Delphi mode responds to buffer changes.
-Defaults to t in case the `delphi-after-change' function is called on a
-non-Delphi buffer. Set to nil in a Delphi buffer. To override, just do:
- (let ((delphi-ignore-changes t)) ...)")
+(defvar opascal--ignore-changes t
+ "Internal flag to control if the OPascal mode responds to buffer changes.
+Defaults to t in case the `opascal-after-change' function is called on a
+non-OPascal buffer. Set to nil in OPascal buffers. To override, just do:
+ (let ((opascal--ignore-changes t)) ...)")
-(defun delphi-set-text-properties (from to properties)
+(defun opascal-set-text-properties (from to properties)
;; Like `set-text-properties', except we do not consider this to be a buffer
;; modification.
- (delphi-save-state
+ (opascal-save-state
(set-text-properties from to properties)))
-(defun delphi-literal-kind (p)
+(defun opascal-literal-kind (p)
;; Returns the literal kind the point p is in (or nil if not in a literal).
(if (and (<= (point-min) p) (<= p (point-max)))
(get-text-property p 'token)))
-(defun delphi-literal-start-pattern (literal-kind)
+(defun opascal-literal-start-pattern (literal-kind)
;; Returns the start pattern of the literal kind.
(cdr (assoc literal-kind
'((comment-single-line . "//")
(string . "'")
(double-quoted-string . "\"")))))
-(defun delphi-literal-end-pattern (literal-kind)
+(defun opascal-literal-end-pattern (literal-kind)
;; Returns the end pattern of the literal kind.
(cdr (assoc literal-kind
'((comment-single-line . "\n")
(string . "'")
(double-quoted-string . "\"")))))
-(defun delphi-literal-stop-pattern (literal-kind)
+(defun opascal-literal-stop-pattern (literal-kind)
;; Returns the pattern that delimits end of the search for the literal kind.
;; These are regular expressions.
(cdr (assoc literal-kind
(string . "['\n]")
(double-quoted-string . "[\"\n]")))))
-(defun delphi-is-literal-start (p)
+(defun opascal-is-literal-start (p)
;; True if the point p is at the start point of a (completed) literal.
- (let* ((kind (delphi-literal-kind p))
- (pattern (delphi-literal-start-pattern kind)))
+ (let* ((kind (opascal-literal-kind p))
+ (pattern (opascal-literal-start-pattern kind)))
(or (null kind) ; Non-literals are considered as start points.
- (delphi-looking-at-string p pattern))))
+ (opascal-looking-at-string p pattern))))
-(defun delphi-is-literal-end (p)
+(defun opascal-is-literal-end (p)
;; True if the point p is at the end point of a (completed) literal.
- (let* ((kind (delphi-literal-kind (1- p)))
- (pattern (delphi-literal-end-pattern kind)))
+ (let* ((kind (opascal-literal-kind (1- p)))
+ (pattern (opascal-literal-end-pattern kind)))
(or (null kind) ; Non-literals are considered as end points.
- (and (delphi-looking-at-string (- p (length pattern)) pattern)
- (or (not (delphi-is kind delphi-strings))
+ (and (opascal-looking-at-string (- p (length pattern)) pattern)
+ (or (not (opascal-is kind opascal-strings))
;; Special case: string delimiters are start/end ambiguous.
;; We have an end only if there is some string content (at
;; least a starting delimiter).
- (not (delphi-is-literal-end (1- p)))))
+ (not (opascal-is-literal-end (1- p)))))
;; Special case: strings cannot span lines.
- (and (delphi-is kind delphi-strings) (eq ?\n (char-after (1- p)))))))
+ (and (opascal-is kind opascal-strings) (eq ?\n (char-after (1- p)))))))
-(defun delphi-is-stable-literal (p)
+(defun opascal-is-stable-literal (p)
;; True if the point p marks a stable point. That is, a point outside of a
;; literal region, inside of a literal region, or adjacent to completed
;; literal regions.
- (let ((at-start (delphi-is-literal-start p))
- (at-end (delphi-is-literal-end p)))
+ (let ((at-start (opascal-is-literal-start p))
+ (at-end (opascal-is-literal-end p)))
(or (>= p (point-max))
(and at-start at-end)
(and (not at-start) (not at-end)
- (eq (delphi-literal-kind (1- p)) (delphi-literal-kind p))))))
+ (eq (opascal-literal-kind (1- p)) (opascal-literal-kind p))))))
-(defun delphi-complete-literal (literal-kind limit)
+(defun opascal-complete-literal (literal-kind limit)
;; Continues the search for a literal's true end point and returns the
;; point past the end pattern (if found) or the limit (if not found).
- (let ((pattern (delphi-literal-stop-pattern literal-kind)))
+ (let ((pattern (opascal-literal-stop-pattern literal-kind)))
(if (not (stringp pattern))
(error "Invalid literal kind %S" literal-kind)
;; Search up to the limit.
(re-search-forward pattern limit 'goto-limit-on-fail)
(point))))
-(defun delphi-literal-text-properties (kind)
+(defun opascal-literal-text-properties (kind)
;; Creates a list of text properties for the literal kind.
(if (and (boundp 'font-lock-mode)
font-lock-mode)
- (list 'token kind 'face (delphi-face-of kind) 'lazy-lock t)
+ (list 'token kind 'face (opascal-face-of kind) 'lazy-lock t)
(list 'token kind)))
-(defun delphi-parse-next-literal (limit)
+(defun opascal-parse-next-literal (limit)
;; Searches for the next literal region (i.e. comment or string) and sets the
;; the point to its end (or the limit, if not found). The literal region is
;; marked as such with a text property, to speed up tokenizing during face
;; coloring and indentation scanning.
(let ((search-start (point)))
- (cond ((not (delphi-is-literal-end search-start))
+ (cond ((not (opascal-is-literal-end search-start))
;; We are completing an incomplete literal.
- (let ((kind (delphi-literal-kind (1- search-start))))
- (delphi-complete-literal kind limit)
- (delphi-set-text-properties
- search-start (point) (delphi-literal-text-properties kind))))
+ (let ((kind (opascal-literal-kind (1- search-start))))
+ (opascal-complete-literal kind limit)
+ (opascal-set-text-properties
+ search-start (point) (opascal-literal-text-properties kind))))
((re-search-forward
"\\(//\\)\\|\\({\\)\\|\\((\\*\\)\\|\\('\\)\\|\\(\"\\)"
((match-beginning 4) 'string)
((match-beginning 5) 'double-quoted-string)))
(start (match-beginning 0)))
- (delphi-set-text-properties search-start start nil)
- (delphi-complete-literal kind limit)
- (delphi-set-text-properties
- start (point) (delphi-literal-text-properties kind))))
+ (opascal-set-text-properties search-start start nil)
+ (opascal-complete-literal kind limit)
+ (opascal-set-text-properties
+ start (point) (opascal-literal-text-properties kind))))
;; Nothing found. Mark it as a non-literal.
- ((delphi-set-text-properties search-start limit nil)))
- (delphi-step-progress (point) "Parsing" delphi-parsing-progress-step)))
+ ((opascal-set-text-properties search-start limit nil)))
+ (opascal-step-progress (point) "Parsing" opascal-parsing-progress-step)))
-(defun delphi-literal-token-at (p)
+(defun opascal-literal-token-at (p)
;; Returns the literal token surrounding the point p, or nil if none.
- (let ((kind (delphi-literal-kind p)))
+ (let ((kind (opascal-literal-kind p)))
(when kind
(let ((start (previous-single-property-change (1+ p) 'token))
(end (next-single-property-change p 'token)))
- (delphi-token-of kind (or start (point-min)) (or end (point-max)))))))
+ (opascal-token-of kind (or start (point-min)) (or end (point-max)))))))
-(defun delphi-point-token-at (p kind)
+(defun opascal-point-token-at (p kind)
;; Returns the single character token at the point p.
- (delphi-token-of kind p (1+ p)))
+ (opascal-token-of kind p (1+ p)))
-(defsubst delphi-char-token-at (p char kind)
+(defsubst opascal-char-token-at (p char kind)
;; Returns the token at the point p that describes the specified character.
;; If not actually over such a character, nil is returned.
(when (eq char (char-after p))
- (delphi-token-of kind p (1+ p))))
+ (opascal-token-of kind p (1+ p))))
-(defun delphi-charset-token-at (p charset kind)
+(defun opascal-charset-token-at (p charset kind)
;; Returns the token surrounding point p that contains only members of the
;; character set.
(let ((currp (point))
(setq end (point))
(goto-char (1+ p))
(skip-chars-backward charset)
- (setq token (delphi-token-of kind (point) end)))
+ (setq token (opascal-token-of kind (point) end)))
(goto-char currp)
token))
-(defun delphi-space-token-at (p)
+(defun opascal-space-token-at (p)
;; If point p is surrounded by space characters, then return the token of the
;; contiguous spaces.
- (delphi-charset-token-at p delphi-space-chars 'space))
+ (opascal-charset-token-at p opascal-space-chars 'space))
-(defun delphi-word-token-at (p)
+(defun opascal-word-token-at (p)
;; If point p is over a word (i.e. identifier characters), then return a word
;; token. If the word is actually a keyword, then return the keyword token.
- (let ((word (delphi-charset-token-at p delphi-word-chars 'word)))
+ (let ((word (opascal-charset-token-at p opascal-word-chars 'word)))
(when word
- (let* ((word-image (downcase (delphi-token-string word)))
+ (let* ((word-image (downcase (opascal-token-string word)))
(keyword (intern-soft word-image)))
(when (and (or keyword (string= "nil" word-image))
- (delphi-is keyword delphi-keywords))
- (delphi-set-token-kind word keyword))
+ (opascal-is keyword opascal-keywords))
+ (opascal-set-token-kind word keyword))
word))))
-(defun delphi-explicit-token-at (p token-string kind)
+(defun opascal-explicit-token-at (p token-string kind)
;; If point p is anywhere in the token string then returns the resulting
;; token.
- (let ((token (delphi-charset-token-at p token-string kind)))
- (when (and token (string= token-string (delphi-token-string token)))
+ (let ((token (opascal-charset-token-at p token-string kind)))
+ (when (and token (string= token-string (opascal-token-string token)))
token)))
-(defun delphi-token-at (p)
+(defun opascal-token-at (p)
;; Returns the token from parsing text at point p.
(when (and (<= (point-min) p) (<= p (point-max)))
- (cond ((delphi-char-token-at p ?\n 'newline))
+ (cond ((opascal-char-token-at p ?\n 'newline))
- ((delphi-literal-token-at p))
+ ((opascal-literal-token-at p))
- ((delphi-space-token-at p))
+ ((opascal-space-token-at p))
- ((delphi-word-token-at p))
+ ((opascal-word-token-at p))
- ((delphi-char-token-at p ?\( 'open-group))
- ((delphi-char-token-at p ?\) 'close-group))
- ((delphi-char-token-at p ?\[ 'open-group))
- ((delphi-char-token-at p ?\] 'close-group))
- ((delphi-char-token-at p ?\; 'semicolon))
- ((delphi-char-token-at p ?. 'dot))
- ((delphi-char-token-at p ?, 'comma))
- ((delphi-char-token-at p ?= 'equals))
- ((delphi-char-token-at p ?+ 'plus))
- ((delphi-char-token-at p ?- 'minus))
- ((delphi-char-token-at p ?* 'times))
- ((delphi-char-token-at p ?/ 'divides))
- ((delphi-char-token-at p ?: 'colon))
+ ((opascal-char-token-at p ?\( 'open-group))
+ ((opascal-char-token-at p ?\) 'close-group))
+ ((opascal-char-token-at p ?\[ 'open-group))
+ ((opascal-char-token-at p ?\] 'close-group))
+ ((opascal-char-token-at p ?\; 'semicolon))
+ ((opascal-char-token-at p ?. 'dot))
+ ((opascal-char-token-at p ?, 'comma))
+ ((opascal-char-token-at p ?= 'equals))
+ ((opascal-char-token-at p ?+ 'plus))
+ ((opascal-char-token-at p ?- 'minus))
+ ((opascal-char-token-at p ?* 'times))
+ ((opascal-char-token-at p ?/ 'divides))
+ ((opascal-char-token-at p ?: 'colon))
- ((delphi-explicit-token-at p "<>" 'not-equals))
+ ((opascal-explicit-token-at p "<>" 'not-equals))
- ((delphi-point-token-at p 'punctuation)))))
+ ((opascal-point-token-at p 'punctuation)))))
-(defun delphi-current-token ()
- ;; Returns the delphi source token under the current point.
- (delphi-token-at (point)))
+(defun opascal-current-token ()
+ ;; Returns the opascal source token under the current point.
+ (opascal-token-at (point)))
-(defun delphi-next-token (token)
+(defun opascal-next-token (token)
;; Returns the token after the specified token.
(when token
- (let ((next (delphi-token-at (delphi-token-end token))))
+ (let ((next (opascal-token-at (opascal-token-end token))))
(if next
- (delphi-step-progress (delphi-token-start next) "Scanning"
- delphi-scanning-progress-step))
+ (opascal-step-progress (opascal-token-start next) "Scanning"
+ opascal-scanning-progress-step))
next)))
-(defun delphi-previous-token (token)
+(defun opascal-previous-token (token)
;; Returns the token before the specified token.
(when token
- (let ((previous (delphi-token-at (1- (delphi-token-start token)))))
+ (let ((previous (opascal-token-at (1- (opascal-token-start token)))))
(if previous
- (delphi-step-progress (delphi-token-start previous) "Scanning"
- delphi-scanning-progress-step))
+ (opascal-step-progress (opascal-token-start previous) "Scanning"
+ opascal-scanning-progress-step))
previous)))
-(defun delphi-next-visible-token (token)
+(defun opascal-next-visible-token (token)
;; Returns the first non-space token after the specified token.
(let (next-token)
(while (progn
- (setq next-token (delphi-next-token token))
- (delphi-is (delphi-token-kind next-token) '(space newline))))
+ (setq next-token (opascal-next-token token))
+ (opascal-is (opascal-token-kind next-token) '(space newline))))
next-token))
-(defun delphi-parse-region (from to)
+(defun opascal-parse-region (from to)
;; Parses the literal tokens in the region. The point is set to "to".
(save-restriction
(widen)
(goto-char from)
(while (< (point) to)
- (delphi-parse-next-literal to))))
+ (opascal-parse-next-literal to))))
-(defun delphi-parse-region-until-stable (from to)
+(defun opascal-parse-region-until-stable (from to)
;; Parses at least the literal tokens in the region. After that, parsing
;; continues as long as obsolete literal regions are encountered. The point
;; is set to the encountered stable point.
(save-restriction
(widen)
- (delphi-parse-region from to)
- (while (not (delphi-is-stable-literal (point)))
- (delphi-parse-next-literal (point-max)))))
-
-(defun delphi-fontify-region (from to &optional verbose)
- ;; Colors the text in the region according to Delphi rules.
- (delphi-save-excursion
- (delphi-save-state
+ (opascal-parse-region from to)
+ (while (not (opascal-is-stable-literal (point)))
+ (opascal-parse-next-literal (point-max)))))
+
+(defun opascal-fontify-region (from to &optional verbose)
+ ;; Colors the text in the region according to OPascal rules.
+ (opascal-save-excursion
+ (opascal-save-state
(let ((p from)
- (delphi-verbose verbose)
+ (opascal-verbose verbose)
(token nil))
- (delphi-progress-start)
+ (opascal-progress-start)
(while (< p to)
;; Color the token and move past it.
- (setq token (delphi-token-at p))
+ (setq token (opascal-token-at p))
(add-text-properties
- (delphi-token-start token) (delphi-token-end token)
- (list 'face (delphi-face-of (delphi-token-kind token)) 'lazy-lock t))
- (setq p (delphi-token-end token))
- (delphi-step-progress p "Fontifying" delphi-fontifying-progress-step))
- (delphi-progress-done)))))
+ (opascal-token-start token) (opascal-token-end token)
+ (list 'face (opascal-face-of (opascal-token-kind token)) 'lazy-lock t))
+ (setq p (opascal-token-end token))
+ (opascal-step-progress p "Fontifying" opascal-fontifying-progress-step))
+ (opascal-progress-done)))))
-(defun delphi-after-change (change-start change-end _old-length)
+(defun opascal-after-change (change-start change-end _old-length)
;; Called when the buffer has changed. Reparses the changed region.
- (unless delphi-ignore-changes
- (let ((delphi-ignore-changes t)) ; Prevent recursive calls.
- (delphi-save-excursion
- (delphi-progress-start)
+ (unless opascal--ignore-changes
+ (let ((opascal--ignore-changes t)) ; Prevent recursive calls.
+ (opascal-save-excursion
+ (opascal-progress-start)
;; Reparse at least from the token previous to the change to the end of
;; line after the change.
- (delphi-parse-region-until-stable
- (delphi-token-start (delphi-token-at (1- change-start)))
+ (opascal-parse-region-until-stable
+ (opascal-token-start (opascal-token-at (1- change-start)))
(progn (goto-char change-end) (end-of-line) (point)))
- (delphi-progress-done)))))
+ (opascal-progress-done)))))
-(defun delphi-group-start (from-token)
+(defun opascal-group-start (from-token)
;; Returns the token that denotes the start of the ()/[] group.
- (let ((token (delphi-previous-token from-token))
+ (let ((token (opascal-previous-token from-token))
(token-kind nil))
(catch 'done
(while token
- (setq token-kind (delphi-token-kind token))
+ (setq token-kind (opascal-token-kind token))
(cond
;; Skip over nested groups.
- ((eq 'close-group token-kind) (setq token (delphi-group-start token)))
+ ((eq 'close-group token-kind) (setq token (opascal-group-start token)))
((eq 'open-group token-kind) (throw 'done token)))
- (setq token (delphi-previous-token token)))
+ (setq token (opascal-previous-token token)))
;; Start not found.
nil)))
-(defun delphi-group-end (from-token)
+(defun opascal-group-end (from-token)
;; Returns the token that denotes the end of the ()/[] group.
- (let ((token (delphi-next-token from-token))
+ (let ((token (opascal-next-token from-token))
(token-kind nil))
(catch 'done
(while token
- (setq token-kind (delphi-token-kind token))
+ (setq token-kind (opascal-token-kind token))
(cond
;; Skip over nested groups.
- ((eq 'open-group token-kind) (setq token (delphi-group-end token)))
+ ((eq 'open-group token-kind) (setq token (opascal-group-end token)))
((eq 'close-group token-kind) (throw 'done token)))
- (setq token (delphi-next-token token)))
+ (setq token (opascal-next-token token)))
;; end not found.
nil)))
-(defun delphi-indent-of (token &optional offset)
+(defun opascal-indent-of (token &optional offset)
;; Returns the start column of the token, plus any offset.
- (let ((indent (+ (delphi-column-of (delphi-token-start token))
+ (let ((indent (+ (opascal-column-of (opascal-token-start token))
(if offset offset 0))))
- (when delphi-debug
- (delphi-debug-log
+ (when opascal-debug
+ (opascal-debug-log
(concat "\n Indent of: %S %S"
"\n column: %d indent: %d offset: %d")
- token (delphi-token-string token)
- (delphi-column-of (delphi-token-start token))
+ token (opascal-token-string token)
+ (opascal-column-of (opascal-token-start token))
indent (if offset offset 0)))
indent))
-(defun delphi-line-indent-of (from-token &optional offset &rest terminators)
+(defun opascal-line-indent-of (from-token &optional offset &rest terminators)
;; Returns the column of first non-space character on the token's line, plus
;; any offset. We also stop if one of the terminators or an open ( or [ is
;; encountered.
- (let ((token (delphi-previous-token from-token))
+ (let ((token (opascal-previous-token from-token))
(last-token from-token)
(kind nil))
(catch 'done
(while token
- (setq kind (delphi-token-kind token))
+ (setq kind (opascal-token-kind token))
(cond
;; Skip over ()/[] groups.
- ((eq 'close-group kind) (setq token (delphi-group-start token)))
+ ((eq 'close-group kind) (setq token (opascal-group-start token)))
;; Stop at the beginning of the line or an open group.
- ((delphi-is kind '(newline open-group)) (throw 'done nil))
+ ((opascal-is kind '(newline open-group)) (throw 'done nil))
;; Stop at one of the specified terminators.
- ((delphi-is kind terminators) (throw 'done nil)))
- (unless (delphi-is kind delphi-whitespace) (setq last-token token))
- (setq token (delphi-previous-token token))))
- (delphi-indent-of last-token offset)))
+ ((opascal-is kind terminators) (throw 'done nil)))
+ (unless (opascal-is kind opascal-whitespace) (setq last-token token))
+ (setq token (opascal-previous-token token))))
+ (opascal-indent-of last-token offset)))
-(defun delphi-stmt-line-indent-of (from-token &optional offset)
- ;; Like `delphi-line-indent-of' except is also stops on a use clause, and
+(defun opascal-stmt-line-indent-of (from-token &optional offset)
+ ;; Like `opascal-line-indent-of' except is also stops on a use clause, and
;; colons that precede statements (i.e. case labels).
- (let ((token (delphi-previous-token from-token))
+ (let ((token (opascal-previous-token from-token))
(last-token from-token)
(kind nil))
(catch 'done
(while token
- (setq kind (delphi-token-kind token))
+ (setq kind (opascal-token-kind token))
(cond
((and (eq 'colon kind)
- (delphi-is (delphi-token-kind last-token)
- `(,@delphi-block-statements
- ,@delphi-expr-statements)))
+ (opascal-is (opascal-token-kind last-token)
+ `(,@opascal-block-statements
+ ,@opascal-expr-statements)))
;; We hit a label followed by a statement. Indent to the statement.
(throw 'done nil))
;; Skip over ()/[] groups.
- ((eq 'close-group kind) (setq token (delphi-group-start token)))
+ ((eq 'close-group kind) (setq token (opascal-group-start token)))
- ((delphi-is kind `(newline open-group ,@delphi-use-clauses))
+ ((opascal-is kind `(newline open-group ,@opascal-use-clauses))
;; Stop at the beginning of the line, an open group, or a use clause
(throw 'done nil)))
- (unless (delphi-is kind delphi-whitespace) (setq last-token token))
- (setq token (delphi-previous-token token))))
- (delphi-indent-of last-token offset)))
+ (unless (opascal-is kind opascal-whitespace) (setq last-token token))
+ (setq token (opascal-previous-token token))))
+ (opascal-indent-of last-token offset)))
-(defun delphi-open-group-indent (token last-token &optional offset)
+(defun opascal-open-group-indent (token last-token &optional offset)
;; Returns the indent relative to an unmatched ( or [.
- (when (eq 'open-group (delphi-token-kind token))
+ (when (eq 'open-group (opascal-token-kind token))
(if last-token
- (delphi-indent-of last-token offset)
+ (opascal-indent-of last-token offset)
;; There is nothing following the ( or [. Indent from its line.
- (delphi-stmt-line-indent-of token delphi-indent-level))))
+ (opascal-stmt-line-indent-of token opascal-indent-level))))
-(defun delphi-composite-type-start (token last-token)
+(defun opascal-composite-type-start (token last-token)
;; Returns true (actually the last-token) if the pair equals (= class), (=
;; dispinterface), (= interface), (= object), or (= record), and nil
;; otherwise.
- (if (and (eq 'equals (delphi-token-kind token))
- (delphi-is (delphi-token-kind last-token) delphi-composite-types))
+ (if (and (eq 'equals (opascal-token-kind token))
+ (opascal-is (opascal-token-kind last-token) opascal-composite-types))
last-token))
-(defun delphi-is-simple-class-type (at-token limit-token)
+(defun opascal-is-simple-class-type (at-token limit-token)
;; True if at-token is the start of a simple class type. E.g.
;; class of TClass;
;; class (TBaseClass);
;; class;
- (when (delphi-is (delphi-token-kind at-token) delphi-class-types)
+ (when (opascal-is (opascal-token-kind at-token) opascal-class-types)
(catch 'done
;; Scan until the semi colon.
- (let ((token (delphi-next-token at-token))
+ (let ((token (opascal-next-token at-token))
(token-kind nil)
- (limit (delphi-token-start limit-token)))
- (while (and token (<= (delphi-token-start token) limit))
- (setq token-kind (delphi-token-kind token))
+ (limit (opascal-token-start limit-token)))
+ (while (and token (<= (opascal-token-start token) limit))
+ (setq token-kind (opascal-token-kind token))
(cond
;; A semicolon delimits the search.
((eq 'semicolon token-kind) (throw 'done token))
;; Skip over the inheritance list.
- ((eq 'open-group token-kind) (setq token (delphi-group-end token)))
+ ((eq 'open-group token-kind) (setq token (opascal-group-end token)))
;; Only allow "of" and whitespace, and an identifier
- ((delphi-is token-kind `(of word ,@delphi-whitespace)))
+ ((opascal-is token-kind `(of word ,@opascal-whitespace)))
;; Otherwise we are not in a simple class declaration.
((throw 'done nil)))
- (setq token (delphi-next-token token)))))))
+ (setq token (opascal-next-token token)))))))
-(defun delphi-block-start (from-token &optional stop-on-class)
+(defun opascal-block-start (from-token &optional stop-on-class)
;; Returns the token that denotes the start of the block.
- (let ((token (delphi-previous-token from-token))
+ (let ((token (opascal-previous-token from-token))
(last-token nil)
(token-kind nil))
(catch 'done
(while token
- (setq token-kind (delphi-token-kind token))
+ (setq token-kind (opascal-token-kind token))
(cond
;; Skip over nested blocks.
- ((delphi-is token-kind delphi-end-block-statements)
- (setq token (delphi-block-start token)))
+ ((opascal-is token-kind opascal-end-block-statements)
+ (setq token (opascal-block-start token)))
;; Regular block start found.
- ((delphi-is token-kind delphi-block-statements)
+ ((opascal-is token-kind opascal-block-statements)
(throw 'done
;; As a special case, when a "case" block appears
;; within a record declaration (to denote a variant
;; the enclosing block.
(if (eq 'case token-kind)
(let ((enclosing-token
- (delphi-block-start token
+ (opascal-block-start token
'stop-on-class)))
(if
(eq 'record
- (delphi-token-kind enclosing-token))
+ (opascal-token-kind enclosing-token))
(if stop-on-class
enclosing-token
- (delphi-previous-token enclosing-token))
+ (opascal-previous-token enclosing-token))
token))
token)))
;; A class/record start also begins a block.
- ((delphi-composite-type-start token last-token)
+ ((opascal-composite-type-start token last-token)
(throw 'done (if stop-on-class last-token token)))
)
- (unless (delphi-is token-kind delphi-whitespace)
+ (unless (opascal-is token-kind opascal-whitespace)
(setq last-token token))
- (setq token (delphi-previous-token token)))
+ (setq token (opascal-previous-token token)))
;; Start not found.
nil)))
-(defun delphi-else-start (from-else)
+(defun opascal-else-start (from-else)
;; Returns the token of the if or case statement.
- (let ((token (delphi-previous-token from-else))
+ (let ((token (opascal-previous-token from-else))
(token-kind nil)
(semicolon-count 0))
(catch 'done
(while token
- (setq token-kind (delphi-token-kind token))
+ (setq token-kind (opascal-token-kind token))
(cond
;; Skip over nested groups.
- ((eq 'close-group token-kind) (setq token (delphi-group-start token)))
+ ((eq 'close-group token-kind) (setq token (opascal-group-start token)))
;; Skip over any nested blocks.
- ((delphi-is token-kind delphi-end-block-statements)
- (setq token (delphi-block-start token)))
+ ((opascal-is token-kind opascal-end-block-statements)
+ (setq token (opascal-block-start token)))
((eq 'semicolon token-kind)
;; Semicolon means we are looking for an enclosing if, unless we
((eq 'case token-kind)
;; We have hit a case statement start.
(throw 'done token)))
- (setq token (delphi-previous-token token)))
+ (setq token (opascal-previous-token token)))
;; No if or case statement found.
nil)))
-(defun delphi-comment-content-start (comment)
+(defun opascal-comment-content-start (comment)
;; Returns the point of the first non-space character in the comment.
- (let ((kind (delphi-token-kind comment)))
- (when (delphi-is kind delphi-comments)
- (delphi-save-excursion
- (goto-char (+ (delphi-token-start comment)
- (length (delphi-literal-start-pattern kind))))
- (skip-chars-forward delphi-space-chars)
+ (let ((kind (opascal-token-kind comment)))
+ (when (opascal-is kind opascal-comments)
+ (opascal-save-excursion
+ (goto-char (+ (opascal-token-start comment)
+ (length (opascal-literal-start-pattern kind))))
+ (skip-chars-forward opascal-space-chars)
(point)))))
-(defun delphi-comment-block-start (comment)
+(defun opascal-comment-block-start (comment)
;; Returns the starting comment token of a contiguous // comment block. If
;; the comment is multiline (i.e. {...} or (*...*)), the original comment is
;; returned.
- (if (not (eq 'comment-single-line (delphi-token-kind comment)))
+ (if (not (eq 'comment-single-line (opascal-token-kind comment)))
comment
;; Scan until we run out of // comments.
(let ((prev-comment comment)
(start-comment comment))
- (while (let ((kind (delphi-token-kind prev-comment)))
+ (while (let ((kind (opascal-token-kind prev-comment)))
(cond ((eq kind 'space))
((eq kind 'comment-single-line)
(setq start-comment prev-comment))
(t nil)))
- (setq prev-comment (delphi-previous-token prev-comment)))
+ (setq prev-comment (opascal-previous-token prev-comment)))
start-comment)))
-(defun delphi-comment-block-end (comment)
+(defun opascal-comment-block-end (comment)
;; Returns the end comment token of a contiguous // comment block. If the
;; comment is multiline (i.e. {...} or (*...*)), the original comment is
;; returned.
- (if (not (eq 'comment-single-line (delphi-token-kind comment)))
+ (if (not (eq 'comment-single-line (opascal-token-kind comment)))
comment
;; Scan until we run out of // comments.
(let ((next-comment comment)
(end-comment comment))
- (while (let ((kind (delphi-token-kind next-comment)))
+ (while (let ((kind (opascal-token-kind next-comment)))
(cond ((eq kind 'space))
((eq kind 'comment-single-line)
(setq end-comment next-comment))
(t nil)))
- (setq next-comment (delphi-next-token next-comment)))
+ (setq next-comment (opascal-next-token next-comment)))
end-comment)))
-(defun delphi-on-first-comment-line (comment)
+(defun opascal-on-first-comment-line (comment)
;; Returns true if the current point is on the first line of the comment.
(save-excursion
- (let ((comment-start (delphi-token-start comment))
+ (let ((comment-start (opascal-token-start comment))
(current-point (point)))
(goto-char comment-start)
(end-of-line)
(and (<= comment-start current-point) (<= current-point (point))))))
-(defun delphi-comment-indent-of (comment)
+(defun opascal-comment-indent-of (comment)
;; Returns the correct indentation for the comment.
- (let ((start-comment (delphi-comment-block-start comment)))
+ (let ((start-comment (opascal-comment-block-start comment)))
(if (and (eq start-comment comment)
- (delphi-on-first-comment-line comment))
+ (opascal-on-first-comment-line comment))
;; Indent as a statement.
- (delphi-enclosing-indent-of comment)
+ (opascal-enclosing-indent-of comment)
(save-excursion
- (let ((kind (delphi-token-kind comment)))
+ (let ((kind (opascal-token-kind comment)))
(beginning-of-line)
(cond ((eq 'comment-single-line kind)
;; Indent to the first comment in the // block.
- (delphi-indent-of start-comment))
+ (opascal-indent-of start-comment))
- ((looking-at (concat delphi-leading-spaces-re
- (delphi-literal-stop-pattern kind)))
+ ((looking-at (concat opascal-leading-spaces-re
+ (opascal-literal-stop-pattern kind)))
;; Indent multi-line comment terminators to the comment start.
- (delphi-indent-of comment))
+ (opascal-indent-of comment))
;; Indent according to the comment's content start.
- ((delphi-column-of (delphi-comment-content-start comment)))))))
+ ((opascal-column-of (opascal-comment-content-start comment)))))))
))
-(defun delphi-is-use-clause-end (at-token last-token last-colon from-kind)
+(defun opascal-is-use-clause-end (at-token last-token last-colon from-kind)
;; True if we are after the end of a uses type clause.
(when (and last-token
(not last-colon)
- (eq 'comma (delphi-token-kind at-token))
+ (eq 'comma (opascal-token-kind at-token))
(eq 'semicolon from-kind))
;; Scan for the uses statement, just to be sure.
- (let ((token (delphi-previous-token at-token))
+ (let ((token (opascal-previous-token at-token))
(token-kind nil))
(catch 'done
(while token
- (setq token-kind (delphi-token-kind token))
- (cond ((delphi-is token-kind delphi-use-clauses)
+ (setq token-kind (opascal-token-kind token))
+ (cond ((opascal-is token-kind opascal-use-clauses)
(throw 'done t))
;; Whitespace, identifiers, strings, "in" keyword, and commas
;; are allowed in use clauses.
- ((or (delphi-is token-kind '(word comma in newline))
- (delphi-is token-kind delphi-whitespace)
- (delphi-is token-kind delphi-strings)))
+ ((or (opascal-is token-kind '(word comma in newline))
+ (opascal-is token-kind opascal-whitespace)
+ (opascal-is token-kind opascal-strings)))
;; Nothing else is.
((throw 'done nil)))
- (setq token (delphi-previous-token token)))
+ (setq token (opascal-previous-token token)))
nil))))
-(defun delphi-is-block-after-expr-statement (token)
+(defun opascal-is-block-after-expr-statement (token)
;; Returns true if we have a block token trailing an expression delimiter (of
;; presumably an expression statement).
- (when (delphi-is (delphi-token-kind token) delphi-block-statements)
- (let ((previous (delphi-previous-token token))
+ (when (opascal-is (opascal-token-kind token) opascal-block-statements)
+ (let ((previous (opascal-previous-token token))
(previous-kind nil))
(while (progn
- (setq previous-kind (delphi-token-kind previous))
+ (setq previous-kind (opascal-token-kind previous))
(eq previous-kind 'space))
- (setq previous (delphi-previous-token previous)))
- (or (delphi-is previous-kind delphi-expr-delimiters)
+ (setq previous (opascal-previous-token previous)))
+ (or (opascal-is previous-kind opascal-expr-delimiters)
(eq previous-kind 'else)))))
-(defun delphi-previous-indent-of (from-token)
+(defun opascal-previous-indent-of (from-token)
;; Returns the indentation of the previous statement of the token.
- (let ((token (delphi-previous-token from-token))
+ (let ((token (opascal-previous-token from-token))
(token-kind nil)
- (from-kind (delphi-token-kind from-token))
+ (from-kind (opascal-token-kind from-token))
(last-colon nil)
(last-of nil)
(last-token nil))
(catch 'done
(while token
- (setq token-kind (delphi-token-kind token))
+ (setq token-kind (opascal-token-kind token))
(cond
;; An open ( or [ always is an indent point.
((eq 'open-group token-kind)
- (throw 'done (delphi-open-group-indent token last-token)))
+ (throw 'done (opascal-open-group-indent token last-token)))
;; Skip over any ()/[] groups.
- ((eq 'close-group token-kind) (setq token (delphi-group-start token)))
+ ((eq 'close-group token-kind) (setq token (opascal-group-start token)))
- ((delphi-is token-kind delphi-end-block-statements)
- (if (eq 'newline (delphi-token-kind (delphi-previous-token token)))
+ ((opascal-is token-kind opascal-end-block-statements)
+ (if (eq 'newline (opascal-token-kind (opascal-previous-token token)))
;; We can stop at an end token that is right up against the
;; margin.
(throw 'done 0)
;; Otherwise, skip over any nested blocks.
- (setq token (delphi-block-start token))))
+ (setq token (opascal-block-start token))))
;; Special case: if we encounter a ", word;" then we assume that we
;; are in some kind of uses clause, and thus indent to column 0. This
;; someUnit,
;; someOtherUnit;
;; // this should be at column 0!
- ((delphi-is-use-clause-end token last-token last-colon from-kind)
+ ((opascal-is-use-clause-end token last-token last-colon from-kind)
(throw 'done 0))
;; A previous terminator means we can stop. If we are on a directive,
;; however, then we are not actually encountering a new statement.
((and last-token
- (delphi-is token-kind delphi-previous-terminators)
- (not (delphi-is (delphi-token-kind last-token)
- delphi-directives)))
- (throw 'done (delphi-stmt-line-indent-of last-token 0)))
+ (opascal-is token-kind opascal-previous-terminators)
+ (not (opascal-is (opascal-token-kind last-token)
+ opascal-directives)))
+ (throw 'done (opascal-stmt-line-indent-of last-token 0)))
;; Ignore whitespace.
- ((delphi-is token-kind delphi-whitespace))
+ ((opascal-is token-kind opascal-whitespace))
;; Remember any "of" we encounter, since that affects how we
;; indent to a case statement within a record declaration
;; specially.
((eq 'case token-kind)
(throw 'done
- (if last-colon (delphi-line-indent-of last-colon)
- (delphi-line-indent-of token delphi-case-label-indent))))
+ (if last-colon (opascal-line-indent-of last-colon)
+ (opascal-line-indent-of token opascal-case-label-indent))))
;; If we are in a use clause then commas mark an enclosing rather than
;; a previous statement.
- ((delphi-is token-kind delphi-use-clauses)
+ ((opascal-is token-kind opascal-use-clauses)
(throw 'done
(if (eq 'comma from-kind)
(if last-token
;; Indent to first unit in use clause.
- (delphi-indent-of last-token)
+ (opascal-indent-of last-token)
;; Indent from use clause keyword.
- (delphi-line-indent-of token delphi-indent-level))
+ (opascal-line-indent-of token opascal-indent-level))
;; Indent to use clause keyword.
- (delphi-line-indent-of token))))
+ (opascal-line-indent-of token))))
;; Assembly sections always indent in from the asm keyword.
((eq token-kind 'asm)
- (throw 'done (delphi-stmt-line-indent-of token delphi-indent-level)))
+ (throw 'done (opascal-stmt-line-indent-of token opascal-indent-level)))
;; An enclosing statement delimits a previous statement.
;; We try to use the existing indent of the previous statement,
;; otherwise we calculate from the enclosing statement.
- ((delphi-is token-kind delphi-previous-enclosing-statements)
+ ((opascal-is token-kind opascal-previous-enclosing-statements)
(throw 'done (if last-token
;; Otherwise indent to the last token
- (delphi-line-indent-of last-token)
+ (opascal-line-indent-of last-token)
;; Just indent from the enclosing keyword
- (delphi-line-indent-of token delphi-indent-level))))
+ (opascal-line-indent-of token opascal-indent-level))))
;; A class or record declaration also delimits a previous statement.
- ((delphi-composite-type-start token last-token)
+ ((opascal-composite-type-start token last-token)
(throw
'done
- (if (delphi-is-simple-class-type last-token from-token)
+ (if (opascal-is-simple-class-type last-token from-token)
;; c = class; or c = class of T; are previous statements.
- (delphi-line-indent-of token)
+ (opascal-line-indent-of token)
;; Otherwise c = class ... or r = record ... are enclosing
;; statements.
- (delphi-line-indent-of last-token delphi-indent-level))))
+ (opascal-line-indent-of last-token opascal-indent-level))))
;; We have a definite previous statement delimiter.
- ((delphi-is token-kind delphi-previous-statements)
- (throw 'done (delphi-stmt-line-indent-of token 0)))
+ ((opascal-is token-kind opascal-previous-statements)
+ (throw 'done (opascal-stmt-line-indent-of token 0)))
)
- (unless (delphi-is token-kind delphi-whitespace)
+ (unless (opascal-is token-kind opascal-whitespace)
(setq last-token token))
- (setq token (delphi-previous-token token)))
+ (setq token (opascal-previous-token token)))
;; We ran out of tokens. Indent to column 0.
0)))
-(defun delphi-section-indent-of (section-token)
+(defun opascal-section-indent-of (section-token)
;; Returns the indentation appropriate for begin/var/const/type/label
;; tokens.
- (let* ((token (delphi-previous-token section-token))
+ (let* ((token (opascal-previous-token section-token))
(token-kind nil)
(last-token nil)
(nested-block-count 0)
(last-terminator nil))
(catch 'done
(while token
- (setq token-kind (delphi-token-kind token))
+ (setq token-kind (opascal-token-kind token))
(cond
;; Always stop at unmatched ( or [.
((eq token-kind 'open-group)
- (throw 'done (delphi-open-group-indent token last-token)))
+ (throw 'done (opascal-open-group-indent token last-token)))
;; Skip over any ()/[] groups.
- ((eq 'close-group token-kind) (setq token (delphi-group-start token)))
+ ((eq 'close-group token-kind) (setq token (opascal-group-start token)))
- ((delphi-is token-kind delphi-end-block-statements)
- (if (eq 'newline (delphi-token-kind (delphi-previous-token token)))
+ ((opascal-is token-kind opascal-end-block-statements)
+ (if (eq 'newline (opascal-token-kind (opascal-previous-token token)))
;; We can stop at an end token that is right up against the
;; margin.
(throw 'done 0)
;; Otherwise, skip over any nested blocks.
- (setq token (delphi-block-start token)
+ (setq token (opascal-block-start token)
nested-block-count (1+ nested-block-count))))
;; Remember if we have encountered any forward routine declarations.
(setq nested-block-count (1+ nested-block-count)))
;; Mark the completion of a nested routine traversal.
- ((and (delphi-is token-kind delphi-routine-statements)
+ ((and (opascal-is token-kind opascal-routine-statements)
(> nested-block-count 0))
(setq nested-block-count (1- nested-block-count)))
((eq 'semicolon token-kind) (setq last-terminator token))
;; Remember if we have encountered any expression delimiters.
- ((delphi-is token-kind delphi-expr-delimiters)
+ ((opascal-is token-kind opascal-expr-delimiters)
(setq expr-delimited token))
;; Enclosing body statements are delimiting. We indent the compound
;; bodies specially.
((and (not last-terminator)
- (delphi-is token-kind delphi-body-statements))
+ (opascal-is token-kind opascal-body-statements))
(throw 'done
- (delphi-stmt-line-indent-of token delphi-compound-block-indent)))
+ (opascal-stmt-line-indent-of token opascal-compound-block-indent)))
;; An enclosing ":" means a label.
((and (eq 'colon token-kind)
- (delphi-is (delphi-token-kind section-token)
- delphi-block-statements)
+ (opascal-is (opascal-token-kind section-token)
+ opascal-block-statements)
(not last-terminator)
(not expr-delimited)
- (not (eq 'equals (delphi-token-kind last-token))))
+ (not (eq 'equals (opascal-token-kind last-token))))
(throw 'done
- (delphi-stmt-line-indent-of token delphi-indent-level)))
+ (opascal-stmt-line-indent-of token opascal-indent-level)))
;; Block and mid block tokens are always enclosing
- ((delphi-is token-kind delphi-begin-enclosing-tokens)
+ ((opascal-is token-kind opascal-begin-enclosing-tokens)
(throw 'done
- (delphi-stmt-line-indent-of token delphi-indent-level)))
+ (opascal-stmt-line-indent-of token opascal-indent-level)))
;; Declaration sections and routines are delimiters, unless they
;; are part of a nested routine.
- ((and (delphi-is token-kind delphi-decl-delimiters)
+ ((and (opascal-is token-kind opascal-decl-delimiters)
(= 0 nested-block-count))
- (throw 'done (delphi-line-indent-of token 0)))
+ (throw 'done (opascal-line-indent-of token 0)))
;; Unit statements mean we indent right to the left.
- ((delphi-is token-kind delphi-unit-statements) (throw 'done 0))
+ ((opascal-is token-kind opascal-unit-statements) (throw 'done 0))
)
- (unless (delphi-is token-kind delphi-whitespace)
+ (unless (opascal-is token-kind opascal-whitespace)
(setq last-token token))
- (setq token (delphi-previous-token token)))
+ (setq token (opascal-previous-token token)))
;; We ran out of tokens. Indent to column 0.
0)))
-(defun delphi-enclosing-indent-of (from-token)
+(defun opascal-enclosing-indent-of (from-token)
;; Returns the indentation offset from the enclosing statement of the token.
- (let ((token (delphi-previous-token from-token))
- (from-kind (delphi-token-kind from-token))
+ (let ((token (opascal-previous-token from-token))
+ (from-kind (opascal-token-kind from-token))
(token-kind nil)
(stmt-start nil)
(last-token nil)
(expr-delimited nil))
(catch 'done
(while token
- (setq token-kind (delphi-token-kind token))
+ (setq token-kind (opascal-token-kind token))
(cond
;; An open ( or [ always is an indent point.
((eq 'open-group token-kind)
(throw 'done
- (delphi-open-group-indent
+ (opascal-open-group-indent
token last-token
- (if (delphi-is from-kind delphi-binary-ops)
+ (if (opascal-is from-kind opascal-binary-ops)
;; Keep binary operations aligned with the open group.
0
- delphi-indent-level))))
+ opascal-indent-level))))
;; Skip over any ()/[] groups.
- ((eq 'close-group token-kind) (setq token (delphi-group-start token)))
+ ((eq 'close-group token-kind) (setq token (opascal-group-start token)))
;; Skip over any nested blocks.
- ((delphi-is token-kind delphi-end-block-statements)
- (setq token (delphi-block-start token)))
+ ((opascal-is token-kind opascal-end-block-statements)
+ (setq token (opascal-block-start token)))
;; An expression delimiter affects indentation depending on whether
;; the point is before or after it. Remember that we encountered one.
;; Also remember the last encountered token, since if it exists it
;; should be the actual indent point.
- ((delphi-is token-kind delphi-expr-delimiters)
+ ((opascal-is token-kind opascal-expr-delimiters)
(setq expr-delimited token stmt-start last-token))
;; With a non-delimited expression statement we indent after the
;; statement's keyword, unless we are on the delimiter itself.
((and (not expr-delimited)
- (delphi-is token-kind delphi-expr-statements))
+ (opascal-is token-kind opascal-expr-statements))
(throw 'done
- (cond ((delphi-is from-kind delphi-expr-delimiters)
+ (cond ((opascal-is from-kind opascal-expr-delimiters)
;; We are indenting a delimiter. Indent to the statement.
- (delphi-stmt-line-indent-of token 0))
+ (opascal-stmt-line-indent-of token 0))
- ((and last-token (delphi-is from-kind delphi-binary-ops))
+ ((and last-token (opascal-is from-kind opascal-binary-ops))
;; Align binary ops with the expression.
- (delphi-indent-of last-token))
+ (opascal-indent-of last-token))
(last-token
;; Indent in from the expression.
- (delphi-indent-of last-token delphi-indent-level))
+ (opascal-indent-of last-token opascal-indent-level))
;; Indent in from the statement's keyword.
- ((delphi-indent-of token delphi-indent-level)))))
+ ((opascal-indent-of token opascal-indent-level)))))
;; A delimited case statement indents the label according to
;; a special rule.
(if stmt-start
;; We are not actually indenting to the case statement,
;; but are within a label expression.
- (delphi-stmt-line-indent-of
- stmt-start delphi-indent-level)
+ (opascal-stmt-line-indent-of
+ stmt-start opascal-indent-level)
;; Indent from the case keyword.
- (delphi-stmt-line-indent-of
- token delphi-case-label-indent))))
+ (opascal-stmt-line-indent-of
+ token opascal-case-label-indent))))
;; Body expression statements are enclosing. Indent from the
;; statement's keyword, unless we have a non-block statement following
;; it.
- ((delphi-is token-kind delphi-body-expr-statements)
+ ((opascal-is token-kind opascal-body-expr-statements)
(throw 'done
- (delphi-stmt-line-indent-of
- (or stmt-start token) delphi-indent-level)))
+ (opascal-stmt-line-indent-of
+ (or stmt-start token) opascal-indent-level)))
;; An else statement is enclosing, but it doesn't have an expression.
;; Thus we take into account last-token instead of stmt-start.
((eq 'else token-kind)
- (throw 'done (delphi-stmt-line-indent-of
- (or last-token token) delphi-indent-level)))
+ (throw 'done (opascal-stmt-line-indent-of
+ (or last-token token) opascal-indent-level)))
;; We indent relative to an enclosing declaration section.
- ((delphi-is token-kind delphi-decl-sections)
- (throw 'done (delphi-indent-of (if last-token last-token token)
- delphi-indent-level)))
+ ((opascal-is token-kind opascal-decl-sections)
+ (throw 'done (opascal-indent-of (if last-token last-token token)
+ opascal-indent-level)))
;; In unit sections we indent right to the left.
- ((delphi-is token-kind delphi-unit-sections)
+ ((opascal-is token-kind opascal-unit-sections)
(throw 'done
;; Handle specially the case of "interface", which can be used
;; to start either a unit section or an interface definition.
- (if (delphi-is token-kind delphi-interface-types)
+ (if (opascal-is token-kind opascal-interface-types)
(progn
;; Find the previous non-whitespace token.
(while (progn
(setq last-token token
- token (delphi-previous-token token)
- token-kind (delphi-token-kind token))
+ token (opascal-previous-token token)
+ token-kind (opascal-token-kind token))
(and token
- (delphi-is token-kind
- delphi-whitespace))))
+ (opascal-is token-kind
+ opascal-whitespace))))
;; If this token is an equals sign, "interface" is being
;; used to start an interface definition and we should
;; treat it as a composite type; otherwise, we should
;; consider it the start of a unit section.
(if (and token (eq token-kind 'equals))
- (delphi-line-indent-of last-token
- delphi-indent-level)
+ (opascal-line-indent-of last-token
+ opascal-indent-level)
0))
0)))
;; A previous terminator means we can stop.
- ((delphi-is token-kind delphi-previous-terminators)
+ ((opascal-is token-kind opascal-previous-terminators)
(throw 'done
(cond ((and last-token
(eq 'comma token-kind)
- (delphi-is from-kind delphi-binary-ops))
+ (opascal-is from-kind opascal-binary-ops))
;; Align binary ops with the expression.
- (delphi-indent-of last-token))
+ (opascal-indent-of last-token))
(last-token
;; Indent in from the expression.
- (delphi-indent-of last-token delphi-indent-level))
+ (opascal-indent-of last-token opascal-indent-level))
;; No enclosing expression; use the previous statement's
;; indent.
- ((delphi-previous-indent-of token)))))
+ ((opascal-previous-indent-of token)))))
;; A block statement after an expression delimiter has its start
;; column as the expression statement. E.g.
;; //...
;; end;
;; Remember it for when we encounter the expression statement start.
- ((delphi-is-block-after-expr-statement token)
+ ((opascal-is-block-after-expr-statement token)
(throw 'done
- (cond (last-token (delphi-indent-of last-token delphi-indent-level))
+ (cond (last-token (opascal-indent-of last-token opascal-indent-level))
- ((+ (delphi-section-indent-of token) delphi-indent-level)))))
+ ((+ (opascal-section-indent-of token) opascal-indent-level)))))
;; Assembly sections always indent in from the asm keyword.
((eq token-kind 'asm)
- (throw 'done (delphi-stmt-line-indent-of token delphi-indent-level)))
+ (throw 'done (opascal-stmt-line-indent-of token opascal-indent-level)))
;; Stop at an enclosing statement and indent from it.
- ((delphi-is token-kind delphi-enclosing-statements)
- (throw 'done (delphi-stmt-line-indent-of
- (or last-token token) delphi-indent-level)))
+ ((opascal-is token-kind opascal-enclosing-statements)
+ (throw 'done (opascal-stmt-line-indent-of
+ (or last-token token) opascal-indent-level)))
;; A class/record declaration is also enclosing.
- ((delphi-composite-type-start token last-token)
+ ((opascal-composite-type-start token last-token)
(throw 'done
- (delphi-line-indent-of last-token delphi-indent-level)))
+ (opascal-line-indent-of last-token opascal-indent-level)))
;; A ":" we indent relative to its line beginning. If we are in a
;; parameter list, then stop also if we hit a ";".
((and (eq token-kind 'colon)
(not expr-delimited)
- (not (delphi-is from-kind delphi-expr-delimiters))
+ (not (opascal-is from-kind opascal-expr-delimiters))
(not equals-encountered)
(not (eq from-kind 'equals)))
(throw 'done
(if last-token
- (delphi-indent-of last-token delphi-indent-level)
- (delphi-line-indent-of token delphi-indent-level 'semicolon))))
+ (opascal-indent-of last-token opascal-indent-level)
+ (opascal-line-indent-of token opascal-indent-level 'semicolon))))
;; If the ":" was not processed above and we have token after the "=",
;; then indent from the "=". Ignore :=, however.
;; + 2;
;; which doesn't look right.
;;;; Align binary ops with the before token.
- ;;((delphi-is from-kind delphi-binary-ops)
- ;;(throw 'done (delphi-indent-of before-equals 0)))
+ ;;((opascal-is from-kind opascal-binary-ops)
+ ;;(throw 'done (opascal-indent-of before-equals 0)))
;; Assignments (:=) we skip over to get a normal indent.
- ((eq (delphi-token-kind last-token) 'equals))
+ ((eq (opascal-token-kind last-token) 'equals))
;; Otherwise indent in from the equals.
((throw 'done
- (delphi-indent-of before-equals delphi-indent-level)))))
+ (opascal-indent-of before-equals opascal-indent-level)))))
;; Remember any "=" we encounter if it has not already been processed.
((eq token-kind 'equals)
(setq equals-encountered token
before-equals last-token))
)
- (unless (delphi-is token-kind delphi-whitespace)
+ (unless (opascal-is token-kind opascal-whitespace)
(setq last-token token))
- (setq token (delphi-previous-token token)))
+ (setq token (opascal-previous-token token)))
;; We ran out of tokens. Indent to column 0.
0)))
-(defun delphi-corrected-indentation ()
+(defun opascal-corrected-indentation ()
;; Returns the corrected indentation for the current line.
- (delphi-save-excursion
- (delphi-progress-start)
+ (opascal-save-excursion
+ (opascal-progress-start)
;; Move to the first token on the line.
(beginning-of-line)
- (skip-chars-forward delphi-space-chars)
- (let* ((token (delphi-current-token))
- (token-kind (delphi-token-kind token))
+ (skip-chars-forward opascal-space-chars)
+ (let* ((token (opascal-current-token))
+ (token-kind (opascal-token-kind token))
(indent
(cond ((eq 'close-group token-kind)
;; Indent to the matching start ( or [.
- (delphi-indent-of (delphi-group-start token)))
+ (opascal-indent-of (opascal-group-start token)))
- ((delphi-is token-kind delphi-unit-statements) 0)
+ ((opascal-is token-kind opascal-unit-statements) 0)
- ((delphi-is token-kind delphi-comments)
+ ((opascal-is token-kind opascal-comments)
;; In a comment.
- (delphi-comment-indent-of token))
+ (opascal-comment-indent-of token))
- ((delphi-is token-kind delphi-decl-matchers)
+ ((opascal-is token-kind opascal-decl-matchers)
;; Use a previous section/routine's indent.
- (delphi-section-indent-of token))
+ (opascal-section-indent-of token))
- ((delphi-is token-kind delphi-match-block-statements)
+ ((opascal-is token-kind opascal-match-block-statements)
;; Use the block's indentation.
(let ((block-start
- (delphi-block-start token 'stop-on-class)))
+ (opascal-block-start token 'stop-on-class)))
(cond
;; When trailing a body statement, indent to
;; the statement's keyword.
- ((delphi-is-block-after-expr-statement block-start)
- (delphi-section-indent-of block-start))
+ ((opascal-is-block-after-expr-statement block-start)
+ (opascal-section-indent-of block-start))
;; Otherwise just indent to the block start.
- ((delphi-stmt-line-indent-of block-start 0)))))
+ ((opascal-stmt-line-indent-of block-start 0)))))
((eq 'else token-kind)
;; Find the start of the if or case statement.
- (delphi-stmt-line-indent-of (delphi-else-start token) 0))
+ (opascal-stmt-line-indent-of (opascal-else-start token) 0))
;; Otherwise indent in from enclosing statement.
- ((delphi-enclosing-indent-of
- (if token token (delphi-token-at (1- (point)))))))))
- (delphi-progress-done)
+ ((opascal-enclosing-indent-of
+ (if token token (opascal-token-at (1- (point)))))))))
+ (opascal-progress-done)
indent)))
-(defun delphi-indent-line ()
+(defun opascal-indent-line ()
"Indent the current line according to the current language construct.
If before the indent, the point is moved to the indent."
(interactive)
- (delphi-save-match-data
+ (save-match-data
(let ((marked-point (point-marker)) ; Maintain our position reliably.
(line-start nil)
(old-indent 0)
(new-indent 0))
(beginning-of-line)
(setq line-start (point))
- (skip-chars-forward delphi-space-chars)
+ (skip-chars-forward opascal-space-chars)
(setq old-indent (current-column))
- (setq new-indent (delphi-corrected-indentation))
+ (setq new-indent (opascal-corrected-indentation))
(if (< marked-point (point))
;; If before the indent column, then move to it.
(set-marker marked-point (point)))
(goto-char marked-point)
(set-marker marked-point nil))))
-(defvar delphi-mode-abbrev-table nil
- "Abbrev table in use in Delphi mode buffers.")
-(define-abbrev-table 'delphi-mode-abbrev-table ())
+(defvar opascal-mode-abbrev-table nil
+ "Abbrev table in use in OPascal mode buffers.")
+(define-abbrev-table 'opascal-mode-abbrev-table ())
-(defmacro delphi-ensure-buffer (buffer-var buffer-name)
+(defmacro opascal-ensure-buffer (buffer-var buffer-name)
;; Ensures there exists a buffer of the specified name in the specified
;; variable.
`(when (not (buffer-live-p ,buffer-var))
(setq ,buffer-var (get-buffer-create ,buffer-name))))
-(defun delphi-log-msg (to-buffer the-msg)
+(defun opascal-log-msg (to-buffer the-msg)
;; Writes a message to the end of the specified buffer.
(with-current-buffer to-buffer
(save-selected-window
;; Debugging helpers:
-(defvar delphi-debug-buffer nil
- "Buffer to write Delphi mode debug messages to. Created on demand.")
+(defvar opascal-debug-buffer nil
+ "Buffer to write OPascal mode debug messages to. Created on demand.")
-(defun delphi-debug-log (format-string &rest args)
+(defun opascal-debug-log (format-string &rest args)
;; Writes a message to the log buffer.
- (when delphi-debug
- (delphi-ensure-buffer delphi-debug-buffer "*Delphi Debug Log*")
- (delphi-log-msg delphi-debug-buffer
+ (when opascal-debug
+ (opascal-ensure-buffer opascal-debug-buffer "*OPascal Debug Log*")
+ (opascal-log-msg opascal-debug-buffer
(concat (format-time-string "%H:%M:%S " (current-time))
(apply #'format (cons format-string args))
"\n"))))
-(defun delphi-debug-token-string (token)
- (let* ((image (delphi-token-string token))
+(defun opascal-debug-token-string (token)
+ (let* ((image (opascal-token-string token))
(has-newline (string-match "^\\([^\n]*\\)\n\\(.+\\)?$" image)))
(when has-newline
(setq image (concat (match-string 1 image)
(if (match-beginning 2) "..."))))
image))
-(defun delphi-debug-show-current-token ()
+(defun opascal-debug-show-current-token ()
(interactive)
- (let ((token (delphi-current-token)))
- (delphi-debug-log "Token: %S %S" token (delphi-debug-token-string token))))
+ (let ((token (opascal-current-token)))
+ (opascal-debug-log "Token: %S %S" token (opascal-debug-token-string token))))
-(defun delphi-debug-goto-point (p)
+(defun opascal-debug-goto-point (p)
(interactive "NGoto char: ")
(goto-char p))
-(defun delphi-debug-goto-next-token ()
+(defun opascal-debug-goto-next-token ()
(interactive)
- (goto-char (delphi-token-start (delphi-next-token (delphi-current-token)))))
+ (goto-char (opascal-token-start (opascal-next-token (opascal-current-token)))))
-(defun delphi-debug-goto-previous-token ()
+(defun opascal-debug-goto-previous-token ()
(interactive)
(goto-char
- (delphi-token-start (delphi-previous-token (delphi-current-token)))))
+ (opascal-token-start (opascal-previous-token (opascal-current-token)))))
-(defun delphi-debug-show-current-string (from to)
+(defun opascal-debug-show-current-string (from to)
(interactive "r")
- (delphi-debug-log "String: %S" (buffer-substring from to)))
+ (opascal-debug-log "String: %S" (buffer-substring from to)))
-(defun delphi-debug-show-is-stable ()
+(defun opascal-debug-show-is-stable ()
(interactive)
- (delphi-debug-log "stable: %S prev: %S next: %S"
- (delphi-is-stable-literal (point))
- (delphi-literal-kind (1- (point)))
- (delphi-literal-kind (point))))
+ (opascal-debug-log "stable: %S prev: %S next: %S"
+ (opascal-is-stable-literal (point))
+ (opascal-literal-kind (1- (point)))
+ (opascal-literal-kind (point))))
-(defun delphi-debug-unparse-buffer ()
+(defun opascal-debug-unparse-buffer ()
(interactive)
- (delphi-set-text-properties (point-min) (point-max) nil))
+ (opascal-set-text-properties (point-min) (point-max) nil))
-(defun delphi-debug-parse-region (from to)
+(defun opascal-debug-parse-region (from to)
(interactive "r")
- (let ((delphi-verbose t))
- (delphi-save-excursion
- (delphi-progress-start)
- (delphi-parse-region from to)
- (delphi-progress-done "Parsing done"))))
+ (let ((opascal-verbose t))
+ (opascal-save-excursion
+ (opascal-progress-start)
+ (opascal-parse-region from to)
+ (opascal-progress-done "Parsing done"))))
-(defun delphi-debug-parse-window ()
+(defun opascal-debug-parse-window ()
(interactive)
- (delphi-debug-parse-region (window-start) (window-end)))
+ (opascal-debug-parse-region (window-start) (window-end)))
-(defun delphi-debug-parse-buffer ()
+(defun opascal-debug-parse-buffer ()
(interactive)
- (delphi-debug-parse-region (point-min) (point-max)))
+ (opascal-debug-parse-region (point-min) (point-max)))
-(defun delphi-debug-fontify-window ()
+(defun opascal-debug-fontify-window ()
(interactive)
- (delphi-fontify-region (window-start) (window-end) t))
+ (opascal-fontify-region (window-start) (window-end) t))
-(defun delphi-debug-fontify-buffer ()
+(defun opascal-debug-fontify-buffer ()
(interactive)
- (delphi-fontify-region (point-min) (point-max) t))
+ (opascal-fontify-region (point-min) (point-max) t))
-(defun delphi-debug-tokenize-region (from to)
+(defun opascal-debug-tokenize-region (from to)
(interactive)
- (delphi-save-excursion
- (delphi-progress-start)
+ (opascal-save-excursion
+ (opascal-progress-start)
(goto-char from)
(while (< (point) to)
- (goto-char (delphi-token-end (delphi-current-token)))
- (delphi-step-progress (point) "Tokenizing" delphi-scanning-progress-step))
- (delphi-progress-done "Tokenizing done")))
+ (goto-char (opascal-token-end (opascal-current-token)))
+ (opascal-step-progress (point) "Tokenizing" opascal-scanning-progress-step))
+ (opascal-progress-done "Tokenizing done")))
-(defun delphi-debug-tokenize-buffer ()
+(defun opascal-debug-tokenize-buffer ()
(interactive)
- (delphi-debug-tokenize-region (point-min) (point-max)))
+ (opascal-debug-tokenize-region (point-min) (point-max)))
-(defun delphi-debug-tokenize-window ()
+(defun opascal-debug-tokenize-window ()
(interactive)
- (delphi-debug-tokenize-region (window-start) (window-end)))
+ (opascal-debug-tokenize-region (window-start) (window-end)))
-(defun delphi-newline ()
- "Terminate the current line with a newline and indent the next, unless
-`delphi-newline-always-indents' is nil, in which case no reindenting occurs."
- (interactive)
- ;; Remove trailing spaces
- (delete-horizontal-space)
- (newline)
- (when delphi-newline-always-indents
- ;; Indent both the (now) previous and current line first.
- (save-excursion
- (forward-line -1)
- (delphi-indent-line))
- (delphi-indent-line)))
-
-
-(defun delphi-tab ()
+
+(defun opascal-tab ()
"Indent the region, when Transient Mark mode is enabled and the region is
active. Otherwise, indent the current line or insert a TAB, depending on the
-value of `delphi-tab-always-indents' and the current line position."
+value of `opascal-tab-always-indents' and the current line position."
(interactive)
(cond ((use-region-p)
;; If Transient Mark mode is enabled and the region is active, indent
;; the entire region.
(indent-region (region-beginning) (region-end)))
- ((or delphi-tab-always-indents
- (save-excursion (skip-chars-backward delphi-space-chars) (bolp)))
+ ((or opascal-tab-always-indents
+ (save-excursion (skip-chars-backward opascal-space-chars) (bolp)))
;; Otherwise, if we are configured always to indent (regardless of the
;; point's position in the line) or we are before the first non-space
;; character on the line, indent the line.
- (delphi-indent-line))
+ (opascal-indent-line))
(t
;; Otherwise, insert a tab character.
(insert "\t"))))
-(defun delphi-is-directory (path)
+(defun opascal-is-directory (path)
;; True if the specified path is an existing directory.
(let ((attributes (file-attributes path)))
(and attributes (car attributes))))
-(defun delphi-is-file (path)
+(defun opascal-is-file (path)
;; True if the specified file exists as a file.
(let ((attributes (file-attributes path)))
(and attributes (null (car attributes)))))
-(defun delphi-search-directory (unit dir &optional recurse)
+(defun opascal-search-directory (unit dir &optional recurse)
;; Searches for the unit in the specified directory. If recurse is true, then
;; the directory is recursively searched. File name comparison is done in a
;; case insensitive manner.
- (when (delphi-is-directory dir)
+ (when (opascal-is-directory dir)
(let ((files (directory-files dir))
(unit-file (downcase unit)))
(catch 'done
;; Search for the file.
- (mapc #'(lambda (file)
- (let ((path (concat dir "/" file)))
- (if (and (string= unit-file (downcase file))
- (delphi-is-file path))
- (throw 'done path))))
- files)
+ (dolist (file files)
+ (let ((path (concat dir "/" file)))
+ (if (and (string= unit-file (downcase file))
+ (opascal-is-file path))
+ (throw 'done path))))
;; Not found. Search subdirectories.
(when recurse
- (mapc #'(lambda (subdir)
- (unless (member subdir '("." ".."))
- (let ((path (delphi-search-directory
- unit (concat dir "/" subdir) recurse)))
- (if path (throw 'done path)))))
- files))
+ (dolist (subdir files)
+ (unless (member subdir '("." ".."))
+ (let ((path (opascal-search-directory
+ unit (concat dir "/" subdir) recurse)))
+ (if path (throw 'done path))))))
;; Not found.
nil))))
-(defun delphi-find-unit-in-directory (unit dir)
+(defun opascal-find-unit-in-directory (unit dir)
;; Searches for the unit in the specified directory. If the directory ends
;; in \"...\", then it is recursively searched.
(let ((dir-name dir)
;; Ensure the trailing slash is removed.
(if (string-match "^\\(.+\\)[\\\\/]$" dir-name)
(setq dir-name (match-string 1 dir-name)))
- (delphi-search-directory unit dir-name recurse)))
+ (opascal-search-directory unit dir-name recurse)))
-(defun delphi-find-unit-file (unit)
- ;; Finds the specified delphi source file according to `delphi-search-path'.
+(defun opascal-find-unit-file (unit)
+ ;; Finds the specified opascal source file according to `opascal-search-path'.
;; If found, the full path is returned, otherwise nil is returned.
(catch 'done
- (cond ((null delphi-search-path)
- (delphi-find-unit-in-directory unit "."))
+ (cond ((null opascal-search-path)
+ (opascal-find-unit-in-directory unit "."))
- ((stringp delphi-search-path)
- (delphi-find-unit-in-directory unit delphi-search-path))
+ ((stringp opascal-search-path)
+ (opascal-find-unit-in-directory unit opascal-search-path))
- ((mapc
- #'(lambda (dir)
- (let ((file (delphi-find-unit-in-directory unit dir)))
- (if file (throw 'done file))))
- delphi-search-path)))
+ ((dolist (dir opascal-search-path)
+ (let ((file (opascal-find-unit-in-directory unit dir)))
+ (if file (throw 'done file))))))
nil))
-(defun delphi-find-unit (unit)
- "Find the specified Delphi source file according to `delphi-search-path'.
+(defun opascal-find-unit (unit)
+ "Find the specified OPascal source file according to `opascal-search-path'.
If no extension is specified, .pas is assumed. Creates a buffer for the unit."
- (interactive "sDelphi unit name: ")
+ (interactive "sOPascal unit name: ")
(let* ((unit-file (if (string-match "^\\(.*\\)\\.[a-z]+$" unit)
unit
(concat unit ".pas")))
- (file (delphi-find-unit-file unit-file)))
+ (file (opascal-find-unit-file unit-file)))
(if (null file)
(error "unit not found: %s" unit-file)
(find-file file)
- (if (not (derived-mode-p 'delphi-mode))
- (delphi-mode)))
+ (if (not (derived-mode-p 'opascal-mode))
+ (opascal-mode)))
file))
-(defun delphi-find-current-def ()
+(defun opascal-find-current-def ()
"Find the definition of the identifier under the current point."
(interactive)
- (error "delphi-find-current-def: not implemented yet"))
+ (error "opascal-find-current-def: not implemented yet"))
-(defun delphi-find-current-xdef ()
+(defun opascal-find-current-xdef ()
"Find the definition of the identifier under the current point, searching
in external units if necessary (as listed in the current unit's use clause).
The set of directories to search for a unit is specified by the global variable
-`delphi-search-path'."
+`opascal-search-path'."
(interactive)
- (error "delphi-find-current-xdef: not implemented yet"))
+ (error "opascal-find-current-xdef: not implemented yet"))
-(defun delphi-find-current-body ()
+(defun opascal-find-current-body ()
"Find the body of the identifier under the current point, assuming
it is a routine."
(interactive)
- (error "delphi-find-current-body: not implemented yet"))
+ (error "opascal-find-current-body: not implemented yet"))
-(defun delphi-fill-comment ()
+(defun opascal-fill-comment ()
"Fill the text of the current comment, according to `fill-column'.
An error is raised if not in a comment."
(interactive)
(save-excursion
(save-restriction
- (let* ((comment (delphi-current-token))
- (comment-kind (delphi-token-kind comment)))
- (if (not (delphi-is comment-kind delphi-comments))
+ (let* ((comment (opascal-current-token))
+ (comment-kind (opascal-token-kind comment)))
+ (if (not (opascal-is comment-kind opascal-comments))
(error "Not in a comment")
- (let* ((start-comment (delphi-comment-block-start comment))
- (end-comment (delphi-comment-block-end comment))
- (comment-start (delphi-token-start start-comment))
- (comment-end (delphi-token-end end-comment))
- (content-start (delphi-comment-content-start start-comment))
- (content-indent (delphi-column-of content-start))
+ (let* ((start-comment (opascal-comment-block-start comment))
+ (end-comment (opascal-comment-block-end comment))
+ (comment-start (opascal-token-start start-comment))
+ (comment-end (opascal-token-end end-comment))
+ (content-start (opascal-comment-content-start start-comment))
+ (content-indent (opascal-column-of content-start))
(content-prefix (make-string content-indent ?\s))
- (content-prefix-re delphi-leading-spaces-re)
+ (content-prefix-re opascal-leading-spaces-re)
(p nil)
(marked-point (point-marker))) ; Maintain our position reliably.
(when (eq 'comment-single-line comment-kind)
;; // style comments need more work.
(setq content-prefix
- (let ((comment-indent (delphi-column-of comment-start)))
+ (let ((comment-indent (opascal-column-of comment-start)))
(concat (make-string comment-indent ?\s) "//"
(make-string (- content-indent comment-indent 2)
?\s)))
- content-prefix-re (concat delphi-leading-spaces-re
+ content-prefix-re (concat opascal-leading-spaces-re
"//"
- delphi-spaces-re)
- comment-end (if (delphi-is-literal-end comment-end)
+ opascal-spaces-re)
+ comment-end (if (opascal-is-literal-end comment-end)
;; Don't include the trailing newline.
(1- comment-end)
comment-end)))
(set-marker marked-point nil)
;; React to the entire fill change as a whole.
- (delphi-progress-start)
- (delphi-parse-region comment-start comment-end)
- (delphi-progress-done)))))))
+ (opascal-progress-start)
+ (opascal-parse-region comment-start comment-end)
+ (opascal-progress-done)))))))
-(defun delphi-new-comment-line ()
+(defun opascal-new-comment-line ()
"If in a // comment, do a newline, indented such that one is still in the
comment block. If not in a // comment, just does a normal newline."
(interactive)
- (let ((comment (delphi-current-token)))
- (if (not (eq 'comment-single-line (delphi-token-kind comment)))
+ (let ((comment (opascal-current-token)))
+ (if (not (eq 'comment-single-line (opascal-token-kind comment)))
;; Not in a // comment. Just do the normal newline.
- (delphi-newline)
- (let* ((start-comment (delphi-comment-block-start comment))
- (comment-start (delphi-token-start start-comment))
- (content-start (delphi-comment-content-start start-comment))
+ (newline)
+ (let* ((start-comment (opascal-comment-block-start comment))
+ (comment-start (opascal-token-start start-comment))
+ (content-start (opascal-comment-content-start start-comment))
(prefix
- (concat (make-string (delphi-column-of comment-start) ?\s) "//"
+ (concat (make-string (opascal-column-of comment-start) ?\s) "//"
(make-string (- content-start comment-start 2) ?\s))))
(delete-horizontal-space)
- (newline)
- (insert prefix)))))
+ (insert "\n" prefix)))))
-(defun delphi-match-token (token limit)
+(defun opascal-match-token (token limit)
;; Sets the match region used by (match-string 0) and friends to the token's
;; region. Sets the current point to the end of the token (or limit).
(set-match-data nil)
(if token
- (let ((end (min (delphi-token-end token) limit)))
- (set-match-data (list (delphi-token-start token) end))
+ (let ((end (min (opascal-token-end token) limit)))
+ (set-match-data (list (opascal-token-start token) end))
(goto-char end)
token)))
-(defconst delphi-font-lock-defaults
+(defconst opascal-font-lock-defaults
'(nil ; We have our own fontify routine, so keywords don't apply.
t ; Syntactic fontification doesn't apply.
nil ; Don't care about case since we don't use regexps to find tokens.
nil ; Syntax alists don't apply.
nil ; Syntax begin movement doesn't apply
- (font-lock-fontify-region-function . delphi-fontify-region)
- (font-lock-verbose . delphi-fontifying-progress-step))
- "Delphi mode font-lock defaults. Syntactic fontification is ignored.")
+ (font-lock-fontify-region-function . opascal-fontify-region)
+ (font-lock-verbose . opascal-fontifying-progress-step))
+ "OPascal mode font-lock defaults. Syntactic fontification is ignored.")
-(defvar delphi-debug-mode-map
+(defvar opascal-debug-mode-map
(let ((kmap (make-sparse-keymap)))
- (mapc #'(lambda (binding) (define-key kmap (car binding) (cadr binding)))
- '(("n" delphi-debug-goto-next-token)
- ("p" delphi-debug-goto-previous-token)
- ("t" delphi-debug-show-current-token)
- ("T" delphi-debug-tokenize-buffer)
- ("W" delphi-debug-tokenize-window)
- ("g" delphi-debug-goto-point)
- ("s" delphi-debug-show-current-string)
- ("a" delphi-debug-parse-buffer)
- ("w" delphi-debug-parse-window)
- ("f" delphi-debug-fontify-window)
- ("F" delphi-debug-fontify-buffer)
- ("r" delphi-debug-parse-region)
- ("c" delphi-debug-unparse-buffer)
- ("x" delphi-debug-show-is-stable)
- ))
+ (dolist (binding '(("n" opascal-debug-goto-next-token)
+ ("p" opascal-debug-goto-previous-token)
+ ("t" opascal-debug-show-current-token)
+ ("T" opascal-debug-tokenize-buffer)
+ ("W" opascal-debug-tokenize-window)
+ ("g" opascal-debug-goto-point)
+ ("s" opascal-debug-show-current-string)
+ ("a" opascal-debug-parse-buffer)
+ ("w" opascal-debug-parse-window)
+ ("f" opascal-debug-fontify-window)
+ ("F" opascal-debug-fontify-buffer)
+ ("r" opascal-debug-parse-region)
+ ("c" opascal-debug-unparse-buffer)
+ ("x" opascal-debug-show-is-stable)))
+ (define-key kmap (car binding) (cadr binding)))
kmap)
- "Keystrokes for Delphi mode debug commands.")
+ "Keystrokes for OPascal mode debug commands.")
-(defvar delphi-mode-map
+(defvar opascal-mode-map
(let ((kmap (make-sparse-keymap)))
- (mapc #'(lambda (binding) (define-key kmap (car binding) (cadr binding)))
- (list '("\r" delphi-newline)
- '("\t" delphi-tab)
- '("\177" backward-delete-char-untabify)
-;; '("\C-cd" delphi-find-current-def)
-;; '("\C-cx" delphi-find-current-xdef)
-;; '("\C-cb" delphi-find-current-body)
- '("\C-cu" delphi-find-unit)
- '("\M-q" delphi-fill-comment)
- '("\M-j" delphi-new-comment-line)
- ;; Debug bindings:
- (list "\C-c\C-d" delphi-debug-mode-map)))
+ (dolist (binding
+ (list ;; '("\C-cd" opascal-find-current-def)
+ ;; '("\C-cx" opascal-find-current-xdef)
+ ;; '("\C-cb" opascal-find-current-body)
+ '("\C-cu" opascal-find-unit)
+ '("\M-q" opascal-fill-comment)
+ '("\M-j" opascal-new-comment-line)
+ ;; Debug bindings:
+ (list "\C-c\C-d" opascal-debug-mode-map)))
+ (define-key kmap (car binding) (cadr binding)))
kmap)
- "Keymap used in Delphi mode.")
+ "Keymap used in OPascal mode.")
+(define-obsolete-variable-alias 'delphi-mode-hook 'opascal-mode-hook "24.4")
;;;###autoload
-(define-derived-mode delphi-mode prog-mode "Delphi"
- "Major mode for editing Delphi code. \\<delphi-mode-map>
-\\[delphi-tab]\t- Indents the current line (or region, if Transient Mark mode
-\t is enabled and the region is active) of Delphi code.
-\\[delphi-find-unit]\t- Search for a Delphi source file.
-\\[delphi-fill-comment]\t- Fill the current comment.
-\\[delphi-new-comment-line]\t- If in a // comment, do a new comment line.
+(define-obsolete-function-alias 'delphi-mode 'opascal-mode "24.4")
+;;;###autoload
+(define-derived-mode opascal-mode prog-mode "OPascal"
+ "Major mode for editing OPascal code. \\<opascal-mode-map>
+\\[opascal-find-unit]\t- Search for a OPascal source file.
+\\[opascal-fill-comment]\t- Fill the current comment.
+\\[opascal-new-comment-line]\t- If in a // comment, do a new comment line.
\\[indent-region] also works for indenting a whole region.
Customization:
- `delphi-indent-level' (default 3)
- Indentation of Delphi statements with respect to containing block.
- `delphi-compound-block-indent' (default 0)
+ `opascal-indent-level' (default 3)
+ Indentation of OPascal statements with respect to containing block.
+ `opascal-compound-block-indent' (default 0)
Extra indentation for blocks in compound statements.
- `delphi-case-label-indent' (default 0)
+ `opascal-case-label-indent' (default 0)
Extra indentation for case statement labels.
- `delphi-tab-always-indents' (default t)
- Non-nil means TAB in Delphi mode should always reindent the current line,
+ `opascal-tab-always-indents' (default `tab-always-indents')
+ Non-nil means TAB in OPascal mode should always reindent the current line,
regardless of where in the line point is when the TAB command is used.
- `delphi-newline-always-indents' (default t)
- Non-nil means NEWLINE in Delphi mode should always reindent the current
- line, insert a blank line and move to the default indent column of the
- blank line.
- `delphi-search-path' (default .)
+ `opascal-search-path' (default .)
Directories to search when finding external units.
- `delphi-verbose' (default nil)
- If true then Delphi token processing progress is reported to the user.
+ `opascal-verbose' (default nil)
+ If true then OPascal token processing progress is reported to the user.
Coloring:
- `delphi-comment-face' (default font-lock-comment-face)
- Face used to color Delphi comments.
- `delphi-string-face' (default font-lock-string-face)
- Face used to color Delphi strings.
- `delphi-keyword-face' (default font-lock-keyword-face)
- Face used to color Delphi keywords.
- `delphi-other-face' (default nil)
+ `opascal-comment-face' (default font-lock-comment-face)
+ Face used to color OPascal comments.
+ `opascal-string-face' (default font-lock-string-face)
+ Face used to color OPascal strings.
+ `opascal-keyword-face' (default font-lock-keyword-face)
+ Face used to color OPascal keywords.
+ `opascal-other-face' (default nil)
Face used to color everything else.
-Turning on Delphi mode calls the value of the variable `delphi-mode-hook'
+Turning on OPascal mode calls the value of the variable `opascal-mode-hook'
with no args, if that value is non-nil."
;; Buffer locals:
- (mapc #'(lambda (var)
- (let ((var-symb (car var))
- (var-val (cadr var)))
- (set (make-local-variable var-symb) var-val)))
- (list '(indent-line-function delphi-indent-line)
- '(comment-indent-function delphi-indent-line)
- '(case-fold-search t)
- '(delphi-progress-last-reported-point nil)
- '(delphi-ignore-changes nil)
- (list 'font-lock-defaults delphi-font-lock-defaults)))
-
+ (setq-local indent-line-function #'opascal-indent-line)
+ (setq-local comment-indent-function #'opascal-indent-line)
+ (setq-local case-fold-search t)
+ (setq-local opascal-progress-last-reported-point nil)
+ (setq-local opascal--ignore-changes nil)
+ (setq-local font-lock-defaults opascal-font-lock-defaults)
+ (setq-local tab-always-indent opascal-tab-always-indents)
+
+ ;; FIXME: Use syntax-propertize-function to tokenize, maybe?
+
;; We need to keep track of changes to the buffer to determine if we need
;; to retokenize changed text.
- (add-hook 'after-change-functions 'delphi-after-change nil t)
-
- (widen)
-
- (delphi-save-excursion
- (let ((delphi-verbose t))
- (delphi-progress-start)
- (delphi-parse-region (point-min) (point-max))
- (delphi-progress-done)))
+ (add-hook 'after-change-functions #'opascal-after-change nil t)
- (run-mode-hooks 'delphi-mode-hook))
+ (opascal-save-excursion
+ (let ((opascal-verbose t))
+ (opascal-progress-start)
+ (opascal-parse-region (point-min) (point-max))
+ (opascal-progress-done))))
-;;; delphi.el ends here
+(provide 'opascal)
+;;; opascal.el ends here
;; find about the syntax of Pascal's comments said that (* ... } is
;; a valid comment, just as { ... *) or (* ... *) or { ... }.
(modify-syntax-entry ?* ". 23" st)
+ ;; Allow //...\n comments as accepted by Free Pascal (bug#13585).
+ (modify-syntax-entry ?/ ". 12c" st)
+ (modify-syntax-entry ?\n "> c" st)
(modify-syntax-entry ?{ "<" st)
(modify-syntax-entry ?} ">" st)
(modify-syntax-entry ?+ "." st)
-;;; 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)
;; encounters an exception, it prints the _entire_ stack
;; trace. To handle all of these cases, we want to find
;; the _last_ stack frame printed in the most recent
- ;; batch of output, then jump to the corrsponding
+ ;; batch of output, then jump to the corresponding
;; file/line number.
(goto-char (point-max))
(when (re-search-backward python-pdbtrack-stacktrace-info-regexp nil t)
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 (ruby-calculate-indent))
+ (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,
1 font-lock-function-name-face)
;; keywords
(cons (concat
- "\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(defined\\?\\|"
+ "\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(defined\\?\\|"
(regexp-opt
'("alias_method"
"alias"
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\\)\\>"
+ '("\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(nil\\|self\\|true\\|false\\)\\>"
2 font-lock-variable-name-face)
;; symbols
'("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
'("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+"
0 font-lock-variable-name-face)
;; constants
- '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)"
- 2 font-lock-type-face)
+ '("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)"
+ 1 font-lock-type-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+\\s-*[.]\\s-*\\)*\\w+\\)" 1)
+ ("Sequences" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*sequence\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1)
+ ("Triggers" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*trigger\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1)
+ ("Functions" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?function\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1)
+ ("Procedures" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?proc\\(?:edure\\)?\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1)
+ ("Packages" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*package\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1)
+ ("Types" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*type\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1)
+ ("Indexes" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*index\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1)
+ ("Tables/Views" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:table\\|view\\)\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\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-+"
- "\\(\\w+\\)")
+ "\\(?:if\\s-+not\\s-+exists\\s-+\\)?" ;; IF NOT EXISTS
+ "\\(\\w+\\(?:\\s-*[.]\\s-*\\w+\\)*\\)")
1 'font-lock-function-name-face))
"Pattern to match the names of top-level objects.
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)))
+ (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))
- (cond
- ((eq token 'user) ; 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
Allows the suppression of continuation prompts.")
-(defvar sql-output-by-send nil
- "Non-nil if the command in the input was generated by `sql-send-string'.")
-
(defun sql-input-sender (proc string)
"Send STRING to PROC after applying filters."
(if (= sql-output-newline-count 0)
(setq sql-output-newline-count nil
- oline (concat "\n" oline)
- sql-output-by-send nil)
+ oline (concat "\n" oline))
(setq sql-preoutput-hold oline
oline ""))
(setq sql-output-newline-count
(if sql-output-newline-count
(1+ sql-output-newline-count)
- 1)))
- (setq sql-output-by-send t)))
+ 1)))))
(defun sql-remove-tabs-filter (str)
"Replace tab characters with spaces."
(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
(sql-get-product-feature sql-product :prompt-cont-regexp))
(make-local-variable 'sql-output-newline-count)
(make-local-variable 'sql-preoutput-hold)
- (make-local-variable 'sql-output-by-send)
(add-hook 'comint-preoutput-filter-functions
'sql-interactive-remove-continuation-prompt nil t)
(make-local-variable 'sql-input-ring-separator)
;; Was one selected
(when connection
;; Get connection settings
- (let ((connect-set (assoc connection sql-connection-alist)))
+ (let ((connect-set (assoc-string connection sql-connection-alist t)))
;; Settings are defined
(if connect-set
;; Set the desired parameters
(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...")
(setq sql-buffer (buffer-name new-sqli-buffer))
(run-hooks 'sql-set-sqli-hook)))
+ ;; Make sure the connection is complete
+ ;; (Sometimes start up can be slow)
+ ;; and call the login hook
+ (let ((proc (get-buffer-process new-sqli-buffer)))
+ (while (and (memq (process-status proc) '(open run))
+ (accept-process-output proc 2.5)
+ (progn (goto-char (point-max))
+ (not (looking-back sql-prompt-regexp))))))
+ (run-hooks 'sql-login-hook)
;; All done.
(message "Login...done")
- (run-hooks 'sql-login-hook)
(pop-to-buffer new-sqli-buffer)))))
(message "No default SQL product defined. Set `sql-product'.")))
;; is meaningless; database without user/password is meaningless,
;; because "@param" will ask sqlplus to interpret the script
;; "param".
- (let ((parameter nil))
+ (let (parameter nlslang coding)
(if (not (string= "" sql-user))
(if (not (string= "" sql-password))
(setq parameter (concat sql-user "/" sql-password))
(if parameter
(setq parameter (nconc (list parameter) options))
(setq parameter options))
- (sql-comint product parameter)))
+ (sql-comint product parameter)
+ ;; Set process coding system to agree with the interpreter
+ (setq nlslang (or (getenv "NLS_LANG") "")
+ coding (dolist (cs
+ ;; Are we missing any common NLS character sets
+ '(("US8PC437" . cp437)
+ ("EL8PC737" . cp737)
+ ("WE8PC850" . cp850)
+ ("EE8PC852" . cp852)
+ ("TR8PC857" . cp857)
+ ("WE8PC858" . cp858)
+ ("IS8PC861" . cp861)
+ ("IW8PC1507" . cp862)
+ ("N8PC865" . cp865)
+ ("RU8PC866" . cp866)
+ ("US7ASCII" . us-ascii)
+ ("UTF8" . utf-8)
+ ("AL32UTF8" . utf-8)
+ ("AL16UTF16" . utf-16))
+ (or coding 'utf-8))
+ (when (string-match (format "\\.%s\\'" (car cs)) nlslang)
+ (setq coding (cdr cs)))))
+ (set-buffer-process-coding-system coding coding)))
(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
(when (and (null name)
(boundp 'imenu--index-alist) (null imenu--index-alist)
(null which-function-imenu-failed))
- (imenu--make-index-alist t)
+ (ignore-errors (imenu--make-index-alist t))
(unless imenu--index-alist
(set (make-local-variable 'which-function-imenu-failed) t)))
;; If we have an index alist, use it.
namestack (cons (car pair) namestack)
alist (cdr pair)))
- ((number-or-marker-p (setq mark (cdr pair)))
+ ((or (number-or-marker-p (setq mark (cdr pair)))
+ (and (overlayp mark)
+ (setq mark (overlay-start mark))))
(when (and (>= (setq offset (- (point) mark)) 0)
(< offset minoffset)) ; Find the closest item.
(setq minoffset offset
Any other value is treated as nil.
-If you set `ps-selected-pages' (see it for documentation), first the pages are
-filtered by `ps-selected-pages' and then by `ps-even-or-odd-pages'. For
-example, if we have:
+If you set option `ps-selected-pages', first the pages are
+filtered by option `ps-selected-pages' and then by `ps-even-or-odd-pages'.
+For example, if we have:
(setq ps-selected-pages '(1 4 (6 . 10) (12 . 16) 20))
-Combining with `ps-even-or-odd-pages' and `ps-n-up-printing', we have:
+Combining with `ps-even-or-odd-pages' and option `ps-n-up-printing', we have:
`ps-n-up-printing' = 1:
`ps-even-or-odd-pages' PAGES PRINTED
;;;###autoload
(defun ps-spool-buffer-with-faces ()
"Generate and spool a PostScript image of the buffer.
-Like `ps-spool-buffer', but includes font, color, and underline information in
-the generated image. This command works only if you are using a window system,
-so it has a way to determine color values.
+Like the command `ps-spool-buffer', but includes font, color, and underline
+information in the generated image. This command works only if you are using
+a window system, so it has a way to determine color values.
Use the command `ps-despool' to send the spooled images to the printer."
(interactive)
(KIND XCOL YCOL XLIN YLIN REPEAT END XSTART YSTART)
Where:
-KIND is a valid value of `ps-n-up-filling'.
+KIND is a valid value of the variable `ps-n-up-filling'.
XCOL YCOL are the relative position for the next column.
XLIN YLIN are the relative position for the beginning of next line.
REPEAT is the number of repetitions for external loop.
(defconst server-buffer " *server*"
"Buffer used internally by Emacs's server.
-One use is to log the I/O for debugging purposes (see `server-log'),
+One use is to log the I/O for debugging purposes (see option `server-log'),
the other is to provide a current buffer in which the process filter can
safely let-bind buffer-local variables like `default-directory'.")
"If non-nil, log the server's inputs and outputs in the `server-buffer'.")
(defun server-log (string &optional client)
- "If `server-log' is non-nil, log STRING to `server-buffer'.
+ "If option `server-log' is non-nil, log STRING to `server-buffer'.
If CLIENT is non-nil, add a description of it to the logged message."
(when server-log
(with-current-buffer (get-buffer-create server-buffer)
(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.
Other major modes are defined by comparison with this one."
(interactive)
(kill-all-local-variables)
- (unless delay-mode-hooks
- (run-hooks 'after-change-major-mode-hook)))
+ (run-mode-hooks))
;; Special major modes to view specially formatted data rather than files.
(suppress-keymap map)
(define-key map "q" 'quit-window)
(define-key map " " 'scroll-up-command)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map "\C-?" 'scroll-down-command)
(define-key map "?" 'describe-mode)
(define-key map "h" 'describe-mode)
(defun newline (&optional arg)
"Insert a newline, and move to left margin of the new line if it's blank.
-If `use-hard-newlines' is non-nil, the newline is marked with the
+If option `use-hard-newlines' is non-nil, the newline is marked with the
text-property `hard'.
With ARG, insert that many newlines.
Call `auto-fill-function' if the current column number is greater
"Delete all spaces and tabs around point, leaving one space (or N spaces).
If N is negative, delete newlines as well, leaving -N spaces."
(interactive "*p")
- (unless n (setq n 1))
- (let ((orig-pos (point))
- (skip-characters (if (< n 0) " \t\n\r" " \t"))
- (n (abs n)))
- (skip-chars-backward skip-characters)
+ (cycle-spacing n nil t))
+
+(defvar cycle-spacing--context nil
+ "Store context used in consecutive calls to `cycle-spacing' command.
+The first time this function is run, it saves the original point
+position and original spacing around the point in this
+variable.")
+
+(defun cycle-spacing (&optional n preserve-nl-back single-shot)
+ "Manipulate spaces around the point in a smart way.
+
+When run as an interactive command, the first time it's called
+in a sequence, deletes all spaces and tabs around point leaving
+one (or N spaces). If this does not change content of the
+buffer, skips to the second step:
+
+When run for the second time in a sequence, deletes all the
+spaces it has previously inserted.
+
+When run for the third time, returns the whitespace and point in
+a state encountered when it had been run for the first time.
+
+For example, if buffer contains \"foo ^ bar\" with \"^\" denoting the
+point, calling `cycle-spacing' command will replace two spaces with
+a single space, calling it again immediately after, will remove all
+spaces, and calling it for the third time will bring two spaces back
+together.
+
+If N is negative, delete newlines as well. However, if
+PRESERVE-NL-BACK is t new line characters prior to the point
+won't be removed.
+
+If SINGLE-SHOT is non-nil, will only perform the first step. In
+other words, it will work just like `just-one-space' command."
+ (interactive "*p")
+ (let ((orig-pos (point))
+ (skip-characters (if (and n (< n 0)) " \t\n\r" " \t"))
+ (n (abs (or n 1))))
+ (skip-chars-backward (if preserve-nl-back " \t" skip-characters))
(constrain-to-field nil orig-pos)
- (dotimes (i n)
- (if (= (following-char) ?\s)
- (forward-char 1)
- (insert ?\s)))
- (delete-region
- (point)
- (progn
- (skip-chars-forward skip-characters)
- (constrain-to-field nil orig-pos t)))))
+ (cond
+ ;; Command run for the first time or single-shot is non-nil.
+ ((or single-shot
+ (not (equal last-command this-command))
+ (not cycle-spacing--context))
+ (let* ((start (point))
+ (n (- n (skip-chars-forward " " (+ n (point)))))
+ (mid (point))
+ (end (progn
+ (skip-chars-forward skip-characters)
+ (constrain-to-field nil orig-pos t))))
+ (setq cycle-spacing--context ;; Save for later.
+ ;; Special handling for case where there was no space at all.
+ (unless (= start end)
+ (cons orig-pos (buffer-substring start (point)))))
+ ;; If this run causes no change in buffer content, delete all spaces,
+ ;; otherwise delete all excess spaces.
+ (delete-region (if (and (not single-shot) (zerop n) (= mid end))
+ start mid) end)
+ (insert (make-string n ?\s))))
+
+ ;; Command run for the second time.
+ ((not (equal orig-pos (point)))
+ (delete-region (point) orig-pos))
+
+ ;; Command run for the third time.
+ (t
+ (insert (cdr cycle-spacing--context))
+ (goto-char (car cycle-spacing--context))
+ (setq cycle-spacing--context nil)))))
\f
(defun beginning-of-buffer (&optional arg)
"Move point to the beginning of the buffer.
;; If we went to a place in the middle of the buffer,
;; adjust it to the beginning of a line.
(cond ((and arg (not (consp arg))) (forward-line 1))
- ((> (point) (window-end nil t))
+ ((and (eq (current-buffer) (window-buffer))
+ (> (point) (window-end nil t)))
;; If the end of the buffer is not already on the screen,
;; then scroll specially to put it near, but not at, the bottom.
(overlay-recenter (point))
"Delete the previous N characters (following if N is negative).
If Transient Mark mode is enabled, the mark is active, and N is 1,
delete the text in the region and deactivate the mark instead.
-To disable this, set `delete-active-region' to nil.
+To disable this, set option `delete-active-region' to nil.
Optional second arg KILLFLAG, if non-nil, means to kill (save in
kill ring) instead of delete. Interactively, N is the prefix
"Delete the following N characters (previous if N is negative).
If Transient Mark mode is enabled, the mark is active, and N is 1,
delete the text in the region and deactivate the mark instead.
-To disable this, set `delete-active-region' to nil.
+To disable this, set variable `delete-active-region' to nil.
Optional second arg KILLFLAG non-nil means to kill (save in kill
ring) instead of delete. Interactively, N is the prefix arg, and
If there are no search errors, this function displays an overlay with
the isearch prompt which replaces the original minibuffer prompt.
Otherwise, it displays the standard isearch message returned from
-`isearch-message'."
+the function `isearch-message'."
(if (not (and (minibufferp) isearch-success (not isearch-error)))
;; Use standard function `isearch-message' when not in the minibuffer,
;; or search fails, or has an error (like incomplete regexp).
"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
kill the rest of the current line, even if there are only
nonblanks there.
-If `kill-whole-line' is non-nil, then this command kills the whole line
+If option `kill-whole-line' is non-nil, then this command kills the whole line
including its terminating newline, when used at the beginning of a line
with no argument. As a consequence, you can always kill a whole line
by typing \\[move-beginning-of-line] \\[kill-line].
(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)))
"Non-nil means vertical motion starting at end of line keeps to ends of lines.
This means moving to the end of each line moved onto.
The beginning of a blank line does not count as the end of a line.
-This has no effect when `line-move-visual' is non-nil."
+This has no effect when the variable `line-move-visual' is non-nil."
:type 'boolean
:group 'editing-basics)
(defcustom goal-column nil
"Semipermanent goal column for vertical motion, as set by \\[set-goal-column], or nil.
-A non-nil setting overrides `line-move-visual', which see."
+A non-nil setting overrides the variable `line-move-visual', which see."
:type '(choice integer
(const :tag "None" nil))
:group 'editing-basics)
It is the column where point was at the start of the current run
of vertical motion commands.
-When moving by visual lines via `line-move-visual', it is a cons
+When moving by visual lines via the function `line-move-visual', it is a cons
cell (COL . HSCROLL), where COL is the x-position, in pixels,
divided by the default column width, and HSCROLL is the number of
columns by which window is scrolled from left margin.
(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
(locate-file "simple" load-path (get-load-suffixes)))
lisp-dir)
;; Don't abort if simple.el cannot be found, but print a warning.
+ ;; Although in most usage we are going to cryptically abort a moment
+ ;; later anyway, due to missing required bidi data files (eg bug#13430).
(if (null simple-file-name)
- (progn
- (princ "Warning: Could not find simple.el nor simple.elc"
- 'external-debugging-output)
- (terpri 'external-debugging-output))
+ (let ((standard-output 'external-debugging-output)
+ (lispdir (expand-file-name "../lisp" data-directory)))
+ (princ "Warning: Could not find simple.el or simple.elc")
+ (terpri)
+ (when (getenv "EMACSLOADPATH")
+ (princ "The EMACSLOADPATH environment variable is set, \
+please check its value")
+ (terpri))
+ (unless (file-readable-p lispdir)
+ (princ (format "Lisp directory %s not readable?" lispdir))
+ (terpri)))
(setq lisp-dir (file-truename (file-name-directory simple-file-name)))
(setq load-history
(mapcar (lambda (elt)
(suppress-keymap map)
(set-keymap-parent map button-buffer-map)
(define-key map "\C-?" 'scroll-down-command)
+ (define-key map [?\S-\ ] 'scroll-down-command)
(define-key map " " 'scroll-up-command)
(define-key map "q" 'exit-splash-screen)
map)
: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")
(make-obsolete-variable 'default-scroll-down-aggressively 'scroll-down-aggressively "23.2")
(make-obsolete-variable 'default-fill-column 'fill-column "23.2")
(make-obsolete-variable 'default-cursor-type 'cursor-type "23.2")
-(make-obsolete-variable 'default-buffer-file-type 'buffer-file-type "23.2")
(make-obsolete-variable 'default-cursor-in-non-selected-windows 'cursor-in-non-selected-windows "23.2")
(make-obsolete-variable 'default-buffer-file-coding-system 'buffer-file-coding-system "23.2")
(make-obsolete-variable 'default-major-mode 'major-mode "23.2")
This hook is normally set up with a function to put the buffer in Help
mode.")
-(defvar-local buffer-file-type nil
- "Non-nil if the visited file is a binary file.
-This variable is meaningful on MS-DOG and MS-Windows.
-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.
-Don't use it!")
-
;; The `assert' macro from the cl package signals
;; `cl-assertion-failed' at runtime so always define it.
(put 'cl-assertion-failed 'error-conditions '(error))
(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)))
(progn ,@body)))))))
(defmacro condition-case-unless-debug (var bodyform &rest handlers)
- "Like `condition-case' except that it does not catch anything when debugging.
-More specifically if `debug-on-error' is set, then it does not catch any signal."
+ "Like `condition-case' except that it does not prevent debugging.
+More specifically if `debug-on-error' is set then the debugger will be invoked
+even if this catches the signal."
(declare (debug condition-case) (indent 2))
- (let ((bodysym (make-symbol "body")))
- `(let ((,bodysym (lambda () ,bodyform)))
- (if debug-on-error
- (funcall ,bodysym)
- (condition-case ,var
- (funcall ,bodysym)
- ,@handlers)))))
+ `(condition-case ,var
+ ,bodyform
+ ,@(mapcar (lambda (handler)
+ `((debug ,@(if (listp (car handler)) (car handler)
+ (list (car handler))))
+ ,@(cdr handler)))
+ handlers)))
(define-obsolete-function-alias 'condition-case-no-debug
'condition-case-unless-debug "24.1")
(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)
+ (unless (boundp ',sym)
+ (let ((i 1))
+ (while (not (eq (indirect-function (nth 1 (backtrace-frame i)) t)
+ (indirect-function 'called-interactively-p)))
+ (setq i (1+ i)))
+ (setq ,sym 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.
"Non-nil means Flyspell reports a repeated word as an error.
See `flyspell-mark-duplications-exceptions' to add exceptions to this rule.
Detection of repeated words is not implemented in
-\"large\" regions; see `flyspell-large-region'."
+\"large\" regions; see variable `flyspell-large-region'."
:group 'flyspell
:type 'boolean)
(defcustom flyspell-default-deplacement-commands
'(next-line previous-line
handle-switch-frame handle-select-window
- scroll-up scroll-down)
+ scroll-up
+ scroll-down)
"The standard list of deplacement commands for Flyspell.
-See `flyspell-deplacement-commands'."
+See variable `flyspell-deplacement-commands'."
:group 'flyspell
:version "21.1"
:type '(repeat (symbol)))
;;*---------------------------------------------------------------------*/
;;* 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
(make-obsolete-variable 'ispell-aspell-supports-utf8
'ispell-encoding8-command "23.1")
+(defvar ispell-hunspell-dictionary-equivs-alist
+ '(("american" "en_US")
+ ("brasileiro" "pt_BR")
+ ("british" "en_GB")
+ ("castellano" "es_ES")
+ ("castellano8" "es_ES")
+ ("czech" "cs_CZ")
+ ("dansk" "da_DK")
+ ("deutsch" "de_DE")
+ ("deutsch8" "de_DE")
+ ("english" "en_US")
+ ("esperanto" "eo")
+ ("esperanto-tex" "eo")
+ ("finnish" "fi_FI")
+ ("francais7" "fr_FR")
+ ("francais" "fr_FR")
+ ("francais-tex" "fr_FR")
+ ("german" "de_DE")
+ ("german8" "de_DE")
+ ("italiano" "it_IT")
+ ("nederlands" "nl_NL")
+ ("nederlands8" "nl_NL")
+ ("norsk" "nn_NO")
+ ("norsk7-tex" "nn_NO")
+ ("polish" "pl_PL")
+ ("portugues" "pt_PT")
+ ("russian" "ru_RU")
+ ("russianw" "ru_RU")
+ ("slovak" "sk_SK")
+ ("slovenian" "sl_SI")
+ ("svenska" "sv_SE")
+ ("hebrew" "he_IL"))
+ "Alist with matching hunspell dict names for standard dict names in
+ `ispell-dictionary-base-alist'.")
+
(defvar ispell-emacs-alpha-regexp
(if (string-match "^[[:alpha:]]+$" "abcde")
"[[:alpha:]]"
(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
ispell-encoding8-command)
ispell-aspell-dictionary-alist
nil))
+ (ispell-dictionary-base-alist ispell-dictionary-base-alist)
ispell-base-dicts-override-alist ; Override only base-dicts-alist
all-dicts-alist)
+ ;; While ispell and aspell (through aliases) use the traditional
+ ;; dict naming originally expected by ispell.el, hunspell
+ ;; uses locale based names with no alias. We need to map
+ ;; standard names to locale based names to make default dict
+ ;; definitions available for hunspell.
+ (if ispell-really-hunspell
+ (let (tmp-dicts-alist)
+ (dolist (adict ispell-dictionary-base-alist)
+ (let* ((dict-name (nth 0 adict))
+ (dict-equiv
+ (cadr (assoc dict-name
+ ispell-hunspell-dictionary-equivs-alist)))
+ (ispell-args (nth 5 adict))
+ (ispell-args-has-d (member "-d" ispell-args))
+ skip-dict)
+ ;; Remove "-d" option from `ispell-args' if present
+ (if ispell-args-has-d
+ (let ((ispell-args-after-d
+ (cdr (cdr ispell-args-has-d)))
+ (ispell-args-before-d
+ (butlast ispell-args (length ispell-args-has-d))))
+ (setq ispell-args
+ (nconc ispell-args-before-d
+ ispell-args-after-d))))
+ ;; Unless default dict, re-add "-d" option with the mapped value
+ (if dict-name
+ (if dict-equiv
+ (nconc ispell-args (list "-d" dict-equiv))
+ (message
+ "ispell-set-spellchecker-params: Missing hunspell equiv for \"%s\". Skipping."
+ dict-name)
+ (setq skip-dict t)))
+
+ (unless skip-dict
+ (add-to-list 'tmp-dicts-alist
+ (list
+ dict-name ; dict name
+ (nth 1 adict) ; casechars
+ (nth 2 adict) ; not-casechars
+ (nth 3 adict) ; otherchars
+ (nth 4 adict) ; many-otherchars-p
+ ispell-args ; ispell-args
+ (nth 6 adict) ; extended-character-mode
+ (nth 7 adict) ; dict encoding
+ ))))
+ (setq ispell-dictionary-base-alist tmp-dicts-alist))))
+
(run-hooks 'ispell-initialize-spellchecker-hook)
;; Add dicts to ``ispell-dictionary-alist'' unless already present.
(defun ispell-accept-output (&optional timeout-secs timeout-msecs)
"Wait for output from ispell process, or TIMEOUT-SECS and TIMEOUT-MSECS.
-If asynchronous subprocesses are not supported, call `ispell-filter' and
-pass it the output of the last ispell invocation."
+If asynchronous subprocesses are not supported, call function `ispell-filter'
+and pass it the output of the last ispell invocation."
(if ispell-async-processp
(accept-process-output ispell-process timeout-secs timeout-msecs)
(if (null ispell-process)
(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 ()
((= l ?k) (reftex-get-bib-field "key" entry))
((= l ?m) (reftex-get-bib-field "month" entry))
((= l ?n) (reftex-get-bib-field "number" entry))
+ ((= l ?N) (reftex-get-bib-field "note" entry))
((= l ?o) (reftex-get-bib-field "organization" entry))
((= l ?p) (reftex-get-bib-field "pages" entry))
((= l ?P) (car (split-string
"[- .]+")))
((= l ?s) (reftex-get-bib-field "school" entry))
((= l ?u) (reftex-get-bib-field "publisher" entry))
+ ((= l ?U) (reftex-get-bib-field "url" entry))
((= l ?r) (reftex-get-bib-field "address" entry))
((= l ?t) (reftex-get-bib-field "title" entry))
((= l ?T) (reftex-abbreviate-title
;; 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)))))
%e Works like %a, but on list of editor names. (%2e and %E work a well)
It is also possible to access all other BibTeX database fields:
-%b booktitle %c chapter %d edition %h howpublished
-%i institution %j journal %k key %m month
-%n number %o organization %p pages %P first page
-%r address %s school %u publisher %t title
-%v volume %y year
-%B booktitle, abbreviated %T title, abbreviated
+%b booktitle %c chapter %d edition %h howpublished
+%i institution %j journal %k key %m month
+%n number %N note %o organization %p pages
+%P first page %r address %s school %u publisher
+%U url %t title %v volume %y year
+%B booktitle, abbreviated %T title, abbreviated
Usually, only %l is needed. The other stuff is mainly for the echo area
display, and for (setq reftex-comment-citations t).
(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)
))))
("ul" . "Unordered list")
("var" . "Math variable face")
("wbr" . "Enable <br> within <nobr>"))
- "Value of `sgml-tag-help' for HTML mode.")
+ "Value of variable `sgml-tag-help' for HTML mode.")
(defvar outline-regexp)
(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
(put 'defun 'end-op 'end-of-defun)
(put 'defun 'forward-op 'end-of-defun)
-;; Filenames and URLs www.com/foo%32bar
+;; Filenames
(defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:"
"Characters allowable in filenames.")
(forward-char)
(goto-char (point-min)))))
+;; URIs
+
+(defvar thing-at-point-beginning-of-url-regexp nil
+ "Regexp matching the beginning of a well-formed URI.
+If nil, construct the regexp from `thing-at-point-uri-schemes'.")
+
(defvar thing-at-point-url-path-regexp
"[^]\t\n \"'<>[^`{}]*[^]\t\n \"'<>[^`{}.,;]+"
- "A regular expression probably matching the host and filename or e-mail part of a URL.")
+ "Regexp matching the host and filename or e-mail part of a URL.")
(defvar thing-at-point-short-url-regexp
(concat "[-A-Za-z0-9]+\\.[-A-Za-z0-9.]+" thing-at-point-url-path-regexp)
- "A regular expression probably matching a URL without an access scheme.
-Hostname matching is stricter in this case than for
-``thing-at-point-url-regexp''.")
+ "Regexp matching a URI without a scheme component.")
(defvar thing-at-point-uri-schemes
;; Officials from http://www.iana.org/assignments/uri-schemes.html
- '("ftp://" "http://" "gopher://" "mailto:" "news:" "nntp:"
- "telnet://" "wais://" "file:/" "prospero:" "z39.50s:" "z39.50r:"
- "cid:" "mid:" "vemmi:" "service:" "imap:" "nfs:" "acap:" "rtsp:"
- "tip:" "pop:" "data:" "dav:" "opaquelocktoken:" "sip:" "tel:" "fax:"
- "modem:" "ldap:" "https://" "soap.beep:" "soap.beeps:" "urn:" "go:"
- "afs:" "tn3270:" "mailserver:"
- "crid:" "dict:" "dns:" "dtn:" "h323:" "im:" "info:" "ipp:"
- "iris.beep:" "mtqp:" "mupdate:" "pres:" "sips:" "snmp:" "tag:"
- "tftp:" "xmlrpc.beep:" "xmlrpc.beeps:" "xmpp:"
- ;; Compatibility
- "snews:" "irc:" "mms://" "mmsh://")
- "Uniform Resource Identifier (URI) Schemes.")
-
-(defvar thing-at-point-url-regexp
- (concat "\\<\\(" (mapconcat 'identity thing-at-point-uri-schemes "\\|") "\\)"
- thing-at-point-url-path-regexp)
- "A regular expression probably matching a complete URL.")
-
-(defvar thing-at-point-markedup-url-regexp
- "<URL:[^>]+>"
- "A regular expression matching a URL marked up per RFC1738.
-This may contain whitespace (including newlines) .")
+ '("aaa://" "about:" "acap://" "apt:" "bzr://" "bzr+ssh://"
+ "attachment:/" "chrome://" "cid:" "content://" "crid://" "cvs://"
+ "data:" "dav:" "dict://" "doi:" "dns:" "dtn:" "feed:" "file:/"
+ "finger://" "fish://" "ftp://" "geo:" "git://" "go:" "gopher://"
+ "h323:" "http://" "https://" "im:" "imap://" "info:" "ipp:"
+ "irc://" "irc6://" "ircs://" "iris.beep:" "jar:" "ldap://"
+ "ldaps://" "mailto:" "mid:" "mtqp://" "mupdate://" "news:"
+ "nfs://" "nntp://" "opaquelocktoken:" "pop://" "pres:"
+ "resource://" "rmi://" "rsync://" "rtsp://" "rtspu://" "service:"
+ "sftp://" "sip:" "sips:" "smb://" "sms:" "snmp://" "soap.beep://"
+ "soap.beeps://" "ssh://" "svn://" "svn+ssh://" "tag:" "tel:"
+ "telnet://" "tftp://" "tip://" "tn3270://" "udp://" "urn:"
+ "uuid:" "vemmi://" "webcal://" "xri://" "xmlrpc.beep://"
+ "xmlrpc.beeps://" "z39.50r://" "z39.50s://" "xmpp:"
+ ;; Compatibility
+ "fax:" "mms://" "mmsh://" "modem:" "prospero:" "snews:"
+ "wais://")
+ "List of URI schemes recognized by `thing-at-point-url-at-point'.
+Each string in this list should correspond to the start of a
+URI's scheme component, up to and including the trailing // if
+the scheme calls for that to be present.")
+
+(defvar thing-at-point-markedup-url-regexp "<URL:\\([^<>\n]+\\)>"
+ "Regexp matching a URL marked up per RFC1738.
+This kind of markup was formerly recommended as a way to indicate
+URIs, but as of RFC 3986 it is no longer recommended.
+Subexpression 1 should contain the delimited URL.")
+
+(defvar thing-at-point-newsgroup-regexp
+ "\\`[[:lower:]]+\\.[-+[:lower:]_0-9.]+\\'"
+ "Regexp matching a newsgroup name.")
+
+(defvar thing-at-point-newsgroup-heads
+ '("alt" "comp" "gnu" "misc" "news" "sci" "soc" "talk")
+ "Used by `thing-at-point-newsgroup-p' if gnus is not running.")
+
+(defvar thing-at-point-default-mail-uri-scheme "mailto"
+ "Default scheme for ill-formed URIs that look like <foo@example.com>.
+If nil, do not give such URIs a scheme.")
(put 'url 'bounds-of-thing-at-point 'thing-at-point-bounds-of-url-at-point)
-(defun thing-at-point-bounds-of-url-at-point ()
- (let ((strip (thing-at-point-looking-at
- thing-at-point-markedup-url-regexp))) ;; (url "") short
- (if (or strip
- (thing-at-point-looking-at thing-at-point-url-regexp)
- ;; Access scheme omitted?
- ;; (setq short (thing-at-point-looking-at
- ;; thing-at-point-short-url-regexp))
- )
- (let ((beginning (match-beginning 0))
- (end (match-end 0)))
- (when strip
- (setq beginning (+ beginning 5))
- (setq end (- end 1)))
- (cons beginning end)))))
+
+(defun thing-at-point-bounds-of-url-at-point (&optional lax)
+ "Return a cons cell containing the start and end of the URI at point.
+Try to find a URI using `thing-at-point-markedup-url-regexp'.
+If that fails, try with `thing-at-point-beginning-of-url-regexp'.
+If that also fails, and optional argument LAX is non-nil, return
+the bounds of a possible ill-formed URI (one lacking a scheme)."
+ ;; Look for the old <URL:foo> markup. If found, use it.
+ (or (thing-at-point--bounds-of-markedup-url)
+ ;; Otherwise, find the bounds within which a URI may exist. The
+ ;; method is similar to `ffap-string-at-point'. Note that URIs
+ ;; may contain parentheses but may not contain spaces (RFC3986).
+ (let* ((allowed-chars "--:=&?$+@-Z_[:alpha:]~#,%;*()!'")
+ (skip-before "^[0-9a-zA-Z]")
+ (skip-after ":;.,!?")
+ (pt (point))
+ (beg (save-excursion
+ (skip-chars-backward allowed-chars)
+ (skip-chars-forward skip-before pt)
+ (point)))
+ (end (save-excursion
+ (skip-chars-forward allowed-chars)
+ (skip-chars-backward skip-after pt)
+ (point))))
+ (or (thing-at-point--bounds-of-well-formed-url beg end pt)
+ (if lax (cons beg end))))))
+
+(defun thing-at-point--bounds-of-markedup-url ()
+ (when thing-at-point-markedup-url-regexp
+ (let ((case-fold-search t)
+ (pt (point))
+ (beg (line-beginning-position))
+ (end (line-end-position))
+ found)
+ (save-excursion
+ (goto-char beg)
+ (while (and (not found)
+ (<= (point) pt)
+ (< (point) end))
+ (and (re-search-forward thing-at-point-markedup-url-regexp
+ end 1)
+ (> (point) pt)
+ (setq found t))))
+ (if found
+ (cons (match-beginning 1) (match-end 1))))))
+
+(defun thing-at-point--bounds-of-well-formed-url (beg end pt)
+ (save-excursion
+ (goto-char beg)
+ (let (url-beg paren-end regexp)
+ (save-restriction
+ (narrow-to-region beg end)
+ ;; The scheme component must either match at BEG, or have no
+ ;; other alphanumerical ASCII characters before it.
+ (setq regexp (concat "\\(?:\\`\\|[^a-zA-Z0-9]\\)\\("
+ (or thing-at-point-beginning-of-url-regexp
+ (regexp-opt thing-at-point-uri-schemes))
+ "\\)"))
+ (and (re-search-forward regexp end t)
+ ;; URI must have non-empty contents.
+ (< (point) end)
+ (setq url-beg (match-beginning 1))))
+ (when url-beg
+ ;; If there is an open paren before the URI, truncate to the
+ ;; matching close paren.
+ (and (> url-beg (point-min))
+ (eq (car-safe (syntax-after (1- url-beg))) 4)
+ (save-restriction
+ (narrow-to-region (1- url-beg) (min end (point-max)))
+ (setq paren-end (ignore-errors
+ (scan-lists (1- url-beg) 1 0))))
+ (not (blink-matching-check-mismatch (1- url-beg) paren-end))
+ (setq end (1- paren-end)))
+ (cons url-beg end)))))
(put 'url 'thing-at-point 'thing-at-point-url-at-point)
-(defun thing-at-point-url-at-point ()
- "Return the URL around or before point.
-Search backwards for the start of a URL ending at or after point. If
-no URL found, return nil. The access scheme will be prepended if
-absent: \"mailto:\" if the string contains \"@\", \"ftp://\" if it
-starts with \"ftp\" and not \"ftp:/\", or \"http://\" by default."
-
- (let ((url "") short strip)
- (if (or (setq strip (thing-at-point-looking-at
- thing-at-point-markedup-url-regexp))
- (thing-at-point-looking-at thing-at-point-url-regexp)
- ;; Access scheme omitted?
- (setq short (thing-at-point-looking-at
- thing-at-point-short-url-regexp)))
- (progn
- (setq url (buffer-substring-no-properties (match-beginning 0)
- (match-end 0)))
- (and strip (setq url (substring url 5 -1))) ; Drop "<URL:" & ">"
- ;; strip whitespace
- (while (string-match "[ \t\n\r]+" url)
- (setq url (replace-match "" t t url)))
- (and short (setq url (concat (cond ((string-match "^[a-zA-Z]+:" url)
- ;; already has a URL scheme.
- "")
- ((string-match "@" url)
- "mailto:")
- ;; e.g. ftp.swiss... or ftp-swiss...
- ((string-match "^ftp" url)
- "ftp://")
- (t "http://"))
- url)))
- (if (string-equal "" url)
- nil
- url)))))
+(defun thing-at-point-url-at-point (&optional lax bounds)
+ "Return the URL around or before point.
+If no URL is found, return nil.
+
+If optional argument LAX is non-nil, look for URLs that are not
+well-formed, such as foo@bar or <nobody>.
+
+If optional arguments BOUNDS are non-nil, it should be a cons
+cell of the form (START . END), containing the beginning and end
+positions of the URI. Otherwise, these positions are detected
+automatically from the text around point.
+
+If the scheme component is absent, either because a URI delimited
+with <url:...> lacks one, or because an ill-formed URI was found
+with LAX or BEG and END, try to add a scheme in the returned URI.
+The scheme is chosen heuristically: \"mailto:\" if the address
+looks like an email address, \"ftp://\" if it starts with
+\"ftp\", etc."
+ (unless bounds
+ (setq bounds (thing-at-point-bounds-of-url-at-point lax)))
+ (when (and bounds (< (car bounds) (cdr bounds)))
+ (let ((str (buffer-substring-no-properties (car bounds) (cdr bounds))))
+ ;; If there is no scheme component, try to add one.
+ (unless (string-match "\\`[a-zA-Z][-a-zA-Z0-9+.]*:" str)
+ (or
+ ;; If the URI has the form <foo@bar>, treat it according to
+ ;; `thing-at-point-default-mail-uri-scheme'. If there are
+ ;; no angle brackets, it must be mailto.
+ (when (string-match "\\`[^:</>@]+@[-.0-9=&?$+A-Z_a-z~#,%;*]" str)
+ (let ((scheme (if (and (eq (char-before (car bounds)) ?<)
+ (eq (char-after (cdr bounds)) ?>))
+ thing-at-point-default-mail-uri-scheme
+ "mailto")))
+ (if scheme
+ (setq str (concat scheme ":" str)))))
+ ;; If the string is like <FOO>, where FOO is an existing user
+ ;; name on the system, treat that as an email address.
+ (and (string-match "\\`[[:alnum:]]+\\'" str)
+ (eq (char-before (car bounds)) ?<)
+ (eq (char-after (cdr bounds)) ?>)
+ (not (string-match "~" (expand-file-name (concat "~" str))))
+ (setq str (concat "mailto:" str)))
+ ;; If it looks like news.example.com, treat it as news.
+ (if (thing-at-point-newsgroup-p str)
+ (setq str (concat "news:" str)))
+ ;; If it looks like ftp.example.com. treat it as ftp.
+ (if (string-match "\\`ftp\\." str)
+ (setq str (concat "ftp://" str)))
+ ;; If it looks like www.example.com. treat it as http.
+ (if (string-match "\\`www\\." str)
+ (setq str (concat "http://" str)))
+ ;; Otherwise, it just isn't a URI.
+ (setq str nil)))
+ str)))
+
+(defun thing-at-point-newsgroup-p (string)
+ "Return STRING if it looks like a newsgroup name, else nil."
+ (and
+ (string-match thing-at-point-newsgroup-regexp string)
+ (let ((htbs '(gnus-active-hashtb gnus-newsrc-hashtb gnus-killed-hashtb))
+ (heads thing-at-point-newsgroup-heads)
+ htb ret)
+ (while htbs
+ (setq htb (car htbs) htbs (cdr htbs))
+ (condition-case nil
+ (progn
+ ;; errs: htb symbol may be unbound, or not a hash-table.
+ ;; gnus-gethash is just a macro for intern-soft.
+ (and (symbol-value htb)
+ (intern-soft string (symbol-value htb))
+ (setq ret string htbs nil))
+ ;; If we made it this far, gnus is running, so ignore "heads":
+ (setq heads nil))
+ (error nil)))
+ (or ret (not heads)
+ (let ((head (string-match "\\`\\([[:lower:]]+\\)\\." string)))
+ (and head (setq head (substring string 0 (match-end 1)))
+ (member head heads)
+ (setq ret string))))
+ ret)))
+
+(put 'url 'end-op (lambda () (end-of-thing 'url)))
+
+(put 'url 'beginning-op (lambda () (end-of-thing 'url)))
;; The normal thingatpt mechanism doesn't work for complex regexps.
;; This should work for almost any regexp wherever we are in the
(goto-char match)
(looking-at regexp)))))
-(put 'url 'end-op
- (lambda ()
- (let ((bounds (thing-at-point-bounds-of-url-at-point)))
- (if bounds
- (goto-char (cdr bounds))
- (error "No URL here")))))
-(put 'url 'beginning-op
- (lambda ()
- (let ((bounds (thing-at-point-bounds-of-url-at-point)))
- (if bounds
- (goto-char (car bounds))
- (error "No URL here")))))
-
;; Email addresses
(defvar thing-at-point-email-regexp
"<?[-+_.~a-zA-Z][-+_.~:a-zA-Z0-9]*@[-.a-zA-Z0-9]+>?"
(progn
(insert-file-contents (tutorial--saved-file))
(let ((enable-local-variables :safe)
- (enable-local-eval nil))
+ (enable-local-eval nil)
+ (enable-dir-local-variables nil)) ; bug#11127
(hack-local-variables))
- ;; FIXME? What we actually want is to ignore dir-locals (?).
- (setq buffer-read-only nil) ; bug#11118
(goto-char (point-min))
(setq old-tut-point
(string-to-number
(setq tutorial--point-before-chkeys (point-marker)))
(insert-file-contents (expand-file-name filename tutorial-directory))
(let ((enable-local-variables :safe)
- (enable-local-eval nil))
+ (enable-local-eval nil)
+ (enable-dir-local-variables nil)) ; bug#11127
(hack-local-variables))
- ;; FIXME? What we actually want is to ignore dir-locals (?).
- (setq buffer-read-only nil) ; bug#11118
(forward-line)
(setq tutorial--point-before-chkeys (point-marker)))
;; 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))))
+2013-02-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * url-cache.el (url-cache-create-filename-using-md5): Don't waste your
+ time `requiring' a builtin feature.
+
+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):
(defun url-cache-create-filename-using-md5 (url)
"Create a cached filename using MD5.
Very fast if you have an `md5' primitive function, suitably fast otherwise."
- (require 'md5)
(if url
(let* ((checksum (md5 url))
(urlobj (url-generic-parse-url url))
;; 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)
:group 'compare-windows)
(defcustom compare-ignore-whitespace nil
- "Non-nil means `compare-windows' ignores whitespace."
+ "Non-nil means command `compare-windows' ignores whitespace."
:type 'boolean
:group 'compare-windows
:version "22.1")
(defcustom compare-ignore-case nil
- "Non-nil means `compare-windows' ignores case differences."
+ "Non-nil means command `compare-windows' ignores case differences."
:type 'boolean
:group 'compare-windows)
(delete-overlay compare-windows-overlay2)))))
(defun compare-windows-dehighlight ()
- "Remove highlighting created by `compare-windows-highlight'."
+ "Remove highlighting created by function `compare-windows-highlight'."
(interactive)
(remove-hook 'pre-command-hook 'compare-windows-dehighlight)
(mapc 'delete-overlay compare-windows-overlays1)
(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))
When called interactively with a prefix argument, prompt
interactively for diff switches. Otherwise, the switches
-specified in `diff-switches' are passed to the diff command."
+specified in the variable `diff-switches' are passed to the diff command."
(interactive
(let* ((newf (if (and buffer-file-name (file-exists-p buffer-file-name))
(read-file-name
tempfile))
(file-local-copy file-or-buf)))
+(defvar diff-use-labels 'check
+ "Whether `diff-command' understands the \"--label\" option.
+Possible values are:
+ t -- yes, it does
+ nil -- no, it does not
+ check -- try to probe whether it does")
+
(defun diff-no-select (old new &optional switches no-async buf)
;; Noninteractive helper for creating and reverting diff buffers
(unless (bufferp new) (setq new (expand-file-name new)))
(or switches (setq switches diff-switches)) ; If not specified, use default.
(unless (listp switches) (setq switches (list switches)))
(or buf (setq buf (get-buffer-create "*Diff*")))
+ (when (eq 'check diff-use-labels)
+ (setq diff-use-labels
+ (with-temp-buffer
+ (when (ignore-errors (call-process diff-command nil t nil "--help"))
+ (if (search-backward "--label" nil t) t)))))
(let* ((old-alt (diff-file-local-copy old))
(new-alt (diff-file-local-copy new))
(command
,@switches
,@(mapcar #'shell-quote-argument
(nconc
- (when (or old-alt new-alt)
- (list "-L" (if (stringp old)
- old (prin1-to-string old))
- "-L" (if (stringp new)
- new (prin1-to-string new))))
+ (and (or old-alt new-alt)
+ (eq diff-use-labels t)
+ (list "--label"
+ (if (stringp old) old
+ (prin1-to-string old))
+ "--label"
+ (if (stringp new) new
+ (prin1-to-string new))))
(list (or old-alt old)
(or new-alt new)))))
" "))
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)
(while (re-search-forward (concat "^" (car header)
":" log-edit-header-contents-regexp)
nil t)
- (if (eq t (cdr header))
- (setq summary (match-string 1))
- (if (functionp (cdr header))
- (setq res (nconc res (funcall (cdr header) (match-string 1))))
- (push (match-string 1) res)
- (push (or (cdr header) (car header)) res)))
- (replace-match "" t t)))
+ (let ((txt (match-string 1)))
+ (replace-match "" t t)
+ (if (eq t (cdr header))
+ (setq summary txt)
+ (if (functionp (cdr header))
+ (setq res (nconc res (funcall (cdr header) txt)))
+ (push txt res)
+ (push (or (cdr header) (car header)) res))))))
;; Remove header separator if the header is empty.
(widen)
(goto-char (point-min))
(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 ()
;;;###autoload (defun vc-arch-registered (file)
;;;###autoload (if (vc-find-root file "{arch}/=tagging-method")
;;;###autoload (progn
-;;;###autoload (load "vc-arch")
+;;;###autoload (load "vc-arch" nil t)
;;;###autoload (vc-arch-registered file))))
(defun vc-arch-add-tagline ()
;;;###autoload (defun vc-bzr-registered (file)
;;;###autoload (if (vc-find-root file vc-bzr-admin-checkout-format-file)
;;;###autoload (progn
-;;;###autoload (load "vc-bzr")
+;;;###autoload (load "vc-bzr" nil t)
;;;###autoload (vc-bzr-registered file))))
(defun vc-bzr-registered (file)
(declare-function log-edit-extract-headers "log-edit" (headers string))
+(defun vc-bzr--sanitize-header (arg)
+ ;; Newlines in --fixes (and probably other fields as well) trigger a nasty
+ ;; Bazaar bug; see https://bugs.launchpad.net/bzr/+bug/1094180.
+ (lambda (str) (list arg
+ (replace-regexp-in-string "\\`[ \t]+\\|[ \t]+\\'"
+ "" (replace-regexp-in-string
+ "\n[ \t]?" " " str)))))
+
(defun vc-bzr-checkin (files rev comment)
"Check FILES in to bzr with log message COMMENT.
REV non-nil gets an error."
(if rev (error "Can't check in a specific revision with bzr"))
- (apply 'vc-bzr-command "commit" nil 0
- files (cons "-m" (log-edit-extract-headers '(("Author" . "--author")
- ("Date" . "--commit-time")
- ("Fixes" . "--fixes"))
- comment))))
+ (apply 'vc-bzr-command "commit" nil 0 files
+ (cons "-m" (log-edit-extract-headers
+ `(("Author" . ,(vc-bzr--sanitize-header "--author"))
+ ("Date" . ,(vc-bzr--sanitize-header "--commit-time"))
+ ("Fixes" . ,(vc-bzr--sanitize-header "--fixes")))
+ comment))))
(defun vc-bzr-find-revision (file rev buffer)
"Fetch revision REV of file FILE and put it into BUFFER."
;;;###autoload "Return non-nil if file F is registered with CVS."
;;;###autoload (when (file-readable-p (expand-file-name
;;;###autoload "CVS/Entries" (file-name-directory f)))
-;;;###autoload (load "vc-cvs")
+;;;###autoload (load "vc-cvs" nil t)
;;;###autoload (vc-cvs-registered f)))
(defun vc-cvs-registered (file)
(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
;;;###autoload "Return non-nil if FILE is registered with git."
;;;###autoload (if (vc-find-root file ".git") ; Short cut.
;;;###autoload (progn
-;;;###autoload (load "vc-git")
+;;;###autoload (load "vc-git" nil t)
;;;###autoload (vc-git-registered file))))
(defun vc-git-registered (file)
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
;;;###autoload "Return non-nil if FILE is registered with hg."
;;;###autoload (if (vc-find-root file ".hg") ; short cut
;;;###autoload (progn
-;;;###autoload (load "vc-hg")
+;;;###autoload (load "vc-hg" nil t)
;;;###autoload (vc-hg-registered file))))
;; Modeled after the similar function in vc-bzr.el
(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 (and buffer-file-truename
+ (expand-file-name buffer-file-truename)))
+ (link-type (and truename
+ (not (equal buffer-file-name truename))
+ (vc-backend truename))))
(cond ((not link-type) nil) ;Nothing to do.
((eq vc-follow-symlinks nil)
(message
"Warning: symbolic link to %s-controlled source file" link-type))
((or (not (eq vc-follow-symlinks 'ask))
+ ;; Assume we cannot ask, default to yes.
+ noninteractive
+ ;; Copied from server-start. Seems like there should
+ ;; be a better way to ask "can we get user input?"...
+ (and (daemonp)
+ (null (cdr (frame-list)))
+ (eq (selected-frame) terminal-frame))
;; If we already visited this file by following
;; the link, don't ask again if we try to visit
;; it again. GUD does that, and repeated questions
"))
(bindings--define-key map [undo]
'(menu-item "Undo Last Check-In" vc-rollback
+ :enable (let ((backend (if buffer-file-name
+ (vc-backend buffer-file-name))))
+ (or (not backend)
+ (vc-find-backend-function backend 'rollback)))
:help "Remove the most recent changeset committed to the repository"))
(bindings--define-key map [vc-revert]
'(menu-item "Revert to Base Version" vc-revert
;;;###autoload (defun vc-mtn-registered (file)
;;;###autoload (if (vc-find-root file vc-mtn-admin-format)
;;;###autoload (progn
-;;;###autoload (load "vc-mtn")
+;;;###autoload (load "vc-mtn" nil t)
;;;###autoload (vc-mtn-registered file))))
(defun vc-mtn-revision-granularity () 'repository)
:type 'string
:group 'vc-svn)
-(defcustom vc-svn-global-switches nil
- "Global switches to pass to any SVN command."
+;; Might be nice if svn defaulted to non-interactive if stdin not tty.
+;; http://svn.haxx.se/dev/archive-2008-05/0762.shtml
+;; http://svn.haxx.se/dev/archive-2009-04/0094.shtml
+;; Maybe newer ones do?
+(defcustom vc-svn-global-switches (unless (eq system-type 'darwin) ; bug#13513
+ '("--non-interactive"))
+ "Global switches to pass to any SVN command.
+The option \"--non-interactive\" is often needed to prevent SVN
+hanging while prompting for authorization."
:type '(choice (const :tag "None" nil)
(string :tag "Argument String")
(repeat :tag "Argument List"
:value ("")
string))
- :version "22.1"
+ :version "24.4"
:group 'vc-svn)
(defcustom vc-svn-register-switches nil
;;;###autoload "_svn")
;;;###autoload (t ".svn"))))
;;;###autoload (when (vc-find-root f admin-dir)
-;;;###autoload (load "vc-svn")
+;;;###autoload (load "vc-svn" nil t)
;;;###autoload (vc-svn-registered f))))
(defun vc-svn-registered (file)
(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.
(defun vc-svn-command (buffer okstatus file-or-list &rest flags)
"A wrapper around `vc-do-command' for use in vc-svn.el.
The difference to vc-do-command is that this function always invokes `svn',
-and that it passes \"--non-interactive\" and `vc-svn-global-switches' to
-it before FLAGS."
- ;; Might be nice if svn defaulted to non-interactive if stdin not tty.
- ;; http://svn.haxx.se/dev/archive-2008-05/0762.shtml
- ;; http://svn.haxx.se/dev/archive-2009-04/0094.shtml
- ;; Maybe newer ones do?
- (or (member "--non-interactive"
- (setq flags (if (stringp vc-svn-global-switches)
- (cons vc-svn-global-switches flags)
- (append vc-svn-global-switches flags))))
- (setq flags (cons "--non-interactive" flags)))
+and that it passes `vc-svn-global-switches' to it before FLAGS."
(apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list
- flags))
+ (if (stringp vc-svn-global-switches)
+ (cons vc-svn-global-switches flags)
+ (append vc-svn-global-switches flags))))
(defun vc-svn-repository-hostname (dirname)
(with-temp-buffer
(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)))
- ;; Do the right thing
+ ;; 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))
+ (dolist (file files)
+ (let ((buffer (get-file-buffer file)))
+ (and buffer
+ (buffer-modified-p buffer)
+ (setq state 'unlocked-changes)))))
+
+ ;; Do the right thing.
(cond
((eq state 'missing)
(error "Fileset files are missing, so cannot be operated on"))
;; 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))
(cond ((consp current-prefix-arg) ;C-u
(list buffer-file-name))
(current-prefix-arg ;Numeric argument.
- (let ((files nil)
- (buffers (buffer-list))
- file)
- (while buffers
- (setq file (buffer-file-name (car buffers)))
- (and file (vc-backend file)
- (setq files (cons file files)))
- (setq buffers (cdr buffers)))
+ (let ((files nil))
+ (dolist (buffer (buffer-list))
+ (let ((file (buffer-file-name buffer)))
+ (and file (vc-backend file)
+ (setq files (cons file files)))))
files))
(t
;; Don't supply any filenames to backend; this means
(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.
(define-key map "\C-?" 'View-scroll-page-backward)
;; (define-key map "f" 'View-scroll-page-forward)
(define-key map " " 'View-scroll-page-forward)
+ (define-key map [?\S-\ ] 'View-scroll-page-backward)
(define-key map "o" 'View-scroll-to-buffer-end)
(define-key map ">" 'end-of-buffer)
(define-key map "<" 'beginning-of-buffer)
\\[View-scroll-to-buffer-end] scroll so that buffer end is at last line of window.
SPC scroll forward \"page size\" lines.
With prefix scroll forward prefix lines.
-DEL scroll backward \"page size\" lines.
- With prefix scroll backward prefix lines.
+DEL, S-SPC scroll backward \"page size\" lines.
+ With prefix scroll backward prefix lines.
\\[View-scroll-page-forward-set-page-size] like \\[View-scroll-page-forward] but with prefix sets \"page size\" to prefix.
\\[View-scroll-page-backward-set-page-size] like \\[View-scroll-page-backward] but with prefix sets \"page size\" to prefix.
\\[View-scroll-half-page-forward] scroll forward \"half page size\" lines. With prefix, sets
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."
(defvar whitespace-point (point)
"Used to save locally current point value.
-Used by `whitespace-trailing-regexp' function (which see).")
+Used by function `whitespace-trailing-regexp' (which see).")
(defvar whitespace-font-lock-refontify nil
"Used to save locally the font-lock refontify state.
-Used by `whitespace-post-command-hook' function (which see).")
+Used by function `whitespace-post-command-hook' (which see).")
(defvar whitespace-bob-marker nil
"Used to save locally the bob marker value.
-Used by `whitespace-post-command-hook' function (which see).")
+Used by function `whitespace-post-command-hook' (which see).")
(defvar whitespace-eob-marker nil
"Used to save locally the eob marker value.
-Used by `whitespace-post-command-hook' function (which see).")
+Used by function `whitespace-post-command-hook' (which see).")
(defvar whitespace-buffer-changed nil
"Used to indicate locally if buffer changed.
"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],
+[
+ :
+])
--- /dev/null
+# dirent_h.m4 serial 16
+dnl Copyright (C) 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 Written by Bruno Haible.
+
+AC_DEFUN([gl_DIRENT_H],
+[
+ 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_DIRENT_H_DEFAULTS])
+
+ dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([dirent.h])
+ if test $ac_cv_header_dirent_h = yes; then
+ HAVE_DIRENT_H=1
+ else
+ HAVE_DIRENT_H=0
+ fi
+ AC_SUBST([HAVE_DIRENT_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
+ ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
+])
+
+AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_DIRENT_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_DIRENT_H_DEFAULTS],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
+ GNULIB_OPENDIR=0; AC_SUBST([GNULIB_OPENDIR])
+ GNULIB_READDIR=0; AC_SUBST([GNULIB_READDIR])
+ GNULIB_REWINDDIR=0; AC_SUBST([GNULIB_REWINDDIR])
+ GNULIB_CLOSEDIR=0; AC_SUBST([GNULIB_CLOSEDIR])
+ GNULIB_DIRFD=0; AC_SUBST([GNULIB_DIRFD])
+ GNULIB_FDOPENDIR=0; AC_SUBST([GNULIB_FDOPENDIR])
+ GNULIB_SCANDIR=0; AC_SUBST([GNULIB_SCANDIR])
+ GNULIB_ALPHASORT=0; AC_SUBST([GNULIB_ALPHASORT])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_OPENDIR=1; AC_SUBST([HAVE_OPENDIR])
+ HAVE_READDIR=1; AC_SUBST([HAVE_READDIR])
+ HAVE_REWINDDIR=1; AC_SUBST([HAVE_REWINDDIR])
+ HAVE_CLOSEDIR=1; AC_SUBST([HAVE_CLOSEDIR])
+ HAVE_DECL_DIRFD=1; AC_SUBST([HAVE_DECL_DIRFD])
+ HAVE_DECL_FDOPENDIR=1;AC_SUBST([HAVE_DECL_FDOPENDIR])
+ HAVE_FDOPENDIR=1; AC_SUBST([HAVE_FDOPENDIR])
+ HAVE_SCANDIR=1; AC_SUBST([HAVE_SCANDIR])
+ HAVE_ALPHASORT=1; AC_SUBST([HAVE_ALPHASORT])
+ REPLACE_OPENDIR=0; AC_SUBST([REPLACE_OPENDIR])
+ REPLACE_CLOSEDIR=0; AC_SUBST([REPLACE_CLOSEDIR])
+ REPLACE_DIRFD=0; AC_SUBST([REPLACE_DIRFD])
+ REPLACE_FDOPENDIR=0; AC_SUBST([REPLACE_FDOPENDIR])
+])
-#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
+])
-# serial 12 -*- Autoconf -*-
+# serial 13 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc.
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
# Autoconf. Perhaps we can remove this once we can assume Autoconf
-# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# 2.70 or later everywhere, but since Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
+#
# Remember that #undef in AH_VERBATIM gets replaced with #define by
# AC_DEFINE. The goal here is to define all known feature-enabling
# macros, then, if reports of conflicts are made, disable macros that
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
- AC_REQUIRE([AC_CANONICAL_HOST])
-
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
except with this defined.])
AC_DEFINE([_MINIX], [1],
[Define to 1 if on MINIX.])
+ AC_DEFINE([_NETBSD_SOURCE], [1],
+ [Define to 1 to make NetBSD features available. MINIX 3 needs this.])
fi
- dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
- dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
- dnl provided.
- case "$host_os" in
- hpux*)
- AC_DEFINE([_XOPEN_SOURCE], [500],
- [Define to 500 only on HP-UX.])
- ;;
- esac
-
- AH_VERBATIM([__EXTENSIONS__],
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+ AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
-/* Enable general extensions on Mac OS X. */
+/* Enable general extensions on OS X. */
#ifndef _DARWIN_C_SOURCE
# undef _DARWIN_C_SOURCE
#endif
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
AC_DEFINE([_GNU_SOURCE])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([_TANDEM_SOURCE])
+ AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+ [ac_cv_should_define__xopen_source],
+ [ac_cv_should_define__xopen_source=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [ac_cv_should_define__xopen_source=yes])])])
+ test $ac_cv_should_define__xopen_source = yes &&
+ AC_DEFINE([_XOPEN_SOURCE], [500])
])# AC_USE_SYSTEM_EXTENSIONS
# gl_USE_SYSTEM_EXTENSIONS
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 10
+# See if we need to provide fdopendir.
+
+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_FDOPENDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl FreeBSD 7.3 has the function, but failed to declare it.
+ AC_CHECK_DECLS([fdopendir], [], [HAVE_DECL_FDOPENDIR=0], [[
+#include <dirent.h>
+ ]])
+ AC_CHECK_FUNCS_ONCE([fdopendir])
+ if test $ac_cv_func_fdopendir = no; then
+ HAVE_FDOPENDIR=0
+ else
+ AC_CACHE_CHECK([whether fdopendir works],
+ [gl_cv_func_fdopendir_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
+#if !HAVE_DECL_FDOPENDIR
+extern
+# ifdef __cplusplus
+"C"
+# endif
+DIR *fdopendir (int);
+#endif
+]], [int result = 0;
+ int fd = open ("conftest.c", O_RDONLY);
+ if (fd < 0) result |= 1;
+ if (fdopendir (fd)) result |= 2;
+ if (close (fd)) result |= 4;
+ return result;])],
+ [gl_cv_func_fdopendir_works=yes],
+ [gl_cv_func_fdopendir_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_fdopendir_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_fdopendir_works" in
+ *yes) ;;
+ *)
+ REPLACE_FDOPENDIR=1
+ ;;
+ esac
+ fi
+])
--- /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
+# fstatat.m4 serial 3
+dnl Copyright (C) 2004-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 Jim Meyering.
+
+# If we have the fstatat function, and it has the bug (in AIX 7.1)
+# that it does not fill in st_size correctly, use the replacement function.
+AC_DEFUN([gl_FUNC_FSTATAT],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS_ONCE([fstatat])
+
+ if test $ac_cv_func_fstatat = no; then
+ HAVE_FSTATAT=0
+ else
+ dnl Test for an AIX 7.1 bug; see
+ dnl <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00015.html>.
+ AC_CACHE_CHECK([whether fstatat (..., 0) works],
+ [gl_cv_func_fstatat_zero_flag],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ int
+ main (void)
+ {
+ struct stat a;
+ return fstatat (AT_FDCWD, ".", &a, 0) != 0;
+ }
+ ]])],
+ [gl_cv_func_fstatat_zero_flag=yes],
+ [gl_cv_func_fstatat_zero_flag=no],
+ [case "$host_os" in
+ aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
+ *) gl_cv_func_fstatat_zero_flag="guessing yes";;
+ esac
+ ])
+ ])
+
+ case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
+ *yes+*yes) ;;
+ *) REPLACE_FSTATAT=1
+ case $gl_cv_func_fstatat_zero_flag in
+ *yes)
+ AC_DEFINE([HAVE_WORKING_FSTATAT_ZERO_FLAG], [1],
+ [Define to 1 if fstatat (..., 0) works.
+ For example, it does not work in AIX 7.1.])
+ ;;
+ esac
+ ;;
+ esac
+ fi
+])
--- /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
AC_REQUIRE([gl_PROG_AR_RANLIB])
# Code from module alloca-opt:
# Code from module allocator:
+ # Code from module at-internal:
# Code from module c-ctype:
# 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 crypto/sha512:
+ # Code from module dirent:
# Code from module dosname:
# Code from module dtoastr:
# 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 fdopendir:
# Code from module filemode:
+ # Code from module fpending:
+ # Code from module fstatat:
+ # 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:
AC_REQUIRE([AC_SYS_LARGEFILE])
# Code from module lstat:
# Code from module manywarnings:
+ # Code from module memrchr:
# Code from module mktime:
# Code from module multiarch:
# Code from module nocrash:
+ # Code from module openat-h:
# Code from module pathmax:
# Code from module pselect:
# Code from module pthread_sigmask:
+ # Code from module putenv:
# Code from module readlink:
+ # Code from module readlinkat:
+ # 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 stdio:
# Code from module stdlib:
# Code from module strftime:
+ # Code from module string:
# Code from module strtoimax:
# Code from module strtoll:
# Code from module strtoull:
# 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_SHA512
+ gl_DIRENT_H
AC_REQUIRE([gl_C99_STRTOLD])
gl_FUNC_DUP2
if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
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_FUNC_FDOPENDIR
+ if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
+ AC_LIBOBJ([fdopendir])
+ fi
+ gl_DIRENT_MODULE_INDICATOR([fdopendir])
+ gl_MODULE_INDICATOR([fdopendir])
gl_FILEMODE
+ gl_FUNC_FPENDING
+ if test $ac_cv_func___fpending = no; then
+ AC_LIBOBJ([fpending])
+ gl_PREREQ_FPENDING
+ fi
+ gl_FUNC_FSTATAT
+ if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+ AC_LIBOBJ([fstatat])
+ fi
+ gl_SYS_STAT_MODULE_INDICATOR([fstatat])
gl_GETLOADAVG
if test $HAVE_GETLOADAVG = 0; then
AC_LIBOBJ([getloadavg])
gl_PREREQ_LSTAT
fi
gl_SYS_STAT_MODULE_INDICATOR([lstat])
+ gl_FUNC_MEMRCHR
+ if test $ac_cv_func_memrchr = no; then
+ AC_LIBOBJ([memrchr])
+ gl_PREREQ_MEMRCHR
+ fi
+ gl_STRING_MODULE_INDICATOR([memrchr])
gl_FUNC_MKTIME
if test $REPLACE_MKTIME = 1; then
AC_LIBOBJ([mktime])
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_READLINKAT
+ if test $HAVE_READLINKAT = 0; then
+ AC_LIBOBJ([readlinkat])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([readlinkat])
+ 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_STDIO_H
gl_STDLIB_H
gl_FUNC_GNU_STRFTIME
+ gl_HEADER_STRING_H
gl_FUNC_STRTOIMAX
if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
AC_LIBOBJ([strtoimax])
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_260941c0e5dc67ec9e87d1fb321c300b=false
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_03e0aaad4cb89ca757653bd367a6ccb7=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_260941c0e5dc67ec9e87d1fb321c300b ()
+ {
+ if ! $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then
+ AC_LIBOBJ([openat-proc])
+ gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true
+ fi
+ }
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_03e0aaad4cb89ca757653bd367a6ccb7 ()
+ {
+ if ! $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then
+ gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=true
+ 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_260941c0e5dc67ec9e87d1fb321c300b
+ 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 $HAVE_FACCESSAT = 0; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
+ if test $HAVE_FDOPENDIR = 0; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
if test $REPLACE_GETOPT = 1; then
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
fi
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
func_gl_gnulib_m4code_stat
fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
+ fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $HAVE_READLINKAT = 0; then
+ func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
+ fi
if { test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
func_gl_gnulib_m4code_strtoll
fi
func_gl_gnulib_m4code_verify
fi
m4_pattern_allow([^gl_GNULIB_ENABLED_])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], [$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b])
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_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
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/dirent.in.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/fdopendir.c
lib/filemode.c
lib/filemode.h
+ lib/fpending.c
+ lib/fpending.h
+ lib/fstatat.c
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/lstat.c
lib/md5.c
lib/md5.h
+ lib/memrchr.c
lib/mktime-internal.h
lib/mktime.c
+ lib/openat-priv.h
+ lib/openat-proc.c
+ lib/openat.h
lib/pathmax.h
lib/pselect.c
lib/pthread_sigmask.c
+ lib/putenv.c
lib/readlink.c
+ lib/readlinkat.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/stdlib.in.h
lib/strftime.c
lib/strftime.h
+ lib/string.in.h
lib/strtoimax.c
lib/strtol.c
lib/strtoll.c
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/dirent_h.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/fdopendir.m4
m4/filemode.m4
+ m4/fpending.m4
+ m4/fstatat.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/lstat.m4
m4/manywarnings.m4
m4/md5.m4
+ m4/memrchr.m4
m4/mktime.m4
m4/multiarch.m4
m4/nocrash.m4
m4/pathmax.m4
m4/pselect.m4
m4/pthread_sigmask.m4
+ m4/putenv.m4
m4/readlink.m4
+ m4/readlinkat.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
m4/stdio_h.m4
m4/stdlib_h.m4
m4/strftime.m4
+ m4/string_h.m4
m4/strtoimax.m4
m4/strtoll.m4
m4/strtoull.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])
+])
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# The following implementation works around a problem in autoconf <= 2.68;
-# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5.
-m4_version_prereq([2.69], [] ,[
+# The following implementation works around a problem in autoconf <= 2.69;
+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
+# or configures them incorrectly in some cases.
+m4_version_prereq([2.70], [] ,[
# _AC_SYS_LARGEFILE_TEST_INCLUDES
# -------------------------------
# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
-# CACHE-VAR,
-# DESCRIPTION,
-# PROLOGUE, [FUNCTION-BODY])
+# CACHE-VAR,
+# DESCRIPTION,
+# PROLOGUE, [FUNCTION-BODY])
# --------------------------------------------------------
m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
[_AC_SYS_LARGEFILE_TEST_INCLUDES])
fi
- AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
-[/* Enable large inode numbers on Mac OS X. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif])
+ AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
+ [Enable large inode numbers on Mac OS X 10.5.])
fi
])# AC_SYS_LARGEFILE
-
-])# m4_version_prereq 2.69
+])# m4_version_prereq 2.70
# Enable large files on systems where this is implemented by Gnulib, not by the
# system headers.
-# 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
+# memrchr.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software Foundation,
+dnl 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_MEMRCHR],
+[
+ dnl Persuade glibc <string.h> to declare memrchr().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([memrchr])
+ if test $ac_cv_have_decl_memrchr = no; then
+ HAVE_DECL_MEMRCHR=0
+ fi
+
+ AC_CHECK_FUNCS([memrchr])
+])
+
+# Prerequisites of lib/memrchr.c.
+AC_DEFUN([gl_PREREQ_MEMRCHR], [:])
--- /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
+# serial 3
+# See if we need to provide readlinkat 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_READLINKAT],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([readlinkat])
+ if test $ac_cv_func_readlinkat = no; then
+ HAVE_READLINKAT=0
+ fi
+])
--- /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
-# stdlib_h.m4 serial 41
+# stdlib_h.m4 serial 42
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,
]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
posix_openpt ptsname ptsname_r random random_r realpath rpmatch
- setenv setstate setstate_r srandom srandom_r
+ secure_getenv setenv setstate setstate_r srandom srandom_r
strtod strtoll strtoull unlockpt unsetenv])
])
GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH])
GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
+ GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV])
GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL])
HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
+ HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
--- /dev/null
+# Configure a GNU-like replacement for <string.h>.
+
+# Copyright (C) 2007-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.
+
+# serial 21
+
+# Written by Paul Eggert.
+
+AC_DEFUN([gl_HEADER_STRING_H],
+[
+ 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_HEADER_STRING_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_STRING_H_BODY],
+[
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ gl_NEXT_HEADERS([string.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by C89.
+ gl_WARN_ON_USE_PREPARE([[#include <string.h>
+ ]],
+ [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
+ strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
+ strerror_r strsignal strverscmp])
+])
+
+AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_HEADER_STRING_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_HEADER_STRING_H_DEFAULTS],
+[
+ GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL])
+ GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL])
+ GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
+ GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
+ GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
+ GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
+ GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR])
+ GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY])
+ GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY])
+ GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL])
+ GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP])
+ GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT])
+ GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP])
+ GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN])
+ GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK])
+ GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP])
+ GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR])
+ GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR])
+ GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R])
+ GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN])
+ GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN])
+ GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR])
+ GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR])
+ GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR])
+ GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP])
+ GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
+ GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
+ GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR])
+ GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN])
+ GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK])
+ GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN])
+ GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP])
+ GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R])
+ GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
+ GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R])
+ GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
+ GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
+ HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
+ HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
+ HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
+ HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
+ HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
+ HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
+ HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
+ HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
+ HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
+ HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
+ HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
+ HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
+ HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
+ HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
+ HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
+ HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
+ HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
+ HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R])
+ HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
+ HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
+ REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
+ REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
+ REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
+ REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
+ REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
+ REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
+ REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
+ REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
+ REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
+ REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
+ REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
+ REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
+ REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
+ REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
+ UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
+])
-# 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
echo "Making links to \`lisp' and its subdirectories"
files=`find lisp \( -name '*.el' -o -name '*.elc' -o -name 'ChangeLog*' \
- -o -name 'README*' \)`
+ -o -name 'README' \)`
### Don't distribute site-init.el, site-load.el, or default.el.
for file in lisp/Makefile.in lisp/makefile.w32-in $files; do
+2013-02-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * sedlibmk.inp: Sync with changes in lib/Makefile.in.
+ (HAVE_SECURE_GETENV, GNULIB_SECURE_GETENV): Edit to appropriate values.
+
2012-12-30 Eli Zaretskii <eliz@gnu.org>
* 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.93"/
+/^#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/
/^GNULIB_RMDIR *=/s/@GNULIB_RMDIR@/0/
/^GNULIB_RPMATCH *=/s/@GNULIB_RPMATCH@/0/
/^GNULIB_SCANF *=/s/@GNULIB_SCANF@/0/
+/^GNULIB_SECURE_GETENV *=/s/@GNULIB_SECURE_GETENV@/0/
/^GNULIB_SELECT *=/s/@GNULIB_SELECT@/0/
/^GNULIB_SETENV *=/s/@GNULIB_SETENV@/0/
/^GNULIB_SETHOSTNAME *=/s/@GNULIB_SETHOSTNAME@/0/
/^HAVE_REALPATH *=/s/@HAVE_REALPATH@/0/
/^HAVE_RENAMEAT *=/s/@HAVE_RENAMEAT@/0/
/^HAVE_RPMATCH *=/s/@HAVE_RPMATCH@/0/
+/^HAVE_SECURE_GETENV *=/s/@HAVE_SECURE_GETENV@/0/
/^HAVE_SETENV *=/s/@HAVE_SETENV@/1/
/^HAVE_SETHOSTNAME *=/s/@HAVE_SETHOSTNAME@/0/
/^HAVE_SIGACTION *=/s/@HAVE_SIGACTION@/1/
-2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
+2013-02-13 Juanma Barranquero <lekktu@gmail.com>
- Revert recent change for Bug#8855; see ../src/ChangeLog.
+ * config.nt: Sync with autogen/config.in.
+ (GC_MARK_STACK): Remove.
+ (GNULIB_FDOPENDIR, HAVE_DECL_FDOPENDIR, HAVE_DECL_MEMRCHR)
+ (HAVE_DIRENT_H, HAVE_FDOPENDIR, HAVE_FSTATAT, HAVE_MEMRCHR)
+ (HAVE_WORKING_FSTATAT_ZERO_FLAG, _NETBSD_SOURCE): New macros.
+
+2013-02-12 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/ms-w32.h: Add prototype for memrchr.
+
+2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+ * inc/sys/stat.h (fstatat):
+ * inc/unistd.h (readlinkat): New decls.
+
+2013-01-28 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/dirent.h (opendir): Update prototype.
+
+2013-01-11 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/unistd.h (O_IGNORE_CTTY): Define, as it is unconditionally
+ used in term.c. (Bug#13387)
+
+2013-01-09 Juanma Barranquero <lekktu@gmail.com>
+
+ * config.nt: Sync with autogen/config.in.
+ (HAVE_GTK_HANDLE_BOX_NEW, HAVE_GTK_TEAROFF_MENU_ITEM_NEW): New macros.
+
+2012-12-24 Eli Zaretskii <eliz@gnu.org>
+
+ * 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/stdint.h (INTPTR_MIN): Define for MSVC.
+ * inc/ms-w32.h (AT_FDCWD, AT_EACCESS, faccessat): Remove macros.
+
+2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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). */
/* Mark a secondary stack, like the register stack on the ia64. */
#undef GC_MARK_SECONDARY_STACK
-/* Define to GC_USE_GCPROS_AS_BEFORE if conservative garbage collection is not
- known to work. */
-#define GC_MARK_STACK 1
-
/* Define if setjmp is known to save all registers relevant for conservative
garbage collection in the jmp_buf.
MSVC ignores the "register" keyword, so test fails even though
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 fdopendir shall be considered present. */
+#undef GNULIB_FDOPENDIR
+
/* 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 to 1 if you have the `dbus_watch_get_unix_fd' function. */
#undef HAVE_DBUS_WATCH_GET_UNIX_FD
+/* Define to 1 if you have the declaration of `fdopendir', and to 0 if you
+ don't. */
+#undef HAVE_DECL_FDOPENDIR
+
/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
*/
#define HAVE_DECL_GETENV 1
don't. */
#undef HAVE_DECL_LOCALTIME_R
+/* Define to 1 if you have the declaration of `memrchr', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MEMRCHR
+
/* Define to 1 if you have the declaration of `strmode', and to 0 if you
don't. */
#undef HAVE_DECL_STRMODE
*/
#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 '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 `fdopendir' function. */
+#undef HAVE_FDOPENDIR
/* 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 fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
+/* Define to 1 if you have the `fstatat' function. */
+#undef HAVE_FSTATAT
+
/* Define to 1 if you have the `fsync' function. */
#define HAVE_FSYNC 1
/* 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 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. */
#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 the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `memrchr' function. */
+#undef HAVE_MEMRCHR
+
/* Define to 1 if you have mouse menus. (This is automatic if you use X, but
the option to specify it remains.) It is also defined with other window
systems that support xmenu.c. */
/* 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 1 if `fork' works. */
#undef HAVE_WORKING_FORK
+/* Define to 1 if fstatat (..., 0) works. For example, it does not work in AIX
+ 7.1. */
+#undef HAVE_WORKING_FSTATAT_ZERO_FLAG
+
/* Define if utimes works properly. */
#undef HAVE_WORKING_UTIMES
/* 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
/* Define to 1 if using the Motif X toolkit. */
#undef USE_MOTIF
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable general extensions on OS X. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
/* Define to 1 if we should use toolkit scroll bars. */
#define USE_TOOLKIT_SCROLL_BARS 1
#undef USG_SUBTTY_WORKS
/* Version number of package */
-#define VERSION "24.2.93"
+#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'. */
/* Define if the system is AIX. */
#undef _AIX
-/* Enable large inode numbers on Mac OS X. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
+/* Enable large inode numbers on Mac OS X 10.5. */
+#undef _DARWIN_USE_64_BIT_INODE
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define if GNUstep uses ObjC exceptions. */
#undef _NATIVE_OBJC_EXCEPTIONS
+/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */
+#undef _NETBSD_SOURCE
+
/* The _Noreturn keyword of C11. */
#if ! (defined _Noreturn \
|| (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
/* Needed for system_process_attributes on Solaris. */
#undef _STRUCTURED_PROC
-/* Define to 500 only on HP-UX. */
-#undef _XOPEN_SOURCE
-
-/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable general extensions on Mac OS X. */
-#ifndef _DARWIN_C_SOURCE
-# undef _DARWIN_C_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
/* Define to rpl_ if the getopt replacement functions and variables should be
used. */
#undef __GETOPT_PREFIX
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,93,0
- PRODUCTVERSION 24,2,93,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, 93, 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, 93, 0\0"
+ VALUE "ProductVersion", "24, 3, 50, 0\0"
VALUE "OLESelfRegister", "\0"
END
END
#endif
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 24,2,93,0
- PRODUCTVERSION 24,2,93,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, 93, 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, 93, 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 */
char dd_buf[DIRBLKSIZ]; /* directory block */
} DIR; /* stream data from opendir() */
-extern DIR *opendir (char *);
-extern struct direct *readdir (DIR *);
+extern DIR *opendir (const char *);
+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);
+extern void * memrchr (void const *, int, size_t);
+
+
#if defined (__MINGW32__)
/* Define to 1 if the system has the type `long long int'. */
--- /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
_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*);
_CRTIMP int __cdecl __MINGW_NOTHROW lstat (const char*, struct stat*);
+_CRTIMP int __cdecl __MINGW_NOTHROW fstatat (int, char const *,
+ struct stat *, int);
#endif /* INC_SYS_STAT_H_ */
-
--- /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 ssize_t readlinkat (int, 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
+#define O_IGNORE_CTTY 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.93
+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. */
define pwinx
set $w = $arg0
- xgetint $w->sequence_number
if ($w->mini_p != Qnil)
printf "Mini "
end
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
* keyboard.c (input-decode-map, key-translation-map): Doc fixes.
-2013-02-12 Paul Eggert <eggert@cs.ucla.edu>
+2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
Improve AIX port some more (Bug#13650).
With this, it should be as good as it was in 23.3, though it's
This ports to compilers that optimize the external declaration
'int x = 0;' as if it were 'int x;' to shrink the executable.
-2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
-
Improve AIX port (Bug#13650).
This doesn't fix the bug, but it makes progress: Emacs builds now.
* unexaix.c: Include inttypes.h, stdarg.h.
(write_ptr): Use %p to print address rather than %lx and a cast
to unsigned long. Grow buffer a bit, to be safer.
-2013-02-11 Eli Zaretskii <eliz@gnu.org>
+2013-02-13 Eli Zaretskii <eliz@gnu.org>
* bidi.c (bidi_resolve_neutral): After finding the next
non-neutral character, accept NEUTRAL_ON type as well, because
bidi_peek_at_next_level is non-negative. Negative values will
cause an infloop.
-2013-02-05 Daniel Colascione <dancol@dancol.org>
+2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ Minor getenv-related fixes.
+ * callproc.c (Fcall_process_region) [!DOS_NT]:
+ Avoid unnecessary duplicate call to getenv.
+ * callproc.c (init_callproc):
+ * dispnew.c (init_display):
+ * sysdep.c (sys_subshell):
+ Omit unnecessary cast of getenv or egetenv.
+
+2013-02-13 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
+ Update dependencies.
+
+2013-02-12 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (redisplay_internal): Don't set w->region_showing to the
+ marker's position.
+ (display_line): Set w->region_showing to the value of
+ it->region_beg_charpos, not to -1. This fixes redisplay
+ optimization when cursor is moved up after M->. (Bug#13623)
+ (Bug#13626)
+ (try_scrolling): Scroll text up more if point is too close to ZV
+ and inside the scroll margin. This makes sure point is moved
+ outside the scroll margin in these cases.
+
+ * window.h (struct window): region_showing can no longer be
+ negative.
+
+2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ Tune by using memchr and memrchr.
+ * doc.c (Fsnarf_documentation):
+ * fileio.c (Fsubstitute_in_file_name):
+ * search.c (find_newline, scan_newline):
+ * xdisp.c (pos_visible_p, display_count_lines):
+ Use memchr and memrchr rather than scanning byte-by-byte.
+ * search.c (find_newline): Rename from scan_buffer.
+ Omit first arg TARGET, as it's always '\n'. All callers changed.
+
+ Clean up read_key_sequence a tiny bit more.
+ * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
+ (read_key_sequence): Remove unused locals.
+
+2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Clean up read_key_sequence a bit; reread active keymaps after first event.
+ * keyboard.c (read_char, read_char_x_menu_prompt)
+ (read_char_minibuf_menu_prompt):
+ Replace nmaps+maps with a single `map' arg.
+ (follow_key): Operate on a single map.
+ (active_maps): New function.
+ (test_undefined): Also return true for nil bindings.
+ (read_key_sequence): Use active_maps to replace the arrays of keymaps with
+ a single (composed) keymap. Remember `first_event' to choose the right
+ set of active keymaps. Recompute the set of keymaps after receiving
+ the first event. Remove GOBBLE_FIRST_EVENT.
+ (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
+ * keyboard.h (read_char): Update declaration.
+ * lread.c (read_filtered_event): Adjust call to read_char.
+
+2013-02-11 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (move_it_vertically_backward, move_it_by_lines):
+ Don't use the limitation on backwards movement when lines are truncated
+ in the window. (Bug#13675)
+
+2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * marker.c (set_marker_internal): If desired position is passed
+ as a marker, avoid call to buf_charpos_to_bytepos.
+ * window.c (Fset_window_point): Omit redundant type checking.
+ (Fset_window_start): Likewise. Format comment.
+ (window_scroll_pixel_based): Use set_marker_restricted_both
+ with character and byte positions obtained from an iterator.
+ (Fset_window_configuration): Use set_marker_restricted_both.
+ * xdisp.c (message_dolog): Likewise.
+
+2013-02-10 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (move_it_vertically_backward, move_it_by_lines):
+ When text lines are longer than window's screen lines, don't move back
+ too far. This speeds up some redisplay operations. (Bug#13675)
+
+2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * syntax.c (scan_sexps_forward): Fix byte position calculation
+ Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
+
+2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
+ that was not needed.
+
+2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ Minor hashing refactoring.
+ * fns.c (SXHASH_REDUCE): Move to lisp.h.
+ (sxhash_float): Return EMACS_UINT, for consistency with the other
+ hash functions.
+ * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
+ non-static inline function and therefore can't use static vars.
+ (SXHASH_REDUCE): Move here from fns.c, and make it inline.
+ * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
+ with the other hash functions.
+
+2013-02-09 Eli Zaretskii <eliz@gnu.org>
+
+ * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
+ XXXXXX part of the temporary file pattern is not downcased even
+ when w32-downcase-file-names is non-nil. (Bug#13661)
+
+ * xdisp.c (decode_mode_spec): Remove handling of %t.
+
+ * msdos.c (careadlinkatcwd): Remove.
+
+2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * lread.c (skip_dyn_bytes): New function (bug#12598).
+ (read1): Use it. Use getc instead of READCHAR to read bytes.
+ (load_each_byte): Remove. Update users.
+
+2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * search.c (scan_buffer): Calculate end byte position just once.
+ (scan_newline): Do not recalculate start_byte.
+ (search_command): Use eassert.
+ * syntax.c (struct lisp_parse_state): New member location_byte.
+ (scan_sexps_forward): Record from_byte and avoid redundant
+ character to byte position calculation ...
+ (Fparse_partial_sexp): ... here. Break too long line.
+
+2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (make_uninit_vector): New function.
+ * alloc.c (Fvector, Fmake_byte_code):
+ * ccl.c (Fregister_ccl_program):
+ * charset.c (Fdefine_charset_internal, define_charset_internal):
+ * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
+ * composite.c (syms_of_composite):
+ * font.c (Fquery_font, Ffont_info, syms_of_font):
+ * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
+ * ftfont.c (ftfont_shape_by_flt):
+ * indent.c (recompute_width_table):
+ * nsselect.m (clean_local_selection_data):
+ * syntax.c (init_syntax_once):
+ * w32unsubscribe.c (uniscribe_shape):
+ * window.c (Fcurrent_window_configuration):
+ * xfaces.c (Fx_family_fonts):
+ * xselect.c (selection_data_to_lisp_data): Use it.
+
+2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * coding.c (Fdefine_coding_system_internal): Use AREF where
+ argument is known to be a vector.
+ * fns.c (Flocale_info): Likewise for ASET.
+ * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
+ * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
+
+2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
+ height.
+
+ * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
+ (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
+ updateCollectionBehaviour.
+
+ * nsterm.m (NEW_STYLE_FS): Remove.
+ (ns_last_use_native_fullscreen): New variable.
+ (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
+ (x_set_window_size): Do not take title bar and tool bar into account
+ if isFullscreen returns YES.
+ (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
+ (check_native_fs): New function.
+ (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
+ (ns_term_init): Remove NEW_STYLE_FS.
+ (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
+ and tool bar if isFullscreen returns NO.
+ (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
+ (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
+ with HAVE_NATIVE_FS.
+ (window:willUseFullScreenPresentationOptions:): New method.
+ (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
+ Hide toolbar if not enabled (Bug#13444).
+ (windowDidExitFullScreen:): Call updateCollectionBehaviour.
+ Restore tool bar if enabled, hide it otherwise (Bug#13444).
+ (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
+ (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
+ window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
+ Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
+ FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
+ (syms_of_nsterm): Add ns-use-native-fullscreen.
+
+2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fileio.c (Qchoose_write_coding_system): Now static.
+
+2013-02-04 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (window_buffer_changed): region_showing can be negative,
+ which still means region is being displayed.
+ (redisplay_internal): Resurrect code that forced redisplay of the
+ whole window when showing region and the mark has changed.
+ Record the new mark position to allow redisplay optimizations.
+ (display_line): If it->region_beg_charpos is non-zero, set the
+ window's region_showing member to -1. (Bug#13623) (Bug#13626)
+
+ * window.h (struct window) <region_showing>: Declare ptrdiff_t,
+ not bitfield of 1 bit.
+
+2013-02-03 Daniel Colascione <dancol@dancol.org>
* emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
daemon mode works on cygw32 when Emacs is installed and not just
during development.
-2013-02-01 Eli Zaretskii <eliz@gnu.org>
+2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ Avoid file time stamp bug on MS-Windows (Bug#13149).
+ * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
+ as FAT32 doesn't update time stamps when truncating them.
+ Also, check that a file time stamp is not a multiple of 100 ns;
+ this should catch all instances of the problem on MS-Windows,
+ as its native file system resolution is 100 ns or worse, and
+ checking for a non-multiple of 100 ns should impose only a small
+ overhead on systems with ns resolution.
+
+2013-02-02 Eli Zaretskii <eliz@gnu.org>
+
+ Avoid encoding file names on MS-Windows when they need to be run
+ through dostounix_filename.
+ * w32.c (normalize_filename): Accept an additional argument
+ MULTIBYTE; if non-zero, traverse the file name by bytes and don't
+ downcase it even if w32-downcase-file-names is non-nil.
+ (dostounix_filename): Accept an additional argument MULTIBYTE and
+ pass it to normalize_filename.
+ (emacs_root_dir): Adjust.
+
+ * msdos.h (dostounix_filename): Adjust prototype.
+
+ * w32.h (dostounix_filename): Adjust prototype.
+
+ * msdos.c (dostounix_filename): Accept an additional argument and
+ ignore it.
+ (init_environment): Adjust callers of dostounix_filename.
+
+ * fileio.c (Ffile_name_directory, file_name_as_directory)
+ (directory_file_name, Fexpand_file_name)
+ (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
+ dostounix_filename.
+ [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
+ non-nil.
+ (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
+ variables, as egetenv is case-insensitive for DOS_NT.
+
+ * dired.c (file_name_completion): Don't call Fdirectory_file_name
+ with an encoded file name.
+
+ * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
+ Adjust calls to dostounix_filename.
+
+ * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
+
+ * unexw32.c (unexec): Adjust call to dostounix_filename.
+
+ * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
+
+ * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
+ dostounix_filename.
+
+ * callproc.c (Fcall_process) [MSDOS]: Adjust call to
+ dostounix_filename.
* callproc.c (Fcall_process): Make sure program name in PATH and
new_argv[0] is encoded, if needed. Otherwise, un-encoded string
* w32proc.c (sys_spawnve): Make sure escape_char is initialized,
even if w32-quote-process-args is nil.
-2013-01-27 Eli Zaretskii <eliz@gnu.org>
+2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix timestamp bug when write-region appends nothing (Bug#13149).
+ * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
+ the file's time stamp doesn't change if Emacs happens to write nothing
+ to the file, and on a buggy file system this could cause Emacs to
+ incorrectly infer that the file system doesn't have the bug.
+ Avoid this problem by inhibiting the inference in this case.
+
+2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.h (struct window): Convert base_line_number, base_line_pos
+ and column_number_displayed members from Lisp_Object to ptrdiff_t.
+ Convert region_showing member from Lisp_Object to bitfield.
+ Remove sequence_number member. Adjust comments.
+ * window.c (sequence_number): Remove.
+ (make_window): Initialize column_number_displayed.
+ * print.c (print_object): Follow the printed representation of
+ frames and print window pointer to distinguish between windows.
+ (adjust_window_count): Invalidate base_line_pos. Adjust comment.
+ * xdisp.c (wset_base_line_number, wset_base_line_pos)
+ (wset_column_number_displayed, wset_region_showing): Remove.
+ (window_buffer_changed, mode_line_update_needed, redisplay_internal)
+ (try_scrolling, try_cursor_movement, redisplay_window)
+ (try_window_reusing_current_matrix, try_window_id, display_line)
+ (display_mode_lines, decode_mode_spec): Adjust users.
+ * .gdbinit (pwinx): Do not print sequence_number.
+
+2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+ * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
+ * dired.c: Include <fcntl.h>.
+ (open_directory): New function, which uses open and fdopendir
+ rather than opendir. DOS_NT platforms still use opendir, though.
+ (directory_files_internal, file_name_completion): Use it.
+ (file_attributes): New function, with most of the old Ffile_attributes.
+ (directory_files_internal, Ffile_attributes): Use it.
+ (file_attributes, file_name_completion_stat): First arg is now fd,
+ not dir name. All uses changed. Use fstatat rather than lstat +
+ stat.
+ (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
+ * fileio.c: Include <allocator.h>, <careadlinkat.h>.
+ (emacs_readlinkat): New function, with much of the old
+ Ffile_symlink_p, but with an fd argument for speed.
+ It uses readlinkat rather than careadlinkatcwd, so that it
+ need not assume the working directory.
+ (Ffile_symlink_p): Use it.
+ * filelock.c (current_lock_owner): Use emacs_readlinkat
+ rather than emacs_readlink.
+ * lisp.h (emacs_readlinkat): New decl.
+ (READLINK_BUFSIZE, emacs_readlink): Remove.
+ * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
+ (emacs_norealloc_allocator, emacs_readlink): Remove.
+ This stuff is moved to fileio.c.
+ * w32.c (fstatat, readlinkat): New functions.
+ (careadlinkat): Don't check that fd == AT_FDCWD.
+ (careadlinkatcwd): Remove; no longer needed.
+
+2013-01-31 Glenn Morris <rgm@gnu.org>
+
+ * fileio.c (choose_write_coding_system): Make it callable from Lisp.
+ (Fwrite_region): Update for new choose_write_coding_system args.
+ Move the last piece of choose_write_coding_system here. (Bug#13522)
+ (syms_of_fileio): Add choose-write-coding-system.
+
+2013-01-30 Eli Zaretskii <eliz@gnu.org>
* w32.c (sys_open): Zero out the flags for the new file descriptor.
(sys_close): Zero out the flags for the file descriptor before
closing it. (Bug#13546)
-2013-01-26 Eli Zaretskii <eliz@gnu.org>
-
* w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
- (logon_network_drive, stat_worker, symlink, chase_symlinks): Use
- CharNextExA and CharPrevExA to iterate over file names encoded in
+ (logon_network_drive, stat_worker, symlink, chase_symlinks):
+ Use CharNextExA and CharPrevExA to iterate over file names encoded in
DBCS. (Bug#13553)
-2013-01-25 Eli Zaretskii <eliz@gnu.org>
-
* w32.c (w32_get_long_filename, init_environment, readlink):
Support file names encoded in DBCS codepages.
(readlink): Use the current file-name-coding-system, not the ANSI
codepage, to decode and handle targets of symlinks.
-2013-01-23 Eli Zaretskii <eliz@gnu.org>
+2013-01-28 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (opendir): Now accepts a 'const char *'.
+
+2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Remove obsolete redisplay code. See the discussion at
+ http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
+ * dispnew.c (preemption_period, preemption_next_check): Remove.
+ (Vredisplay_preemption_period): Likewise.
+ (update_frame, update_single_window, update_window, update_frame_1):
+ Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
+ used, following the 2012-06-22 change.
+
+2013-01-25 Eli Zaretskii <eliz@gnu.org>
+
+ * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
+
+2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * font.c (num_fonts): Remove the leftover from old
+ debugging code. Adjust comment style here and there.
+ * insdel.c (insert_1): Remove.
+ * lisp.h (insert_1): Remove prototype.
+ * xdisp.c (message_dolog): Adjust users to call insert_1_both.
+
+2013-01-25 Eli Zaretskii <eliz@gnu.org>
* w32.c (max_filename_mbslen): New function.
(normalize_filename, readdir): Use it to detect locales where ANSI
encoding of file names uses a double-byte character set (DBCS).
If a DBCS encoding is used, advance by characters using
- CharNextExA, instead of incrementing a 'char *' pointer. Use
- _mbslwr instead of _strlwr. (Bug#13515)
-
-2013-01-22 Eli Zaretskii <eliz@gnu.org>
+ CharNextExA, instead of incrementing a 'char *' pointer.
+ Use _mbslwr instead of _strlwr. (Bug#13515)
* w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
request of memory reservation to 1.7GB. (Bug#13065)
-2013-01-20 Andreas Schwab <schwab@linux-m68k.org>
+2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
* coding.c (detect_coding_iso_2022): Move back mis-reordered code
at check_extra_latin label. (Bug#13505)
-2013-01-17 Glenn Morris <rgm@gnu.org>
+2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
+ Avoid redundant calls to strlen.
+
+2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Drop async_visible and async_iconified fields of struct frame.
+ This is possible because async input is gone; for details, see
+ http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
+ * frame.h (struct frame): Remove async_visible and async_iconified
+ members, convert garbaged to unsigned bitfield. Adjust comments.
+ (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
+ (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
+ * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
+ Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
+ FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
+ * w32term.c: Ditto.
+ (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
+ properly. Likewise for obscured.
+ * xterm.c: Ditto.
+ (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
+ properly.
+ * nsterm.m: Ditto.
+ (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
+
+2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
+ in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
+
+2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (message2, message2_nolog): Remove functions.
+ (message3, message3_nolog): Extract nbytes and multibyteness directly
+ from the string. Change all callers.
+ (message3_nolog): Don't set message_enable_multibyte since set_message
+ will reset it anyway.
+ (message1, message1_nolog): Use message3.
+ (vmessage): Use a stack allocated buffer rather than f->message_buf.
+ (with_echo_area_buffer): Remove last two arguments. Update all callers.
+ (set_message): Drop all but the second arg, which has to be a string.
+ (set_message_1): Simplify now that we know that a1 is NULL and the
+ second arg is a string.
+ * frame.h (struct frame): Remove `message_buf' field.
+ Use glyphs_initialized_p instead.
+ (FRAME_MESSAGE_BUF): Remove macro.
+ * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
+ * lisp.h (message2, message2_nolog): Remove declarations.
+ (message3, message3_nolog): Update declarations.
+ * keyboard.c (read_char_minibuf_menu_text)
+ (read_char_minibuf_menu_width): Remove vars.
+ (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
+ to correctly handle multibyte strings.
+ * frame.c (delete_frame): Don't free message_buf any more.
+ * editfns.c (message_text, message_length): Remove vars.
+ (Fmessage_box): Don't copy the Lisp string's bytes any longer.
+ * fileio.c (auto_save_error): Use message3 instead of message2.
+ * dispnew.c (adjust_frame_message_buffer): Remove function.
+
+2013-01-23 Eli Zaretskii <eliz@gnu.org>
+
+ * w32term.c (w32fullscreen_hook): Account correctly for the screen
+ real estate used for the tool bar and the menu bar.
+
+2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * insdel.c (prepare_to_modify_buffer): Force redisplay if
+ hidden buffer is prepared to modification (Bug#13164).
+
+2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.h (struct window): Change window_end_valid member from
+ Lisp_Object to a bitfield. Adjust comments.
+ (wset_window_end_valid): Remove.
+ * window.c (adjust_window_count): Clear window_end_valid.
+ (Fwindow_end): Adjust user. Remove ancient #if 0 code.
+ (Fwindow_line_height, set_window_buffer, Frecenter)
+ (Fsplit_window_internal, Fdelete_other_windows_internal)
+ (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
+ * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
+ * xdisp.c (check_window_end, reconsider_clip_changes)
+ (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
+ (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
+ (find_first_unchanged_at_end_row, try_window_id): Likewise.
+
+2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (mark_window_display_accurate): Simplify the loop
+ assuming that the only one of vchild, hchild or buffer window
+ slots is non-nil. Call mark_window_display_accurate_1 for
+ the leaf windows only.
+ (mark_window_display_accurate_1): Always assume leaf window.
+ Adjust comment.
+
+2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * emacs.c (Qkill_emacs_hook): Now static.
+
+ * fileio.c (Finsert_file_contents): Simplify.
+ Remove unnecessary assignments and tests.
+
+2013-01-21 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (acl_set_file): Don't test for errors unless
+ set_file_security returns FALSE. Avoids spurious errors when
+ saving files.
+
+2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * fileio.c (Finsert_file_contents): Revert code introduced at
+ 2013-01-18 in favor of the simpler and generally better fix.
+ Save stack space by removing 'buffer' and reusing 'read_buf'
+ where appropriate.
+
+2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lisp.h (eabs): Define unconditionally (Bug#13419).
+ The old "#if !defined (eabs)" was an unnecessary revenant of back
+ when this macro was called "abs". Document 'eabs' better.
+
+2013-01-19 Glenn Morris <rgm@gnu.org>
* fns.c (Frandom): Doc fix.
+2013-01-19 Eli Zaretskii <eliz@gnu.org>
+
+ * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
+ segfault when there are lots of overlays.
+
+ * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
+ when there are lots of overlays.
+ See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
+ for the details and a way to reproduce.
+
+2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fileio.c: Use O_APPEND to append.
+ This corresponds better to the natural interpretation of "append",
+ and avoids the need to open the output file twice, or to invoke
+ lseek when APPEND is neither nil nor a number.
+ This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
+ (Fwrite_region): Simplify. Use O_APPEND instead of opening the
+ file possibly twice, and lseeking to its end; this avoids the
+ need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
+ at the same time: the combination is never needed and apparently
+ it doesn't work with DOS_NT.
+
+ Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
+ * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
+
+ Allow floating-point file offsets.
+ Problem reported by Vitalie Spinu in
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
+ * fileio.c (emacs_lseek): Remove.
+ (file_offset): New function.
+ (Finsert_file_contents, Fwrite_region): Use it.
+
+2013-01-19 Chong Yidong <cyd@gnu.org>
+
+ * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
+ aborting on Fsignal (Bug#13289).
+
+2013-01-19 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
+ set_file_security as failure due to insufficient privileges.
+ Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
+ (fstat): Return owner and group like 'stat' and 'lstat' do.
+
+2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ Work around bug in CIFS and vboxsf file systems (Bug#13149).
+ The bug was observed on Ubuntu operating inside a virtual machine,
+ editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
+ The workaround introduces a race condition on non-buggy hosts,
+ but it's an unlikely race and anyway there's a nearly identical
+ nearby race that can't be fixed.
+ * fileio.c (valid_timestamp_file_system, timestamp_file_system):
+ New static vars.
+ (Fwrite_region): Test for file system time stamp bug.
+ (init_fileio): New function.
+ * lisp.h (init_fileio): Declare it.
+ * emacs.c (main): Call it.
+
+ * fileio.c (Finsert_file_contents): Simplify new diagnostic
+ and make it more consistent with other stat-failure diagnostics.
+
+2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Fix crash when inserting data from non-regular files.
+ See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
+ for the error description produced by valgrind.
+ * fileio.c (read_non_regular): Rename to read_contents.
+ Free Lisp_Save_Value object used to pass parameters.
+ (read_non_regular_quit): Rename to read_contents_quit.
+ (Finsert_file_contents): Redesign internal file reading loop to adjust
+ gap and end positions after each read and so help make_gap to work
+ properly. Do not signal an I/O error too early and so do not leave
+ not yet decoded characters in a buffer, which was the reason of
+ redisplay crash. Use list2 to build return value. Adjust comments.
+
+2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Close a race when statting and reading files (Bug#13149).
+ * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
+ This avoids a race if the file is renamed between stat and open.
+ This race is not the problem originally noted in Bug#13149;
+ see <http://bugs.gnu.org/13149#73> and later messages in the thread.
+
+2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (toplevel): Add comment about using Lisp_Save_Value
+ objects, related functions and macros.
+ (make_save_value): Adjust prototype.
+ (make_save_pointer): New prototype.
+ (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
+ (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
+ * alloc.c (format_save_value): Rename to make_save_value.
+ (make_save_pointer): New function.
+ (record_xmalloc): Use make_save_pointer.
+ * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
+ * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
+ Change users of make_save_value to make_save_pointer.
+ Likewise for format_save_value and make_save_value.
+
+2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
+ (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
+ * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
+ debugging stubs.
+
+2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * alloc.c (free_save_value): Now static.
+
+2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * keymap.c (map_keymap_internal): Use format_save_value.
+ (map_keymap_char_table_item): Adjust accordingly.
+ * fileio.c (non_regular_fd, non_regular_inserted)
+ (non_regular_nbytes): Remove.
+ (Finsert_file_contents): Convert trytry to ptrdiff_t.
+ Use format_save_value to pass parameters to read_non_regular.
+ (read_non_regular): Use XSAVE_ macros to extract parameters.
+ Adjust comment.
+ * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
+ format_save_value.
+ (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
+
+2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
+ extraction from any Lisp_Save_Value slot. Add type checking.
+ * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
+ * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
+ * xselect.c: All users changed.
+
+2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Some convenient bits to deal with Lisp_Save_Values.
+ * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
+ (allocate_misc): Remove prototype.
+ (format_save_value): New prototype.
+ * alloc.c (allocate_misc): Revert back to static.
+ (format_save_value): New function to build Lisp_Save_Value
+ object with the specified internal structure.
+ (make_save_value): Reimplement using format_save_value.
+ * editfns.c (save_excursion_save): Use format_save_value.
+ (save_excursion_restore): Use XSAVE_OBJECT.
+
+2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Avoid needless casts with XSAVE_POINTER.
+ * alloc.c (mark_object) [GC_MARK_STACK]:
+ * dired.c (directory_files_internal_unwind):
+ * fileio.c (do_auto_save_unwind):
+ * gtkutil.c (pop_down_dialog):
+ * keymap.c (map_keymap_char_table_item):
+ * lread.c (load_unwind):
+ * nsmenu.m (pop_down_menu):
+ * print.c (print_object) [GC_MARK_STACK]:
+ * xfns.c (clean_up_file_dialog):
+ * xmenu.c (cleanup_widget_value_tree):
+ Omit casts between XSAVE_POINTER and a pointer type.
+
+2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
+ * eval.c (eval_sub): Protect `form' from being GCed before its
+ car and cdr becomes protected with the backtrace entry.
+
+2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Make Lisp_Save_Value more versatile storage for up to four objects.
+ * lisp.h (toplevel): Enumeration to describe types of saved objects.
+ (struct Lisp_Save_Value): New layout. Adjust comments.
+ (XSAVE_POINTER): New macro.
+ (XSAVE_INTEGER): Likewise.
+ (allocate_misc): Add prototype.
+ (free_misc): Likewise.
+ * alloc.c (allocate_misc): Now global.
+ (free_misc): Likewise. Adjust comment.
+ (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
+ (free_save_value): Likewise.
+ (mark_object): Likewise.
+ * editfns.c (save_excursion_save): Pack everything within
+ Lisp_Save_Value and so avoid xmalloc.
+ (save_excursion_restore): Adjust to match new layout. Use free_misc
+ because we do not allocate extra memory any more. Add eassert.
+ * print.c (print_object): New code to print Lisp_Save_Value. Do not
+ rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
+ * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
+ * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
+ Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
+
2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
* nsfont.m (LCD_SMOOTHING_MARGIN): New define.
(ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
Bug#11484 with LCD smoothing on.
-2013-01-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
-
- * gtkutil.c (xg_initialize): Backport from trunk.
- Add ifdef HAVE_FREETYPE around x_last_font_name (Bug#13403).
-
-2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
-
- Backport typo fix from trunk, for AIX (Bug#13408).
- * 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>.
+2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
Fix SIGDANGER handlers, for AIX (Bug#13408).
* sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
Move handlers here from emacs.c; they were out of place.
+2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.c (syms_of_xterm): Adjust documentation for
+ scroll-bar-adjust-thumb-portion.
+
+2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
+
+ * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
+ determine whether scroll bar thumb size should be adjusted or
+ not. Use variable for MOTIF.
+
+ * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
+ GTK.
+
+2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
+ event is generated.
+ (doCommandBySelector:): Set processingCompose to NO.
+
+ * nsfont.m (ns_findfonts): Add block/unblock_input calls.
+ Remove check for fkeys count > zero, block/unblock fixes the real bug.
+ (nsfont_list_family): Add block/unblock_input calls.
+ (nsfont_open): Move block_input earlier. Add unblock_input before early
+ return.
+ (nsfont_draw): Add block/unblock_input calls.
+
+2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
+ for old_charpos and old_bytepos.
+
+2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
+ * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
+ Clear tzvalbuf_in_environ if this workaround is in effect.
+ Problem and fix reported by Kazuhiro Ito.
+
+2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
+
+ * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
+ Fix ambiguous doc string cross-reference(s).
+
+ * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
+ doc string cross-reference(s).
+
+ * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
+ string cross-reference(s).
+
+2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Avoid unnecessary byte position calculation for the gap movement.
+ Since all users of move_gap do CHAR_TO_BYTE for other purposes
+ anyway, all of them should use move_gap_both instead.
+ * lisp.h (move_gap): Remove prototype.
+ * insdel.c (move_gap): Remove.
+ (move_gap_both): Add eassert.
+ * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
+ * xml.c (parse_region): Likewise.
+
+2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ emacsclient -t should not suspend Emacs server (Bug#13387)
+ * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
+ New functions.
+ * term.c (init_tty): Use them instead of rolling our own code.
+ * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
+ switches from 'signal' to 'pthread_sigmask', which is safer in
+ multithreaded applications.
+ * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
+ which has already arranged for that.
+ (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
+ This is the main part of the bug fix.
+
+2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
+
+ * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
+ x_last_font_name (Bug#13403).
+
+2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Omit buffer_slot_type_mismatch and use generic predicates to enforce
+ the type of per-buffer values where appropriate.
+ * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
+ predicate, which is how it's really used now. Adjust comment.
+ * buffer.h (buffer_slot_type_mismatch): Remove prototype.
+ * buffer.c (buffer_slot_type_mismatch): Remove.
+ (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
+ predicate. Adjust comment.
+ (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
+ fill-column, left-margin, tab-width, buffer-saved-size,
+ left-margin-width, right-margin-width, left-fringe-width,
+ right-fringe-width, scroll-bar-width and buffer-display-count.
+ Use Qstringp for default-directory, buffer-file-name,
+ buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
+ scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
+ line-spacing.
+ * data.c (store_symval_forwarding): Adjust to call the predicate.
+
+2013-01-09 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32.c (get_name_and_id, acl_set_file):
+ * w32term.c (w32fullscreen_hook): Remove unused local variables.
+
+2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (make_gap_1): New prototype.
+ * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
+ gap size values.
+ * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
+ naming convention.
+ (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
+ * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
+ (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
+ (make_gap_1): New function to adjust the gap of any buffer.
+ * coding.c (coding_alloc_by_making_gap): Use it.
+ * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
+ GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
+
+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>
- * search.c (search_buffer): Check the inverse translations of each
- character in pattern when the buffer being searched is unibyte.
- (Bug#13084)
+ * 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-10 Paul Eggert <eggert@cs.ucla.edu>
+2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
- * 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.
+ 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-08 Jan Djärv <jan.h.d@swipnet.se>
+2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
- * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
+ * xdisp.c (redisplay_internal): Remove now-unused local.
-2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
+2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
- * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
- DWORD_PTR, for compatibility with 64-bit builds.
+ * 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).
- * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
- (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
- (system_process_attributes): Use SIZE_T rather than DWORD, for
- compatibility with 64-bit builds.
+2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
-2012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
+ * 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.
- * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
+2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
-2012-12-07 Eli Zaretskii <eliz@gnu.org>
+ * 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.
- * 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-18 Eli Zaretskii <eliz@gnu.org>
-2012-12-07 Martin Rudalics <rudalics@gmx.at>
+ * 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.
- * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
+2012-12-17 Juanma Barranquero <lekktu@gmail.com>
-2012-12-05 Eli Zaretskii <eliz@gnu.org>
+ * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
+ ($(BLD)/w32.$(O)): Update dependencies.
- * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
- fails, signal an error instead of continuing with an empty
- string. (Bug#13079)
- Encode expanded temp file pattern before passing it to mkstemp or
- mktemp.
+2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
-2012-12-04 Eli Zaretskii <eliz@gnu.org>
+ * 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.
- * 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-17 Eli Zaretskii <eliz@gnu.org>
-2012-12-01 Chong Yidong <cyd@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>.
- * fileio.c (Vauto_save_list_file_name): Doc fix.
+2012-12-16 Romain Francoise <romain@orebokech.com>
-2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.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'.
- * w32fns.c: Remove prototype of atof.
- (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
- builds.
- (file_dialog_callback): Declared UINT_PTR.
+ * Makefile.in (LIBACL_LIBS): New macro.
+ (LIBES): Use it.
- * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
- with 64-bit builds.
+2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
- * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
- (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
- defined.
+ * fileio.c (internal_delete_file): Use bool for boolean.
-2012-11-27 Glenn Morris <rgm@gnu.org>
+2012-12-15 Eli Zaretskii <eliz@gnu.org>
- * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
+ 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.
-2012-11-26 Eli Zaretskii <eliz@gnu.org>
+ * 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.
- * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
- (Bug#11964)
+ * fileio.c (internal_delete_file): Return an int again: non-zero
+ if delete-file succeeds, zero otherwise.
-2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
+ * lisp.h (internal_delete_file): Adjust prototype.
- 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.
+ * 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-11-24 Eli Zaretskii <eliz@gnu.org>
+2012-12-14 Eli Zaretskii <eliz@gnu.org>
- * 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.
+ * editfns.c [HAVE_PWD_H]: Include grp.h.
-2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
- Eli Zaretskii <eliz@gnu.org>
+ * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
- 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.
+2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
- This is a backport from the trunk, consisting of:
+ 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.
- * 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.
+2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
- * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
- as it is no longer needed.
+ * xdisp.c (select_frame_for_redisplay, display_mode_lines):
+ Keep selected_window and selected_frame in sync.
- * 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'.
+2012-12-14 Eli Zaretskii <eliz@gnu.org>
-2012-11-23 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-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-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-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.
+
+ * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
+ (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
+ (system_process_attributes): Use SIZE_T rather than DWORD, for
+ compatibility with 64-bit builds.
+
+2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
+
+ * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
+
+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-10 Martin Rudalics <rudalics@gmx.at>
+
+ * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
+
+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
+ string. (Bug#13079)
+ Encode expanded temp file pattern before passing it to mkstemp or
+ mktemp.
+
+ * 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-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-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
+
+ * w32fns.c: Remove prototype of atof.
+ (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
+ builds.
+ (file_dialog_callback): Make it UINT_PTR.
+
+ * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
+ with 64-bit builds.
+
+ * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
+ (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
+ defined.
+
+2012-12-03 Glenn Morris <rgm@gnu.org>
+
+ * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
+
+2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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.
+
+ 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.
+
+2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ * 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-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
+
+2012-11-24 Ken Brown <kbrown@cornell.edu>
+
+ * keyboard.c (HAVE_MOUSE):
+ * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
+ were always defined.
+
+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>
+
+ * 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-20 Ken Brown <kbrown@cornell.edu>
+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
#include <limits.h> /* For CHAR_BIT. */
#ifdef ENABLE_CHECKING
-#include <signal.h> /* For SIGABRT. */
+#include <signal.h> /* For SIGABRT. */
#endif
#ifdef HAVE_PTHREAD
#endif
#include <unistd.h>
-#ifndef HAVE_UNISTD_H
-extern void *sbrk ();
-#endif
-
#include <fcntl.h>
#ifdef USE_GTK
static Lisp_Object Qpost_gc_hook;
+static void free_save_value (Lisp_Object);
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;
}
record_xmalloc (size_t size)
{
void *p = xmalloc (size);
- record_unwind_protect (safe_alloca_unwind, make_save_value (p, 0));
+ record_unwind_protect (safe_alloca_unwind, make_save_pointer (p));
return p;
}
b = lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP);
#ifdef DOUG_LEA_MALLOC
- /* Back to a reasonable maximum of mmap'ed areas. */
+ /* Back to a reasonable maximum of mmap'ed areas. */
mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
#endif
#ifdef GC_CHECK_STRING_BYTES
/* Check that the string size recorded in the string is the
- same as the one recorded in the sdata structure. */
+ same as the one recorded in the sdata structure. */
if (s && string_bytes (s) != SDATA_NBYTES (from))
emacs_abort ();
#endif /* GC_CHECK_STRING_BYTES */
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;
usage: (vector &rest OBJECTS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
- register Lisp_Object len, val;
ptrdiff_t i;
- register struct Lisp_Vector *p;
+ register Lisp_Object val = make_uninit_vector (nargs);
+ register struct Lisp_Vector *p = XVECTOR (val);
- XSETFASTINT (len, nargs);
- val = Fmake_vector (len, Qnil);
- p = XVECTOR (val);
for (i = 0; i < nargs; i++)
p->contents[i] = args[i];
return val;
usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
- register Lisp_Object len, val;
ptrdiff_t i;
- register struct Lisp_Vector *p;
+ register Lisp_Object val = make_uninit_vector (nargs);
+ register struct Lisp_Vector *p = XVECTOR (val);
/* We used to purecopy everything here, if purify-flag was set. This worked
OK for Emacs-23, but with Emacs-24's lexical binding code, it can be
just wasteful and other times plainly wrong (e.g. those free vars may want
to be setcar'd). */
- XSETFASTINT (len, nargs);
- val = Fmake_vector (len, Qnil);
-
- p = XVECTOR (val);
for (i = 0; i < nargs; i++)
p->contents[i] = args[i];
make_byte_code (p);
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 object */
+/* Free a Lisp_Misc object. */
-static void
+void
free_misc (Lisp_Object misc)
{
XMISCTYPE (misc) = Lisp_Misc_Free;
total_free_markers++;
}
-/* Return a Lisp_Misc_Save_Value object containing POINTER and
- INTEGER. This is used to package C values to call record_unwind_protect.
- The unwind function can get the C values back using XSAVE_VALUE. */
+/* Return a Lisp_Save_Value object with the data saved according to
+ FMT. Format specifiers are `i' for an integer, `p' for a pointer
+ and `o' for Lisp_Object. Up to 4 objects can be specified. */
Lisp_Object
-make_save_value (void *pointer, ptrdiff_t integer)
+make_save_value (const char *fmt, ...)
{
- register Lisp_Object val;
- register struct Lisp_Save_Value *p;
+ va_list ap;
+ int len = strlen (fmt);
+ Lisp_Object val = allocate_misc (Lisp_Misc_Save_Value);
+ struct Lisp_Save_Value *p = XSAVE_VALUE (val);
+
+ eassert (0 < len && len < 5);
+ va_start (ap, fmt);
+
+#define INITX(index) \
+ do { \
+ if (len <= index) \
+ p->type ## index = SAVE_UNUSED; \
+ else \
+ { \
+ if (fmt[index] == 'i') \
+ { \
+ p->type ## index = SAVE_INTEGER; \
+ p->data[index].integer = va_arg (ap, ptrdiff_t); \
+ } \
+ else if (fmt[index] == 'p') \
+ { \
+ p->type ## index = SAVE_POINTER; \
+ p->data[index].pointer = va_arg (ap, void *); \
+ } \
+ else if (fmt[index] == 'o') \
+ { \
+ p->type ## index = SAVE_OBJECT; \
+ p->data[index].object = va_arg (ap, Lisp_Object); \
+ } \
+ else \
+ emacs_abort (); \
+ } \
+ } while (0)
+
+ INITX (0);
+ INITX (1);
+ INITX (2);
+ INITX (3);
+
+#undef INITX
+
+ va_end (ap);
+ p->area = 0;
+ return val;
+}
+
+/* The most common task it to save just one C pointer. */
+
+Lisp_Object
+make_save_pointer (void *pointer)
+{
+ Lisp_Object val = allocate_misc (Lisp_Misc_Save_Value);
+ struct Lisp_Save_Value *p = XSAVE_VALUE (val);
- val = allocate_misc (Lisp_Misc_Save_Value);
- p = XSAVE_VALUE (val);
- p->pointer = pointer;
- p->integer = integer;
- p->dogc = 0;
+ p->area = 0;
+ p->type0 = SAVE_POINTER;
+ p->data[0].pointer = pointer;
+ p->type1 = p->type2 = p->type3 = SAVE_UNUSED;
return val;
}
+/* Free a Lisp_Save_Value object. Do not use this function
+ if SAVE contains pointer other than returned by xmalloc. */
+
+static void
+free_save_value (Lisp_Object save)
+{
+ xfree (XSAVE_POINTER (save, 0));
+ 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;
}
}
-/* setjmp will work with GCC unless NON_SAVING_SETJMP is defined in
- the GCC system configuration. In gcc 3.2, the only systems for
- which this is so are i386-sco5 non-ELF, i386-sysv3 (maybe included
- by others?) and ns32k-pc532-min. */
-
#if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS
static bool setjmp_tested_p;
#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))
case Lisp_Misc_Save_Value:
XMISCANY (obj)->gcmarkbit = 1;
-#if GC_MARK_STACK
{
register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj);
- /* If DOGC is set, POINTER is the address of a memory
- area containing INTEGER potential Lisp_Objects. */
- if (ptr->dogc)
+ /* If `area' is nonzero, `data[0].pointer' is the address
+ of a memory area containing `data[1].integer' potential
+ Lisp_Objects. */
+#if GC_MARK_STACK
+ if (ptr->area)
{
- Lisp_Object *p = (Lisp_Object *) ptr->pointer;
+ Lisp_Object *p = ptr->data[0].pointer;
ptrdiff_t nelt;
- for (nelt = ptr->integer; nelt > 0; nelt--, p++)
+ for (nelt = ptr->data[1].integer; nelt > 0; nelt--, p++)
mark_maybe_object (*p);
}
+ else
+#endif /* GC_MARK_STACK */
+ {
+ /* Find Lisp_Objects in `data[N]' slots and mark them. */
+ if (ptr->type0 == SAVE_OBJECT)
+ mark_object (ptr->data[0].object);
+ if (ptr->type1 == SAVE_OBJECT)
+ mark_object (ptr->data[1].object);
+ if (ptr->type2 == SAVE_OBJECT)
+ mark_object (ptr->data[2].object);
+ if (ptr->type3 == SAVE_OBJECT)
+ mark_object (ptr->data[3].object);
+ }
}
-#endif
break;
case Lisp_Misc_Overlay:
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;
}
}
}
#endif
\f
-/* Initialization */
+/* Initialization. */
void
init_alloc_once (void)
#endif
#ifdef DOUG_LEA_MALLOC
- mallopt (M_TRIM_THRESHOLD, 128*1024); /* trim threshold */
- mallopt (M_MMAP_THRESHOLD, 64*1024); /* mmap threshold */
- mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); /* max. number of mmap'ed areas */
+ mallopt (M_TRIM_THRESHOLD, 128 * 1024); /* Trim threshold. */
+ mallopt (M_MMAP_THRESHOLD, 64 * 1024); /* Mmap threshold. */
+ mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); /* Max. number of mmap'ed areas. */
#endif
init_strings ();
init_vectors ();
b->INTERNAL_FIELD (zv_marker) = val;
}
-/* For debugging; temporary. See set_buffer_internal. */
-/* Lisp_Object Qlisp_mode, Vcheck_symbol; */
-
void
nsberror (Lisp_Object spec)
{
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;
-
- CHECK_FRAME (frame);
+ struct frame *f = decode_any_frame (frame);
+ Lisp_Object tail = f->buffer_list, pred = f->buffer_predicate;
+ Lisp_Object buf, notsogood = Qnil;
- 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
if (!buffer->text->inhibit_shrinking)
{
/* If a buffer's gap size is more than 10% of the buffer
- size, or larger than 2000 bytes, then shrink it
- accordingly. Keep a minimum size of 20 bytes. */
- int size = min (2000, max (20, (buffer->text->z_byte / 10)));
-
- if (buffer->text->gap_size > size)
- {
- struct buffer *save_current = current_buffer;
- current_buffer = buffer;
- make_gap (-(buffer->text->gap_size - size));
- current_buffer = save_current;
- }
+ size, or larger than GAP_BYTES_DFL bytes, then shrink it
+ accordingly. Keep a minimum size of GAP_BYTES_MIN bytes. */
+ ptrdiff_t size = clip_to_bounds (GAP_BYTES_MIN,
+ BUF_Z_BYTE (buffer) / 10,
+ GAP_BYTES_DFL);
+ if (BUF_GAP_SIZE (buffer) > size)
+ make_gap_1 (buffer, -(BUF_GAP_SIZE (buffer) - size));
}
- 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;
}
sort_overlays (Lisp_Object *overlay_vec, ptrdiff_t noverlays, struct window *w)
{
ptrdiff_t i, j;
- struct sortvec *sortvec = alloca (noverlays * sizeof *sortvec);
+ USE_SAFE_ALLOCA;
+ struct sortvec *sortvec;
+
+ SAFE_NALLOCA (sortvec, 1, noverlays);
/* Put the valid and relevant overlays into sortvec. */
for (i = 0; i < noverlays; i++)
overlay_vec[i] = sortvec[i].overlay;
+
+ SAFE_FREE ();
return (noverlays);
}
\f
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);
}
for (; CONSP (hit_list); hit_list = XCDR (hit_list))
Fdelete_overlay (XCAR (hit_list));
}
-\f
-/* Somebody has tried to store a value with an unacceptable type
- in the slot with offset OFFSET. */
-
-void
-buffer_slot_type_mismatch (Lisp_Object newval, int type)
-{
- Lisp_Object predicate;
-
- switch (type)
- {
- case_Lisp_Int: predicate = Qintegerp; break;
- case Lisp_String: predicate = Qstringp; break;
- case Lisp_Symbol: predicate = Qsymbolp; break;
- default: emacs_abort ();
- }
-
- wrong_type_argument (predicate, newval);
-}
-\f
/***********************************************************************
Allocation with mmap
***********************************************************************/
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! */
free (pwd);
}
-/* Similar to defvar_lisp but define a variable whose value is the Lisp
- Object stored in the current buffer. address is the address of the slot
- in the buffer that is current now. */
-
-/* TYPE is nil for a general Lisp variable.
- An integer specifies a type; then only Lisp values
- with that type code are allowed (except that nil is allowed too).
- LNAME is the Lisp-level variable name.
- VNAME is the name of the buffer slot.
- DOC is a dummy where you write the doc string as a comment. */
-#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \
- do { \
- static struct Lisp_Buffer_Objfwd bo_fwd; \
- defvar_per_buffer (&bo_fwd, lname, vname, type); \
+/* Similar to defvar_lisp but define a variable whose value is the
+ Lisp_Object stored in the current buffer. LNAME is the Lisp-level
+ variable name. VNAME is the name of the buffer slot. PREDICATE
+ is nil for a general Lisp variable. If PREDICATE is non-nil, then
+ only Lisp values that satisfies the PREDICATE are allowed (except
+ that nil is allowed too). DOC is a dummy where you write the doc
+ string as a comment. */
+
+#define DEFVAR_PER_BUFFER(lname, vname, predicate, doc) \
+ do { \
+ static struct Lisp_Buffer_Objfwd bo_fwd; \
+ defvar_per_buffer (&bo_fwd, lname, vname, predicate); \
} while (0)
static void
defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring,
- Lisp_Object *address, Lisp_Object type)
+ Lisp_Object *address, Lisp_Object predicate)
{
struct Lisp_Symbol *sym;
int offset;
bo_fwd->type = Lisp_Fwd_Buffer_Obj;
bo_fwd->offset = offset;
- bo_fwd->slottype = type;
+ bo_fwd->predicate = predicate;
sym->declared_special = 1;
sym->redirect = SYMBOL_FORWARDED;
{
doc: /* Value of `major-mode' for new buffers. */);
DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode),
- make_number (Lisp_Symbol),
+ Qsymbolp,
doc: /* Symbol for current buffer's major mode.
The default value (normally `fundamental-mode') affects new buffers.
A value of nil means to use the current buffer's major mode, provided
doc: /* Non-nil if searches and matches should ignore case. */);
DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column),
- make_number (Lisp_Int0),
+ Qintegerp,
doc: /* Column beyond which automatic line-wrapping should happen.
Interactively, you can set the buffer local value using \\[set-fill-column]. */);
DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin),
- make_number (Lisp_Int0),
+ Qintegerp,
doc: /* Column for the default `indent-line-function' to indent to.
Linefeed indents to this column in Fundamental mode. */);
DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width),
- make_number (Lisp_Int0),
+ Qintegerp,
doc: /* Distance between tab stops (for display of tab characters), in columns.
This should be an integer greater than zero. */);
`visual-line-mode'. */);
DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory),
- make_number (Lisp_String),
+ Qstringp,
doc: /* Name of default directory of current buffer. Should end with slash.
To interactively change the default directory, use command `cd'. */);
its value may not be a list of functions. */);
DEFVAR_PER_BUFFER ("buffer-file-name", &BVAR (current_buffer, filename),
- make_number (Lisp_String),
+ Qstringp,
doc: /* Name of file visited in current buffer, or nil if not visiting a file. */);
DEFVAR_PER_BUFFER ("buffer-file-truename", &BVAR (current_buffer, file_truename),
- make_number (Lisp_String),
+ Qstringp,
doc: /* Abbreviated truename of file visited in current buffer, or nil if none.
The truename of a file is calculated by `file-truename'
and then abbreviated with `abbreviate-file-name'. */);
DEFVAR_PER_BUFFER ("buffer-auto-save-file-name",
&BVAR (current_buffer, auto_save_file_name),
- make_number (Lisp_String),
+ Qstringp,
doc: /* Name of file for auto-saving current buffer.
If it is nil, that means don't auto-save this buffer. */);
Backing up is done before the first time the file is saved. */);
DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length),
- make_number (Lisp_Int0),
+ Qintegerp,
doc: /* Length of current buffer when last read in, saved or auto-saved.
0 initially.
-1 means auto-saving turned off until next real save.
See also the functions `display-table-slot' and `set-display-table-slot'. */);
DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols),
- Qnil,
+ Qintegerp,
doc: /* Width of left marginal area for display of a buffer.
A value of nil means no marginal area. */);
DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols),
- Qnil,
+ Qintegerp,
doc: /* Width of right marginal area for display of a buffer.
A value of nil means no marginal area. */);
DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width),
- Qnil,
+ Qintegerp,
doc: /* Width of this buffer's left fringe (in pixels).
A value of 0 means no left fringe is shown in this buffer's window.
A value of nil means to use the left fringe width from the window's frame. */);
DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width),
- Qnil,
+ Qintegerp,
doc: /* Width of this buffer's right fringe (in pixels).
A value of 0 means no right fringe is shown in this buffer's window.
A value of nil means to use the right fringe width from the window's frame. */);
A value of nil means to display fringes between margins and buffer text. */);
DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width),
- Qnil,
+ Qintegerp,
doc: /* Width of this buffer's scroll bars in pixels.
A value of nil means to use the scroll bar width from the window's frame. */);
cursor type. */);
DEFVAR_PER_BUFFER ("scroll-up-aggressively",
- &BVAR (current_buffer, scroll_up_aggressively), Qnil,
+ &BVAR (current_buffer, scroll_up_aggressively), Qfloatp,
doc: /* How far to scroll windows upward.
If you move point off the bottom, the window scrolls automatically.
This variable controls how far it scrolls. The value nil, the default,
between 0.0 and 1.0, inclusive. */);
DEFVAR_PER_BUFFER ("scroll-down-aggressively",
- &BVAR (current_buffer, scroll_down_aggressively), Qnil,
+ &BVAR (current_buffer, scroll_down_aggressively), Qfloatp,
doc: /* How far to scroll windows downward.
If you move point off the top, the window scrolls automatically.
This variable controls how far it scrolls. The value nil, the default,
window scrolls by a full window height. Meaningful values are
between 0.0 and 1.0, inclusive. */);
-/*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol,
- "Don't ask.");
-*/
-
DEFVAR_LISP ("before-change-functions", Vbefore_change_functions,
doc: /* List of functions to call before each text change.
Two arguments are passed to each function: the positions of
and they have an ellipsis as well if ELLIPSIS is non-nil. */);
DEFVAR_PER_BUFFER ("buffer-display-count",
- &BVAR (current_buffer, display_count), Qnil,
+ &BVAR (current_buffer, display_count), Qintegerp,
doc: /* A number incremented each time this buffer is displayed in a window.
The function `set-window-buffer' increments it. */);
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
`cursor-in-non-selected-windows'. */);
DEFVAR_PER_BUFFER ("line-spacing",
- &BVAR (current_buffer, extra_line_spacing), Qnil,
+ &BVAR (current_buffer, extra_line_spacing), Qnumberp,
doc: /* Additional space to put between lines when displaying a buffer.
The space is measured in pixels, and put below lines on graphic displays,
see `display-graphic-p'.
/* Size of gap. */
#define GAP_SIZE (current_buffer->text->gap_size)
-/* Is the current buffer narrowed? */
-#define NARROWED ((BEGV != BEG) || (ZV != Z))
-
/* Modification count. */
#define MODIFF (current_buffer->text->modiff)
/* Size of gap. */
#define BUF_GAP_SIZE(buf) ((buf)->text->gap_size)
-/* Is this buffer narrowed? */
-#define BUF_NARROWED(buf) ((BUF_BEGV (buf) != BUF_BEG (buf)) \
- || (BUF_ZV (buf) != BUF_Z (buf)))
-
/* Modification count. */
#define BUF_MODIFF(buf) ((buf)->text->modiff)
/* 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)
/* Access a Lisp position value in POS,
and store the charpos in CHARPOS and the bytepos in BYTEPOS. */
-#define DECODE_POSITION(charpos, bytepos, pos) \
-do \
- { \
- Lisp_Object __pos = (pos); \
- if (NUMBERP (__pos)) \
- { \
- charpos = __pos; \
- bytepos = buf_charpos_to_bytepos (current_buffer, __pos); \
- } \
- else if (MARKERP (__pos)) \
- { \
- charpos = marker_position (__pos); \
- bytepos = marker_byte_position (__pos); \
- } \
- else \
- wrong_type_argument (Qinteger_or_marker_p, __pos); \
- } \
-while (0)
+#define DECODE_POSITION(charpos, bytepos, pos) \
+ do \
+ { \
+ Lisp_Object __pos = (pos); \
+ if (NUMBERP (__pos)) \
+ { \
+ charpos = __pos; \
+ bytepos = buf_charpos_to_bytepos (current_buffer, __pos); \
+ } \
+ else if (MARKERP (__pos)) \
+ { \
+ charpos = marker_position (__pos); \
+ bytepos = marker_byte_position (__pos); \
+ } \
+ else \
+ wrong_type_argument (Qinteger_or_marker_p, __pos); \
+ } \
+ while (0)
/* Maximum number of bytes in a buffer.
A buffer cannot contain more bytes than a 1-origin fixnum can represent,
#define BUF_BYTES_MAX \
(ptrdiff_t) min (MOST_POSITIVE_FIXNUM - 1, min (SIZE_MAX, PTRDIFF_MAX))
+/* Maximum gap size after compact_buffer, in bytes. Also
+ used in make_gap_larger to get some extra reserved space. */
+
+#define GAP_BYTES_DFL 2000
+
+/* Minimum gap size after compact_buffer, in bytes. Also
+ used in make_gap_smaller to avoid too small gap size. */
+
+#define GAP_BYTES_MIN 20
+
/* Return the address of byte position N in current buffer. */
#define BYTE_POS_ADDR(n) \
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) \
do { \
if (BUFFER_LIVE_P (b)) \
- { \
- if (b->base_buffer) \
- { \
- eassert (b->indirections == -1); \
- eassert (b->base_buffer->indirections > 0); \
- } \
- else \
- eassert (b->indirections >= 0); \
- } \
+ { \
+ if (b->base_buffer) \
+ { \
+ eassert (b->indirections == -1); \
+ eassert (b->base_buffer->indirections > 0); \
+ } \
+ else \
+ eassert (b->indirections >= 0); \
+ } \
} while (0)
/* Chain of all buffers, including killed ones. */
/* 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. */
extern void set_buffer_temp (struct buffer *);
extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object);
extern void record_buffer (Lisp_Object);
-extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int);
extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t);
extern void mmap_set_vars (bool);
+ 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
switch (*tem)
{
- case 'a': /* Symbol defined as a function */
+ case 'a': /* Symbol defined as a function. */
visargs[i] = Fcompleting_read (callint_message,
Vobarray, Qfboundp, Qt,
Qnil, Qnil, Qnil, Qnil);
- /* Passing args[i] directly stimulates compiler bug */
+ /* Passing args[i] directly stimulates compiler bug. */
teml = visargs[i];
args[i] = Fintern (teml, Qnil);
break;
- case 'b': /* Name of existing buffer */
+ case 'b': /* Name of existing buffer. */
args[i] = Fcurrent_buffer ();
if (EQ (selected_window, minibuf_window))
args[i] = Fother_buffer (args[i], Qnil, Qnil);
args[i] = Fread_buffer (callint_message, args[i], Qt);
break;
- case 'B': /* Name of buffer, possibly nonexistent */
+ case 'B': /* Name of buffer, possibly nonexistent. */
args[i] = Fread_buffer (callint_message,
Fother_buffer (Fcurrent_buffer (), Qnil, Qnil),
Qnil);
break;
- case 'c': /* Character */
+ case 'c': /* Character. */
/* Prompt in `minibuffer-prompt' face. */
Fput_text_property (make_number (0),
make_number (SCHARS (callint_message)),
Qface, Qminibuffer_prompt, callint_message);
args[i] = Fread_char (callint_message, Qnil, Qnil);
message1_nolog ((char *) 0);
- /* Passing args[i] directly stimulates compiler bug */
+ /* Passing args[i] directly stimulates compiler bug. */
teml = args[i];
/* See bug#8479. */
if (! CHARACTERP (teml)) error ("Non-character input-event");
visargs[i] = Fchar_to_string (teml);
break;
- case 'C': /* Command: symbol with interactive function */
+ case 'C': /* Command: symbol with interactive function. */
visargs[i] = Fcompleting_read (callint_message,
Vobarray, Qcommandp,
Qt, Qnil, Qnil, Qnil, Qnil);
- /* Passing args[i] directly stimulates compiler bug */
+ /* Passing args[i] directly stimulates compiler bug. */
teml = visargs[i];
args[i] = Fintern (teml, Qnil);
break;
varies[i] = 1;
break;
- case 'D': /* Directory name. */
+ case 'D': /* Directory name. */
args[i] = Fread_file_name (callint_message, Qnil,
BVAR (current_buffer, directory), Qlambda, Qnil,
Qfile_directory_p);
break;
- case 'f': /* Existing file name. */
+ case 'f': /* Existing file name. */
args[i] = Fread_file_name (callint_message,
Qnil, Qnil, Qlambda, Qnil, Qnil);
break;
- case 'F': /* Possibly nonexistent file name. */
+ case 'F': /* Possibly nonexistent file name. */
args[i] = Fread_file_name (callint_message,
Qnil, Qnil, Qnil, Qnil, Qnil);
break;
case 'G': /* Possibly nonexistent file name,
- default to directory alone. */
+ default to directory alone. */
args[i] = Fread_file_name (callint_message,
Qnil, Qnil, Qnil, empty_unibyte_string, Qnil);
break;
- case 'i': /* Ignore an argument -- Does not do I/O */
+ case 'i': /* Ignore an argument -- Does not do I/O. */
varies[i] = -1;
break;
- case 'k': /* Key sequence. */
+ case 'k': /* Key sequence. */
{
ptrdiff_t speccount1 = SPECPDL_INDEX ();
specbind (Qcursor_in_echo_area, Qt);
}
break;
- case 'K': /* Key sequence to be defined. */
+ case 'K': /* Key sequence to be defined. */
{
ptrdiff_t speccount1 = SPECPDL_INDEX ();
specbind (Qcursor_in_echo_area, Qt);
}
break;
- case 'U': /* Up event from last k or K */
+ case 'U': /* Up event from last k or K. */
if (!NILP (up_event))
{
args[i] = Fmake_vector (make_number (1), up_event);
Qnil, Qnil, Qnil, Qt);
break;
- case 'N': /* Prefix arg as number, else number from minibuffer */
+ case 'N': /* Prefix arg as number, else number from minibuffer. */
if (!NILP (prefix_arg))
goto have_prefix_arg;
case 'n': /* Read number from minibuffer. */
varies[i] = -1;
break;
- case 'p': /* Prefix arg converted to number. No I/O. */
+ case 'p': /* Prefix arg converted to number. No I/O. */
have_prefix_arg:
args[i] = Fprefix_numeric_value (prefix_arg);
/* visargs[i] = Qnil; */
varies[i] = -1;
break;
- case 'r': /* Region, point and mark as 2 args. */
+ case 'r': /* Region, point and mark as 2 args. */
check_mark (1);
set_marker_both (point_marker, Qnil, PT, PT_BYTE);
/* visargs[i+1] = Qnil; */
case 'S': /* Any symbol. */
visargs[i] = Fread_string (callint_message,
Qnil, Qnil, Qnil, Qnil);
- /* Passing args[i] directly stimulates compiler bug */
+ /* Passing args[i] directly stimulates compiler bug. */
teml = visargs[i];
args[i] = Fintern (teml, Qnil);
break;
case 'v': /* Variable name: symbol that is
- custom-variable-p. */
+ custom-variable-p. */
args[i] = Fread_variable (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
- case 'x': /* Lisp expression read but not evaluated */
+ case 'x': /* Lisp expression read but not evaluated. */
args[i] = Fread_minibuffer (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
- case 'X': /* Lisp expression read and evaluated */
+ case 'X': /* Lisp expression read and evaluated. */
args[i] = Feval_minibuffer (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
case 'Z': /* Coding-system symbol, or ignore the
- argument if no prefix */
+ argument if no prefix. */
if (NILP (prefix_arg))
{
args[i] = Qnil;
}
break;
- case 'z': /* Coding-system symbol or nil */
+ case 'z': /* Coding-system symbol or nil. */
args[i] = Fread_coding_system (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
/* 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. */
-/* True if this is termination due to exit. */
-static bool call_process_exited;
+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 ();
+}
+
+/* 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);
-
-#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;
- }
+ Fset_buffer (buffer);
- 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))
{
args[i] = encode_coding_string (&argument_coding, args[i], 1);
}
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;
if (STRING_MULTIBYTE (path))
path = ENCODE_FILE (path);
- new_argv[0] = SDATA (path);
+ new_argv[0] = SSDATA (path);
UNGCPRO;
}
tempfile = alloca (20);
*tempfile = '\0';
}
- dostounix_filename (tempfile);
+ dostounix_filename (tempfile, 0);
if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/')
strcat (tempfile, "/");
strcat (tempfile, "detmp.XXX");
}
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;
}
tmpdir = Vtemporary_file_directory;
else
{
+ char *outf;
#ifndef DOS_NT
- if (getenv ("TMPDIR"))
- tmpdir = build_string (getenv ("TMPDIR"));
- else
- tmpdir = build_string ("/tmp/");
+ outf = getenv ("TMPDIR");
+ tmpdir = build_string (outf ? outf : "/tmp/");
#else /* DOS_NT */
- char *outf;
if ((outf = egetenv ("TMPDIR"))
|| (outf = egetenv ("TMP"))
|| (outf = egetenv ("TEMP")))
{
USE_SAFE_ALLOCA;
Lisp_Object pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir);
- Lisp_Object encoded_tem = ENCODE_FILE (pattern);
- char *tempfile = SAFE_ALLOCA (SBYTES (encoded_tem) + 1);
+ Lisp_Object encoded_tem;
+ char *tempfile;
+
+#ifdef WINDOWSNT
+ /* Cannot use the result of Fexpand_file_name, because it
+ downcases the XXXXXX part of the pattern, and mktemp then
+ doesn't recognize it. */
+ if (!NILP (Vw32_downcase_file_names))
+ {
+ Lisp_Object dirname = Ffile_name_directory (pattern);
+
+ if (NILP (dirname))
+ pattern = Vtemp_file_name_pattern;
+ else
+ pattern = concat2 (dirname, Vtemp_file_name_pattern);
+ }
+#endif
+
+ encoded_tem = ENCODE_FILE (pattern);
+ tempfile = SAFE_ALLOCA (SBYTES (encoded_tem) + 1);
memcpy (tempfile, SDATA (encoded_tem), SBYTES (encoded_tem) + 1);
coding_systems = Qt;
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");
+ sh = getenv ("SHELL");
Vshell_file_name = build_string (sh ? sh : "/bin/sh");
#ifdef DOS_NT
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)
Vccl_program_table = larger_vector (Vccl_program_table, 1, -1);
{
- Lisp_Object elt;
+ Lisp_Object elt = make_uninit_vector (4);
- elt = Fmake_vector (make_number (4), Qnil);
ASET (elt, 0, name);
ASET (elt, 1, ccl_prog);
ASET (elt, 2, resolved);
CHECK_NATNUM (parent_max_code);
parent_code_offset = Fnth (make_number (3), val);
CHECK_NUMBER (parent_code_offset);
- val = Fmake_vector (make_number (4), Qnil);
+ val = make_uninit_vector (4);
ASET (val, 0, make_number (parent_charset->id));
ASET (val, 1, parent_min_code);
ASET (val, 2, parent_max_code);
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.
args[charset_arg_name] = name;
args[charset_arg_dimension] = make_number (dimension);
- val = Fmake_vector (make_number (8), make_number (0));
+ val = make_uninit_vector (8);
for (i = 0; i < 8; i++)
ASET (val, i, make_number (code_space[i]));
args[charset_arg_code_space] = val;
{
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
#include "termchar.h"
#include "tparam.h"
-#define BIG 9999 /* 9999 good on VAXen. For 16 bit machines
- use about 2000.... */
+#define BIG 9999 /* Good on 32-bit hosts. */
int cost; /* sums up costs */
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;
GPT -= gap_head_used, GPT_BYTE -= gap_head_used;
}
else
- {
- Lisp_Object this_buffer;
-
- this_buffer = Fcurrent_buffer ();
- set_buffer_internal (XBUFFER (coding->dst_object));
- make_gap (bytes);
- set_buffer_internal (XBUFFER (this_buffer));
- }
+ make_gap_1 (XBUFFER (coding->dst_object), bytes);
}
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
int i;
memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len);
- subsidiaries = Fmake_vector (make_number (3), Qnil);
+ subsidiaries = make_uninit_vector (3);
for (i = 0; i < 3; i++)
{
strcpy (buf + base_name_len, suffixes[i]);
CHECK_VECTOR (initial);
for (i = 0; i < 4; i++)
{
- val = Faref (initial, make_number (i));
+ val = AREF (initial, i);
if (! NILP (val))
{
struct charset *charset;
this_name = AREF (eol_type, i);
this_aliases = Fcons (this_name, Qnil);
this_eol_type = (i == 0 ? Qunix : i == 1 ? Qdos : Qmac);
- this_spec = Fmake_vector (make_number (3), attrs);
+ this_spec = make_uninit_vector (3);
+ ASET (this_spec, 0, attrs);
ASET (this_spec, 1, this_aliases);
ASET (this_spec, 2, this_eol_type);
Fputhash (this_name, this_spec, Vcoding_system_hash_table);
}
}
- spec_vec = Fmake_vector (make_number (3), attrs);
+ spec_vec = make_uninit_vector (3);
+ ASET (spec_vec, 0, attrs);
ASET (spec_vec, 1, aliases);
ASET (spec_vec, 2, eol_type);
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;
}
staticpro (&gstring_work_headers);
- gstring_work_headers = Fmake_vector (make_number (8), Qnil);
+ gstring_work_headers = make_uninit_vector (8);
for (i = 0; i < 8; i++)
ASET (gstring_work_headers, i, Fmake_vector (make_number (i + 2), Qnil));
staticpro (&gstring_work);
#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
#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;
}
case Lisp_Fwd_Buffer_Obj:
{
int offset = XBUFFER_OBJFWD (valcontents)->offset;
- Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype;
+ Lisp_Object predicate = XBUFFER_OBJFWD (valcontents)->predicate;
- if (!(NILP (type) || NILP (newval)
- || (XINT (type) == Lisp_Int0
- ? INTEGERP (newval)
- : XTYPE (newval) == XINT (type))))
- buffer_slot_type_mismatch (newval, XINT (type));
+ if (!NILP (predicate) && !NILP (newval)
+ && NILP (call1 (predicate, newval)))
+ wrong_type_argument (predicate, newval);
if (buf == NULL)
buf = current_buffer;
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 <grp.h>
#include <errno.h>
+#include <fcntl.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 Lisp_Object Qfile_attributes_lessp;
static ptrdiff_t scmp (const char *, const char *, ptrdiff_t);
+static Lisp_Object file_attributes (int, char const *, Lisp_Object);
\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
+}
+
+static DIR *
+open_directory (char const *name, int *fdp)
+{
+ DIR *d;
+ int fd, opendir_errno;
+
+ block_input ();
+
+#ifdef DOS_NT
+ /* Directories cannot be opened. The emulation assumes that any
+ file descriptor other than AT_FDCWD corresponds to the most
+ recently opened directory. This hack is good enough for Emacs. */
+ fd = 0;
+ d = opendir (name);
+ opendir_errno = errno;
+#else
+ fd = emacs_open (name, O_RDONLY | O_DIRECTORY, 0);
+ if (fd < 0)
+ {
+ opendir_errno = errno;
+ d = 0;
+ }
+ else
+ {
+ d = fdopendir (fd);
+ opendir_errno = errno;
+ if (! d)
+ close (fd);
+ }
+#endif
+
+ unblock_input ();
+
+ *fdp = fd;
+ errno = opendir_errno;
+ return d;
+}
+
#ifdef WINDOWSNT
Lisp_Object
directory_files_internal_w32_unwind (Lisp_Object arg)
static Lisp_Object
directory_files_internal_unwind (Lisp_Object dh)
{
- DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer;
+ DIR *d = XSAVE_POINTER (dh, 0);
block_input ();
closedir (d);
unblock_input ();
Lisp_Object id_format)
{
DIR *d;
+ int fd;
ptrdiff_t directory_nbytes;
Lisp_Object list, dirfilename, encoded_directory;
struct re_pattern_buffer *bufp = NULL;
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
/* Now *bufp is the compiled form of MATCH; don't call anything
which might compile a new regexp until we're done with the loop! */
- block_input ();
- d = opendir (SSDATA (dirfilename));
- unblock_input ();
+ d = open_directory (SSDATA (dirfilename), &fd);
if (d == NULL)
report_file_error ("Opening directory", Fcons (directory, Qnil));
file-attributes on filenames, both of which can throw, so we must
do a proper unwind-protect. */
record_unwind_protect (directory_files_internal_unwind,
- make_save_value (d, 0));
+ make_save_pointer (d));
#ifdef WINDOWSNT
if (attrs)
/* 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);
+
+ /* Note: DECODE_FILE can GC; it should protect its argument,
+ though. */
+ name = DECODE_FILE (name);
+ len = SBYTES (name);
- if (dp == NULL)
- break;
+ /* 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;
- if (DIRENTRY_NONEMPTY (dp))
+ 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)
+ {
+ Lisp_Object fileattrs
+ = file_attributes (fd, dp->d_name, id_format);
+ list = Fcons (Fcons (finalname, fileattrs), list);
+ }
+ 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 (int, struct dirent *, struct stat *);
static Lisp_Object Qdefault_directory;
static Lisp_Object
Lisp_Object predicate)
{
DIR *d;
+ int fd;
ptrdiff_t bestmatchsize = 0;
int matchcount = 0;
/* If ALL_FLAG is 1, BESTMATCH is the list of all matches, decoded.
on the encoded file name. */
encoded_file = STRING_MULTIBYTE (file) ? ENCODE_FILE (file) : file;
- encoded_dir = ENCODE_FILE (dirname);
+ encoded_dir = ENCODE_FILE (Fdirectory_file_name (dirname));
- block_input ();
- d = opendir (SSDATA (Fdirectory_file_name (encoded_dir)));
- unblock_input ();
+ d = open_directory (SSDATA (encoded_dir), &fd);
if (!d)
report_file_error ("Opening directory", Fcons (dirname, Qnil));
record_unwind_protect (directory_files_internal_unwind,
- make_save_value (d, 0));
+ make_save_pointer (d));
/* Loop reading blocks */
/* (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;
- if (file_name_completion_stat (encoded_dir, dp, &st) < 0)
+ if (file_name_completion_stat (fd, dp, &st) < 0)
continue;
directoryp = S_ISDIR (st.st_mode) != 0;
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 (int fd, struct dirent *dp, struct stat *st_addr)
{
- ptrdiff_t len = NAMLEN (dp);
- ptrdiff_t pos = SCHARS (dirname);
int value;
- USE_SAFE_ALLOCA;
- char *fullname = SAFE_ALLOCA (len + pos + 2);
#ifdef MSDOS
/* Some fields of struct stat are *very* expensive to compute on MS-DOS,
_djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
#endif /* MSDOS */
- memcpy (fullname, SDATA (dirname), pos);
- if (!IS_DIRECTORY_SEP (fullname[pos - 1]))
- fullname[pos++] = DIRECTORY_SEP;
-
- memcpy (fullname + pos, dp->d_name, len);
- fullname[pos + len] = 0;
-
/* We want to return success if a link points to a nonexistent file,
but we want to return the status for what the link points to,
in case it is a directory. */
- value = lstat (fullname, st_addr);
+ value = fstatat (fd, dp->d_name, st_addr, AT_SYMLINK_NOFOLLOW);
if (value == 0 && S_ISLNK (st_addr->st_mode))
- stat (fullname, st_addr);
+ fstatat (fd, dp->d_name, st_addr, 0);
#ifdef MSDOS
_djstat_flags = save_djstat_flags;
#endif /* MSDOS */
- SAFE_FREE ();
return value;
}
\f
#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
so last access time will always be midnight of that day. */)
(Lisp_Object filename, Lisp_Object id_format)
{
- Lisp_Object values[12];
Lisp_Object encoded;
- struct stat s;
-#ifdef BSD4_2
- Lisp_Object dirname;
- struct stat sdir;
-#endif /* BSD4_2 */
-
- /* An array to hold the mode string generated by filemodestring,
- including its terminating space and null byte. */
- char modes[sizeof "-rwxr-xr-x "];
-
Lisp_Object handler;
- struct gcpro gcpro1;
- char *uname = NULL, *gname = NULL;
filename = Fexpand_file_name (filename, Qnil);
return call3 (handler, Qfile_attributes, filename, id_format);
}
- GCPRO1 (filename);
encoded = ENCODE_FILE (filename);
- UNGCPRO;
+ return file_attributes (AT_FDCWD, SSDATA (encoded), id_format);
+}
+
+static Lisp_Object
+file_attributes (int fd, char const *name, Lisp_Object id_format)
+{
+ Lisp_Object values[12];
+ struct stat s;
+ int lstat_result;
+
+ /* An array to hold the mode string generated by filemodestring,
+ including its terminating space and null byte. */
+ char modes[sizeof "-rwxr-xr-x "];
+
+ char *uname = NULL, *gname = NULL;
+
+#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 = fstatat (fd, name, &s, AT_SYMLINK_NOFOLLOW);
+
+#ifdef WINDOWSNT
+ w32_stat_get_owner_group = 0;
+#endif
- if (lstat (SSDATA (encoded), &s) < 0)
+ if (lstat_result < 0)
return Qnil;
- values[0] = (S_ISLNK (s.st_mode) ? Ffile_symlink_p (filename)
+ values[0] = (S_ISLNK (s.st_mode) ? emacs_readlinkat (fd, name)
: S_ISDIR (s.st_mode) ? Qt : Qnil);
values[1] = make_number (s.st_nlink);
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 */
struct window *);
static void build_frame_matrix_from_leaf_window (struct glyph_matrix *,
struct window *);
-static void adjust_frame_message_buffer (struct frame *);
static void adjust_decode_mode_spec_buffer (struct frame *);
static void fill_up_glyph_row_with_spaces (struct glyph_row *);
static void clear_window_matrices (struct window *, bool);
static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
-\f
-/* Redisplay preemption timers. */
-
-static EMACS_TIME preemption_period;
-static EMACS_TIME preemption_next_check;
-
/* True upon entry to redisplay means do not assume anything about
current contents of actual terminal frame; clear and redraw it. */
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;
are invalidated below. */
if (INTEGERP (w->window_end_vpos)
&& XFASTINT (w->window_end_vpos) >= i)
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
while (i < matrix->nrows)
matrix->rows[i++].enabled_p = 0;
else
{
clear_glyph_matrix (w->current_matrix);
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
}
}
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
else
adjust_frame_glyphs_for_frame_redisplay (f);
- /* Don't forget the message buffer and the buffer for
- decode_mode_spec. */
- adjust_frame_message_buffer (f);
+ /* Don't forget the buffer for decode_mode_spec. */
adjust_decode_mode_spec_buffer (f);
f->glyphs_initialized_p = 1;
}
-/* Adjust/ allocate message buffer of frame F.
-
- Note that the message buffer is never freed. Since I could not
- find a free in 19.34, I assume that freeing it would be
- problematic in some way and don't do it either.
-
- (Implementation note: It should be checked if we can free it
- eventually without causing trouble). */
-
-static void
-adjust_frame_message_buffer (struct frame *f)
-{
- FRAME_MESSAGE_BUF (f) = xrealloc (FRAME_MESSAGE_BUF (f),
- FRAME_MESSAGE_BUF_SIZE (f) + 1);
-}
-
-
/* Re-allocate buffer for decode_mode_spec on 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;
}
if (redisplay_dont_pause)
force_p = 1;
- else if (NILP (Vredisplay_preemption_period))
- force_p = 1;
- else if (!force_p && NUMBERP (Vredisplay_preemption_period))
+ else if (!force_p && detect_input_pending_ignore_squeezables ())
{
- double p = XFLOATINT (Vredisplay_preemption_period);
-
- if (detect_input_pending_ignore_squeezables ())
- {
- paused_p = 1;
- goto do_pause;
- }
-
- preemption_period = EMACS_TIME_FROM_DOUBLE (p);
- preemption_next_check = add_emacs_time (current_emacs_time (),
- preemption_period);
+ paused_p = 1;
+ goto do_pause;
}
if (FRAME_WINDOW_P (f))
if (redisplay_dont_pause)
force_p = 1;
- else if (NILP (Vredisplay_preemption_period))
- force_p = 1;
- else if (!force_p && NUMBERP (Vredisplay_preemption_period))
- {
- double p = XFLOATINT (Vredisplay_preemption_period);
- preemption_period = EMACS_TIME_FROM_DOUBLE (p);
- preemption_next_check = add_emacs_time (current_emacs_time (),
- preemption_period);
- }
/* Update W. */
update_begin (f);
{
struct glyph_matrix *desired_matrix = w->desired_matrix;
bool paused_p;
-#if !PERIODIC_PREEMPTION_CHECKING
int preempt_count = baud_rate / 2400 + 1;
-#endif
struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
#ifdef GLYPH_DEBUG
/* Check that W's frame doesn't have glyph matrices. */
#endif
/* Check pending input the first time so that we can quickly return. */
-#if !PERIODIC_PREEMPTION_CHECKING
if (!force_p)
detect_input_pending_ignore_squeezables ();
-#endif
/* If forced to complete the update, or if no input is pending, do
the update. */
struct glyph_row *header_line_row;
int yb;
bool changed_p = 0, mouse_face_overwritten_p = 0;
-#if ! PERIODIC_PREEMPTION_CHECKING
int n_updated = 0;
-#endif
rif->update_window_begin_hook (w);
yb = window_text_bottom_y (w);
detect_input_pending. If it's done too often,
scrolling large windows with repeated scroll-up
commands will too quickly pause redisplay. */
-#if PERIODIC_PREEMPTION_CHECKING
- if (!force_p)
- {
- EMACS_TIME tm = current_emacs_time ();
- if (EMACS_TIME_LT (preemption_next_check, tm))
- {
- preemption_next_check = add_emacs_time (tm,
- preemption_period);
- if (detect_input_pending_ignore_squeezables ())
- break;
- }
- }
-#else
if (!force_p && ++n_updated % preempt_count == 0)
detect_input_pending_ignore_squeezables ();
-#endif
changed_p |= update_window_line (w, vpos,
&mouse_face_overwritten_p);
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);
}
if (preempt_count <= 0)
preempt_count = 1;
-#if !PERIODIC_PREEMPTION_CHECKING
if (!force_p && detect_input_pending_ignore_squeezables ())
{
pause_p = 1;
goto do_pause;
}
-#endif
/* If we cannot insert/delete lines, it's no use trying it. */
if (!FRAME_LINE_INS_DEL_OK (f))
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);
}
}
-#if PERIODIC_PREEMPTION_CHECKING
- if (!force_p)
- {
- EMACS_TIME tm = current_emacs_time ();
- if (EMACS_TIME_LT (preemption_next_check, tm))
- {
- preemption_next_check = add_emacs_time (tm, preemption_period);
- if (detect_input_pending_ignore_squeezables ())
- break;
- }
- }
-#else
if (!force_p && (i - 1) % preempt_count == 0)
detect_input_pending_ignore_squeezables ();
-#endif
update_frame_line (f, i);
}
}
}
-#if !PERIODIC_PREEMPTION_CHECKING
do_pause:
-#endif
clear_desired_matrices (f);
return pause_p;
inverse_video = 0;
cursor_in_echo_area = 0;
- terminal_type = (char *) 0;
/* Now is the time to initialize this; it's used by init_sys_modes
during startup. */
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
#ifdef WINDOWSNT
terminal_type = "w32console";
#else
- /* Look at the TERM variable. */
- terminal_type = (char *) getenv ("TERM");
+ terminal_type = getenv ("TERM");
#endif
if (!terminal_type)
{
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,
doc: /* Non-nil means display update isn't paused when input is detected. */);
redisplay_dont_pause = 1;
-#if PERIODIC_PREEMPTION_CHECKING
- DEFVAR_LISP ("redisplay-preemption-period", Vredisplay_preemption_period,
- doc: /* Period in seconds between checking for input during redisplay.
-This has an effect only if `redisplay-dont-pause' is nil; in that
-case, arriving input preempts redisplay until the input is processed.
-If the value is nil, redisplay is never preempted. */);
- Vredisplay_preemption_period = make_float (0.10);
-#endif
-
#ifdef CANNOT_DUMP
if (noninteractive)
#endif
#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;
if (space_left <= 0)
{
ptrdiff_t in_buffer = p - get_doc_string_buffer;
- get_doc_string_buffer =
- xpalloc (get_doc_string_buffer, &get_doc_string_buffer_size,
- 16 * 1024, -1, 1);
+ get_doc_string_buffer
+ = xpalloc (get_doc_string_buffer, &get_doc_string_buffer_size,
+ 16 * 1024, -1, 1);
p = get_doc_string_buffer + in_buffer;
space_left = (get_doc_string_buffer_size - 1
- (p - get_doc_string_buffer));
else
{
/* The data determines whether the string is multibyte. */
- ptrdiff_t nchars =
- multibyte_chars_in_text (((unsigned char *) get_doc_string_buffer
- + offset),
- to - (get_doc_string_buffer + offset));
+ ptrdiff_t nchars
+ = multibyte_chars_in_text (((unsigned char *) get_doc_string_buffer
+ + offset),
+ to - (get_doc_string_buffer + offset));
return make_string_from_bytes (get_doc_string_buffer + offset,
nchars,
to - (get_doc_string_buffer + offset));
}
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))
break;
buf[filled] = 0;
- p = buf;
end = buf + (filled < 512 ? filled : filled - 128);
- while (p != end && *p != '\037') p++;
+ p = memchr (buf, '\037', end - buf);
/* p points to ^_Ffunctionname\n or ^_Vvarname\n or ^_Sfilename\n. */
- if (p != end)
+ if (p)
{
end = strchr (p, '\n');
could include embedded null characters.
. It signals an error if the length of the formatted string is about to
- overflow MOST_POSITIVE_FIXNUM, to avoid producing strings longer than what
+ overflow ptrdiff_t or size_t, to avoid producing strings longer than what
Emacs can handle.
OTOH, this function supports only a small subset of the standard C formatted
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
ptrdiff_t noverlays;
Lisp_Object *overlay_vec, tem;
struct buffer *obuf = current_buffer;
+ USE_SAFE_ALLOCA;
set_buffer_temp (XBUFFER (object));
make enough space for all, and try again. */
if (noverlays > 40)
{
- overlay_vec = alloca (noverlays * sizeof *overlay_vec);
+ SAFE_ALLOCA_LISP (overlay_vec, noverlays);
noverlays = overlays_around (posn, overlay_vec, noverlays);
}
noverlays = sort_overlays (overlay_vec, noverlays, NULL);
; /* The overlay will not cover a char inserted at point. */
else
{
+ SAFE_FREE ();
return tem;
}
}
}
+ SAFE_FREE ();
{ /* Now check the text properties. */
int stickiness = text_property_stickiness (prop, position, object);
/* This is the ONLY_IN_LINE case, check that NEW_POS and
FIELD_BOUND are on the same line by seeing whether
there's an intervening newline or not. */
- || (scan_buffer ('\n',
- XFASTINT (new_pos), XFASTINT (field_bound),
- fwd ? -1 : 1, &shortage, 1),
+ || (find_newline (XFASTINT (new_pos), XFASTINT (field_bound),
+ fwd ? -1 : 1, &shortage, 1),
shortage != 0)))
/* Constrain NEW_POS to FIELD_BOUND. */
new_pos = field_bound;
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);
- /* 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))));
+ return make_save_value
+ ("oooo",
+ Fpoint_marker (),
+ /* Do not copy the mark if it points to nowhere. */
+ (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. */
+ ((XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
+ ? selected_window : Qnil),
+ BVAR (current_buffer, mark_active));
}
+/* Restore saved buffer before leaving `save-excursion' special form. */
+
Lisp_Object
save_excursion_restore (Lisp_Object info)
{
Lisp_Object tem, tem1, omark, nmark;
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 (XSAVE_OBJECT (info, 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 = XSAVE_OBJECT (info, 0);
Fgoto_char (tem);
unchain_marker (XMARKER (tem));
/* Mark marker. */
- info = XCDR (info);
- tem = XCAR (info);
+ tem = XSAVE_OBJECT (info, 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 = XSAVE_OBJECT (info, 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 = XSAVE_OBJECT (info, 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_misc (info);
return Qnil;
}
return unbind_to (count, Fprogn (args));
}
\f
-DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0,
+DEFUN ("buffer-size", Fbuffer_size, Sbuffer_size, 0, 1, 0,
doc: /* Return the number of characters in the current buffer.
If BUFFER, return the number of characters in that buffer instead. */)
(Lisp_Object buffer)
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;
- /* 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));
+ int tzeqlen = sizeof "TZ=" - 1;
+
+#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 ();
+ tzvalbuf_in_environ = 0;
+#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; )
return unbind_to (count, val);
}
\f
-/* Buffer for the most recent text displayed by Fmessage_box. */
-static char *message_text;
-
-/* Allocated length of that buffer. */
-static ptrdiff_t message_length;
-
DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
doc: /* Display a message at the bottom of the screen.
The message also goes into the `*Messages*' buffer, if `message-log-max'
{
register Lisp_Object val;
val = Fformat (nargs, args);
- message3 (val, SBYTES (val), STRING_MULTIBYTE (val));
+ message3 (val);
return val;
}
}
}
else
{
- register Lisp_Object val;
- val = Fformat (nargs, args);
+ Lisp_Object val = Fformat (nargs, args);
#ifdef HAVE_MENUS
/* The MS-DOS frames support popup menus even though they are
not FRAME_WINDOW_P. */
return val;
}
#endif /* HAVE_MENUS */
- /* Copy the data so that it won't move when we GC. */
- if (SBYTES (val) > message_length)
- {
- ptrdiff_t new_length = SBYTES (val) + 80;
- message_text = xrealloc (message_text, new_length);
- message_length = new_length;
- }
- memcpy (message_text, SDATA (val), SBYTES (val));
- message2 (message_text, SBYTES (val),
- STRING_MULTIBYTE (val));
+ message3 (val);
return val;
}
}
{
buf = xmalloc (bufsize);
sa_must_free = 1;
- buf_save_value = make_save_value (buf, 0);
+ buf_save_value = make_save_pointer (buf);
record_unwind_protect (safe_alloca_unwind, buf_save_value);
memcpy (buf, initial_buffer, used);
}
else
- XSAVE_VALUE (buf_save_value)->pointer = buf = xrealloc (buf, bufsize);
+ XSAVE_POINTER (buf_save_value, 0) = buf = xrealloc (buf, bufsize);
p = buf + used;
}
(Lisp_Object startr1, Lisp_Object endr1, Lisp_Object startr2, Lisp_Object endr2, Lisp_Object leave_markers)
{
register ptrdiff_t start1, end1, start2, end2;
- ptrdiff_t start1_byte, start2_byte, len1_byte, len2_byte;
+ ptrdiff_t start1_byte, start2_byte, len1_byte, len2_byte, end2_byte;
ptrdiff_t gap, len1, len_mid, len2;
unsigned char *start1_addr, *start2_addr, *temp;
the gap the minimum distance to get it out of the way, and then
deal with an unbroken array. */
+ start1_byte = CHAR_TO_BYTE (start1);
+ end2_byte = CHAR_TO_BYTE (end2);
+
/* Make sure the gap won't interfere, by moving it out of the text
we will operate on. */
if (start1 < gap && gap < end2)
{
if (gap - start1 < end2 - gap)
- move_gap (start1);
+ move_gap_both (start1, start1_byte);
else
- move_gap (end2);
+ move_gap_both (end2, end2_byte);
}
- start1_byte = CHAR_TO_BYTE (start1);
start2_byte = CHAR_TO_BYTE (start2);
len1_byte = CHAR_TO_BYTE (end1) - start1_byte;
- len2_byte = CHAR_TO_BYTE (end2) - start2_byte;
+ len2_byte = end2_byte - start2_byte;
#ifdef BYTE_COMBINING_DEBUG
if (end1 == start2)
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 (&Sline_beginning_position);
defsubr (&Sline_end_position);
-/* defsubr (&Smark); */
-/* defsubr (&Sset_mark); */
defsubr (&Ssave_excursion);
defsubr (&Ssave_current_buffer);
- defsubr (&Sbufsize);
+ defsubr (&Sbuffer_size);
defsubr (&Spoint_max);
defsubr (&Spoint_min);
defsubr (&Spoint_min_marker);
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;
Lisp_Object Qrisky_local_variable;
Lisp_Object Qkill_emacs;
+static Lisp_Object Qkill_emacs_hook;
/* If true, Emacs should not attempt to use a window-specific code,
but instead should use the virtual terminal under which it was started. */
#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. */
}
init_callproc (); /* Must follow init_cmdargs but not init_sys_modes. */
+ init_fileio ();
init_lread ();
#ifdef WINDOWSNT
/* Check to see if Emacs has been installed correctly. */
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 ();
(Lisp_Object arg)
{
struct gcpro gcpro1;
- Lisp_Object hook;
int exit_code;
GCPRO1 (arg);
if (feof (stdin))
arg = Qt;
- hook = intern ("kill-emacs-hook");
- Frun_hooks (1, &hook);
-
+ /* Fsignal calls emacs_abort () if it sees that waiting_for_input is
+ set. */
+ waiting_for_input = 0;
+ Frun_hooks (1, &Qkill_emacs_hook);
UNGCPRO;
#ifdef HAVE_X_WINDOWS
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)
{
{
char *path_copy = alloca (strlen (path) + 1);
strcpy (path_copy, path);
- dostounix_filename (path_copy);
+ dostounix_filename (path_copy, 0);
path = path_copy;
}
#endif
DEFSYM (Qfile_name_handler_alist, "file-name-handler-alist");
DEFSYM (Qrisky_local_variable, "risky-local-variable");
DEFSYM (Qkill_emacs, "kill-emacs");
+ DEFSYM (Qkill_emacs_hook, "kill-emacs-hook");
#ifndef CANNOT_DUMP
defsubr (&Sdump_emacs);
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
return form;
QUIT;
+
+ GCPRO1 (form);
maybe_gc ();
+ UNGCPRO;
if (++lisp_eval_depth > max_lisp_eval_depth)
{
/* 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);
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"
#endif
#include "systime.h"
+#include <allocator.h>
+#include <careadlinkat.h>
#include <stat-time.h>
#ifdef HPUX
/* Set by auto_save_1 if an error occurred during the last auto-save. */
static bool auto_save_error_occurred;
+/* If VALID_TIMESTAMP_FILE_SYSTEM, then TIMESTAMP_FILE_SYSTEM is the device
+ number of a file system where time stamps were observed to to work. */
+static bool valid_timestamp_file_system;
+static dev_t timestamp_file_system;
+
/* The symbol bound to coding-system-for-read when
insert-file-contents is called for recovering a file. This is not
an actual coding system name, but just an indicator to tell
is added here. */
static Lisp_Object Vwrite_region_annotation_buffers;
-#ifdef HAVE_FSYNC
-#endif
-
static Lisp_Object Qdelete_by_moving_to_trash;
/* Lisp function for moving files to trash. */
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;
+static Lisp_Object Qchoose_write_coding_system;
Lisp_Object Qwrite_region;
static Lisp_Object Qverify_visited_file_modtime;
static Lisp_Object Qset_visited_file_modtime;
if (getdefdir (c_toupper (*beg) - 'A' + 1, r))
{
- if (!IS_DIRECTORY_SEP (res[strlen (res) - 1]))
+ size_t l = strlen (res);
+
+ if (l > 3 || !IS_DIRECTORY_SEP (res[l - 1]))
strcat (res, "/");
beg = res;
p = beg + strlen (beg);
- dostounix_filename (beg);
+ dostounix_filename (beg, 0);
tem_fn = make_specified_string (beg, -1, p - beg,
STRING_MULTIBYTE (filename));
}
}
else if (STRING_MULTIBYTE (filename))
{
- tem_fn = ENCODE_FILE (make_specified_string (beg, -1, p - beg, 1));
- dostounix_filename (SSDATA (tem_fn));
- tem_fn = DECODE_FILE (tem_fn);
+ tem_fn = make_specified_string (beg, -1, p - beg, 1);
+ dostounix_filename (SSDATA (tem_fn), 1);
+#ifdef WINDOWSNT
+ if (!NILP (Vw32_downcase_file_names))
+ tem_fn = Fdowncase (tem_fn);
+#endif
}
else
{
- dostounix_filename (beg);
+ dostounix_filename (beg, 0);
tem_fn = make_specified_string (beg, -1, p - beg, 0);
}
return tem_fn;
srclen++;
}
#ifdef DOS_NT
- if (multibyte)
- {
- Lisp_Object tem_fn = make_specified_string (dst, -1, srclen, 1);
-
- tem_fn = ENCODE_FILE (tem_fn);
- dostounix_filename (SSDATA (tem_fn));
- tem_fn = DECODE_FILE (tem_fn);
- memcpy (dst, SSDATA (tem_fn), (srclen = SBYTES (tem_fn)) + 1);
- }
- else
- dostounix_filename (dst);
+ dostounix_filename (dst, multibyte);
#endif
return srclen;
}
error ("Invalid handler in `file-name-handler-alist'");
}
+#ifdef WINDOWSNT
+ if (!NILP (Vw32_downcase_file_names))
+ file = Fdowncase (file);
+#endif
buf = alloca (SBYTES (file) + 10);
length = file_name_as_directory (buf, SSDATA (file), SBYTES (file),
STRING_MULTIBYTE (file));
srclen--;
}
#ifdef DOS_NT
- if (multibyte)
- {
- Lisp_Object tem_fn = make_specified_string (dst, -1, srclen, 1);
-
- tem_fn = ENCODE_FILE (tem_fn);
- dostounix_filename (SSDATA (tem_fn));
- tem_fn = DECODE_FILE (tem_fn);
- memcpy (dst, SSDATA (tem_fn), (srclen = SBYTES (tem_fn)) + 1);
- }
- else
- dostounix_filename (dst);
+ dostounix_filename (dst, multibyte);
#endif
return srclen;
}
error ("Invalid handler in `file-name-handler-alist'");
}
+#ifdef WINDOWSNT
+ if (!NILP (Vw32_downcase_file_names))
+ directory = Fdowncase (directory);
+#endif
buf = alloca (SBYTES (directory) + 20);
length = directory_file_name (buf, SSDATA (directory), SBYTES (directory),
STRING_MULTIBYTE (directory));
}
}
+#ifdef WINDOWSNT
+ if (!NILP (Vw32_downcase_file_names))
+ default_directory = Fdowncase (default_directory);
+#endif
+
/* Make a local copy of nm[] to protect it from GC in DECODE_FILE below. */
nm = alloca (SBYTES (name) + 1);
memcpy (nm, SSDATA (name), SBYTES (name) + 1);
#ifdef DOS_NT
/* Make sure directories are all separated with /, but
avoid allocation of a new string when not required. */
- if (multibyte)
- {
- Lisp_Object tem_name = make_specified_string (nm, -1, strlen (nm),
- multibyte);
-
- tem_name = ENCODE_FILE (tem_name);
- dostounix_filename (SSDATA (tem_name));
- tem_name = DECODE_FILE (tem_name);
- memcpy (nm, SSDATA (tem_name), SBYTES (tem_name) + 1);
- }
- else
- dostounix_filename (nm);
+ dostounix_filename (nm, multibyte);
#ifdef WINDOWSNT
if (IS_DIRECTORY_SEP (nm[1]))
{
temp[0] = DRIVE_LETTER (drive);
name = concat2 (build_string (temp), name);
}
+#ifdef WINDOWSNT
+ if (!NILP (Vw32_downcase_file_names))
+ name = Fdowncase (name);
+#endif
return name;
#else /* not DOS_NT */
if (strcmp (nm, SSDATA (name)) == 0)
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);
#ifdef WINDOWSNT
char *prev_o = o;
#endif
- while (o != target && (--o) && !IS_DIRECTORY_SEP (*o))
- ;
+ while (o != target && (--o, !IS_DIRECTORY_SEP (*o)))
+ continue;
#ifdef WINDOWSNT
/* Don't go below server level in UNC filenames. */
if (o == target + 1 && IS_DIRECTORY_SEP (*o)
target[1] = ':';
}
result = make_specified_string (target, -1, o - target, multibyte);
- if (multibyte)
- {
- result = ENCODE_FILE (result);
- dostounix_filename (SSDATA (result));
- result = DECODE_FILE (result);
- }
- else
- dostounix_filename (SSDATA (result));
+ dostounix_filename (SSDATA (result), multibyte);
+#ifdef WINDOWSNT
+ if (!NILP (Vw32_downcase_file_names))
+ result = Fdowncase (result);
+#endif
#else /* !DOS_NT */
result = make_specified_string (target, -1, o - target, multibyte);
#endif /* !DOS_NT */
{
char *nm, *s, *p, *o, *x, *endp;
char *target = NULL;
- int total = 0;
+ ptrdiff_t total = 0;
bool substituted = 0;
bool multibyte;
char *xnm;
memcpy (nm, SDATA (filename), SBYTES (filename) + 1);
#ifdef DOS_NT
- if (multibyte)
- {
- Lisp_Object encoded_filename = ENCODE_FILE (filename);
- Lisp_Object tem_fn;
-
- dostounix_filename (SDATA (encoded_filename));
- tem_fn = DECODE_FILE (encoded_filename);
- nm = alloca (SBYTES (tem_fn) + 1);
- memcpy (nm, SDATA (tem_fn), SBYTES (tem_fn) + 1);
- substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0);
- if (substituted)
- filename = tem_fn;
- }
- else
- {
- dostounix_filename (nm);
- substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0);
- }
+ dostounix_filename (nm, multibyte);
+ substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0);
#endif
endp = nm + SBYTES (filename);
else if (*p == '{')
{
o = ++p;
- while (p != endp && *p != '}') p++;
- if (*p != '}') goto missingclose;
+ p = memchr (p, '}', endp - p);
+ if (! p)
+ goto missingclose;
s = p;
}
else
}
if (!substituted)
- return filename;
+ {
+#ifdef WINDOWSNT
+ if (!NILP (Vw32_downcase_file_names))
+ filename = Fdowncase (filename);
+#endif
+ return filename;
+ }
/* If substitution required, recopy the string and do it. */
/* Make space in stack frame for the new copy. */
else if (*p == '{')
{
o = ++p;
- while (p != endp && *p != '}') p++;
- if (*p != '}') goto missingclose;
+ p = memchr (p, '}', endp - p);
+ if (! p)
+ goto missingclose;
s = p++;
}
else
target = alloca (s - o + 1);
memcpy (target, o, s - o);
target[s - o] = 0;
-#ifdef DOS_NT
- strupr (target); /* $home == $HOME etc. */
-#endif /* DOS_NT */
/* Get variable value. */
o = egetenv (target);
need to quote some $ to $$ first. */
xnm = p;
+#ifdef WINDOWSNT
+ if (!NILP (Vw32_downcase_file_names))
+ {
+ Lisp_Object xname = make_specified_string (xnm, -1, x - xnm, multibyte);
+
+ xname = Fdowncase (xname);
+ return xname;
+ }
+ else
+#endif
return make_specified_string (xnm, -1, x - xnm, multibyte);
badsubst:
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
return Qnil;
}
\f
+/* Relative to directory FD, return the symbolic link value of FILENAME.
+ On failure, return nil. */
+Lisp_Object
+emacs_readlinkat (int fd, char const *filename)
+{
+ static struct allocator const emacs_norealloc_allocator =
+ { xmalloc, NULL, xfree, memory_full };
+ Lisp_Object val;
+ char readlink_buf[1024];
+ char *buf = careadlinkat (fd, filename, readlink_buf, sizeof readlink_buf,
+ &emacs_norealloc_allocator, readlinkat);
+ if (!buf)
+ return Qnil;
+
+ val = build_string (buf);
+ if (buf[0] == '/' && strchr (buf, ':'))
+ val = concat2 (build_string ("/:"), val);
+ if (buf != readlink_buf)
+ xfree (buf);
+ val = DECODE_FILE (val);
+ return val;
+}
+
DEFUN ("file-symlink-p", Ffile_symlink_p, Sfile_symlink_p, 1, 1, 0,
doc: /* Return non-nil if file FILENAME is the name of a symbolic link.
The value is the link target, as a string.
(Lisp_Object filename)
{
Lisp_Object handler;
- char *buf;
- Lisp_Object val;
- char readlink_buf[READLINK_BUFSIZE];
CHECK_STRING (filename);
filename = Fexpand_file_name (filename, Qnil);
filename = ENCODE_FILE (filename);
- buf = emacs_readlink (SSDATA (filename), readlink_buf);
- if (! buf)
- return Qnil;
-
- val = build_string (buf);
- if (buf[0] == '/' && strchr (buf, ':'))
- val = concat2 (build_string ("/:"), val);
- if (buf != readlink_buf)
- xfree (buf);
- val = DECODE_FILE (val);
- return val;
+ return emacs_readlinkat (AT_FDCWD, SSDATA (filename));
}
DEFUN ("file-directory-p", Ffile_directory_p, Sfile_directory_p, 1, 1, 0,
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));
return Qnil;
}
-
-/* Used to pass values from insert-file-contents to read_non_regular. */
-
-static int non_regular_fd;
-static ptrdiff_t non_regular_inserted;
-static int non_regular_nbytes;
-
-
-/* Read from a non-regular file.
- Read non_regular_nbytes bytes max from non_regular_fd.
- Non_regular_inserted specifies where to put the read bytes.
- Value is the number of bytes read. */
+/* Read from a non-regular file. STATE is a Lisp_Save_Value
+ object where slot 0 is the file descriptor, slot 1 specifies
+ an offset to put the read bytes, and slot 2 is the maximum
+ amount of bytes to read. Value is the number of bytes read. */
static Lisp_Object
-read_non_regular (Lisp_Object ignore)
+read_non_regular (Lisp_Object state)
{
int nbytes;
immediate_quit = 1;
QUIT;
- nbytes = emacs_read (non_regular_fd,
+ nbytes = emacs_read (XSAVE_INTEGER (state, 0),
((char *) BEG_ADDR + PT_BYTE - BEG_BYTE
- + non_regular_inserted),
- non_regular_nbytes);
+ + XSAVE_INTEGER (state, 1)),
+ XSAVE_INTEGER (state, 2));
immediate_quit = 0;
+ /* Fast recycle this object for the likely next call. */
+ free_misc (state);
return make_number (nbytes);
}
return Qnil;
}
-/* Reposition FD to OFFSET, based on WHENCE. This acts like lseek
- except that it also tests for OFFSET being out of lseek's range. */
+/* Return the file offset that VAL represents, checking for type
+ errors and overflow. */
static off_t
-emacs_lseek (int fd, EMACS_INT offset, int whence)
+file_offset (Lisp_Object val)
{
- /* Use "&" rather than "&&" to suppress a bogus GCC warning; see
- <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43772>. */
- if (! ((offset >= TYPE_MINIMUM (off_t)) & (offset <= TYPE_MAXIMUM (off_t))))
+ if (RANGED_INTEGERP (0, val, TYPE_MAXIMUM (off_t)))
+ return XINT (val);
+
+ if (FLOATP (val))
{
- errno = EINVAL;
- return -1;
+ double v = XFLOAT_DATA (val);
+ if (0 <= v
+ && (sizeof (off_t) < sizeof v
+ ? v <= TYPE_MAXIMUM (off_t)
+ : v < TYPE_MAXIMUM (off_t)))
+ return v;
}
- return lseek (fd, offset, whence);
+
+ wrong_type_argument (intern ("file-offset"), val);
}
/* Return a special time value indicating the error number ERRNUM. */
(Lisp_Object filename, Lisp_Object visit, Lisp_Object beg, Lisp_Object end, Lisp_Object replace)
{
struct stat st;
- int file_status;
EMACS_TIME mtime;
int fd;
ptrdiff_t inserted = 0;
int save_errno = 0;
char read_buf[READ_BUF_SIZE];
struct coding_system coding;
- char buffer[1 << 14];
bool replace_handled = 0;
bool set_coding_system = 0;
Lisp_Object coding_system;
orig_filename = filename;
filename = ENCODE_FILE (filename);
- fd = -1;
-
-#ifdef WINDOWSNT
- {
- Lisp_Object tem = Vw32_get_true_file_attributes;
-
- /* Tell stat to use expensive method to get accurate info. */
- Vw32_get_true_file_attributes = Qt;
- file_status = stat (SSDATA (filename), &st);
- Vw32_get_true_file_attributes = tem;
- }
-#else
- file_status = stat (SSDATA (filename), &st);
-#endif /* WINDOWSNT */
-
- if (file_status == 0)
- mtime = get_stat_mtime (&st);
- else
+ fd = emacs_open (SSDATA (filename), O_RDONLY, 0);
+ if (fd < 0)
{
- badopen:
save_errno = errno;
if (NILP (visit))
report_file_error ("Opening input file", Fcons (orig_filename, Qnil));
mtime = time_error_value (save_errno);
st.st_size = -1;
- how_much = 0;
if (!NILP (Vcoding_system_for_read))
Fset (Qbuffer_file_coding_system, Vcoding_system_for_read);
goto notfound;
}
+ /* Replacement should preserve point as it preserves markers. */
+ if (!NILP (replace))
+ record_unwind_protect (restore_point_unwind, Fpoint_marker ());
+
+ record_unwind_protect (close_file_unwind, make_number (fd));
+
+ if (fstat (fd, &st) != 0)
+ report_file_error ("Input file status", Fcons (orig_filename, Qnil));
+ mtime = get_stat_mtime (&st);
+
/* This code will need to be changed in order to work on named
pipes, and it's probably just not worth it. So we should at
least signal an error. */
build_string ("not a regular file"), orig_filename);
}
- if (fd < 0)
- if ((fd = emacs_open (SSDATA (filename), O_RDONLY, 0)) < 0)
- goto badopen;
-
- /* Replacement should preserve point as it preserves markers. */
- if (!NILP (replace))
- record_unwind_protect (restore_point_unwind, Fpoint_marker ());
-
- record_unwind_protect (close_file_unwind, make_number (fd));
-
-
if (!NILP (visit))
{
if (!NILP (beg) || !NILP (end))
}
if (!NILP (beg))
- {
- if (! RANGED_INTEGERP (0, beg, TYPE_MAXIMUM (off_t)))
- wrong_type_argument (intern ("file-offset"), beg);
- beg_offset = XFASTINT (beg);
- }
+ beg_offset = file_offset (beg);
else
beg_offset = 0;
if (!NILP (end))
- {
- if (! RANGED_INTEGERP (0, end, TYPE_MAXIMUM (off_t)))
- wrong_type_argument (intern ("file-offset"), end);
- end_offset = XFASTINT (end);
- }
+ end_offset = file_offset (end);
else
{
if (not_regular)
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;
}
}
{
int nread, bufpos;
- nread = emacs_read (fd, buffer, sizeof buffer);
+ nread = emacs_read (fd, read_buf, sizeof read_buf);
if (nread < 0)
error ("IO error reading %s: %s",
SSDATA (orig_filename), emacs_strerror (errno));
if (CODING_REQUIRE_DETECTION (&coding))
{
- coding_system = detect_coding_system ((unsigned char *) buffer,
+ coding_system = detect_coding_system ((unsigned char *) read_buf,
nread, nread, 1, 0,
coding_system);
setup_coding_system (coding_system, &coding);
bufpos = 0;
while (bufpos < nread && same_at_start < ZV_BYTE
- && FETCH_BYTE (same_at_start) == buffer[bufpos])
+ && FETCH_BYTE (same_at_start) == read_buf[bufpos])
same_at_start++, bufpos++;
/* If we found a discrepancy, stop the scan.
Otherwise loop around and scan the next bufferful. */
if (curpos == 0)
break;
/* How much can we scan in the next step? */
- trial = min (curpos, sizeof buffer);
+ trial = min (curpos, sizeof read_buf);
if (lseek (fd, curpos - trial, SEEK_SET) < 0)
report_file_error ("Setting file position",
Fcons (orig_filename, Qnil));
total_read = nread = 0;
while (total_read < trial)
{
- nread = emacs_read (fd, buffer + total_read, trial - total_read);
+ nread = emacs_read (fd, read_buf + total_read, trial - total_read);
if (nread < 0)
error ("IO error reading %s: %s",
SDATA (orig_filename), emacs_strerror (errno));
/* Compare with same_at_start to avoid counting some buffer text
as matching both at the file's beginning and at the end. */
while (bufpos > 0 && same_at_end > same_at_start
- && FETCH_BYTE (same_at_end - 1) == buffer[bufpos - 1])
+ && FETCH_BYTE (same_at_end - 1) == read_buf[bufpos - 1])
same_at_end--, bufpos--;
/* If we found a discrepancy, stop the scan.
report_file_error ("Setting file position",
Fcons (orig_filename, Qnil));
- total = st.st_size; /* Total bytes in the file. */
- how_much = 0; /* Bytes read from file so far. */
inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */
unprocessed = 0; /* Bytes not processed in previous loop. */
GCPRO1 (conversion_buffer);
- while (how_much < total)
+ while (1)
{
- /* We read one bunch by one (READ_BUF_SIZE bytes) to allow
- quitting while reading a huge while. */
- /* `try'' is reserved in some compilers (Microsoft C). */
- int trytry = min (total - how_much, READ_BUF_SIZE - unprocessed);
+ /* Read at most READ_BUF_SIZE bytes at a time, to allow
+ quitting while reading a huge file. */
/* Allow quitting out of the actual I/O. */
immediate_quit = 1;
QUIT;
- this = emacs_read (fd, read_buf + unprocessed, trytry);
+ this = emacs_read (fd, read_buf + unprocessed,
+ READ_BUF_SIZE - unprocessed);
immediate_quit = 0;
if (this <= 0)
break;
- how_much += this;
-
BUF_TEMP_SET_PT (XBUFFER (conversion_buffer),
BUF_Z (XBUFFER (conversion_buffer)));
decode_coding_c_string (&coding, (unsigned char *) read_buf,
so defer the removal till we reach the `handled' label. */
deferred_remove_unwind_protect = 1;
- /* At this point, HOW_MUCH should equal TOTAL, or should be <= 0
- if we couldn't read the file. */
-
if (this < 0)
error ("IO error reading %s: %s",
SDATA (orig_filename), emacs_strerror (errno));
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);
while (how_much < total)
{
/* try is reserved in some compilers (Microsoft C) */
- int trytry = min (total - how_much, READ_BUF_SIZE);
+ ptrdiff_t trytry = min (total - how_much, READ_BUF_SIZE);
ptrdiff_t this;
if (not_regular)
/* Maybe make more room. */
if (gap_size < trytry)
{
- make_gap (total - gap_size);
- gap_size = GAP_SIZE;
+ make_gap (trytry - gap_size);
+ gap_size = GAP_SIZE - inserted;
}
/* Read from the file, capturing `quit'. When an
error occurs, end the loop, and arrange for a quit
to be signaled after decoding the text we read. */
- non_regular_fd = fd;
- non_regular_inserted = inserted;
- non_regular_nbytes = trytry;
- nbytes = internal_condition_case_1 (read_non_regular,
- Qnil, Qerror,
- read_non_regular_quit);
+ nbytes = internal_condition_case_1
+ (read_non_regular,
+ make_save_value ("iii", (ptrdiff_t) fd, inserted, trytry),
+ Qerror, read_non_regular_quit);
+
if (NILP (nbytes))
{
read_quit = 1;
}
}
- /* Now we have read all the file data into the gap.
- If it was empty, undo marking the buffer modified. */
+ /* Now we have either read all the file data into the gap,
+ or stop reading on I/O error or quit. If nothing was
+ read, undo marking the buffer modified. */
if (inserted == 0)
{
else
Vdeactivate_mark = Qt;
+ emacs_close (fd);
+
+ /* Discard the unwind protect for closing the file. */
+ specpdl_ptr--;
+
+ if (how_much < 0)
+ error ("IO error reading %s: %s",
+ SDATA (orig_filename), emacs_strerror (errno));
+
/* Make the text read part of the buffer. */
GAP_SIZE -= inserted;
GPT += inserted;
/* Put an anchor to ensure multi-byte form ends at gap. */
*GPT_ADDR = 0;
- emacs_close (fd);
-
- /* Discard the unwind protect for closing the file. */
- specpdl_ptr--;
-
- if (how_much < 0)
- error ("IO error reading %s: %s",
- SDATA (orig_filename), emacs_strerror (errno));
-
notfound:
if (NILP (coding_system))
if (read_quit)
Fsignal (Qquit, Qnil);
- /* ??? Retval needs to be dealt with in all cases consistently. */
+ /* Retval needs to be dealt with in all cases consistently. */
if (NILP (val))
- val = Fcons (orig_filename,
- Fcons (make_number (inserted),
- Qnil));
+ val = list2 (orig_filename, make_number (inserted));
RETURN_UNGCPRO (unbind_to (count, val));
}
/* Decide the coding-system to encode the data with. */
-static Lisp_Object
-choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
- Lisp_Object append, Lisp_Object visit, Lisp_Object lockname,
- struct coding_system *coding)
+DEFUN ("choose-write-coding-system", Fchoose_write_coding_system,
+ Schoose_write_coding_system, 3, 6, 0,
+ doc: /* Choose the coding system for writing a file.
+Arguments are as for `write-region'.
+This function is for internal use only. It may prompt the user. */ )
+ (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
+ Lisp_Object append, Lisp_Object visit, Lisp_Object lockname)
{
Lisp_Object val;
Lisp_Object eol_parent = Qnil;
+ /* Mimic write-region behavior. */
+ if (NILP (start))
+ {
+ XSETFASTINT (start, BEGV);
+ XSETFASTINT (end, ZV);
+ }
+
if (auto_saving
&& NILP (Fstring_equal (BVAR (current_buffer, filename),
BVAR (current_buffer, auto_save_file_name))))
}
val = coding_inherit_eol_type (val, eol_parent);
- setup_coding_system (val, coding);
-
- if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display)))
- coding->mode |= CODING_MODE_SELECTIVE_DISPLAY;
return val;
}
instead of any buffer contents; END is ignored.
Optional fourth argument APPEND if non-nil means
- append to existing file contents (if any). If it is an integer,
+ append to existing file contents (if any). If it is a number,
seek to that offset in the file before writing.
Optional fifth argument VISIT, if t or a string, means
set the last-save-file-modtime of buffer to this file's modtime
(Lisp_Object start, Lisp_Object end, Lisp_Object filename, Lisp_Object append, Lisp_Object visit, Lisp_Object lockname, Lisp_Object mustbenew)
{
int desc;
+ int open_flags;
+ int mode;
+ off_t offset IF_LINT (= 0);
bool ok;
int save_errno = 0;
const char *fn;
We used to make this choice before calling build_annotations, but that
leads to problems when a write-annotate-function takes care of
unsavable chars (as was the case with X-Symbol). */
- Vlast_coding_system_used
- = choose_write_coding_system (start, end, filename,
- append, visit, lockname, &coding);
+ Vlast_coding_system_used =
+ Fchoose_write_coding_system (start, end, filename,
+ append, visit, lockname);
+
+ setup_coding_system (Vlast_coding_system_used, &coding);
+
+ if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display)))
+ coding.mode |= CODING_MODE_SELECTIVE_DISPLAY;
#ifdef CLASH_DETECTION
if (!auto_saving)
#endif /* CLASH_DETECTION */
encoded_filename = ENCODE_FILE (filename);
-
fn = SSDATA (encoded_filename);
- desc = -1;
- if (!NILP (append))
+ open_flags = O_WRONLY | O_BINARY | O_CREAT;
+ open_flags |= EQ (mustbenew, Qexcl) ? O_EXCL : !NILP (append) ? 0 : O_TRUNC;
+ if (NUMBERP (append))
+ offset = file_offset (append);
+ else if (!NILP (append))
+ open_flags |= O_APPEND;
#ifdef DOS_NT
- desc = emacs_open (fn, O_WRONLY | O_BINARY, 0);
-#else /* not DOS_NT */
- desc = emacs_open (fn, O_WRONLY, 0);
-#endif /* not DOS_NT */
+ mode = S_IREAD | S_IWRITE;
+#else
+ mode = auto_saving ? auto_save_mode_bits : 0666;
+#endif
- if (desc < 0 && (NILP (append) || errno == ENOENT))
-#ifdef DOS_NT
- desc = emacs_open (fn,
- O_WRONLY | O_CREAT | O_BINARY
- | (EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC),
- S_IREAD | S_IWRITE);
-#else /* not DOS_NT */
- desc = emacs_open (fn, O_WRONLY | O_TRUNC | O_CREAT
- | (EQ (mustbenew, Qexcl) ? O_EXCL : 0),
- auto_saving ? auto_save_mode_bits : 0666);
-#endif /* not DOS_NT */
+ desc = emacs_open (fn, open_flags, mode);
if (desc < 0)
{
record_unwind_protect (close_file_unwind, make_number (desc));
- if (!NILP (append) && !NILP (Ffile_regular_p (filename)))
+ if (NUMBERP (append))
{
- off_t ret;
-
- if (NUMBERP (append))
- ret = emacs_lseek (desc, XINT (append), SEEK_CUR);
- else
- ret = lseek (desc, 0, SEEK_END);
+ off_t ret = lseek (desc, offset, SEEK_SET);
if (ret < 0)
{
#ifdef CLASH_DETECTION
immediate_quit = 0;
#ifdef HAVE_FSYNC
- /* Note fsync appears to change the modtime on BSD4.2 (both vax and sun).
+ /* fsync appears to change the modtime on BSD4.2.
Disk full in NFS may be reported here. */
/* mib says that closing the file will try to write as fast as NFS can do
it, and that means the fsync here is not crucial for autosave files. */
/* Discard the unwind protect for close_file_unwind. */
specpdl_ptr = specpdl + count1;
+ /* Some file systems have a bug where st_mtime is not updated
+ properly after a write. For example, CIFS might not see the
+ st_mtime change until after the file is opened again.
+
+ Attempt to detect this file system bug, and update MODTIME to the
+ newer st_mtime if the bug appears to be present. This introduces
+ a race condition, so to avoid most instances of the race condition
+ on non-buggy file systems, skip this check if the most recently
+ encountered non-buggy file system was the current file system.
+
+ A race condition can occur if some other process modifies the
+ file between the fstat above and the fstat below, but the race is
+ unlikely and a similar race between the last write and the fstat
+ above cannot possibly be closed anyway. */
+
+ if (EMACS_TIME_VALID_P (modtime)
+ && ! (valid_timestamp_file_system && st.st_dev == timestamp_file_system))
+ {
+ int desc1 = emacs_open (fn, O_WRONLY | O_BINARY, 0);
+ if (0 <= desc1)
+ {
+ struct stat st1;
+ if (fstat (desc1, &st1) == 0
+ && st.st_dev == st1.st_dev && st.st_ino == st1.st_ino)
+ {
+ /* Use the heuristic if it appears to be valid. With neither
+ O_EXCL nor O_TRUNC, if Emacs happened to write nothing to the
+ file, the time stamp won't change. Also, some non-POSIX
+ systems don't update an empty file's time stamp when
+ truncating it. Finally, file systems with 100 ns or worse
+ resolution sometimes seem to have bugs: on a system with ns
+ resolution, checking ns % 100 incorrectly avoids the heuristic
+ 1% of the time, but the problem should be temporary as we will
+ try again on the next time stamp. */
+ bool use_heuristic
+ = ((open_flags & (O_EXCL | O_TRUNC)) != 0
+ && st.st_size != 0
+ && EMACS_NSECS (modtime) % 100 != 0);
+
+ EMACS_TIME modtime1 = get_stat_mtime (&st1);
+ if (use_heuristic
+ && EMACS_TIME_EQ (modtime, modtime1)
+ && st.st_size == st1.st_size)
+ {
+ timestamp_file_system = st.st_dev;
+ valid_timestamp_file_system = 1;
+ }
+ else
+ {
+ st.st_size = st1.st_size;
+ modtime = modtime1;
+ }
+ }
+ emacs_close (desc1);
+ }
+ }
+
/* Call write-region-post-annotation-function. */
while (CONSP (Vwrite_region_annotation_buffers))
{
}
if (!auto_saving)
- message_with_string ((INTEGERP (append)
+ message_with_string ((NUMBERP (append)
? "Updated %s"
: ! NILP (append)
? "Added to %s"
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;
auto_save_error (Lisp_Object error_val)
{
Lisp_Object args[3], msg;
- int i, nbytes;
+ int i;
struct gcpro gcpro1;
- char *msgbuf;
- USE_SAFE_ALLOCA;
auto_save_error_occurred = 1;
args[2] = Ferror_message_string (error_val);
msg = Fformat (3, args);
GCPRO1 (msg);
- nbytes = SBYTES (msg);
- msgbuf = SAFE_ALLOCA (nbytes);
- memcpy (msgbuf, SDATA (msg), nbytes);
for (i = 0; i < 3; ++i)
{
if (i == 0)
- message2 (msgbuf, nbytes, STRING_MULTIBYTE (msg));
+ message3 (msg);
else
- message2_nolog (msgbuf, nbytes, STRING_MULTIBYTE (msg));
+ message3_nolog (msg);
Fsleep_for (make_number (1), Qnil);
}
- SAFE_FREE ();
UNGCPRO;
return Qnil;
}
do_auto_save_unwind (Lisp_Object arg) /* used as unwind-protect function */
{
- FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
+ FILE *stream = XSAVE_POINTER (arg, 0);
auto_saving = 0;
if (stream != NULL)
{
}
record_unwind_protect (do_auto_save_unwind,
- make_save_value (stream, 0));
+ make_save_pointer (stream));
record_unwind_protect (do_auto_save_unwind_1,
make_number (minibuffer_auto_raise));
minibuffer_auto_raise = 0;
}
\f
+void
+init_fileio (void)
+{
+ valid_timestamp_file_system = 0;
+}
+
void
syms_of_fileio (void)
{
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 (Qchoose_write_coding_system, "choose-write-coding-system");
DEFSYM (Qwrite_region, "write-region");
DEFSYM (Qverify_visited_file_modtime, "verify-visited-file-modtime");
DEFSYM (Qset_visited_file_modtime, "set-visited-file-modtime");
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);
defsubr (&Sfile_newer_than_file_p);
defsubr (&Sinsert_file_contents);
+ defsubr (&Schoose_write_coding_system);
defsubr (&Swrite_region);
defsubr (&Scar_less_than_car);
defsubr (&Sverify_visited_file_modtime);
lock_info_type local_owner;
intmax_t n;
char *at, *dot, *colon;
- char readlink_buf[READLINK_BUFSIZE];
- char *lfinfo = emacs_readlink (lfname, readlink_buf);
+ Lisp_Object lfinfo_object = emacs_readlinkat (AT_FDCWD, lfname);
+ char *lfinfo;
+ struct gcpro gcpro1;
/* If nonexistent lock file, all is well; otherwise, got strange error. */
- if (!lfinfo)
+ if (NILP (lfinfo_object))
return errno == ENOENT ? 0 : -1;
+ lfinfo = SSDATA (lfinfo_object);
/* Even if the caller doesn't want the owner info, we still have to
read it to determine return value. */
at = strrchr (lfinfo, '@');
dot = strrchr (lfinfo, '.');
if (!at || !dot)
- {
- if (lfinfo != readlink_buf)
- xfree (lfinfo);
- return -1;
- }
+ return -1;
len = at - lfinfo;
+ GCPRO1 (lfinfo_object);
owner->user = xmalloc (len + 1);
memcpy (owner->user, lfinfo, len);
owner->user[len] = 0;
owner->host[len] = 0;
/* We're done looking at the link info. */
- if (lfinfo != readlink_buf)
- xfree (lfinfo);
+ UNGCPRO;
/* On current host? */
if (STRINGP (Fsystem_name ())
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;
}
usage: (widget-apply WIDGET PROPERTY &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
- /* This function can GC. */
+ /* This function can GC. */
Lisp_Object newargs[3];
struct gcpro gcpro1, gcpro2;
Lisp_Object result;
val = build_unibyte_string (str);
/* Fixme: Is this coding system necessarily right, even if
it is consistent with CODESET? If not, what to do? */
- Faset (v, make_number (i),
- code_convert_string_norecord (val, Vlocale_coding_system,
- 0));
+ ASET (v, i, code_convert_string_norecord (val, Vlocale_coding_system,
+ 0));
}
UNGCPRO;
return v;
{
str = nl_langinfo (months[i]);
val = build_unibyte_string (str);
- Faset (v, make_number (i),
- code_convert_string_norecord (val, Vlocale_coding_system, 0));
+ ASET (v, i, code_convert_string_norecord (val, Vlocale_coding_system,
+ 0));
}
UNGCPRO;
return v;
/* 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)
-
/* Return a hash for string PTR which has length LEN. The hash value
can be any EMACS_UINT value. */
while (p != end)
{
c = *p++;
- hash = SXHASH_COMBINE (hash, c);
+ hash = sxhash_combine (hash, c);
}
return hash;
/* Return a hash for the floating point value VAL. */
-static EMACS_INT
+static EMACS_UINT
sxhash_float (double val)
{
EMACS_UINT hash = 0;
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
-/* Font name parser and unparser */
+/* Font name parser and unparser. */
static int parse_matrix (const char *);
static int font_expand_wildcards (Lisp_Object *, int);
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;
+ }
}
}
/* This part (through the next ^L) is still experimental and not
tested much. We may drastically change codes. */
-/* OTF handler */
+/* OTF handler. */
#if 0
OTF *otf;
if (! NILP (val))
- otf = XSAVE_VALUE (XCDR (val))->pointer;
+ otf = XSAVE_POINTER (XCDR (val), 0);
else
{
otf = STRINGP (file) ? OTF_open (SSDATA (file)) : NULL;
- val = make_save_value (otf, 0);
+ val = make_save_pointer (otf);
otf_list = Fcons (Fcons (file, val), otf_list);
}
return otf;
#endif /* 0 */
\f
-/* Font sorting */
+/* Font sorting. */
static unsigned font_score (Lisp_Object, Lisp_Object *);
static int font_compare (const void *, const void *);
{
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;
return val;
}
-static int num_fonts;
static void
font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver)
{
eassert (font && driver == font->driver);
driver->close (f, font);
- num_fonts--;
}
}
if (driver->free_entity)
{
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
return Qnil;
ASET (entity, FONT_OBJLIST_INDEX,
Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX)));
- num_fonts++;
font = XFONT_OBJECT (font_object);
min_width = (font->min_width ? font->min_width
eassert (FRAME_X_DISPLAY_INFO (f)->n_fonts);
FRAME_X_DISPLAY_INFO (f)->n_fonts--;
#endif
- num_fonts--;
}
Lisp_Object it;
int i;
- /* Set boolean values to Qt or Qnil */
+ /* Set boolean values to Qt or Qnil. */
for (i = 0; boolean_properties[i] != NULL; ++i)
for (it = alist; ! NILP (it); it = XCDR (it))
{
#endif
\f
-/* Lisp API */
+/* Lisp API. */
DEFUN ("fontp", Ffontp, Sfontp, 1, 2, 0,
doc: /* Return t if OBJECT is a font-spec, font-entity, or font-object.
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;
}
CHECK_FONT_GET_OBJECT (font_object, font);
- val = Fmake_vector (make_number (9), Qnil);
+ val = make_uninit_vector (9);
ASET (val, 0, AREF (font_object, FONT_NAME_INDEX));
ASET (val, 1, AREF (font_object, FONT_FILE_INDEX));
ASET (val, 2, make_number (font->pixel_size));
ASET (val, 7, make_number (font->average_width));
if (font->driver->otf_capability)
ASET (val, 8, Fcons (Qopentype, font->driver->otf_capability (font)));
+ else
+ ASET (val, 8, Qnil);
return val;
}
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))
{
return Qnil;
font = XFONT_OBJECT (font_object);
- info = Fmake_vector (make_number (7), Qnil);
+ info = make_uninit_vector (7);
ASET (info, 0, AREF (font_object, FONT_NAME_INDEX));
ASET (info, 1, AREF (font_object, FONT_FULLNAME_INDEX));
ASET (info, 2, make_number (font->pixel_size));
XSYMBOL (intern_c_string ("font-width-table"))->constant = 1;
staticpro (&font_style_table);
- font_style_table = Fmake_vector (make_number (3), Qnil);
+ font_style_table = make_uninit_vector (3);
ASET (font_style_table, 0, Vfont_weight_table);
ASET (font_style_table, 1, Vfont_slant_table);
ASET (font_style_table, 2, Vfont_width_table);
/* Macros for FONT-DEF and RFONT-DEF of fontset. */
#define FONT_DEF_NEW(font_def, font_spec, encoding, repertory) \
do { \
- (font_def) = Fmake_vector (make_number (3), (font_spec)); \
+ (font_def) = make_uninit_vector (3); \
+ ASET ((font_def), 0, font_spec); \
ASET ((font_def), 1, encoding); \
ASET ((font_def), 2, repertory); \
} while (0)
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 arg;
- arg = Fmake_vector (make_number (5), Qnil);
+ arg = make_uninit_vector (5);
ASET (arg, 0, fontset);
ASET (arg, 1, font_def);
ASET (arg, 2, add);
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);
tty_frame_count = 1;
fset_name (f, build_pure_c_string ("F1"));
- f->visible = 1;
- f->async_visible = 1;
+ SET_FRAME_VISIBLE (f, 1);
f->output_method = terminal->type;
f->terminal = terminal;
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. */
fset_name (f, make_formatted_string (name, "F%"pMd, ++tty_frame_count));
- f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
- f->async_visible = 1; /* Don't let visible be cleared later. */
+ SET_FRAME_VISIBLE (f, 1);
+
f->terminal = terminal;
f->terminal->reference_count++;
#ifdef MSDOS
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;
/* Set the top frame to the newly created frame. */
if (FRAMEP (FRAME_TTY (f)->top_frame)
&& FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
- XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */
+ SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (f)->top_frame), 2); /* obscured */
FRAME_TTY (f)->top_frame = frame;
{
if (FRAMEP (FRAME_TTY (XFRAME (frame))->top_frame))
/* Mark previously displayed frame as now obscured. */
- XFRAME (FRAME_TTY (XFRAME (frame))->top_frame)->async_visible = 2;
- XFRAME (frame)->async_visible = 1;
+ SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (XFRAME (frame))->top_frame), 2);
+ SET_FRAME_VISIBLE (XFRAME (frame), 1);
FRAME_TTY (XFRAME (frame))->top_frame = frame;
}
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))
+ {
+ 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)
+ {
+ 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 ();
+ eassert (CONSP (Vframe_list));
- /* If this frame is dead, it won't be in Vframe_list, and we'll loop
- forever. Forestall that. */
- CHECK_LIVE_FRAME (frame);
-
- 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;
and note any recent change in visibility. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (XFRAME (this)))
- {
- x_sync (XFRAME (this));
- FRAME_SAMPLE_VISIBILITY (XFRAME (this));
- }
+ x_sync (XFRAME (this));
#endif
if (FRAME_VISIBLE_P (XFRAME (this))
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
fset_root_window (f, Qnil);
Vframe_list = Fdelq (frame, Vframe_list);
- FRAME_SET_VISIBLE (f, 0);
+ SET_FRAME_VISIBLE (f, 0);
/* Allow the vector of menu bar contents to be freed in the next
garbage collection. The frame object itself may not be garbage
xfree (FRAME_DELETEN_COST (f));
xfree (FRAME_INSERTN_COST (f));
xfree (FRAME_DELETE_COST (f));
- xfree (FRAME_MESSAGE_BUF (f));
/* Since some events are handled at the interrupt level, we may get
an event for f at any time; if we zero out the frame's terminal
{
struct terminal *terminal = FRAME_TERMINAL (f);
f->output_data.nothing = 0;
- f->terminal = 0; /* Now the frame is dead. */
+ f->terminal = 0; /* Now the frame is dead. */
/* If needed, delete the terminal that this frame was on.
- (This must be done after the frame is killed.) */
+ (This must be done after the frame is killed.) */
terminal->reference_count--;
#ifdef USE_GTK
/* FIXME: Deleting the terminal crashes emacs because of a GTK
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;
+ Lisp_Object 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);
-
- 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;
-
- frame_on_same_kboard = Qnil;
- frame_with_minibuf = Qnil;
+ Lisp_Object frame_on_same_kboard = 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)))
- {
- FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
- x_make_frame_visible (XFRAME (frame));
- }
+ if (FRAME_WINDOW_P (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;
+ struct frame *f = decode_live_frame (frame);
- CHECK_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. */
{
CHECK_LIVE_FRAME (frame);
- FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
-
if (FRAME_VISIBLE_P (XFRAME (frame)))
return Qt;
if (FRAME_ICONIFIED_P (XFRAME (frame)))
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
make_formatted_string (buf, "%"pMu, w));
#endif
store_in_alist (alistptr, Qicon_name, f->icon_name);
- FRAME_SAMPLE_VISIBILITY (f);
store_in_alist (alistptr, Qvisibility,
(FRAME_VISIBLE_P (f) ? Qt
: FRAME_ICONIFIED_P (f) ? Qicon : Qnil));
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
/* Don't multiply include: dispextern.h includes macterm.h which
includes frame.h some emacs source includes both dispextern.h and
- frame.h */
+ frame.h. */
#ifndef EMACS_FRAME_H
#define EMACS_FRAME_H
\f
/* Miscellanea. */
-/* Nonzero means there is at least one garbaged frame. */
+/* Nonzero means there is at least one garbaged frame. */
extern bool frame_garbaged;
\f
output_x_window,
output_msdos_raw,
output_w32,
- output_mac,
output_ns
};
string's pointer (`name', above) because it might get relocated. */
char *namebuf;
- /* Glyph pool and matrix. */
+ /* Glyph pool and matrix. */
struct glyph_pool *current_pool;
struct glyph_pool *desired_pool;
struct glyph_matrix *desired_matrix;
#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;
+ /* Next two bitfields are mutually exclusive. They might both be
+ zero if the frame has been made invisible without an icon. */
- /* visible is nonzero if the frame is currently displayed; we check
+ /* 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.
Note that, since invisible frames aren't updated, whenever a
- frame becomes visible again, it must be marked as garbaged. The
- FRAME_SAMPLE_VISIBILITY macro takes care of this.
+ frame becomes visible again, it must be marked as garbaged.
On ttys and on Windows NT/9X, to avoid wasting effort updating
visible frames that are actually completely obscured by other
windows on the display, we bend the meaning of visible slightly:
- if greater than 1, then the frame is obscured - we still consider
+ if equal to 2, then the frame is obscured - we still consider
it to be "visible" as seen from lisp, but we don't bother
updating it. We must take care to garbage the frame when it
- ceases to be obscured though.
-
- iconified is nonzero if the frame is currently iconified.
-
- Asynchronous input handlers should NOT change these directly;
- instead, they should change async_visible or async_iconified, and
- let the FRAME_SAMPLE_VISIBILITY macro set visible and iconified
- at the next redisplay.
-
- These should probably be considered read-only by everyone except
- FRAME_SAMPLE_VISIBILITY.
-
- These two are mutually exclusive. They might both be zero, if the
- frame has been made invisible without an icon. */
+ ceases to be obscured though. See SET_FRAME_VISIBLE below. */
unsigned visible : 2;
- unsigned iconified : 1;
-
- /* Let's not use bitfields for volatile variables. */
- /* Asynchronous input handlers change these, and
- FRAME_SAMPLE_VISIBILITY copies them into visible and iconified.
- See FRAME_SAMPLE_VISIBILITY, below. */
- volatile char async_visible, async_iconified;
+ /* Nonzero if the frame is currently iconified. Do not
+ set this directly, use SET_FRAME_ICONIFIED instead. */
+ unsigned iconified : 1;
/* Nonzero if this frame should be redrawn. */
- volatile char garbaged;
+ unsigned garbaged : 1;
/* True if frame actually has a minibuffer window on it.
0 if using a minibuffer window that isn't on this frame. */
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?
/* Width of bar cursor (if we are using that) for blink-off state. */
int blink_off_cursor_width;
- /* Storage for messages to this frame. */
- char *message_buf;
-
/* Nonnegative if current redisplay should not do scroll computation
for lines beyond a certain vpos. This is the vpos. */
int scroll_bottom_vpos;
#else
#define FRAME_EXTERNAL_MENU_BAR(f) 0
#endif
-#define FRAME_VISIBLE_P(f) ((f)->visible != 0)
+#define FRAME_VISIBLE_P(f) (f)->visible
/* Nonzero if frame F is currently visible but hidden. */
#define FRAME_OBSCURED_P(f) ((f)->visible > 1)
/* Nonzero if frame F is currently iconified. */
#define FRAME_ICONIFIED_P(f) (f)->iconified
-#define FRAME_SET_VISIBLE(f,p) \
- ((f)->async_visible = (p), FRAME_SAMPLE_VISIBILITY (f))
+/* Mark frame F as currently garbaged. */
#define SET_FRAME_GARBAGED(f) (frame_garbaged = 1, f->garbaged = 1)
+
+/* Nonzero if frame F is currently garbaged. */
#define FRAME_GARBAGED_P(f) (f)->garbaged
/* Nonzero means do not allow splitting this frame's window. */
#define FRAME_DELETE_COST(f) (f)->delete_line_cost
#define FRAME_INSERTN_COST(f) (f)->insert_n_lines_cost
#define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost
-#define FRAME_MESSAGE_BUF(f) (f)->message_buf
#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)
#define FRAME_MESSAGE_BUF_SIZE(f) (((int) FRAME_COLS (f)) * 4)
-/* Emacs's redisplay code could become confused if a frame's
- visibility changes at arbitrary times. For example, if a frame is
- visible while the desired glyphs are being built, but becomes
- invisible before they are updated, then some rows of the
- desired_glyphs will be left marked as enabled after redisplay is
- complete, which should never happen. The next time the frame
- becomes visible, redisplay will probably barf.
-
- Currently, there are no similar situations involving iconified, but
- the principle is the same.
-
- So instead of having asynchronous input handlers directly set and
- clear the frame's visibility and iconification flags, they just set
- the async_visible and async_iconified flags; the redisplay code
- calls the FRAME_SAMPLE_VISIBILITY macro before doing any redisplay,
- which sets visible and iconified from their asynchronous
- counterparts.
-
- Synchronous code must use the FRAME_SET_VISIBLE macro.
-
- Also, if a frame used to be invisible, but has just become visible,
- it must be marked as garbaged, since redisplay hasn't been keeping
- up its contents.
-
- Note that a tty frame is visible if and only if it is the topmost
- frame. */
-
-#define FRAME_SAMPLE_VISIBILITY(f) \
- (((f)->async_visible && (f)->visible != (f)->async_visible) ? \
- SET_FRAME_GARBAGED (f) : 0, \
- (f)->visible = (f)->async_visible, \
- (f)->iconified = (f)->async_iconified)
-
#define CHECK_FRAME(x) \
CHECK_TYPE (FRAMEP (x), Qframep, x)
&& (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)
+
+/* Set visibility of frame F, marking F as garbaged if needed. */
+
+#define SET_FRAME_VISIBLE(f, v) \
+ (((f)->visible == 0 || ((f)->visible == 2)) \
+ && ((v) == 1) ? SET_FRAME_GARBAGED (f) : 0, \
+ (f)->visible = (eassert (0 <= (v) && (v) <= 2), (v)))
+
+/* Set iconify of frame F. */
+
+#define SET_FRAME_ICONIFIED(f, i) \
+ (f)->iconified = (eassert (0 <= (i) && (i) <= 1), (i))
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);
cache_data = xmalloc (sizeof *cache_data);
cache_data->ft_face = NULL;
cache_data->fc_charset = NULL;
- val = make_save_value (NULL, 0);
- XSAVE_VALUE (val)->integer = 0;
- XSAVE_VALUE (val)->pointer = cache_data;
+ val = make_save_value ("pi", cache_data, 0);
cache = Fcons (Qnil, val);
Fputhash (key, cache, ft_face_cache);
}
else
{
val = XCDR (cache);
- cache_data = XSAVE_VALUE (val)->pointer;
+ cache_data = XSAVE_POINTER (val, 0);
}
if (cache_for == FTFONT_CACHE_FOR_ENTITY)
cache = ftfont_lookup_cache (entity, FTFONT_CACHE_FOR_CHARSET);
val = XCDR (cache);
- cache_data = XSAVE_VALUE (val)->pointer;
+ cache_data = XSAVE_POINTER (val, 0);
return cache_data->fc_charset;
}
filename = XCAR (val);
idx = XCDR (val);
val = XCDR (cache);
- cache_data = XSAVE_VALUE (XCDR (cache))->pointer;
+ cache_data = XSAVE_POINTER (XCDR (cache), 0);
ft_face = cache_data->ft_face;
- if (XSAVE_VALUE (val)->integer > 0)
+ if (XSAVE_INTEGER (val, 1) > 0)
{
/* FT_Face in this cache is already used by the different size. */
if (FT_New_Size (ft_face, &ft_size) != 0)
return Qnil;
}
}
- XSAVE_VALUE (val)->integer++;
+ XSAVE_INTEGER (val, 1)++;
size = XINT (AREF (entity, FONT_SIZE_INDEX));
if (size == 0)
size = pixel_size;
if (FT_Set_Pixel_Sizes (ft_face, size, size) != 0)
{
- if (XSAVE_VALUE (val)->integer == 0)
+ if (XSAVE_INTEGER (val, 1) == 0)
FT_Done_Face (ft_face);
return Qnil;
}
cache = ftfont_lookup_cache (val, FTFONT_CACHE_FOR_FACE);
eassert (CONSP (cache));
val = XCDR (cache);
- (XSAVE_VALUE (val)->integer)--;
- if (XSAVE_VALUE (val)->integer == 0)
+ XSAVE_INTEGER (val, 1)--;
+ if (XSAVE_INTEGER (val, 1) == 0)
{
- struct ftfont_cache_data *cache_data = XSAVE_VALUE (val)->pointer;
+ struct ftfont_cache_data *cache_data = XSAVE_POINTER (val, 0);
FT_Done_Face (cache_data->ft_face);
#ifdef HAVE_LIBOTF
LGLYPH_SET_DESCENT (lglyph, g->descent >> 6);
if (g->adjusted)
{
- Lisp_Object vec;
+ Lisp_Object vec = make_uninit_vector (3);
- vec = Fmake_vector (make_number (3), Qnil);
ASET (vec, 0, make_number (g->xoff >> 6));
ASET (vec, 1, make_number (g->yoff >> 6));
ASET (vec, 2, make_number (g->xadv >> 6));
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);
}
}
size as fast as possible.
For unmapped windows, we can set rows/cols. When
the frame is mapped again we will (hopefully) get the correct size. */
- if (f->async_visible)
+ if (FRAME_VISIBLE_P (f))
{
/* Must call this to flush out events */
(void)gtk_events_pending ();
static Lisp_Object
pop_down_dialog (Lisp_Object arg)
{
- struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
- struct xg_dialog_data *dd = (struct xg_dialog_data *) p->pointer;
+ struct xg_dialog_data *dd = XSAVE_POINTER (arg, 0);
block_input ();
if (dd->w) gtk_widget_destroy (dd->w);
g_signal_connect (G_OBJECT (w), "delete-event", G_CALLBACK (gtk_true), NULL);
gtk_widget_show (w);
- record_unwind_protect (pop_down_dialog, make_save_value (&dd, 0));
+ record_unwind_protect (pop_down_dialog, make_save_pointer (&dd));
(void) xg_maybe_add_timer (&dd);
g_main_loop_run (dd.loop);
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
adj = gtk_range_get_adjustment (GTK_RANGE (wscroll));
- /* We do the same as for MOTIF in xterm.c, assume 30 chars per line
- rather than the real portion value. This makes the thumb less likely
- to resize and that looks better. */
- portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
- /* When the thumb is at the bottom, position == whole.
- So we need to increase `whole' to make space for the thumb. */
- whole += portion;
+ if (scroll_bar_adjust_thumb_portion_p)
+ {
+ /* We do the same as for MOTIF in xterm.c, use 30 chars per
+ line rather than the real portion value. This makes the
+ thumb less likely to resize and that looks better. */
+ portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
+
+ /* When the thumb is at the bottom, position == whole.
+ So we need to increase `whole' to make space for the thumb. */
+ whole += portion;
+ }
if (whole <= 0)
top = 0, shown = 1;
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
struct Lisp_Vector *widthtab;
if (!VECTORP (BVAR (buf, width_table)))
- bset_width_table (buf, Fmake_vector (make_number (256), make_number (0)));
+ bset_width_table (buf, make_uninit_vector (256));
widthtab = XVECTOR (BVAR (buf, width_table));
eassert (widthtab->header.size == 256);
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);
struct window *w;
Lisp_Object old_buffer;
EMACS_INT old_charpos IF_LINT (= 0), old_bytepos IF_LINT (= 0);
- struct gcpro gcpro1, gcpro2, gcpro3;
+ struct gcpro gcpro1;
Lisp_Object lcols = Qnil;
double cols IF_LINT (= 0);
void *itdata = NULL;
}
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);
+ GCPRO1 (old_buffer);
if (XBUFFER (w->buffer) != current_buffer)
{
/* 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 */
#endif /* MARKER_DEBUG */
-/* Move gap to position CHARPOS.
- Note that this can quit! */
-
-void
-move_gap (ptrdiff_t charpos)
-{
- move_gap_both (charpos, charpos_to_bytepos (charpos));
-}
-
/* Move gap to byte position BYTEPOS, which is also char position CHARPOS.
Note that this can quit! */
void
move_gap_both (ptrdiff_t charpos, ptrdiff_t bytepos)
{
+ eassert (charpos == BYTE_TO_CHAR (bytepos)
+ && bytepos == CHAR_TO_BYTE (charpos));
if (bytepos < GPT_BYTE)
gap_left (charpos, bytepos, 0);
else if (bytepos > GPT_BYTE)
ptrdiff_t real_gap_loc_byte;
ptrdiff_t old_gap_size;
ptrdiff_t current_size = Z_BYTE - BEG_BYTE + GAP_SIZE;
- enum { enough_for_a_while = 2000 };
if (BUF_BYTES_MAX - current_size < nbytes_added)
buffer_overflow ();
/* If we have to get more space, get enough to last a while;
but do not exceed the maximum buffer size. */
- nbytes_added = min (nbytes_added + enough_for_a_while,
+ nbytes_added = min (nbytes_added + GAP_BYTES_DFL,
BUF_BYTES_MAX - current_size);
enlarge_buffer_text (current_buffer, nbytes_added);
GPT_BYTE = Z_BYTE + GAP_SIZE;
GAP_SIZE = nbytes_added;
- /* Move the new gap down to be consecutive with the end of the old one.
- This adjusts the markers properly too. */
+ /* Move the new gap down to be consecutive with the end of the old one. */
gap_left (real_gap_loc + old_gap_size, real_gap_loc_byte + old_gap_size, 1);
/* Now combine the two into one large gap. */
ptrdiff_t real_beg_unchanged;
ptrdiff_t new_gap_size;
- /* Make sure the gap is at least 20 bytes. */
- if (GAP_SIZE - nbytes_removed < 20)
- nbytes_removed = GAP_SIZE - 20;
+ /* Make sure the gap is at least GAP_BYTES_MIN bytes. */
+ if (GAP_SIZE - nbytes_removed < GAP_BYTES_MIN)
+ nbytes_removed = GAP_SIZE - GAP_BYTES_MIN;
/* Prevent quitting in move_gap. */
tem = Vinhibit_quit;
Z_BYTE += new_gap_size;
GAP_SIZE = nbytes_removed;
- /* Move the unwanted pretend gap to the end of the buffer. This
- adjusts the markers properly too. */
+ /* Move the unwanted pretend gap to the end of the buffer. */
gap_right (Z, Z_BYTE);
enlarge_buffer_text (current_buffer, -nbytes_removed);
make_gap_smaller (-nbytes_added);
#endif
}
-\f
+
+/* Add NBYTES to B's gap. It's enough to temporarily
+ fake current_buffer and avoid real switch to B. */
+
+void
+make_gap_1 (struct buffer *b, ptrdiff_t nbytes)
+{
+ struct buffer *oldb = current_buffer;
+
+ current_buffer = b;
+ make_gap (nbytes);
+ current_buffer = oldb;
+}
+
/* Copy NBYTES bytes of text from FROM_ADDR to TO_ADDR.
FROM_MULTIBYTE says whether the incoming text is multibyte.
TO_MULTIBYTE says whether to store the text as multibyte.
}
}
-/* Subroutine used by the insert functions above. */
-
-void
-insert_1 (const char *string, ptrdiff_t nbytes,
- bool inherit, bool prepare, bool before_markers)
-{
- insert_1_both (string, chars_in_text ((unsigned char *) string, nbytes),
- nbytes, inherit, prepare, before_markers);
-}
-
-\f
#ifdef BYTE_COMBINING_DEBUG
/* See if the bytes before POS/POS_BYTE combine with bytes
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);
DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
Scombine_after_change_execute, 0, 0, 0,
- doc: /* This function is for use internally in `combine-after-change-calls'. */)
+ doc: /* This function is for use internally in the function `combine-after-change-calls'. */)
(void)
{
ptrdiff_t count = SPECPDL_INDEX ();
combine_after_change_buffer = Qnil;
DEFVAR_LISP ("combine-after-change-calls", Vcombine_after_change_calls,
- doc: /* Used internally by the `combine-after-change-calls' macro. */);
+ doc: /* Used internally by the function `combine-after-change-calls' macro. */);
Vcombine_after_change_calls = Qnil;
DEFVAR_BOOL ("inhibit-modification-hooks", inhibit_modification_hooks,
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 bool get_input_pending (int);
static bool readable_events (int);
-static Lisp_Object read_char_x_menu_prompt (ptrdiff_t, Lisp_Object *,
+static Lisp_Object read_char_x_menu_prompt (Lisp_Object,
Lisp_Object, bool *);
-static Lisp_Object read_char_minibuf_menu_prompt (int, ptrdiff_t,
- Lisp_Object *);
+static Lisp_Object read_char_minibuf_menu_prompt (int, 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;
+ }
- idx = make_number (SCHARS (echo_string) - 2);
- prev_char = Faref (echo_string, idx);
+ /* 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) - 1);
- last_char = Faref (echo_string, idx);
+ idx = make_number (SCHARS (echo_string) - 2);
+ prev_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))
+ 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) && 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)
}
echoing = 1;
- message3_nolog (KVAR (current_kboard, echo_string),
- SBYTES (KVAR (current_kboard, echo_string)),
- STRING_MULTIBYTE (KVAR (current_kboard, echo_string)));
+ /* FIXME: Use call (Qmessage) so it can be advised (e.g. emacspeak). */
+ message3_nolog (KVAR (current_kboard, echo_string));
echoing = 0;
/* Record in what buffer we echoed, and from which kboard. */
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. */
sit_for (Vminibuffer_message_timeout, 0, 2);
/* Clear the echo area. */
- message2 (0, 0, 0);
+ message1 (0);
safe_run_hooks (Qecho_area_clear_hook);
unbind_to (count, Qnil);
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))
{
do { if (polling_stopped_here) start_polling (); \
polling_stopped_here = 0; } while (0)
-/* read a character from the keyboard; call the redisplay if needed */
+/* Read a character from the keyboard; call the redisplay if needed. */
/* commandflag 0 means do not autosave, but do redisplay.
-1 means do not redisplay, but do autosave.
1 means do both. */
-/* The arguments MAPS and NMAPS are for menu prompting.
- MAPS is an array of keymaps; NMAPS is the length of MAPS.
+/* The arguments MAP is for menu prompting. MAP is a keymap.
PREV_EVENT is the previous input event, or nil if we are reading
the first event of a key sequence (or not reading a key sequence).
Value is t if we showed a menu and the user rejected it. */
Lisp_Object
-read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
+read_char (int commandflag, Lisp_Object map,
Lisp_Object prev_event,
bool *used_mouse_menu, EMACS_TIME *end_time)
{
goto reread_first;
}
- /* if redisplay was requested */
+ /* If redisplay was requested. */
if (commandflag >= 0)
{
bool echo_current = EQ (echo_message_buffer, echo_area_buffer[0]);
user-visible, such as X selection_request events. */
if (input_pending
|| detect_input_pending_run_timers (0))
- swallow_events (0); /* may clear input_pending */
+ swallow_events (0); /* May clear input_pending. */
/* Redisplay if no pending input. */
while (!input_pending)
menu prompting. If EVENT_HAS_PARAMETERS then we are reading
after a mouse event so don't try a minibuf menu. */
c = Qnil;
- if (nmaps > 0 && INTERACTIVE
+ if (KEYMAPP (map) && INTERACTIVE
&& !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event)
/* Don't bring up a menu if we already have another event. */
&& NILP (Vunread_command_events)
&& !detect_input_pending_run_timers (0))
{
- c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps);
+ c = read_char_minibuf_menu_prompt (commandflag, map);
if (INTEGERP (c) && XINT (c) == -2)
return c; /* wrong_kboard_jmpbuf */
because the recursive call of read_char in read_char_minibuf_menu_prompt
does not pass on any keymaps. */
- if (nmaps > 0 && INTERACTIVE
+ if (KEYMAPP (map) && INTERACTIVE
&& !NILP (prev_event)
&& EVENT_HAS_PARAMETERS (prev_event)
&& !EQ (XCAR (prev_event), Qmenu_bar)
/* Don't bring up a menu if we already have another event. */
&& NILP (Vunread_command_events))
{
- c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu);
+ c = read_char_x_menu_prompt (map, prev_event, used_mouse_menu);
/* Now that we have read an event, Emacs is not idle. */
if (!end_time)
/* If we are not reading a key sequence,
never use the echo area. */
- if (maps == 0)
+ if (!KEYMAPP (map))
{
specbind (Qinput_method_use_echo_area, Qt);
}
last_input_event = c;
num_input_events++;
- /* Process the help character specially if enabled */
+ /* Process the help character specially if enabled. */
if (!NILP (Vhelp_form) && help_char_p (c))
{
ptrdiff_t count = SPECPDL_INDEX ();
cancel_echoing ();
do
{
- c = read_char (0, 0, 0, Qnil, 0, NULL);
+ c = read_char (0, Qnil, Qnil, 0, NULL);
if (EVENT_HAS_PARAMETERS (c)
&& EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_click))
XSETCAR (help_form_saved_window_configs, Qnil);
}
while (BUFFERP (c));
- /* Remove the help from the frame */
+ /* Remove the help from the frame. */
unbind_to (count, Qnil);
redisplay ();
{
cancel_echoing ();
do
- c = read_char (0, 0, 0, Qnil, 0, NULL);
+ c = read_char (0, Qnil, Qnil, 0, NULL);
while (BUFFERP (c));
}
}
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;
- /* Make sure no interrupt happens while storing the 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. */
#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
static void
append_tool_bar_item (void)
{
- ptrdiff_t incr =
- (ntool_bar_items
- - (ASIZE (tool_bar_items_vector) - TOOL_BAR_ITEM_NSLOTS));
+ ptrdiff_t incr
+ = (ntool_bar_items
+ - (ASIZE (tool_bar_items_vector) - TOOL_BAR_ITEM_NSLOTS));
/* Enlarge tool_bar_items_vector if necessary. */
if (0 < incr)
\f
-/* Read a character using menus based on maps in the array MAPS.
- NMAPS is the length of MAPS. Return nil if there are no menus in the maps.
+/* Read a character using menus based on the keymap MAP.
+ Return nil if there are no menus in the maps.
Return t if we displayed a menu but the user rejected it.
PREV_EVENT is the previous input event, or nil if we are reading
and do auto-saving in the inner call of read_char. */
static Lisp_Object
-read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps,
+read_char_x_menu_prompt (Lisp_Object map,
Lisp_Object prev_event, bool *used_mouse_menu)
{
-#ifdef HAVE_MENUS
- ptrdiff_t mapno;
-#endif
-
if (used_mouse_menu)
*used_mouse_menu = 0;
- /* Use local over global Menu maps */
+ /* Use local over global Menu maps. */
if (! menu_prompting)
return Qnil;
- /* Optionally disregard all but the global map. */
- if (inhibit_local_menu_bar_menus)
- {
- maps += (nmaps - 1);
- nmaps = 1;
- }
-
#ifdef HAVE_MENUS
/* If we got to this point via a mouse click,
use a real menu for mouse selection. */
&& !EQ (XCAR (prev_event), Qtool_bar))
{
/* Display the menu and get the selection. */
- Lisp_Object *realmaps = alloca (nmaps * sizeof *realmaps);
Lisp_Object value;
- ptrdiff_t nmaps1 = 0;
- /* Use the maps that are not nil. */
- for (mapno = 0; mapno < nmaps; mapno++)
- if (!NILP (maps[mapno]))
- realmaps[nmaps1++] = maps[mapno];
-
- value = Fx_popup_menu (prev_event, Flist (nmaps1, realmaps));
+ value = Fx_popup_menu (prev_event, get_keymap (map, 0, 1));
if (CONSP (value))
{
Lisp_Object tem;
return Qnil ;
}
-/* Buffer in use so far for the minibuf prompts for menu keymaps.
- We make this bigger when necessary, and never free it. */
-static char *read_char_minibuf_menu_text;
-/* Size of that buffer. */
-static ptrdiff_t read_char_minibuf_menu_width;
-
static Lisp_Object
read_char_minibuf_menu_prompt (int commandflag,
- ptrdiff_t nmaps, Lisp_Object *maps)
+ Lisp_Object map)
{
- ptrdiff_t mapno;
register Lisp_Object name;
ptrdiff_t nlength;
/* FIXME: Use the minibuffer's frame width. */
ptrdiff_t idx = -1;
bool nobindings = 1;
Lisp_Object rest, vector;
- char *menu;
+ Lisp_Object prompt_strings = Qnil;
vector = Qnil;
- name = Qnil;
if (! menu_prompting)
return Qnil;
- /* Get the menu name from the first map that has one (a prompt string). */
- for (mapno = 0; mapno < nmaps; mapno++)
- {
- name = Fkeymap_prompt (maps[mapno]);
- if (!NILP (name))
- break;
- }
+ map = get_keymap (map, 0, 1);
+ name = Fkeymap_prompt (map);
/* If we don't have any menus, just read a character normally. */
if (!STRINGP (name))
return Qnil;
- /* Make sure we have a big enough buffer for the menu text. */
- width = max (width, SBYTES (name));
- if (STRING_BYTES_BOUND - 4 < width)
- memory_full (SIZE_MAX);
- if (width + 4 > read_char_minibuf_menu_width)
- {
- read_char_minibuf_menu_text
- = xrealloc (read_char_minibuf_menu_text, width + 4);
- read_char_minibuf_menu_width = width + 4;
- }
- menu = read_char_minibuf_menu_text;
+#define PUSH_C_STR(str, listvar) \
+ listvar = Fcons (make_unibyte_string (str, strlen (str)), listvar)
/* Prompt string always starts with map's prompt, and a space. */
- strcpy (menu, SSDATA (name));
- nlength = SBYTES (name);
- menu[nlength++] = ':';
- menu[nlength++] = ' ';
- menu[nlength] = 0;
+ prompt_strings = Fcons (name, prompt_strings);
+ PUSH_C_STR (": ", prompt_strings);
+ nlength = SCHARS (name) + 2;
- /* Start prompting at start of first map. */
- mapno = 0;
- rest = maps[mapno];
+ rest = map;
/* Present the documented bindings, a line at a time. */
while (1)
{
bool notfirst = 0;
+ Lisp_Object menu_strings = prompt_strings;
ptrdiff_t i = nlength;
Lisp_Object obj;
Lisp_Object orig_defn_macro;
{
Lisp_Object elt;
- /* If reached end of map, start at beginning of next map. */
+ /* FIXME: Use map_keymap to handle new keymap formats. */
+
+ /* At end of map, wrap around if just starting,
+ or end this line if already have something on it. */
if (NILP (rest))
{
- mapno++;
- /* At end of last map, wrap around to first map if just starting,
- or end this line if already have something on it. */
- if (mapno == nmaps)
- {
- mapno = 0;
- if (notfirst || nobindings) break;
- }
- rest = maps[mapno];
+ if (notfirst || nobindings)
+ break;
+ else
+ rest = map;
}
/* Look at the next element of the map. */
/* Punctuate between strings. */
if (notfirst)
{
- strcpy (menu + i, ", ");
+ PUSH_C_STR (", ", menu_strings);
i += 2;
}
notfirst = 1;
{
/* Add as much of string as fits. */
thiswidth = min (SCHARS (desc), width - i);
- memcpy (menu + i, SDATA (desc), thiswidth);
+ menu_strings
+ = Fcons (Fsubstring (desc, make_number (0),
+ make_number (thiswidth)),
+ menu_strings);
i += thiswidth;
- strcpy (menu + i, " = ");
+ PUSH_C_STR (" = ", menu_strings);
i += 3;
}
/* Add as much of string as fits. */
thiswidth = min (SCHARS (s), width - i);
- memcpy (menu + i, SDATA (s), thiswidth);
+ menu_strings
+ = Fcons (Fsubstring (s, make_number (0),
+ make_number (thiswidth)),
+ menu_strings);
i += thiswidth;
- menu[i] = 0;
}
else
{
/* If this element does not fit, end the line now,
and save the element for the next line. */
- strcpy (menu + i, "...");
+ PUSH_C_STR ("...", menu_strings);
break;
}
}
}
/* Prompt with that and read response. */
- message2_nolog (menu, strlen (menu),
- ! NILP (BVAR (current_buffer, enable_multibyte_characters)));
+ message3_nolog (apply1 (intern ("concat"), Fnreverse (menu_strings)));
- /* Make believe its not a keyboard macro in case the help char
+ /* Make believe it's not a keyboard macro in case the help char
is pressed. Help characters are not recorded because menu prompting
- is not used on replay.
- */
+ is not used on replay. */
orig_defn_macro = KVAR (current_kboard, defining_kbd_macro);
kset_defining_kbd_macro (current_kboard, Qnil);
do
- obj = read_char (commandflag, 0, 0, Qt, 0, NULL);
+ obj = read_char (commandflag, Qnil, Qt, 0, NULL);
while (BUFFERP (obj));
kset_defining_kbd_macro (current_kboard, orig_defn_macro);
- if (!INTEGERP (obj))
- return obj;
- else if (XINT (obj) == -2)
+ if (!INTEGERP (obj) || XINT (obj) == -2)
return obj;
if (! EQ (obj, menu_prompt_more_char)
store_kbd_macro_char (obj);
return obj;
}
- /* Help char - go round again */
+ /* Help char - go round again. */
}
}
\f
/* Reading key sequences. */
-/* Follow KEY in the maps in CURRENT[0..NMAPS-1], placing its bindings
- in DEFS[0..NMAPS-1]. Set NEXT[i] to DEFS[i] if DEFS[i] is a
- keymap, or nil otherwise. Return the index of the first keymap in
- which KEY has any binding, or NMAPS if no map has a binding.
-
- If KEY is a meta ASCII character, treat it like meta-prefix-char
- followed by the corresponding non-meta character. Keymaps in
- CURRENT with non-prefix bindings for meta-prefix-char become nil in
- NEXT.
-
- If KEY has no bindings in any of the CURRENT maps, NEXT is left
- unmodified.
-
- NEXT may be the same array as CURRENT. */
-
-static int
-follow_key (Lisp_Object key, ptrdiff_t nmaps, Lisp_Object *current,
- Lisp_Object *defs, Lisp_Object *next)
+static Lisp_Object
+follow_key (Lisp_Object keymap, Lisp_Object key)
{
- ptrdiff_t i, first_binding;
-
- first_binding = nmaps;
- for (i = nmaps - 1; i >= 0; i--)
- {
- if (! NILP (current[i]))
- {
- defs[i] = access_keymap (current[i], key, 1, 0, 1);
- if (! NILP (defs[i]))
- first_binding = i;
- }
- else
- defs[i] = Qnil;
- }
-
- /* Given the set of bindings we've found, produce the next set of maps. */
- if (first_binding < nmaps)
- for (i = 0; i < nmaps; i++)
- next[i] = NILP (defs[i]) ? Qnil : get_keymap (defs[i], 0, 1);
+ return access_keymap (get_keymap (keymap, 0, 1),
+ key, 1, 0, 1);
+}
- return first_binding;
+static Lisp_Object
+active_maps (Lisp_Object first_event)
+{
+ Lisp_Object position = INTEGERP (first_event) ? Qnil : first_event;
+ return Fcons (Qkeymap, Fcurrent_active_maps (Qt, position));
}
/* Structure used to keep track of partial application of key remapping
static bool
test_undefined (Lisp_Object binding)
{
- return (EQ (binding, Qundefined)
- || (!NILP (binding) && SYMBOLP (binding)
+ return (NILP (binding)
+ || EQ (binding, Qundefined)
+ || (SYMBOLP (binding)
&& EQ (Fcommand_remapping (binding, Qnil, Qnil), Qundefined)));
}
bool dont_downcase_last, bool can_return_switch_frame,
bool fix_current_buffer)
{
- Lisp_Object from_string;
ptrdiff_t count = SPECPDL_INDEX ();
/* How many keys there are in the current key sequence. */
ptrdiff_t echo_start IF_LINT (= 0);
ptrdiff_t keys_start;
- /* The number of keymaps we're scanning right now, and the number of
- keymaps we have allocated space for. */
- ptrdiff_t nmaps;
- ptrdiff_t nmaps_allocated = 0;
-
- /* defs[0..nmaps-1] are the definitions of KEYBUF[0..t-1] in
- the current keymaps. */
- Lisp_Object *defs = NULL;
+ Lisp_Object current_binding = Qnil;
+ Lisp_Object first_event = Qnil;
- /* submaps[0..nmaps-1] are the prefix definitions of KEYBUF[0..t-1]
- in the current keymaps, or nil where it is not a prefix. */
- Lisp_Object *submaps = NULL;
-
- /* The local map to start out with at start of key sequence. */
- Lisp_Object orig_local_map;
-
- /* The map from the `keymap' property to start out with at start of
- key sequence. */
- Lisp_Object orig_keymap;
-
- /* Positive if we have already considered switching to the local-map property
- of the place where a mouse click occurred. */
- int localized_local_map = 0;
-
- /* The index in submaps[] of the first keymap that has a binding for
- this key sequence. In other words, the lowest i such that
- submaps[i] is non-nil. */
- ptrdiff_t first_binding;
/* Index of the first key that has no binding.
It is useless to try fkey.start larger than that. */
int first_unbound;
While we're reading, we keep the event here. */
Lisp_Object delayed_switch_frame;
- /* See the comment below... */
-#if defined (GOBBLE_FIRST_EVENT)
- Lisp_Object first_event;
-#endif
-
Lisp_Object original_uppercase IF_LINT (= Qnil);
int original_uppercase_position = -1;
/* List of events for which a fake prefix key has been generated. */
Lisp_Object fake_prefixed_keys = Qnil;
-#if defined (GOBBLE_FIRST_EVENT)
- int junk;
-#endif
-
struct gcpro gcpro1;
GCPRO1 (fake_prefixed_keys);
keys_start = this_command_key_count;
this_single_command_key_start = keys_start;
-#if defined (GOBBLE_FIRST_EVENT)
- /* This doesn't quite work, because some of the things that read_char
- does cannot safely be bypassed. It seems too risky to try to make
- this work right. */
-
- /* Read the first char of the sequence specially, before setting
- up any keymaps, in case a filter runs and switches buffers on us. */
- first_event = read_char (NILP (prompt), 0, submaps, last_nonmenu_event,
- &junk, NULL);
-#endif /* GOBBLE_FIRST_EVENT */
-
- orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
- orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
- from_string = Qnil;
-
/* We jump here when we need to reinitialize fkey and keytran; this
happens if we switch keyboards between rescans. */
replay_entire_sequence:
keybuf with its symbol, or if the sequence starts with a mouse
click and we need to switch buffers, we jump back here to rebuild
the initial keymaps from the current buffer. */
- nmaps = 0;
-
- if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
- {
- if (2 > nmaps_allocated)
- {
- submaps = alloca (2 * sizeof *submaps);
- defs = alloca (2 * sizeof *defs);
- nmaps_allocated = 2;
- }
- submaps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
- }
- else if (!NILP (Voverriding_local_map))
- {
- if (2 > nmaps_allocated)
- {
- submaps = alloca (2 * sizeof *submaps);
- defs = alloca (2 * sizeof *defs);
- nmaps_allocated = 2;
- }
- submaps[nmaps++] = Voverriding_local_map;
- }
- else
- {
- ptrdiff_t nminor;
- ptrdiff_t total;
- Lisp_Object *maps;
-
- nminor = current_minor_maps (0, &maps);
- total = nminor + (!NILP (orig_keymap) ? 3 : 2);
-
- if (total > nmaps_allocated)
- {
- submaps = alloca (total * sizeof *submaps);
- defs = alloca (total * sizeof *defs);
- nmaps_allocated = total;
- }
-
- if (!NILP (orig_keymap))
- submaps[nmaps++] = orig_keymap;
-
- memcpy (submaps + nmaps, maps, nminor * sizeof (submaps[0]));
-
- nmaps += nminor;
-
- submaps[nmaps++] = orig_local_map;
- }
- submaps[nmaps++] = current_global_map;
-
- /* Find an accurate initial value for first_binding. */
- for (first_binding = 0; first_binding < nmaps; first_binding++)
- if (! NILP (submaps[first_binding]))
- break;
+ current_binding = active_maps (first_event);
/* Start from the beginning in keybuf. */
t = 0;
/* If the best binding for the current key sequence is a keymap, or
we may be looking at a function key's escape sequence, keep on
reading. */
- while (first_binding < nmaps
+ while (!NILP (current_binding)
/* Keep reading as long as there's a prefix binding. */
- ? !NILP (submaps[first_binding])
+ ? KEYMAPP (current_binding)
/* Don't return in the middle of a possible function key sequence,
if the only bindings we found were via case conversion.
Thus, if ESC O a has a function-key-map translation
just one key. */
ptrdiff_t echo_local_start IF_LINT (= 0);
int keys_local_start;
- ptrdiff_t local_first_binding;
+ Lisp_Object new_binding;
eassert (indec.end == t || (indec.end > t && indec.end <= mock_input));
eassert (indec.start <= indec.end);
if (INTERACTIVE)
echo_local_start = echo_length ();
keys_local_start = this_command_key_count;
- local_first_binding = first_binding;
replay_key:
/* These are no-ops, unless we throw away a keystroke below and
if (INTERACTIVE && t < mock_input)
echo_truncate (echo_local_start);
this_command_key_count = keys_local_start;
- first_binding = local_first_binding;
/* By default, assume each event is "real". */
last_real_key_start = t;
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. */
{
KBOARD *interrupted_kboard = current_kboard;
struct frame *interrupted_frame = SELECTED_FRAME ();
- key = read_char (NILP (prompt), nmaps,
- (Lisp_Object *) submaps, last_nonmenu_event,
+ key = read_char (NILP (prompt),
+ current_binding, last_nonmenu_event,
&used_mouse_menu, NULL);
if ((INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
/* When switching to a new tty (with a new keyboard),
KVAR (interrupted_kboard, kbd_queue)));
}
mock_input = 0;
- orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
- orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
goto replay_entire_sequence;
}
}
{
if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
- if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
+ if (XBUFFER (XWINDOW (selected_window)->buffer)
+ != current_buffer)
Fset_buffer (XWINDOW (selected_window)->buffer);
}
- orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
- orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
goto replay_sequence;
}
keybuf[t++] = key;
mock_input = t;
Vquit_flag = Qnil;
- orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
- orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
goto replay_sequence;
}
}
}
+ if (NILP (first_event))
+ {
+ first_event = key;
+ /* Even if first_event does not specify a particular
+ window/position, it's important to recompute the maps here
+ since a long time might have passed since we entered
+ read_key_sequence, and a timer (or process-filter or
+ special-event-map, ...) might have switched the current buffer
+ or the selected window from under us in the mean time. */
+ if (fix_current_buffer
+ && (XBUFFER (XWINDOW (selected_window)->buffer)
+ != current_buffer))
+ Fset_buffer (XWINDOW (selected_window)->buffer);
+ current_binding = active_maps (first_event);
+ }
+
GROW_RAW_KEYBUF;
ASET (raw_keybuf, raw_keybuf_count, key);
raw_keybuf_count++;
or when user programs play with this-command-keys. */
if (EVENT_HAS_PARAMETERS (key))
{
- Lisp_Object kind;
- Lisp_Object string;
-
- kind = EVENT_HEAD_KIND (EVENT_HEAD (key));
+ Lisp_Object kind = EVENT_HEAD_KIND (EVENT_HEAD (key));
if (EQ (kind, Qmouse_click))
{
- Lisp_Object window, posn;
-
- window = POSN_WINDOW (EVENT_START (key));
- posn = POSN_POSN (EVENT_START (key));
+ Lisp_Object window = POSN_WINDOW (EVENT_START (key));
+ Lisp_Object posn = POSN_POSN (EVENT_START (key));
if (CONSP (posn)
|| (!NILP (fake_prefixed_keys)
if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
- orig_local_map = get_local_map (PT, current_buffer,
- Qlocal_map);
- orig_keymap = get_local_map (PT, current_buffer,
- Qkeymap);
goto replay_sequence;
}
-
- /* For a mouse click, get the local text-property keymap
- of the place clicked on, rather than point. */
- if (CONSP (XCDR (key))
- && ! localized_local_map)
- {
- Lisp_Object map_here, start, pos;
-
- localized_local_map = 1;
- start = EVENT_START (key);
-
- if (CONSP (start) && POSN_INBUFFER_P (start))
- {
- pos = POSN_BUFFER_POSN (start);
- if (INTEGERP (pos)
- && XINT (pos) >= BEGV
- && XINT (pos) <= ZV)
- {
- map_here = get_local_map (XINT (pos),
- current_buffer,
- Qlocal_map);
- if (!EQ (map_here, orig_local_map))
- {
- orig_local_map = map_here;
- ++localized_local_map;
- }
-
- map_here = get_local_map (XINT (pos),
- current_buffer,
- Qkeymap);
- if (!EQ (map_here, orig_keymap))
- {
- orig_keymap = map_here;
- ++localized_local_map;
- }
-
- if (localized_local_map > 1)
- {
- keybuf[t] = key;
- mock_input = t + 1;
-
- goto replay_sequence;
- }
- }
- }
- }
}
/* Expand mode-line and scroll-bar events into two events:
prevent proper action when the event is pushed
back into unread-command-events. */
fake_prefixed_keys = Fcons (key, fake_prefixed_keys);
-
- /* If on a mode line string with a local keymap,
- reconsider the key sequence with that keymap. */
- if (string = POSN_STRING (EVENT_START (key)),
- (CONSP (string) && STRINGP (XCAR (string))))
- {
- Lisp_Object pos, map, map2;
-
- pos = XCDR (string);
- string = XCAR (string);
- if (XINT (pos) >= 0
- && XINT (pos) < SCHARS (string))
- {
- map = Fget_text_property (pos, Qlocal_map, string);
- if (!NILP (map))
- orig_local_map = map;
- map2 = Fget_text_property (pos, Qkeymap, string);
- if (!NILP (map2))
- orig_keymap = map2;
- if (!NILP (map) || !NILP (map2))
- goto replay_sequence;
- }
- }
-
goto replay_key;
}
- else if (NILP (from_string)
- && (string = POSN_STRING (EVENT_START (key)),
- (CONSP (string) && STRINGP (XCAR (string)))))
- {
- /* For a click on a string, i.e. overlay string or a
- string displayed via the `display' property,
- consider `local-map' and `keymap' properties of
- that string. */
- Lisp_Object pos, map, map2;
-
- pos = XCDR (string);
- string = XCAR (string);
- if (XINT (pos) >= 0
- && XINT (pos) < SCHARS (string))
- {
- map = Fget_text_property (pos, Qlocal_map, string);
- if (!NILP (map))
- orig_local_map = map;
- map2 = Fget_text_property (pos, Qkeymap, string);
- if (!NILP (map2))
- orig_keymap = map2;
-
- if (!NILP (map) || !NILP (map2))
- {
- from_string = string;
- keybuf[t++] = key;
- mock_input = t;
- goto replay_sequence;
- }
- }
- }
}
else if (CONSP (XCDR (key))
&& CONSP (EVENT_START (key))
if (bufsize - t <= 1)
error ("Key sequence too long");
keybuf[t] = posn;
- keybuf[t+1] = key;
+ keybuf[t + 1] = key;
/* Zap the position in key, so we know that we've
expanded it, and don't try to do so again. */
/* We have finally decided that KEY is something we might want
to look up. */
- first_binding = (follow_key (key,
- nmaps - first_binding,
- submaps + first_binding,
- defs + first_binding,
- submaps + first_binding)
- + first_binding);
+ new_binding = follow_key (current_binding, key);
/* If KEY wasn't bound, we'll try some fallbacks. */
- if (first_binding < nmaps)
+ if (!NILP (new_binding))
/* This is needed for the following scenario:
event 0: a down-event that gets dropped by calling replay_key.
event 1: some normal prefix like C-h.
new_click
= Fcons (new_head, Fcons (EVENT_START (key), Qnil));
- /* Look for a binding for this new key. follow_key
- promises that it didn't munge submaps the
- last time we called it, since key was unbound. */
- first_binding
- = (follow_key (new_click,
- nmaps - local_first_binding,
- submaps + local_first_binding,
- defs + local_first_binding,
- submaps + local_first_binding)
- + local_first_binding);
+ /* Look for a binding for this new key. */
+ new_binding = follow_key (current_binding, new_click);
/* If that click is bound, go for it. */
- if (first_binding < nmaps)
+ if (!NILP (new_binding))
{
+ current_binding = new_binding;
key = new_click;
break;
}
}
}
}
+ current_binding = new_binding;
keybuf[t++] = key;
/* Normally, last_nonmenu_event gets the previous key we read.
}
}
- if (first_binding < nmaps
- && NILP (submaps[first_binding])
- && !test_undefined (defs[first_binding])
+ if (!KEYMAPP (current_binding)
+ && !test_undefined (current_binding)
&& indec.start >= t)
/* There is a binding and it's not a prefix.
(and it doesn't have any input-decode-map translation pending).
first_binding >= nmaps) we don't want
to apply this function-key-mapping. */
fkey.end + 1 == t
- && (first_binding >= nmaps
- || test_undefined (defs[first_binding])),
+ && (test_undefined (current_binding)),
&diff, prompt);
UNGCPRO;
if (done)
and cannot be part of a function key or translation,
and is an upper case letter
use the corresponding lower-case letter instead. */
- if (first_binding >= nmaps
+ if (NILP (current_binding)
&& /* indec.start >= t && fkey.start >= t && */ keytran.start >= t
&& INTEGERP (key)
&& ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK))
and cannot be part of a function key or translation,
and is a shifted function key,
use the corresponding unshifted function key instead. */
- if (first_binding >= nmaps
+ if (NILP (current_binding)
&& /* indec.start >= t && fkey.start >= t && */ keytran.start >= t)
{
Lisp_Object breakdown = parse_modifiers (key);
}
}
if (!dummyflag)
- read_key_sequence_cmd = (first_binding < nmaps
- ? defs[first_binding]
- : Qnil);
+ read_key_sequence_cmd = current_binding;
read_key_sequence_remapped
/* Remap command through active keymaps.
Do the remapping here, before the unbind_to so it uses the keymaps
/* Don't downcase the last character if the caller says don't.
Don't downcase it if the result is undefined, either. */
- if ((dont_downcase_last || first_binding >= nmaps)
+ if ((dont_downcase_last || NILP (current_binding))
&& t > 0
&& t - 1 == original_uppercase_position)
{
memset (keybuf, 0, sizeof keybuf);
GCPRO1 (keybuf[0]);
- gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0]));
+ gcpro1.nvars = (sizeof keybuf / sizeof (keybuf[0]));
if (NILP (continue_echo))
{
cancel_hourglass ();
#endif
- i = read_key_sequence (keybuf, (sizeof keybuf/sizeof (keybuf[0])),
+ i = read_key_sequence (keybuf, (sizeof keybuf / sizeof (keybuf[0])),
prompt, ! NILP (dont_downcase_last),
! NILP (can_return_switch_frame), 0);
doc: /* Execute CMD as an editor command.
CMD must be a symbol that satisfies the `commandp' predicate.
Optional second arg RECORD-FLAG non-nil
-means unconditionally put this command in `command-history'.
+means unconditionally put this command in the variable `command-history'.
Otherwise, that is done only if an arg is read using the minibuffer.
The argument KEYS specifies the value to use instead of (this-command-keys)
when reading the arguments; if it is nil, (this-command-keys) is used.
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);
to count as a drag. */);
double_click_fuzz = 3;
- DEFVAR_BOOL ("inhibit-local-menu-bar-menus", inhibit_local_menu_bar_menus,
- doc: /* Non-nil means inhibit local map menu bar menus. */);
- inhibit_local_menu_bar_menus = 0;
-
DEFVAR_INT ("num-input-keys", num_input_keys,
doc: /* Number of complete key sequences read as input so far.
This includes key sequences read from keyboard macros.
Vsaved_region_selection,
doc: /* Contents of active region prior to buffer modification.
If `select-active-regions' is non-nil, Emacs sets this to the
-text in the region before modifying the buffer. The next
-`deactivate-mark' call uses this to set the window selection. */);
+text in the region before modifying the buffer. The next call to
+the function `deactivate-mark' uses this to set the window selection. */);
Vsaved_region_selection = Qnil;
DEFVAR_LISP ("selection-inhibit-update-commands",
"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);
}
}
}
extern Lisp_Object parse_modifiers (Lisp_Object);
extern Lisp_Object reorder_modifiers (Lisp_Object);
-extern Lisp_Object read_char (int, ptrdiff_t, Lisp_Object *, Lisp_Object,
+extern Lisp_Object read_char (int, Lisp_Object, Lisp_Object,
bool *, EMACS_TIME *);
extern int parse_solitary_modifier (Lisp_Object symbol);
{
if (!NILP (val))
{
- map_keymap_function_t fun
- = (map_keymap_function_t) XSAVE_VALUE (XCAR (args))->pointer;
- args = XCDR (args);
+ map_keymap_function_t fun = XSAVE_POINTER (args, 0);
/* If the key is a range, make a copy since map_char_table modifies
it in place. */
if (CONSP (key))
key = Fcons (XCAR (key), XCDR (key));
- map_keymap_item (fun, XCDR (args), key, val,
- XSAVE_VALUE (XCAR (args))->pointer);
+ map_keymap_item (fun, XSAVE_OBJECT (args, 2), key,
+ val, XSAVE_POINTER (args, 1));
}
}
}
}
else if (CHAR_TABLE_P (binding))
- {
- map_char_table (map_keymap_char_table_item, Qnil, binding,
- Fcons (make_save_value ((void *) fun, 0),
- Fcons (make_save_value (data, 0),
- args)));
- }
+ map_char_table (map_keymap_char_table_item, Qnil, binding,
+ make_save_value ("ppo", fun, data, args));
}
UNGCPRO;
return tail;
return INTEGERP (command) ? Qnil : command;
}
-/* Value is number if KEY is too long; nil if valid but has no definition. */
+/* Value is number if KEY is too long; nil if valid but has no definition. */
/* GC is possible in this function. */
DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0,
doc: /* Return a list of the currently active keymaps.
OLP if non-nil indicates that we should obey `overriding-local-map' and
`overriding-terminal-local-map'. POSITION can specify a click position
-like in the respective argument of `key-binding'. */)
+like in the respective argument of `key-binding'. */)
(Lisp_Object olp, Lisp_Object position)
{
ptrdiff_t count = SPECPDL_INDEX ();
/* If a mouse click position is given, our variables are based on
the buffer clicked on, not the current buffer. So we may have to
- switch the buffer here. */
+ switch the buffer here. */
if (CONSP (position))
{
#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,
/* Lisp integers use 2 tags, to give them one extra bit, thus
extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */
-static EMACS_INT const INTMASK = EMACS_INT_MAX >> (INTTYPEBITS - 1);
+#define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1))
#define case_Lisp_Int case Lisp_Int0: case Lisp_Int1
#define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0)
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;
+}
+
+/* Hash X, returning a value that fits into a fixnum. */
+
+LISP_INLINE EMACS_UINT
+SXHASH_REDUCE (EMACS_UINT x)
+{
+ return (x ^ x >> (BITS_PER_EMACS_INT - FIXNUM_BITS)) & INTMASK;
+}
+
/* These structures are used for various misc types. */
struct Lisp_Misc_Any /* Supertype of all Misc types. */
Lisp_Object plist;
};
-/* Hold a C pointer for later use.
- This type of object is used in the arg to record_unwind_protect. */
+/* Types of data which may be saved in a Lisp_Save_Value. */
+
+enum
+ {
+ SAVE_UNUSED,
+ SAVE_INTEGER,
+ SAVE_POINTER,
+ SAVE_OBJECT
+ };
+
+/* Special object used to hold a different values for later use.
+
+ This is mostly used to package C integers and pointers to call
+ record_unwind_protect. Typical task is to pass just one C pointer
+ to unwind function. You should pack pointer with make_save_pointer
+ and then get it back with XSAVE_POINTER, e.g.:
+
+ ...
+ struct my_data *md = get_my_data ();
+ record_unwind_protect (my_unwind, make_save_pointer (md));
+ ...
+
+ Lisp_Object my_unwind (Lisp_Object arg)
+ {
+ struct my_data *md = XSAVE_POINTER (arg, 0);
+ ...
+ }
+
+ If yon need to pass more than just one C pointer, you should
+ use make_save_value. This function allows you to pack up to
+ 4 integers, pointers or Lisp_Objects and conveniently get them
+ back with XSAVE_POINTER, XSAVE_INTEGER and XSAVE_OBJECT macros:
+
+ ...
+ struct my_data *md = get_my_data ();
+ ptrdiff_t my_offset = get_my_offset ();
+ Lisp_Object my_object = get_my_object ();
+ record_unwind_protect
+ (my_unwind, make_save_value ("pio", md, my_offset, my_object));
+ ...
+
+ Lisp_Object my_unwind (Lisp_Object arg)
+ {
+ struct my_data *md = XSAVE_POINTER (arg, 0);
+ ptrdiff_t my_offset = XSAVE_INTEGER (arg, 1);
+ Lisp_Object my_object = XSAVE_OBJECT (arg, 2);
+ ...
+ }
+
+ If ENABLE_CHECKING is in effect, XSAVE_xxx macros do type checking of the
+ saved objects and raise eassert if type of the saved object doesn't match
+ the type which is extracted. In the example above, XSAVE_INTEGER (arg, 2)
+ or XSAVE_OBJECT (arg, 1) are wrong because integer was saved in slot 1 and
+ Lisp_Object was saved in slot 2 of ARG. */
+
struct Lisp_Save_Value
{
ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */
unsigned gcmarkbit : 1;
- int spacer : 14;
- /* If DOGC is set, POINTER is the address of a memory
- area containing INTEGER potential Lisp_Objects. */
- unsigned int dogc : 1;
- void *pointer;
- ptrdiff_t integer;
+ int spacer : 6;
+ /* If `area' is nonzero, `data[0].pointer' is the address of a memory area
+ containing `data[1].integer' potential Lisp_Objects. The rest of `data'
+ fields are unused. */
+ unsigned area : 1;
+ /* If `area' is zero, `data[N]' may hold different objects which type is
+ encoded in `typeN' fields as described by the anonymous enum above.
+ E.g. if `type0' is SAVE_INTEGER, `data[0].integer' is in use. */
+ unsigned type0 : 2;
+ unsigned type1 : 2;
+ unsigned type2 : 2;
+ unsigned type3 : 2;
+ union {
+ void *pointer;
+ ptrdiff_t integer;
+ Lisp_Object object;
+ } data[4];
};
+/* Macro to set and extract Nth saved pointer. Type
+ checking is ugly because it's used as an lvalue. */
+
+#define XSAVE_POINTER(obj, n) \
+ XSAVE_VALUE (obj)->data[(eassert (XSAVE_VALUE (obj)->type \
+ ## n == SAVE_POINTER), n)].pointer
+
+/* Likewise for the saved integer. */
+
+#define XSAVE_INTEGER(obj, n) \
+ XSAVE_VALUE (obj)->data[(eassert (XSAVE_VALUE (obj)->type \
+ ## n == SAVE_INTEGER), n)].integer
+
+/* Macro to extract Nth saved object. This is never used as
+ an lvalue, so we can do more convenient type checking. */
+
+#define XSAVE_OBJECT(obj, n) \
+ (eassert (XSAVE_VALUE (obj)->type ## n == SAVE_OBJECT), \
+ XSAVE_VALUE (obj)->data[n].object)
/* A miscellaneous object, when it's on the free list. */
struct Lisp_Free
{
enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */
int offset;
- Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */
+ /* One of Qnil, Qintegerp, Qsymbolp, Qstringp, Qfloatp or Qnumberp. */
+ Lisp_Object predicate;
};
/* struct Lisp_Buffer_Local_Value is used in a symbol value cell when
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
2 Mark the stack, and check that everything GCPRO'd is
marked.
3 Mark using GCPRO's, mark stack last, and count how many
- dead objects are kept alive. */
+ dead objects are kept alive.
+ Formerly, method 0 was used. Currently, method 1 is used unless
+ otherwise specified by hand when building, e.g.,
+ "make CPPFLAGS='-DGC_MARK_STACK=GC_USE_GCPROS_AS_BEFORE'".
+ Methods 2 and 3 are present mainly to debug the transition from 0 to 1. */
#define GC_USE_GCPROS_AS_BEFORE 0
#define GC_MAKE_GCPROS_NOOPS 1
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);
/* Defined in insdel.c. */
extern Lisp_Object Qinhibit_modification_hooks;
-extern void move_gap (ptrdiff_t);
extern void move_gap_both (ptrdiff_t, ptrdiff_t);
extern _Noreturn void buffer_overflow (void);
extern void make_gap (ptrdiff_t);
+extern void make_gap_1 (struct buffer *, ptrdiff_t);
extern ptrdiff_t copy_text (const unsigned char *, unsigned char *,
ptrdiff_t, bool, bool);
extern int count_combining_before (const unsigned char *,
ptrdiff_t, ptrdiff_t, ptrdiff_t);
extern void insert (const char *, ptrdiff_t);
extern void insert_and_inherit (const char *, ptrdiff_t);
-extern void insert_1 (const char *, ptrdiff_t, bool, bool, bool);
extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t,
bool, bool, bool);
extern void insert_from_gap (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 void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
extern void message1 (const char *);
extern void message1_nolog (const char *);
-extern void message2 (const char *, ptrdiff_t, int);
-extern void message2_nolog (const char *, ptrdiff_t, int);
-extern void message3 (Lisp_Object, ptrdiff_t, int);
-extern void message3_nolog (Lisp_Object, ptrdiff_t, int);
+extern void message3 (Lisp_Object);
+extern void message3_nolog (Lisp_Object);
extern void message_dolog (const char *, ptrdiff_t, int, int);
extern void message_with_string (const char *, Lisp_Object, int);
extern void message_log_maybe_newline (void);
/* Defined in alloc.c. */
extern void check_pure_size (void);
+extern void free_misc (Lisp_Object);
extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT);
extern void malloc_warning (const char *);
extern _Noreturn void memory_full (size_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);
+
+/* Make an unitialized vector for SIZE objects. NOTE: you must
+ be sure that GC cannot happen until the vector is completely
+ initialized. E.g. the following code is likely to crash:
+
+ v = make_uninit_vector (3);
+ ASET (v, 0, obj0);
+ ASET (v, 1, Ffunction_can_gc ());
+ ASET (v, 2, obj1); */
+
+LISP_INLINE Lisp_Object
+make_uninit_vector (ptrdiff_t size)
+{
+ Lisp_Object v;
+ struct Lisp_Vector *p;
+
+ p = allocate_vector (size);
+ XSETVECTOR (v, p);
+ return v;
+}
+
+extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type);
#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \
((typ*) \
allocate_pseudovector \
extern Lisp_Object make_float (double);
extern void display_malloc_warning (void);
extern ptrdiff_t inhibit_garbage_collection (void);
-extern Lisp_Object make_save_value (void *, ptrdiff_t);
+extern Lisp_Object make_save_value (const char *, ...);
+extern Lisp_Object make_save_pointer (void *);
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 Lisp_Object emacs_readlinkat (int, const char *);
+extern bool file_directory_p (const char *);
+extern bool file_accessible_directory_p (const char *);
+extern void init_fileio (void);
extern void syms_of_fileio (void);
extern Lisp_Object make_temp_name (Lisp_Object, bool);
extern Lisp_Object Qdelete_file;
extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t, Lisp_Object);
-extern ptrdiff_t scan_buffer (int, ptrdiff_t, ptrdiff_t, ptrdiff_t,
- ptrdiff_t *, bool);
+extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t,
+ ptrdiff_t *, bool);
extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
EMACS_INT, bool);
extern ptrdiff_t find_next_newline (ptrdiff_t, int);
#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 void sys_subshell (void);
extern void sys_suspend (void);
extern void discard_tty_input (void);
+extern void block_tty_out_signal (void);
+extern void unblock_tty_out_signal (void);
extern void init_sys_modes (struct tty_display_info *);
extern void reset_sys_modes (struct tty_display_info *);
extern void init_all_sys_modes (void);
extern int emacs_close (int);
extern ptrdiff_t emacs_read (int, char *, ptrdiff_t);
extern ptrdiff_t emacs_write (int, const char *, ptrdiff_t);
-enum { READLINK_BUFSIZE = 1024 };
-extern char *emacs_readlink (const char *, char [READLINK_BUFSIZE]);
extern void unlock_all_files (void);
extern void lock_file (Lisp_Object);
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 *);
/* Set up the name of the machine we're running on. */
extern void init_system_name (void);
-/* We used to use `abs', but that clashes with system headers on some
- platforms, and using a name reserved by Standard C is a bad idea
- anyway. */
-#if !defined (eabs)
+/* Return the absolute value of X. X should be a signed integer
+ expression without side effects, and X's absolute value should not
+ exceed the maximum for its promoted type. This is called 'eabs'
+ because 'abs' is reserved by the C standard. */
#define eabs(x) ((x) < 0 ? -(x) : (x))
-#endif
/* Return a fixnum or float, depending on whether VAL fits in a Lisp
fixnum. */
NITEMS items, each of the same type as *BUF. MULTIPLIER must
positive. The code is tuned for MULTIPLIER being a constant. */
-#define SAFE_NALLOCA(buf, multiplier, nitems) \
- do { \
- if ((nitems) <= MAX_ALLOCA / sizeof *(buf) / (multiplier)) \
- (buf) = alloca (sizeof *(buf) * (multiplier) * (nitems)); \
- else \
+#define SAFE_NALLOCA(buf, multiplier, nitems) \
+ do { \
+ if ((nitems) <= MAX_ALLOCA / sizeof *(buf) / (multiplier)) \
+ (buf) = alloca (sizeof *(buf) * (multiplier) * (nitems)); \
+ else \
{ \
(buf) = xnmalloc (nitems, sizeof *(buf) * (multiplier)); \
sa_must_free = 1; \
record_unwind_protect (safe_alloca_unwind, \
- make_save_value (buf, 0)); \
+ make_save_pointer (buf)); \
} \
} while (0)
{ \
Lisp_Object arg_; \
buf = xmalloc ((nelt) * word_size); \
- arg_ = make_save_value (buf, nelt); \
- XSAVE_VALUE (arg_)->dogc = 1; \
+ arg_ = make_save_value ("pi", buf, nelt); \
+ XSAVE_VALUE (arg_)->area = 1; \
sa_must_free = 1; \
record_unwind_protect (safe_alloca_unwind, arg_); \
} \
It must be set to nil before all top-level calls to read0. */
static Lisp_Object read_objects;
-/* True means READCHAR should read bytes one by one (not character)
- when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char.
- This is set by read1 temporarily while handling #@NUMBER. */
-static bool load_each_byte;
-
/* List of descriptors now open for Fload. */
static Lisp_Object load_descriptor_list;
return c;
}
c = (*readbyte) (-1, readcharfun);
- if (c < 0 || load_each_byte)
+ if (c < 0)
return c;
if (multibyte)
*multibyte = 1;
return STRING_CHAR (buf);
}
+static void
+skip_dyn_bytes (Lisp_Object readcharfun, ptrdiff_t n)
+{
+ if (EQ (readcharfun, Qget_file_char)
+ || EQ (readcharfun, Qget_emacs_mule_file_char))
+ {
+ block_input (); /* FIXME: Not sure if it's needed. */
+ fseek (instream, n, SEEK_CUR);
+ unblock_input ();
+ }
+ else
+ { /* We're not reading directly from a file. In that case, it's difficult
+ to reliably count bytes, since these are usually meant for the file's
+ encoding, whereas we're now typically in the internal encoding.
+ But luckily, skip_dyn_bytes is used to skip over a single
+ dynamic-docstring (or dynamic byte-code) which is always quoted such
+ that \037 is the final char. */
+ int c;
+ do {
+ c = READCHAR;
+ } while (c >= 0 && c != '\037');
+ }
+}
+
/* Unread the character C in the way appropriate for the stream READCHARFUN.
If the stream is a user function, call it with the char as argument. */
else if (EQ (readcharfun, Qget_file_char)
|| EQ (readcharfun, Qget_emacs_mule_file_char))
{
- if (load_each_byte)
- {
- block_input ();
- ungetc (c, instream);
- unblock_input ();
- }
- else
- unread_char = c;
+ unread_char = c;
}
else
call1 (readcharfun, make_number (c));
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 ();
end_time = add_emacs_time (current_emacs_time (), wait_time);
}
-/* Read until we get an acceptable event. */
+ /* Read until we get an acceptable event. */
retry:
do
- val = read_char (0, 0, 0, (input_method ? Qnil : Qt), 0,
+ val = read_char (0, Qnil, (input_method ? Qnil : Qt), 0,
NUMBERP (seconds) ? &end_time : NULL);
while (INTEGERP (val) && XINT (val) == -2); /* wrong_kboard_jmpbuf */
if (BUFFERP (val))
goto retry;
- /* switch-frame events are put off until after the next ASCII
+ /* `switch-frame' events are put off until after the next ASCII
character. This is better than signaling an error just because
the last characters were typed to a separate minibuffer frame,
for example. Eventually, some code which can deal with
message_with_string ("Loading %s...", file, 1);
}
- record_unwind_protect (load_unwind, make_save_value (stream, 0));
+ record_unwind_protect (load_unwind, make_save_pointer (stream));
record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
specbind (Qload_file_name, found);
specbind (Qinhibit_file_name_operation, Qnil);
static Lisp_Object
load_unwind (Lisp_Object arg) /* Used as unwind-protect function in load. */
{
- FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
+ FILE *stream = XSAVE_POINTER (arg, 0);
if (stream != NULL)
{
block_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)
bool multibyte;
*pch = 0;
- load_each_byte = 0;
retry:
return tmp;
}
- /* #@NUMBER is used to skip NUMBER following characters.
+ /* #@NUMBER is used to skip NUMBER following bytes.
That's used in .elc files to skip over doc strings
and function definitions. */
if (c == '@')
enum { extra = 100 };
ptrdiff_t i, nskip = 0;
- load_each_byte = 1;
/* Read a decimal integer. */
while ((c = READCHAR) >= 0
&& c >= '0' && c <= '9')
nskip *= 10;
nskip += c - '0';
}
- UNREAD (c);
-
+ if (nskip > 0)
+ /* We can't use UNREAD here, because in the code below we side-step
+ READCHAR. Instead, assume the first char after #@NNN occupies
+ a single byte, which is the case normally since it's just
+ a space. */
+ nskip--;
+ else
+ UNREAD (c);
+
if (load_force_doc_strings
&& (EQ (readcharfun, Qget_file_char)
|| EQ (readcharfun, Qget_emacs_mule_file_char)))
saved_doc_string_position = file_tell (instream);
/* Copy that many characters into saved_doc_string. */
+ block_input ();
for (i = 0; i < nskip && c >= 0; i++)
- saved_doc_string[i] = c = READCHAR;
+ saved_doc_string[i] = c = getc (instream);
+ unblock_input ();
saved_doc_string_length = i;
}
else
- {
- /* Skip that many characters. */
- for (i = 0; i < nskip && c >= 0; i++)
- c = READCHAR;
- }
+ /* Skip that many bytes. */
+ skip_dyn_bytes (readcharfun, nskip);
- load_each_byte = 0;
goto retry;
}
if (c == '!')
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 \
+ $(GNU_LIB)/allocator.h \
$(BUFFER_H) \
+ $(CAREADLINKAT_H) \
$(CHARACTER_H) \
$(CODING_H) \
$(CONFIG_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 \
$(NT_INC)/sys/file.h \
$(NT_INC)/sys/stat.h \
$(NT_INC)/unistd.h \
- $(GNU_LIB)/allocator.h \
$(GNU_LIB)/execinfo.h \
$(GNU_LIB)/ignore-value.h \
$(GNU_LIB)/utimens.h \
- $(CAREADLINKAT_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(DISPEXTERN_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);
{
register ptrdiff_t charpos, bytepos;
- CHECK_NUMBER_COERCE_MARKER (position);
- charpos = clip_to_bounds (restricted ? BUF_BEGV (b) : BUF_BEG (b),
- XINT (position),
- restricted ? BUF_ZV (b) : BUF_Z (b));
- bytepos = buf_charpos_to_bytepos (b, charpos);
+ /* Do not use CHECK_NUMBER_COERCE_MARKER because we
+ don't want to call buf_charpos_to_bytepos if POSTION
+ is a marker and so we know the bytepos already. */
+ if (INTEGERP (position))
+ charpos = XINT (position), bytepos = -1;
+ else if (MARKERP (position))
+ {
+ charpos = XMARKER (position)->charpos;
+ bytepos = XMARKER (position)->bytepos;
+ }
+ else
+ wrong_type_argument (Qinteger_or_marker_p, position);
+
+ charpos = clip_to_bounds
+ (restricted ? BUF_BEGV (b) : BUF_BEG (b), charpos,
+ restricted ? BUF_ZV (b) : BUF_Z (b));
+ if (bytepos == -1)
+ bytepos = buf_charpos_to_bytepos (b, charpos);
+ else
+ bytepos = clip_to_bounds
+ (restricted ? BUF_BEGV_BYTE (b) : BUF_BEG_BYTE (b),
+ bytepos, restricted ? BUF_ZV_BYTE (b) : BUF_Z_BYTE (b));
+
attach_marker (m, b, charpos, bytepos);
}
return marker;
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 =
/* Destructively turn backslashes into slashes. */
void
-dostounix_filename (char *p)
+dostounix_filename (char *p, int ignore)
{
msdos_downcase_filename (p);
if (!s) s = "c:/command.com";
t = alloca (strlen (s) + 1);
strcpy (t, s);
- dostounix_filename (t);
+ dostounix_filename (t, 0);
setenv ("SHELL", t, 0);
/* PATH is also downcased and backslashes mirrored. */
/* Current directory is always considered part of MsDos's path but it is
not normally mentioned. Now it is. */
strcat (strcpy (t, ".;"), s);
- dostounix_filename (t); /* Not a single file name, but this should work. */
+ dostounix_filename (t, 0); /* Not a single file name, but this should work. */
setenv ("PATH", t, 1);
/* In some sense all dos users have root privileges, so... */
/*
* 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
return buffer;
}
-ssize_t
-careadlinkatcwd (int fd, char const *filename, char *buffer,
- size_t buffer_size)
-{
- (void) fd;
- return readlink (filename, buffer, buffer_size);
-}
-
\f
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
int getdefdir (int, char*);
void unixtodos_filename (char *);
-void dostounix_filename (char *);
+void dostounix_filename (char *, int);
char *rootrelativepath (char *);
void init_environment (int, char **, int);
void internal_terminal_init (void);
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 LCD_SMOOTHING_MARGIN 2
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;
static void
ns_escape_name (char *name)
{
- int i =0, len =strlen (name);
- for ( ; i<len; i++)
- if (name[i] == ' ')
- name[i] = '_';
+ for (; *name; name++)
+ if (*name == ' ')
+ *name = '_';
}
static void
ns_unescape_name (char *name)
{
- int i =0, len =strlen (name);
- for ( ; i<len; i++)
- if (name[i] == '_')
- name[i] = ' ';
+ for (; *name; name++)
+ if (*name == '_')
+ *name = ' ';
}
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)));*/
while CONSP (rts)
{
r = XCAR (XCAR (rts));
- if (!strncmp(SSDATA(r), reg, strlen(SSDATA(r))))
+ if (!strncmp (SSDATA (r), reg, SBYTES (r)))
{
script = XCDR (XCAR (rts));
return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (script))];
NSSet *cFamilies;
BOOL foundItal = NO;
+ block_input ();
if (NSFONT_TRACE)
{
fprintf (stderr, "nsfont: %s for fontspec:\n ",
[fkeys removeObject: NSFontFamilyAttribute];
matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys];
+
if (NSFONT_TRACE)
NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc,
[matchingDescs count]);
[s1 release];
}
+ unblock_input ();
+
/* Return something if was a match and nothing found. */
if (isMatch)
return ns_fallback_entity ();
nsfont_list_family (Lisp_Object frame)
{
Lisp_Object list = Qnil;
- NSEnumerator *families =
- [[[NSFontManager sharedFontManager] availableFontFamilies]
- objectEnumerator];
+ NSEnumerator *families;
NSString *family;
+
+ block_input ();
+ families = [[[NSFontManager sharedFontManager] availableFontFamilies]
+ objectEnumerator];
while ((family = [families nextObject]))
list = Fcons (intern ([family UTF8String]), list);
/* FIXME: escape the name? */
fprintf (stderr, "nsfont: list families returning %"pI"d entries\n",
XINT (Flength (list)));
+ unblock_input ();
return list;
}
Lisp_Object font_object;
int fixLeopardBug;
+ block_input ();
+
if (NSFONT_TRACE)
{
fprintf (stderr, "nsfont: open size %d of fontentity:\n ", pixel_size);
font_info = (struct nsfont_info *) XFONT_OBJECT (font_object);
font = (struct font *) font_info;
if (!font)
- return Qnil; /* FIXME: other terms do, but return Qnil causes segfault */
+ {
+ unblock_input ();
+ return Qnil; /* FIXME: other terms do, but return Qnil causes segfault */
+ }
font_info->glyphs = xzalloc (0x100 * sizeof *font_info->glyphs);
font_info->metrics = xzalloc (0x100 * sizeof *font_info->metrics);
- block_input ();
-
/* for metrics */
#ifdef NS_IMPL_COCOA
sfont = [nsfont screenFontWithRenderingMode:
char isComposite = s->first_glyph->type == COMPOSITE_GLYPH;
int end = isComposite ? s->cmp_to : s->nchars;
+ block_input ();
/* Select face based on input flags */
switch (ns_tmp_flags)
{
/* Draw underline, overline, strike-through. */
ns_draw_text_decoration (s, face, col, r.size.width, r.origin.x);
+ unblock_input ();
return to-from;
}
{
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");
FRAME_TOOLBAR_HEIGHT (f) =
NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
- FRAME_NS_TITLEBAR_HEIGHT (f);
+ if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen.
+ FRAME_TOOLBAR_HEIGHT (f) = 0;
unblock_input ();
}
static Lisp_Object
pop_down_menu (Lisp_Object arg)
{
- struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
- struct Popdown_data *unwind_data = (struct Popdown_data *) p->pointer;
+ struct Popdown_data *unwind_data = XSAVE_POINTER (arg, 0);
block_input ();
if (popup_activated_flag)
unwind_data->pool = pool;
unwind_data->dialog = dialog;
- record_unwind_protect (pop_down_menu, make_save_value (unwind_data, 0));
+ record_unwind_protect (pop_down_menu, make_save_pointer (unwind_data));
popup_activated_flag = 1;
tem = [dialog runDialogAt: p];
unbind_to (specpdl_count, Qnil); /* calls pop_down_menu */
if (size == 1)
return clean_local_selection_data (AREF (obj, 0));
- copy = Fmake_vector (make_number (size), Qnil);
+ copy = make_uninit_vector (size);
for (i = 0; i < size; i++)
ASET (copy, i, clean_local_selection_data (AREF (obj, i)));
return copy;
#ifndef MAC_OS_X_VERSION_10_8
#define MAC_OS_X_VERSION_10_8 1080
#endif
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+#define HAVE_NATIVE_FS
+#endif
+
#endif /* NS_IMPL_COCOA */
#ifdef __OBJC__
int tibar_height, tobar_height, bwidth;
int maximized_width, maximized_height;
NSWindow *nonfs_window;
+ BOOL fs_is_native;
@public
struct frame *emacsframe;
int rows, cols;
- (void) handleFS;
- (void) setFSValue: (int)value;
- (void) toggleFullScreen: (id) sender;
+- (BOOL) fsIsNative;
+- (BOOL) isFullscreen;
+#ifdef HAVE_NATIVE_FS
+- (void) updateCollectionBehaviour;
+#endif
#ifdef NS_IMPL_GNUSTEP
/* Not declared, but useful. */
/* this dummy decl needed to support TTYs */
struct x_output
{
- unsigned long background_pixel;
- unsigned long foreground_pixel;
+ int unused;
};
#define FRAME_FONT(f) ((f)->output_data.ns->font)
#ifdef __OBJC__
-#define XNS_SCROLL_BAR(vec) ((id) XSAVE_VALUE (vec)->pointer)
+#define XNS_SCROLL_BAR(vec) ((id) XSAVE_POINTER (vec, 0))
#else
-#define XNS_SCROLL_BAR(vec) XSAVE_VALUE (vec)->pointer
+#define XNS_SCROLL_BAR(vec) XSAVE_POINTER (vec, 0)
#endif
/* Compute pixel size for vertical scroll bars */
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"
#define NSTRACE(x)
#endif
-#if defined (NS_IMPL_COCOA) && \
- MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
-#define NEW_STYLE_FS
-#endif
-
extern NSString *NSMenuDidBeginTrackingNotification;
/* ==========================================================================
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 */
};
static NSMutableArray *ns_pending_files, *ns_pending_service_names,
*ns_pending_service_args;
static BOOL ns_do_open_file = NO;
+static BOOL ns_last_use_native_fullscreen;
static struct {
struct input_event *q;
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;
}
NSView *view = FRAME_NS_VIEW (f);
check_ns ();
block_input ();
- FRAME_SAMPLE_VISIBILITY (f);
if (FRAME_VISIBLE_P (f))
- {
- [[view window] makeKeyAndOrderFront: NSApp];
- }
+ [[view window] makeKeyAndOrderFront: NSApp];
unblock_input ();
}
if (!FRAME_VISIBLE_P (f))
{
EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f);
- f->async_visible = 1;
+
+ SET_FRAME_VISIBLE (f, 1);
ns_raise_frame (f);
-#ifdef NEW_STYLE_FS
/* Making a new frame from a fullscreen frame will make the new frame
fullscreen also. So skip handleFS as this will print an error. */
- if (f->want_fullscreen == FULLSCREEN_BOTH
- && ([[view window] styleMask] & NSFullScreenWindowMask) != 0)
+ if ([view fsIsNative] && f->want_fullscreen == FULLSCREEN_BOTH
+ && [view isFullscreen])
return;
-#endif
+
if (f->want_fullscreen != FULLSCREEN_NONE)
{
block_input ();
NSTRACE (x_make_frame_invisible);
check_ns ();
[[view window] orderOut: NSApp];
- f->async_visible = 0;
- f->async_iconified = 0;
+ SET_FRAME_VISIBLE (f, 0);
+ SET_FRAME_ICONIFIED (f, 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_window = Qnil;
- hlinfo->mouse_face_deferred_gc = 0;
hlinfo->mouse_face_mouse_frame = 0;
}
pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
/* If we have a toolbar, take its height into account. */
- if (tb)
+ if (tb && ! [view isFullscreen])
/* NOTE: previously this would generate wrong result if toolbar not
yet displayed and fixing toolbar_height=32 helped, but
now (200903) seems no longer needed */
FRAME_TOOLBAR_HEIGHT (f) = 0;
wr.size.width = pixelwidth + f->border_width;
- wr.size.height = pixelheight + FRAME_NS_TITLEBAR_HEIGHT (f)
- + FRAME_TOOLBAR_HEIGHT (f);
+ wr.size.height = pixelheight;
+ if (! [view isFullscreen])
+ wr.size.height += FRAME_NS_TITLEBAR_HEIGHT (f)
+ + FRAME_TOOLBAR_HEIGHT (f);
/* Do not try to constrain to this screen. We may have multiple
screens, and want Emacs to span those. Constraining to screen
{
EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f);
- if (! f->async_visible) return;
-#ifndef NEW_STYLE_FS
- if (f->want_fullscreen == FULLSCREEN_BOTH)
+ if (!FRAME_VISIBLE_P (f))
+ return;
+
+ if (! [view fsIsNative] && f->want_fullscreen == FULLSCREEN_BOTH)
{
/* Old style fs don't initiate correctly if created from
init/default-frame alist, so use a timer (not nice...).
userInfo: nil repeats: NO];
return;
}
-#endif
block_input ();
[view handleFS];
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 ();
+ }
}
}
}
}
+#ifdef HAVE_NATIVE_FS
+static void
+check_native_fs ()
+{
+ Lisp_Object frame, tail;
+
+ if (ns_last_use_native_fullscreen == ns_use_native_fullscreen)
+ return;
+
+ ns_last_use_native_fullscreen = ns_use_native_fullscreen;
+
+ /* Clear the mouse-moved flag for every frame on this display. */
+ FOR_EACH_FRAME (tail, frame)
+ {
+ struct frame *f = XFRAME (frame);
+ if (FRAME_NS_P (f))
+ {
+ EmacsView *view = FRAME_NS_VIEW (f);
+ [view updateCollectionBehaviour];
+ }
+ }
+}
+#endif
+
static int
ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
/* --------------------------------------------------------------------------
/* NSTRACE (ns_read_socket); */
+#ifdef HAVE_NATIVE_FS
+ check_native_fs ();
+#endif
+
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)
+#ifdef HAVE_NATIVE_FS
+ check_native_fs ();
+#endif
+
+ 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 ();
}
bar = [[EmacsScroller alloc] initFrame: r window: win];
- wset_vertical_scroll_bar (window, make_save_value (bar, 0));
+ wset_vertical_scroll_bar (window, make_save_pointer (bar));
}
else
{
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))
NSColorPboardType,
NSFontPboardType, nil] retain];
-#ifndef NEW_STYLE_FS
/* If fullscreen is in init/default-frame-alist, focus isn't set
right for fullscreen windows, so set this. */
[NSApp activateIgnoringOtherApps:YES];
-#endif
[NSApp run];
ns_do_open_file = YES;
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;
emacs_event->code = code;
EV_TRAILER (theEvent);
+ processingCompose = NO;
return;
}
}
if (NS_KEYLOG)
NSLog (@"doCommandBySelector: %@", NSStringFromSelector (aSelector));
+ processingCompose = NO;
if (aSelector == @selector (deleteBackward:))
{
/* happens when user backspaces over an ongoing composition:
{
NSWindow *window = [self window];
NSRect wr = [window frame];
-#ifdef NS_IMPL_GNUSTEP
- int extra = 3;
-#else
int extra = 0;
+ int gsextra = 0;
+#ifdef NS_IMPL_GNUSTEP
+ gsextra = 3;
#endif
int oldc = cols, oldr = rows;
oldh = FRAME_PIXEL_HEIGHT (emacsframe);
int neww, newh;
- cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, wr.size.width + extra);
+ cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, wr.size.width + gsextra);
if (cols < MINWIDTH)
cols = MINWIDTH;
- rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES
- (emacsframe, wr.size.height
- - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) + extra
- - FRAME_TOOLBAR_HEIGHT (emacsframe));
+ if (! [self isFullscreen])
+ {
+ extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
+ + FRAME_TOOLBAR_HEIGHT (emacsframe) - gsextra;
+ }
+
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, wr.size.height - extra);
if (rows < MINHEIGHT)
rows = MINHEIGHT;
neww = (int)wr.size.width - emacsframe->border_width;
- newh = ((int)wr.size.height
- - FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
- - FRAME_TOOLBAR_HEIGHT (emacsframe));
+ newh = (int)wr.size.height - extra;
if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
{
- (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
/* normalize frame to gridded text size */
{
+ int extra = 0;
+ int gsextra = 0;
+#ifdef NS_IMPL_GNUSTEP
+ gsextra = 3;
+#endif
+
NSTRACE (windowWillResize);
/*fprintf (stderr,"Window will resize: %.0f x %.0f\n",frameSize.width,frameSize.height); */
maximized_width = maximized_height = -1;
cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe,
-#ifdef NS_IMPL_GNUSTEP
- frameSize.width + 3);
-#else
- frameSize.width);
-#endif
+ frameSize.width + gsextra);
if (cols < MINWIDTH)
cols = MINWIDTH;
- rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, frameSize.height
-#ifdef NS_IMPL_GNUSTEP
- - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) + 3
- - FRAME_TOOLBAR_HEIGHT (emacsframe));
-#else
- - FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
- - FRAME_TOOLBAR_HEIGHT (emacsframe));
-#endif
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe,
+ frameSize.height - extra);
if (rows < MINHEIGHT)
rows = MINHEIGHT;
#ifdef NS_IMPL_COCOA
- (void)windowDidResize: (NSNotification *)notification
{
-
-#if !defined (NEW_STYLE_FS) && ! defined (NS_IMPL_GNUSTEP)
- NSWindow *theWindow = [notification object];
- /* We can get notification on the non-FS window when in fullscreen mode. */
- if ([self window] != theWindow) return;
-#endif
+ if (! [self fsIsNative])
+ {
+ NSWindow *theWindow = [notification object];
+ /* We can get notification on the non-FS window when in
+ fullscreen mode. */
+ if ([self window] != theWindow) return;
+ }
#ifdef NS_IMPL_GNUSTEP
NSWindow *theWindow = [notification object];
scrollbarsNeedingUpdate = 0;
fs_state = FULLSCREEN_NONE;
fs_before_fs = next_maximized = -1;
+#ifdef HAVE_NATIVE_FS
+ fs_is_native = ns_use_native_fullscreen;
+#else
+ fs_is_native = NO;
+#endif
maximized_width = maximized_height = -1;
nonfs_window = nil;
backing: NSBackingStoreBuffered
defer: YES];
-#ifdef NEW_STYLE_FS
+#ifdef HAVE_NATIVE_FS
[win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
#endif
NSTRACE (windowDidDeminiaturize);
if (!emacsframe->output_data.ns)
return;
- emacsframe->async_iconified = 0;
- emacsframe->async_visible = 1;
+
+ SET_FRAME_ICONIFIED (emacsframe, 0);
+ SET_FRAME_VISIBLE (emacsframe, 1);
windows_or_buffers_changed++;
if (emacs_event)
{
- emacs_event->kind = ICONIFY_EVENT;
+ emacs_event->kind = DEICONIFY_EVENT;
EV_TRAILER ((id)nil);
}
}
NSTRACE (windowDidExpose);
if (!emacsframe->output_data.ns)
return;
- emacsframe->async_visible = 1;
+
+ SET_FRAME_VISIBLE (emacsframe, 1);
SET_FRAME_GARBAGED (emacsframe);
if (send_appdefined)
if (!emacsframe->output_data.ns)
return;
- emacsframe->async_iconified = 1;
- emacsframe->async_visible = 0;
+ SET_FRAME_ICONIFIED (emacsframe, 1);
+ SET_FRAME_VISIBLE (emacsframe, 0);
if (emacs_event)
{
}
}
+#ifdef HAVE_NATIVE_FS
+- (NSApplicationPresentationOptions)window:(NSWindow *)window
+ willUseFullScreenPresentationOptions:
+ (NSApplicationPresentationOptions)proposedOptions
+{
+ return proposedOptions|NSApplicationPresentationAutoHideToolbar;
+}
+#endif
+
- (void)windowWillEnterFullScreen:(NSNotification *)notification
{
fs_before_fs = fs_state;
- (void)windowDidEnterFullScreen:(NSNotification *)notification
{
[self setFSValue: FULLSCREEN_BOTH];
-#ifdef NEW_STYLE_FS
- // Fix bad background.
- if ([toolbar isVisible])
+ if (! [self fsIsNative])
{
- [toolbar setVisible:NO];
- [toolbar setVisible:YES];
+ [self windowDidBecomeKey:notification];
+ [nonfs_window orderOut:self];
}
-#else
- [self windowDidBecomeKey:notification];
- [nonfs_window orderOut:self];
-#endif
+ else if (! FRAME_EXTERNAL_TOOL_BAR (emacsframe))
+ [toolbar setVisible:NO];
}
- (void)windowWillExitFullScreen:(NSNotification *)notification
{
[self setFSValue: fs_before_fs];
fs_before_fs = -1;
+ [self updateCollectionBehaviour];
+ if (FRAME_EXTERNAL_TOOL_BAR (emacsframe))
+ {
+ [toolbar setVisible:YES];
+ update_frame_tool_bar (emacsframe);
+ [self updateFrameSize:YES];
+ [[self window] display];
+ }
+ else
+ [toolbar setVisible:NO];
+
if (next_maximized != -1)
[[self window] performZoom:self];
}
-- (void)toggleFullScreen: (id)sender
+- (BOOL)fsIsNative
{
-#ifdef NEW_STYLE_FS
- [[self window] toggleFullScreen:sender];
+ return fs_is_native;
+}
+
+- (BOOL)isFullscreen
+{
+ if (! fs_is_native) return nonfs_window != nil;
+#ifdef HAVE_NATIVE_FS
+ return ([[self window] styleMask] & NSFullScreenWindowMask) != 0;
#else
- NSWindow *w = [self window], *fw;
- BOOL onFirstScreen = [[w screen]
- isEqual:[[NSScreen screens] objectAtIndex:0]];
- struct frame *f = emacsframe;
+ return NO;
+#endif
+}
+
+#ifdef HAVE_NATIVE_FS
+- (void)updateCollectionBehaviour
+{
+ if (! [self isFullscreen])
+ {
+ NSWindow *win = [self window];
+ NSWindowCollectionBehavior b = [win collectionBehavior];
+ if (ns_use_native_fullscreen)
+ b |= NSWindowCollectionBehaviorFullScreenPrimary;
+ else
+ b &= ~NSWindowCollectionBehaviorFullScreenPrimary;
+
+ [win setCollectionBehavior: b];
+ fs_is_native = ns_use_native_fullscreen;
+ }
+}
+#endif
+
+- (void)toggleFullScreen: (id)sender
+{
+ NSWindow *w, *fw;
+ BOOL onFirstScreen;
+ struct frame *f;
NSSize sz;
- NSRect r, wr = [w frame];
- NSColor *col = ns_lookup_indexed_color (NS_FACE_BACKGROUND
- (FRAME_DEFAULT_FACE (f)),
- f);
+ NSRect r, wr;
+ NSColor *col;
+
+ if (fs_is_native)
+ {
+ [[self window] toggleFullScreen:sender];
+ return;
+ }
+
+ w = [self window];
+ onFirstScreen = [[w screen] isEqual:[[NSScreen screens] objectAtIndex:0]];
+ f = emacsframe;
+ wr = [w frame];
+ col = ns_lookup_indexed_color (NS_FACE_BACKGROUND
+ (FRAME_DEFAULT_FACE (f)),
+ f);
sz.width = FRAME_COLUMN_WIDTH (f);
sz.height = FRAME_LINE_HEIGHT (f);
FRAME_NS_TITLEBAR_HEIGHT (f) = 0;
tobar_height = FRAME_TOOLBAR_HEIGHT (f);
FRAME_TOOLBAR_HEIGHT (f) = 0;
- FRAME_EXTERNAL_TOOL_BAR (f) = 0;
nonfs_window = w;
f->border_width = bwidth;
FRAME_NS_TITLEBAR_HEIGHT (f) = tibar_height;
- FRAME_TOOLBAR_HEIGHT (f) = tobar_height;
- if (tobar_height)
- FRAME_EXTERNAL_TOOL_BAR (f) = 1;
+ if (FRAME_EXTERNAL_TOOL_BAR (f))
+ FRAME_TOOLBAR_HEIGHT (f) = tobar_height;
[self windowWillExitFullScreen:nil];
[fw setFrame: [w frame] display:YES animate:YES];
[fw close];
[w makeKeyAndOrderFront:NSApp];
[self windowDidExitFullScreen:nil];
+ [self updateFrameSize:YES];
}
-#endif
}
- (void)handleFS
/* 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);
Only works on OSX 10.6 or later. */);
ns_auto_hide_menu_bar = Qnil;
+ DEFVAR_BOOL ("ns-use-native-fullscreen", ns_use_native_fullscreen,
+ doc: /*Non-nil means to use native fullscreen on OSX >= 10.7.
+Nil means use fullscreen the old (< 10.7) way. The old way works better with
+multiple monitors, but lacks tool bar. This variable is ignored on OSX < 10.7.
+Default is t for OSX >= 10.7, nil otherwise. */);
+#ifdef HAVE_NATIVE_FS
+ ns_use_native_fullscreen = YES;
+#else
+ ns_use_native_fullscreen = NO;
+#endif
+ ns_last_use_native_fullscreen = ns_use_native_fullscreen;
+
/* TODO: move to common code */
DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
doc: /* Which toolkit scroll bars Emacs uses, if any.
else
fprintf (stderr, "#<%s_LISP_OBJECT 0x%08"pI"x>\r\n",
!valid ? "INVALID" : "SOME",
- XHASH (arg));
+ XLI (arg));
}
\f
{
int len;
strout ("#<window ", -1, -1, printcharfun);
- len = sprintf (buf, "%d", XWINDOW (obj)->sequence_number);
+ len = sprintf (buf, "%p", XWINDOW (obj));
strout (buf, len, len, printcharfun);
if (!NILP (XWINDOW (obj)->buffer))
{
#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))
PRINTCHAR ('>');
break;
- /* Remaining cases shouldn't happen in normal usage, but let's print
- them anyway for the benefit of the debugger. */
+ /* Remaining cases shouldn't happen in normal usage, but let's
+ print them anyway for the benefit of the debugger. */
+
case Lisp_Misc_Free:
strout ("#<misc free cell>", -1, -1, printcharfun);
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->area)
+ {
+ ptrdiff_t amount = v->data[1].integer;
+
+#if GC_MARK_STACK
+
+ /* If GC_MARK_STACK, valid_lisp_object_p is quite reliable,
+ and so we 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 we do not use this code under
+ normal circumstances. */
+
+ int limit = min (amount, 8);
+ Lisp_Object *area = v->data[0].pointer;
+
+ i = sprintf (buf, "with %"pD"d objects", amount);
+ strout (buf, i, i, printcharfun);
+
+ for (i = 0; i < limit; i++)
+ {
+ Lisp_Object maybe = area[i];
+
+ if (valid_lisp_object_p (maybe) > 0)
+ {
+ PRINTCHAR (' ');
+ print_object (maybe, printcharfun, escapeflag);
+ }
+ else
+ strout (" <invalid>", -1, -1, printcharfun);
+ }
+ if (i == limit && i < amount)
+ strout (" ...", 4, 4, printcharfun);
+
+#else /* not GC_MARK_STACK */
+
+ /* If !GC_MARK_STACK, we have no reliable way to find
+ whether Lisp_Object pointers points to an initialized
+ objects, and so we do not ever trying to print them. */
+
+ i = sprintf (buf, "with %"pD"d objects", amount);
+ strout (buf, i, i, printcharfun);
+
+#endif /* GC_MARK_STACK */
+ }
+ else
+ {
+ /* Print each `data[N]' slot according to its type. */
+
+#define PRINTX(index) \
+ do { \
+ i = 0; \
+ if (v->type ## index == SAVE_UNUSED) \
+ i = sprintf (buf, "<unused>"); \
+ else if (v->type ## index == SAVE_INTEGER) \
+ i = sprintf (buf, "<integer %"pD"d>", v->data[index].integer); \
+ else if (v->type ## index == SAVE_POINTER) \
+ i = sprintf (buf, "<pointer %p>", v->data[index].pointer); \
+ else /* SAVE_OBJECT */ \
+ print_object (v->data[index].object, printcharfun, escapeflag); \
+ if (i) \
+ strout (buf, i, i, printcharfun); \
+ } while (0)
+
+ PRINTX (0);
+ PRINTCHAR (' ');
+ PRINTX (1);
+ PRINTCHAR (' ');
+ PRINTX (2);
+ PRINTCHAR (' ');
+ PRINTX (3);
+
+#undef PRINTX
+
+ }
+ 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 SXHASH_REDUCE (hash);
+ }
+ 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
existing data structure, and disturb as little of the existing code
as possible.
- So here's the tack. We add some caching to the scan_buffer
+ So here's the tack. We add some caching to the find_newline
function, so that when it searches for a newline, it notes that the
region between the start and end of the search contained no
newlines; then, the next time around, it consults this cache to see
}
\f
-/* Search for COUNT instances of the character TARGET between START and END.
+/* Search for COUNT newlines between START and END.
If COUNT is positive, search forwards; END must be >= START.
If COUNT is negative, search backwards for the -COUNTth instance;
this is not the same as the usual convention for Emacs motion commands.
If we don't find COUNT instances before reaching END, set *SHORTAGE
- to the number of TARGETs left unfound, and return END.
+ to the number of newlines left unfound, and return END.
If ALLOW_QUIT, set immediate_quit. That's good to do
except when inside redisplay. */
ptrdiff_t
-scan_buffer (int target, ptrdiff_t start, ptrdiff_t end,
- ptrdiff_t count, ptrdiff_t *shortage, bool allow_quit)
+find_newline (ptrdiff_t start, ptrdiff_t end,
+ ptrdiff_t count, ptrdiff_t *shortage, bool allow_quit)
{
struct region_cache *newline_cache;
+ ptrdiff_t end_byte = -1;
int direction;
if (count > 0)
{
direction = 1;
- if (! end) end = ZV;
+ if (!end)
+ end = ZV, end_byte = ZV_BYTE;
}
else
{
direction = -1;
- if (! end) end = BEGV;
+ if (!end)
+ end = BEGV, end_byte = BEGV_BYTE;
}
+ if (end_byte == -1)
+ end_byte = CHAR_TO_BYTE (end);
newline_cache_on_off (current_buffer);
newline_cache = current_buffer->newline_cache;
the position of the last character before the next such
obstacle --- the last character the dumb search loop should
examine. */
- ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end) - 1;
+ ptrdiff_t ceiling_byte = end_byte - 1;
ptrdiff_t start_byte;
ptrdiff_t tem;
/* If we're looking for a newline, consult the newline cache
to see where we can avoid some scanning. */
- if (target == '\n' && newline_cache)
+ if (newline_cache)
{
ptrdiff_t next_change;
immediate_quit = 0;
while (cursor < ceiling_addr)
{
- unsigned char *scan_start = cursor;
-
/* The dumb loop. */
- while (*cursor != target && ++cursor < ceiling_addr)
- ;
+ unsigned char *nl = memchr (cursor, '\n', ceiling_addr - cursor);
/* If we're looking for newlines, cache the fact that
the region from start to cursor is free of them. */
- if (target == '\n' && newline_cache)
- know_region_cache (current_buffer, newline_cache,
- BYTE_TO_CHAR (start_byte + scan_start - base),
- BYTE_TO_CHAR (start_byte + cursor - base));
-
- /* Did we find the target character? */
- if (cursor < ceiling_addr)
- {
- if (--count == 0)
- {
- immediate_quit = 0;
- return BYTE_TO_CHAR (start_byte + cursor - base + 1);
- }
- cursor++;
- }
+ if (newline_cache)
+ {
+ unsigned char *low = cursor;
+ unsigned char *lim = nl ? nl : ceiling_addr;
+ know_region_cache (current_buffer, newline_cache,
+ BYTE_TO_CHAR (low - base + start_byte),
+ BYTE_TO_CHAR (lim - base + start_byte));
+ }
+
+ if (! nl)
+ break;
+
+ if (--count == 0)
+ {
+ immediate_quit = 0;
+ return BYTE_TO_CHAR (nl + 1 - base + start_byte);
+ }
+ cursor = nl + 1;
}
- start = BYTE_TO_CHAR (start_byte + cursor - base);
+ start = BYTE_TO_CHAR (ceiling_addr - base + start_byte);
}
}
else
while (start > end)
{
/* The last character to check before the next obstacle. */
- ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end);
+ ptrdiff_t ceiling_byte = end_byte;
ptrdiff_t start_byte;
ptrdiff_t tem;
/* Consult the newline cache, if appropriate. */
- if (target == '\n' && newline_cache)
+ if (newline_cache)
{
ptrdiff_t next_change;
immediate_quit = 0;
while (cursor >= ceiling_addr)
{
- unsigned char *scan_start = cursor;
-
- while (*cursor != target && --cursor >= ceiling_addr)
- ;
+ unsigned char *nl = memrchr (ceiling_addr, '\n',
+ cursor + 1 - ceiling_addr);
/* If we're looking for newlines, cache the fact that
the region from after the cursor to start is free of them. */
- if (target == '\n' && newline_cache)
- know_region_cache (current_buffer, newline_cache,
- BYTE_TO_CHAR (start_byte + cursor - base),
- BYTE_TO_CHAR (start_byte + scan_start - base));
-
- /* Did we find the target character? */
- if (cursor >= ceiling_addr)
- {
- if (++count >= 0)
- {
- immediate_quit = 0;
- return BYTE_TO_CHAR (start_byte + cursor - base);
- }
- cursor--;
- }
+ if (newline_cache)
+ {
+ unsigned char *low = nl ? nl : ceiling_addr - 1;
+ unsigned char *lim = cursor;
+ know_region_cache (current_buffer, newline_cache,
+ BYTE_TO_CHAR (low - base + start_byte),
+ BYTE_TO_CHAR (lim - base + start_byte));
+ }
+
+ if (! nl)
+ break;
+
+ if (++count >= 0)
+ {
+ immediate_quit = 0;
+ return BYTE_TO_CHAR (nl - base + start_byte);
+ }
+ cursor = nl - 1;
}
- start = BYTE_TO_CHAR (start_byte + cursor - base);
+ start = BYTE_TO_CHAR (ceiling_addr - 1 - base + start_byte);
}
}
return start;
}
\f
-/* Search for COUNT instances of a line boundary, which means either a
- newline or (if selective display enabled) a carriage return.
+/* Search for COUNT instances of a line boundary.
Start at START. If COUNT is negative, search backwards.
We report the resulting position by calling TEMP_SET_PT_BOTH.
bool old_immediate_quit = immediate_quit;
- /* The code that follows is like scan_buffer
- but checks for either newline or carriage return. */
-
if (allow_quit)
immediate_quit++;
- start_byte = CHAR_TO_BYTE (start);
-
if (count > 0)
{
while (start_byte < limit_byte)
ceiling = min (limit_byte - 1, ceiling);
ceiling_addr = BYTE_POS_ADDR (ceiling) + 1;
base = (cursor = BYTE_POS_ADDR (start_byte));
- while (1)
- {
- while (*cursor != '\n' && ++cursor != ceiling_addr)
- ;
- if (cursor != ceiling_addr)
+ do
+ {
+ unsigned char *nl = memchr (cursor, '\n', ceiling_addr - cursor);
+ if (! nl)
+ break;
+ if (--count == 0)
{
- if (--count == 0)
- {
- immediate_quit = old_immediate_quit;
- start_byte = start_byte + cursor - base + 1;
- start = BYTE_TO_CHAR (start_byte);
- TEMP_SET_PT_BOTH (start, start_byte);
- return 0;
- }
- else
- if (++cursor == ceiling_addr)
- break;
+ immediate_quit = old_immediate_quit;
+ start_byte += nl - base + 1;
+ start = BYTE_TO_CHAR (start_byte);
+ TEMP_SET_PT_BOTH (start, start_byte);
+ return 0;
}
- else
- break;
+ cursor = nl + 1;
}
- start_byte += cursor - base;
+ while (cursor < ceiling_addr);
+
+ start_byte += ceiling_addr - base;
}
}
else
{
ceiling = BUFFER_FLOOR_OF (start_byte - 1);
ceiling = max (limit_byte, ceiling);
- ceiling_addr = BYTE_POS_ADDR (ceiling) - 1;
+ ceiling_addr = BYTE_POS_ADDR (ceiling);
base = (cursor = BYTE_POS_ADDR (start_byte - 1) + 1);
while (1)
{
- while (--cursor != ceiling_addr && *cursor != '\n')
- ;
+ unsigned char *nl = memrchr (ceiling_addr, '\n',
+ cursor - ceiling_addr);
+ if (! nl)
+ break;
- if (cursor != ceiling_addr)
+ if (++count == 0)
{
- if (++count == 0)
- {
- immediate_quit = old_immediate_quit;
- /* Return the position AFTER the match we found. */
- start_byte = start_byte + cursor - base + 1;
- start = BYTE_TO_CHAR (start_byte);
- TEMP_SET_PT_BOTH (start, start_byte);
- return 0;
- }
+ immediate_quit = old_immediate_quit;
+ /* Return the position AFTER the match we found. */
+ start_byte += nl - base + 1;
+ start = BYTE_TO_CHAR (start_byte);
+ TEMP_SET_PT_BOTH (start, start_byte);
+ return 0;
}
- else
- break;
+
+ cursor = nl;
}
- /* Here we add 1 to compensate for the last decrement
- of CURSOR, which took it past the valid range. */
- start_byte += cursor - base + 1;
+ start_byte += ceiling_addr - base;
}
}
ptrdiff_t
find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt)
{
- return scan_buffer ('\n', from, 0, cnt, (ptrdiff_t *) 0, 0);
+ return find_newline (from, 0, cnt, (ptrdiff_t *) 0, 0);
}
/* Like find_next_newline, but returns position before the newline,
find_before_next_newline (ptrdiff_t from, ptrdiff_t to, ptrdiff_t cnt)
{
ptrdiff_t shortage;
- ptrdiff_t pos = scan_buffer ('\n', from, to, cnt, &shortage, 1);
+ ptrdiff_t pos = find_newline (from, to, cnt, &shortage, 1);
if (shortage == 0)
pos--;
if (!EQ (noerror, Qt))
{
- if (lim < BEGV || lim > ZV)
- emacs_abort ();
+ eassert (BEGV <= lim && lim <= ZV);
SET_PT_BOTH (lim, lim_byte);
return Qnil;
#if 0 /* This would be clean, but maybe programs depend on
return Qnil;
}
- if (np < BEGV || np > ZV)
- emacs_abort ();
-
+ eassert (BEGV <= np && np <= ZV);
SET_PT (np);
return make_number (np);
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);
}
/* Char number of start of containing expression */
ptrdiff_t prevlevelstart;
ptrdiff_t location; /* Char number at which parsing stopped. */
+ ptrdiff_t location_byte; /* Corresponding byte position. */
ptrdiff_t comstr_start; /* Position of last comment/string starter. */
Lisp_Object levelstarts; /* Char numbers of starts-of-expression
of levels (starting from outermost). */
stop: /* Here if stopping before start of sexp. */
from = prev_from; /* We have just fetched the char that starts it; */
+ from_byte = prev_from_byte;
goto done; /* but return the position before it. */
endquoted:
state.prevlevelstart
= (curlevel == levelstart) ? -1 : (curlevel - 1)->last;
state.location = from;
+ state.location_byte = from_byte;
state.levelstarts = Qnil;
while (curlevel > levelstart)
state.levelstarts = Fcons (make_number ((--curlevel)->last),
Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
If it is symbol `syntax-table', stop after the start of a comment or a
string, or after end of a comment or a string. */)
- (Lisp_Object from, Lisp_Object to, Lisp_Object targetdepth, Lisp_Object stopbefore, Lisp_Object oldstate, Lisp_Object commentstop)
+ (Lisp_Object from, Lisp_Object to, Lisp_Object targetdepth,
+ Lisp_Object stopbefore, Lisp_Object oldstate, Lisp_Object commentstop)
{
struct lisp_parse_state state;
EMACS_INT target;
(NILP (commentstop)
? 0 : (EQ (commentstop, Qsyntax_table) ? -1 : 1)));
- SET_PT (state.location);
+ SET_PT_BOTH (state.location, state.location_byte);
return Fcons (make_number (state.depth),
Fcons (state.prevlevelstart < 0
Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots");
/* Create objects which can be shared among syntax tables. */
- Vsyntax_code_object = Fmake_vector (make_number (Smax), Qnil);
- for (i = 0; i < ASIZE (Vsyntax_code_object); i++)
+ Vsyntax_code_object = make_uninit_vector (Smax);
+ for (i = 0; i < Smax; i++)
ASET (Vsyntax_code_object, i, Fcons (make_number (i), Qnil));
/* Now we are ready to set up this property, so we can
#include <limits.h>
#include <unistd.h>
-#include <allocator.h>
#include <c-ctype.h>
-#include <careadlinkat.h>
#include <ignore-value.h>
#include <utimens.h>
#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 */
+ sh = egetenv ("SUSPEND"); /* KFS, 1994-12-14 */
#endif
if (sh == 0)
- sh = (char *) egetenv ("SHELL");
+ sh = egetenv ("SHELL");
if (sh == 0)
sh = "sh";
/* 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;
}
+/* Block and unblock SIGTTOU. */
+
+void
+block_tty_out_signal (void)
+{
+#ifdef SIGTTOU
+ sigset_t blocked;
+ sigemptyset (&blocked);
+ sigaddset (&blocked, SIGTTOU);
+ pthread_sigmask (SIG_BLOCK, &blocked, 0);
+#endif
+}
+
+void
+unblock_tty_out_signal (void)
+{
+#ifdef SIGTTOU
+ pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
+#endif
+}
+
/* Safely set a controlling terminal FD's process group to PGID.
If we are not in the foreground already, POSIX requires tcsetpgrp
to deliver a SIGTTOU signal, which would stop us. This is an
tcsetpgrp_without_stopping (int fd, pid_t pgid)
{
#ifdef SIGTTOU
- signal_handler_t handler;
block_input ();
- handler = signal (SIGTTOU, SIG_IGN);
+ block_tty_out_signal ();
tcsetpgrp (fd, pgid);
- signal (SIGTTOU, handler);
+ unblock_tty_out_signal ();
unblock_input ();
#endif
}
#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 (bytes_written);
}
-
-static struct allocator const emacs_norealloc_allocator =
- { xmalloc, NULL, xfree, memory_full };
-
-/* Get the symbolic link value of FILENAME. Return a pointer to a
- NUL-terminated string. If readlink fails, return NULL and set
- errno. If the value fits in INITIAL_BUF, return INITIAL_BUF.
- Otherwise, allocate memory and return a pointer to that memory. If
- memory allocation fails, diagnose and fail without returning. If
- successful, store the length of the symbolic link into *LINKLEN. */
-char *
-emacs_readlink (char const *filename, char initial_buf[READLINK_BUFSIZE])
-{
- 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;
t->display_info.tty->output = 0;
if (FRAMEP (t->display_info.tty->top_frame))
- FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0);
+ SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0);
}
if (fd == -1)
error ("Can not reopen tty device %s: %s", t->display_info.tty->name, strerror (errno));
- if (strcmp (t->display_info.tty->name, DEV_TTY))
+ if (!O_IGNORE_CTTY && strcmp (t->display_info.tty->name, DEV_TTY) != 0)
dissociate_if_controlling_tty (fd);
t->display_info.tty->output = fdopen (fd, "w+");
get_tty_size (fileno (t->display_info.tty->input), &width, &height);
if (width != old_width || height != old_height)
change_frame_size (f, height, width, 0, 0, 0);
- FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
+ SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
}
set_tty_hooks (t);
terminal->delete_terminal_hook = &delete_tty;
}
-/* Drop the controlling terminal if fd is the same device. */
+/* If FD is the controlling terminal, drop it. */
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 */
+ /* If tcgetpgrp succeeds, fd is the controlling terminal,
+ so dissociate it by invoking setsid. */
+ if (0 <= tcgetpgrp (fd) && setsid () < 0)
+ {
+#ifdef TIOCNOTTY
+ /* setsid failed, presumably because Emacs is already a process
+ group leader. Fall back on the obsolescent way to dissociate
+ a controlling tty. */
+ block_tty_out_signal ();
+ ioctl (fd, TIOCNOTTY, 0);
+ unblock_tty_out_signal ();
+#endif
}
-#endif /* !DOS_NT */
}
/* 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;
/* On some systems, tgetent tries to access the controlling
terminal. */
- {
- sigset_t blocked;
- sigemptyset (&blocked);
- sigaddset (&blocked, SIGTTOU);
- pthread_sigmask (SIG_BLOCK, &blocked, 0);
- status = tgetent (tty->termcap_term_buffer, terminal_type);
- pthread_sigmask (SIG_UNBLOCK, &blocked, 0);
- }
+ block_tty_out_signal ();
+ status = tgetent (tty->termcap_term_buffer, terminal_type);
+ unblock_tty_out_signal ();
if (status < 0)
{
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
if (termcap_name && (*termcap_name == '\\'
|| *termcap_name == '/'
|| termcap_name[1] == ':'))
- dostounix_filename (termcap_name);
+ dostounix_filename (termcap_name, 0);
#endif
filep = termcap_name && valid_filename_p (termcap_name);
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 ();
}
/* Ignore old_name, and get our actual location from the OS. */
if (!GetModuleFileName (NULL, in_filename, MAX_PATH))
abort ();
- dostounix_filename (in_filename);
+ dostounix_filename (in_filename, 0);
strcpy (out_filename, in_filename);
/* Change the base of the output filename to match the requested name. */
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. */
switch (put_status)
{
case 1:
- message2 (no_mem_msg, sizeof (no_mem_msg) - 1, 0);
+ message3 (make_unibyte_string (no_mem_msg, sizeof (no_mem_msg) - 1));
break;
case 2:
- message2 (binary_msg, sizeof (binary_msg) - 1, 0);
+ message3 (make_unibyte_string (binary_msg, sizeof (binary_msg) - 1));
break;
case 3:
- message2 (system_error_msg, sizeof (system_error_msg) - 1, 0);
+ message3 (make_unibyte_string (system_error_msg, sizeof (system_error_msg) - 1));
break;
}
sit_for (make_number (2), 0, 2);
#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;
case path name components to lower case. */
static void
-normalize_filename (register char *fp, char path_sep)
+normalize_filename (register char *fp, char path_sep, int multibyte)
{
char sep;
char *elem, *p2;
int dbcs_p = max_filename_mbslen () > 1;
+ /* Multibyte file names are in the Emacs internal representation, so
+ we can traverse them by bytes with no problems. */
+ if (multibyte)
+ dbcs_p = 0;
+
/* Always lower-case drive letters a-z, even if the filesystem
preserves case in filenames.
This is so filenames can be compared by string comparison
fp += 2;
}
- if (NILP (Vw32_downcase_file_names))
+ if (multibyte || NILP (Vw32_downcase_file_names))
{
while (*fp)
{
} while (*fp);
}
-/* Destructively turn backslashes into slashes. */
+/* Destructively turn backslashes into slashes. MULTIBYTE non-zero
+ means the file name is a multibyte string in Emacs's internal
+ representation. */
void
-dostounix_filename (register char *p)
+dostounix_filename (register char *p, int multibyte)
{
- normalize_filename (p, '/');
+ normalize_filename (p, '/', multibyte);
}
/* Destructively turn slashes into backslashes. */
void
unixtodos_filename (register char *p)
{
- normalize_filename (p, '\\');
+ normalize_filename (p, '\\', 0);
}
/* Remove all CR's that are followed by a LF.
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))
emacs_abort ();
strcpy (root_dir, p);
root_dir[parse_root (root_dir, NULL)] = '\0';
- dostounix_filename (root_dir);
+ dostounix_filename (root_dir, 0);
return root_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];
static void close_unc_volume (HANDLE);
DIR *
-opendir (char *filename)
+opendir (const char *filename)
{
DIR *dirp;
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;
get_name_and_id (PSECURITY_DESCRIPTOR psd, unsigned *id, char *nm, int what)
{
PSID sid = NULL;
- char machine[MAX_COMPUTERNAME_LENGTH+1];
BOOL dflt;
SID_NAME_USE ignore;
char name[UNLEN+1];
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
return stat_worker (path, buf, 0);
}
+int
+fstatat (int fd, char const *name, struct stat *st, int flags)
+{
+ /* Rely on a hack: an open directory is modeled as file descriptor 0.
+ This is good enough for the current usage in Emacs, but is fragile.
+
+ FIXME: Add proper support for fdopendir, fstatat, readlinkat.
+ Gnulib does this and can serve as a model. */
+ char fullname[MAX_PATH];
+
+ if (fd != AT_FDCWD)
+ {
+ if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, name)
+ < 0)
+ {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ name = fullname;
+ }
+
+ return stat_worker (name, st, ! (flags & AT_SYMLINK_NOFOLLOW));
+}
+
/* Provide fstat and utime as well as stat for consistent handling of
file timestamps. */
int
else
buf->st_ino = fake_inode;
- /* Consider files to belong to current user.
- FIXME: this should use GetSecurityInfo API, but it is only
- available for _WIN32_WINNT >= 0x501. */
- buf->st_uid = dflt_passwd.pw_uid;
- buf->st_gid = dflt_passwd.pw_gid;
- strcpy (buf->st_uname, dflt_passwd.pw_name);
- strcpy (buf->st_gname, dflt_group.gr_name);
+ /* If the caller so requested, get the true file owner and group.
+ Otherwise, consider the file to belong to the current user. */
+ if (!w32_stat_get_owner_group || is_windows_9x () == TRUE)
+ get_file_owner_and_group (NULL, buf);
+ else
+ {
+ PSECURITY_DESCRIPTOR psd = NULL;
+
+ psd = get_file_security_desc_by_handle (fh);
+ if (psd)
+ {
+ get_file_owner_and_group (psd, buf);
+ LocalFree (psd);
+ }
+ else
+ get_file_owner_and_group (NULL, buf);
+ }
buf->st_dev = info.dwVolumeSerialNumber;
buf->st_rdev = info.dwVolumeSerialNumber;
{
/* 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 retval;
}
+ssize_t
+readlinkat (int fd, char const *name, char *buffer,
+ size_t buffer_size)
+{
+ /* Rely on a hack: an open directory is modeled as file descriptor 0,
+ as in fstatat. FIXME: Add proper support for readlinkat. */
+ char fullname[MAX_PATH];
+
+ if (fd != AT_FDCWD)
+ {
+ if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, name)
+ < 0)
+ {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ name = fullname;
+ }
+
+ return readlink (name, buffer, buffer_size);
+}
+
/* If FILE is a symlink, return its target (stored in a static
buffer); otherwise return FILE.
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;
+ 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;
+ if (!set_file_security ((char *)fname, flags, (PSECURITY_DESCRIPTOR)acl))
+ {
+ err = GetLastError ();
+
+ if (errno == ENOTSUP)
+ ;
+ else if (err == ERROR_INVALID_OWNER
+ || err == ERROR_NOT_ALL_ASSIGNED
+ || err == ERROR_ACCESS_DENIED)
+ {
+ /* 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;
+ else
+ errno = EACCES;
+ }
+ else
+ {
+ retval = 0;
+ errno = e;
+ }
+
+ if (st)
+ {
+ if (st >= 2)
+ restore_privilege (&old2);
+ restore_privilege (&old1);
+ revert_to_self ();
+ }
+
+ 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
char linkname[MAX_PATH];
ssize_t link_size;
- if (fd != AT_FDCWD)
- {
- errno = EINVAL;
- return NULL;
- }
-
link_size = preadlinkat (fd, filename, linkname, sizeof(linkname));
if (link_size > 0)
return NULL;
}
-ssize_t
-careadlinkatcwd (int fd, char const *filename, char *buffer,
- size_t buffer_size)
-{
- (void) fd;
- return readlink (filename, buffer, buffer_size);
-}
-
\f
/* Support for browsing other processes and their attributes. See
process.c for the Lisp bindings. */
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 check_windows_init_file (void);
extern void syms_of_ntproc (void);
extern void syms_of_ntterm (void);
-extern void dostounix_filename (register char *);
+extern void dostounix_filename (register char *, int);
extern void unixtodos_filename (register char *);
extern BOOL init_winsock (int load_now);
extern void srandom (int);
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
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
/* Let redisplay know that we have made the frame visible already. */
- f->async_visible = 1;
+ SET_FRAME_VISIBLE (f, 1);
ShowWindow (FRAME_W32_WINDOW (f), SW_SHOWNOACTIVATE);
}
/* we get one of the two final 0 bytes for free. */
1 + sizeof (wchar_t) * wcslen (filename_buf)));
#else /* !NTGUI_UNICODE */
- dostounix_filename (filename_buf);
+ dostounix_filename (filename_buf, 0);
filename = DECODE_FILE (build_string (filename_buf));
#endif /* NTGUI_UNICODE */
CHECK_VECTOR (key);
- if (XFASTINT (Flength (key)) != 1)
+ if (ASIZE (key) != 1)
return Qnil;
GCPRO1 (key);
- c = Faref (key, make_number (0));
+ c = AREF (key, 0);
if (CONSP (c) && lucid_event_type_list_p (c))
c = Fevent_convert_list (c);
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. If the file cannot be
+watched for some reason, this function signals a `file-error' error.
+
+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.
+
+Note that some networked filesystems, such as Samba-mounted Unix
+volumes, might not send notifications about file changes. In these
+cases, this function will return a valid descriptor, but notifications
+will never come in. Volumes shared from remote Windows machines do
+generate notifications correctly, though. */)
+ (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)
{
if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0)
return Qnil;
- dostounix_filename (shortname);
+ dostounix_filename (shortname, 0);
+ /* No need to DECODE_FILE, because 8.3 names are pure ASCII. */
return build_string (shortname);
}
if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH))
return Qnil;
- dostounix_filename (longname);
+ dostounix_filename (longname, 0);
/* If we were passed only a drive, make sure that a slash is not appended
for consistency with directories. Allow for drive mapping via SUBST
#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 ();
DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f,
SDATA (f->name)));
}
- else if (f->async_visible != 1)
+ else if (FRAME_VISIBLE_P (f) != 1)
{
+ bool iconified = FRAME_ICONIFIED_P (f);
+
/* Definitely not obscured, so mark as visible. */
- f->async_visible = 1;
- f->async_iconified = 0;
+ SET_FRAME_VISIBLE (f, 1);
+ SET_FRAME_ICONIFIED (f, 0);
SET_FRAME_GARBAGED (f);
DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f,
SDATA (f->name)));
/* WM_PAINT serves as MapNotify as well, so report
visibility changes properly. */
- if (f->iconified)
+ if (iconified)
{
inev.kind = DEICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
}
- else if (! NILP (Vframe_list)
- && ! NILP (XCDR (Vframe_list)))
+ else if (!NILP (Vframe_list) && !NILP (XCDR (Vframe_list)))
/* Force a redisplay sooner or later to update the
frame titles in case this is the second frame. */
record_asynch_buffer_change ();
case WM_SYSKEYDOWN:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
- if (f && !f->iconified)
+ if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
case WM_CHAR:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
- if (f && !f->iconified)
+ if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
case WM_APPCOMMAND:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
- if (f && !f->iconified)
+ if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
case WM_MOVE:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
- if (f && !f->async_iconified)
+ if (f && !FRAME_ICONIFIED_P (f))
{
int x, y;
switch (msg.msg.wParam)
{
case SIZE_MINIMIZED:
- f->async_visible = 0;
- f->async_iconified = 1;
+ SET_FRAME_VISIBLE (f, 0);
+ SET_FRAME_ICONIFIED (f, 1);
inev.kind = ICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
case SIZE_MAXIMIZED:
case SIZE_RESTORED:
- f->async_visible = 1;
- f->async_iconified = 0;
+ {
+ bool iconified = FRAME_ICONIFIED_P (f);
- /* wait_reading_process_output will notice this and update
- the frame's display structures. */
- SET_FRAME_GARBAGED (f);
+ SET_FRAME_VISIBLE (f, 1);
+ SET_FRAME_ICONIFIED (f, 0);
- if (f->iconified)
- {
- int x, y;
-
- /* Reset top and left positions of the Window
- here since Windows sends a WM_MOVE message
- BEFORE telling us the Window is minimized
- when the Window is iconified, with 3000,3000
- as the co-ords. */
- x_real_positions (f, &x, &y);
- f->left_pos = x;
- f->top_pos = y;
+ /* wait_reading_process_output will notice this
+ and update the frame's display structures. */
+ SET_FRAME_GARBAGED (f);
- inev.kind = DEICONIFY_EVENT;
- XSETFRAME (inev.frame_or_window, f);
- }
- else if (! NILP (Vframe_list)
- && ! NILP (XCDR (Vframe_list)))
- /* Force a redisplay sooner or later
- to update the frame titles
- in case this is the second frame. */
- record_asynch_buffer_change ();
+ if (iconified)
+ {
+ int x, y;
+
+ /* Reset top and left positions of the Window
+ here since Windows sends a WM_MOVE message
+ BEFORE telling us the Window is minimized
+ when the Window is iconified, with 3000,3000
+ as the co-ords. */
+ x_real_positions (f, &x, &y);
+ f->left_pos = x;
+ f->top_pos = y;
+
+ inev.kind = DEICONIFY_EVENT;
+ XSETFRAME (inev.frame_or_window, f);
+ }
+ else if (! NILP (Vframe_list)
+ && ! NILP (XCDR (Vframe_list)))
+ /* Force a redisplay sooner or later
+ to update the frame titles
+ in case this is the second frame. */
+ record_asynch_buffer_change ();
+ }
break;
}
}
- if (f && !f->async_iconified && msg.msg.wParam != SIZE_MINIMIZED)
+ if (f && !FRAME_ICONIFIED_P (f) && msg.msg.wParam != SIZE_MINIMIZED)
{
RECT rect;
int rows;
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)
continue;
/* Check "visible" frames and mark each as obscured or not.
- Note that async_visible is nonzero for unobscured and
- obscured frames, but zero for hidden and iconified frames. */
- if (FRAME_W32_P (f) && f->async_visible)
+ Note that visible is nonzero for unobscured and obscured
+ frames, but zero for hidden and iconified frames. */
+ if (FRAME_W32_P (f) && FRAME_VISIBLE_P (f))
{
RECT clipbox;
HDC hdc;
+ bool obscured;
enter_crit ();
/* Query clipping rectangle for the entire window area
ReleaseDC (FRAME_W32_WINDOW (f), hdc);
leave_crit ();
- if (clipbox.right == clipbox.left
- || clipbox.bottom == clipbox.top)
+ obscured = FRAME_OBSCURED_P (f);
+
+ if (clipbox.right == clipbox.left || clipbox.bottom == clipbox.top)
{
- /* Frame has become completely obscured so mark as
- such (we do this by setting async_visible to 2 so
- that FRAME_VISIBLE_P is still true, but redisplay
- will skip it). */
- f->async_visible = 2;
+ /* Frame has become completely obscured so mark as such (we
+ do this by setting visible to 2 so that FRAME_VISIBLE_P
+ is still true, but redisplay will skip it). */
+ SET_FRAME_VISIBLE (f, 2);
- if (!FRAME_OBSCURED_P (f))
- {
- DebPrint (("frame %p (%s) obscured\n", f,
- SDATA (f->name)));
- }
+ if (!obscured)
+ DebPrint (("frame %p (%s) obscured\n", f, SDATA (f->name)));
}
else
{
/* Frame is not obscured, so mark it as such. */
- f->async_visible = 1;
+ SET_FRAME_VISIBLE (f, 1);
- if (FRAME_OBSCURED_P (f))
+ if (obscured)
{
SET_FRAME_GARBAGED (f);
- DebPrint (("obscured frame %p (%s) found to be visible\n", f,
- SDATA (f->name)));
+ DebPrint (("obscured frame %p (%s) found to be visible\n",
+ f, SDATA (f->name)));
/* Force a redisplay sooner or later. */
record_asynch_buffer_change ();
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;
+
+ if (FRAME_VISIBLE_P (f))
+ {
+ 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)
+ {
+ case FULLSCREEN_MAXIMIZED:
+ PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MAXIMIZE, 0);
+ break;
+ case FULLSCREEN_BOTH:
+ height =
+ FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height)
+ - XINT (Ftool_bar_lines_needed (selected_frame))
+ + (NILP (Vmenu_bar_mode) ? 1 : 0);
+ width =
+ FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width)
+ - FRAME_SCROLL_BAR_COLS (f);
+ left_pos = workarea_rect.left;
+ top_pos = workarea_rect.top;
+ break;
+ case FULLSCREEN_WIDTH:
+ width =
+ FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width)
+ - FRAME_SCROLL_BAR_COLS (f);
+ 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)
+ - XINT (Ftool_bar_lines_needed (selected_frame))
+ + (NILP (Vmenu_bar_mode) ? 1 : 0);
+ 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.
causes unexpected behavior when unminimizing frames that were
previously maximized. But only SW_SHOWNORMAL works properly for
frames that were truely hidden (using make-frame-invisible), so
- we need it to avoid Bug#5482. It seems that async_iconified
- is only set for minimized windows that are still visible, so
- use that to determine the appropriate flag to pass ShowWindow. */
+ we need it to avoid Bug#5482. It seems that iconified is only
+ set for minimized windows that are still visible, so use that to
+ determine the appropriate flag to pass ShowWindow. */
my_show_window (f, FRAME_W32_WINDOW (f),
- f->async_iconified ? SW_RESTORE : SW_SHOWNORMAL);
+ FRAME_ICONIFIED_P (f) ? SW_RESTORE : SW_SHOWNORMAL);
}
/* Synchronize to ensure Emacs knows the frame is visible
poll_suppress_count = old_poll_suppress_count;
}
}
- FRAME_SAMPLE_VISIBILITY (f);
}
}
So we can't win using the usual strategy of letting
FRAME_SAMPLE_VISIBILITY set this. So do it by hand,
and synchronize with the server to make sure we agree. */
- f->visible = 0;
- FRAME_ICONIFIED_P (f) = 0;
- f->async_visible = 0;
- f->async_iconified = 0;
+ SET_FRAME_VISIBLE (f, 0);
+ SET_FRAME_ICONIFIED (f, 0);
unblock_input ();
}
if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f)
FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0;
- if (f->async_iconified)
+ if (FRAME_ICONIFIED_P (f))
return;
block_input ();
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;
are zero. */
|| (!attributes[j].fClusterStart && items[i].a.fRTL))
{
- Lisp_Object vec;
- vec = Fmake_vector (make_number (3), Qnil);
+ Lisp_Object vec = make_uninit_vector (3);
+
if (items[i].a.fRTL)
{
/* Empirically, it looks like Uniscribe
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
/* Hook run at end of temp_output_buffer_show. */
static Lisp_Object Qtemp_buffer_show_hook;
-/* Incremented for each window created. */
-static int sequence_number;
-
/* Nonzero after init_window_once has finished. */
static int window_initialized;
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);
+ /* These should be recalculated by redisplay code. */
+ w->window_end_valid = 0;
+ w->base_line_pos = 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);
Note that, when WINDOW is selected, the value returned is the same as
that returned by `point' for WINDOW's buffer. It would be more strictly
-correct to return the `top-level' value of `point', outside of any
+correct to return the top-level value of `point', outside of any
`save-excursion' forms. But that is hard to define. */)
(Lisp_Object window)
{
CHECK_BUFFER (buf);
b = XBUFFER (buf);
-#if 0 /* This change broke some things. We should make it later. */
- /* If we don't know the end position, return nil.
- The user can compute it with vertical-motion if he wants to.
- It would be nicer to do it automatically,
- but that's so slow that it would probably bother people. */
- if (NILP (w->window_end_valid))
- return Qnil;
-#endif
-
if (! NILP (update)
- && (windows_or_buffers_changed || NILP (w->window_end_valid))
+ && (windows_or_buffers_changed || !w->window_end_valid)
&& !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);
{
register struct window *w = decode_live_window (window);
- CHECK_NUMBER_COERCE_MARKER (pos);
+ /* Type of POS is checked by Fgoto_char or set_marker_restricted ... */
if (w == XWINDOW (selected_window))
{
{
struct buffer *old_buffer = current_buffer;
+ /* ... but here we want to catch type error before buffer change. */
+ CHECK_NUMBER_COERCE_MARKER (pos);
set_buffer_internal (XBUFFER (w->buffer));
Fgoto_char (pos);
set_buffer_internal (old_buffer);
{
register struct window *w = decode_live_window (window);
- CHECK_NUMBER_COERCE_MARKER (pos);
set_marker_restricted (w->start, pos, w->buffer);
- /* this is not right, but much easier than doing what is right. */
+ /* This is not right, but much easier than doing what is right. */
w->start_at_line_beg = 0;
if (NILP (noforce))
w->force_start = 1;
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));
}
b = XBUFFER (w->buffer);
/* Fail if current matrix is not up-to-date. */
- if (NILP (w->window_end_valid)
+ if (!w->window_end_valid
|| current_buffer->clip_changed
|| current_buffer->prevent_redisplay_optimizations_p
|| w->last_modified < BUF_MODIFF (b)
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),
n->pseudo_window_p = 0;
wset_window_end_vpos (n, make_number (0));
wset_window_end_pos (n, make_number (0));
- wset_window_end_valid (n, Qnil);
+ n->window_end_valid = 0;
n->frozen_window_start_p = 0;
}
{
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);
}
else if (EQ (all_frames, Qvisible))
{
- FRAME_SAMPLE_VISIBILITY (f);
candidate_p = FRAME_VISIBLE_P (f)
&& (FRAME_TERMINAL (XFRAME (w->frame))
== FRAME_TERMINAL (XFRAME (selected_frame)));
}
else if (INTEGERP (all_frames) && XINT (all_frames) == 0)
{
- FRAME_SAMPLE_VISIBILITY (f);
candidate_p = (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)
#ifdef HAVE_X_WINDOWS
/* Yuck!! If we've just created the frame and the
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))
;
pos = *vmotion (startpos, -top, w);
set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
|| FETCH_BYTE (pos.bytepos - 1) == '\n');
/* We need to do this, so that the window-scroll-functions
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;
}
wset_window_end_pos (w, make_number (0));
wset_window_end_vpos (w, make_number (0));
memset (&w->last_cursor, 0, sizeof w->last_cursor);
- wset_window_end_valid (w, Qnil);
+
if (!(keep_margins_p && samebuf))
{ /* If we're not actually changing the buffer, don't reset hscroll and
vscroll. This case happens for example when called from
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;
-
replace_window (window, parent, 1);
wset_next (o, Qnil);
w->nrows_scale_factor = w->ncols_scale_factor = 1;
w->phys_cursor_type = -1;
w->phys_cursor_width = -1;
- w->sequence_number = ++sequence_number;
+ w->column_number_displayed = -1;
/* Reset window_list. */
Vwindow_list = Qnil;
}
-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);
+ n->window_end_valid = 0;
memset (&n->last_cursor, 0, sizeof n->last_cursor);
/* Get special geometry settings from reference window. */
}
/* 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;
+ set_marker_restricted_both (w->start, w->buffer, IT_CHARPOS (it),
+ IT_BYTEPOS (it));
+ 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;
/* Set the new window start. */
set_marker_both (w->start, w->buffer, charpos, bytepos);
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
w->optional_new_start = 1;
&& 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));
}
{
/* Set window markers at start of visible range. */
if (XMARKER (w->start)->buffer == 0)
- set_marker_restricted (w->start, make_number (0),
- w->buffer);
+ set_marker_restricted_both (w->start, w->buffer, 0, 0);
if (XMARKER (w->pointm)->buffer == 0)
set_marker_restricted_both
(w->pointm, w->buffer,
wset_buffer (w, other_buffer_safely (Fcurrent_buffer ()));
/* This will set the markers to beginning of visible
range. */
- set_marker_restricted (w->start,
- make_number (0), w->buffer);
- set_marker_restricted (w->pointm,
- make_number (0), w->buffer);
+ set_marker_restricted_both (w->start, w->buffer, 0, 0);
+ set_marker_restricted_both (w->pointm, w->buffer, 0, 0);
w->start_at_line_beg = 1;
if (!NILP (w->dedicated))
/* Record this window as dead. */
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,
data->minibuf_selected_window = minibuf_level > 0 ? minibuf_selected_window : Qnil;
data->root_window = FRAME_ROOT_WINDOW (f);
data->focus_frame = FRAME_FOCUS_FRAME (f);
- tem = Fmake_vector (make_number (n_windows), Qnil);
+ tem = make_uninit_vector (n_windows);
data->saved_windows = tem;
for (i = 0; i < n_windows; i++)
ASET (tem, i,
- Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil));
+ Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil));
save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0);
XSETWINDOW_CONFIGURATION (tem, data);
return (tem);
adjust_window_margins (w);
clear_glyph_matrix (w->current_matrix);
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
++windows_or_buffers_changed;
adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
{
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);
}
adjust_window_margins (w);
clear_glyph_matrix (w->current_matrix);
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
++windows_or_buffers_changed;
adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
(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);
}
Other values are reserved for future use.
-This variable takes no effect if `window-combination-limit' is non-nil. */);
+This variable takes no effect if the variable `window-combination-limit' is
+non-nil. */);
Vwindow_combination_resize = Qnil;
DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit,
no scroll bar. A value of t means use frame value. */
Lisp_Object vertical_scroll_bar_type;
- /* Z - the buffer position of the last glyph in the current matrix
- of W. Only valid if WINDOW_END_VALID is not nil. */
+ /* Z - the buffer position of the last glyph in the current
+ matrix of W. Only valid if window_end_valid is nonzero. */
Lisp_Object window_end_pos;
+
/* Glyph matrix row of the last glyph in the current matrix
- of W. Only valid if WINDOW_END_VALID is not nil. */
+ of W. Only valid if window_end_valid is nonzero. */
Lisp_Object window_end_vpos;
- /* t if window_end_pos is truly valid.
- This is nil if nontrivial redisplay is preempted
- since in that case the frame image that window_end_pos
- did not get onto the frame. */
- Lisp_Object window_end_valid;
/* Display-table to use for displaying chars in this window.
Nil means use the buffer's own display-table. */
and Qt, so bitfield can't be used here. */
Lisp_Object dedicated;
- /* Line number and position of a line somewhere above the top of the
- screen. If this field is nil, it means we don't have a base
- line. */
- Lisp_Object base_line_number;
- /* If this field is nil, it means we don't have a base line.
- If it is a buffer, it means don't display the line number
- as long as the window shows that buffer. */
- Lisp_Object base_line_pos;
-
- /* If we have highlighted the region (or any part of it),
- this is the mark position that we used, as an integer. */
- Lisp_Object region_showing;
-
- /* The column number currently displayed in this window's mode line,
- or nil if column numbers are not being displayed. */
- Lisp_Object column_number_displayed;
-
/* If redisplay in this window goes beyond this buffer position,
must run the redisplay-end-trigger-hook. */
Lisp_Object redisplay_end_trigger;
/* Number saying how recently window was selected. */
int use_time;
- /* Unique number of window assigned when it was created. */
- int sequence_number;
-
/* Number of columns display within the window is scrolled to the left. */
ptrdiff_t hscroll;
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;
+ /* Line number and position of a line somewhere above the top of the
+ screen. If this field is zero, it means we don't have a base line. */
+ ptrdiff_t base_line_number;
+
+ /* If this field is zero, it means we don't have a base line.
+ If it is -1, it means don't display the line number as long
+ as the window shows its buffer. */
+ ptrdiff_t base_line_pos;
+
+ /* The column number currently displayed in this window's mode
+ line, or -1 if column numbers are not being displayed. */
+ ptrdiff_t column_number_displayed;
+
/* Scaling factor for the glyph_matrix size calculation in this window.
Used if window contains many small images or uses proportional fonts,
as the normal may yield a matrix which is too small. */
/* 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
Otherwise draw them between margin areas and text. */
unsigned fringes_outside_margins : 1;
+ /* Nonzero if window_end_pos and window_end_vpos are truly valid.
+ This is zero if nontrivial redisplay is preempted since in that case
+ the frame image that window_end_pos did not get onto the frame. */
+ unsigned window_end_valid : 1;
+
/* Amount by which lines of this window are scrolled in
y-direction (smooth scrolling). */
int vscroll;
- /* Z_BYTE - the 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. */
+ /* If we have highlighted the region (or any part of it), the mark
+ (region start) position; otherwise zero. */
+ ptrdiff_t region_showing;
+
+ /* 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 nonzero. */
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;
w->window_end_pos = val;
}
WINDOW_INLINE void
-wset_window_end_valid (struct window *w, Lisp_Object val)
-{
- w->window_end_valid = val;
-}
-WINDOW_INLINE void
wset_window_end_vpos (struct window *w, Lisp_Object val)
{
w->window_end_vpos = 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 Lisp_Object Qmargin, Qpointer;
static Lisp_Object Qline_height;
-/* These setters are used only in this file, so they can be private. */
-static void
-wset_base_line_number (struct window *w, Lisp_Object val)
-{
- w->base_line_number = val;
-}
-static void
-wset_base_line_pos (struct window *w, Lisp_Object val)
-{
- w->base_line_pos = val;
-}
-static void
-wset_column_number_displayed (struct window *w, Lisp_Object val)
-{
- w->column_number_displayed = val;
-}
-static void
-wset_region_showing (struct window *w, Lisp_Object val)
-{
- w->region_showing = val;
-}
-
#ifdef HAVE_WINDOW_SYSTEM
/* Test if overflow newline into fringe. Called with iterator IT
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 Lisp_Object unwind_with_echo_area_buffer (Lisp_Object);
static Lisp_Object with_echo_area_buffer_unwind_data (struct window *);
static int with_echo_area_buffer (struct window *, int,
- int (*) (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t),
- ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
+ int (*) (ptrdiff_t, Lisp_Object),
+ ptrdiff_t, Lisp_Object);
static void clear_garbaged_frames (void);
-static int current_message_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
+static int current_message_1 (ptrdiff_t, Lisp_Object);
static void pop_message (void);
-static int truncate_message_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
-static void set_message (const char *, Lisp_Object, ptrdiff_t, int);
-static int set_message_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
+static int truncate_message_1 (ptrdiff_t, Lisp_Object);
+static void set_message (Lisp_Object);
+static int set_message_1 (ptrdiff_t, Lisp_Object);
static int display_echo_area (struct window *);
-static int display_echo_area_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
-static int resize_mini_window_1 (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t);
+static int display_echo_area_1 (ptrdiff_t, Lisp_Object);
+static int resize_mini_window_1 (ptrdiff_t, Lisp_Object);
static Lisp_Object unwind_redisplay (Lisp_Object);
static int string_char_and_length (const unsigned char *, int *);
static struct text_pos display_prop_end (struct it *, Lisp_Object,
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)))
{
Lisp_Object cpos = make_number (charpos);
Lisp_Object spec = Fget_char_property (cpos, Qdisplay, Qnil);
Lisp_Object string = string_from_display_spec (spec);
- int newline_in_string = 0;
-
- if (STRINGP (string))
- {
- const char *s = SSDATA (string);
- const char *e = s + SBYTES (string);
- while (s < e)
- {
- if (*s++ == '\n')
- {
- newline_in_string = 1;
- break;
- }
- }
- }
+ bool newline_in_string
+ = (STRINGP (string)
+ && memchr (SDATA (string), '\n', SBYTES (string)));
/* The tricky code below is needed because there's a
discrepancy between move_it_to and how we set cursor
when the display line ends in a newline from a
static void
check_window_end (struct window *w)
{
- if (!MINI_WINDOW_P (w)
- && !NILP (w->window_end_valid))
+ if (!MINI_WINDOW_P (w) && w->window_end_valid)
{
struct glyph_row *row;
eassert ((row = MATRIX_ROW (w->current_matrix,
#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;
}
}
struct it it2, it3;
void *it2data = NULL, *it3data = NULL;
ptrdiff_t start_pos;
+ int nchars_per_row
+ = (it->last_visible_x - it->first_visible_x) / FRAME_COLUMN_WIDTH (it->f);
+ ptrdiff_t pos_limit;
move_further_back:
eassert (dy >= 0);
/* Estimate how many newlines we must move back. */
nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));
+ if (it->line_wrap == TRUNCATE)
+ pos_limit = BEGV;
+ else
+ pos_limit = max (start_pos - nlines * nchars_per_row, BEGV);
- /* Set the iterator's position that many lines back. */
- while (nlines-- && IT_CHARPOS (*it) > BEGV)
+ /* Set the iterator's position that many lines back. But don't go
+ back more than NLINES full screen lines -- this wins a day with
+ buffers which have very long lines. */
+ while (nlines-- && IT_CHARPOS (*it) > pos_limit)
back_to_previous_visible_line_start (it);
/* Reseat the iterator here. When moving backward, we don't want
struct it it2;
void *it2data = NULL;
ptrdiff_t start_charpos, i;
+ int nchars_per_row
+ = (it->last_visible_x - it->first_visible_x) / FRAME_COLUMN_WIDTH (it->f);
+ ptrdiff_t pos_limit;
/* Start at the beginning of the screen line containing IT's
position. This may actually move vertically backwards,
move_it_vertically_backward (it, 0);
dvpos -= it->vpos;
- /* Go back -DVPOS visible lines and reseat the iterator there. */
+ /* Go back -DVPOS buffer lines, but no farther than -DVPOS full
+ screen lines, and reseat the iterator there. */
start_charpos = IT_CHARPOS (*it);
- for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i)
+ if (it->line_wrap == TRUNCATE)
+ pos_limit = BEGV;
+ else
+ pos_limit = max (start_charpos + dvpos * nchars_per_row, BEGV);
+ for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > pos_limit; --i)
back_to_previous_visible_line_start (it);
reseat (it, it->current.pos, 1);
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;
bset_undo_list (current_buffer, Qt);
oldpoint = message_dolog_marker1;
- set_marker_restricted (oldpoint, make_number (PT), Qnil);
+ set_marker_restricted_both (oldpoint, Qnil, PT, PT_BYTE);
oldbegv = message_dolog_marker2;
- set_marker_restricted (oldbegv, make_number (BEGV), Qnil);
+ set_marker_restricted_both (oldbegv, Qnil, BEGV, BEGV_BYTE);
oldzv = message_dolog_marker3;
- set_marker_restricted (oldzv, make_number (ZV), Qnil);
+ set_marker_restricted_both (oldzv, Qnil, ZV, ZV_BYTE);
GCPRO1 (old_deactivate_mark);
if (PT == Z)
}
}
else if (nbytes)
- insert_1 (m, nbytes, 1, 0, 0);
+ insert_1_both (m, chars_in_text (msg, nbytes), nbytes, 1, 0, 0);
if (nlflag)
{
ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte;
printmax_t dups;
- insert_1 ("\n", 1, 1, 0, 0);
+
+ insert_1_both ("\n", 1, 1, 1, 0, 0);
scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0);
this_bol = PT;
change message_log_check_duplicate. */
int duplen = sprintf (dupstr, " [%"pMd" times]", dups);
TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1);
- insert_1 (dupstr, duplen, 1, 0, 1);
+ insert_1_both (dupstr, duplen, duplen, 1, 0, 1);
}
}
}
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;
for (i = 0; i < len; i++)
{
- if (i >= 3 && p1[i-3] == '.' && p1[i-2] == '.' && p1[i-1] == '.')
+ if (i >= 3 && p1[i - 3] == '.' && p1[i - 2] == '.' && p1[i - 1] == '.')
seen_dots = 1;
if (p1[i] != p2[i])
return seen_dots;
char *pend;
intmax_t n = strtoimax ((char *) p1, &pend, 10);
if (0 < n && n < INTMAX_MAX && strncmp (pend, " times]\n", 8) == 0)
- return n+1;
+ return n + 1;
}
return 0;
}
\f
-/* Display an echo area message M with a specified length of NBYTES
- bytes. The string may include null characters. If M is 0, clear
- out any existing message, and let the mini-buffer text show
- through.
-
- This may GC, so the buffer M must NOT point to a Lisp string. */
-
-void
-message2 (const char *m, ptrdiff_t nbytes, int multibyte)
-{
- /* First flush out any partial line written with print. */
- message_log_maybe_newline ();
- if (m)
- message_dolog (m, nbytes, 1, multibyte);
- message2_nolog (m, nbytes, multibyte);
-}
-
-
-/* The non-logging counterpart of message2. */
-
-void
-message2_nolog (const char *m, ptrdiff_t nbytes, int multibyte)
-{
- struct frame *sf = SELECTED_FRAME ();
- message_enable_multibyte = multibyte;
-
- if (FRAME_INITIAL_P (sf))
- {
- if (noninteractive_need_newline)
- putc ('\n', stderr);
- noninteractive_need_newline = 0;
- if (m)
- fwrite (m, nbytes, 1, stderr);
- if (cursor_in_echo_area == 0)
- fprintf (stderr, "\n");
- fflush (stderr);
- }
- /* A null message buffer means that the frame hasn't really been
- initialized yet. Error messages get reported properly by
- cmd_error, so this must be just an informative message; toss it. */
- else if (INTERACTIVE
- && sf->glyphs_initialized_p
- && FRAME_MESSAGE_BUF (sf))
- {
- Lisp_Object mini_window;
- struct frame *f;
-
- /* Get the frame containing the mini-buffer
- that the selected frame is using. */
- mini_window = FRAME_MINIBUF_WINDOW (sf);
- f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
-
- FRAME_SAMPLE_VISIBILITY (f);
- if (FRAME_VISIBLE_P (sf)
- && ! FRAME_VISIBLE_P (f))
- Fmake_frame_visible (WINDOW_FRAME (XWINDOW (mini_window)));
-
- if (m)
- {
- set_message (m, Qnil, nbytes, multibyte);
- if (minibuffer_auto_raise)
- Fraise_frame (WINDOW_FRAME (XWINDOW (mini_window)));
- }
- else
- clear_message (1, 1);
-
- 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)
- (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
- }
-}
-
-
/* Display an echo area message M with a specified length of NBYTES
bytes. The string may include null characters. If M is not a
string, clear out any existing message, and let the mini-buffer
This function cancels echoing. */
void
-message3 (Lisp_Object m, ptrdiff_t nbytes, int multibyte)
+message3 (Lisp_Object m)
{
struct gcpro gcpro1;
message_log_maybe_newline ();
if (STRINGP (m))
{
+ ptrdiff_t nbytes = SBYTES (m);
+ int multibyte = STRING_MULTIBYTE (m);
USE_SAFE_ALLOCA;
char *buffer = SAFE_ALLOCA (nbytes);
memcpy (buffer, SDATA (m), nbytes);
message_dolog (buffer, nbytes, 1, multibyte);
SAFE_FREE ();
}
- message3_nolog (m, nbytes, multibyte);
+ message3_nolog (m);
UNGCPRO;
}
and make this cancel echoing. */
void
-message3_nolog (Lisp_Object m, ptrdiff_t nbytes, int multibyte)
+message3_nolog (Lisp_Object m)
{
struct frame *sf = SELECTED_FRAME ();
- message_enable_multibyte = multibyte;
if (FRAME_INITIAL_P (sf))
{
putc ('\n', stderr);
noninteractive_need_newline = 0;
if (STRINGP (m))
- fwrite (SDATA (m), nbytes, 1, stderr);
+ fwrite (SDATA (m), SBYTES (m), 1, stderr);
if (cursor_in_echo_area == 0)
fprintf (stderr, "\n");
fflush (stderr);
}
- /* A null message buffer means that the frame hasn't really been
- initialized yet. Error messages get reported properly by
- cmd_error, so this must be just an informative message; toss it. */
- else if (INTERACTIVE
- && sf->glyphs_initialized_p
- && FRAME_MESSAGE_BUF (sf))
+ /* Error messages get reported properly by cmd_error, so this must be just an
+ informative message; if the frame hasn't really been initialized yet, just
+ toss it. */
+ else if (INTERACTIVE && sf->glyphs_initialized_p)
{
- Lisp_Object mini_window;
- Lisp_Object frame;
- struct frame *f;
-
/* Get the frame containing the mini-buffer
that the selected frame is using. */
- mini_window = FRAME_MINIBUF_WINDOW (sf);
- frame = XWINDOW (mini_window)->frame;
- f = XFRAME (frame);
+ Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
+ Lisp_Object frame = XWINDOW (mini_window)->frame;
+ struct frame *f = XFRAME (frame);
- FRAME_SAMPLE_VISIBILITY (f);
- if (FRAME_VISIBLE_P (sf)
- && !FRAME_VISIBLE_P (f))
+ if (FRAME_VISIBLE_P (sf) && !FRAME_VISIBLE_P (f))
Fmake_frame_visible (frame);
if (STRINGP (m) && SCHARS (m) > 0)
{
- set_message (NULL, m, nbytes, multibyte);
+ set_message (m);
if (minibuffer_auto_raise)
Fraise_frame (frame);
/* Assume we are not echoing.
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);
}
}
void
message1 (const char *m)
{
- message2 (m, (m ? strlen (m) : 0), 0);
+ message3 (m ? make_unibyte_string (m, strlen (m)) : Qnil);
}
void
message1_nolog (const char *m)
{
- message2_nolog (m, (m ? strlen (m) : 0), 0);
+ message3_nolog (m ? make_unibyte_string (m, strlen (m)) : Qnil);
}
/* Display a message M which contains a single %s
mini_window = FRAME_MINIBUF_WINDOW (sf);
f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
- /* A null message buffer means that the frame hasn't really been
- initialized yet. Error messages get reported properly by
- cmd_error, so this must be just an informative message; toss it. */
- if (FRAME_MESSAGE_BUF (f))
+ /* Error messages get reported properly by cmd_error, so this must be
+ just an informative message; if the frame hasn't really been
+ initialized yet, just toss it. */
+ if (f->glyphs_initialized_p)
{
Lisp_Object args[2], msg;
struct gcpro gcpro1, gcpro2;
msg = Fformat (2, args);
if (log)
- message3 (msg, SBYTES (msg), STRING_MULTIBYTE (msg));
+ message3 (msg);
else
- message3_nolog (msg, SBYTES (msg), STRING_MULTIBYTE (msg));
+ message3_nolog (msg);
UNGCPRO;
mini_window = FRAME_MINIBUF_WINDOW (sf);
f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
- /* A null message buffer means that the frame hasn't really been
- initialized yet. Error messages get reported properly by
- cmd_error, so this must be just an informative message; toss
- it. */
- if (FRAME_MESSAGE_BUF (f))
+ /* Error messages get reported properly by cmd_error, so this must be
+ just an informative message; if the frame hasn't really been
+ initialized yet, just toss it. */
+ if (f->glyphs_initialized_p)
{
if (m)
{
ptrdiff_t len;
+ ptrdiff_t maxsize = FRAME_MESSAGE_BUF_SIZE (f);
+ char *message_buf = alloca (maxsize + 1);
- len = doprnt (FRAME_MESSAGE_BUF (f),
- FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, ap);
+ len = doprnt (message_buf, maxsize, m, (char *)0, ap);
- message2 (FRAME_MESSAGE_BUF (f), len, 1);
+ message3 (make_string (message_buf, len));
}
else
message1 (0);
{
Lisp_Object string;
string = Fcurrent_message ();
- message3 (string, SBYTES (string),
- !NILP (BVAR (current_buffer, enable_multibyte_characters)));
+ message3 (string);
}
}
}
-/* Call FN with args A1..A4 with either the current or last displayed
+/* Call FN with args A1..A2 with either the current or last displayed
echo_area_buffer as current buffer.
WHICH zero means use the current message buffer
static int
with_echo_area_buffer (struct window *w, int which,
- int (*fn) (ptrdiff_t, Lisp_Object, ptrdiff_t, ptrdiff_t),
- ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
+ int (*fn) (ptrdiff_t, Lisp_Object),
+ ptrdiff_t a1, Lisp_Object a2)
{
Lisp_Object buffer;
int this_one, the_other, clear_buffer_p, rc;
eassert (BEGV >= BEG);
eassert (ZV <= Z && ZV >= BEGV);
- rc = fn (a1, a2, a3, a4);
+ rc = fn (a1, a2);
eassert (BEGV >= BEG);
eassert (ZV <= Z && ZV >= BEGV);
{
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
{
window_height_changed_p
= with_echo_area_buffer (w, display_last_displayed_message_p,
display_echo_area_1,
- (intptr_t) w, Qnil, 0, 0);
+ (intptr_t) w, Qnil);
if (no_message_p)
echo_area_buffer[i] = Qnil;
Value is non-zero if height of W was changed. */
static int
-display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
+display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2)
{
intptr_t i1 = a1;
struct window *w = (struct window *) i1;
resize_exactly = Qnil;
resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1,
- (intptr_t) w, resize_exactly,
- 0, 0);
+ (intptr_t) w, resize_exactly);
if (resized_p)
{
++windows_or_buffers_changed;
resize_mini_window returns. */
static int
-resize_mini_window_1 (ptrdiff_t a1, Lisp_Object exactly, ptrdiff_t a3, ptrdiff_t a4)
+resize_mini_window_1 (ptrdiff_t a1, Lisp_Object exactly)
{
intptr_t i1 = a1;
return resize_mini_window ((struct window *) i1, !NILP (exactly));
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)
else
{
with_echo_area_buffer (0, 0, current_message_1,
- (intptr_t) &msg, Qnil, 0, 0);
+ (intptr_t) &msg, Qnil);
if (NILP (msg))
echo_area_buffer[0] = Qnil;
}
static int
-current_message_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
+current_message_1 (ptrdiff_t a1, Lisp_Object a2)
{
intptr_t i1 = a1;
Lisp_Object *msg = (Lisp_Object *) i1;
void
restore_message (void)
{
- Lisp_Object msg;
-
eassert (CONSP (Vmessage_stack));
- msg = XCAR (Vmessage_stack);
- if (STRINGP (msg))
- message3_nolog (msg, SBYTES (msg), STRING_MULTIBYTE (msg));
- else
- message3_nolog (msg, 0, 0);
+ message3_nolog (XCAR (Vmessage_stack));
}
{
if (nchars == 0)
echo_area_buffer[0] = Qnil;
- /* A null message buffer means that the frame hasn't really been
- initialized yet. Error messages get reported properly by
- cmd_error, so this must be just an informative message; toss it. */
else if (!noninteractive
&& INTERACTIVE
&& !NILP (echo_area_buffer[0]))
{
struct frame *sf = SELECTED_FRAME ();
- if (FRAME_MESSAGE_BUF (sf))
- with_echo_area_buffer (0, 0, truncate_message_1, nchars, Qnil, 0, 0);
+ /* Error messages get reported properly by cmd_error, so this must be
+ just an informative message; if the frame hasn't really been
+ initialized yet, just toss it. */
+ if (sf->glyphs_initialized_p)
+ with_echo_area_buffer (0, 0, truncate_message_1, nchars, Qnil);
}
}
message to at most NCHARS characters. */
static int
-truncate_message_1 (ptrdiff_t nchars, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
+truncate_message_1 (ptrdiff_t nchars, Lisp_Object a2)
{
if (BEG + nchars < Z)
del_range (BEG + nchars, Z);
return 0;
}
-/* Set the current message to a substring of S or STRING.
-
- If STRING is a Lisp string, set the message to the first NBYTES
- bytes from STRING. NBYTES zero means use the whole string. If
- STRING is multibyte, the message will be displayed multibyte.
-
- If S is not null, set the message to the first LEN bytes of S. LEN
- zero means use the whole string. MULTIBYTE_P non-zero means S is
- multibyte. Display the message multibyte in that case.
-
- Doesn't GC, as with_echo_area_buffer binds Qinhibit_modification_hooks
- to t before calling set_message_1 (which calls insert).
- */
+/* Set the current message to STRING. */
static void
-set_message (const char *s, Lisp_Object string,
- ptrdiff_t nbytes, int multibyte_p)
+set_message (Lisp_Object string)
{
- message_enable_multibyte
- = ((s && multibyte_p)
- || (STRINGP (string) && STRING_MULTIBYTE (string)));
+ eassert (STRINGP (string));
- with_echo_area_buffer (0, -1, set_message_1,
- (intptr_t) s, string, nbytes, multibyte_p);
+ message_enable_multibyte = STRING_MULTIBYTE (string);
+
+ with_echo_area_buffer (0, -1, set_message_1, 0, string);
message_buf_print = 0;
help_echo_showing_p = 0;
}
-/* Helper function for set_message. Arguments have the same meaning
- as there, with A1 corresponding to S and A2 corresponding to STRING
- This function is called with the echo area buffer being
- current. */
+/* Helper function for set_message. First argument is ignored and second
+ argument has the same meaning as for set_message.
+ This function is called with the echo area buffer being current. */
static int
-set_message_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t nbytes, ptrdiff_t multibyte_p)
+set_message_1 (ptrdiff_t a1, Lisp_Object string)
{
- intptr_t i1 = a1;
- const char *s = (const char *) i1;
- const unsigned char *msg = (const unsigned char *) s;
- Lisp_Object string = a2;
+ eassert (STRINGP (string));
/* Change multibyteness of the echo buffer appropriately. */
if (message_enable_multibyte
/* Insert new message at BEG. */
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
- if (STRINGP (string))
- {
- ptrdiff_t nchars;
-
- if (nbytes == 0)
- nbytes = SBYTES (string);
- nchars = string_byte_to_char (string, nbytes);
-
- /* This function takes care of single/multibyte conversion. We
- just have to ensure that the echo area buffer has the right
- setting of enable_multibyte_characters. */
- insert_from_string (string, 0, 0, nchars, nbytes, 1);
- }
- else if (s)
- {
- if (nbytes == 0)
- nbytes = strlen (s);
-
- if (multibyte_p && NILP (BVAR (current_buffer, enable_multibyte_characters)))
- {
- /* Convert from multi-byte to single-byte. */
- ptrdiff_t i;
- int c, n;
- char work[1];
-
- /* Convert a multibyte string to single-byte. */
- for (i = 0; i < nbytes; i += n)
- {
- c = string_char_and_length (msg + i, &n);
- work[0] = (ASCII_CHAR_P (c)
- ? c
- : multibyte_char_to_unibyte (c));
- insert_1_both (work, 1, 1, 1, 0, 0);
- }
- }
- else if (!multibyte_p
- && !NILP (BVAR (current_buffer, enable_multibyte_characters)))
- {
- /* Convert from single-byte to multi-byte. */
- ptrdiff_t i;
- int c, n;
- unsigned char str[MAX_MULTIBYTE_LENGTH];
-
- /* Convert a single-byte string to multibyte. */
- for (i = 0; i < nbytes; i++)
- {
- c = msg[i];
- MAKE_CHAR_MULTIBYTE (c);
- n = CHAR_STRING (c, str);
- insert_1_both ((char *) str, 1, n, 1, 0, 0);
- }
- }
- else
- insert_1 (s, nbytes, 1, 0, 0);
- }
+ /* This function takes care of single/multibyte conversion.
+ We just have to ensure that the echo area buffer has the right
+ setting of enable_multibyte_characters. */
+ insert_from_string (string, 0, 0, SCHARS (string), SBYTES (string), 1);
return 0;
}
{
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)))
+ != (w->region_showing != 0)));
+}
+
+/* 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 (w->column_number_displayed != -1
+ && !(PT == w->last_point && !window_outdated (w))
+ && (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)
reconsider_clip_changes (struct window *w, struct buffer *b)
{
if (b->clip_changed
- && !NILP (w->window_end_valid)
- && w->current_matrix->buffer == b
- && w->current_matrix->zv == BUF_ZV (b)
- && w->current_matrix->begv == BUF_BEGV (b))
+ && w->window_end_valid
+ && w->current_matrix->buffer == b
+ && w->current_matrix->zv == BUF_ZV (b)
+ && w->current_matrix->begv == BUF_BEGV (b))
b->clip_changed = 0;
/* If display wasn't paused, and W is not a tool bar window, see if
we set b->clip_changed to 1 to force updating the screen. If
b->clip_changed has already been set to 1, we can skip this
check. */
- if (!b->clip_changed
- && BUFFERP (w->buffer) && !NILP (w->window_end_valid))
+ if (!b->clip_changed && BUFFERP (w->buffer) && w->window_end_valid)
{
ptrdiff_t pt;
}
\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;
+ /* 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;
- 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);
- }
- }
+ 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 ();
}
-
/* If showing the region, and mark has changed, we must redisplay
the whole window. The assignment to this_line_start_pos prevents
the optimization directly below this if-statement. */
if (((!NILP (Vtransient_mark_mode)
&& !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
- != !NILP (w->region_showing))
- || (!NILP (w->region_showing)
- && !EQ (w->region_showing,
- Fmarker_position (BVAR (XBUFFER (w->buffer), mark)))))
+ != (w->region_showing > 0))
+ || (w->region_showing
+ && w->region_showing
+ != XINT (Fmarker_position (BVAR (XBUFFER (w->buffer), mark)))))
CHARPOS (this_line_start_pos) = 0;
/* Optimize the case that only the line containing the cursor in the
|| 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
else if (XFASTINT (w->window_end_vpos) == this_line_vpos
&& this_line_vpos > 0)
wset_window_end_vpos (w, make_number (this_line_vpos - 1));
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
/* Update hint: No need to try to scroll in update_window. */
w->desired_matrix->no_scrolling_p = 1;
&& (EQ (selected_window,
BVAR (current_buffer, last_selected_window))
|| highlight_nonselected_windows)
- && NILP (w->region_showing)
+ && !w->region_showing
&& NILP (Vshow_trailing_whitespace)
&& !cursor_in_echo_area)
{
}
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)
{
int this_is_visible = 0;
- if (XFRAME (frame)->visible)
- this_is_visible = 1;
- FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
if (XFRAME (frame)->visible)
this_is_visible = 1;
/* 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;
}
-/* Mark the display of window W as accurate or inaccurate. If
- ACCURATE_P is non-zero mark display of W as accurate. If
- ACCURATE_P is zero, arrange for W to be redisplayed the next time
- redisplay_internal is called. */
+/* Mark the display of leaf window W as accurate or inaccurate.
+ If ACCURATE_P is non-zero mark display of W as accurate. If
+ ACCURATE_P is zero, arrange for W to be redisplayed the next
+ time redisplay_internal is called. */
static void
mark_window_display_accurate_1 (struct window *w, int accurate_p)
{
- if (BUFFERP (w->buffer))
- {
- struct buffer *b = XBUFFER (w->buffer);
+ 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_had_star
- = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b);
+ 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 (accurate_p)
- {
- b->clip_changed = 0;
- b->prevent_redisplay_optimizations_p = 0;
+ if (accurate_p)
+ {
+ b->clip_changed = 0;
+ b->prevent_redisplay_optimizations_p = 0;
- BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b);
- BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b);
- BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b);
- BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b);
+ BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b);
+ BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b);
+ BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b);
+ BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b);
- w->current_matrix->buffer = b;
- w->current_matrix->begv = BUF_BEGV (b);
- w->current_matrix->zv = BUF_ZV (b);
+ w->current_matrix->buffer = b;
+ w->current_matrix->begv = BUF_BEGV (b);
+ w->current_matrix->zv = BUF_ZV (b);
- w->last_cursor = w->cursor;
- w->last_cursor_off_p = w->cursor_off_p;
+ w->last_cursor = w->cursor;
+ w->last_cursor_off_p = w->cursor_off_p;
- if (w == XWINDOW (selected_window))
- w->last_point = BUF_PT (b);
- else
- w->last_point = XMARKER (w->pointm)->charpos;
- }
- }
+ if (w == XWINDOW (selected_window))
+ w->last_point = BUF_PT (b);
+ else
+ w->last_point = marker_position (w->pointm);
- if (accurate_p)
- {
- wset_window_end_valid (w, w->buffer);
+ w->window_end_valid = 1;
w->update_mode_line = 0;
}
}
for (; !NILP (window); window = w->next)
{
w = XWINDOW (window);
- mark_window_display_accurate_1 (w, accurate_p);
-
if (!NILP (w->vchild))
mark_window_display_accurate (w->vchild, accurate_p);
- if (!NILP (w->hchild))
+ else if (!NILP (w->hchild))
mark_window_display_accurate (w->hchild, accurate_p);
+ else if (BUFFERP (w->buffer))
+ mark_window_display_accurate_1 (w, accurate_p);
}
if (accurate_p)
- {
- update_overlay_arrows (1);
- }
+ update_overlay_arrows (1);
else
- {
- /* Force a thorough redisplay the next time by setting
- last_arrow_position and last_arrow_string to t, which is
- unequal to any useful value of Voverlay_arrow_... */
- update_overlay_arrows (-1);
- }
+ /* Force a thorough redisplay the next time by setting
+ last_arrow_position and last_arrow_string to t, which is
+ unequal to any useful value of Voverlay_arrow_... */
+ update_overlay_arrows (-1);
}
else
{
struct text_pos scroll_margin_pos = startp;
+ int y_offset = 0;
/* See if point is inside the scroll margin at the top of the
window. */
if (this_scroll_margin)
{
+ int y_start;
+
start_display (&it, w, startp);
+ y_start = it.current_y;
move_it_vertically (&it, this_scroll_margin);
scroll_margin_pos = it.current.pos;
+ /* If we didn't move enough before hitting ZV, request
+ additional amount of scroll, to move point out of the
+ scroll margin. */
+ if (IT_CHARPOS (it) == ZV
+ && it.current_y - y_start < this_scroll_margin)
+ y_offset = this_scroll_margin - (it.current_y - y_start);
}
if (PT < CHARPOS (scroll_margin_pos))
|| IT_CHARPOS (it) < CHARPOS (scroll_margin_pos))
return SCROLLING_FAILED;
+ /* Additional scroll for when ZV was too close to point. */
+ dy += y_offset;
+
/* Compute new window start. */
start_display (&it, w, startp);
if (!just_this_one_p
|| current_buffer->clip_changed
|| BEG_UNCHANGED < CHARPOS (startp))
- wset_base_line_number (w, Qnil);
+ w->base_line_number = 0;
/* If cursor ends up on a partially visible line,
treat that as being off the bottom of the screen. */
SET_TEXT_POS (start_pos, ZV, ZV_BYTE);
/* Find the start of the continued line. This should be fast
- because scan_buffer is fast (newline cache). */
+ because find_newline is fast (newline cache). */
row = w->desired_matrix->rows + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0);
init_iterator (&it, w, CHARPOS (start_pos), BYTEPOS (start_pos),
row, DEFAULT_FACE_ID);
/* 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)))
- && NILP (w->region_showing)
+ && markpos_of_region () < 0
+ && !w->region_showing
&& NILP (Vshow_trailing_whitespace)
/* This code is not used for mini-buffer for the sake of the case
of redisplaying to replace an echo area message; since in
set_buffer_internal_1 (XBUFFER (w->buffer));
current_matrix_up_to_date_p
- = (!NILP (w->window_end_valid)
+ = (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
specbind (Qinhibit_point_motion_hooks, Qt);
buffer_unchanged_p
- = (!NILP (w->window_end_valid)
+ = (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 (XMARKER (w->start)->buffer == current_buffer)
compute_window_start_on_continuation_line (w);
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
}
/* Some sanity checks. */
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)
{
w->force_start = 0;
w->vscroll = 0;
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
/* Forget any recorded base line for line number display. */
if (!buffer_unchanged_p)
- wset_base_line_number (w, Qnil);
+ w->base_line_number = 0;
/* Redisplay the mode line. Select the buffer properly for that.
Also, run the hook window-scroll-functions
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;
|| current_buffer->clip_changed
|| BEG_UNCHANGED < CHARPOS (startp))
/* Forget any recorded base line for line number display. */
- wset_base_line_number (w, Qnil);
+ w->base_line_number = 0;
if (!cursor_row_fully_visible_p (w, 1, 0))
{
debug_method_add (w, "recenter");
#endif
- /* w->vscroll = 0; */
-
/* Forget any previously recorded base line for line number display. */
if (!buffer_unchanged_p)
- wset_base_line_number (w, Qnil);
+ w->base_line_number = 0;
/* Determine the window start relative to point. */
init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
line.) */
if (w->cursor.vpos < 0)
{
- if (!NILP (w->window_end_valid)
- && PT >= Z - XFASTINT (w->window_end_pos))
+ if (w->window_end_valid && PT >= Z - XFASTINT (w->window_end_pos))
{
clear_glyph_matrix (w->desired_matrix);
move_it_by_lines (&it, 1);
&& !FRAME_WINDOW_P (f)
&& !WINDOW_FULL_WIDTH_P (w))
/* Line number to display. */
- || INTEGERP (w->base_line_pos)
+ || w->base_line_pos > 0
/* Column number is displayed and different from the one displayed. */
- || (!NILP (w->column_number_displayed)
- && (XFASTINT (w->column_number_displayed) != current_column ())))
+ || (w->column_number_displayed != -1
+ && (w->column_number_displayed != current_column ())))
/* This means that the window has a mode line. */
&& (WINDOW_WANTS_MODELINE_P (w)
|| WINDOW_WANTS_HEADER_LINE_P (w)))
goto need_larger_matrices;
}
- if (!line_number_displayed
- && !BUFFERP (w->base_line_pos))
+ if (!line_number_displayed && w->base_line_pos != -1)
{
- wset_base_line_pos (w, Qnil);
- wset_base_line_number (w, Qnil);
+ w->base_line_pos = 0;
+ w->base_line_number = 0;
}
finish_menu_bars:
}
/* But that is not valid info until redisplay finishes. */
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
return 1;
}
return 0;
/* Can't do this if region may have changed. */
- if ((!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (current_buffer, mark_active)))
- || !NILP (w->region_showing)
+ if (0 <= markpos_of_region ()
+ || w->region_showing
|| !NILP (Vshow_trailing_whitespace))
return 0;
wset_window_end_pos (w, make_number (Z - ZV));
wset_window_end_vpos (w, make_number (0));
}
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
/* Update hint: don't try scrolling again in update_window. */
w->desired_matrix->no_scrolling_p = 1;
(w, make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled));
}
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
w->desired_matrix->no_scrolling_p = 1;
#ifdef GLYPH_DEBUG
/* Display must not have been paused, otherwise the current matrix
is not up to date. */
- eassert (!NILP (w->window_end_valid));
+ eassert (w->window_end_valid);
/* A value of window_end_pos >= END_UNCHANGED means that the window
end is in the range of changed text. If so, there is no
/* Try to redisplay window W by reusing its existing display. W's
current matrix must be up to date when this function is called,
- i.e. window_end_valid must not be nil.
+ i.e. window_end_valid must be nonzero.
Value is
GIVE_UP (7);
/* Verify that display wasn't paused. */
- if (NILP (w->window_end_valid))
+ if (!w->window_end_valid)
GIVE_UP (8);
/* 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. */
GIVE_UP (11);
/* Likewise if showing a region. */
- if (!NILP (w->region_showing))
+ if (w->region_showing)
GIVE_UP (10);
/* Can't use this if overlay arrow position and/or string have
debug_end_vpos = XFASTINT (w->window_end_vpos));
/* Record that display has not been completed. */
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
w->desired_matrix->no_scrolling_p = 1;
return 3;
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 */
}
/* Is IT->w showing the region? */
- wset_region_showing (it->w, it->region_beg_charpos > 0 ? Qt : Qnil);
+ it->w->region_showing = it->region_beg_charpos > 0 ? it->region_beg_charpos : 0;
/* Clear the result glyph row and enable it. */
prepare_desired_row (row);
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;
- wset_column_number_displayed (w, Qnil);
+ w->column_number_displayed = -1;
if (WINDOW_WANTS_MODELINE_P (w))
{
++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;
returned with spaces to that value. Return a Lisp string in
*STRING if the resulting string is taken from that Lisp string.
- Note we operate on the current buffer for most purposes,
- the exception being w->base_line_pos. */
+ Note we operate on the current buffer for most purposes. */
static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------";
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))
else
{
ptrdiff_t col = current_column ();
- wset_column_number_displayed (w, make_number (col));
+ w->column_number_displayed = col;
pint2str (decode_mode_spec_buf, width, col);
return decode_mode_spec_buf;
}
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);
/* If we decided that this buffer isn't suitable for line numbers,
don't forget that too fast. */
- if (EQ (w->base_line_pos, w->buffer))
+ if (w->base_line_pos == -1)
goto no_value;
- /* But do forget it, if the window shows a different buffer now. */
- else if (BUFFERP (w->base_line_pos))
- wset_base_line_pos (w, Qnil);
/* If the buffer is very big, don't waste time. */
if (INTEGERP (Vline_number_display_limit)
&& BUF_ZV (b) - BUF_BEGV (b) > XINT (Vline_number_display_limit))
{
- wset_base_line_pos (w, Qnil);
- wset_base_line_number (w, Qnil);
+ w->base_line_pos = 0;
+ w->base_line_number = 0;
goto no_value;
}
- if (INTEGERP (w->base_line_number)
- && INTEGERP (w->base_line_pos)
- && XFASTINT (w->base_line_pos) <= startpos)
+ if (w->base_line_number > 0
+ && w->base_line_pos > 0
+ && w->base_line_pos <= startpos)
{
- line = XFASTINT (w->base_line_number);
- linepos = XFASTINT (w->base_line_pos);
+ line = w->base_line_number;
+ linepos = w->base_line_pos;
linepos_byte = buf_charpos_to_bytepos (b, linepos);
}
else
go back past it. */
if (startpos == BUF_BEGV (b))
{
- wset_base_line_number (w, make_number (topline));
- wset_base_line_pos (w, make_number (BUF_BEGV (b)));
+ w->base_line_number = topline;
+ w->base_line_pos = BUF_BEGV (b);
}
else if (nlines < height + 25 || nlines > height * 3 + 50
|| linepos == BUF_BEGV (b))
give up on line numbers for this window. */
if (position == limit_byte && limit == startpos - distance)
{
- wset_base_line_pos (w, w->buffer);
- wset_base_line_number (w, Qnil);
+ w->base_line_pos = -1;
+ w->base_line_number = 0;
goto no_value;
}
- wset_base_line_number (w, make_number (topline - nlines));
- wset_base_line_pos (w, make_number (BYTE_TO_CHAR (position)));
+ w->base_line_number = topline - nlines;
+ w->base_line_pos = BYTE_TO_CHAR (position);
}
/* Now count lines from the start pos to point. */
return "@";
}
- case 't': /* indicate TEXT or BINARY */
- return "T";
-
case 'z':
/* coding-system (not including end-of-line format) */
case 'Z':
ceiling = min (limit_byte - 1, ceiling);
ceiling_addr = BYTE_POS_ADDR (ceiling) + 1;
base = (cursor = BYTE_POS_ADDR (start_byte));
- while (1)
+
+ do
{
if (selective_display)
- while (*cursor != '\n' && *cursor != 015 && ++cursor != ceiling_addr)
- ;
+ {
+ while (*cursor != '\n' && *cursor != 015
+ && ++cursor != ceiling_addr)
+ continue;
+ if (cursor == ceiling_addr)
+ break;
+ }
else
- while (*cursor != '\n' && ++cursor != ceiling_addr)
- ;
+ {
+ cursor = memchr (cursor, '\n', ceiling_addr - cursor);
+ if (! cursor)
+ break;
+ }
- if (cursor != ceiling_addr)
+ cursor++;
+
+ if (--count == 0)
{
- if (--count == 0)
- {
- start_byte += cursor - base + 1;
- *byte_pos_ptr = start_byte;
- return orig_count;
- }
- else
- if (++cursor == ceiling_addr)
- break;
+ start_byte += cursor - base;
+ *byte_pos_ptr = start_byte;
+ return orig_count;
}
- else
- break;
}
- start_byte += cursor - base;
+ while (cursor < ceiling_addr);
+
+ start_byte += ceiling_addr - base;
}
}
else
{
ceiling = BUFFER_FLOOR_OF (start_byte - 1);
ceiling = max (limit_byte, ceiling);
- ceiling_addr = BYTE_POS_ADDR (ceiling) - 1;
+ ceiling_addr = BYTE_POS_ADDR (ceiling);
base = (cursor = BYTE_POS_ADDR (start_byte - 1) + 1);
while (1)
{
if (selective_display)
- while (--cursor != ceiling_addr
- && *cursor != '\n' && *cursor != 015)
- ;
+ {
+ while (--cursor >= ceiling_addr
+ && *cursor != '\n' && *cursor != 015)
+ continue;
+ if (cursor < ceiling_addr)
+ break;
+ }
else
- while (--cursor != ceiling_addr && *cursor != '\n')
- ;
+ {
+ cursor = memrchr (ceiling_addr, '\n', cursor - ceiling_addr);
+ if (! cursor)
+ break;
+ }
- if (cursor != ceiling_addr)
+ if (++count == 0)
{
- if (++count == 0)
- {
- start_byte += cursor - base + 1;
- *byte_pos_ptr = start_byte;
- /* When scanning backwards, we should
- not count the newline posterior to which we stop. */
- return - orig_count - 1;
- }
+ start_byte += cursor - base + 1;
+ *byte_pos_ptr = start_byte;
+ /* When scanning backwards, we should
+ not count the newline posterior to which we stop. */
+ return - orig_count - 1;
}
- else
- break;
}
- /* Here we add 1 to compensate for the last decrement
- of CURSOR, which took it past the valid range. */
- start_byte += cursor - base + 1;
+ start_byte += ceiling_addr - base;
}
}
/* 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);
And verify the buffer's text has not changed. */
b = XBUFFER (w->buffer);
if (part == ON_TEXT
- && EQ (w->window_end_valid, w->buffer)
+ && w->window_end_valid
&& w->last_modified == BUF_MODIFF (b)
&& w->last_overlay_modified == BUF_OVERLAY_MODIFF (b))
{
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);
}
for (i = nfonts - 1; i >= 0; --i)
{
Lisp_Object font = AREF (vec, i);
- Lisp_Object v = Fmake_vector (make_number (8), Qnil);
+ Lisp_Object v = make_uninit_vector (8);
int point;
Lisp_Object spacing;
/* 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;
static Lisp_Object
clean_up_file_dialog (Lisp_Object arg)
{
- struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
- Widget dialog = (Widget) p->pointer;
+ Widget dialog = XSAVE_POINTER (arg, 0);
/* Clean up. */
block_input ();
XmStringFree (default_xmstring);
}
- record_unwind_protect (clean_up_file_dialog, make_save_value (dialog, 0));
+ record_unwind_protect (clean_up_file_dialog, make_save_pointer (dialog));
/* Process events until the user presses Cancel or OK. */
x_menu_set_in_use (1);
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;
static Lisp_Object
pop_down_menu (Lisp_Object arg)
{
- struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
-
popup_activated_flag = 0;
block_input ();
- gtk_widget_destroy (GTK_WIDGET (p->pointer));
+ gtk_widget_destroy (GTK_WIDGET (XSAVE_POINTER (arg, 0)));
unblock_input ();
return Qnil;
}
gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i,
timestamp ? timestamp : gtk_get_current_event_time ());
- record_unwind_protect (pop_down_menu, make_save_value (menu, 0));
+ record_unwind_protect (pop_down_menu, make_save_pointer (menu));
if (gtk_widget_get_mapped (menu))
{
static Lisp_Object
cleanup_widget_value_tree (Lisp_Object arg)
{
- struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
- widget_value *wv = p->pointer;
-
- free_menubar_widget_value_tree (wv);
-
+ free_menubar_widget_value_tree (XSAVE_POINTER (arg, 0));
return Qnil;
}
/* Make sure to free the widget_value objects we used to specify the
contents even with longjmp. */
record_unwind_protect (cleanup_widget_value_tree,
- make_save_value (first_wv, 0));
+ make_save_pointer (first_wv));
/* Actually create and show the menu until popped down. */
create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp);
if (menu)
{
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
- record_unwind_protect (pop_down_menu, make_save_value (menu, 0));
+ record_unwind_protect (pop_down_menu, make_save_pointer (menu));
/* Display the menu. */
gtk_widget_show_all (menu);
/* Make sure to free the widget_value objects we used to specify the
contents even with longjmp. */
record_unwind_protect (cleanup_widget_value_tree,
- make_save_value (first_wv, 0));
+ make_save_pointer (first_wv));
/* Actually create and show the dialog. */
create_and_show_dialog (f, first_wv);
static Lisp_Object
pop_down_menu (Lisp_Object arg)
{
- struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg));
- struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg));
-
- FRAME_PTR f = p1->pointer;
- XMenu *menu = p2->pointer;
+ FRAME_PTR f = XSAVE_POINTER (arg, 0);
+ XMenu *menu = XSAVE_POINTER (arg, 1);
block_input ();
#ifndef MSDOS
#endif
record_unwind_protect (pop_down_menu,
- Fcons (make_save_value (f, 0),
- make_save_value (menu, 0)));
+ make_save_value ("pp", f, menu));
/* Help display under X won't work because XMenuActivate contains
a loop that doesn't give Emacs a chance to process it. */
xmlDoc *doc;
Lisp_Object result = Qnil;
const char *burl = "";
- ptrdiff_t bytes;
- ptrdiff_t istart, iend;
+ ptrdiff_t istart, iend, istart_byte, iend_byte;
fn_xmlCheckVersion (LIBXML_VERSION);
istart = XINT (start);
iend = XINT (end);
+ istart_byte = CHAR_TO_BYTE (istart);
+ iend_byte = CHAR_TO_BYTE (iend);
if (istart < GPT && GPT < iend)
- move_gap (iend);
+ move_gap_both (iend, iend_byte);
if (! NILP (base_url))
{
burl = SSDATA (base_url);
}
- bytes = CHAR_TO_BYTE (iend) - CHAR_TO_BYTE (istart);
-
if (htmlp)
- doc = fn_htmlReadMemory ((char *) BYTE_POS_ADDR (CHAR_TO_BYTE (istart)),
- bytes, burl, "utf-8",
+ doc = fn_htmlReadMemory ((char *) BYTE_POS_ADDR (istart_byte),
+ iend_byte - istart_byte, burl, "utf-8",
HTML_PARSE_RECOVER|HTML_PARSE_NONET|
HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR|
HTML_PARSE_NOBLANKS);
else
- doc = fn_xmlReadMemory ((char *) BYTE_POS_ADDR (CHAR_TO_BYTE (istart)),
- bytes, burl, "utf-8",
+ doc = fn_xmlReadMemory ((char *) BYTE_POS_ADDR (istart_byte),
+ iend_byte - istart_byte, burl, "utf-8",
XML_PARSE_NONET|XML_PARSE_NOWARNING|
XML_PARSE_NOBLANKS |XML_PARSE_NOERROR);
#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 Lisp_Object
wait_for_property_change_unwind (Lisp_Object loc)
{
- struct prop_location *location = XSAVE_VALUE (loc)->pointer;
+ struct prop_location *location = XSAVE_POINTER (loc, 0);
unexpect_property_change (location);
if (location == property_change_reply_object)
/* Make sure to do unexpect_property_change if we quit or err. */
record_unwind_protect (wait_for_property_change_unwind,
- make_save_value (location, 0));
+ make_save_pointer (location));
XSETCAR (property_change_reply, Qnil);
property_change_reply_object = location;
return x_atom_to_symbol (display, (Atom) idata[0]);
else
{
- Lisp_Object v = Fmake_vector (make_number (size / sizeof (int)),
- make_number (0));
+ Lisp_Object v = make_uninit_vector (size / sizeof (int));
+
for (i = 0; i < size / sizeof (int); i++)
- Faset (v, make_number (i),
- x_atom_to_symbol (display, (Atom) idata[i]));
+ ASET (v, i, x_atom_to_symbol (display, (Atom) idata[i]));
return v;
}
}
else if (format == 16)
{
ptrdiff_t i;
- Lisp_Object v;
- v = Fmake_vector (make_number (size / 2), make_number (0));
+ Lisp_Object v = make_uninit_vector (size / 2);
+
for (i = 0; i < size / 2; i++)
{
short j = ((short *) data) [i];
- Faset (v, make_number (i), make_number (j));
+ ASET (v, i, make_number (j));
}
return v;
}
else
{
ptrdiff_t i;
- Lisp_Object v = Fmake_vector (make_number (size / X_LONG_SIZE),
- make_number (0));
+ Lisp_Object v = make_uninit_vector (size / X_LONG_SIZE);
+
for (i = 0; i < size / X_LONG_SIZE; i++)
{
int j = ((int *) data) [i];
- Faset (v, make_number (i), INTEGER_TO_CONS (j));
+ ASET (v, i, INTEGER_TO_CONS (j));
}
return v;
}
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;
+ Lisp_Object tail, frame;
- 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;
-
- 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;
}
#ifdef USE_MOTIF
- /* We use an estimate of 30 chars per line rather than the real
- `portion' value. This has the disadvantage that the thumb size
- is not very representative, but it makes our life a lot easier.
- Otherwise, we have to constantly adjust the thumb size, which
- we can't always do quickly enough: while dragging, the size of
- the thumb might prevent the user from dragging the thumb all the
- way to the end. but Motif and some versions of Xaw3d don't allow
- updating the thumb size while dragging. Also, even if we can update
- its size, the update will often happen too late.
- If you don't believe it, check out revision 1.650 of xterm.c to see
- what hoops we were going through and the still poor behavior we got. */
- portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
- /* When the thumb is at the bottom, position == whole.
- So we need to increase `whole' to make space for the thumb. */
- whole += portion;
+ if (scroll_bar_adjust_thumb_portion_p)
+ {
+ /* We use an estimate of 30 chars per line rather than the real
+ `portion' value. This has the disadvantage that the thumb size
+ is not very representative, but it makes our life a lot easier.
+ Otherwise, we have to constantly adjust the thumb size, which
+ we can't always do quickly enough: while dragging, the size of
+ the thumb might prevent the user from dragging the thumb all the
+ way to the end. but Motif and some versions of Xaw3d don't allow
+ updating the thumb size while dragging. Also, even if we can update
+ its size, the update will often happen too late.
+ If you don't believe it, check out revision 1.650 of xterm.c to see
+ what hoops we were going through and the still poor behavior we got. */
+ portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
+ /* When the thumb is at the bottom, position == whole.
+ So we need to increase `whole' to make space for the thumb. */
+ whole += portion;
+ }
if (whole <= 0)
top = 0, shown = 1;
/* 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;
last_user_time = event.xproperty.time;
f = x_top_window_to_frame (dpyinfo, event.xproperty.window);
if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state)
- if (x_handle_net_wm_state (f, &event.xproperty) && f->iconified
- && f->output_data.x->net_wm_state_hidden_seen)
+ if (x_handle_net_wm_state (f, &event.xproperty)
+ && FRAME_ICONIFIED_P (f)
+ && f->output_data.x->net_wm_state_hidden_seen)
{
- /* Gnome shell does not iconify us when C-z is pressed. It hides
- the frame. So if our state says we aren't hidden anymore,
- treat it as deiconified. */
- if (! f->async_iconified)
- SET_FRAME_GARBAGED (f);
- f->async_visible = 1;
- f->async_iconified = 0;
+ /* Gnome shell does not iconify us when C-z is pressed.
+ It hides the frame. So if our state says we aren't
+ hidden anymore, treat it as deiconified. */
+ SET_FRAME_VISIBLE (f, 1);
+ SET_FRAME_ICONIFIED (f, 0);
f->output_data.x->has_been_visible = 1;
f->output_data.x->net_wm_state_hidden_seen = 0;
inev.ie.kind = DEICONIFY_EVENT;
event.xexpose.width, event.xexpose.height,
FALSE);
#endif
- if (f->async_visible == 0)
+ if (!FRAME_VISIBLE_P (f))
{
- f->async_visible = 1;
- f->async_iconified = 0;
+ SET_FRAME_VISIBLE (f, 1);
+ SET_FRAME_ICONIFIED (f, 0);
f->output_data.x->has_been_visible = 1;
SET_FRAME_GARBAGED (f);
}
if (f) /* F may no longer exist if
the frame was deleted. */
{
+ bool visible = FRAME_VISIBLE_P (f);
/* While a frame is unmapped, display generation is
disabled; you don't want to spend time updating a
display that won't ever be seen. */
- f->async_visible = 0;
+ SET_FRAME_VISIBLE (f, 0);
/* We can't distinguish, from the event, whether the window
has become iconified or invisible. So assume, if it
was previously visible, than now it is iconified.
But x_make_frame_invisible clears both
the visible flag and the iconified flag;
and that way, we know the window is not iconified now. */
- if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f))
+ if (visible || FRAME_ICONIFIED_P (f))
{
- f->async_iconified = 1;
-
+ SET_FRAME_ICONIFIED (f, 1);
inev.ie.kind = ICONIFY_EVENT;
XSETFRAME (inev.ie.frame_or_window, f);
}
f = x_top_window_to_frame (dpyinfo, event.xmap.window);
if (f)
{
+ bool iconified = FRAME_ICONIFIED_P (f);
/* wait_reading_process_output will notice this and update
the frame's display structures.
If we where iconified, we should not set garbaged,
because that stops redrawing on Expose events. This looks
bad if we are called from a recursive event loop
(x_dispatch_event), for example when a dialog is up. */
- if (! f->async_iconified)
+ if (!iconified)
SET_FRAME_GARBAGED (f);
/* Check if fullscreen was specified before we where mapped the
if (!f->output_data.x->has_been_visible)
x_check_fullscreen (f);
- f->async_visible = 1;
- f->async_iconified = 0;
+ SET_FRAME_VISIBLE (f, 1);
+ SET_FRAME_ICONIFIED (f, 0);
f->output_data.x->has_been_visible = 1;
- if (f->iconified)
+ if (iconified)
{
inev.ie.kind = DEICONIFY_EVENT;
XSETFRAME (inev.ie.frame_or_window, f);
}
- else if (! NILP (Vframe_list)
- && ! NILP (XCDR (Vframe_list)))
- /* Force a redisplay sooner or later
- to update the frame titles
- in case this is the second frame. */
+ else if (! NILP (Vframe_list) && ! NILP (XCDR (Vframe_list)))
+ /* Force a redisplay sooner or later to update the
+ frame titles in case this is the second frame. */
record_asynch_buffer_change ();
#ifdef USE_GTK
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);
if (tmp_data) XFree (tmp_data);
x_uncatch_errors ();
unblock_input ();
- return ! f->iconified;
+ return !FRAME_ICONIFIED_P (f);
}
x_uncatch_errors ();
static void
XTfullscreen_hook (FRAME_PTR f)
{
- if (f->async_visible)
+ if (FRAME_VISIBLE_P (f))
{
block_input ();
x_check_fullscreen (f);
/* But the ConfigureNotify may in fact never arrive, and then this is
not right if the frame is visible. Instead wait (with timeout)
for the ConfigureNotify. */
- if (f->async_visible)
+ if (FRAME_VISIBLE_P (f))
x_wait_for_event (f, ConfigureNotify);
else
{
x_raise_frame (struct frame *f)
{
block_input ();
- if (f->async_visible)
+ if (FRAME_VISIBLE_P (f))
XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
-
XFlush (FRAME_X_DISPLAY (f));
unblock_input ();
}
static void
x_lower_frame (struct frame *f)
{
- if (f->async_visible)
+ if (FRAME_VISIBLE_P (f))
{
block_input ();
XLowerWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
{
/* See XEmbed Protocol Specification at
http://freedesktop.org/wiki/Specifications/xembed-spec */
- if (f->async_visible)
+ if (FRAME_VISIBLE_P (f))
xembed_send_message (f, CurrentTime,
XEMBED_REQUEST_FOCUS, 0, 0, 0);
}
http://freedesktop.org/wiki/Specifications/wm-spec */
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
- if (f->async_visible && wm_supports (f, dpyinfo->Xatom_net_active_window))
+
+ if (FRAME_VISIBLE_P (f) && wm_supports (f, dpyinfo->Xatom_net_active_window))
{
Lisp_Object frame;
XSETFRAME (frame, f);
poll_for_input_1 ();
poll_suppress_count = old_poll_suppress_count;
}
-
- /* See if a MapNotify event has been processed. */
- FRAME_SAMPLE_VISIBILITY (f);
}
/* 2000-09-28: In
So we can't win using the usual strategy of letting
FRAME_SAMPLE_VISIBILITY set this. So do it by hand,
and synchronize with the server to make sure we agree. */
- f->visible = 0;
- FRAME_ICONIFIED_P (f) = 0;
- f->async_visible = 0;
- f->async_iconified = 0;
+ SET_FRAME_VISIBLE (f, 0);
+ SET_FRAME_ICONIFIED (f, 0);
x_sync (f);
if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f)
FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0;
- if (f->async_iconified)
+ if (FRAME_ICONIFIED_P (f))
return;
block_input ();
- FRAME_SAMPLE_VISIBILITY (f);
-
type = x_icon_type (f);
if (!NILP (type))
x_bitmap_icon (f, type);
gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
gtk_window_iconify (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
- f->iconified = 1;
- f->visible = 1;
- f->async_iconified = 1;
- f->async_visible = 0;
+ SET_FRAME_VISIBLE (f, 0);
+ SET_FRAME_ICONIFIED (f, 1);
unblock_input ();
return;
}
/* The server won't give us any event to indicate
that an invisible frame was changed to an icon,
so we have to record it here. */
- f->iconified = 1;
- f->visible = 1;
- f->async_iconified = 1;
- f->async_visible = 0;
+ SET_FRAME_VISIBLE (f, 0);
+ SET_FRAME_ICONIFIED (f, 1);
unblock_input ();
return;
}
if (!result)
error ("Can't notify window manager of iconification");
- f->async_iconified = 1;
- f->async_visible = 0;
-
+ SET_FRAME_ICONIFIED (f, 1);
+ SET_FRAME_VISIBLE (f, 0);
block_input ();
XFlush (FRAME_X_DISPLAY (f));
XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
}
- f->async_iconified = 1;
- f->async_visible = 0;
+ SET_FRAME_ICONIFIED (f, 1);
+ SET_FRAME_VISIBLE (f, 0);
XFlush (FRAME_X_DISPLAY (f));
unblock_input ();
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;
Vx_toolkit_scroll_bars = Qnil;
#endif
+ DEFVAR_BOOL ("scroll-bar-adjust-thumb-portion",
+ scroll_bar_adjust_thumb_portion_p,
+ doc: /* Adjust thumb for overscrolling for Gtk+ and MOTIF.
+Non-nil means adjust the thumb in the scroll bar so it can be dragged downwards
+even if the end of the buffer is shown (i.e. overscrolling).
+Set to nil if you want the thumb to be at the bottom when the end of the buffer
+is shown. Also, the thumb fills the whole scroll bar when the entire buffer
+is visible. In this case you can not overscroll. */);
+ scroll_bar_adjust_thumb_portion_p = 1;
+
staticpro (&last_mouse_motion_frame);
last_mouse_motion_frame = Qnil;
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-02-04 Chong Yidong <cyd@gnu.org>
+
+ * automated/thingatpt.el: New file.
+
+2013-02-03 Chong Yidong <cyd@gnu.org>
+
+ * automated/files.el (file-test--do-local-variables-test): Avoid
+ compilation warning message.
+
+2013-01-27 Dmitry Gutov <dgutov@yandex.ru>
+
+ * automated/ruby-mode-tests.el
+ (ruby-indent-spread-args-in-parens): New test.
+ * automated/ruby-mode-tests.el (ruby-block-test-example):
+ Break indentation of the do block opener and add a line inside it.
+ * automated/ruby-mode-tests.el (works-on-do, ok-with-three):
+ Adjust line numbers.
+
+2013-01-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * automated/advice-tests.el: Split up. Add advice-test-preactivate.
+
+2013-01-14 Glenn Morris <rgm@gnu.org>
+
+ * automated/compile-tests.el (compile-tests--test-regexps-data):
+ Fix interpretation of gnu line.col1-col2 format. (Bug#13335)
+
+2013-01-10 Wolfgang Jenkner <wjenkner@inode.at>
+
+ * automated/man-tests.el: New file.
+
+2013-01-09 Aaron S. Hawley <aaron.s.hawley@gmail.com>
+
+ * automated/undo-tests.el (undo-test0): Adjust error to code change.
+
+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-nadvice ()
+ "Test nadvice code."
+ (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 (get 'sm-test1 'defalias-fset-function) nil))
+
+ (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)))))
+
+(ert-deftest advice-tests-advice ()
+ "Test advice code."
+ (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))
+
+ (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))))
+
+ ;; This used to signal an error (bug#12858).
+ (autoload 'sm-test6 "foo")
+ (defadvice sm-test6 (around test activate)
+ ad-do-it))
+
+(ert-deftest advice-tests-combination ()
+ "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)))
+
+(ert-deftest advice-test-called-interactively-p ()
+ "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))))
+
+(ert-deftest advice-test-interactive ()
+ "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"))))
+
+(ert-deftest advice-test-preactivate ()
+ (should (equal (null (get 'sm-test9 'defalias-fset-function)) t))
+ (defun sm-test9 (a) (interactive "p") a)
+ (should (equal (null (get 'sm-test9 'defalias-fset-function)) t))
+ (defadvice sm-test9 (before adv1 pre act protect compile) nil)
+ (should (equal (null (get 'sm-test9 'defalias-fset-function)) nil))
+ (defadvice sm-test9 (before adv2 pre act protect compile)
+ (interactive "P") nil)
+ (should (equal (interactive-form 'sm-test9) '(interactive "P"))))
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
+;;; advice-tests.el ends here.
("foo.c:8.23: note: message" 1 23 8 "foo.c")
("foo.c:8.23: info: message" 1 23 8 "foo.c")
("foo.c:8:23:information: message" 1 23 8 "foo.c")
- ("foo.c:8.23-45: Informational: message" 1 (23 . nil) (8 . 45) "foo.c")
+ ("foo.c:8.23-45: Informational: message" 1 (23 . 46) (8 . nil) "foo.c")
("foo.c:8-23: message" 1 nil (8 . 23) "foo.c")
+ ;; The next one is not in the GNU standards AFAICS.
+ ;; Here we seem to interpret it as LINE1-LINE2.COL2.
("foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c")
("foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c")
("jade:dbcommon.dsl:133:17:E: missing argument for function call"
-;;; 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
;; Set to t if the local variable was set, `query' if the query was
;; triggered.
-(defvar files-test-result)
+(defvar files-test-result nil)
-(defvar files-test-safe-result)
+(defvar files-test-safe-result nil)
(put 'files-test-safe-result 'safe-local-variable 'booleanp)
(defun files-test-fun1 ()
(defun file-test--do-local-variables-test (str test-settings)
(with-temp-buffer
(insert str)
+ (setq files-test-result nil
+ files-test-safe-result nil)
(let ((enable-local-variables (nth 0 test-settings))
(enable-local-eval (nth 1 test-settings))
- (files-test-result nil)
- (files-test-queried nil)
- (files-test-safe-result nil))
+ (files-test-queried nil))
(hack-local-variables)
(eval (nth 2 test-settings)))))
--- /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.
--- /dev/null
+;;; man-tests.el --- Test suite for man.
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;; Author: Wolfgang Jenkner <wjenkner@inode.at>
+;; Keywords: help, internal, unix
+
+;; 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)
+(require 'man)
+
+(defconst man-tests-parse-man-k-tests
+ '(;; GNU/Linux: man-db-2.6.1
+ ("\
+sin (3) - sine function
+sinf (3) - sine function
+sinl (3) - sine function"
+ . (#("sin(3)" 0 6 (help-echo "sine function")) #("sinf(3)" 0 7 (help-echo "sine function")) #("sinl(3)" 0 7 (help-echo "sine function"))))
+ ;; GNU/Linux: man-1.6g
+ ("\
+sin (3) - sine function
+sinf [sin] (3) - sine function
+sinl [sin] (3) - sine function"
+ . (#("sin(3)" 0 6 (help-echo "sine function")) #("sinf(3)" 0 7 (help-echo "sine function")) #("sinl(3)" 0 7 (help-echo "sine function"))))
+ ;; FreeBSD 9
+ ("\
+sin(3), sinf(3), sinl(3) - sine functions"
+ . (#("sin(3)" 0 6 (help-echo "sine functions")) #("sinf(3)" 0 7 (help-echo "sine functions")) #("sinl(3)" 0 7 (help-echo "sine functions"))))
+ ;; SunOS, Solaris
+ ;; http://docs.oracle.com/cd/E19455-01/805-6331/usradm-7/index.html
+ ;; SunOS 4
+ ("\
+tset, reset (1) - establish or restore terminal characteristics"
+ . (#("tset(1)" 0 7 (help-echo "establish or restore terminal characteristics")) #("reset(1)" 0 8 (help-echo "establish or restore terminal characteristics"))))
+ ;; SunOS 5.7, Solaris
+ ("\
+reset tset (1b) - establish or restore terminal characteristics
+tset tset (1b) - establish or restore terminal characteristics"
+ . (#("reset(1b)" 0 8 (help-echo "establish or restore terminal characteristics")) #("tset(1b)" 0 7 (help-echo "establish or restore terminal characteristics"))))
+ ;; Minix 3
+ ;; http://www.minix3.org/manpages/html5/whatis.html
+ ("\
+cawf, nroff (1) - C version of the nroff-like, Amazingly Workable (text) Formatter
+whatis (5) - database of online manual pages"
+ . (#("cawf(1)" 0 7 (help-echo "C version of the nroff-like, Amazingly Workable (text) Formatter")) #("nroff(1)" 0 8 (help-echo "C version of the nroff-like, Amazingly Workable (text) Formatter")) #("whatis(5)" 0 9 (help-echo "database of online manual pages"))))
+ ;; HP-UX
+ ;; http://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/man.1.html
+ ;; Assuming that the line break in the zgrep description was
+ ;; introduced by the man page formatting.
+ ("\
+grep, egrep, fgrep (1) - search a file for a pattern
+zgrep(1) - search possibly compressed files for a regular expression"
+ . (#("grep(1)" 0 7 (help-echo "search a file for a pattern")) #("egrep(1)" 0 8 (help-echo "search a file for a pattern")) #("fgrep(1)" 0 8 (help-echo "search a file for a pattern")) #("zgrep(1)" 0 8 (help-echo "search possibly compressed files for a regular expression"))))
+ ;; AIX
+ ;; http://pic.dhe.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix.cmds/doc/aixcmds6/whatis.htm
+ ("\
+ls(1) -Displays the contents of a directory."
+ . (#("ls(1)" 0 5 (help-echo "Displays the contents of a directory."))))
+ ;; https://www.ibm.com/developerworks/mydeveloperworks/blogs/cgaix/entry/catman_0703_102_usr_lbin_mkwhatis_the_error_number_is_1?lang=en
+ ("\
+loopmount(1) - Associate an image file to a loopback device."
+ . (#("loopmount(1)" 0 12 (help-echo "Associate an image file to a loopback device."))))
+ )
+ "List of tests for `Man-parse-man-k'.
+Each element is a cons cell whose car is a string containing
+man -k output. That should result in the table which is stored
+in the cdr of the element.")
+
+(defun man-tests-name-equal-p (name description string)
+ (and (equal name string)
+ (not (next-single-property-change 0 'help-echo string))
+ (equal (get-text-property 0 'help-echo string) description)))
+
+(defun man-tests-parse-man-k-test-case (test)
+ (let ((temp-buffer (get-buffer-create " *test-man*"))
+ (man-k-output (car test)))
+ (unwind-protect
+ (save-window-excursion
+ (with-current-buffer temp-buffer
+ (erase-buffer)
+ (insert man-k-output)
+ (let ((result (Man-parse-man-k))
+ (checklist (cdr test)))
+ (while (and checklist result
+ (man-tests-name-equal-p
+ (car checklist)
+ (get-text-property 0 'help-echo
+ (car checklist))
+ (pop result)))
+ (pop checklist))
+ (and (null checklist) (null result)))))
+ (and (buffer-name temp-buffer)
+ (kill-buffer temp-buffer)))))
+
+(ert-deftest man-tests ()
+ "Test man."
+ (dolist (test man-tests-parse-man-k-tests)
+ (should (man-tests-parse-man-k-test-case test))))
+
+(provide 'man-tests)
+
+;;; man-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
|end
|statement"))
+(ert-deftest ruby-indent-spread-args-in-parens ()
+ (let ((ruby-deep-indent-paren '(?\()))
+ (ruby-should-indent-buffer
+ "foo(1,
+ | 2,
+ | 3)
+ |"
+ "foo(1,
+ | 2,
+ | 3)
+ |")))
+
(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
+ |3
+ | 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 (= 13 (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 (= 14 (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
+;;; thingatpt.el --- tests for thing-at-point.
+
+;; Copyright (C) 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/>.
+
+;;; Code:
+
+(require 'ert)
+
+(defvar thing-at-point-test-data
+ '(("http://1.gnu.org" 1 url "http://1.gnu.org")
+ ("http://2.gnu.org" 6 url "http://2.gnu.org")
+ ("http://3.gnu.org" 19 url "http://3.gnu.org")
+ ("https://4.gnu.org" 1 url "https://4.gnu.org")
+ ("bzr://savannah.gnu.org" 1 url "bzr://savannah.gnu.org")
+ ("A geo URI (geo:3.14159,-2.71828)." 12 url "geo:3.14159,-2.71828")
+ ("Visit http://5.gnu.org now." 5 url nil)
+ ("Visit http://6.gnu.org now." 7 url "http://6.gnu.org")
+ ("Visit http://7.gnu.org now." 22 url "http://7.gnu.org")
+ ("Visit http://8.gnu.org now." 22 url "http://8.gnu.org")
+ ("Visit http://9.gnu.org now." 24 url nil)
+ ;; Invalid URIs
+ ("<<<<" 2 url nil)
+ ("<>" 1 url nil)
+ ("<url:>" 1 url nil)
+ ("http://" 1 url nil)
+ ;; Invalid schema
+ ("foo://www.gnu.org" 1 url nil)
+ ("foohttp://www.gnu.org" 1 url nil)
+ ;; Non alphanumeric characters can be found in URIs
+ ("ftp://example.net/~foo!;#bar=baz&goo=bob" 3 url "ftp://example.net/~foo!;#bar=baz&goo=bob")
+ ("bzr+ssh://user@example.net:5/a%20d,5" 34 url "bzr+ssh://user@example.net:5/a%20d,5")
+ ;; <url:...> markup
+ ("Url: <url:foo://1.example.com>..." 8 url "foo://1.example.com")
+ ("Url: <url:foo://2.example.com>..." 30 url "foo://2.example.com")
+ ("Url: <url:foo://www.gnu.org/a bc>..." 20 url "foo://www.gnu.org/a bc")
+ ;; Hack used by thing-at-point: drop punctuation at end of URI.
+ ("Go to http://www.gnu.org, for details" 7 url "http://www.gnu.org")
+ ("Go to http://www.gnu.org." 24 url "http://www.gnu.org")
+ ;; Standard URI delimiters
+ ("Go to \"http://10.gnu.org\"." 8 url "http://10.gnu.org")
+ ("Go to \"http://11.gnu.org/\"." 26 url "http://11.gnu.org/")
+ ("Go to <http://12.gnu.org> now." 8 url "http://12.gnu.org")
+ ("Go to <http://13.gnu.org> now." 24 url "http://13.gnu.org")
+ ;; Parenthesis handling (non-standard)
+ ("http://example.com/a(b)c" 21 url "http://example.com/a(b)c")
+ ("http://example.com/a(b)" 21 url "http://example.com/a(b)")
+ ("(http://example.com/abc)" 2 url "http://example.com/abc")
+ ("This (http://example.com/a(b))" 7 url "http://example.com/a(b)")
+ ("This (http://example.com/a(b))" 30 url "http://example.com/a(b)")
+ ("This (http://example.com/a(b))" 5 url nil)
+ ("http://example.com/ab)c" 4 url "http://example.com/ab)c")
+ ;; URL markup, lacking schema
+ ("<url:foo@example.com>" 1 url "mailto:foo@example.com")
+ ("<url:ftp.example.net/abc/>" 1 url "ftp://ftp.example.net/abc/"))
+ "List of thing-at-point tests.
+Each list element should have the form
+
+ (STRING POS THING RESULT)
+
+where STRING is a string of buffer contents, POS is the value of
+point, THING is a symbol argument for `thing-at-point', and
+RESULT should be the result of calling `thing-at-point' from that
+position to retrieve THING.")
+
+(ert-deftest thing-at-point-tests ()
+ "Test the file-local variables implementation."
+ (dolist (test thing-at-point-test-data)
+ (with-temp-buffer
+ (insert (nth 0 test))
+ (goto-char (nth 1 test))
+ (should (equal (thing-at-point (nth 2 test)) (nth 3 test))))))
+
+;;; thingatpt.el ends here
--- /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 number-or-marker-p 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
{$gnu-pascal,I+}
+// Free-pascal style comment.
+
program CRTDemo;
uses GPC, CRT;
# 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