commit 30c09955f64815201ae9b86215fed8ea2af0ba66 (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Sat Feb 2 10:16:45 2019 +0100 Fix window splitting behavior of 'display-buffer-at-bottom' * lisp/window.el (display-buffer-at-bottom): Never split an arbitrary bottom window. Try to split the frame's main window instead (Bug#33870). diff --git a/lisp/window.el b/lisp/window.el index 424d0525f4..19f84696e0 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7559,10 +7559,6 @@ selected frame." nil nil 'nomini) (or (and bottom-window-shows-buffer (window--display-buffer buffer bottom-window 'reuse alist)) - (and (not (frame-parameter nil 'unsplittable)) - (let (split-height-threshold) - (setq window (window--try-to-split-window bottom-window alist))) - (window--display-buffer buffer window 'window alist)) (and (not (frame-parameter nil 'unsplittable)) (setq window (split-window-no-error (window-main-window))) (window--display-buffer buffer window 'window alist)) commit dc1d2d3c22ab91b8b52188574680a028851fbda8 Author: Martin Rudalics Date: Sat Feb 2 09:43:34 2019 +0100 Fix bugs caused by running window change functions during redisplay * src/xdisp.c (redisplay_internal): Run window change functions before updating the display so changes induced by these functions can get caught by redisplay (Bug#34138). * src/window.c (run_window_change_functions): Bind Qinhibit_redisplay to avoid that the minibuffer window gets resized while running window change functions (Bug#34179, Bug#34260). diff --git a/src/window.c b/src/window.c index 1b474a663a..49d7fc2426 100644 --- a/src/window.c +++ b/src/window.c @@ -3710,6 +3710,7 @@ run_window_change_functions (void) ptrdiff_t count_outer = SPECPDL_INDEX (); record_unwind_protect_void (window_change_record); + specbind (Qinhibit_redisplay, Qt); FOR_EACH_FRAME (tail, frame) { diff --git a/src/xdisp.c b/src/xdisp.c index ec8dd86230..b5034b513e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -14153,6 +14153,9 @@ redisplay_internal (void) clear_garbaged_frames (); } + if (!NILP (Vrun_hooks)) + run_window_change_functions (); + if (windows_or_buffers_changed && !update_mode_lines) /* Code that sets windows_or_buffers_changed doesn't distinguish whether only the windows's contents needs to be refreshed, or whether the @@ -14332,18 +14335,6 @@ redisplay_internal (void) && (w = XWINDOW (selected_window)) != sw) goto retry; - if (!NILP (Vrun_hooks)) - { - run_window_change_functions (); - - /* If windows or buffers changed or selected_window - changed, redisplay again. */ - if ((windows_or_buffers_changed) - || (WINDOWP (selected_window) - && (w = XWINDOW (selected_window)) != sw)) - goto retry; - } - /* We used to always goto end_of_redisplay here, but this isn't enough if we have a blinking cursor. */ if (w->cursor_off_p == w->last_cursor_off_p) @@ -14707,18 +14698,6 @@ redisplay_internal (void) && (w = XWINDOW (selected_window)) != sw)) goto retry; - if (!NILP (Vrun_hooks)) - { - run_window_change_functions (); - - /* If windows or buffers changed or selected_window changed, - redisplay again. */ - if ((windows_or_buffers_changed) - || (WINDOWP (selected_window) - && (w = XWINDOW (selected_window)) != sw)) - goto retry; - } - /* Clear the face and image caches. We used to do this only if consider_all_windows_p. But the cache commit c0052dd43dc1c4a7a68e6b26edf6cd30d926373a Author: Glenn Morris Date: Fri Feb 1 17:59:15 2019 -0800 * .gitignore: Add MANIFEST. diff --git a/.gitignore b/.gitignore index 53f41f0f3e..81d3adfb57 100644 --- a/.gitignore +++ b/.gitignore @@ -262,6 +262,9 @@ ChangeLog # Built by 'make install'. etc/emacs.tmpdesktop +# Built by 'make-dist'. +/MANIFEST + # Distribution directories. /emacs-[1-9]*/ commit 4bce79d2a3c06898c7ba2bebb43493008f631a15 Author: Glenn Morris Date: Fri Feb 1 17:56:25 2019 -0800 * make-dist: Avoid "Bad fd number" error with dash. diff --git a/make-dist b/make-dist index d5373be50e..ef35c87c35 100755 --- a/make-dist +++ b/make-dist @@ -496,7 +496,7 @@ if [ "${make_tar}" = yes ]; then case $default_gzip in cat) tar $taropt -cf - $emacsname;; *) if tar $taropt -cf /dev/null --use-compress-program="$default_gzip" \ - $emacsname/src/lisp.h >& /dev/null + $emacsname/src/lisp.h > /dev/null 2>&1 then tar $taropt -cf - --use-compress-program="$default_gzip" $emacsname else commit f31c83cba790cb58699e894f0c8ad46d314ff868 Author: Glenn Morris Date: Fri Feb 1 17:50:59 2019 -0800 * make-dist: Remove references to src/stamp-h.in. This file was removed two years ago in 2f89350. diff --git a/make-dist b/make-dist index a56b7341fe..d5373be50e 100755 --- a/make-dist +++ b/make-dist @@ -339,10 +339,6 @@ if [ $update = yes ]; then echo "Running autoreconf" autoreconf -i -I m4 || { x=$?; echo Autoreconf FAILED! >&2; exit $x; } - ## Make sure src/stamp-h.in is newer than configure.ac. - rm -f src/stamp-h.in - echo timestamp > src/stamp-h.in - if [ "$make_info" = yes ] ; then echo "Updating Info files" make info @@ -371,7 +367,7 @@ possibly_non_vc_files=" MANIFEST aclocal.m4 configure admin/charsets/jisx2131-filter src/config.in src/dmpstruct.h src/emacs-module.h - src/fingerprint.c src/stamp-h.in + src/fingerprint.c "$( find admin doc etc lisp \ \( -name '*.el' -o -name '*.elc' -o -name '*.map' -o -name '*.stamp' \ commit cdcdb11017342da2bf1f1cb360a8ef597f89b4dd Author: Glenn Morris Date: Fri Feb 1 17:36:32 2019 -0800 * make-dist: Fix --no-update with no pre-existing MANIFEST. diff --git a/make-dist b/make-dist index 62e47b4d14..a56b7341fe 100755 --- a/make-dist +++ b/make-dist @@ -389,7 +389,7 @@ fi # 'git ls-files' later (e.g., after extraction from a tarball). # Otherwise, rely on the existing MANIFEST, which should be maintained some # other way when adding or deleting a distributed file while not using Git. -if [ $update = yes ] && [ -r .git ]; then +if ( [ $update = yes ] || [ ! -f MANIFEST ] ) && [ -r .git ]; then echo "Updating MANIFEST" if [ $with_tests = yes ]; then git ls-files >MANIFEST commit d53ff31bf12b3dca83caf20c7360bb92822cb151 Author: Paul Eggert Date: Fri Feb 1 17:07:13 2019 -0800 Restore SETFATTR substitution * configure.ac (SETFATTR): Restore the AC_SUBST of this that was inadvertently removed when pdumper support was added. Need for ./configure --with-dumping=unexec on Fedora 29. diff --git a/configure.ac b/configure.ac index 53e2ef35c7..0259c82258 100644 --- a/configure.ac +++ b/configure.ac @@ -1351,6 +1351,7 @@ if test $with_unexec = yes && test $opsys = gnu-linux; then fi AC_SUBST([PAXCTL_dumped]) AC_SUBST([PAXCTL_notdumped]) +AC_SUBST([SETFATTR]) # Makeinfo on macOS is ancient, check whether there is a more recent # version installed by Homebrew. commit 38fb5f4d22a5d69621a8b42bf39258af0919b456 Author: Paul Eggert Date: Fri Feb 1 15:17:48 2019 -0800 Make make-dist more automatic Simplify make-dist maintenance by having it generate its list of files more automatically. Put the list of distributed files into a file MANIFEST that can be used in the unusual situations when you’re making a distribution without having access to a Git repository. * make-dist (top_level_ChangeLog): Now nonempty if the distribution tarball will contain a ChangeLog, instead of being nonempty when a ChangeLog is requested, Git is present and a readable ChangeLog exists. The new interpretation makes the script a bit easier to follow. (possibly_non_vc_files, info_files, mkdir_verbose) (file_to_skip, MANIFEST_subdir_sed, tempsubdirs): New variables. (MANIFEST): Update and use this file, which now records what files are distributed. (top_level, subdir, files, file): Remove. diff --git a/make-dist b/make-dist index 20be62da1f..62e47b4d14 100755 --- a/make-dist +++ b/make-dist @@ -358,6 +358,50 @@ if [ $update = yes ]; then $EMACS -batch -f batch-byte-recompile-directory lisp fi # $update = yes +if [ "$changelog" = yes ] && [ -r .git ]; then + top_level_ChangeLog=ChangeLog +else + top_level_ChangeLog= +fi + +# Files to distribute that might not be under version control. +# Don't distribute site-init.el, site-load.el, or default.el. +possibly_non_vc_files=" + $top_level_ChangeLog + MANIFEST aclocal.m4 configure + admin/charsets/jisx2131-filter + src/config.in src/dmpstruct.h src/emacs-module.h + src/fingerprint.c src/stamp-h.in +"$( + find admin doc etc lisp \ + \( -name '*.el' -o -name '*.elc' -o -name '*.map' -o -name '*.stamp' \ + -o -name '*.texi' -o -name '*.tex' -o -name '*.txt' \) \ + ! -name 'site-init*' ! -name 'site-load*' ! -name 'default*' +) || exit + +if [ $with_info = yes ]; then + info_files="info/dir $(echo info/*.info)" || exit +else + info_files= +fi + +# If Git is in use update the file MANIFEST, which can substitute for +# 'git ls-files' later (e.g., after extraction from a tarball). +# Otherwise, rely on the existing MANIFEST, which should be maintained some +# other way when adding or deleting a distributed file while not using Git. +if [ $update = yes ] && [ -r .git ]; then + echo "Updating MANIFEST" + if [ $with_tests = yes ]; then + git ls-files >MANIFEST + else + git ls-files | grep -v '^test' >MANIFEST + fi || exit + printf '%s\n' $possibly_non_vc_files $info_files >>MANIFEST || exit + sort -u -o MANIFEST MANIFEST || exit +fi + +/dev/null 2>&1; then + mkdir_verbose='mkdir --verbose' +else + mkdir $tempdir || exit + mkdir_verbose=mkdir +fi + +# file_to_skip is normally empty to link every file, +# but it can be 'ChangeLog' if we do not want to link the +# top-level ChangeLog. +file_to_skip= -top_level_ChangeLog= if [ "$changelog" = yes ]; then if test -r .git; then ## When making a release or pretest the ChangeLog should already ## have been created and edited as needed. Don't ignore it. - if test -r ChangeLog; then + if [ -r ChangeLog ] && [ ! -L ChangeLog ]; then echo "Using existing top-level ChangeLog" - top_level_ChangeLog=ChangeLog else echo "Making top-level ChangeLog" make ChangeLog CHANGELOG=${tempdir}/ChangeLog || \ { x=$?; echo "make ChangeLog FAILED (try --no-changelog?)" >&2; exit $x; } + file_to_skip=ChangeLog fi else echo "No repository, so omitting top-level ChangeLog" fi fi -### We copy in the top-level files before creating the subdirectories in -### hopes that this will make the top-level files appear first in the -### tar file; this means that people can start reading the INSTALL and -### README while the rest of the tar file is still unpacking. Whoopee. -echo "Making links to top-level files" -top_level=' - INSTALL README BUGS - ChangeLog.*[0-9] Makefile.in autogen.sh configure configure.ac - config.bat make-dist .dir-locals.el - aclocal.m4 CONTRIBUTE -' -ln $top_level $top_level_ChangeLog $tempdir || exit - echo "Creating subdirectories" -for subdir in site-lisp \ - leim leim/CXTERM-DIC leim/MISC-DIC leim/SKK-DIC \ - build-aux \ - src src/bitmaps lib lib-src oldXMenu lwlib \ - nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \ - `find etc lisp admin test -type d` \ - doc doc/emacs doc/misc doc/man doc/lispref doc/lispintro \ - info m4 modules msdos \ - nextstep nextstep/templates \ - nextstep/Cocoa nextstep/Cocoa/Emacs.base \ - nextstep/Cocoa/Emacs.base/Contents \ - nextstep/Cocoa/Emacs.base/Contents/Resources \ - nextstep/GNUstep \ - nextstep/GNUstep/Emacs.base \ - nextstep/GNUstep/Emacs.base/Resources -do - - if [ "$with_tests" != "yes" ]; then - case $subdir in - test*) continue ;; - esac - fi - - ## site-lisp for in-place installs (?). - [ "$subdir" = "site-lisp" ] || [ -d "$subdir" ] || \ - echo "WARNING: $subdir not found, making anyway" - [ "$verbose" = "yes" ] && echo " ${tempdir}/${subdir}" - mkdir ${tempdir}/${subdir} || exit -done - -echo "Making links to 'lisp' and its subdirectories" -files=`find lisp \( -name '*.el' -o -name '*.elc' -o -name 'ChangeLog*' \ - -o -name 'README' \)` || exit - -### Don't distribute site-init.el, site-load.el, or default.el. -for file in lisp/Makefile.in $files; do - case $file in - */site-init*|*/site-load*|*/default*) continue ;; - esac - ln $file $tempdir/$file || exit -done - -echo "Making links to 'leim' and its subdirectories" -(cd leim && - ln ChangeLog.*[0-9] README ../${tempdir}/leim && - ln CXTERM-DIC/README CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC && - ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC && - ln MISC-DIC/README MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC && - ln Makefile.in ../${tempdir}/leim/Makefile.in && - ln leim-ext.el ../${tempdir}/leim/leim-ext.el && -:) || exit - -## FIXME Can we not just use the "find -type f" method for this one? -echo "Making links to 'build-aux'" -(cd build-aux && - ln config.guess config.sub msys-to-w32 ../${tempdir}/build-aux && - ln gitlog-to-changelog gitlog-to-emacslog ../${tempdir}/build-aux && - ln install-sh move-if-change ../${tempdir}/build-aux && - ln update-copyright update-subdirs ../${tempdir}/build-aux && - ln dir_top make-info-dir ../${tempdir}/build-aux && -:) || exit - -echo "Making links to 'src'" -### Don't distribute the configured versions of -### config.in, paths.in, buildobj.h, or Makefile.in. -(cd src && - ln [a-zA-Z]*.[chm] ../${tempdir}/src && - ln [a-zA-Z]*.in ../${tempdir}/src && - ln deps.mk dmpstruct.awk ../${tempdir}/src && - ln README ChangeLog.*[0-9] ../${tempdir}/src && - ln .gdbinit .dbxinit ../${tempdir}/src && - cd ../${tempdir}/src && - rm -f globals.h config.h epaths.h Makefile buildobj.h && -:) || exit - -echo "Making links to 'src/bitmaps'" -(cd src/bitmaps && - ln README *.xbm ../../${tempdir}/src/bitmaps && -:) || exit - -echo "Making links to 'lib'" -(cd lib && - ln [a-zA-Z_]*.[ch] ../${tempdir}/lib && - ln gnulib.mk.in Makefile.in ../${tempdir}/lib && - cd ../${tempdir}/lib && - script='/[*]/d; s/\.in\.h$/.h/' && - rm -f `ls *.in.h | sed "$script"` && -:) || exit - -echo "Making links to 'lib-src'" -(cd lib-src && - ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src && - ln ChangeLog.*[0-9] Makefile.in README ../${tempdir}/lib-src && - ln rcs2log ../${tempdir}/lib-src && -:) || exit - -echo "Making links to 'm4'" -(cd m4 && - ln *.m4 ../${tempdir}/m4 && -:) || exit - -echo "Making links to 'modules'" -(cd modules && - ln *.py ../${tempdir}/modules && -:) || exit - -echo "Making links to 'nt'" -(cd nt && - ln emacs-x86.manifest emacs-x64.manifest ../${tempdir}/nt && - ln [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt && - ln *.in gnulib-cfg.mk ../${tempdir}/nt && - ln mingw-cfg.site epaths.nt INSTALL.W64 ../${tempdir}/nt && - ln ChangeLog.*[0-9] INSTALL README README.W32 ../${tempdir}/nt && -:) || exit - -echo "Making links to 'nt/inc' and its subdirectories" -for f in `find nt/inc -type f -name '[a-z]*.h'`; do - ln $f $tempdir/$f || exit -done - -echo "Making links to 'nt/icons'" -(cd nt/icons && - ln README [a-z]*.ico ../../${tempdir}/nt/icons && - ln [a-z]*.cur ../../${tempdir}/nt/icons && -:) || exit - -echo "Making links to 'msdos'" -(cd msdos && - ln ChangeLog.*[0-9] INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos && - ln depfiles.bat inttypes.h ../${tempdir}/msdos && - ln mainmake.v2 sed*.inp ../${tempdir}/msdos && -:) || exit - -echo "Making links to 'nextstep'" -(cd nextstep && - ln ChangeLog.*[0-9] README INSTALL Makefile.in ../${tempdir}/nextstep && -:) || exit - -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 && -:) || exit - -echo "Making links to 'nextstep/Cocoa/Emacs.base/Contents'" -(cd nextstep/Cocoa/Emacs.base/Contents && - ln PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents && -:) || exit - -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 && -:) || exit - -echo "Making links to 'nextstep/GNUstep/Emacs.base/Resources'" -(cd nextstep/GNUstep/Emacs.base/Resources && - ln README emacs.tiff \ - ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources && -:) || exit - -echo "Making links to 'oldXMenu'" -(cd oldXMenu && - ln *.[ch] *.in *.mk ../${tempdir}/oldXMenu && - ln README ChangeLog.*[0-9] ../${tempdir}/oldXMenu && -:) || exit - -echo "Making links to 'lwlib'" -(cd lwlib && - ln *.[ch] *.in *.mk ../${tempdir}/lwlib && - ln README ChangeLog.*[0-9] ../${tempdir}/lwlib && -:) || exit - -## It is important to distribute admin/ because it contains sources -## for generated lisp/international/uni-*.el files. -echo "Making links to 'admin' and its subdirectories" -for f in `find admin -type f`; do - case $f in - */Makefile) [ -f $f.in ] && continue ;; - esac - ln $f $tempdir/$f || exit -done - -if [ "$with_tests" = "yes" ]; then - echo "Making links to 'test' and its subdirectories" - for f in `find test -type f ! -name '*.log' ! -name a.out \ - ! -name '*.so' ! -name '*.dll' ! -name '*.o' - `; do - case $f in - */Makefile) [ -f $f.in ] && continue ;; - esac - ln $f $tempdir/$f || exit - done -fi - -echo "Making links to 'etc' and its subdirectories" -for f in `find etc -type f`; do - case $f in - etc/DOC*|etc/*.pyc) continue ;; - ## Arguably we should not exclude *.ps. - etc/refcards/*.aux|etc/refcards/*.dvi|etc/refcards/*.log|etc/refcards/*.ps) - continue ;; - esac - ln $f $tempdir/$f || exit -done - -if [ "$with_info" = "yes" ]; then - echo "Making links to 'info'" - ln `find info -type f -print` ${tempdir}/info || exit -fi +MANIFEST_subdir_sed=' + $a\ +'$tempdir'/info\ +'$tempdir'/site-lisp + s,[^/]*$,, + s,/$,, + /^$/d + s,^,'$tempdir'/, +' +tempsubdirs=$(sed "$MANIFEST_subdir_sed" MANIFEST | sort -u) +$mkdir_verbose -p $tempsubdirs || exit -echo "Making links to 'doc/emacs'" -(cd doc/emacs && - ln *.texi *.in ChangeLog.*[0-9] ../../${tempdir}/doc/emacs && -:) || exit - -echo "Making links to 'doc/misc'" -(cd doc/misc && - ln *.texi *.tex *.in gnus-news.el ChangeLog.*[0-9] \ - ../../${tempdir}/doc/misc && -:) || exit - -echo "Making links to 'doc/lispref'" -(cd doc/lispref && - ln *.texi *.in README ChangeLog.*[0-9] ../../${tempdir}/doc/lispref && - ln spellfile ../../${tempdir}/doc/lispref && - ln two-volume.make two-volume-cross-refs.txt ../../${tempdir}/doc/lispref && -:) || exit - -echo "Making links to 'doc/lispintro'" -(cd doc/lispintro && - ln *.texi *.in *.eps *.pdf ../../${tempdir}/doc/lispintro && - ln README ChangeLog.*[0-9] ../../${tempdir}/doc/lispintro && - cd ../../${tempdir}/doc/lispintro && -:) || exit - -echo "Making links to 'doc/man'" -(cd doc/man && - ln *.*[0-9] *.in ../../${tempdir}/doc/man && - cd ../../${tempdir}/doc/man && - rm -f emacs.1 && -:) || exit - -### It would be nice if they could all be symlinks to top-level copy, but -### you're not supposed to have any symlinks in distribution tar files. -echo "Making sure copying notices are all copies of 'COPYING'" -for subdir in . etc leim lib lib-src lisp lwlib msdos nt src; do - rm -f ${tempdir}/${subdir}/COPYING || exit - cp COPYING ${tempdir}/${subdir} || exit -done +echo "Making links to files" +while read file; do + [ $file = "$file_to_skip" ] || ln $file $tempdir/$file || exit +done Date: Fri Feb 1 16:44:47 2019 -0500 * configure.ac (emacs_config_features): Add pdumper and unexec. diff --git a/configure.ac b/configure.ac index ff745eca1a..53e2ef35c7 100644 --- a/configure.ac +++ b/configure.ac @@ -5550,9 +5550,11 @@ emacs_config_features= for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \ GCONF GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \ LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT OLDXMENU X11 XDBE XIM \ - NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON LCMS2 GMP; do + NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER UNEXEC LCMS2 GMP; do case $opt in + PDUMPER) val=${with_pdumper} ;; + UNEXEC) val=${with_unexec} ;; GLIB) val=${emacs_cv_links_glib} ;; NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;; TOOLKIT_SCROLL_BARS|X_TOOLKIT) eval val=\${USE_$opt} ;; commit 3b69e02a248c8b46223d5a9cecfb2494992e5fbe Author: Paul Eggert Date: Fri Feb 1 13:03:18 2019 -0800 Rename CANNOT_DUMP to HAVE_UNEXEC * configure.ac (CANNOT_DUMP): Remove. All uses removed, or changed to the negative of with_unexec. (HAVE_UNEXEC): New macro. All uses of CANNOT_DUMP changed to the negative of this macro. diff --git a/configure.ac b/configure.ac index 40be0859aa..ff745eca1a 100644 --- a/configure.ac +++ b/configure.ac @@ -382,15 +382,8 @@ if test "$with_pdumper" = "yes"; then AC_DEFINE(HAVE_PDUMPER, 1, [Define to build with portable dumper support]) fi -if test "$with_unexec" = "yes"; then - CANNOT_DUMP=no -else - CANNOT_DUMP=yes -fi - DUMPING=$with_dumping AC_SUBST(DUMPING) -AC_SUBST(CANNOT_DUMP) dnl FIXME currently it is not the last. dnl This should be the last --with option, because --with-x is @@ -1314,7 +1307,7 @@ AC_SUBST([FIND_DELETE]) PAXCTL_dumped= PAXCTL_notdumped= -if test "$CANNOT_DUMP" = "no" && test $opsys = gnu-linux; then +if test $with_unexec = yes && test $opsys = gnu-linux; then if test "${SETFATTR+set}" != set; then AC_CACHE_CHECK([for setfattr], [emacs_cv_prog_setfattr], @@ -1434,7 +1427,7 @@ else fi AC_CACHE_CHECK([for -znocombreloc], [emacs_cv_znocombreloc], - [if test "$CANNOT_DUMP" = "yes"; then + [if test $with_unexec = no; then emacs_cv_znocombreloc='not needed' else save_LDFLAGS=$LDFLAGS @@ -1465,13 +1458,16 @@ AC_CACHE_CHECK([whether addresses are sanitized], [emacs_cv_sanitize_address=yes], [emacs_cv_sanitize_address=no])]) -if test "$CANNOT_DUMP" = "yes"; then - AC_DEFINE(CANNOT_DUMP, 1, [Define if Emacs should not support unexec.]) -elif test "$emacs_cv_sanitize_address" = yes; then - AC_MSG_WARN([[Addresses are sanitized; suggest CANNOT_DUMP=yes]]) +if test $with_unexec = yes; then + AC_DEFINE([HAVE_UNEXEC], 1, [Define if Emacs supports unexec.]) + if test "$emacs_cv_sanitize_address" = yes; then + AC_MSG_WARN([[Addresses are sanitized; suggest --without-unexec]]) + fi fi -UNEXEC_OBJ=unexelf.o + +UNEXEC_OBJ= +test $with_unexec = yes && case "$opsys" in # MSDOS uses unexcoff.o aix4-2) @@ -1499,8 +1495,10 @@ case "$opsys" in # not been tested, so for now this change is for Solaris 10 or newer. UNEXEC_OBJ=unexsol.o ;; + *) + UNEXEC_OBJ=unexelf.o + ;; esac -test "$CANNOT_DUMP" = "yes" && UNEXEC_OBJ= LD_SWITCH_SYSTEM= test "$with_unexec" = no || case "$opsys" in @@ -1551,7 +1549,7 @@ esac C_SWITCH_MACHINE= -test "$CANNOT_DUMP" = yes || +test $with_unexec = yes && case $canonical in alpha*) AC_CHECK_DECL([__ELF__]) @@ -2310,7 +2308,7 @@ doug_lea_malloc=$emacs_cv_var_doug_lea_malloc hybrid_malloc= system_malloc=yes -test "$CANNOT_DUMP" = yes || +test $with_unexec = yes && case "$opsys" in ## darwin ld insists on the use of malloc routines in the System framework. darwin | mingw32 | nacl | sol2-10) ;; @@ -5440,7 +5438,7 @@ esac AC_CACHE_CHECK( [for $CC option to disable position independent executables], [emacs_cv_prog_cc_no_pie], - [if test "$CANNOT_DUMP" = yes; then + [if test $with_unexec = no; then emacs_cv_prog_cc_no_pie='not needed' else emacs_save_c_werror_flag=$ac_c_werror_flag @@ -5552,10 +5550,9 @@ emacs_config_features= for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \ GCONF GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \ LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT OLDXMENU X11 XDBE XIM \ - NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON CANNOT_DUMP LCMS2 GMP; do + NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON LCMS2 GMP; do case $opt in - CANNOT_DUMP) eval val=\${$opt} ;; GLIB) val=${emacs_cv_links_glib} ;; NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;; TOOLKIT_SCROLL_BARS|X_TOOLKIT) eval val=\${USE_$opt} ;; diff --git a/etc/DEBUG b/etc/DEBUG index 21097ccdf4..d401d0be90 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -936,7 +936,7 @@ its own versions, and because the dumping process might be incompatible with the way these packages use to track allocated memory. Here are some of the changes you might find necessary: - - Edit configure, to set system_malloc and CANNOT_DUMP to "yes". + - Make sure unexec is disabled, e.g., './configure --without-unexec'. - Configure with a different --prefix= option. If you use GCC, version 2.7.2 is preferred, as some malloc debugging packages diff --git a/lisp/loadup.el b/lisp/loadup.el index 747476c506..67e8aa7d40 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -526,8 +526,7 @@ lost after dumping"))) t)))) (kill-emacs))) -;; For machines with CANNOT_DUMP defined in config.h, -;; this file must be loaded each time Emacs is run. +;; This file must be loaded each time Emacs is run from scratch, e.g., temacs. ;; So run the startup code now. First, remove `-l loadup' from args. (if (and (member (nth 1 command-line-args) '("-l" "--load")) diff --git a/src/alloc.c b/src/alloc.c index 5ea466beca..a0d0a61134 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -168,7 +168,7 @@ voidfuncptr __MALLOC_HOOK_VOLATILE __malloc_initialize_hook EXTERNALLY_VISIBLE #endif -#if defined DOUG_LEA_MALLOC || !defined CANNOT_DUMP +#if defined DOUG_LEA_MALLOC || defined HAVE_UNEXEC /* Allocator-related actions to do just before and after unexec. */ @@ -502,11 +502,11 @@ static struct mem_node *mem_find (void *); #endif /* Addresses of staticpro'd variables. Initialize it to a nonzero - value if we might dump; otherwise some compilers put it into + value if we might unexec; otherwise some compilers put it into BSS. */ Lisp_Object *staticvec[NSTATICS] -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC = {&Vpurify_flag} #endif ; @@ -1192,9 +1192,9 @@ verify (POWER_OF_2 (BLOCK_ALIGN)); /* Use aligned_alloc if it or a simple substitute is available. Aligned allocation is incompatible with unexmacosx.c, so don't use - it on Darwin unless CANNOT_DUMP. */ + it on Darwin if HAVE_UNEXEC. */ -#if !defined DARWIN_OS || defined CANNOT_DUMP +#if ! (defined DARWIN_OS && defined HAVE_UNEXEC) # if (defined HAVE_ALIGNED_ALLOC \ || (defined HYBRID_MALLOC \ ? defined HAVE_POSIX_MEMALIGN \ @@ -5390,7 +5390,7 @@ pure_alloc (size_t size, int type) } -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC /* Print a warning if PURESIZE is too small. */ diff --git a/src/conf_post.h b/src/conf_post.h index 125dbf0152..f8254cfa9d 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -92,13 +92,11 @@ typedef bool bool_bf; # define ADDRESS_SANITIZER false #endif -#ifdef DARWIN_OS -#if defined emacs && !defined CANNOT_DUMP -#define malloc unexec_malloc -#define realloc unexec_realloc -#define free unexec_free +#if defined DARWIN_OS && defined emacs && defined HAVE_UNEXEC +# define malloc unexec_malloc +# define realloc unexec_realloc +# define free unexec_free #endif -#endif /* DARWIN_OS */ /* If HYBRID_MALLOC is defined (e.g., on Cygwin), emacs will use gmalloc before dumping and the system malloc after dumping. diff --git a/src/emacs.c b/src/emacs.c index d6b8a87c72..ff814a149b 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -149,7 +149,7 @@ bool running_asynch_code; bool display_arg; #endif -#if defined GNU_LINUX && !defined CANNOT_DUMP +#if defined GNU_LINUX && defined HAVE_UNEXEC /* The gap between BSS end and heap start as far as we can tell. */ static uprintmax_t heap_bss_diff; #endif @@ -868,7 +868,7 @@ main (int argc, char **argv) can set heap flags properly if we're going to unexec. */ if (!initialized && temacs) { -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC if (strcmp (temacs, "dump") == 0 || strcmp (temacs, "bootstrap") == 0) gflags.will_dump_with_unexec_ = true; @@ -878,7 +878,7 @@ main (int argc, char **argv) strcmp (temacs, "pbootstrap") == 0) gflags.will_dump_with_pdumper_ = true; #endif -#if defined (HAVE_PDUMPER) || !defined (CANNOT_DUMP) +#if defined HAVE_PDUMPER || defined HAVE_UNEXEC if (strcmp (temacs, "bootstrap") == 0 || strcmp (temacs, "pbootstrap") == 0) gflags.will_bootstrap_ = true; @@ -904,7 +904,7 @@ main (int argc, char **argv) #endif } -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC if (!will_dump_with_unexec_p ()) gflags.will_not_unexec_ = true; #endif @@ -953,7 +953,7 @@ main (int argc, char **argv) argc = maybe_disable_address_randomization ( will_dump_with_unexec_p (), argc, argv); -#if defined (GNU_LINUX) && !defined (CANNOT_DUMP) +#if defined GNU_LINUX && defined HAVE_UNEXEC if (!initialized) { char *heap_start = my_heap_start (); @@ -967,7 +967,7 @@ main (int argc, char **argv) #endif /* If using unexmacosx.c (set by s/darwin.h), we must do this. */ -#if defined DARWIN_OS && !defined CANNOT_DUMP +#if defined DARWIN_OS && defined HAVE_UNEXEC if (!initialized) unexec_init_emacs_zone (); #endif @@ -1445,7 +1445,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem /* Call syms_of_keyboard before init_window_once because keyboard sets up symbols that include some face names that the X support will want to use. This can happen when - CANNOT_DUMP is defined. */ + Emacs starts up from scratch (e.g., temacs). */ syms_of_keyboard (); /* Called before syms_of_fileio, because it sets up Qerror_condition. */ @@ -2378,7 +2378,7 @@ shut_down_emacs (int sig, Lisp_Object stuff) -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC #include "unexec.h" @@ -2405,10 +2405,10 @@ You must run Emacs in batch mode in order to dump it. */) if (definitely_will_not_unexec_p ()) error ("This Emacs instance was not started in temacs mode"); -#if defined GNU_LINUX && !defined CANNOT_DUMP +# if defined GNU_LINUX && defined HAVE_UNEXEC /* Warn if the gap between BSS end and heap start is larger than this. */ -# define MAX_HEAP_BSS_DIFF (1024*1024) +# define MAX_HEAP_BSS_DIFF (1024 * 1024) if (heap_bss_diff > MAX_HEAP_BSS_DIFF) { @@ -2421,7 +2421,7 @@ You must run Emacs in batch mode in order to dump it. */) fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n"); fprintf (stderr, "**************************************************\n"); } -#endif /* GNU_LINUX */ +# endif /* Bind `command-line-processed' to nil before dumping, so that the dumped Emacs will process its command line @@ -2445,7 +2445,7 @@ You must run Emacs in batch mode in order to dump it. */) tem = Vpurify_flag; Vpurify_flag = Qnil; -#ifdef HYBRID_MALLOC +# ifdef HYBRID_MALLOC { static char const fmt[] = "%d of %d static heap bytes used"; char buf[sizeof fmt + 2 * (INT_STRLEN_BOUND (int) - 2)]; @@ -2454,18 +2454,16 @@ You must run Emacs in batch mode in order to dump it. */) /* Don't log messages, because at this point buffers cannot be created. */ message1_nolog (buf); } -#endif +# endif fflush_unlocked (stdout); /* Tell malloc where start of impure now is. */ /* Also arrange for warnings when nearly out of space. */ -#if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC -#ifndef WINDOWSNT +# if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC && !defined WINDOWSNT /* On Windows, this was done before dumping, and that once suffices. Meanwhile, my_edata is not valid on Windows. */ memory_warnings (my_edata, malloc_warning); -#endif /* not WINDOWSNT */ -#endif /* not SYSTEM_MALLOC and not HYBRID_MALLOC */ +# endif struct gflags old_gflags = gflags; gflags.will_dump_ = false; @@ -2480,19 +2478,19 @@ You must run Emacs in batch mode in order to dump it. */) gflags = old_gflags; -#ifdef WINDOWSNT +# ifdef WINDOWSNT Vlibrary_cache = Qnil; -#endif -#ifdef HAVE_WINDOW_SYSTEM +# endif +# ifdef HAVE_WINDOW_SYSTEM reset_image_types (); -#endif +# endif Vpurify_flag = tem; return unbind_to (count, Qnil); } -#endif /* not CANNOT_DUMP */ +#endif #if HAVE_SETLOCALE @@ -2781,7 +2779,7 @@ syms_of_emacs (void) DEFSYM (Qkill_emacs, "kill-emacs"); DEFSYM (Qkill_emacs_hook, "kill-emacs-hook"); -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC defsubr (&Sdump_emacs); #endif diff --git a/src/image.c b/src/image.c index 2014860581..57bbf3cdb9 100644 --- a/src/image.c +++ b/src/image.c @@ -10003,7 +10003,7 @@ lookup_image_type (Lisp_Object type) return NULL; } -#if !defined CANNOT_DUMP && defined HAVE_WINDOW_SYSTEM +#if defined HAVE_UNEXEC && defined HAVE_WINDOW_SYSTEM /* Reset image_types before dumping. Called from Fdump_emacs. */ diff --git a/src/lastfile.c b/src/lastfile.c index 706f667dbb..bcaf105a51 100644 --- a/src/lastfile.c +++ b/src/lastfile.c @@ -43,7 +43,7 @@ along with GNU Emacs. If not, see . */ char my_edata[] = "End of Emacs initialized data"; #endif -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC /* Help unexec locate the end of the .bss area used by Emacs (which isn't always a separate section in NT executables). */ diff --git a/src/lisp.h b/src/lisp.h index 5a0de4b12c..3b481089cf 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -633,11 +633,11 @@ extern bool initialized; extern struct gflags { /* True means this Emacs instance was born to dump. */ -#if defined (HAVE_PDUMPER) || !defined (CANNOT_DUMP) +#if defined HAVE_PDUMPER || defined HAVE_UNEXEC bool will_dump_ : 1; bool will_bootstrap_ : 1; #endif -#if defined (HAVE_PDUMPER) +#ifdef HAVE_PDUMPER /* Set in an Emacs process that will likely dump with pdumper; all Emacs processes may dump with pdumper, however. */ bool will_dump_with_pdumper_ : 1; @@ -645,7 +645,7 @@ extern struct gflags { dump. */ bool dumped_with_pdumper_ : 1; #endif -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC bool will_dump_with_unexec_ : 1; /* Set in an Emacs process that has been restored from an unexec dump. */ @@ -658,7 +658,7 @@ extern struct gflags { INLINE bool will_dump_p (void) { -#if HAVE_PDUMPER || !defined (CANNOT_DUMP) +#if HAVE_PDUMPER || defined HAVE_UNEXEC return gflags.will_dump_; #else return false; @@ -668,7 +668,7 @@ will_dump_p (void) INLINE bool will_bootstrap_p (void) { -#if HAVE_PDUMPER || !defined (CANNOT_DUMP) +#if HAVE_PDUMPER || defined HAVE_UNEXEC return gflags.will_bootstrap_; #else return false; @@ -698,20 +698,20 @@ dumped_with_pdumper_p (void) INLINE bool will_dump_with_unexec_p (void) { -#ifdef CANNOT_DUMP - return false; -#else +#ifdef HAVE_UNEXEC return gflags.will_dump_with_unexec_; +#else + return false; #endif } INLINE bool dumped_with_unexec_p (void) { -#ifdef CANNOT_DUMP - return false; -#else +#ifdef HAVE_UNEXEC return gflags.dumped_with_unexec_; +#else + return false; #endif } @@ -721,10 +721,10 @@ dumped_with_unexec_p (void) INLINE bool definitely_will_not_unexec_p (void) { -#ifdef CANNOT_DUMP - return true; -#else +#ifdef HAVE_UNEXEC return gflags.will_not_unexec_; +#else + return true; #endif } @@ -3032,7 +3032,7 @@ CHECK_INTEGER (Lisp_Object x) /* If we're not dumping using the legacy dumper and we might be using the portable dumper, try to bunch all the subr structures together for more efficient dump loading. */ -#ifdef CANNOT_DUMP +#ifndef HAVE_UNEXEC # ifdef DARWIN_OS # define SUBR_SECTION_ATTRIBUTE ATTRIBUTE_SECTION ("__DATA,subrs") # else @@ -4135,7 +4135,7 @@ Lisp_Object backtrace_top_function (void); extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol); /* Defined in unexmacosx.c. */ -#if defined DARWIN_OS && !defined CANNOT_DUMP +#if defined DARWIN_OS && defined HAVE_UNEXEC extern void unexec_init_emacs_zone (void); extern void *unexec_malloc (size_t); extern void *unexec_realloc (void *, size_t); diff --git a/src/term.c b/src/term.c index c5a1fb99a1..7255f561e2 100644 --- a/src/term.c +++ b/src/term.c @@ -1350,7 +1350,8 @@ term_get_fkeys_1 (void) char **address = term_get_fkeys_address; KBOARD *kboard = term_get_fkeys_kboard; - /* This can happen if CANNOT_DUMP or with strange options. */ + /* This can happen if Emacs is starting up from scratch, or with + strange options. */ if (!KEYMAPP (KVAR (kboard, Vinput_decode_map))) kset_input_decode_map (kboard, Fmake_sparse_keymap (Qnil)); diff --git a/src/timefns.c b/src/timefns.c index ce1f4d3f5a..7e061228e2 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -294,7 +294,7 @@ tzlookup (Lisp_Object zone, bool settz) void init_timefns (void) { -#ifndef CANNOT_DUMP +#ifdef HAVE_UNEXEC /* A valid but unlikely setting for the TZ environment variable. It is OK (though a bit slower) if the user chooses this value. */ static char dump_tz_string[] = "TZ=UtC0"; @@ -311,7 +311,7 @@ init_timefns (void) char *tz = getenv ("TZ"); -#if !defined CANNOT_DUMP +#ifdef HAVE_UNEXEC /* If the execution TZ happens to be the same as the dump TZ, change it to some other value and then change it back, to force the underlying implementation to reload the TZ info. diff --git a/src/unexcoff.c b/src/unexcoff.c index 6e90c0628d..220ce709df 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c @@ -56,7 +56,7 @@ along with GNU Emacs. If not, see . */ #define PERROR(file) report_error (file, new) -#ifndef CANNOT_DUMP /* all rest of file! */ +#ifdef HAVE_UNEXEC /* all rest of file! */ #ifdef HAVE_COFF_H #include @@ -538,4 +538,4 @@ unexec (const char *new_name, const char *a_name) emacs_close (a_out); } -#endif /* not CANNOT_DUMP */ +#endif /* HAVE_UNEXEC */ diff --git a/src/w32heap.c b/src/w32heap.c index 8a2c1b5877..9a59a1f075 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -115,9 +115,9 @@ typedef struct _RTL_HEAP_PARAMETERS { than half of the size stated below. It would be nice to find a way to build only the first bootstrap-emacs.exe with the large size, and reset that to a lower value afterwards. */ -#ifdef CANNOT_DUMP -/* We don't use dumped_data[] when CANNOT_DUMP, so define to a small - size that won't matter. */ +#ifndef HAVE_UNEXEC +/* We don't use dumped_data[], so define to a small size that won't + matter. */ # define DUMPED_HEAP_SIZE 10 #else # if defined _WIN64 || defined WIDE_EMACS_INT @@ -597,7 +597,7 @@ free_after_dump_9x (void *ptr) } } -#if !defined (CANNOT_DUMP) && defined (ENABLE_CHECKING) +#if defined HAVE_UNEXEC && defined ENABLE_CHECKING void report_temacs_memory_usage (void) { commit 84802b66197c623735aaca875b8e1a39cb0ef085 Author: Paul Eggert Date: Fri Feb 1 12:05:28 2019 -0800 Omit some linker hacks if not doing unexec * configure.ac (LDFLAGS, LD_SWITCH_SYSTEM_TEMACS): Omit some funky linker flags if not supporting unexec. Use macOS linker hacks only if needed * configure.ac: On darwin, link with -fno-pie and -headerpad only if configuring with unexec. diff --git a/configure.ac b/configure.ac index 16491a95d5..40be0859aa 100644 --- a/configure.ac +++ b/configure.ac @@ -791,7 +791,9 @@ case "${canonical}" in opsys=qnxnto test -z "$CC" && CC=qcc CFLAGS="$CFLAGS -D__NO_EXT_QNX" - LDFLAGS="-N2MB $LDFLAGS" + if test "$with_unexec" = yes; then + LDFLAGS="-N2MB $LDFLAGS" + fi ;; ## Intel 386 machines where we don't care about the manufacturer. @@ -1501,7 +1503,7 @@ esac test "$CANNOT_DUMP" = "yes" && UNEXEC_OBJ= LD_SWITCH_SYSTEM= -case "$opsys" in +test "$with_unexec" = no || case "$opsys" in freebsd|dragonfly) ## Let 'ld' find image libs and similar things in /usr/local/lib. ## The system compiler, GCC, has apparently been modified to not @@ -5379,6 +5381,15 @@ case "$opsys" in cygwin) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000" ;; darwin) + if test "$HAVE_NS" = "yes"; then + libs_nsgui="-framework AppKit" + if test "$NS_IMPL_COCOA" = "yes"; then + libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon" + fi + else + libs_nsgui= + fi + LD_SWITCH_SYSTEM_TEMACS=$libs_nsgui ## The -headerpad option tells ld (see man page) to leave room at the ## end of the header for adding load commands. Needed for dumping. ## 0x1000 is enough for roughly 52 load commands on the x86_64 @@ -5387,15 +5398,9 @@ case "$opsys" in ## about 14 to about 34. Setting it high gets us plenty of slop and ## only costs about 1.5K of wasted binary space. headerpad_extra=1000 - if test "$HAVE_NS" = "yes"; then - libs_nsgui="-framework AppKit" - if test "$NS_IMPL_COCOA" = "yes"; then - libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon" - fi - else - libs_nsgui= + if test "$with_unexec" = yes; then + LD_SWITCH_SYSTEM_TEMACS="-fno-pie $LD_SWITCH_SYSTEM_TEMACS -Xlinker -headerpad -Xlinker $headerpad_extra" fi - LD_SWITCH_SYSTEM_TEMACS="-fno-pie $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" ## This is here because src/Makefile.in did some extra fiddling around ## with LD_SWITCH_SYSTEM. It seems cleaner to put this in commit 08dc1a371f7b0b88b3961fd37cca8a1717a94a7d Author: Paul Eggert Date: Fri Feb 1 08:45:20 2019 -0800 Stop using macOS -prebind option * configure.ac (LD_SWITCH_SYSTEM_TEMACS): Remove -prebind, which has been obsolete and ineffective since Mac OS X 10.4 (2005), which was never necessary for correct operation, and which now generates annoying warnings. Problem reported by Robert Pluim in: https://lists.gnu.org/r/emacs-devel/2019-01/msg00761.html diff --git a/configure.ac b/configure.ac index 7529719429..16491a95d5 100644 --- a/configure.ac +++ b/configure.ac @@ -5395,7 +5395,7 @@ case "$opsys" in else libs_nsgui= fi - LD_SWITCH_SYSTEM_TEMACS="-fno-pie -prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" + LD_SWITCH_SYSTEM_TEMACS="-fno-pie $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" ## This is here because src/Makefile.in did some extra fiddling around ## with LD_SWITCH_SYSTEM. It seems cleaner to put this in commit 3e99077ab39fac1ab1f3794b211f2c0c480c6e6e Merge: b80e3308d6 6c6b540711 Author: Paul Eggert Date: Fri Feb 1 08:40:53 2019 -0800 Merge from origin/emacs-26 6c6b540711 Correct the docs of inserting kmacro counter 32555daf4c * doc/misc/calc.texi (Algebraic Tutorial): Fix a typo. (B... commit b80e3308d690e53b7c6300f030d99281b6894b8c Merge: b60761acfa af525f44d5 Author: Paul Eggert Date: Fri Feb 1 08:40:53 2019 -0800 ; Merge from origin/emacs-26 The following commit was skipped: af525f44d5 ; Auto-commit of loaddefs files. commit b60761acfa3c0070efd53056040524f05b35c07f Merge: 94245b9a79 7ba8f80398 Author: Paul Eggert Date: Fri Feb 1 08:40:52 2019 -0800 Merge from origin/emacs-26 7ba8f80398 Avoid errors in 'rmail-get-new-mail' 9c8412a0b8 Fix process-contact bug with TCP connections # Conflicts: # src/process.c commit 6c6b540711d0dd8a8eac9547968ed4dfb493fd1c Author: Eli Zaretskii Date: Fri Feb 1 17:34:23 2019 +0200 Correct the docs of inserting kmacro counter * doc/emacs/kmacro.texi (Keyboard Macro Counter): Correct the description of the affect "C-u" has on inserting the macro counter. Define "previous counter value". * lisp/kmacro.el (kmacro-insert-counter) (kmacro-start-macro-or-insert-counter): Fix the doc strings regarding the effect of "C-u". (Bug#34263) diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi index a7d849a7f0..65387ae783 100644 --- a/doc/emacs/kmacro.texi +++ b/doc/emacs/kmacro.texi @@ -241,10 +241,17 @@ determined by the customizable variable @code{kmacro-ring-max}. @section The Keyboard Macro Counter Each keyboard macro has an associated counter, which is initialized -to 0 when you start defining the macro. This counter allows you to -insert a number into the buffer that depends on the number of times -the macro has been called. The counter is incremented each time its -value is inserted into the buffer. +to 0 when you start defining the macro. This @dfn{current counter} +allows you to insert a number into the buffer that depends on the +number of times the macro has been called. The counter is normally +incremented each time its value is inserted into the buffer. + +In addition to the current counter, keyboard macros also maintain the +@dfn{previous counter}, which records the value the current counter +had last time it was incremented or set. Note that incrementing the +current counter by zero, e.g., with @w{@kbd{C-u 0 C-x C-k C-i}}, also +records the value of the current counter as the previous counter +value. @table @kbd @item @key{F3} @@ -270,8 +277,8 @@ value of the keyboard macro's counter into the buffer, and increments the counter by 1. (If you are not defining a macro, @key{F3} begins a macro definition instead. @xref{Basic Keyboard Macro}.) You can use a numeric prefix argument to specify a different increment. If you -just specify a @kbd{C-u} prefix, that is the same as an increment of -zero: it inserts the current counter value without changing it. +just specify a @kbd{C-u} prefix, that inserts the previous counter +value, and doesn't change the current value. As an example, let us show how the keyboard macro counter can be used to build a numbered list. Consider the following key sequence: diff --git a/lisp/kmacro.el b/lisp/kmacro.el index f9d00a5603..72d7091df1 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -263,7 +263,10 @@ Can be set directly via `kmacro-set-format', which see.") (defun kmacro-insert-counter (arg) "Insert current value of `kmacro-counter', then increment it by ARG. Interactively, ARG defaults to 1. With \\[universal-argument], insert -current value of `kmacro-counter', but do not increment it." +the previous value of `kmacro-counter', and do not increment the +current value. +The previous value of the counter is the one it had before +the last increment." (interactive "P") (if kmacro-initial-counter-value (setq kmacro-counter kmacro-initial-counter-value @@ -692,9 +695,10 @@ the current value of `kmacro-counter'). When used during defining/executing a macro, inserts the current value of `kmacro-counter' and increments the counter value by ARG (or by 1 if no -prefix argument). With just \\[universal-argument], inserts the current value -of `kmacro-counter', but does not modify the counter; this is the -same as incrementing the counter by zero. +prefix argument). With just \\[universal-argument], inserts the previous +value of `kmacro-counter', and does not modify the counter; this is +different from incrementing the counter by zero. (The previous value +of the counter is the one it had before the last increment.) The macro counter can be set directly via \\[kmacro-set-counter] and \\[kmacro-add-counter]. The format of the inserted value of the counter can be controlled commit 32555daf4c24ea5878f5bd731e1f8fce310628cf Author: Nicholas Drozd Date: Fri Feb 1 08:06:50 2019 -0600 * doc/misc/calc.texi (Algebraic Tutorial): Fix a typo. (Bug#34273) diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 59125771ac..0b6e119390 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -2026,7 +2026,7 @@ You can also ``unstore'' a variable when you are through with it: @smallexample @group -2: 2 + 5 => 5 +2: 2 + 3 => 5 1: 2 a + 2 b => 2 a + 2 b . commit 94245b9a790392768d47afc15ae278369307d663 Author: Glenn Morris Date: Fri Feb 1 07:33:38 2019 -0500 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index f2e1f88a6a..4c5e6a4dae 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -15220,7 +15220,7 @@ List of hook functions run by `grep-process-setup' (see `run-hooks').") (custom-autoload 'grep-setup-hook "grep" t) -(defconst grep-regexp-alist `((,(concat "^\\(?:" "\\(?1:[^\0\n]+\\)\\(?3:\0\\)\\(?2:[0-9]+\\):" "\\|" "\\(?1:" "\\(?:[a-zA-Z]:\\)?" "[^\n:]+?[^\n/:]\\):[\11 ]*\\(?2:[1-9][0-9]*\\)[\11 ]*:" "\\)") 1 2 (,(lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face))) (when mbeg (- mbeg beg))))) \, (lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) nil nil (3 '(face nil display ":"))) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "\ +(defconst grep-regexp-alist `((,(concat "^\\(?:" "\\(?1:[^\0\n]+\\)\\(?3:\0\\)\\(?2:[0-9]+\\):" "\\|" "\\(?1:" "\\(?:[a-zA-Z]:\\)?" "[^\n:]+?[^\n/:]\\):[\11 ]*\\(?2:[1-9][0-9]*\\)[\11 ]*:" "\\)") 1 2 (,(lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- mbeg beg))))) \, (lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) nil nil (3 '(face nil display ":"))) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "\ Regexp used to match grep hits. See `compilation-error-regexp-alist' for format details.") @@ -17719,13 +17719,20 @@ must be available. (autoload 'create-image "image" "\ Create an image. FILE-OR-DATA is an image file name or image data. + Optional TYPE is a symbol describing the image type. If TYPE is omitted or nil, try to determine the image type from its first few bytes of image data. If that doesn't work, and FILE-OR-DATA is a file name, use its file extension as image type. + Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data. + Optional PROPS are additional image attributes to assign to the image, -like, e.g. `:mask MASK'. +like, e.g. `:mask MASK'. If the property `:scale' is not given and the +display has a high resolution (more exactly, when the average width of a +character in the default font is more than 10 pixels), the image is +automatically scaled up in proportion to the default font. + Value is the image created, or nil if images of type TYPE are not supported. Images should not be larger than specified by `max-image-size'. @@ -34755,7 +34762,7 @@ the output buffer or changing the window configuration. ;;;### (autoloads nil "tramp" "net/tramp.el" (0 0 0 0)) ;;; Generated autoloads from net/tramp.el -(push (purecopy '(tramp 2 4 1)) package--builtin-versions) +(push (purecopy '(tramp 2 4 2 -1)) package--builtin-versions) (defvar tramp-mode t "\ Whether Tramp is enabled. commit af525f44d531a5446c3153778a1b1124f3be4828 Author: Glenn Morris Date: Fri Feb 1 06:24:20 2019 -0500 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 7b7f93c3b0..fdc61eecb3 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -15241,7 +15241,7 @@ List of hook functions run by `grep-process-setup' (see `run-hooks').") (custom-autoload 'grep-setup-hook "grep" t) -(defconst grep-regexp-alist `((,(concat "^\\(?:" "\\(?1:[^\n]+\\)\\(?3:\\)\\(?2:[0-9]+\\):" "\\|" "\\(?1:" "\\(?:[a-zA-Z]:\\)?" "[^\n:]+?[^\n/:]\\):[ ]*\\(?2:[1-9][0-9]*\\)[ ]*:" "\\)") 1 2 (,(lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face))) (when mbeg (- mbeg beg))))) \, (lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) nil nil (3 '(face nil display ":"))) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "\ +(defconst grep-regexp-alist `((,(concat "^\\(?:" "\\(?1:[^\n]+\\)\\(?3:\\)\\(?2:[0-9]+\\):" "\\|" "\\(?1:" "\\(?:[a-zA-Z]:\\)?" "[^\n:]+?[^\n/:]\\):[ ]*\\(?2:[1-9][0-9]*\\)[ ]*:" "\\)") 1 2 (,(lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- mbeg beg))))) \, (lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) nil nil (3 '(face nil display ":"))) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "\ Regexp used to match grep hits. See `compilation-error-regexp-alist' for format details.") @@ -17711,13 +17711,20 @@ must be available. (autoload 'create-image "image" "\ Create an image. FILE-OR-DATA is an image file name or image data. + Optional TYPE is a symbol describing the image type. If TYPE is omitted or nil, try to determine the image type from its first few bytes of image data. If that doesn't work, and FILE-OR-DATA is a file name, use its file extension as image type. + Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data. + Optional PROPS are additional image attributes to assign to the image, -like, e.g. `:mask MASK'. +like, e.g. `:mask MASK'. If the property `:scale' is not given and the +display has a high resolution (more exactly, when the average width of a +character in the default font is more than 10 pixels), the image is +automatically scaled up in proportion to the default font. + Value is the image created, or nil if images of type TYPE are not supported. Images should not be larger than specified by `max-image-size'. @@ -30122,7 +30129,14 @@ Like `mail' command, but display mail buffer in another frame. (defvar server-name "server" "\ The name of the Emacs server, if this Emacs process creates one. The command `server-start' makes use of this. It should not be -changed while a server is running.") +changed while a server is running. +If this is a file name with no leading directories, Emacs will +create a socket file by that name under `server-socket-dir' +if `server-use-tcp' is nil, else under `server-auth-dir'. +If this is an absolute file name, it specifies where the socket +file will be created. To have emacsclient connect to the same +socket, use the \"-s\" switch for local non-TCP sockets, and +the \"-f\" switch otherwise.") (custom-autoload 'server-name "server" t) commit decdff76fb185f87145940cc3b91549f84600a87 Author: Mattias Engdegård Date: Wed Jan 16 14:57:12 2019 +0100 Make the rx operators \? and \?? behave correctly * lisp/emacs-lisp/rx.el (rx-kleene): Treat \? and \?? like ? and ?? (Bug#34100). * test/lisp/emacs-lisp/rx-tests.el: Add tests for all repetition operators. diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index a39fe55c32..8b4551d0d3 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -733,8 +733,8 @@ If OP is anything else, produce a greedy regexp if `rx-greedy-flag' is non-nil." (rx-check form) (setq form (rx-trans-forms form)) - (let ((suffix (cond ((memq (car form) '(* + ?\s)) "") - ((memq (car form) '(*? +? ??)) "?") + (let ((suffix (cond ((memq (car form) '(* + \? ?\s)) "") + ((memq (car form) '(*? +? \?? ??)) "?") (rx-greedy-flag "") (t "?"))) (op (cond ((memq (car form) '(* *? 0+ zero-or-more)) "*") diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 392a38ab95..f15e1016f7 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -65,5 +65,28 @@ (list u v))) '("1" "3")))) +(ert-deftest rx-kleene () + "Test greedy and non-greedy repetition operators." + (should (equal (rx (* "a") (+ "b") (\? "c") (?\s "d") + (*? "e") (+? "f") (\?? "g") (?? "h")) + "a*b+c?d?e*?f+?g??h??")) + (should (equal (rx (zero-or-more "a") (0+ "b") + (one-or-more "c") (1+ "d") + (zero-or-one "e") (optional "f") (opt "g")) + "a*b*c+d+e?f?g?")) + (should (equal (rx (minimal-match + (seq (* "a") (+ "b") (\? "c") (?\s "d") + (*? "e") (+? "f") (\?? "g") (?? "h")))) + "a*b+c?d?e*?f+?g??h??")) + (should (equal (rx (minimal-match + (seq (zero-or-more "a") (0+ "b") + (one-or-more "c") (1+ "d") + (zero-or-one "e") (optional "f") (opt "g")))) + "a*?b*?c+?d+?e??f??g??")) + (should (equal (rx (maximal-match + (seq (* "a") (+ "b") (\? "c") (?\s "d") + (*? "e") (+? "f") (\?? "g") (?? "h")))) + "a*b+c?d?e*?f+?g??h??"))) + (provide 'rx-tests) ;; rx-tests.el ends here. commit 7ba8f803983fce7896042289ca47b3de4df42bb7 Author: Eli Zaretskii Date: Fri Feb 1 11:16:13 2019 +0200 Avoid errors in 'rmail-get-new-mail' * lisp/mail/rmail.el (rmail-insert-inbox-text): Don't assume the Rmail protocol is always a string when calling 'rmail-remote-proto-p'. (Bug#34252) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 768454ab13..8a75f1fba9 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -2079,7 +2079,8 @@ Value is the size of the newly read mail after conversion." ;; If we just read the password, most likely it is ;; wrong. Otherwise, see if there is a specific ;; reason to think that the problem is a wrong passwd. - (if (and (rmail-remote-proto-p proto) + (if (and proto + (rmail-remote-proto-p proto) (or got-password (re-search-forward rmail-remote-password-error nil t))) commit 9c8412a0b8e1f96b87ea506c3ec67778a4ce7bb4 Author: Paul Eggert Date: Wed Jan 30 15:11:17 2019 -0800 Fix process-contact bug with TCP connections This fixes a regression from Emacs 25.3 (Bug#34134). * src/process.c (server_accept_connection): Set host correctly, fixing a bug introduced in 2017-09-16T21:29:18Z!eggert@cs.ucla.edu when working around a GCC bug. diff --git a/src/process.c b/src/process.c index 7f32150e8e..d8acd139c0 100644 --- a/src/process.c +++ b/src/process.c @@ -4724,19 +4724,24 @@ server_accept_connection (Lisp_Object server, int channel) service = Qnil; Lisp_Object args[11]; int nargs = 0; - AUTO_STRING (procname_format_in, "%s <%d.%d.%d.%d:%d>"); - AUTO_STRING (procname_format_in6, "%s <[%x:%x:%x:%x:%x:%x:%x:%x]:%d>"); + #define HOST_FORMAT_IN "%d.%d.%d.%d" + #define HOST_FORMAT_IN6 "%x:%x:%x:%x:%x:%x:%x:%x" + AUTO_STRING (host_format_in, HOST_FORMAT_IN); + AUTO_STRING (host_format_in6, HOST_FORMAT_IN6); + AUTO_STRING (procname_format_in, "%s <"HOST_FORMAT_IN":%d>"); + AUTO_STRING (procname_format_in6, "%s <["HOST_FORMAT_IN6"]:%d>"); AUTO_STRING (procname_format_default, "%s <%d>"); switch (saddr.sa.sa_family) { case AF_INET: { args[nargs++] = procname_format_in; - nargs++; + args[nargs++] = host_format_in; unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; service = make_number (ntohs (saddr.in.sin_port)); for (int i = 0; i < 4; i++) args[nargs++] = make_number (ip[i]); + host = Fformat (5, args + 1); args[nargs++] = service; } break; @@ -4745,11 +4750,12 @@ server_accept_connection (Lisp_Object server, int channel) case AF_INET6: { args[nargs++] = procname_format_in6; - nargs++; + args[nargs++] = host_format_in6; DECLARE_POINTER_ALIAS (ip6, uint16_t, &saddr.in6.sin6_addr); service = make_number (ntohs (saddr.in.sin_port)); for (int i = 0; i < 8; i++) args[nargs++] = make_number (ip6[i]); + host = Fformat (9, args + 1); args[nargs++] = service; } break;