]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoAllow the use of poll instead of select feature/more-fds
Robert Pluim [Wed, 4 May 2022 15:09:07 +0000 (17:09 +0200)]
Allow the use of poll instead of select

Increase the maximum number of open files allowed to
10 x FD_SETSIZE (which is what poll is limited to on macOS).

* configure.ac (--with-poll): New option, default off, for requesting
'poll' support.  Check for "sys/poll.h" header.
(USE_POLL): New variable.
(EMACS_CONFIG_FEATURES): Add USE_POLL.

* etc/NEWS: Document --with-poll.

* src/sysselect.h: New define EMACS_MAX_FD, defaulting to FD_SETSIZE,
for the maximum number of file descriptors Emacs can use.
* src/process.c:
* src/sysdep.c:
* src/nsterm.m (ns_select_1):
(applicationDidFinishLaunching): Use EMACS_MAX_FD instead of
FD_SETSIZE everywhere.

* src/syspoll.h (SYSPOLL_H): New file for definitions related to use
of 'poll'.

* src/sysselect.h [USE_POLL]: Set EMACS_MAX_FD to 10 x FD_SETSIZE.
(emacs_fd_set) [USE_POLL]: New type, used for bitsets of file
descriptors.
(FD_CLR, FD_ISSET, FD_SET, FD_ZERO) [USE_POLL]: Macros for
manipulating bitsets.
[USE_POLL]: Include "syspoll.h".

* src/process.c (fd_sets_to_pollfds) [USE_POLL]: New function.
Converts two 'emacs_fd_set' to an array of 'struct pollfd'
(pollfds_to_fd_sets) [USE_POLL]: New function.
Converts from an array of 'struct pollfd' to two 'emacs_fd_set'.
(timespec_to_timeout) [USE_POLL]: New function, converts a 'struct
timespec' to a timeout in milliseconds.
(emacs_pselect) [USE_POLL]: Replacement for 'pselect' that calls
'poll' and does the appropriate conversions.  Does not support
sigmask.

2 years agoSort completions in Info references/menu correctly
Lars Ingebrigtsen [Thu, 5 May 2022 11:30:14 +0000 (13:30 +0200)]
Sort completions in Info references/menu correctly

