From 622c675648e81d9c9267c26475dbcb617633c022 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 12 Oct 2017 22:38:28 -0700 Subject: [PATCH 01/55] * CONTRIBUTE: Suggest American English. --- CONTRIBUTE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTE b/CONTRIBUTE index d01ac8b07ed..78a2d515cd5 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -195,7 +195,8 @@ them right the first time, so here are guidelines for formatting them: sentences starting with a capital and ending with a period (except the summary line should not end in a period). See https://www.gnu.org/prep/standards/html_node/Comments.html - or run 'info "(standards)Comments"'. + or run 'info "(standards)Comments"'. American English is preferred + in Emacs. They are preserved indefinitely, and have a reasonable chance of being read in the future, so it's better that they have good From 55e313f7bea318f03bac0a2c9db362ed361961e6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 13 Oct 2017 12:04:40 +0300 Subject: [PATCH 02/55] ; * CONTRIBUTE: More suggestions for using US English. --- CONTRIBUTE | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTE b/CONTRIBUTE index 78a2d515cd5..8995bb3eec4 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -82,8 +82,9 @@ Doc-strings should be updated together with the code. Think about whether your change requires updating the manuals. If you know it does not, mark the NEWS entry with "---". If you know -that *all* the necessary documentation updates have been made, mark -the entry with "+++". Otherwise do not mark it. +that *all* the necessary documentation updates have been made as part +of your changes or those by others, mark the entry with "+++". +Otherwise do not mark it. If your change requires updating the manuals to document new functions/commands/variables/faces, then use the proper Texinfo @@ -92,6 +93,10 @@ command to index them; for instance, use @vindex for variables and https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Predefined-Indices.html or run the shell command 'info "(texinfo)Predefined Indices"'. +We prefer American English both in doc strings and in the manuals. +That includes both spelling (e.g., "behavior", not "behaviour") and +the convention of leaving 2 spaces between sentences. + For more specific tips on Emacs's doc style, see https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html Use 'checkdoc' to check for documentation errors before submitting a patch. @@ -196,7 +201,8 @@ them right the first time, so here are guidelines for formatting them: the summary line should not end in a period). See https://www.gnu.org/prep/standards/html_node/Comments.html or run 'info "(standards)Comments"'. American English is preferred - in Emacs. + in Emacs; that includes spelling and leaving 2 blanks between + sentences. They are preserved indefinitely, and have a reasonable chance of being read in the future, so it's better that they have good From 716b84034d10b8cae5d721173108c4c299f66ed0 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 13 Oct 2017 11:47:29 +0200 Subject: [PATCH 03/55] gnutls_mac_get_nonce_size has been added in gnutls 3.3 * src/gnutls.c (HAVE_GNUTLS_MAC_GET_NONCE_SIZE) [GNUTLS_VERSION_NUMBER >= 0x030300]: Define. (gnutls_mac_get_nonce_size): Depend on HAVE_GNUTLS_MAC_GET_NONCE_SIZE. (Fgnutls_macs): Use 0 for :mac-algorithm-noncesize if !HAVE_GNUTLS_MAC_GET_NONCE_SIZE. --- src/gnutls.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/gnutls.c b/src/gnutls.c index b55d1b9289f..36f65c4acb3 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -26,7 +26,7 @@ along with GNU Emacs. If not, see . */ #include "coding.h" #include "buffer.h" -#if 0x030014 <= GNUTLS_VERSION_NUMBER +#if GNUTLS_VERSION_NUMBER >= 0x030014 # define HAVE_GNUTLS_X509_SYSTEM_TRUST #endif @@ -36,10 +36,16 @@ along with GNU Emacs. If not, see . */ The relevant fix seems to have been made in GnuTLS 3.5.1; see: https://gitlab.com/gnutls/gnutls/commit/568935848dd6b82b9315d8b6c529d00e2605e03d So, require 3.5.1. */ -#if 0x030501 <= GNUTLS_VERSION_NUMBER +#if GNUTLS_VERSION_NUMBER >= 0x030501 # define HAVE_GNUTLS_AEAD #endif +/* gnutls_mac_get_nonce_size was added in GnuTLS 3.2.0, but was + exported only since 3.3.0. */ +#if GNUTLS_VERSION_NUMBER >= 0x030300 +# define HAVE_GNUTLS_MAC_GET_NONCE_SIZE +#endif + #ifdef HAVE_GNUTLS # ifdef WINDOWSNT @@ -187,7 +193,9 @@ DEF_DLL_FN (const char *, gnutls_mac_get_name, (gnutls_mac_algorithm_t)); # ifdef HAVE_GNUTLS3 DEF_DLL_FN (int, gnutls_rnd, (gnutls_rnd_level_t, void *, size_t)); DEF_DLL_FN (const gnutls_mac_algorithm_t *, gnutls_mac_list, (void)); +# ifdef HAVE_GNUTLS_MAC_GET_NONCE_SIZE DEF_DLL_FN (size_t, gnutls_mac_get_nonce_size, (gnutls_mac_algorithm_t)); +# endif DEF_DLL_FN (size_t, gnutls_mac_get_key_size, (gnutls_mac_algorithm_t)); DEF_DLL_FN (const gnutls_digest_algorithm_t *, gnutls_digest_list, (void)); DEF_DLL_FN (const char *, gnutls_digest_get_name, (gnutls_digest_algorithm_t)); @@ -316,7 +324,9 @@ init_gnutls_functions (void) # ifdef HAVE_GNUTLS3 LOAD_DLL_FN (library, gnutls_rnd); LOAD_DLL_FN (library, gnutls_mac_list); +# ifdef HAVE_GNUTLS_MAC_GET_NONCE_SIZE LOAD_DLL_FN (library, gnutls_mac_get_nonce_size); +# endif LOAD_DLL_FN (library, gnutls_mac_get_key_size); LOAD_DLL_FN (library, gnutls_digest_list); LOAD_DLL_FN (library, gnutls_digest_get_name); @@ -427,7 +437,9 @@ init_gnutls_functions (void) # ifdef HAVE_GNUTLS3 # define gnutls_rnd fn_gnutls_rnd # define gnutls_mac_list fn_gnutls_mac_list -# define gnutls_mac_get_nonce_size fn_gnutls_mac_get_nonce_size +# ifdef HAVE_GNUTLS_MAC_GET_NONCE_SIZE +# define gnutls_mac_get_nonce_size fn_gnutls_mac_get_nonce_size +# endif # define gnutls_mac_get_key_size fn_gnutls_mac_get_key_size # define gnutls_digest_list fn_gnutls_digest_list # define gnutls_digest_get_name fn_gnutls_digest_get_name @@ -442,10 +454,10 @@ init_gnutls_functions (void) # define gnutls_cipher_decrypt2 fn_gnutls_cipher_decrypt2 # define gnutls_cipher_deinit fn_gnutls_cipher_deinit # ifdef HAVE_GNUTLS_AEAD -# define gnutls_aead_cipher_encrypt fn_gnutls_aead_cipher_encrypt -# define gnutls_aead_cipher_decrypt fn_gnutls_aead_cipher_decrypt -# define gnutls_aead_cipher_init fn_gnutls_aead_cipher_init -# define gnutls_aead_cipher_deinit fn_gnutls_aead_cipher_deinit +# define gnutls_aead_cipher_encrypt fn_gnutls_aead_cipher_encrypt +# define gnutls_aead_cipher_decrypt fn_gnutls_aead_cipher_decrypt +# define gnutls_aead_cipher_init fn_gnutls_aead_cipher_init +# define gnutls_aead_cipher_deinit fn_gnutls_aead_cipher_deinit # endif # define gnutls_hmac_init fn_gnutls_hmac_init # define gnutls_hmac_get_len fn_gnutls_hmac_get_len @@ -2178,6 +2190,10 @@ name. */) /* A symbol representing the GnuTLS MAC algorithm. */ Lisp_Object gma_symbol = intern (gnutls_mac_get_name (gma)); + size_t nonce_size = 0; +#ifdef HAVE_GNUTLS_MAC_GET_NONCE_SIZE + nonce_size = gnutls_mac_get_nonce_size (gma); +#endif Lisp_Object mp = listn (CONSTYPE_HEAP, 11, gma_symbol, QCmac_algorithm_id, make_number (gma), QCtype, Qgnutls_type_mac_algorithm, @@ -2189,7 +2205,7 @@ name. */) make_number (gnutls_mac_get_key_size (gma)), QCmac_algorithm_noncesize, - make_number (gnutls_mac_get_nonce_size (gma))); + make_number (nonce_size)); mac_algorithms = Fcons (mp, mac_algorithms); } From 8968be822ea864f383be75888e83bd92274fc520 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Fri, 13 Oct 2017 20:51:13 +0200 Subject: [PATCH 04/55] ; * etc/NEWS: Grammar and spelling fixes * etc/NEWS (Changes in Specialized Modes and Packages in Emacs 26.1) (Lisp Changes in Emacs 26.1): Fix the grammar and spelling of some entries. --- etc/NEWS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 87a82de0462..a3c6a124217 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -630,12 +630,12 @@ remaining directories without more prompts. It gets replaced by the current file name, like ' ? '. +++ -*** A new option 'dired-always-read-filesystem' default to nil. -If non-nil, buffers visiting files are reverted before search them; -for instance, in 'dired-mark-files-containing-regexp' a non-nil value -of this option means the file is revisited in a temporary buffer; -this temporary buffer is the actual buffer searched: the original buffer -visiting the file is not modified. +*** A new option 'dired-always-read-filesystem' defaulting to nil. +If non-nil, buffers visiting files are reverted before they are +searched; for instance, in 'dired-mark-files-containing-regexp' a +non-nil value of this option means the file is revisited in a +temporary buffer; this temporary buffer is the actual buffer searched: +the original buffer visiting the file is not modified. --- *** Users can now customize mouse clicks in Dired in a more flexible way. @@ -1102,7 +1102,7 @@ domain. *** 'url-retrieve-synchronously' now takes an optional timeout parameter. --- -*** The URL package now support HTTPS over proxies supporting CONNECT. +*** The URL package now supports HTTPS over proxies supporting CONNECT. +++ *** 'url-user-agent' now defaults to 'default', and the User-Agent @@ -1868,7 +1868,7 @@ For details, see the doc string of 'rx--pcase-macroexpander'. ** New functions to set region from secondary selection and vice versa. The new functions 'secondary-selection-to-region' and 'secondary-selection-from-region' let you set the beginning and the -end of the region from those of the secondary selection and vise +end of the region from those of the secondary selection and vice versa. ** New function 'lgstring-remove-glyph' can be used to modify a From ff330530123a9e3f6fbb2d0fe52564e4e3d78369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= Date: Fri, 13 Oct 2017 21:48:12 +0200 Subject: [PATCH 05/55] Fix indentation bug in multi-line CSS selectors * lisp/textmodes/css-mode.el (css--colon-inside-selector-p): Fix indentation of multi-line CSS selectors that include both a pseudo-class and parenthesis. * test/manual/indent/css-mode.css: Add test for the above change. --- lisp/textmodes/css-mode.el | 2 +- test/manual/indent/css-mode.css | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 9022ab7c3fb..39885c10860 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1149,7 +1149,7 @@ This function is intended to be good enough to help SMIE during tokenization, but should not be regarded as a reliable function for determining whether point is within a selector." (save-excursion - (re-search-forward "[{};)]" nil t) + (re-search-forward "[{};]" nil t) (eq (char-before) ?\{))) (defun css--colon-inside-funcall () diff --git a/test/manual/indent/css-mode.css b/test/manual/indent/css-mode.css index bf612b53a14..640418b022d 100644 --- a/test/manual/indent/css-mode.css +++ b/test/manual/indent/css-mode.css @@ -66,6 +66,16 @@ div::before { ); } +/* Multi-line selector including both a pseudo-class and + parenthesis. */ +.form-group:not(.required) label, +.birth-date .row > * { + &::after { + display: inline; + font-weight: normal; + } +} + @font-face { src: url("Sans-Regular.eot") format("eot"), url("Sans-Regular.woff") format("woff"), From d7038020aa0a868c74cddaed5733ad6eeb73406b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 14 Oct 2017 00:55:25 -0700 Subject: [PATCH 06/55] Do not under-align pseudovectors Problem reported by Fabrice Popineau in: https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00357.html Also see diagnosis by Eli Zaretskii in: https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00476.html * src/alloc.c (vector_alignment): Now a multiple of alignof (max_align_t). --- src/alloc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 2e6399e7f8d..da0c3ad4b3e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2923,9 +2923,13 @@ set_next_vector (struct Lisp_Vector *v, struct Lisp_Vector *p) enum { - /* Alignment of struct Lisp_Vector objects. */ - vector_alignment = COMMON_MULTIPLE (FLEXALIGNOF (struct Lisp_Vector), - GCALIGNMENT), + /* Alignment of struct Lisp_Vector objects. Because pseudovectors + can contain any C type, align at least as strictly as + max_align_t. On x86 and x86-64 this can waste up to 8 bytes + for typical vectors, since alignof (max_align_t) is 16 but + typical vectors need only an alignment of 8. However, it is + not worth the hassle to avoid wasting those bytes. */ + vector_alignment = COMMON_MULTIPLE (alignof (max_align_t), GCALIGNMENT), /* Vector size requests are a multiple of this. */ roundup_size = COMMON_MULTIPLE (vector_alignment, word_size) From aa0c38f3586d462c7b4d489542b32580f489fdc5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Oct 2017 11:13:47 +0300 Subject: [PATCH 07/55] Make sure thread stack is properly aligned on MS-Windows * src/systhread.c: Include w32term.h instead of windows.h. (w32_beginthread_wrapper): Add ALIGN_STACK attribute, to ensure the thread's stack is correctly aligned. * src/w32term.h (ALIGN_STACK): Update commentary. --- src/systhread.c | 7 ++++--- src/w32term.h | 15 ++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/systhread.c b/src/systhread.c index ee89a1ed3ff..6f9baabaf2e 100644 --- a/src/systhread.c +++ b/src/systhread.c @@ -187,7 +187,7 @@ sys_thread_yield (void) #elif defined (WINDOWSNT) -#include +#include /* Cannot include because of the local header by the same name, sigh. */ @@ -326,8 +326,9 @@ sys_thread_self (void) static thread_creation_function *thread_start_address; /* _beginthread wants a void function, while we are passed a function - that returns a pointer. So we use a wrapper. */ -static void + that returns a pointer. So we use a wrapper. See the command in + w32term.h about the need for ALIGN_STACK attribute. */ +static void ALIGN_STACK w32_beginthread_wrapper (void *arg) { (void)thread_start_address (arg); diff --git a/src/w32term.h b/src/w32term.h index 16b44b0ca2f..8d08ca0a2bf 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -22,13 +22,14 @@ along with GNU Emacs. If not, see . */ #include "frame.h" #include "atimer.h" -/* Stack alignment stuff. Every CALLBACK function should have the - ALIGN_STACK attribute if it manipulates Lisp objects, because - Windows x86 32-bit ABI only guarantees 4-byte stack alignment, and - that is what we will get when a Windows function calls us. The - ALIGN_STACK attribute forces GCC to emit a preamble code to - re-align the stack at function entry. Further details about this - can be found in http://www.peterstock.co.uk/games/mingw_sse/. */ +/* Stack alignment stuff. Every CALLBACK and thread function should + have the ALIGN_STACK attribute if it manipulates Lisp objects, + because Windows x86 32-bit ABI only guarantees 4-byte stack + alignment, and that is what we will get when a Windows function + calls us. The ALIGN_STACK attribute forces GCC to emit a preamble + code to re-align the stack at function entry. Further details + about this can be found in + http://www.peterstock.co.uk/games/mingw_sse/. */ #ifdef __GNUC__ # if USE_STACK_LISP_OBJECTS && !defined _WIN64 && !defined __x86_64__ \ && __GNUC__ + (__GNUC_MINOR__ > 1) >= 5 From 05aadd89900873f0d94a151c3fb0002f267151f5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Oct 2017 11:17:34 +0300 Subject: [PATCH 08/55] Fix fontification of ALIGN_STACK functions * .dir-locals.el (c-mode) : Add "ALIGN_STACK", to correctly fontify functions with this attribute. --- .dir-locals.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index a3705f4d93c..eb80d969fb4 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -2,7 +2,7 @@ (sentence-end-double-space . t) (fill-column . 70))) (c-mode . ((c-file-style . "GNU") - (c-noise-macro-names . ("UNINIT")))) + (c-noise-macro-names . ("UNINIT" "ALIGN_STACK")))) (objc-mode . ((c-file-style . "GNU"))) (log-edit-mode . ((log-edit-font-lock-gnu-style . t) (log-edit-setup-add-author . t))) From eda9f5018cdf8e23f47f5f7421539ce56ed7148b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Oct 2017 11:19:56 +0300 Subject: [PATCH 09/55] Another fix for C mode fontification of w32 source files * .dir-locals.el (c-mode) : Add "CALLBACK", to correctly fontify functions with this attribute. --- .dir-locals.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index eb80d969fb4..68eb58fa18b 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -2,7 +2,7 @@ (sentence-end-double-space . t) (fill-column . 70))) (c-mode . ((c-file-style . "GNU") - (c-noise-macro-names . ("UNINIT" "ALIGN_STACK")))) + (c-noise-macro-names . ("UNINIT" "CALLBACK" "ALIGN_STACK")))) (objc-mode . ((c-file-style . "GNU"))) (log-edit-mode . ((log-edit-font-lock-gnu-style . t) (log-edit-setup-add-author . t))) From 4e59ecc646e88a7a756f1850d92fd2b8780513eb Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 14 Oct 2017 10:30:09 +0200 Subject: [PATCH 10/55] Fix wording in Elisp manual's child frames section (Bug#28819) * doc/lispref/frames.texi (Child Frames): Fix wording (Bug#28819). --- doc/lispref/frames.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 07a8b825026..ad853418ac4 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -3202,7 +3202,7 @@ a number of other ways as well. Here we sketch a few of them: @item The semantics of maximizing and iconifying child frames is highly window-system dependent. As a rule, applications should never invoke -these operations for on frames. By default, invoking +these operations on child frames. By default, invoking @code{iconify-frame} on a child frame will try to iconify the top-level frame corresponding to that child frame instead. To obtain a different behavior, users may customize the option @code{iconify-child-frame} From def9715282f71953740e8b92cf6443bfc459dd41 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 14 Oct 2017 12:52:05 +0200 Subject: [PATCH 11/55] ; Cleanup of etc/NEWS --- etc/NEWS | 219 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 112 insertions(+), 107 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a3c6a124217..2b2aa7c0f0f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1,6 +1,6 @@ GNU Emacs NEWS -- history of user-visible changes. -Copyright (C) 2014-2017 Free Software Foundation, Inc. +Copyright (C) 2016-2017 Free Software Foundation, Inc. See the end of the file for license conditions. Please send Emacs bug reports to bug-gnu-emacs@gnu.org. @@ -58,7 +58,7 @@ configure option '--disable-libsystemd'. +++ ** A systemd user unit file is provided. Use it in the standard way: -systemctl --user enable emacs +'systemctl --user enable emacs'. (If your Emacs is installed in a non-standard location, you may need to copy the emacs.service file to eg ~/.config/systemd/user/) @@ -107,10 +107,10 @@ requirements. The option makes Emacs abort if a module-related assertion triggers. +++ -** Emacs now supports 24-bit colors on capable text terminals +** Emacs now supports 24-bit colors on capable text terminals. Terminal is automatically initialized to use 24-bit colors if the required capabilities are found in terminfo. See the FAQ node -"Colors on a TTY" for more information. +"(efaq) Colors on a TTY" for more information. +++ ** Emacs now obeys the X resource "scrollBar" at startup. @@ -121,8 +121,8 @@ The effect is similar to that of "toolBar" resource on the tool bar. +++ ** Option 'buffer-offer-save' can be set to new value, 'always'. When - set to 'always', the command `save-some-buffers' will always offer - this buffer for saving. +set to 'always', the command 'save-some-buffers' will always offer +this buffer for saving. ** Security vulnerability related to Enriched Text mode is removed. @@ -176,8 +176,8 @@ explicitly yields. Global variables are shared among all threads, but a 'let' binding is thread-local. Each thread also has its own current buffer and its own match data. -See the chapter "Threads" in the ELisp manual for full documentation -of these facilities. +See the chapter "(elisp) Threads" in the ELisp manual for full +documentation of these facilities. +++ ** The new user variable 'electric-quote-chars' provides a list @@ -224,8 +224,9 @@ frame by evaluating this form: (modify-frame-parameters nil '((inhibit-double-buffering . t))) --- -The group 'wp', whose label was "text", is now deprecated. -Use the new group 'text', which inherits from 'wp', instead. +** The customization group 'wp', whose label was "text", is now +deprecated. Use the new group 'text', which inherits from 'wp', +instead. +++ ** The new function 'call-shell-region' executes a command in an @@ -339,13 +340,13 @@ eliminated, and integer strings work everywhere. ** It is possible to disable attempted recovery on fatal signals. Two new variables support disabling attempts to recover from stack overflow and to avoid automatic auto-save when Emacs is delivered a -fatal signal. 'attempt-stack-overflow-recovery', if set to 'nil', +fatal signal. 'attempt-stack-overflow-recovery', if set to nil, will disable attempts to recover from C stack overflows; Emacs will then crash as with any other fatal signal. -'attempt-orderly-shutdown-on-fatal-signal', if set to 'nil', will +'attempt-orderly-shutdown-on-fatal-signal', if set to nil, will disable attempts to auto-save the session and shut down in an orderly fashion when Emacs receives a fatal signal; instead, Emacs will -terminate immediately. Both variables are non-'nil' by default. +terminate immediately. Both variables are non-nil by default. These variables are for users who would like to avoid the small probability of data corruption due to techniques Emacs uses to recover in these situations. @@ -362,7 +363,7 @@ See the variable 'dir-locals-file-2' for more information. +++ ** Connection-local variables can be used to specify local variables with a value depending on the connected remote server. For details, -see the node "Connection Local Variables" in the ELisp manual. +see the node "(elisp) Connection Local Variables" in the ELisp manual. --- ** International domain names (IDNA) are now encoded via the new @@ -382,7 +383,7 @@ debug.el and edebug.el have been updated to heed to this variable. --- ** Values in call stack frames are now displayed using 'cl-prin1'. -The old behaviour of using 'prin1' can be restored by customizing the +The old behavior of using 'prin1' can be restored by customizing the new option 'debugger-print-function'. +++ @@ -420,17 +421,17 @@ want to reverse the direction of the scroll, customize 'mwheel-flip-direction'. +++ -** Emacsclient has a new option -u/--suppress-output. +** Emacsclient has a new option '-u' / '--suppress-output'. This option suppresses display of return values from the server process. +++ -** Emacsclient has a new option -T/--tramp. +** Emacsclient has a new option '-T' / '--tramp'. This helps with using a local Emacs session as the server for a remote emacsclient. With appropriate setup, one can now set the EDITOR environment variable on a remote machine to emacsclient, and use the local Emacs to edit remote files via Tramp. See the node -"emacsclient Options" in the user manual for the details. +"(emacs) emacsclient Options" in the user manual for the details. --- ** New user option 'dig-program-options' and extended functionality @@ -456,17 +457,17 @@ display of raw bytes from octal to hex. +++ ** You can now provide explicit field numbers in format specifiers. -For example, '(format "%2$s %1$s" "X" "Y")' produces "Y X". +For example, '(format "%2$s %1$s %2$s" "X" "Y")' produces "Y X Y". +++ ** Emacs now supports optional display of line numbers in the buffer. -This is similar to what linum-mode provides, but much faster and +This is similar to what 'linum-mode' provides, but much faster and doesn't usurp the display margin for the line numbers. Customize the buffer-local variable 'display-line-numbers' to activate this optional -display. Alternatively, you can use the `display-line-numbers-mode' -minor mode or the global `global-display-line-numbers-mode'. When -using these modes, customize `display-line-numbers-type' with the same -value as you would use with `display-line-numbers'. +display. Alternatively, you can use the 'display-line-numbers-mode' +minor mode or the global 'global-display-line-numbers-mode'. When +using these modes, customize 'display-line-numbers-type' with the same +value as you would use with 'display-line-numbers'. Line numbers are not displayed at all in minibuffer windows and in tooltips, as they are not useful there. @@ -480,13 +481,13 @@ Lisp programs that need to know how much screen estate is used up for line-number display in a window can use the new function 'line-number-display-width'. -Linum mode and all similar packages are henceforth becoming obsolete. +'linum-mode' and all similar packages are henceforth becoming obsolete. Users and developers are encouraged to switch to this new feature instead. +++ ** emacsclient now accepts command-line options in ALTERNATE_EDITOR -and --alternate-editor. For example, ALTERNATE_EDITOR="emacs -Q -nw". +and '--alternate-editor'. For example, ALTERNATE_EDITOR="emacs -Q -nw". Arguments may be quoted "like this", so that for example an absolute path containing a space may be specified; quote escaping is not supported. @@ -526,8 +527,8 @@ the end of the window, e.g. "5-17%". The new option +++ ** Two new user options 'list-matching-lines-jump-to-current-line' and -'list-matching-lines-current-line-face' to show highlighted the current -line in *Occur* buffer. +'list-matching-lines-current-line-face' to show the current line +highlighted in *Occur* buffer. +++ ** The 'occur' command can now operate on the region. @@ -590,7 +591,7 @@ different buffer while keeping point, mark, markers, and text properties as intact as possible. +++ -** New commands 'apropos-local-variable' and 'apropos-local-value. +** New commands 'apropos-local-variable' and 'apropos-local-value'. These are buffer-local versions of 'apropos-variable' and 'apropos-value', respectively. They show buffer-local variables whose names and values, respectively, match a given pattern. @@ -614,7 +615,7 @@ state to take effect (making a frame visible, for example). See the file ORG-NEWS for user-visible changes in Org. --- -** New function `cl-generic-p'. +** New function 'cl-generic-p'. ** Dired @@ -666,17 +667,17 @@ keep previous behavior. ** html2text is now marked obsolete. --- -** smerge-refine-regions can refine regions in separate buffers +** smerge-refine-regions can refine regions in separate buffers. --- ** Info menu and index completion uses substring completion by default. -This can be customized via the info-menu category in -completion-category-override. +This can be customized via the 'info-menu' category in +'completion-category-overrides'. +++ ** The ancestor buffer is shown by default in 3-way merges. -A new option ediff-show-ancestor and a new toggle -ediff-toggle-show-ancestor. +A new option 'ediff-show-ancestor' and a new toggle +'ediff-toggle-show-ancestor'. --- ** TeX: Add luatex and xetex as alternatives to pdftex @@ -707,7 +708,7 @@ bound to 'Buffer-menu-unmark-all-buffers'. ** Gnus --- -*** The .newsrc file will now only be saved if the native select +*** The ~/.newsrc file will now only be saved if the native select method is an NNTP select method. +++ @@ -716,9 +717,10 @@ added: 'C-c C-s C-m C-m'. +++ -*** In message-citation-line-format the %Z format is now the time zone name -instead of the numeric form. The %z format continues to be the -numeric form. The new behavior is compatible with format-time-string. +*** In 'message-citation-line-format' the '%Z' format is now the time +zone name instead of the numeric form. The '%z' format continues to +be the numeric form. The new behavior is compatible with +'format-time-string'. ** Ibuffer @@ -785,7 +787,7 @@ whose content matches a regexp; bound to '% g'. --- *** New user option 'comint-move-point-for-matching-input' to control -where to place point after C-c M-r and C-c M-s. +where to place point after 'C-c M-r' and 'C-c M-s'. ** Compilation mode @@ -818,7 +820,7 @@ breakpoint (e.g. with "f" and "o") by customizing the new option 'edebug-sit-on-break'. +++ -*** New customizable option 'edebug-max-depth' +*** New customizable option 'edebug-max-depth'. This allows to enlarge the maximum recursion depth when instrumenting code. @@ -860,7 +862,6 @@ bigger than the current window). avoid accidentally accessing remote links may rebind 'w' and 'u' in 'eww-link-keymap' to it. - ** Ido --- @@ -893,8 +894,8 @@ also available in 'image-mode'. +++ *** A new library for creating and manipulating SVG images has been -added. See the "SVG Images" section in the Lisp reference manual for -details. +added. See the "(elisp) SVG Images" section in the ELisp reference +manual for details. +++ *** New setf-able function to access and set image parameters is @@ -936,10 +937,10 @@ instead of shell command strings. This change affects 'image-dired-cmd-write-exif-data-options', 'image-dired-cmd-read-exif-data-options', and introduces 'image-dired-cmd-pngnq-options', 'image-dired-cmd-pngcrush-options', -'image-dired-cmd-create-standard-thumbnail-options' +'image-dired-cmd-create-standard-thumbnail-options'. --- -*** Recognizes more tools by default, including pngnq-s9 and OptiPNG +*** Recognizes more tools by default, including pngnq-s9 and OptiPNG. --- *** 'find-file' and related commands now work on thumbnails and @@ -978,7 +979,7 @@ there are now top-level domains added all the time. Message will no longer warn about sending emails to top-level domains it hasn't heard about. -*** 'message-beginning-of-line' (bound to C-a) understands folded headers. +*** 'message-beginning-of-line' (bound to 'C-a') understands folded headers. In 'visual-line-mode' it will look for the true beginning of a header while in non-'visual-line-mode' it will move the point to the indented header's value. @@ -988,7 +989,7 @@ header's value. +++ *** The new variable 'package-gnupghome-dir' has been added to control where the GnuPG home directory (used for signature verification) is -located and whether GnuPG's option "--homedir" is used or not. +located and whether GnuPG's option '--homedir' is used or not. --- *** Deleting a package no longer respects 'delete-by-moving-to-trash'. @@ -1070,8 +1071,8 @@ background. +++ ** Emacs now supports character name escape sequences in character and -string literals. The syntax variants \N{character name} and -\N{U+code} are supported. +string literals. The syntax variants '\N{character name}' and +'\N{U+code}' are supported. +++ ** Prog mode has some support for multi-mode indentation. @@ -1083,7 +1084,7 @@ A major mode can provide indentation context for a sub-mode through the 'prog-indentation-context' variable. To support this, modes that provide indentation should use 'prog-widen' instead of 'widen' and 'prog-first-column' instead of a literal zero. See the node -"Mode-Specific Indent" in the ELisp manual for more details. +"(elisp) Mode-Specific Indent" in the ELisp manual for more details. ** ERC @@ -1140,12 +1141,12 @@ to a format suitable for reverse lookup zone files. +++ *** Enchant is now supported as a spell-checker. -Enchant is a meta-spell-checker that uses providers -such as Hunspell to do the actual checking. With it, users can use -spell-checkers not directly supported by Emacs, such as Voikko, Hspell -and AppleSpell, more easily share personal word-lists with other -programs, and configure different spelling-checkers for different -languages. (Version 2.1.0 or later of Enchant is required.) +Enchant is a meta-spell-checker that uses providers such as Hunspell +to do the actual checking. With it, users can use spell-checkers not +directly supported by Emacs, such as Voikko, Hspell and AppleSpell, +more easily share personal word-lists with other programs, and +configure different spelling-checkers for different languages. +(Version 2.1.0 or later of Enchant is required.) ** Flymake @@ -1161,7 +1162,7 @@ check your buffer from different perspectives (see variable 'flymake-diagnostic-functions'). Backends for Emacs Lisp mode are provided. -The old Flymake behaviour is preserved in the so-called "legacy +The old Flymake behavior is preserved in the so-called "legacy backend", which has been updated to benefit from the new UI features. @@ -1178,10 +1179,10 @@ backend", which has been updated to benefit from the new UI features. mode for *.html files. This mode handles indentation, fontification, and commenting for embedded JavaScript and CSS. -** New mode 'conf-toml-mode' is a sub-mode of conf-mode, specialized - for editing TOML files. +** New mode 'conf-toml-mode' is a sub-mode of 'conf-mode', specialized +for editing TOML files. -** New mode 'conf-desktop-mode' is a sub-mode of conf-unix-mode, +** New mode 'conf-desktop-mode' is a sub-mode of 'conf-unix-mode', specialized for editing freedesktop.org desktop entries. ** New minor mode 'pixel-scroll-mode' provides smooth pixel-level scrolling. @@ -1193,11 +1194,11 @@ editing Less files. * Incompatible Lisp Changes in Emacs 26.1 --- -*** password-data is now a hash-table -so that `password-read' can use any object for the `key' argument. +** 'password-data' is now a hash-table so that 'password-read' can use +any object for the 'key' argument. +++ -*** Command 'dired-mark-extension' now automatically prepends a '.' to the +** Command 'dired-mark-extension' now automatically prepends a '.' to the extension when not present. The new command 'dired-mark-suffix' behaves similarly but it doesn't prepend a '.'. @@ -1221,25 +1222,29 @@ binding syntax as 'and-let*'. --- ** 'C-up', 'C-down', 'C-left' and 'C-right' are now defined in term mode to send the same escape sequences that xterm does. This makes -things like forward-word in readline work. +things like 'forward-word' in readline work. --- ** hideshow mode got four key bindings that are analogous to outline -mode bindings: 'C-c @ C-a', 'C-c @ C-t', 'C-c @ C-d', and 'C-c @ C-e.' +mode bindings: 'C-c @ C-a', 'C-c @ C-t', 'C-c @ C-d', and 'C-c @ C-e'. --- ** Customizable variable 'query-replace-from-to-separator' now doesn't propertize the string value of the separator. -Instead, text properties are added by query-replace-read-from. +Instead, text properties are added by 'query-replace-read-from'. Additionally, the new nil value restores pre-24.5 behavior of not providing replacement pairs via the history. --- ** Some obsolete functions, variables, and faces have been removed: -*** make-variable-frame-local. Variables cannot be frame-local any more. -*** From subr.el: window-dot, set-window-dot, read-input, show-buffer, -eval-current-buffer, string-to-int -*** icomplete-prospects-length. + +*** 'make-variable-frame-local'. Variables cannot be frame-local any more. + +*** From subr.el: 'window-dot', 'set-window-dot', 'read-input', +'show-buffer', 'eval-current-buffer', 'string-to-int'. + +*** 'icomplete-prospects-length'. + *** All the default-FOO variables that hold the default value of the FOO variable. Use 'default-value' and 'setq-default' to access and change FOO, respectively. The exhaustive list of removed variables is: @@ -1257,7 +1262,8 @@ change FOO, respectively. The exhaustive list of removed variables is: 'default-cursor-in-non-selected-windows', 'default-buffer-file-coding-system', 'default-major-mode', and 'default-enable-multibyte-characters'. -*** Many variables obsoleted in 22.1 referring to face symbols + +*** Many variables obsoleted in 22.1 referring to face symbols. +++ ** The variable 'text-quoting-style' is now a customizable option. It @@ -1272,9 +1278,9 @@ now generate less chatter and more-compact diagnostics. The auxiliary function 'check-declare-errmsg' has been removed. +++ -** The regular expression character class [:blank:] now matches +** The regular expression character class '[:blank:]' now matches Unicode horizontal whitespace as defined in the Unicode Technical -Standard #18. If you only want to match space and tab, use [ \t] +Standard #18. If you only want to match space and tab, use '[ \t]' instead. +++ @@ -1296,8 +1302,8 @@ characters: ‘’‛“”‟〞"', unless they are escaped with backslash. +++ ** 'default-file-name-coding-system' now defaults to a coding system -that does not process CRLF. For example, it defaults to utf-8-unix -instead of to utf-8. Before this change, Emacs would sometimes +that does not process CRLF. For example, it defaults to 'utf-8-unix' +instead of to 'utf-8'. Before this change, Emacs would sometimes mishandle file names containing these control characters. +++ @@ -1368,9 +1374,10 @@ documentation and had inherent races that led to security holes. A call like (rename-file C D) that used the old, undocumented behavior can be written as (rename-file C (file-name-as-directory D)), a formulation portable to both older and newer versions of Emacs. -Affected functions include add-name-to-file, copy-directory, -copy-file, format-write-file, gnus-copy-file, make-symbolic-link, -rename-file, thumbs-rename-images, and write-file. +Affected functions include 'add-name-to-file', 'copy-directory', +'copy-file', 'format-write-file', 'gnus-copy-file', +'make-symbolic-link', 'rename-file', 'thumbs-rename-images', and +'write-file'. --- ** The list returned by 'overlays-at' is now in decreasing priority order. @@ -1395,6 +1402,7 @@ Programs that called it with multiple arguments before should pass them through 'format' first. Even that is discouraged: for ElDoc support, you should set 'eldoc-documentation-function' instead of calling 'eldoc-message' directly. + * Lisp Changes in Emacs 26.1 @@ -1453,9 +1461,7 @@ range of indentation. ** New optional argument TEXT in 'make-temp-file'. --- -** New function `define-symbol-prop'. - -** Checksum/Hash +** New function 'define-symbol-prop'. +++ ** New function 'secure-hash-algorithms' to list the algorithms that @@ -1537,7 +1543,7 @@ function instead of 'subr-arity'. ** New function 'region-bounds' can be used in the interactive spec to provide region boundaries (for rectangular regions more than one) to an interactively callable function as a single argument instead of -two separate arguments region-beginning and region-end. +two separate arguments 'region-beginning' and 'region-end'. +++ ** 'parse-partial-sexp' state has a new element. Element 10 is @@ -1567,27 +1573,27 @@ compares their numerical values. According to this predicate, --- ** Numeric comparisons and 'logb' no longer return incorrect answers -due to internal rounding errors. For example, (< most-positive-fixnum -(+ 1.0 most-positive-fixnum)) now correctly returns t on 64-bit hosts. +due to internal rounding errors. For example, '(< most-positive-fixnum +(+ 1.0 most-positive-fixnum))' now correctly returns t on 64-bit hosts. --- ** The functions 'ffloor', 'fceiling', 'ftruncate' and 'fround' now accept only floating-point arguments, as per their documentation. Formerly, they quietly accepted integer arguments and sometimes -returned nonsensical answers, e.g., (< N (ffloor N)) could return t. +returned nonsensical answers, e.g., '(< N (ffloor N))' could return t. --- ** On hosts like GNU/Linux x86-64 where a 'long double' fraction contains at least EMACS_INT_WIDTH - 3 bits, 'format' no longer returns incorrect answers due to internal rounding errors when formatting -Emacs integers with %e, %f, or %g conversions. For example, on these -hosts (eql N (string-to-number (format "%.0f" N))) now returns t for -all Emacs integers N. +Emacs integers with '%e', '%f', or '%g' conversions. For example, on +these hosts '(eql N (string-to-number (format "%.0f" N)))' now returns +t for all Emacs integers N. --- ** Calls that accept floating-point integers (for use on hosts with limited integer range) now signal an error if arguments are not -integral. For example (decode-char 'ascii 0.5) now signals an error. +integral. For example '(decode-char 'ascii 0.5)' now signals an error. +++ ** The new function 'char-from-name' converts a Unicode name string @@ -1622,7 +1628,7 @@ ABBR is a time zone abbreviation. The affected functions are 'format-time-string', and 'set-time-zone-rule'. +++ -** 'format-time-string' now formats "%q" to the calendar quarter. +** 'format-time-string' now formats '%q' to the calendar quarter. +++ ** New built-in function 'mapcan'. @@ -1699,7 +1705,7 @@ run. frame's outer border. +++ -*** New frame parameters and changed semantics for older ones +*** New frame parameters and changed semantics for older ones: +++ **** 'z-group' positions a frame above or below all others. @@ -1710,8 +1716,8 @@ frame. +++ **** 'parent-frame' makes a frame the child frame of another Emacs -frame. The section "Child Frames" in the Elisp manual describes the -intrinsics of that relationship. +frame. The section "(elisp) Child Frames" in the ELisp manual +describes the intrinsics of that relationship. +++ **** 'delete-before' triggers deletion of one frame before that of @@ -1727,7 +1733,7 @@ frame. +++ **** 'skip-taskbar' removes a frame's icon from the taskbar and has -Alt- skip this frame. +'Alt-' skip this frame. +++ **** 'no-focus-on-map' avoids that a frame gets input focus when mapped. @@ -1796,19 +1802,18 @@ internal border. WINDOW for redisplay. +++ -*** Support for side windows is now official. -The display action function 'display-buffer-in-side-window' will -display its buffer in a side window. Functions for toggling all side -windows on a frame, changing and reversing the layout of side windows -and returning the main (major non-side) window of a frame are -provided. For details consult the section "Side Windows" in the Elisp -manual. +*** Support for side windows is now official. The display action +function 'display-buffer-in-side-window' will display its buffer in a +side window. Functions for toggling all side windows on a frame, +changing and reversing the layout of side windows and returning the +main (major non-side) window of a frame are provided. For details +consult the section "(elisp) Side Windows" in the ELisp manual. +++ *** Support for atomic windows - rectangular compositions of windows treated by 'split-window', 'delete-window' and 'delete-other-windows' like a single live window - is now official. For details consult the -section "Atomic Windows" in the Elisp manual. +section "(elisp) Atomic Windows" in the ELisp manual. +++ *** New 'display-buffer' alist entry 'window-parameters' allows to @@ -1854,14 +1859,14 @@ window's body. +++ *** The semantics of 'mouse-autoselect-window' has changed slightly. -For details see the section "Mouse Window Auto-selection" in the Elisp -manual. +For details see the section "(elisp) Mouse Window Auto-selection" in +the ELisp manual. --- ** 'tcl-auto-fill-mode' is now declared obsolete. Its functionality can be replicated simply by setting 'comment-auto-fill-only-comments'. -** New pcase pattern 'rx' to match against a rx-style regular expression. +** New pcase pattern 'rx' to match against an rx-style regular expression. For details, see the doc string of 'rx--pcase-macroexpander'. --- @@ -1881,7 +1886,7 @@ uniscribe). +++ ** Intercepting hotkeys on Windows 7 and later now works better. The new keyboard hooking code properly grabs system hotkeys such as -Win-* and Alt-TAB, in a way that Emacs can get at them before the +'Win-*' and 'Alt-TAB', in a way that Emacs can get at them before the system. This makes the 'w32-register-hot-key' functionality work again on all versions of MS-Windows starting with Windows 7. On Windows NT and later you can now register any hotkey combination. (On From 3c78960a4755d7bd583a0411d7089a0c13c0c64b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 14 Oct 2017 19:16:12 -0700 Subject: [PATCH 12/55] Encourage https: in commit messages * CONTRIBUTE: Prefer https: when citing. * build-aux/git-hooks/commit-msg: Diagnose http: and ftp: URLs to FSF or GNU hosts. --- CONTRIBUTE | 3 +++ build-aux/git-hooks/commit-msg | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/CONTRIBUTE b/CONTRIBUTE index 8995bb3eec4..c7f3330ab01 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -175,6 +175,9 @@ them right the first time, so here are guidelines for formatting them: bug number NNNNN in the debbugs database. This string is often parenthesized, as in "(Bug#19003)". +- When citing URLs, prefer https: to http: when either will do. In + particular, gnu.org and fsf.org URLs should start with "https:". + - Commit messages should contain only printable UTF-8 characters. - Commit messages should not contain the "Signed-off-by:" lines that diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg index 39450865cb8..e21aaf074c6 100755 --- a/build-aux/git-hooks/commit-msg +++ b/build-aux/git-hooks/commit-msg @@ -66,6 +66,8 @@ exec $awk -v at_sign="$at_sign" -v cent_sign="$cent_sign" ' non_print = "[^[:print:]]" } } + c_lower = "abcdefghijklmnopqrstuvwxyz" + unsafe_gnu_url = "(http|ftp)://([" c_lower ".]*\\.)?(gnu|fsf)\\.org" } /^#/ { @@ -125,6 +127,14 @@ exec $awk -v at_sign="$at_sign" -v cent_sign="$cent_sign" ' status = 1 } + { + if (match($0, unsafe_gnu_url)) { + url = substr($0, RSTART, RLENGTH) + printf "Use https: URL instead of '\''%s'\'' in commit message\n", url + status = 1 + } + } + $0 ~ non_print { print "Unprintable character in commit message" status = 1 From 864734d112249bac120764f1564e008231ebb6e8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 14 Oct 2017 19:18:37 -0700 Subject: [PATCH 13/55] ; Prefer https: to http: in GNU URLs --- ChangeLog.3 | 144 +++++++++++++-------------- lisp/emacs-lisp/rmc.el | 2 +- lisp/progmodes/flymake-proc.el | 2 +- lisp/progmodes/flymake.el | 2 +- test/lisp/progmodes/flymake-tests.el | 2 +- 5 files changed, 76 insertions(+), 76 deletions(-) diff --git a/ChangeLog.3 b/ChangeLog.3 index a49477a7207..811b6dbad76 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -425,7 +425,7 @@ Fix bug in recent styled_format change Problem reported by Kaushal Modi in: - http://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00141.html + https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00141.html * src/editfns.c (styled_format): Fix bug where USE_SAFE_ALLOCA was not always followed by SAFE_FREE. This bug was introduced in my patch 2017-09-26T23:31:57Z!eggert@cs.ucla.edu entitled "Avoid some @@ -2074,7 +2074,7 @@ * doc/emacs/maintaining.texi (VC Change Log): Mention the new binding. * doc/emacs/vc1-xtra.texi (Version Headers): Remove the association of 'C-x v h' with `vc-insert-headers'. - (http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00957.html) + (https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00957.html) 2017-09-30 Allen Li (tiny change) @@ -2648,7 +2648,7 @@ * doc/emacs/cmdargs.texi (Action Arguments): Don't mention 'find-file', as the implementation has changed. Reported by Everton J. Carpes in - http://lists.gnu.org/archive/html/help-gnu-emacs/2017-09/msg00146.html. + https://lists.gnu.org/archive/html/help-gnu-emacs/2017-09/msg00146.html. 2017-09-19 Eli Zaretskii @@ -2843,7 +2843,7 @@ * src/eval.c (push_handler_nosignal): Use CACHEABLE to work around GCC compilation warning. Suggested by Paul Eggert - in http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00492.html. + in https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00492.html. 2017-09-17 Michael Albinus @@ -3162,7 +3162,7 @@ * src/lisp.h (pI) [__MINGW32__]: Provide definition that will hopefully DTRT with both MinGW64 and mingw.org's MinGW. See - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00171.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00171.html for the details. * src/conf_post.h (PRINTF_ARCHETYPE) [MINGW_W64]: Separate definition specific to MinGW64. @@ -3198,7 +3198,7 @@ Port renameat_noreplace to openSUSE 12.3 Problem reported by M. Nomiya in: - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00363.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00363.html * src/sysdep.c (renameat_noreplace): Call renameat2 only if CYGWIN. @@ -3402,7 +3402,7 @@ * doc/misc/gnus.texi (Saving Articles): Document behavior with directory name targets (Bug#27986). Problem reported by Katsumi Yamaoka in: - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00216.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00216.html 2017-09-12 Mark Oteiza @@ -3774,7 +3774,7 @@ * configure.ac (srcdir) [mingw32]: Downcase the drive letter, to avoid warnings from find-file-noselect when making autoloads. For the details, see - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00049.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00049.html. 2017-09-10 Mark Oteiza @@ -4006,7 +4006,7 @@ bit-shifting, to avoid compiler warnings. (w32font_text_extents): Tell GCC NGLYPHS is non-negative, to avoid a warning. For details of the warning, see - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00093.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00093.html. * src/term.c (keys) [WINDOWSNT]: Don't define, as it is not used in that build. * src/sound.c (sound_perror): Ifdef away on WINDOWSNT, as this @@ -4093,7 +4093,7 @@ autogen.sh: omit bogus chatter if no .git Problem reported by Angelo Graziosi in: - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00045.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00045.html * autogen.sh (git_config): Do not execut 'git' if $do_git fails. 2017-09-07 Glenn Morris @@ -4112,7 +4112,7 @@ * doc/lispref/functions.texi (Mapping Functions): Fix the order of @example and @group. For the details, see - http://lists.gnu.org/archive/html/bug-texinfo/2017-09/msg00007.html. + https://lists.gnu.org/archive/html/bug-texinfo/2017-09/msg00007.html. 2017-09-06 Mark Oteiza @@ -4240,7 +4240,7 @@ Revert recent float→double Motif change Problem reported by Martin Rudalics in: - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00014.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00014.html * src/xterm.c (xm_scroll_callback, xaw_jump_callback) (x_set_toolkit_scroll_bar_thumb) (x_set_toolkit_horizontal_scroll_bar_thumb): @@ -5390,7 +5390,7 @@ * src/w32term.c (x_get_scale_factor): * src/xterm.c (x_get_scale_factor): Don't let the scale factors become less than 1. Reported by Yuri D'Elia in - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00459.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00459.html. 2017-08-21 Sam Steingold @@ -5940,7 +5940,7 @@ Apparently Gitlab doesn’t create .git/hooks, like regular Git does. Problem reported by Ted Zlatanov in: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00380.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00380.html * autogen.sh (git_sample_hook_src): New function. Use it to work even if .git/hooks or its samples do not exist. @@ -6209,7 +6209,7 @@ Default autogen.sh to 'all' This addresses a problem noted by RMS in: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00052.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00052.html * autogen.sh (do_git): Set to true if this script is invoked with no arguments and there is a .git subdirectory. @@ -6689,7 +6689,7 @@ Fix some crashes on self-modifying Elisp code Prompted by a problem report by Alex in: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00143.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00143.html * src/eval.c (For, Fprogn, Fsetq, FletX, eval_sub): Compute XCDR (x) near XCAR (x); although this doesn't fix any bugs, it is likely to run a bit faster with typical hardware caches. @@ -6976,7 +6976,7 @@ Port recent rename changes to RHEL 7 + NFS Problem reported by Ted Zlatanov in: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00082.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00082.html * src/fileio.c (Frename_file): On RHEL 7 + NFS, renameat2 can fail with errno == EINVAL when it is not supported. So treat that case like errno == ENOSYS. Also, when ok_if_already_exists is neither @@ -7009,7 +7009,7 @@ * configure.ac (with_mailutils): Default to 'yes' if GNU Mailutils is installed. See: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00054.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00054.html 2017-08-02 Paul Eggert @@ -8075,7 +8075,7 @@ bury-buffer to exit todo-mode. This restores the desired behavior of not immediately returning to the exited todo-mode buffer on quitting another buffer, which a dired bug fix had changed (see - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00739.html). + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00739.html). 2017-07-19 Tino Calancha @@ -8146,8 +8146,8 @@ Port gnutls.c to older (buggier?) GnuTLS Problem reported for GnuTLS 3.2.1 by Glenn Morris in: - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00716.html - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00742.html + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00716.html + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00742.html Although I don't see how this bug can occur with vanilla GnuTLS 3.2.1, perhaps hydra was using a modified GnuTLS. * src/gnutls.c (Fgnutls_ciphers): Don't assume GNUTLS_CIPHER_NULL @@ -8663,8 +8663,8 @@ * lisp/faces.el (line-number): Don't use a fixed-pitch font, by popular demand. For relevant discussions, see - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00433.html - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00445.html + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00433.html + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00445.html 2017-07-14 Paul Eggert @@ -10603,7 +10603,7 @@ Adjust lm-verify to accept current notices Problem reported by Mike Kupfer in: - http://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00512.html + https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00512.html * lisp/emacs-lisp/lisp-mnt.el (lm-crack-copyright): Do not require later lines in a copyright notice to have more indentation than earlier lines. @@ -12009,7 +12009,7 @@ (gdb-send): Don't increment gdb-control-level if the command matches gdb-python-guile-commands-regexp and has non-empty arguments. Reported by David Boles in - http://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00009.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00009.html. 2017-06-10 Eli Zaretskii @@ -12707,7 +12707,7 @@ * src/doprnt.c (doprnt): Format "%%" correctly. Problem reported by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00901.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00901.html 2017-06-01 Paul Eggert @@ -12806,7 +12806,7 @@ * lisp/emacs-lisp/eldoc.el (eldoc--supported-p): New function. (turn-on-eldoc-mode, eldoc-mode): Use it. - (http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00865.html) + (https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00865.html) 2017-05-30 Glenn Morris @@ -13638,7 +13638,7 @@ * lisp/net/tls.el (tls-program, tls-checktrust): Remove s_client. Ref http://bugs.debian.org/766397 - http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00803.html + https://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00803.html (cherry picked from commit 6e45de6bacc508db11b15b2c8ba86aad8c0570df) @@ -14070,7 +14070,7 @@ * src/emacs-module.c (module_reset_handlerlist): Check handlerlist. Suggested by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html 2017-05-20 Paul Eggert @@ -14078,7 +14078,7 @@ * configure.ac (WERROR_CFLAGS): Omit -Wmissing-braces for Clang, to shut off a false alarm. Problem reportd by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html 2017-05-20 Noam Postavsky @@ -14150,7 +14150,7 @@ * etc/PROBLEMS: Describe problems with Microsoft Intellipoint and mouse-2 events. For the details, see - http://lists.gnu.org/archive/html/help-emacs-windows/2017-05/msg00009.html. + https://lists.gnu.org/archive/html/help-emacs-windows/2017-05/msg00009.html. 2017-05-19 Nick Helm (tiny change) @@ -14245,7 +14245,7 @@ Attempt to work around macOS vfork bug Problem reported by YAMAMOTO Mitsuharu in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00342.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00342.html This is related to the fix for Bug#26397. * src/callproc.c (call_process_cleanup, call_process) [!MSDOS]: Report internal error if wait_for_termination fails. @@ -14269,7 +14269,7 @@ Don’t compile the (DARWIN_OS_CASE_SENSITIVE_FIXME == 2) code unless DARWIN_OS_CASE_SENSITIVE_FIXME is 2. Problem reported by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html 2017-05-19 Paul Eggert @@ -14277,7 +14277,7 @@ * configure.ac (WERROR_CFLAGS): Omit -Wdouble-promotion if clang. Problem reported by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html 2017-05-19 Paul Eggert @@ -14362,7 +14362,7 @@ Avoid undefined behavior in struct sockaddr Problem noted by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00391.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00391.html * src/conf_post.h (ATTRIBUTE_MAY_ALIAS, DECLARE_POINTER_ALIAS): New macros. * src/process.c (conv_sockaddr_to_lisp, conv_lisp_to_sockaddr) @@ -14387,7 +14387,7 @@ Work around AddressSanitizer bug with vfork Problem reported by Jim Meyering in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00246.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00246.html * src/conf_post.h (vfork) [ADDRESS_SANITIZER]: Define to fork. Unfortunately with the AddressSanitizer in Fedora 25 x86-64, the vforked child messes up the parent’s shadow memory. This is too @@ -14452,7 +14452,7 @@ multiple calls and struct literals in the last case of a switch. The old code ran afoul of GCC bug 80659, which caused an internal compiler error. Problem reported by Jim Meyering in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00182.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00182.html https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80659 2017-05-16 Paul Eggert @@ -14563,9 +14563,9 @@ * src/process.c (connect_network_socket): Use struct sockaddr_storage, not struct sockaddr_in, to store info about a socket address. Problem reported by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00314.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00314.html This fix is based on a patch by Philipp in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00357.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00357.html 2017-05-14 Gemini Lasswell @@ -15156,7 +15156,7 @@ Compare unqualified type to Lisp_Object, to do the right thing when the expression has type ‘Lisp_Object const’. Problem reported by Eli Zaretskii in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00138.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00138.html 2017-05-06 Paul Eggert @@ -15295,7 +15295,7 @@ * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Denote the edebug spec part for qualifiers as [&rest atom], per - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00053.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00053.html. 2017-05-05 Mike Kupfer @@ -16077,7 +16077,7 @@ * lisp/net/tls.el (tls-program, tls-checktrust): Remove s_client. Ref http://bugs.debian.org/766397 - http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00803.html + https://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00803.html 2017-04-25 Glenn Morris @@ -16706,7 +16706,7 @@ * src/lisp.h (STRING_SET_CHARS): Add an assertion and commentary to prevent incorrect usage. For details, see this discussion: - http://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00412.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00412.html. 2017-04-16 Eli Zaretskii @@ -18130,7 +18130,7 @@ * lisp/emacs-lisp/package.el (package-archives): Default to https for elpa.gnu.org if gnutls is available. Ref: - http://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00130.html + https://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00130.html 2017-04-04 Paul Eggert @@ -18369,7 +18369,7 @@ Fix bugs in simplified test dependencies Problem reported by Glenn Morris in: - http://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00017.html + https://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00017.html * test/Makefile.in (LOGFILES, TESTS): Omit leading "./". (TESTS): Omit unnecessary patsubst. (test_template): Redo dependency heuristic, hopefully @@ -18778,7 +18778,7 @@ Fix redisplay glitches due to recent change in redisplay_internal * src/xdisp.c (redisplay_internal): A better fix for bug#26097. - See http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00695.html + See https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00695.html for the problems caused by the original fix. 2017-03-26 Michael Albinus @@ -18938,7 +18938,7 @@ Don’t require chown/chgrp for game installation Problem reported by Joseph Mingrone in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00622.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00622.html * lib-src/Makefile.in (exp_archlibdir): Don’t fail if chown or chgrp fails with update-game-score and the game directory. Instead, expect the installer to fix this up afterwards. @@ -19072,7 +19072,7 @@ Don’t remove dependency files when configuring Problem reported by Tom Tromey in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00533.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00533.html * configure.ac: Don’t remove */*.o and */deps/* when --enable-autodepend is in effect. @@ -19081,7 +19081,7 @@ Make --without-pop the default. Suggested by Angelo Graziosi in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00431.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00431.html * configure.ac: Change the default from --with-pop to --without-pop. Adjust diagnostics to match. @@ -19118,7 +19118,7 @@ org-src fontify buffers" the hooks were enabled also for modifications to the original org buffer. This causes fontification errors when combined with certain packages, as reported in - http://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00420.html. + https://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00420.html. * lisp/org/org-src.el (org-src-font-lock-fontify-block): Reduce scope of inhibit-modification-hooks let-binding. @@ -19175,7 +19175,7 @@ Fix problem with out-of-date dependencies Problem reported by Robert Marshall in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00501.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00501.html Although this problem has been with us for a while, the recent change from Automake to GNU Make exposed it again. * configure.ac (AUTO_DEPEND): When autodepending, clean out any @@ -19405,7 +19405,7 @@ Port out-of-source builds to windows-nt Problem reported by Angelo Graziosi in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00431.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00431.html * lib/Makefile.in: Prepend $(srcdir) to ../nt/gnulib-cfg.mk, to handle out-of-source builds if windows-nt. @@ -20082,7 +20082,7 @@ overlay, protect against that overlay's end point being outside of the narrowed region. Reported by Filipe Silva in - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00176.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00176.html. 2017-03-10 Glenn Morris @@ -20221,7 +20221,7 @@ min and max should not return markers Problem reported by Glenn Morris in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00147.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00147.html * src/data.c (minmax_driver): Convert any marker result to an integer, since some callers assume this. * test/src/data-tests.el (data-tests-max, data-tests-min): @@ -22803,9 +22803,9 @@ Make FOR_EACH_TAIL more like other FOR_EACH macros See comments by Stefan Monnier in: - http://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00181.html + https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00181.html and by Eli Zaretskii in: - http://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00207.html + https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00207.html * src/fns.c (internal_equal): Do not bypass check for depth overflow when tail-recursing via a dotted list tail or an overlay plist, to avoid a rare infloop. @@ -23174,7 +23174,7 @@ * lisp/progmodes/xref.el (xref-collect-matches): Use '-E' together with '-e', as suggested by Noam Postavsky - (http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00780.html). + (https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00780.html). 2017-02-03 Paul Eggert @@ -23301,7 +23301,7 @@ Fix quitting bug when buffers are frozen Problem noted by Eli Zaretskii in: - http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html + https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html This patch also fixes some other issues in that report. * src/lisp.h (incr_rarely_quit): Remove. All callers changed to use rarely_quit directly. @@ -23319,7 +23319,7 @@ This fixes some infinite loops that cannot be quitted out of, e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#))) when byte-compiled and when run under X. See: - http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html + https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html This also attempts to keep the performance improvements I recently added, as much as possible under the constraint that the infloops must be caught. In some cases this fixes infloop bugs recently @@ -23448,7 +23448,7 @@ * lisp/net/tramp.el (tramp-accept-process-output): Change argument list. Make it work when called inside a timer. See - . + . 2017-01-31 Eli Zaretskii @@ -23835,7 +23835,7 @@ * lisp/textmodes/reftex-vars.el (reftex-cite-format-builtin): Add \citetitle[*] to `reftex-cite-format' and bind them to keys i/I per user request - http://lists.gnu.org/archive/html/auctex/2017-01/msg00049.html. + https://lists.gnu.org/archive/html/auctex/2017-01/msg00049.html. 2017-01-27 Lars Ingebrigtsen @@ -23872,7 +23872,7 @@ * lisp/shell.el (shell-mode): Use setq-local. Set scroll-conservatively to 101 locally. See the discussion at - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00736.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00736.html for the reasons. 2017-01-27 Michael Hoffman (tiny change) @@ -24534,7 +24534,7 @@ * lisp/simple.el (region-bounds): New function. (region-noncontiguous-p): Use it. - http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00044.html + https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00044.html 2017-01-21 Alan Mackenzie @@ -25369,7 +25369,7 @@ * lisp/textmodes/ispell.el (ispell-begin-skip-region-regexp): Protect against 'ispell-skip-region-alist' being nil. Reported by Ernest Adrogué , see - http://lists.gnu.org/archive/html/help-gnu-emacs/2017-01/msg00007.html. + https://lists.gnu.org/archive/html/help-gnu-emacs/2017-01/msg00007.html. 2017-01-06 Philipp Stephani @@ -25662,7 +25662,7 @@ Remove mistakenly-added files Problem reported by Glenn Morris in: - http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00008.html + https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00008.html * lisp/gnus/gnus-ems.el, lisp/gnus/gnus-sync.el: * lisp/gnus/messcompat.el, lisp/nxml/nxml-glyph.el: * lisp/nxml/nxml-uchnm.el, lisp/obsolete/awk-mode.el: @@ -25982,7 +25982,7 @@ This avoids the confusion of using two different phrases "main thread" and "primary thread" internally to mean the same thing. See: - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01142.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01142.html * src/thread.c (main_thread): Rename from primary_thread, since the new name no longer clashes with main_thread_id and Emacs internals normally call this the "main thread". @@ -26175,7 +26175,7 @@ Simplify prog1 implementation Inspired by a suggestion from Chris Gregory in: - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00965.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00965.html On my platform, this generates exactly the same machine insns. * src/eval.c (prog_ignore): Rename from unwind_body, since it’s more general than that. All callers changed. @@ -26326,7 +26326,7 @@ This fixes a regression introduced in - http://git.savannah.gnu.org/gitweb/?p=emacs.git;a=commit;h=2c8a7e50d24daf19ea7d86f1cfeaa98a41c56085 + https://git.savannah.gnu.org/gitweb/?p=emacs.git;a=commit;h=2c8a7e50d24daf19ea7d86f1cfeaa98a41c56085 This bug was filed in @@ -26585,7 +26585,7 @@ therefore don't need to be inserted into the red-black tree, so mem_find will never find them. Reported by Daniel Colascione in - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00817.html. + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00817.html. 2016-12-21 Stefan Monnier @@ -26618,7 +26618,7 @@ Port dumping better to WSL Problem reported by Angelo Graziosi in: - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00822.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00822.html * src/sysdep.c (disable_address_randomization): Detect buggy platforms where 'personality' always returns 0. @@ -26967,7 +26967,7 @@ needs to be, which then causes copy_executable_and_dump_data to write beyond the requested size of the file mapping, thus relying on the OS roundup to page boundary to save us from ourselves. See - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html for the details. * lib/stdio-impl.h: Revert the workaround fix of not including @@ -27501,7 +27501,7 @@ Use C99 syntax for font drivers Problem reported by Daniel Colascione in: - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00515.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00515.html * src/ftcrfont.c (ftcrfont_driver): * src/ftfont.c (ftfont_driver): * src/ftxfont.c (ftxfont_driver): diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 57bc6d9b591..0be6971992c 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -17,7 +17,7 @@ ;; 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 . +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index ab60855b217..a9caef4fc8e 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -20,7 +20,7 @@ ;; 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 . +;; along with GNU Emacs. If not, see . ;;; Commentary: ;; diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 8c9c4b211a2..5d5f9bb75d8 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -20,7 +20,7 @@ ;; 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 . +;; along with GNU Emacs. If not, see . ;;; Commentary: ;; diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index 0b29b6a9715..9f570adcc41 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -37,7 +37,7 @@ ;; ;; (defun flymake-tests--wait-for-backends () - ;; Weirdness here... http://debbugs.gnu.org/17647#25 + ;; Weirdness here... https://debbugs.gnu.org/17647#25 ;; ... meaning `sleep-for', and even ;; `accept-process-output', won't suffice as ways to get ;; process filters and sentinels to run, though they do work From a7f154688d2de911c995be9b640cee36bec66673 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Sun, 15 Oct 2017 12:40:34 +0200 Subject: [PATCH 14/55] Improve customization type of 'mouse-drag-and-drop-region' * lisp/mouse.el (mouse-drag-and-drop-region): Provide a more precise customization type. --- lisp/mouse.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/mouse.el b/lisp/mouse.el index 169d2632f4f..5eeee1ec52c 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -2349,7 +2349,15 @@ choose a font." If the value is a modifier, such as `control' or `shift' or `meta', then if that modifier key is pressed when dropping the region, region text is copied instead of being cut." - :type 'symbol + :type `(choice + (const :tag "Disable dragging the region" nil) + ,@(mapcar + (lambda (modifier) + `(const :tag ,(format "Enable, but copy with the %s modifier" + modifier) + modifier)) + '(alt super hyper shift control meta)) + (other :tag "Enable dragging the region" t)) :version "26.1" :group 'mouse) From f95cd5cd7006d2801948b75f7a270ea66d5579bf Mon Sep 17 00:00:00 2001 From: "K. Handa" Date: Sun, 15 Oct 2017 23:15:47 +0900 Subject: [PATCH 15/55] Improve customization of arabic-shaper-ZWNJ-handling. Make the effect of customizing arabic-shaper-ZWNJ-handling appear immediately. * lisp/language/misc-lang.el (arabic-shaper-ZWNJ-handling): Add :set value. * src/composite.c (Fclear_composition_cache): New function. (syms_of_composite): Defsubr it. --- lisp/language/misc-lang.el | 5 ++++- src/composite.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index a63c3a21091..cbb581fd19f 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -95,7 +95,10 @@ Customizing the value takes effect when you start Emacs next time." :type '(choice (const :tag "default" nil) (const :tag "as space" as-space) - (const :tag "absorb" absorb))) + (const :tag "absorb" absorb)) + :set (lambda (sym val) + (set-default sym val) + (clear-composition-cache))) ;; Record error in arabic-change-gstring. (defvar arabic-shape-log nil) diff --git a/src/composite.c b/src/composite.c index c01e2e3b95c..1a348ddf234 100644 --- a/src/composite.c +++ b/src/composite.c @@ -686,6 +686,20 @@ composition_gstring_from_id (ptrdiff_t id) return HASH_VALUE (h, id); } +DEFUN ("clear-composition-cache", Fclear_composition_cache, + Sclear_composition_cache, 0, 0, 0, + doc: /* Internal use only. +Clear composition cache. */) + (void) +{ + Lisp_Object args[] = {QCtest, Qequal, QCsize, make_number (311)}; + gstring_hash_table = CALLMANY (Fmake_hash_table, args); + /* Fixme: We call Fclear_face_cache to force complete re-building of + display glyphs. But, it may be better to call this function from + Fclear_face_cache instead. */ + Fclear_face_cache (Qt); +} + bool composition_gstring_p (Lisp_Object gstring) { @@ -1982,4 +1996,5 @@ See also the documentation of `auto-composition-mode'. */); defsubr (&Scompose_string_internal); defsubr (&Sfind_composition_internal); defsubr (&Scomposition_get_gstring); + defsubr (&Sclear_composition_cache); } From f79382819c60609c5eff76cb2b85c330215abf90 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 15 Oct 2017 19:13:34 +0300 Subject: [PATCH 16/55] ; * src/composite.c (Fclear_composition_cache): Fix last change. --- src/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/composite.c b/src/composite.c index 1a348ddf234..650bf8708b3 100644 --- a/src/composite.c +++ b/src/composite.c @@ -697,7 +697,7 @@ Clear composition cache. */) /* Fixme: We call Fclear_face_cache to force complete re-building of display glyphs. But, it may be better to call this function from Fclear_face_cache instead. */ - Fclear_face_cache (Qt); + return Fclear_face_cache (Qt); } bool From 325dfdae13bdc0653fe04b746326a1518ee18ff1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 15 Oct 2017 19:20:58 +0300 Subject: [PATCH 17/55] Avoid compilation warnings in optimized builds * src/process.c (Fmake_network_process): * src/image.c (xbm_scan, gif_load): * src/fileio.c (Frename_file): * src/data.c (Fmake_local_variable): * src/buffer.c (fix_start_end_in_overlays): * lib-src/etags.c (process_file_name): Mark variables with UNINIT to avoid compiler warnings in optimized builds. --- lib-src/etags.c | 2 +- src/buffer.c | 4 ++-- src/data.c | 2 +- src/fileio.c | 2 +- src/image.c | 4 ++-- src/process.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib-src/etags.c b/lib-src/etags.c index 009cba528d7..cc7631f647e 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1530,7 +1530,7 @@ process_file_name (char *file, language *lang) fdesc *fdp; compressor *compr; char *compressed_name, *uncompressed_name; - char *ext, *real_name UNINIT, *tmp_name; + char *ext, *real_name UNINIT, *tmp_name UNINIT; int retval; canonicalize_filename (file); diff --git a/src/buffer.c b/src/buffer.c index cc6021bfb5d..1c8b4635086 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -3616,8 +3616,8 @@ void fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end) { Lisp_Object overlay; - struct Lisp_Overlay *before_list; - struct Lisp_Overlay *after_list; + struct Lisp_Overlay *before_list UNINIT; + struct Lisp_Overlay *after_list UNINIT; /* These are either nil, indicating that before_list or after_list should be assigned, or the cons cell the cdr of which should be assigned. */ diff --git a/src/data.c b/src/data.c index e070be6c208..ef7210fbfa0 100644 --- a/src/data.c +++ b/src/data.c @@ -1888,7 +1888,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) (Lisp_Object variable) { Lisp_Object tem; - bool forwarded; + bool forwarded UNINIT; union Lisp_Val_Fwd valcontents; struct Lisp_Symbol *sym; struct Lisp_Buffer_Local_Value *blv = NULL; diff --git a/src/fileio.c b/src/fileio.c index e57bf46015c..b7df38c8570 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2296,7 +2296,7 @@ This is what happens in interactive use with M-x. */) bool plain_rename = (case_only_rename || (!NILP (ok_if_already_exists) && !INTEGERP (ok_if_already_exists))); - int rename_errno; + int rename_errno UNINIT; if (!plain_rename) { if (renameat_noreplace (AT_FDCWD, SSDATA (encoded_file), diff --git a/src/image.c b/src/image.c index 3dac7086cb4..cd4901b3d4f 100644 --- a/src/image.c +++ b/src/image.c @@ -2574,7 +2574,7 @@ xbm_image_p (Lisp_Object object) static int xbm_scan (char **s, char *end, char *sval, int *ival) { - unsigned char c; + unsigned char c UNINIT; loop: @@ -7839,7 +7839,7 @@ gif_load (struct frame *f, struct image *img) init_color_table (); #ifndef USE_CAIRO - unsigned long bgcolor; + unsigned long bgcolor UNINIT; if (STRINGP (specified_bg)) bgcolor = x_alloc_image_color (f, img, specified_bg, FRAME_BACKGROUND_PIXEL (f)); diff --git a/src/process.c b/src/process.c index 05feba73253..943cb2a1048 100644 --- a/src/process.c +++ b/src/process.c @@ -3830,7 +3830,7 @@ usage: (make-network-process &rest ARGS) */) Lisp_Object proc; Lisp_Object contact; struct Lisp_Process *p; - const char *portstring; + const char *portstring UNINIT; ptrdiff_t portstringlen ATTRIBUTE_UNUSED; char portbuf[INT_BUFSIZE_BOUND (EMACS_INT)]; #ifdef HAVE_LOCAL_SOCKETS From 8eb3c01dbd2ed0bd54a18ab0a13cfc262b21b45e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 15 Oct 2017 19:36:58 +0300 Subject: [PATCH 18/55] * lisp/dired-aux.el (dired-create-directory): Doc fix. --- lisp/dired-aux.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 7e2252fcf1b..03639f6b507 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1965,6 +1965,7 @@ Optional arg HOW-TO determines how to treat the target. ;;;###autoload (defun dired-create-directory (directory) "Create a directory called DIRECTORY. +Parent directories of DIRECTORY are created as needed. If DIRECTORY already exists, signal an error." (interactive (list (read-file-name "Create directory: " (dired-current-directory)))) From 616b4c59561c63b986634d666c45a73e95fac392 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Fri, 1 Sep 2017 09:38:55 -0400 Subject: [PATCH 19/55] Let select-frame-by-name choose any frame when called from lisp (Bug#25521) * lisp/frame.el (select-frame-by-name): Choose from the whole list of frames in the non-interactive part, if not found on the current display. --- etc/NEWS | 4 ++++ lisp/frame.el | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2b2aa7c0f0f..d995a3dded0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1862,6 +1862,10 @@ window's body. For details see the section "(elisp) Mouse Window Auto-selection" in the ELisp manual. +--- +*** 'select-frame-by-name' now may return a frame on another display +if it does not find a suitable one on the current display. + --- ** 'tcl-auto-fill-mode' is now declared obsolete. Its functionality can be replicated simply by setting 'comment-auto-fill-only-comments'. diff --git a/lisp/frame.el b/lisp/frame.el index f8aa5c6e523..b6c066462b0 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -892,7 +892,8 @@ Calls `suspend-emacs' if invoked from the controlling tty device, (defvar frame-name-history nil) (defun select-frame-by-name (name) - "Select the frame on the current terminal whose name is NAME and raise it. + "Select the frame whose name is NAME and raise it. +Frames on the current terminal are checked first. If there is no frame by that name, signal an error." (interactive (let* ((frame-names-alist (make-frame-names-alist)) @@ -903,11 +904,14 @@ If there is no frame by that name, signal an error." (if (= (length input) 0) (list default) (list input)))) - (let* ((frame-names-alist (make-frame-names-alist)) - (frame (cdr (assoc name frame-names-alist)))) - (if frame - (select-frame-set-input-focus frame) - (error "There is no frame named `%s'" name)))) + (select-frame-set-input-focus + ;; Prefer frames on the current display. + (or (cdr (assoc name (make-frame-names-alist))) + (catch 'done + (dolist (frame (frame-list)) + (when (equal (frame-parameter frame 'name) name) + (throw 'done frame)))) + (error "There is no frame named `%s'" name)))) ;;;; Background mode. From 5980de3727a0e80b5d70849bd2dd7054318c25d8 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 12 Oct 2017 23:25:13 -0400 Subject: [PATCH 20/55] Disable python native completion on w32 (Bug#28580) * lisp/progmodes/python.el (python-shell-completion-native-disabled-interpreters): For windows-nt systems, put an empty string to match interpreters. --- lisp/progmodes/python.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f79d9a47d31..895117b9ee3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3304,8 +3304,9 @@ the full statement in the case of imports." (defcustom python-shell-completion-native-disabled-interpreters ;; PyPy's readline cannot handle some escape sequences yet. Native ;; completion was found to be non-functional for IPython (see - ;; Bug#25067). - (list "pypy" "ipython") + ;; Bug#25067). Native completion doesn't work on w32 (Bug#28580). + (if (eq system-type 'windows-nt) '("") + '("pypy" "ipython")) "List of disabled interpreters. When a match is found, native completion is disabled." :version "25.1" From 51615a808236058ac732a5eaba239874d56fdd10 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 12 Oct 2017 22:59:53 -0400 Subject: [PATCH 21/55] Don't remember old debugger window (Bug#17882) * lisp/emacs-lisp/debug.el (debug): Unset debugger-previous-window when `debugger-will-be-back' is nil. --- lisp/emacs-lisp/debug.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 0247179a843..6c754615b00 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -253,7 +253,9 @@ first will be printed into the backtrace buffer." ;; Unshow debugger-buffer. (quit-restore-window debugger-window debugger-bury-or-kill) ;; Restore current buffer (Bug#12502). - (set-buffer debugger-old-buffer)))) + (set-buffer debugger-old-buffer))) + ;; Forget debugger window, it won't be back (Bug#17882). + (setq debugger-previous-window nil)) ;; Restore previous state of debugger-buffer in case we were ;; in a recursive invocation of the debugger, otherwise just ;; erase the buffer and put it into fundamental mode. From de60992053a6ce21afe218e37bb377e7a5713522 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 15 Oct 2017 11:38:21 -0400 Subject: [PATCH 22/55] Fix ert-test finding by symbol (Bug#28849) In 2017-07-28 "* lisp/subr.el (define-symbol-prop): New function", the symbol used for ert tests in load-history was changed from `ert-deftest' to `ert--test', but a couple of other places were not updated accordingly. * lisp/emacs-lisp/ert.el (ert-find-test-other-window): Pass `ert--test' as the TYPE to `find-function-do-it'. (top-level): Use `ert--test' as the key to the `find-function-regexp-alist' entry. --- lisp/emacs-lisp/ert.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 83acbacb883..3a3979e81f0 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1625,7 +1625,7 @@ default (if any)." (defun ert-find-test-other-window (test-name) "Find, in another window, the definition of TEST-NAME." (interactive (list (ert-read-test-name-at-point "Find test definition: "))) - (find-function-do-it test-name 'ert-deftest 'switch-to-buffer-other-window)) + (find-function-do-it test-name 'ert--test 'switch-to-buffer-other-window)) (defun ert-delete-test (test-name) "Make the test TEST-NAME unbound. @@ -2594,7 +2594,7 @@ To be used in the ERT results buffer." ;;; Actions on load/unload. -(add-to-list 'find-function-regexp-alist '(ert-deftest . ert--find-test-regexp)) +(add-to-list 'find-function-regexp-alist '(ert--test . ert--find-test-regexp)) (add-to-list 'minor-mode-alist '(ert--current-run-stats (:eval (ert--tests-running-mode-line-indicator)))) From 1ca9ae706975289aaa84cc196f7aa3ebc446713d Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sun, 15 Oct 2017 20:21:35 -0700 Subject: [PATCH 23/55] Require subr-x when compiling nnimap.el * lisp/gnus/nnimap.el (require): For the when-let* macro. --- lisp/gnus/nnimap.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 6e2a735233a..297e2923ee6 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -27,7 +27,8 @@ ;;; Code: (eval-when-compile - (require 'cl)) + (require 'cl) + (require 'subr-x)) (require 'nnheader) (require 'gnus-util) From 3205b12a78b6c52b247d8e40a70ccf23693807c5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 16 Oct 2017 01:14:58 -0700 Subject: [PATCH 24/55] Fix regression in display of PPM images Problem reported by Roland Winkler (Bug#28824#35). Based on a patch proposed by Andy Moreton (Bug#28824#38). * src/image.c (pbm_scan_index): New function. (pbm_load): Use it to decode raw data correctly when its top bit is set. --- src/image.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/image.c b/src/image.c index cd4901b3d4f..335a43e924d 100644 --- a/src/image.c +++ b/src/image.c @@ -5277,6 +5277,25 @@ pbm_scan_number (char **s, char *end) return val; } +/* Scan an index from *S and return it. It is a one-byte unsigned + index if !TWO_BYTE, and a two-byte big-endian unsigned index if + TWO_BYTE. */ + +static int +pbm_scan_index (char **s, bool two_byte) +{ + char *p = *s; + unsigned char c0 = *p++; + int n = c0; + if (two_byte) + { + unsigned char c1 = *p++; + n = (n << 8) + c1; + } + *s = p; + return n; +} + /* Load PBM image IMG for use on frame F. */ @@ -5499,7 +5518,8 @@ pbm_load (struct frame *f, struct image *img) else { int expected_size = height * width; - if (max_color_idx > 255) + bool two_byte = 255 < max_color_idx; + if (two_byte) expected_size *= 2; if (type == PBM_COLOR) expected_size *= 3; @@ -5522,24 +5542,14 @@ pbm_load (struct frame *f, struct image *img) int r, g, b; if (type == PBM_GRAY && raw_p) - { - r = g = b = *p++; - if (max_color_idx > 255) - r = g = b = r * 256 + *p++; - } + r = g = b = pbm_scan_index (&p, two_byte); else if (type == PBM_GRAY) r = g = b = pbm_scan_number (&p, end); else if (raw_p) { - r = *p++; - if (max_color_idx > 255) - r = r * 256 + *p++; - g = *p++; - if (max_color_idx > 255) - g = g * 256 + *p++; - b = *p++; - if (max_color_idx > 255) - b = b * 256 + *p++; + r = pbm_scan_index (&p, two_byte); + g = pbm_scan_index (&p, two_byte); + b = pbm_scan_index (&p, two_byte); } else { From 613db8d35c3d080fd059dfc8cf668520bf6950d2 Mon Sep 17 00:00:00 2001 From: Andy Moreton Date: Mon, 16 Oct 2017 01:23:32 -0700 Subject: [PATCH 25/55] Don't reject PBM header whitespace unnecessarily * lisp/image.el (image-type-header-regexps): Allow two or more CRs or LFs in initial whitespace sequences. See: http://netpbm.sourceforge.net/doc/pbm.html --- lisp/image.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/image.el b/lisp/image.el index 1d0776180b2..32df508bc8d 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -34,8 +34,8 @@ (defconst image-type-header-regexps `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm) ("\\`P[1-6]\\(?:\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[[:space:]]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[0-9]\\)+\ \\)\\{2\\}" . pbm) ("\\`GIF8[79]a" . gif) ("\\`\x89PNG\r\n\x1a\n" . png) From 16e85456e70174f1d97fc5a7cd8a199b8f0e7e70 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 16 Oct 2017 11:35:02 +0200 Subject: [PATCH 26/55] Fix error in tramp-smb-handle-insert-directory * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory): Insert size information only when FULL-DIRECTORY-P is non-nil. --- lisp/net/tramp-smb.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 620c93828da..f35c10b58ab 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1073,10 +1073,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." entries)) ;; Insert size information. - (insert - (if avail - (format "total used in directory %s available %s\n" used avail) - (format "total %s\n" used))) + (when full-directory-p + (insert + (if avail + (format "total used in directory %s available %s\n" used avail) + (format "total %s\n" used)))) ;; Print entries. (mapc From 081d2187c4b8b54e8415b304fffafedc4ecfe446 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 16 Oct 2017 18:51:32 +0300 Subject: [PATCH 27/55] Fix 'line-number-display-width' in hscrolled windows * src/indent.c (line_number_display_width): Make sure a line number is generated even when the first line of the window is completely hscrolled out of view. (Bug#28854) --- src/indent.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/indent.c b/src/indent.c index 26507b5eb5b..be8676600a5 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1974,6 +1974,11 @@ line_number_display_width (struct window *w, int *width, int *pixel_width) saved_restriction = true; } start_display (&it, w, wstart); + /* The call to move_it_by_lines below will not generate a line + number if the first line shown in the window is hscrolled + such that all of its display elements are out of view. So we + pretend the hscroll doesn't exist. */ + it.first_visible_x = 0; move_it_by_lines (&it, 1); *width = it.lnum_width; *pixel_width = it.lnum_pixel_width; From c63b344c3d5f6278a189a16099ee6310fad9fbd7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 16 Oct 2017 19:25:01 +0300 Subject: [PATCH 28/55] Fix range-error in image-dired.el * lisp/image-dired.el (image-dired-create-thumb-1): Avoid overflowing an Emacs integer on 32-bit hosts. (Bug#28809) --- lisp/image-dired.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/image-dired.el b/lisp/image-dired.el index f48f1a1b874..30ecc2befc7 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -748,7 +748,10 @@ Increase at own risk.") 'image-dired-cmd-create-thumbnail-program) (let* ((width (int-to-string (image-dired-thumb-size 'width))) (height (int-to-string (image-dired-thumb-size 'height))) - (modif-time (floor (float-time (nth 5 (file-attributes original-file))))) + (modif-time + (format "%.0f" + (ffloor (float-time + (nth 5 (file-attributes original-file)))))) (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png" thumbnail-file)) (spec From db68cefe72e5c68fa81796028a52de1b8e6480aa Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 16 Oct 2017 19:36:06 +0300 Subject: [PATCH 29/55] Fix errors in kmacro.el post-command-hook * lisp/kmacro.el (kmacro-step-edit-active): Initialize to nil to avoid 'void-variable' errors. (Bug#28818) * test/lisp/kmacro-tests.el (kmacro-tests-step-edit-cleans-up-hook): Now succeeds. (Bug#18708) --- lisp/kmacro.el | 2 +- test/lisp/kmacro-tests.el | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 582a58eda1c..4abc571db44 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -937,7 +937,7 @@ without repeating the prefix." ;;; Single-step editing of keyboard macros -(defvar kmacro-step-edit-active) ;; step-editing active +(defvar kmacro-step-edit-active nil) ;; step-editing active (defvar kmacro-step-edit-new-macro) ;; storage for new macro (defvar kmacro-step-edit-inserting) ;; inserting into macro (defvar kmacro-step-edit-appending) ;; append to end of macro diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el index 9f3eeafe486..690d5029231 100644 --- a/test/lisp/kmacro-tests.el +++ b/test/lisp/kmacro-tests.el @@ -818,7 +818,6 @@ This is a regression for item 7 in Bug#24991." (kmacro-tests-deftest kmacro-tests-step-edit-cleans-up-hook () "Step-editing properly cleans up `post-command-hook.' (Bug #18708)" - (:expected-result :failed) (let (post-command-hook) (setq-local post-command-hook '(t)) (kmacro-tests-run-step-edit "x" From fb4200a87555c2e69cc66eea1ae9a55e8be3bbf3 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Mon, 16 Oct 2017 11:09:29 -0700 Subject: [PATCH 30/55] Fix Edebug spec for cl-defun (bug#24255) * lisp/emacs-lisp/cl-macs.el: Modify the Edebug spec for `cl-lambda-list' to support destructuring argument lists. (cl-defun, cl-defmacro): Fix spelling errors in docstrings. * lisp/textmodes/rst.el: Remove alternate version of Edebug specs for `cl-lambda-list' and `cl-type-spec'. --- lisp/emacs-lisp/cl-macs.el | 32 +++++++++++++++++++++++--------- lisp/textmodes/rst.el | 16 ---------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 40eda1e0d65..e313af24975 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -193,20 +193,34 @@ The name is made by appending a number to PREFIX, default \"T\"." (&or lambda-doc cl-declarations)) (def-edebug-spec cl-lambda-list - (([&rest arg] + (([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] - [&optional ["&rest" arg]] + [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] - ))) + . [&or arg nil]))) (def-edebug-spec cl-&optional-arg - (&or (arg &optional def-form arg) arg)) + (&or (cl-lambda-arg &optional def-form arg) arg)) (def-edebug-spec cl-&key-arg - (&or ([&or (symbolp arg) arg] &optional def-form arg) arg)) + (&or ([&or (symbolp cl-lambda-arg) arg] &optional def-form arg) arg)) + +(def-edebug-spec cl-lambda-arg + (&or arg cl-lambda-list1)) + +(def-edebug-spec cl-lambda-list1 + (([&optional ["&whole" arg]] ;; only allowed at lower levels + [&rest cl-lambda-arg] + [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] + [&optional ["&rest" cl-lambda-arg]] + [&optional ["&key" cl-&key-arg &rest cl-&key-arg + &optional "&allow-other-keys"]] + [&optional ["&aux" &rest + &or (symbolp &optional def-form) symbolp]] + . [&or arg nil]))) (def-edebug-spec cl-type-spec sexp) @@ -336,8 +350,8 @@ The full form of a Common Lisp function argument list is [&key (([KEYWORD] VAR) [INITFORM [SVAR]])... [&allow-other-keys]] [&aux (VAR [INITFORM])...]) -VAR maybe be replaced recursively with an argument list for -destructing, `&whole' is supported within these sublists. If +VAR may be replaced recursively with an argument list for +destructuring, `&whole' is supported within these sublists. If SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be written simply `VAR'. See the Info node `(cl)Argument Lists' for more details. @@ -430,8 +444,8 @@ The full form of a Common Lisp macro argument list is [&aux (VAR [INITFORM])...] [&environment VAR]) -VAR maybe be replaced recursively with an argument list for -destructing, `&whole' is supported within these sublists. If +VAR may be replaced recursively with an argument list for +destructuring, `&whole' is supported within these sublists. If SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be written simply `VAR'. See the Info node `(cl)Argument Lists' for more details. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 146d9b95f1a..315059e1107 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -109,22 +109,6 @@ (def-edebug-spec push (&or [form symbolp] [form gv-place])) -;; Correct wrong declaration. This still doesn't support dotted destructuring -;; though. -(def-edebug-spec cl-lambda-list - (([&rest cl-macro-arg] - [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] - [&optional ["&rest" arg]] - [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] - &optional "&allow-other-keys"]] - [&optional ["&aux" &rest - &or (symbolp &optional def-form) symbolp]] - ))) - -;; Add missing declaration. -(def-edebug-spec cl-type-spec sexp) ;; This is not exactly correct but good - ;; enough. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Support for `testcover' From a0b7b301dd32ea02b00a3ffb477c8a6074071f74 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 16 Oct 2017 15:54:06 -0700 Subject: [PATCH 31/55] Do not reject https://gnu.org in commit messages * build-aux/git-hooks/commit-msg: Do not reject commit messages containing http: or ftp: URLs to gnu.org or fsf.org. Instead, rewrite the messages to use https: URLs. --- build-aux/git-hooks/commit-msg | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg index e21aaf074c6..e1ff281de71 100755 --- a/build-aux/git-hooks/commit-msg +++ b/build-aux/git-hooks/commit-msg @@ -44,7 +44,7 @@ if test "$at_sign" != @; then fi # Check the log entry. -exec $awk -v at_sign="$at_sign" -v cent_sign="$cent_sign" ' +exec $awk -v at_sign="$at_sign" -v cent_sign="$cent_sign" -v file="$1" ' BEGIN { # These regular expressions assume traditional Unix unibyte behavior. # They are needed for old or broken versions of awk, e.g., @@ -70,6 +70,8 @@ exec $awk -v at_sign="$at_sign" -v cent_sign="$cent_sign" ' unsafe_gnu_url = "(http|ftp)://([" c_lower ".]*\\.)?(gnu|fsf)\\.org" } + { input[NR] = $0 } + /^#/ { # Ignore every line after a scissors line. if (/^# *---* *(>[8%]|[8%]<) *---* *$/) { exit } @@ -127,12 +129,8 @@ exec $awk -v at_sign="$at_sign" -v cent_sign="$cent_sign" ' status = 1 } - { - if (match($0, unsafe_gnu_url)) { - url = substr($0, RSTART, RLENGTH) - printf "Use https: URL instead of '\''%s'\'' in commit message\n", url - status = 1 - } + $0 ~ unsafe_gnu_url { + needs_rewriting = 1 } $0 ~ non_print { @@ -145,6 +143,21 @@ exec $awk -v at_sign="$at_sign" -v cent_sign="$cent_sign" ' print "Empty commit message" status = 1 } + if (status == 0 && needs_rewriting) { + for (i = 1; i <= NR; i++) { + line = input[i] + while (match(line, unsafe_gnu_url)) { + prefix = substr(line, 1, RSTART - 1) + suffix = substr(line, RSTART) + line = prefix "https:" substr(suffix, 5 + (suffix ~ /^http:/)) + } + print line >file + } + if (close(file) != 0) { + print "Cannot rewrite: " file + status = 1 + } + } if (status != 0) { print "Commit aborted; please see the file 'CONTRIBUTE'" } From 20cc68e871b8903a603aa4a89d2bc648d010781a Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 15 Oct 2017 17:09:09 -0400 Subject: [PATCH 32/55] Document rectangle-preview option more (Bug#27974) * lisp/rect.el (string-rectangle): * etc/NEWS.25: Mention `rectangle-preview'. --- etc/NEWS.25 | 2 ++ lisp/rect.el | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/etc/NEWS.25 b/etc/NEWS.25 index 5201a300e01..aac60c46887 100644 --- a/etc/NEWS.25 +++ b/etc/NEWS.25 @@ -712,7 +712,9 @@ CLOS class and slot documentation. *** Rectangle Mark mode can have corners past EOL or in the middle of a TAB. *** 'C-x C-x' in 'rectangle-mark-mode' now cycles through the four corners. + *** 'string-rectangle' provides on-the-fly preview of the result. +Customize 'rectangle-preview' to nil for the old behavior. ** New font-lock functions 'font-lock-ensure' and 'font-lock-flush'. These should be used in preference to 'font-lock-fontify-buffer' when diff --git a/lisp/rect.el b/lisp/rect.el index 12e62b6a990..a62ed95b715 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -450,6 +450,10 @@ With a prefix (or a FILL) argument, also fill too short lines." "Replace rectangle contents with STRING on each line. The length of STRING need not be the same as the rectangle width. +When called interactively and option `rectangle-preview' is +non-nil, display the result as the user enters the string into +the minibuffer. + Called from a program, takes three args; START, END and STRING." (interactive (progn From b38724ab675ac02dec865930a35abd8e06ee8e76 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 16 Oct 2017 23:44:32 -0700 Subject: [PATCH 33/55] Work around ImageMagick bug 825 This should fix several bugs reported recently against Emacs (Bug#28518, Bug#28626, Bug#28632, Bug#28633, Bug#28770). * src/image.c (imagemagick_load_image): Do not call MagickWandTerminus. --- src/image.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/image.c b/src/image.c index 335a43e924d..c1c1671899b 100644 --- a/src/image.c +++ b/src/image.c @@ -8552,13 +8552,19 @@ imagemagick_load_image (struct frame *f, struct image *img, char hint_buffer[MaxTextExtent]; char *filename_hint = NULL; + /* Initialize the ImageMagick environment. */ + static bool imagemagick_initialized; + if (!imagemagick_initialized) + { + imagemagick_initialized = true; + MagickWandGenesis (); + } + /* Handle image index for image types who can contain more than one image. Interface :index is same as for GIF. First we "ping" the image to see how many sub-images it contains. Pinging is faster than loading the image to find out things about it. */ - /* Initialize the imagemagick environment. */ - MagickWandGenesis (); image = image_spec_value (img->spec, QCindex, NULL); ino = INTEGERP (image) ? XFASTINT (image) : 0; image_wand = NewMagickWand (); @@ -8859,8 +8865,10 @@ imagemagick_load_image (struct frame *f, struct image *img, DestroyMagickWand (image_wand); if (bg_wand) DestroyPixelWand (bg_wand); - /* `MagickWandTerminus' terminates the imagemagick environment. */ - MagickWandTerminus (); + /* Do not call MagickWandTerminus, to work around ImageMagick bug 825. See: + https://github.com/ImageMagick/ImageMagick/issues/825 + Although this bug was introduced in ImageMagick 6.9.9-14 and + fixed in 6.9.9-18, it's simpler to work around it in all versions. */ return 1; @@ -8868,7 +8876,6 @@ imagemagick_load_image (struct frame *f, struct image *img, DestroyMagickWand (image_wand); if (bg_wand) DestroyPixelWand (bg_wand); - MagickWandTerminus (); /* TODO more cleanup. */ image_error ("Error parsing IMAGEMAGICK image `%s'", img->spec); return 0; From 2c3e6f1ddc90335249f1a7f56f5f7b377c873fb7 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 17 Oct 2017 16:20:08 +0900 Subject: [PATCH 34/55] Dont update primary selection with winner-undo * lisp/winner.el (winner-set): Dont update primary selection when select-enable-primary is non-nil (Bug#28631). Co-authored-by: Noam Postavsky --- lisp/winner.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/winner.el b/lisp/winner.el index 61ea4d40e7b..6bc27484a79 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -304,12 +304,15 @@ You may want to include buffer names such as *Help*, *Apropos*, (push win xwins))) ; delete this window ;; Restore marks - (save-current-buffer - (cl-loop for buf in buffers - for entry = (cadr (assq buf winner-point-alist)) - do (progn (set-buffer buf) - (set-mark (car entry)) - (setf (winner-active-region) (cdr entry))))) + ;; `winner-undo' shouldn't update the selection (Bug#28631) when + ;; select-enable-primary is non-nil. + (unless select-enable-primary + (save-current-buffer + (cl-loop for buf in buffers + for entry = (cadr (assq buf winner-point-alist)) + do (progn (set-buffer buf) + (set-mark (car entry)) + (setf (winner-active-region) (cdr entry)))))) ;; Delete windows, whose buffers are dead or boring. ;; Return t if this is still a possible configuration. (or (null xwins) From 22adeca42a9c28d5df01dcd203955191faf5de89 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 17 Oct 2017 10:24:54 +0200 Subject: [PATCH 35/55] In NEWS give advice on use of `switch-to-buffer' (Bug#28645) * etc/NEWS: Mention that applications should prefer `pop-to-buffer-same-window' to `switch-to-buffer'. (Bug#28645) --- etc/NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index d995a3dded0..b40d578e5fa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -375,6 +375,9 @@ where you can cancel them with the 'c' command. +++ ** 'switch-to-buffer-preserve-window-point' now defaults to t. +Applications that call 'switch-to-buffer' and want to show the buffer at +the position of its point should use 'pop-to-buffer-same-window' in lieu +of 'switch-to-buffer'. +++ ** The new variable 'debugger-stack-frame-as-list' allows displaying From 5b6e59cfdb6acd7b8c02a7ce66bb9f4815876863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0=2E=20G=C3=B6ktu=C4=9F=20Kayaalp?= Date: Tue, 10 Oct 2017 01:43:30 +0300 Subject: [PATCH 36/55] Implement vc-default-dir-extra-headers for vc-rcs Add a do-nothing implementation for vc-rcs to suppress the message which the default function adds to the vc-dir buffer (Bug#28570). * lisp/vc/vc-rcs.el (vc-rcs-dir-extra-headers): New function. --- lisp/vc/vc-rcs.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index db1addbecd2..84ab10b14fe 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -177,6 +177,8 @@ For a description of possible values, see `vc-check-master-templates'." (push (list frel state) result)))) (funcall update-function result))) +(defun vc-rcs-dir-extra-headers (&rest _ignore)) + (defun vc-rcs-working-revision (file) "RCS-specific version of `vc-working-revision'." (or (and vc-consult-headers From 2e1b3522b8562f94a98fed07aeddb6b5ba0dbc6c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 17 Oct 2017 19:17:22 +0300 Subject: [PATCH 37/55] Improve documentation of 'line-number-display-width' * doc/lispref/display.texi (Size of Displayed Text): Document the additional 2 columns used for line-number display. * src/indent.c (Fline_number_display_width): Doc fix. (Bug#28248) --- doc/lispref/display.texi | 5 +++-- src/indent.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index afd09cfb330..fbdd810247d 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2053,8 +2053,9 @@ This function returns the width used for displaying the line numbers in the selected window. Optional argument @var{pixelwise}, if non-@code{nil}, means return the value in pixels; otherwise the value is returned in column units of the font defined for the -@code{line-number} face. If line numbers are not displayed in the -selected window, the value is zero. Use @code{with-selected-window} +@code{line-number} face, and doesn't include the 2 columns used to pad +the numbers. If line numbers are not displayed in the selected +window, the value is zero. Use @code{with-selected-window} (@pxref{Selecting Windows}) if you need this information about another window. @end defun diff --git a/src/indent.c b/src/indent.c index be8676600a5..a3e9b5b0b9a 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1993,7 +1993,8 @@ DEFUN ("line-number-display-width", Fline_number_display_width, doc: /* Return the width used for displaying line numbers in the selected window. If optional argument PIXELWISE is non-nil, return the width in pixels, otherwise return the width in columns of the face used to display -line numbers, `line-number'. */) +line numbers, `line-number'. Note that in the latter case, the value +doesn't include the 2 columns used for padding the numbers. */) (Lisp_Object pixelwise) { int width, pixel_width; From 8ca6fa585add53db66fb17b151e67029d68cc9ef Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 17 Oct 2017 18:25:18 -0700 Subject: [PATCH 38/55] Improve format-time-string doc * doc/lispref/os.texi (Time Parsing): Fix some errors in the documentation for format-time-string. Document ^, #, %s, and %z with colons. Say that unrecognized sequences are output as-is. * src/editfns.c (Fformat_time_string): %S can stand for 60. Also mention unrecognized sequences. --- doc/lispref/os.texi | 37 +++++++++++++++++++++++++++---------- src/editfns.c | 11 ++++++----- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 59c269a3084..0cb9de9f9a8 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1486,8 +1486,8 @@ This stands for the full name of the month. @item %c This is a synonym for @samp{%x %X}. @item %C -This has a locale-specific meaning. In the default locale (named C), it -is equivalent to @samp{%A, %B %e, %Y}. +This stands for the century, that is, the year divided by 100, +truncated toward zero. @item %d This stands for the day of month, zero-padded. @item %D @@ -1530,8 +1530,11 @@ This stands for the calendar quarter (1--4). This is a synonym for @samp{%I:%M:%S %p}. @item %R This is a synonym for @samp{%H:%M}. +@item %s +This stands for the integer number of seconds since the epoch. @item %S -This stands for the seconds (00--59). +This stands for the second (00--59, or 00--60 on platforms +that support leap seconds). @item %t This stands for a tab character. @item %T @@ -1561,22 +1564,31 @@ This stands for the year with century. @item %Z This stands for the time zone abbreviation (e.g., @samp{EST}). @item %z -This stands for the time zone numerical offset (e.g., @samp{-0500}). +This stands for the time zone numerical offset. The @samp{z} can be +preceded by one, two, or three colons; if plain @samp{%z} stands for +@samp{-0500}, then @samp{%:z} stands for @samp{-05:00}, @samp{%::z} +stands for @samp{-05:00:00}, and @samp{%:::z} is like @samp{%::z} +except it suppresses trailing instances of @samp{:00} so it stands for +@samp{-05} in the same example. +@item %% +This stands for a single @samp{%}. @end table +One or more flag characters can appear immediately after the @samp{%}. +@samp{0} pads with zeros, @samp{_} pads with blanks, @samp{-} +suppresses padding, @samp{^} upper-cases letters, and @samp{#} +reverses the case of letters. + You can also specify the field width and type of padding for any of these @samp{%}-sequences. This works as in @code{printf}: you write -the field width as digits in the middle of a @samp{%}-sequences. If you -start the field width with @samp{0}, it means to pad with zeros. If you -start the field width with @samp{_}, it means to pad with spaces. - +the field width as digits in a @samp{%}-sequence, after any flags. For example, @samp{%S} specifies the number of seconds since the minute; @samp{%03S} means to pad this with zeros to 3 positions, @samp{%_3S} to pad with spaces to 3 positions. Plain @samp{%3S} pads with zeros, because that is how @samp{%S} normally pads to two positions. -The characters @samp{E} and @samp{O} act as modifiers when used between -@samp{%} and one of the letters in the table above. @samp{E} specifies +The characters @samp{E} and @samp{O} act as modifiers when used after +any flags and field widths in a @samp{%}-sequence. @samp{E} specifies using the current locale's alternative version of the date and time. In a Japanese locale, for example, @code{%Ex} might yield a date format based on the Japanese Emperors' reigns. @samp{E} is allowed in @@ -1587,6 +1599,11 @@ based on the Japanese Emperors' reigns. @samp{E} is allowed in representation of numbers, instead of the ordinary decimal digits. This is allowed with most letters, all the ones that output numbers. +To help debug programs, unrecognized @samp{%}-sequences stand for +themselves and are output as-is. Programs should not rely on this +behavior, as future versions of Emacs may recognize new +@samp{%}-sequences as extensions. + This function uses the C library function @code{strftime} (@pxref{Formatting Calendar Time,,, libc, The GNU C Library Reference Manual}) to do most of the work. In order to communicate with that diff --git a/src/editfns.c b/src/editfns.c index e65bd34da87..f6f5ccc9480 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2038,11 +2038,11 @@ by text that describes the specified date and time in TIME: only blank-padded, %l is like %I blank-padded. %p is the locale's equivalent of either AM or PM. %q is the calendar quarter (1–4). -%M is the minute. -%S is the second. -%N is the nanosecond, %6N the microsecond, %3N the millisecond, etc. -%Z is the time zone name, %z is the numeric form. +%M is the minute (00-59). +%S is the second (00-59; 00-60 on platforms with leap seconds) %s is the number of seconds since 1970-01-01 00:00:00 +0000. +%N is the nanosecond, %6N the microsecond, %3N the millisecond, etc. +%Z is the time zone abbreviation, %z is the numeric form. %c is the locale's date and time format. %x is the locale's "preferred" date format. @@ -2052,7 +2052,8 @@ by text that describes the specified date and time in TIME: %R is like "%H:%M", %T is like "%H:%M:%S", %r is like "%I:%M:%S %p". %X is the locale's "preferred" time format. -Finally, %n is a newline, %t is a tab, %% is a literal %. +Finally, %n is a newline, %t is a tab, %% is a literal %, and +unrecognized %-sequences stand for themselves. Certain flags and modifiers are available with some format controls. The flags are `_', `-', `^' and `#'. For certain characters X, From 445e92658f16255b30b359e296d301fa6b929872 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Wed, 18 Oct 2017 12:12:39 +0900 Subject: [PATCH 39/55] Mention how to send CC to > 1 address in a bug report * admin/notes/bugtracker (* More detailed information): mention how to CC to more than 1 address (Bug#28833). --- admin/notes/bugtracker | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker index dfca809dc46..0b1625fdb8a 100644 --- a/admin/notes/bugtracker +++ b/admin/notes/bugtracker @@ -95,13 +95,16 @@ normal bug reporting.) ** When reporting a new bug, to send a Cc to another address (e.g. bug-cc-mode@gnu.org), do NOT just use a Cc: header. -Instead, use "X-Debbugs-CC:". This ensures the Cc address will get a +Instead, use "X-Debbugs-CC:". This ensures the Cc address(es) will get a mail with the bug report number in. If you do not do this, each reply in the subsequent discussion might end up creating a new bug. This is annoying. (So annoying that a form of message-id tracking has been implemented to hopefully stop this happening, but it is still better to use X-Debbugs-CC.) +If you want to send copies to more than one address, add them +comma-separated in only one X-Debbugs-CC line. + Like any X-Debbugs- header, this one can also be specified in the pseudo-header (see below), if your mail client does not let you add "X-" headers. From b970a4a52a1c04afce4916ca2bf337e2b36d26c4 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 18 Oct 2017 10:04:40 +0200 Subject: [PATCH 40/55] Fix handling of `border-width' in `frameset--restore-frame' (Bug#28873) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/frameset.el (frameset--restore-frame): Don't process `border-width' parameter via ‘modify-frame-parameters’ (Bug#28873). --- lisp/frameset.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/frameset.el b/lisp/frameset.el index bda21a8b8d7..d826f7fcdce 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -1035,6 +1035,12 @@ Internal use only." (frameset--initial-params filtered-cfg)))) (puthash frame :created frameset--action-map)) + ;; Remove `border-width' from the list of parameters. If it has not + ;; been assigned via `make-frame-on-display', any attempt to assign + ;; it now via `modify-frame-parameters' may result in an error on X + ;; (Bug#28873). + (setq filtered-cfg (assq-delete-all 'border-width filtered-cfg)) + ;; Try to assign parent-frame right here - it will improve things ;; for minibuffer-less child frames. (let* ((frame-id (frame-parameter frame 'frameset--parent-frame)) From dc8812829b81540d385eaa5577fa31397a8181d3 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Tue, 17 Oct 2017 10:51:03 +0100 Subject: [PATCH 41/55] Remove resizable attribute on macOS undecorated frames (bug#28512) * src/nsterm.m (FRAME_DECORATED_FLAGS): Remove Cocoa specific #define. (initFrameFromEmacs): Remove Cocoa specific window style attributes. --- src/nsterm.m | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index 0b43c04c0b7..709e905ec8f 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -423,20 +423,12 @@ static CGPoint menu_mouse_point; } -/* GNUstep always shows decorations if the window is resizable, - miniaturizable or closable, but Cocoa does strange things in native - fullscreen mode if you don't have at least resizable enabled. - - These flags will be OR'd or XOR'd with the NSWindow's styleMask +/* These flags will be OR'd or XOR'd with the NSWindow's styleMask property depending on what we're doing. */ -#ifdef NS_IMPL_COCOA -#define FRAME_DECORATED_FLAGS NSWindowStyleMaskTitled -#else #define FRAME_DECORATED_FLAGS (NSWindowStyleMaskTitled \ | NSWindowStyleMaskResizable \ | NSWindowStyleMaskMiniaturizable \ | NSWindowStyleMaskClosable) -#endif #define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless /* TODO: get rid of need for these forward declarations */ @@ -7211,15 +7203,9 @@ not_in_argv (NSString *arg) win = [[EmacsWindow alloc] initWithContentRect: r - styleMask: ((FRAME_UNDECORATED (f) - ? FRAME_UNDECORATED_FLAGS - : FRAME_DECORATED_FLAGS) -#ifdef NS_IMPL_COCOA - | NSWindowStyleMaskResizable - | NSWindowStyleMaskMiniaturizable - | NSWindowStyleMaskClosable -#endif - ) + styleMask: (FRAME_UNDECORATED (f) + ? FRAME_UNDECORATED_FLAGS + : FRAME_DECORATED_FLAGS) backing: NSBackingStoreBuffered defer: YES]; From 2551d28fe8344e0c122489965abc6c91d65bca06 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 18 Oct 2017 19:16:16 +0300 Subject: [PATCH 42/55] Fix line number display after 'widen' * src/xdisp.c (maybe_produce_line_number): Don't use data cached by line-number-mode on the first redisplay after the buffer is widened. (Bug#28879) --- src/xdisp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index b14b7daf2b0..6d9acecb424 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20889,9 +20889,11 @@ maybe_produce_line_number (struct it *it) && it->w->base_line_pos <= IT_CHARPOS (*it) /* line-number-mode always displays narrowed line numbers, so we cannot use its data if the user wants - line numbers that disregard narrowing. */ + line numbers that disregard narrowing, or if the + buffer's narrowing has just changed. */ && !(display_line_numbers_widen - && (BEG_BYTE != BEGV_BYTE || Z_BYTE != ZV_BYTE))) + && (BEG_BYTE != BEGV_BYTE || Z_BYTE != ZV_BYTE)) + && !current_buffer->clip_changed) { start_from = CHAR_TO_BYTE (it->w->base_line_pos); last_line = it->w->base_line_number - 1; From 2f7163fb72e764d2df046a4d816e1e0b81e41d18 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 18 Oct 2017 20:21:25 +0300 Subject: [PATCH 43/55] Fix the MSDOS build. * msdos/sed1v2.inp (GETADDRINFO_A_LIBS, LIBLCMS2, XDBE_LIBS) (XDBE_FLAGS, HYBRID_MALLOC, LIBSYSTEMD_CFLAGS) (LIBSYSTEMD_LIBS): Edit to empty. (LIBRESOLV, DEPFLAGS, MKDEPDIR, YMF_PASS_LDFLAGS) (PRE_EDIT_LDFLAGS, POST_EDIT_LDFLAGS): Remove editing. Remove editing of lines that are no longer present in src/Makefile.in. * msdos/sed2v2.inp (NEED_MKTIME_INTERNAL) (NEED_MKTIME_WORKING): Define to 1. (HAVE_STRUCT_DIRENT_D_TYPE): Define to 1 for DJGPP >= 2.05. (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Define to 1. Define PACKAGE_VERSION, not VERSION. (FLEXIBLE_ARRAY_MEMBER): Define to empty. (HAVE_DECL_*_UNLOCKED): Define to 0. (HAVE___BUILTIN_FRAME_ADDRESS): Define to 1. (PENDING_*): Don't define, as Gnulib no longer supports that. Instead, define _IOERR as it is in libc/file.h. * msdos/sed3v2.inp: Use $(CURDIR) instead of $(shell cd) to determine the current directory. (UPDATE_MANIFEST, UTILITIES): Don't edit. * msdos/sedlisp.inp (FIND_DELETE): Edit to "-delete". * msdos/sedlibmk.inp (AUTO_DEPEND): Define to yes. (HYBRID_MALLOC): Edit to empty. (am__cd): Don't edit. (../config.status): Replaces $(top_builddir)/config.status. Define OMIT_GNULIB_MODULE_foo = true for modules not built for MS-DOS. Convert GL_GENERATE_xxx_H_TRUE and GL_GENERATE_xxx_H_FALSE into values of GL_GENERATE_xxx_H. * msdos/mainmake.v2 (src): Use 'compile-one-process', and make the command line shorter to fit into 126-char limit of command.com. * config.bat: Generate src/deps/*.d files. Rename more files like djtar on plain DOS would. Don't rename src/dir.h: it is long gone. Edit lib/gnulib.mk.in using the same scripts as for lib/Makefile.in. * msdos/depfiles.bat: Create *.d files, not *.Po. * src/thread.c (Fmake_thread) [!THREADS_ENABLED]: Improve the error message. * src/thread.h [MSDOS]: Include . * src/sysselect.h (select) [MSDOS]: Undefine, to avoid compilation errors. * src/sysdep.c (block_interrupt_signal, restore_signal_mask): Expose to MSDOS build. * src/process.c (update_processes_for_thread_death) [!subprocess]: No-op implementation. [HAVE_SETRLIMIT]: Move inclusion of sys/resource.h and declaration of nofile_limit outside "#ifdef subprocesses", as it's needed for MSDOS. * src/msdos.c (faccessat): Declare fullname[]. * src/msdos.h (ENOTSUP): Define to be identical to ENOSYS. Include termhooks.h. * src/conf_post.h [WINDOWSNT]: Include ms-w32.h only on WINDOWSNT, not DOS_NT. * admin/admin.el (set-version): Set version on PACKAGE_VERSION. --- admin/admin.el | 2 +- config.bat | 24 +++++---- msdos/depfiles.bat | 2 +- msdos/sed1v2.inp | 40 ++++++--------- msdos/sed2v2.inp | 35 ++++++++++--- msdos/sed3v2.inp | 6 +-- msdos/sedlibmk.inp | 123 +++++++++++++++++++++++++++++---------------- msdos/sedlisp.inp | 1 + src/conf_post.h | 2 +- src/msdos.c | 2 + src/msdos.h | 3 ++ src/process.c | 11 ++++ src/sysdep.c | 3 +- src/sysselect.h | 5 ++ src/thread.c | 4 ++ src/thread.h | 4 ++ 16 files changed, 176 insertions(+), 91 deletions(-) diff --git a/admin/admin.el b/admin/admin.el index 44d091d1423..b2adfbf9f76 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -114,7 +114,7 @@ Root must be the root of an Emacs source tree." ;; configure.ac with sed, rather than duplicating the information. (set-version-in-file root "msdos/sed2v2.inp" version (rx (and bol "/^#undef " (1+ not-newline) - "define VERSION" (1+ space) "\"" + "define PACKAGE_VERSION" (1+ space) "\"" (submatch (1+ (in "0-9.")))))) ;; Major version only. (when (string-match "\\([0-9]\\{2,\\}\\)" version) diff --git a/config.bat b/config.bat index d0251df560d..90882218bc6 100644 --- a/config.bat +++ b/config.bat @@ -189,9 +189,6 @@ rm -f junk.c junk junk.exe update config.h2 config.h >nul rm -f config.tmp config.h2 -rem On my system dir.h gets in the way. It's a VMS file so who cares. -if exist dir.h ren dir.h vmsdir.h - rem Create "makefile" from "makefile.in". rm -f Makefile makefile.tmp copy Makefile.in+deps.mk makefile.tmp @@ -222,6 +219,10 @@ sed -e "/^LIBXML2_LIBS *=/s/=/= -lxml2 -lz -liconv/" makefile.tmp sed -e "/^LIBXML2_CFLAGS *=/s|=|= -I/dev/env/DJDIR/include/libxml2|" Makefile rm -f makefile.tmp :src7 +Rem Create .d files for new files in src/ +If Not Exist deps\stamp mkdir deps +for %%f in (*.c) do @call ..\msdos\depfiles.bat %%f +echo deps-stamp > deps\stamp cd .. rem ---------------------------------------------------------------------- Echo Configuring the library source directory... @@ -273,6 +274,7 @@ Echo Configuring the lib directory... If Exist build-aux\snippet\c++defs.h update build-aux/snippet/c++defs.h build-aux/snippet/cxxdefs.h cd lib Rem Rename files like djtar on plain DOS filesystem would. +If Exist c++defs.h update c++defs.h cxxdefs.h If Exist alloca.in.h update alloca.in.h alloca.in-h If Exist byteswap.in.h update byteswap.in.h byteswap.in-h If Exist dirent.in.h update dirent.in.h dirent.in-h @@ -280,12 +282,12 @@ If Exist errno.in.h update errno.in.h errno.in-h If Exist execinfo.in.h update execinfo.in.h execinfo.in-h If Exist fcntl.in.h update fcntl.in.h fcntl.in-h If Exist getopt.in.h update getopt.in.h getopt.in-h +If Exist getopt-cdefs.in.h update getopt-cdefs.in.h getopt-cdefs.in-h If Exist inttypes.in.h update inttypes.in.h inttypes.in-h -If Exist stdarg.in.h update stdarg.in.h stdarg.in-h -If Exist stdalign.in.h update stdalign.in.h stdalign.in-h -If Exist stdbool.in.h update stdbool.in.h stdbool.in-h +If Exist limits.in.h update limits.in.h limits.in-h If Exist signal.in.h update signal.in.h signal.in-h -If Exist stdalign.in.h update stdalign.in.h stdalign.in-h +If Exist signal.in.h update signal.in.h signal.in-h +If Exist stdalign.in.h update stdalign.in.h stdalign.in-h If Exist stddef.in.h update stddef.in.h stddef.in-h If Exist stdint.in.h update stdint.in.h stdint.in-h If Exist stdio.in.h update stdio.in.h stdio.in-h @@ -293,16 +295,20 @@ If Exist stdlib.in.h update stdlib.in.h stdlib.in-h If Exist string.in.h update string.in.h string.in-h If Exist sys_select.in.h update sys_select.in.h sys_select.in-h If Exist sys_stat.in.h update sys_stat.in.h sys_stat.in-h -If Exist sys_types.in.h update sys_types.in.h sys_types.in-h If Exist sys_time.in.h update sys_time.in.h sys_time.in-h +If Exist sys_types.in.h update sys_types.in.h sys_types.in-h If Exist time.in.h update time.in.h time.in-h If Exist unistd.in.h update unistd.in.h unistd.in-h +If Exist gnulib.mk.in update gnulib.mk.in gnulib.mk-in Rem Only repository has the msdos/autogen directory If Exist Makefile.in sed -f ../msdos/sedlibcf.inp < Makefile.in > makefile.tmp If Exist ..\msdos\autogen\Makefile.in sed -f ../msdos/sedlibcf.inp < ..\msdos\autogen\Makefile.in > makefile.tmp sed -f ../msdos/sedlibmk.inp < makefile.tmp > Makefile rm -f makefile.tmp -Rem Create .Po files for new files in lib/ +sed -f ../msdos/sedlibcf.inp < gnulib.mk-in > gnulib.tmp +sed -f ../msdos/sedlibmk.inp < gnulib.tmp > gnulib.mk +rm -f gnulib.tmp +Rem Create .d files for new files in lib/ If Not Exist deps\stamp mkdir deps for %%f in (*.c) do @call ..\msdos\depfiles.bat %%f echo deps-stamp > deps\stamp diff --git a/msdos/depfiles.bat b/msdos/depfiles.bat index 31c8622f792..8910b009eb3 100644 --- a/msdos/depfiles.bat +++ b/msdos/depfiles.bat @@ -20,6 +20,6 @@ rem along with GNU Emacs. If not, see https://www.gnu.org/licenses/. rem ---------------------------------------------------------------------- -echo %1 | sed -e "s,\(.*\)\.c,@if not exist deps\\\1.Po echo # dummy > deps\\\1.Po," > tdepfile.bat +echo %1 | sed -e "s,\(.*\)\.c,@if not exist deps\\\1.d echo # dummy > deps\\\1.d," > tdepfile.bat call tdepfile del tdepfile.bat diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index 5431d2bd6c1..cc51301cad3 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -94,6 +94,8 @@ s/ *@LIBXPM@// /^IMAGEMAGICK_CFLAGS *=/s/@IMAGEMAGICK_CFLAGS@// /^LIBXML2_LIBS *=/s/@LIBXML2_LIBS@// /^LIBXML2_CFLAGS *=/s/@LIBXML2_CFLAGS@// +/^GETADDRINFO_A_LIBS *=/s/@GETADDRINFO_A_LIBS@// +/^LIBLCMS2 *=/s/@LIBLCMS2@// /^WIDGET_OBJ *=/s/@WIDGET_OBJ@// /^XWIDGETS_OBJ *=/s/@XWIDGETS_OBJ@// /^WEBKIT_LIBS *=/s/@WEBKIT_LIBS@// @@ -102,16 +104,19 @@ s/ *@LIBXPM@// /^CAIRO_CFLAGS *=/s/@CAIRO_CFLAGS@// /^XFIXES_LIBS *=/s/@XFIXES_LIBS@// /^XFIXES_CFLAGS *=/s/@XFIXES_CFLAGS@// +/^XDBE_LIBS *=/s/@XDBE_LIBS@// +/^XDBE_CFLAGS *=/s/@XDBE_CFLAGS@// /^CYGWIN_OBJ *=/s/@CYGWIN_OBJ@// /^WINDOW_SYSTEM_OBJ *=/s/@WINDOW_SYSTEM_OBJ@// /^MSDOS_OBJ *=/s/= */= dosfns.o msdos.o w16select.o/ /^NS_OBJ *=/s/@NS_OBJ@// /^NS_OBJC_OBJ *=/s/@NS_OBJC_OBJ@// /^GNU_OBJC_CFLAGS*=/s/=.*$/=/ -/^LIBRESOLV *=/s/@LIBRESOLV@// /^LIBMODULES *=/s/@LIBMODULES@// /^MODULES_OBJ *=/s/@MODULES_OBJ@// /^LIBSELINUX_LIBS *=/s/@LIBSELINUX_LIBS@// +/^LIBSYSTEMD_LIBS *=/s/@LIBSYSTEMD_LIBS@// +/^LIBSYSTEMD_CFLAGS *=/s/@LIBSYSTEMD_CFLAGS@// /^LIB_CLOCK_GETTIME *=/s/@[^@\n]*@//g /^LIB_TIMER_TIME *=/s/@[^@\n]*@//g /^LIB_EXECINFO *=/s/@[^@\n]*@//g @@ -133,6 +138,7 @@ s/ *@LIBXPM@// /^XRANDR_CFLAGS *=/s/@XRANDR_CFLAGS@// /^XINERAMA_LIBS *=/s/@XINERAMA_LIBS@// /^XINERAMA_CFLAGS *=/s/@XINERAMA_CFLAGS@// +/^HYBRID_MALLOC *=/s/@HYBRID_MALLOC@// /^GMALLOC_OBJ *=/s/@GMALLOC_OBJ@/gmalloc.o/ /^VMLIMIT_OBJ *=/s/@VMLIMIT_OBJ@/vm-limit.o/ /^FIRSTFILE_OBJ *=/s/@FIRSTFILE_OBJ@// @@ -140,9 +146,8 @@ s/ *@LIBXPM@// /^PRE_ALLOC_OBJ *=/s/@PRE_ALLOC_OBJ@/lastfile.o/ /^POST_ALLOC_OBJ *=/s/@POST_ALLOC_OBJ@/$(vmlimitobj)/ /^UNEXEC_OBJ *=/s/@UNEXEC_OBJ@/unexcoff.o/ +/^BUILD_DETAILS *=/s/@BUILD_DETAILS@// /^CANNOT_DUMP *=/s/@CANNOT_DUMP@/no/ -/^DEPFLAGS *=/s/@DEPFLAGS@// -/^MKDEPDIR *=/s/@MKDEPDIR@// /^W32_OBJ *=/s/@W32_OBJ@// /^W32_LIBS *=/s/@W32_LIBS@// /^version *=/s/@[^@\n]*@// @@ -172,20 +177,18 @@ lisp.mk: $(lispsource)/loadup.el\ /^ [ ]*\$(AM_V_GLOBALS)\$(libsrc)\/make-doc/s!>.*$!! /^\$(libsrc)\/make-docfile\$(EXEEXT): /i\ cd ../src -/^\$(leimdir)\/leim-list.el: /s/bootstrap-emacs\$(EXEEXT)/b-emacs$(EXEEXT)/ /^ if test -f/,/^ fi$/c\ command.com /c if exist .gdbinit rm -f _gdbinit /^ *ifneq (\$(PAXCTL_notdumped),)/,/^ *endif/d /^ *ifneq (\$(PAXCTL_dumped),)/,/^ *endif/d /^ *ln /s/ln /cp / -/^ *\$(SETFATTR_if_present) -n/d /^ fi/d /^ *\$(RUN_TEMACS) /i\ stubedit temacs.exe minstack=1024k /^ *LC_ALL=C \$(RUN_TEMACS)/i\ stubedit temacs.exe minstack=1024k /^ *LC_ALL=C.*\$(RUN_TEMACS)/s/LC_ALL=C/set &;/ -/-batch -l loadup/a\ +/-batch .* -l loadup/a\ stubify emacs\ stubedit emacs.exe minstack=3072k s/ @true *$/ @rem/ @@ -193,7 +196,6 @@ s/^ [^ ]*move-if-change / update / /^ [^ ]*echo[ ][ ]*timestamp/s/echo /djecho / /^ .*djecho timestamp/a\ @rm -f globals.tmp -/^ *@\$(MKDEPDIR) *$/d /^ mv \.\/\.gdbinit/d /^ if test -f/,/^ fi$/c\ command.com /c if exist .gdbinit rm -f _gdbinit @@ -201,12 +203,7 @@ s/^ [^ ]*move-if-change / update / /^ @: /d /^ -\{0,1\} *ln /s/ln /cp / /^[ ]touch /s/touch/djecho $@ >/ -s/@YMF_PASS_LDFLAGS@/flags/ -s/@PRE_EDIT_LDFLAGS@// -s/@POST_EDIT_LDFLAGS@// s/bootstrap-emacs/b-emacs/ -s/bootstrap-temacs/b-temacs/ -s/bootstrap-doc/b-doc/ /rm -f bootstrap-emacs/s/b-emacs/b-emacs b-emacs.exe/ s/echo.*buildobj.lst/dj&/ / --load loadup bootstrap/a\ @@ -222,25 +219,20 @@ s/echo.*buildobj.lst/dj&/ } # Remove or replace dependencies we cannot have /^\.PRECIOUS: /s!\.\./config.status !! -/^\.\.\/config.status: /d +/^\.\.\/config.status: /,/^ /d /^Makefile: /s!\.\./config.status !! -/^\$(top_srcdir)\/aclocal\.m4 /,/^doc\.o:/c\ -\ -doc.o: buildobj.h # Make the GCC command line fit one screen line /^[ ][ ]*\$(GNUSTEP_CFLAGS)/d -/^[ ][ ]*\$(GCONF_CFLAGS)/d /^[ ][ ]*\$(LIBGNUTLS_CFLAGS)/d -s/\$(LIBOTF_CFLAGS) \$(M17N_FLT_CFLAGS) \$(DEPFLAGS) // +/^[ ][ ]*\$(LIBSYSTEMD_CFLAGS)/d +/^[ ][ ]*\$(XRANDR_CFLAGS)/d +/^[ ][ ]*\$(WEBKIT_CFLAGS)/d +/^[ ][ ]*\$(SETTINGS_CFLAGS)/d +s/\$(LIBOTF_CFLAGS) \$(M17N_FLT_CFLAGS) // s/ \$(C_SWITCH_X_SITE)// s/ \$(DBUS_CFLAGS)// s/ \$(PNG_CFLAGS) // -s/ \$(XINERAMA_CFLAGS)// -s/ \$(XFIXES_CFLAGS)// -s/ \$(FREETYPE_CFLAGS)// -s/ \$(FONTCONFIG_CFLAGS)// s| -I\$(srcdir)/\.\./lib|| s| -I\$(top_srcdir)/lib|| -# Add our local inttypes.h to prerequisites where needed -/^lread\.o:/s|lread\.c|& ../msdos/inttypes.h| +s| -I\. -I\$(srcdir)| -I.| /^ *test "X/d diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index 2c9c03960cc..d4db26396ff 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -55,6 +55,7 @@ /^#undef HAVE_STRNCASECMP *$/s/^.*$/#define HAVE_STRNCASECMP 1/ /^#undef HAVE_STRUCT_TM_TM_ZONE *$/s/^.*$/#define HAVE_STRUCT_TM_TM_ZONE 1/ /^#undef HAVE_SYNC *$/s/^.*$/#define HAVE_SYNC 1/ +/^#undef HAVE___BUILTIN_FRAME_ADDRESS *$/s/^.*$/#define HAVE___BUILTIN_FRAME_ADDRESS 1/ /^#undef HAVE___BUILTIN_UNWIND_INIT *$/s/^.*$/#define HAVE___BUILTIN_UNWIND_INIT 1/ /^#undef HAVE_MENUS *$/s/^.*$/#define HAVE_MENUS 1/ /^#undef DATA_START/s/^.*$/#define DATA_START (\&etext + 1)/ @@ -64,9 +65,7 @@ /^#undef PACKAGE_NAME/s/^.*$/#define PACKAGE_NAME ""/ /^#undef PACKAGE_STRING/s/^.*$/#define PACKAGE_STRING ""/ /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/ -/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION VERSION/ -/^#undef PENDING_OUTPUT_COUNT/s/^.*$/#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)/ -/^#undef VERSION/s/^.*$/#define VERSION "26.0.90"/ +/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "26.0.90"/ /^#undef SYSTEM_TYPE/s/^.*$/#define SYSTEM_TYPE "ms-dos"/ /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/ /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/ @@ -86,6 +85,8 @@ /^#undef IS_DIRECTORY_SEP *$/s,^.*$,#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\\\'), /^#undef IS_DEVICE_SEP *$/s/^.*$/#define IS_DEVICE_SEP(_c_) ((_c_) == ':')/ /^#undef IS_ANY_SEP *$/s/^.*$/#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))/ +/^#undef NEED_MKTIME_INTERNAL *$/s/^.*$/#define NEED_MKTIME_INTERNAL 1/ +/^#undef NEED_MKTIME_WORKING *$/s/^.*$/#define NEED_MKTIME_WORKING 1/ /^#undef INTERNAL_TERMINAL *$/s,^.*$,#define INTERNAL_TERMINAL "pc|bios|IBM PC with color display::co#80:li#25:Co#16:pa#256:km:ms:cm=:cl=:ce=::se=:so=:us=
    :ue=
