]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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`

2 years agoFix race conditions with async input in some Haiku dialogs
Po Lu [Mon, 2 May 2022 01:59:52 +0000 (01:59 +0000)]
Fix race conditions with async input in some Haiku dialogs

* src/haikufns.c (Fhaiku_save_session_reply):
* src/haikufont.c (Fx_select_font): Block sigio around system
calls.

2 years agoFix the macOS build
Po Lu [Mon, 2 May 2022 01:38:36 +0000 (09:38 +0800)]
Fix the macOS build

* src/nsterm.m (ns_font_desc_to_font_spec, syms_of_nsterm):
Define missing symbols that are only on GNUstep.

2 years agoMake the NS font dialog return more correct values
Po Lu [Mon, 2 May 2022 01:32:54 +0000 (09:32 +0800)]
Make the NS font dialog return more correct values

* src/nsfns.m (Fx_select_font): Update doc string.
* src/nsterm.m (ns_font_desc_to_font_spec): New
function.
([EmacsView showFontPanel]): Return selected font as a
font spec instead.

2 years agoFix devices staying disabled in some cases
Po Lu [Mon, 2 May 2022 00:49:40 +0000 (08:49 +0800)]
Fix devices staying disabled in some cases

* src/xterm.c (handle_one_xevent): Process queued disables
before handling an XIDeviceEnabled situation.

2 years agoFix string-lines return for ""
Lars Ingebrigtsen [Sun, 1 May 2022 21:05:06 +0000 (23:05 +0200)]
Fix string-lines return for ""

* lisp/subr.el (string-lines): Return the correct result on ""
(bug#55213).

2 years agoChange string-lines semantics slightly
Lars Ingebrigtsen [Sun, 1 May 2022 18:54:11 +0000 (20:54 +0200)]
Change string-lines semantics slightly

* lisp/subr.el (string-lines): Change the semantics slightly --
don't return an empty string for a trailing newline.

2 years agoHandle escaped characters in Eshell special references (e.g. buffers)
Jim Porter [Wed, 27 Apr 2022 04:53:00 +0000 (21:53 -0700)]
Handle escaped characters in Eshell special references (e.g. buffers)

* lisp/eshell/esh-arg.el (eshell-parse-special-reference): Unescape
escaped characters.

* test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell): Restore
current buffer after evaluating BODY.

* test/lisp/eshell/eshell-tests.el (eshell-test/redirect-buffer)
(eshell-test/redirect-buffer-escaped): New tests (bug#55204).

2 years agoHandle escaped characters in Eshell argument predicates/modifiers
Jim Porter [Wed, 27 Apr 2022 04:51:23 +0000 (21:51 -0700)]
Handle escaped characters in Eshell argument predicates/modifiers

* lisp/eshell/em-pred.el (eshell-get-delimited-modifier-argument):
Unescape escaped characters.

* test/lisp/eshell/em-pred-tests.el (em-pred-test/predicate-escaping):
New test (bug#55204).

2 years agoUse a common set of string delimiters for all Eshell predicates/modifiers
Jim Porter [Mon, 28 Mar 2022 05:28:40 +0000 (22:28 -0700)]
Use a common set of string delimiters for all Eshell predicates/modifiers

* lisp/eshell/em-pred.el (eshell-pred-delimiter-pairs): New variable.
(eshell-get-comparison-modifier-argument)
(eshell-get-numeric-modifier-argument)
(eshell-get-delimited-modifier-argument): New functions...
(eshell-pred-user-or-group, eshell-pred-file-time)
(eshell-pred-file-links, eshell-pred-file-size)
(eshell-pred-substitute, eshell-join-memebers, eshell-split-members):
... and use them here.
(eshell-include-members): Pass 'mod-char' and use
'eshell-get-delimited-modifier-argument'.
(eshell-pred-file-type, eshell-pred-file-mode): Use 'when-let'.
(eshell-modifier-alist): Pass modifier char to
'eshell-include-members'.

* test/lisp/eshell/em-pred-tests.el
(em-pred-test/predicate-delimiters): New test.
(em-pred-test/predicate-uid, em-pred-test/predicate-gid,
em-pred-test/modifier-include, em-pred-test/modifier-exclude): Remove
cases covered by 'em-pred-test/predicate-delimiters'.
(em-pred-test/modifier-substitute): Add test cases for new delimiter
styles.

* doc/misc/eshell.texi (Argument Predication and Modification):
Explain how string parameters are delimited.
(Argument Modifiers): Document some special delimiter behavior with
the 's/PATTERN/REPLACE/' modifier (bug#55204).

* etc/NEWS: Announce this change, and move the
'eshell-eval-using-options' entry to the Eshell section.

2 years ago* lisp/minibuffer.el (completion--replace): Fix bug#55205
Stefan Monnier [Sun, 1 May 2022 17:04:44 +0000 (13:04 -0400)]
* lisp/minibuffer.el (completion--replace): Fix bug#55205

2 years agoReplace NS code that implemented font panels in a different way
Po Lu [Sun, 1 May 2022 13:39:33 +0000 (21:39 +0800)]
Replace NS code that implemented font panels in a different way

* doc/emacs/macos.texi (Mac / GNUstep Events): Document removal
of `ns-change-font' event.  The font panels are now implemented
normally, via `x-select-font'.

* lisp/term/common-win.el (x-setup-function-keys): Likewise.

* lisp/term/ns-win.el (global-map, ns-popup-font-panel): Remove.
(x-select-font, mouse-set-font, ns-input-font):
(ns-input-fontsize): Remove.
(ns-respond-to-change-font): Delete function.

* src/nsfns.m (Fns_popup_font_panel): Delete function.
(Fx_select_font): New function.
(syms_of_nsfns): Update subrs.
* src/nsterm.h (@interface EmacsView):
* src/nsterm.m (ns_select_1): New function.
(ns_select): Wrap around that instead.
([EmacsView changeFont:]): Exit nested event loop
([EmacsView showFontPanel:]): New function.

2 years agoDon't enter the debugger from *Backtrace* or edebug on eval errors
Lars Ingebrigtsen [Sun, 1 May 2022 11:40:13 +0000 (13:40 +0200)]
Don't enter the debugger from *Backtrace* or edebug on eval errors

* doc/lispref/debugging.texi (Error Debugging): Document it.

* doc/lispref/edebug.texi (Edebug Eval): Mention it.
* lisp/emacs-lisp/debug.el (debug-allow-recursive-debug): New user
option (bug#36145).
(debugger-eval-expression): Use it.

* lisp/emacs-lisp/edebug.el (edebug-eval-expression): Ditto.

This patch is based on a patch by Noam Postavsky.

2 years agoCorrect Using Debugger lispref node
Lars Ingebrigtsen [Sun, 1 May 2022 11:07:14 +0000 (13:07 +0200)]
Correct Using Debugger lispref node

* doc/lispref/debugging.texi (Using Debugger): Make documentation
reflect reality (bug#36145).

2 years agoMake scroll-other-window respect target window remappings
Lars Ingebrigtsen [Sun, 1 May 2022 10:47:31 +0000 (12:47 +0200)]
Make scroll-other-window respect target window remappings

* lisp/window.el (scroll-other-window, scroll-other-window-down):
Moved from window.c and change implementation so that they respect
command remappings in the target window (bug#20236).

2 years agoImprove documentation of 'malloc-trim'
Eli Zaretskii [Sun, 1 May 2022 10:06:33 +0000 (13:06 +0300)]
Improve documentation of 'malloc-trim'

* src/alloc.c (Fmalloc_trim): Fix the doc string.

* etc/NEWS: Document which systems support 'malloc-trim'.

2 years agoAdd new function `malloc-trim'
Lars Ingebrigtsen [Sun, 1 May 2022 09:51:35 +0000 (11:51 +0200)]
Add new function `malloc-trim'

* configure.ac (PGTK_LIBS): Check for malloc_trim.

* src/alloc.c (Fmalloc_trim): Add new function (bug#45200).

2 years agoFix specifying zero as a size for fonts on Haiku
Po Lu [Sun, 1 May 2022 09:08:33 +0000 (09:08 +0000)]
Fix specifying zero as a size for fonts on Haiku

* src/haiku_support.cc (MessageReceived): Set `size_specified'
correctly.

