Refactor package--list-loaded-files for easier debuggability
* lisp/emacs-lisp/package.el (package--files-load-history)
(package--list-of-conflicts): Factor out from...
(package--list-loaded-files): ... this function for easier
debuggability.
Glenn Morris [Fri, 25 Dec 2020 18:36:48 +0000 (10:36 -0800)]
Merge from origin/emacs-27
5d46593568 Support build of Emacs on ARM Macos machines 7f8793e5f1 Update to Org 9.4.4 7b3367a0b5 * lisp/so-long.el: Decrease use of passive voice. a90836c638 * doc/misc/efaq.texi (New in Emacs 27): Add section. 711fe70dd8 * doc/misc/efaq.texi (Latest version of Emacs): Bump version. 52b30834fb * lisp/face-remap.el (face-remap-set-base): Doc fix. (Bug... b3fe0ac62e Correct argument order in comment
Timo Myyrä [Thu, 24 Dec 2020 15:29:49 +0000 (17:29 +0200)]
Add support for more EBCDIC code pages IBM2XX
There was already charset file present in etc/charsets for IBM2XX
character sets but there wasn't definitions for them in Emacs.
Add character set and coding system definitions for them.
* lisp/language/japanese.el (ibm281, ibm290):
* lisp/language/european.el (ibm256, ibm273, ibm274, ibm277)
(ibm278, ibm280, ibm284, ibm285, ibm297):
* lisp/language/english.el (ibm275): New coding systems.
* lisp/international/mule-conf.el (ibm256, ibm273, ibm274)
(ibm275, ibm277, ibm278, ibm280, ibm281, ibm284, ibm285, ibm290)
(ibm297): New charsets.
Philipp Stephani [Fri, 25 Dec 2020 10:39:09 +0000 (11:39 +0100)]
Use posix_spawn if possible.
posix_spawn is less error-prone than vfork + execve, and can make
better use of system-specific enhancements like 'clone' on Linux. Use
it if we don't need to configure a pseudoterminal.
* src/Makefile.in (LIB_POSIX_SPAWN): New variable.
(LIBES): Use it.
* src/callproc.c (emacs_spawn): Use posix_spawn on Unix-like system if
we don't need to set up a pseudoterminal.
Philipp Stephani [Fri, 25 Dec 2020 10:33:02 +0000 (11:33 +0100)]
Import posix_spawn from Gnulib.
posix_spawn is less error-prone than vfork + exec, and can make use of
system-specific optimizations like `clone' on Linux. Import Gnulib
replacement so that we can use recent additions like
`posix_spawn_file_actions_addchdir'.
The only manual change are to admin/merge-gnulib and .gitignore. All
other changes are due to rerunning merge-gnulib.
Paul Eggert [Fri, 25 Dec 2020 09:38:31 +0000 (01:38 -0800)]
Adjust to recent Gnulib changes
The latest Gnulib merge brought in free-posix, which causes 'free'
to preserve errno. This lets us simplify some Emacs code that
calls 'free'.
* admin/merge-gnulib (GNULIB_MODULES): Add free-posix.
This module is pulled in by canonicalize-lgpl anyway,
so we might as well rely on it.
* lib-src/emacsclient.c (get_current_dir_name):
Sync better with src/sysdep.c.
* lib-src/etags.c (process_file_name, etags_mktmp):
* lib-src/update-game-score.c (unlock_file):
* src/fileio.c (file_accessible_directory_p):
* src/sysdep.c (get_current_dir_name_or_unreachable):
Simplify by assuming that 'free' preserves errno.
* src/alloc.c (malloc_unblock_input):
Preserve errno, so that xfree preserves errno.
* src/sysdep.c (get_current_dir_name_or_unreachable):
Simplify by using strdup instead of malloc+memcpy.
No need for realloc (and the old code leaked memory anyway on
failure); just use free+malloc.
Paul Eggert [Fri, 25 Dec 2020 08:27:37 +0000 (00:27 -0800)]
Pacify gcc 10.2 -Wanalyzer-null-argument in gtkutil.c
* src/gtkutil.c (xg_item_label_same_p): Simplify. Without this
simplification, GCC (Ubuntu 10.2.0-13ubuntu1)
-Wanalyzer-null-argument complains about use of NULL where
non-null expected as argument of strcmp.
Eli Zaretskii [Thu, 24 Dec 2020 15:58:51 +0000 (17:58 +0200)]
Unbreak the MinGW build broken by recent changes in callproc.c
* src/w32.h (set_process_dir):
* src/w32proc.c (set_process_dir): Change the argument to 'const
char *'.
* src/lisp.h (make_environment_block):
* src/callproc.c (make_environment_block): Now returns 'char **'.
(exec_failed) [DOS_NT]: Remove unused function.
* src/callproc.c (child_setup): NEW_ARGV and ENV are now 'char **'.
Making them 'const' breaks the MinGW build and is not needed for
other platforms.
* src/callproc.c (emacs_spawn): ARGV and ENVP arguments are now
'char *', for the same reason.
* src/process.c (create_process): Adapt to above changes.
Philipp Stephani [Thu, 24 Dec 2020 14:27:45 +0000 (15:27 +0100)]
Centralize subprocess creation in a single function.
Getting the vfork + execve combination right isn't easy, and the code
was partially duplicated between callproc.c and process.c. Centralize
the spawn operation in a single function that deals with the nasty
details. Going forward, we should be able to use posix_spawn from
either libc or Gnulib (or CreateProcessW on Windows) in the non-pty
case.
* src/callproc.c (emacs_spawn): New function to start an asynchronous
subprocess. Merge code from 'call_process' and 'create_process' into
this function.
(call_process): Use new 'emacs_spawn' function.
(child_setup): Make static, since there are no users outside this
compilation unit left.
(CHILD_SETUP_TYPE): Move from header file, since there are no users
outside this compilation unit left.
* src/process.c (create_process): Use new 'emacs_spawn' function.
Alan Mackenzie [Thu, 24 Dec 2020 11:29:27 +0000 (11:29 +0000)]
CC Mode: introduce a new cache for brace structures. This fixes bug #45248
Also fix three infinite loops. The new cache accelerates backward searches
for struct beginnings in c-looking-at-or-maybe-in-bracelist.
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): In the final loop
over unary operators, add a check (> (point) lim) to avoid certain infinite
loops.
(c-beginning-of-decl-1): In the first loop add a similar check on point and
lim.
(c-laomib-loop): New function extracted from
c-looking-at-or-maybe-in-bracelist.
(c-laomib-cache): New buffer local variable.
(c-laomib-get-cache, c-laomib-put-cache, c-laomib-fix-elt)
(c-laomib-invalidate-cache): New functions which implement the cache.
(c-looking-at-or-maybe-in-bracelist): Replace two invocations of
c-go-up-list-backwards with calls to c-parse-state. Extract the new function
c-laomib-loop. Insert code which calls c-laomib-loop minimally, with the help
of the new cache.
* lisp/progmodes/cc-mode.el (c-basic-common-init): Initialise the new cach
(at mode start).
(c-before-change): Invalidate the new cache.
(c-fl-decl-start): Add an extra check (> (point) bod-lim) to prevent looping.
Determine the enclosing brace to pass as arguments to
c-looking-at-or-maybe-in-bracelist.
TEC [Wed, 23 Dec 2020 21:34:35 +0000 (22:34 +0100)]
authinfo-mode: add option to not hide any elements (and add font-lock)
* lisp/auth-source.el (authinfo-hide-elements): New user option.
(authinfo--keywords): New variable.
(authinfo-mode): Use it.
(authinfo--hide-passwords): Use doc-face instead of warning for
the passwords.
(authinfo--toggle-display): Ditto.
Adam Porter [Sun, 13 Dec 2020 05:54:28 +0000 (05:54 +0000)]
* lisp/tab-line.el: New options, faces, and functions
* lisp/tab-line.el:
(tab-line-tab-face-functions): New option.
(tab-line-tab-inactive-alternate): New face.
(tab-line-tab-special): New face.
(tab-line-tab-face-inactive-alternating): New function.
(tab-line-tab-face-special): New function.
(tab-line-format-template): Use them.
* etc/NEWS: Update.
With thanks to Juri Linkov and Eli Zaretskii for their guidance.
Philipp Stephani [Wed, 23 Dec 2020 14:55:23 +0000 (15:55 +0100)]
Allocate environment block before forking.
While 'child_setup' carefully avoids calls to async-signal-unsafe
functions like 'malloc', it seems simpler and less brittle to use
normal allocation outside the critical section between 'fork' and
'exec'.
* src/callproc.c (make_environment_block): New function to create the
environment block for subprocesses. Code largely extracted from
'child_setup' and adapted to use 'xmalloc' instead of 'alloca'.
(child_setup): Remove environment block allocation in favor of
passing the environment block as command-line argument.
(call_process): Adapt to new calling convention.
* src/process.c (create_process): Adapt to new calling convention.
Juri Linkov [Wed, 23 Dec 2020 09:30:04 +0000 (11:30 +0200)]
Show image as text when trying to search/replace in image buffer (bug#25905)
* lisp/image-mode.el (image-mode-isearch-filter): New function.
(image-mode--setup-mode): Use it to add it as :before-while to
isearch-filter-predicate.
Eric Abrahamsen [Sun, 20 Dec 2020 19:26:37 +0000 (11:26 -0800)]
Ensure that Gnus servers are open(able) before searching them
* lisp/gnus/gnus-search.el (gnus-search-run-search): Imap servers need
to be opened (made into the "current server") before we manipulate the
nnimap-buffer.
(gnus-search-run-search): Sneakily fix regexp.
(gnus-search-indexed-parse-output): We need to pass the server name in
here, otherwise nnmaildir won't know how to make this the "current
server".
Alan Mackenzie [Tue, 22 Dec 2020 12:06:21 +0000 (12:06 +0000)]
Re-order the items in `profiler-report' output.
Putting the usage figures first on the line will eliminate the truncation of
function names.
lisp/profiler.el (profiler-version): Change to "28.1".
(profiler-format): Enhance, so that a width of zero means print the string
without padding or truncation.
(profiler-report-cpu-line-format, profiler-report-memory-line-format): Amend
for the new layout. The number of places for the cpu samples has been reduced
from 19 to 12 (enough for ~30 years at 1,000 samples per second).
(profiler-report-line-format, profiler-report-describe-entry): Amend for the
new order of arguments to profiler-format.
etc/NEWS (Specialized Modes): Add an entry documenting this change.
doc/lispref/debugging.texi (Profiling): Describe the new ordering of the items
in place of the old ordering.
Daniel Martín [Tue, 22 Dec 2020 06:36:41 +0000 (07:36 +0100)]
Fix wdired-get-filename when ls -F marks symlinks
* lisp/wdired.el (wdired-get-filename): In some systems like BSD or
macOS, "ls -F" marks symlinks with a trailing "@". Add logic
accounting for this so that wdired-get-filename returns the correct
filename. This change also fixes test "wdired-test-bug34915" on macOS
and BSD systems (bug#34915).
Eli Zaretskii [Mon, 21 Dec 2020 17:27:02 +0000 (19:27 +0200)]
Fix frame creation on X when tool bar is disabled
* src/xterm.c (handle_one_xevent): Restrict the fix for bug#44002
to situations when we are asked by the WM to create a window with
bogus 1x1 dimensions. (Bug#44794)
Make python-mode fontify more assignment statements
* lisp/progmodes/python.el (python-font-lock-assignment-matcher): New
function to match assignment statements.
(python-rx): Add `assignment-target' and `grouped-assignment-target'.
(python-font-lock-keywords-maximum-decoration): Add new matchers
(bug#45341).
Dmitry Gutov [Mon, 21 Dec 2020 01:38:37 +0000 (03:38 +0200)]
Generic-ify xref-location-column
* lisp/progmodes/xref.el (xref-location-column):
Create a generic from xref-file-location-column, to use in the
common rendering code (bug#36967).
(xref--insert-xrefs): Update accordingly.
Juri Linkov [Mon, 21 Dec 2020 01:22:23 +0000 (03:22 +0200)]
De-duplicate lines in Xref buffers
* lisp/progmodes/xref.el (xref--insert-xrefs):
Render matches coming from the same line together (bug#36967).
(xref--item-at-point): Account for the above.
Give get-buffer-create an optional argument to inhibit buffer hooks
in internal or temporary buffers for efficiency (bug#34765).
* etc/NEWS: Announce new parameter of get-buffer-create and
generate-new-buffer, and that with-temp-buffer and with-temp-file
now inhibit buffer hooks.
* doc/lispref/buffers.texi (Buffer Names): Fix typo.
(Creating Buffers): Document new parameter of get-buffer-create and
generate-new-buffer.
(Buffer List, Killing Buffers): Document when buffer hooks are
inhibited.
(Current Buffer):
* doc/lispref/files.texi (Writing to Files): Document that
with-temp-buffer and with-temp-file inhibit buffer hooks.
* doc/lispref/internals.texi (Buffer Internals): Document
inhibit_buffer_hooks flag. Remove stale comment.
* doc/misc/gnus-faq.texi (FAQ 5-8):
* lisp/simple.el (shell-command-on-region): Fix indentation.
* lisp/subr.el (generate-new-buffer): Forward new optional argument
to inhibit buffer hooks to get-buffer-create.
(with-temp-file, with-temp-buffer, with-output-to-string):
* lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer
used.
* src/buffer.c (run_buffer_list_update_hook): New helper function.
(Fget_buffer_create): Use it. Add optional argument to set
inhibit_buffer_hooks flag instead of comparing the buffer name to
Vcode_conversion_workbuf_name. All callers changed.
(Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal)
(record_buffer): Use run_buffer_list_update_hook.
(Fkill_buffer): Document when buffer hooks are inhibited. Use
run_buffer_list_update_hook.
(init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer.
(Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document
when hooks are inhibited.
* src/buffer.h (struct buffer): Update inhibit_buffer_hooks
commentary.
* src/coding.h (Vcode_conversion_workbuf_name):
* src/coding.c (Vcode_conversion_workbuf_name): Make static again
since it is no longer needed in src/buffer.c.
(code_conversion_restore, code_conversion_save, syms_of_coding):
Prefer boolean over integer constants.
* src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in
" *code-converting-work*" buffer.
* src/window.c (Fselect_window): Fix grammar. Mention
window-selection-change-functions alongside buffer-list-update-hook.
* test/src/buffer-tests.el: Fix requires.
(buffer-tests-inhibit-buffer-hooks): New test.
Juri Linkov [Sat, 19 Dec 2020 20:19:18 +0000 (22:19 +0200)]
* lisp/image-mode.el: Use one timer and lock for slow remote calls (bug#45256)
* lisp/image-mode.el (image-auto-resize-timer): New variable.
(image--window-state-change): Cancel previous timer and
remember new timer in image-auto-resize-timer.
(image--window-state-change): New variable.
(image-fit-to-window): When image-fit-to-window-lock is nil,
call image-toggle-display-image ignoring 'remote-file-error'.