Alan Mackenzie [Mon, 31 May 2021 16:24:11 +0000 (16:24 +0000)]
Make frames record when their selected window was the mini-window
When a frame in this state is selected again by Fselect_frame (but not by
Fselect_window), the mini-window rather than the frame's currently selected
window, is chosen for selection, should there still be an active minibuffer in
it.
This fixes bug #48674.
* src/frame.h (struct frame): Add new boolean field select_mini_window_flag.
* src/frame.c (make_frame): Initialize select_mini_window_flag to false.
(do_switch_frame): Set the new flag appropriately for the old frame, and
process the new frame's setting of this flag, before setting it to false.
* src/window.c (select_window): Set f->select_mini_window_flag to false.
(Fset_frame_selected_window, Fdelete_other_windows_internal)
(Fdelete_window_internal): Add comments clarifying that there is no clearing
of f->select_mini_window_flag in these functions.
Alan Mackenzie [Mon, 31 May 2021 10:33:10 +0000 (10:33 +0000)]
Correct mouse handling when window origin changes between down and up events
Do this by using frame relative positions rather than window relative ones,
which gave rise to spurious drag events when the origin of the window changed
between the mouse down and up events. This fixes bug #48409.
* keyboard.c (frame_relative_event_pos): New static variable.
(make_lispy_event): Record frame relative position of down event. When the up
event is in the same position, "move" this event into the window of the down
event when this window (typically a mini-window) is no longer under the mouse.
Call make_lispy_position a second time to generate this changed event.
(syms_of_keyboard): Declare Qwindow_edges. static_pro
frame_relative_event_pos.
* lisp/emacs-lisp/elp.el (elp-results): Make `q' work in ELP
results buffer (bug#14104).
(elp-results-mode): Define as an empty special mode derivation.
Philipp Stephani [Sun, 30 May 2021 20:39:54 +0000 (22:39 +0200)]
Document that the 'syntax-propertize-function' may move point.
The functions generated by 'syntax-propertize-rules' don't use
'save-excursion', but 'syntax-propertize' does, so we might as well
document that the 'syntax-propertize-function' may move point.
* doc/lispref/syntax.texi (Syntax Properties): Document that the
'syntax-propertize-function' may move point.
Mauro Aranda [Sun, 30 May 2021 12:35:13 +0000 (09:35 -0300)]
Do not reset settings when disabling a theme
* lisp/custom.el (disable-theme): Don't call custom-push-theme, since
that resets the theme settings and it isn't useful: we only need to
remove the theme setting from the themed variable or face. This fixes
a regression when "toggling" themes, introduced while fixing Bug#34027.
(Bug#48736)
Eli Zaretskii [Sun, 30 May 2021 08:16:59 +0000 (11:16 +0300)]
Don't account for character compositions in 'format' and friends
'lisp_string_width' is called from 'format' and 'format-message',
which can be called both very early into Emacs initialization and in
other contexts where using the font backend is impossible or
undesirable. So this commit changes 'lisp_string_width' to try
accounting for automatic compositions only when explicitly requested,
and only 'string-width' does that; 'format' and 'format-message'
don't.
* src/character.c (lisp_string_width): Accept an additional
argument AUTO_COMP; attempt accounting for auto-compositions only
if that argument is non-zero. (Bug#48732)
* src/editfns.c (styled_format):
* src/character.c (Fstring_width): Callers of 'lisp_string_width'
adjusted.
* lisp/menu-bar.el (menu-bar-select-buffer): Move from
here... (bug#15651).
* lisp/msb.el (menu-bar-select-buffer): ... to here (which is the
only usage in-tree in Emacs).
Stephen Gildea [Sun, 30 May 2021 05:54:30 +0000 (22:54 -0700)]
time-stamp: improve unit-test coverage
* test/lisp/time-stamp-tests.el (time-stamp-format-year-4digit,
time-stamp-format-ignored-modifiers): Improve coverage with more cases.
(time-stamp-format-multiple-conversions): New test.
Daniel Martín [Sun, 30 May 2021 04:41:24 +0000 (06:41 +0200)]
Improve the documentation of documentation groups
* doc/lispref/help.texi (Documentation Groups): Fix typos and add an
example.
* lisp/emacs-lisp/shortdoc.el (define-short-documentation-group): Add
:no-eval* and :result-string keywords to the docstring. (Bug#48730)
Eli Zaretskii [Sat, 29 May 2021 08:17:53 +0000 (11:17 +0300)]
Fix last change
* lisp/international/quail.el (quail-add-unread-command-events):
Fix wording of the doc string. Move the rationale for the
function out of the doc string and into a comment.
* lisp/subr.el (inhibit--record-char): Now obsolete.
* lisp/term/xterm.el (xterm--init): New function, with most of the
code of former 'terminal-init-xterm'.
(terminal-init-xterm): Clear the lossage after terminal
initialization (see Bug#44908).
(xterm--read-event-for-query): Do not use 'inhibit--record-char'
anymore (revert commit 3e6525d69f).
* src/keyboard.c (syms_of_keyboard): Remove 'inhibit--record-char'
(partly revert 03e3440dbb).
(record_char, syms_of_keyboard_for_pdumper): Do not use
'inhibit_record_char anymore'.
Make sure that each example in shortdoc actually contains the function
it illustrates, and add a test for it.
* lisp/emacs-lisp/shortdoc.el (string, list, buffer, number):
Use the right functions in examples for string-version-lessp,
lax-plist-put, point-min and ffloor.
* test/lisp/emacs-lisp/shortdoc-tests.el: New test file.
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.