Eli Zaretskii [Sat, 30 Jun 2018 08:43:42 +0000 (11:43 +0300)]
Speed up reading sub-process output on MS-Windows
* src/w32proc.c (syms_of_ntproc) <w32-pipe-read-delay>: Set to
zero. For the details, see this discussion:
http://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00711.html.
* src/w32.c (_sys_read_ahead): Update the commentary for
w32-pipe-read-delay usage.
Eli Zaretskii [Sat, 30 Jun 2018 08:17:25 +0000 (11:17 +0300)]
Speed-up let-binding of automatically-local variables
* src/data.c (set_default_internal): Use FOR_EACH_LIVE_BUFFER
when binding variables that don't nominally have a local
value, to avoid slowing down due to a large number of dead
buffers. (Bug#18522) (Bug#31853)
Paul Eggert [Sat, 30 Jun 2018 00:31:04 +0000 (17:31 -0700)]
Update from Gnulib
This incorporates:
2018-06-29 regex: glibc does not use intprops.h
2018-06-28 regex: port to recently proposed glibc regex merge
2018-06-25 Continue to use spaces for indentation, not tabs
2018-06-25 manywarnings: Don't enable -Wjump-misses-init by default
2018-06-25 acl-internal.h: remove _GL_ATTRIBUTE_CONST on void function
2018-06-24 manywarnings: accommodate GCC 9: remove -Wchkp and -Wabi
2018-06-24 maint: clarify comments about sticky EOF
2018-06-24 af_alg: avoid hangs when reading from streams
2018-06-17 crypto: use byteswap
2018-06-17 getloadavg: Return 0 on MS-Windows without Cygwi
2018-06-17 getloadavg: Allow building on MS-Windows without Cygwin
* build-aux/config.guess, build-aux/config.sub, doc/misc/texinfo.tex:
* lib/acl-internal.c, lib/acl-internal.h, lib/get-permissions.c:
* lib/getloadavg.c, lib/gettimeofday.c, lib/md5.c, lib/pselect.c:
* lib/set-permissions.c, lib/sha1.c, lib/sha256.c, lib/sha512.c:
* lib/time.in.h, m4/getloadavg.m4, m4/gnulib-common.m4:
* m4/manywarnings.m4, m4/pthread_sigmask.m4, m4/vararrays.m4:
Copy from Gnulib.
Noam Postavsky [Sat, 12 May 2018 01:56:56 +0000 (21:56 -0400)]
Let ediff '=' compare against ancestor buffer (Bug#11320)
* lisp/vc/ediff-util.el (ediff-inferior-compare-regions): Ask user
whether to compare against the ancestor or merge buffer. Use
read-multiple-choice for A vs B buffer query.
Paul Eggert [Thu, 28 Jun 2018 20:49:48 +0000 (13:49 -0700)]
Fix recently-introduced SAFE_FREE bug
Problem reported by Andy Moreton (Bug#31996).
* src/lisp.h (union specbinding.unwind_array):
Remove unused member func. Move array after nelts, as this is
likely to generate more efficient code in safe_free, which can
call xfree with the same value either way.
(safe_free): Also handle SPECPDL_UNWIND_AWAY.
Paul Eggert [Thu, 28 Jun 2018 07:37:08 +0000 (00:37 -0700)]
Tune SAFE_FREE
On my platform (Fedora 28 x86-64, AMD Phenom II X4 910e) this sped
up a SAFE_FREE-using microbenchmark (string-distance "abc" "abc")
by about 18%, and shrank the Emacs text size by about 0.1%.
* src/callint.c (Fcall_interactively):
* src/callproc.c (call_process):
* src/doc.c (get_doc_string, Fsnarf_documentation):
* src/editfns.c (Freplace_buffer_contents):
* src/emacs-module.c (funcall_module):
* src/eval.c (Flet):
* src/process.c (Fmake_process):
* src/term.c (tty_menu_show):
* src/xdisp.c (safe__call):
* src/xmenu.c (x_menu_show):
Use SAFE_FREE_UNBIND_TO.
* src/data.c (wrong_choice): No need to call SAFE_FREE here.
* src/lisp.h (USE_SAFE_ALLOCA):
* src/regex.c (REGEX_USE_SAFE_ALLOCA):
Do not declare sa_must_free local; no longer needed.
All uses removed.
(SAFE_FREE): Rewrite in terms of safe_free.
(safe_free): New function, optimized to use xfree.
(SAFE_FREE_UNBIND_TO): New macro.
(safe_free_unbind_to): New function.
Glenn Morris [Tue, 26 Jun 2018 14:51:01 +0000 (07:51 -0700)]
Merge from origin/emacs-26
12c77f6 (origin/emacs-26) Add ido-fallback special variable (Bug#31707) 826e8d1 Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs into... c784876 Tighten a cross-reference in documentation 517dc0b Fix last change in tramp-sh.el f43186f Revert previous patch; comment was OK after all. 4c3306e Fix lead comment for count_trailing_zero_bits b419f27 ; * doc/emacs/files.texi (Interlocking): Fix a non-portable @... 7488de4 * lisp/emacs-lisp/regexp-opt.el (regexp-opt): Fix docstring q... 0b69807 Make a minor update to the CSS mode docstring 9a53b6d Say how to override a primitive interactive spec 1d77078 Fix Bug#31941
Before ido.el switch to lexical-binding, it was possible for other
packages to modify the 'fallback' variables declared inside
'ido-file-internal' and 'ido-buffer-internal'.
* lisp/ido.el (ido-fallback): New variable.
(ido-buffer-internal, ido-file-internal): Reset ido-fallback to nil
before prompting user. Use ido-fallback when ido-exit is 'fallback'.
(ido-fallback-command): Add optional FALLBACK-COMMAND argument.
Reformat package.el message strings for future l10n
* lisp/emacs-lisp/package.el (package-buffer-info)
(package--download-one-archive, package-install-selected-packages)
(package-autoremove, describe-package-1, package-menu-toggle-hiding)
(package-menu-hide-package, package-menu--mark-upgrades-1)
(package-menu--list-to-prompt, package-menu--prompt-transaction-p)
(package-menu-execute, package-menu--find-and-notify-upgrades):
Reformat message strings to remove need for plural computation. Try
to put full sentences in source string literals.
* test/lisp/emacs-lisp/package-tests.el
(package-test-describe-package): Update to match new message format.
Noam Postavsky [Thu, 21 Jun 2018 00:12:23 +0000 (20:12 -0400)]
Suppress indent errors during electric indentation (Bug#18764)
* lisp/electric.el (electric-indent-post-self-insert-function):
Suppress errors from indent code, but don't suppress errors from
elsewhere in this function. That way, if trouble is encountered with
electric indent "not working", the error should be reproducible by
calling indent directly (as is the case for Bug#18764), or else it's
from the electric indent code and will be reported normally.
Paul Eggert [Mon, 25 Jun 2018 19:21:40 +0000 (12:21 -0700)]
(format "%d" F) now truncates floating F
Problem reported by Paul Pogonyshev (Bug#31938).
* src/editfns.c: Include math.h, for trunc.
(styled_format): For %d, truncate floating-point numbers and
convert -0 to 0, going back to how Emacs 26 did things.
* doc/lispref/strings.texi (Formatting Strings):
Document behavior of %o, %d, %x, %X on floating-point numbers.
* src/floatfns.c (trunc) [!HAVE_TRUNC]: Rename from emacs_trunc
and make it an extern function, so that editfns.c can use it.
All callers changed.
* test/src/editfns-tests.el (format-%d-float): New test.
Karl Fogel [Mon, 25 Jun 2018 17:23:23 +0000 (12:23 -0500)]
Tighten a cross-reference in documentation
* doc/lispref/internals.texi (Writing Emacs Primitives): Switch to
a simple parenthetical cross-reference, following up to my
commit 9a53b6d426 of 2018-06-24.
See discussion:
https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00826.html
From: Eli Zaretskii
Subject: Re: [Emacs-diffs] \
emacs-26 9a53b6d: Say how to override a primitive interactive spec
To: Karl Fogel CC: Stefan Monnier, Emacs Devel
Date: Mon, 25 Jun 2018 17:41:53 +0300
Message-Id: <83r2kvrkr2.fsf@gnu.org>
Make more TLS checks trigger on the default `medium' level
* doc/emacs/misc.texi (Network Security): Update the doc to say
what's on the different levels.
* lisp/net/nsm.el (nsm-protocol-check--intermediary-sha1): Check
intermediary certificates for SHA1.
(nsm-protocol-check--3des): Check for 3DES ciphers.
(network-security-protocol-checks): Put most of the checks on
`medium'.
Return the entire TLS certificate chain back to the caller
* src/gnutls.c (gnutls_deinit_certificates): New function.
(Fgnutls_peer_status): Return all certificates in the chain back
to Lisp land.
(gnutls_verify_boot): Compute all the x509 certificates in the
chain.
* src/process.h (struct Lisp_Process): Adjust gnutls fields so
that we can keep tracks of all certificates in the chain instead
of just the host certificate.
Tom Tromey [Sun, 24 Jun 2018 17:18:19 +0000 (11:18 -0600)]
Fix two tcl-mode defun-related bugs
Fixes bug#23565
* lisp/progmodes/tcl.el (tcl-mode): Set beginning-of-defun-function
and end-of-defun-function.
(tcl-beginning-of-defun-function, tcl-end-of-defun-function): New
defuns.
* test/lisp/progmodes/tcl-tests.el: New file.
* lisp/net/nsm.el (network-security-protocol-checks): New variable.
(nsm-check-protocol): Refactor the checks into separate functions
for greater flexibility.
(nsm-protocol-check--diffie-hellman-prime-bits)
(nsm-protocol-check--rc4, nsm-protocol-check--ssl)
(nsm-protocol-check--signature-sha1): Refactored out of the big
function.
Karl Fogel [Sun, 24 Jun 2018 12:10:43 +0000 (07:10 -0500)]
Say how to override a primitive interactive spec
* doc/lispref/internals.texi (Writing Emacs Primitives): Mention that
the `interactive-form' property can be used to override a primitive
interactive specification, and refer to the detailed documentation
for setting that property.
From this thread on Emacs Devel:
https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00923.html
From: Eli Zaretskii
To: Karl Fogel CC: Juri Linkov, Emacs Devel
Subject: Re: [Emacs-diffs] \
master b88e7c8: Make transpose-regions interactive (Bug#30343)
Date: Thu, 29 Mar 2018 14:38:15 +0300
Message-Id: <834lkzdsd4.fsf@gnu.org>
Michael Albinus [Sun, 24 Jun 2018 08:24:26 +0000 (10:24 +0200)]
Fix Bug#31941
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): In case of
FILENAME being a directory, check whether `copy-directory' could
be avoided. Suggested by Stephen Nutt <stnutt@gmail.com>. (Bug#31941)
(tramp-do-copy-or-rename-file-directly): Call "cp" with "-r".
Glenn Morris [Sat, 23 Jun 2018 14:51:00 +0000 (07:51 -0700)]
Merge from origin/emacs-26
bbc9d37 (origin/emacs-26) Fix previous change in minibuffer-default-a... 7caeef1 * src/editfns.c (Fformat): Make %x easier to spot in doc stri... ecc29fb Improve responsiveness while in 'replace-buffer-contents' 8182d64 Improve documentation of 'server-start' and friends decdfed Clarify wording about functions' argument lists 5abac8b * lisp/doc-view.el: Fix typos in the commentary. (Bug#31937)
Glenn Morris [Sat, 23 Jun 2018 14:50:59 +0000 (07:50 -0700)]
Merge from origin/emacs-26
5cb3991 Fix a typo in emacs-lisp-intro.texi d6aa55e Avoid segfaults in replace-buffer-contents with large buffers d22b8d1 Adjust for scaling for mode-line popup menus (Bug#31880) 3d2e3dc Change name of `seqp' argument (Bug#26411) 40e1db8 Change index of ";" to better reflect it's usage (Bug#31623) d289e7e Fix bug of 'mouse-drag-and-drop-region' to detect edges of re... e292c09 Fix #'fun handling inside `labels' (Bug#31792)
Leo Liu [Tue, 12 Jun 2018 04:24:09 +0000 (12:24 +0800)]
Fix previous change in minibuffer-default-add-dired-shell-commands
The mailcap minibuffer completion used dynamic binding. Locally set
a dynamic variable.
* lisp/dired-aux.el (minibuffer-default-add-dired-shell-commands):
Store list of files in 'minibuffer-completion-table'. (Bug#31794)
Eli Zaretskii [Sat, 23 Jun 2018 11:03:10 +0000 (14:03 +0300)]
Improve responsiveness while in 'replace-buffer-contents'
* src/editfns.c (buffer_chars_equal): Avoid calling
buf_charpos_to_bytepos when the buffer is plain-ASCII.
Suggested by Milan Stanojević <mstanojevic@janestreet.com>.
Call maybe_quit to improve responsiveness.
(Freplace_buffer_contents): Call maybe_quit. Warn in the doc
string that the function could be slow. (Bug#31888)
Eli Zaretskii [Fri, 22 Jun 2018 18:25:55 +0000 (21:25 +0300)]
Fix a typo in emacs-lisp-intro.texi
* doc/lispintro/emacs-lisp-intro.texi (kill-ring-yank-pointer):
Add a missing quote. Reported by Jean-Christophe Helary
<brandelune@gmail.com> in emacs-devel.
Stefan Monnier [Fri, 22 Jun 2018 03:30:11 +0000 (23:30 -0400)]
New functions to switch back and forth to another major mode
* subr.el (major-mode--suspended): New var.
(major-mode-suspend, major-mode-restore): New funs, extracted from doc-view.
* doc-view.el (doc-view--previous-major-mode): Remove.
(doc-view-mode): Use major-mode-suspend.
(doc-view-fallback-mode): Use major-mode-restore.
* hexl-mode.el (hexl-mode--minor-mode-p, hexl-mode--setq-local): Remove.
(hexl-mode): Use major-mode-suspend and hexl-follow-ascii-mode.
(hexl-mode-exit): Use major-mode-restore.
(hexl-activate-ruler, hexl-follow-line): Don't bother trying to preserve
earlier state, now that entering/leaving hexl-mode kills local vars.
(hexl-follow-ascii-mode): New proper local minor mode.
(hexl-follow-ascii): Rewrite, using it.
* image-mode.el (image-mode-previous-major-mode): Remove.
(image-mode): Use major-mode-suspend.
(image-mode-to-text): Use major-mode-restore.
Paul Eggert [Thu, 21 Jun 2018 20:29:15 +0000 (13:29 -0700)]
Set group when installing, too
From a patch by Ulrich Mueller in:
https://lists.gnu.org/r/emacs-devel/2018-06/msg00687.html
* Makefile.in (set_installuser): Also set the group, in order
to match install(1) behavior. Also, don’t clutter stderr
with a diagnostic if ‘id’ is missing.
Noam Postavsky [Wed, 20 Jun 2018 12:40:51 +0000 (08:40 -0400)]
Change index of ";" to better reflect it's usage (Bug#31623)
* doc/lispref/objects.texi (Comments): "; for commenting" fits better
with the following text about how a semicolon begins a comment. Also
mention that only unescaped semicolons start a comment.
Noam Postavsky [Tue, 12 Jun 2018 22:41:46 +0000 (18:41 -0400)]
Fix #'fun handling inside `labels' (Bug#31792)
* lisp/emacs-lisp/cl.el (labels): Apply the equivalent of the
cl-labels change from 2015-01-16 "* lisp/emacs-lisp/cl-macs.el: Fix
last change".
* test/lisp/emacs-lisp/cl-tests.el (labels-function-quoting): New
test.
* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Improve docstring,
link to relevant manual page.
* doc/misc/cl.texi (Function Bindings): Don't imply that function
cells of symbols are modified by cl-flet. Don't claim that cl-flet or
cl-labels affect references of the form (quote FUNC).
João Távora [Tue, 19 Jun 2018 01:18:43 +0000 (02:18 +0100)]
Electric-pair-mode lets modes choose how to skip whitespace
cc-mode.el-based major-modes with stricter syntax for invalid
NL-terminated strings might choose to have electric-pair-mode skip
some of whitespace into non-string-syntax regions, for the sake of
letting electric-pair-mode chomp that whitespace and make the string
valid again.
* lisp/elec-pair.el (electric-pair-post-self-insert-function): Call it.
(electric-pair-skip-whitespace-function): New buffer-local variable.
Noam Postavsky [Tue, 12 Jun 2018 00:41:07 +0000 (20:41 -0400)]
Stop assuming .git is a directory in gitmerge.el
* admin/gitmerge.el (gitmerge-maybe-resume): Use 'git rev-parse
--git-dir' to find the git directory rather than assuming it is
.git/ (that assumption fails for separated worktrees).
Move tls.el and starttls.el to lisp/obsolete/ (Bug#31457)
* lisp/obsolete/tls.el: Moved from lisp/net/tls.el.
* lisp/gnus/nnimap.el:
* lisp/url/url-http.el: Don't require tls, since it's obsolete.
* lisp/net/network-stream.el: Only require tls if we actually try to
use it (i.e., when (gnutls-available-p) returns nil). Declare some
functions to fix compilation warnings.
* lisp/obsolete/starttls.el: Moved from lisp/net/starttls.el.
* lisp/net/sieve-manage.el:
* lisp/net/network-stream.el: Don't require `starttls' at the
top-level, declare the variables and functions used instead.
(network-stream-open-starttls): Only require `starttls' if
needed (i.e., gnutls-available-p fails).
Glenn Morris [Mon, 18 Jun 2018 19:14:25 +0000 (12:14 -0700)]
Merge from origin/emacs-26
63ba73a Fix documentation of ':propertize' in mode-line-format 22aa665 Reject invalid 5-byte sequences when detecting UTF-8 encoding 0d3c358 Fix 'replace-buffer-contents' in multibyte buffers c79a627 Update etc/NEWS for mail-source-movemail-program change 63f1dc4 Improve movemail default 0b1a2ae Delete description of deleted Customize functions fcd66d0 Keep vc-print-log from putting point at buffer end (Bug#31764)
* doc/emacs/misc.texi (Shell Ring): Fix a typo in the name of
'comint-insert-previous-argument'. Document
'comint-insert-previous-argument-from-end'. (Bug#25271)
* etc/NEWS: Reformat and rephrase the entry for recent Comint
changes.