* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
* doc/lispref/searching.texi (Regexp Functions):
Be more specific about how the KEEP-ORDER argument actually works.
If nil, the regexp guarantees a longest match; this is the behaviour
that many callers implicitly rely on.
Wilson Snyder [Tue, 17 Dec 2019 23:04:48 +0000 (18:04 -0500)]
Verilog-Mode collected updates.
* lisp/progmodes/verilog-mode.el (verilog-compiler-directives): Support
indenting `uselib.
(verilog-read-decls): Fix AUTO* to ignore `protected regions.
(verilog-read-auto-template-middle): Fix AUTO_TEMPLATEs with multiple
module templates and at-REGEXPs, msg3183. Reported by Berk Akinci.
Adjust cursor column when auto-scrolling during rectangle selection
* lisp/mouse.el (mouse-drag-region-rectangle):
Move cursor to the correct column during auto-scrolling both when
crutches are used and not (bug#38641). Reported by Konrad Podczeck.
Dmitry Gutov [Mon, 16 Dec 2019 21:55:11 +0000 (23:55 +0200)]
vc-git-after-dir-status-stage: Avoid erroneous up-to-date status
* lisp/vc/vc-git.el (vc-git-after-dir-status-stage):
Don't set `up-to-date' status if the previous stage (`diff-index')
has assigned some other status to the file (bug#38615).
Eli Zaretskii [Mon, 16 Dec 2019 15:43:30 +0000 (17:43 +0200)]
Fix face merging for display strings broken by a recent commit
* src/xfaces.c (face_at_string_position): Revert the last
change, as it cannot possibly solve bug#38563.
* src/xdisp.c (face_at_pos): Fix a typo made during last
change here, which broke face merging for display strings.
(Bug#38633)
Phil Sainty [Sat, 14 Dec 2019 07:49:41 +0000 (20:49 +1300)]
New command 'diff-buffers'
* lisp/vc/diff.el (diff-buffers): New command.
(diff, diff-no-select, diff-file-local-copy): Improve docstrings.
* doc/emacs/files.texi:
* etc/NEWS: Document new command, and the previously-undocumented
ability for 'diff' to compare buffers.
Eli Zaretskii [Sat, 14 Dec 2019 18:02:11 +0000 (20:02 +0200)]
Update documentation of pure-space overflow
* doc/lispref/internals.texi (Garbage Collection)
(Pure Storage):
* src/alloc.c (Fgarbage_collect): Update the documentation of
pure-space overflow for when pdumper is used. (Bug#38492)
Paul Eggert [Sat, 14 Dec 2019 01:06:52 +0000 (17:06 -0800)]
Fix typo that broke GNU/Linux unexec build
* src/emacs.c (Fdump_emacs): Remove stray closing brace that
breaks the build when configured with --with-dumping=unexec on
GNU/Linux. (Apparently everybody is using pdumper now.)
I introduced the bug in 2019-07-09T00:50:39Z!eggert@cs.ucla.edu.
Allow characters and single-char strings in rx charsets
The `not' and `intersection' forms, and `or' inside these forms,
now accept characters and single-character strings as arguments.
Previously, they had to be wrapped in `any' forms.
This does not add expressive power but is a convenience and is easily
understood.
* doc/lispref/searching.texi (Rx Constructs): Amend the documentation.
* etc/NEWS: Announce the change.
* lisp/emacs-lisp/rx.el (rx--charset-p, rx--translate-not)
(rx--charset-intervals, rx): Accept characters and 1-char strings in
more places.
* test/lisp/emacs-lisp/rx-tests.el (rx-not, rx-charset-or)
(rx-def-in-charset-or, rx-intersection): Test the change.
Noam Postavsky [Fri, 13 Dec 2019 11:36:02 +0000 (06:36 -0500)]
Add prefix to help.el uni-confusable* vars
* lisp/help.el (help-uni-confusables, help-uni-confusables-regexp):
Rename from uni-confusable and uni-confusables-regexp, respectively.
(help-uni-confusable-suggestions): Use ngettext. Use new variable
name.
* lisp/emacs-lisp/lisp-mode.el (lisp--match-confusable-symbol-character):
Use new variable name.
Eli Zaretskii [Fri, 13 Dec 2019 10:29:05 +0000 (12:29 +0200)]
A better fix for extension of overlay string's faces
* src/xdisp.c (face_at_pos): Revert previous change that
rejected the underlying face if it failed the filtering
criteria.
* src/xfaces.c (face_at_string_position): Reset the base face's
attribute used for filtering faces if the attribute is t.
(Bug#38563)
Eli Zaretskii [Thu, 12 Dec 2019 11:16:46 +0000 (13:16 +0200)]
Fix face extension of overlay strings on buffer text with faces
* src/xdisp.c (face_at_pos): Reject the face returned by
'underlying_face_id' when we are filtering by face attribute,
and that attribute's value fails the filter test. (Bug#38563)
Robert Pluim [Mon, 9 Dec 2019 17:41:59 +0000 (18:41 +0100)]
Treat passed strings as raw-text when percent-escaping in epg
The strings contained in gpg keys can contain UTF-8 data, but can also
use percent-escapes to encode non-ASCII chars. When converting those
escapes, use 'raw-text' coding system rather than 'string-to-unibyte',
since the latter signals an error for non-ASCII characters.
* lisp/epg.el (epg--decode-percent-escape): Convert the passed
string to raw-text before treating percent escapes (Bug#38512).
Allow placing debug-on-entry on a function not-yet-defined, which
is convenient when the problem you're investigating happens while
the relevant files are loaded.
Stefan Monnier [Thu, 12 Dec 2019 01:17:17 +0000 (20:17 -0500)]
* lisp/gnus/message.el (message-expand-name-standard-ui): New option
(message--old-style-completion-functions): New var.
(message-completion-function): Allow functions on
`message-completion-alist` to follow the capf protocol.
(message-completion-alist): Adjust docstring accordingly.
Simplify regexps and make them apply more liberally.
(message-expand-group): Use the capf protocol.
(completion-category-defaults): Use 'substring' completion style by
default for email addresses.
(message--bbdb-query-with-words, message--name-table): New functions.
(message-expand-name): Use them to obey `message-expand-name-standard-ui`.
These character set operations, together with `not' for set
complement, improve the compositionality of rx, and reduce duplication
in complicated cases. Named character classes are not permitted in
set operations.
* src/nsimage.m (ns_image_from_XBM): Use new reverseBytes argument.
([EmacsImage initFromXBM:width:height:fg:bg:reverseBytes:]): Add
ability to reverse the contents of each byte for use with XBMs, while
still working with fringe bitmaps.
* src/nsterm.h
([EmacsImage initFromXBM:width:height:fg:bg:reverseBytes:]): Modified
function definition.
* src/nsterm.m (ns_draw_fringe_bitmap): Use new reverseBytes argument.
Alan Third [Thu, 5 Dec 2019 13:14:00 +0000 (13:14 +0000)]
Fix dabbrev-completion (bug#17899)
* lisp/dabbrev.el (dabbrev--check-all-buffers): Add new variable.
(dabbrev-completion): Lexical scoping means we can't use let to
override global variables, so use setq.
(dabbrev--reset-global-variables): Reset new variable.
(dabbrev--make-friend-buffer-list): Use new variable.
* test/lisp/dabbrev-tests.el (dabbrev-completion-test):
(dabbrev-completion-test-with-argument): New tests.
Federico Tedin [Fri, 6 Dec 2019 00:23:25 +0000 (01:23 +0100)]
Simplify call to add-to-history in read_minibuf
* src/minibuf.c (read_minibuf): Avoid restoring the previous buffer,
as this is already done at the end of the function; call
`add-to-history' after that point.
Dmitry Gutov [Tue, 10 Dec 2019 00:11:15 +0000 (02:11 +0200)]
Make ':extend' inherited from default spec unless overridden
* lisp/faces.el (face-spec-recalc): Handle the :extend attribute
specially and always inherit it from the default spec unless
overwritten in a theme (bug#37774).
* test/lisp/faces-tests.el (faces--test-data-dir): New variable.
(faces--test-extend-with-themes): Use test themes instead of ones
from etc/themes. Update expected values.
* test/data/themes/faces-test-dark-theme.el: New file.
* test/data/themes/faces-test-light-theme.el: New file.
* doc/lispref/display.texi (Face Attributes):
Update the description of ':extend'.
* etc/NEWS: Update the entry for ':extend'.
* etc/themes/adwaita-theme.el:
* etc/themes/deeper-blue-theme.el:
* etc/themes/dichromacy-theme.el:
* etc/themes/leuven-theme.el:
* etc/themes/light-blue-theme.el:
* etc/themes/manoj-dark-theme.el:
* etc/themes/misterioso-theme.el:
* etc/themes/tango-dark-theme.el:
* etc/themes/tango-theme.el:
* etc/themes/tsdh-dark-theme.el:
* etc/themes/tsdh-light-theme.el:
* etc/themes/wheatgrass-theme.el:
* etc/themes/wombat-theme.el: Remove the now-redundant ':extend'
attribute in all the themes.
Juri Linkov [Mon, 9 Dec 2019 23:53:16 +0000 (01:53 +0200)]
* lisp/emacs-lisp/map-ynp.el (read-answer): Use [remap self-insert-command]
This reverts the last change that replaced [remap self-insert-command]
with [t]. The user should have freedom of using any command
in the minibuffer. (bug#32738)
Eli Zaretskii [Mon, 9 Dec 2019 12:46:43 +0000 (14:46 +0200)]
Add more tests for face :extend attribute
* test/lisp/faces-tests.el (faces--test-extend-with-themes):
New set of tests for verifying the :extend attribute across
theme loading and unloading, and also via face inheritance.
(Bug#37774)
Juri Linkov [Sun, 8 Dec 2019 23:27:29 +0000 (01:27 +0200)]
* lisp/emacs-lisp/map-ynp.el (read-answer): Allow more SHORT-ANSWER types.
Treat SHORT-ANSWER as a character is characterp returns non-nil.
Otherwise, use key-description to print it.
Use catch-all [t] in keymap instead of [remap self-insert-command].
(bug#32738)
Eric Abrahamsen [Tue, 3 Dec 2019 09:12:44 +0000 (09:12 +0000)]
Continued fixes to gnus registry loading
* lisp/gnus/gnus-registry.el (gnus-registry-db): Do not initialize
this variable to an empty database, that should only be done for new
databases.
(gnus-registry-load): Remove "force" argument, don't check if the
database is already loaded, as we're only going to load it once.
(gnus-registry-initialize): Either load the db directly, or set up a
hook to do it later.
(gnus-registry-install-hooks): Don't load on
gnus-read-newsrc-el-hook.
Juri Linkov [Sat, 7 Dec 2019 22:36:58 +0000 (00:36 +0200)]
* lisp/man.el (Man-width-max): New defcustom (bug#32536, bug#9385)
(Man-columns): New buffer-local variable.
(Man-columns): New function.
(Man-start-calling): Call Man-columns and set buffer-local Man-columns.
(Man--window-state-change-timer): New internal variable.
(Man--window-state-change): New internal function.
(Man-fit-to-window): New function.
(Man-mode): Add Man--window-state-change to local hook
window-state-change-functions.
* lisp/image-mode.el (image-fit-to-window): Add window arg to
window-buffer call.
Robert Cochran [Fri, 8 Nov 2019 19:29:43 +0000 (11:29 -0800)]
Add hooks for after tab open, before close, and to prevent closing
* lisp/tab-bar.el (tab-bar-tab-post-open-functions,
tab-bar-tab-prevent-close-functions, tab-bar-tab-pre-close-functions):
New defcustoms
(tab-bar-new-tab-to, tab-bar-close-tab): Use new defcustoms
Alan Mackenzie [Sat, 7 Dec 2019 18:55:19 +0000 (18:55 +0000)]
CC Mode: Allow most functions on post-self-insert-hook to be called
This contrasts with the previous state where no such functions got called.
This fixes bug #38406.
* lisp/progmodes/cc-cmds.el (c--unsafe-post-self-insert-hook-functions): New
variable.
(c--call-post-self-insert-hook-more-safely-1): New function.
(c--call-post-self-insert-hook-more-safely): New macro.
(c-electric-pound, c-electric-brace, c-electric-slash, c-electric-star)
(c-electric-semi&comma, c-electric-colon, c-electric-lt-gt, c-electric-paren):
Invoke c--call-post-self-insert-hook-more-safely (which calls most of the hook
post-self-insert-hook) at the end of each of the commands.
Eli Zaretskii [Sat, 7 Dec 2019 10:11:36 +0000 (12:11 +0200)]
Corrections in semantic.texi
* doc/misc/semantic.texi (Parser code, Tag handling)
(Semanticdb Internals, Analyzer Internals, Tools): Fix file
names according to what was actually imported from the
original CEDET. (Bug#38451)
Eli Zaretskii [Sat, 7 Dec 2019 09:28:05 +0000 (11:28 +0200)]
Fix fallout from fixing bug#37782
* src/keyboard.c (read_key_sequence): Modify the fix for
bug#37782 so that it applies only to keyboard keys, not to
other events, such as a new buffer. (Bug#38132)
Paul Eggert [Fri, 6 Dec 2019 23:36:48 +0000 (15:36 -0800)]
Test format-time-string padding
Adapted from tests written by Stephen Gildea.
* test/src/timefns-tests.el:
(format-time-string-padding-minimal-deletes-unneeded-zeros)
(format-time-string-padding-minimal-retains-needed-zeros)
(format-time-string-padding-spaces)
(format-time-string-padding-zeros-adds-on-insignificant-side):
New tests.
Paul Eggert [Fri, 6 Dec 2019 23:16:15 +0000 (15:16 -0800)]
Update from Gnulib
This incorporates:
2019-12-06 nstrftime: better width support for %N, %z
2019-12-03 Avoid hassles caused by [[noreturn]] in C++
2019-12-02 Fix mistakes in --enable-threads=isoc fixes from 2019-12-01
* admin/merge-gnulib (AVOIDED_MODULES): Avoid pthread-h.
* lib/_Noreturn.h, lib/nstrftime.c, m4/gnulib-common.m4:
* m4/timer_time.m4:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
Eli Zaretskii [Fri, 6 Dec 2019 15:42:19 +0000 (17:42 +0200)]
Clarify documentation of functions that use the default face
* lisp/simple.el (default-font-height, default-font-width)
(default-line-height): Say in the doc strings that the default
face these functions use is for the currently selected frame.
* doc/lispref/display.texi (Attribute Functions)
(Low-Level Font): Document more clearly the dependence of the
results of 'face-font', 'default-font-width', and
'default-font-height' on the frame's definition of the default
face.
Eli Zaretskii [Fri, 6 Dec 2019 13:29:20 +0000 (15:29 +0200)]
Fix set-marker when the position is larger than the largest buffer
* src/marker.c (set_marker_internal): Handle the case where
POSITION is beyond PTRDIFF_MAX, which can happen if Emacs was
built --with-wide-int. Bug uncovered by the recently added
overlay tests.
Paul Eggert [Fri, 6 Dec 2019 03:31:00 +0000 (19:31 -0800)]
2019-12-05 regexp lint fixes
* lisp/org/org-agenda.el (org-agenda-filter):
Fix unescaped literal ‘+’ in regexp. Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00215.html
* lisp/org/org.el (org-clone-subtree-with-time-shift):
Fix a regexp typo that mishandled strings like ‘\1d’,
reported by the same emaikl.
* lisp/progmodes/verilog-mode.el (verilog-inject-inst):
Omit unnecessary ‘?’ in regexp. Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00217.html
Eli Zaretskii [Thu, 5 Dec 2019 14:38:17 +0000 (16:38 +0200)]
Fix recent modifications in emacs-module-tests
* test/data/emacs-module/mod-test.c (extract_big_integer): Fix
calculation of size of 'magnitude' when 'emacs_limb_t' is wider
than 'unsigned long'.
* test/src/emacs-module-tests.el
(module--test-assertions--load-non-live-object)
(module--test-assertions--call-emacs-from-gc): On MS-Windows,
check also mod-test-emacs with ".exe" appended, before
skipping the tests.