* lisp/info.el (Info-follow-reference): Sort completions in the
order they appear in the buffer (bug#54175).
(Info-menu-update): Ditto.

2 years agoBe more resilient towards errors during error handling
Lars Ingebrigtsen [Thu, 5 May 2022 11:22:33 +0000 (13:22 +0200)]
Be more resilient towards errors during error handling

* src/print.c (print_error_message): Avoid infinite recursion if
`substitute-command-keys' bugs out (bug#55269).

2 years agoAvoid resizing mini buffer when displaying page numbers
Philip Kaludercic [Wed, 4 May 2022 12:24:31 +0000 (14:24 +0200)]
Avoid resizing mini buffer when displaying page numbers

* doc-view.el (doc-view-goto-page): Do not insert a newline at the end
of the "current info" if not necessary.

2 years agoDescribe kmacro registers better
Lars Ingebrigtsen [Thu, 5 May 2022 11:09:57 +0000 (13:09 +0200)]
Describe kmacro registers better

* lisp/kmacro.el (register-val-describe): Allow describing macros
that contain mouse events (bug#55266).

2 years agoSpeed up opening fonts on Haiku
Po Lu [Thu, 5 May 2022 09:46:05 +0000 (09:46 +0000)]
Speed up opening fonts on Haiku

* src/font.h (font_property_index): Note that some font drivers
use the extra data in a font entity to store driver-specific
information.

* src/haiku_font_support.cc (BFont_find): Set font indices.
(be_open_font_at_index): New function.
(BFont_open_pattern): Clean up coding style.
* src/haiku_support.h (enum haiku_font_specification)
(struct haiku_font_pattern): New fields and specifications for
indices.
* src/haikufont.c (haikufont_pattern_to_entity, haikufont_open):
Use indices to open fonts if available in the extra data.

2 years agoFix font weight reporting on macOS
Po Lu [Thu, 5 May 2022 09:01:53 +0000 (17:01 +0800)]
Fix font weight reporting on macOS

* src/macfont.m (macfont_store_descriptor_attributes): Fix
numeric values for the addition of `medium'.

* src/nsterm.m (ns_font_desc_to_font_spec): Adjust accordingly.
(ns_create_font_panel_buttons): Try to fix button width.

2 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Po Lu [Thu, 5 May 2022 07:56:19 +0000 (15:56 +0800)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

2 years agoImprove appearance of macOS font panel buttons
Po Lu [Thu, 5 May 2022 07:55:33 +0000 (15:55 +0800)]
Improve appearance of macOS font panel buttons

* src/nsterm.m (ns_create_font_panel_buttons):
([EmacsView noteUserCancelledSelection]): New functions.
([EmacsView showFontPanel]): Use those buttons instead.

2 years agoAdd Tramp test
Michael Albinus [Thu, 5 May 2022 07:54:31 +0000 (09:54 +0200)]
Add Tramp test

* test/lisp/net/tramp-tests.el (tar-mode): Require.
(tramp-test10-write-region-other-file-name-handler): New test.
(tramp-test31-interrupt-process, tramp-test31-signal-process):
Tag them :unstable unconditionally.

* test/lisp/net/tramp-resources/foo.tar.gz: New resource file.

2 years agoFix min size reporting of style pane in Haiku font dialogs
Po Lu [Thu, 5 May 2022 06:33:49 +0000 (06:33 +0000)]
Fix min size reporting of style pane in Haiku font dialogs

* src/haiku_support.cc (class DualLayoutView):
(MinSize): Implement correctly with both views.

2 years agoUse bswap_32 and bswap_16 in Motif DND code
Po Lu [Thu, 5 May 2022 05:44:19 +0000 (13:44 +0800)]
Use bswap_32 and bswap_16 in Motif DND code

* src/xterm.c (SWAPCARD32, SAPCARD16): Use glibc/gnulib
byte-swapping functions if checking is disabled.

2 years agoTake size into account when previewing fonts on Haiku
Po Lu [Thu, 5 May 2022 04:58:47 +0000 (04:58 +0000)]
Take size into account when previewing fonts on Haiku

* src/haiku_support.cc (MessageReceived): Decode size sent and
handle `UPDATE_PREVIEW_DIALOG' message.
(UpdatePreview): Add current size.
(EmacsFontSelectionDialog): Assign correct modification messages
to the size entry.

2 years agoAllow displaying font preview on Haiku
Po Lu [Thu, 5 May 2022 03:10:30 +0000 (03:10 +0000)]
Allow displaying font preview on Haiku

* src/haiku_support.cc (class EmacsFontPreviewDialog)
(class DualLayoutView): New classes.
(class EmacsFontSelectionDialog): Add field for preview,
checkbox and layout view.
(MessageReceived): Handle new font preview messages.
(EmacsFontSelectionDialog): New constructor.
(FrameResized): Resize the layout view instead.

2 years agoFix device reporting from scroll bar events on X
Po Lu [Thu, 5 May 2022 01:03:30 +0000 (09:03 +0800)]
Fix device reporting from scroll bar events on X

* src/xterm.c (x_scroll_bar_handle_click): New argument
`device'.
(handle_one_xevent): Set it appropriately as long as required.

2 years agoTranscription error
dickmao [Wed, 4 May 2022 23:23:53 +0000 (19:23 -0400)]
Transcription error

* lisp/gnus/gnus-topic.el (gnus-topic-display-missing-topic):
Indent.
(gnus-topic-update-topic-line): Insert missing fourth argument.

2 years agoRevert "server-execute: Initialize the *scratch* buffer"
Sean Whitton [Wed, 4 May 2022 23:31:28 +0000 (16:31 -0700)]
Revert "server-execute: Initialize the *scratch* buffer"

This reverts commit f2d2fe6fc8ef0b6087c4a8a69d05a4e521b23047.

To be replaced with factoring out *scratch* buffer initialization.

2 years agoStop esh-var-tests leaving temp files behind
Glenn Morris [Wed, 4 May 2022 22:02:40 +0000 (15:02 -0700)]
Stop esh-var-tests leaving temp files behind

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/quoted-interp-temp-cmd): Don't leave temporary files.

2 years agoRemove bogus mode check from gnus topic update functions
Eric Abrahamsen [Wed, 4 May 2022 19:54:37 +0000 (12:54 -0700)]
Remove bogus mode check from gnus topic update functions

* lisp/gnus/gnus-topic.el (gnus-topic-update-topics-containing-group):
(gnus-topic-update-topic): These functions originally checked to see
if we were in group mode, but later that check was changed to
'gnus-topic-mode, which never passes because 'gnus-topic-mode isn't a
major mode. Revert to checking for 'gnus-group-mode, and use
`derived-mode-p' while we're at it.

2 years ago* lisp/tab-bar.el: Use pixel-based alignment (bug#55207)
Juri Linkov [Wed, 4 May 2022 19:32:30 +0000 (22:32 +0300)]
* lisp/tab-bar.el: Use pixel-based alignment (bug#55207)

* lisp/tab-bar.el (tab-bar-format-align-right): Use string-pixel-width
on the string with tab-bar face to get the width in pixels to align.
(tab-bar-format-global): Remove string-trim-right to keep padding-right.

2 years agoRemove unused lexvar in subr-x-tests.el
Basil L. Contovounesios [Wed, 4 May 2022 18:54:49 +0000 (21:54 +0300)]
Remove unused lexvar in subr-x-tests.el

* test/lisp/emacs-lisp/subr-x-tests.el
(test-with-buffer-unmodified-if-unchanged): Pacify unused lexvar
byte-compiler warning.  Simplify slightly and reindent.

2 years ago* src/xterm.c (handle_one_xevent): Fix int/Lisp_Object mix-up.
Glenn Morris [Wed, 4 May 2022 14:48:22 +0000 (07:48 -0700)]
* src/xterm.c (handle_one_xevent): Fix int/Lisp_Object mix-up.

; Flagged by --enable-check-lisp-object-type

2 years ago; Re-fix last change in doc of 'with-buffer-unmodified-if-unchanged'.
Robert Pluim [Wed, 4 May 2022 12:53:34 +0000 (14:53 +0200)]
; Re-fix last change in doc of 'with-buffer-unmodified-if-unchanged'.

2 years ago* etc/NEWS: Improve some NEWS entries
Robert Pluim [Wed, 4 May 2022 12:48:27 +0000 (14:48 +0200)]
* etc/NEWS: Improve some NEWS entries

2 years ago; * etc/PROBLEMS: Fix typo.
Robert Pluim [Wed, 4 May 2022 12:46:59 +0000 (14:46 +0200)]
; * etc/PROBLEMS: Fix typo.

2 years ago* doc/emacs/killing.texi: Fix typos
Robert Pluim [Wed, 4 May 2022 12:35:59 +0000 (14:35 +0200)]
* doc/emacs/killing.texi: Fix typos

* doc/emacs/killing.texi (Clipboard): Fix wording in description of
'save-interprogram-paste-before-kill'.  Ensure the reference to
"Yanking Media" is not split over two lines.

2 years ago; Fix last change in doc string of 'with-buffer-unmodified-if-unchanged'.
Eli Zaretskii [Wed, 4 May 2022 10:08:53 +0000 (13:08 +0300)]
; Fix last change in doc string of 'with-buffer-unmodified-if-unchanged'.

2 years ago; Fix typo in emacs-news-mode
Po Lu [Wed, 4 May 2022 09:15:24 +0000 (17:15 +0800)]
; Fix typo in emacs-news-mode

* lisp/textmodes/emacs-news-mode.el
(emacs-news-count-untagged-entries): Fix typo in message when
there are a pural amount of untagged entries.

2 years ago; * lisp/frameset.el: Fix a typo in a comment.
Eli Zaretskii [Wed, 4 May 2022 09:06:10 +0000 (12:06 +0300)]
; * lisp/frameset.el: Fix a typo in a comment.

2 years agoFix restoring desktop from TTY-saved sessions
Eli Zaretskii [Wed, 4 May 2022 09:04:53 +0000 (12:04 +0300)]
Fix restoring desktop from TTY-saved sessions

* lisp/frameset.el (frameset-restore): Don't override/fix position
of the restored frames for which we have geometry information
saved by a past GUI session.  (Bug#55070)

2 years agoTurn on XInput 2 support by default
Po Lu [Wed, 4 May 2022 08:48:24 +0000 (16:48 +0800)]
Turn on XInput 2 support by default

The support doesn't interfere with compatibility, since Emacs
built with XInput 2 support transparently falls back to Core
Input when a suitable version of the input extension is not
available.  It also matured much sooner than expected, so
enabling this by default will lead to new features being
available to more users.

* INSTALL:
* configure.ac:
* etc/NEWS: Enable XInput 2 support by default.

2 years agoClarify the doc string of 'with-buffer-unmodified-if-unchanged'
Eli Zaretskii [Wed, 4 May 2022 08:46:01 +0000 (11:46 +0300)]
Clarify the doc string of 'with-buffer-unmodified-if-unchanged'

* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Describe better what is meant by "buffer changes".  (Bug#4587)

2 years agoRemove unused variable in Haiku selection code
Po Lu [Wed, 4 May 2022 08:40:41 +0000 (08:40 +0000)]
Remove unused variable in Haiku selection code

* src/haiku_select.cc (selection_state_flag):
* src/haikuselect.h: Remove variable.

2 years ago; * lisp/international/characters.el (#xfb50): Fix last change.
Eli Zaretskii [Wed, 4 May 2022 08:20:05 +0000 (11:20 +0300)]
; * lisp/international/characters.el (#xfb50): Fix last change.

2 years agoFix 'bidi-class' property of unassigned codepoints
Eli Zaretskii [Wed, 4 May 2022 08:14:45 +0000 (11:14 +0300)]
Fix 'bidi-class' property of unassigned codepoints

* admin/unidata/unidata-gen.el (unidata-file-alist): Update the
default values of 'bidi-class' according to the latest Unicode
Standard.

* admin/notes/unicode: Mention possible changes in
DerivedBidiClass.txt that need to be reflected in unidata-gen.el.

* lisp/international/characters.el (#xfb50, #xfdf0): Fix the
Arabic block characters.  (Bug#55256)

2 years agoFlush the tool bar cache on all terminals when adding new entries
Lars Ingebrigtsen [Wed, 4 May 2022 07:34:56 +0000 (09:34 +0200)]
Flush the tool bar cache on all terminals when adding new entries

* lisp/tool-bar.el (tool-bar--flush-cache): Flush the cache for
the current tool bar on all terminals.

2 years agoCorrectly encode and decode filenames on NS
Po Lu [Wed, 4 May 2022 07:31:32 +0000 (15:31 +0800)]
Correctly encode and decode filenames on NS

* src/nsfns.m (Fns_read_file_name): Run dir through ENCODE_FILE
and fname through DECODE_FILE.

2 years agoFix file name encoding on Haiku file dialogs
Po Lu [Wed, 4 May 2022 07:26:43 +0000 (07:26 +0000)]
Fix file name encoding on Haiku file dialogs

* src/haikufns.c (Fhaiku_read_file_name): Use ENCODE_FILE and
DECODE_FILE correctly.

2 years agoSet initial size in the Haiku font dialog
Po Lu [Wed, 4 May 2022 05:46:24 +0000 (05:46 +0000)]
Set initial size in the Haiku font dialog

* src/haiku_support.cc (class EmacsFontSelectionDialog)
(EmacsFontSelectionDialog): New argument `initial_size'.
(be_select_font): Likewise.
* src/haiku_support.h: Update prototypes.
* src/haikufont.c (Fx_select_font): Set font dialog size to the
pixel size of the current font.

2 years agoEncode and decode filenames correctly on Haiku
Po Lu [Wed, 4 May 2022 03:26:28 +0000 (03:26 +0000)]
Encode and decode filenames correctly on Haiku

* src/haikufns.c (Fhaiku_read_file_name): Decode file names
correctly.

2 years agoClean up Haiku file panel code
Po Lu [Wed, 4 May 2022 03:23:11 +0000 (03:23 +0000)]
Clean up Haiku file panel code

* lisp/term/haiku-win.el (x-file-dialog): Fix nil values of
`default-filename'.
* src/haiku_io.c (haiku_len): Remove `FILE_PANEL_EVENT'.
(record_c_unwind_protect_from_cxx, c_specpdl_idx_from_cxx)
(c_unbind_to_nil_from_cxx): Delete functions.
* src/haiku_support.cc (MessageReceived): Write pointer to
buffer to file panel port instead.
(struct popup_file_dialog_data): Delete strict.
(unwind_popup_file_dialog): Delete functions.
(be_popup_file_dialog): Accept a pointer to
`process_pending_signals' and run nested event loop as usual.

* src/haiku_support.h (enum haiku_event_type): Remove
`FILE_PANEL_EVENT'.
(struct haiku_file_panel_event): Delete struct.
* src/haikufns.c (unwind_popup): Delete function.
(Fhaiku_read_file_name): Update and quit on invalid filename.

* src/haikuterm.c (struct unhandled_event): Delete struct.
(haiku_read_socket): Remove "unhandled events".

2 years ago* src/haikufns.c (haiku_create_frame): Improve default border width.
Po Lu [Wed, 4 May 2022 01:42:11 +0000 (01:42 +0000)]
* src/haikufns.c (haiku_create_frame): Improve default border width.

2 years agoserver-execute: Initialize the *scratch* buffer
Sean Whitton [Wed, 4 May 2022 01:08:14 +0000 (18:08 -0700)]
server-execute: Initialize the *scratch* buffer

* lisp/server.el: Require subr-x when compiling.
(server-execute): Initialize the *scratch* buffer in the same way that
the scratch-buffer command does, for consistency.

2 years agoFix display of placeholder composite string on Haiku
Po Lu [Wed, 4 May 2022 00:47:52 +0000 (00:47 +0000)]
Fix display of placeholder composite string on Haiku

* src/haikuterm.c
(haiku_draw_composite_glyph_string_foreground): Correct
translation of XDrawRectangle.

2 years agoFix event mask and source indication of _NET_WM_STATE messages
Po Lu [Wed, 4 May 2022 00:40:12 +0000 (08:40 +0800)]
Fix event mask and source indication of _NET_WM_STATE messages

* src/xselect.c (x_send_client_event): Make static.
* src/xterm.c (set_wm_state): Send event with correct mask and
source indication set.
* src/xterm.h: Update prototypes.

2 years agoMake some recently added tests actually run
Lars Ingebrigtsen [Tue, 3 May 2022 20:30:39 +0000 (22:30 +0200)]
Make some recently added tests actually run

2 years agoMake with-buffer-unmodified-if-unchanged more efficient
Lars Ingebrigtsen [Tue, 3 May 2022 20:06:31 +0000 (22:06 +0200)]
Make with-buffer-unmodified-if-unchanged more efficient

* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Make more efficient.

2 years agoMake with-buffer-unmodified-if-unchanged more resilient
Lars Ingebrigtsen [Tue, 3 May 2022 20:04:39 +0000 (22:04 +0200)]
Make with-buffer-unmodified-if-unchanged more resilient

* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Make more resilient.

2 years agowith-buffer-unmodified-if-unchanged: Tweak the implementation
Stefan Monnier [Tue, 3 May 2022 19:35:47 +0000 (15:35 -0400)]
with-buffer-unmodified-if-unchanged: Tweak the implementation

* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Skip the hash if the buffer was not modified at all.
Use `restore-buffer-modified-p`.
Also mention that it's imperative that the current buffer is preserved.

2 years agoAdd NEWS entry about incompatible sorting command behaviors
Lars Ingebrigtsen [Tue, 3 May 2022 19:29:47 +0000 (21:29 +0200)]
Add NEWS entry about incompatible sorting command behaviors

2 years agoMake sorting not change buffer modification status always
Lars Ingebrigtsen [Tue, 3 May 2022 19:23:40 +0000 (21:23 +0200)]
Make sorting not change buffer modification status always

* lisp/sort.el (sort-subr): Don't mark buffer modified if the
sorting didn't change anything (bug#4587).

2 years agoAdd new macro with-buffer-unmodified-if-unchanged
Lars Ingebrigtsen [Tue, 3 May 2022 19:22:53 +0000 (21:22 +0200)]
Add new macro with-buffer-unmodified-if-unchanged

* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
New macro.
* lisp/textmodes/fill.el (fill-paragraph): Macro code copied from
here.  Adjust and use the macro.

2 years agoFix thinko in recent tool bar caching logic
Lars Ingebrigtsen [Tue, 3 May 2022 17:20:52 +0000 (19:20 +0200)]
Fix thinko in recent tool bar caching logic

* lisp/tool-bar.el (tool-bar--cache-key): New function.
(tool-bar--flush-cache, tool-bar-make-keymap): Use it.

2 years agoMake tool bar caching more sensible
Lars Ingebrigtsen [Tue, 3 May 2022 16:46:05 +0000 (18:46 +0200)]
Make tool bar caching more sensible

* lisp/tool-bar.el (tool-bar-keymap-cache): Make into a non-weak
EQ hash table, which should be faster and not lose the contents
after a GC (bug#43397).
(tool-bar--flush-cache, tool-bar-make-keymap): Use the terminal
only as the key.
(tool-bar-local-item, tool-bar-local-item-from-menu): Flush the
cache after altering the tool bar.

2 years ago; * doc/misc/eshell.texi (Arguments): Fix cross-references.
Eli Zaretskii [Tue, 3 May 2022 16:38:06 +0000 (19:38 +0300)]
; * doc/misc/eshell.texi (Arguments): Fix cross-references.

2 years agoAllow desktop to restore frames and windows on TTY frames
Eli Zaretskii [Tue, 3 May 2022 16:29:03 +0000 (19:29 +0300)]
Allow desktop to restore frames and windows on TTY frames

* lisp/frameset.el (frameset-persistent-filter-alist): Add 'top',
'left', 'bottom', and 'right' to frame parameters that are shelved
and unshelved when switching from GUI to TTY frames and vice
versa.
(frameset--restore-frame): Accept two optional arguments DX and
DY, and offset by them each frame restored from TTY desktop, to
make such restored frames more prominently visible.  Force such
frames to be visible on GUI display, since the visibility
parameter is meaningless for TTY frames.
(frameset-restore): Pass DX and DY offsets to
'frameset--restore-frame', when restoring TTY frames on GUI
display.
* lisp/desktop.el (desktop-restore-frameset): Pass the
:force-onscreen argument of 'frameset-restore' as nil when
restoring frames on text-mode display.
(desktop-restore-forces-onscreen): Document that this option has
no real effect on restoring frames on text-mode display.
(desktop-restoring-frameset-p): Allow restoring frames in non-GUI
sessions, but disallow that when the selected frame is the
daemon's initial frame.  (Bug#55070)

2 years agoImprove the behavior of concatenating parts of Eshell arguments
Jim Porter [Mon, 2 May 2022 23:56:49 +0000 (16:56 -0700)]
Improve the behavior of concatenating parts of Eshell arguments

Previously, concatenating a list to a string would first convert the
list to a string.  Now, the string is concatenated with the last
element of the list.

* lisp/eshell/esh-util.el (eshell-to-flat-string): Make obsolete.

* lisp/eshell/esh-arg.el (eshell-concat, eshell-concat-1): New
functions.
(eshell-resolve-current-argument): Use 'eshell-concat'.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-concat-cmd):
Add check for concatenation of multiline output of subcommands.
(esh-var-test/quoted-interp-concat-cmd): New test.

* test/lisp/eshell/em-extpipe-tests.el (em-extpipe-test-13): Use
'eshell-concat'.

* doc/misc/eshell.texi (Expansion): Document this behavior.

* etc/NEWS: Announce the change (bug#55236).

2 years agoReturn a list of numbers if all lines of an Eshell subcommand are numeric
Jim Porter [Mon, 2 May 2022 05:09:17 +0000 (22:09 -0700)]
Return a list of numbers if all lines of an Eshell subcommand are numeric

* lisp/eshell/esh-util.el (eshell-convertible-to-number-p)
(eshell-convert-to-number): New functions...
(eshell-convert): ... use them.

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/interp-convert-cmd-string-newline): Add checks for
numeric output.

* doc/misc/eshell.texi (Dollars Expansion): Document the new behavior.

* etc/NEWS: Announce the change (bug#55236).

2 years agoEshell variable expansion should always return strings inside quotes
Jim Porter [Tue, 1 Mar 2022 01:38:39 +0000 (17:38 -0800)]
Eshell variable expansion should always return strings inside quotes

This is closer in behavior to regular shells, and gives Eshell users
greater flexibility in how variables are expanded.

* lisp/eshell/esh-util.el (eshell-convert): Add TO-STRING argument.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Add MODIFIER-P
argument and adjust how 'eshell-convert' and 'eshell-apply-indices'
are called.
(eshell-get-variable, eshell-apply-indices): Add QUOTED argument.

* test/lisp/eshell/esh-var-tests.el (eshell-test-value): New defvar.
(esh-var-test/interp-convert-var-number)
(esh-var-test/interp-convert-var-split-indices)
(esh-var-test/interp-convert-quoted-var-number)
(esh-var-test/interp-convert-quoted-var-split-indices)
(esh-var-test/interp-convert-cmd-string-newline)
(esh-var-test/interp-convert-cmd-multiline)
(esh-var-test/interp-convert-cmd-number)
(esh-var-test/interp-convert-cmd-split-indices)
(esh-var-test/quoted-interp-convert-var-number)
(esh-var-test/quoted-interp-convert-var-split-indices)
(esh-var-test/quoted-interp-convert-quoted-var-number)
(esh-var-test/quoted-interp-convert-quoted-var-split-indices)
(esh-var-test/quoted-interp-convert-cmd-string-newline)
(esh-var-test/quoted-interp-convert-cmd-multiline)
(esh-var-test/quoted-interp-convert-cmd-number)
(esh-var-test/quoted-interp-convert-cmd-split-indices): New tests.

* doc/misc/eshell.texi (Arguments): Expand this section, and document
the new behavior.
(Dollars Expansion): Provide more detail about '$(lisp)' and
'${command}' forms.

* etc/NEWS (Eshell): Announce this change (bug#55236).

2 years agoMake adding things to the tool bar show up on next redisplay
Lars Ingebrigtsen [Tue, 3 May 2022 16:19:13 +0000 (18:19 +0200)]
Make adding things to the tool bar show up on next redisplay

* lisp/tool-bar.el (tool-bar--flush-cache): New function.
(tool-bar-add-item): Flush the cache (bug#43397).

2 years agoAdd new command 'package-update'
Lars Ingebrigtsen [Tue, 3 May 2022 16:00:32 +0000 (18:00 +0200)]
Add new command 'package-update'

* doc/emacs/package.texi (Package Installation): Mention it.
* lisp/emacs-lisp/package.el (package-update): New command
(bug#18790).

2 years agoFix key-parse problem with C-x ( ... sequences
Lars Ingebrigtsen [Tue, 3 May 2022 14:19:50 +0000 (16:19 +0200)]
Fix key-parse problem with C-x ( ... sequences

* lisp/keymap.el (key-parse): Move the read-kbd-macro compat code
from here...
* lisp/subr.el (kbd): ... to here.  (And fix the logic, too.)
This allows `key-parse' to have a less puzzling result while
maintaining backwards compatibility (bug#38775).

2 years agoMake TAB work in makefile mode when transient mark mode is on
Lars Ingebrigtsen [Tue, 3 May 2022 14:02:51 +0000 (16:02 +0200)]
Make TAB work in makefile mode when transient mark mode is on

* lisp/progmodes/make-mode.el (makefile-mode): Insert a tab
instead of removing it (bug#37087).

2 years agoHandle file name handler in write-region's VISIT arg
Michael Albinus [Tue, 3 May 2022 12:14:37 +0000 (14:14 +0200)]
Handle file name handler in write-region's VISIT arg

* lisp/net/tramp.el (tramp-skeleton-delete-directory): Move up.
(tramp-skeleton-write-region): New defmacro.  Handle also file
name handler in VISIT.  (Bug#55166)
(tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-write-region): Use it.

2 years agoRewrite sql-interactive-remove-continuation-prompt
Filipp Gunbin [Tue, 3 May 2022 10:35:34 +0000 (12:35 +0200)]
Rewrite sql-interactive-remove-continuation-prompt

* lisp/progmodes/sql.el (sql-starts-with-prompt-re): Remove.
(sql-ends-with-prompt-re): Remove
(sql-interactive-remove-continuation-prompt): Delete prompts from
anywhere in the process output, not just at the beginning of current
string.  Streamline logic, describe it in docstring.
* test/lisp/progmodes/sql-tests.el: Add tests

2 years agoMake more buttons in *Help* respect `help-window-keep-selected'
Lars Ingebrigtsen [Tue, 3 May 2022 10:23:25 +0000 (12:23 +0200)]
Make more buttons in *Help* respect `help-window-keep-selected'

* lisp/help-mode.el (help-function-cmacro, help-variable-def)
(help-face-def): Also respect `help-window-keep-selected' like the
other commands.

2 years agoFurther mm-base64-line-p bug fixes
Lars Ingebrigtsen [Tue, 3 May 2022 09:32:03 +0000 (11:32 +0200)]
Further mm-base64-line-p bug fixes

* lisp/gnus/mm-bodies.el (mm-base64-line-p): Fix parsing error
introduced by d90f54d.

2 years agoFix mm-base64-line-p logic
Lars Ingebrigtsen [Tue, 3 May 2022 09:28:59 +0000 (11:28 +0200)]
Fix mm-base64-line-p logic

* lisp/gnus/mm-bodies.el (mm-base64-line-p): Don't claim that an
empty line is base64.

2 years ago* src/haiku_support.cc (DrawContent): Use right UI color.
Po Lu [Tue, 3 May 2022 08:19:41 +0000 (08:19 +0000)]
* src/haiku_support.cc (DrawContent): Use right UI color.

2 years ago; * lisp/tooltip.el (tooltip-show-help): Fix typo in last change.
Po Lu [Tue, 3 May 2022 08:13:59 +0000 (16:13 +0800)]
; * lisp/tooltip.el (tooltip-show-help): Fix typo in last change.

2 years agoMake menu bar help text work on macOS as well
Po Lu [Tue, 3 May 2022 08:12:24 +0000 (16:12 +0800)]
Make menu bar help text work on macOS as well

* lisp/tooltip.el (tooltip-show-help): Resort to displaying
messages in the echo area on NS.

* src/nsmenu.m ([EmacsMenu menu:willHighlightItem:]): Call
`show_help_echo' instead of storing an event into the keyboard
buffer.

2 years agoFix default font in macOS font dialogs
Po Lu [Tue, 3 May 2022 08:05:46 +0000 (16:05 +0800)]
Fix default font in macOS font dialogs

* src/nsterm.m ([EmacsView noteUserSelectedFont]): Use current
font if none was selected.

2 years agoFix some font parsing problems on NS
Po Lu [Tue, 3 May 2022 08:02:02 +0000 (16:02 +0800)]
Fix some font parsing problems on NS

* src/nsterm.m (ns_font_desc_to_font_spec): Fix processing of
condensed width.

2 years agoHandle GraphicsExpose events on scroll bars
Po Lu [Tue, 3 May 2022 05:40:54 +0000 (13:40 +0800)]
Handle GraphicsExpose events on scroll bars

* src/xterm.c (x_scroll_bar_expose): Handle GraphicsExpose
events.
(handle_one_xevent): Give graphics exposures to scroll bars.

2 years agoMake sure rectangles are drawn correctly on X
Po Lu [Tue, 3 May 2022 03:43:32 +0000 (11:43 +0800)]
Make sure rectangles are drawn correctly on X

* src/xfaces.c (prepare_face_for_display): Always use line-width
of 1.
* src/xfns.c (x_make_gc): Likewise.
* src/xterm.c (x_scroll_bar_expose): Comment out obsolete code.

2 years agoFix glyphless glyph display on Haiku
Po Lu [Tue, 3 May 2022 03:18:11 +0000 (03:18 +0000)]
Fix glyphless glyph display on Haiku

* src/haikuterm.c
(haiku_draw_glyphless_glyph_string_foreground): Fix rectangle
width.

2 years agoFix font matching of "Fira Code Retina" and "Fira Code Regular" on Haiku
Po Lu [Tue, 3 May 2022 02:44:00 +0000 (02:44 +0000)]
Fix font matching of "Fira Code Retina" and "Fira Code Regular" on Haiku

* src/haiku_font_support.cc (font_family_style_matches_p): Don't
allow matches on fonts with an adstyle if none was specified in
the input pattern.

2 years agoDon't leave temp files behind from undigest-tests
Glenn Morris [Tue, 3 May 2022 01:26:22 +0000 (18:26 -0700)]
Don't leave temp files behind from undigest-tests

Sadly the "temp" in with-temp-file refers to a buffer, not a file.
* test/lisp/mail/undigest-tests.el (rmail-undigest-test-rfc934-digest)
(rmail-undigest-test-rfc1153-digest-strict)
(rmail-undigest-test-rfc1153-less-strict-digest)
(rmail-undigest-test-rfc1153-sloppy-digest)
(rmail-undigest-test-rfc1521-mime-digest)
(rmail-undigest-test-multipart-mixed-digest):
Delete temporary files at end.

2 years agoClean up X11 double buffering code
Po Lu [Tue, 3 May 2022 01:22:06 +0000 (09:22 +0800)]
Clean up X11 double buffering code

This fixes several latent bugs where code went down the path
with double buffering enabled when it wasn't, and vice versa.

* src/xfns.c (x_set_inhibit_double_buffering): Improve
commentary and only define when HAVE_XDBE.
(x_mark_frame_dirty): Only set buffer flip flag when HAVE_XDBE.
(initial_set_up_x_back_buffer): Clean up coding style and remove
unnecessary block_input pair.
(Fx_double_buffered_p): Always return nil if !HAVE_XDBE.
(x_frame_parm_handlers): Don't set double buffering handler if
!HAVE_XDBE.

* src/xftfont.c (xftfont_drop_xrender_surfaces, xftfont_driver):
Only define when XDBE is available.

* src/xterm.c (x_drop_xrender_surfaces): Likewise.
(x_clear_window): Don't test double buffering flags when
!HAVE_XDBE.
(show_back_buffer): Only define when HAVE_XDBE.
(x_flip_and_flush): Don't try to flip when !HAVE_XDBE.
(XTframe_up_to_date): Likewise.
(XTbuffer_flipping_unblocked_hook): Only define when Xdbe is
available.
(x_clear_area): Don't test double buffering flags when Xdbe is
not available.
(flush_dirty_back_buffer_on): Don't define if there's no DBE.
(handle_one_xevent, x_create_terminal): Likewise.

* src/xterm.h (FRAME_X_DRAWABLE): Fix coding style.

2 years ago; * src/nsterm.m (syms_of_nsterm): Fix typo in defsym.
Po Lu [Tue, 3 May 2022 00:41:38 +0000 (08:41 +0800)]
; * src/nsterm.m (syms_of_nsterm): Fix typo in defsym.

2 years agoFix punctuation in the Eshell manual
Eli Zaretskii [Mon, 2 May 2022 16:16:59 +0000 (19:16 +0300)]
Fix punctuation in the Eshell manual

* doc/misc/eshell.texi (Argument Predication and Modification):
Fix whitespace.

2 years ago; * etc/NEWS: Improve wording of "M-x scratch-buffer" entry.
Eli Zaretskii [Mon, 2 May 2022 16:06:45 +0000 (19:06 +0300)]
; * etc/NEWS: Improve wording of "M-x scratch-buffer" entry.

2 years ago; Fix typo and wording of a doc string
Eli Zaretskii [Mon, 2 May 2022 15:57:15 +0000 (18:57 +0300)]
; Fix typo and wording of a doc string

* lisp/textmodes/reftex-parse.el (reftex-using-biblatex-p): Fix
typo and wording of the doc string.

2 years agoLoad multiple bibliographies with multibib package
Arash Esbati [Mon, 2 May 2022 12:31:19 +0000 (14:31 +0200)]
Load multiple bibliographies with multibib package

* lisp/textmodes/reftex-parse.el (reftex-using-biblatex-p):
Recognize 'multibib' which allows multiple bibliography loading
macro calls.
(reftex-locate-bibliography-files): Prevent possible duplications
in bibliography database files.

2 years agoWait for events from all displays in Xm dialogs even on XI2
Po Lu [Mon, 2 May 2022 12:16:53 +0000 (20:16 +0800)]
Wait for events from all displays in Xm dialogs even on XI2

* src/xfns.c (Fx_file_dialog): Always process events from all
displays.

2 years agoMake the eval-in-debug error message prettier in non-recursive errors
Lars Ingebrigtsen [Mon, 2 May 2022 11:59:11 +0000 (13:59 +0200)]
Make the eval-in-debug error message prettier in non-recursive errors

* lisp/emacs-lisp/debug.el (debugger-eval-expression): Make the
error message (when recursive debugging is off) prettier.

2 years agoMake non-recursive error messages in edebug prettier
Lars Ingebrigtsen [Mon, 2 May 2022 11:55:56 +0000 (13:55 +0200)]
Make non-recursive error messages in edebug prettier

* lisp/emacs-lisp/edebug.el (edebug-eval-expression): Make the
error message (when recursive debugging is off) prettier.

2 years agoFix eldoc interaction with `when' and `unless'
Lars Ingebrigtsen [Mon, 2 May 2022 10:30:19 +0000 (12:30 +0200)]
Fix eldoc interaction with `when' and `unless'

* lisp/subr.el (when, unless): Remove the (fn...) bits from the
doc string, because the advertised calling convention is correct
the way it is (bug#27229).  This also makes eldoc highlight the
arguments correctly.

2 years agoAdd a command to recreate the *scratch* buffer
Lars Ingebrigtsen [Mon, 2 May 2022 10:26:31 +0000 (12:26 +0200)]
Add a command to recreate the *scratch* buffer

* doc/emacs/building.texi (Lisp Interaction): Mention it.
* lisp/simple.el (scratch-buffer): New command.

2 years agoFix handling double-click-time nil or t
Stefan Kangas [Mon, 2 May 2022 10:03:08 +0000 (12:03 +0200)]
Fix handling double-click-time nil or t

* lisp/mouse.el (mouse-double-click-time): New function to always
return a number for `double-click-time'.
* lisp/emulation/viper-mous.el (viper-multiclick-timeout):
* lisp/foldout.el (foldout-mouse-swallow-events):
* lisp/help.el (help--read-key-sequence):
* lisp/org/org-mouse.el (org-mouse-show-context-menu): Use
'mouse-double-click-time' instead of 'double-click-time'.
* src/keyboard.c (syms_of_keyboard): Mention
'mouse-double-click-time' in doc string of 'double-click-time'.
* test/lisp/mouse-tests.el (mouse-test-mouse-double-click-time):
New test.

2 years agoRe-fix Gcc header tokenization in Gnus
Lars Ingebrigtsen [Mon, 2 May 2022 09:37:35 +0000 (11:37 +0200)]
Re-fix Gcc header tokenization in Gnus

* lisp/gnus/gnus-msg.el (gnus-inews-do-gcc): Split the Gcc header
on commas, but allow group names to contain spaces (bug#55217).

2 years agoAllow reusing the *Help* window with `i'/`s/ commands
Lars Ingebrigtsen [Mon, 2 May 2022 09:30:43 +0000 (11:30 +0200)]
Allow reusing the *Help* window with `i'/`s/ commands

* doc/emacs/help.texi (Help): Document it.

* lisp/help-mode.el (help-function-def--button-function): Use it.
* lisp/help-mode.el (help-goto-info): Use it.

* lisp/help.el (help-window-select): Mention it.
(help-window-keep-selected): New user option (bug#9054).

* lisp/info-look.el (info-lookup-symbol):
(info-lookup): Allow keeping the same window.

2 years agoFix inconsistencies in Haiku font selection dialog
Po Lu [Mon, 2 May 2022 09:05:12 +0000 (09:05 +0000)]
Fix inconsistencies in Haiku font selection dialog

* src/haiku_font_support.cc (font_family_style_matches_p): Fix
coding style.
* src/haikufont.c (haikufont_pattern_from_object): Set slant and
width using correct object.

2 years agoAllow show-paren to show matching parentheses inside comments
Lars Ingebrigtsen [Mon, 2 May 2022 09:02:01 +0000 (11:02 +0200)]
Allow show-paren to show matching parentheses inside comments

* lisp/paren.el (show-paren--default): Improve blinking when
inside a comment (bug#5410).

2 years agoFix handling of some weights in the Haiku font driver
Po Lu [Mon, 2 May 2022 08:46:04 +0000 (08:46 +0000)]
Fix handling of some weights in the Haiku font driver

* src/haiku_font_support.cc (font_style_to_flags):
* src/haiku_support.h (enum haiku_font_weight):
* src/haikufont.c (haikufont_weight_to_lisp)
(haikufont_lisp_to_weight): Make `ultralight' and `extralight'
mean the same thing.

2 years agoUse xref-goto-xref as the xref mouse binding
Lars Ingebrigtsen [Mon, 2 May 2022 08:01:55 +0000 (10:01 +0200)]
Use xref-goto-xref as the xref mouse binding

* lisp/progmodes/xref.el (xref--button-map): Keep the
xref-goto-xref binding instead of select-and-show to be more
similar to grep buffers.

2 years agoFix the OMIT-NULLS + "" case in string-lines
Lars Ingebrigtsen [Mon, 2 May 2022 07:56:49 +0000 (09:56 +0200)]
Fix the OMIT-NULLS + "" case in string-lines

* lisp/subr.el (string-lines): Respect OMIT-NULLS when given an
empty string.

2 years agoImprove font dialog on macOS
Po Lu [Mon, 2 May 2022 07:06:58 +0000 (15:06 +0800)]
Improve font dialog on macOS

* src/nsterm.m ([EmacsView changeFont:]): Don't exit loop here
on macOS.
([EmacsView noteUserSelectedFont]): New function.
([EmacsView showFontPanel]): Add explicit "OK" button on macOS.

2 years agoDefault to currently selected font in Haiku font dialogs
Po Lu [Mon, 2 May 2022 05:48:48 +0000 (05:48 +0000)]
Default to currently selected font in Haiku font dialogs

* src/haiku_font_support.cc (be_find_font_indices): New
function.
* src/haiku_support.cc (class EmacsFontSelectionDialog)
(UpdateStylesForIndex, EmacsFontSelectionDialog): Allow
specifying an initial font family and style.
(be_select_font): New parameters `initial_family' and
`initial_style'.
* src/haiku_support.h: Update prototypes.

* src/haikufont.c (haikufont_lisp_to_weight)
(haikufont_lisp_to_slant, haikufont_lisp_to_width): Handle
`regular'.
(haikufont_pattern_from_object): New function.
(haikufont_spec_or_entity_to_pattern): Fix coding style.
(Fx_select_font): Compute indices based on currently selected
font.
(syms_of_haikufont): New defsyms.

2 years ago* lisp/gnus/gnus-util.el (gnus-byte-compile): Use `lexical-binding`
Stefan Monnier [Mon, 2 May 2022 05:14:17 +0000 (01:14 -0400)]
* lisp/gnus/gnus-util.el (gnus-byte-compile): Use `lexical-binding`