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

2 years agoMake Python evaluation work more reliably
Jin Choi [Sat, 30 Apr 2022 11:34:57 +0000 (13:34 +0200)]
Make Python evaluation work more reliably

* lisp/progmodes/python.el (python-shell-buffer-substring): Make
more regions valid Python code (bug#55174).

Copyright-paperwork-exempt: yes

2 years agoFix some cases of flicker on MS Windows
Po Lu [Sat, 30 Apr 2022 11:02:56 +0000 (19:02 +0800)]
Fix some cases of flicker on MS Windows

* src/w32term.c (w32_read_socket): Fix typo in check before
flipping buffers.

2 years agoTruncate output from grep
Lars Ingebrigtsen [Sat, 30 Apr 2022 10:56:18 +0000 (12:56 +0200)]
Truncate output from grep

* doc/emacs/building.texi (Compilation): Document it.
* lisp/progmodes/compile.el (compilation-max-output-line-length):
New user option (bug#44983).
(compilation-filter): Use it.
(compilation--insert-abbreviated-line): New function.

2 years agoMake grep-mode-font-lock-keywords more efficient
Lars Ingebrigtsen [Sat, 30 Apr 2022 10:47:50 +0000 (12:47 +0200)]
Make grep-mode-font-lock-keywords more efficient

* lisp/progmodes/grep.el (grep-mode-font-lock-keywords): Make the
regexp less greedy so that long lines don't take forever to
font-lock (bug#44983).

2 years agoAdd a KEEP-NEWLINES argument to string-lines
Lars Ingebrigtsen [Sat, 30 Apr 2022 10:46:40 +0000 (12:46 +0200)]
Add a KEEP-NEWLINES argument to string-lines

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

* lisp/subr.el (string-lines): Add a KEEP-NEWLINES argument.

2 years agoFix display updating inside the minibuffer on MS Windows
Po Lu [Sat, 30 Apr 2022 10:54:34 +0000 (18:54 +0800)]
Fix display updating inside the minibuffer on MS Windows

* src/minibuf.c (read_minibuf): Call `w32_flip_buffers_if_dirty'
after changing the cursor position and redisplaying instead of
`flush_frame'.  (bug#55193)

* src/w32term.c (w32_flip_buffers_if_dirty): New function.
* src/w32term.h: Update prototypes.

2 years agoAvoid server roundtrip on wheel events from scroll bars on XI2
Po Lu [Sat, 30 Apr 2022 10:05:44 +0000 (18:05 +0800)]
Avoid server roundtrip on wheel events from scroll bars on XI2

* src/xterm.c (handle_one_xevent): Translate coordinates for
scroll bars correctly when handling XI2 wheel events.

2 years ago; * src/w32term.c (w32_read_socket): Add comment for recent change.
Eli Zaretskii [Sat, 30 Apr 2022 09:35:48 +0000 (12:35 +0300)]
; * src/w32term.c (w32_read_socket): Add comment for recent change.

2 years ago; Minor fixes of documentation of double-buffering on MS-Windows
Eli Zaretskii [Sat, 30 Apr 2022 09:00:33 +0000 (12:00 +0300)]
; Minor fixes of documentation of double-buffering on MS-Windows

* etc/NEWS: Improve and expand wording of the entry about
double-buffering on MS-Windows.

* src/w32fns.c (w32_set_inhibit_double_buffering): Fix commentary.

2 years ago* admin/CPP-DEFINES: Update for new features.
Po Lu [Sat, 30 Apr 2022 08:46:33 +0000 (16:46 +0800)]
* admin/CPP-DEFINES: Update for new features.

2 years agoProcess editres events not for frames correctly
Po Lu [Sat, 30 Apr 2022 07:57:11 +0000 (15:57 +0800)]
Process editres events not for frames correctly

* src/xterm.c (handle_one_xevent): Dispatch Editres events to
interested widgets.

2 years agoAdjustments to double buffering on MS Windows
Po Lu [Sat, 30 Apr 2022 07:49:06 +0000 (15:49 +0800)]
Adjustments to double buffering on MS Windows

* src/w32fns.c (w32_set_inhibit_double_buffering): Add comment
describing double buffering.
(w32_wnd_proc): Respect `w32-disable-double-buffering'.
(globals_of_w32fns): New variable
`w32-disable-double-buffering'.

* src/w32term.c (w32_show_back_buffer): Return immediately if
double buffering is disabled on the frame.
(w32_scroll_run): Use old scrolling code if
`w32-disable-double-buffering' is enabled.
(w32_scroll_bar_clear): Document why we don't clear scroll bars
when double buffering is enabled.
(w32_read_socket): Respect `w32-disable-double-buffering' and
clean up some code.

* src/w32xfns.c (get_frame_dc): Respect
`w32-disable-double-buffering'.

2 years agoFix use of kp-decimal in 'vhdl-stutter-mode'
Eli Zaretskii [Sat, 30 Apr 2022 07:10:07 +0000 (10:10 +0300)]
Fix use of kp-decimal in 'vhdl-stutter-mode'

* lisp/progmodes/vhdl-mode.el (vhdl-electric-period): Avoid
signaling an error when the user presses the kp-decimal key on the
numeric pad in 'vhdl-stutter-mode'.  (Bug#55079)

2 years agoHandle exposure in the widget's expose proc on X
Po Lu [Sat, 30 Apr 2022 06:29:33 +0000 (14:29 +0800)]
Handle exposure in the widget's expose proc on X

* src/widget.c (emacsFrameClassRec): Don't inherit expose proc.
(get_default_char_pixel_size):
(pixel_to_char_size):
(char_to_pixel_size):
(round_size_to_char):
(EmacsFrameInitialize):
(EmacsFrameRealize):
(EmacsFrameResize): Clean up coding style.
(EmacsFrameExpose): New function.  Expose the frame here to
satisfy the toolkit when it calls the expose proc by hand.

* src/xterm.c (handle_one_xevent): Handle exposure through the
widget instead.

2 years agoFix releasing the mouse on top of the tool bar on MS Windows
Po Lu [Sat, 30 Apr 2022 05:26:40 +0000 (13:26 +0800)]
Fix releasing the mouse on top of the tool bar on MS Windows

* src/w32term.c (w32_read_socket): Don't handle tool bar clicks
specially for button up events if no tool bar item was
previously pressed.

2 years agoFix palette freeing on MS Windows with double buffering
Po Lu [Sat, 30 Apr 2022 03:33:38 +0000 (11:33 +0800)]
Fix palette freeing on MS Windows with double buffering

* src/w32term.c (w32_release_paint_buffer): Also release target
DC palette.

2 years agoImplement double buffering on MS Windows
Po Lu [Fri, 29 Apr 2022 03:33:41 +0000 (11:33 +0800)]
Implement double buffering on MS Windows

* etc/NEWS: Announce changes.
* src/w32fns.c (w32_set_inhibit_double_buffering): New function.
(w32_wnd_proc):
(Fx_create_frame):
(w32_create_tip_frame): Set `inhibit-double-buffering' parameter.
(w32_frame_parm_handlers): Add new handler.

* src/w32term.c (w32_show_back_buffer):
(w32_release_paint_buffer): New functions.
(w32_frame_up_to_date): Show back buffer if applicable.
(w32_buffer_flipping_unblocked_hook): New hook.
(w32_scroll_run): Use BitBlt to scroll instead of window
scrolling functions.
(w32_scroll_bar_clear): Don't clear scroll bars when double
buffered.
(w32_read_socket): Flip buffers after reading input events in
some cases.
(w32_free_frame_resources): Free back buffer.
(w32_create_terminal): Add new hook.

* src/w32term.h (struct w32_output): New fields for handling
back buffers.
* src/w32xfns.c (select_palette): Fix indentation.
(get_frame_dc, release_frame_dc): Return back buffer when
appropriate and set dirty flag.

2 years agoPrevent cursors from being set on tooltip frames on Haiku
Po Lu [Sat, 30 Apr 2022 02:34:18 +0000 (02:34 +0000)]
Prevent cursors from being set on tooltip frames on Haiku

* src/haikuterm.c (haiku_show_hourglass, haiku_hide_hourglass)
(haiku_define_frame_cursor, haiku_toggle_invisible_pointer):
Ignore tooltip frames.  Otherwise, the cursor changes every time
a tooltip is mapped.

2 years agodebug-early: Print bytecode in a more manageable way
Stefan Monnier [Sat, 30 Apr 2022 02:18:09 +0000 (22:18 -0400)]
debug-early: Print bytecode in a more manageable way

* lisp/emacs-lisp/debug-early.el (debug-early-backtrace):
Escape newlines to and bytecodes to make backtraces slightly more
readable.  Use `cl-prin1` when available.

2 years ago* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add `symbol-with-pos`
Stefan Monnier [Sat, 30 Apr 2022 02:13:20 +0000 (22:13 -0400)]
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add `symbol-with-pos`

2 years agoFix focus reversion of Motif menus on XI2
Po Lu [Sat, 30 Apr 2022 01:29:56 +0000 (09:29 +0800)]
Fix focus reversion of Motif menus on XI2

* src/xmenu.c (create_and_show_popup_menu): Stop setting input
focus on the menu window.

2 years agoFix mouse face bugs on Motif
Po Lu [Sat, 30 Apr 2022 01:22:20 +0000 (09:22 +0800)]
Fix mouse face bugs on Motif

* src/xterm.c (handle_one_xevent): Fix handling LeaveNotify
events from Motif menus.

2 years agoCheck display when handling XdndFinished events
Po Lu [Sat, 30 Apr 2022 00:47:42 +0000 (08:47 +0800)]
Check display when handling XdndFinished events

* src/xterm.c (handle_one_xevent): Check that the display is
actually the one we want before finishing DND.

2 years agoCL types: Accept both `byte-code-function` and `compiled-function`
Stefan Monnier [Fri, 29 Apr 2022 19:29:35 +0000 (15:29 -0400)]
CL types: Accept both `byte-code-function` and `compiled-function`

`type-of` returns `compiled-function` for bytecode functions, but the
predicate for those objects is called `byte-code-function-p`,
So accept both `compiled-function` and `byte-code-function` as type
names for those objects.

* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types):
Add `byte-code-function`.
* lisp/emacs-lisp/cl-macs.el (byte-code-function, compiled-function, subr):
New types.

2 years ago* test/lisp/replace-tests.el (query-replace-tests): Add more tests (bug#54733)
Juri Linkov [Fri, 29 Apr 2022 17:40:15 +0000 (20:40 +0300)]
* test/lisp/replace-tests.el (query-replace-tests): Add more tests (bug#54733)

(perform-replace-tests): New tests.
(perform-replace--run-tests): New function.
(perform-replace-tests): New test function.

2 years agoSimplify window-char-pixel-* code slightly
Lars Ingebrigtsen [Fri, 29 Apr 2022 13:52:21 +0000 (15:52 +0200)]
Simplify window-char-pixel-* code slightly

* lisp/window.el (window-char-pixel-width)
(window-char-pixel-height): Simplify code slightly.

2 years agoExplain effects of setting a zero-width fringe
Lars Ingebrigtsen [Fri, 29 Apr 2022 13:31:06 +0000 (15:31 +0200)]
Explain effects of setting a zero-width fringe

* lisp/fringe.el (fringe-mode): Not non-obvious effects of setting
a fringe to zero width.

2 years agoAdd new functions for computing character metrics for windows
Titus von der Malsburg [Fri, 29 Apr 2022 13:14:09 +0000 (15:14 +0200)]
Add new functions for computing character metrics for windows

* doc/lispref/display.texi (Size of Displayed Text): Document the
char functions.
* doc/lispref/windows.texi (Window Sizes): Document
window-max-characters-per-line.

* lisp/window.el (window-char-pixel-width)
(window-char-pixel-height)
(window-max-characters-per-line): New functions (bug#19395).

2 years agoMake timer_check even more resilient
Pip Cet [Fri, 29 Apr 2022 12:14:19 +0000 (14:14 +0200)]
Make timer_check even more resilient

* src/keyboard.c (timer_check): Inhibit atimers while making the
copy of the timer list (bug#21380).  This prevents an extremely
unlikely segfault.

2 years agoAvoid binding mouse-1 in xref when mouse-1 doesn't follow links
Lars Ingebrigtsen [Fri, 29 Apr 2022 11:57:57 +0000 (13:57 +0200)]
Avoid binding mouse-1 in xref when mouse-1 doesn't follow links

* lisp/progmodes/xref.el (xref--button-map): Avoid binding mouse-1
when `mouse-1-click-follows-link' is nil (bug#35353).

2 years agoFix colorspace calculations on Haiku
Po Lu [Fri, 29 Apr 2022 11:06:52 +0000 (11:06 +0000)]
Fix colorspace calculations on Haiku

* src/haiku_support.cc (be_get_display_planes)
(be_get_display_color_cells): Handle grayscale basic colorspaces
correctly.
(be_is_display_grayscale): New function.

* src/haiku_support.h: Update prototypes.

* src/haikufns.c (haiku_set_no_accept_focus, haiku_iconify_frame)
(Fxw_display_color_p, Fxw_color_values, Fx_display_grayscale_p):
Actually handle grayscale colorspaces.
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_mm_height, Fx_display_mm_width): Clean up coding
style.
(Fx_display_visual_class): Handle grayscale colorspaces.
(syms_of_haikufns): New defsyms.

2 years agoAdd helper function to remove title bar when maximizing frames
Lars Ingebrigtsen [Fri, 29 Apr 2022 10:42:06 +0000 (12:42 +0200)]
Add helper function to remove title bar when maximizing frames

* lisp/frame.el (toggle-frame-maximized): Mention it.
(frame-hide-title-bar-when-maximized): New function (bug#31968).
Adapted from code by Jonathan Kyle Mitchell.

* src/window.c (syms_of_window): Mention it.

2 years ago; Fix typo in documentation of 'current-time-list'
Eli Zaretskii [Fri, 29 Apr 2022 07:12:02 +0000 (10:12 +0300)]
; Fix typo in documentation of 'current-time-list'

* src/timefns.c (syms_of_timefns) <current-time-list>:
* etc/NEWS:
* doc/lispref/os.texi (Time of Day): Fix a typo.

2 years agoHandle IO errors when creating Motif drag window
Po Lu [Fri, 29 Apr 2022 05:48:02 +0000 (13:48 +0800)]
Handle IO errors when creating Motif drag window

* src/xterm.c (xm_drag_window_io_error_handler): New function.
(xm_get_drag_window): Use that as the IO error handler when the
temporary display is open.

2 years agoFix file name selection conversion on Haiku
Po Lu [Fri, 29 Apr 2022 04:22:17 +0000 (04:22 +0000)]
Fix file name selection conversion on Haiku

* lisp/term/haiku-win.el (haiku-normal-selection-encoders):
Register new encoder.
(haiku-select-encode-file-name): New function.

2 years agoRemove some unneeded tests from the X double buffering code
Po Lu [Fri, 29 Apr 2022 03:52:22 +0000 (11:52 +0800)]
Remove some unneeded tests from the X double buffering code

* src/xterm.c (x_flip_and_flush): Fix coding style.
(flush_dirty_back_buffer_on): Avoid testing for impossible
situations.

2 years ago; * src/xterm.c (x_connection_closed): Clean up compiler warning.
Po Lu [Fri, 29 Apr 2022 01:35:58 +0000 (09:35 +0800)]
; * src/xterm.c (x_connection_closed): Clean up compiler warning.

2 years agoCancel DND correctly during display disconnect on a different display
Po Lu [Fri, 29 Apr 2022 01:27:51 +0000 (09:27 +0800)]
Cancel DND correctly during display disconnect on a different display

* src/xterm.c (x_dnd_io_error_handler): New function.
(x_connection_closed): Send the messages to cancel DND if a
different display was disconnected.

2 years ago* src/xterm.c (XTflash): Check return value of pselect.
Po Lu [Fri, 29 Apr 2022 00:43:27 +0000 (08:43 +0800)]
* src/xterm.c (XTflash): Check return value of pselect.

2 years agoFind libgccjit.dylib on Homebrew Macos
Eugene Ha [Thu, 28 Apr 2022 21:48:38 +0000 (23:48 +0200)]
Find libgccjit.dylib on Homebrew Macos

* configure.ac: Also find libggcjit on Homebrew (bug#55173).

Copyright-paperwork-exempt: yes

2 years agoPacify byte compiler etc. on org-compat, org-macs
Paul Eggert [Thu, 28 Apr 2022 20:40:13 +0000 (13:40 -0700)]
Pacify byte compiler etc. on org-compat, org-macs

Byte-compiler problem reported by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg01256.html
* lisp/org/org-compat.el (org-at-table.el-p):
Now declared in org-table, not org.
(org-string-collate-lessp): Define the ersatz
org-string-collate-lessp with the same API as the primary form, to
pacify check-declare-file when run on org-macs.
* lisp/org/org-macs.el (org-time-convert-to-integer): Declare.

2 years agoChange current-time back to list form
Paul Eggert [Thu, 28 Apr 2022 19:50:39 +0000 (12:50 -0700)]
Change current-time back to list form

Change current-time and related functions back to using the
traditional list form.  Also, add a new boolean variable
current-time-list that lets people try out (TICKS . HZ) form,
with the goal of smoothing the transition.
* src/timefns.c (CURRENT_TIME_LIST): Change default back to true.
(current-time-list): New boolean Lisp variable, which defaults to
CURRENT_TIME_LIST.  All uses of CURRENT_TIME_LIST changed to
use current_time_list, and all documentation changed.

2 years agoDocument \807 etc. in raw byte display
Paul Eggert [Thu, 28 Apr 2022 17:51:01 +0000 (10:51 -0700)]
Document \807 etc. in raw byte display

* doc/emacs/display.texi (Display Custom): Mention potential
confusion in raw byte display.

2 years agoKill off more Gnus buffers on Gnus exit
Lars Ingebrigtsen [Thu, 28 Apr 2022 16:36:59 +0000 (18:36 +0200)]
Kill off more Gnus buffers on Gnus exit

* lisp/gnus/gnus.el (gnus-kill-buffer): Make into function;
there's no reason this should be a macro.

* lisp/gnus/nntp.el (nntp-make-process-buffer): Ensure that we
kill these buffers on Gnus exit (bug#55167).

2 years agoAdd Sefirot to Omer counting
Sam Steingold [Thu, 28 Apr 2022 15:35:51 +0000 (11:35 -0400)]
Add Sefirot to Omer counting

* lisp/calendar/cal-hebrew.el (diary-hebrew-omer-sefirot): New variable.
(diary-hebrew-omer): Use it to show the sefirot.

2 years ago; * lisp/progmodes/xref.el (xref-query-replace-in-results): Fix last change.
Eli Zaretskii [Thu, 28 Apr 2022 15:41:53 +0000 (18:41 +0300)]
; * lisp/progmodes/xref.el (xref-query-replace-in-results): Fix last change.

2 years agoMerge from origin/emacs-28
Eli Zaretskii [Thu, 28 Apr 2022 15:37:34 +0000 (18:37 +0300)]
Merge from origin/emacs-28

# Conflicts:
# lisp/progmodes/xref.el

2 years ago; Merge from origin/emacs-28
Eli Zaretskii [Thu, 28 Apr 2022 15:36:15 +0000 (18:36 +0300)]
; Merge from origin/emacs-28

The following commit was skipped:

4d4f564 Fix customization-group of 'python-forward-sexp-function'

2 years agoAdd tests for image-supported-file-p
Stefan Kangas [Thu, 28 Apr 2022 15:01:20 +0000 (17:01 +0200)]
Add tests for image-supported-file-p

* test/lisp/image-tests.el (image-type-from-file-name): Suppress
obsoletion warnings for test.
(image-supported-file-p/built-in)
(image-supported-file-p/optional)
(image-supported-file-p/unsupported-returns-nil): New tests.

2 years ago* lisp/finder.el (finder-mode-map): Use defvar-keymap.
Stefan Kangas [Thu, 24 Mar 2022 08:55:10 +0000 (09:55 +0100)]
* lisp/finder.el (finder-mode-map): Use defvar-keymap.

2 years agoImprove documentation of font- and face-related attribute functions
Eli Zaretskii [Thu, 28 Apr 2022 14:53:36 +0000 (17:53 +0300)]
Improve documentation of font- and face-related attribute functions

* lisp/faces.el (face-attribute):
* src/xfaces.c (Fx_family_fonts):
* src/font.c (Ffont_get, Ffont_put): Improve and clarify the doc
strings.

* doc/lispref/display.texi (Low-Level Font): Document the :type
attribute of a font.  Improve documentation of 'font-get' and
'font-put'.
(Attribute Functions): Add cross-reference to the description of
face attributes.

2 years ago* lisp/emacs-lisp/nadvice.el: Fix bug#55149
Stefan Monnier [Thu, 28 Apr 2022 13:38:58 +0000 (09:38 -0400)]
* lisp/emacs-lisp/nadvice.el: Fix bug#55149

2 years agoAllow inserting and selecting binary blobs from sqlite
Lars Ingebrigtsen [Thu, 28 Apr 2022 12:58:20 +0000 (14:58 +0200)]
Allow inserting and selecting binary blobs from sqlite

* doc/lispref/text.texi (Database): Document how to insert binary
data.
* src/sqlite.c (bind_values): Bind BLOB columns correctly (bug#54591).

2 years agoSimplify buffer flipping code on Haiku
Po Lu [Thu, 28 Apr 2022 12:50:47 +0000 (12:50 +0000)]
Simplify buffer flipping code on Haiku

* src/haikuterm.c (flush_dirty_back_buffers): Delete function.
(haiku_flush_dirty_back_buffer_on): New function.
(haiku_read_socket): Use that instead of looping over each frame
at the end.

2 years agoDocument dired-keep-marker-copy more
Lars Ingebrigtsen [Thu, 28 Apr 2022 11:50:25 +0000 (13:50 +0200)]
Document dired-keep-marker-copy more

* doc/emacs/dired.texi (Operating on Files): Mention
dired-keep-marker-copy.

2 years agoImprove dired-do-copy doc string
Lars Ingebrigtsen [Thu, 28 Apr 2022 11:48:17 +0000 (13:48 +0200)]
Improve dired-do-copy doc string

* lisp/dired-aux.el (dired-do-copy): Mention the
`dired-keep-marker-copy' variable in the doc string (bug#21746).

2 years agoDocument the non-effect of narrowing on get-text-property
Lars Ingebrigtsen [Thu, 28 Apr 2022 11:04:28 +0000 (13:04 +0200)]
Document the non-effect of narrowing on get-text-property

* doc/lispref/text.texi (Examining Properties): Document
surprising non-effect of narrowing (bug#16413).

* src/textprop.c (Ftext_properties_at, Fget_text_property):
Mention narrowing.