Paul Eggert [Sun, 5 Apr 2020 01:26:21 +0000 (18:26 -0700)]
Avoid SAFE_ALLOCA in Fstring, Funibyte_string
* src/character.c (Fstring, Funibyte_string):
Redo to avoid the need for a temporary array allocation
and then a copying from that array to the destination.
Stefan Monnier [Sat, 4 Apr 2020 02:27:54 +0000 (22:27 -0400)]
* lisp/arc-mode.el (archive--file-desc): Add fields from other structs
Add fields `size`, `time` (used by all backends) as well as
`pos`, `ratio`, `uid`, and `gid` (used only be some backends).
(archive-arc--file-desc, archive-rar--file-desc, archive-ar--file-desc)
(archive-lzh--file-desc, archive-zip--file-desc, archive-7z--file-desc):
Remove defstructs.
(archive-arc-summarize): Record size and time in the descrs.
(archive-lzh-summarize): Record size, time, uid, and gid in the descrs.
(archive-zip-summarize): Record size and time in the descrs.
(archive-zoo-summarize): Record size and time in the descrs.
(archive-rar-summarize): Adjust to use of `archive--file-desc`.
(archive-7z-summarize): Adjust to new constructor.
(archive-ar-summarize): Adjust to use of `archive--file-desc`.
Paul Eggert [Sat, 4 Apr 2020 23:56:57 +0000 (16:56 -0700)]
Default gcc -Og to inlining key ops
Problem reported by Martin Rudalics in:
https://lists.gnu.org/r/emacs-devel/2020-04/msg00195.html
* configure.ac (DEFINE_KEY_OPS_AS_MACROS): Define if -Og.
* src/Makefile.in (KEY_OPS_CFLAGS): New macro.
(EMACS_CFLAGS): Use it.
* src/lisp.h (DEFINE_KEY_OPS_AS_MACROS): Let the gcc command line
specify it. Remove use of undocumented INLINING macro.
Eli Zaretskii [Sat, 4 Apr 2020 11:15:41 +0000 (14:15 +0300)]
Support the "explore" command in gdb-mi.el
* lisp/progmodes/gdb-mi.el (gdb-control-commands-regexp): Add
support for "explore", "explore value", and "explore type".
Allow more than one word after control commands.
(gdb-gdb): Decrease gdb-control-level when we get the "(gdb)"
prompt, which signals that "explore" exited. (Bug#40250)
Eli Zaretskii [Sat, 4 Apr 2020 06:59:16 +0000 (09:59 +0300)]
Fix face spec handling for 'default' "terminal class"
* lisp/faces.el (face-spec-choose): Reverse order of 'defaults'
and 'result' when generating attribute list, so that the spec for
'default' "terminal class" is indeed overridden by the actual
class's spec, per the documentation. (Bug#40336)
Stefan Monnier [Fri, 3 Apr 2020 22:11:52 +0000 (18:11 -0400)]
* lisp/arc-mode.el: Remove unused struct fields
(archive--file-desc): Remove `case-fiddled`.
Change all subtypes's constructors as their callers accordingly.
(archive--file-desc-case-fiddled): New function.
(archive-int-to-mode): Accept a nil input.
Make all callers take advantage of it.
(archive-arc-rename-entry): Use `make-string`.
(archive-zip--file-desc): Change `pos+len` field into `pos` field.
(archive-zip-chmod-entry): Simplify accordingly.
(archive-zip-summarize): Don't bother with `lheader` which was not used.
(archive-zoo--file-desc): Delete struct; use archive--file-desc instead.
(archive-7z--file-desc): Remove `user` and `group` fields.
Adjust constructor and its caller.
(archive-ar-summarize): Use `archive-int-to-mode`.
(archive-get-descr, archive-mode, archive-summarize-files)
(archive-maybe-copy, archive-extract, archive-*-write-file-member)
(archive-expunge, archive-arc-summarize, archive-arc-rename-entry)
(archive-lzh-summarize, archive-lzh-rename-entry, archive-lzh-ogm)
(archive-zip-summarize, archive-zip-write-file-member)
(archive-zip-chmod-entry, archive-zoo-summarize)
(archive-rar-summarize, archive-7z-summarize, archive-ar-summarize)
(archive-ar-write-file-member): Use struct constructors and accessors
instead of `vector` and `aref`.
(archive-calc-mode): Remove `error` arg which was always non-nil;
adjust all callers.
Rewrite using `string-to-number` and `file-modes-symbolic-to-number`.
Alan Mackenzie [Fri, 3 Apr 2020 20:37:31 +0000 (20:37 +0000)]
C++ Mode: recognize brace blocks without the hitherto required = sign
* lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Add code
to recognize a literal brace expression following an array declaration for
C++.
(c-looking-at-inexpr-block): Replace c-symbol-chars with c-symbol-char-key,
fixing a coding error.
Stefan Monnier [Fri, 3 Apr 2020 17:55:50 +0000 (13:55 -0400)]
* lisp/arc-mode.el (archive-ar-write-file-member): New function
(archive-ar--name): New funtion, extracted from `archive-ar-summarize`.
(archive-ar-extract): Use it.
(archive-ar-summarize): Use it. Put the extname in the slot 0 of the
desc vectors.
Stefan Monnier [Fri, 3 Apr 2020 17:28:31 +0000 (13:28 -0400)]
* lisp/arc-mode.el: Use lexical-binding
(arc-insert-unibyte): Simplify.
(archive--mode-revert): Rename from `archive-mode-revert` and adjust
for use as an :around advice.
(archive-mode): Use setq-local. Use `add-function` to hook into
`revert-buffer-function`.
(archive-summarize): Don't use `set` on a hook.
Robert Pluim [Fri, 3 Apr 2020 12:56:08 +0000 (14:56 +0200)]
Check for IPv6 servers in dns.el
* lisp/net/dns.el (dns-set-servers): Set dns-servers to nil when we
don't find any DNS servers with nslookup. Add support for IPv6
servers. (Bug#40248).
(dns-make-network-process): Check for datagram process support before
creating a datagram process.
(dns-query): Return nil if dns-servers is nil.
Robert Pluim [Thu, 2 Apr 2020 15:52:01 +0000 (17:52 +0200)]
Make make-{network,serial}-process handle :coding nil consistently
The handling of :coding nil was different between
make-{network,serial}-process and make-{pipe}process. Now they all
handle :coding nil as if :coding had not been specified.
* process.c (Fmake_serial_process)
(set_network_socket_coding_system): Use plist-get to check if
:coding has been specified instead of plist-member, to ensure that
":coding nil" does not override coding-system-for-{read,write}.
* network-stream-tests.el (check-network-process-coding-system-bind)
(check-network-process-coding-system-no-override)
(check-network-process-coding-system-override): New tests.
* etc/NEWS: Describe change in make-network-process and
make-serial-process :coding behavior.
Update texinfo.el following changes in 'tex-start-options-string'
* lisp/textmodes/texinfo.el (texinfo-texi2dvi-options): New
defcustom.
(texinfo-tex-buffer): Take 'tex-start-options' from
'texinfo-texi2dvi-options'. (Bug#40001)
Alex Branham [Tue, 24 Mar 2020 23:34:14 +0000 (19:34 -0400)]
Error out if 'date-days-in-month' is given an invalid month
* lisp/calendar/time-date.el (date-days-in-month): Add test for
month validity; signal an error if it isn't. (Bug#40217)
* test/lisp/calendar/time-date-tests.el (test-days-in-month): Add
a test for the new error.
Federico Tedin [Mon, 30 Mar 2020 19:44:47 +0000 (21:44 +0200)]
Copy INSIDE_EMACS env variable to subprocesses in Eshell (Bug#25496)
* lisp/eshell/em-dirs.el (eshell-dirs-initialize): Add INSIDE_EMACS
variable to buffer-local value of eshell-variable-aliases-alist.
(eshell-inside-emacs): Add new constant used for INSIDE_EMACS.
* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Update doc
string; remove mention of eshell-user-aliases-list and explain that
variables can optionally be copied to subprocesses' environments.
* test/lisp/eshell/eshell-tests.el (eshell-test/inside-emacs-var): Add
test for the INSIDE_EMACS variable.
* etc/NEWS: Announce changes.
Juri Linkov [Thu, 2 Apr 2020 22:08:09 +0000 (01:08 +0300)]
* lisp/vc/vc-dir.el: Commands to mark un/registered files (bug#34949)
* lisp/vc/vc-dir.el (vc-dir-mark-state-files): New function.
(vc-dir-mark-registered-files)
(vc-dir-mark-unregistered-files): New commands.
(vc-dir-mode-map): Bind vc-dir-mark-registered-files to '* r'.
(vc-dir-menu-map): Add menu entries for
vc-dir-mark-registered-files and vc-dir-mark-unregistered-files.
Separate values for box line width and height and allow both to be
negative which makes the visual width and height of the boxed string
unchanged (Bug#13011).
* doc/lispref/display.texi (Face Attributes): Modify :box attribute
description to reflect the new possibilities.
* lisp/cus-face.el (custom-face-attributes): Set box attribute to get
two integer to set vertical and horizontal width and modify pre-filter
to accept dotted list of two int as valid box attribute.
* src/dispextern.h (face): Use two int for box horizontal and vertical
line width.
* src/nsfont.m (nsfont_draw): Use new face attributes.
* src/nsterm.m (ns_draw_box, ns_draw_relief): Support separated
horizontal and vertical box line width.
(ns_dumpglyphs_box_or_relief, ns_maybe_dumpglyphs_background)
(ns_dumpglyphs_image, ns_draw_glyph_string_foreground)
(ns_draw_composite_glyph_string_foreground): Use new face attributes.
* src/w32term.c (w32_draw_box_rect, w32_draw_relief_rect): Support
separated horizontal and vertical box line width.
(x_draw_glyph_string_background, x_draw_glyph_string_foreground)
(x_draw_composite_glyph_string_foreground)
(x_draw_glyphless_glyph_string_foreground, x_draw_glyph_string_box)
(x_draw_image_foreground, x_draw_image_relief)
(w32_draw_image_foreground_1, x_draw_image_glyph_string): Use new face
attributes.
* src/xfaces.c (Sinternal_set_lisp_face_attribute, realize_x_face):
Accept box attribute as a list of two ints.
* src/xdisp.c (estimate_mode_line_height, produce_image_glyph)
(produce_xwidget_glyph, x_produce_glyphs): Use new face attributes.
* src/xterm.c (x_draw_box_rect, x_draw_relief_rect): Support separated
horizontal and vertical box line width.
(x_draw_glyph_string_background, x_draw_glyph_string_foreground)
(x_draw_composite_glyph_string_foreground)
(x_draw_glyphless_glyph_string_foreground, x_draw_glyph_string_box)
(x_draw_image_foreground, x_draw_image_relief, x_draw_image_foreground_1)
(x_draw_image_glyph_string): Use new face attributes.
Stefan Monnier [Tue, 31 Mar 2020 23:45:22 +0000 (19:45 -0400)]
Remove `all_buffers` and the associated `next` field of buffers
* src/alloc.c (enum mem_type): Remove MEM_TYPE_BUFFER.
(allocate_buffer): Allocate like any other pseudovector.
Don't register on `all_buffers` any more.
(live_buffer_holding, live_buffer_p): Delete functions.
(mark_maybe_object, valid_lisp_object_p): Don't pay attention to
MEM_TYPE_BUFFER any more.
(garbage_collect): Only compact the live buffers.
(mark_buffer): Mark the undo_list of dead buffers here.
(mark_object): Buffers are normal pseudovectors now.
(sweep_buffers): Don't do the actual sweep here, just cleanup the
markers and only for live buffers.
* src/buffer.c (all_buffers): Remove variable.
(Fkill_buffer): Don't check indirect dead buffers.
Set the undo_list before we remove ourselves from the list of live buffers.
(Fbuffer_swap_text, Fset_buffer_multibyte): Don't check indirect dead
buffers.
(init_buffer_once): Don't set `all_buffers`.
(init_buffer): Don't map new memory for dead buffers.
Noam Postavsky [Tue, 24 Mar 2020 09:39:03 +0000 (05:39 -0400)]
Don't lose point during fileloop replace (Bug#38867)
Suggested by Eric Michael Timmons <etimmons@mit.edu>.
* lisp/fileloop.el (fileloop-initialize-replace): Save the
match-beginning position in a variable instead of the buffer's point.
The point may be changed by the time perform-replace is called, e.g.,
due to switch-to-buffer-preserve-window-point.
Glenn Morris [Tue, 31 Mar 2020 00:17:01 +0000 (17:17 -0700)]
Mark recently failing Tramp tests on hydra
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process, tramp-test33-environment-variables):
Expect failure on hydra.nixos.org, since March 29 Tramp cache changes.
Juri Linkov [Mon, 30 Mar 2020 22:52:59 +0000 (01:52 +0300)]
* lisp/minibuffer.el (minibuffer-completion-help): Use mainbuf (bug#39822)
* lisp/minibuffer.el (minibuffer-completion-help): Run
display-completion-list in the original buffer mainbuf
to allow completion-setup-function set completion-reference-buffer to it.
Eli Zaretskii [Mon, 30 Mar 2020 13:57:43 +0000 (16:57 +0300)]
Avoid assertion violation at startup in pdumped Emacs
* src/buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Remove the
assertion that ensured all buffers in pdumped Emacs have non-NULL
pointer to buffer text. That was false when Emacs was pdumped
with killed buffer(s) in the all_buffers linked list. See
https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00800.html
for more details.
Juri Linkov [Sun, 29 Mar 2020 22:34:47 +0000 (01:34 +0300)]
Support state changing VC operations on directories in Dired (bug#34949)
* lisp/dired-aux.el (dired-vc-next-action): New command.
(dired-vc-deduce-fileset): Rename from vc-dired-deduce-fileset in vc.el.
* lisp/dired.el (dired-mode-map): Remap vc-next-action to
dired-vc-next-action.
* lisp/vc/vc-dir.el (vc-dir-mark-files): New function.
(vc-dir-refresh): Run hook vc-dir-refresh-hook.
* lisp/vc/vc.el (vc-deduce-fileset): Rename arg 'observer' to
'not-state-changing' and document it in docstring.
(vc-dired-deduce-fileset): Rename to dired-vc-deduce-fileset in dired-aux.el.
* lisp/cedet/ede.el (ede-turn-on-hook, ede-minor-mode):
* lisp/desktop.el (desktop-minor-mode-table): Rename the long ago
obsolete vc-dired-mode to vc-dir-mode.
Juri Linkov [Sat, 28 Mar 2020 23:41:29 +0000 (01:41 +0200)]
Switch to literal mode with message when regexp is too big in char-fold search
* lisp/char-fold.el (char-fold-to-regexp): Don't use regexp-quote
when the length of regexp reaches 5000. (Bug#40216)
* lisp/isearch.el (isearch-search): On big regexp in char-fold mode
gracefully fall back to literal mode, try to search again and display
momentary-message about switching to literal mode.
(isearch--momentary-message): Add optional arg SECONDS.
Paul Eggert [Sat, 28 Mar 2020 20:58:44 +0000 (13:58 -0700)]
Stop using newly-deprecated dosname Gnulib module
Code is supposed to use the filename module now.
* admin/merge-gnulib (GNULIB_MODULES): Replace dosname with filename.
* lib/dosname.h: Remove this forwarding stub.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/emacsclient.c, src/fileio.c:
Include filename.h instead of dosname.h.
Paul Eggert [Sat, 28 Mar 2020 20:50:02 +0000 (13:50 -0700)]
Update from Gnulib
This incorporates:
2020-03-28 Use module 'filename' instead of module 'dosname'
2020-03-28 dosname: Redirect to 'filename'
* lib/at-func.c, lib/canonicalize-lgpl.c, lib/dosname.h:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/filename.h: New file, copied from Gnulib.
Stefan Monnier [Sat, 28 Mar 2020 14:16:58 +0000 (10:16 -0400)]
* lisp/jit-lock.el (jit-lock-mode): Pass `local` to add-hook
The old code used local=nil knowing that add-hook would affect the
local part only anyway. Remove this hideous assumption.
Remove redundant `:group` args while we're at it.
Used to be called `ebrowse-tags-loop-form` and passed to `eval`.
Now it's passed to `apply` instead, which is better for karma.
(ebrowse-tags-loop-continue, ebrowse-tags-search)
(ebrowse-tags-query-replace, ebrowse-tags-search-member-use):
Adjust accordingly.
(ebrowse-electric-position-mode-map): Move init into declaration.
(ebrowse-electric-position-mode): Derive from special.
Michael Albinus [Sat, 28 Mar 2020 11:59:03 +0000 (12:59 +0100)]
Tramp cache fixes
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Flush the
cache after the file has been written.
Stefan Monnier [Fri, 27 Mar 2020 20:38:52 +0000 (16:38 -0400)]
* lisp/gnus/gnus-registry.el: Use lexical-binding
(gnus-registry-install-shortcuts): Use a closure (with dynamic :documentation)
(gnus-registry-user-format-function-M): Use define-obsolete-function-alias.
(gnus-registry-article-marks-to-names): η-reduce.
Stefan Monnier [Fri, 27 Mar 2020 16:54:52 +0000 (12:54 -0400)]
* lisp/textmodes/tex-mode.el: Replace double-definition hack with an advice
(tex-verbatim-environments): Add "Verbatim".
(tex--guess-mode): Rename from tex-guess-mode and return the mode
rather than calling it.
(tex-mode): Replace second definition with an advice.
Stefan Monnier [Fri, 27 Mar 2020 16:24:19 +0000 (12:24 -0400)]
* lisp/progmodes/ebrowse.el: Prefer hash-tables to obarrays
Remove redundant :group args.
Use `defvar-local` and `setq-local` where possible.
(ebrowse-some): Use seq-some instead.
(ebrowse-every): Use seq-every-p instead.
(ebrowse-position): Use seq-position.
(ebrowse--tree-table): Rename from `ebrowse--tree-obarray`.
Change all users to use a hash-table rather than an obarray.
(ebrowse-for-all-trees): Adjust to the table being a hash-table.
(ebrowse-tree-table-as-alist): Rename from `ebrowse-tree-obarray-as-alist`.
(ebrowse-build-tree-obarray): Rename from `ebrowse-build-tree-obarray`.
(ebrowse-tree-mode): Remove redundant setting of `ebrowse--tree-obarray`.
(ebrowse-set-tree-indentation, ebrowse-view-file-other-frame)
(ebrowse-last-completion-table): Rename from
ebrowse-last-completion-obarray.
(ebrowse-position): Make it a proper struct.
Eli Zaretskii [Fri, 27 Mar 2020 12:43:20 +0000 (15:43 +0300)]
Port the 'module/async-pipe' test to MS-Windows
These changes let the code compile and produce a valid DLL, but the
test hangs. It looks like the hang is in Fdelete_process, when it
closes one of the descriptors of the pipe process.
In addition, this use of the pipe process cannot currently work
on MS-Windows, since make-pipe-process doesn't set up the reader
thread to read from the Emacs's side of the pipe, so the select
emulation doesn't know there's stuff to read from that pipe.
* test/data/emacs-module/mod-test.c [WINDOWSNT]: Include
windows.h.
(ALIGN_STACK) [!__x86_64__]: Define for 32-bit builds.
(sleep_for_half_second): New function.
(write_to_pipe): Declare return type differently for WINDOWSNT.
Call sleep_for_half_second.
(Fmod_test_async_pipe) [WINDOWSNT]: Use _beginthread as substitute
for pthread_create.
(invalid_finalizer): Replace non_ASCII character in a comment.
* test/src/emacs-module-tests.el (module/async-pipe): Skip on
MS-Windows, as the test fails and then hangs.
Paul Eggert [Fri, 27 Mar 2020 07:58:31 +0000 (00:58 -0700)]
Treat out-of-range positions consistently
If a position argument to get-byte etc. is an out-of-range integer,
treat it the same regardless of whether it is a fixnum or a bignum.
* src/buffer.c (fix_position): New function.
* src/buffer.c (validate_region):
* src/character.c (Fget_byte):
* src/coding.c (Ffind_coding_systems_region_internal)
(Fcheck_coding_systems_region):
* src/composite.c (Ffind_composition_internal):
* src/editfns.c (Fposition_bytes, Fchar_after, Fchar_before)
(Finsert_buffer_substring, Fcompare_buffer_substrings)
(Fnarrow_to_region):
* src/fns.c (Fsecure_hash_algorithms):
* src/font.c (Finternal_char_font, Ffont_at):
* src/fringe.c (Ffringe_bitmaps_at_pos):
* src/search.c (search_command):
* src/textprop.c (get_char_property_and_overlay):
* src/window.c (Fpos_visible_in_window_p):
* src/xdisp.c (Fwindow_text_pixel_size):
Use it instead of CHECK_FIXNUM_COERCE_MARKER, so that
the code is simpler and treats bignums consistently with fixnums.
* src/buffer.h (CHECK_FIXNUM_COERCE_MARKER): Define here
rather than in lisp.h, and reimplement in terms of fix_position
so that it treats bignums consistently with fixnums.
* src/lisp.h (CHECK_FIXNUM_COERCE_MARKER): Move to buffer.h.
* src/textprop.c (validate_interval_range): Signal with original
bounds rather than modified ones.
Paul Eggert [Thu, 26 Mar 2020 23:12:21 +0000 (16:12 -0700)]
Refactor and fix typo in CHECK_*_COERCE_MARKER
* src/data.c (check_integer_coerce_marker)
(check_number_coerce_marker): New functions.
Also, fix a typo in the former, by having it use
Qinteger_or_marker_p not Qnumber_or_marker_p.
(arithcompare, floatop_arith_driver, bignum_arith_driver)
(arith_driver, Fplus, Fminus, Ftimes, Fquo, Frem, Fmod)
(minmax_driver, Flogand, Flogior, Flogxor, Fadd1, Fsub1):
Use them in place of the similarly-named macros.
* src/lisp.h (CHECK_NUMBER_COERCE_MARKER)
(CHECK_INTEGER_COERCE_MARKER): Remove; no longer used.
Philipp Stephani [Thu, 26 Mar 2020 16:22:25 +0000 (17:22 +0100)]
Add a module function to open a file descriptor connected to a pipe.
A common complaint about the module API is that modules can't
communicate asynchronously with Emacs. While it isn't possible to
call arbitrary Emacs functions asynchronously, writing to a pipe
should always be fine and is a pretty low-hanging fruit.
This patch implements a function that adapts an existing pipe
process. That way, users can use familiar tools like process filters
or 'accept-process-output'.
* src/emacs-module.c (module_open_channel): Provide definition for
'open_channel'.
(initialize_environment): Use it.
* src/process.c (open_channel_for_module): New helper function.
(syms_of_process): Define necessary symbol.
* test/src/emacs-module-tests.el (module/async-pipe): New unit test.
* test/data/emacs-module/mod-test.c (signal_system_error): New helper
function.
(signal_errno): Use it.
(write_to_pipe): New function running in the background.
(Fmod_test_async_pipe): New test module function.
(emacs_module_init): Export it.
* doc/lispref/internals.texi (Module Misc): Document new module
function.
* doc/lispref/processes.texi (Asynchronous Processes): New anchor
for pipe processes.
Paul Eggert [Thu, 26 Mar 2020 00:40:57 +0000 (17:40 -0700)]
Fix integer overflow in forward-point
* lisp/subr.el (forward-point): Rewrite in Lisp and move here ...
* src/cmds.c (Fforward_point): ... from here. This fixes an
integer overflow bug with (forward-point most-positive-fixnum).
Make compilation-mode regexp matching case-sensitive (bug#40119)
The number of regexps is large, they are written independently of one
another, and they frequently intersect. Using case-sensitive matching
improves separation and performance, and is probably what everyone
have being assuming was used by compilation-mode all along.
* lisp/progmodes/compile.el (compilation-error-case-fold-search): New.
(compilation-parse-errors): Bind case-fold-search to
compilation-error-case-fold-search during matching.
* etc/NEWS: Announce.
Paul Eggert [Wed, 25 Mar 2020 20:39:21 +0000 (13:39 -0700)]
Update from gnulib
This incorporates:
2020-03-25 getopt-posix: port __GETOPT_PREFIX to macOS
2020-03-22 acl-permissions: Improve autoconf macro
* lib/getopt-pfx-core.h, m4/acl.m4: Copy from Gnulib.
Stefan Monnier [Wed, 25 Mar 2020 18:09:48 +0000 (14:09 -0400)]
* lisp/textmodes/conf-mode.el (conf-mode): Fix last change
`delay-mode-hooks` cannot be tested from within `define-derived-mode`
because it's always non-nil in there, so arrange to test it before we
enter the body.
Eli Zaretskii [Wed, 25 Mar 2020 14:18:37 +0000 (16:18 +0200)]
Improve the UI of 'list-timers'
* lisp/emacs-lisp/timer-list.el (list-timers): Display both "Next"
and "Repeat" in units of seconds, for consistency.
(timer-list-mode): Add help-echo to column headers.
Juri Linkov [Tue, 24 Mar 2020 21:58:01 +0000 (23:58 +0200)]
Rename dired-mark-region choices and ignore empty region.
* lisp/dired.el (dired-mark-region): Rename choices
'exclusive' to 'file', and 'inclusive' to 'line'.
(dired-mark-if, dired-mark): Check for non-empty region explicitly
instead of using use-region-p to ignore non-nil value of
use-empty-active-region. (Bug#39902)
Philip K [Tue, 17 Mar 2020 14:29:53 +0000 (15:29 +0100)]
Add support for multiple Gravatar services
Now supports Libravatar and Unicornify, next to Gravatar (Bug#39965).
* lisp/image/gravatar.el (gravatar-base-url): Remove constant.
(gravatar-service-alist): List supported services.
(gravatar-service): Add user option to specify service, defaults to
Libravatar.
(gravatar--service-libravatar): New function, libravatar image host
resolver implementation.
(gravatar-build-url): Use alist gravatar-service-alist instead of
gravatar-base-url.
* etc/NEWS: Mention new gravatar service option.
Don't add repeated xlmns:xlink declarations in svg-create
* lisp/svg.el (svg-create): Fix previous unconditional addition of
the xmlns:xlink declaration -- callers may already add one, and
having it twice is something most svg libraries doesn't like.
Don't add repeated xlmns:xlink declarations in svg-create
* lisp/svg.el (svg-create): Fix previous unconditional addition of
the xmlns:xlink declaration -- callers may already add one, and
having it twice is something most svg libraries doesn't like.
Eli Zaretskii [Mon, 23 Mar 2020 14:37:27 +0000 (16:37 +0200)]
Don't build the Gnulib 'utimens' module on MinGW
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_utimens): Omit the
'utimens' module in the MinGW build: 'utimens' is not used by
Emacs, and 'fdutimens' is implemented in w32.c.
Noam Postavsky [Fri, 20 Mar 2020 08:07:39 +0000 (04:07 -0400)]
Don't signal during backtrace unrewind (Bug#40088)
backtrace_eval_unrewind is used to temporarily reverse
let-bindings (it's called with a positive argument to reverse
bindings, and then a negative argument to re-apply them) by
backtrace--locals and backtrace-eval. For the SPECPDL_LET_DEFAULT and
SPECPDL_LET_LOCAL cases (which occur for let-bindings on buffer-local
variables), the code calls Fdefault_value and Fbuffer_local_value on
the symbol.
For symbols which are unbound at top-level, the first (with positive
argument) call to backtrace_eval_unrewind will set the symbol's value
to unbound (putting the current value in the specpdl's "old value"
slot). On the second (with negative argument) call,
backtrace_eval_unrewind attempts to retrieve the symbol's value with
Fdefault_value or Fbuffer_local_value, but that raises a void-variable
signal. This interrupts the restoration of the let-bindings, so any
other variables more recent on the stack will now have the wrong
value.
* src/data.c (default_value): Make non-static.
* src/lisp.h: Declare it.
* src/eval.c (backtrace_eval_unrewind): Replace the calls to
Fdefault_value and Fbuffer_local_value with default_value and
buffer_local_value, respectively. The latter do exactly the same as
the former, except if the symbol's value is Qunbound they just return
it instead of signaling void-variable.
Noam Postavsky [Fri, 20 Mar 2020 10:00:11 +0000 (06:00 -0400)]
Fix a couple of problems in changelog generating functions
* lisp/vc/diff-mode.el (diff-add-log-current-defuns): If there is a
scan-error when calling end-of-defun, go to end of hunk. This can
easily happen since we are calling end-of-defun on a partial code
fragment from a diff.
* lisp/vc/log-edit.el (log-edit-generate-changelog-from-diff): Bind
display-buffer-overriding-action around the log-edit-show-diff call
only. Otherwise, it can affect, for example, debugger windows
triggered by the diff-add-log-current-defuns call.