2 years agoImprove display of Haiku font dialog
Po Lu [Sun, 1 May 2022 08:53:51 +0000 (08:53 +0000)]
Improve display of Haiku font dialog

* src/haiku_support.cc (EmacsFontSelectionDialog)
(class EmacsFontSelectionDialog, FrameResized): Set minimum size
based on individual view dimensions and add label to size
control.
(BWindow_set_min_size): Delete function.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_update_size_hints): Stop setting min
size, since that doesn't work correctly on Haiku.

2 years agoFix the mm-decode-content-transfer-encoding overflow better
Lars Ingebrigtsen [Sun, 1 May 2022 08:20:07 +0000 (10:20 +0200)]
Fix the mm-decode-content-transfer-encoding overflow better

* lisp/gnus/mm-bodies.el (mm-decode-content-transfer-encoding):
Use it.
(mm-base64-line-p): New function.

2 years ago* lisp/menu-bar.el (menu-bar-search-menu): Remove extra separator.
Po Lu [Sun, 1 May 2022 07:20:25 +0000 (07:20 +0000)]
* lisp/menu-bar.el (menu-bar-search-menu): Remove extra separator.

2 years agoDocument 'help-window-select'
Eli Zaretskii [Sun, 1 May 2022 07:01:28 +0000 (10:01 +0300)]
Document 'help-window-select'

