Peter Oliver [Sat, 29 May 2021 02:15:28 +0000 (04:15 +0200)]
Rename emacs.appdata.xml to emacs.metainfo.xml and add more data
* Makefile.in: Replace "appdata" with "metainfo".
This is the name currently recommended by the spec at
<https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html>.
* etc/emacs.metainfo.xml: Populate more fields, based on those
available in
https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html
(bug#48662).
Eli Zaretskii [Fri, 28 May 2021 11:03:16 +0000 (14:03 +0300)]
Another stability fix in 'lisp_string_width'
* src/character.c (lisp_string_width): Compute C pointer to data
of STRING immediately before using it, since STRING could be
relocated by GC triggered by processing compositions. (Bug#48711)
Alex Bochannek [Thu, 27 May 2021 23:19:38 +0000 (01:19 +0200)]
Fix nnimap lexical conversion problem
* lisp/gnus/nnimap.el (nnimap-process-expiry-targets): Fix problem
introduced when converting to lexical binding -- `set' alters the
dynamic value (bug#48577).
Eli Zaretskii [Thu, 27 May 2021 13:31:14 +0000 (16:31 +0300)]
Fix resolution of symlinks during dumping
* src/comp.c (Fcomp_el_to_eln_rel_filename): Don't use
'file-truename', as it is only available once files.el is loaded,
which doesn't work during dumping, until loadup loads files.el.
Instead, use 'realpath'. (Bug#48578)
* src/w32.c (realpath): New function.
* src/w32.h (realpath): Add prototype.
* nt/mingw-cfg.site (ac_cv_func_realpath)
(gl_cv_func_realpath_works): Define to "yes", as this function is
now implemented in w32.c.
Fix lexing of numbers with trailing decimal point and exponent
Numbers with a trailing dot and an exponent were incorrectly read as
integers (with the exponent ignored) instead of the floats they should
be. For example, 1.e6 was read as the integer 1, not 1000000.0 as
every sane person would agree was meant. (Bug#48678)
Numbers with a trailing dot but no exponent are still read as
integers.
Don't propagate lexical variables into inlined functions
Functions compiled when inlined (thus from inside the optimiser)
mustn't retain the lexical environment of the caller or there will be
tears. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg01227.html .
Bug found by Stefan Monnier.
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
Bind byte-optimize--lexvars to nil when re-entering the compiler
recursively.
* test/lisp/emacs-lisp/bytecomp-resources/bc-test-alpha.el:
* test/lisp/emacs-lisp/bytecomp-resources/bc-test-beta.el: New files.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-defsubst): New test.
Eli Zaretskii [Thu, 27 May 2021 09:24:29 +0000 (12:24 +0300)]
A better fix for 'string-width'
* src/character.c (lisp_string_width): Compute the width when
automatic compositions can happen more accurately, by using the
pixel widths of the grapheme clusters, divided by the default
face's font width. Disregard the current state of
'auto-composition-mode', for consistency with 'current-column' .
Karl Fogel [Wed, 26 May 2021 19:28:11 +0000 (14:28 -0500)]
Improve some doc strings in bookmark.el
* lisp/bookmark.el (bookmark-bmenu-load): Describe prefix argument
behavior. Refer to related functions for more information.
(bookmark-bmenu-save): Likewise refer to related functions.
From: Karl Fogel
To: Eli Zaretskii Cc: Matthias Meulien, Drew Adams, Lars Ingebrigtsen,
Stefan Monnier, Emacs Devel
Subject: Re: [External] : Re: [PATCH] When deleting in bookmark menu,
prompt for confirmation.
Date: Sun, 09 May 2021 13:37:52 -0500
Message-ID: <87h7jboirj.fsf@red-bean.com>
Eli Zaretskii [Wed, 26 May 2021 17:08:47 +0000 (20:08 +0300)]
Make 'string-width' auto-composition aware
* src/composite.c (find_automatic_composition): Now extern.
(char_composable_p): Don't assume 'unicode-category-table' is
always available.
* src/composite.h (find_automatic_composition): Add prototype.
* src/character.c (lisp_string_width): Support automatic
compositions; call 'find_automatic_composition' when
'auto-composition-mode' is ON.
Filipp Gunbin [Thu, 20 May 2021 20:32:59 +0000 (23:32 +0300)]
Improve system_process_attributes on macOS (Bug#48548)
* src/sysdep.c (system_process_attributes): Fix misprint in 'tty' attr
- should be 'ttname' instead. Change 'utime', 'stime', 'time',
'majflt' attrs to obtain them from proc_pid_rusage, as sysctl call
used before doesn't give correct values; remove 'minflt' because it's
not available. Obtain 'vsize' / 'rss' / 'thcount' from proc_pidinfo.
Use sysctl with KERN_PROCARGS2 to obtain args: value contains both
argc and argv, so argv can be reliably cut out.
* lisp/files.el (dir-locals-read-from-dir): Handle syntactically
invalid .dir-locals.el files more gently (bug#48568). Give a
message instead of bugging out later.
* doc/misc/modus-themes.org:
(Overview): Document good support for cases with red-green color
deficiency (deuteranopia).
(Customization Options): Add code block with sample configuration.
(Option for mode line presentation): Document new values.
(Option for completion framework aesthetics): Reword statements.
(Option for mail citations): Include new customization.
(Option for line highlighting (hl-line-mode)): Change description
of possible value.
(Option for diff buffer looks): Update the meaning of 'fg-only',
which now is an alias for 'fg-only-deuteranopia'.
(Option for org-mode block styles): Rename possible values.
(Cycle through arbitrary colors (DIY)): Include code samples for
demo case.
(Override colors (DIY)): Use correct symbol.
(Override color saturation (DIY)): Show how to combine manual and
automatic color overrides.
(Update Org block delimiter fontification (DIY)): Provide example.
(Load theme depending on time of day): Include missing "DIY" label.
(Full support for packages or face groups): Update list with
additions, removals.
(Indirectly covered packages): Update list.
(Notes for individual packages)
(Note on dimmer.el)
(Note on display-fill-column-indicator-mode)
(Note on mmm-mode.el background colors)
(Note on prism.el)
(Note on ERC escaped color sequences)
(Note on powerline or spaceline)
(Note on Helm grep)
(Note on EWW and Elfeed fonts (SHR fonts)): Stylistic change to
the heading.
(Note on inline Latex in Org buffers)
(Note on god-mode.el): Add note.
(Frequently Asked Questions (FAQ)): Include new section.
(Acknowledgements): Update list of contributors (bug#48647).
* etc/themes/modus-operandi-theme.el: Bump version number.
* etc/themes/modus-themes.el: Add new defcustom forms and update
existing ones, edit doc strings, remove old obsolete aliases,
tweak internal functions, refine face specifications.
* etc/themes/modus-vivendi-theme.el: Bump version number.
Gregory Heytings [Tue, 25 May 2021 19:40:02 +0000 (21:40 +0200)]
Do not switch to other window when minibuffer is selected
* lisp/window.el (handle-select-window): Do not silently switch to
other window when minibuffer is selected and
mouse-autoselect-window is t (Bug#47969).
* lisp/dired-aux.el (dired-do-create-files): Preserve the return
value from `dired-create-files', which is apparently an
undocumented feature used by dired-aux-tests.el (dired-test-bug30624).
Miha Rihtaršič [Tue, 25 May 2021 19:01:58 +0000 (21:01 +0200)]
Try to not prioritise reading from lower file descriptors
* src/process.c (wait_reading_process_output): When looping through
fds, continue from where we left off.
(syms_of_process): Vprocess_prioritize_lower_fds: New variable
(bug#48118).
Stefan Monnier [Tue, 25 May 2021 17:38:05 +0000 (13:38 -0400)]
* lisp/emacs-lisp/byte-opt.el: Make the build more reproducible
(byte-compile-inline-expand): When inlining code from another file,
always inline the byte-code version of the function.
(byte-optimize--pcase): Simplify edebug spec.
Gregory Heytings [Tue, 25 May 2021 08:39:48 +0000 (10:39 +0200)]
Further improvements to completion-list-mode-map
* doc/emacs/mini.texi (Completion Commands): Mention the change,
and mention the 'n' and 'p' keys bound to 'next-completion' and
'previous-completion'. (bug#47699).
* lisp/minibuffer.el (minibuffer-local-completion-map): Change the
M-g key to M-g M-c.
* lisp/simple.el (completion-list-mode-map): Change the M-g key to
M-g M-c.
(read-expression-map): Bind M-g M-c to
read-expression-switch-to-completions.
(read-expression-switch-to-completions): New function.
Gregory Heytings [Tue, 25 May 2021 04:38:15 +0000 (06:38 +0200)]
Improve completion-list-mode-map
* doc/emacs/mini.texi (Completion Commands): Mention it.
* lisp/minibuffer.el (minibuffer-local-completion-map): Add the M-g key
for switch-to-completion (bug#47699).
* lisp/simple.el (completion-list-mode-map): Make special-mode-map its
parent, unbind the 'g' revert key, add the 'n' and 'p' keys for
next-completion and previous-completion, and the M-g key for
switch-to-minibuffer.
(switch-to-minibuffer): New function.
Gregory Heytings [Mon, 24 May 2021 22:24:57 +0000 (00:24 +0200)]
Fix bug when moving directories to trash
* lisp/files.el (move-file-to-trash): Pass the correct dir-flag to
make-temp-file so that a directory is created when a directory is
being trashed (Bug#47960).
Glenn Morris [Sun, 23 May 2021 23:03:03 +0000 (16:03 -0700)]
Tweak c-mode bug reporting address
* lisp/progmodes/cc-mode.el (c-mode-help-address):
Switch to bug-gnu-emacs. This is an alias for the previous
submit@debbugs address, except that if no Package header can be found,
as often seems to happen for cc-mode reports, debbugs will assign
the report to the "emacs" package rather than to "debbugs.gnu.org".
Philipp Stephani [Mon, 17 May 2021 19:59:57 +0000 (21:59 +0200)]
Fix find invocation for macOS (Bug#48471).
* lisp/progmodes/project.el (project--files-in-directory): Instead of
appending a slash (which doesn't work well with macOS find), remove
trailing slash and pass -H instead.
Tassilo Horn [Sat, 22 May 2021 17:06:57 +0000 (19:06 +0200)]
Document bug-reference setup for 3rd-party packages
* doc/emacs/maintaining.texi (Bug Reference): Add section explaining
adding support for third-party packages.
* lisp/progmodes/bug-reference.el (bug-reference-maybe-setup-from-vc)
(bug-reference-maybe-setup-from-mail)
(bug-reference-maybe-setup-from-irc): Rename from
bug-reference--maybe-setup-from-*, i.e., un-privatize them because
they are advertised in the docs now.
Philipp Stephani [Sat, 22 May 2021 11:29:50 +0000 (13:29 +0200)]
Give 'when-let' and 'when-let*' their own Edebug specification.
The Edebug specification of 'if-let' and 'if-let*' doesn't work if the
body is empty. While that's a pathological case, it's not wrong per
se, and could arguably happen due to macro expansion.
* lisp/emacs-lisp/subr-x.el (when-let*, when-let): Don't reuse Edebug
specification from 'if-let*' and 'if-let'.
Juri Linkov [Thu, 20 May 2021 17:51:32 +0000 (20:51 +0300)]
* lisp/international/mule-cmds.el: Use group-function in read-char-by-name.
(mule--ucs-names-group): Simplify for using by group-function.
(read-char-by-name-group): Remove defcustom
obsoleted by completions-group.
(read-char-by-name): Mention completions-group and
completions-group-sort in docstring. Use group-function when
completions-group is non-nil.
https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg00791.html
Daniel Mendler [Tue, 11 May 2021 07:08:05 +0000 (09:08 +0200)]
(minibuffer-completion-help): Add group sorting
Sort the groups as returned by the `group-function` of the completion
table depending on the value of the customizable variable
`completions-group-sort`. By default `completions-group-sort` is set
to nil. The variable can be set to the symbol `alphabetical` in order
to configure alphabetical sorting. Furthermore, a custom sorting
function can be used as value of `completions-group-sort`.
* lisp/minibuffer.el (completions-group-sort): New variable.
(minibuffer--group-by): Add SORT-FUN argument.
(minibuffer-completion-help): Pass `completions-group-sort` to
`minibuffer--group-by`.
Daniel Mendler [Sun, 2 May 2021 13:50:08 +0000 (15:50 +0200)]
(minibuffer-completion-help): Do not check `completions-group` centrally
The guard variable `completions-group` should be checked in each
completion table individually. The guard variable
`completions-detailed` variable is used in the same way.
* minibuffer.el (minibuffer-completion-help): Remove check of
`completions-group`.
Daniel Mendler [Fri, 30 Apr 2021 06:40:59 +0000 (08:40 +0200)]
(completion--insert-strings): Split function; Full group title support
Split `completion--insert-strings` into a function per completions
format in order to increase readability and extensibility. This
change eases the addition of more formats. Add support for group
titles to the vertical and horizontal formatting functions.
* minibuffer.el (completion--insert): Add new function.
(completion--insert-vertical, completion--insert-horizontal,
completion--insert-one-column): Extract function from
`completion--insert-strings`. Use new function `completion--insert`.
(completion--insert-strings): Use new insertion functions.
Daniel Mendler [Sun, 25 Apr 2021 11:07:29 +0000 (13:07 +0200)]
(completing-read): Add `group-function` to the completion metadata
A completion table can specify a `group-function` in its metadata.
The group function takes two arguments, a completion candidate and a
transform argument. The group function is used to group the
candidates after sorting and to enhance the completion UI with group
titles.
If the transform argument is nil, the function must return the title
of the group to which the completion candidate belongs. The function
may also return nil if the candidate does not belong to a group.
If the transform argument is non-nil, the function must return the
transformed candidate. For example, the transformation allows to
remove a redundant part of the candidate, which is then displayed in
the title.
The grouping functionality is guarded by the customizable variable
`completions-group` and turned off by default for the *Completions*
buffer.
The specific form of the `group-function` has been chosen in order to
allow allocation-free grouping. This is important for completion UIs,
which continously update the displayed set of candidates (Icomplete,
Vertico, Ivy, etc.). Only when the transform argument is non-nil the
candidate transformation is performed, which may involve a string
allocation as done in the function `xref--completing-read-group`.
The function `xref-show-definitions-completing-read` makes use of the
`group-function`, by moving the file name prefix to the title. If
grouping is enabled, the *Completions* are displayed as
"linenum:summary" instead of "file:linenum:summary". This way the
*Completions* buffer resembles the *Occur* buffer.
* doc/lispref/minibuf.texi: Add documentation.
* lisp/minibuffer.el (completion-metadata): Describe the
`group-function` in the docstring.
(completions-group): Add guard variable, off by default.
(completions-group-format): Add variable defining the format string
for the group titles.
(completions-group-title): Add face used by `completions-group-format`
for the group titles.
(completions-group-separator): Add face used by
`completions-group-format` for the group separator lines.
(minibuffer--group-by): New grouping function.
(minibuffer-completion-help): Use it.
(display-completion-list): Add optional GROUP-FUN argument.
(completion--insert-strings): Add optional GROUP-FUN argument. Insert
group titles if `completions-format` is `one-column`. Transform each
candidate with the GROUP-FUN. Attach the untransformed candidate to
the property `completion--string`.
* lisp/simple.el (choose-completion): Retrieve the untransformed
completion candidate from the property `completion--string`.
* lisp/progmodes/xref.el:
(xref--completing-read-group): New grouping function.
(xref-show-definitions-completing-read): Use it.
Eli Zaretskii [Thu, 20 May 2021 09:01:40 +0000 (12:01 +0300)]
Fix arg-out-of-range errors in 'line-number-at-pos'
* src/fns.c (Fline_number_at_pos): Pass character position to
args_out_of_range. Suggested by Andreas Schwab
<schwab@linux-m68k.org>. Call args_out_of_range_3 to show both
ends of the accessible portion.
Eli Zaretskii [Thu, 20 May 2021 08:44:54 +0000 (11:44 +0300)]
Make sure gmalloc's hybrid_free preserves errno
* src/gmalloc.c (hybrid_free_1): New function, with the body of
the previous 'hybrid_free'.
(hybrid_free): Call 'hybrid_free_1' while preserving the value of
'errno'. Suggested by Paul Eggert <eggert@cs.ucla.edu>.