diff --git a/ChangeLog b/ChangeLog index 7d1c19a535e..d6260f6c228 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,108 @@ +2012-09-17 Andreas Schwab + + * Makefile.in (bootstrap): Revert last change. Run config.status + after config.status --recheck, run configure from $(srcdir). + (config.status): Run configure from $(srcdir). + +2012-09-17 Paul Eggert + + * Makefile.in: Fix build error on FreeBSD. + ($(MAKEFILE_NAME)): Pass MAKE='$(MAKE)' to config.status's env. + Suggested by Wolfgang Jenker in + . + (MAKE_CONFIG_STATUS): Remove. Remaining use expanded. + This undoes part of the 2012-09-10 patch. + (bootstrap): Run ./configure, rather than trying to run config.status + if it exists. That builds src/epaths.h more reliably. + Run autogen/copy_autogen if autogen.sh fails, + to create 'configure'; problem reported by Andreas Schwab in + . + * autogen.sh: Exit with status 1 when failing due to missing tools, + reverting the 2012-09-10 change to this file. + * autogen/copy_autogen: Fail if one of the subsidiary actions fail. + Use 'cp -f' for the build-aux files, since the destinations are + typically read-only. + + Remove no-longer-needed Solaris 2.4 vfork bug workaround. + * configure.ac (ac_cv_func_vfork_works): Default to 'no' on + Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works. + +2012-09-17 Glenn Morris + + * configure.ac (copyright): New output variable. + (COPYRIGHT): New AC_DEFINE. + +2012-09-16 Paul Eggert + + Remove configure's --without-sync-input option (Bug#12450). + * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove. + +2012-09-16 Glenn Morris + + Increase compartmentalization of Nextstep builds rules, + and store Emacs version number in fewer versioned files. + * configure.ac (ns_appsrc): Use relative names. + (ns_frag): Remove. + (Info-gnustep.plist, Emacs.desktop, Info.plist, InfoPlist.strings) + (nextstep/Makefile): Generate these nextstep files. + (SUBDIR_MAKEFILES): Add nextstep. + * Makefile.in (clean, distclean, bootstrap-clean): Add nextstep. + * make-dist (nextstep/templates): Add directory. + (nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj): Remove. + (nextstep/Cocoa/Emacs.base/Contents) + (nextstep, nextstep/GNUstep/Emacs.base/Resources): Update contents. + +2012-09-15 Paul Eggert + + Port better to POSIX hosts lacking _setjmp (Bug#12446). + * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. + (_setjmp, _longjmp): Remove. + +2012-09-14 Paul Eggert + + * configure.ac (--without-sync-input): Fix typo in usage message. + + * configure.ac: Port to hosts lacking gtk. + (PKG_CHECK_MODULES): Capture pkg-config diagnostics + better, in particular, problems in invoking pkg-config itself. + This is useful on hosts that don't have pkg-config. + (GTK_MODULES): Do not exit 'configure' simply because gtk3 + and gtk2 are both missing. Problem found on Solaris 8. + +2012-09-13 Jan Djärv + + * configure.ac: Reorder Xaw3d messages. + Report Gtk+ 3 as GTK. + +2012-09-13 Paul Eggert + + Simplify SIGIO usage (Bug#12408). + * configure.ac (NO_TERMIO, BROKEN_FIONREAD, BROKEN_SIGAIO) + (BROKEN_SIGPOLL, BROKEN_SIGPTY): Remove. + (USABLE_FIONREAD, USABLE_SIGIO): New symbols. All uses of + 'defined SIGIO' replaced with 'defined USABLE_SIGIO', with no need + to #undef SIGIO now (which was error-prone). Likewise, all uses + of 'defined FIONREAD' replaced with 'defined USABLE_FIONREAD'. + +2012-09-12 Jan Djärv + + * configure.ac: No --with-x-toolkit given: Try gtk3 toolkit first + and then gtk2 if not found. + --with-x-toolkit=gtk|yes: As above, but fail if gtk2 or gt3 not found. + --with-x-toolkit=gtk2: Only try gtk2, fail if not found. + --with-x-toolkit=gtk3: Only try gtk3, fail if not found. + +2012-09-11 Glenn Morris + + * Makefile.in (install-arch-dep, install-arch-indep, install-doc): + Be more explicit about dependencies, for parallel `make install'. + +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + * configure.ac (logb, cbrt): Do not check for these functions, + as they are not being used. + 2012-09-10 Paul Eggert Improve robustness of 'make bootstrap' (Bug#12376). diff --git a/Makefile.in b/Makefile.in index 6ed32491a66..7a38abeca1c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -358,19 +358,17 @@ blessmail: Makefile src FRC MAKEFILE_NAME = Makefile $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \ $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) - ./config.status + MAKE='$(MAKE)' ./config.status # Don't erase these files if make is interrupted while refreshing them. .PRECIOUS: Makefile config.status -MAKE_CONFIG_STATUS = \ +config.status: ${srcdir}/configure ${srcdir}/lisp/version.el if [ -x ./config.status ]; then \ ./config.status --recheck; \ else \ - ./configure $(CONFIGURE_FLAGS); \ + $(srcdir)/configure $(CONFIGURE_FLAGS); \ fi -config.status: ${srcdir}/configure ${srcdir}/lisp/version.el - $(MAKE_CONFIG_STATUS) AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 @@ -737,6 +735,7 @@ clean: FRC -(cd doc/lispref && $(MAKE) $(MFLAGS) clean) -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean) (cd leim; $(MAKE) $(MFLAGS) clean) + (cd nextstep && $(MAKE) $(MFLAGS) clean) ### `bootclean' ### Delete all files that need to be remade for a clean bootstrap. @@ -763,6 +762,7 @@ distclean: FRC (cd doc/lispintro && $(MAKE) $(MFLAGS) distclean) (cd leim; $(MAKE) $(MFLAGS) distclean) (cd lisp; $(MAKE) $(MFLAGS) distclean) + (cd nextstep && $(MAKE) $(MFLAGS) distclean) ${top_distclean} ### `bootstrap-clean' @@ -780,6 +780,7 @@ bootstrap-clean: FRC -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean) (cd leim; $(MAKE) $(MFLAGS) maintainer-clean) (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean) + (cd nextstep && $(MAKE) $(MFLAGS) maintainer-clean) [ ! -f config.log ] || mv -f config.log config.log~ ${top_bootclean} @@ -889,12 +890,17 @@ dvi: # Bootstrapping does the following: # * Remove files to start from a clean slate. -# * Run autogen.sh, but don't worry about exit status 101 (missing tools). +# * Run autogen.sh, falling back on copy_autogen if autogen.sh fails. # * Build Makefile, to build the build procedure itself. # * Do the actual build. bootstrap: bootstrap-clean FRC - cd $(srcdir) && { ./autogen.sh || test $$? -eq 101; } - $(MAKE_CONFIG_STATUS) + cd $(srcdir) && { ./autogen.sh || autogen/copy_autogen; } + if [ -x config.status ]; then \ + ./config.status --recheck && \ + ./config.status; \ + else \ + $(srcdir)/configure $(CONFIGURE_FLAGS); \ + fi $(MAKE) $(MFLAGS) info all .PHONY: check-declare diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index cf6ffee2c63..661cde9c43e 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -90,11 +90,6 @@ BROKEN_GETWD BROKEN_GET_CURRENT_DIR_NAME BROKEN_NON_BLOCKING_CONNECT BROKEN_PTY_READ_AFTER_EAGAIN -BROKEN_SA_RESTART -BROKEN_SIGAIO -BROKEN_SIGIO -BROKEN_SIGPOLL -BROKEN_SIGPTY CLASH_DETECTION DATA_SEG_BITS DATA_START @@ -423,7 +418,6 @@ MAIL_USE_SYSTEM_LOCK MAXPATHLEN NLIST_STRUCT NO_EDITRES -NO_TERMIO NSIG NSIG_MINIMUM NULL_DEVICE @@ -439,7 +433,6 @@ PTY_OPEN PTY_TTY_NAME_SPRINTF PURESIZE RUN_TIME_REMAP -SA_RESTART SETPGRP_RELEASES_CTTY SETUP_SLAVE_PTY SIGALRM diff --git a/admin/ChangeLog b/admin/ChangeLog index 2c61f437981..7f30fe8fc0f 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,38 @@ +2012-09-17 Glenn Morris + + * admin.el (add-log-time-format): Declare. + + * admin.el (cusver-scan, cusver-check): Bind local variables. + + * admin.el (set-version): Set major version in + etc/refcards/ru-refcard.tex and etc/refcards/emacsver.tex. + (set-copyright): In etc/refcards, only change ru-refcard.tex + and emacsver.tex. + + * admin.el (set-copyright): No more need to set copyrights for + nextstep, or .c files. Add configure.ac and config.nt. + +2012-09-16 Paul Eggert + + Remove configure's --without-sync-input option (Bug#12450). + * CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove. + +2012-09-16 Glenn Morris + + * admin.el (set-version): No more need to set nextstep versions. + (set-copyright): Update for moved nextstep files. + +2012-09-13 Paul Eggert + + Simplify SIGIO usage (Bug#12408). + * CPP_DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) + (BROKEN_SIGPTY, NO_TERMIO): Remove. + +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + * CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove. + 2012-09-09 Paul Eggert Assume C89 or later for math functions (Bug#12381). diff --git a/admin/admin.el b/admin/admin.el index 6d729214bd0..862e5aed6c1 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -26,6 +26,8 @@ ;;; Code: +(defvar add-log-time-format) ; in add-log + (defun add-release-logs (root version) "Add \"Version VERSION released.\" change log entries in ROOT. Root must be the root of an Emacs source tree." @@ -126,39 +128,16 @@ Root must be the root of an Emacs source tree." (set-version-in-file root "nt/emacsclient.rc" comma-space-version (rx (and "\"ProductVersion\"" (0+ space) ?, (0+ space) ?\" (submatch (1+ (in "0-9, "))) - "\\0\"")))) - ;; nextstep. - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Info.plist" - version (rx (and "CFBundleGetInfoString" (1+ anything) "Emacs" (1+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Info.plist" - version (rx (and "CFBundleShortVersionString" (1+ not-newline) ?\n - (0+ not-newline) "" (0+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" - version (rx (and "CFBundleShortVersionString" (0+ space) ?= (0+ space) - ?\" (0+ space) "Version" (1+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" - version (rx (and "CFBundleGetInfoString" (0+ space) ?= (0+ space) - ?\" (0+ space) "Emacs version" (1+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist" - version (rx (and "ApplicationRelease" (0+ space) ?= (0+ space) - ?\" (0+ space) (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist" - version (rx (and "FullVersionID" (0+ space) ?= (0+ space) - ?\" (0+ space) "Emacs" (1+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop" - version (rx (and "Version=" (submatch (1+ (in "0-9."))))))) + "\\0\""))) + (when (string-match "\\([0-9]\\{2,\\}\\)" version) + (setq version (match-string 1 version)) + (set-version-in-file root "etc/refcards/ru-refcard.tex" version + "\\\\newcommand{\\\\versionemacs}\\[0\\]\ +{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs") + (set-version-in-file root "etc/refcards/emacsver.tex" version + "\\\\def\\\\versionemacs\ +{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")))) + ;; Note this makes some assumptions about form of short copyright. (defun set-copyright (root copyright) @@ -172,45 +151,24 @@ Root must be the root of an Emacs source tree." (format-time-string "%Y"))))) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) (error "%s doesn't seem to be the root of an Emacs source tree" root)) - (set-version-in-file root "src/emacs.c" copyright - (rx (and "emacs_copyright" (0+ (not (in ?\"))) - ?\" (submatch (1+ (not (in ?\")))) ?\"))) - (set-version-in-file root "lib-src/ebrowse.c" copyright - (rx (and "emacs_copyright" (0+ (not (in ?\"))) - ?\" (submatch (1+ (not (in ?\")))) ?\"))) - (set-version-in-file root "lib-src/etags.c" copyright - (rx (and "emacs_copyright" (0+ (not (in ?\"))) + (set-version-in-file root "configure.ac" copyright + (rx (and bol "copyright" (0+ (not (in ?\"))) ?\" (submatch (1+ (not (in ?\")))) ?\"))) + (set-version-in-file root "nt/config.nt" copyright + (rx (and bol "#" (0+ blank) "define" (1+ blank) + "COPYRIGHT" (1+ blank) + ?\" (submatch (1+ (not (in ?\")))) ?\"))) (set-version-in-file root "lib-src/rcs2log" copyright (rx (and "Copyright" (0+ space) ?= (0+ space) ?\' (submatch (1+ nonl))))) - ;; This one is a nuisance, as it needs to be split over two lines. - (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright) - ;; nextstep. - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Info.plist" - copyright (rx (and "CFBundleGetInfoString" (1+ anything) "Emacs" (1+ space) - (1+ (in "0-9.")) (1+ space) - (submatch (1+ (not (in ?\<))))))) - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" - copyright (rx (and "NSHumanReadableCopyright" (0+ space) ?\= (0+ space) - ?\" (submatch (1+ (not (in ?\"))))))) - (set-version-in-file - root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist" - copyright (rx (and "Copyright" (0+ space) ?\= (0+ space) - ?\" (submatch (1+ (not (in ?\"))))))) (when (string-match "\\([0-9]\\{4\\}\\)" copyright) (setq copyright (match-string 1 copyright)) - (dolist (file (directory-files (expand-file-name "etc/refcards" root) - t "\\.tex\\'")) - (unless (string-match "gnus-refcard\\.tex" file) - (set-version-in-file - root file copyright - (concat (if (string-match "ru-refcard\\.tex" file) - "\\\\newcommand{\\\\cyear}\\[0\\]{" - "\\\\def\\\\year{") - "\\([0-9]\\{4\\}\\)}.+%.+copyright year")))))) + (set-version-in-file root "etc/refcards/ru-refcard.tex" copyright + "\\\\newcommand{\\\\cyear}\\[0\\]\ +{\\([0-9]\\{4\\}\\)}.+%.+copyright year") + (set-version-in-file root "etc/refcards/emacsver.tex" copyright + "\\\\def\\\\year\ +{\\([0-9]\\{4\\}\\)}.+%.+copyright year"))) ;;; Various bits of magic for generating the web manuals @@ -459,7 +417,7 @@ Also generate PostScript output in PS-DEST." (setq done t)) (t (if (eobp) - (error "Parse error in %s" f)) + (error "Parse error in %s" f)) ; f is bound in manual-html-node (unless open-td (setq done t)))) (forward-line 1)))) @@ -491,7 +449,7 @@ If optional argument OLD is non-nil, also scan for defvars." (let ((m (format "Scanning %s..." file)) (re (format "^[ \t]*\\((def%s\\)[ \t\n]" (if old "\\(?:custom\\|var\\)" "custom"))) - alist var ver) + alist var ver form) (message "%s" m) (with-temp-buffer (insert-file-contents file) @@ -550,7 +508,7 @@ changes (in a non-trivial way). This function does not check for that." (mapcar (lambda (file) (cons file (cusver-scan file))) newfiles))) - oldcus result thisfile) + oldcus result thisfile file) (message "Reading old defcustoms...") (dolist (file oldfiles) (setq oldcus (append oldcus (cusver-scan file t)))) diff --git a/autogen.sh b/autogen.sh index dc8d53eec97..9cfaa40eee5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -201,7 +201,7 @@ This is not recommended - see the comments in \`copy_autogen'. Please report any problems with this script to bug-gnu-emacs@gnu.org . EOF - exit 101 # Exit status 101 means tools were missing. + exit 1 fi echo "Your system has the required tools, running autoreconf..." diff --git a/autogen/Makefile.in b/autogen/Makefile.in index dbedb5d12e5..103a2e94ef3 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -787,6 +787,7 @@ builddir = @builddir@ cache_file = @cache_file@ canonical = @canonical@ configuration = @configuration@ +copyright = @copyright@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ diff --git a/autogen/config.in b/autogen/config.in index 99074bd1bc5..2f2555c75c9 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -50,9 +50,6 @@ along with GNU Emacs. If not, see . */ /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T -/* Define if FIONREAD should not be used. */ -#undef BROKEN_FIONREAD - /* Define if getwd should not be used. */ #undef BROKEN_GETWD @@ -62,21 +59,6 @@ along with GNU Emacs. If not, see . */ /* Define on FreeBSD to work around an issue when reading from a PTY. */ #undef BROKEN_PTY_READ_AFTER_EAGAIN -/* Define if SA_RESTART should only be used in batch mode. */ -#undef BROKEN_SA_RESTART - -/* Define if SIGAIO should not be used. */ -#undef BROKEN_SIGAIO - -/* Define if SIGIO should not be used. */ -#undef BROKEN_SIGIO - -/* Define if SIGPOLL should not be used. */ -#undef BROKEN_SIGPOLL - -/* Define if SIGPTY should not be used. */ -#undef BROKEN_SIGPTY - /* Define if the system is compatible with BSD 4.2. */ #undef BSD4_2 @@ -97,6 +79,9 @@ along with GNU Emacs. If not, see . */ his/her Emacs. */ #undef CLASH_DETECTION +/* Short copyright string for this version of Emacs. */ +#undef COPYRIGHT + /* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP systems. This function is required for 'alloca.c' support on those systems. */ @@ -806,6 +791,10 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T +/* Define to 1 if sigsetjmp and siglongjmp work. The value of this symbol is + irrelevant if HAVE__SETJMP is defined. */ +#undef HAVE_SIGSETJMP + /* Define to 1 if the system has the type `sigset_t'. */ #undef HAVE_SIGSET_T @@ -1089,6 +1078,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `_ftime' function. */ #undef HAVE__FTIME +/* Define to 1 if _setjmp and _longjmp work. */ +#undef HAVE__SETJMP + /* Define to 1 if you have the `__builtin_unwind_init' function. */ #undef HAVE___BUILTIN_UNWIND_INIT @@ -1166,9 +1158,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O -/* Define if termio.h should not be included. */ -#undef NO_TERMIO - /* Minimum value of NSIG. */ #undef NSIG_MINIMUM @@ -1306,9 +1295,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 on System V Release 4. */ #undef SVR4 -/* Process async input synchronously. */ -#undef SYNC_INPUT - /* Define to use system malloc. */ #undef SYSTEM_MALLOC @@ -1353,6 +1339,12 @@ along with GNU Emacs. If not, see . */ /* Define if the system has Unix98 PTYs. */ #undef UNIX98_PTYS +/* Define to 1 if FIONREAD is usable. */ +#undef USABLE_FIONREAD + +/* Define to 1 if SIGIO is usable. */ +#undef USABLE_SIGIO + /* How to get a user's full name. */ #undef USER_FULL_NAME @@ -1514,14 +1506,6 @@ along with GNU Emacs. If not, see . */ declarations. Define as empty for no equivalent. */ #undef __restrict_arr -/* Define to longjmp if _setjmp and _longjmp do not work. Because longjmp may - alter signal masks, callers of _longjmp should not assume that it leaves - signal masks alone. */ -#undef _longjmp - -/* Define to setjmp if _setjmp and _longjmp do not work. See _longjmp. */ -#undef _setjmp - /* Some platforms that do not use configure define this to include extra configuration information. */ #undef config_opsysfile diff --git a/autogen/configure b/autogen/configure index 3621eee77c6..4c6fa8b5cf7 100755 --- a/autogen/configure +++ b/autogen/configure @@ -1143,6 +1143,7 @@ srcdir canonical configuration version +copyright KRB4LIB DESLIB KRB5LIB @@ -1330,8 +1331,7 @@ PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='deps_frag -lisp_frag -ns_frag' +lisp_frag' ac_user_opts=' enable_option_checking with_all @@ -1343,7 +1343,6 @@ with_mmdf with_mail_unlink with_mailhost with_sound -with_sync_input with_x_toolkit with_wide_int with_xpm @@ -2061,9 +2060,8 @@ Optional Packages: --with-mailhost=HOSTNAME string giving default POP mail host --without-sound don't compile with sound support - --without-sync-input process async input synchronously - --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk3, - lucid or athena, motif, no) + --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk2, + gtk3, lucid or athena, motif, no) --with-wide-int prefer wide Emacs integers (typically 62-bit) --without-xpm don't compile with XPM image support --without-jpeg don't compile with JPEG image support @@ -3933,20 +3931,6 @@ fi -# Check whether --with-sync-input was given. -if test "${with_sync_input+set}" = set; then : - withval=$with_sync_input; -else - with_sync_input=$with_features -fi - -if test "$with_sync_input" = yes; then - -$as_echo "#define SYNC_INPUT 1" >>confdefs.h - -fi - - # Check whether --with-x-toolkit was given. if test "${with_x_toolkit+set}" = set; then : withval=$with_x_toolkit; case "${withval}" in @@ -3956,11 +3940,13 @@ if test "${with_x_toolkit+set}" = set; then : a | at | ath | athe | athen | athena ) val=athena ;; m | mo | mot | moti | motif ) val=motif ;; g | gt | gtk ) val=gtk ;; + gtk2 ) val=gtk2 ;; gtk3 ) val=gtk3 ;; * ) as_fn_error "\`--with-x-toolkit=$withval' is invalid; -this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or -\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5 +this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk', +\`gtk2' or \`gtk3'. \`yes' and \`gtk' are synonyms. +\`athena' and \`lucid' are synonyms." "$LINENO" 5 ;; esac with_x_toolkit=$val @@ -8576,8 +8562,9 @@ $as_echo "no" >&6; } ALSA_CFLAGS="" ALSA_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ALSA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$ALSA_MODULES"` + ## 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` fi @@ -9411,13 +9398,13 @@ if test "${with_ns}" != no; then ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir}/Contents/MacOS ns_appresdir=${ns_appdir}/Contents/Resources - ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base + ns_appsrc=Cocoa/Emacs.base elif test -f $GNUSTEP_CONFIG_FILE; then NS_IMPL_GNUSTEP=yes ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir} ns_appresdir=${ns_appdir}/Resources - ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base + ns_appsrc=GNUstep/Emacs.base GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" GNUSTEP_LOCAL_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_LOCAL_HEADERS)" @@ -9507,7 +9494,6 @@ fi INSTALL_ARCH_INDEP_EXTRA=install-etc ns_self_contained=no -ns_frag=/dev/null NS_OBJ= NS_OBJC_OBJ= if test "${HAVE_NS}" = yes; then @@ -9531,7 +9517,6 @@ if test "${HAVE_NS}" = yes; then leimdir="\${ns_appresdir}/leim" INSTALL_ARCH_INDEP_EXTRA= fi - ns_frag=$srcdir/src/ns.mk NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" fi CFLAGS="$tmp_CFLAGS" @@ -9542,7 +9527,6 @@ CPPFLAGS="$tmp_CPPFLAGS" - ## $window_system is now set to the window system we will ## ultimately use. @@ -9562,6 +9546,9 @@ case "${window_system}" in gtk ) with_gtk=yes term_header=gtkutil.h USE_X_TOOLKIT=none ;; + gtk2 ) with_gtk2=yes + term_header=gtkutil.h + USE_X_TOOLKIT=none ;; gtk3 ) with_gtk3=yes term_header=gtkutil.h USE_X_TOOLKIT=none ;; @@ -10393,8 +10380,9 @@ $as_echo "no" >&6; } RSVG_CFLAGS="" RSVG_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - RSVG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$RSVG_MODULE"` + ## 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` fi @@ -10463,8 +10451,9 @@ $as_echo "no" >&6; } IMAGEMAGICK_CFLAGS="" IMAGEMAGICK_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - IMAGEMAGICK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$IMAGEMAGICK_MODULE"` + ## 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` fi @@ -10511,7 +10500,9 @@ fi HAVE_GTK=no GTK_OBJ= -if test "${with_gtk3}" = "yes"; then +check_gtk2=no +gtk3_pkg_errors= +if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then GLIB_REQUIRED=2.28 GTK_REQUIRED=3.0 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" @@ -10547,8 +10538,9 @@ $as_echo "no" >&6; } GTK_CFLAGS="" GTK_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$GTK_MODULES"` + ## 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` fi @@ -10566,19 +10558,22 @@ $as_echo "no" >&6; } pkg_check_gtk=no fi - if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then + if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5 fi + if test "$pkg_check_gtk" = "yes"; then $as_echo "#define HAVE_GTK3 1" >>confdefs.h - GTK_OBJ=emacsgtkfixed.o - term_header=gtkutil.h + GTK_OBJ=emacsgtkfixed.o + term_header=gtkutil.h + else + check_gtk2=yes + gtk3_pkg_errors="$GTK_PKG_ERRORS " + fi fi -if test "$pkg_check_gtk" != "yes"; then - HAVE_GTK=no -if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then +if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then GLIB_REQUIRED=2.10 GTK_REQUIRED=2.10 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" @@ -10614,8 +10609,9 @@ $as_echo "no" >&6; } GTK_CFLAGS="" GTK_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$GTK_MODULES"` + ## 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` fi @@ -10633,11 +10629,12 @@ $as_echo "no" >&6; } pkg_check_gtk=no fi - if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then - as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5 + if test "$pkg_check_gtk" = "no" && + { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } + then + as_fn_error "$gtk3_pkg_errors$GTK_PKG_ERRORS" "$LINENO" 5 fi fi -fi if test x"$pkg_check_gtk" = xyes; then @@ -10774,8 +10771,9 @@ $as_echo "no" >&6; } DBUS_CFLAGS="" DBUS_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - DBUS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "dbus-1 >= 1.0"` + ## 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` fi @@ -10854,8 +10852,9 @@ $as_echo "no" >&6; } GSETTINGS_CFLAGS="" GSETTINGS_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GSETTINGS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gio-2.0 >= 2.26"` + ## 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` fi @@ -10915,8 +10914,9 @@ $as_echo "no" >&6; } GCONF_CFLAGS="" GCONF_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GCONF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gconf-2.0 >= 2.13"` + ## 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` fi @@ -10975,8 +10975,9 @@ $as_echo "no" >&6; } GOBJECT_CFLAGS="" GOBJECT_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GOBJECT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gobject-2.0 >= 2.0"` + ## 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` fi @@ -11108,8 +11109,9 @@ $as_echo "no" >&6; } LIBGNUTLS_CFLAGS="" LIBGNUTLS_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - LIBGNUTLS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnutls >= 2.6.6"` + ## 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` fi @@ -11161,8 +11163,6 @@ 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xaw3d" >&5 -$as_echo_n "checking for xaw3d... " >&6; } if test "${emacs_cv_xaw3d+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -11233,6 +11233,8 @@ fi emacs_cv_xaw3d=no fi if test $emacs_cv_xaw3d = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xaw3d" >&5 +$as_echo_n "checking for xaw3d... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; using Lucid toolkit" >&5 $as_echo "yes; using Lucid toolkit" >&6; } USE_X_TOOLKIT=LUCID @@ -11242,6 +11244,8 @@ $as_echo "yes; using Lucid toolkit" >&6; } $as_echo "#define HAVE_XAW3D 1" >>confdefs.h else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xaw3d" >&5 +$as_echo_n "checking for xaw3d... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libXaw" >&5 @@ -11735,8 +11739,9 @@ $as_echo "no" >&6; } FONTCONFIG_CFLAGS="" FONTCONFIG_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "fontconfig >= 2.2.0"` + ## 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` fi @@ -11793,8 +11798,9 @@ $as_echo "no" >&6; } XFT_CFLAGS="" XFT_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - XFT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xft >= 0.13.0"` + ## 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` fi @@ -11960,8 +11966,9 @@ $as_echo "no" >&6; } FREETYPE_CFLAGS="" FREETYPE_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - FREETYPE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "freetype2"` + ## 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` fi @@ -12020,8 +12027,9 @@ $as_echo "no" >&6; } LIBOTF_CFLAGS="" LIBOTF_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - LIBOTF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libotf"` + ## 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` fi @@ -12128,8 +12136,9 @@ $as_echo "no" >&6; } M17N_FLT_CFLAGS="" M17N_FLT_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - M17N_FLT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "m17n-flt"` + ## 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` fi @@ -12817,8 +12826,9 @@ $as_echo "no" >&6; } LIBXML2_CFLAGS="" LIBXML2_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - LIBXML2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml-2.0 > 2.6.17"` + ## 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` fi @@ -12926,8 +12936,8 @@ $as_echo "#define HAVE_H_ERRNO 1" >>confdefs.h fi -# fmod, logb, and frexp are found in -lm on most systems. -# On HPUX 9.01, -lm does not contain logb, so check for sqrt. +# sqrt and other floating-point functions such as fmod and frexp +# are found in -lm on most systems. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 $as_echo_n "checking for sqrt in -lm... " >&6; } if test "${ac_cv_lib_m_sqrt+set}" = set; then : @@ -13177,7 +13187,7 @@ esac for ac_func in gethostname \ closedir getrusage get_current_dir_name \ -lrand48 logb cbrt setsid \ +lrand48 setsid \ fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ __fpending strsignal setitimer \ @@ -14479,6 +14489,11 @@ else $as_echo "no" >&6; } fi +case $canonical in + *-solaris2.4 | *-solaris2.4.*) + : ${ac_cv_func_vfork_works=no};; +esac + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = x""yes; then : @@ -14891,12 +14906,6 @@ esac case $opsys in - darwin | gnu | hpux* | *bsd ) - -$as_echo "#define NO_TERMIO 1" >>confdefs.h - - ;; - irix6-5 | sol2* | unixware ) $as_echo "#define NSIG_MINIMUM 32" >>confdefs.h @@ -14904,29 +14913,15 @@ $as_echo "#define NSIG_MINIMUM 32" >>confdefs.h ;; esac +emacs_broken_SIGIO=no case $opsys in hpux* | irix6-5 | openbsd | sol2* | unixware ) - -$as_echo "#define BROKEN_SIGIO 1" >>confdefs.h - + emacs_broken_SIGIO=yes ;; aix4-2) -$as_echo "#define BROKEN_FIONREAD 1" >>confdefs.h - - -$as_echo "#define BROKEN_SIGAIO 1" >>confdefs.h - - -$as_echo "#define BROKEN_SIGPOLL 1" >>confdefs.h - - -$as_echo "#define BROKEN_SIGPTY 1" >>confdefs.h - - - $as_echo "#define BROKEN_GET_CURRENT_DIR_NAME 1" >>confdefs.h ;; @@ -15468,13 +15463,45 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_func__setjmp" >&5 $as_echo "$emacs_cv_func__setjmp" >&6; } -if test $emacs_cv_func__setjmp = no; then +if test $emacs_cv_func__setjmp = yes; then -$as_echo "#define _setjmp setjmp" >>confdefs.h +$as_echo "#define HAVE__SETJMP 1" >>confdefs.h +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 +$as_echo_n "checking for sigsetjmp... " >&6; } +if test "${emacs_cv_func_sigsetjmp+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -$as_echo "#define _longjmp longjmp" >>confdefs.h +int +main () +{ +sigjmp_buf j; + if (! sigsetjmp (j, 1)) + siglongjmp (j, 1); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + emacs_cv_func_sigsetjmp=yes +else + emacs_cv_func_sigsetjmp=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: $emacs_cv_func_sigsetjmp" >&5 +$as_echo "$emacs_cv_func_sigsetjmp" >&6; } + if test $emacs_cv_func_sigsetjmp = yes; then +$as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h + + fi fi case $opsys in @@ -15637,6 +15664,85 @@ $as_echo "#define SOLARIS2 /**/" >>confdefs.h ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable FIONREAD" >&5 +$as_echo_n "checking for usable FIONREAD... " >&6; } +if test "${emacs_cv_usable_FIONREAD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $opsys in + aix4-2) + emacs_cv_usable_FIONREAD=no + ;; + + *) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #ifdef USG5_4 + # include + #endif + +int +main () +{ +int foo = ioctl (0, FIONREAD, &foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + emacs_cv_usable_FIONREAD=yes +else + emacs_cv_usable_FIONREAD=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_usable_FIONREAD" >&5 +$as_echo "$emacs_cv_usable_FIONREAD" >&6; } +if test $emacs_cv_usable_FIONREAD = yes; then + +$as_echo "#define USABLE_FIONREAD 1" >>confdefs.h + + + if test $emacs_broken_SIGIO = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable SIGIO" >&5 +$as_echo_n "checking for usable SIGIO... " >&6; } +if test "${emacs_cv_usable_SIGIO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +int foo = SIGIO | F_SETFL | FASYNC; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + emacs_cv_usable_SIGIO=yes +else + emacs_cv_usable_SIGIO=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_usable_SIGIO" >&5 +$as_echo "$emacs_cv_usable_SIGIO" >&6; } + if test $emacs_cv_usable_SIGIO = yes; then + +$as_echo "#define USABLE_SIGIO 1" >>confdefs.h + + fi + fi +fi + case $opsys in cygwin) @@ -15647,9 +15753,6 @@ $as_echo "#define G_SLICE_ALWAYS_MALLOC 1" >>confdefs.h hpux11) -$as_echo "#define BROKEN_SA_RESTART 1" >>confdefs.h - - $as_echo "#define USG_SUBTTY_WORKS 1" >>confdefs.h ;; @@ -15684,6 +15787,14 @@ fi version=$PACKAGE_VERSION +copyright="Copyright (C) 2012 Free Software Foundation, Inc." + +cat >>confdefs.h <<_ACEOF +#define COPYRIGHT "$copyright" +_ACEOF + + + ### Specify what sort of things we'll be editing into Makefile and config.h. ### Use configuration here uncanonicalized to avoid exceeding size limits. @@ -24182,11 +24293,7 @@ fi #### It makes printing result more understandable as using GTK sets #### toolkit_scroll_bars to yes by default. if test "${HAVE_GTK}" = "yes"; then - if test "${with_gtk3}" = "yes"; then - USE_X_TOOLKIT=GTK3 - else - USE_X_TOOLKIT=GTK - fi + USE_X_TOOLKIT=GTK fi echo " @@ -24275,9 +24382,19 @@ test "${prefix}" != NONE && test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` -SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" +if test "$HAVE_NS" = "yes"; then + if test "$NS_IMPL_GNUSTEP" = yes; then + ac_config_files="$ac_config_files nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in" -ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" + else + ac_config_files="$ac_config_files nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in" + + fi +fi + +SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile" + +ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile" opt_makefile=test/automated/Makefile @@ -25117,6 +25234,10 @@ do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist") CONFIG_FILES="$CONFIG_FILES nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in" ;; + "nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop") CONFIG_FILES="$CONFIG_FILES nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in" ;; + "nextstep/Cocoa/Emacs.base/Contents/Info.plist") CONFIG_FILES="$CONFIG_FILES nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in" ;; + "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings") CONFIG_FILES="$CONFIG_FILES nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib-src/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/Makefile" ;; @@ -25129,6 +25250,7 @@ do "lwlib/Makefile") CONFIG_FILES="$CONFIG_FILES lwlib/Makefile" ;; "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;; "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;; + "nextstep/Makefile") CONFIG_FILES="$CONFIG_FILES nextstep/Makefile" ;; "test/automated/Makefile") CONFIG_FILES="$CONFIG_FILES test/automated/Makefile" ;; "admin/unidata/Makefile") CONFIG_FILES="$CONFIG_FILES admin/unidata/Makefile" ;; "mkdirs") CONFIG_COMMANDS="$CONFIG_COMMANDS mkdirs" ;; diff --git a/autogen/copy_autogen b/autogen/copy_autogen index b6af9b6eb35..8aacd4d399a 100755 --- a/autogen/copy_autogen +++ b/autogen/copy_autogen @@ -8,7 +8,7 @@ ## regenerate configure and will fail if you do not have the required ## tools. You will have to run this script again. -test -d autogen && cd autogen +test ! -d autogen || cd autogen || exit if test ! -e config.in; then echo "Cannot find autogen/ directory." @@ -16,11 +16,12 @@ if test ! -e config.in; then fi ## Order implied by top-level Makefile's rules, for time-stamps. -cp compile config.guess config.sub depcomp install-sh missing ../build-aux -cp aclocal.m4 ../ -cp configure ../ -touch ../src/stamp-h.in -cp config.in ../src/ -cp Makefile.in ../lib/ +cp -f compile config.guess config.sub depcomp install-sh missing \ + ../build-aux && +cp aclocal.m4 ../ && +cp configure ../ && +touch ../src/stamp-h.in && +cp config.in ../src/ && +cp Makefile.in ../lib/ && echo "You can now run configure" diff --git a/configure.ac b/configure.ac index ad47a381133..0b4aece4daf 100644 --- a/configure.ac +++ b/configure.ac @@ -128,17 +128,12 @@ AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME], OPTION_DEFAULT_ON([sound],[don't compile with sound support]) -OPTION_DEFAULT_ON([sync-input],[process async input synchronously]) -if test "$with_sync_input" = yes; then - AC_DEFINE(SYNC_INPUT, 1, [Process async input synchronously.]) -fi - 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 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, gtk3, lucid or athena, motif, no)])], + [use an X toolkit (KIT one of: yes or gtk, gtk2, gtk3, lucid or athena, motif, no)])], [ case "${withval}" in y | ye | yes ) val=gtk ;; n | no ) val=no ;; @@ -146,11 +141,13 @@ AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT], a | at | ath | athe | athen | athena ) val=athena ;; m | mo | mot | moti | motif ) val=motif ;; g | gt | gtk ) val=gtk ;; + gtk2 ) val=gtk2 ;; gtk3 ) val=gtk3 ;; * ) AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid; -this option's value should be `yes', `no', `lucid', `athena', `motif', `gtk' or -`gtk3'. `yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.]) +this option's value should be `yes', `no', `lucid', `athena', `motif', `gtk', +`gtk2' or `gtk3'. `yes' and `gtk' are synonyms. +`athena' and `lucid' are synonyms.]) ;; esac with_x_toolkit=$val @@ -1189,9 +1186,10 @@ AC_DEFUN([PKG_CHECK_MODULES], [ $1_CFLAGS="" $1_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + $1_PKG_ERRORS=`($PKG_CONFIG --print-errors "$2") 2>&1` + ifelse([$4], ,echo "$$1_PKG_ERRORS",) fi AC_SUBST($1_CFLAGS) @@ -1460,13 +1458,13 @@ if test "${with_ns}" != no; then ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir}/Contents/MacOS ns_appresdir=${ns_appdir}/Contents/Resources - ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base + ns_appsrc=Cocoa/Emacs.base elif test -f $GNUSTEP_CONFIG_FILE; then NS_IMPL_GNUSTEP=yes ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir} ns_appresdir=${ns_appdir}/Resources - ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base + ns_appsrc=GNUstep/Emacs.base dnl FIXME sourcing this several times in subshells seems inefficient. GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" @@ -1520,7 +1518,6 @@ AC_SUBST(TEMACS_LDFLAGS2) INSTALL_ARCH_INDEP_EXTRA=install-etc ns_self_contained=no -ns_frag=/dev/null NS_OBJ= NS_OBJC_OBJ= if test "${HAVE_NS}" = yes; then @@ -1547,7 +1544,6 @@ if test "${HAVE_NS}" = yes; then leimdir="\${ns_appresdir}/leim" INSTALL_ARCH_INDEP_EXTRA= fi - ns_frag=$srcdir/src/ns.mk NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" fi CFLAGS="$tmp_CFLAGS" @@ -1557,7 +1553,6 @@ AC_SUBST(ns_self_contained) AC_SUBST(NS_OBJ) AC_SUBST(NS_OBJC_OBJ) AC_SUBST(LIB_STANDARD) -AC_SUBST_FILE(ns_frag) ## $window_system is now set to the window system we will ## ultimately use. @@ -1580,6 +1575,9 @@ case "${window_system}" in dnl Don't set this for GTK. A lot of tests below assumes Xt when dnl USE_X_TOOLKIT is set. USE_X_TOOLKIT=none ;; + gtk2 ) with_gtk2=yes + term_header=gtkutil.h + USE_X_TOOLKIT=none ;; gtk3 ) with_gtk3=yes term_header=gtkutil.h USE_X_TOOLKIT=none ;; @@ -1902,35 +1900,41 @@ fi HAVE_GTK=no GTK_OBJ= -if test "${with_gtk3}" = "yes"; then +check_gtk2=no +gtk3_pkg_errors= +if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then GLIB_REQUIRED=2.28 GTK_REQUIRED=3.0 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" dnl Checks for libraries. PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) - if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then + if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then AC_MSG_ERROR($GTK_PKG_ERRORS) fi - AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) - GTK_OBJ=emacsgtkfixed.o - term_header=gtkutil.h + if test "$pkg_check_gtk" = "yes"; then + AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) + GTK_OBJ=emacsgtkfixed.o + term_header=gtkutil.h + else + check_gtk2=yes + gtk3_pkg_errors="$GTK_PKG_ERRORS " + fi fi -if test "$pkg_check_gtk" != "yes"; then - HAVE_GTK=no -if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then +if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then GLIB_REQUIRED=2.10 GTK_REQUIRED=2.10 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" dnl Checks for libraries. PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) - if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then - AC_MSG_ERROR($GTK_PKG_ERRORS) + if test "$pkg_check_gtk" = "no" && + { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } + then + AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) fi fi -fi if test x"$pkg_check_gtk" = xyes; then @@ -2159,7 +2163,6 @@ 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 - AC_MSG_CHECKING(for xaw3d) AC_CACHE_VAL(emacs_cv_xaw3d, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include @@ -2172,6 +2175,7 @@ if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then emacs_cv_xaw3d=no fi if test $emacs_cv_xaw3d = yes; then + AC_MSG_CHECKING(for xaw3d) AC_MSG_RESULT([yes; using Lucid toolkit]) USE_X_TOOLKIT=LUCID HAVE_XAW3D=yes @@ -2179,6 +2183,7 @@ if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then AC_DEFINE(HAVE_XAW3D, 1, [Define to 1 if you have the Xaw3d library (-lXaw3d).]) else + AC_MSG_CHECKING(for xaw3d) AC_MSG_RESULT(no) AC_MSG_CHECKING(for libXaw) AC_CACHE_VAL(emacs_cv_xaw, @@ -2750,8 +2755,8 @@ if test $emacs_cv_netdb_declares_h_errno = yes; then AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.]) fi -# fmod, logb, and frexp are found in -lm on most systems. -# On HPUX 9.01, -lm does not contain logb, so check for sqrt. +# sqrt and other floating-point functions such as fmod and frexp +# are found in -lm on most systems. AC_CHECK_LIB(m, sqrt) # Check for mail-locking functions in a "mail" library. Probably this should @@ -2831,7 +2836,7 @@ AC_SUBST(BLESSMAIL_TARGET) AC_CHECK_FUNCS(gethostname \ closedir getrusage get_current_dir_name \ -lrand48 logb cbrt setsid \ +lrand48 setsid \ fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ __fpending strsignal setitimer \ @@ -3211,6 +3216,14 @@ else AC_MSG_RESULT(no) fi +dnl Check for a Solaris 2.4 vfork bug that Autoconf misses (through 2.69). +dnl This can be removed once we assume Autoconf 2.70. +case $canonical in + *-solaris2.4 | *-solaris2.4.*) + dnl Disable the Autoconf-generated vfork test. + : ${ac_cv_func_vfork_works=no};; +esac + AC_FUNC_FORK AC_CHECK_FUNCS(snprintf) @@ -3321,10 +3334,6 @@ esac case $opsys in - darwin | gnu | hpux* | *bsd ) - AC_DEFINE(NO_TERMIO, 1, [Define if termio.h should not be included.]) - ;; - irix6-5 | sol2* | unixware ) dnl Some SVr4s don't define NSIG in sys/signal.h for ANSI environments; dnl instead, there's a system variable _sys_nsig. Unfortunately, we @@ -3334,26 +3343,16 @@ case $opsys in ;; esac +emacs_broken_SIGIO=no case $opsys in dnl SIGIO exists, but the feature doesn't work in the way Emacs needs. dnl See eg . hpux* | irix6-5 | openbsd | sol2* | unixware ) - AC_DEFINE(BROKEN_SIGIO, 1, [Define if SIGIO should not be used.]) + emacs_broken_SIGIO=yes ;; aix4-2) - dnl BUILD 9008 - FIONREAD problem still exists in X-Windows. - AC_DEFINE(BROKEN_FIONREAD, 1, [Define if FIONREAD should not be used.]) - dnl As we define BROKEN_FIONREAD, SIGIO will be undefined in systty.h. - dnl But, on AIX, SIGAIO, SIGPTY, and SIGPOLL are defined as SIGIO, - dnl which causes compilation error at init_signals in sysdep.c. - dnl So, we define these macros so that syssignal.h detects them - dnl and undefine SIGAIO, SIGPTY and SIGPOLL. - AC_DEFINE(BROKEN_SIGAIO, 1, [Define if SIGAIO should not be used.]) - AC_DEFINE(BROKEN_SIGPOLL,1, [Define if SIGPOLL should not be used.]) - AC_DEFINE(BROKEN_SIGPTY, 1, [Define if SIGPTY should not be used.]) - dnl On AIX Emacs uses the gmalloc.c malloc implementation. But given dnl the way this system works, libc functions that return malloced dnl memory use the libc malloc implementation. Calling xfree or @@ -3429,7 +3428,7 @@ dnl The choice is controlled by the variable interrupt_input. dnl dnl Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO) dnl -dnl Emacs uses the presence or absence of the SIGIO and BROKEN_SIGIO macros +dnl Emacs uses the presence of the USABLE_SIGIO macro dnl to indicate whether or not signal-driven I/O is possible. It uses dnl INTERRUPT_INPUT to decide whether to use it by default. dnl @@ -3836,13 +3835,24 @@ AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp], _longjmp (j, 1);]])], [emacs_cv_func__setjmp=yes], [emacs_cv_func__setjmp=no])]) -if test $emacs_cv_func__setjmp = no; then - AC_DEFINE([_setjmp], [setjmp], - [Define to setjmp if _setjmp and _longjmp do not work. See _longjmp.]) - AC_DEFINE([_longjmp], [longjmp], - [Define to longjmp if _setjmp and _longjmp do not work. - Because longjmp may alter signal masks, callers of _longjmp - should not assume that it leaves signal masks alone.]) +if test $emacs_cv_func__setjmp = yes; then + AC_DEFINE([HAVE__SETJMP], 1, [Define to 1 if _setjmp and _longjmp work.]) +else + AC_CACHE_CHECK([for sigsetjmp], [emacs_cv_func_sigsetjmp], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[sigjmp_buf j; + if (! sigsetjmp (j, 1)) + siglongjmp (j, 1);]])], + [emacs_cv_func_sigsetjmp=yes], + [emacs_cv_func_sigsetjmp=no])]) + if test $emacs_cv_func_sigsetjmp = yes; then + AC_DEFINE([HAVE_SIGSETJMP], 1, + [Define to 1 if sigsetjmp and siglongjmp work. + The value of this symbol is irrelevant if HAVE__SETJMP is defined.]) + fi fi case $opsys in @@ -3950,6 +3960,46 @@ case $opsys in ;; esac +AC_CACHE_CHECK([for usable FIONREAD], [emacs_cv_usable_FIONREAD], + [case $opsys in + aix4-2) + dnl BUILD 9008 - FIONREAD problem still exists in X-Windows. + emacs_cv_usable_FIONREAD=no + ;; + + *) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + #include + #ifdef USG5_4 + # include + #endif + ]], + [[int foo = ioctl (0, FIONREAD, &foo);]])], + [emacs_cv_usable_FIONREAD=yes], + [emacs_cv_usable_FIONREAD=no]) + ;; + esac]) +if test $emacs_cv_usable_FIONREAD = yes; then + AC_DEFINE([USABLE_FIONREAD], [1], [Define to 1 if FIONREAD is usable.]) + + if test $emacs_broken_SIGIO = no; then + AC_CACHE_CHECK([for usable SIGIO], [emacs_cv_usable_SIGIO], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + #include + ]], + [[int foo = SIGIO | F_SETFL | FASYNC;]])], + [emacs_cv_usable_SIGIO=yes], + [emacs_cv_usable_SIGIO=no])], + [emacs_cv_usable_SIGIO=yes], + [emacs_cv_usable_SIGIO=no]) + if test $emacs_cv_usable_SIGIO = yes; then + AC_DEFINE([USABLE_SIGIO], [1], [Define to 1 if SIGIO is usable.]) + fi + fi +fi + case $opsys in dnl Emacs supplies its own malloc, but glib (part of Gtk+) calls @@ -3963,11 +4013,6 @@ case $opsys in ;; hpux11) - dnl See comments in sysdep.c:sys_signal. - dnl SA_RESTART resets the timeout of `select' on hpux11. - dnl Defining BROKEN_SA_RESTART is not the same as undef'ing SA_RESTART. - AC_DEFINE(BROKEN_SA_RESTART, 1, [Define if SA_RESTART should only - be used in batch mode.]) dnl It works to open the pty's tty in the parent (Emacs), then dnl close and reopen it in the child. AC_DEFINE(USG_SUBTTY_WORKS, 1, [Define for USG systems where it @@ -4002,6 +4047,11 @@ fi version=$PACKAGE_VERSION +copyright="Copyright (C) 2012 Free Software Foundation, Inc." +AC_DEFINE_UNQUOTED(COPYRIGHT, ["$copyright"], + [Short copyright string for this version of Emacs.]) +AC_SUBST(copyright) + ### Specify what sort of things we'll be editing into Makefile and config.h. ### Use configuration here uncanonicalized to avoid exceeding size limits. AC_SUBST(version) @@ -4407,11 +4457,7 @@ End: #### It makes printing result more understandable as using GTK sets #### toolkit_scroll_bars to yes by default. if test "${HAVE_GTK}" = "yes"; then - if test "${with_gtk3}" = "yes"; then - USE_X_TOOLKIT=GTK3 - else - USE_X_TOOLKIT=GTK - fi + USE_X_TOOLKIT=GTK fi echo " @@ -4505,6 +4551,16 @@ fi test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] +if test "$HAVE_NS" = "yes"; then + if test "$NS_IMPL_GNUSTEP" = yes; then + AC_CONFIG_FILES([nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in \ + nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in]) + else + AC_CONFIG_FILES([nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in \ + nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in]) + fi +fi + dnl Obviously there is duplication here wrt $SUBDIR_MAKEFILES. dnl You _can_ use that variable in AC_CONFIG_FILES, so long as any directory dnl using automake (ie lib/) is explicitly listed and not "hidden" in a variable @@ -4513,12 +4569,12 @@ dnl This will work, but you get a config.status that is not quite right dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html). dnl That doesn't have any obvious consequences for Emacs, but on the whole dnl it seems better to just live with the duplication. -SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" +SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile" AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \ - leim/Makefile]) + leim/Makefile nextstep/Makefile]) dnl test/ is not present in release tarfiles. opt_makefile=test/automated/Makefile diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 508dbbf8021..35e635eec28 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2012-09-17 Chong Yidong + + * building.texi (GDB User Interface Layout): Remove reference to + removed variable gdb-use-separate-io-buffer (Bug#12454). + 2012-09-08 Jambunathan K * regs.texi (Text Registers): `C-x r +' can now be used instead of diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 05ea667e5f7..21948f181fb 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -888,10 +888,6 @@ displays the following frame layout: @end group @end smallexample - However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O -buffer does not appear and the primary source buffer occupies the full -width of the frame. - @findex gdb-restore-windows @findex gdb-many-windows If you ever change the window layout, you can restore the ``many diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index ceb199dae88..329c194f45a 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,30 @@ +2012-09-18 Chong Yidong + + * display.texi (Faces): Discuss anonymous faces. + (Face Attributes): Tweak intro. + (Defining Faces): Move after the Face Attributes node. Copyedits. + (Displaying Faces): Describe role of inheritance. + + * customize.texi (Customization): Define customization more + carefully (Bug#11440). + (Common Keywords): Add xref to Constant Variables. + + * variables.texi (Defining Variables): Link to defcustom's node + instead of the higher-level Customization chapter. + +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + * numbers.texi (Float Basics, Arithmetic Operations, Math Functions): + Document that / and mod (with floating point arguments), along + with asin, acos, log, log10, expt and sqrt, return special values + instead of signaling exceptions. + (Float Basics): Document that logb operates on the absolute value + of its argument. + (Math Functions): Document that (log ARG BASE) also returns NaN if + BASE is negative. Document that (expt X Y) returns NaN if X is a + finite negative number and Y a finite non-integer. + 2012-09-09 Chong Yidong * lists.texi (Sets And Lists): Explain that the return value for diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 38dfc949264..c9d22851ed2 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -6,13 +6,30 @@ @chapter Customization Settings @cindex customization item - This chapter describes how to declare customizable variables and -customization groups for classifying them. We use the term -@dfn{customization item} to include customizable variables, -customization groups, as well as faces. + Users of Emacs can customize variables and faces without writing +Lisp code, by using the Customize interface. @xref{Easy +Customization,,, emacs, The GNU Emacs Manual}. This chapter describes +how to define @dfn{customization items} that users can interact with +through the Customize interface. - @xref{Defining Faces}, for the @code{defface} macro, which is used -for declaring customizable faces. + Customization items include customizable variables, which are +defined with the +@ifinfo +@code{defcustom} macro (@pxref{Variable Definitions}); +@end ifinfo +@ifnotinfo +@code{defcustom} macro; +@end ifnotinfo +customizable faces, which are defined with @code{defface} (described +separately in @ref{Defining Faces}); and @dfn{customization groups}, +defined with +@ifinfo +@code{defgroup} (@pxref{Group Definitions}), +@end ifinfo +@ifnotinfo +@code{defgroup}, +@end ifnotinfo +which act as containers for groups of related customization items. @menu * Common Keywords:: Common keyword arguments for all kinds of @@ -29,9 +46,10 @@ for declaring customizable faces. @cindex customization keywords The customization declarations that we will describe in the next few -sections (@code{defcustom}, @code{defgroup}, etc.) all accept keyword -arguments for specifying various information. This section describes -keywords that apply to all types of customization declarations. +sections---@code{defcustom}, @code{defgroup}, etc.---all accept +keyword arguments (@pxref{Constant Variables}) for specifying various +information. This section describes keywords that apply to all types +of customization declarations. All of these keywords, except @code{:tag}, can be used more than once in a given item. Each use of the keyword has an independent effect. @@ -188,14 +206,14 @@ choice is the official name of the package, such as MH-E or Gnus. @cindex define customization group @cindex customization groups, defining - Each Emacs Lisp package should have one main customization group which -contains all the options, faces and other groups in the package. If the -package has a small number of options and faces, use just one group and -put everything in it. When there are more than twelve or so options and -faces, then you should structure them into subgroups, and put the -subgroups under the package's main customization group. It is OK to -put some of the options and faces in the package's main group alongside -the subgroups. + Each Emacs Lisp package should have one main customization group +which contains all the options, faces and other groups in the package. +If the package has a small number of options and faces, use just one +group and put everything in it. When there are more than twenty or so +options and faces, then you should structure them into subgroups, and +put the subgroups under the package's main customization group. It is +OK to put some of the options and faces in the package's main group +alongside the subgroups. The package's main or only group should be a member of one or more of the standard customization groups. (To display the full list of them, @@ -251,7 +269,17 @@ confusing names for options and faces. @node Variable Definitions @section Defining Customization Variables @cindex define customization options -@cindex customization variables, how to define +@cindex customizable variables, how to define +@cindex user options, how to define + + @dfn{Customizable variables}, also called @dfn{user options}, are +global Lisp variables whose values can be set through the Customize +interface. Unlike other global variables, which are defined with +@code{defvar} (@pxref{Defining Variables}), customizable variables are +defined using the @code{defcustom} macro. In addition to calling +@code{defvar} as a subroutine, @code{defcustom} states how the +variable should be displayed in the Customize interface, the values it +is allowed to take, etc. @defmac defcustom option standard doc [keyword value]@dots{} This macro declares @var{option} as a user option (i.e.@: a @@ -291,13 +319,14 @@ has not been assigned the right value yet. In that case, use standard value after Emacs starts up. @end defmac - @code{defcustom} accepts the following additional keywords: + In addition to the keywords listed in @ref{Common Keywords}, this +macro accepts the following keywords: @table @code @item :type @var{type} Use @var{type} as the data type for this option. It specifies which -values are legitimate, and how to display the value. -@xref{Customization Types}, for more information. +values are legitimate, and how to display the value +(@pxref{Customization Types}). @item :options @var{value-list} @kindex options@r{, @code{defcustom} keyword} diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 64aa891e56b..11a86f3c1c5 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -1863,20 +1863,36 @@ height. A @dfn{face} is a collection of graphical @dfn{attributes} for displaying text: font, foreground color, background color, optional -underlining, and so on. Faces control how Emacs displays text in -buffers, as well as other parts of the frame such as the mode line. -@xref{Standard Faces,,, emacs, The GNU Emacs Manual}, for the list of -faces Emacs normally comes with. +underlining, etc. Faces control how Emacs displays text in buffers, +as well as other parts of the frame such as the mode line. -@cindex face id - For most purposes, you refer to a face in Lisp programs using its -@dfn{face name}, which is usually a Lisp symbol. For backward -compatibility, a face name can also be a string, which is equivalent -to a Lisp symbol of the same name. +@cindex anonymous face + One way to represent a face is as a property list of attributes, +like @code{(:foreground "red" :weight bold)}. For example, you can +assign such an @dfn{anonymous face} as the value of the @code{face} +text property; this causes Emacs to display the underlying text with +the specified attributes. @xref{Special Properties}. + +@cindex face name + More commonly, a face is referred to via a @dfn{face name}: a Lisp +symbol which is associated with a set of face attributes. Named faces +are defined using the @code{defface} macro (@pxref{Defining Faces}). +Emacs defines several standard named faces; @xref{Standard Faces,,, +emacs, The GNU Emacs Manual}. + + Many parts of Emacs require named faces, and do not accept anonymous +faces. These include the functions documented in @ref{Attribute +Functions}, and the variable @code{font-lock-keywords} +(@pxref{Search-based Fontification}). Unless otherwise stated, we +will use the term @dfn{face} to refer only to named faces. + + For backward compatibility, you can also use a string to specify a +face name; that is equivalent to a Lisp symbol with the same name. @defun facep object -This function returns a non-@code{nil} value if @var{object} is a Lisp -symbol or string that names a face. Otherwise, it returns @code{nil}. +This function returns a non-@code{nil} value if @var{object} is a +named face: a Lisp symbol or string which serves as a face name. +Otherwise, it returns @code{nil}. @end defun By default, each face name corresponds to the same set of attributes @@ -1884,8 +1900,8 @@ in all frames. But you can also assign a face name a special set of attributes in one frame (@pxref{Attribute Functions}). @menu -* Defining Faces:: How to define a face. * Face Attributes:: What is in a face? +* Defining Faces:: How to define a face. * Attribute Functions:: Functions to examine and set face attributes. * Displaying Faces:: How Emacs combines the faces specified for a character. * Face Remapping:: Remapping faces to alternative definitions. @@ -1900,161 +1916,21 @@ attributes in one frame (@pxref{Attribute Functions}). * Low-Level Font:: Lisp representation for character display fonts. @end menu -@node Defining Faces -@subsection Defining Faces - - The @code{defface} macro defines a face and specifies its default -appearance. The user can subsequently customize the face using the -Customize interface (@pxref{Customization}). - -@defmac defface face spec doc [keyword value]@dots{} -This macro declares @var{face} as a customizable face whose default -attributes are given by @var{spec}. You should not quote the symbol -@var{face}, and it should not end in @samp{-face} (that would be -redundant). The argument @var{doc} is a documentation string for the -face. The additional @var{keyword} arguments have the same meanings -as in @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}). - -When @code{defface} executes, it defines the face according to -@var{spec}, then uses any customizations that were read from the -init file (@pxref{Init File}) to override that specification. - -When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs -Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} -overrides any customizations of the face. This way, the face reflects -exactly what the @code{defface} says. - -@cindex face specification -The @var{spec} argument is a @dfn{face specification}, which states -how the face should appear on different kinds of terminals. It should -be an alist whose elements each have the form - -@example -(@var{display} . @var{plist}) -@end example - -@noindent -@var{display} specifies a class of terminals (see below), while -@var{plist} is a property list of face attributes and their values, -specifying how the face appears on such terminals -@iftex -(see the next section for details about face attributes). -@end iftex -@ifnottex -(@pxref{Face Attributes}, for details about face attributes). -@end ifnottex - -The @var{display} part of an element of @var{spec} determines which -frames the element matches. If more than one element of @var{spec} -matches a given frame, the first element that matches is the one used -for that frame. There are three possibilities for @var{display}: - -@table @asis -@item @code{default} -This element of @var{spec} doesn't match any frames; instead, it -specifies defaults that apply to all frames. This element, if used, -must be the first element of @var{spec}. Each of the following -elements can override any or all of these defaults. - -@item @code{t} -This element of @var{spec} matches all frames. Therefore, any -subsequent elements of @var{spec} are never used. Normally -@code{t} is used in the last (or only) element of @var{spec}. - -@item a list -If @var{display} is a list, each element should have the form -@code{(@var{characteristic} @var{value}@dots{})}. Here -@var{characteristic} specifies a way of classifying frames, and the -@var{value}s are possible classifications which @var{display} should -apply to. Here are the possible values of @var{characteristic}: - -@table @code -@item type -The kind of window system the frame uses---either @code{graphic} (any -graphics-capable display), @code{x}, @code{pc} (for the MS-DOS console), -@code{w32} (for MS Windows 9X/NT/2K/XP), or @code{tty} -(a non-graphics-capable display). -@xref{Window Systems, window-system}. - -@item class -What kinds of colors the frame supports---either @code{color}, -@code{grayscale}, or @code{mono}. - -@item background -The kind of background---either @code{light} or @code{dark}. - -@item min-colors -An integer that represents the minimum number of colors the frame -should support. This matches a frame if its -@code{display-color-cells} value is at least the specified integer. - -@item supports -Whether or not the frame can display the face attributes given in -@var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face -Attribute Testing}, for more information on exactly how this testing -is done. -@end table - -If an element of @var{display} specifies more than one @var{value} for a -given @var{characteristic}, any of those values is acceptable. If -@var{display} has more than one element, each element should specify a -different @var{characteristic}; then @emph{each} characteristic of the -frame must match one of the @var{value}s specified for it in -@var{display}. -@end table -@end defmac - - Here's how the standard face @code{highlight} is defined: - -@example -(defface highlight - '((((class color) (min-colors 88) (background light)) - :background "darkseagreen2") - (((class color) (min-colors 88) (background dark)) - :background "darkolivegreen") - (((class color) (min-colors 16) (background light)) - :background "darkseagreen2") - (((class color) (min-colors 16) (background dark)) - :background "darkolivegreen") - (((class color) (min-colors 8)) - :background "green" :foreground "black") - (t :inverse-video t)) - "Basic face for highlighting." - :group 'basic-faces) -@end example - - Internally, Emacs stores the face's default specification in its -@code{face-defface-spec} symbol property (@pxref{Property Lists}). -The @code{saved-face} property stores the face specification saved by -the user, using the customization buffer; the @code{customized-face} -property stores the face specification customized for the current -session, but not saved; and the @code{theme-face} property stores an -alist associating the active customization settings and Custom themes -with their specifications for that face. The face's documentation -string is stored in the @code{face-documentation} property. But -normally you should not try to set any of these properties directly. -@xref{Applying Customizations}, for the @code{custom-set-faces} -function, which is used to apply customized face settings. - - People are sometimes tempted to create variables whose values -specify a face to use. In the vast majority of cases, this is not -necessary; it is preferable to simply use faces directly. - @node Face Attributes @subsection Face Attributes @cindex face attributes - The effect of using a face is determined by a fixed set of @dfn{face -attributes}. This table lists all the face attributes, their possible -values, and their effects. You can specify more than one face for a -given piece of text; Emacs merges the attributes of all the faces to -determine how to display the text. @xref{Displaying Faces}. + @dfn{Face attributes} determine the visual appearance of a face. +The following table lists all the face attributes, their possible +values, and their effects. - In addition to the values given below, each face attribute can also -have the value @code{unspecified}. This special value means the face -doesn't specify that attribute. In face merging, when the first face -fails to specify a particular attribute, the next face gets a chance. -However, the @code{default} face must specify all attributes. + Apart from the values given below, each face attribute can have the +value @code{unspecified}. This special value means that the face +doesn't specify that attribute directly. An @code{unspecified} +attribute tells Emacs to refer instead to a parent face (see the +description @code{:inherit} attribute below); or, failing that, to an +underlying face (@pxref{Displaying Faces}). The @code{default} face +must specify all attributes. Some of these attributes are meaningful only on certain kinds of displays. If your display cannot handle a certain attribute, the @@ -2063,7 +1939,7 @@ attribute is ignored. @table @code @item :family Font family or fontset (a string). @xref{Fonts,,, emacs, The GNU -Emacs Manual}, for more information about font families; the function +Emacs Manual}, for more information about font families. The function @code{font-family-list} (see below) returns a list of available family names. @xref{Fontsets}, for information about fontsets. @@ -2083,9 +1959,8 @@ The height of the font. In the simplest case, this is an integer in units of 1/10 point. The value can also be a floating point number or a function, which -specifies the height relative to an @dfn{underlying face} (i.e., a -face that has a lower priority in the list described in -@ref{Displaying Faces}). If the value is a floating point number, +specifies the height relative to an @dfn{underlying face} +(@pxref{Displaying Faces}). If the value is a floating point number, that specifies the amount by which to scale the height of the underlying face. If the value is a function, that function is called with one argument, the height of the underlying face, and returns the @@ -2261,11 +2136,147 @@ suitable for use with @code{:stipple} (see above). It returns @code{nil} otherwise. @end defun +@node Defining Faces +@subsection Defining Faces + + The usual way to define a face is through the @code{defface} macro. +This macro defines a face name, and associates that name with a set of +face attributes. It also sets up the face so that the user can +customize it via the Customize interface (@pxref{Customization}). + +@defmac defface face spec doc [keyword value]@dots{} +This macro declares @var{face} as a customizable face whose default +attributes are given by @var{spec}. You should not quote the symbol +@var{face}, and it should not end in @samp{-face} (that would be +redundant). The argument @var{doc} is a documentation string for the +face. The additional @var{keyword} arguments have the same meanings +as in @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}). + +When @code{defface} executes, it defines the face according to +@var{spec}, then uses any customizations that were read from the +init file (@pxref{Init File}) to override that specification. + +When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs +Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} +overrides any customizations of the face. This way, the face reflects +exactly what the @code{defface} says. + +@cindex face specification +The @var{spec} argument is a @dfn{face specification}, which states +how the face should appear on different kinds of terminals. It should +be an alist whose elements each have the form + +@example +(@var{display} . @var{plist}) +@end example + +@noindent +@var{display} specifies a class of terminals (see below). @var{plist} +is a property list of face attributes and their values, specifying how +the face appears on such terminals. For backward compatibility, you +can also write an element as @code{(@var{display} @var{plist})}. + +The @var{display} part of an element of @var{spec} determines which +terminals the element matches. If more than one element of @var{spec} +matches a given terminal, the first element that matches is the one +used for that terminal. There are three possibilities for +@var{display}: + +@table @asis +@item @code{default} +This element of @var{spec} doesn't match any terminal; instead, it +specifies defaults that apply to all terminals. This element, if +used, must be the first element of @var{spec}. Each of the following +elements can override any or all of these defaults. + +@item @code{t} +This element of @var{spec} matches all terminals. Therefore, any +subsequent elements of @var{spec} are never used. Normally @code{t} +is used in the last (or only) element of @var{spec}. + +@item a list +If @var{display} is a list, each element should have the form +@code{(@var{characteristic} @var{value}@dots{})}. Here +@var{characteristic} specifies a way of classifying terminals, and the +@var{value}s are possible classifications which @var{display} should +apply to. Here are the possible values of @var{characteristic}: + +@table @code +@item type +The kind of window system the terminal uses---either @code{graphic} +(any graphics-capable display), @code{x}, @code{pc} (for the MS-DOS +console), @code{w32} (for MS Windows 9X/NT/2K/XP), or @code{tty} (a +non-graphics-capable display). @xref{Window Systems, window-system}. + +@item class +What kinds of colors the terminal supports---either @code{color}, +@code{grayscale}, or @code{mono}. + +@item background +The kind of background---either @code{light} or @code{dark}. + +@item min-colors +An integer that represents the minimum number of colors the terminal +should support. This matches a terminal if its +@code{display-color-cells} value is at least the specified integer. + +@item supports +Whether or not the terminal can display the face attributes given in +@var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face +Attribute Testing}, for more information on exactly how this testing +is done. +@end table + +If an element of @var{display} specifies more than one @var{value} for +a given @var{characteristic}, any of those values is acceptable. If +@var{display} has more than one element, each element should specify a +different @var{characteristic}; then @emph{each} characteristic of the +terminal must match one of the @var{value}s specified for it in +@var{display}. +@end table +@end defmac + + Here's how the standard face @code{highlight} is defined: + +@example +(defface highlight + '((((class color) (min-colors 88) (background light)) + :background "darkseagreen2") + (((class color) (min-colors 88) (background dark)) + :background "darkolivegreen") + (((class color) (min-colors 16) (background light)) + :background "darkseagreen2") + (((class color) (min-colors 16) (background dark)) + :background "darkolivegreen") + (((class color) (min-colors 8)) + :background "green" :foreground "black") + (t :inverse-video t)) + "Basic face for highlighting." + :group 'basic-faces) +@end example + + Internally, Emacs stores the face's default specification in its +@code{face-defface-spec} symbol property (@pxref{Property Lists}). +The @code{saved-face} property stores the face specification saved by +the user, using the customization buffer; the @code{customized-face} +property stores the face specification customized for the current +session, but not saved; and the @code{theme-face} property stores an +alist associating the active customization settings and Custom themes +with their specifications for that face. The face's documentation +string is stored in the @code{face-documentation} property. But +normally you should not try to set any of these properties directly. +@xref{Applying Customizations}, for the @code{custom-set-faces} +function, which is used to apply customized face settings. + + People are sometimes tempted to create variables whose values +specify a face to use. In the vast majority of cases, this is not +necessary; it is preferable to simply use faces directly. + @node Attribute Functions @subsection Face Attribute Functions This section describes the functions for accessing and modifying the -attributes of an existing face. +attributes of an existing named face. @defun set-face-attribute face frame &rest arguments This function sets one or more attributes of @var{face} for @@ -2467,8 +2478,12 @@ This function returns the @code{:inverse-video} attribute of face @var{face}. @node Displaying Faces @subsection Displaying Faces - Here is how Emacs determines the face to use for displaying any -given piece of text: + When Emacs displays a given piece of text, the visual appearance of +the text may be determined by faces drawn from different sources. If +these various sources together specify more than one face for a +particular character, Emacs merges the attributes of the various +faces. Here is the order in which Emacs merges the faces, from +highest to lowest priority: @itemize @bullet @item @@ -2482,11 +2497,11 @@ Manual}. @item If the text lies within an overlay with a non-@code{nil} @code{face} -property, Emacs applies the face or face attributes specified by that -property. If the overlay has a @code{mouse-face} property and the -mouse is ``near enough'' to the overlay, Emacs applies the face or -face attributes specified by the @code{mouse-face} property instead. -@xref{Overlay Properties}. +property, Emacs applies the face(s) specified by that property. If +the overlay has a @code{mouse-face} property and the mouse is ``near +enough'' to the overlay, Emacs applies the face or face attributes +specified by the @code{mouse-face} property instead. @xref{Overlay +Properties}. When multiple overlays cover one character, an overlay with higher priority overrides those with lower priority. @xref{Overlays}. @@ -2508,11 +2523,12 @@ If any given attribute has not been specified during the preceding steps, Emacs applies the attribute of the @code{default} face. @end itemize - If these various sources together specify more than one face for a -particular character, Emacs merges the attributes of the various faces -specified. For each attribute, Emacs tries using the above order -(i.e.@: first the face of any special glyph; then the face for region -highlighting, if appropriate; and so on). + At each stage, if a face has a valid @code{:inherit} attribute, +Emacs treats any attribute with an @code{unspecified} value as having +the corresponding value drawn from the parent face(s). @pxref{Face +Attributes}. Note that the parent face(s) may also leave the +attribute unspecified; in that case, the attribute remains unspecified +at the next level of face merging. @node Face Remapping @subsection Face Remapping diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index caa5185dec3..db770616820 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -1366,8 +1366,8 @@ Overlays Faces -* Defining Faces:: How to define a face. * Face Attributes:: What is in a face? +* Defining Faces:: How to define a face. * Attribute Functions:: Functions to examine and set face attributes. * Displaying Faces:: How Emacs combines the faces specified for a character. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index fe7f24e42cd..a5910ea921b 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -2999,12 +2999,11 @@ can be the following: A face name (a symbol or string). @item -A property list of face attributes. This has the -form (@var{keyword} @var{value} @dots{}), where each @var{keyword} is a -face attribute name and @var{value} is a meaningful value for that -attribute. With this feature, you do not need to create a face each -time you want to specify a particular attribute for certain text. -@xref{Face Attributes}. +A property list of face attributes. This has the form (@var{keyword} +@var{value} @dots{}), where each @var{keyword} is a face attribute +name and @var{value} is a meaningful value for that attribute. With +this feature, you do not need to create a face each time you want to +specify a particular attribute for certain text. @item A list of faces. This specifies a face which is an aggregate of the diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index c5b66757ace..1c0abcb8e66 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -403,7 +403,8 @@ unconditionally initializes the variable, whereas @code{defvar} initializes it only if it is originally void. To define a customizable variable, you should use @code{defcustom} -(which calls @code{defvar} as a subroutine). @xref{Customization}. +(which calls @code{defvar} as a subroutine). @xref{Variable +Definitions}. @defspec defvar symbol [value [doc-string]] This special form defines @var{symbol} as a variable. Note that diff --git a/etc/ChangeLog b/etc/ChangeLog index aa788275256..6f2b178fcd7 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,47 @@ +2012-09-17 Glenn Morris + + * refcards/emacsver.tex: New file. + * refcards/calccard.tex, refcards/cs-dired-ref.tex: + * refcards/cs-refcard.tex, refcards/cs-survival.tex: + * refcards/de-refcard.tex, refcards/dired-ref.tex: + * refcards/emacsver.tex, refcards/fr-dired-ref.tex: + * refcards/fr-refcard.tex, refcards/fr-survival.tex: + * refcards/orgcard.tex, refcards/pl-refcard.tex: + * refcards/pt-br-refcard.tex, refcards/refcard.tex: + * refcards/sk-dired-ref.tex, refcards/sk-refcard.tex: + * refcards/sk-survival.tex, refcards/survival.tex: + * refcards/vipcard.tex, refcards/viperCard.tex: Include emacsver.tex. + * refcards/calccard.tex (\emacsversionnumber): + Rename to \versionemacs, same as all the other refcards. + * refcards/Makefile (ENVADD): New variable. + (sk-dired-ref.pdf, sk-survival.pdf, pl-refcard.pdf) + (%.pdf, %,dvi, sk-dired-ref.dvi, sk-survival.dvi, pl-refcard.dvi): + Depend on emacsver.tex. Add "." to TEXINPUTS for TeX commands. + +2012-09-16 Paul Eggert + + Remove configure's --without-sync-input option (Bug#12450). + * TODO (Make SYNC_INPUT the default): Remove, as the code now + behaves as if SYNC_INPUT is always true. + +2012-09-13 Paul Eggert + + Use a more backwards-compatible timer format (Bug#12430). + * NEWS: Document it, plus fix a typo. + +2012-09-13 Jan Djärv + + * NEWS (--with-x-toolkit): Mention that Gtk+ 3 is now default. + +2012-09-13 Paul Eggert + + * NEWS: Document timer format change (Bug#12430). + +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + * NEWS: Document NaNs versus signaling-error change. + 2012-09-04 Paul Eggert Give more-useful info on a fatal error (Bug#12328). diff --git a/etc/NEWS b/etc/NEWS index a7388c4e9fa..3344158b73c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -65,6 +65,14 @@ renamed to '--enable-check-lisp-object-type', as the resulting Lisp_Object type no longer uses a union to implement the compile time check that this option enables. +--- +** The default toolkit has been changed to Gtk+ version 3. +If you don't pass --with-x-toolkit to configure or if you pass +--with-x-toolkit=gtk or --with-x-toolkit=yes, configure will try to build +with Gtk+ version 3, and if that fails, try Gtk+ version 2. +You can explicitly require a specific version by passing +--with-x-toolkit=gtk2 or --with-x-toolkit=gtk3 to configure. + * Startup Changes in Emacs 24.3 @@ -101,6 +109,11 @@ machines. Other functions that use this format, such as file-attributes and format-time-string, have been changed accordingly. Old-format time stamps are still accepted. +** The format of timers in timer-list and timer-idle-list is now +[TRIGGERED-P HI-SECS LO-SECS USECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY PSECS]. +The PSECS slot is new, and uses picosecond resolution. It can be +accessed via the new timer--psecs accessor. + ** Emacs now generates backtraces on fatal errors. On encountering a fatal error, Emacs now outputs a textual description of the fatal signal, and a short backtrace on platforms like glibc @@ -722,6 +735,7 @@ in Emacs 24.1: **** `special-display-frame-alist' **** `special-display-buffer-names' **** `special-display-function' +**** `display-buffer-function' ** Completion diff --git a/etc/TODO b/etc/TODO index 50e3bd64b9d..be0ef95aed2 100644 --- a/etc/TODO +++ b/etc/TODO @@ -1229,13 +1229,6 @@ systems for HTML/XML files automatically." For use by sml-mode, python-mode, tex-mode, scheme-mode, lisp-mode, haskell-mode, tuareg-mode, ... -** Make SYNC_INPUT the default. [true since 2008-03-11] - All loops using immediate_quit need to be checked to ensure that - C-g can interrupt them, in case of an infinite loop. Once we - switch to using SYNC_INPUT, we can remove the BLOCK_INPUTs in the - allocation functions (allocate_string etc.) without worrying about - data munging. - ** Add "link" button class Add a standard button-class named "link", and make all other link-like button classes inherit from it. Set the default face of the "link" button diff --git a/etc/refcards/Makefile b/etc/refcards/Makefile index 64e2d8638f8..ef810da6022 100644 --- a/etc/refcards/Makefile +++ b/etc/refcards/Makefile @@ -47,26 +47,27 @@ VIPER_CARDS_PDF = vipcard.pdf viperCard.pdf viper-cards_pdf: ${VIPER_CARDS_PDF} viper-cards_ps: ${VIPER_CARDS_PDF:.pdf=.ps} +ENVADD = TEXINPUTS=".:" ## PDF files. ## The page layouts (a4/letter) are written directly in the .tex files. cs-refcard.pdf cs-dired-ref.pdf cs-survival.pdf sk-refcard.pdf \ -sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex +sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex emacsver.tex if pdfcsplain --version > /dev/null 2> /dev/null; then \ - pdfcsplain $<; \ + ${ENVADD} pdfcsplain $<; \ else \ - csplain "\pdfoutput=1\input $<"; \ + ${ENVADD} csplain "\pdfoutput=1\input $<"; \ fi ## Some versions of pdfmex seem to create dvi by default, hence output-format. -pl-refcard.pdf: %.pdf: %.tex +pl-refcard.pdf: %.pdf: %.tex emacsver.tex if ! kpsewhich -format=fmt mex > /dev/null && \ ! pdfmex --version > /dev/null 2> /dev/null; then \ echo "No mex format found."; false; \ fi - pdftex -output-format=pdf $< + ${ENVADD} pdftex -output-format=pdf $< ru-refcard.pdf: %.pdf: %.tex pdflatex $< @@ -81,21 +82,21 @@ gnus-booklet.pdf: gnus-refcard.tex gnus-logo.pdf pdflatex -jobname=gnus-booklet '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}' ## Everything not explicitly listed above. -%.pdf: %.tex - pdftex $< +%.pdf: %.tex emacsver.tex + ${ENVADD} pdftex $< ## dvi files. cs-refcard.dvi cs-dired-ref.dvi cs-survival.dvi sk-refcard.dvi \ -sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex - csplain $< +sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex emacsver.tex + ${ENVADD} csplain $< -pl-refcard.dvi: %.dvi: %.tex +pl-refcard.dvi: %.dvi: %.tex emacsver.tex if ! kpsewhich -format=fmt mex > /dev/null; then \ echo "No mex format found."; false; \ fi - tex $< + ${ENVADD} tex $< ru-refcard.dvi gnus-refcard.dvi: %.dvi: %.tex latex $< @@ -105,8 +106,8 @@ gnus-booklet.dvi: gnus-refcard.tex mv gnus-refcard.dvi $@ ## Everything not explicitly listed above. -%.dvi: %.tex - tex $< +%.dvi: %.tex emacsver.tex + ${ENVADD} tex $< ## PostScript files. diff --git a/etc/refcards/calccard.tex b/etc/refcards/calccard.tex index fd3d45b8da4..04c88befeea 100644 --- a/etc/refcards/calccard.tex +++ b/etc/refcards/calccard.tex @@ -63,8 +63,7 @@ % UUCP: mit-erl!gildea % Internet: gildea@stop.mail-abuse.org -\def\emacsversionnumber{24} -\def\year{2012} % latest copyright year +\input emacsver.tex \def\shortcopyrightnotice{\vskip 1ex plus 2 fill \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. @@ -276,7 +275,7 @@ \title{GNU Calc Reference Card} -\centerline{(for GNU Emacs version \emacsversionnumber)} +\centerline{(for GNU Emacs version \versionemacs)} \section{Starting and Stopping} diff --git a/etc/refcards/cs-dired-ref.tex b/etc/refcards/cs-dired-ref.tex index ee7acaf416d..45867e11d44 100644 --- a/etc/refcards/cs-dired-ref.tex +++ b/etc/refcards/cs-dired-ref.tex @@ -41,8 +41,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/cs-refcard.tex b/etc/refcards/cs-refcard.tex index d17e5c6ddeb..98842dd08e0 100644 --- a/etc/refcards/cs-refcard.tex +++ b/etc/refcards/cs-refcard.tex @@ -59,8 +59,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/cs-survival.tex b/etc/refcards/cs-survival.tex index 5aa111c0297..4050cf0a1ab 100644 --- a/etc/refcards/cs-survival.tex +++ b/etc/refcards/cs-survival.tex @@ -54,8 +54,7 @@ % Czech hyphenation rules applied \chyph -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/de-refcard.tex b/etc/refcards/de-refcard.tex index ca3141b8390..906895b358a 100644 --- a/etc/refcards/de-refcard.tex +++ b/etc/refcards/de-refcard.tex @@ -60,8 +60,7 @@ \input german.sty \mdqoff % deactivates the "-char -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/dired-ref.tex b/etc/refcards/dired-ref.tex index 9ccf57682ff..b85bef1ce0b 100644 --- a/etc/refcards/dired-ref.tex +++ b/etc/refcards/dired-ref.tex @@ -43,8 +43,7 @@ \input pdflayout.sty \pdflayout=(1) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/emacsver.tex b/etc/refcards/emacsver.tex new file mode 100644 index 00000000000..620ee8ef9e0 --- /dev/null +++ b/etc/refcards/emacsver.tex @@ -0,0 +1,4 @@ +%% This file is not generated by configure, because then the provided +%% pdf files would always appear out-of-date. +\def\versionemacs{24} % major version of emacs +\def\year{2012} % latest copyright year diff --git a/etc/refcards/fr-dired-ref.tex b/etc/refcards/fr-dired-ref.tex index 2819bbaa25b..457ee2db472 100644 --- a/etc/refcards/fr-dired-ref.tex +++ b/etc/refcards/fr-dired-ref.tex @@ -35,8 +35,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/fr-refcard.tex b/etc/refcards/fr-refcard.tex index ed82f00a85d..4fe94d79075 100644 --- a/etc/refcards/fr-refcard.tex +++ b/etc/refcards/fr-refcard.tex @@ -56,8 +56,7 @@ \input pdflayout.sty \pdflayout=(0l) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/fr-survival.tex b/etc/refcards/fr-survival.tex index 1cd9cc4cf05..16d67f6b1cd 100644 --- a/etc/refcards/fr-survival.tex +++ b/etc/refcards/fr-survival.tex @@ -49,8 +49,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 3c0584d6db4..60e81f36d3e 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,7 +1,7 @@ % Reference Card for Org Mode \def\orgversionnumber{7.8.11} \def\versionyear{2012} % latest update -\def\year{2012} % latest copyright year +\input emacsver.tex %**start of header \newcount\columnsperpage diff --git a/etc/refcards/pl-refcard.tex b/etc/refcards/pl-refcard.tex index 9cc6fc6a6cd..db814cfa8c2 100644 --- a/etc/refcards/pl-refcard.tex +++ b/etc/refcards/pl-refcard.tex @@ -69,8 +69,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/pt-br-refcard.tex b/etc/refcards/pt-br-refcard.tex index c16d5096f30..d3fbe54ce87 100644 --- a/etc/refcards/pt-br-refcard.tex +++ b/etc/refcards/pt-br-refcard.tex @@ -62,8 +62,7 @@ \input pdflayout.sty \pdflayout=(0l) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/refcard.tex b/etc/refcards/refcard.tex index 70788e8c67b..6ca9856085d 100644 --- a/etc/refcards/refcard.tex +++ b/etc/refcards/refcard.tex @@ -63,8 +63,7 @@ % Nothing else needs to be changed below this line. -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % copyright year +\input emacsver.tex \def\shortcopyrightnotice{\vskip 1ex plus 2 fill \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. diff --git a/etc/refcards/sk-dired-ref.tex b/etc/refcards/sk-dired-ref.tex index 4b12b0b42eb..50d17409072 100644 --- a/etc/refcards/sk-dired-ref.tex +++ b/etc/refcards/sk-dired-ref.tex @@ -42,8 +42,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/sk-refcard.tex b/etc/refcards/sk-refcard.tex index 5105e8ca986..e617387fad1 100644 --- a/etc/refcards/sk-refcard.tex +++ b/etc/refcards/sk-refcard.tex @@ -60,8 +60,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/sk-survival.tex b/etc/refcards/sk-survival.tex index 7597c63f5c7..2e7ac9b9298 100644 --- a/etc/refcards/sk-survival.tex +++ b/etc/refcards/sk-survival.tex @@ -55,8 +55,7 @@ % Slovak hyphenation rules applied \shyph -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/survival.tex b/etc/refcards/survival.tex index 92d178a130a..09151e9801c 100644 --- a/etc/refcards/survival.tex +++ b/etc/refcards/survival.tex @@ -44,8 +44,7 @@ \input pdflayout.sty \pdflayout=(1) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/vipcard.tex b/etc/refcards/vipcard.tex index 13b43dbab73..2a709dc79f2 100644 --- a/etc/refcards/vipcard.tex +++ b/etc/refcards/vipcard.tex @@ -49,8 +49,8 @@ \input pdflayout.sty \pdflayout=(1) +\input emacsver.tex \def\versionemacs{18} % version of Emacs this is for -\def\year{2012} % latest copyright year \def\versionvip{3.5} % Nothing else needs to be changed. diff --git a/etc/refcards/viperCard.tex b/etc/refcards/viperCard.tex index a8694dd3bed..c6ab31cdb83 100644 --- a/etc/refcards/viperCard.tex +++ b/etc/refcards/viperCard.tex @@ -52,8 +52,8 @@ \input pdflayout.sty \pdflayout=(1) +\input emacsver.tex \def\versionemacs{21} % version of Emacs this is for -\def\year{2012} % latest copyright year \def\versionxemacs{20} % version of XEmacs this is for \def\versionviper{3.0} % version of Viper this is for diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index f8569fe3747..056ed471fde 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -3516,8 +3516,7 @@ usage (int error) static _Noreturn void version (void) { - /* Makes it easier to update automatically. */ - char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc."; + char emacs_copyright[] = COPYRIGHT; printf ("ebrowse %s\n", VERSION); puts (emacs_copyright); diff --git a/lib-src/etags.c b/lib-src/etags.c index e65082de534..ec415e9905f 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -836,8 +836,7 @@ etags --help --lang=ada."); static void print_version (void) { - /* Makes it easier to update automatically. */ - char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc."; + char emacs_copyright[] = COPYRIGHT; printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); puts (emacs_copyright); diff --git a/lisp/align.el b/lisp/align.el index 4c82d7bea81..0af5e56c668 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -74,7 +74,7 @@ ;; align-?-modes variables (for example, `align-dq-string-modes'), use ;; `add-to-list', or some similar function which checks first to see ;; if the value is already there. Since the user may customize that -;; mode list, and then write your mode name into their .emacs file, +;; mode list, and then write your mode name into their init file, ;; causing the symbol already to be present the next time they load ;; your package. @@ -1201,7 +1201,10 @@ have been aligned. No changes will be made to the buffer." (gocol col) cur) (when area (if func - (funcall func (car area) (cdr area) change) + (funcall func + (marker-position (car area)) + (marker-position (cdr area)) + change) (if (not (and justify (consp (cdr area)))) (goto-char (cdr area)) diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index fbf8c466585..21c35811ac3 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -36,7 +36,7 @@ ;; setq auto-insert-directory to an appropriate slash-terminated value ;; ;; You can also customize the variable `auto-insert-mode' to load the -;; package. Alternatively, add the following to your .emacs file: +;; package. Alternatively, add the following to your init file: ;; (auto-insert-mode 1) ;; ;; Author: Charlie Martin diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 75a8d9f59dc..31bbc13acf9 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -144,10 +144,7 @@ You can toggle whether files are shown with \\\\[bookma (defcustom bookmark-bmenu-toggle-filenames t "Non-nil means show filenames when listing bookmarks. -This may result in truncated bookmark names. To disable this, put the -following in your `.emacs' file: - -\(setq bookmark-bmenu-toggle-filenames nil)" +A non-nil value may result in truncated bookmark names." :type 'boolean :group 'bookmark) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 7089070df59..c7d93530fd7 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -61,7 +61,7 @@ (declare-function math-vector-is-string "calccomp" (a)) (declare-function math-vector-to-string "calccomp" (a &optional quoted)) (declare-function math-format-radix-float "calc-bin" (a prec)) -(declare-function math-compose-expr "calccomp" (a prec)) +(declare-function math-compose-expr "calccomp" (a prec &optional div)) (declare-function math-abs "calc-arith" (a)) (declare-function math-format-bignum-binary "calc-bin" (a)) (declare-function math-format-bignum-octal "calc-bin" (a)) @@ -3483,7 +3483,7 @@ If X is not an error form, return 1." (substring str i)))) str)) -;;; Users can redefine this in their .emacs files. +;;; Users can redefine this in their init files. (defvar calc-keypad-user-menu nil "If non-nil, this describes an additional menu for calc-keypad. It should contain a list of three rows. diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index dfc5dfc6588..bd748158d66 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -494,7 +494,7 @@ (car res)))))))) -;;; It is safe to redefine these in your .emacs file to use a different +;;; It is safe to redefine these in your init file to use a different ;;; language. (defvar math-long-weekday-names '( "Sunday" "Monday" "Tuesday" "Wednesday" diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 3e6ae1c7404..17f0998d30b 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -199,7 +199,7 @@ (declare-function calc-div-fractions "calc-frac" (a b)) (declare-function math-div-objects-fancy "calc-arith" (a b)) (declare-function math-div-symb-fancy "calc-arith" (a b)) -(declare-function math-compose-expr "calccomp" (a prec)) +(declare-function math-compose-expr "calccomp" (a prec &optional div)) (declare-function math-comp-width "calccomp" (c)) (declare-function math-composition-to-string "calccomp" (c &optional width)) (declare-function math-stack-value-offset-fancy "calccomp" ()) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index d5514d14a32..cdbf8d7aa86 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -593,7 +593,7 @@ You can customize `diary-date-forms' to your preferred format. Three default styles are provided: `diary-american-date-forms', `diary-european-date-forms', and `diary-iso-date-forms'. You can choose between these by setting `calendar-date-style' in your -.emacs file, or by using `calendar-set-date-style' when in the calendar. +init file, or by using `calendar-set-date-style' when in the calendar. A diary entry can be preceded by the character `diary-nonmarking-symbol' \(ordinarily `&') to make that entry nonmarking--that is, it will not be @@ -1276,7 +1276,7 @@ Runs the following hooks: generating a calendar, if today's date is visible or not, respectively `calendar-initial-window-hook' - after first creating a calendar -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "P") ;; Avoid loading cal-x unless it will be used. (if (and (memq calendar-setup '(one-frame two-frames calendar-only)) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 8fa5b0ddb07..4bce8ec0927 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -200,19 +200,21 @@ holidays), or hard copy output." 'diary-list-entries-hook "23.1") (defcustom diary-list-entries-hook nil - "List of functions called after diary file is culled for relevant entries. -You might wish to add `diary-include-other-diary-files', in which case -you will probably also want to add `diary-mark-included-diary-files' to -`diary-mark-entries-hook'. For example, you could use + "Hook run after diary file is culled for relevant entries. + +If you add `diary-include-other-diary-files' to this hook, you +will probably also want to add `diary-mark-included-diary-files' +to `diary-mark-entries-hook'. For example, to cause the fancy +diary buffer to be displayed with diary entries from various +included files, each day's entries sorted into lexicographic +order, add the following to your init file: (setq diary-display-function 'diary-fancy-display) (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) (add-hook 'diary-list-entries-hook 'diary-sort-entries t) -in your `.emacs' file to cause the fancy diary buffer to be displayed with -diary entries from various included files, each day's entries sorted into -lexicographic order. Note how the sort function is placed last, -so that it can sort the entries included from other files. +Note how the sort function is placed last, so that it can sort +the entries included from other files. This hook runs after `diary-nongregorian-listing-hook'. These two hooks differ only if you are using included diary files. In that case, @@ -532,7 +534,7 @@ If so, return the expanded file name, otherwise signal an error." "Generate the diary window for ARG days starting with the current date. If no argument is provided, the number of days of diary entries is governed by the variable `diary-number-of-entries'. A value of ARG less than 1 -does nothing. This function is suitable for execution in a `.emacs' file." +does nothing. This function is suitable for execution in an init file." (interactive "P") (diary-check-diary-file) (diary-list-entries (calendar-current-date) @@ -1230,8 +1232,8 @@ Mail is sent to the address specified by `diary-mail-addr'. Here is an example of a script to call `diary-mail-entries', suitable for regular scheduling using cron (or at). Note that -since `emacs -script' does not load your `.emacs' file, you -should ensure that all relevant variables are set. +since `emacs -script' does not load your init file, you should +ensure that all relevant variables are set. #!/usr/bin/emacs -script ;; diary-rem.el - run the Emacs diary-reminder diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 9643a1e2905..b94815f98ea 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -343,12 +343,12 @@ See the documentation for `calendar-holidays' for details." "List of notable days for the command \\[holidays]. Additional holidays are easy to add to the list, just put them in the -list `holiday-other-holidays' in your .emacs file. Similarly, by setting +list `holiday-other-holidays' in your init file. Similarly, by setting any of `holiday-general-holidays', `holiday-local-holidays', `holiday-christian-holidays', `holiday-hebrew-holidays', `holiday-islamic-holidays', `holiday-bahai-holidays', `holiday-oriental-holidays', or `holiday-solar-holidays' to nil in your -.emacs file, you can eliminate unwanted categories of holidays. +init file, you can eliminate unwanted categories of holidays. The aforementioned variables control the holiday choices offered by the function `holiday-list' when it is called interactively. @@ -523,7 +523,7 @@ use instead of point." (defun holidays (&optional arg) "Display the holidays for last month, this month, and next month. If called with an optional prefix argument ARG, prompts for month and year. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in a init file." (interactive "P") (save-excursion (let* ((completion-ignore-case t) diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el index 8f09d20f50e..2761df0bdb1 100644 --- a/lisp/calendar/lunar.el +++ b/lisp/calendar/lunar.el @@ -236,7 +236,7 @@ use instead of point." (defun lunar-phases (&optional arg) "Display the quarters of the moon for last month, this month, and next month. If called with an optional prefix argument ARG, prompts for month and year. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "P") (save-excursion (let* ((date (if arg (calendar-read-date t) diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index a8d7d44af3b..3ccdf135fb6 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el @@ -797,7 +797,7 @@ If called with an optional prefix argument ARG, prompt for date. If called with an optional double prefix argument, prompt for longitude, latitude, time zone, and date, and always use standard time. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "p") (or arg (setq arg 1)) (if (and (< arg 16) diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 2ebb8c7c3ae..3151ce145de 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -49,7 +49,7 @@ ;; If you want Emacs to display the amount of time "left" to your ;; workday in the mode-line, you can either set the value of ;; `timeclock-mode-line-display' to t using M-x customize, or you can -;; add this code to your .emacs file: +;; add this code to your init file: ;; ;; (require 'timeclock) ;; (timeclock-mode-line-display) @@ -60,7 +60,7 @@ ;; You may also want Emacs to ask you before exiting, if you are ;; currently working on a project. This can be done either by setting ;; `timeclock-ask-before-exiting' to t using M-x customize (this is -;; the default), or by adding the following to your .emacs file: +;; the default), or by adding the following to your init file: ;; ;; (add-hook 'kill-emacs-query-functions 'timeclock-query-out) diff --git a/lisp/comint.el b/lisp/comint.el index 5b0eb3027e6..994d81a375a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -181,7 +181,7 @@ override the read-only-ness of comint prompts is to call `comint-kill-whole-line' or `comint-kill-region' with no narrowing in effect. This way you will be certain that none of the remaining prompts will be accidentally messed up. You may -wish to put something like the following in your `.emacs' file: +wish to put something like the following in your init file: \(add-hook 'comint-mode-hook (lambda () @@ -3161,8 +3161,8 @@ See `completion-table-with-quoting' and `comint-unquote-function'.") (complete-with-action action table string pred)))) (unless (zerop (length filesuffix)) (list :exit-function - (lambda (_s finished) - (when (memq finished '(sole finished)) + (lambda (_s status) + (when (eq status 'finished) (if (looking-at (regexp-quote filesuffix)) (goto-char (match-end 0)) (insert filesuffix))))))))) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 86a19131569..2e6f2b14625 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -526,7 +526,10 @@ WIDGET is the widget to apply the filter entries of MENU on." :type 'boolean) (defcustom custom-unlispify-remove-prefixes nil - "Non-nil means remove group prefixes from option names in buffer." + "Non-nil means remove group prefixes from option names in buffer. +Discarding prefixes often leads to confusing names for options +and faces in Customize buffers, so do not set this to a non-nil +value unless you are sure you know what it does." :group 'custom-menu :group 'custom-buffer :type 'boolean) diff --git a/lisp/custom.el b/lisp/custom.el index 3eb2895888d..dfc8e631152 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -237,7 +237,7 @@ The following keywords are meaningful: is `default-value'. :require VALUE should be a feature symbol. If you save a value - for this option, then when your `.emacs' file loads the value, + for this option, then when your init file loads the value, it does (require VALUE) first. :set-after VARIABLES Specifies that SYMBOL should be set after the list of variables @@ -350,68 +350,62 @@ FACE does not need to be quoted. Third argument DOC is the face documentation. -If FACE has been set with `custom-set-faces', set the face attributes -as specified by that function, otherwise set the face attributes -according to SPEC. - -The remaining arguments should have the form - - [KEYWORD VALUE]... +If FACE has been set with `custom-set-faces', set the face +attributes as specified by that function, otherwise set the face +attributes according to SPEC. +The remaining arguments should have the form [KEYWORD VALUE]... For a list of valid keywords, see the common keywords listed in `defcustom'. -SPEC should be an alist of the form ((DISPLAY ATTS)...). +SPEC should be an alist of the form -In the first element, DISPLAY can be `default'. The ATTS in that -element then act as defaults for all the following elements. + ((DISPLAY . ATTS)...) -Aside from that, DISPLAY specifies conditions to match some or -all frames. For each frame, the first element of SPEC where the -DISPLAY conditions are satisfied is the one that applies to that -frame. The ATTRs in this element take effect, and the following -elements are ignored, on that frame. +where DISPLAY is a form specifying conditions to match certain +terminals and ATTS is a property list (ATTR VALUE ATTR VALUE...) +specifying face attributes and values for frames on those +terminals. On each terminal, the first element with a matching +DISPLAY specification takes effect, and the remaining elements in +SPEC are disregarded. -In the last element, DISPLAY can be t. That element applies to a -frame if none of the previous elements (except the `default' if -any) did. +As a special exception, in the first element of SPEC, DISPLAY can +be the special value `default'. Then the ATTS in that element +act as defaults for all the following elements. -ATTS is a list of face attributes followed by their values: - (ATTR VALUE ATTR VALUE...) +For backward compatibility, elements of SPEC can be written +as (DISPLAY ATTS) instead of (DISPLAY . ATTS). -The possible attributes are `:family', `:width', `:height', `:weight', -`:slant', `:underline', `:overline', `:strike-through', `:box', -`:foreground', `:background', `:stipple', `:inverse-video', and `:inherit'. +Each DISPLAY can have the following values: + - `default' (only in the first element). + - The symbol t, which matches all terminals. + - An alist of conditions. Each alist element must have the form + (REQ ITEM...). A matching terminal must satisfy each + specified condition by matching one of its ITEMs. Each REQ + must be one of the following: + - `type' (the terminal type). + Each ITEM must be one of the values returned by + `window-system'. Under X, additional allowed values are + `motif', `lucid', `gtk' and `x-toolkit'. + - `class' (the terminal's color support). + Each ITEM should be one of `color', `grayscale', or `mono'. + - `background' (what color is used for the background text) + Each ITEM should be one of `light' or `dark'. + - `min-colors' (the minimum number of supported colors) + Each ITEM should be an integer, which is compared with the + result of `display-color-cells'. + - `supports' (match terminals supporting certain attributes). + Each ITEM should be a list of face attributes. See + `display-supports-face-attributes-p' for more information on + exactly how testing is done. -DISPLAY can be `default' (only in the first element), the symbol -t (only in the last element) to match all frames, or an alist of -conditions of the form \(REQ ITEM...). For such an alist to -match a frame, each of the conditions must be satisfied, meaning -that the REQ property of the frame must match one of the -corresponding ITEMs. These are the defined REQ values: +In the ATTS property list, possible attributes are `:family', +`:width', `:height', `:weight', `:slant', `:underline', +`:overline', `:strike-through', `:box', `:foreground', +`:background', `:stipple', `:inverse-video', and `:inherit'. -`type' (the value of `window-system') - Under X, in addition to the values `window-system' can take, - `motif', `lucid', `gtk' and `x-toolkit' are allowed, and match when - the Motif toolkit, Lucid toolkit, GTK toolkit or any X toolkit is in use. - -`class' (the frame's color support) - Should be one of `color', `grayscale', or `mono'. - -`background' (what color is used for the background text) - Should be one of `light' or `dark'. - -`min-colors' (the minimum number of colors the frame should support) - Should be an integer, it is compared with the result of - `display-color-cells'. - -`supports' (only match frames that support the specified face attributes) - Should be a list of face attributes. See the documentation for - the function `display-supports-face-attributes-p' for more - information on exactly how testing is done. - -See Info node `(elisp) Customization' in the Emacs Lisp manual -for more information." +See Info node `(elisp) Faces' in the Emacs Lisp manual for more +information." (declare (doc-string 3)) ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem @@ -1227,7 +1221,7 @@ query also about adding HASH to `custom-safe-themes'." (save-window-excursion (rename-buffer "*Custom Theme*" t) (emacs-lisp-mode) - (setq window (pop-to-buffer (current-buffer))) + (pop-to-buffer (current-buffer)) (goto-char (point-min)) (prog1 (when (y-or-n-p "Loading a theme can run Lisp code. Really load? ") ;; Offer to save to `custom-safe-themes'. diff --git a/lisp/desktop.el b/lisp/desktop.el index a873a6b63bf..75deb58b4d8 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -34,7 +34,7 @@ ;; - some local variables ;; To use this, use customize to turn on desktop-save-mode or add the -;; following line somewhere in your .emacs file: +;; following line somewhere in your init file: ;; ;; (desktop-save-mode 1) ;; diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 1f8e8068de3..e5ca463e8d4 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -244,7 +244,10 @@ List has a form of (file-name full-file-name (attribute-list))." (function dired-check-process) (append (list operation program) - (unless (string-equal new-attribute "") + (unless (or (string-equal new-attribute "") + ;; Use `eq' instead of `equal' + ;; to detect empty input (bug#12399). + (eq new-attribute default)) (if (eq op-symbol 'touch) (list "-t" new-attribute) (list new-attribute))) @@ -278,7 +281,10 @@ Symbolic modes like `g+w' are allowed." "Change mode of %s to: " nil 'chmod arg files default)) num-modes) - (cond ((equal modes "") + (cond ((or (equal modes "") + ;; Use `eq' instead of `equal' + ;; to detect empty input (bug#12399). + (eq modes default)) ;; We used to treat empty input as DEFAULT, but that is not ;; such a good idea (Bug#9361). (error "No file mode specified")) diff --git a/lisp/dired.el b/lisp/dired.el index f4ae027181a..54921a4ea66 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3744,7 +3744,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "4b260eda371d319a6c8e8e5ec917e287") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "3c768e470d5d053d0049e0286ce38da7") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index cac76d2bce1..d96076d17a6 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1,4 +1,4 @@ -;;; advice.el --- an overloading mechanism for Emacs Lisp functions +;;; advice.el --- An overloading mechanism for Emacs Lisp functions ;; Copyright (C) 1993-1994, 2000-2012 Free Software Foundation, Inc. @@ -1746,7 +1746,8 @@ (provide 'advice-preload) ;; During a normal load this is a noop: (require 'advice-preload "advice.el") - +(require 'macroexp) +(eval-when-compile (require 'cl-lib)) ;; @@ Variable definitions: ;; ======================== @@ -1812,54 +1813,6 @@ generates a copy of TREE." (funcall fUnCtIoN tReE)) (t tReE))) -;; this is just faster than `ad-substitute-tree': -(defun ad-copy-tree (tree) - "Return a copy of the list structure of TREE." - (cond ((consp tree) - (cons (ad-copy-tree (car tree)) - (ad-copy-tree (cdr tree)))) - (t tree))) - -(defmacro ad-dolist (varform &rest body) - "A Common-Lisp-style dolist iterator with the following syntax: - - (ad-dolist (VAR INIT-FORM [RESULT-FORM]) - BODY-FORM...) - -which will iterate over the list yielded by INIT-FORM binding VAR to the -current head at every iteration. If RESULT-FORM is supplied its value will -be returned at the end of the iteration, nil otherwise. The iteration can be -exited prematurely with `(ad-do-return [VALUE])'." - (let ((expansion - `(let ((ad-dO-vAr ,(car (cdr varform))) - ,(car varform)) - (while ad-dO-vAr - (setq ,(car varform) (car ad-dO-vAr)) - ,@body - ;;work around a backquote bug: - ;;(` ((,@ '(foo)) (bar))) => (append '(foo) '(((bar)))) wrong - ;;(` ((,@ '(foo)) (, '(bar)))) => (append '(foo) (list '(bar))) - ,'(setq ad-dO-vAr (cdr ad-dO-vAr))) - ,(car (cdr (cdr varform)))))) - ;;ok, this wastes some cons cells but only during compilation: - (if (catch 'contains-return - (ad-substitute-tree - (function (lambda (subtree) - (cond ((eq (car-safe subtree) 'ad-dolist)) - ((eq (car-safe subtree) 'ad-do-return) - (throw 'contains-return t))))) - 'identity body) - nil) - `(catch 'ad-dO-eXiT ,expansion) - expansion))) - -(defmacro ad-do-return (value) - `(throw 'ad-dO-eXiT ,value)) - -(if (not (get 'ad-dolist 'lisp-indent-hook)) - (put 'ad-dolist 'lisp-indent-hook 1)) - - ;; @@ Save real definitions of subrs used by Advice: ;; ================================================= ;; Advice depends on the real, unmodified functionality of various subrs, @@ -1924,16 +1877,16 @@ exited prematurely with `(ad-do-return [VALUE])'." ad-advised-functions))) (defmacro ad-do-advised-functions (varform &rest body) - "`ad-dolist'-style iterator that maps over `ad-advised-functions'. + "`dolist'-style iterator that maps over `ad-advised-functions'. \(ad-do-advised-functions (VAR [RESULT-FORM]) BODY-FORM...) On each iteration VAR will be bound to the name of an advised function \(a symbol)." - `(ad-dolist (,(car varform) + `(cl-dolist (,(car varform) ad-advised-functions ,(car (cdr varform))) - (setq ,(car varform) (intern (car ,(car varform)))) - ,@body)) + (setq ,(car varform) (intern (car ,(car varform)))) + ,@body)) (if (not (get 'ad-do-advised-functions 'lisp-indent-hook)) (put 'ad-do-advised-functions 'lisp-indent-hook 1)) @@ -1948,7 +1901,7 @@ On each iteration VAR will be bound to the name of an advised function `(put ,function 'ad-advice-info ,advice-info)) (defmacro ad-copy-advice-info (function) - `(ad-copy-tree (get ,function 'ad-advice-info))) + `(copy-tree (get ,function 'ad-advice-info))) (defmacro ad-is-advised (function) "Return non-nil if FUNCTION has any advice info associated with it. @@ -2022,8 +1975,8 @@ either t or nil, and DEFINITION should be a list of the form (defun ad-has-enabled-advice (function class) "True if at least one of FUNCTION's advices in CLASS is enabled." - (ad-dolist (advice (ad-get-advice-info-field function class)) - (if (ad-advice-enabled advice) (ad-do-return t)))) + (cl-dolist (advice (ad-get-advice-info-field function class)) + (if (ad-advice-enabled advice) (cl-return t)))) (defun ad-has-redefining-advice (function) "True if FUNCTION's advice info defines at least 1 redefining advice. @@ -2036,14 +1989,14 @@ Redefining advices affect the construction of an advised definition." (defun ad-has-any-advice (function) "True if the advice info of FUNCTION defines at least one advice." (and (ad-is-advised function) - (ad-dolist (class ad-advice-classes nil) + (cl-dolist (class ad-advice-classes nil) (if (ad-get-advice-info-field function class) - (ad-do-return t))))) + (cl-return t))))) (defun ad-get-enabled-advices (function class) "Return the list of enabled advices of FUNCTION in CLASS." (let (enabled-advices) - (ad-dolist (advice (ad-get-advice-info-field function class)) + (dolist (advice (ad-get-advice-info-field function class)) (if (ad-advice-enabled advice) (push advice enabled-advices))) (reverse enabled-advices))) @@ -2151,7 +2104,7 @@ function at point for which PREDICATE returns non-nil)." (ad-do-advised-functions (function) (if (or (null predicate) (funcall predicate function)) - (ad-do-return function))) + (cl-return function))) (error "ad-read-advised-function: %s" "There are no qualifying advised functions"))) (let* ((ad-pReDiCaTe predicate) @@ -2184,9 +2137,9 @@ be returned on empty input (defaults to the first non-empty advice class of FUNCTION)." (setq default (or default - (ad-dolist (class ad-advice-classes) + (cl-dolist (class ad-advice-classes) (if (ad-get-advice-info-field function class) - (ad-do-return class))) + (cl-return class))) (error "ad-read-advice-class: `%s' has no advices" function))) (let ((class (completing-read (format "%s (default %s): " (or prompt "Class") default) @@ -2255,18 +2208,18 @@ NAME can be a symbol or a regular expression matching part of an advice name. If CLASS is `any' all valid advice classes will be checked." (if (ad-is-advised function) (let (found-advice) - (ad-dolist (advice-class ad-advice-classes) + (cl-dolist (advice-class ad-advice-classes) (if (or (eq class 'any) (eq advice-class class)) (setq found-advice - (ad-dolist (advice (ad-get-advice-info-field + (cl-dolist (advice (ad-get-advice-info-field function advice-class)) (if (or (and (stringp name) (string-match name (symbol-name (ad-advice-name advice)))) (eq name (ad-advice-name advice))) - (ad-do-return advice))))) - (if found-advice (ad-do-return found-advice)))))) + (cl-return advice))))) + (if found-advice (cl-return found-advice)))))) (defun ad-enable-advice-internal (function class name flag) "Set enable FLAG of FUNCTION's advices in CLASS matching NAME. @@ -2277,10 +2230,10 @@ considered. The number of changed advices will be returned (or nil if FUNCTION was not advised)." (if (ad-is-advised function) (let ((matched-advices 0)) - (ad-dolist (advice-class ad-advice-classes) + (dolist (advice-class ad-advice-classes) (if (or (eq class 'any) (eq advice-class class)) - (ad-dolist (advice (ad-get-advice-info-field - function advice-class)) + (dolist (advice (ad-get-advice-info-field + function advice-class)) (cond ((or (and (stringp name) (string-match name (symbol-name (ad-advice-name advice)))) @@ -2586,11 +2539,6 @@ For that it has to be fbound with a non-autoload definition." (byte-compile symbol) (fset function (symbol-function symbol)))))) -(defun ad-prognify (forms) - (cond ((<= (length forms) 1) - (car forms)) - (t (cons 'progn forms)))) - ;; @@@ Accessing argument lists: ;; ============================= @@ -2868,8 +2816,8 @@ in any of these classes." (if origdoc (setq paragraphs (list origdoc))) (unless (eq style 'plain) (push (concat "This " origtype " is advised.") paragraphs)) - (ad-dolist (class ad-advice-classes) - (ad-dolist (advice (ad-get-enabled-advices function class)) + (dolist (class ad-advice-classes) + (dolist (advice (ad-get-enabled-advices function class)) (setq advice-docstring (ad-make-single-advice-docstring advice class style)) (if advice-docstring @@ -2891,24 +2839,24 @@ in any of these classes." (defun ad-advised-arglist (function) "Find first defined arglist in FUNCTION's redefining advices." - (ad-dolist (advice (append (ad-get-enabled-advices function 'before) + (cl-dolist (advice (append (ad-get-enabled-advices function 'before) (ad-get-enabled-advices function 'around) (ad-get-enabled-advices function 'after))) (let ((arglist (ad-arglist (ad-advice-definition advice)))) (if arglist ;; We found the first one, use it: - (ad-do-return arglist))))) + (cl-return arglist))))) (defun ad-advised-interactive-form (function) "Find first interactive form in FUNCTION's redefining advices." - (ad-dolist (advice (append (ad-get-enabled-advices function 'before) + (cl-dolist (advice (append (ad-get-enabled-advices function 'before) (ad-get-enabled-advices function 'around) (ad-get-enabled-advices function 'after))) (let ((interactive-form (ad-interactive-form (ad-advice-definition advice)))) (if interactive-form ;; We found the first one, use it: - (ad-do-return interactive-form))))) + (cl-return interactive-form))))) ;; @@@ Putting it all together: ;; ============================ @@ -2997,47 +2945,47 @@ and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG should be modified. The assembled function will be returned." (let (before-forms around-form around-form-protected after-forms definition) - (ad-dolist (advice befores) - (cond ((and (ad-advice-protected advice) - before-forms) - (setq before-forms - `((unwind-protect - ,(ad-prognify before-forms) - ,@(ad-body-forms - (ad-advice-definition advice)))))) - (t (setq before-forms - (append before-forms - (ad-body-forms (ad-advice-definition advice))))))) + (dolist (advice befores) + (cond ((and (ad-advice-protected advice) + before-forms) + (setq before-forms + `((unwind-protect + ,(macroexp-progn before-forms) + ,@(ad-body-forms + (ad-advice-definition advice)))))) + (t (setq before-forms + (append before-forms + (ad-body-forms (ad-advice-definition advice))))))) (setq around-form `(setq ad-return-value ,orig)) - (ad-dolist (advice (reverse arounds)) - ;; If any of the around advices is protected then we - ;; protect the complete around advice onion: - (if (ad-advice-protected advice) - (setq around-form-protected t)) - (setq around-form - (ad-substitute-tree - (function (lambda (form) (eq form 'ad-do-it))) - (function (lambda (form) around-form)) - (ad-prognify (ad-body-forms (ad-advice-definition advice)))))) + (dolist (advice (reverse arounds)) + ;; If any of the around advices is protected then we + ;; protect the complete around advice onion: + (if (ad-advice-protected advice) + (setq around-form-protected t)) + (setq around-form + (ad-substitute-tree + (function (lambda (form) (eq form 'ad-do-it))) + (function (lambda (form) around-form)) + (macroexp-progn (ad-body-forms (ad-advice-definition advice)))))) (setq after-forms (if (and around-form-protected before-forms) `((unwind-protect - ,(ad-prognify before-forms) + ,(macroexp-progn before-forms) ,around-form)) (append before-forms (list around-form)))) - (ad-dolist (advice afters) - (cond ((and (ad-advice-protected advice) - after-forms) - (setq after-forms - `((unwind-protect - ,(ad-prognify after-forms) - ,@(ad-body-forms - (ad-advice-definition advice)))))) - (t (setq after-forms - (append after-forms - (ad-body-forms (ad-advice-definition advice))))))) + (dolist (advice afters) + (cond ((and (ad-advice-protected advice) + after-forms) + (setq after-forms + `((unwind-protect + ,(macroexp-progn after-forms) + ,@(ad-body-forms + (ad-advice-definition advice)))))) + (t (setq after-forms + (append after-forms + (ad-body-forms (ad-advice-definition advice))))))) (setq definition `(,@(if (memq type '(macro special-form)) '(macro)) @@ -3061,7 +3009,7 @@ should be modified. The assembled function will be returned." (ad-body-forms (ad-advice-definition advice)))) (ad-get-enabled-advices function hook-name)))) (if hook-forms - (ad-prognify (apply 'append hook-forms))))) + (macroexp-progn (apply 'append hook-forms))))) ;; @@ Caching: @@ -3171,11 +3119,11 @@ advised definition from scratch." (nth 2 cache-id))))) (defun ad-verify-cache-class-id (cache-class-id advices) - (ad-dolist (advice advices (null cache-class-id)) + (cl-dolist (advice advices (null cache-class-id)) (if (ad-advice-enabled advice) (if (eq (car cache-class-id) (ad-advice-name advice)) (setq cache-class-id (cdr cache-class-id)) - (ad-do-return nil))))) + (cl-return nil))))) ;; There should be a way to monitor if and why a cache verification failed ;; in order to determine whether a certain preactivation could be used or @@ -3670,7 +3618,16 @@ See Info node `(elisp)Advising Functions' for comprehensive documentation. usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...) [DOCSTRING] [INTERACTIVE-FORM] BODY...)" - (declare (doc-string 3)) + (declare (doc-string 3) + (debug (&define name ;; thing being advised. + (name ;; class is [&or "before" "around" "after" + ;; "activation" "deactivation"] + name ;; name of advice + &rest sexp ;; optional position and flags + ) + [&optional stringp] + [&optional ("interactive" interactive)] + def-body))) (if (not (ad-name-p function)) (error "defadvice: Invalid function name: %s" function)) (let* ((class (car args)) diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index d1382f42b19..93e890a20c9 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -312,7 +312,7 @@ This uses `defvaralias' and `make-obsolete-variable' (which see). See the Info node `(elisp)Variable Aliases' for more details. If CURRENT-NAME is a defcustom (more generally, any variable -where OBSOLETE-NAME may be set, e.g. in a .emacs file, before the +where OBSOLETE-NAME may be set, e.g. in an init file, before the alias is defined), then the define-obsolete-variable-alias statement should be evaluated before the defcustom, if user customizations are to be respected. The simplest way to achieve diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 10bc37c6dcd..c42ae21aae5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1016,6 +1016,10 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ((bufferp byte-compile-current-file) (format "Buffer %s:" (buffer-name byte-compile-current-file))) + ;; We might be simply loading a file that + ;; contains explicit calls to byte-compile functions. + ((stringp load-file-name) + (format "%s:" (file-relative-name load-file-name dir))) (t ""))) (pos (if (and byte-compile-current-file (integerp byte-compile-read-position)) diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 532c81c502c..5749ff91b40 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -121,7 +121,7 @@ a future Emacs interpreter will be able to use it.") ;;; Generalized variables. ;; These macros are defined here so that they -;; can safely be used in .emacs files. +;; can safely be used in init files. (defmacro cl-incf (place &optional x) "Increment PLACE by X (1 by default). diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 774b4d3d600..e002dbabe49 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -75,9 +75,9 @@ window previously showing the debugger buffer. The value used here is passed to `quit-restore-window'." :type '(choice (const :tag "Keep alive" nil) - (const :tag "Append" 'append) - (const :tag "Bury" 'bury) - (const :tag "Kill" 'kill)) + (const :tag "Append" append) + (const :tag "Bury" bury) + (const :tag "Kill" kill)) :group 'debugger :version "24.2") @@ -265,7 +265,8 @@ first will be printed into the backtrace buffer." ;; Make sure we unbind buffer-read-only in the right buffer. (save-excursion (recursive-edit)))) - (when (and (window-live-p debugger-window) + (when (and (not debugger-will-be-back) + (window-live-p debugger-window) (eq (window-buffer debugger-window) debugger-buffer)) ;; Record height of debugger window. (setq debugger-previous-window-height diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 7f9f8a33634..939fab78942 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -148,7 +148,7 @@ unselectable text. A string consisting solely of hyphens is displayed as a solid horizontal line. A menu item can be a list with the same format as MENU. This is a submenu." - (declare (indent defun)) + (declare (indent defun) (debug (symbolp body))) `(progn ,(if symbol `(defvar ,symbol nil ,doc)) (easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu))) diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index a66d5972d82..2248dde8c03 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -28,8 +28,8 @@ ;;; Code: ;; Layout of a timer vector: -;; [triggered-p high-seconds low-seconds usecs psecs repeat-delay -;; function args idle-delay] +;; [triggered-p high-seconds low-seconds usecs repeat-delay +;; function args idle-delay psecs] ;; triggered-p is nil if the timer is active (waiting to be triggered), ;; t if it is inactive ("already triggered", in theory) @@ -42,7 +42,7 @@ (:type vector) (:conc-name timer--)) (triggered t) - high-seconds low-seconds usecs psecs repeat-delay function args idle-delay) + high-seconds low-seconds usecs repeat-delay function args idle-delay psecs) (defun timerp (object) "Return t if OBJECT is a timer." diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index 7fc24773b9e..87b6bcf0aa9 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -61,7 +61,7 @@ ;; emacs -q -l edt-mapper.el -;; The "-q" option prevents loading of your .emacs file (commands +;; The "-q" option prevents loading of your init file (commands ;; therein might confuse this program). ;; An instruction screen showing the typical LK-201 terminal @@ -74,7 +74,7 @@ ;; and loaded automatically when the EDT emulation is started. If ;; you specify a different file name, you will need to set the ;; variable "edt-keys-file" before starting the EDT emulation. -;; Here's how you might go about doing that in your .emacs file. +;; Here's how you might go about doing that in your init file: ;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys")) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index dbd13a01a8b..3810dcccbb3 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -48,7 +48,7 @@ ;; You can have the EDT Emulation start up automatically, each time ;; you initiate a GNU Emacs session, by adding the following line to -;; your .emacs file: +;; your init file: ;; ;; (add-hook term-setup-hook 'edt-emulation-on) @@ -75,7 +75,7 @@ ;; default, this feature is enabled, with the top margin set to ;; 10% of the window and the bottom margin set to 15% of the ;; window. To change these settings, you can invoke the function -;; edt-set-scroll-margins in your .emacs file. For example, the +;; edt-set-scroll-margins in your init file. For example, the ;; following line ;; ;; (edt-set-scroll-margins "20%" "25%") @@ -363,7 +363,7 @@ This means that an edt-user.el file was found in the user's `load-path'.") ;;; ;;; (setq edt-keep-current-page-delimiter t) ;;; -;;; in your .emacs file. +;;; in your init file. (defun edt-page-forward (num) "Move forward to just after next page delimiter. @@ -1961,14 +1961,14 @@ created." Ack!! You're running the Enhanced EDT Emulation without loading an EDT key mapping file. To create an EDT key mapping file, run the edt-mapper program. It is safest to run it from an Emacs loaded - without any of your own customizations found in your .emacs file, etc. + without any of your own customizations found in your init file, etc. The reason for this is that some user customizations confuse edt-mapper. You can do this by quitting Emacs and then invoking Emacs again as follows: emacs -q -l edt-mapper - [NOTE: If you do nothing out of the ordinary in your .emacs file, and + [NOTE: If you do nothing out of the ordinary in your init file, and the search for edt-mapper is successful, you can try running it now.] The library edt-mapper includes these same directions on how to diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index b8d07e8b744..d375725af56 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el @@ -163,8 +163,8 @@ ;; and type `tpu-edt' followed by a carriage return. ;; If you like TPU-edt and want to use it all the time, you can start -;; TPU-edt using the Emacs initialization file, .emacs. Simply create -;; a .emacs file in your home directory containing the line: +;; TPU-edt using the Emacs initialization file, .emacs. Simply add +;; the following line to your init file: ;; (tpu-edt) @@ -2440,7 +2440,7 @@ If FILE is nil, try to load a default file. The default file names are ;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins -;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "76f06905db4c5bfb3b86491a51512a0e") +;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "bf5e7322f9a2c324a3bb306415813374") ;;; Generated autoloads from tpu-extras.el (autoload 'tpu-cursor-free-mode "tpu-extras" "\ diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el index 521b189e3bc..4cf9eee037b 100644 --- a/lisp/emulation/tpu-extras.el +++ b/lisp/emulation/tpu-extras.el @@ -26,7 +26,7 @@ ;; Use the functions defined here to customize TPU-edt to your tastes by ;; setting scroll margins and/or turning on free cursor mode. Here's an -;; example for your .emacs file. +;; example for your init file. ;; (tpu-set-cursor-free) ; Set cursor free. ;; (tpu-set-scroll-margins "10%" "15%") ; Set scroll margins. diff --git a/lisp/emulation/tpu-mapper.el b/lisp/emulation/tpu-mapper.el index ef4e9b305fc..9cced60816c 100644 --- a/lisp/emulation/tpu-mapper.el +++ b/lisp/emulation/tpu-mapper.el @@ -81,7 +81,7 @@ Finally, you will be prompted for the name of the file to store the key definitions. If you chose the default, TPU-edt will find it and load it automatically. If you specify a different file name, you will need to set the variable ``tpu-xkeys-file'' before starting TPU-edt. Here's how -you might go about doing that in your .emacs file. +you might go about doing that in your init file. (setq tpu-xkeys-file (expand-file-name \"~/.my-emacs-x-keys\")) (tpu-edt) diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el index 9bf108c8c38..a59dd610c21 100644 --- a/lisp/emulation/vi.el +++ b/lisp/emulation/vi.el @@ -28,7 +28,7 @@ ;; (if (not (or (eq major-mode 'Info-mode) ;; (eq major-mode 'vi-mode))) ;; (vi-mode)))))) -;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload" +;; 3) In your init file you can define the command "vi-mode" to be "autoload" ;; or you can execute the "load" command to load "vi" directly. ;; 4) Read the comments for command "vi-mode" before you start using it. diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 81fbfb0394c..8de253d19b0 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -351,7 +351,7 @@ user decide when to invoke Viper in a major mode." If t, viperize Emacs. If nil -- don't. If `ask', ask the user. This variable is used primarily when Viper is being loaded. -Must be set in `~/.emacs' before Viper is loaded. +Must be set in your init file before Viper is loaded. DO NOT set this variable interactively, unless you are using the customization widget." :type '(choice (const nil) (const t) (const ask)) @@ -1173,7 +1173,7 @@ If you wish to Viperize AND make this your way of life, please put (setq viper-mode t) (require 'viper) -in your .emacs file (preferably, close to the top). +in your init file (preferably, close to the top). These two lines must come in the order given. ** Viper users: diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el index be5b849651c..a16fa5abdd4 100644 --- a/lisp/epa-mail.el +++ b/lisp/epa-mail.el @@ -170,24 +170,26 @@ Don't use this command in Lisp programs!" If no one is selected, symmetric encryption will be performed. " recipients) (if recipients - (mapcar - (lambda (recipient) - (setq recipient-key - (epa-mail--find-usable-key - (epg-list-keys - (epg-make-context epa-protocol) - (if (string-match "@" recipient) - (concat "<" recipient ">") - recipient)) - 'encrypt)) - (unless (or recipient-key - (y-or-n-p - (format - "No public key for %s; skip it? " - recipient))) - (error "No public key for %s" recipient)) - recipient-key) - recipients))) + (apply + 'nconc + (mapcar + (lambda (recipient) + (setq recipient-key + (epa-mail--find-usable-key + (epg-list-keys + (epg-make-context epa-protocol) + (if (string-match "@" recipient) + (concat "<" recipient ">") + recipient)) + 'encrypt)) + (unless (or recipient-key + (y-or-n-p + (format + "No public key for %s; skip it? " + recipient))) + (error "No public key for %s" recipient)) + (if recipient-key (list recipient-key))) + recipients)))) (setq sign (if verbose (y-or-n-p "Sign? "))) (if sign (epa-select-keys context diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 37e755e7655..674a6c97eec 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,9 @@ +2012-09-17 Chong Yidong + + * erc-page.el (erc-page-function): + + * erc-stamp.el (erc-stamp): Doc fix. + 2012-08-21 Josh Feinstein * erc-join.el (erc-autojoin-timing): Fix defcustom type. diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index c8a7fec32bd..a0593dcb743 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -25,7 +25,7 @@ ;; Heavily borrowed from gnus-art.el. Thanks to the original authors. ;; This buttonizes nicks and other stuff to make it all clickable. -;; To enable, add to your ~/.emacs: +;; To enable, add to your init file: ;; (require 'erc-button) ;; (erc-button-mode 1) ;; diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el index 4f6361ee923..c7103d6dc61 100644 --- a/lisp/erc/erc-capab.el +++ b/lisp/erc/erc-capab.el @@ -48,7 +48,7 @@ ;;; Usage: -;; Put the following in your ~/.emacs file. +;; Put the following in your init file. ;; (require 'erc-capab) ;; (erc-capab-identify-mode 1) diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index cac042c0298..de7f2137197 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -29,7 +29,7 @@ ;; customizable variables. ;; Usage: -;; Put (erc-match-mode 1) into your ~/.emacs file. +;; Put (erc-match-mode 1) into your init file. ;;; Code: diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index 44fbc9563d6..355b345492c 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -23,7 +23,7 @@ ;;; Commentary: ;; This module hides quit/join messages if a netsplit occurs. -;; To enable, add the following to your ~/.emacs: +;; To enable, add the following to your init file: ;; (require 'erc-netsplit) ;; (erc-netsplit-mode 1) diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index e6b670c91ba..51ddc33e1c0 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -45,7 +45,7 @@ If nil, this prints the page message in the minibuffer and calls `beep'. If non-nil, it must be a function that takes two arguments: SENDER and MSG, both strings. -Example for your ~/.emacs file: +Example for your init file: \(setq erc-page-function (lambda (sender msg) diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index 04c5885bc3e..6c5804c62a4 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -25,7 +25,7 @@ ;; This module allows you to systematically replace text in incoming ;; messages. Load erc-replace, and customize `erc-replace-alist'. -;; Then add to your ~/.emacs: +;; Then add to your init file: ;; (require 'erc-replace) ;; (erc-replace-mode 1) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 5831233affe..4ce2f18e041 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -43,7 +43,7 @@ group provides settings related to the format and display of timestamp information in `erc-mode' buffer. For timestamping to be activated, you just need to load `erc-stamp' -in your .emacs file or interactively using `load-library'." +in your init file or interactively using `load-library'." :group 'erc) (defcustom erc-timestamp-format "[%H:%M]" diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 9c56c724224..88a3285730d 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -24,7 +24,7 @@ ;;; Commentary: ;; Highlights keywords and pals (friends), and hides or highlights fools -;; (using a dark color). Add to your ~/.emacs: +;; (using a dark color). Add to your init file: ;; (require 'erc-track) ;; (erc-track-mode 1) diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index 4b62fec95e6..940056b6438 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el @@ -133,10 +133,10 @@ Each element of this alias is a list of the form: Where NAME is the textual name of the alias, and DEFINITION is the command string to replace that command with. -Note: this list should not be modified in your '.emacs' file. Rather, -any desired alias definitions should be declared using the `alias' -command, which will automatically write them to the file named by -`eshell-aliases-file'.") +Note: this list should not be modified in your init file. +Rather, any desired alias definitions should be declared using +the `alias' command, which will automatically write them to the +file named by `eshell-aliases-file'.") (put 'eshell-command-aliases-list 'risky-local-variable t) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 8218e91ddc7..fa0336232f9 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -84,7 +84,7 @@ Numeric form is tested using the regular expression NOTE: If you find that numeric conversions are interfering with the specification of filenames (for example, in calling `find-file', or some other Lisp function that deals with files, not numbers), add the -following in your .emacs file: +following in your init file: (put 'find-file 'eshell-no-numeric-conversions t) diff --git a/lisp/ffap.el b/lisp/ffap.el index ebe8b6dee94..f3e8d4c194e 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -34,7 +34,7 @@ ;; README's, MANIFEST's, and so on. Submit bugs or suggestions with ;; M-x ffap-bug. ;; -;; For the default installation, add this line to your .emacs file: +;; For the default installation, add this line to your init file: ;; ;; (ffap-bindings) ; do default key bindings ;; @@ -206,7 +206,7 @@ Sensible values are nil, \"news\", or \"mailto\"." ;; those features interesting but not clear winners (a matter of ;; personal taste) I try to leave options to enable them. Read ;; through this section for features that you like, put an appropriate -;; enabler in your .emacs file. +;; enabler in your init file. (defcustom ffap-dired-wildcards "[*?][^/]*\\'" "A regexp matching filename wildcard characters, or nil. diff --git a/lisp/files.el b/lisp/files.el index 4acdb542089..289f5c6b0b6 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -658,22 +658,13 @@ Not actually set up until the first time you use it.") (defun parse-colon-path (search-path) "Explode a search path into a list of directory names. -Directories are separated by occurrences of `path-separator' -\(which is colon in GNU and GNU-like systems)." - ;; We could use split-string here. - (and search-path - (let (cd-list (cd-start 0) cd-colon) - (setq search-path (concat search-path path-separator)) - (while (setq cd-colon (string-match path-separator search-path cd-start)) - (setq cd-list - (nconc cd-list - (list (if (= cd-start cd-colon) - nil - (substitute-in-file-name - (file-name-as-directory - (substring search-path cd-start cd-colon))))))) - (setq cd-start (+ cd-colon 1))) - cd-list))) +Directories are separated by `path-separator' (which is colon in +GNU and Unix systems). Substitute environment variables into the +resulting list of directory names." + (when (stringp search-path) + (mapcar (lambda (f) + (substitute-in-file-name (file-name-as-directory f))) + (split-string search-path path-separator t)))) (defun cd-absolute (dir) "Change current directory to given absolute file name DIR." diff --git a/lisp/filesets.el b/lisp/filesets.el index 6c24a4f43d6..a91d8cf0fcb 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -35,7 +35,7 @@ ;; inclusion group (i.e. a base file including other files). ;; Usage: -;; 1. Put (require 'filesets) and (filesets-init) in your .emacs file. +;; 1. Put (require 'filesets) and (filesets-init) in your init file. ;; 2. Type ;; M-x filesets-edit or choose "Edit Filesets" from the menu. ;; 3. Save your customizations. diff --git a/lisp/flow-ctrl.el b/lisp/flow-ctrl.el index 747a4ca018c..b301886de5b 100644 --- a/lisp/flow-ctrl.el +++ b/lisp/flow-ctrl.el @@ -31,7 +31,7 @@ ;; ;; To invoke these adjustments, a user need only invoke the function ;; enable-flow-control-on with a list of terminal types in his/her own -;; .emacs file. As arguments, give it the names of one or more terminal +;; init file. As arguments, give it the names of one or more terminal ;; types in use by that user which require flow control adjustments. ;; Here's an example: ;; diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 77c21d26535..6404af7703a 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -37,7 +37,7 @@ ;; When this minor mode is on, the faces of the current line are updated with ;; every insertion or deletion. ;; -;; To turn Font Lock mode on automatically, add this to your ~/.emacs file: +;; To turn Font Lock mode on automatically, add this to your init file: ;; ;; (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) ;; diff --git a/lisp/frame.el b/lisp/frame.el index c182a964820..0bef358ecfb 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -301,7 +301,7 @@ there (in decreasing order of priority)." ;; existing frame. We need to explicitly include ;; default-frame-alist in the parameters of the screen we ;; create here, so that its new value, gleaned from the user's - ;; .emacs file, will be applied to the existing screen. + ;; init file, will be applied to the existing screen. (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist) (assq 'minibuffer window-system-frame-alist) (assq 'minibuffer default-frame-alist) diff --git a/lisp/generic-x.el b/lisp/generic-x.el index cc7963b1711..a97c5649c95 100644 --- a/lisp/generic-x.el +++ b/lisp/generic-x.el @@ -28,7 +28,7 @@ ;; ;; INSTALLATION: ;; -;; Add this line to your .emacs file: +;; Add this line to your init file: ;; ;; (require 'generic-x) ;; diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5644c394f7e..45f23a6d99c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,31 @@ +2012-09-17 Richard Stallman + + * message.el (message-in-body-p): Don't set mark or modify buffer. + + * mml.el (mml-attach-file): Doc fix. + (mml-attach-external, mml-attach-buffer, mml-attach-file): + Set mail-encode-mml when in Mail mode. + Simplify code to set HEAD and move back to HEAD. + (mml-insert-multipart, mml-insert-part): + Set mail-encode-mml when in Mail mode. + +2012-09-13 Katsumi Yamaoka + + * gnus-util.el (gnus-timer--function): New function. + + * gnus-art.el (gnus-article-stop-animations): Use it. + +2012-09-13 Paul Eggert + + Fix glitches caused by addition of psec to timers. + * gnus-art.el (gnus-article-stop-animations): Use timer--function + rather than raw access to timer vector. + +2012-09-11 Julien Danjou + + * gnus-notifications.el (gnus-notifications): Check for nil values in + ignored addresses check. + 2012-09-10 Stefan Monnier * qp.el (quoted-printable-decode-region): Inline+CSE+strength-reduction. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index b9020a40b75..7dcbd61316f 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4554,7 +4554,7 @@ commands: (defun gnus-article-stop-animations () (dolist (timer (and (boundp 'timer-list) timer-list)) - (when (eq (elt timer 5) 'image-animate-timeout) + (when (eq (gnus-timer--function timer) 'image-animate-timeout) (cancel-timer timer)))) (defun gnus-stop-downloads () diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 4c5eabab723..f5e1077f8c4 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1964,6 +1964,11 @@ definitions to shadow the loaded ones for use in file byte-compilation." (defun gnus-bound-and-true-p (sym) (and (boundp sym) (symbol-value sym))) +(if (fboundp 'timer--function) + (defalias 'gnus-timer--function 'timer--function) + (defun gnus-timer--function (timer) + (elt timer 5))) + (provide 'gnus-util) ;;; gnus-util.el ends here diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 42911ce0648..5360f008432 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3160,8 +3160,12 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." (defun message-in-body-p () "Return t if point is in the message body." - (let ((body (save-excursion (message-goto-body)))) - (>= (point) body))) + (>= (point) + (save-excursion + (goto-char (point-min)) + (or (search-forward (concat "\n" mail-header-separator "\n") nil t) + (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)) + (point)))) (defun message-goto-eoh () "Move point to the end of the headers." diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index cc1aedf1b97..a72962aae0d 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -1305,7 +1305,8 @@ to specify options." (defun mml-attach-file (file &optional type description disposition) "Attach a file to the outgoing MIME message. The file is not inserted or encoded until you send the message with -`\\[message-send-and-exit]' or `\\[message-send]'. +`\\[message-send-and-exit]' or `\\[message-send]' in Message mode, +or `\\[mail-send-and-exit]' or `\\[mail-send]' in Mail mode. FILE is the name of the file to attach. TYPE is its content-type, a string of the form \"type/subtype\". DESCRIPTION @@ -1319,11 +1320,9 @@ body) or \"attachment\" (separate from the body)." (description (mml-minibuffer-read-description)) (disposition (mml-minibuffer-read-disposition type nil file))) (list file type description disposition))) - ;; Don't move point if this command is invoked inside the message header. - (let ((head (unless (message-in-body-p) - (prog1 - (point) - (goto-char (point-max)))))) + ;; If in the message header, attach at the end and leave point unchanged. + (let ((head (unless (message-in-body-p) (point)))) + (if head (goto-char (point-max))) (mml-insert-empty-tag 'part 'type type ;; icicles redefines read-file-name and returns a @@ -1331,12 +1330,15 @@ body) or \"attachment\" (separate from the body)." 'filename (mm-substring-no-properties file) 'disposition (or disposition "attachment") 'description description) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (when head - (unless (prog1 - (pos-visible-in-window-p) - (goto-char head)) + (unless (pos-visible-in-window-p) (message "The file \"%s\" has been attached at the end of the message" - (file-name-nondirectory file)))))) + (file-name-nondirectory file))) + (goto-char head)))) (defun mml-dnd-attach-file (uri action) "Attach a drag and drop file. @@ -1372,21 +1374,22 @@ BUFFER is the name of the buffer to attach. See (description (mml-minibuffer-read-description)) (disposition (mml-minibuffer-read-disposition type nil))) (list buffer type description disposition))) - ;; Don't move point if this command is invoked inside the message header. - (let ((head (unless (message-in-body-p) - (prog1 - (point) - (goto-char (point-max)))))) + ;; If in the message header, attach at the end and leave point unchanged. + (let ((head (unless (message-in-body-p) (point)))) + (if head (goto-char (point-max))) (mml-insert-empty-tag 'part 'type type 'buffer buffer 'disposition disposition 'description description) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (when head - (unless (prog1 - (pos-visible-in-window-p) - (goto-char head)) + (unless (pos-visible-in-window-p) (message "The buffer \"%s\" has been attached at the end of the message" - buffer))))) + buffer)) + (goto-char head)))) (defun mml-attach-external (file &optional type description) "Attach an external file into the buffer. @@ -1397,19 +1400,20 @@ TYPE is the MIME type to use." (type (mml-minibuffer-read-type file)) (description (mml-minibuffer-read-description))) (list file type description))) - ;; Don't move point if this command is invoked inside the message header. - (let ((head (unless (message-in-body-p) - (prog1 - (point) - (goto-char (point-max)))))) + ;; If in the message header, attach at the end and leave point unchanged. + (let ((head (unless (message-in-body-p) (point)))) + (if head (goto-char (point-max))) (mml-insert-empty-tag 'external 'type type 'name file 'disposition "attachment" 'description description) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (when head - (unless (prog1 - (pos-visible-in-window-p) - (goto-char head)) + (unless (pos-visible-in-window-p) (message "The file \"%s\" has been attached at the end of the message" - (file-name-nondirectory file)))))) + (file-name-nondirectory file))) + (goto-char head)))) (defun mml-insert-multipart (&optional type) (interactive (if (message-in-body-p) @@ -1422,12 +1426,20 @@ TYPE is the MIME type to use." (or type (setq type "mixed")) (mml-insert-empty-tag "multipart" 'type type) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (forward-line -1)) (defun mml-insert-part (&optional type) (interactive (if (message-in-body-p) (list (mml-minibuffer-read-type "")) (error "Use this command in the message body"))) + ;; When using Mail mode, make sure it does the mime encoding + ;; 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")) (declare-function message-subscribed-p "message" ()) diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 644024a4b86..f92e2ab0af2 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -52,14 +52,14 @@ ;; ;; Setup: ;; -;; Put the following code in your .emacs file. This turns on +;; Put the following code in your init file. This turns on ;; hi-lock mode and adds a "Regexp Highlighting" entry ;; to the edit menu. ;; ;; (global-hi-lock-mode 1) ;; ;; To enable the use of patterns found in files (presumably placed -;; there by hi-lock) include the following in your .emacs file: +;; there by hi-lock) include the following in your init file: ;; ;; (setq hi-lock-file-patterns-policy 'ask) ;; @@ -356,7 +356,7 @@ Hi-lock: end is found. A mode is excluded if it's in the list "Possible archaic use of (hi-lock-mode). Use (global-hi-lock-mode 1) in .emacs to enable hi-lock for all buffers, use (hi-lock-mode 1) for individual buffers. For compatibility with Emacs -versions before 22 use the following in your .emacs file: +versions before 22 use the following in your init file: (if (functionp 'global-hi-lock-mode) (global-hi-lock-mode 1) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index c6e799252a2..77461469044 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -123,13 +123,13 @@ own!): no upper limit on its size. The size will also be aligned to the right. -Thus, if you wanted to use these two formats, add +Thus, if you wanted to use these two formats, the appropriate +value for this variable would be - (setq ibuffer-formats '((mark \" \" name) - (mark modified read-only - (name 16 16 :left) (size 6 -1 :right)))) - -to your ~/.emacs file. + '((mark \" \" name) + (mark modified read-only + (name 16 16 :left) + (size 6 -1 :right))) Using \\[ibuffer-switch-format], you can rotate the display between the specified formats in the list." diff --git a/lisp/ielm.el b/lisp/ielm.el index c93f235d81f..ba05bbcfc0f 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -59,7 +59,7 @@ override the read-only-ness of IELM prompts is to call `comint-kill-whole-line' or `comint-kill-region' with no narrowing in effect. This way you will be certain that none of the remaining prompts will be accidentally messed up. You may -wish to put something like the following in your `.emacs' file: +wish to put something like the following in your init file: \(add-hook 'ielm-mode-hook (lambda () diff --git a/lisp/image.el b/lisp/image.el index 7801923c3fe..99c0a74a512 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -645,8 +645,8 @@ number, play until that number of seconds has elapsed." (while tail (setq timer (car tail) tail (cdr tail)) - (if (and (eq (aref timer 5) 'image-animate-timeout) - (eq (car-safe (aref timer 6)) image)) + (if (and (eq (timer--function timer) 'image-animate-timeout) + (eq (car-safe (timer--args timer)) image)) (setq tail nil) (setq timer nil))) timer)) diff --git a/lisp/info.el b/lisp/info.el index fe4afd72163..5862e5e850f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1882,9 +1882,7 @@ If DIRECTION is `backward', search in the reverse direction." (while (and (not give-up) (or (null found) (not (funcall isearch-filter-predicate beg-found found)))) - (let ((search-spaces-regexp - (if (or (not isearch-mode) isearch-regexp) - Info-search-whitespace-regexp))) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) (if (if backward (re-search-backward regexp bound t) (re-search-forward regexp bound t)) @@ -1904,9 +1902,7 @@ If DIRECTION is `backward', search in the reverse direction." (if (null Info-current-subfile) (if isearch-mode (signal 'search-failed (list regexp "end of manual")) - (let ((search-spaces-regexp - (if (or (not isearch-mode) isearch-regexp) - Info-search-whitespace-regexp))) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) (if backward (re-search-backward regexp) (re-search-forward regexp)))) @@ -1964,9 +1960,7 @@ If DIRECTION is `backward', search in the reverse direction." (while (and (not give-up) (or (null found) (not (funcall isearch-filter-predicate beg-found found)))) - (let ((search-spaces-regexp - (if (or (not isearch-mode) isearch-regexp) - Info-search-whitespace-regexp))) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) (if (if backward (re-search-backward regexp nil t) (re-search-forward regexp nil t)) @@ -2034,21 +2028,26 @@ If DIRECTION is `backward', search in the reverse direction." (defun Info-isearch-search () (if Info-isearch-search (lambda (string &optional bound noerror count) - (Info-search - (cond - (isearch-word - ;; Lax version of word search - (let ((lax (not (or isearch-nonincremental - (eq (length string) - (length (isearch--state-string - (car isearch-cmds)))))))) - (if (functionp isearch-word) - (funcall isearch-word string lax) - (word-search-regexp string lax)))) - (isearch-regexp string) - (t (regexp-quote string))) - bound noerror count - (unless isearch-forward 'backward)) + (let ((Info-search-whitespace-regexp + (if (if isearch-regexp + isearch-regexp-lax-whitespace + isearch-lax-whitespace) + search-whitespace-regexp))) + (Info-search + (cond + (isearch-word + ;; Lax version of word search + (let ((lax (not (or isearch-nonincremental + (eq (length string) + (length (isearch--state-string + (car isearch-cmds)))))))) + (if (functionp isearch-word) + (funcall isearch-word string lax) + (word-search-regexp string lax)))) + (isearch-regexp string) + (t (regexp-quote string))) + bound noerror count + (unless isearch-forward 'backward))) (point)) (isearch-search-fun-default))) @@ -4157,8 +4156,6 @@ Advanced commands: 'Info-isearch-push-state) (set (make-local-variable 'isearch-filter-predicate) 'Info-isearch-filter) - (set (make-local-variable 'search-whitespace-regexp) - Info-search-whitespace-regexp) (set (make-local-variable 'revert-buffer-function) 'Info-revert-buffer-function) (Info-set-mode-line) diff --git a/lisp/international/ogonek.el b/lisp/international/ogonek.el index 39a88001112..3c34e5d9a2a 100644 --- a/lisp/international/ogonek.el +++ b/lisp/international/ogonek.el @@ -224,13 +224,14 @@ The functions come in the following groups. ogonek-prefix-to-encoding iso8859-2 The above default values can be changed by placing appropriate settings - in the '~/.emacs' file: + in your init file: (setq ogonek-prefix-char ?/) (setq ogonek-prefix-to-encoding \"iso8859-2\") - Instead of loading the whole library `ogonek' it may be better to - autoload the needed functions, for example by placing in `~/.emacs': + Instead of loading the whole library `ogonek' it may be better + to autoload the needed functions, for example by adding the + following lines to your init file: (autoload 'ogonek-how \"ogonek\") (autoload 'ogonek-recode-region \"ogonek\") diff --git a/lisp/language/chinese.el b/lisp/language/chinese.el index ac2afa373c4..782b5a363ad 100644 --- a/lisp/language/chinese.el +++ b/lisp/language/chinese.el @@ -110,7 +110,8 @@ (use-cjk-char-width-table 'zh_CN))) (exit-function . use-default-char-width-table) (coding-system chinese-iso-8bit iso-2022-cn chinese-hz) - (coding-priority chinese-iso-8bit chinese-big5 iso-2022-cn) + (coding-priority chinese-iso-8bit chinese-gbk chinese-big5 + iso-2022-cn) (input-method . "chinese-py-punct") (features china-util) (sample-text . "Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B) $ADc:C(B") @@ -140,7 +141,8 @@ (use-cjk-char-width-table 'zh_HK))) (exit-function . use-default-char-width-table) (coding-system chinese-big5 chinese-iso-7bit) - (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit) + (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit + chinese-gbk) (input-method . "chinese-py-punct-b5") (ctext-non-standard-encodings "big5-0") (features china-util) @@ -196,7 +198,7 @@ (exit-function . use-default-char-width-table) (coding-system iso-2022-cn euc-tw) (coding-priority iso-2022-cn euc-tw chinese-big5 - chinese-iso-8bit) + chinese-iso-8bit chinese-gbk) (features china-util) (input-method . "chinese-cns-quick") ;; Fixme: presumably it won't accept big5 now. @@ -216,7 +218,7 @@ accepts Big5 for input also (which is then converted to CNS).")) (exit-function . use-default-char-width-table) (coding-system euc-tw iso-2022-cn) (coding-priority euc-tw chinese-big5 iso-2022-cn - chinese-iso-8bit) + chinese-iso-8bit chinese-gbk) (features china-util) (input-method . "chinese-cns-quick") (documentation . "\ diff --git a/lisp/locate.el b/lisp/locate.el index 29d7c75cbb2..d172ce3d6c4 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -34,7 +34,7 @@ ;; ;; SHELLPROGRAM Name-to-find ;; -;; set the variable `locate-command' in your .emacs file. +;; set the variable `locate-command' in your init file. ;; ;; To use a more complicated expression, create a function which ;; takes a string (the name to find) as input and returns a list. diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 520271940f2..4305094611a 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -139,9 +139,8 @@ ;; feedmail-send-it. Hers's the best way to use the stuff in this ;; file: ;; -;; Save this file as feedmail.el somewhere on your elisp -;; loadpath; byte-compile it. Put the following lines somewhere in -;; your ~/.emacs stuff: +;; Save this file as feedmail.el somewhere on your elisp loadpath; +;; byte-compile it. Put the following lines in your init file: ;; ;; (setq send-mail-function 'feedmail-send-it) ;; (autoload 'feedmail-send-it "feedmail") diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el index dd489e3c6a9..40d67b4e904 100644 --- a/lisp/mail/mail-hist.el +++ b/lisp/mail/mail-hist.el @@ -28,7 +28,7 @@ ;; time. ;; ;; To use this package, put it in a directory in your load-path, and -;; put this in your .emacs file: +;; put this in your init file: ;; ;; (load "mail-hist" nil t) ;; diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 290c57c1c55..2e4ffec1383 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -391,35 +391,24 @@ double-quotes." (defun mail-abbrev-expand-hook () "For use as the fourth arg to `define-abbrev'. After expanding a mail-abbrev, if Auto Fill mode is on and we're past the -fill-column, break the line at the previous comma, and indent the next line." - ;; Disable abbrev mode to avoid recursion in indent-relative expanding - ;; part of the abbrev expansion as an abbrev itself. - (let ((abbrev-mode nil)) - (save-excursion - (let ((p (point)) - bol comma fp) - (beginning-of-line) - (setq bol (point)) - (goto-char p) - (while (and auto-fill-function - (>= (current-column) fill-column) - (search-backward "," bol t)) - (setq comma (point)) - (forward-char 1) ; Now we are just past the comma. - (insert "\n") - (delete-horizontal-space) - (setq p (point)) - (indent-relative) - (setq fp (buffer-substring p (point))) - ;; Go to the end of the new line. - (end-of-line) - (if (> (current-column) fill-column) - ;; It's still too long; do normal auto-fill. - (let ((fill-prefix (or fp "\t"))) - (do-auto-fill))) - ;; Resume the search. - (goto-char comma) - ))))) +fill-column, break the line at the previous comma, and indent the next line +with a space." + (when auto-fill-function + (let (p) + (save-excursion + (while (>= (current-column) fill-column) + (while (and (search-backward "," (point-at-bol) 'move) + (>= (current-column) (1- fill-column)) + (setq p (point)))) + (when (or (not (bolp)) + (and p (goto-char p))) + (setq p nil) + (forward-char 1) + (insert "\n") + (when (looking-at "[\t ]+") + (delete-region (point) (match-end 0))) + (insert " ") + (end-of-line))))))) ;;; Syntax tables and abbrev-expansion diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index d88862b2d47..5606e71dea4 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4068,6 +4068,13 @@ The variable `rmail-retry-ignored-headers' is a regular expression specifying headers which should not be copied into the new message." (interactive) (require 'mail-utils) + (if rmail-enable-mime + (with-current-buffer rmail-buffer + (if (rmail-mime-message-p) + (let ((rmail-mime-mbox-buffer rmail-view-buffer) + (rmail-mime-view-buffer rmail-buffer)) + (rmail-mime-toggle-raw 'raw))))) + (let ((rmail-this-buffer (current-buffer)) (msgnum rmail-current-message) bounce-start bounce-end bounce-indent resending @@ -4598,7 +4605,7 @@ With prefix argument N moves forward N messages with these labels. ;;;*** -;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "cd7656f82944d0b92b0d093a5f3a4c36") +;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "0c18b83f914803d1216e1a9df7ea5275") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el index 0b837a43d94..e4e066bd642 100644 --- a/lisp/mail/rmailedit.el +++ b/lisp/mail/rmailedit.el @@ -111,6 +111,8 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. ;; Even if the message is in `raw' state, boundaries etc ;; are still missing. All we can do is insert the real ;; raw message. (Bug#9840) + ;; FIXME? Since the 2012-09-17 changes to rmail-mime, + ;; can we just use that function now? (when (and entity (not (equal "text/plain" (car (rmail-mime-entity-type entity))))) diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 67b2e62275f..2cc57963ef7 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -389,13 +389,13 @@ Use `raw' for raw mode, and any other non-nil value for decoded mode." ;; Enter the raw mode. (rmail-mime-raw-mode entity) ;; Enter the shown mode. - (rmail-mime-shown-mode entity)) - (let ((inhibit-read-only t) - (modified (buffer-modified-p))) - (save-excursion - (goto-char (aref segment 1)) - (rmail-mime-insert entity) - (restore-buffer-modified-p modified))))) + (rmail-mime-shown-mode entity) + (let ((inhibit-read-only t) + (modified (buffer-modified-p))) + (save-excursion + (goto-char (aref segment 1)) + (rmail-mime-insert entity) + (restore-buffer-modified-p modified)))))) (defun rmail-mime-toggle-hidden () "Hide or show the body of the MIME-entity at point." @@ -1212,7 +1212,7 @@ available." (if (rmail-mime-display-header current) (delete-char (- (aref segment 2) (aref segment 1)))) (insert-buffer-substring rmail-mime-mbox-buffer - (aref header 0) (aref header 1))) + (aref header 0) (aref header 1))) ;; tagline (if (rmail-mime-display-tagline current) (delete-char (- (aref segment 3) (aref segment 2)))) @@ -1261,14 +1261,17 @@ The arguments ARG and STATE have no effect in this case." (interactive (list current-prefix-arg nil)) (if rmail-enable-mime (with-current-buffer rmail-buffer - (if (rmail-mime-message-p) - (let ((rmail-mime-mbox-buffer rmail-view-buffer) - (rmail-mime-view-buffer rmail-buffer) - (entity (get-text-property - (progn - (or arg (goto-char (point-min))) - (point)) 'rmail-mime-entity))) - (if (or (not arg) entity) (rmail-mime-toggle-raw state))) + (if (or (rmail-mime-message-p) + (get-text-property (point-min) 'rmail-mime-hidden)) + (let* ((hidden (get-text-property (point-min) 'rmail-mime-hidden)) + (desired-hidden (if state (eq state 'raw) (not hidden)))) + (unless (eq hidden desired-hidden) + (if (not desired-hidden) + (rmail-show-message rmail-current-message) + (let ((rmail-enable-mime nil) + (inhibit-read-only t)) + (rmail-show-message rmail-current-message) + (add-text-properties (point-min) (point-max) '(rmail-mime-hidden t)))))) (message "Not a MIME message, just toggling headers") (rmail-toggle-header))) (let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string)) diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el index fdfe17a1a07..3d7495ffd1a 100644 --- a/lisp/mail/uce.el +++ b/lisp/mail/uce.el @@ -63,7 +63,7 @@ ;; Usage: ;; Place uce.el in your load-path (and optionally byte-compile it). -;; Add the following line to your ~/.emacs: +;; Add the following line to your init file: ;; (autoload 'uce-reply-to-uce "uce" "Reply to UCEs" t nil) ;; If you want to use it with Gnus rather than Rmail: ;; (setq uce-mail-reader 'gnus) diff --git a/lisp/mouse-copy.el b/lisp/mouse-copy.el index 8d043b4495f..a8e32bec1ae 100644 --- a/lisp/mouse-copy.el +++ b/lisp/mouse-copy.el @@ -35,7 +35,7 @@ ;; If you like mouse-copy, you should also check out mouse-drag ;; for ``one-click scrolling''. ;; -;; To use mouse-copy, place the following in your .emacs file: +;; To use mouse-copy, place the following in your init file: ;; (require 'mouse-copy) ;; (global-set-key [M-down-mouse-1] 'mouse-drag-secondary-pasting) ;; (global-set-key [M-S-down-mouse-1] 'mouse-drag-secondary-moving) diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el index 7fb10505355..acdad9a42cf 100644 --- a/lisp/mouse-drag.el +++ b/lisp/mouse-drag.el @@ -46,7 +46,7 @@ ;; If you like mouse-drag, you should also check out mouse-copy ;; for ``one-click text copy and move''. ;; -;; To use mouse-drag, place the following in your .emacs file: +;; To use mouse-drag, place the following in your init file: ;; -either- ;; (global-set-key [down-mouse-2] 'mouse-drag-throw) ;; -or- diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 1501fa41baa..265a855b842 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -79,7 +79,7 @@ ;; that this change will take effect for the current GNU Emacs session only. ;; See below for a discussion of non-UNIX hosts. If a large number of ;; machines with similar hostnames have this problem then it is easier to set -;; the value of ange-ftp-dumb-unix-host-regexp in your .emacs file. ange-ftp +;; the value of ange-ftp-dumb-unix-host-regexp in your init file. ange-ftp ;; is unable to automatically recognize dumb unix hosts. ;; File name completion: @@ -275,10 +275,10 @@ ;; VMS support: ;; -;; Ange-ftp has full support for VMS hosts. It -;; should be able to automatically recognize any VMS machine. However, if it -;; fails to do this, you can use the command ange-ftp-add-vms-host. As well, -;; you can set the variable ange-ftp-vms-host-regexp in your .emacs file. We +;; Ange-ftp has full support for VMS hosts. It should be able to +;; automatically recognize any VMS machine. However, if it fails to do +;; this, you can use the command ange-ftp-add-vms-host. Also, you can +;; set the variable ange-ftp-vms-host-regexp in your init file. We ;; would be grateful if you would report any failures to automatically ;; recognize a VMS host as a bug. ;; @@ -332,7 +332,7 @@ ;; the Michigan terminal system. It should be able to automatically ;; recognize any MTS machine. However, if it fails to do this, you can use ;; the command ange-ftp-add-mts-host. As well, you can set the variable -;; ange-ftp-mts-host-regexp in your .emacs file. We would be grateful if you +;; ange-ftp-mts-host-regexp in your init file. We would be grateful if you ;; would report any failures to automatically recognize a MTS host as a bug. ;; ;; Filename syntax: @@ -358,7 +358,7 @@ ;; CMS. It should be able to automatically recognize any CMS machine. ;; However, if it fails to do this, you can use the command ;; ange-ftp-add-cms-host. As well, you can set the variable -;; ange-ftp-cms-host-regexp in your .emacs file. We would be grateful if you +;; ange-ftp-cms-host-regexp in your init file. We would be grateful if you ;; would report any failures to automatically recognize a CMS host as a bug. ;; ;; Filename syntax: diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 8daf339d376..b46d753d225 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -122,8 +122,7 @@ ;; the buffer, use: ;; M-x browse-url -;; To display a URL by shift-clicking on it, put this in your ~/.emacs -;; file: +;; To display a URL by shift-clicking on it, put this in your init file: ;; (global-set-key [S-mouse-2] 'browse-url-at-mouse) ;; (Note that using Shift-mouse-1 is not desirable because ;; that event has a standard meaning in Emacs.) diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 6a9d80f9672..f9e31788527 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -33,7 +33,7 @@ ;; INSTALLATION ;; ;; To use goto-address in a particular mode (for example, while -;; reading mail in mh-e), add something like this in your .emacs file: +;; reading mail in mh-e), add this to your init file: ;; ;; (add-hook 'mh-show-mode-hook 'goto-address) ;; diff --git a/lisp/net/newsticker.el b/lisp/net/newsticker.el index 5d673faf0db..91eca84ce53 100644 --- a/lisp/net/newsticker.el +++ b/lisp/net/newsticker.el @@ -87,7 +87,7 @@ ;; If you are using Newsticker as part of GNU Emacs there is no need to ;; perform any installation steps in order to use Newsticker. Otherwise ;; place Newsticker in a directory where Emacs can find it. Add the -;; following line to your Emacs startup file (`~/.emacs'). +;; following line to your init file: ;; (add-to-list 'load-path "/path/to/newsticker/") ;; (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t) ;; (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t) diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el index f3b0e372de4..f7d41fcd97a 100644 --- a/lisp/net/quickurl.el +++ b/lisp/net/quickurl.el @@ -164,7 +164,7 @@ To make use of this do something like: (setq quickurl-postfix quickurl-reread-hook-postfix) -in your ~/.emacs (after loading/requiring quickurl).") +in your init file (after loading/requiring quickurl).") ;; Non-customize variables. diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 06aae1f6af2..abca6b3ea01 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -204,7 +204,7 @@ useful thing to do is to put (setq tramp-verbose 9) -in the ~/.emacs file and to repeat the bug. Then, include the +in your init file and to repeat the bug. Then, include the contents of the *tramp/foo* buffer and the *debug tramp/foo* buffer in your bug report. diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el index 232e5ca581a..d5de2f410c5 100644 --- a/lisp/net/webjump.el +++ b/lisp/net/webjump.el @@ -38,7 +38,7 @@ ;; example sites. You'll probably want to override it with your own favorite ;; sites. The documentation for the variable describes the syntax. -;; You may wish to add something like the following to your `.emacs' file: +;; You may wish to add something like the following to your init file: ;; ;; (require 'webjump) ;; (global-set-key "\C-cj" 'webjump) diff --git a/lisp/novice.el b/lisp/novice.el index bcc94c86c9d..c621ac4b692 100644 --- a/lisp/novice.el +++ b/lisp/novice.el @@ -159,8 +159,8 @@ to future sessions." (defun disable-command (command) "Require special confirmation to execute COMMAND from now on. COMMAND must be a symbol. -This command alters the user's .emacs file so that this will apply -to future sessions." +This command alters your init file so that this choice applies to +future sessions." (interactive "CDisable command: ") (en/disable-command command t)) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index d357da685e5..3f120961486 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -28,7 +28,7 @@ ;; argument position. ;; ;; To use pcomplete with shell-mode, for example, you will need the -;; following in your .emacs file: +;; following in your init file: ;; ;; (add-hook 'shell-mode-hook 'pcomplete-shell-setup) ;; @@ -451,9 +451,12 @@ Same as `pcomplete' but using the standard completion UI." (list beg (point) table :predicate pred :exit-function + ;; If completion is finished, add a terminating space. + ;; We used to also do this if STATUS is `sole', but + ;; that does not work right when completion cycling. (unless (zerop (length pcomplete-termination-string)) - (lambda (_s finished) - (when (memq finished '(sole finished)) + (lambda (_s status) + (when (eq status 'finished) (if (looking-at (regexp-quote pcomplete-termination-string)) (goto-char (match-end 0)) diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el index 1f04099a6ae..3b6035473fd 100644 --- a/lisp/play/bubbles.el +++ b/lisp/play/bubbles.el @@ -33,7 +33,7 @@ ;; Installation ;; ------------ -;; Add the following lines to your Emacs startup file (`~/.emacs'). +;; Add the following lines to your init file: ;; (add-to-list 'load-path "/path/to/bubbles/") ;; (autoload 'bubbles "bubbles" "Play Bubbles" t) diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el index 8d9506a1614..ade0d15006a 100644 --- a/lisp/play/decipher.el +++ b/lisp/play/decipher.el @@ -138,19 +138,7 @@ the tail of the list." ("^)\\([A-Z ]+\\)\\([a-z ]+\\)" (1 font-lock-keyword-face) (2 font-lock-string-face))) - "Expressions to fontify in Decipher mode. - -Ciphertext uses `font-lock-keyword-face', plaintext uses -`font-lock-string-face', comments use `font-lock-comment-face', and -checkpoints use `font-lock-constant-face'. You can customize the -display by changing these variables. For best results, I recommend -that all faces use the same background color. - -For example, to display ciphertext in the `bold' face, use - (add-hook 'decipher-mode-hook - (lambda () (set (make-local-variable 'font-lock-keyword-face) - 'bold))) -in your `.emacs' file.") + "Font Lock keywords for Decipher mode.") (defvar decipher-mode-map (let ((map (make-keymap))) diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index d2e307c0145..85c128b08e2 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -45,7 +45,7 @@ ;; Installation ;; ;; type at your prompt "emacs -l handwrite.el" or put this file on your -;; Emacs-Lisp load path, add the following into your ~/.emacs startup file +;; Emacs-Lisp load path, add the following into your init file: ;; ;; (require 'handwrite) ;; diff --git a/lisp/printing.el b/lisp/printing.el index 0152ed63dbb..02b2fb0139c 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -139,10 +139,9 @@ Please send all bug fixes and enhancements to ;; ;; One way to set variables is by calling `pr-customize', customize all ;; variables and save the customization by future sessions (see Options -;; section). Other way is by coding your settings on Emacs init file (that is, -;; ~/.emacs file), see below for a first setting template that it should be -;; inserted on your ~/.emacs file (or c:/_emacs, if you're using Windows 9x/NT -;; or MS-DOS): +;; section). Other way is by adding code to your init file; see below +;; for a first setting template that it should be inserted on your +;; init file: ;; ;; * Example of setting for Windows system: ;; @@ -297,8 +296,7 @@ Please send all bug fixes and enhancements to ;; Using `printing' ;; ---------------- ;; -;; To use `printing' insert in your ~/.emacs file (or c:/_emacs, if you're -;; using Windows 9x/NT or MS-DOS): +;; To use `printing' insert in your init file: ;; ;; (require 'printing) ;; ;; ...some user settings... diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 4062646c967..5a054af9883 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -69,7 +69,7 @@ ;; This file requires Emacs-20.3, XEmacs-20.4 or higher and package cc-mode. ;; If antlr-mode is not part of your distribution, put this file into your -;; load-path and the following into your ~/.emacs: +;; load-path and the following into your init file: ;; (autoload 'antlr-mode "antlr-mode" nil t) ;; (setq auto-mode-alist (cons '("\\.g\\'" . antlr-mode) auto-mode-alist)) ;; (add-hook 'speedbar-load-hook ; would be too late in antlr-mode.el diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 8bccb44f308..0dc596a472b 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -1829,7 +1829,7 @@ itself is evaluated." (eval form)) ;; Only used at compile time - suppress "might not be defined at runtime". -(declare-function cl-macroexpand-all "cl-extra" (form &optional env)) +(declare-function cl-macroexpand-all "cl" (form &optional env)) (defmacro c-lang-defconst (name &rest args) "Set the language specific values of the language constant NAME. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 78be8ac2cc4..d5a1be572ba 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -208,9 +208,10 @@ the evaluated constant value at compile time." ;; Suppress "might not be defined at runtime" warning. ;; This file is only used when compiling other cc files. -(declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys)) -(declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest)) -(declare-function cl-macroexpand-all "cl-extra" (form &optional env)) +;; These are defined in cl as aliases to the cl- versions. +(declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys) t) +(declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest) t) +(declare-function cl-macroexpand-all "cl" (form &optional env)) (eval-and-compile ;; Some helper functions used when building the language constants. diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index cf628e44de0..20aa2bc2775 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -352,8 +352,8 @@ might get set too. If DONT-OVERRIDE is neither nil nor t, style variables whose default values have been set (more precisely, whose default values are not the symbol `set-from-style') will not be changed. This avoids overriding global settings -done in ~/.emacs. It is useful to call c-set-style from a mode hook in this -way. +done in your init file. It is useful to call c-set-style from a mode hook +in this way. If DONT-OVERRIDE is t, style variables that already have values (i.e., whose values are not the symbol `set-from-style') will not be overridden. CC Mode diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el index 943b5c6a067..525b1c9671e 100644 --- a/lisp/progmodes/cmacexp.el +++ b/lisp/progmodes/cmacexp.el @@ -49,7 +49,7 @@ ;; INSTALLATION ====================================================== -;; Put the following in your ~/.emacs file. +;; Put the following in your init file. ;; If you want the *Macroexpansion* window to be not higher than ;; necessary: diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index fbb0c9e204a..95b8758ba80 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -488,9 +488,12 @@ What matched the HYPERLINK'th subexpression has `mouse-face' and `compilation-message-face' applied. If this is nil, the text matched by the whole REGEXP becomes the hyperlink. -Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where SUBMATCH is -the number of a submatch that should be highlighted when it matches, -and FACE is an expression returning the face to use for that submatch.." +Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where +SUBMATCH is the number of a submatch and FACE is an expression +which evaluates to a face name (a symbol or string). +Alternatively, FACE can evaluate to a property list of the +form (face FACE PROP1 VAL1 PROP2 VAL2 ...), in which case all the +listed text properties PROP# are given values VAL# as well." :type '(repeat (choice (symbol :tag "Predefined symbol") (sexp :tag "Error specification"))) :link `(file-link :tag "example file" @@ -1328,16 +1331,27 @@ to `compilation-error-regexp-alist' if RULES is nil." (compilation--put-prop end-col 'font-lock-face compilation-column-face) + ;; Obey HIGHLIGHT. (dolist (extra-item (nthcdr 6 item)) (let ((mn (pop extra-item))) (when (match-beginning mn) (let ((face (eval (car extra-item)))) (cond ((null face)) - ((symbolp face) + ((or (symbolp face) (stringp face)) (put-text-property (match-beginning mn) (match-end mn) 'font-lock-face face)) + ((and (listp face) + (eq (car face) 'face) + (or (symbolp (cadr face)) + (stringp (cadr face)))) + (put-text-property + (match-beginning mn) (match-end mn) + 'font-lock-face (cadr face)) + (add-text-properties + (match-beginning mn) (match-end mn) + (nthcdr 2 face))) (t (error "Don't know how to handle face %S" face))))))) @@ -1542,20 +1556,20 @@ Returns the compilation buffer created." (get-buffer-create (compilation-buffer-name name-of-mode mode name-function))) (let ((comp-proc (get-buffer-process (current-buffer)))) - (if comp-proc - (if (or (not (eq (process-status comp-proc) 'run)) - compilation-always-kill - (yes-or-no-p - (format "A %s process is running; kill it? " - name-of-mode))) - (condition-case () - (progn - (interrupt-process comp-proc) - (sit-for 1) - (delete-process comp-proc)) - (error nil)) - (error "Cannot have two processes in `%s' at once" - (buffer-name))))) + (if comp-proc + (if (or (not (eq (process-status comp-proc) 'run)) + (eq (process-query-on-exit-flag comp-proc) nil) + (yes-or-no-p + (format "A %s process is running; kill it? " + name-of-mode))) + (condition-case () + (progn + (interrupt-process comp-proc) + (sit-for 1) + (delete-process comp-proc)) + (error nil)) + (error "Cannot have two processes in `%s' at once" + (buffer-name))))) ;; first transfer directory from where M-x compile was called (setq default-directory thisdir) ;; Make compilation buffer read-only. The filter can still write it. @@ -1610,7 +1624,7 @@ Returns the compilation buffer created." (let ((process-environment (append compilation-environment - (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning + (if (if (boundp 'system-uses-terminfo);`If' for compiler warning. system-uses-terminfo) (list "TERM=dumb" "TERMCAP=" (format "COLUMNS=%d" (window-width))) @@ -1660,13 +1674,20 @@ Returns the compilation buffer created." nil `("-c" ,command)))) (start-file-process-shell-command (downcase mode-name) outbuf command)))) - ;; Make the buffer's mode line show process state. - (setq mode-line-process - '(:propertize ":%s" face compilation-mode-line-run)) - (set-process-sentinel proc 'compilation-sentinel) - (unless (eq mode t) - ;; Keep the comint filter, since it's needed for proper handling - ;; of the prompts. + ;; Make the buffer's mode line show process state. + (setq mode-line-process + '(:propertize ":%s" face compilation-mode-line-run)) + + ;; Set the process as killable without query by default. + ;; This allows us to start a new compilation without + ;; getting prompted. + (when compilation-always-kill + (set-process-query-on-exit-flag proc nil)) + + (set-process-sentinel proc 'compilation-sentinel) + (unless (eq mode t) + ;; Keep the comint filter, since it's needed for proper + ;; handling of the prompts. (set-process-filter proc 'compilation-filter)) ;; Use (point-max) here so that output comes in ;; after the initial text, diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index cdbaf4708a7..0f18cffc3de 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -43,7 +43,7 @@ Please send all bug fixes and enhancements to ;; ;; This package translates an EBNF to a syntactic chart on PostScript. ;; -;; To use ebnf2ps, insert in your ~/.emacs: +;; To use ebnf2ps, insert in your init file: ;; ;; (require 'ebnf2ps) ;; @@ -772,7 +772,7 @@ Please send all bug fixes and enhancements to ;; ;; To set the above options you may: ;; -;; a) insert the code in your ~/.emacs, like: +;; a) insert the code in your init file, like: ;; ;; (setq ebnf-terminal-shape 'bevel) ;; diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index cc1251f6a75..f42952685d0 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -102,10 +102,9 @@ ;; (abbrev-mode 1) ; turn on abbreviation mode ;; (f90-add-imenu-menu) ; extra menu with functions etc. ;; (if f90-auto-keyword-case ; change case of all keywords on startup -;; (f90-change-keywords f90-auto-keyword-case)) -;; )) +;; (f90-change-keywords f90-auto-keyword-case)))) ;; -;; in your .emacs file. You can also customize the lists +;; in your init file. You can also customize the lists ;; f90-font-lock-keywords, etc. ;; ;; The auto-fill and abbreviation minor modes are accessible from the F90 menu, diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 233b9a5212e..2a77ad013c7 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -52,7 +52,7 @@ ;; ;; First make sure hideshow.el is in a directory in your `load-path'. ;; You can optionally byte-compile it using `M-x byte-compile-file'. -;; Then, add the following to your ~/.emacs: +;; Then, add the following to your init file: ;; ;; (load-library "hideshow") ;; (add-hook 'X-mode-hook ; other modes similarly diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el index 246ba8f29cd..24613d14634 100644 --- a/lisp/progmodes/idlw-complete-structtag.el +++ b/lisp/progmodes/idlw-complete-structtag.el @@ -53,8 +53,8 @@ ;; ;; INSTALLATION ;; ============ -;; Put this file on the emacs load path and load it with the following -;; line in your .emacs file: +;; Put this file on the emacs load path and load it with the following +;; line in your init file: ;; ;; (add-hook 'idlwave-load-hook ;; (lambda () (require 'idlw-complete-structtag))) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 4f9109284ae..08d1461c008 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -48,7 +48,7 @@ ;; ;; Follow the instructions in the INSTALL file of the distribution. ;; In short, put this file on your load path and add the following -;; lines to your .emacs file: +;; lines to your init file: ;; ;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t) ;; @@ -111,9 +111,7 @@ For example, \"^\r?IDL> \" or \"^\r?WAVE> \". The \"^\r?\" is needed, to indicate the beginning of the line, with optional return character (which IDL seems to output randomly). This variable is used to initialize `comint-prompt-regexp' in the -process buffer. - -This is a fine thing to set in your `.emacs' file." +process buffer." :group 'idlwave-shell-general-setup :type 'regexp) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index a35ffd3e45d..9b634328fa7 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -51,7 +51,7 @@ ;; ;; Follow the instructions in the INSTALL file of the distribution. ;; In short, put this file on your load path and add the following -;; lines to your .emacs file: +;; lines to your init file: ;; ;; (autoload 'idlwave-mode "idlwave" "IDLWAVE Mode" t) ;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t) @@ -746,7 +746,7 @@ or even '?'. '.' is not a good choice because it can make structure field names act like abbrevs in certain circumstances. Changes to this in `idlwave-mode-hook' will have no effect. Instead a user -must set it directly using `setq' in the .emacs file before idlwave.el +must set it directly using `setq' in the init file before idlwave.el is loaded." :group 'idlwave-abbrev-and-indent-action :type 'string) diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index cd6c8869d9f..401970b2ce8 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -168,9 +168,7 @@ This variable is only used if the variable More precise choices: Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\" franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" -kcl: \"^>+ *\" - -This is a fine thing to set in your .emacs file or through Custom." +kcl: \"^>+ *\"" :type 'regexp :group 'inferior-lisp) diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index 54d857dd4b1..a59176a5aa6 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -32,7 +32,7 @@ ;; GNU MDK from `https://savannah.gnu.org/projects/mdk/' and ;; `ftp://ftp.gnu.org/pub/gnu/mdk'. ;; -;; To use this mode, place the following in your .emacs file: +;; To use this mode, place the following in your init file: ;; `(load-file "/PATH-TO-FILE/mixal-mode.el")'. ;; When you load a file with the extension .mixal the mode will be started ;; automatic. If you want to start the mode manual, use `M-x mixal-mode'. diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index 79b3fcee720..ab5a19f8a2f 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el @@ -585,12 +585,12 @@ Variables you can use to customize Octave mode Turning on Octave mode runs the hook `octave-mode-hook'. To begin using this mode for all `.m' files that you edit, add the -following lines to your `.emacs' file: +following lines to your init file: (add-to-list 'auto-mode-alist '(\"\\\\.m\\\\'\" . octave-mode)) To automatically turn on the abbrev and auto-fill features, -add the following lines to your `.emacs' file as well: +add the following lines to your init file as well: (add-hook 'octave-mode-hook (lambda () diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index e13b67e596d..3dd9a48bb33 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -28,14 +28,14 @@ ;;; Commentary: ;; To enter perl-mode automatically, add (autoload 'perl-mode "perl-mode") -;; to your .emacs file and change the first line of your perl script to: +;; to your init file and change the first line of your perl script to: ;; #!/usr/bin/perl -- # -*-Perl-*- ;; With arguments to perl: ;; #!/usr/bin/perl -P- # -*-Perl-*- ;; To handle files included with do 'filename.pl';, add something like ;; (setq auto-mode-alist (append (list (cons "\\.pl\\'" 'perl-mode)) ;; auto-mode-alist)) -;; to your .emacs file; otherwise the .pl suffix defaults to prolog-mode. +;; to your init file; otherwise the .pl suffix defaults to prolog-mode. ;; This code is based on the 18.53 version c-mode.el, with extensive ;; rewriting. Most of the features of c-mode survived intact. diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 16d85cb2d79..33d43cb3d5a 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -60,9 +60,7 @@ ;;; Installation: ;; -;; Insert the following lines in your init file--typically ~/.emacs -;; (GNU Emacs and XEmacs <21.4), or ~/.xemacs/init.el (XEmacs -;; 21.4)--to use this mode when editing Prolog files under Emacs: +;; Insert the following lines in your init file: ;; ;; (setq load-path (cons "/usr/lib/xemacs/site-lisp" load-path)) ;; (autoload 'run-prolog "prolog" "Start a Prolog sub-process." t) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index f3ecbe3fc3d..3d5abc4df62 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -268,9 +268,8 @@ (defcustom sql-password "" "Default password. - -Storing your password in a textfile such as ~/.emacs could be dangerous. -Customizing your password will store it in your ~/.emacs file." +If you customize this, the value will be stored in your init +file. Since that is a plaintext file, this could be dangerous." :type 'string :group 'SQL :risky t) @@ -1285,8 +1284,8 @@ Based on `comint-mode-map'.") ["List all objects" sql-list-all (sql-get-product-feature sql-product :list-all)] ["List table details" sql-list-table (sql-get-product-feature sql-product :list-table)])) -;; Abbreviations -- if you want more of them, define them in your -;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too. +;; 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 "Abbrev table used in `sql-mode' and `sql-interactive-mode'.") @@ -3715,8 +3714,8 @@ For information on how to create multiple SQLi buffers, see `sql-interactive-mode'. Note that SQL doesn't have an escape character unless you specify -one. If you specify backslash as escape character in SQL, -you must tell Emacs. Here's how to do that in your `~/.emacs' file: +one. If you specify backslash as escape character in SQL, you +must tell Emacs. Here's how to do that in your init file: \(add-hook 'sql-mode-hook (lambda () @@ -3806,7 +3805,7 @@ cause the window to scroll to the end of the buffer. If you want to make SQL buffers limited in length, add the function `comint-truncate-buffer' to `comint-output-filter-functions'. -Here is an example for your .emacs file. It keeps the SQLi buffer a +Here is an example for your init file. It keeps the SQLi buffer a certain length. \(add-hook 'sql-interactive-mode-hook diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index c072754e66d..835d548c19f 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -8790,7 +8790,7 @@ Note these are only read when the file is first visited, you must use \\[find-alternate-file] RET to have these take effect after editing them! If you want to disable the \"Process `eval' or hook local variables\" -warning message, you need to add to your .emacs file: +warning message, you need to add to your init file: (setq enable-local-eval t)" (let ((origbuf (current-buffer))) @@ -11756,7 +11756,7 @@ An example: // For this example we declare the function in the // module's file itself. Often you'd define it instead - // in a site-start.el or .emacs file. + // in a site-start.el or init file. /* Local Variables: eval: diff --git a/lisp/ps-print.el b/lisp/ps-print.el index addf2975c5f..930e750ab27 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -1042,7 +1042,7 @@ Please send all bug fixes and enhancements to ;; variables `ps-bold-faces', `ps-italic-faces' and `ps-underlined-faces'. ;; These variables contain lists of faces that ps-print should consider bold, ;; italic or underline; to set them, put code like the following into your -;; .emacs file: +;; init file: ;; ;; (setq ps-bold-faces '(my-blue-face)) ;; (setq ps-italic-faces '(my-red-face)) diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 43dad63a140..0c082169462 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -56,13 +56,12 @@ This means when you visit a file, point goes to the last place where it was when you previously visited the same file. This variable is automatically buffer-local. -If you wish your place in any file to always be automatically saved, -simply put this in your `~/.emacs' file: +If you wish your place in any file to always be automatically +saved, set this to t using the Customize facility, or put the +following code in your init file: \(setq-default save-place t) -\(require 'saveplace) - -or else use the Custom facility to set this option." +\(require 'saveplace)" :type 'boolean :require 'saveplace :group 'save-place) @@ -148,7 +147,8 @@ even in a later Emacs session. If called with a prefix arg, the mode is enabled if and only if the argument is positive. -To save places automatically in all files, put this in your `.emacs' file: +To save places automatically in all files, put this in your init +file: \(setq-default save-place t\)" (interactive "P") diff --git a/lisp/shell.el b/lisp/shell.el index b98efceefbf..77a42389785 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -46,7 +46,7 @@ ;; YOUR .EMACS FILE ;;============================================================================= -;; Some suggestions for your .emacs file. +;; Some suggestions for your init file. ;; ;; ;; Define M-# to run some strange command: ;; (eval-after-load "shell" @@ -136,9 +136,7 @@ how Shell mode treats paragraphs. The pattern should probably not match more than one line. If it does, Shell mode may become confused trying to distinguish prompt from input -on lines which don't start with a prompt. - -This is a fine thing to set in your `.emacs' file." +on lines which don't start with a prompt." :type 'regexp :group 'shell) @@ -146,9 +144,7 @@ This is a fine thing to set in your `.emacs' file." "List of suffixes to be disregarded during file/command completion. This variable is used to initialize `comint-completion-fignore' in the shell buffer. The default is nil, for compatibility with most shells. -Some people like (\"~\" \"#\" \"%\"). - -This is a fine thing to set in your `.emacs' file." +Some people like (\"~\" \"#\" \"%\")." :type '(repeat (string :tag "Suffix")) :group 'shell) @@ -158,31 +154,29 @@ This variable is used to initialize `comint-delimiter-argument-list' in the shell buffer. The value may depend on the operating system or shell." :type '(choice (const nil) (repeat :tag "List of characters" character)) - ;; Reverted. -;; :version "24.1" ; changed to nil (bug#8027) :group 'shell) -(defvar shell-file-name-chars +(defcustom shell-file-name-chars (if (memq system-type '(ms-dos windows-nt cygwin)) "~/A-Za-z0-9_^$!#%&{}@`'.,:()-" "[]~/A-Za-z0-9+@:_.$#%,={}-") "String of characters valid in a file name. This variable is used to initialize `comint-file-name-chars' in the -shell buffer. The value may depend on the operating system or shell. +shell buffer. The value may depend on the operating system or shell." + :type 'string + :group 'shell) -This is a fine thing to set in your `.emacs' file.") - -(defvar shell-file-name-quote-list +(defcustom shell-file-name-quote-list (if (memq system-type '(ms-dos windows-nt)) nil (append shell-delimiter-argument-list '(?\s ?$ ?\* ?\! ?\" ?\' ?\` ?\# ?\\))) "List of characters to quote when in a file name. This variable is used to initialize `comint-file-name-quote-list' in the -shell buffer. The value may depend on the operating system or shell. +shell buffer. The value may depend on the operating system or shell." + :type '(repeat character) + :group 'shell) -This is a fine thing to set in your `.emacs' file.") - -(defvar shell-dynamic-complete-functions +(defcustom shell-dynamic-complete-functions '(comint-c-a-p-replace-by-expanded-history shell-environment-variable-completion shell-command-completion @@ -192,9 +186,9 @@ This is a fine thing to set in your `.emacs' file.") comint-filename-completion) "List of functions called to perform completion. This variable is used to initialize `comint-dynamic-complete-functions' in the -shell buffer. - -This is a fine thing to set in your `.emacs' file.") +shell buffer." + :type '(repeat function) + :group 'shell) (defcustom shell-command-regexp "[^;&|\n]+" "Regexp to match a single command within a pipeline. diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 90cdea63e85..25a6fbfd998 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -706,7 +706,7 @@ will be stripped by a simplified optimizer when compiled into a singular expression. This variable will be turned into `speedbar-file-regexp' for use with speedbar. You should use the function `speedbar-add-supported-extension' to add a new extension at -runtime, or use the configuration dialog to set it in your .emacs file. +runtime, or use the configuration dialog to set it in your init file. If you add an extension to this list, and it does not appear, you may need to also modify `completion-ignored-extension' which will also help file completion." diff --git a/lisp/startup.el b/lisp/startup.el index 348e653dd28..db5efb89eed 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -71,12 +71,13 @@ once you are familiar with the contents of the startup screen." "Non-nil inhibits the initial startup echo area message. Setting this variable takes effect only if you do it with the customization buffer -or if your `.emacs' file contains a line of this form: +or if your init file contains a line of this form: (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\") -If your `.emacs' file is byte-compiled, use the following form instead: +If your init file is byte-compiled, use the following form +instead: (eval '(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")) -Thus, someone else using a copy of your `.emacs' file will see -the startup message unless he personally acts to inhibit it." +Thus, someone else using a copy of your init file will see the +startup message unless he personally acts to inhibit it." :type '(choice (const :tag "Don't inhibit") (string :tag "Enter your user name, to inhibit")) :group 'initialization) @@ -261,10 +262,14 @@ and VALUE is the value which is given to that frame parameter "Normal hook run after handling urgent options but before loading init files.") (defvar after-init-hook nil - "Normal hook run after loading the init files, `~/.emacs' and `default.el'. -There is no `condition-case' around the running of these functions; -therefore, if you set `debug-on-error' non-nil in `.emacs', -an error in one of these functions will invoke the debugger.") + "Normal hook run after initializing the Emacs session. +It is run after Emacs loads the init file, `default' library, the +abbrevs file, and additional Lisp packages (if any), and setting +the value of `after-init-time'. + +There is no `condition-case' around the running of this hook; +therefore, if `debug-on-error' is non-nil, an error in one of +these functions will invoke the debugger.") (defvar emacs-startup-hook nil "Normal hook run after loading init files and handling the command line.") @@ -296,7 +301,7 @@ the user's init file.") :group 'initialization) (defvar init-file-user nil - "Identity of user whose `.emacs' file is or was read. + "Identity of user whose init file is or was read. The value is nil if `-q' or `--no-init-file' was specified, meaning do not load any init file. @@ -306,7 +311,7 @@ or it may be a string containing a user's name meaning use that person's init file. In either of the latter cases, `(concat \"~\" init-file-user \"/\")' -evaluates to the name of the directory where the `.emacs' file was +evaluates to the name of the directory where the init file was looked for. Setting `init-file-user' does not prevent Emacs from loading @@ -365,7 +370,7 @@ init file is read, in case it sets `mail-host-address'." (t (concat user-emacs-directory "auto-save-list/.saves-"))) "Prefix for generating `auto-save-list-file-name'. -This is used after reading your `.emacs' file to initialize +This is used after reading your init file to initialize `auto-save-list-file-name', by appending Emacs's pid and the system name, if you have not already set `auto-save-list-file-name' yourself. Directories in the prefix will be created if necessary. diff --git a/lisp/strokes.el b/lisp/strokes.el index dfd0e95f61a..62a8528f25d 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -933,14 +933,7 @@ and then safely save them for later use, send letters to friends extracting the strokes for editing use once again, so the editing cycle can continue. -Strokes are easy to program and fun to use. To start strokes going, -you'll want to put the following line in your .emacs file as mentioned -in the commentary to strokes.el. - -This will load strokes when and only when you start Emacs on a window -system, with a mouse or other pointer device defined. - -To toggle strokes-mode, you just do +To toggle strokes-mode, invoke the command > M-x strokes-mode diff --git a/lisp/subr.el b/lisp/subr.el index aa1b10ce17d..e9b85ff1f38 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -80,6 +80,7 @@ For more information, see Info node `(elisp)Declaring Functions'." (defmacro noreturn (form) "Evaluate FORM, expecting it not to return. If FORM does return, signal an error." + (declare (debug t)) `(prog1 ,form (error "Form marked with `noreturn' did return"))) @@ -87,6 +88,7 @@ If FORM does return, signal an error." "Evaluate FORM, expecting a constant return value. This is the global do-nothing version. There is also `testcover-1value' that complains if FORM ever does return differing values." + (declare (debug t)) form) (defmacro def-edebug-spec (symbol spec) diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el index 9a9a31f4253..aea2e8c1092 100644 --- a/lisp/term/iris-ansi.el +++ b/lisp/term/iris-ansi.el @@ -322,7 +322,7 @@ "Terminal initialization function for iris-ansi." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap iris-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m))) diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el index 76a3a31cedc..6b9e1301003 100644 --- a/lisp/term/lk201.el +++ b/lisp/term/lk201.el @@ -75,7 +75,7 @@ (defun terminal-init-lk201 () ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap lk201-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m))) diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 481d6b498cf..98141563006 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -166,7 +166,7 @@ ;; Use inheritance to let the main keymap override those defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap rxvt-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index b02d39c1e0f..f1b6eea8875 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el @@ -93,7 +93,7 @@ "Terminal initialization function for tvi970." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap tvi970-terminal-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el index d037962af19..ce148b62dba 100644 --- a/lisp/term/wyse50.el +++ b/lisp/term/wyse50.el @@ -109,7 +109,7 @@ "Terminal initialization function for wyse50." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap wyse50-terminal-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 28fb9da0b9d..e4871658b98 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -480,7 +480,7 @@ The relevant features are: ;; Use inheritance to let the main keymap override those defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (set-keymap-parent map (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map map))) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index a9320d945ef..42f0418b690 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -290,9 +290,9 @@ If this variable is nil, all regions are treated as small." ;;* Mode specific options enable users to disable flyspell on */ ;;* certain word depending of the emacs mode. For instance, when */ ;;* using flyspell with mail-mode add the following expression */ -;;* in your .emacs file: */ +;;* in your init file: */ ;;* (add-hook 'mail-mode */ -;;* (lambda () (setq flyspell-generic-check-word-predicate */ +;;* (lambda () (setq flyspell-generic-check-word-predicate */ ;;* 'mail-mode-flyspell-verify))) */ ;;*---------------------------------------------------------------------*/ (defvar flyspell-generic-check-word-predicate nil @@ -488,7 +488,7 @@ invoking `ispell-change-dictionary'. Consider using the `ispell-parser' to check your text. For instance consider adding: \(add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 'tex)))) -in your .emacs file. +in your init file. \\[flyspell-region] checks all words inside a region. \\[flyspell-buffer] checks the whole buffer." diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 0c7966f22d3..51a4800de52 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1127,7 +1127,8 @@ aspell is used along with Emacs).") ;; If Emacs flavor supports [:alpha:] use it for global dicts. If ;; spellchecker also supports UTF-8 via command-line option use it - ;; in communication. This does not affect definitions in ~/.emacs. + ;; in communication. This does not affect definitions in your + ;; init file. (if ispell-emacs-alpha-regexp (let (tmp-dicts-alist) (dolist (adict ispell-dictionary-alist) @@ -3680,7 +3681,7 @@ use the `x' command. (Any subsequent regions will be checked.) The `X' command aborts sending the message so that you can edit the buffer. To spell-check whenever a message is sent, include the appropriate lines -in your .emacs file: +in your init file: (add-hook 'message-send-hook 'ispell-message) ;; GNUS 5 (add-hook 'news-inews-hook 'ispell-message) ;; GNUS 4 (add-hook 'mail-send-hook 'ispell-message) diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index d8afb3e5544..8584c496a97 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -47,7 +47,7 @@ ;; To turn RefTeX Mode on and off in a buffer, use `M-x reftex-mode'. ;; ;; To turn on RefTeX Mode for all LaTeX files, add the following lines -;; to your .emacs file: +;; to your init file: ;; ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; AUCTeX LaTeX mode ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; Emacs latex mode @@ -99,7 +99,7 @@ ;; ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x ;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the -;; following lines to your `.emacs' file: +;; following lines to your init file: ;; ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 767f8f360bb..47a821c0148 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -81,7 +81,7 @@ ;;; INSTALLATION -;; Add the following lines to your `.emacs' file: +;; Add the following lines to your init file: ;; ;; (require 'rst) ;; @@ -103,11 +103,51 @@ ;;; Code: +;; FIXME: Check through major mode conventions again. + ;; FIXME: Add proper ";;;###autoload" comments. ;; FIXME: When 24.1 is common place remove use of `lexical-let' and put "-*- ;; lexical-binding: t -*-" in the first line. +;; FIXME: Use `testcover'. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Support for `testcover' + +(when (boundp 'testcover-1value-functions) + ;; Below `lambda' is used in a loop with varying parameters and is thus not + ;; 1valued. + (setq testcover-1value-functions + (delq 'lambda testcover-1value-functions)) + (add-to-list 'testcover-compose-functions 'lambda)) + +(defun rst-testcover-defcustom () + "Remove all customized variables from `testcover-module-constants'. +This seems to be a bug in `testcover': `defcustom' variables are +considered constants. Revert it with this function after each `defcustom'." + (when (boundp 'testcover-module-constants) + (setq testcover-module-constants + (delq nil + (mapcar + (lambda (sym) + (if (not (plist-member (symbol-plist sym) 'standard-value)) + sym)) + testcover-module-constants))))) + +(defun rst-testcover-add-compose (fun) + "Add FUN to `testcover-compose-functions'." + (when (boundp 'testcover-compose-functions) + (add-to-list 'testcover-compose-functions fun))) + +(defun rst-testcover-add-1value (fun) + "Add FUN to `testcover-1value-functions'." + (when (boundp 'testcover-1value-functions) + (add-to-list 'testcover-1value-functions fun))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Common Lisp stuff + ;; Only use of macros is allowed - may be replaced by `cl-lib' some time. (eval-when-compile (require 'cl)) @@ -160,6 +200,7 @@ Comparison done with `equal'." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Versions +;; testcover: ok. (defun rst-extract-version (delim-re head-re re tail-re var &optional default) "Extract the version from a variable according to the given regexes. Return the version after regex DELIM-RE and HEAD-RE matching RE @@ -173,7 +214,7 @@ and before TAIL-RE and DELIM-RE in VAR or DEFAULT for no match." ;; Use CVSHeader to really get information from CVS and not other version ;; control systems. (defconst rst-cvs-header - "$CVSHeader: sm/rst_el/rst.el,v 1.301 2012-07-30 19:29:46 stefan Exp $") + "$CVSHeader: sm/rst_el/rst.el,v 1.309.2.1 2012-09-17 17:30:49 stefan Exp $") (defconst rst-cvs-rev (rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+" " .*" rst-cvs-header "0.0") @@ -483,6 +524,8 @@ argument list for `rst-re'.") (defvar rst-re-alist) ; Forward declare to use it in `rst-re'. ;; FIXME: Use `sregex` or `rx` instead of re-inventing the wheel. +(rst-testcover-add-compose 'rst-re) +;; testcover: ok. (defun rst-re (&rest args) "Interpret ARGS as regular expressions and return a regex string. Each element of ARGS may be one of the following: @@ -556,6 +599,7 @@ After interpretation of ARGS the results are concatenated as for ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Mode definition +;; testcover: ok. (defun rst-define-key (keymap key def &rest deprecated) "Bind like `define-key' but add deprecated key definitions. KEYMAP, KEY, and DEF are as in `define-key'. DEPRECATED key @@ -734,6 +778,7 @@ This inherits from Text mode.") The hook for `text-mode' is run before this one." :group 'rst :type '(hook)) +(rst-testcover-defcustom) ;; Pull in variable definitions silencing byte-compiler. (require 'newcomment) @@ -949,6 +994,7 @@ file." (const :tag "Underline only" simple)) (integer :tag "Indentation for overline and underline type" :value 0)))) +(rst-testcover-defcustom) (defcustom rst-default-indent 1 "Number of characters to indent the section title. @@ -958,7 +1004,7 @@ from a simple adornment style to a over-and-under adornment style." :group 'rst-adjust :type '(integer)) - +(rst-testcover-defcustom) (defun rst-compare-adornments (ado1 ado2) "Compare adornments. @@ -979,7 +1025,8 @@ not found." (setq cur (cdr cur))) cur)) - +;; testcover: FIXME: Test with `rst-preferred-adornments' == nil. Add test +;; `rst-adjust-no-preference'. (defun rst-suggest-new-adornment (allados &optional prev) "Suggest a new, different adornment from all that have been seen. @@ -1032,7 +1079,7 @@ requested adornment." len) ;; Fixup whitespace at the beginning and end of the line. - (if (or (null indent) (eq style 'simple)) + (if (or (null indent) (eq style 'simple)) ;; testcover: ok. (setq indent 0)) (beginning-of-line) (delete-horizontal-space) @@ -1046,7 +1093,8 @@ requested adornment." ;; Remove previous line if it is an adornment. (save-excursion - (forward-line -1) + (forward-line -1) ;; testcover: FIXME: Doesn't work when in first line + ;; of buffer. (if (and (looking-at (rst-re 'ado-beg-2-1)) ;; Avoid removing the underline of a title right above us. (save-excursion (forward-line -1) @@ -1055,7 +1103,8 @@ requested adornment." ;; Remove following line if it is an adornment. (save-excursion - (forward-line +1) + (forward-line +1) ;; testcover: FIXME: Doesn't work when in last line + ;; of buffer. (if (looking-at (rst-re 'ado-beg-2-1)) (rst-delete-entire-line)) ;; Add a newline if we're at the end of the buffer, for the subsequence @@ -1071,13 +1120,14 @@ requested adornment." (insert (make-string len char)))) ;; Insert underline. - (forward-line +1) + (1value ;; Line has been inserted above. + (forward-line +1)) (open-line 1) (insert (make-string len char)) - (forward-line +1) - (goto-char marker) - )) + (1value ;; Line has been inserted above. + (forward-line +1)) + (goto-char marker))) (defun rst-classify-adornment (adornment end) "Classify adornment for section titles and transitions. @@ -1104,11 +1154,14 @@ Return nil if no syntactically valid adornment is found." (ado-re (rst-re ado-ch 'adorep3-hlp)) (end-pnt (point)) (beg-pnt (progn - (forward-line 0) + (1value ;; No lines may be left to move. + (forward-line 0)) (point))) (nxt-emp ; Next line nonexistent or empty (save-excursion (or (not (zerop (forward-line 1))) + ;; testcover: FIXME: Add test classifying at the end of + ;; buffer. (looking-at (rst-re 'lin-end))))) (prv-emp ; Previous line nonexistent or empty (save-excursion @@ -1117,7 +1170,9 @@ Return nil if no syntactically valid adornment is found." (ttl-blw ; Title found below starting here. (save-excursion (and - (zerop (forward-line 1)) + (zerop (forward-line 1)) ;; testcover: FIXME: Add test + ;; classifying at the end of + ;; buffer. (looking-at (rst-re 'ttl-beg)) (point)))) (ttl-abv ; Title found above starting here. @@ -1129,7 +1184,9 @@ Return nil if no syntactically valid adornment is found." (und-fnd ; Matching underline found starting here. (save-excursion (and ttl-blw - (zerop (forward-line 2)) + (zerop (forward-line 2)) ;; testcover: FIXME: Add test + ;; classifying at the end of + ;; buffer. (looking-at (rst-re ado-re 'lin-end)) (point)))) (ovr-fnd ; Matching overline found starting here. @@ -1174,8 +1231,8 @@ Return nil if no syntactically valid adornment is found." (setq key nil))) (if key (list key - (or beg-ovr beg-txt beg-und) - (or end-und end-txt end-ovr) + (or beg-ovr beg-txt) + (or end-und end-txt) beg-ovr end-ovr beg-txt end-txt beg-und end-und))))))) (defun rst-find-title-line () @@ -1193,7 +1250,8 @@ in the first element. If there is no adornment around the title CHARACTER is also nil and match groups for overline and underline are nil." (save-excursion - (forward-line 0) + (1value ;; No lines may be left to move. + (forward-line 0)) (let ((orig-pnt (point)) (orig-end (line-end-position))) (cond @@ -1253,6 +1311,7 @@ t when no section adornments were found. Value depends on `rst-all-sections'.") (make-variable-buffer-local 'rst-section-hierarchy) +(rst-testcover-add-1value 'rst-reset-section-caches) (defun rst-reset-section-caches () "Reset all section cache variables. Should be called by interactive functions which deal with sections." @@ -1354,9 +1413,7 @@ Return a list of the previous and next adornments." (if (and cur (caar cur)) (setq next (if (= curline (caar cur)) (cdr cur) cur))) - (mapcar 'cdar (list prev next)) - )) - + (mapcar 'cdar (list prev next)))) (defun rst-adornment-complete-p (ado) "Return true if the adornment ADO around point is complete." @@ -1369,8 +1426,7 @@ Return a list of the previous and next adornments." (let* ((char (car ado)) (style (cadr ado)) (indent (caddr ado)) - (endcol (save-excursion (end-of-line) (current-column))) - ) + (endcol (save-excursion (end-of-line) (current-column)))) (if char (let ((exps (rst-re "^" char (format "\\{%d\\}" (+ endcol indent)) "$"))) (and @@ -1380,9 +1436,7 @@ Return a list of the previous and next adornments." (or (not (eq style 'over-and-under)) (save-excursion (forward-line -1) (beginning-of-line) - (looking-at exps)))) - )) - )) + (looking-at exps)))))))) (defun rst-get-next-adornment @@ -1414,8 +1468,7 @@ REVERSE-DIRECTION is used to reverse the cycling order." cur)) ;; If not found, take the first of all adornments. - suggestion - ))) + suggestion))) ;; FIXME: A line "``/`` full" is not accepted as a section title. @@ -1456,7 +1509,7 @@ b. a negative numerical argument, which generally inverts the (reverse-direction (and pfxarg (< (prefix-numeric-value pfxarg) 0))) (toggle-style (and pfxarg (not reverse-direction)))) - (if (rst-portable-mark-active-p) + (if (use-region-p) ;; Adjust adornments within region. (rst-promote-region (and pfxarg t)) ;; Adjust adornment around point. @@ -1466,15 +1519,14 @@ b. a negative numerical argument, which generally inverts the (run-hooks 'rst-adjust-hook) ;; Make sure to reset the cursor position properly after we're done. - (goto-char origpt) - - )) + (goto-char origpt))) (defcustom rst-adjust-hook nil "Hooks to be run after running `rst-adjust'." :group 'rst-adjust :type '(hook) :package-version '(rst . "1.1.0")) +(rst-testcover-defcustom) (defcustom rst-new-adornment-down nil "Controls level of new adornment for section headers." @@ -1483,6 +1535,7 @@ b. a negative numerical argument, which generally inverts the (const :tag "Same level as previous one" nil) (const :tag "One level down relative to the previous one" t)) :package-version '(rst . "1.1.0")) +(rst-testcover-defcustom) (defun rst-adjust-adornment (pfxarg) "Call `rst-adjust-adornment-work' interactively. @@ -1741,8 +1794,7 @@ hierarchy is similar to that used by `rst-adjust-adornment-work'." (region-begin-line (line-number-at-pos (region-beginning))) (region-end-line (line-number-at-pos (region-end))) - marker-list - ) + marker-list) ;; Skip the markers that come before the region beginning. (while (and cur (< (caar cur) region-begin-line)) @@ -1771,8 +1823,7 @@ hierarchy is similar to that used by `rst-adjust-adornment-work'." ;; Clear marker to avoid slowing down the editing after we're done. (set-marker (car p) nil)) - (setq deactivate-mark nil) - ))) + (setq deactivate-mark nil)))) @@ -1792,9 +1843,7 @@ in ADORNMENTS." (apply 'rst-update-section x) (goto-char (point-max)) (insert "\n") - (incf level) - )) - ))) + (incf level)))))) (defun rst-straighten-adornments () "Redo all the adornments in the current buffer. @@ -1822,10 +1871,7 @@ in order to adapt it to our preferred style." (apply 'rst-update-section (nth (car lm) rst-preferred-adornments)) ;; Reset the marker to avoid slowing down editing until it gets GC'ed. - (set-marker (cdr lm) nil) - ) - ))) - + (set-marker (cdr lm) nil))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1906,7 +1952,7 @@ and the column of the point." (looking-at pfx-re)))))) ; ...pfx at same level. (push (cons (point) (current-column)) pfx)) - (forward-line 1)) ) + (forward-line 1))) (nreverse pfx))) (defun rst-insert-list-pos (newitem) @@ -2005,6 +2051,7 @@ starting item, for example 'e' for 'A)' style. The position is also arranged by :tag (char-to-string char) char)) rst-bullets))) :package-version '(rst . "1.1.0")) +(rst-testcover-defcustom) (defun rst-insert-list-continue (curitem prefer-roman) "Insert a list item with list start CURITEM including its indentation level. @@ -2206,8 +2253,7 @@ list destructively." (setq node (cons nil (cdaar children)))) ;; Return this node with its children. - (cons node children) - )) + (cons node children))) (defun rst-section-tree-point (node &optional point) @@ -2241,11 +2287,8 @@ container subtree node that we're returning." (let ((sub (rst-section-tree-point (car last) curpoint))) (setq path (car sub) outtree (cdr sub))) - (setq outtree node)) - - ))) - (cons (cons (car node) path) outtree) - )) + (setq outtree node))))) + (cons (cons (car node) path) outtree))) (defgroup rst-toc nil @@ -2257,6 +2300,7 @@ container subtree node that we're returning." "Indentation for table-of-contents display. Also used for formatting insertion, when numbering is disabled." :group 'rst-toc) +(rst-testcover-defcustom) (defcustom rst-toc-insert-style 'fixed "Insertion style for table-of-contents. @@ -2267,10 +2311,12 @@ indentation style: - aligned: numbering, titles aligned under each other - listed: numbering, with dashes like list items (EXPERIMENTAL)" :group 'rst-toc) +(rst-testcover-defcustom) (defcustom rst-toc-insert-number-separator " " "Separator that goes between the TOC number and the title." :group 'rst-toc) +(rst-testcover-defcustom) ;; This is used to avoid having to change the user's mode. (defvar rst-toc-insert-click-keymap @@ -2282,7 +2328,7 @@ indentation style: (defcustom rst-toc-insert-max-level nil "If non-nil, maximum depth of the inserted TOC." :group 'rst-toc) - +(rst-testcover-defcustom) (defun rst-toc-insert (&optional pfxarg) "Insert a simple text rendering of the table of contents. @@ -2316,8 +2362,7 @@ The TOC is inserted indented at the current column." (delete-region init-point (+ init-point (length initial-indent))) ;; Delete the last newline added. - (delete-char -1) - ))) + (delete-char -1)))) (defun rst-toc-insert-node (node level indent pfx) "Insert tree node NODE in table-of-contents. @@ -2343,9 +2388,7 @@ level to align." ;; is generated automatically. (put-text-property b (point) 'mouse-face 'highlight) (put-text-property b (point) 'rst-toc-target (cadar node)) - (put-text-property b (point) 'keymap rst-toc-insert-click-keymap) - - ) + (put-text-property b (point) 'keymap rst-toc-insert-click-keymap)) (insert "\n") ;; Prepare indent for children. @@ -2362,9 +2405,7 @@ level to align." ((eq rst-toc-insert-style 'listed) (concat (substring indent 0 -3) - (concat (make-string (+ (length pfx) 2) ? ) " - "))) - )) - ) + (concat (make-string (+ (length pfx) 2) ? ) " - ")))))) (if (or (eq rst-toc-insert-max-level nil) (< level rst-toc-insert-max-level)) @@ -2382,8 +2423,7 @@ level to align." (if (cdr node) (setq fmt (format "%%-%dd" (1+ (floor (log10 (length - (cdr node)))))))) - )) + (cdr node)))))))))) (dolist (child (cdr node)) (rst-toc-insert-node child @@ -2391,9 +2431,7 @@ level to align." indent (if do-child-numbering (concat pfx (format fmt count)) pfx)) - (incf count))) - - ))) + (incf count)))))) (defun rst-toc-update () @@ -2468,8 +2506,7 @@ file-write hook to always make it up-to-date automatically." ;; Add link on lines. (put-text-property b (point) 'rst-toc-target (cadar node)) - (insert "\n") - )) + (insert "\n"))) (dolist (child (cdr node)) (rst-toc-node child (1+ level)))) @@ -2517,8 +2554,7 @@ brings the cursor in that section." line ;; Create a temporary buffer. - (buf (get-buffer-create rst-toc-buffer-name)) - ) + (buf (get-buffer-create rst-toc-buffer-name))) (with-current-buffer buf (let ((inhibit-read-only t)) @@ -2531,8 +2567,7 @@ brings the cursor in that section." ;; Count the lines to our found node. (let ((linefound (rst-toc-count-lines sectree our-node))) - (setq line (if (cdr linefound) (car linefound) 0))) - )) + (setq line (if (cdr linefound) (car linefound) 0))))) (display-buffer buf) (pop-to-buffer buf) @@ -2541,8 +2576,7 @@ brings the cursor in that section." ;; Move the cursor near the right section in the TOC. (goto-char (point-min)) - (forward-line (1- line)) - )) + (forward-line (1- line)))) (defun rst-toc-mode-find-section () @@ -2644,8 +2678,7 @@ backwards in the file (default is to use 1)." (curline (line-number-at-pos)) (cur allados) - (idx 0) - ) + (idx 0)) ;; Find the index of the "next" adornment w.r.t. to the current line. (while (and cur (< (caar cur) curline)) @@ -2666,8 +2699,7 @@ backwards in the file (default is to use 1)." (progn (goto-char (point-min)) (forward-line (1- (car cur)))) - (if (> offset 0) (goto-char (point-max)) (goto-char (point-min)))) - )) + (if (> offset 0) (goto-char (point-max)) (goto-char (point-min)))))) (defun rst-backward-section () "Like `rst-forward-section', except move back one title." @@ -2686,7 +2718,7 @@ for negative COUNT." (error "Cannot mark zero sections")) (cond ((and allow-extend (or (and (eq last-command this-command) (mark t)) - (rst-portable-mark-active-p))) + (use-region-p))) (set-mark (save-excursion (goto-char (mark)) @@ -2742,17 +2774,14 @@ of each paragraph only." (valid (and (= curcol leftcol) (not (looking-at (rst-re 'lin-end)))) (and (= curcol leftcol) - (not (looking-at (rst-re 'lin-end))))) - ) + (not (looking-at (rst-re 'lin-end)))))) ((>= (point) endm)) (if (if ,first-only (and valid (not previous)) valid) ,body-consequent - ,body-alternative) - - )))) + ,body-alternative))))) ;; FIXME: This needs to be refactored. Probably this is simply a function ;; applying BODY rather than a macro. @@ -2785,13 +2814,10 @@ first of a paragraph." (,isleftmost (and (not ,isempty) (= (current-column) ,leftmost)) (and (not ,isempty) - (= (current-column) ,leftmost))) - ) + (= (current-column) ,leftmost)))) ((>= (point) endm)) - (progn ,@body) - - ))))) + (progn ,@body)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Indentation @@ -2817,26 +2843,31 @@ here." "Indentation when there is no more indentation point given." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) (defcustom rst-indent-field 3 "Indentation for first line after a field or 0 to always indent for content." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) (defcustom rst-indent-literal-normal 3 "Default indentation for literal block after a markup on an own line." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) (defcustom rst-indent-literal-minimized 2 "Default indentation for literal block after a minimized markup." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) (defcustom rst-indent-comment 3 "Default indentation for first line of a comment." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) ;; FIXME: Must consider other tabs: ;; * Line blocks @@ -3116,8 +3147,7 @@ do all lines instead of just paragraphs." (let ((ins-string (format "%d. " (incf count)))) (setq last-insert-len (length ins-string)) (insert ins-string)) - (insert (make-string last-insert-len ?\ )) - ))) + (insert (make-string last-insert-len ?\ ))))) (defun rst-bullet-list-region (beg end all) "Add bullets to all the leftmost paragraphs in the given region. @@ -3127,8 +3157,7 @@ do all lines instead of just paragraphs." (rst-iterate-leftmost-paragraphs beg end (not all) (insert (car rst-preferred-bullets) " ") - (insert " ") - )) + (insert " "))) ;; FIXME: Does not deal with a varying number of digits appropriately. ;; FIXME: Does not deal with multiple levels independently. @@ -3143,18 +3172,13 @@ Renumber as necessary. Region is from BEG to END." (cons (copy-marker (car x)) (cdr x))) (rst-find-pfx-in-region beg end (rst-re 'itmany-sta-1)))) - (count 1) - ) + (count 1)) (save-excursion (dolist (x items) (goto-char (car x)) (looking-at (rst-re 'itmany-beg-1)) (replace-match (format "%d." count) nil nil nil 1) - (incf count) - )) - )) - - + (incf count))))) ;;------------------------------------------------------------------------------ @@ -3202,6 +3226,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-block-face "customize the face `rst-block' instead." "24.1") @@ -3216,6 +3241,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-external-face "customize the face `rst-external' instead." "24.1") @@ -3230,6 +3256,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-definition-face "customize the face `rst-definition' instead." "24.1") @@ -3246,6 +3273,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." "Directives and roles." :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-directive-face "customize the face `rst-directive' instead." "24.1") @@ -3260,6 +3288,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-comment-face "customize the face `rst-comment' instead." "24.1") @@ -3274,6 +3303,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-emphasis1-face "customize the face `rst-emphasis1' instead." "24.1") @@ -3287,6 +3317,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." "Double emphasis." :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-emphasis2-face "customize the face `rst-emphasis2' instead." "24.1") @@ -3301,6 +3332,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-literal-face "customize the face `rst-literal' instead." "24.1") @@ -3315,6 +3347,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-reference-face "customize the face `rst-reference' instead." "24.1") @@ -3368,6 +3401,7 @@ Recompute the faces. VAL is the value to set." :group 'rst-faces-defaults :type '(integer) :set 'rst-set-level-default) +(rst-testcover-defcustom) ;; FIXME: It should be possible to give "#RRGGBB" type of color values. ;; Together with a `rst-level-face-end-light' this could be used for ;; computing steps. @@ -3378,6 +3412,7 @@ Recompute the faces. VAL is the value to set." :group 'rst-faces-defaults :type '(string) :set 'rst-set-level-default) +(rst-testcover-defcustom) ;; FIXME LEVEL-FACE: This needs to be done differently: The faces must specify ;; how they behave for dark and light background using the ;; relevant options explained in `defface'. @@ -3391,12 +3426,14 @@ The default depends on whether the value of `frame-background-mode' is :group 'rst-faces-defaults :type '(integer) :set 'rst-set-level-default) +(rst-testcover-defcustom) (defcustom rst-level-face-format-light "%2d" "The format for the lightness factor appended to the base name of the color. This value is expanded by `format' with an integer." :group 'rst-faces-defaults :type '(string) :set 'rst-set-level-default) +(rst-testcover-defcustom) ;; FIXME LEVEL-FACE: This needs to be done differently: The faces must specify ;; how they behave for dark and light background using the ;; relevant options explained in `defface'. @@ -3420,6 +3457,7 @@ This color is used as background for section title text on level :group 'rst-faces-defaults :type '(integer) :set 'rst-set-level-default) +(rst-testcover-defcustom) (defcustom rst-adornment-faces-alist ;; FIXME LEVEL-FACE: Must be redone if `rst-level-face-max' is changed @@ -3447,6 +3485,7 @@ group." (const :tag "section title adornment" nil)) :value-type (face)) :set-after '(rst-level-face-max)) +(rst-testcover-defcustom) (defun rst-define-level-faces () "Define the faces for the section title text faces from the values." @@ -3663,8 +3702,7 @@ variable of the `rst-faces-defaults' group is customized. Use ;; Indentation is not required for doctest blocks. (,(rst-re 'lin-beg '(:grp (:alt ">>>" ell-tag)) '(:grp ".+")) (1 rst-block-face) - (2 rst-literal-face)) - ) + (2 rst-literal-face))) "Keywords to highlight in rst mode.") (defvar font-lock-beg) @@ -3974,6 +4012,7 @@ string)) to be used for converting the document." (string :tag "Options")))) :group 'rst :package-version "1.2.0") +(rst-testcover-defcustom) ;; FIXME: Must be `defcustom`. (defvar rst-compile-primary-toolset 'html @@ -3999,11 +4038,8 @@ string)) to be used for converting the document." (setq prevdir dir) (setq dir (expand-file-name (file-name-directory (directory-file-name - (file-name-directory dir))))) - ) - (or (and dir (concat dir file-name)) nil) - ))) - + (file-name-directory dir)))))) + (or (and dir (concat dir file-name)) nil)))) (require 'compile) @@ -4041,8 +4077,7 @@ select the alternative tool-set." ;; Invoke the compile command. (if (or compilation-read-command use-alt) (call-interactively 'compile) - (compile compile-command)) - )) + (compile compile-command)))) (defun rst-compile-alt-toolset () "Compile command with the alternative tool-set." @@ -4166,8 +4201,7 @@ column is used (fill-column vs. end of previous/next line)." (cond ((equal last-command 'rst-repeat-last-character) (if (= curcol fill-column) prevcol fill-column)) (t (save-excursion - (if (zerop prevcol) fill-column prevcol))) - )) ) + (if (zerop prevcol) fill-column prevcol)))))) (end-of-line) (if (> (current-column) rightmost-column) ;; Shave characters off the end. @@ -4176,17 +4210,7 @@ column is used (fill-column vs. end of previous/next line)." (point)) ;; Fill with last characters. (insert-char (preceding-char) - (- rightmost-column (current-column)))) - )) - - -(defun rst-portable-mark-active-p () - "Return non-nil if the mark is active. -This is a portable function." - (cond - ((fboundp 'region-active-p) (region-active-p)) - ((boundp 'transient-mark-mode) (and transient-mark-mode mark-active)) - (t mark-active))) + (- rightmost-column (current-column)))))) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 5bcd87ede68..67d7f8c01f9 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -451,7 +451,7 @@ the next N words. In Transient Mark mode, when the mark is active, N defaults to -1, which means to wrap it around the current region. If you like upcased tags, put (setq sgml-transformation-function 'upcase) -in your `.emacs' file. +in your init file. Use \\[sgml-validate] to validate your document with an SGML parser. diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 2664a89855f..459e884d45d 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -126,7 +126,7 @@ ;; again. ;; ;; To use the package regularly place this file in the site library -;; directory and add the next expression in your .emacs file. Make +;; directory and add the next expression in your init file. Make ;; sure that directory is included in the `load-path'. ;; ;; (require 'table) @@ -342,10 +342,10 @@ ;; (function (lambda () ;; (local-set-key [] ')))) ;; -;; Above code is well known ~/.emacs idiom for customizing a mode -;; specific keymap however it does not work for this package. This is -;; because there is no table mode in effect. This package does not -;; use a local map therefore you must modify `table-cell-map' +;; Adding the above to your init file is a common way to customize a +;; mode specific keymap. However it does not work for this package. +;; This is because there is no table mode in effect. This package +;; does not use a local map therefore you must modify `table-cell-map' ;; explicitly. The correct way of achieving above task is: ;; ;; (add-hook 'table-cell-map-hook diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index 8a4fe4f87fd..b21e72639fd 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -276,8 +276,9 @@ You have the following commands at your disposal: \\[2C-merge] Merge both buffers \\[2C-dissociate] Dissociate the two buffers -These keybindings can be customized in your ~/.emacs by `2C-mode-map', -`2C-minor-mode-map' and by binding `2C-command' to some prefix. +These keybindings can be customized in your init file by +`2C-mode-map', `2C-minor-mode-map' and by binding `2C-command' to +some prefix. The appearance of the screen can be customized by the variables `2C-window-width', `2C-beyond-fill-column', `2C-mode-line-format' and diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 13963121e2b..c2ac1035dfe 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -29,7 +29,7 @@ ;; static char *ts = "sdmain.c Time-stamp: <2001-08-13 10:20:51 gildea>"; ;; See the top of `time-stamp.el' for another example. -;; To use time-stamping, add this line to your .emacs file: +;; To use time-stamping, add this line to your init file: ;; (add-hook 'before-save-hook 'time-stamp) ;; Now any time-stamp templates in your files will be updated automatically. @@ -254,7 +254,7 @@ time-stamped file itself.") (defun time-stamp () "Update the time stamp string(s) in the buffer. A template in a file can be automatically updated with a new time stamp -every time you save the file. Add this line to your .emacs file: +every time you save the file. Add this line to your init file: (add-hook 'before-save-hook 'time-stamp) or customize `before-save-hook' through Custom. Normally the template must appear in the first 8 lines of a file and diff --git a/lisp/time.el b/lisp/time.el index 8d43b565416..fe3cdbb57be 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -575,7 +575,8 @@ To turn off the world time display, go to that window and type `q'." (let ((list timer-list)) (while list (let ((elt (pop list))) - (when (equal (symbol-name (aref elt 5)) "display-time-world-timer") + (when (equal (symbol-name (timer--function elt)) + "display-time-world-timer") (cancel-timer elt))))))) ;;;###autoload diff --git a/lisp/url/url-methods.el b/lisp/url/url-methods.el index bd7d8e33922..26fe72014f7 100644 --- a/lisp/url/url-methods.el +++ b/lisp/url/url-methods.el @@ -79,7 +79,7 @@ ;; Store any proxying information - this will not overwrite an old ;; entry, so that people can still set this information in their - ;; .emacs file + ;; init file (cond (cur-proxy nil) ; Keep their old settings ((null env-proxy) nil) ; No proxy setup diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el index 0f71b7b82e7..fc65d62c67d 100644 --- a/lisp/vc/pcvs-defs.el +++ b/lisp/vc/pcvs-defs.el @@ -57,11 +57,7 @@ versions, such as the one in SunOS-4.") ;;;; END OF THINGS TO CHECK WHEN INSTALLING ;;;; -------------------------------------------------------- -;;;; ;;;; User configuration variables: -;;;; -;;;; NOTE: these should be set in your ~/.emacs (or site-lisp/default.el) file. -;;;; (defgroup pcl-cvs nil "Special support for the CVS versioning system." diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index c0dafda57b6..1eb33776f6a 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -534,7 +534,9 @@ in the branch repository (or whose status not be determined)." ;; FIXME: maybe it's overkill to check if both these ;; files exist. (and (file-exists-p branch-format-file) - (file-exists-p lastrev-file))))) + (file-exists-p lastrev-file) + (equal (emacs-bzr-version-dirstate l-c-parent-dir) + (emacs-bzr-version-dirstate rootdir)))))) t))) (with-temp-buffer (insert-file-contents branch-format-file) @@ -553,13 +555,17 @@ in the branch repository (or whose status not be determined)." (insert-file-contents lastrev-file) (when (re-search-forward "[0-9]+" nil t) (buffer-substring (match-beginning 0) (match-end 0)))))) - ;; fallback to calling "bzr revno" + ;; Fallback to calling "bzr revno --tree". + ;; The "--tree" matters for lightweight checkouts not on the same + ;; revision as the parent. (let* ((result (vc-bzr-command-discarding-stderr - vc-bzr-program "revno" (file-relative-name file))) + vc-bzr-program "revno" "--tree" + (file-relative-name file))) (exitcode (car result)) (output (cdr result))) (cond - ((eq exitcode 0) (substring output 0 -1)) + ((and (eq exitcode 0) (not (zerop (length output)))) + (substring output 0 -1)) (t nil)))))) (defun vc-bzr-create-repo () diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b48ea1afd95..ea9ce949ccb 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -31,7 +31,7 @@ ;; To install: put this file on the load-path and add Git to the list ;; of supported backends in `vc-handled-backends'; the following line, -;; placed in your ~/.emacs, will accomplish this: +;; placed in your init file, will accomplish this: ;; ;; (add-to-list 'vc-handled-backends 'Git) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 1ef4faaa008..47800bd4aac 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -653,7 +653,6 @@ (require 'vc-hooks) (require 'vc-dispatcher) -(require 'ediff) (declare-function diff-setup-whitespace "diff-mode" ()) @@ -1698,7 +1697,9 @@ saving the buffer." (vc-diff-internal t (vc-deduce-fileset t) nil nil (called-interactively-p 'interactive)))) -(declare-function ediff-vc-internal (rev1 rev2 &optional startup-hooks)) +(declare-function ediff-load-version-control "ediff" (&optional silent)) +(declare-function ediff-vc-internal "ediff-vers" + (rev1 rev2 &optional startup-hooks)) ;;;###autoload (defun vc-version-ediff (files rev1 rev2) @@ -1719,7 +1720,8 @@ repository history using ediff." ;; FIXME We only support running ediff on one file for now. ;; We could spin off an ediff session per file in the file set. ((= (length files) 1) - (ediff-load-version-control) + (require 'ediff) + (ediff-load-version-control) ; loads ediff-vers (find-file (car files)) ;FIXME: find-file from Elisp is bad. (ediff-vc-internal rev1 rev2 nil)) (t diff --git a/lisp/version.el b/lisp/version.el index e63c51d0d26..1fb3828e15d 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -87,40 +87,91 @@ to the system configuration; look at `system-configuration' instead." ;; Set during dumping, this is a defvar so that it can be setq'd. (defvar emacs-bzr-version nil "String giving the bzr revision from which this Emacs was built. -Value is the bzr revision number and a revision ID separated by a blank. +The format is: [revno] revision_id, where revno may be absent. Value is nil if Emacs was not built from a bzr checkout, or if we could not determine the revision.") -(defun emacs-bzr-get-version (&optional dir) - "Try to return as a string the bzr revision number of the Emacs sources. -Value is the bzr revision number and a revision ID separated by a blank. +(defun emacs-bzr-version-dirstate (dir) + "Try to return as a string the bzr revision ID of directory DIR. +This uses the dirstate file's parent revision entry. +Returns nil if unable to find this information." + (let ((file (expand-file-name ".bzr/checkout/dirstate" dir))) + (when (file-readable-p file) + (with-temp-buffer + (insert-file-contents file) + (and (looking-at "#bazaar dirstate flat format 3") + (forward-line 3) + (looking-at "[0-9]+\0\\([^\0\n]+\\)\0") + (match-string 1)))))) + +(defun emacs-bzr-version-bzr (dir) + "Ask bzr itself for the version information for directory DIR." + ;; Comments on `bzr version-info': + ;; i) Unknown files also cause clean != 1. + ;; ii) It can be slow, contacting the upstream repo to get the + ;; branch nick if one is not set locally, even with a custom + ;; template that is not asking for the nick (as used here). You'd + ;; think the latter part would be trivial to fix: + ;; https://bugs.launchpad.net/bzr/+bug/882541/comments/3 + ;; https://bugs.launchpad.net/bzr/+bug/629150 + ;; You can set the nick locally with `bzr nick ...', which speeds + ;; things up enormously. `bzr revno' does not have this issue, but + ;; has no way to print the revision_id AFAICS. + (message "Waiting for bzr...") + (with-temp-buffer + (if (zerop + (call-process "bzr" nil '(t nil) nil "version-info" + "--custom" + "--template={revno} {revision_id} (clean = {clean})" + "dir")) + (buffer-string)))) + +(defun emacs-bzr-get-version (&optional dir external) + "Try to return as a string the bzr revision of the Emacs sources. +The format is: [revno] revision_id, where revno may be absent. Value is nil if the sources do not seem to be under bzr, or if we could not determine the revision. Note that this reports on the current state of the sources, which may not correspond to the running Emacs. -Optional argument DIR is a directory to use instead of `source-directory'." +Optional argument DIR is a directory to use instead of `source-directory'. +Optional argument EXTERNAL non-nil means to maybe ask `bzr' itself, +if the sources appear to be under bzr. If `force', always ask bzr. +Otherwise only ask bzr if we cannot find any information ourselves." (or dir (setq dir source-directory)) - (when (file-directory-p (setq dir (expand-file-name ".bzr/branch" dir))) - (let (file loc) - (cond ((file-readable-p - (setq file (expand-file-name "last-revision" dir))) - (with-temp-buffer - (insert-file-contents file) - (goto-char (point-max)) - (if (looking-back "\n") - (delete-char -1)) - (buffer-string))) - ;; OK, no last-revision. Is it a lightweight checkout? - ((file-readable-p - (setq file (expand-file-name "location" dir))) - ;; If the parent branch is local, try looking there for the revid. - (if (setq loc (with-temp-buffer - (insert-file-contents file) - (if (looking-at "file://\\(.*\\)") - (match-string 1)))) - (emacs-bzr-get-version loc))) - ;; Could fall back to eg `bzr testament' at this point. - )))) + (when (file-directory-p (expand-file-name ".bzr/branch" dir)) + (if (eq external 'force) + (emacs-bzr-version-bzr dir) + (let (file loc rev) + (cond ((file-readable-p + (setq file (expand-file-name ".bzr/branch/last-revision" dir))) + (with-temp-buffer + (insert-file-contents file) + (goto-char (point-max)) + (if (looking-back "\n") + (delete-char -1)) + (buffer-string))) + ;; OK, no last-revision. Is it a lightweight checkout? + ((file-readable-p + (setq file (expand-file-name ".bzr/branch/location" dir))) + (setq rev (emacs-bzr-version-dirstate dir)) + ;; If the parent branch is local, try looking there for the rev. + ;; Note: there is no guarantee that the parent branch's rev + ;; corresponds to this branch. This branch could have + ;; been made with a specific -r revno argument, or the + ;; parent could have been updated since this branch was created. + ;; To try and detect this, we check the dirstate revids + ;; to see if they match. + (if (and (setq loc (with-temp-buffer + (insert-file-contents file) + (if (looking-at "file://\\(.*\\)") + (match-string 1)))) + (equal rev (emacs-bzr-version-dirstate loc))) + (emacs-bzr-get-version loc) + ;; If parent does not match, the best we can do without + ;; calling external commands is to use the dirstate rev. + rev)) + (external + (emacs-bzr-version-bzr dir))))))) ;; We put version info into the executable in the form that `ident' uses. (purecopy (concat "\n$Id: " (subst-char-in-string ?\n ?\s (emacs-version)) diff --git a/lisp/windmove.el b/lisp/windmove.el index 3a1afec38ee..1181e409dff 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -94,7 +94,7 @@ ;; Installation: ;; -;; Put the following line in your `.emacs' file: +;; Put the following line in your init file: ;; ;; (windmove-default-keybindings) ; shifted arrow keys ;; diff --git a/lisp/window.el b/lisp/window.el index dd1f55450c3..fccb68bd94a 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4551,6 +4551,9 @@ of the window used." (function :tag "function")) :group 'windows) +(make-obsolete-variable 'display-buffer-function + 'display-buffer-alist "24.3") + ;; Eventually, we want to turn this into a defvar; instead of ;; customizing this, the user should use a `pop-up-frame-parameters' ;; alist entry in `display-buffer-base-action'. @@ -4768,8 +4771,8 @@ the selected window. If they contain (same-frame . t), display BUFFER in a window of the selected frame. If ARGS is a list whose car is a symbol, use (car ARGS) as a -function to do the work. Pass it BUFFER as first argument, -and (cdr ARGS) as second." +function to do the work. Pass it BUFFER as first argument, and +pass the elements of (cdr ARGS) as the remaining arguments." (if (and args (symbolp (car args))) (apply (car args) buffer (cdr args)) (let ((window (get-buffer-window buffer 0))) diff --git a/make-dist b/make-dist index 28d2ec15214..7a17fa02372 100755 --- a/make-dist +++ b/make-dist @@ -287,10 +287,10 @@ for subdir in site-lisp \ `find etc lisp admin -type d` \ doc doc/emacs doc/misc doc/man doc/lispref doc/lispintro \ info m4 msdos \ - nextstep nextstep/Cocoa nextstep/Cocoa/Emacs.base \ + nextstep nextstep/templates \ + nextstep/Cocoa nextstep/Cocoa/Emacs.base \ nextstep/Cocoa/Emacs.base/Contents \ nextstep/Cocoa/Emacs.base/Contents/Resources \ - nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj \ nextstep/GNUstep \ nextstep/GNUstep/Emacs.base \ nextstep/GNUstep/Emacs.base/Resources @@ -404,23 +404,23 @@ echo "Making links to \`msdos'" echo "Making links to \`nextstep'" (cd nextstep - ln ChangeLog README INSTALL ../${tempdir}/nextstep) + ln ChangeLog README INSTALL Makefile.in ../${tempdir}/nextstep) + +echo "Making links to \`nextstep/templates'" +(cd nextstep/templates + ln Emacs.desktop.in Info-gnustep.plist.in Info.plist.in InfoPlist.strings.in ../../${tempdir}/nextstep/templates) echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents'" (cd nextstep/Cocoa/Emacs.base/Contents - ln Info.plist PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents) + ln PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents) echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources'" (cd nextstep/Cocoa/Emacs.base/Contents/Resources ln Credits.html *.icns ../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources) -echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj'" -(cd nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj - ln InfoPlist.strings ../../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj) - echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'" (cd nextstep/GNUstep/Emacs.base/Resources - ln Emacs.desktop Info-gnustep.plist README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources ) + ln README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources ) echo "Making links to \`oldXMenu'" (cd oldXMenu diff --git a/nextstep/ChangeLog b/nextstep/ChangeLog index 6451f7a7322..53f42c97716 100644 --- a/nextstep/ChangeLog +++ b/nextstep/ChangeLog @@ -1,3 +1,22 @@ +2012-09-17 Glenn Morris + + * templates/Info-gnustep.plist.in, templates/InfoPlist.strings.in: + * templates/Info.plist.in: Let configure set copyright. + +2012-09-16 Glenn Morris + + * Makefile.in: New file. + * templates: New directory. + * templates/Emacs.desktop.in, templates/Info-gnustep.plist.in: + * templates/Info.plist.in, templates/InfoPlist.strings.in: + Move here from various Cocoa/, GNUstep/ locations. + Let configure set the version number. + * Cocoa/Emacs.base/Contents/Info.plist: + * Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings: + * GNUstep/Emacs.base/Resources/Info-gnustep.plist: + * GNUstep/Emacs.base/Resources/Emacs.desktop: Move to templates/. + * Cocoa/Emacs.base/Contents/Resources/English.lproj: Remove directory. + 2012-04-07 Glenn Morris * Cocoa/Emacs.base/Contents/Info.plist: diff --git a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings b/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings deleted file mode 100644 index 7655c0ca8ec..00000000000 --- a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings +++ /dev/null @@ -1,6 +0,0 @@ -/* Localized versions of Info.plist keys */ - -CFBundleName = "Emacs"; -CFBundleShortVersionString = "Version 24.2.50"; -CFBundleGetInfoString = "Emacs version 24.2.50, NS Windowing"; -NSHumanReadableCopyright = "Copyright (C) 2012 Free Software Foundation, Inc."; diff --git a/nextstep/Makefile.in b/nextstep/Makefile.in new file mode 100644 index 00000000000..27ec5d1556b --- /dev/null +++ b/nextstep/Makefile.in @@ -0,0 +1,67 @@ +### nextstep/Makefile for GNU Emacs + +## Copyright (C) 2012 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 . + +### Commentary: + +### Code: +SHELL = /bin/sh + +srcdir = @srcdir@ +EXEEXT = @EXEEXT@ + +@SET_MAKE@ +MKDIR_P = @MKDIR_P@ + +ns_appdir = @ns_appdir@ +ns_appbindir = @ns_appbindir@ +ns_appsrc = @ns_appsrc@ + +${ns_appdir}: ${srcdir}/${ns_appsrc} ${ns_appsrc} + rm -rf ${ns_appdir} + ${MKDIR_P} ${ns_appdir} + ( cd ${srcdir}/${ns_appsrc} ; tar cfh - . ) | \ + ( cd ${ns_appdir} ; umask 022; tar xf - ) + [ `cd ${srcdir} && /bin/pwd` = `/bin/pwd` ] || \ + ( cd ${ns_appsrc} ; tar cfh - . ) | \ + ( cd ${ns_appdir} ; umask 022; tar xf - ) + +${ns_appbindir}/Emacs: ${ns_appdir} ../src/emacs${EXEEXT} + ${MKDIR_P} ${ns_appbindir} + cp -f ../src/emacs${EXEEXT} ${ns_appbindir}/Emacs + +.PHONY: all + +all: ${ns_appdir} ${ns_appbindir}/Emacs + + +.PHONY: clean distclean maintainer-clean + +clean: + rm -rf ${ns_appdir} + +distclean: clean + rm -f Makefile + rm -f GNUstep/Emacs.base/Resources/Info-gnustep.plist \ + GNUstep/Emacs.base/Resources/Emacs.desktop \ + Cocoa/Emacs.base/Contents/Info.plist \ + Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings + +maintainer-clean: distclean + +### Makefile.in ends here diff --git a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop b/nextstep/templates/Emacs.desktop.in similarity index 92% rename from nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop rename to nextstep/templates/Emacs.desktop.in index a36eafaadb0..170f195f270 100644 --- a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop +++ b/nextstep/templates/Emacs.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Encoding=UTF-8 Type=Application -Version=24.2.50 +Version=@version@ Categories=GNUstep Name=Emacs Comment=GNU Emacs for NeXT/Open/GNUstep and OS X diff --git a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist b/nextstep/templates/Info-gnustep.plist.in similarity index 94% rename from nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist rename to nextstep/templates/Info-gnustep.plist.in index 6cde01b0d05..4ac97e5cde6 100644 --- a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist +++ b/nextstep/templates/Info-gnustep.plist.in @@ -2,7 +2,7 @@ ApplicationDescription = "GNU Emacs for GNUstep / OS X"; ApplicationIcon = emacs.tiff; ApplicationName = Emacs; - ApplicationRelease = "24.2.50"; + ApplicationRelease = "@version@"; Authors = ( "Adrian Robert (GNUstep)", "Christophe de Dinechin (MacOS X)", @@ -11,9 +11,9 @@ "Carl Edman (NeXTstep)", "..see etc/NEXTSTEP" ); - Copyright = "Copyright (C) 2012 Free Software Foundation, Inc."; + Copyright = "@copyright@"; CopyrightDescription = "Released under the GNU General Public License Version 3 or later"; - FullVersionID = "Emacs 24.2.50, NS Windowing"; + FullVersionID = "Emacs @version@, NS Windowing"; NSExecutable = Emacs; NSIcon = emacs.tiff; NSPrincipalClass = NSApplication; diff --git a/nextstep/Cocoa/Emacs.base/Contents/Info.plist b/nextstep/templates/Info.plist.in similarity index 99% rename from nextstep/Cocoa/Emacs.base/Contents/Info.plist rename to nextstep/templates/Info.plist.in index f5490f613fd..25c73916e58 100644 --- a/nextstep/Cocoa/Emacs.base/Contents/Info.plist +++ b/nextstep/templates/Info.plist.in @@ -553,7 +553,7 @@ along with GNU Emacs. If not, see . CFBundleExecutable Emacs CFBundleGetInfoString - Emacs 24.2.50 Copyright (C) 2012 Free Software Foundation, Inc. + Emacs @version@ @copyright@ CFBundleIconFile Emacs.icns CFBundleIdentifier @@ -566,7 +566,7 @@ along with GNU Emacs. If not, see . APPL CFBundleShortVersionString - 24.2.50 + @version@ CFBundleSignature EMAx diff --git a/nextstep/templates/InfoPlist.strings.in b/nextstep/templates/InfoPlist.strings.in new file mode 100644 index 00000000000..f38d8925017 --- /dev/null +++ b/nextstep/templates/InfoPlist.strings.in @@ -0,0 +1,6 @@ +/* Localized versions of Info.plist keys */ + +CFBundleName = "Emacs"; +CFBundleShortVersionString = "Version @version@"; +CFBundleGetInfoString = "Emacs version @version@, NS Windowing"; +NSHumanReadableCopyright = "@copyright@"; diff --git a/nt/ChangeLog b/nt/ChangeLog index fd528315e2a..106f0e91695 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,32 @@ +2012-09-17 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (BROKEN_SA_RESTART, SYNC_INPUT): Remove. + +2012-09-17 Glenn Morris + + * config.nt (COPYRIGHT): New. + +2012-09-15 Paul Eggert + + Port _setjmp fix to POSIXish hosts as well as Microsoft. + * config.nt: Attempt to sync with autogen/config.in. + (HAVE_SIGSETJMP, HAVE__SETJMP): New macros. + (_longjmp, _setjmp): Remove. + +2012-09-14 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) + (BROKEN_SIGPTY, HAVE_CBRT, HAVE_LOGB, NO_TERMIO): Remove. + (USABLE_FIONREAD, USABLE_SIGIO): New macros. + +2012-09-10 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (FLOAT_CHECK_DOMAIN, HAVE_FMOD, HAVE_FREXP) + (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove. + 2012-09-08 Eli Zaretskii * configure.bat : Don't leave it set in the diff --git a/nt/config.nt b/nt/config.nt index 5dc171bae44..23b33731a36 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -54,9 +54,6 @@ along with GNU Emacs. If not, see . */ /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T -/* Define if FIONREAD should not be used. */ -#undef BROKEN_FIONREAD - /* Define if getwd should not be used. */ #undef BROKEN_GETWD @@ -66,21 +63,6 @@ along with GNU Emacs. If not, see . */ /* Define on FreeBSD to work around an issue when reading from a PTY. */ #undef BROKEN_PTY_READ_AFTER_EAGAIN -/* Define if SA_RESTART should only be used in batch mode. */ -#undef BROKEN_SA_RESTART - -/* Define if SIGAIO should not be used. */ -#undef BROKEN_SIGAIO - -/* Define if SIGIO should not be used. */ -#undef BROKEN_SIGIO - -/* Define if SIGPOLL should not be used. */ -#undef BROKEN_SIGPOLL - -/* Define if SIGPTY should not be used. */ -#undef BROKEN_SIGPTY - /* Define if the system is compatible with BSD 4.2. */ #undef BSD4_2 @@ -101,6 +83,9 @@ along with GNU Emacs. If not, see . */ his/her Emacs. */ #undef CLASH_DETECTION +/* Short copyright string for this version of Emacs. */ +#define COPYRIGHT "Copyright (C) 2012 Free Software Foundation, Inc." + /* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP systems. This function is required for 'alloca.c' support on those systems. */ @@ -161,10 +146,6 @@ along with GNU Emacs. If not, see . */ */ #define FIRST_PTY_LETTER 'a' -/* Define if the float library doesn't handle errors by either setting errno, - or signaling SIGFPE. */ -#undef FLOAT_CHECK_DOMAIN - /* Enable compile-time and run-time bounds-checking, and some warnings, without upsetting glibc 2.15+. */ #if defined __OPTIMIZE__ && __OPTIMIZE__ @@ -256,9 +237,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if strtold conforms to C99. */ #undef HAVE_C99_STRTOLD -/* Define to 1 if you have the `cbrt' function. */ -#undef HAVE_CBRT - /* Define to 1 if you have the `cfmakeraw' function. */ #undef HAVE_CFMAKERAW @@ -377,9 +355,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `fmod' function. */ -#define HAVE_FMOD 1 - /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK @@ -392,9 +367,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if using the freetype and fontconfig libraries. */ #undef HAVE_FREETYPE -/* Define to 1 if you have the `frexp' function. */ -#define HAVE_FREXP 1 - /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO @@ -549,9 +521,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if you have the functions acosh, asinh, and atanh. */ -#undef HAVE_INVERSE_HYPERBOLIC - /* Define to 1 if you have the jpeg library (-ljpeg). */ #undef HAVE_JPEG @@ -660,9 +629,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R -/* Define to 1 if you have the `logb' function. */ -#define HAVE_LOGB 1 - /* Define to 1 if you support file names longer than 14 characters. */ #define HAVE_LONG_FILE_NAMES 1 @@ -834,6 +800,10 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T +/* Define to 1 if sigsetjmp and siglongjmp work. The value of this symbol is + irrelevant if HAVE__SETJMP is defined. */ +#undef HAVE_SIGSETJMP + /* Define to 1 if the system has the type `sigset_t'. */ #undef HAVE_SIGSET_T @@ -1118,6 +1088,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `_ftime' function. */ #undef HAVE__FTIME +/* Define to 1 if _setjmp and _longjmp work. */ +#define HAVE__SETJMP 1 + /* Define to 1 if you have the `__builtin_unwind_init' function. */ #undef HAVE___BUILTIN_UNWIND_INIT @@ -1192,15 +1165,9 @@ along with GNU Emacs. If not, see . */ /* Define if XEditRes should not be used. */ #undef NO_EDITRES -/* Define to 1 if you don't have struct exception in math.h. */ -#define NO_MATHERR 1 - /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O -/* Define if termio.h should not be included. */ -#undef NO_TERMIO - /* Minimum value of NSIG. */ #undef NSIG_MINIMUM @@ -1338,9 +1305,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 on System V Release 4. */ #undef SVR4 -/* Process async input synchronously. */ -#undef SYNC_INPUT - /* Define to use system malloc. */ #undef SYSTEM_MALLOC @@ -1385,6 +1349,12 @@ along with GNU Emacs. If not, see . */ /* Define if the system has Unix98 PTYs. */ #undef UNIX98_PTYS +/* Define to 1 if FIONREAD is usable. */ +#define USABLE_FIONREAD 1 + +/* Define to 1 if SIGIO is usable. */ +#undef USABLE_SIGIO + /* How to get a user's full name. */ #define USER_FULL_NAME pw->pw_gecos @@ -1545,14 +1515,6 @@ along with GNU Emacs. If not, see . */ declarations. Define as empty for no equivalent. */ #undef __restrict_arr -/* Define to longjmp if _setjmp and _longjmp do not work. Because longjmp may - alter signal masks, callers of _longjmp should not assume that it leaves - signal masks alone. */ -#undef _longjmp - -/* Define to setjmp if _setjmp and _longjmp do not work. See _longjmp. */ -#undef _setjmp - /* Some platforms that do not use configure define this to include extra configuration information. */ #define config_opsysfile diff --git a/src/Makefile.in b/src/Makefile.in index a84fdd1caf8..cdae2c89fa1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -264,9 +264,6 @@ MSDOS_OBJ = ## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS. MSDOS_X_OBJ = -ns_appdir=@ns_appdir@ -ns_appbindir=@ns_appbindir@ -ns_appsrc=@ns_appsrc@ NS_OBJ=@NS_OBJ@ ## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS. NS_OBJC_OBJ=@NS_OBJC_OBJ@ @@ -514,8 +511,9 @@ $(OLDXMENU): $(OLDXMENU_TARGET) doc.o: buildobj.h -## If HAVE_NS, some ns-specific rules (for OTHER_FILES) are inserted here. -@ns_frag@ +ns-app: emacs$(EXEEXT) + cd ../nextstep && $(MAKE) $(MFLAGS) all + .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean .PHONY: versionclean extraclean frc @@ -529,7 +527,6 @@ mostlyclean: clean: mostlyclean rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT) -rm -rf $(DEPDIR) - test "X$(ns_appdir)" = "X" || rm -rf $(ns_appdir) ## bootstrap-clean is used to clean up just before a bootstrap. ## It should remove all files generated during a compilation/bootstrap, diff --git a/src/atimer.c b/src/atimer.c index 34731920af5..5dbd807872a 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -18,7 +18,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "syssignal.h" #include "systime.h" @@ -369,7 +369,6 @@ run_timers (void) if (! atimers) pending_atimers = 0; -#ifdef SYNC_INPUT if (pending_atimers) pending_signals = 1; else @@ -377,10 +376,6 @@ run_timers (void) pending_signals = interrupt_input_pending; set_alarm (); } -#else - if (! pending_atimers) - set_alarm (); -#endif } @@ -391,11 +386,7 @@ static void handle_alarm_signal (int sig) { pending_atimers = 1; -#ifdef SYNC_INPUT pending_signals = 1; -#else - run_timers (); -#endif } static void diff --git a/src/bidi.c b/src/bidi.c index 4186a46e19e..af0209565e2 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -56,7 +56,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/blockinput.h b/src/blockinput.h index 3f61b2b27b9..7501bfc91a0 100644 --- a/src/blockinput.h +++ b/src/blockinput.h @@ -67,15 +67,10 @@ extern int pending_atimers; If doing signal-driven input, and a signal came in when input was blocked, reinvoke the signal handler now to deal with it. - We used to have two possible definitions of this macro - one for - when SIGIO was #defined, and one for when it wasn't; when SIGIO - wasn't #defined, we wouldn't bother to check if we should re-invoke - the signal handler. But that doesn't work very well; some of the - files which use this macro don't #include the right files to get - SIGIO. - - So, we always test interrupt_input_pending now; that's not too - expensive, and it'll never get set if we don't need to resignal. */ + Always test interrupt_input_pending; that's not too expensive, and + it'll never get set if we don't need to resignal. This is simpler + than dealing here with every configuration option that might affect + whether interrupt_input_pending can be nonzero. */ #define UNBLOCK_INPUT \ do \ diff --git a/src/buffer.c b/src/buffer.c index d512547d34e..b020edb9962 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include diff --git a/src/bytecode.c b/src/bytecode.c index 97730636d0e..5f4fdcc5eff 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -33,7 +33,7 @@ by Hallvard: */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" @@ -458,7 +458,8 @@ unmark_byte_stack (void) Fsignal (Qquit, Qnil); \ AFTER_POTENTIAL_GC (); \ } \ - ELSE_PENDING_SIGNALS \ + else if (pending_signals) \ + process_pending_signals (); \ } while (0) diff --git a/src/callint.c b/src/callint.c index b11545ddea2..c4c087e83d7 100644 --- a/src/callint.c +++ b/src/callint.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include -#include #include "lisp.h" #include "character.h" diff --git a/src/callproc.c b/src/callproc.c index a92959a1559..2604d295f3e 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include @@ -497,11 +496,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) register char **save_environ = environ; register int fd1 = fd[1]; int fd_error = fd1; -#ifdef HAVE_WORKING_VFORK - sigset_t procmask; - sigset_t blocked; - struct sigaction sigpipe_action; -#endif if (fd_output >= 0) fd1 = fd_output; @@ -588,17 +582,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) 0, current_dir); #else /* not WINDOWSNT */ -#ifdef HAVE_WORKING_VFORK - /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal', - this sets the parent's signal handlers as well as the child's. - So delay all interrupts whose handlers the child might munge, - and record the current handlers so they can be restored later. */ - sigemptyset (&blocked); - sigaddset (&blocked, SIGPIPE); - sigaction (SIGPIPE, 0, &sigpipe_action); - pthread_sigmask (SIG_BLOCK, &blocked, &procmask); -#endif - BLOCK_INPUT; /* vfork, and prevent local vars from being clobbered by the vfork. */ @@ -646,9 +629,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) /* GConf causes us to ignore SIGPIPE, make sure it is restored in the child. */ signal (SIGPIPE, SIG_DFL); -#ifdef HAVE_WORKING_VFORK - pthread_sigmask (SIG_SETMASK, &procmask, 0); -#endif child_setup (filefd, fd1, fd_error, (char **) new_argv, 0, current_dir); @@ -656,12 +636,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) UNBLOCK_INPUT; -#ifdef HAVE_WORKING_VFORK - /* Restore the signal state. */ - sigaction (SIGPIPE, &sigpipe_action, 0); - pthread_sigmask (SIG_SETMASK, &procmask, 0); -#endif - #endif /* not WINDOWSNT */ /* The MSDOS case did this already. */ diff --git a/src/casefiddle.c b/src/casefiddle.c index 1102054b153..e3654627576 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/casetab.c b/src/casetab.c index 3e22d0d0b77..a84bc9202d0 100644 --- a/src/casetab.c +++ b/src/casetab.c @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/category.c b/src/category.c index 80dc6938d8b..01a6f54ad17 100644 --- a/src/category.c +++ b/src/category.c @@ -32,7 +32,6 @@ along with GNU Emacs. If not, see . */ #define CATEGORY_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/ccl.c b/src/ccl.c index dd37934451d..34cc1c98eea 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" diff --git a/src/character.c b/src/character.c index 37963d1878c..def1ad090fd 100644 --- a/src/character.c +++ b/src/character.c @@ -36,7 +36,6 @@ along with GNU Emacs. If not, see . */ #ifdef emacs #include -#include #include #include "lisp.h" #include "character.h" diff --git a/src/charset.c b/src/charset.c index 972a0598059..d8c38e5ea3b 100644 --- a/src/charset.c +++ b/src/charset.c @@ -32,7 +32,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include "lisp.h" #include "character.h" diff --git a/src/chartab.c b/src/chartab.c index c14df0ebac6..e864514e336 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "charset.h" diff --git a/src/cm.c b/src/cm.c index 4b17b92eebc..eda6430bafa 100644 --- a/src/cm.c +++ b/src/cm.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "frame.h" diff --git a/src/cmds.c b/src/cmds.c index 90d3cd6dced..45f7df948ae 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" diff --git a/src/coding.c b/src/coding.c index 94a2d9fea80..4b3d22f956c 100644 --- a/src/coding.c +++ b/src/coding.c @@ -285,7 +285,6 @@ encode_coding_XXX (struct coding_system *coding) #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/composite.c b/src/composite.c index eddabb66d33..ae46df0a573 100644 --- a/src/composite.c +++ b/src/composite.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #define COMPOSITE_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/conf_post.h b/src/conf_post.h index 1bf40af260b..0c4d029bc5d 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -90,7 +90,6 @@ along with GNU Emacs. If not, see . */ char *_getpty(); #endif -#undef SA_RESTART /* not the same as defining BROKEN_SA_RESTART */ #endif /* IRIX6_5 */ #ifdef MSDOS @@ -133,22 +132,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ #endif #endif /* MSDOS */ -#ifdef USG5_4 -/* Get FIONREAD from . Get to get struct tchars. - But get first to make sure ttold.h doesn't interfere. */ -#include - -#ifdef emacs -#include -#include -#include -#include -#include -#include -#include -#endif -#endif /* USG5_4 */ - /* Mac OS X / GNUstep need a bit more pure memory. Of the existing knobs, SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ #ifdef HAVE_NS diff --git a/src/data.c b/src/data.c index 5d7f036b70d..72d7c8ccf9a 100644 --- a/src/data.c +++ b/src/data.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include diff --git a/src/dbusbind.c b/src/dbusbind.c index 901820648cb..c2eefd605bb 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_DBUS #include #include -#include + #include "lisp.h" #include "frame.h" #include "termhooks.h" diff --git a/src/dired.c b/src/dired.c index 9af5f76821b..3aa27ecf920 100644 --- a/src/dired.c +++ b/src/dired.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifdef HAVE_PWD_H #include diff --git a/src/dispextern.h b/src/dispextern.h index 11243d23db9..6f5cd55504b 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3221,6 +3221,7 @@ void unrequest_sigio (void); int tabs_safe_p (int); void init_baud_rate (int); void init_sigio (int); +void ignore_sigio (void); /* Defined in xfaces.c */ diff --git a/src/dispnew.c b/src/dispnew.c index bc9141a575d..9cc7349f1b0 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #define DISPEXTERN_INLINE EXTERN_INLINE #include -#include #include #include "lisp.h" @@ -5982,7 +5981,7 @@ sit_for (Lisp_Object timeout, bool reading, int do_display) wrong_type_argument (Qnumberp, timeout); -#ifdef SIGIO +#ifdef USABLE_SIGIO gobble_input (0); #endif diff --git a/src/doc.c b/src/doc.c index 02a5b4b8143..d2d664df266 100644 --- a/src/doc.c +++ b/src/doc.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include /* Must be after sys/types.h for USG*/ -#include #include #include diff --git a/src/doprnt.c b/src/doprnt.c index 3b7391f07d4..caa56d6ae88 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -102,7 +102,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include #include diff --git a/src/dosfns.c b/src/dosfns.c index 21676f4b4f5..3c649f4d534 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -30,7 +30,7 @@ along with GNU Emacs. If not, see . */ #include #undef gettime #undef settime -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/editfns.c b/src/editfns.c index 299cad07fd7..c6744648bc5 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifdef HAVE_PWD_H #include diff --git a/src/emacs.c b/src/emacs.c index d0e2f1e021d..7e4f25abe6e 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -25,7 +25,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" @@ -92,7 +91,7 @@ extern void moncontrol (int mode); #endif static const char emacs_version[] = VERSION; -static const char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc."; +static const char emacs_copyright[] = COPYRIGHT; /* Empty lisp strings. To avoid having to build any others. */ Lisp_Object empty_unibyte_string, empty_multibyte_string; @@ -852,14 +851,10 @@ main (int argc, char **argv) /* Arrange to get warning messages as memory fills up. */ memory_warnings (0, malloc_warning); - /* Call malloc at least once, to run the initial __malloc_hook. + /* Call malloc at least once, to run malloc_initialize_hook. Also call realloc and free for consistency. */ free (realloc (malloc (4), 4)); -# ifndef SYNC_INPUT - /* Arrange to disable interrupt input inside malloc etc. */ - uninterrupt_malloc (); -# endif /* not SYNC_INPUT */ #endif /* not SYSTEM_MALLOC */ #if defined (MSDOS) || defined (WINDOWSNT) @@ -2041,12 +2036,10 @@ shut_down_emacs (int sig, Lisp_Object stuff) unlock_all_files (); #endif -#ifdef SIGIO /* There is a tendency for a SIGIO signal to arrive within exit, and cause a SIGHUP because the input descriptor is already closed. */ unrequest_sigio (); - signal (SIGIO, SIG_IGN); -#endif + ignore_sigio (); #ifdef WINDOWSNT term_ntproc (); @@ -2152,12 +2145,6 @@ You must run Emacs in batch mode in order to dump it. */) memory_warnings (my_edata, malloc_warning); } #endif /* not WINDOWSNT */ -#if defined (HAVE_PTHREAD) && !defined SYNC_INPUT - /* Pthread may call malloc before main, and then we will get an endless - loop, because pthread_self (see alloc.c) calls malloc the first time - it is called on some systems. */ - reset_malloc_hooks (); -#endif #endif /* not SYSTEM_MALLOC */ #ifdef DOUG_LEA_MALLOC malloc_state_ptr = malloc_get_state (); diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index 5f90a5b90aa..d23f3e21f24 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -22,13 +22,40 @@ along with GNU Emacs. If not, see . */ #include "emacsgtkfixed.h" #include -#include + #include "lisp.h" #include "frame.h" #include "xterm.h" #ifdef HAVE_XWIDGETS #include "xwidget.h" #endif +/* Silence a bogus diagnostic; see GNOME bug 683906. */ +#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#endif + +#define EMACS_TYPE_FIXED emacs_fixed_get_type () +#define EMACS_FIXED(obj) \ + G_TYPE_CHECK_INSTANCE_CAST (obj, EMACS_TYPE_FIXED, EmacsFixed) + +typedef struct _EmacsFixed EmacsFixed; +typedef struct _EmacsFixedPrivate EmacsFixedPrivate; +typedef struct _EmacsFixedClass EmacsFixedClass; + +struct _EmacsFixed +{ + GtkFixed container; + + /*< private >*/ + EmacsFixedPrivate *priv; +}; + +struct _EmacsFixedClass +{ + GtkFixedClass parent_class; +}; + struct _EmacsFixedPrivate { struct frame *f; diff --git a/src/eval.c b/src/eval.c index 8a8a507a1b6..1c565e233c6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" #include "blockinput.h" @@ -118,12 +117,6 @@ static EMACS_INT when_entered_debugger; Lisp_Object Vsignaling_function; -/* Set to non-zero while processing X events. Checked in Feval to - make sure the Lisp interpreter isn't called from a signal handler, - which is unsafe because the interpreter isn't reentrant. */ - -int handling_signal; - /* If non-nil, Lisp code must not be run since some part of Emacs is in an inconsistent state. Currently, x-create-frame uses this to avoid triggering window-configuration-change-hook while the new @@ -707,7 +700,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) else { /* Check if there is really a global binding rather than just a let binding that shadows the global unboundness of the var. */ - volatile struct specbinding *pdl = specpdl_ptr; + struct specbinding *pdl = specpdl_ptr; while (pdl > specpdl) { if (EQ ((--pdl)->symbol, sym) && !pdl->func @@ -1072,7 +1065,7 @@ internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object catchlist = &c; /* Call FUNC. */ - if (! _setjmp (c.jmp)) + if (! sys_setjmp (c.jmp)) c.val = (*func) (arg); /* Throw works by a longjmp that comes right here. */ @@ -1107,7 +1100,6 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value) /* Restore certain special C variables. */ set_poll_suppress_count (catch->poll_suppress_count); UNBLOCK_INPUT_TO (catch->interrupt_input_blocked); - handling_signal = 0; immediate_quit = 0; do @@ -1140,7 +1132,7 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value) backtrace_list = catch->backlist; lisp_eval_depth = catch->lisp_eval_depth; - _longjmp (catch->jmp, 1); + sys_longjmp (catch->jmp, 1); } DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0, @@ -1204,12 +1196,9 @@ See also the function `signal' for more info. usage: (condition-case VAR BODYFORM &rest HANDLERS) */) (Lisp_Object args) { - register Lisp_Object bodyform, handlers; - volatile Lisp_Object var; - - var = Fcar (args); - bodyform = Fcar (Fcdr (args)); - handlers = Fcdr (Fcdr (args)); + Lisp_Object var = Fcar (args); + Lisp_Object bodyform = Fcar (Fcdr (args)); + Lisp_Object handlers = Fcdr (Fcdr (args)); return internal_lisp_condition_case (var, bodyform, handlers); } @@ -1249,7 +1238,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform, c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { if (!NILP (h.var)) specbind (h.var, c.val); @@ -1304,7 +1293,7 @@ internal_condition_case (Lisp_Object (*bfun) (void), Lisp_Object handlers, c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1342,7 +1331,7 @@ internal_condition_case_1 (Lisp_Object (*bfun) (Lisp_Object), Lisp_Object arg, c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1384,7 +1373,7 @@ internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object), c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1428,7 +1417,7 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *), c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val, nargs, args); } @@ -1490,7 +1479,7 @@ See also the function `condition-case'. */) struct handler *h; struct backtrace *bp; - immediate_quit = handling_signal = 0; + immediate_quit = 0; abort_on_gc = 0; if (gc_in_progress || waiting_for_input) emacs_abort (); @@ -2043,9 +2032,6 @@ eval_sub (Lisp_Object form) struct backtrace backtrace; struct gcpro gcpro1, gcpro2, gcpro3; - if (handling_signal) - emacs_abort (); - if (SYMBOLP (form)) { /* Look up its binding in the lexical environment. @@ -3108,8 +3094,6 @@ specbind (Lisp_Object symbol, Lisp_Object value) { struct Lisp_Symbol *sym; - eassert (!handling_signal); - CHECK_SYMBOL (symbol); sym = XSYMBOL (symbol); if (specpdl_ptr == specpdl + specpdl_size) @@ -3203,8 +3187,6 @@ specbind (Lisp_Object symbol, Lisp_Object value) void record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg) { - eassert (!handling_signal); - if (specpdl_ptr == specpdl + specpdl_size) grow_specpdl (); specpdl_ptr->func = function; diff --git a/src/fileio.c b/src/fileio.c index f0b3f0cc2fd..ca71af7ed95 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #ifdef HAVE_PWD_H diff --git a/src/filelock.c b/src/filelock.c index 1f599c68912..17f3f253249 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifdef HAVE_PWD_H #include diff --git a/src/floatfns.c b/src/floatfns.c index 8a9a9fd0886..4fe209fcb61 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -22,13 +22,14 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* C89 requires only these math.h functions: - acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, fmod, - frexp, ldexp, log, log10, modf, pow, sin, sinh, sqrt, tan, tanh. +/* C89 requires only the following math.h functions, and Emacs omits + the starred functions since we haven't found a use for them: + acos, asin, atan, atan2, ceil, cos, *cosh, exp, fabs, floor, fmod, + frexp, ldexp, log, log10, *modf, pow, sin, *sinh, sqrt, tan, *tanh. */ #include -#include + #include "lisp.h" #include "syssignal.h" @@ -42,10 +43,12 @@ along with GNU Emacs. If not, see . */ #include -/* This declaration is omitted on some systems, like Ultrix. */ -#if !defined (HPUX) && defined (HAVE_LOGB) && !defined (logb) -extern double logb (double); -#endif /* not HPUX and HAVE_LOGB and no logb macro */ +#ifndef isfinite +# define isfinite(x) ((x) - (x) == 0) +#endif +#ifndef isnan +# define isnan(x) ((x) != (x)) +#endif /* Extract a Lisp number as a `double', or signal an error. */ @@ -126,9 +129,6 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0, return make_float (d); } -#undef isnan -#define isnan(x) ((x) != (x)) - DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, doc: /* Return non nil iff argument X is a NaN. */) (Lisp_Object x) @@ -153,6 +153,7 @@ Cause an error if X1 or X2 is not a float. */) return make_float (copysign (f1, f2)); } +#endif DEFUN ("frexp", Ffrexp, Sfrexp, 1, 1, 0, doc: /* Get significand and exponent of a floating point number. @@ -167,15 +168,9 @@ If X is zero, both parts (SGNFCAND and EXP) are zero. */) (Lisp_Object x) { double f = XFLOATINT (x); - - if (f == 0.0) - return Fcons (make_float (0.0), make_number (0)); - else - { - int exponent; - double sgnfcand = frexp (f, &exponent); - return Fcons (make_float (sgnfcand), make_number (exponent)); - } + int exponent; + double sgnfcand = frexp (f, &exponent); + return Fcons (make_float (sgnfcand), make_number (exponent)); } DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0, @@ -187,118 +182,6 @@ Returns the floating point value resulting from multiplying SGNFCAND CHECK_NUMBER (exponent); return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exponent))); } -#endif - -#if 0 /* Leave these out unless we find there's a reason for them. */ - -DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0, - doc: /* Return the bessel function j0 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = j0 (d); - return make_float (d); -} - -DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0, - doc: /* Return the bessel function j1 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = j1 (d); - return make_float (d); -} - -DEFUN ("bessel-jn", Fbessel_jn, Sbessel_jn, 2, 2, 0, - doc: /* Return the order N bessel function output jn of ARG. -The first arg (the order) is truncated to an integer. */) - (Lisp_Object n, Lisp_Object arg) -{ - int i1 = extract_float (n); - double f2 = extract_float (arg); - - f2 = jn (i1, f2); - return make_float (f2); -} - -DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0, - doc: /* Return the bessel function y0 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = y0 (d); - return make_float (d); -} - -DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0, - doc: /* Return the bessel function y1 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = y1 (d); - return make_float (d); -} - -DEFUN ("bessel-yn", Fbessel_yn, Sbessel_yn, 2, 2, 0, - doc: /* Return the order N bessel function output yn of ARG. -The first arg (the order) is truncated to an integer. */) - (Lisp_Object n, Lisp_Object arg) -{ - int i1 = extract_float (n); - double f2 = extract_float (arg); - - f2 = yn (i1, f2); - return make_float (f2); -} - -#endif - -#if 0 /* Leave these out unless we see they are worth having. */ - -DEFUN ("erf", Ferf, Serf, 1, 1, 0, - doc: /* Return the mathematical error function of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = erf (d); - return make_float (d); -} - -DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0, - doc: /* Return the complementary error function of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = erfc (d); - return make_float (d); -} - -DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0, - doc: /* Return the log gamma of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = lgamma (d); - return make_float (d); -} - -DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0, - doc: /* Return the cube root of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); -#ifdef HAVE_CBRT - d = cbrt (d); -#else - if (d >= 0.0) - d = pow (d, 1.0/3.0); - else - d = -pow (-d, 1.0/3.0); -#endif - return make_float (d); -} - -#endif DEFUN ("exp", Fexp, Sexp, 1, 1, 0, doc: /* Return the exponential base e of ARG. */) @@ -383,63 +266,6 @@ DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0, return make_float (d); } -#if 0 /* Not clearly worth adding. */ - -DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0, - doc: /* Return the inverse hyperbolic cosine of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = acosh (d); - return make_float (d); -} - -DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0, - doc: /* Return the inverse hyperbolic sine of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = asinh (d); - return make_float (d); -} - -DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0, - doc: /* Return the inverse hyperbolic tangent of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = atanh (d); - return make_float (d); -} - -DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0, - doc: /* Return the hyperbolic cosine of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = cosh (d); - return make_float (d); -} - -DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0, - doc: /* Return the hyperbolic sine of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = sinh (d); - return make_float (d); -} - -DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0, - doc: /* Return the hyperbolic tangent of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = tanh (d); - return make_float (d); -} -#endif - DEFUN ("abs", Fabs, Sabs, 1, 1, 0, doc: /* Return the absolute value of ARG. */) (register Lisp_Object arg) @@ -477,16 +303,15 @@ This is the same as the exponent of a float. */) if (f == 0.0) value = MOST_NEGATIVE_FIXNUM; - else + else if (isfinite (f)) { -#ifdef HAVE_LOGB - value = logb (f); -#else int ivalue; frexp (f, &ivalue); value = ivalue - 1; -#endif } + else + value = MOST_POSITIVE_FIXNUM; + XSETINT (val, value); return val; } @@ -719,27 +544,9 @@ syms_of_floatfns (void) defsubr (&Sisnan); #ifdef HAVE_COPYSIGN defsubr (&Scopysign); +#endif defsubr (&Sfrexp); defsubr (&Sldexp); -#endif -#if 0 - defsubr (&Sacosh); - defsubr (&Sasinh); - defsubr (&Satanh); - defsubr (&Scosh); - defsubr (&Ssinh); - defsubr (&Stanh); - defsubr (&Sbessel_y0); - defsubr (&Sbessel_y1); - defsubr (&Sbessel_yn); - defsubr (&Sbessel_j0); - defsubr (&Sbessel_j1); - defsubr (&Sbessel_jn); - defsubr (&Serf); - defsubr (&Serfc); - defsubr (&Slog_gamma); - defsubr (&Scube_root); -#endif defsubr (&Sfceiling); defsubr (&Sffloor); defsubr (&Sfround); diff --git a/src/fns.c b/src/fns.c index 91dc6639150..42c4f817f29 100644 --- a/src/fns.c +++ b/src/fns.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include diff --git a/src/font.c b/src/font.c index 49a09bced28..1f22fee88ee 100644 --- a/src/font.c +++ b/src/font.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include @@ -4296,12 +4295,15 @@ to get the correct visual image of character sequences set in the header of the glyph-string. If the shaping was successful, the value is GSTRING itself or a newly -created glyph-string. Otherwise, the value is nil. */) +created glyph-string. Otherwise, the value is nil. + +See the documentation of `composition-get-gstring' for the format of +GSTRING. */) (Lisp_Object gstring) { struct font *font; Lisp_Object font_object, n, glyph; - ptrdiff_t i, j, from, to; + ptrdiff_t i, from, to; if (! composition_gstring_p (gstring)) signal_error ("Invalid glyph-string: ", gstring); @@ -4327,44 +4329,42 @@ created glyph-string. Otherwise, the value is nil. */) if (XINT (n) < LGSTRING_GLYPH_LEN (gstring)) LGSTRING_SET_GLYPH (gstring, XINT (n), Qnil); + /* Check FROM_IDX and TO_IDX of each GLYPH in GSTRING to assure that + GLYPHS covers all characters (except for the last few ones) in + GSTRING. More formally, provided that NCHARS is the number of + characters in GSTRING and GLYPHS[i] is the ith glyph, FROM_IDX + and TO_IDX of each glyph must satisfy these conditions: + + GLYPHS[0].FROM_IDX == 0 + GLYPHS[i].FROM_IDX <= GLYPHS[i].TO_IDX + if (GLYPHS[i].FROM_IDX == GLYPHS[i-1].FROM_IDX) + ;; GLYPHS[i] and GLYPHS[i-1] belongs to the same grapheme cluster + GLYPHS[i].TO_IDX == GLYPHS[i-1].TO_IDX + else + ;; Be sure to cover all characters. + GLYPHS[i].FROM_IDX == GLYPHS[i-1].TO_IDX + 1 */ glyph = LGSTRING_GLYPH (gstring, 0); from = LGLYPH_FROM (glyph); to = LGLYPH_TO (glyph); - for (i = 1, j = 0; i < LGSTRING_GLYPH_LEN (gstring); i++) + if (from != 0 || to < from) + goto shaper_error; + for (i = 1; i < LGSTRING_GLYPH_LEN (gstring); i++) { - Lisp_Object this = LGSTRING_GLYPH (gstring, i); - - if (NILP (this)) + glyph = LGSTRING_GLYPH (gstring, i); + if (NILP (glyph)) break; - if (NILP (LGLYPH_ADJUSTMENT (this))) - { - if (j < i - 1) - for (; j < i; j++) - { - glyph = LGSTRING_GLYPH (gstring, j); - LGLYPH_SET_FROM (glyph, from); - LGLYPH_SET_TO (glyph, to); - } - from = LGLYPH_FROM (this); - to = LGLYPH_TO (this); - j = i; - } - else - { - if (from > LGLYPH_FROM (this)) - from = LGLYPH_FROM (this); - if (to < LGLYPH_TO (this)) - to = LGLYPH_TO (this); - } + if (! (LGLYPH_FROM (glyph) <= LGLYPH_TO (glyph) + && (LGLYPH_FROM (glyph) == from + ? LGLYPH_TO (glyph) == to + : LGLYPH_FROM (glyph) == to + 1))) + goto shaper_error; + from = LGLYPH_FROM (glyph); + to = LGLYPH_TO (glyph); } - if (j < i - 1) - for (; j < i; j++) - { - glyph = LGSTRING_GLYPH (gstring, j); - LGLYPH_SET_FROM (glyph, from); - LGLYPH_SET_TO (glyph, to); - } return composition_gstring_put_cache (gstring, XINT (n)); + + shaper_error: + return Qnil; } DEFUN ("font-variation-glyphs", Ffont_variation_glyphs, Sfont_variation_glyphs, diff --git a/src/fontset.c b/src/fontset.c index 2b955fe6b11..35d4bfb367e 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "blockinput.h" diff --git a/src/frame.c b/src/frame.c index 9b12842bf89..6930dac3ce8 100644 --- a/src/frame.c +++ b/src/frame.c @@ -24,7 +24,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include @@ -1299,6 +1298,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force) structures can still refer to it. */ fset_menu_bar_vector (f, Qnil); + /* If FRAME's buffer lists contains killed + buffers, this helps GC to reclaim them. */ + fset_buffer_list (f, Qnil); + fset_buried_buffer_list (f, Qnil); + free_font_driver_list (f); xfree (f->namebuf); xfree (f->decode_mode_spec_buffer); diff --git a/src/fringe.c b/src/fringe.c index 0c2109a0f8e..6e6deeddb08 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -18,7 +18,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "frame.h" diff --git a/src/ftfont.c b/src/ftfont.c index a85773a9a21..f07ad6f33c7 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -21,8 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include - #include #include diff --git a/src/ftxfont.c b/src/ftxfont.c index c705ede62c4..466250bd43f 100644 --- a/src/ftxfont.c +++ b/src/ftxfont.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" diff --git a/src/gnutls.c b/src/gnutls.c index a2573f6bd99..1c4693aee32 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -18,7 +18,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "process.h" diff --git a/src/gtkutil.c b/src/gtkutil.c index 884574e1062..1eb4b2cabdf 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #ifdef USE_GTK #include #include -#include #include diff --git a/src/image.c b/src/image.c index cf01602050f..8fc1c8637eb 100644 --- a/src/image.c +++ b/src/image.c @@ -5514,6 +5514,15 @@ init_png_functions (Lisp_Object libraries) #endif /* HAVE_NTGUI */ +/* Possibly inefficient/inexact substitutes for _setjmp and _longjmp. + Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp + substitute may munge the signal mask, but that should be OK here. + MinGW (MS-Windows) uses _setjmp and defines setjmp to _setjmp in + the system header setjmp.h; don't mess up that. */ +#ifndef HAVE__SETJMP +# define _setjmp(j) setjmp (j) +# define _longjmp longjmp +#endif #if (PNG_LIBPNG_VER < 10500) #define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1)) @@ -5591,20 +5600,31 @@ png_read_from_file (png_structp png_ptr, png_bytep data, png_size_t length) /* Load PNG image IMG for use on frame F. Value is non-zero if successful. */ +struct png_load_context +{ + /* These are members so that longjmp doesn't munge local variables. */ + png_struct *png_ptr; + png_info *info_ptr; + png_info *end_info; + FILE *fp; + png_byte *pixels; + png_byte **rows; +}; + static int -png_load (struct frame *f, struct image *img) +png_load_body (struct frame *f, struct image *img, struct png_load_context *c) { Lisp_Object file, specified_file; Lisp_Object specified_data; int x, y; ptrdiff_t i; XImagePtr ximg, mask_img = NULL; - png_struct *png_ptr = NULL; + png_struct *png_ptr; png_info *info_ptr = NULL, *end_info = NULL; - FILE *volatile fp = NULL; + FILE *fp = NULL; png_byte sig[8]; - png_byte * volatile pixels = NULL; - png_byte ** volatile rows = NULL; + png_byte *pixels = NULL; + png_byte **rows = NULL; png_uint_32 width, height; int bit_depth, color_type, interlace_type; png_byte channels; @@ -5671,24 +5691,26 @@ png_load (struct frame *f, struct image *img) png_ptr = fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, my_png_error, my_png_warning); - if (!png_ptr) + if (png_ptr) { - if (fp) fclose (fp); - return 0; + info_ptr = fn_png_create_info_struct (png_ptr); + end_info = fn_png_create_info_struct (png_ptr); } - info_ptr = fn_png_create_info_struct (png_ptr); - if (!info_ptr) - { - fn_png_destroy_read_struct (&png_ptr, NULL, NULL); - if (fp) fclose (fp); - return 0; - } + c->png_ptr = png_ptr; + c->info_ptr = info_ptr; + c->end_info = end_info; + c->fp = fp; + c->pixels = pixels; + c->rows = rows; - end_info = fn_png_create_info_struct (png_ptr); - if (!end_info) + if (! (info_ptr && end_info)) + { + fn_png_destroy_read_struct (&c->png_ptr, &c->info_ptr, &c->end_info); + png_ptr = 0; + } + if (! png_ptr) { - fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL); if (fp) fclose (fp); return 0; } @@ -5698,14 +5720,18 @@ png_load (struct frame *f, struct image *img) if (_setjmp (PNG_JMPBUF (png_ptr))) { error: - if (png_ptr) - fn_png_destroy_read_struct (&png_ptr, &info_ptr, &end_info); - xfree (pixels); - xfree (rows); - if (fp) fclose (fp); + if (c->png_ptr) + fn_png_destroy_read_struct (&c->png_ptr, &c->info_ptr, &c->end_info); + xfree (c->pixels); + xfree (c->rows); + if (c->fp) + fclose (c->fp); return 0; } + /* Silence a bogus diagnostic; see GCC bug 54561. */ + IF_LINT (fp = c->fp); + /* Read image info. */ if (!NILP (specified_data)) fn_png_set_read_fn (png_ptr, (void *) &tbr, png_read_from_memory); @@ -5821,8 +5847,8 @@ png_load (struct frame *f, struct image *img) if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *rows < height || min (PTRDIFF_MAX, SIZE_MAX) / sizeof *pixels / height < row_bytes) memory_full (SIZE_MAX); - pixels = xmalloc (sizeof *pixels * row_bytes * height); - rows = xmalloc (height * sizeof *rows); + c->pixels = pixels = xmalloc (sizeof *pixels * row_bytes * height); + c->rows = rows = xmalloc (height * sizeof *rows); for (i = 0; i < height; ++i) rows[i] = pixels + i * row_bytes; @@ -5832,7 +5858,7 @@ png_load (struct frame *f, struct image *img) if (fp) { fclose (fp); - fp = NULL; + c->fp = NULL; } /* Create an image and pixmap serving as mask if the PNG image @@ -5907,7 +5933,7 @@ png_load (struct frame *f, struct image *img) #endif /* COLOR_TABLE_SUPPORT */ /* Clean up. */ - fn_png_destroy_read_struct (&png_ptr, &info_ptr, &end_info); + fn_png_destroy_read_struct (&c->png_ptr, &c->info_ptr, &c->end_info); xfree (rows); xfree (pixels); @@ -5936,6 +5962,13 @@ png_load (struct frame *f, struct image *img) return 1; } +static int +png_load (struct frame *f, struct image *img) +{ + struct png_load_context c; + return png_load_body (f, img, &c); +} + #else /* HAVE_PNG */ #ifdef HAVE_NS @@ -6105,7 +6138,20 @@ jpeg_resync_to_restart_wrapper (j_decompress_ptr cinfo, int desired) struct my_jpeg_error_mgr { struct jpeg_error_mgr pub; - jmp_buf setjmp_buffer; + sys_jmp_buf setjmp_buffer; + + /* The remaining members are so that longjmp doesn't munge local + variables. */ + struct jpeg_decompress_struct cinfo; + enum + { + MY_JPEG_ERROR_EXIT, + MY_JPEG_INVALID_IMAGE_SIZE, + MY_JPEG_CANNOT_CREATE_X + } failure_code; +#ifdef lint + FILE *fp; +#endif }; @@ -6113,7 +6159,8 @@ static _Noreturn void my_error_exit (j_common_ptr cinfo) { struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err; - _longjmp (mgr->setjmp_buffer, 1); + mgr->failure_code = MY_JPEG_ERROR_EXIT; + sys_longjmp (mgr->setjmp_buffer, 1); } @@ -6319,17 +6366,15 @@ jpeg_file_src (j_decompress_ptr cinfo, FILE *fp) from the JPEG lib. */ static int -jpeg_load (struct frame *f, struct image *img) +jpeg_load_body (struct frame *f, struct image *img, + struct my_jpeg_error_mgr *mgr) { - struct jpeg_decompress_struct cinfo; - struct my_jpeg_error_mgr mgr; Lisp_Object file, specified_file; Lisp_Object specified_data; - FILE * volatile fp = NULL; + FILE *fp = NULL; JSAMPARRAY buffer; int row_stride, x, y; XImagePtr ximg = NULL; - int rc; unsigned long *colors; int width, height; @@ -6359,26 +6404,37 @@ jpeg_load (struct frame *f, struct image *img) return 0; } + IF_LINT (mgr->fp = fp); + /* Customize libjpeg's error handling to call my_error_exit when an error is detected. This function will perform a longjmp. */ - cinfo.err = fn_jpeg_std_error (&mgr.pub); - mgr.pub.error_exit = my_error_exit; - - if ((rc = _setjmp (mgr.setjmp_buffer)) != 0) + mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub); + mgr->pub.error_exit = my_error_exit; + if (sys_setjmp (mgr->setjmp_buffer)) { - if (rc == 1) + switch (mgr->failure_code) { - /* Called from my_error_exit. Display a JPEG error. */ - char buf[JMSG_LENGTH_MAX]; - cinfo.err->format_message ((j_common_ptr) &cinfo, buf); - image_error ("Error reading JPEG image `%s': %s", img->spec, - build_string (buf)); + case MY_JPEG_ERROR_EXIT: + { + char buf[JMSG_LENGTH_MAX]; + mgr->cinfo.err->format_message ((j_common_ptr) &mgr->cinfo, buf); + image_error ("Error reading JPEG image `%s': %s", img->spec, + build_string (buf)); + break; + } + + case MY_JPEG_INVALID_IMAGE_SIZE: + image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); + break; + + case MY_JPEG_CANNOT_CREATE_X: + break; } /* Close the input file and destroy the JPEG object. */ if (fp) - fclose ((FILE *) fp); - fn_jpeg_destroy_decompress (&cinfo); + fclose (fp); + fn_jpeg_destroy_decompress (&mgr->cinfo); /* If we already have an XImage, free that. */ x_destroy_x_image (ximg); @@ -6388,46 +6444,52 @@ jpeg_load (struct frame *f, struct image *img) return 0; } + /* Silence a bogus diagnostic; see GCC bug 54561. */ + IF_LINT (fp = mgr->fp); + /* Create the JPEG decompression object. Let it read from fp. Read the JPEG image header. */ - fn_jpeg_CreateDecompress (&cinfo, JPEG_LIB_VERSION, sizeof (cinfo)); + fn_jpeg_CreateDecompress (&mgr->cinfo, JPEG_LIB_VERSION, sizeof *&mgr->cinfo); if (NILP (specified_data)) - jpeg_file_src (&cinfo, (FILE *) fp); + jpeg_file_src (&mgr->cinfo, fp); else - jpeg_memory_src (&cinfo, SDATA (specified_data), + jpeg_memory_src (&mgr->cinfo, SDATA (specified_data), SBYTES (specified_data)); - fn_jpeg_read_header (&cinfo, 1); + fn_jpeg_read_header (&mgr->cinfo, 1); /* Customize decompression so that color quantization will be used. Start decompression. */ - cinfo.quantize_colors = 1; - fn_jpeg_start_decompress (&cinfo); - width = img->width = cinfo.output_width; - height = img->height = cinfo.output_height; + mgr->cinfo.quantize_colors = 1; + fn_jpeg_start_decompress (&mgr->cinfo); + width = img->width = mgr->cinfo.output_width; + height = img->height = mgr->cinfo.output_height; if (!check_image_size (f, width, height)) { - image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); - _longjmp (mgr.setjmp_buffer, 2); + mgr->failure_code = MY_JPEG_INVALID_IMAGE_SIZE; + sys_longjmp (mgr->setjmp_buffer, 1); } /* Create X image and pixmap. */ if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) - _longjmp (mgr.setjmp_buffer, 2); + { + mgr->failure_code = MY_JPEG_CANNOT_CREATE_X; + sys_longjmp (mgr->setjmp_buffer, 1); + } /* Allocate colors. When color quantization is used, - cinfo.actual_number_of_colors has been set with the number of - colors generated, and cinfo.colormap is a two-dimensional array - of color indices in the range 0..cinfo.actual_number_of_colors. + mgr->cinfo.actual_number_of_colors has been set with the number of + colors generated, and mgr->cinfo.colormap is a two-dimensional array + of color indices in the range 0..mgr->cinfo.actual_number_of_colors. No more than 255 colors will be generated. */ { int i, ir, ig, ib; - if (cinfo.out_color_components > 2) + if (mgr->cinfo.out_color_components > 2) ir = 0, ig = 1, ib = 2; - else if (cinfo.out_color_components > 1) + else if (mgr->cinfo.out_color_components > 1) ir = 0, ig = 1, ib = 0; else ir = 0, ig = 0, ib = 0; @@ -6437,15 +6499,15 @@ jpeg_load (struct frame *f, struct image *img) a default color, and we don't have to care about which colors can be freed safely, and which can't. */ init_color_table (); - colors = alloca (cinfo.actual_number_of_colors * sizeof *colors); + colors = alloca (mgr->cinfo.actual_number_of_colors * sizeof *colors); - for (i = 0; i < cinfo.actual_number_of_colors; ++i) + for (i = 0; i < mgr->cinfo.actual_number_of_colors; ++i) { /* Multiply RGB values with 255 because X expects RGB values in the range 0..0xffff. */ - int r = cinfo.colormap[ir][i] << 8; - int g = cinfo.colormap[ig][i] << 8; - int b = cinfo.colormap[ib][i] << 8; + int r = mgr->cinfo.colormap[ir][i] << 8; + int g = mgr->cinfo.colormap[ig][i] << 8; + int b = mgr->cinfo.colormap[ib][i] << 8; colors[i] = lookup_rgb_color (f, r, g, b); } @@ -6457,21 +6519,21 @@ jpeg_load (struct frame *f, struct image *img) } /* Read pixels. */ - row_stride = width * cinfo.output_components; - buffer = cinfo.mem->alloc_sarray ((j_common_ptr) &cinfo, JPOOL_IMAGE, - row_stride, 1); + row_stride = width * mgr->cinfo.output_components; + buffer = mgr->cinfo.mem->alloc_sarray ((j_common_ptr) &mgr->cinfo, + JPOOL_IMAGE, row_stride, 1); for (y = 0; y < height; ++y) { - fn_jpeg_read_scanlines (&cinfo, buffer, 1); - for (x = 0; x < cinfo.output_width; ++x) + fn_jpeg_read_scanlines (&mgr->cinfo, buffer, 1); + for (x = 0; x < mgr->cinfo.output_width; ++x) XPutPixel (ximg, x, y, colors[buffer[0][x]]); } /* Clean up. */ - fn_jpeg_finish_decompress (&cinfo); - fn_jpeg_destroy_decompress (&cinfo); + fn_jpeg_finish_decompress (&mgr->cinfo); + fn_jpeg_destroy_decompress (&mgr->cinfo); if (fp) - fclose ((FILE *) fp); + fclose (fp); /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) @@ -6484,6 +6546,13 @@ jpeg_load (struct frame *f, struct image *img) return 1; } +static int +jpeg_load (struct frame *f, struct image *img) +{ + struct my_jpeg_error_mgr mgr; + return jpeg_load_body (f, img, &mgr); +} + #else /* HAVE_JPEG */ #ifdef HAVE_NS diff --git a/src/indent.c b/src/indent.c index c60315a7f6e..053643e6319 100644 --- a/src/indent.c +++ b/src/indent.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/insdel.c b/src/insdel.c index b12a390633e..87010cd8251 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include -#include #include @@ -840,8 +839,7 @@ insert_1_both (const char *string, PT + nchars, PT_BYTE + nbytes, before_markers); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, PT, nchars); + offset_intervals (current_buffer, PT, nchars); if (!inherit && buffer_intervals (current_buffer)) set_text_properties (make_number (PT), make_number (PT + nchars), @@ -1153,8 +1151,7 @@ insert_from_buffer_1 (struct buffer *buf, PT_BYTE + outgoing_nbytes, 0); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, PT, nchars); + offset_intervals (current_buffer, PT, nchars); /* Get the intervals for the part of the string we are inserting. */ intervals = buffer_intervals (buf); @@ -1222,8 +1219,7 @@ adjust_after_replace (ptrdiff_t from, ptrdiff_t from_byte, else if (len < nchars_del) adjust_overlays_for_delete (from, nchars_del - len); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, from, len - nchars_del); + offset_intervals (current_buffer, from, len - nchars_del); if (from < PT) adjust_point (len - nchars_del, len_byte - nbytes_del); @@ -1394,16 +1390,16 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, eassert (GPT <= GPT_BYTE); - /* Adjust the overlay center as needed. This must be done after - adjusting the markers that bound the overlays. */ - adjust_overlays_for_delete (from, nchars_del); - adjust_overlays_for_insert (from, inschars); - /* Adjust markers for the deletion and the insertion. */ if (markers) adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, inschars, outgoing_insbytes); + /* Adjust the overlay center as needed. This must be done after + adjusting the markers that bound the overlays. */ + adjust_overlays_for_delete (from, nchars_del); + adjust_overlays_for_insert (from, inschars); + offset_intervals (current_buffer, from, inschars - nchars_del); /* Get the intervals for the part of the string we are inserting-- @@ -1510,6 +1506,12 @@ replace_range_2 (ptrdiff_t from, ptrdiff_t from_byte, eassert (GPT <= GPT_BYTE); + /* Adjust markers for the deletion and the insertion. */ + if (markers + && ! (nchars_del == 1 && inschars == 1 && nbytes_del == insbytes)) + adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, + inschars, insbytes); + /* Adjust the overlay center as needed. This must be done after adjusting the markers that bound the overlays. */ if (nchars_del != inschars) @@ -1518,12 +1520,6 @@ replace_range_2 (ptrdiff_t from, ptrdiff_t from_byte, adjust_overlays_for_delete (from + inschars, nchars_del); } - /* Adjust markers for the deletion and the insertion. */ - if (markers - && ! (nchars_del == 1 && inschars == 1 && nbytes_del == insbytes)) - adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, - inschars, insbytes); - offset_intervals (current_buffer, from, inschars - nchars_del); /* Relocate point as if it were a marker. */ diff --git a/src/intervals.c b/src/intervals.c index e508f968963..584ee1e923d 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -41,7 +41,6 @@ along with GNU Emacs. If not, see . */ #define INTERVALS_INLINE EXTERN_INLINE -#include #include #include "lisp.h" #include "intervals.h" @@ -674,8 +673,7 @@ find_interval (register INTERVAL tree, register ptrdiff_t position) eassert (relative_position <= TOTAL_LENGTH (tree)); - if (!handling_signal) - tree = balance_possible_root_interval (tree); + tree = balance_possible_root_interval (tree); while (1) { diff --git a/src/keyboard.c b/src/keyboard.c index de48b53053b..c80f1d61e77 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -22,7 +22,7 @@ along with GNU Emacs. If not, see . */ #define KEYBOARD_INLINE EXTERN_INLINE #include -#include + #include "lisp.h" #include "termchar.h" #include "termopts.h" @@ -56,6 +56,10 @@ along with GNU Emacs. If not, see . */ #include #endif /* not MSDOS */ +#if defined USABLE_FIONREAD && defined USG5_4 +# include +#endif + #include "syssignal.h" #include @@ -80,9 +84,7 @@ int interrupt_input_pending; pending_atimers separately, to reduce code size. So, any code that changes interrupt_input_pending or pending_atimers should update this too. */ -#ifdef SYNC_INPUT int pending_signals; -#endif #define KBD_BUFFER_SIZE 4096 @@ -141,7 +143,7 @@ static ptrdiff_t before_command_echo_length; /* For longjmp to where kbd input is being done. */ -static jmp_buf getcjmp; +static sys_jmp_buf getcjmp; /* True while doing kbd input. */ int waiting_for_input; @@ -388,19 +390,6 @@ int interrupt_input; /* Nonzero while interrupts are temporarily deferred during redisplay. */ int interrupts_deferred; -/* Allow configure to inhibit use of FIONREAD. */ -#ifdef BROKEN_FIONREAD -#undef FIONREAD -#endif - -/* We are unable to use interrupts if FIONREAD is not available, - so flush SIGIO so we won't try. */ -#if !defined (FIONREAD) -#ifdef SIGIO -#undef SIGIO -#endif -#endif - /* If we support a window system, turn on the code to poll periodically to detect C-g. It isn't actually used when doing interrupt input. */ #if defined (HAVE_WINDOW_SYSTEM) && !defined (USE_ASYNC_EVENTS) @@ -446,12 +435,12 @@ static Lisp_Object modify_event_symbol (ptrdiff_t, int, Lisp_Object, Lisp_Object *, ptrdiff_t); static Lisp_Object make_lispy_switch_frame (Lisp_Object); static int help_char_p (Lisp_Object); -static void save_getcjmp (jmp_buf); -static void restore_getcjmp (jmp_buf); +static void save_getcjmp (sys_jmp_buf); +static void restore_getcjmp (sys_jmp_buf); static Lisp_Object apply_modifiers (int, Lisp_Object); static void clear_event (struct input_event *); static Lisp_Object restore_kboard_configuration (Lisp_Object); -#ifdef SIGIO +#ifdef USABLE_SIGIO static void deliver_input_available_signal (int signo); #endif static void handle_interrupt (void); @@ -2022,17 +2011,9 @@ static struct atimer *poll_timer; void poll_for_input_1 (void) { -/* Tell ns_read_socket() it is being called asynchronously so it can avoid - doing anything dangerous. */ -#ifdef HAVE_NS - ++handling_signal; -#endif if (interrupt_input_blocked == 0 && !waiting_for_input) read_avail_input (0); -#ifdef HAVE_NS - --handling_signal; -#endif } /* Timer callback function for poll_timer. TIMER is equal to @@ -2043,12 +2024,8 @@ poll_for_input (struct atimer *timer) { if (poll_suppress_count == 0) { -#ifdef SYNC_INPUT interrupt_input_pending = 1; pending_signals = 1; -#else - poll_for_input_1 (); -#endif } } @@ -2327,8 +2304,8 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, { volatile Lisp_Object c; ptrdiff_t jmpcount; - jmp_buf local_getcjmp; - jmp_buf save_jump; + sys_jmp_buf local_getcjmp; + sys_jmp_buf save_jump; volatile int key_already_recorded = 0; Lisp_Object tem, save; volatile Lisp_Object previous_echo_area_message; @@ -2574,7 +2551,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, it *must not* be in effect when we call redisplay. */ jmpcount = SPECPDL_INDEX (); - if (_setjmp (local_getcjmp)) + if (sys_setjmp (local_getcjmp)) { /* Handle quits while reading the keyboard. */ /* We must have saved the outer value of getcjmp here, @@ -3406,13 +3383,13 @@ record_char (Lisp_Object c) See read_process_output. */ static void -save_getcjmp (jmp_buf temp) +save_getcjmp (sys_jmp_buf temp) { memcpy (temp, getcjmp, sizeof getcjmp); } static void -restore_getcjmp (jmp_buf temp) +restore_getcjmp (sys_jmp_buf temp) { memcpy (getcjmp, temp, sizeof getcjmp); } @@ -3649,10 +3626,8 @@ kbd_buffer_store_event_hold (register struct input_event *event, /* Don't read keyboard input until we have processed kbd_buffer. This happens when pasting text longer than KBD_BUFFER_SIZE/2. */ hold_keyboard_input (); -#ifdef SIGIO if (!noninteractive) - signal (SIGIO, SIG_IGN); -#endif + ignore_sigio (); stop_polling (); } #endif /* subprocesses */ @@ -3821,14 +3796,14 @@ kbd_buffer_get_event (KBOARD **kbp, /* Start reading input again, we have processed enough so we can accept new events again. */ unhold_keyboard_input (); -#ifdef SIGIO +#ifdef USABLE_SIGIO if (!noninteractive) { struct sigaction action; emacs_sigaction_init (&action, deliver_input_available_signal); sigaction (SIGIO, &action, 0); } -#endif /* SIGIO */ +#endif start_polling (); } #endif /* subprocesses */ @@ -3870,10 +3845,9 @@ kbd_buffer_get_event (KBOARD **kbp, /* One way or another, wait until input is available; then, if interrupt handlers have not read it, read it now. */ -/* Note SIGIO has been undef'd if FIONREAD is missing. */ -#ifdef SIGIO +#ifdef USABLE_SIGIO gobble_input (0); -#endif /* SIGIO */ +#endif if (kbd_fetch_ptr != kbd_store_ptr) break; #if defined (HAVE_MOUSE) || defined (HAVE_GPM) @@ -4352,7 +4326,7 @@ decode_timer (Lisp_Object timer, EMACS_TIME *result) if (! NILP (vector[0])) return 0; - return decode_time_components (vector[1], vector[2], vector[3], vector[4], + return decode_time_components (vector[1], vector[2], vector[3], vector[8], result, 0); } @@ -4554,7 +4528,7 @@ in the same style as (current-time). The value when Emacs is not idle is nil. -NSEC is a multiple of the system clock resolution. */) +PSEC is a multiple of the system clock resolution. */) (void) { if (EMACS_TIME_VALID_P (timer_idleness_start_time)) @@ -6785,7 +6759,7 @@ get_input_pending (int *addr, int flags) void gobble_input (int expected) { -#ifdef SIGIO +#ifdef USABLE_SIGIO if (interrupt_input) { sigset_t blocked, procmask; @@ -6840,7 +6814,7 @@ record_asynch_buffer_change (void) return; /* Make sure no interrupt happens while storing the event. */ -#ifdef SIGIO +#ifdef USABLE_SIGIO if (interrupt_input) { sigset_t blocked, procmask; @@ -7066,7 +7040,7 @@ tty_read_avail_input (struct terminal *terminal, #endif /* HAVE_GPM */ /* Determine how many characters we should *try* to read. */ -#ifdef FIONREAD +#ifdef USABLE_FIONREAD /* Find out how much input is available. */ if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0) { @@ -7079,14 +7053,12 @@ tty_read_avail_input (struct terminal *terminal, return 0; if (n_to_read > sizeof cbuf) n_to_read = sizeof cbuf; -#else /* no FIONREAD */ -#if defined (USG) || defined (CYGWIN) +#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); #else - you lose; -#endif +# error "Cannot read without possibly delaying" #endif #ifdef subprocesses @@ -7135,7 +7107,7 @@ tty_read_avail_input (struct terminal *terminal, #endif ); -#ifndef FIONREAD +#ifndef USABLE_FIONREAD #if defined (USG) || defined (CYGWIN) fcntl (fileno (tty->input), F_SETFL, 0); #endif /* USG or CYGWIN */ @@ -7206,19 +7178,12 @@ tty_read_avail_input (struct terminal *terminal, return nread; } -#if defined SYNC_INPUT || defined SIGIO static void handle_async_input (void) { interrupt_input_pending = 0; -#ifdef SYNC_INPUT pending_signals = pending_atimers; -#endif -/* Tell ns_read_socket() it is being called asynchronously so it can avoid - doing anything dangerous. */ -#ifdef HAVE_NS - ++handling_signal; -#endif + while (1) { int nread; @@ -7229,13 +7194,8 @@ handle_async_input (void) if (nread <= 0) break; } -#ifdef HAVE_NS - --handling_signal; -#endif } -#endif /* SYNC_INPUT || SIGIO */ -#ifdef SYNC_INPUT void process_pending_signals (void) { @@ -7243,25 +7203,17 @@ process_pending_signals (void) handle_async_input (); do_pending_atimers (); } -#endif -#ifdef SIGIO /* for entire page */ -/* Note SIGIO has been undef'd if FIONREAD is missing. */ +#ifdef USABLE_SIGIO static void handle_input_available_signal (int sig) { -#ifdef SYNC_INPUT interrupt_input_pending = 1; pending_signals = 1; -#endif if (input_available_clear_time) *input_available_clear_time = make_emacs_time (0, 0); - -#ifndef SYNC_INPUT - handle_async_input (); -#endif } static void @@ -7269,7 +7221,7 @@ deliver_input_available_signal (int sig) { handle_on_main_thread (sig, handle_input_available_signal); } -#endif /* SIGIO */ +#endif /* USABLE_SIGIO */ /* Send ourselves a SIGIO. @@ -7280,7 +7232,7 @@ deliver_input_available_signal (int sig) void reinvoke_input_signal (void) { -#ifdef SIGIO +#ifdef USABLE_SIGIO handle_async_input (); #endif } @@ -7354,7 +7306,7 @@ handle_user_signal (int sig) } p->npending++; -#ifdef SIGIO +#ifdef USABLE_SIGIO if (interrupt_input) kill (getpid (), SIGIO); else @@ -11010,7 +10962,7 @@ quit_throw_to_read_char (int from_signal) do_switch_frame (make_lispy_switch_frame (internal_last_event_frame), 0, 0, Qnil); - _longjmp (getcjmp, 1); + sys_longjmp (getcjmp, 1); } DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, @@ -11023,8 +10975,7 @@ See also `current-input-mode'. */) (Lisp_Object interrupt) { int new_interrupt_input; -#ifdef SIGIO -/* Note SIGIO has been undef'd if FIONREAD is missing. */ +#ifdef USABLE_SIGIO #ifdef HAVE_X_WINDOWS if (x_display_list != NULL) { @@ -11035,9 +10986,9 @@ See also `current-input-mode'. */) else #endif /* HAVE_X_WINDOWS */ new_interrupt_input = !NILP (interrupt); -#else /* not SIGIO */ +#else /* not USABLE_SIGIO */ new_interrupt_input = 0; -#endif /* not SIGIO */ +#endif /* not USABLE_SIGIO */ if (new_interrupt_input != interrupt_input) { @@ -11397,9 +11348,7 @@ init_keyboard (void) input_pending = 0; interrupt_input_blocked = 0; interrupt_input_pending = 0; -#ifdef SYNC_INPUT pending_signals = 0; -#endif /* This means that command_loop_1 won't try to select anything the first time through. */ @@ -11431,15 +11380,14 @@ init_keyboard (void) sigaction (SIGQUIT, &action, 0); #endif /* not DOS_NT */ } -/* Note SIGIO has been undef'd if FIONREAD is missing. */ -#ifdef SIGIO +#ifdef USABLE_SIGIO if (!noninteractive) { struct sigaction action; emacs_sigaction_init (&action, deliver_input_available_signal); sigaction (SIGIO, &action, 0); } -#endif /* SIGIO */ +#endif /* Use interrupt input by default, if it works and noninterrupt input has deficiencies. */ diff --git a/src/keymap.c b/src/keymap.c index d79ff89ed67..66fb52061f9 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -40,7 +40,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" diff --git a/src/lisp.h b/src/lisp.h index 41fa274a562..37416dc9464 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -20,6 +20,7 @@ along with GNU Emacs. If not, see . */ #ifndef EMACS_LISP_H #define EMACS_LISP_H +#include #include #include #include @@ -1968,7 +1969,25 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int); static struct Lisp_Kboard_Objfwd ko_fwd; \ defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \ } while (0) + +/* Save and restore the instruction and environment pointers, + without affecting the signal mask. */ +#ifdef HAVE__SETJMP +typedef jmp_buf sys_jmp_buf; +# define sys_setjmp(j) _setjmp (j) +# define sys_longjmp(j, v) _longjmp (j, v) +#elif defined HAVE_SIGSETJMP +typedef sigjmp_buf sys_jmp_buf; +# define sys_setjmp(j) sigsetjmp (j, 0) +# define sys_longjmp(j, v) siglongjmp (j, v) +#else +/* A platform that uses neither _longjmp nor siglongjmp; assume + longjmp does not affect the sigmask. */ +typedef jmp_buf sys_jmp_buf; +# define sys_setjmp(j) setjmp (j) +# define sys_longjmp(j, v) longjmp (j, v) +#endif /* Structure for recording Lisp call stack for backtrace purposes. */ @@ -2061,7 +2080,7 @@ struct catchtag Lisp_Object volatile val; struct catchtag *volatile next; struct gcpro *gcpro; - jmp_buf jmp; + sys_jmp_buf jmp; struct backtrace *backlist; struct handler *handlerlist; EMACS_INT lisp_eval_depth; @@ -2093,22 +2112,16 @@ extern char *stack_bottom; If quit-flag is set to `kill-emacs' the SIGINT handler has received a request to exit Emacs when it is safe to do. */ -#ifdef SYNC_INPUT extern void process_pending_signals (void); extern int pending_signals; -#define ELSE_PENDING_SIGNALS \ - else if (pending_signals) \ - process_pending_signals (); -#else /* not SYNC_INPUT */ -#define ELSE_PENDING_SIGNALS -#endif /* not SYNC_INPUT */ extern void process_quit_flag (void); #define QUIT \ do { \ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ process_quit_flag (); \ - ELSE_PENDING_SIGNALS \ + else if (pending_signals) \ + process_pending_signals (); \ } while (0) @@ -2832,8 +2845,6 @@ extern void memory_warnings (void *, void (*warnfun) (const char *)); /* Defined in alloc.c. */ extern void check_pure_size (void); extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); -extern void reset_malloc_hooks (void); -extern void uninterrupt_malloc (void); extern void malloc_warning (const char *); extern _Noreturn void memory_full (size_t); extern _Noreturn void buffer_memory_full (ptrdiff_t); @@ -3029,7 +3040,6 @@ extern Lisp_Object Qand_rest; extern Lisp_Object Vautoload_queue; extern Lisp_Object Vsignaling_function; extern Lisp_Object inhibit_lisp_code; -extern int handling_signal; #if BYTE_MARK_STACK extern struct catchtag *catchlist; extern struct handler *handlerlist; diff --git a/src/lread.c b/src/lread.c index 08a2e856c00..08d5f97292b 100644 --- a/src/lread.c +++ b/src/lread.c @@ -25,7 +25,6 @@ along with GNU Emacs. If not, see . */ #include #include #include /* For CHAR_BIT. */ -#include #include #include "lisp.h" #include "intervals.h" diff --git a/src/macros.c b/src/macros.c index e81068181b9..a507f12e343 100644 --- a/src/macros.c +++ b/src/macros.c @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "macros.h" #include "commands.h" diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 7b9c67bf135..24ecb2676da 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -482,7 +482,6 @@ WINDOW_H = $(SRC)/window.h \ $(BLD)/alloc.$(O) : \ $(SRC)/alloc.c \ $(SRC)/puresize.h \ - $(SRC)/syssignal.h \ $(SRC)/w32.h \ $(NT_INC)/unistd.h \ $(GNU_LIB)/verify.h \ diff --git a/src/marker.c b/src/marker.c index bfbb161a71d..0c4e8cb3b55 100644 --- a/src/marker.c +++ b/src/marker.c @@ -18,7 +18,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/menu.c b/src/menu.c index bfdc68ca118..7b01d1faefc 100644 --- a/src/menu.c +++ b/src/menu.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include /* for INT_MAX */ #include "lisp.h" diff --git a/src/minibuf.c b/src/minibuf.c index 4ed480a8408..8a1e0ddde86 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "commands.h" diff --git a/src/ns.mk b/src/ns.mk deleted file mode 100644 index 77fbf5845d9..00000000000 --- a/src/ns.mk +++ /dev/null @@ -1,39 +0,0 @@ -### autodeps.mk --- src/Makefile fragment for GNU Emacs - -## Copyright (C) 2008-2012 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 . - -### Commentary: - -## This is inserted in src/Makefile if HAVE_NS. - -## The only reason this is in a separate file is because $ns_appdir, -## which appears as a target, is empty on non-NS builds. Some makes -## do not like empty targets, even if they are never used. - -${ns_appdir}: ${ns_appsrc} - rm -fr ${ns_appdir} - ${MKDIR_P} ${ns_appdir} - ( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; umask 022; tar xf - ) - -${ns_appbindir}/Emacs: emacs${EXEEXT} - ${MKDIR_P} ${ns_appbindir} - cp -f emacs${EXEEXT} ${ns_appbindir}/Emacs - -ns-app: ${ns_appdir} ${ns_appbindir}/Emacs - -### ns.mk ends here diff --git a/src/nsfns.m b/src/nsfns.m index f73086eeee9..072005d2d3d 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -31,7 +31,6 @@ Updated by Christian Limpach (chris@nice.ch) #include #include -#include #include #include "lisp.h" @@ -1797,19 +1796,6 @@ and GNUstep implementations ("distributor-specific release SSDATA (display)); } - /* Register our external input/output types, used for determining - applicable services and also drag/drop eligibility. */ - ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain]; - ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] - retain]; - ns_drag_types = [[NSArray arrayWithObjects: - NSStringPboardType, - NSTabularTextPboardType, - NSFilenamesPboardType, - NSURLPboardType, - NSColorPboardType, - NSFontPboardType, nil] retain]; - return Qnil; } diff --git a/src/nsfont.m b/src/nsfont.m index 1c9976ec6cc..eba1eb04765 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -23,7 +23,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" diff --git a/src/nsimage.m b/src/nsimage.m index 8a8a3ddaae4..668664c7a20 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -28,7 +28,6 @@ Updated by Christian Limpach (chris@nice.ch) /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" diff --git a/src/nsmenu.m b/src/nsmenu.m index d0f3e45e939..907d3eac622 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -24,7 +24,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "window.h" @@ -589,10 +588,7 @@ - (void)menuNeedsUpdate: (NSMenu *)menu From 10.6 on, we could also use -[NSMenu propertiesToUpdate]: In the key press case, NSMenuPropertyItemImage (e.g.) won't be set. */ - if (trackingMenu == 0 - /* Also, don't try this if from an event picked up asynchronously, - as lots of lisp evaluation happens in ns_update_menubar. */ - || handling_signal != 0) + if (trackingMenu == 0) return; /*fprintf (stderr, "Updating menu '%s'\n", [[self title] UTF8String]); NSLog (@"%@\n", event); */ ns_update_menubar (frame, 1, self); diff --git a/src/nsselect.m b/src/nsselect.m index e0bbfe58636..95bc1a95957 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -28,7 +28,6 @@ Updated by Christian Limpach (chris@nice.ch) /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "nsterm.h" diff --git a/src/print.c b/src/print.c index 5643ff06774..6ae33ee23ef 100644 --- a/src/print.c +++ b/src/print.c @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/process.c b/src/process.c index f80b5e80c76..c654369627d 100644 --- a/src/process.c +++ b/src/process.c @@ -25,12 +25,9 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include /* Some typedefs are used in sys/file.h. */ #include #include -#include - #include #include @@ -75,6 +72,11 @@ along with GNU Emacs. If not, see . */ #include #endif +#ifdef USG5_4 +# include +# include +#endif + #ifdef HAVE_RES_INIT #include #include @@ -212,17 +214,13 @@ static EMACS_INT update_tick; "non-destructive" select. So we require either native select, or emulation of select using FIONREAD. */ -#ifdef BROKEN_DATAGRAM_SOCKETS -#undef DATAGRAM_SOCKETS -#else -#ifndef DATAGRAM_SOCKETS -#if defined (HAVE_SELECT) || defined (FIONREAD) -#if defined (HAVE_SENDTO) && defined (HAVE_RECVFROM) && defined (EMSGSIZE) -#define DATAGRAM_SOCKETS -#endif /* HAVE_SENDTO && HAVE_RECVFROM && EMSGSIZE */ -#endif /* HAVE_SELECT || FIONREAD */ -#endif /* DATAGRAM_SOCKETS */ -#endif /* BROKEN_DATAGRAM_SOCKETS */ +#ifndef BROKEN_DATAGRAM_SOCKETS +# if defined HAVE_SELECT || defined USABLE_FIONREAD +# if defined HAVE_SENDTO && defined HAVE_RECVFROM && defined EMSGSIZE +# define DATAGRAM_SOCKETS +# endif +# endif +#endif #if defined HAVE_LOCAL_SOCKETS && defined DATAGRAM_SOCKETS # define HAVE_SEQPACKET @@ -251,7 +249,7 @@ static int process_output_skip; #endif static void create_process (Lisp_Object, char **, Lisp_Object); -#ifdef SIGIO +#ifdef USABLE_SIGIO static int keyboard_bit_set (SELECT_TYPE *); #endif static void deactivate_process (Lisp_Object); @@ -1611,14 +1609,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) #if !defined (WINDOWSNT) && defined (FD_CLOEXEC) int wait_child_setup[2]; #endif +#ifdef SIGCHLD sigset_t blocked, procmask; - struct sigaction sigint_action; - struct sigaction sigquit_action; - struct sigaction sigpipe_action; -#ifdef AIX - struct sigaction sighup_action; #endif - /* Use volatile to protect variables from being clobbered by longjmp. */ + /* Use volatile to protect variables from being clobbered by vfork. */ volatile int forkin, forkout; volatile int pty_flag = 0; @@ -1710,25 +1704,13 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) XPROCESS (process)->pty_flag = pty_flag; pset_status (XPROCESS (process), Qrun); +#ifdef SIGCHLD /* Delay interrupts until we have a chance to store the new fork's pid in its process structure */ sigemptyset (&blocked); -#ifdef SIGCHLD sigaddset (&blocked, SIGCHLD); -#endif -#ifdef HAVE_WORKING_VFORK - /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal', - this sets the parent's signal handlers as well as the child's. - So delay all interrupts whose handlers the child might munge, - and record the current handlers so they can be restored later. */ - sigaddset (&blocked, SIGINT ); sigaction (SIGINT , 0, &sigint_action ); - sigaddset (&blocked, SIGQUIT); sigaction (SIGQUIT, 0, &sigquit_action); - sigaddset (&blocked, SIGPIPE); sigaction (SIGPIPE, 0, &sigpipe_action); -#ifdef AIX - sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action ); -#endif -#endif /* HAVE_WORKING_VFORK */ pthread_sigmask (SIG_BLOCK, &blocked, &procmask); +#endif FD_SET (inchannel, &input_wait_mask); FD_SET (inchannel, &non_keyboard_wait_mask); @@ -1881,8 +1863,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) in the child. */ signal (SIGPIPE, SIG_DFL); +#ifdef SIGCHLD /* Stop blocking signals in the child. */ pthread_sigmask (SIG_SETMASK, &procmask, 0); +#endif if (pty_flag) child_setup_tty (xforkout); @@ -1961,19 +1945,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) #endif } - /* Restore the signal state whether vfork succeeded or not. - (We will signal an error, below, if it failed.) */ -#ifdef HAVE_WORKING_VFORK - /* Restore the parent's signal handlers. */ - sigaction (SIGINT, &sigint_action, 0); - sigaction (SIGQUIT, &sigquit_action, 0); - sigaction (SIGPIPE, &sigpipe_action, 0); -#ifdef AIX - sigaction (SIGHUP, &sighup_action, 0); -#endif -#endif /* HAVE_WORKING_VFORK */ +#ifdef SIGCHLD /* Stop blocking signals in the parent. */ pthread_sigmask (SIG_SETMASK, &procmask, 0); +#endif /* Now generate the error if vfork failed. */ if (pid < 0) @@ -4397,10 +4372,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, Otherwise, do pending quit if requested. */ if (read_kbd >= 0) QUIT; -#ifdef SYNC_INPUT else process_pending_signals (); -#endif /* Exit now if the cell we're waiting for became non-nil. */ if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) @@ -4836,7 +4809,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) break; -#ifdef SIGIO +#ifdef USABLE_SIGIO /* If we think we have keyboard input waiting, but didn't get SIGIO, go read it. This can happen with X on BSD after logging out. In that case, there really is no input and no SIGIO, @@ -5420,7 +5393,7 @@ read_process_output (Lisp_Object proc, register int channel) /* Sending data to subprocess */ -static jmp_buf send_process_frame; +static sys_jmp_buf send_process_frame; static Lisp_Object process_sent_to; static _Noreturn void @@ -5430,7 +5403,7 @@ handle_pipe_signal (int sig) sigemptyset (&unblocked); sigaddset (&unblocked, SIGPIPE); pthread_sigmask (SIG_UNBLOCK, &unblocked, 0); - _longjmp (send_process_frame, 1); + sys_longjmp (send_process_frame, 1); } static void @@ -5639,7 +5612,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2, CFLAGS="-g -O": The value of the parameter `proc' is clobbered when returning with longjmp despite being declared volatile. */ - if (!_setjmp (send_process_frame)) + if (!sys_setjmp (send_process_frame)) { p = XPROCESS (proc); /* Repair any setjmp clobbering. */ process_sent_to = proc; @@ -6853,7 +6826,7 @@ delete_gpm_wait_descriptor (int desc) # endif -# ifdef SIGIO +# ifdef USABLE_SIGIO /* Return nonzero if *MASK has a bit set that corresponds to one of the keyboard input descriptors. */ diff --git a/src/ralloc.c b/src/ralloc.c index 74834333aa3..9a4b1ada229 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -25,7 +25,7 @@ along with GNU Emacs. If not, see . */ #ifdef emacs #include -#include + #include "lisp.h" /* Needed for VALBITS. */ #include "blockinput.h" @@ -1204,9 +1204,15 @@ r_alloc_init (void) UNBLOCK_INPUT; #else #ifndef SYSTEM_MALLOC - /* Give GNU malloc's morecore some hysteresis - so that we move all the relocatable blocks much less often. */ - __malloc_extra_blocks = 64; + /* Give GNU malloc's morecore some hysteresis so that we move all + the relocatable blocks much less often. The number used to be + 64, but alloc.c would override that with 32 in code that was + removed when SYNC_INPUT became the only input handling mode. + That code was conditioned on !DOUG_LEA_MALLOC, so the call to + mallopt above is left unchanged. (Actually, I think there's no + system nowadays that uses DOUG_LEA_MALLOC and also uses + REL_ALLOC.) */ + __malloc_extra_blocks = 32; #endif #endif diff --git a/src/regex.c b/src/regex.c index 472ef727979..17562043df1 100644 --- a/src/regex.c +++ b/src/regex.c @@ -126,7 +126,6 @@ that make sense only in Emacs. */ #ifdef emacs -# include # include "lisp.h" # include "character.h" # include "buffer.h" @@ -1832,9 +1831,9 @@ typedef struct /* The next available element. */ #define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) -/* Explicit quit checking is only used on NTemacs and whenever we - use polling to process input events. */ -#if defined emacs && (defined WINDOWSNT || defined SYNC_INPUT) && defined QUIT +/* Explicit quit checking is needed for Emacs, which uses polling to + process input events. */ +#ifdef emacs extern int immediate_quit; # define IMMEDIATE_QUIT_CHECK \ do { \ diff --git a/src/region-cache.c b/src/region-cache.c index c3eb087aade..832f4bfd214 100644 --- a/src/region-cache.c +++ b/src/region-cache.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/scroll.c b/src/scroll.c index 79dd464b29e..71ce43b2e48 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "termchar.h" #include "dispextern.h" diff --git a/src/search.c b/src/search.c index 72bd5605709..1735ade5d8a 100644 --- a/src/search.c +++ b/src/search.c @@ -20,7 +20,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "syntax.h" #include "category.h" @@ -674,7 +674,7 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end, obstacle --- the last character the dumb search loop should examine. */ ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end) - 1; - ptrdiff_t start_byte = CHAR_TO_BYTE (start); + ptrdiff_t start_byte; ptrdiff_t tem; /* If we're looking for a newline, consult the newline cache @@ -684,18 +684,22 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end, ptrdiff_t next_change; immediate_quit = 0; while (region_cache_forward - (current_buffer, newline_cache, start_byte, &next_change)) - start_byte = next_change; + (current_buffer, newline_cache, start, &next_change)) + start = next_change; immediate_quit = allow_quit; + start_byte = CHAR_TO_BYTE (start); + /* START should never be after END. */ if (start_byte > ceiling_byte) start_byte = ceiling_byte; /* Now the text after start is an unknown region, and next_change is the position of the next known region. */ - ceiling_byte = min (next_change - 1, ceiling_byte); + ceiling_byte = min (CHAR_TO_BYTE (next_change) - 1, ceiling_byte); } + else + start_byte = CHAR_TO_BYTE (start); /* The dumb loop can only scan text stored in contiguous bytes. BUFFER_CEILING_OF returns the last character @@ -747,7 +751,7 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end, { /* The last character to check before the next obstacle. */ ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end); - ptrdiff_t start_byte = CHAR_TO_BYTE (start); + ptrdiff_t start_byte; ptrdiff_t tem; /* Consult the newline cache, if appropriate. */ @@ -756,18 +760,22 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end, ptrdiff_t next_change; immediate_quit = 0; while (region_cache_backward - (current_buffer, newline_cache, start_byte, &next_change)) - start_byte = next_change; + (current_buffer, newline_cache, start, &next_change)) + start = next_change; immediate_quit = allow_quit; + start_byte = CHAR_TO_BYTE (start); + /* Start should never be at or before end. */ if (start_byte <= ceiling_byte) start_byte = ceiling_byte + 1; /* Now the text before start is an unknown region, and next_change is the position of the next known region. */ - ceiling_byte = max (next_change, ceiling_byte); + ceiling_byte = max (CHAR_TO_BYTE (next_change), ceiling_byte); } + else + start_byte = CHAR_TO_BYTE (start); /* Stop scanning before the gap. */ tem = BUFFER_FLOOR_OF (start_byte - 1); diff --git a/src/sheap.c b/src/sheap.c index 3ae14b5daec..f6022ea3ce7 100644 --- a/src/sheap.c +++ b/src/sheap.c @@ -20,7 +20,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include @@ -93,4 +93,3 @@ report_sheap_usage (int die_if_pure_storage_exceeded) bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); message ("%s", buf); } - diff --git a/src/sound.c b/src/sound.c index 5729d704b6a..0ee85312fd3 100644 --- a/src/sound.c +++ b/src/sound.c @@ -44,7 +44,7 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include + #include "lisp.h" #include "dispextern.h" #include "atimer.h" @@ -314,7 +314,7 @@ sound_perror (const char *msg) int saved_errno = errno; turn_on_atimers (1); -#ifdef SIGIO +#ifdef USABLE_SIGIO { sigset_t unblocked; sigemptyset (&unblocked); @@ -732,7 +732,7 @@ static void vox_configure (struct sound_device *sd) { int val; -#ifdef SIGIO +#ifdef USABLE_SIGIO sigset_t blocked; #endif @@ -742,7 +742,7 @@ vox_configure (struct sound_device *sd) interrupted by a signal. Block the ones we know to cause troubles. */ turn_on_atimers (0); -#ifdef SIGIO +#ifdef USABLE_SIGIO sigemptyset (&blocked); sigaddset (&blocked, SIGIO); pthread_sigmask (SIG_BLOCK, &blocked, 0); @@ -778,7 +778,7 @@ vox_configure (struct sound_device *sd) } turn_on_atimers (1); -#ifdef SIGIO +#ifdef USABLE_SIGIO pthread_sigmask (SIG_UNBLOCK, &blocked, 0); #endif } @@ -794,7 +794,7 @@ vox_close (struct sound_device *sd) /* On GNU/Linux, it seems that the device driver doesn't like to be interrupted by a signal. Block the ones we know to cause troubles. */ -#ifdef SIGIO +#ifdef USABLE_SIGIO sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGIO); @@ -806,7 +806,7 @@ vox_close (struct sound_device *sd) ioctl (sd->fd, SNDCTL_DSP_SYNC, NULL); turn_on_atimers (1); -#ifdef SIGIO +#ifdef USABLE_SIGIO pthread_sigmask (SIG_UNBLOCK, &blocked, 0); #endif diff --git a/src/syntax.c b/src/syntax.c index fdd9353bb87..91ef4e66663 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" diff --git a/src/sysdep.c b/src/sysdep.c index 0f16d1a7645..dbfd9efc7d4 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #ifdef HAVE_PWD_H #include #include @@ -107,9 +106,6 @@ extern char *getwd (char *); static int emacs_get_tty (int, struct emacs_tty *); static int emacs_set_tty (int, struct emacs_tty *, int); -#if defined TIOCNOTTY || defined USG5 || defined CYGWIN -static _Noreturn void croak (char *); -#endif /* ULLONG_MAX is missing on Red Hat Linux 7.3; see Bug#11781. */ #ifndef ULLONG_MAX @@ -513,7 +509,7 @@ sys_subshell (void) saved_handlers[0].code = SIGINT; saved_handlers[1].code = SIGQUIT; saved_handlers[2].code = SIGTERM; -#ifdef SIGIO +#ifdef USABLE_SIGIO saved_handlers[3].code = SIGIO; saved_handlers[4].code = 0; #else @@ -642,121 +638,75 @@ restore_signal_handlers (struct save_signal *saved_handlers) } } -#ifndef SIGIO -/* If SIGIO is broken, don't do anything. */ -void -init_sigio (int fd) -{ -} - -static void -reset_sigio (int fd) -{ -} - -void -request_sigio (void) -{ -} - -void -unrequest_sigio (void) -{ -} - -#else -#ifdef F_SETFL - +#ifdef USABLE_SIGIO static int old_fcntl_flags[MAXDESC]; +#endif void init_sigio (int fd) { -#ifdef FASYNC +#ifdef USABLE_SIGIO old_fcntl_flags[fd] = fcntl (fd, F_GETFL, 0) & ~FASYNC; fcntl (fd, F_SETFL, old_fcntl_flags[fd] | FASYNC); -#endif interrupts_deferred = 0; +#endif } static void reset_sigio (int fd) { -#ifdef FASYNC +#ifdef USABLE_SIGIO fcntl (fd, F_SETFL, old_fcntl_flags[fd]); #endif } -#ifdef FASYNC /* F_SETFL does not imply existence of FASYNC */ -/* XXX Uhm, FASYNC is not used anymore here. */ -/* XXX Yeah, but you need it for SIGIO, don't you? */ - void request_sigio (void) { +#ifdef USABLE_SIGIO sigset_t unblocked; if (noninteractive) return; sigemptyset (&unblocked); -#ifdef SIGWINCH +# ifdef SIGWINCH sigaddset (&unblocked, SIGWINCH); -#endif +# endif sigaddset (&unblocked, SIGIO); pthread_sigmask (SIG_UNBLOCK, &unblocked, 0); interrupts_deferred = 0; +#endif } void unrequest_sigio (void) { +#ifdef USABLE_SIGIO sigset_t blocked; if (noninteractive) return; -#if 0 /* XXX What's wrong with blocking SIGIO under X? */ - if (x_display_list) - return; -#endif - sigemptyset (&blocked); -#ifdef SIGWINCH +# ifdef SIGWINCH sigaddset (&blocked, SIGWINCH); -#endif +# endif sigaddset (&blocked, SIGIO); pthread_sigmask (SIG_BLOCK, &blocked, 0); interrupts_deferred = 1; -} - -#else /* no FASYNC */ -#ifndef MSDOS - -void -request_sigio (void) -{ - if (noninteractive || read_socket_hook) - return; - - croak ("request_sigio"); +#endif } void -unrequest_sigio (void) +ignore_sigio (void) { - if (noninteractive || read_socket_hook) - return; - - croak ("unrequest_sigio"); +#ifdef USABLE_SIGIO + signal (SIGIO, SIG_IGN); +#endif } -#endif /* MSDOS */ -#endif /* FASYNC */ -#endif /* F_SETFL */ -#endif /* SIGIO */ - /* Getting and setting emacs_tty structures. */ @@ -1497,27 +1447,21 @@ emacs_sigaction_init (struct sigaction *action, signal_handler_t handler) action->sa_handler = handler; action->sa_flags = 0; #if defined (SA_RESTART) - /* Emacs mostly works better with restartable system services. If this - flag exists, we probably want to turn it on here. - However, on some systems (only hpux11 at present) this resets the - timeout of `select' which means that `select' never finishes if - it keeps getting signals. - We define BROKEN_SA_RESTART on those systems. */ - /* It's not clear why the comment above says "mostly works better". --Stef - When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll + /* SA_RESTART causes interruptible functions with timeouts (e.g., + 'select') to reset their timeout on some platforms (e.g., + HP-UX 11), which is not what we want. Also, when Emacs is + interactive, we don't want SA_RESTART because we need to poll for pending input so we need long-running syscalls to be interrupted after a signal that sets the interrupt_input_pending flag. */ /* Non-interactive keyboard input goes through stdio, where we always want restartable system calls. */ -# if defined (BROKEN_SA_RESTART) || defined (SYNC_INPUT) if (noninteractive) -# endif action->sa_flags = SA_RESTART; #endif } #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD -pthread_t main_thread; +static pthread_t main_thread; #endif /* If we are on the main thread, handle the signal SIG with HANDLER. @@ -1964,11 +1908,9 @@ emacs_write (int fildes, const char *buf, ptrdiff_t nbyte) { if (errno == EINTR) { -#ifdef SYNC_INPUT /* I originally used `QUIT' but that might causes files to be truncated if you hit C-g in the middle of it. --Stef */ process_pending_signals (); -#endif continue; } else @@ -2051,19 +1993,6 @@ getwd (char *pathname) } #endif /* !defined (HAVE_GETWD) || defined (BROKEN_GETWD) */ - -/* - * This function will go away as soon as all the stubs fixed. (fnf) - */ - -void -croak (char *badfunc) -{ - printf ("%s not yet implemented\r\n", badfunc); - reset_all_sys_modes (); - exit (1); -} - #endif /* USG */ /* Directory routines for systems that don't have them. */ diff --git a/src/syssignal.h b/src/syssignal.h index c5529ae718a..e309e6725b7 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -34,27 +34,6 @@ typedef void (*signal_handler_t) (int); extern void emacs_sigaction_init (struct sigaction *, signal_handler_t); -#if ! (defined TIOCNOTTY || defined USG5 || defined CYGWIN) -_Noreturn void croak (char *); -#endif - -/* Interrupt input is not used if there is no FIONREAD. */ -#include -#if defined BROKEN_SIGIO || ! defined FIONREAD || defined BROKEN_FIONREAD -# undef SIGIO -#endif - -/* These are only used by AIX */ -#if defined (SIGPOLL) && defined (BROKEN_SIGPOLL) -#undef SIGPOLL -#endif -#if defined (SIGAIO) && defined (BROKEN_SIGAIO) -#undef SIGAIO -#endif -#if defined (SIGPTY) && defined (BROKEN_SIGPTY) -#undef SIGPTY -#endif - #if NSIG < NSIG_MINIMUM # undef NSIG # define NSIG NSIG_MINIMUM @@ -85,8 +64,4 @@ _Noreturn void croak (char *); char *strsignal (int); #endif -#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD -extern pthread_t main_thread; -#endif - void handle_on_main_thread (int, signal_handler_t); diff --git a/src/systty.h b/src/systty.h index b660441a91e..b7f36c6c259 100644 --- a/src/systty.h +++ b/src/systty.h @@ -17,10 +17,8 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ /* Include the proper files. */ + #ifndef DOS_NT -#ifndef NO_TERMIO -#include -#endif /* not NO_TERMIO */ #include #include #endif /* not DOS_NT */ @@ -38,15 +36,6 @@ along with GNU Emacs. If not, see . */ #include - -/* Special cases - inhibiting the use of certain features. */ - -/* Allow configure to inhibit use of FIONREAD. */ -#ifdef BROKEN_FIONREAD -#undef FIONREAD -#undef ASYNC -#endif - /* Try to establish the correct character to disable terminal functions in a system-independent manner. Note that USG (at least) define diff --git a/src/term.c b/src/term.c index 0eaf76a13df..f4117d67dec 100644 --- a/src/term.c +++ b/src/term.c @@ -25,7 +25,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "termchar.h" @@ -2944,8 +2943,7 @@ dissociate_if_controlling_tty (int fd) emacs_close (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); #else - /* Unknown system. */ - croak (); +# error "Unknown system." #endif /* ! TIOCNOTTY */ #endif /* ! USG */ } diff --git a/src/termcap.c b/src/termcap.c index d1b05e8df94..e494cd113d9 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -19,7 +19,6 @@ Boston, MA 02110-1301, USA. */ /* Emacs config.h may rename various library functions such as malloc. */ #include -#include #include #include #include diff --git a/src/terminal.c b/src/terminal.c index c51a18dfa61..719c2a36111 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #define TERMHOOKS_INLINE EXTERN_INLINE #include -#include #include "lisp.h" #include "frame.h" diff --git a/src/terminfo.c b/src/terminfo.c index ca2d89a000b..124c452a4a9 100644 --- a/src/terminfo.c +++ b/src/terminfo.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include #include "tparam.h" -#include #include "lisp.h" /* Define these variables that serve as global parameters to termcap, diff --git a/src/textprop.c b/src/textprop.c index 2a9efba1c45..872912ea706 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "intervals.h" #include "character.h" diff --git a/src/tparam.c b/src/tparam.c index 58a825c90d7..164f61d471b 100644 --- a/src/tparam.c +++ b/src/tparam.c @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ /* Emacs config.h may rename various library functions such as malloc. */ #include -#include + #include "lisp.h" /* for xmalloc */ #include "tparam.h" diff --git a/src/undo.c b/src/undo.c index 9cd1d5f9f67..e878ef4dcf9 100644 --- a/src/undo.c +++ b/src/undo.c @@ -18,7 +18,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/unexaix.c b/src/unexaix.c index c09156296f7..c01a22a79f6 100644 --- a/src/unexaix.c +++ b/src/unexaix.c @@ -89,7 +89,6 @@ static int adjust_lnnoptrs (int, int, const char *); static int pagemask; -#include #include "lisp.h" static void diff --git a/src/unexcoff.c b/src/unexcoff.c index e83042a379d..966dd58cb6e 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c @@ -120,7 +120,6 @@ static int pagemask; #define ADDR_CORRECT(x) ((char *)(x) - (char*)0) -#include #include "lisp.h" static void diff --git a/src/unexcw.c b/src/unexcw.c index eae534cf4dd..96c4b4a9aec 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include "unexec.h" -#include #include #include #include diff --git a/src/unexsol.c b/src/unexsol.c index 336f3b4faea..470206d5838 100644 --- a/src/unexsol.c +++ b/src/unexsol.c @@ -4,7 +4,6 @@ #include "unexec.h" #include -#include #include "lisp.h" #include "character.h" diff --git a/src/vm-limit.c b/src/vm-limit.c index cf697b56fdf..8de0acd1bb2 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include -#include #include /* for 'environ', on AIX */ #include "lisp.h" #include "mem-limits.h" diff --git a/src/w16select.c b/src/w16select.c index 2026de7421d..a3f6f1fb9ae 100644 --- a/src/w16select.c +++ b/src/w16select.c @@ -31,7 +31,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "dispextern.h" /* frame.h seems to want this */ #include "frame.h" /* Need this to get the X window of selected_frame */ diff --git a/src/w32.c b/src/w32.c index 04f7471577c..bcb0511e2fa 100644 --- a/src/w32.c +++ b/src/w32.c @@ -33,7 +33,6 @@ along with GNU Emacs. If not, see . */ #include #include /* for _mbspbrk */ #include -#include #include /* must include CRT headers *before* config.h */ diff --git a/src/w32console.c b/src/w32console.c index 76585851e7f..b22b09af2f2 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/w32fns.c b/src/w32fns.c index ec1acbd89d9..be008bb18c8 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "w32term.h" diff --git a/src/w32font.c b/src/w32font.c index 8b3a0e4312e..833b7cdfb25 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "w32term.h" diff --git a/src/w32heap.c b/src/w32heap.c index 26cc9aa0a0f..dc65198f90b 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "w32heap.h" #include "lisp.h" /* for VALMASK */ diff --git a/src/w32inevt.c b/src/w32inevt.c index 731dd6715dc..ee07db5335b 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -25,7 +25,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifndef MOUSE_MOVED #define MOUSE_MOVED 1 diff --git a/src/w32menu.c b/src/w32menu.c index d4de73a0de7..fa7db64f147 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "keyboard.h" diff --git a/src/w32proc.c b/src/w32proc.c index 74427e76a4f..26a0925ad87 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -28,7 +28,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include /* must include CRT headers *before* config.h */ #include diff --git a/src/w32reg.c b/src/w32reg.c index 9c727ae5ab7..8a6a3c853b1 100644 --- a/src/w32reg.c +++ b/src/w32reg.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ /* Written by Kevin Gallo */ #include -#include #include "lisp.h" #include "w32term.h" #include "blockinput.h" diff --git a/src/w32select.c b/src/w32select.c index 3fb88d4f17f..11c68c9c617 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -73,7 +73,6 @@ along with GNU Emacs. If not, see . */ */ #include -#include #include "lisp.h" #include "w32term.h" /* for all of the w32 includes */ #include "w32heap.h" /* os_subtype */ diff --git a/src/w32term.c b/src/w32term.c index 28c1c593cf6..6244728b264 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "blockinput.h" #include "w32term.h" @@ -4163,6 +4162,7 @@ w32_read_socket (struct terminal *terminal, int expected, if (interrupt_input_blocked) { interrupt_input_pending = 1; + pending_signals = 1; return -1; } diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index cf99d14dc77..5d160b9d42f 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -27,7 +27,6 @@ along with GNU Emacs. If not, see . */ #define _WIN32_WINNT 0x500 #include #include -#include #include "lisp.h" #include "w32term.h" diff --git a/src/w32xfns.c b/src/w32xfns.c index 820dbcc76c6..33f40fc7c01 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "keyboard.h" #include "frame.h" diff --git a/src/widget.c b/src/widget.c index 0100acc8143..fd5ad167125 100644 --- a/src/widget.c +++ b/src/widget.c @@ -30,7 +30,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "xterm.h" diff --git a/src/window.c b/src/window.c index cf296a707e3..2589596ccfd 100644 --- a/src/window.c +++ b/src/window.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #define WINDOW_INLINE EXTERN_INLINE #include -#include #include "lisp.h" #include "character.h" @@ -1857,23 +1856,23 @@ return value is a list of elements of the form (PARAMETER . VALUE). */) DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, 2, 2, 0, doc: /* Return WINDOW's value for PARAMETER. -WINDOW must be a valid window and defaults to the selected one. */) +WINDOW can be any window and defaults to the selected one. */) (Lisp_Object window, Lisp_Object parameter) { Lisp_Object result; - result = Fassq (parameter, decode_valid_window (window)->window_parameters); + result = Fassq (parameter, decode_any_window (window)->window_parameters); return CDR_SAFE (result); } DEFUN ("set-window-parameter", Fset_window_parameter, Sset_window_parameter, 3, 3, 0, doc: /* Set WINDOW's value of PARAMETER to VALUE. -WINDOW must be a valid window and defaults to the selected one. +WINDOW can be any window and defaults to the selected one. Return VALUE. */) (Lisp_Object window, Lisp_Object parameter, Lisp_Object value) { - register struct window *w = decode_valid_window (window); + register struct window *w = decode_any_window (window); Lisp_Object old_alist_elt; old_alist_elt = Fassq (parameter, w->window_parameters); @@ -2659,7 +2658,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame /* Check for a window that has a killed buffer. */ case CHECK_ALL_WINDOWS: if (! NILP (w->buffer) - && NILP (BVAR (XBUFFER (w->buffer), name))) + && !BUFFER_LIVE_P (XBUFFER (w->buffer))) emacs_abort (); break; @@ -3264,7 +3263,7 @@ This function runs `window-scroll-functions' before running XSETWINDOW (window, w); buffer = Fget_buffer (buffer_or_name); CHECK_BUFFER (buffer); - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) error ("Attempt to display deleted buffer"); tem = w->buffer; @@ -3329,7 +3328,7 @@ displaying that buffer. */) if (STRINGP (object)) object = Fget_buffer (object); - if (BUFFERP (object) && !NILP (BVAR (XBUFFER (object), name))) + if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) { /* Walk all windows looking for buffer, and force update of each of those windows. */ @@ -5543,7 +5542,7 @@ the return value is nil. Otherwise the value is t. */) saved_windows = XVECTOR (data->saved_windows); new_current_buffer = data->current_buffer; - if (NILP (BVAR (XBUFFER (new_current_buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (new_current_buffer))) new_current_buffer = Qnil; else { @@ -5618,7 +5617,7 @@ the return value is nil. Otherwise the value is t. */) w = XWINDOW (window); if (!NILP (w->buffer) && !EQ (w->buffer, p->buffer) - && !NILP (BVAR (XBUFFER (p->buffer), name))) + && BUFFER_LIVE_P (XBUFFER (p->buffer))) /* If a window we restore gets another buffer, record the window's old buffer. */ call1 (Qrecord_window_buffer, window); @@ -5768,7 +5767,7 @@ the return value is nil. Otherwise the value is t. */) if (NILP (p->buffer)) /* An internal window. */ wset_buffer (w, p->buffer); - else if (!NILP (BVAR (XBUFFER (p->buffer), name))) + else if (BUFFER_LIVE_P (XBUFFER (p->buffer))) /* If saved buffer is alive, install it. */ { wset_buffer (w, p->buffer); @@ -5787,7 +5786,7 @@ the return value is nil. Otherwise the value is t. */) Fgoto_char (w->pointm); } else if (!NILP (w->buffer) - && !NILP (BVAR (XBUFFER (w->buffer), name))) + && BUFFER_LIVE_P (XBUFFER (w->buffer))) /* Keep window's old buffer; make sure the markers are real. */ { diff --git a/src/xdisp.c b/src/xdisp.c index 3536e04fe8d..ef36cf5c867 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -273,7 +273,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "keyboard.h" @@ -3671,7 +3670,7 @@ handle_fontified_prop (struct it *it) } /* There isn't much we can reasonably do to protect against misbehaving fontification, but here's a fig leaf. */ - else if (!NILP (BVAR (obuf, name))) + else if (BUFFER_LIVE_P (obuf)) set_buffer_internal_1 (obuf); /* The fontification code may have added/removed text. @@ -9345,12 +9344,6 @@ add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2) struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; USE_SAFE_ALLOCA; - /* Do nothing if called asynchronously. Inserting text into - a buffer may call after-change-functions and alike and - that would means running Lisp asynchronously. */ - if (handling_signal) - return; - fmt = msg = Qnil; GCPRO4 (fmt, msg, arg1, arg2); @@ -9963,7 +9956,7 @@ ensure_echo_area_buffers (void) for (i = 0; i < 2; ++i) if (!BUFFERP (echo_buffer[i]) - || NILP (BVAR (XBUFFER (echo_buffer[i]), name))) + || !BUFFER_LIVE_P (XBUFFER (echo_buffer[i]))) { char name[30]; Lisp_Object old_buffer; @@ -21144,8 +21137,7 @@ are the selected window and the WINDOW's buffer). */) : EQ (face, Qtool_bar) ? TOOL_BAR_FACE_ID : DEFAULT_FACE_ID; - if (XBUFFER (buffer) != current_buffer) - old_buffer = current_buffer; + old_buffer = current_buffer; /* Save things including mode_line_proptrans_alist, and set that to nil so that we don't alter the outer value. */ @@ -21156,8 +21148,7 @@ are the selected window and the WINDOW's buffer). */) mode_line_proptrans_alist = Qnil; Fselect_window (window, Qt); - if (old_buffer) - set_buffer_internal_1 (XBUFFER (buffer)); + set_buffer_internal_1 (XBUFFER (buffer)); init_iterator (&it, w, -1, -1, NULL, face_id); @@ -23167,7 +23158,8 @@ right_overwritten (struct glyph_string *s) { int x = 0, i; struct glyph *glyphs = s->row->glyphs[s->area]; - int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars); + int first = (s->first_glyph - glyphs + + (s->first_glyph->type == COMPOSITE_GLYPH ? 1 : s->nchars)); int end = s->row->used[s->area]; for (i = first; i < end && s->right_overhang > x; ++i) @@ -23190,7 +23182,8 @@ right_overwriting (struct glyph_string *s) int i, k, x; int end = s->row->used[s->area]; struct glyph *glyphs = s->row->glyphs[s->area]; - int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars); + int first = (s->first_glyph - glyphs + + (s->first_glyph->type == COMPOSITE_GLYPH ? 1 : s->nchars)); k = -1; x = 0; diff --git a/src/xfaces.c b/src/xfaces.c index c113c1a37b7..c240a05c6c0 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -204,7 +204,6 @@ along with GNU Emacs. If not, see . */ #include #include #include /* This needs to be before termchar.h */ -#include #include "lisp.h" #include "character.h" diff --git a/src/xfns.c b/src/xfns.c index 90b54d12345..8304a3df04f 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include /* This makes the fields of a Display accessible, in Xlib header files. */ diff --git a/src/xfont.c b/src/xfont.c index 7755b780815..1f2fd13f1b7 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" diff --git a/src/xftfont.c b/src/xftfont.c index 404b9124099..9f52eb8b233 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include diff --git a/src/xgselect.c b/src/xgselect.c index 5f4c7edfb79..c161564a322 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -19,14 +19,12 @@ along with GNU Emacs. If not, see . */ #include -#include #include "xgselect.h" #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) #include #include -#include #include "xterm.h" int diff --git a/src/xmenu.c b/src/xmenu.c index 605db13e149..d03a4bc974b 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -33,7 +33,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "keyboard.h" diff --git a/src/xml.c b/src/xml.c index 7bc6130b8b1..b668525cf26 100644 --- a/src/xml.c +++ b/src/xml.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_LIBXML2 -#include #include #include #include diff --git a/src/xrdb.c b/src/xrdb.c index 624bafa5e92..73672c9617c 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" diff --git a/src/xselect.c b/src/xselect.c index 5a3b7452c6d..ab199e0b9b9 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include #include /* termhooks.h needs this */ -#include #ifdef HAVE_SYS_TYPES_H #include diff --git a/src/xsettings.c b/src/xsettings.c index a28d75d9422..58c84495489 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" #include "xterm.h" @@ -711,12 +710,12 @@ apply_xft_settings (struct x_display_info *dpyinfo, if (send_event_p) store_config_changed_event (Qfont_render, XCAR (dpyinfo->name_list_element)); - Vxft_settings + Vxft_settings = make_formatted_string (buf, format, oldsettings.aa, oldsettings.hinting, oldsettings.rgba, oldsettings.lcdfilter, oldsettings.hintstyle, oldsettings.dpi); - + } else FcPatternDestroy (pat); diff --git a/src/xsmfns.c b/src/xsmfns.c index cddbb2aae86..8067899f931 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -29,7 +29,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "systime.h" diff --git a/src/xterm.c b/src/xterm.c index 8a702800c38..5bc87d0ec64 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #ifdef HAVE_X_WINDOWS @@ -47,7 +46,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include /* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */ /* #include */ @@ -7140,25 +7138,17 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold if (interrupt_input_blocked) { interrupt_input_pending = 1; -#ifdef SYNC_INPUT pending_signals = 1; -#endif return -1; } interrupt_input_pending = 0; -#ifdef SYNC_INPUT pending_signals = pending_atimers; -#endif BLOCK_INPUT; /* So people can tell when we have read the available input. */ input_signal_count++; -#ifndef SYNC_INPUT - ++handling_signal; -#endif - /* For debugging, this gives a way to fake an I/O error. */ if (terminal->display_info.x == XTread_socket_fake_io_error) { @@ -7247,9 +7237,6 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold pending_autoraise_frame = 0; } -#ifndef SYNC_INPUT - --handling_signal; -#endif UNBLOCK_INPUT; return count; @@ -7804,7 +7791,6 @@ x_connection_closed (Display *dpy, const char *error_message) error_msg = alloca (strlen (error_message) + 1); strcpy (error_msg, error_message); - handling_signal = 0; /* Inhibit redisplay while frames are being deleted. */ specbind (Qinhibit_redisplay, Qt); @@ -7892,7 +7878,7 @@ For details, see etc/PROBLEMS.\n", { sigset_t unblocked; sigemptyset (&unblocked); -#ifdef SIGIO +#ifdef USABLE_SIGIO sigaddset (&unblocked, SIGIO); #endif sigaddset (&unblocked, SIGALRM); @@ -10439,10 +10425,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) fcntl (connection, F_SETOWN, getpid ()); #endif /* ! defined (F_SETOWN) */ -#ifdef SIGIO if (interrupt_input) init_sigio (connection); -#endif /* ! defined (SIGIO) */ #ifdef USE_LUCID {