* etc/NEWS:
* doc/emacs/help.texi (Apropos, Help): Document
'help-window-select'; improve indexing.  (Bug#46034)

2 years agoAllow specifying font size in the Haiku font selection dialog
Po Lu [Sun, 1 May 2022 05:41:33 +0000 (05:41 +0000)]
Allow specifying font size in the Haiku font selection dialog

* src/haiku_support.cc (struct font_selection_dialog_message):
New fields `size' and `size_specified'.
(class EmacsFontSelectionDialog): New `size_entry' control.
(MessageReceived): Set size from that control if available.
(EmacsFontSelectionDialog): Initialize that control.
(FrameResized): Handle layout for that control.
(be_select_font): New field `size'.
* src/haiku_support.h: Update prototypes.
* src/haikufont.c (Fx_select_font): Populate font spec with
size.

2 years agoUpdate publicsuffix.txt from upstream
Stefan Kangas [Sun, 1 May 2022 04:01:28 +0000 (06:01 +0200)]
Update publicsuffix.txt from upstream

* etc/publicsuffix.txt: Update from
https://publicsuffix.org/list/public_suffix_list.dat
dated 2022-04-30 19:52:14 UTC.

2 years agoAllow quitting inside font selection dialogs on Haiku
Po Lu [Sun, 1 May 2022 03:20:58 +0000 (03:20 +0000)]
Allow quitting inside font selection dialogs on Haiku

* src/haiku_support.cc (WaitForChoice): Accept new function for
checking quit flag.
(be_select_font): Pass that function.
* src/haiku_support.h: Update prototypes.
* src/haikufont.c (haikufont_should_quit_popup): New function.
(Fx_select_font): Give said function to `be_select_font'.

2 years agoAllow invoking fonts in the Haiku font dialog
Po Lu [Sun, 1 May 2022 02:43:18 +0000 (02:43 +0000)]
Allow invoking fonts in the Haiku font dialog

* src/haiku_support.cc (MessageReceived): Handle invocations.
(EmacsFontSelectionDialog): Set style panel invocation message.

2 years agoImprovements to the Haiku font dialog
Po Lu [Sun, 1 May 2022 02:17:04 +0000 (02:17 +0000)]
Improvements to the Haiku font dialog

* src/haiku_support.cc (class EmacsFontSelectionDialog)
(EmacsFontSelectionDialog, FrameResized): Fix colors and respect
monospace only.
(be_select_font): New parameter `allow_monospace_only'.
* src/haiku_support.h: Update prototype.
* src/haikufont.c (Fx_select_font): Respect
`exclude-proportional'.

2 years agoAlso fix some compiler warnings in xterm.c that didn't show up
Po Lu [Sun, 1 May 2022 01:44:46 +0000 (09:44 +0800)]
Also fix some compiler warnings in xterm.c that didn't show up

* src/xterm.c (x_dnd_begin_drag_and_drop): Don't define unused
variable on GTK builds.

2 years agoFix the GTK build
Po Lu [Sun, 1 May 2022 01:43:08 +0000 (09:43 +0800)]
Fix the GTK build

* src/xterm.c (x_dnd_begin_drag_and_drop): Let GTK handle events
again.

2 years ago* src/xterm.c (x_dnd_begin_drag_and_drop): Fix typo.
Po Lu [Sun, 1 May 2022 01:41:16 +0000 (09:41 +0800)]
* src/xterm.c (x_dnd_begin_drag_and_drop): Fix typo.

2 years agoFix processing events from multiple displays during DND
Po Lu [Sun, 1 May 2022 01:37:12 +0000 (09:37 +0800)]
Fix processing events from multiple displays during DND

* src/xterm.c (x_next_event_from_any_display): New function.
Only used on no-toolkit builds.
(x_dnd_begin_drag_and_drop): Compute correct dpyinfo for
handle_one_xevent.

2 years agoClean up X Windows tooltip code
Po Lu [Sun, 1 May 2022 01:15:52 +0000 (09:15 +0800)]
Clean up X Windows tooltip code

* src/xfns.c (x_hide_tip): Remove "bloodcurdling hack".
* src/xterm.c (handle_one_xevent): Add a better version here
instead.  The code is unlikely to be hit as well, since tooltip
frames are typically deleted, not just hidden.

2 years agoImplement font selection dialog on Haiku
Po Lu [Sun, 1 May 2022 00:59:55 +0000 (00:59 +0000)]
Implement font selection dialog on Haiku

* src/haiku_font_support.cc (font_style_to_flags): Handle style
allocation failures.
(be_font_style_to_flags): New function.

* src/haiku_support.cc (struct font_selection_dialog_message):
New struct.
(class EmacsFontSelectionDialog): New class.
(be_select_font): New function.

* src/haiku_support.h: Update prototypes.
* src/haikufont.c (Fx_select_font): New function.
(syms_of_haikufont): Define new subr.

2 years agoFix failing image test on nox builds
Basil L. Contovounesios [Sat, 30 Apr 2022 22:19:51 +0000 (01:19 +0300)]
Fix failing image test on nox builds

* test/lisp/image-tests.el (image-supported-file-p/built-in): Skip
test in --without-x builds.

2 years agoMake `M-x apropos' respect help-window-select
Lars Ingebrigtsen [Sat, 30 Apr 2022 19:34:18 +0000 (21:34 +0200)]
Make `M-x apropos' respect help-window-select

* lisp/apropos.el (apropos-print): Respect help-window-select.
(apropos): Mention it (bug#46034).

2 years agoMake load-path-shadows-mode a special mode
Lars Ingebrigtsen [Sat, 30 Apr 2022 18:34:35 +0000 (20:34 +0200)]
Make load-path-shadows-mode a special mode

* lisp/emacs-lisp/shadow.el (load-path-shadows-mode): Make the
mode inherit from special-mode so that the `q' command works.

2 years agoFix compilation-max-output-line-length type
Lars Ingebrigtsen [Sat, 30 Apr 2022 17:42:42 +0000 (19:42 +0200)]
Fix compilation-max-output-line-length type

* lisp/progmodes/compile.el (compilation-max-output-line-length):
Fix the type.

2 years agoAvoid regexp overflow in mm-decode-content-transfer-encoding
Lars Ingebrigtsen [Sat, 30 Apr 2022 17:14:35 +0000 (19:14 +0200)]
Avoid regexp overflow in mm-decode-content-transfer-encoding

* lisp/gnus/mm-bodies.el (mm-decode-content-transfer-encoding):
The base64 may be huge, so avoid backtracking (bug#55195).

2 years agoFix Vx_show_tooltip_timeout in ns build, too
Lars Ingebrigtsen [Sat, 30 Apr 2022 16:21:51 +0000 (18:21 +0200)]
Fix Vx_show_tooltip_timeout in ns build, too

* src/nsfns.m (Fx_show_tip): Respect Vx_show_tooltip_timeout here,
too.

2 years agoFix compilation after recent x-show-tooltip-timeout changes
Lars Ingebrigtsen [Sat, 30 Apr 2022 16:20:19 +0000 (18:20 +0200)]
Fix compilation after recent x-show-tooltip-timeout changes

* src/dispnew.c (syms_of_display): Move x-show-tooltip-timeout to
a common file to avoid breaking other systems.

2 years agoRemove the "retro" Gnus/Message tool bars
Lars Ingebrigtsen [Sat, 30 Apr 2022 16:17:47 +0000 (18:17 +0200)]
Remove the "retro" Gnus/Message tool bars

* doc/misc/gnus.texi (Gravatars): Remove documentation.
* lisp/gnus/gmm-utils.el (gmm-tool-bar-style): Obsoleted.

* lisp/gnus/gnus-group.el (gnus-group-tool-bar): Use the "Gnome"
definition.
(gnus-group-tool-bar-gnome, gnus-group-tool-bar-retro)
(gnus-group-tool-bar-zap-list): Obsolete.

* lisp/gnus/gnus-sum.el (gnus-summary-tool-bar): Use the "Gnome"
definition.
(gnus-summary-tool-bar-gnome, gnus-summary-tool-bar-retro)
(gnus-summary-tool-bar-zap-list): Obsolete.

* lisp/gnus/message.el (message-tool-bar): Use the "Gnome"
definition.
(message-tool-bar-gnome, message-tool-bar-retro)
(message-tool-bar-zap-list): Obsolete.

2 years ago* lisp/gnus/deuglify.el (gnus-article-outlook-rearrange-citation): Add autoload cookie.
Andreas Schwab [Sat, 30 Apr 2022 12:46:28 +0000 (14:46 +0200)]
* lisp/gnus/deuglify.el (gnus-article-outlook-rearrange-citation): Add autoload cookie.

2 years agoUse x-show-tooltip-timeout in all the implementations
Lars Ingebrigtsen [Sat, 30 Apr 2022 15:38:34 +0000 (17:38 +0200)]
Use x-show-tooltip-timeout in all the implementations

* src/haikufns.c (Fx_show_tip): Use the timeout variable.
* src/pgtkfns.c (Fx_show_tip): Ditto.

* src/w32fns.c (Fx_show_tip): Ditto.

* src/xfns.c (Fx_show_tip): Doc fix.

2 years agoDon't hard code the default x-show-tip timeout
Lars Ingebrigtsen [Sat, 30 Apr 2022 15:09:02 +0000 (17:09 +0200)]
Don't hard code the default x-show-tip timeout

* src/xfns.c (Fx_show_tip): Use it.
(syms_of_xfns): Add a new x-show-tooltip-timeout variable
(bug#23341).

2 years agoMove the when-let family of macros to subr.el
Lars Ingebrigtsen [Sat, 30 Apr 2022 14:42:44 +0000 (16:42 +0200)]
Move the when-let family of macros to subr.el

* lisp/subr.el (internal--build-binding)
(internal--build-bindings): Moved from subr-x.el and rewritten to
not use the threading macro.
(if-let*, when-let*, and-let*, if-let, when-let): Moved from
subr-x.el.  This avoids breaking the build every time somebody
uses these macros in functions that end up being called during
bootstrap.

2 years agoAvoid using if-let in subr.el
Lars Ingebrigtsen [Sat, 30 Apr 2022 14:24:55 +0000 (16:24 +0200)]
Avoid using if-let in subr.el

* lisp/subr.el (string-lines): Avoid using if-let (from subr-x) in
subr (bug#55194).

2 years ago; * doc/lispref/strings.texi (Creating Strings): Fix a typo.
Eli Zaretskii [Sat, 30 Apr 2022 11:54:35 +0000 (14:54 +0300)]
; * doc/lispref/strings.texi (Creating Strings): Fix a typo.

2 years agoMake the xref--button-map more regular
Lars Ingebrigtsen [Sat, 30 Apr 2022 11:38:04 +0000 (13:38 +0200)]
Make the xref--button-map more regular

* lisp/progmodes/xref.el (xref--button-map): Remove the mouse-1
binding (bug#35353).