:md=:mh=:mb=:mr=:me=::AB=:AF=:op=:", /^#undef NULL_DEVICE *$/s/^.*$/#define NULL_DEVICE "nul"/ /^#undef SEPCHAR *$/s/^.*$/#define SEPCHAR '\;'/ @@ -102,6 +103,7 @@ s/^#undef STACK_DIRECTION *$/#define STACK_DIRECTION -1/ s/^#undef EMACS_CONFIGURATION *$/#define EMACS_CONFIGURATION "i386-pc-msdosdjgpp"/ s/^#undef EMACS_CONFIG_OPTIONS *$/#define EMACS_CONFIG_OPTIONS "msdos"/ s/^#undef EMACS_CONFIG_FEATURES *$/#define EMACS_CONFIG_FEATURES ""/ +s|^#undef FLEXIBLE_ARRAY_MEMBER *$|#define FLEXIBLE_ARRAY_MEMBER /**/| s/^#undef PROTOTYPES *$/#define PROTOTYPES 1/ s/^#undef POINTER_TYPE *$/#define POINTER_TYPE void/ /^#undef HAVE_INTTYPES_H/c\ @@ -117,12 +119,31 @@ s/^#undef POINTER_TYPE *$/#define POINTER_TYPE void/ #undef HAVE_STDINT_H\ #endif s/^#undef HAVE_C_VARARRAYS *$/#define HAVE_C_VARARRAYS 1/ +s/^#undef HAVE_DECL_ALIGNED_ALLOC *$/#define HAVE_DECL_ALIGNED_ALLOC 0/ +s/^#undef HAVE_DECL_CLEARERR_UNLOCKED *$/#define HAVE_DECL_CLEARERR_UNLOCKED 0/ +s/^#undef HAVE_DECL_FEOF_UNLOCKED *$/#define HAVE_DECL_FEOF_UNLOCKED 0/ +s/^#undef HAVE_DECL_FERROR_UNLOCKED *$/#define HAVE_DECL_FERROR_UNLOCKED 0/ +s/^#undef HAVE_DECL_FFLUSH_UNLOCKED *$/#define HAVE_DECL_FFLUSH_UNLOCKED 0/ +s/^#undef HAVE_DECL_FGETS_UNLOCKED *$/#define HAVE_DECL_FGETS_UNLOCKED 0/ +s/^#undef HAVE_DECL_FPUTC_UNLOCKED *$/#define HAVE_DECL_FPUTC_UNLOCKED 0/ +s/^#undef HAVE_DECL_FPUTS_UNLOCKED *$/#define HAVE_DECL_FPUTS_UNLOCKED 0/ +s/^#undef HAVE_DECL_FREAD_UNLOCKED *$/#define HAVE_DECL_FREAD_UNLOCKED 0/ +s/^#undef HAVE_DECL_FWRITE_UNLOCKED *$/#define HAVE_DECL_FWRITE_UNLOCKED 0/ +s/^#undef HAVE_DECL_GETCHAR_UNLOCKED *$/#define HAVE_DECL_GETCHAR_UNLOCKED 0/ +s/^#undef HAVE_DECL_GETC_UNLOCKED *$/#define HAVE_DECL_GETC_UNLOCKED 0/ +s/^#undef HAVE_DECL_PUTCHAR_UNLOCKED *$/#define HAVE_DECL_PUTCHAR_UNLOCKED 0/ +s/^#undef HAVE_DECL_PUTC_UNLOCKED *$/#define HAVE_DECL_PUTC_UNLOCKED 0/ s/^#undef HAVE_DECL_STRTOLL *$/#define HAVE_DECL_STRTOLL 1/ -s/^#undef HAVE_DECL_STRTOULL *$/#define HAVE_DECL_STRTOULL 1/ s/^#undef HAVE_DECL_STRTOIMAX *$/#define HAVE_DECL_STRTOIMAX 1/ -s/^#undef HAVE_DECL_STRTOUMAX *$/#define HAVE_DECL_STRTOUMAX 1/ s/^#undef HAVE_STRTOLL *$/#define HAVE_STRTOLL 1/ s/^#undef HAVE_STRTOULL *$/#define HAVE_STRTOULL 1/ +/^#undef HAVE_STRUCT_DIRENT_D_TYPE *$/c\ +#if __DJGPP__ + (__DJGPP_MINOR__ >= 5) >= 3\ +#define HAVE_STRUCT_DIRENT_D_TYPE 1/\ +#else\ +#undef HAVE_STRUCT_DIRENT_D_TYPE\ +#endif +s/^#undef HAVE_STRUCT_ATTRIBUTE_ALIGNED *$/#define HAVE_STRUCT_ATTRIBUTE_ALIGNED 1/ s/^#undef HAVE_PUTENV *$/#define HAVE_PUTENV 1/ /^#undef HAVE_SIGSET_T *$/s/^.*$/#define HAVE_SIGSET_T 1/ /^#undef HAVE_SNPRINTF/c\ @@ -133,7 +154,9 @@ s/^#undef HAVE_PUTENV *$/#define HAVE_PUTENV 1/ #include \ extern int snprintf (char *__restrict, size_t, const char *__restrict, ...);\ #endif -s/^#undef PENDING_OUTPUT_N_BYTES *$/#define PENDING_OUTPUT_N_BYTES fp->_ptr - fp->_base/ +/^#include /i\ +/* From libc/file.h, needed by lib/fpending.c. */\ +#define _IOERR 000200 # Comment out any remaining undef directives, because some of them # might be defined in sys/config.h we include at the top of config.h. diff --git a/msdos/sed3v2.inp b/msdos/sed3v2.inp index b9600e6b016..174c63aacbe 100644 --- a/msdos/sed3v2.inp +++ b/msdos/sed3v2.inp @@ -20,7 +20,7 @@ /^archlibdir *=/s!=.*$!=/emacs/bin! /^bindir *=/s!=.*$!=/emacs/bin! /^libdir *=/s!=.*$!=/emacs/bin! -/^srcdir=/s!srcdir=@srcdir@!srcdir := $(subst \\,/,$(shell command.com /c cd))! +/^srcdir=/s!srcdir=@srcdir@!srcdir := $(CURDIR)! /^VPATH *=/s!=.*$!=.! /^BLESSMAIL_TARGET *=/s!@BLESSMAIL_TARGET@!need-blessmail! /^KRB4LIB *=/s/@[^@\n]*@//g @@ -41,7 +41,6 @@ /^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@// /^WARN_CFLAGS *=/s/@WARN_CFLAGS@// /^WERROR_CFLAGS *=/s/@WERROR_CFLAGS@// -/^UPDATE_MANIFEST *=/s/@UPDATE_MANIFEST@// /^PROFILING_CFLAGS *=/s/@PROFILING_CFLAGS@// /^AM_DEFAULT_VERBOSITY *=/s/@AM_DEFAULT_VERBOSITY@/1/ /^[Aa][Mm]_/s/@AM_V@/$(V)/ @@ -58,6 +57,3 @@ /^GETOPT_H *=/s!@GETOPT_H@!getopt.h! /^GETOPTOBJS *=/s!@GETOPTOBJS@!getopt.o getopt1.o! /^INSTALLABLES/s/emacsclient[^ ]* *// -/^UTILITIES *=/,/^$/{ - s/movemail[^ ]* *// -} diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 22611351d67..30776b46d7e 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -18,14 +18,9 @@ # # Checklist to add a new gnulib module: # -# . If the module includes source files that need to be compiled, and -# does not appear in the am_libgnu_a_OBJECTS list, add the -# corresponding .o file names to the list that gets assigned to the -# gl_LIBOBJS variable. -# -# . If a module appears in am_libgnu_a_OBJECTS that is not required -# for the MSDOS build, edit it out by adding an appropriate command -# to the set that edits the am_libgnu_a_OBJECTS block. +# . If a module appears in gnulib.mk.in that is not required for the +# MSDOS build, disable its building by setting the corresponding +# OMIT_GNULIB_MODULE_foo variable to true. # # . If the module defines functions that need to replace DJGPP # functions, edit the appropriate REPLACE_foo variables to 1: @@ -38,22 +33,22 @@ # as above should be placed before that catchall rule (search for # "REPLACE_" below). # -# . If the module is a header or adds headers, edit the corresponding -# variable to either an empty value or to the name of the header. -# Examples: +# . If the module generates a header from a .in.h file, edit the +# corresponding variable to either an empty value or to the name of +# the header. Examples: # # /^STDINT_H *=/s/@[^@\n]*@/stdint.h/ -- stdint.h is needed # /^STDDEF_H *=/s/@[^@\n]*@// -- stddef.h is not needed # # . Some of the headers are generated conditionally, and the -# corresponding recipes are guarded by @GL_GENERATE_xxxx_H_TRUE@ -# and @GL_GENERATE_xxxx_H_FALSE@. Depending on whether DJGPP uses -# the corresponding header, these should be edited either to -# nothing (thus exposing the recipe) or to #, which comments the -# recipe away. Example: +# corresponding recipes are guarded by +# ifneq (,$(GL_GENERATE_xxxx_H)) +# Depending on whether DJGPP uses the corresponding header, these +# should be edited either to 1 (thus exposing the recipe) or +# to notyhing, which makes Make bypass the recipe away. Example: # -# s/^@GL_GENERATE_STDBOOL_H_TRUE@/\#/ -# s/^@GL_GENERATE_STDBOOL_H_FALSE@// +# s/^@GL_GENERATE_STDBOOL_H@/1/ +# s/^@GL_GENERATE_STDINT_H@// # # . Also edit the NEXT_foo_H and NEXT_AS_FIRST_DIRECTIVE_foo_H # variables as appropriately: to an empty value if the gnulib @@ -67,7 +62,7 @@ # # . Note that some gnulib headers cannot be left unused: those for # which there's no corresponding foo_H variable in -# msdos/autogen/Makefile.in (example: stdio.h). For these the "not +# lib/Makefile.in (example: stdio.h). For these the "not # needed" path is not applicable. # # . If the header is needed, edit all the variables it uses as @@ -135,8 +130,6 @@ /^@SET_MAKE@$/s/@SET_MAKE@// /^VPATH *=/s/@[^@\n]*@/./ s/@PACKAGE@/emacs/ -/^am__cd *=/c\ -am__cd = cd /^@BUILDING_FOR_WINDOWSNT_TRUE@/s/@[^@\n]*@/#/ /^@BUILDING_FOR_WINDOWSNT_FALSE@/s/@[^@\n]*@// /^ALLOCA *=/s/@[^@\n]*@// @@ -145,6 +138,7 @@ am__cd = cd /^AR *=/s/@[^@\n]*@/ar/ /^ARFLAGS *=/s/@[^@\n]*@/cru/ /^AWK *=/s/@[^@\n]*@/gawk/ +/^AUTO_DEPEND *=/s/@AUTO_DEPEND@/yes/ /^CANNOT_DUMP *=/s/@[^@\n]*@/no/ /^CC *=/s/@[^@\n]*@/gcc -std=gnu99/ /^CPP *=/s/@[^@\n]*@/gcc -e/ @@ -159,6 +153,7 @@ am__cd = cd /^C_SWITCH_X_SITE *=/s/@C_SWITCH_X_SITE@// /^PROFILING_CFLAGS *=/s/@PROFILING_CFLAGS@// /^GNULIB_WARN_CFLAGS *=/s/@GNULIB_WARN_CFLAGS@// +/^HYBRID_MALLOC *=/s/@HYBRID_MALLOC@// /^WARN_CFLAGS *=/s/@WARN_CFLAGS@// /^WERROR_CFLAGS *=/s/@WERROR_CFLAGS@// /^DEFS *=/s/@[^@\n]*@// @@ -191,6 +186,7 @@ am__cd = cd /^GNULIB_MKOSTEMP *=/s/@GNULIB_MKOSTEMP@/1/ /^GNULIB_MKTIME *=/s/@GNULIB_MKTIME@/1/ /^GNULIB_TIME_R *=/s/@GNULIB_TIME_R@/1/ +/^GNULIB_TIMEGM *=/s/@GNULIB_TIMEGM@/1/ /^GNULIB_TIME_RZ *=/s/@GNULIB_TIME_RZ@/1/ /^GNULIB_UNSETENV *=/s/@GNULIB_UNSETENV@/1/ /^GNULIB_[^ =]* *= *@/s/@[^@\n]*@/0/ @@ -250,6 +246,7 @@ am__cd = cd /^HAVE_SYS_PARAM_H *=/s/@HAVE_SYS_PARAM_H@/1/ /^HAVE_SYS_TIME_H *=/s/@HAVE_SYS_TIME_H@/1/ /^HAVE_SYS_TYPES_H *=/s/@HAVE_SYS_TYPES_H@/1/ +/^HAVE_TIMEGM *=/s/@HAVE_TIMEGM@/0/ /^HAVE_TYPE_VOLATILE_SIG_ATOMIC_T *=/s/@HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@/1/ /^HAVE_UNISTD_H *=/s/@HAVE_UNISTD_H@/1/ /^HAVE_UNSIGNED_LONG_LONG_INT *=/s/@HAVE_UNSIGNED_LONG_LONG_INT@/1/ @@ -273,6 +270,7 @@ am__cd = cd /^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@// +/^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@[^@\n]*@// @@ -289,6 +287,7 @@ am__cd = cd /^NEXT_ERRNO_H *=/s/@[^@\n]*@// /^NEXT_FCNTL_H *=/s/@[^@\n]*@// /^NEXT_GETOPT_H *=/s/@[^@\n]*@// +/^NEXT_LIMITS_H *=/s/@[^@\n]*@// /^NEXT_SIGNAL_H *=/s/@[^@\n]*@// /^NEXT_STDDEF_H *=/s/@[^@\n]*@// /^NEXT_STDIO_H *=/s/@[^@\n]*@// @@ -317,6 +316,8 @@ am__cd = cd /^DIRENT_H *=/s/@[^@\n]*@// /^ERRNO_H *=/s/@[^@\n]*@// /^EXECINFO_H *=/s/@[^@\n]*@/execinfo.h/ +/^GETOPT_CDEFS_H *=/s/@[^@\n]*@/getopt-cdefs.h/ +/^LIMITS_H *=/s/@[^@\n]*@/limits.h/ /^STDALIGN_H *=/s/@[^@\n]*@/stdalign.h/ /^STDDEF_H *=/s/@[^@\n]*@/stddef.h/ /^STDINT_H *=/s/@[^@\n]*@/stdint.h/ @@ -330,6 +331,8 @@ am__cd = cd /^WINT_T_SUFFIX *=/s/@WINT_T_SUFFIX@// /^WINDOWS_64_BIT_OFF_T *=/s/@WINDOWS_64_BIT_OFF_T@/0/ /^WINDOWS_64_BIT_ST_SIZE *=/s/@WINDOWS_64_BIT_ST_SIZE@/0/ +/^WINDOWS_STAT_INODES *=/s/@WINDOWS_STAT_INODES@/0/ +/^WINDOWS_STAT_TIMESPEC *=/s/@WINDOWS_STAT_TIMESPEC@/0/ # Tailor lists of files to what we need /am__append_[1-9][0-9]* *=.*gettext\.h/s/@[^@\n]*@/\#/ /am__append_2 *=.*verify\.h/s/@[^@\n]*@// @@ -357,15 +360,18 @@ am__cd = cd /^top_builddir *=/s/@[^@\n]*@/../ s/@PRAGMA_SYSTEM_HEADER@/\#pragma GCC system_header/ s/@PRAGMA_COLUMNS@// +/^SYSTEM_TYPE *=/s/@SYSTEM_TYPE@/msdos/ +/^ifneq (\$(SYSTEM_TYPE),windows-nt)/,/^endif/d +/^DEPDIR *=/a\ +AUTO_DEPEND = yes # # Delete the recipes we don't want to get in our way. -/^\$(srcdir)\/Makefile\.in:/,/^[ ][ ]*\$(AUTOMAKE)/d -/^Makefile:/,/^[ ][ ]*esac/d -/^\$(top_srcdir)\/configure:/,/^\$(am__aclocal_m4_deps):/d -/^\$(top_builddir)\/config.status:/,/^$/d +/^\.\.\/config.status:/,/^Makefile:/c\ +Makefile: $(srcdir)/Makefile.in # # Remove the dependencies on $(top_builddir)/config.status -s/ $(top_builddir)\/config.status// +s/ \.\.\/config.status// +s/ \$(top_builddir)\/config.status// # # Fix the include-dependency lines s/^@AMDEP_TRUE@// @@ -387,23 +393,53 @@ CONFIG_CLEAN_VPATH_FILES = xyzzy s/^ -*test -z.*|| rm/ -rm/ s/@echo /@djecho / # -# Fix the recipes for header files -s/^@GL_GENERATE_ALLOCA_H_TRUE@// -s/^@GL_GENERATE_ALLOCA_H_FALSE@/\#/ -s/^@GL_GENERATE_BYTESWAP_H_TRUE@// -s/^@GL_GENERATE_BYTESWAP_H_FALSE@/\#/ -s/^@GL_GENERATE_ERRNO_H_TRUE@/\#/ -s/^@GL_GENERATE_ERRNO_H_FALSE@// -s/^@GL_GENERATE_EXECINFO_H_TRUE@// -s/^@GL_GENERATE_EXECINFO_H_FALSE@/\#/ -s/^@GL_GENERATE_STDALIGN_H_TRUE@// -s/^@GL_GENERATE_STDALIGN_H_FALSE@/\#/ -s/^@GL_GENERATE_STDDEF_H_TRUE@// -s/^@GL_GENERATE_STDDEF_H_FALSE@/\#/ -s/^@GL_GENERATE_STDINT_H_TRUE@// -s/^@GL_GENERATE_STDINT_H_FALSE@/\#/ -s/^@GL_GENERATE_STDALIGN_H_TRUE@// -s/^@GL_GENERATE_STDALIGN_H_FALSE@/\#/ +# Determine which headers to generate +s/= @GL_GENERATE_ALLOCA_H@/= 1/ +s/= @GL_GENERATE_BYTESWAP_H@/= 1/ +s/= @GL_GENERATE_EXECINFO_H@/= 1/ +s/= @GL_GENERATE_STDALIGN_H@/= 1/ +s/= @GL_GENERATE_STDDEF_H@/= 1/ +s/= @GL_GENERATE_STDINT_H@/= 1/ +s/= @GL_GENERATE_LIMITS_H@/= 1/ +s/= @GL_GENERATE_ERRNO_H@/= / +s/= @GL_GENERATE_LIMITS_H@/= / +# +# Determine which modules to build and which to omit +/^noinst_LIBRARIES /a\ +OMIT_GNULIB_MODULE_acl-permissions = true\ +OMIT_GNULIB_MODULE_allocator = true\ +OMIT_GNULIB_MODULE_at-internal = true\ +OMIT_GNULIB_MODULE_careadlinkat = true\ +OMIT_GNULIB_MODULE_cloexec = true\ +OMIT_GNULIB_MODULE_dirent = true\ +OMIT_GNULIB_MODULE_dirfd = true\ +OMIT_GNULIB_MODULE_dup2 = true\ +OMIT_GNULIB_MODULE_errno = true\ +OMIT_GNULIB_MODULE_euidaccess = true\ +OMIT_GNULIB_MODULE_faccessat = true\ +OMIT_GNULIB_MODULE_fcntl = true\ +OMIT_GNULIB_MODULE_fdopendir = true\ +OMIT_GNULIB_MODULE_fstatat = true\ +OMIT_GNULIB_MODULE_fsync = true\ +OMIT_GNULIB_MODULE_getdtablesize = true\ +OMIT_GNULIB_MODULE_getgroups = true\ +OMIT_GNULIB_MODULE_gettimeofday = true\ +OMIT_GNULIB_MODULE_group-member = true\ +OMIT_GNULIB_MODULE_inttypes-incomplete = true\ +OMIT_GNULIB_MODULE_localtime-buffer = true\ +OMIT_GNULIB_MODULE_lstat = true\ +OMIT_GNULIB_MODULE_open = true\ +OMIT_GNULIB_MODULE_pipe2 = true\ +OMIT_GNULIB_MODULE_pselect = true\ +OMIT_GNULIB_MODULE_putenv = true\ +OMIT_GNULIB_MODULE_qcopy-acl = true\ +OMIT_GNULIB_MODULE_readlink = true\ +OMIT_GNULIB_MODULE_readlinkat = true\ +OMIT_GNULIB_MODULE_strtoimax = true\ +OMIT_GNULIB_MODULE_strtoll = true\ +OMIT_GNULIB_MODULE_symlink = true\ +OMIT_GNULIB_MODULE_sys_select = true\ +OMIT_GNULIB_MODULE_sys_time = true /^arg-nonnull\.h:/,/^[ ][ ]*mv /c\ arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h\ sed -n -e '/GL_ARG_NONNULL/,$$p' < $(top_srcdir)/build-aux/snippet/arg-nonnull.h > $@ @@ -416,6 +452,7 @@ warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h\ s/^ [ ]*{ echo \(.*\); \\/ djecho \1 > $@-t/ s/^ [ ]*{ echo \(.*\) && \\/ djecho \1 > $@-t/ s/^ [ ]*cat \(.*\); \\/ sed -e '' \1 >> $@-t/ +s/^ sed -e/ sed -e/ s/ \&\& \\ *$// s/\.in-h\; *\\$/.in-h >> $@-t/ /^ [ ]*} /d diff --git a/msdos/sedlisp.inp b/msdos/sedlisp.inp index d58e247d343..15f17ce3ee2 100644 --- a/msdos/sedlisp.inp +++ b/msdos/sedlisp.inp @@ -25,6 +25,7 @@ export FNCASE=y /^top_srcdir *=/s|@top_srcdir@|./..| /^EXEEXT *=/s/@EXEEXT@/.exe/ /^XARGS_LIMIT *=/s|@XARGS_LIMIT@|| +/^FIND_DELETE *=/s/@FIND_DELETE@/-delete/ /^AM_DEFAULT_VERBOSITY *=/s/@AM_DEFAULT_VERBOSITY@/1/ /^[Aa][Mm]_/s/@AM_V@/$(V)/ /^[Aa][Mm]_/s/@AM_DEFAULT_V@/$(AM_DEFAULT_VERBOSITY)/ diff --git a/src/conf_post.h b/src/conf_post.h index febdb8b8bf7..4c9eb32aba3 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -31,7 +31,7 @@ along with GNU Emacs. If not, see . */ #include -#if defined DOS_NT && !defined DEFER_MS_W32_H +#if defined WINDOWSNT && !defined DEFER_MS_W32_H # include #endif diff --git a/src/msdos.c b/src/msdos.c index 68daa10fdb9..43730ebedc3 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -3943,6 +3943,8 @@ careadlinkat (int fd, char const *filename, int faccessat (int dirfd, const char * path, int mode, int flags) { + char fullname[MAXPATHLEN]; + /* We silently ignore FLAGS. */ flags = flags; diff --git a/src/msdos.h b/src/msdos.h index 16292c551d9..e4f633e9df4 100644 --- a/src/msdos.h +++ b/src/msdos.h @@ -21,6 +21,8 @@ along with GNU Emacs. If not, see . */ #include +#include "termhooks.h" /* struct terminal */ + int dos_ttraw (struct tty_display_info *); int dos_ttcooked (void); int dos_get_saved_screen (char **, int *, int *); @@ -67,6 +69,7 @@ void syms_of_win16select (void); /* Constants. */ #define EINPROGRESS 112 +#define ENOTSUP ENOSYS /* Gnulib sets O_CLOEXEC to O_NOINHERIT, which gets in the way when we need to redirect standard handles for subprocesses using temporary files created by mkostemp, see callproc.c. */ diff --git a/src/process.c b/src/process.c index 943cb2a1048..fc46e743328 100644 --- a/src/process.c +++ b/src/process.c @@ -40,6 +40,8 @@ along with GNU Emacs. If not, see . */ #include #include +#endif /* subprocesses */ + #ifdef HAVE_SETRLIMIT # include @@ -49,6 +51,8 @@ along with GNU Emacs. If not, see . */ static struct rlimit nofile_limit; #endif +#ifdef subprocesses + /* Are local (unix) sockets supported? */ #if defined (HAVE_SYS_UN_H) #if !defined (AF_LOCAL) && defined (AF_UNIX) @@ -7455,6 +7459,13 @@ keyboard_bit_set (fd_set *mask) #else /* not subprocesses */ +/* This is referenced in thread.c:run_thread (which is never actually + called, since threads are not enabled for this configuration. */ +void +update_processes_for_thread_death (Lisp_Object dying_thread) +{ +} + /* Defined in msdos.c. */ extern int sys_select (int, fd_set *, fd_set *, fd_set *, struct timespec *, void *); diff --git a/src/sysdep.c b/src/sysdep.c index dd0062b6f04..f9cc2c81762 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -831,6 +831,8 @@ unblock_child_signal (sigset_t const *oldset) pthread_sigmask (SIG_SETMASK, oldset, 0); } +#endif /* !MSDOS */ + /* Block SIGINT. */ void block_interrupt_signal (sigset_t *oldset) @@ -848,7 +850,6 @@ restore_signal_mask (sigset_t const *oldset) pthread_sigmask (SIG_SETMASK, oldset, 0); } -#endif /* !MSDOS */ /* Saving and restoring the process group of Emacs's terminal. */ diff --git a/src/sysselect.h b/src/sysselect.h index 8295aeb8421..4d8a4d0a3a9 100644 --- a/src/sysselect.h +++ b/src/sysselect.h @@ -50,6 +50,11 @@ typedef int fd_set; #endif #ifdef MSDOS +/* The above #define for 'select' gets in the way because sysselect.h + is included in thread.h, which is included everywhere, and 'select' + declared in DJGPP system headers has a signature incompatible with + 'pselect', which we emulate in msdos.c. */ +#undef select #define pselect sys_select #endif diff --git a/src/thread.c b/src/thread.c index d075bdb3a13..c03cdda0fae 100644 --- a/src/thread.c +++ b/src/thread.c @@ -806,7 +806,11 @@ If NAME is given, it must be a string; it names the new thread. */) { /* Restore the previous situation. */ all_threads = all_threads->next_thread; +#ifdef THREADS_ENABLED error ("Could not start a new thread"); +#else + error ("Concurrency is not supported in this configuration"); +#endif } /* FIXME: race here where new thread might not be filled in? */ diff --git a/src/thread.h b/src/thread.h index cb2133d72d4..19baafbf8a1 100644 --- a/src/thread.h +++ b/src/thread.h @@ -25,6 +25,10 @@ along with GNU Emacs. If not, see . */ #include #endif +#ifdef MSDOS +#include /* sigset_t */ +#endif + #include "sysselect.h" /* FIXME */ #include "systime.h" /* FIXME */ #include "systhread.h" From b8433b0954b26d4620a3154be025fb8a49a73954 Mon Sep 17 00:00:00 2001 From: Bastian Beischer Date: Thu, 19 Oct 2017 02:44:46 +0300 Subject: [PATCH 44/55] Use pop-to-buffer-same-window instead of switch-to-buffer * lisp/cedet/semantic/decorate/include.el (semantic-decoration-include-visit): Use pop-to-buffer-same-window instead of switch-to-buffer (bug#28645). * lisp/cedet/semantic/analyze/refs.el (semantic-analyze-proto-impl-toggle): Same. * lisp/cedet/semantic/senator.el (senator-go-to-up-reference): Same. * lisp/cedet/semantic/mru-bookmark.el (semantic-mrub-visit): Same. * lisp/cedet/semantic/complete.el (semantic-complete-jump): Same. Copyright-paperwork-exempt: yes --- lisp/cedet/semantic/analyze/refs.el | 2 +- lisp/cedet/semantic/complete.el | 2 +- lisp/cedet/semantic/decorate/include.el | 2 +- lisp/cedet/semantic/mru-bookmark.el | 2 +- lisp/cedet/semantic/senator.el | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el index 55fcd830433..a58479f5054 100644 --- a/lisp/cedet/semantic/analyze/refs.el +++ b/lisp/cedet/semantic/analyze/refs.el @@ -348,7 +348,7 @@ Only works for tags in the global namespace." (push-mark) (semantic-go-to-tag target) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-windown (current-buffer)) (semantic-momentary-highlight-tag target)) ) diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index ff8e61e54dc..325ca1f4414 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -2120,7 +2120,7 @@ completion works." (when (semantic-tag-p tag) (push-mark) (semantic-go-to-tag tag) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag tag) (message "%S: %s " (semantic-tag-class tag) diff --git a/lisp/cedet/semantic/decorate/include.el b/lisp/cedet/semantic/decorate/include.el index 6876e5f3a46..9f1825d4208 100644 --- a/lisp/cedet/semantic/decorate/include.el +++ b/lisp/cedet/semantic/decorate/include.el @@ -467,7 +467,7 @@ its contents. (error "Could not location include %s" (semantic-tag-name tag))) ((get-file-buffer file) - (switch-to-buffer (get-file-buffer file))) + (pop-to-buffer-same-window (get-file-buffer file))) ((stringp file) (find-file file)) )))) diff --git a/lisp/cedet/semantic/mru-bookmark.el b/lisp/cedet/semantic/mru-bookmark.el index 5fa58e08ea6..24863de01b1 100644 --- a/lisp/cedet/semantic/mru-bookmark.el +++ b/lisp/cedet/semantic/mru-bookmark.el @@ -113,7 +113,7 @@ Uses `semantic-go-to-tag' and highlighting." (forward-char o)) (error nil)) ;; make it visible - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag tag) )) diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el index e86658628b5..70e04475ab2 100644 --- a/lisp/cedet/semantic/senator.el +++ b/lisp/cedet/semantic/senator.el @@ -530,11 +530,11 @@ Some tags such as includes have other reference features." ;; A tag ((semantic-tag-p result) (semantic-go-to-tag result) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag result)) ;; Buffers ((bufferp result) - (switch-to-buffer result) + (pop-to-buffer-same-window result) (pulse-momentary-highlight-one-line (point))) ;; Files ((and (stringp result) (file-exists-p result)) From 6f1dea5c74057707bf367f863a8be5750bbb6094 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 18 Oct 2017 18:43:00 -0700 Subject: [PATCH 45/55] Spelling fixes * lisp/cedet/semantic/analyze/refs.el: (semantic-analyze-proto-impl-toggle): Fix recently-introduced misspelling of pop-to-buffer-same-window. --- ChangeLog.3 | 6 +++--- doc/misc/flymake.texi | 4 ++-- lib-src/ChangeLog.1 | 2 +- lisp/cedet/semantic/analyze/refs.el | 2 +- msdos/sedlibmk.inp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ChangeLog.3 b/ChangeLog.3 index 811b6dbad76..2d7f3bbf3a2 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -926,7 +926,7 @@ constrained to call REPORT-FN exactly once. It may do so any number of times, cumulatively reporting diagnostics. Flymake keeps track of outdated REPORT-FN instances and disconsiders obsolete reports. - Backends should avoid reporting obsolete data by cancelling any + Backends should avoid reporting obsolete data by canceling any ongoing processing at every renewed call to the backend function. Consolidated flymake.el internal data structures to require less @@ -18314,7 +18314,7 @@ Throw a `search-failed' derived error in Info search - The original fix for Bug#6106 switched from signalling `search-failed' + The original fix for Bug#6106 switched from signaling `search-failed' to `user-error'. However, this breaks incremental searching over multiple nodes because the isearch code doesn't expect a `user-error'. @@ -28599,7 +28599,7 @@ http://trac.common-lisp.net/bordeaux-threads/wiki/ApiDocumentation ... but not identically. In particular I chose not to implement - interrupt-thread or destroy-thread, but instead a thread-signalling + interrupt-thread or destroy-thread, but instead a thread-signaling approach. I'm still undecided about *default-special-bindings* (which I did not diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 05d879d8f4b..99ab1271ac9 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -560,7 +560,7 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. (defun ruby-flymake (report-fn &rest _args) ;; Not having a ruby interpreter is a serious problem which should cause - ;; the backend to disable itself, so an @code{error} is signalled. + ;; the backend to disable itself, so an @code{error} is signaled. ;; (unless (executable-find "ruby") (error "Cannot find a suitable ruby")) @@ -625,7 +625,7 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. msg) into diags finally (funcall report-fn diags))) - (flymake-log :warning "Cancelling obsolete check %s" + (flymake-log :warning "Canceling obsolete check %s" proc)) ;; Cleanup the temporary buffer used to hold the ;; check's output. diff --git a/lib-src/ChangeLog.1 b/lib-src/ChangeLog.1 index 4b5422e712c..5a370035d70 100644 --- a/lib-src/ChangeLog.1 +++ b/lib-src/ChangeLog.1 @@ -5643,7 +5643,7 @@ 1998-04-06 Andreas Schwab Silence -Wimplicit: - * movemail.c: Move cancelations up. Include if + * movemail.c: Move cancellations up. Include if available. * fakemail.c (_XOPEN_SOURCE): Define for declaration of cuserid. (parse_header): Explicitly declare return type. diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el index a58479f5054..6ebf130d305 100644 --- a/lisp/cedet/semantic/analyze/refs.el +++ b/lisp/cedet/semantic/analyze/refs.el @@ -348,7 +348,7 @@ Only works for tags in the global namespace." (push-mark) (semantic-go-to-tag target) - (pop-to-buffer-same-windown (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag target)) ) diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 30776b46d7e..27072e25a6c 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -45,7 +45,7 @@ # ifneq (,$(GL_GENERATE_xxxx_H)) # Depending on whether DJGPP uses the corresponding header, these # should be edited either to 1 (thus exposing the recipe) or -# to notyhing, which makes Make bypass the recipe away. Example: +# to nothing, which makes Make bypass the recipe away. Example: # # s/^@GL_GENERATE_STDBOOL_H@/1/ # s/^@GL_GENERATE_STDINT_H@// From 4d578d432d4cf1e6826f3c07d119017940dd8e6e Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 19 Oct 2017 09:51:12 +0200 Subject: [PATCH 46/55] On Windows default a frame's border width to zero (Bug#28873) * src/w32fns.c (Fx_create_frame): Default `border-width' to zero as everywhere else, see Bug#28873. --- src/w32fns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/w32fns.c b/src/w32fns.c index efbd81b22d9..43af1122fad 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -5847,7 +5847,8 @@ This function is an internal primitive--use `make-frame' instead. */) that are needed to determine window geometry. */ x_default_font_parameter (f, parameters); - x_default_parameter (f, parameters, Qborder_width, make_number (2), + /* Default BorderWidth to 0 to match other platforms. */ + x_default_parameter (f, parameters, Qborder_width, make_number (0), "borderWidth", "BorderWidth", RES_TYPE_NUMBER); /* We recognize either internalBorderWidth or internalBorder @@ -5862,7 +5863,7 @@ This function is an internal primitive--use `make-frame' instead. */) parameters = Fcons (Fcons (Qinternal_border_width, value), parameters); } - /* Default internalBorderWidth to 0 on Windows to match other programs. */ + x_default_parameter (f, parameters, Qinternal_border_width, make_number (0), "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER); x_default_parameter (f, parameters, Qright_divider_width, make_number (0), From 25f83fa7c527f318b6e53c8a9ae32bdc629b32c2 Mon Sep 17 00:00:00 2001 From: Bastian Beischer Date: Thu, 19 Oct 2017 13:03:11 +0300 Subject: [PATCH 47/55] ; Indentation fixes --- lisp/cedet/semantic/decorate/include.el | 2 +- lisp/cedet/semantic/senator.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/cedet/semantic/decorate/include.el b/lisp/cedet/semantic/decorate/include.el index 9f1825d4208..975ba343469 100644 --- a/lisp/cedet/semantic/decorate/include.el +++ b/lisp/cedet/semantic/decorate/include.el @@ -467,7 +467,7 @@ its contents. (error "Could not location include %s" (semantic-tag-name tag))) ((get-file-buffer file) - (pop-to-buffer-same-window (get-file-buffer file))) + (pop-to-buffer-same-window (get-file-buffer file))) ((stringp file) (find-file file)) )))) diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el index 70e04475ab2..ea796dd19f9 100644 --- a/lisp/cedet/semantic/senator.el +++ b/lisp/cedet/semantic/senator.el @@ -530,11 +530,11 @@ Some tags such as includes have other reference features." ;; A tag ((semantic-tag-p result) (semantic-go-to-tag result) - (pop-to-buffer-same-window (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag result)) ;; Buffers ((bufferp result) - (pop-to-buffer-same-window result) + (pop-to-buffer-same-window result) (pulse-momentary-highlight-one-line (point))) ;; Files ((and (stringp result) (file-exists-p result)) From 3ea6a4d4baf67ae88dc8041c6247e9f0e3cd1eab Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 19 Oct 2017 13:37:23 +0200 Subject: [PATCH 48/55] Skip an rsync test in tramp-tests.el * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards): Skip for "rsync". --- test/lisp/net/tramp-tests.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 7cc0779b81c..c88abbfcb26 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2346,6 +2346,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." "Check `dired' with wildcards." (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) + (skip-unless (not (tramp--test-rsync-p))) ;; Since Emacs 26.1. (skip-unless (fboundp 'insert-directory-wildcard-in-dir-p)) @@ -4394,6 +4395,7 @@ Since it unloads Tramp, it shall be the last test to run." ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. ;; * Fix `tramp-test06-directory-file-name' for `ftp'. ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). +;; * Fix `tramp-test28-interrupt-process', timeout doesn't work reliably. ;; * Fix Bug#16928 in `tramp-test38-asynchronous-requests'. (defun tramp-test-all (&optional interactive) From 234b1e3864b8b940f72f3727fe7087cf7e90b43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 20 Oct 2017 00:50:34 +0100 Subject: [PATCH 49/55] Flymake backends must check proc obsoleteness in source buffer Flymake backends that rely on sentinels running asynchronously and checking buffer-local variables that hold running processes should check for obsoleteness in the correct buffers, otherwise a (harmless) warning might be triggered. * doc/misc/flymake.texi (An annotated example backend): Check buffer-local proc in the current buffer. * lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile): Check buffer-local proc in the current buffer. --- doc/misc/flymake.texi | 2 +- lisp/progmodes/elisp-mode.el | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 99ab1271ac9..2aabaf06b73 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -600,7 +600,7 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. ;; `ruby--flymake-proc', which indicates that ;; `proc' is not an obsolete process. ;; - (if (eq proc ruby--flymake-proc) + (if (with-current-buffer source (eq proc ruby--flymake-proc)) (with-current-buffer (process-buffer proc) (goto-char (point-min)) ;; Parse the output buffer for diagnostic's diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 99a4841e318..41415943a58 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1693,7 +1693,8 @@ current buffer state and calls REPORT-FN when done." (when (eq (process-status proc) 'exit) (unwind-protect (cond - ((not (eq proc elisp-flymake--byte-compile-process)) + ((not (eq proc (with-current-buffer source-buffer + elisp-flymake--byte-compile-process))) (flymake-log :warning "byte-compile process %s obsolete" proc)) ((zerop (process-exit-status proc)) (elisp-flymake--byte-compile-done report-fn From ddd547fada112c603dae7a204fa0b141429f1927 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 19 Oct 2017 20:05:48 -0400 Subject: [PATCH 50/55] Improve treatment of Fortran's "class default" * lisp/progmodes/f90.el (f90-start-block-re, f90-no-block-limit): Handle "class default". (Bug#28786) * test/automated/f90.el (f90-test-bug25039): Add "class default". --- lisp/progmodes/f90.el | 12 +++++++++--- test/lisp/progmodes/f90-tests.el | 14 +++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 6421ba60dce..72156288eba 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -909,6 +909,8 @@ Can be overridden by the value of `font-lock-maximum-decoration'.") [ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)" "Regexp matching the definition of a derived type.") +;; Maybe this should include "class default", but the constant is no +;; longer used. (defconst f90-typeis-re "\\_<\\(class\\|type\\)[ \t]*is[ \t]*(" "Regexp matching a CLASS/TYPE IS statement.") @@ -955,10 +957,14 @@ Used in the F90 entry in `hs-special-modes-alist'.") ;; Avoid F2003 "type is" in "select type", ;; and also variables of derived type "type (foo)". ;; "type, foo" must be a block (?). + ;; And a partial effort to avoid "class default". "\\(?:type\\|class\\)[ \t,]\\(" - "[^i(!\n\"& \t]\\|" ; not-i( + "[^id(!\n\"& \t]\\|" ; not-id( "i[^s!\n\"& \t]\\|" ; i not-s - "is\\(?:\\sw\\|\\s_\\)\\)\\|" + "d[^e!\n\"& \t]\\|" ; d not-e + "de[^f!\n\"& \t]\\|" ; de not-f + "def[^a!\n\"& \t]\\|" ; def not-a + "\\(?:is\\|default\\)\\(?:\\sw\\|\\s_\\)\\)\\|" ;; "abstract interface" is F2003; "submodule" is F2008. "program\\|\\(?:abstract[ \t]*\\)?interface\\|\\(?:sub\\)?module\\|" ;; "enum", but not "enumerator". @@ -1454,7 +1460,7 @@ if all else fails." (not (or (looking-at "end") (looking-at "\\(do\\|if\\|else\\(if\\|where\\)?\ \\|select[ \t]*\\(case\\|type\\)\\|case\\|where\\|forall\\|\ -\\(?:class\\|type\\)[ \t]*is\\|\ +\\(?:class\\|type\\)[ \t]*is\\|class[ \t]*default\\|\ block\\|critical\\|enum\\|associate\\)\\_>") (looking-at "\\(program\\|\\(?:sub\\)?module\\|\ \\(?:abstract[ \t]*\\)?interface\\|block[ \t]*data\\)\\_>") diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el index 0c03a190ca2..2a9100adff6 100644 --- a/test/lisp/progmodes/f90-tests.el +++ b/test/lisp/progmodes/f90-tests.el @@ -256,21 +256,25 @@ end program prog") (should (= 5 (current-indentation))))) (ert-deftest f90-test-bug25039 () - "Test for https://debbugs.gnu.org/25039 ." + "Test for https://debbugs.gnu.org/25039 and 28786." (with-temp-buffer (f90-mode) (insert "program prog select type (a) -class is (c1) -x = 1 type is (t1) x = 2 +class is (c1) +x = 1 +class default +x=3 end select end program prog") (f90-indent-subprogram) (forward-line -3) - (should (= 2 (current-indentation))) ; type is + (should (= 2 (current-indentation))) ; class default (forward-line -2) - (should (= 2 (current-indentation))))) ; class is + (should (= 2 (current-indentation))) ; class is + (forward-line -2) + (should (= 2 (current-indentation))))) ; type is ;;; f90-tests.el ends here From 831eafc8ae201881e6449e2ab5d15d594573650b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Thu, 19 Oct 2017 12:33:20 +0100 Subject: [PATCH 51/55] Augment Flymake API for third-party extensions See https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00619.html * doc/misc/flymake.texi (Flymake error types): Rewrite example. (Flymake utility functions): Augment with new API. * lisp/progmodes/flymake.el (flymake-diagnostics): New function. (flymake--diag-accessor): New helper macro. (flymake-diagnostic-buffer, flymake-diagnostic-text) (flymake-diagnostic-beg, flymake-diagnostic-end) (flymake-diagnostic-backend): Accessors for diagnostic objects. (flymake--overlays): Use flymake-diagnostic property. (flymake--highlight-line): Simplify. Only set flymake-diagnostic property. (flymake--handle-report, flymake-goto-next-error): Use flymake-diagnostic property. (flymake-show-diagnostic): Use diagnostic object. (flymake--diagnostics-buffer-entries): Use flymake-diagnostics. --- doc/misc/flymake.texi | 69 ++++++++++++++++++++++++++------------- lisp/progmodes/flymake.el | 56 ++++++++++++++++++++----------- 2 files changed, 83 insertions(+), 42 deletions(-) diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 2aabaf06b73..b0a56492bcd 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -361,34 +361,38 @@ priority but without an overlay face. (flymake-category . flymake-note)))) @end example -@vindex flymake-text +@vindex flymake-diagnostics +@vindex flymake-diagnostic-backend +@vindex flymake-diagnostic-buffer +@vindex flymake-diagnostic-text +@vindex flymake-diagnostic-beg +@vindex flymake-diagnostic-end As you might have guessed, Flymake's annotations are implemented as overlays (@pxref{Overlays,,, elisp, The Emacs Lisp Reference Manual}). Along with the properties that you specify for the specific type of -diagnostic, Flymake adds the property @code{flymake-text} to these -overlays, and sets it to the message string that the backend used to -describe the diagnostic. +diagnostic, Flymake adds the property @code{flymake-diagnostic} to +these overlays, and sets it to the object that the backend created +with @code{flymake-make-diagnostic}. -Since overlays also support arbitrary keymaps, you can use this -property @code{flymake-text} to create interactive annotations, such -as in the following example of binding a @kbd{mouse-3} event (middle -mouse button click) to an Internet search for the text of a -@code{:warning} or @code{:error}. +Since overlays also support arbitrary keymaps, you can use this along +with the functions @code{flymake-diagnostics} and +@code{flymake-diagnostic-text} (@pxref{Flymake utility functions}) to +create interactive annotations, such as in the following example of +binding a @code{mouse-3} event (middle mouse button click) to an +Internet search for the text of a @code{:warning} or @code{:error}. @example (defun my-search-for-message (event) (interactive "e") - (let ((ovs (overlays-at (posn-point (event-start event)))) - ov) - ;; loop until flymake overlay we clicked on is recovered - (while (not (overlay-get (setq ov (pop ovs)) 'flymake-text))) - (when ov - (eww-browse-url - (concat "https://duckduckgo.com/?q=" - (replace-regexp-in-string " " - "+" - (overlay-get ov 'flymake-text))) - t)))) + (let* ((diags (flymake-diagnostics (posn-point (event-start event)))) + (topmost-diag (car diags))) + (eww-browse-url + (concat + "https://duckduckgo.com/?q=" + (replace-regexp-in-string " " + "+" + (flymake-diagnostic-text topmost-diag))) + t))) (dolist (type '(:warning :error)) (let ((a (assoc type flymake-diagnostic-types-alist))) @@ -513,6 +517,24 @@ Make a Flymake diagnostic for @var{buffer}'s region from @var{beg} to of the problem detected in this region. @end deffn +@cindex access diagnostic object +These objects' properties can be accessed with the functions +@code{flymake-diagnostic-backend}, @code{flymake-diagnostic-buffer}, +@code{flymake-diagnostic-text}, @code{flymake-diagnostic-beg}, +@code{flymake-diagnostic-end} and @code{flymake-diagnostic-type}. + +Additionally, the function @code{flymake-diagnostics} will collect +such objects in the region you specify. + +@cindex collect diagnostic objects +@deffn Function flymake-diagnostics beg end +Get a list of Flymake diagnostics in the region determined by +@var{beg} and @var{end}. If neither @var{beg} or @var{end} is +supplied, use the whole buffer, otherwise if @var{beg} is +non-@code{nil} and @var{end} is @code{nil}, consider only diagnostics +at @var{beg}. +@end deffn + @cindex buffer position from line and column number It is often the case with external syntax tools that a diagnostic's position is reported in terms of a line number, and sometimes a column @@ -520,9 +542,10 @@ number. To convert this information into a buffer position, backends can use the following function: @deffn Function flymake-diag-region buffer line &optional col -Compute @var{buffer}'s region (@var{beg} . @var{end}) corresponding to -@var{line} and @var{col}. If @var{col} is nil, return a region just -for @var{line}. Return nil if the region is invalid. +Compute @var{buffer}'s region (@var{beg} . @var{end}) corresponding +to @var{line} and @var{col}. If @var{col} is @code{nil}, return a +region just for @var{line}. Return @code{nil} if the region is +invalid. @end deffn @cindex add a log message diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 5d5f9bb75d8..9c546fd9667 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -228,6 +228,29 @@ TYPE is a key to `flymake-diagnostic-types-alist' and TEXT is a description of the problem detected in this region." (flymake--diag-make :buffer buffer :beg beg :end end :type type :text text)) +;;;###autoload +(defun flymake-diagnostics (&optional beg end) + "Get Flymake diagnostics in region determined by BEG and END. + +If neither BEG or END is supplied, use the whole buffer, +otherwise if BEG is non-nil and END is nil, consider only +diagnostics at BEG." + (mapcar (lambda (ov) (overlay-get ov 'flymake-diagnostic)) + (flymake--overlays :beg beg :end end))) + +(defmacro flymake--diag-accessor (public internal thing) + "Make PUBLIC an alias for INTERNAL, add doc using THING." + `(defsubst ,public (diag) + ,(format "Get Flymake diagnostic DIAG's %s." (symbol-name thing)) + (,internal diag))) + +(flymake--diag-accessor flymake-diagnostic-buffer flymake--diag-buffer buffer) +(flymake--diag-accessor flymake-diagnostic-text flymake--diag-text text) +(flymake--diag-accessor flymake-diagnostic-type flymake--diag-type type) +(flymake--diag-accessor flymake-diagnostic-beg flymake--diag-beg beg) +(flymake--diag-accessor flymake-diagnostic-end flymake--diag-end end) +(flymake--diag-accessor flymake-diagnostic-backend flymake--diag-backend backend) + (cl-defun flymake--overlays (&key beg end filter compare key) "Get flymake-related overlays. If BEG is non-nil and END is nil, consider only `overlays-at' @@ -238,7 +261,7 @@ verify FILTER, a function, and sort them by COMPARE (using KEY)." (widen) (let ((ovs (cl-remove-if-not (lambda (ov) - (and (overlay-get ov 'flymake) + (and (overlay-get ov 'flymake-diagnostic) (or (not filter) (funcall filter ov)))) (if (and beg (null end)) @@ -498,18 +521,15 @@ associated `flymake-category' return DEFAULT." (default-maybe 'help-echo (lambda (_window _ov pos) (mapconcat - (lambda (ov) - (overlay-get ov 'flymake-text)) - (flymake--overlays :beg pos) + #'flymake--diag-text + (flymake-diagnostics pos) "\n"))) (default-maybe 'severity (warning-numeric-level :error)) (default-maybe 'priority (+ 100 (overlay-get ov 'severity)))) ;; Some properties can't be overridden. ;; (overlay-put ov 'evaporate t) - (overlay-put ov 'flymake t) - (overlay-put ov 'flymake-text (flymake--diag-text diagnostic)) - (overlay-put ov 'flymake--diagnostic diagnostic))) + (overlay-put ov 'flymake-diagnostic diagnostic))) ;; Nothing in Flymake uses this at all any more, so this is just for ;; third-party compatibility. @@ -600,7 +620,7 @@ not expected." (lambda (ov) (eq backend (flymake--diag-backend - (overlay-get ov 'flymake--diagnostic)))))) + (overlay-get ov 'flymake-diagnostic)))))) (mapc (lambda (diag) (flymake--highlight-line diag) (setf (flymake--diag-backend diag) backend)) @@ -899,7 +919,7 @@ applied." (lambda (ov) (let ((diag (overlay-get ov - 'flymake--diagnostic))) + 'flymake-diagnostic))) (and diag (or (not filter) (memq (flymake--diag-type diag) @@ -1089,13 +1109,13 @@ applied." (interactive (list (point) t)) (let* ((id (or (tabulated-list-get-id pos) (user-error "Nothing at point"))) - (overlay (plist-get id :overlay))) - (with-current-buffer (overlay-buffer overlay) + (diag (plist-get id :diagnostic))) + (with-current-buffer (flymake--diag-buffer diag) (with-selected-window (display-buffer (current-buffer) other-window) - (goto-char (overlay-start overlay)) - (pulse-momentary-highlight-region (overlay-start overlay) - (overlay-end overlay) + (goto-char (flymake--diag-beg diag)) + (pulse-momentary-highlight-region (flymake--diag-beg diag) + (flymake--diag-end diag) 'highlight)) (current-buffer)))) @@ -1108,18 +1128,16 @@ POS can be a buffer position or a button" (defun flymake--diagnostics-buffer-entries () (with-current-buffer flymake--diagnostics-buffer-source - (cl-loop for ov in (flymake--overlays) - for diag = (overlay-get ov - 'flymake--diagnostic) + (cl-loop for diag in (flymake-diagnostics) for (line . col) = (save-excursion - (goto-char (overlay-start ov)) + (goto-char (flymake--diag-beg diag)) (cons (line-number-at-pos) (- (point) (line-beginning-position)))) for type = (flymake--diag-type diag) collect - (list (list :overlay ov + (list (list :diagnostic diag :line line :severity (flymake--lookup-type-property type From fd3d8610b27e26107ba15070aba0d488152f8f4d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 20 Oct 2017 12:36:12 +0300 Subject: [PATCH 52/55] Make :align-to account for display-line-numbers These changes also update the various bundled packages to use new feature, and better support customizations of the line-number face. * src/xdisp.c (calc_pixel_width_or_height): Improve commentary. Make :align-to count from the end of the line-number display when the offset or the width form reference that of the text area. (Bug#28855) * src/indent.c (Fline_number_display_width): Implement support for the PIXELWISE argument being 'columns'. Update the doc string. (syms_of_indent): New symbol 'columns'. * lisp/ruler-mode.el (ruler-mode-window-col, ruler-mode-ruler): Call line-number-display-width with last argument 'columns'. * lisp/proced.el (proced-header-line): Call line-number-display-width with 2nd arg 'columns', which also fixes a problem when display-line-numbers is nil. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width): Call line-number-display-width with 2nd arg 'columns. (tabulated-list-entry-lnum-width): Remove unneeded defvar. (tabulated-list-print, tabulated-list-print-entry): No need to account for the value of tabulated-list-entry-lnum-width. (tabulated-list--current-lnum-width): New defvar. (tabulated-list-watch-line-number-width): New function. (tabulated-list-mode): Bind tabulated-list--current-lnum-width locally, and set up tabulated-list-watch-line-number-width as pre-redisplay-functions hook. * doc/lispref/display.texi (Size of Displayed Text): Document the 'columns' value of the PIXELWISE argument. (Pixel Specification): Update and improve the documentation of the supported forms. --- doc/lispref/display.texi | 49 +++++++++++++++++++---------- lisp/emacs-lisp/tabulated-list.el | 25 ++++++++++----- lisp/proced.el | 3 +- lisp/ruler-mode.el | 16 ++++++++-- src/indent.c | 23 +++++++++++--- src/xdisp.c | 51 ++++++++++++++++++++++++++++--- 6 files changed, 129 insertions(+), 38 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index fbdd810247d..17126ce72b9 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2050,14 +2050,17 @@ calculations. @defun line-number-display-width &optional pixelwise This function returns the width used for displaying the line numbers -in the selected window. Optional argument @var{pixelwise}, if -non-@code{nil}, means return the value in pixels; otherwise the value -is returned in column units of the font defined for the +in the selected window. If the optional argument @var{pixelwise} is +the symbol @code{columns}, the return value is a float number of the +frame's canonical columns; if @var{pixelwise} is @code{t} or any other +non-@code{nil} value, the value is an integer and is measured in +pixels. If @var{pixelwise} is omitted or @code{nil}, the value is the +integer number of columns of the font defined for the @code{line-number} face, and doesn't include the 2 columns used to pad -the numbers. If line numbers are not displayed in the selected -window, the value is zero. Use @code{with-selected-window} -(@pxref{Selecting Windows}) if you need this information about another -window. +the numbers on display. If line numbers are not displayed in the +selected window, the value is zero regardless of the value of +@var{pixelwise}. Use @code{with-selected-window} (@pxref{Selecting +Windows}) if you need this information about another window. @end defun @@ -4636,7 +4639,7 @@ as an absolute number of pixels. @smallexample @group - @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | @var{image} | @var{form} + @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | @var{image} | @var{xwidget} | @var{form} @var{num} ::= @var{integer} | @var{float} | @var{symbol} @var{unit} ::= in | mm | cm | width | height @end group @@ -4652,22 +4655,34 @@ as an absolute number of pixels. The form @var{num} specifies a fraction of the default frame font height or width. The form @code{(@var{num})} specifies an absolute number of pixels. If @var{num} is a symbol, @var{symbol}, its -buffer-local variable binding is used. +buffer-local variable binding is used; that binding can be either a +number or a cons cell of the forms shown above (including yet another +cons cell whose @code{car} is a symbol that has a buffer-local +binding). The @code{in}, @code{mm}, and @code{cm} units specify the number of pixels per inch, millimeter, and centimeter, respectively. The @code{width} and @code{height} units correspond to the default width -and height of the current face. An image specification @code{image} -corresponds to the width or height of the image. +and height of the current face. An image specification of the form +@w{@code{(image . @var{props})}} (@pxref{Image Descriptors}) +corresponds to the width or height of the specified image. Similarly, +an xwidget specification of the form @w{@code{(xwidget . @var{props})}} +stands for the width or height of the specified xwidget. +@xref{Xwidgets}. The elements @code{left-fringe}, @code{right-fringe}, @code{left-margin}, @code{right-margin}, @code{scroll-bar}, and -@code{text} specify to the width of the corresponding area of the -window. +@code{text} specify the width of the corresponding area of the window. +When the window displays line numbers (@pxref{Size of Displayed +Text}), the width of the @code{text} area is decreased by the screen +space taken by the line-number display. The @code{left}, @code{center}, and @code{right} positions can be used with @code{:align-to} to specify a position relative to the left -edge, center, or right edge of the text area. +edge, center, or right edge of the text area. When the window +displays line numbers, the @code{left} and the @code{center} positions +are offset to account for the screen space taken by the line-number +display. Any of the above window elements (except @code{text}) can also be used with @code{:align-to} to specify that the position is relative to @@ -4683,13 +4698,15 @@ the left-margin, use If no specific base offset is set for alignment, it is always relative to the left edge of the text area. For example, @samp{:align-to 0} in a -header-line aligns with the first text column in the text area. +header-line aligns with the first text column in the text area. When +the window displays line numbers, the text is considered to start where +the space used for line-number display ends. A value of the form @code{(@var{num} . @var{expr})} stands for the product of the values of @var{num} and @var{expr}. For example, @code{(2 . in)} specifies a width of 2 inches, while @code{(0.5 . @var{image})} specifies half the width (or height) of the specified -image. +@var{image} (which should be given by its image spec). The form @code{(+ @var{expr} ...)} adds up the value of the expressions. The form @code{(- @var{expr} ...)} negates or subtracts diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index d1d7c0a8042..73ddadfb805 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -193,10 +193,10 @@ Populated by `tabulated-list-init-header'.") ;; is displayed. (if (not display-line-numbers) 0 - (let ((cbuf-window (get-buffer-window (current-buffer)))) + (let ((cbuf-window (get-buffer-window (current-buffer) t))) (if (window-live-p cbuf-window) (with-selected-window cbuf-window - (+ (line-number-display-width) 2)) + (line-number-display-width 'columns)) 4)))) (defun tabulated-list-init-header () @@ -329,8 +329,6 @@ Check the current row, the previous one and the next row." (string-width (if (stringp nt) nt (car nt))))) tabulated-list--near-rows))) -(defvar tabulated-list-entry-lnum-width nil) - (defun tabulated-list-print (&optional remember-pos update) "Populate the current Tabulated List mode buffer. This sorts the `tabulated-list-entries' list if sorting is @@ -373,7 +371,6 @@ changing `tabulated-list-sort-key'." (unless tabulated-list-use-header-line (tabulated-list-print-fake-header))) ;; Finally, print the resulting list. - (setq tabulated-list-entry-lnum-width (tabulated-list-line-number-width)) (while entries (let* ((elt (car entries)) (tabulated-list--near-rows @@ -428,9 +425,8 @@ of column descriptors." (x (max tabulated-list-padding 0)) (ncols (length tabulated-list-format)) (inhibit-read-only t)) - (setq x (+ x tabulated-list-entry-lnum-width)) (if (> tabulated-list-padding 0) - (insert (make-string (- x tabulated-list-entry-lnum-width) ?\s))) + (insert (make-string x ?\s))) (let ((tabulated-list--near-rows ; Bind it if not bound yet (Bug#25506). (or (bound-and-true-p tabulated-list--near-rows) (list (or (tabulated-list-get-entry (point-at-bol 0)) @@ -601,6 +597,14 @@ With a numeric prefix argument N, sort the Nth column." (tabulated-list-init-header) (tabulated-list-print t))) +(defvar tabulated-list--current-lnum-width nil) +(defun tabulated-list-watch-line-number-width (_window) + (if display-line-numbers + (let ((lnum-width (tabulated-list-line-number-width))) + (when (not (= tabulated-list--current-lnum-width lnum-width)) + (setq-local tabulated-list--current-lnum-width lnum-width) + (tabulated-list-revert))))) + ;;; The mode definition: (define-derived-mode tabulated-list-mode special-mode "Tabulated" @@ -645,7 +649,12 @@ as the ewoc pretty-printer." ;; column of the first entry happens to begin with a R2L letter. (setq bidi-paragraph-direction 'left-to-right) ;; This is for if/when they turn on display-line-numbers - (add-hook 'display-line-numbers-mode-hook #'tabulated-list-revert nil t)) + (add-hook 'display-line-numbers-mode-hook #'tabulated-list-revert nil t) + ;; This is for if/when they customize the line-number face or when + ;; the line-number width needs to change due to scrolling. + (setq-local tabulated-list--current-lnum-width 0) + (add-hook 'pre-redisplay-functions + #'tabulated-list-watch-line-number-width nil t)) (put 'tabulated-list-mode 'mode-class 'special) diff --git a/lisp/proced.el b/lisp/proced.el index c9e851b7e05..aec54b59211 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -604,7 +604,8 @@ Important: the match ends just after the marker.") "Return header line for Proced buffer." (list (propertize " " 'display - (list 'space :align-to (+ 2 (line-number-display-width)))) + (list 'space :align-to + (line-number-display-width 'columns))) (if (<= (window-hscroll) (length proced-header-line)) (replace-regexp-in-string ;; preserve text properties "\\(%\\)" "\\1\\1" diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index 7a23f4d03c0..3d27858d0fe 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -307,7 +307,12 @@ or remove a tab stop. \\[ruler-mode-toggle-show-tab-stops] or N is a column number relative to selected frame. If required, account for screen estate taken by `display-line-numbers'." (if display-line-numbers - (setq n (- n (line-number-display-width) 2))) + ;; FIXME: ruler-mode relies on N being an integer, so if the + ;; 'line-number' face is customized to use a font that is larger + ;; or smaller than that of the default face, the alignment might + ;; be off by up to half a column, unless the font width is an + ;; integral multiple or divisor of the default face's font. + (setq n (- n (round (line-number-display-width 'columns))))) (- n (or (car (window-margins)) 0) (fringe-columns 'left) @@ -668,7 +673,12 @@ Optional argument PROPS specifies other text properties to apply." (let* ((w (ruler-mode-text-scaled-window-width)) (m (window-margins)) (f (window-fringes)) - (i (if display-line-numbers (+ (line-number-display-width) 2) 0)) + (i (if display-line-numbers + ;; FIXME: ruler-mode relies on I being an integer, so + ;; the column numbers might be slightly off if the + ;; line-number face is customized. + (round (line-number-display-width 'columns)) + 0)) (j (ruler-mode-text-scaled-window-hscroll)) ;; Setup the scrollbar, fringes, and margins areas. (lf (ruler-mode-space @@ -708,7 +718,7 @@ Optional argument PROPS specifies other text properties to apply." ;; line-number display be blank, not filled with ;; ruler-mode-basic-graduation-char. (if display-line-numbers - (let* ((lndw (+ (line-number-display-width) 2)) + (let* ((lndw (round (line-number-display-width 'columns))) (s (make-string lndw ?\s))) (concat s (make-string (- w lndw) ruler-mode-basic-graduation-char))) diff --git a/src/indent.c b/src/indent.c index a3e9b5b0b9a..192eec72efe 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1991,15 +1991,26 @@ line_number_display_width (struct window *w, int *width, int *pixel_width) DEFUN ("line-number-display-width", Fline_number_display_width, Sline_number_display_width, 0, 1, 0, doc: /* Return the width used for displaying line numbers in the selected window. -If optional argument PIXELWISE is non-nil, return the width in pixels, -otherwise return the width in columns of the face used to display -line numbers, `line-number'. Note that in the latter case, the value -doesn't include the 2 columns used for padding the numbers. */) +If optional argument PIXELWISE is the symbol `columns', return the width +in units of the frame's canonical character width. In this case, the +value is a float. +If optional argument PIXELWISE is t or any other non-nil value, return +the width as an integer number of pixels. +Otherwise return the value as an integer number of columns of the face +used to display line numbers, `line-number'. Note that in the latter +case, the value doesn't include the 2 columns used for padding the +numbers on display. */) (Lisp_Object pixelwise) { int width, pixel_width; + struct window *w = XWINDOW (selected_window); line_number_display_width (XWINDOW (selected_window), &width, &pixel_width); - if (!NILP (pixelwise)) + if (EQ (pixelwise, Qcolumns)) + { + struct frame *f = XFRAME (w->frame); + return make_float ((double) pixel_width / FRAME_COLUMN_WIDTH (f)); + } + else if (!NILP (pixelwise)) return make_number (pixel_width); return make_number (width); } @@ -2361,6 +2372,8 @@ syms_of_indent (void) doc: /* Indentation can insert tabs if this is non-nil. */); indent_tabs_mode = 1; + DEFSYM (Qcolumns, "columns"); + defsubr (&Scurrent_indentation); defsubr (&Sindent_to); defsubr (&Scurrent_column); diff --git a/src/xdisp.c b/src/xdisp.c index 6d9acecb424..dc23959aadb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25123,7 +25123,20 @@ else if the text is replaced by an ellipsis. */) '(space :width (+ left-fringe left-margin (- (1)))) '(space :width (+ left-fringe left-margin (-1))) -*/ + If ALIGN_TO is NULL, returns the result in *RES. If ALIGN_TO is + non-NULL, the value of *ALIGN_TO is a window-relative pixel + coordinate, and *RES is the additional pixel width from that point + till the end of the stretch glyph. + + WIDTH_P non-zero means take the width dimension or X coordinate of + the object specified by PROP, WIDTH_P zero means take the height + dimension or the Y coordinate. (Therefore, if ALIGN_TO is + non-NULL, WIDTH_P should be non-zero.) + + FONT is the font of the face of the surrounding text. + + The return value is non-zero if width or height were successfully + calculated, i.e. if PROP is a valid spec. */ static bool calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, @@ -25145,6 +25158,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, { char *unit = SSDATA (SYMBOL_NAME (prop)); + /* The UNIT expression, e.g. as part of (NUM . UNIT). */ if (unit[0] == 'i' && unit[1] == 'n') pixels = 1.0; else if (unit[0] == 'm' && unit[1] == 'm') @@ -25165,10 +25179,12 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, } #ifdef HAVE_WINDOW_SYSTEM + /* 'height': the height of FONT. */ if (EQ (prop, Qheight)) return OK_PIXELS (font ? normal_char_height (font, -1) : FRAME_LINE_HEIGHT (it->f)); + /* 'width': the width of FONT. */ if (EQ (prop, Qwidth)) return OK_PIXELS (font ? FONT_WIDTH (font) @@ -25178,33 +25194,48 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, return OK_PIXELS (1); #endif + /* 'text': the width or height of the text area. */ if (EQ (prop, Qtext)) return OK_PIXELS (width_p - ? window_box_width (it->w, TEXT_AREA) + ? (window_box_width (it->w, TEXT_AREA) + - it->lnum_pixel_width) : WINDOW_BOX_HEIGHT_NO_MODE_LINE (it->w)); + /* ':align_to'. First time we compute the value, window + elements are interpreted as the position of the element's + left edge. */ if (align_to && *align_to < 0) { *res = 0; + /* 'left': left edge of the text area. */ if (EQ (prop, Qleft)) - return OK_ALIGN_TO (window_box_left_offset (it->w, TEXT_AREA)); + return OK_ALIGN_TO (window_box_left_offset (it->w, TEXT_AREA) + + it->lnum_pixel_width); + /* 'right': right edge of the text area. */ if (EQ (prop, Qright)) return OK_ALIGN_TO (window_box_right_offset (it->w, TEXT_AREA)); + /* 'center': the center of the text area. */ if (EQ (prop, Qcenter)) return OK_ALIGN_TO (window_box_left_offset (it->w, TEXT_AREA) + + it->lnum_pixel_width + window_box_width (it->w, TEXT_AREA) / 2); + /* 'left-fringe': left edge of the left fringe. */ if (EQ (prop, Qleft_fringe)) return OK_ALIGN_TO (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w) ? WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (it->w) : window_box_right_offset (it->w, LEFT_MARGIN_AREA)); + /* 'right-fringe': left edge of the right fringe. */ if (EQ (prop, Qright_fringe)) return OK_ALIGN_TO (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w) ? window_box_right_offset (it->w, RIGHT_MARGIN_AREA) : window_box_right_offset (it->w, TEXT_AREA)); + /* 'left-margin': left edge of the left display margin. */ if (EQ (prop, Qleft_margin)) return OK_ALIGN_TO (window_box_left_offset (it->w, LEFT_MARGIN_AREA)); + /* 'right-margin': left edge of the right display margin. */ if (EQ (prop, Qright_margin)) return OK_ALIGN_TO (window_box_left_offset (it->w, RIGHT_MARGIN_AREA)); + /* 'scroll-bar': left edge of the vertical scroll bar. */ if (EQ (prop, Qscroll_bar)) return OK_ALIGN_TO (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (it->w) ? 0 @@ -25215,6 +25246,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, } else { + /* Otherwise, the elements stand for their width. */ if (EQ (prop, Qleft_fringe)) return OK_PIXELS (WINDOW_LEFT_FRINGE_WIDTH (it->w)); if (EQ (prop, Qright_fringe)) @@ -25237,6 +25269,8 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, int base_unit = (width_p ? FRAME_COLUMN_WIDTH (it->f) : FRAME_LINE_HEIGHT (it->f)); + if (width_p && align_to && *align_to < 0) + return OK_PIXELS (XFLOATINT (prop) * base_unit + it->lnum_pixel_width); return OK_PIXELS (XFLOATINT (prop) * base_unit); } @@ -25248,6 +25282,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, if (SYMBOLP (car)) { #ifdef HAVE_WINDOW_SYSTEM + /* '(image PROPS...)': width or height of the specified image. */ if (FRAME_WINDOW_P (it->f) && valid_image_p (prop)) { @@ -25256,12 +25291,15 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, return OK_PIXELS (width_p ? img->width : img->height); } + /* '(xwidget PROPS...)': dimensions of the specified xwidget. */ if (FRAME_WINDOW_P (it->f) && valid_xwidget_spec_p (prop)) { /* TODO: Don't return dummy size. */ return OK_PIXELS (100); } #endif + /* '(+ EXPR...)' or '(- EXPR...)' add or subtract + recursively calculated values. */ if (EQ (car, Qplus) || EQ (car, Qminus)) { bool first = true; @@ -25289,15 +25327,18 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, car = Qnil; } + /* '(NUM)': absolute number of pixels. */ if (NUMBERP (car)) { double fact; + int offset = + width_p && align_to && *align_to < 0 ? it->lnum_pixel_width : 0; pixels = XFLOATINT (car); if (NILP (cdr)) - return OK_PIXELS (pixels); + return OK_PIXELS (pixels + offset); if (calc_pixel_width_or_height (&fact, it, cdr, font, width_p, align_to)) - return OK_PIXELS (pixels * fact); + return OK_PIXELS (pixels * fact + offset); return false; } From d815de017bb531fed751ee0515ed90b73d7a9936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 20 Oct 2017 11:25:34 +0100 Subject: [PATCH 53/55] Skip a Flymake test for old gcc versions Fixes: 28906 * test/lisp/progmodes/flymake-tests.el (different-diagnostic-types): Skip this test for gcc versions < 5. --- test/lisp/progmodes/flymake-tests.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index 9f570adcc41..eddd964ad14 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -24,6 +24,7 @@ ;;; Code: (require 'ert) (require 'flymake) +(require 'subr-x) ; string-trim (defvar flymake-tests-data-directory (expand-file-name "lisp/progmodes/flymake-resources" @@ -128,7 +129,11 @@ SEVERITY-PREDICATE is used to setup (ert-deftest different-diagnostic-types () "Test GCC warning via function predicate." - (skip-unless (and (executable-find "gcc") (executable-find "make"))) + (skip-unless (and (executable-find "gcc") + (version<= + "5" (string-trim + (shell-command-to-string "gcc -dumpversion"))) + (executable-find "make"))) (let ((flymake-wrap-around nil)) (flymake-tests--with-flymake ("errors-and-warnings.c") From b500e06f4d05dc094b79f8f2c063e070a5a3306e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 20 Oct 2017 12:46:54 +0200 Subject: [PATCH 54/55] Fix Bug#28896 * lisp/net/tramp-adb.el (tramp-adb-handle-rename-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): Handle FILENAME being a directory. (Bug#28896) * test/lisp/net/tramp-tests.el (tramp-test11-copy-file) (tramp-test12-rename-file): Test also FILENAME being a directory. --- lisp/net/tramp-adb.el | 65 ++++--- lisp/net/tramp-gvfs.el | 7 +- lisp/net/tramp-sh.el | 162 ++++++++-------- test/lisp/net/tramp-tests.el | 362 +++++++++++++++++------------------ 4 files changed, 304 insertions(+), 292 deletions(-) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index e75efcf483f..bf21db2e8d8 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -802,38 +802,43 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (setq filename (expand-file-name filename) newname (expand-file-name newname)) - (let ((t1 (tramp-tramp-file-p filename)) - (t2 (tramp-tramp-file-p newname))) - (with-parsed-tramp-file-name (if t1 filename newname) nil - (with-tramp-progress-reporter - v 0 (format "Renaming %s to %s" filename newname) + (if (file-directory-p filename) + (progn + (copy-directory filename newname t t) + (delete-directory filename 'recursive)) - (if (and t1 t2 - (tramp-equal-remote filename newname) - (not (file-directory-p filename))) - (let ((l1 (file-remote-p filename 'localname)) - (l2 (file-remote-p newname 'localname))) - (when (and (not ok-if-already-exists) - (file-exists-p newname)) - (tramp-error v 'file-already-exists newname)) - ;; We must also flush the cache of the directory, because - ;; `file-attributes' reads the values from there. - (tramp-flush-file-property v (file-name-directory l1)) - (tramp-flush-file-property v l1) - (tramp-flush-file-property v (file-name-directory l2)) - (tramp-flush-file-property v l2) - ;; Short track. - (tramp-adb-barf-unless-okay - v (format - "mv -f %s %s" - (tramp-shell-quote-argument l1) - (tramp-shell-quote-argument l2)) - "Error renaming %s to %s" filename newname)) + (let ((t1 (tramp-tramp-file-p filename)) + (t2 (tramp-tramp-file-p newname))) + (with-parsed-tramp-file-name (if t1 filename newname) nil + (with-tramp-progress-reporter + v 0 (format "Renaming %s to %s" filename newname) - ;; Rename by copy. - (copy-file - filename newname ok-if-already-exists 'keep-time 'preserve-uid-gid) - (delete-file filename)))))) + (if (and t1 t2 + (tramp-equal-remote filename newname) + (not (file-directory-p filename))) + (let ((l1 (file-remote-p filename 'localname)) + (l2 (file-remote-p newname 'localname))) + (when (and (not ok-if-already-exists) + (file-exists-p newname)) + (tramp-error v 'file-already-exists newname)) + ;; We must also flush the cache of the directory, because + ;; `file-attributes' reads the values from there. + (tramp-flush-file-property v (file-name-directory l1)) + (tramp-flush-file-property v l1) + (tramp-flush-file-property v (file-name-directory l2)) + (tramp-flush-file-property v l2) + ;; Short track. + (tramp-adb-barf-unless-okay + v (format + "mv -f %s %s" + (tramp-shell-quote-argument l1) + (tramp-shell-quote-argument l2)) + "Error renaming %s to %s" filename newname)) + + ;; Rename by copy. + (copy-file + filename newname ok-if-already-exists 'keep-time 'preserve-uid-gid) + (delete-file filename))))))) (defun tramp-adb-handle-process-file (program &optional infile destination display &rest args) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 2b29a1b55f5..51d24cbc1b0 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -675,6 +675,11 @@ file names." (unless (memq op '(copy rename)) (error "Unknown operation `%s', must be `copy' or `rename'" op)) + (if (file-directory-p filename) + (progn + (copy-directory filename newname keep-date t) + (when (eq op 'rename) (delete-directory filename 'recursive))) + (let ((t1 (tramp-tramp-file-p filename)) (t2 (tramp-tramp-file-p newname)) (equal-remote (tramp-equal-remote filename newname)) @@ -738,7 +743,7 @@ file names." (when t2 (with-parsed-tramp-file-name newname nil (tramp-flush-file-property v (file-name-directory localname)) - (tramp-flush-file-property v localname))))))) + (tramp-flush-file-property v localname)))))))) (defun tramp-gvfs-handle-copy-file (filename newname &optional ok-if-already-exists keep-date diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index bdb7a132408..52a6b8fac0b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2039,96 +2039,102 @@ of `copy' and `rename'. FILENAME and NEWNAME must be absolute file names." (unless (memq op '(copy rename)) (error "Unknown operation `%s', must be `copy' or `rename'" op)) - (let ((t1 (tramp-tramp-file-p filename)) - (t2 (tramp-tramp-file-p newname)) - (length (tramp-compat-file-attribute-size - (file-attributes (file-truename filename)))) - (attributes (and preserve-extended-attributes - (apply 'file-extended-attributes (list filename))))) - (with-parsed-tramp-file-name (if t1 filename newname) nil - (when (and (not ok-if-already-exists) (file-exists-p newname)) - (tramp-error v 'file-already-exists newname)) + (if (file-directory-p filename) + (progn + (copy-directory filename newname keep-date t) + (when (eq op 'rename) (delete-directory filename 'recursive))) - (with-tramp-progress-reporter - v 0 (format "%s %s to %s" - (if (eq op 'copy) "Copying" "Renaming") - filename newname) + (let ((t1 (tramp-tramp-file-p filename)) + (t2 (tramp-tramp-file-p newname)) + (length (tramp-compat-file-attribute-size + (file-attributes (file-truename filename)))) + (attributes (and preserve-extended-attributes + (apply 'file-extended-attributes (list filename))))) - (cond - ;; Both are Tramp files. - ((and t1 t2) - (with-parsed-tramp-file-name filename v1 - (with-parsed-tramp-file-name newname v2 - (cond - ;; Shortcut: if method, host, user are the same for - ;; both files, we invoke `cp' or `mv' on the remote - ;; host directly. - ((tramp-equal-remote filename newname) - (tramp-do-copy-or-rename-file-directly - op filename newname - ok-if-already-exists keep-date preserve-uid-gid)) + (with-parsed-tramp-file-name (if t1 filename newname) nil + (when (and (not ok-if-already-exists) (file-exists-p newname)) + (tramp-error v 'file-already-exists newname)) - ;; Try out-of-band operation. - ((and - (tramp-method-out-of-band-p v1 length) - (tramp-method-out-of-band-p v2 length)) - (tramp-do-copy-or-rename-file-out-of-band - op filename newname keep-date)) + (with-tramp-progress-reporter + v 0 (format "%s %s to %s" + (if (eq op 'copy) "Copying" "Renaming") + filename newname) - ;; No shortcut was possible. So we copy the file - ;; first. If the operation was `rename', we go back - ;; and delete the original file (if the copy was - ;; successful). The approach is simple-minded: we - ;; create a new buffer, insert the contents of the - ;; source file into it, then write out the buffer to - ;; the target file. The advantage is that it doesn't - ;; matter which file name handlers are used for the - ;; source and target file. - (t - (tramp-do-copy-or-rename-file-via-buffer - op filename newname keep-date)))))) - - ;; One file is a Tramp file, the other one is local. - ((or t1 t2) (cond - ;; Fast track on local machine. - ((tramp-local-host-p v) - (tramp-do-copy-or-rename-file-directly - op filename newname - ok-if-already-exists keep-date preserve-uid-gid)) + ;; Both are Tramp files. + ((and t1 t2) + (with-parsed-tramp-file-name filename v1 + (with-parsed-tramp-file-name newname v2 + (cond + ;; Shortcut: if method, host, user are the same for + ;; both files, we invoke `cp' or `mv' on the remote + ;; host directly. + ((tramp-equal-remote filename newname) + (tramp-do-copy-or-rename-file-directly + op filename newname + ok-if-already-exists keep-date preserve-uid-gid)) - ;; If the Tramp file has an out-of-band method, the - ;; corresponding copy-program can be invoked. - ((tramp-method-out-of-band-p v length) - (tramp-do-copy-or-rename-file-out-of-band - op filename newname keep-date)) + ;; Try out-of-band operation. + ((and + (tramp-method-out-of-band-p v1 length) + (tramp-method-out-of-band-p v2 length)) + (tramp-do-copy-or-rename-file-out-of-band + op filename newname keep-date)) - ;; Use the inline method via a Tramp buffer. - (t (tramp-do-copy-or-rename-file-via-buffer - op filename newname keep-date)))) + ;; No shortcut was possible. So we copy the file + ;; first. If the operation was `rename', we go back + ;; and delete the original file (if the copy was + ;; successful). The approach is simple-minded: we + ;; create a new buffer, insert the contents of the + ;; source file into it, then write out the buffer to + ;; the target file. The advantage is that it doesn't + ;; matter which file name handlers are used for the + ;; source and target file. + (t + (tramp-do-copy-or-rename-file-via-buffer + op filename newname keep-date)))))) - (t - ;; One of them must be a Tramp file. - (error "Tramp implementation says this cannot happen"))) + ;; One file is a Tramp file, the other one is local. + ((or t1 t2) + (cond + ;; Fast track on local machine. + ((tramp-local-host-p v) + (tramp-do-copy-or-rename-file-directly + op filename newname + ok-if-already-exists keep-date preserve-uid-gid)) - ;; Handle `preserve-extended-attributes'. We ignore possible - ;; errors, because ACL strings could be incompatible. - (when attributes - (ignore-errors - (apply 'set-file-extended-attributes (list newname attributes)))) + ;; If the Tramp file has an out-of-band method, the + ;; corresponding copy-program can be invoked. + ((tramp-method-out-of-band-p v length) + (tramp-do-copy-or-rename-file-out-of-band + op filename newname keep-date)) - ;; In case of `rename', we must flush the cache of the source file. - (when (and t1 (eq op 'rename)) - (with-parsed-tramp-file-name filename v1 - (tramp-flush-file-property v1 (file-name-directory v1-localname)) - (tramp-flush-file-property v1 v1-localname))) + ;; Use the inline method via a Tramp buffer. + (t (tramp-do-copy-or-rename-file-via-buffer + op filename newname keep-date)))) - ;; When newname did exist, we have wrong cached values. - (when t2 - (with-parsed-tramp-file-name newname v2 - (tramp-flush-file-property v2 (file-name-directory v2-localname)) - (tramp-flush-file-property v2 v2-localname))))))) + (t + ;; One of them must be a Tramp file. + (error "Tramp implementation says this cannot happen"))) + + ;; Handle `preserve-extended-attributes'. We ignore possible + ;; errors, because ACL strings could be incompatible. + (when attributes + (ignore-errors + (apply 'set-file-extended-attributes (list newname attributes)))) + + ;; In case of `rename', we must flush the cache of the source file. + (when (and t1 (eq op 'rename)) + (with-parsed-tramp-file-name filename v1 + (tramp-flush-file-property v1 (file-name-directory v1-localname)) + (tramp-flush-file-property v1 v1-localname))) + + ;; When newname did exist, we have wrong cached values. + (when t2 + (with-parsed-tramp-file-name newname v2 + (tramp-flush-file-property v2 (file-name-directory v2-localname)) + (tramp-flush-file-property v2 v2-localname)))))))) (defun tramp-do-copy-or-rename-file-via-buffer (op filename newname keep-date) "Use an Emacs buffer to copy or rename a file. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c88abbfcb26..e92d1b6203c 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -1883,96 +1883,98 @@ This checks also `file-name-as-directory', `file-name-directory', (let (quoted) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) - (tmp-name3 (tramp--test-make-temp-name nil quoted)) - (tmp-name4 (tramp--test-make-temp-name 'local quoted)) - (tmp-name5 (tramp--test-make-temp-name 'local quoted))) + (tmp-name3 (tramp--test-make-temp-name 'local quoted))) + (dolist (source-target + `(;; Copy on remote side. + (,tmp-name1 . ,tmp-name2) + ;; Copy from remote side to local side. + (,tmp-name1 . ,tmp-name3) + ;; Copy from local side to remote side. + (,tmp-name3 . ,tmp-name1))) + (let ((source (car source-target)) + (target (cdr source-target))) - ;; Copy on remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (copy-file tmp-name1 tmp-name2) - (should (file-exists-p tmp-name2)) - (with-temp-buffer - (insert-file-contents tmp-name2) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name1 tmp-name2) - :type 'file-already-exists) - (copy-file tmp-name1 tmp-name2 'ok) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name1 tmp-name3) - :type 'file-already-exists)) - (copy-file tmp-name1 (file-name-as-directory tmp-name3)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name1) tmp-name3)))) + ;; Copy simple file. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (copy-file source target) + (should (file-exists-p target)) + (with-temp-buffer + (insert-file-contents target) + (should (string-equal (buffer-string) "foo"))) + (should-error + (copy-file source target) + :type 'file-already-exists) + (copy-file source target 'ok)) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name2)) - (ignore-errors (delete-directory tmp-name3 'recursive))) + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-file target))) - ;; Copy from remote side to local side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (copy-file tmp-name1 tmp-name4) - (should (file-exists-p tmp-name4)) - (with-temp-buffer - (insert-file-contents tmp-name4) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name1 tmp-name4) - :type 'file-already-exists) - (copy-file tmp-name1 tmp-name4 'ok) - (make-directory tmp-name5) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name1 tmp-name5) - :type 'file-already-exists)) - (copy-file tmp-name1 (file-name-as-directory tmp-name5)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name1) tmp-name5)))) + ;; Copy file to directory. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (make-directory target) + (should (file-directory-p target)) + ;; This has been changed in Emacs 26.1. + (when (tramp--test-emacs26-p) + (should-error + (copy-file source target) + :type 'file-already-exists)) + (copy-file source (file-name-as-directory target)) + (should + (file-exists-p + (expand-file-name (file-name-nondirectory source) target)))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name5 'recursive))) + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-directory target 'recursive))) - ;; Copy from local side to remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name4 nil 'nomessage) - (copy-file tmp-name4 tmp-name1) - (should (file-exists-p tmp-name1)) - (with-temp-buffer - (insert-file-contents tmp-name1) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name4 tmp-name1) - :type 'file-already-exists) - (copy-file tmp-name4 tmp-name1 'ok) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name4 tmp-name3) - :type 'file-already-exists)) - (copy-file tmp-name4 (file-name-as-directory tmp-name3)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name4) tmp-name3)))) + ;; Copy directory to existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + ;; Directory `target' exists already, so we must use + ;; `file-name-as-directory'. + (copy-file source (file-name-as-directory target)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name3 'recursive)))))) + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Copy directory/file to non-existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + (copy-file + source + (expand-file-name (file-name-nondirectory source) target)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) + + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive)))))))) (ert-deftest tramp-test12-rename-file () "Check `rename-file'." @@ -1983,111 +1985,105 @@ This checks also `file-name-as-directory', `file-name-directory', (let (quoted) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) - (tmp-name3 (tramp--test-make-temp-name nil quoted)) - (tmp-name4 (tramp--test-make-temp-name 'local quoted)) - (tmp-name5 (tramp--test-make-temp-name 'local quoted))) + (tmp-name3 (tramp--test-make-temp-name 'local quoted))) + (dolist (source-target + `(;; Rename on remote side. + (,tmp-name1 . ,tmp-name2) + ;; Rename from remote side to local side. + (,tmp-name1 . ,tmp-name3) + ;; Rename from local side to remote side. + (,tmp-name3 . ,tmp-name1))) + (let ((source (car source-target)) + (target (cdr source-target))) - ;; Rename on remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (rename-file tmp-name1 tmp-name2) - (should-not (file-exists-p tmp-name1)) - (should (file-exists-p tmp-name2)) - (with-temp-buffer - (insert-file-contents tmp-name2) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name1) - (should-error - (rename-file tmp-name1 tmp-name2) - :type 'file-already-exists) - (rename-file tmp-name1 tmp-name2 'ok) - (should-not (file-exists-p tmp-name1)) - (write-region "foo" nil tmp-name1) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name1 tmp-name3) - :type 'file-already-exists)) - (rename-file tmp-name1 (file-name-as-directory tmp-name3)) - (should-not (file-exists-p tmp-name1)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name1) tmp-name3)))) + ;; Rename simple file. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (rename-file source target) + (should-not (file-exists-p source)) + (should (file-exists-p target)) + (with-temp-buffer + (insert-file-contents target) + (should (string-equal (buffer-string) "foo"))) + (write-region "foo" nil source) + (should (file-exists-p source)) + (should-error + (rename-file source target) + :type 'file-already-exists) + (rename-file source target 'ok) + (should-not (file-exists-p source))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name2)) - (ignore-errors (delete-directory tmp-name3 'recursive))) + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-file target))) - ;; Rename from remote side to local side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (rename-file tmp-name1 tmp-name4) - (should-not (file-exists-p tmp-name1)) - (should (file-exists-p tmp-name4)) - (with-temp-buffer - (insert-file-contents tmp-name4) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name1) - (should-error - (rename-file tmp-name1 tmp-name4) - :type 'file-already-exists) - (rename-file tmp-name1 tmp-name4 'ok) - (should-not (file-exists-p tmp-name1)) - (write-region "foo" nil tmp-name1) - (make-directory tmp-name5) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name1 tmp-name5) - :type 'file-already-exists)) - (rename-file tmp-name1 (file-name-as-directory tmp-name5)) - (should-not (file-exists-p tmp-name1)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name1) tmp-name5)))) + ;; Rename file to directory. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (make-directory target) + (should (file-directory-p target)) + ;; This has been changed in Emacs 26.1. + (when (tramp--test-emacs26-p) + (should-error + (rename-file source target) + :type 'file-already-exists)) + (rename-file source (file-name-as-directory target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name (file-name-nondirectory source) target)))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name5 'recursive))) + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-directory target 'recursive))) - ;; Rename from local side to remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name4 nil 'nomessage) - (rename-file tmp-name4 tmp-name1) - (should-not (file-exists-p tmp-name4)) - (should (file-exists-p tmp-name1)) - (with-temp-buffer - (insert-file-contents tmp-name1) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name4 nil 'nomessage) - (should-error - (rename-file tmp-name4 tmp-name1) - :type 'file-already-exists) - (rename-file tmp-name4 tmp-name1 'ok) - (should-not (file-exists-p tmp-name4)) - (write-region "foo" nil tmp-name4 nil 'nomessage) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name4 tmp-name3) - :type 'file-already-exists)) - (rename-file tmp-name4 (file-name-as-directory tmp-name3)) - (should-not (file-exists-p tmp-name4)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name4) tmp-name3)))) + ;; Rename directory to existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + ;; Directory `target' exists already, so we must use + ;; `file-name-as-directory'. + (rename-file source (file-name-as-directory target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name3 'recursive)))))) + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Rename directory/file to non-existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + (rename-file + source + (expand-file-name (file-name-nondirectory source) target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) + + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive)))))))) (ert-deftest tramp-test13-make-directory () "Check `make-directory'. From 11bd8aa24b347f75e674528dd1a94b0a4037105e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 20 Oct 2017 13:07:30 -0400 Subject: [PATCH 55/55] Fix flymake's loading of subr-x * lisp/progmodes/flymake.el, test/lisp/progmodes/flymake-tests.el: No need to load subr-x at run-time. --- lisp/progmodes/flymake.el | 3 ++- test/lisp/progmodes/flymake-tests.el | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 9c546fd9667..3c588f02fa6 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -48,7 +48,8 @@ (require 'thingatpt) ; end-of-thing (require 'warnings) ; warning-numeric-level, display-warning (require 'compile) ; for some faces -(require 'subr-x) ; when-let*, if-let*, hash-table-keys, hash-table-values +;; when-let*, if-let*, hash-table-keys, hash-table-values: +(eval-when-compile (require 'subr-x)) (defgroup flymake nil "Universal on-the-fly syntax checker." diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index eddd964ad14..cfa810053ca 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -24,7 +24,7 @@ ;;; Code: (require 'ert) (require 'flymake) -(require 'subr-x) ; string-trim +(eval-when-compile (require 'subr-x)) ; string-trim (defvar flymake-tests-data-directory (expand-file-name "lisp/progmodes/flymake-resources"