]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoRevert "Revert "Use posix_spawn if possible."" scratch/posix-spawn
Philipp Stephani [Sat, 26 Dec 2020 11:20:51 +0000 (12:20 +0100)]
Revert "Revert "Use posix_spawn if possible.""

This reverts commit e387371497d313f05b94e3bf42fe6685184605d1.

3 years agoRevert "Revert "Import posix_spawn from Gnulib.""
Philipp Stephani [Sat, 26 Dec 2020 11:19:50 +0000 (12:19 +0100)]
Revert "Revert "Import posix_spawn from Gnulib.""

This reverts commit ecf84a22ee002112c265b028263f1db81e3271e1.

3 years agoAvoid missing email messages due to rmail-spam-filter
emacs-f [Tue, 8 Dec 2020 23:22:30 +0000 (18:22 -0500)]
Avoid missing email messages due to rmail-spam-filter

* lisp/mail/rmail-spam-filter.el (rsf--rmail-last-seen-message):
New function.
(rmail-spam-filter, rmail-get-new-mail-filter-spam): Call
'rsf--rmail-last-seen-message' instead of
'rmail-first-unseen-message'.  (Bug#45128)

Copyright-paperwork-exempt: yes

3 years agoImprovements for `:base-uri' svg image property
Zajcev Evgeny [Wed, 16 Dec 2020 22:04:09 +0000 (01:04 +0300)]
Improvements for `:base-uri' svg image property

* src/image.c (svg_load): Use ENCODE_FILE for `:base-uri'

* doc/lispref/display.texi (SVG Images): Add more documentation for
  `:base-uri'

3 years agoFix messages with plural forms in todo-mode.el
Eli Zaretskii [Sat, 26 Dec 2020 08:23:04 +0000 (10:23 +0200)]
Fix messages with plural forms in todo-mode.el

* lisp/calendar/todo-mode.el (todo-move-item, todo-item-undone)
(todo-category-completions): Use 'ngettext' instead of hard-coding
plural forms by hand.

4 years agoFix issues with lib/malloc out-of-dir builds
Paul Eggert [Sat, 26 Dec 2020 03:16:27 +0000 (19:16 -0800)]
Fix issues with lib/malloc out-of-dir builds

Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2020-12/msg01626.html
* configure.ac: If the scratch_buffer module is enabled, create
lib/malloc and (if doing dependencies) lib/deps/malloc.
* lib/Makefile.in (DEPFLAGS) [AUTO_DEPEND]: No longer any need to
squash lib dependencies into a single directory.
(clean): Also remove */*.o and $(DEPDIR)/*/*.d, to clean out
malloc/*.o and deps/malloc/*.d.  Just remove *.d files in
dependencies so that rm does not complain about not being able to
remove deps/malloc.
(extraclean): Also remove malloc, if it is empty.

4 years agoKill the scdaemon after doing the mml-sec tests
Lars Ingebrigtsen [Sat, 26 Dec 2020 02:59:35 +0000 (03:59 +0100)]
Kill the scdaemon after doing the mml-sec tests

* test/lisp/gnus/mml-sec-tests.el (mml-sec-test--kill-gpg-agent):
Kill the scdaemon, too (bug#43358).

4 years agoFix infloop in memory-report
Lars Ingebrigtsen [Fri, 25 Dec 2020 23:57:01 +0000 (00:57 +0100)]
Fix infloop in memory-report

* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1):
Fix infloop on circular lists.

4 years agoFix package reloading problems on systems with symlinks
Lars Ingebrigtsen [Fri, 25 Dec 2020 21:44:56 +0000 (22:44 +0100)]
Fix package reloading problems on systems with symlinks

* lisp/emacs-lisp/package.el (package--files-load-history): We're
comparing the truenames, so ensure that we've using that
everywhere.  This fixes problems when there's symlinks in the paths.

4 years agoRefactor package--list-loaded-files for easier debuggability
Lars Ingebrigtsen [Fri, 25 Dec 2020 21:29:42 +0000 (22:29 +0100)]
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.

4 years agoDisable some semantic tests on systems without g++
Lars Ingebrigtsen [Fri, 25 Dec 2020 20:19:37 +0000 (21:19 +0100)]
Disable some semantic tests on systems without g++

* test/lisp/cedet/semantic-utest-ia.el: Disable g++ tests on
systems without g++.

4 years agoSkip some mml tests that rely on CMS if that's not installed
Lars Ingebrigtsen [Fri, 25 Dec 2020 20:09:31 +0000 (21:09 +0100)]
Skip some mml tests that rely on CMS if that's not installed

4 years agoFix gpg-agent killing in mml-sec-tests
Lars Ingebrigtsen [Fri, 25 Dec 2020 19:56:22 +0000 (20:56 +0100)]
Fix gpg-agent killing in mml-sec-tests

* test/lisp/gnus/mml-sec-tests.el (mml-sec-test--kill-gpg-agent):
Identify the gpg-agent more successfully after the resource dir
makeover.

4 years agoMerge from origin/emacs-27
Glenn Morris [Fri, 25 Dec 2020 18:36:48 +0000 (10:36 -0800)]
Merge from origin/emacs-27

b242bbb073 (origin/emacs-27) ; lisp/org/org.el: Fix Version header.
e0fc939c5f Add more details to the "word processor" section
fda9b3e83a * src/Makefile.in (DO_CODESIGN): Fix expected architecture...

4 years ago; Merge from origin/emacs-27
Glenn Morris [Fri, 25 Dec 2020 18:36:48 +0000 (10:36 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

6bf22c933d Codesign the executable on recene MacOS systems

4 years agoMerge from origin/emacs-27
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

4 years ago; lisp/org/org.el: Fix Version header.
Glenn Morris [Fri, 25 Dec 2020 18:36:25 +0000 (10:36 -0800)]
; lisp/org/org.el: Fix Version header.

This is flagged by the single org test that exists in Emacs.

4 years agoTag another Tramp test :unstable on emba
Michael Albinus [Fri, 25 Dec 2020 17:45:29 +0000 (18:45 +0100)]
Tag another Tramp test :unstable on emba

* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process)
(tramp-test43-asynchronous-requests): Tag them :unstable on emba.

4 years agoTag Tramp test :unstable
Michael Albinus [Fri, 25 Dec 2020 16:05:36 +0000 (17:05 +0100)]
Tag Tramp test :unstable

* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):
Tag it :unstable on emba.

4 years ago; * etc/NEWS: Announce the last change.
Eli Zaretskii [Fri, 25 Dec 2020 14:11:49 +0000 (16:11 +0200)]
; * etc/NEWS: Announce the last change.

4 years agoFix last change
Eli Zaretskii [Fri, 25 Dec 2020 13:58:15 +0000 (15:58 +0200)]
Fix last change

* lisp/international/mule-conf.el (ebcdic-int1, cp256, cp273)
(ebcdic-be, cp274, ebcdic-br, cp275, ebcdic-cp-dk, ebcdic-cp-no)
(cp277, ebcdic-cp-fi, ebcdic-cp-se, cp278, ebcdic-cp-it, cp280)
(ebcdic-jp-e, cp281, ebcdic-cp-es, cp284, ebcdic-cp-gb, cp285)
(ebcdic-jp-kana, cp290, ebcdic-cp-fr, cp297): Remove charset
aliases, they are not really needed.

* lisp/language/english.el (ibm275): Move from here...
* lisp/language/european.el (ibm275): ...to here.

4 years agoAdd support for more EBCDIC code pages IBM2XX
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.

4 years agoDon't compile Gnulib's 'free' on MinGW
Eli Zaretskii [Fri, 25 Dec 2020 13:17:19 +0000 (15:17 +0200)]
Don't compile Gnulib's 'free' on MinGW

* nt/mingw-cfg.site (gl_cv_func_free_preserves_errno): Set to
"yes" to avoid compiling Gnulib's free.c in the MinGW build.

4 years agoRevert "Import posix_spawn from Gnulib."
Eli Zaretskii [Fri, 25 Dec 2020 12:51:20 +0000 (14:51 +0200)]
Revert "Import posix_spawn from Gnulib."

This reverts commit 3ba34141da77a24c251ee6530f3f72a366fe556e.
It breaks the MinGW build and should be first tested on a
branch.

4 years agoRevert "Use posix_spawn if possible."
Eli Zaretskii [Fri, 25 Dec 2020 12:50:25 +0000 (14:50 +0200)]
Revert "Use posix_spawn if possible."

This reverts commit 2c79a8f9210db01c86b0e5f236adeb0509519d30.
It breaks the MinGW build in too many ways, and should be
first tested on a branch.

4 years agoUse posix_spawn if possible.
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.

4 years agoImport posix_spawn from Gnulib.
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.

* admin/merge-gnulib (GNULIB_MODULES): Add posix_spawn-related
modules.
* .gitignore: Add new generated files.

4 years agoUpdate Gnulib.
Paul Eggert [Fri, 25 Dec 2020 10:33:29 +0000 (02:33 -0800)]
Update Gnulib.

All changes in this commit are autogenerated by running
admin/merge-gnulib.

4 years agoAdjust test_module to recent Gnulib changes
Paul Eggert [Fri, 25 Dec 2020 10:15:45 +0000 (02:15 -0800)]
Adjust test_module to recent Gnulib changes

* test/Makefile.in ($(test_module)): Also compile lib/free.c
if it is needed to define rpl_free.

4 years agoAdjust to recent Gnulib changes
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.

4 years agoPacify gcc 10.2 -Wanalyzer-null-argument in gtkutil.c
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.

4 years agoAdd more details to the "word processor" section
Eli Zaretskii [Fri, 25 Dec 2020 08:30:02 +0000 (10:30 +0200)]
Add more details to the "word processor" section

* etc/TODO (Emacs as word processor): Add more details based on
recent discussions.

4 years agocperl-mode: Correctly syntax highlight index/value array slices
E. Choroba [Fri, 25 Dec 2020 06:02:01 +0000 (07:02 +0100)]
cperl-mode: Correctly syntax highlight index/value array slices

* lisp/progmodes/cperl-mode.el (cperl-init-faces): %array[0, 1]
should use the array face, not the hash one (bug#45373).

Copyright-paperwork-exempt: yes

4 years agoMake `remove-hook' interactive
Thibault Polge [Fri, 25 Dec 2020 05:44:40 +0000 (06:44 +0100)]
Make `remove-hook' interactive

* lisp/subr.el (remove-hook): Make `remove-hook' interactive
(bug#45393).

4 years agoAllow `string-limit' to work on encoded strings
Lars Ingebrigtsen [Fri, 25 Dec 2020 04:58:09 +0000 (05:58 +0100)]
Allow `string-limit' to work on encoded strings

* doc/lispref/strings.texi (Creating Strings): Document it.

* lisp/emacs-lisp/subr-x.el (string-limit): Allow limiting on
encoded strings.

4 years agoRemove `string-slice' -- it's not very well defined
Lars Ingebrigtsen [Fri, 25 Dec 2020 04:16:46 +0000 (05:16 +0100)]
Remove `string-slice' -- it's not very well defined

* doc/lispref/strings.texi (Creating Strings): Ditto.

* lisp/emacs-lisp/subr-x.el (string-slice): Remove.

4 years agoUnbreak the build on *BSD and Macos after previous gnulib merge
Lars Ingebrigtsen [Thu, 24 Dec 2020 17:42:27 +0000 (18:42 +0100)]
Unbreak the build on *BSD and Macos after previous gnulib merge

* lib/Makefile.in (DEPFLAGS): Unbreak build on BSD derivatives by
writing all deps files into a single directory (instead of
deps/malloc/*.c).

4 years ago; * src/callproc.c (emacs_spawn) [!WINDOWSNT]: Fix last change.
Eli Zaretskii [Thu, 24 Dec 2020 16:32:54 +0000 (18:32 +0200)]
; * src/callproc.c (emacs_spawn) [!WINDOWSNT]: Fix last change.

4 years agoFix the MinGW build broken by Gnulib update
Eli Zaretskii [Thu, 24 Dec 2020 16:17:57 +0000 (18:17 +0200)]
Fix the MinGW build broken by Gnulib update

* nt/mingw-cfg.site (gl_cv_func_readlink_trailing_slash)
(gl_cv_func_readlink_truncate): Define to "yes" to avoid compiling
readlink.c.

4 years agoUnbreak the MinGW build broken by recent changes in callproc.c
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.

4 years agoUpdate Gnulib.
Philipp Stephani [Thu, 24 Dec 2020 15:48:40 +0000 (16:48 +0100)]
Update Gnulib.

All changes in this commit are autogenerated by running
admin/merge-gnulib.

4 years agoEnsure that Gnulib objects in subdirectories are built correctly.
Philipp Stephani [Thu, 24 Dec 2020 15:30:53 +0000 (16:30 +0100)]
Ensure that Gnulib objects in subdirectories are built correctly.

* lib/Makefile.in (.c.o): Add missing -o option.

4 years agoCentralize subprocess creation in a single function.
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.

4 years agoCC Mode: introduce a new cache for brace structures. This fixes bug #45248
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.

4 years ago* src/dispnew.c (sit_for): Fix bug#45292
Stefan Monnier [Wed, 23 Dec 2020 23:31:28 +0000 (18:31 -0500)]
* src/dispnew.c (sit_for): Fix bug#45292

When reading, prefer staying in the selected-window over preserving
the current-buffer.

4 years ago* lisp/emacs-lisp/lisp-mnt.el (lm-section-end): Stop at the right heading
Stefan Monnier [Mon, 21 Dec 2020 04:21:51 +0000 (23:21 -0500)]
* lisp/emacs-lisp/lisp-mnt.el (lm-section-end): Stop at the right heading

`lisp-outline-level` assumes the match-data is that set by
`outline-regexp`.

4 years agoauthinfo-mode: add option to not hide any elements (and add font-lock)
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.

4 years ago* lisp/tab-line.el: New options, faces, and functions
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.

4 years ago* src/Makefile.in (DO_CODESIGN): Fix expected architecture name.
Philipp Stephani [Wed, 23 Dec 2020 18:15:56 +0000 (19:15 +0100)]
* src/Makefile.in (DO_CODESIGN): Fix expected architecture name.

4 years agoDeclare argument vector as char *const *.
Philipp Stephani [Wed, 23 Dec 2020 16:40:18 +0000 (17:40 +0100)]
Declare argument vector as char *const *.

This matches the signature of execve.

* src/callproc.c (child_setup): Declare NEW_ARGV as char *const *.

4 years ago* .clang-format (ColumnLimit): Fix line length.
Philipp Stephani [Wed, 23 Dec 2020 16:34:26 +0000 (17:34 +0100)]
* .clang-format (ColumnLimit): Fix line length.

4 years agoCodesign the executable on recene MacOS systems
Itai Seggev [Tue, 24 Nov 2020 05:52:27 +0000 (06:52 +0100)]
Codesign the executable on recene MacOS systems

* src/Makefile.in (temacs$(EXEEXT)): Codesign the executable on
recent (ARM) MacOS systems (bug#43878).  Without this, building
Emacs fails.

Copyright-paperwork-exempt: yes

4 years agoSupport build of Emacs on ARM Macos machines
Lars Ingebrigtsen [Mon, 14 Sep 2020 10:34:56 +0000 (12:34 +0200)]
Support build of Emacs on ARM Macos machines

* configure.ac: Add support for aarch64-* on Macos (i.e., 64-bit
ARM) (bug#43369).

4 years agoPass C string pointer to current directory to 'child_setup'.
Philipp Stephani [Wed, 23 Dec 2020 15:26:57 +0000 (16:26 +0100)]
Pass C string pointer to current directory to 'child_setup'.

This avoids the impression that 'child_setup' could do anything
Lisp-related.

* src/callproc.c (child_setup): Pass C pointer to current directory
name.
(call_process): Adapt callers.

* src/process.c (create_process): Adapt callers.

4 years agoAllocate environment block before forking.
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.

4 years agoReject filenames containing NUL bytes.
Philipp Stephani [Wed, 23 Dec 2020 11:00:46 +0000 (12:00 +0100)]
Reject filenames containing NUL bytes.

Such filenames are dangerous, as Emacs would silently only use the
part up to the first NUL byte.  Reject them explicitly instead.

* src/coding.c (encode_file_name_1): New helper function.
(encode_file_name): Check that encoded filename doesn't contain a
NUL byte.
(syms_of_coding): Define 'filenamep' symbol.

* test/src/fileio-tests.el (fileio-tests/null-character): New unit
test.

* etc/NEWS: Document change.

4 years agoRemove an unused parameter from 'child_setup' function.
Philipp Stephani [Wed, 23 Dec 2020 10:43:37 +0000 (11:43 +0100)]
Remove an unused parameter from 'child_setup' function.

* src/callproc.c (child_setup): Remove unused SET_PGRP parameter.

* src/callproc.c (call_process):
* src/process.c (create_process): Fix all callers.

4 years agoShow image as text when trying to search/replace in image buffer (bug#25905)
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.

4 years agoImprove the string-limit doc string
Lars Ingebrigtsen [Wed, 23 Dec 2020 06:59:24 +0000 (07:59 +0100)]
Improve the string-limit doc string

* lisp/emacs-lisp/subr-x.el (string-limit): Mention
truncate-string-to-width in the doc string.

4 years agoAllow string-slice to take zero-length matches
Lars Ingebrigtsen [Wed, 23 Dec 2020 06:45:19 +0000 (07:45 +0100)]
Allow string-slice to take zero-length matches

* lisp/emacs-lisp/subr-x.el (string-slice): Allow zero-length
matches.  Code adapted from s.el by Magnar Sveen.

4 years agoRevert recent server.el frame-focus changes
Lars Ingebrigtsen [Wed, 23 Dec 2020 05:58:12 +0000 (06:58 +0100)]
Revert recent server.el frame-focus changes

* lisp/server.el (server-switch-buffer, server-execute): Revert
9cef8fc8cdb5e6e18c9cf617eed3808d67ca340e and
c5f2eb56c0164e87abc881955552e0b718921186.  This change led to
regressions in non-new-frame circumstances.

4 years agoHandle gracefully href="" in base tags in shr
Łukasz Stelmach [Tue, 22 Dec 2020 06:47:23 +0000 (07:47 +0100)]
Handle gracefully href="" in base tags in shr

* net/shr.el (shr-tag-base): shr-parse-base can't handle empty
strings gracefully.  Don't call it unless href is a non-empty
string (bug#45355).

4 years agoFix use of obsolete 'emergency' warning level
Stefan Kangas [Wed, 23 Dec 2020 04:16:02 +0000 (05:16 +0100)]
Fix use of obsolete 'emergency' warning level

* src/alloc.c (display_malloc_warning): Use new style ':emergency'
warning level instead of obsolete 'emergency'.

4 years agoFix use of obsolete 'error' warning level
Zajcev Evgeny [Tue, 22 Dec 2020 14:37:38 +0000 (17:37 +0300)]
Fix use of obsolete 'error' warning level

* src/fileio.c (auto_save_error): Use new style ':error' warning level
instead of obsolete 'error'.

4 years agoUse new NSString lisp methods
Alan Third [Tue, 22 Dec 2020 23:28:25 +0000 (23:28 +0000)]
Use new NSString lisp methods

* src/nsfont.m (ns_otf_to_script):
(ns_registry_to_script):
(ns_get_req_script): Use NSString conversion methods.
* src/nsimage.m ([EmacsImage allocInitFromFile:]): Use NSString
conversion methods.
* src/nsmenu.m (ns_menu_show): Use NSString conversion methods.
* src/nsselect.m (symbol_to_nsstring):
(ns_string_to_pasteboard_internal): Use NSString conversion methods.
* src/nsterm.m (ns_term_init):
([EmacsView initFrameFromEmacs:]): Use NSString conversion methods.
* src/nsxwidget.m (nsxwidget_webkit_uri):
(nsxwidget_webkit_title):
(js_to_lisp): Use NSString conversion methods.
(build_string_with_nsstr): Functionality replaced by NSString
extensions.

4 years agoAlign the word "Function" in profiler's headers over the actual functions
Alan Mackenzie [Tue, 22 Dec 2020 18:34:24 +0000 (18:34 +0000)]
Align the word "Function" in profiler's headers over the actual functions

* lisp/profiler.el (profiler-report-render-calltree-1): Replace two
occurrences of "Function" with "  Function".

4 years agoEnsure that Gnus servers are open(able) before searching them
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".

4 years agoAlign profiler's header-line-format to column 0, to work correctly on tty's
Alan Mackenzie [Tue, 22 Dec 2020 16:57:46 +0000 (16:57 +0000)]
Align profiler's header-line-format to column 0, to work correctly on tty's

* lisp/profiler.el (profiler-report-header-line-format): Propertize the first
space with 'display '(space :align-to 0).

4 years agoRe-order the items in `profiler-report' output.
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.

4 years agoReorganize Tramp header lines
Michael Albinus [Tue, 22 Dec 2020 11:13:37 +0000 (12:13 +0100)]
Reorganize Tramp header lines

* lisp/net/tramp.el: Move header lines Version, Package-Requires,
Package-Type and URL ...
* lisp/net/trampver.el: ... here.

4 years agoUpdate to Org 9.4.4
Bastien Guerry [Tue, 22 Dec 2020 09:29:37 +0000 (10:29 +0100)]
Update to Org 9.4.4

4 years ago; Fix docstrings in last change to subr-x.el
Basil L. Contovounesios [Tue, 22 Dec 2020 09:01:47 +0000 (09:01 +0000)]
; Fix docstrings in last change to subr-x.el

4 years agoFix wdired-get-filename when ls -F marks symlinks
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).

4 years agoMake string-pad take an optional START parameter
Lars Ingebrigtsen [Tue, 22 Dec 2020 05:59:25 +0000 (06:59 +0100)]
Make string-pad take an optional START parameter

* lisp/emacs-lisp/subr-x.el (string-pad): Alter the calling
convention.

4 years agoChange the string-limit parameter semantics
Lars Ingebrigtsen [Tue, 22 Dec 2020 05:54:32 +0000 (06:54 +0100)]
Change the string-limit parameter semantics

* lisp/emacs-lisp/subr-x.el (string-limit): Alter the calling
convention.

4 years agoFurther string-clean-whitespace tweaks
Lars Ingebrigtsen [Tue, 22 Dec 2020 03:24:25 +0000 (04:24 +0100)]
Further string-clean-whitespace tweaks

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Put \r
back, which was mistakenly removed.

4 years ago(ruby-mode-set-encoding): Use 'save-restriction'
Dmitry Gutov [Tue, 22 Dec 2020 01:15:45 +0000 (03:15 +0200)]
(ruby-mode-set-encoding): Use 'save-restriction'

* lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding):
Use 'save-restriction' (bug#45349).

4 years agoTiny string-clean-whitespace simplification
Basil L. Contovounesios [Mon, 21 Dec 2020 22:34:33 +0000 (22:34 +0000)]
Tiny string-clean-whitespace simplification

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Streamline by
treating replacement string as being literal and having fixed case.

4 years agoMake string-chop-newline more efficient
Lars Ingebrigtsen [Mon, 21 Dec 2020 22:18:05 +0000 (23:18 +0100)]
Make string-chop-newline more efficient

* lisp/emacs-lisp/subr-x.el (string-chop-newline): Make more
efficient.

4 years agoMake string-clean-whitespace work on non-ASCII whitespace, too
Lars Ingebrigtsen [Mon, 21 Dec 2020 21:41:37 +0000 (22:41 +0100)]
Make string-clean-whitespace work on non-ASCII whitespace, too

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Also clean
up non-ASCII whitespace.

4 years agoAdd try-completion to the string shortdoc
Lars Ingebrigtsen [Mon, 21 Dec 2020 21:08:56 +0000 (22:08 +0100)]
Add try-completion to the string shortdoc

* lisp/emacs-lisp/shortdoc.el (string): Mention try-completion here.

4 years agoAdd string-chop-newline
Lars Ingebrigtsen [Mon, 21 Dec 2020 21:05:37 +0000 (22:05 +0100)]
Add string-chop-newline

* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/subr-x.el (string-chop-newline): Add new function.

4 years ago; Fix recent string utility additions
Basil L. Contovounesios [Mon, 21 Dec 2020 20:40:12 +0000 (20:40 +0000)]
; Fix recent string utility additions

* etc/NEWS: Fix typo.
* lisp/emacs-lisp/subr-x.el (string-limit): Fix typos in docstring.
Simplify.
(string-slice): Improve docstring wording.
(string-pad): Simplify.

4 years agoFix shorter-than-length case for string-limit
Lars Ingebrigtsen [Mon, 21 Dec 2020 19:42:17 +0000 (20:42 +0100)]
Fix shorter-than-length case for string-limit

* lisp/emacs-lisp/subr-x.el (string-limit): Fix
shorter-than-length case.

4 years agoRename slice-string to string-slice
Lars Ingebrigtsen [Mon, 21 Dec 2020 19:18:57 +0000 (20:18 +0100)]
Rename slice-string to string-slice

* lisp/emacs-lisp/subr-x.el (string-slice): Rename from slice-string.
* doc/lispref/strings.texi (Creating Strings): Ditto.

4 years agoAdd `string-pad'
Lars Ingebrigtsen [Mon, 21 Dec 2020 19:01:28 +0000 (20:01 +0100)]
Add `string-pad'

* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/shortdoc.el (string): Add example.

* lisp/emacs-lisp/subr-x.el (string-pad): New function.

4 years agoBeef up the Emacs string utility set a bit
Lars Ingebrigtsen [Mon, 21 Dec 2020 17:53:32 +0000 (18:53 +0100)]
Beef up the Emacs string utility set a bit

* doc/lispref/strings.texi (Modifying Strings): Document them.
* lisp/emacs-lisp/shortdoc.el (string): Add examples.

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace)
(string-fill, string-limit, string-lines, slice-string): New
functions.

4 years ago* lisp/so-long.el: Decrease use of passive voice.
Stefan Kangas [Mon, 21 Dec 2020 17:44:40 +0000 (18:44 +0100)]
* lisp/so-long.el: Decrease use of passive voice.

Suggested by Richard Stallman <rms@gnu.org>.

4 years agoFix frame creation on X when tool bar is disabled
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)

4 years agoFix permission problem in Tramp's copy-file
Michael Albinus [Mon, 21 Dec 2020 15:37:29 +0000 (16:37 +0100)]
Fix permission problem in Tramp's copy-file

* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly):
Take care of PRESERVE-UID-GID.

4 years ago* doc/misc/efaq.texi (New in Emacs 27): Add section.
Stefan Kangas [Mon, 21 Dec 2020 14:57:30 +0000 (15:57 +0100)]
* doc/misc/efaq.texi (New in Emacs 27): Add section.

4 years ago; * src/nsfns.m (all_nonzero_ascii): comment correction
Mattias Engdegård [Mon, 21 Dec 2020 10:24:46 +0000 (11:24 +0100)]
; * src/nsfns.m (all_nonzero_ascii): comment correction

4 years agoDrop XEmacs support for EDE ELisp projects
Stefan Kangas [Mon, 21 Dec 2020 15:22:42 +0000 (16:22 +0100)]
Drop XEmacs support for EDE ELisp projects

* lisp/cedet/ede/proj-elisp.el (ede-proj-target-elisp): Remove
XEmacs support.
(ede-xemacs-compiler): Make obsolete.

4 years ago* doc/misc/efaq.texi (Latest version of Emacs): Bump version.
Stefan Kangas [Mon, 21 Dec 2020 14:43:05 +0000 (15:43 +0100)]
* doc/misc/efaq.texi (Latest version of Emacs): Bump version.

4 years agoFix problem with entering Gnus groups when Gnus isn't running
Lars Ingebrigtsen [Mon, 21 Dec 2020 04:55:32 +0000 (05:55 +0100)]
Fix problem with entering Gnus groups when Gnus isn't running

* lisp/gnus/gnus-sum.el (gnus-update-summary-mark-positions):
Don't bug out when Gnus isn't running (bug#45330).

4 years agoMake python-mode fontify more assignment statements
Dario Gjorgjevski [Mon, 21 Dec 2020 04:40:38 +0000 (05:40 +0100)]
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).

4 years agoGeneric-ify xref-location-column
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.

* test/lisp/progmodes/xref-tests.el
(xref-matches-in-directory-finds-two-matches-on-the-same-line)
(xref-matches-in-directory-finds-an-empty-line-regexp-match):
Ditto.

4 years agoDe-duplicate lines in Xref buffers
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.

4 years agoUnbreak build after commit 1a0a11f7d2d1dbecb9f754b1e129d50e489058e6.
Philipp Stephani [Sun, 20 Dec 2020 23:17:56 +0000 (00:17 +0100)]
Unbreak build after commit 1a0a11f7d2d1dbecb9f754b1e129d50e489058e6.

The commit only changed a comment in 'struct buffer', so the portable
dumper doesn't need to be adapted.

* src/pdumper.c (dump_buffer): Update hash for 'struct buffer'.

4 years agoFix image cache lookup
Alan Third [Sun, 20 Dec 2020 16:03:52 +0000 (16:03 +0000)]
Fix image cache lookup

* src/image.c (lookup_image): ignore_colors should be false as we want
to search for images with matching colors.