Jonas Bernoulli [Tue, 18 Feb 2020 15:58:31 +0000 (16:58 +0100)]
Drop unnecessary backward compatibility aliases
We can assume that `encode-coding-string' and `decode-coding-string'
are available; they were added in 1997.
* lisp/epa-file.el (epa-file--encode-coding-string)
(epa-file--decode-coding-string): Remove aliases for
encode-coding-string and decode-coding-string.
* lisp/epa-file.el (epa-file-write-region): Use encode-coding-string
instead of removed epa-file--encode-coding-string.
Jonas Bernoulli [Tue, 18 Feb 2020 15:45:34 +0000 (16:45 +0100)]
* lisp/epa.el (epa-faces): Move definition.
Previously option `epa-mail-aliases' was the only option that was
defined right after the group `epa-faces' and right before all the
faces. Now it is defined with all the other options and thus before
the definition of the `epa-faces' group, which it does not belong to.
Juri Linkov [Sun, 12 Jul 2020 23:33:02 +0000 (02:33 +0300)]
Display "C-u C-x =" composed character names on GUI frames as well
* lisp/descr-text.el (describe-char): On GUI frames, display the
Unicode names of the composed characters like they are displayed
on TTY frames. (Bug#42256)
João Távora [Fri, 10 Jul 2020 19:49:54 +0000 (20:49 +0100)]
Sort out ElDoc backward compatibility of eldoc-documentation-function
As explained previously, we can't simply make
eldoc-documentation-function an variable alias for
eldoc-documentation-strategy, because ElDoc is pre-loaded in Emacs <
28, where it holds at least one buffer-local binding. So if eldoc.el
is loaded in those versions, we do the variable alias binding in
reverse. We do this using a macro
eldoc--documentation-strategy-defcustom to at load time in which
direction to make the variable alias.
* lisp/emacs-lisp/eldoc.el
(eldoc--documentation-strategy-defcustom): Helper macro.
(eldoc-documentation-strategy, eldoc-documentation-function): Use it.
(Version): Bump to 1.5.0
* doc/lispref/strings.texi (Creating Strings): 'concat' does not
necessarily return a newly allocated string. This has been the case
at least since 1997 (Emacs 20.3).
* doc/lispref/strings.texi (Creating Strings): 'concat' does not
necessarily return a newly allocated string. This has been the case
at least since 1997 (Emacs 20.3).
Michael Albinus [Sat, 11 Jul 2020 12:46:18 +0000 (14:46 +0200)]
Fix multibyte chars of file names in tramp-adb.el
* lisp/net/tramp-adb.el (tramp-adb-execute-adb-command): Revert return
value meaning. Insert the result into the connection buffer.
(tramp-adb-handle-file-local-copy)
(tramp-adb-handle-write-region, tramp-adb-handle-copy-file)
(tramp-adb-get-device): Adapt calls.
(tramp-adb-send-command): Use "adb shell ..." in case the command
contains multibyte chars.
Eli Zaretskii [Sat, 11 Jul 2020 12:33:51 +0000 (15:33 +0300)]
Another minor improvement of project.el doc strings
* lisp/progmodes/project.el (project-find-functions)
(project-current, project-switch-to-buffer): Doc fix.
(project-current): Rename the argument DIR to DIRECTORY.
* lisp/net/tramp-adb.el (tramp-adb-ls-date-year-regexp)
(tramp-adb-ls-date-time-regexp): New defconst.
(tramp-adb-ls-date-regexp, tramp-adb-ls-toolbox-regexp)
(tramp-adb-sh-fix-ls-output): Use them.
(tramp-adb-handle-set-file-times, tramp-adb-maybe-open-connection):
Apply `eval-when-compile' on constant concat data.
(tramp-do-parse-file-attributes-with-ls):
Suppress `signal-hook-function'.
(tramp-adb--gnu-switches-to-ash): Remove unused function.
(tramp-adb-handle-set-file-modes): Qhote argument.
(tramp-adb-maybe-open-connection): Set file property rather than flush.
* lisp/net/tramp-cmds.el (tramp-rename-these-files):
Apply `eval-when-compile' on constant concat data.
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes)
(tramp-gvfs-file-attributes-with-gvfs-ls-regexp): Embed them in
`eval-and-compile'.
(tramp-gvfs-get-directory-attributes): Apply `eval-when-compile'
on constant concat data.
João Távora [Fri, 10 Jul 2020 00:47:10 +0000 (01:47 +0100)]
Fix Eldoc problem when loading on Emacs 26.3
When defining the obsolete variable alias for old
eldoc-documentation-function (which now points to the newer
eldoc-documentation-strategy), one gets the error "don't know how to
make a localized vareiable an alias". I'm not sure, but I suspect
this is because Eldoc is preloaded in Emacs 26.3 and the
eldoc-documentation-function variable is already set locally by some
Elisp buffer.
Uninterning the symbol shortly before defining the alias seems to fix
it.
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function):
Unintern on load.
(Version): Bump to 1.3.0
Paul Eggert [Thu, 9 Jul 2020 23:35:48 +0000 (16:35 -0700)]
Fix out-of-source ‘make check’ emacs-module-tests
Problem reported by Koki Fukuda in:
https://lists.gnu.org/r/emacs-devel/2020-07/msg00169.html
* test/Makefile.in (MODULE_CFLAGS):
Include from the same directories included from in ../src.
* test/src/emacs-module-tests.el (module/describe-function-1):
Strip path to source directory.
Paul Eggert [Thu, 9 Jul 2020 23:35:48 +0000 (16:35 -0700)]
Use Gnulib libgmp module
Instead of doing GMP by hand, use the Gnulib libgmp module.
* .gitignore: Add lib/gmp.h.
* admin/merge-gnulib (GNULIB_MODULES): Add libgmp.
* configure.ac (GMP_LIB, GMP_OBJ): Remove. Gnulib uses the name
LIB_GMP, so all uses changed. All uses of GMP_OBJ removed.
(HAVE_GMP): Set this from Gnulib’s variables.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/mini-gmp-gnulib.c, lib/mini-gmp.c, lib/mini-gmp.h, m4/libgmp.m4:
New files, copied from Gnulib.
* src/bignum.h, test/data/emacs-module/mod-test.c:
Include gmp.h unconditionally.
* src/mini-gmp-emacs.c, src/mini-gmp.c, src/mini-gmp.h:
Remove. This moves these files from src to lib, and
updates them to the current GMP version.
* test/Makefile.in (GMP_H): New macro.
($(test_module)): Use it to decide whether to compile
mini-gmp-gnulib.c too.
Paul Eggert [Thu, 9 Jul 2020 23:35:48 +0000 (16:35 -0700)]
Speed up GCC 10.1 compilation in default Git builds
* configure.ac (nw): GCC 10.1 introduced warnings enabled by -fanalyzer
that slow down compilation considerably. Generate these warnings only
if --enable-gcc-warnings is explicitly given. Also, do not bother to
eliminate warnings that Gnulib’s revised manywarnings module no longer
generates.
Paul Eggert [Thu, 9 Jul 2020 23:35:48 +0000 (16:35 -0700)]
Update from Gnulib
This incorporates:
2020-07-07 dup2: remove support for some very old platforms
2020-07-07 memchr: remove support for some very old platforms
2020-07-04 getumask: new module
2020-07-03 getrandom: fix compilation error on native Windows
2020-07-03 lchmod: simplify after 2020-02-22 change
2020-07-01 manywarnings: improve port to GCC 10.1
2020-06-28 getrandom: fix compilation errors on older versions of mingw
2020-06-29 alloca-opt: fix warning on mingw
* lib/alloca.in.h, lib/dup2.c, lib/getrandom.c, lib/string.in.h:
* lib/sys_stat.in.h, lib/unistd.in.h, m4/dup2.m4, m4/getrandom.m4:
* m4/lchmod.m4, m4/manywarnings.m4, m4/string_h.m4, m4/sys_stat_h.m4:
* m4/unistd_h.m4: Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
João Távora [Thu, 9 Jul 2020 12:12:34 +0000 (13:12 +0100)]
Unbreak M-x eldoc
The command should always invoke Eldoc when called interactively,
instead of going through the usual checks, which are performed to
avoid interference with other commands.
* lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Rework.
(Version): Bump to 1.2.0
João Távora [Thu, 9 Jul 2020 16:51:38 +0000 (17:51 +0100)]
Prevent infloop in Eldoc message truncation algorithm
The truncation algorithm still has a long way to go for very narrow
frame sizes. It should become a generic mechanism that would allows
one to truncate a string so that fits in N possibly truncated screen
lines of a full-width window.
* test/lisp/descr-text-tests.el (descr-text-test-desc):
Update for recent change to describe-char-eldoc.
* test/lisp/progmodes/elisp-mode-tests.el
(elisp--highlight-function-argument-indexed)
(elisp--highlight-function-argument-keyed-1)
(elisp--highlight-function-argument-keyed-2):
Update for recent change to elisp--highlight-function-argument.
Special-case symbol and fixnum keys in member, assoc and rassoc
* src/fns.c (Fmember, Fassoc, Frassoc): Delegate to the cheaper Fmemq,
Fassq and Frassq for arguments of the appropriate types.
(eq_comparable_value): New function.
João Távora [Sat, 6 Jun 2020 13:04:48 +0000 (14:04 +0100)]
Make more parts of Emacs use new Eldoc capabilities
Elisp-mode was doing a lot of work that can now be delegated to Eldoc.
Flymake uses the new Eldoc functionality, too, installing a global
documentation function that may report on diagnostics under point.
CEDET's grammar.el was left as the only user of an Eldoc-internal
function. That function was moved to grammar.el. That file is still,
somewhat reprehensibly, using an internal function of elisp-mode.el,
but this was left unchanged.
In other situations, eldoc-documentation-functions is used or
recommended.
The only other places where the obsolete eldoc-documentation-function
is still used is in libraries which are presumably meant to remain
compatible with previous Emacs versions.
* lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall)
(elisp-eldoc-var-docstring): New functions.
(emacs-lisp-mode): Put two elements in
eldoc-documentation-functions.
* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Setup
new Elisp eldoc-documentation-functions.
* lisp/progmodes/flymake.el (flymake-mode): Use
flymake-eldoc-function.
(flymake-eldoc-function): New function.
(Package-Requires): Require eldoc 1.1.0
João Távora [Mon, 25 May 2020 15:39:40 +0000 (16:39 +0100)]
Better handle asynchronous Eldoc sources
This is a backward compatible redesign of significant parts of the
eldoc.el library.
Previously, Eldoc clients (major/minor modes setting its documentation
gathering variables) needed to directly call eldoc-message, an
internal function, to display the docstring to the user. When more
asynchronous sources are involved, this is hard to do or even breaks
down.
Now, an Eldoc backend may return any non-nil, non-string value and
call a callback afterwards. This restores power to Eldoc over how
(and crucially also when) to display the docstrings to the user.
Among other things, this fixes so called "doc blinking", or the very
short-lived display of a lower priority Eldoc message. This would
happen if a particular producer of documentation finishes shortly
before a higher priority one, like in the LSP engine Eglot as reported
by Andrii Kolomoiets <andreyk.mad@gmail.com> and Dmitry Gutov
<dgutov@yandex.ru>.
Gathering docstrings is now delegated to the variable
eldoc-documentation-strategy, which is the new name for the
now-obsolete eldoc-documentation-function, and still accepts the
so-called "old protocol". Examples of the new strategies enabled are
codified in functions such as eldoc-documentation-enthusiast,
eldoc-documentation-compose-eagerly, along with the existing
eldoc-documentation-compose and eldoc-documentation-default.
The work of displaying and formatting docstrings is shifted almost
fully to Eldoc itself and is delegated to the internal function
eldoc--handle-docs. Among other improvements, it handles most of
eldoc-echo-area-use-multiline-p and outputs documentation to a
temporary *eldoc* buffer.
The manual and NEWS are updated to mention the new Eldoc features.
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions):
Overhaul docstring.
(eldoc-documentation-compose, eldoc-documentation-default): Handle
non-nil, non-string values of elements of
eldoc-documentation-functions. Use eldoc--handle-multiline.
(eldoc-print-current-symbol-info): Honour non-nil, non-string
values returned by eldoc-documentation-callback.
(eldoc--make-callback): Now also a function.
(eldoc-documentation-default, eldoc-documentation-compose): Tweak docstring.
(eldoc-documentation-enthusiast, eldoc-documentation-compose-eagerly):
New functions.
(eldoc-echo-area-use-multiline-p): Add new semantics.
(eldoc--handle-docs): Handle some of eldoc-echo-area-use-multiline-p.
(eldoc-doc-buffer): New command.
(eldoc-prefer-doc-buffer): New defcustom.
(eldoc--enthusiasm-curbing-timer): New variable.
(eldoc-documentation-strategy): Rename from eldoc-documentation-function.
(eldoc--supported-p): Use eldoc-documentation-strategy
(eldoc-highlight-function-argument)
(eldoc-argument-case, global-eldoc-mode)
(turn-on-eldoc-mode): Mention eldoc-documentation-strategy.
(eldoc-message-function): Mention eldoc--message.
(eldoc-message): Made obsolete.
(eldoc--message): New helper.
* lisp/hexl.el (hexl-print-current-point-info): Adjust to new
eldoc-documentation-functions protocol.
* lisp/progmodes/cfengine.el (cfengine3-documentation-function):
Adjust to new eldoc-documentation-functions protocol.
* lisp/progmodes/elisp-mode.el
(elisp-eldoc-documentation-function): Adjust to new
eldoc-documentation-functions protocol.
* lisp/progmodes/octave.el (octave-eldoc-function): Adjust to new
eldoc-documentation-functions protocol.
* lisp/progmodes/python.el (python-eldoc-function): Adjust to new
eldoc-documentation-functions protocol.
(eldoc-print-current-symbol-info): Rework with cl-labels.
Most pure functions need no explicit optimisation; we can do away with
almost all uses of byte-optimize-predicate (now renamed to
byte-optimize-constant-args, since it is not just for predicates).
Also remove some superfluous arity warnings.
Extend the list of 'pure' functions to many predicates and numerical
functions that we are reasonably confident will give portable results.
Also include various list and array accessors, because our use of purity
in the byte compiler isn't affected by the mutability of arguments.
* lisp/emacs-lisp/byte-opt.el: Update example in comment.
(pure-fns): Add many functions.
(byte-optimize-form-code-walker) Don't signal errors during evaluation
of calls to pure functions with constant arguments at compile time,
since such calls are not necessarily reachable.
Wilson Snyder [Sun, 5 Jul 2020 17:31:39 +0000 (13:31 -0400)]
Verilog-Mode collected updates.
* lisp/progmodes/verilog-mode.el (verilog-auto-inst): Support regexp of
what AUTOINST I/O to include, issue #1682. Reported by Mrainy.
(verilog-font-lock-keywords-1): Fix highlighting module names with no
following (, issue #1679. Reported by Vinam Arora.
(verilog-font-lock-keywords) Adds syntax highlighting for identifiers in
declaration statements, #1678.
(verilog-calculate-indent, verilog-inject-arg)
(verilog-keywords, verilog-showscopes): Support AMS
connectmodule/endconnectmodule, #1665. Reported by Dan McMahill.
Don't confuse errors with nil in bytecomp-tests.el
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-check-1)
(bytecomp-explain-1, test-byte-opt-arithmetic, bytecomp-lexbind-check-1)
(bytecomp-lexbind-explain-1):
If an expression raises an error when evaluated, don't treat it as if
it had succeeded with the value nil; use 'bytecomp-check-error' as the
result instead.
Eli Zaretskii [Sun, 5 Jul 2020 15:30:21 +0000 (18:30 +0300)]
Clarify the documentation of 'left/right-fringe' display spec
* doc/lispref/display.texi (Other Display Specs, Fringe Bitmaps):
Clarify how the optional FACE parameter of the left-fringe and
right-fringe display spec is used. Reported by Gregory Heytings
<ghe@sdf.org>.
Relax portable number check in byte compiler (bug#42147)
With bignums, the set of representable integers is no longer
platform-dependent, and since we use nothing but IEEE754 64-bit
floats, all numbers are now portable. Take advantage of this fact
to simplify constant-folding in the byte compiler, allowing it to
be applied more widely.
* lisp/emacs-lisp/byte-opt.el (byte-opt--portable-max)
(byte-opt--portable-min, byte-opt--portable-numberp): Remove.
(byte-opt--arith-reduce, byte-optimize-minus, byte-optimize-1+)
(byte-optimize-1-): Simplify: any number will do, and if N is a
number, then so are -N, N+1 and N-1.
Alan Mackenzie [Sat, 4 Jul 2020 12:55:49 +0000 (12:55 +0000)]
Fix filling in js-mode and mhtml-mode (js-mode parts), fixing bug #41897
* lisp/progmodes/js.el (js-mode): Use "\\(?:" in the value of
comment-start-skip rather than "\\(", fixing the second half of bug #41952.
Call c-foreign-init-lit-pos-cache and install c-foreign-truncate-lit-pos-cache
on before-change-functions, to connect up correctly with CC Mode's filling
mechanism.
* lisp/textmodes/mhtml-mode.el (mhtml--crucial-variable-prefix): Add prefixes
"adaptive-fill-", "fill-", "normal-auto-fill-function" and "paragraph-" to
pull in variables crucial to filling.
(mhtml-syntax-propertize): Read the current submode from the piece of text
being propertized rather than one character before it, and do so before
erasing the submode text-property.
(mhtml-mode): Set the js-mode value of auto-fill-function to js-do-auto-fill.
Correctly initialize and use CC Mode's filling facilities, as above.
Alan Mackenzie [Sat, 4 Jul 2020 11:56:18 +0000 (11:56 +0000)]
CC Mode: Fix wrong value of comment-start-skip, fixing half of bug #41952
Also add functions to enable correct use of CC Mode's filling functionality
from major modes which don't initialize CC Mode fully. These modes are
currently js-mode and mhtml-mode.
* lisp/progmodes/cc-langs.el (comment-start-skip): Replace "\\(" by "\\(?:" so
that (match-end 1) isn't falsely taken to be the start of the comment.
* lisp/progmodes/cc-engine.el (c-foreign-truncate-lit-pos-cache)
(c-foreign-init-lit-pos-cache): New functions.
Daniel Koning [Tue, 23 Jun 2020 00:03:20 +0000 (19:03 -0500)]
Use 'emacs-lisp-mode-syntax-table' for reading Lisp expressions
* lisp/simple.el (read--expression): Set syntax table to
'emacs-lisp-mode-syntax-table' when reading a Lisp expression
from the minibuffer. (Bug#41781)
James N. V. Cash [Mon, 29 Jun 2020 23:45:15 +0000 (02:45 +0300)]
Subject: Frame-local tab-bar for numeric value of tab-bar-show (bug#42052)
* lisp/tab-bar.el (tab-bar-new-tab-to): Set frame parameter
tab-bar-lines to 1 when tab-bar-show is the same as number of tabs.
(tab-bar-close-tab, tab-bar-close-other-tabs): Set frame parameter
tab-bar-lines to 0 when tab-bar-show is the same as number of tabs.
Alan Mackenzie [Mon, 29 Jun 2020 19:10:09 +0000 (19:10 +0000)]
CC Mode: optimize for repeated simple operations.
Do this by recognising that unterminated strings in a buffer are typically
going to be few and close together. Also optimize code for C++ attributes.
* lisp/progmodes/cc-defs.el (c-previous-single-property-change): New macro.
(c-put-syn-tab, c-clear-syn-tab): Turned from macros into functions, and moved
to cc-mode.el.
(c-clear-syn-tab-properties): Amended to use c-min/max-syn-tab-mkr.
(c-with-extended-string-fences): Removed.
* lisp/progmodes/cc-engine-el (c-enclosing-c++-attribute): Rewritten for
speed.
(c-slow-enclosing-c++-attribute): Removed.
(c-semi-pp-to-literal): Remove a superfluous call to
c-with-extended-string-fences.
* lisp/progmodes/cc-mode.el (c-min-syn-tab-mkr, c-max-syn-tab-mkr): two new
marker variables which bound the region occupied by positions with
c-fl-syn-tab text properties.
(c-basic-common-init): Initialize these two variables.
(c-fl-syn-tab-region): Removed.
(c-put-syn-tab, c-clear-syn-tab): Functions moved from cc-defs.el.
(c-clear-string-fences): Amended to use the new scheme.
(c-restore-string-fences): Now takes no arguments; amended to use the new
scheme.
(c-font-lock-fontify-region): Amended to use the new scheme.
Paul Eggert [Sun, 28 Jun 2020 20:22:44 +0000 (13:22 -0700)]
Update from Gnulib.
This incorporates:
2020-06-28 getrandom: do not depend on ‘open’ on mingw
2020-06-28 getrandom: fix compilation errors on older versions of mingw
* build-aux/config.sub, lib/getrandom.c, m4/getrandom.m4:
Copy from Gnulib
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.