* 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.
* 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.
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.
* 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.
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)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Po Lu [Thu, 28 Apr 2022 02:50:18 +0000 (10:50 +0800)]
Stop overriding default Motif colors with our own
* src/xrdb.c (x_load_resources): Instead of specifying the Motif
defaults manually, let Motif set them itself. This makes
palettes provided by color servers work again.
Po Lu [Thu, 28 Apr 2022 01:31:29 +0000 (09:31 +0800)]
Handle display disconnects during DND
* src/xterm.c (handle_one_xevent): Keep track of the display the
drop target is on during DND finish.
(x_connection_closed, x_delete_terminal): Handle display
disconnects during DND correctly.
Stefan Monnier [Wed, 27 Apr 2022 22:14:56 +0000 (18:14 -0400)]
src/xdisp.c: Use same test in `redisplay_window` and `prepare_menu_bars`
This consolidates the test made in those two functions so as to make
sure they agree whether a window needs to be redisplayed.
At the same time, change this test so it uses the window's point
rather than the buffer's point when comparing to `w->last_point`.
* src/xdisp.c (needs_no_redisplay): New function, extracted from
`redisplay_window`.
(redisplay_window, prepare_menu_bars): Use it.
* src/window.c (window_point): New function, extracted from `Fwindow_point`.
(Fwindow_point): Use it.
* src/window.h (window_point): Declare it.
Sean Whitton [Tue, 26 Apr 2022 18:39:38 +0000 (11:39 -0700)]
New user option 'calc-kill-line-numbering'
* lisp/calc/calc.el (calc-kill-line-numbering): New defcustom.
* lisp/calc/calc-yank.el (calc-kill): Unless calc-kill-line-numbering
is non-nil, do not include line numbering in copied text (bug#55133).
* etc/NEWS:
* doc/misc/calc.texi (Killing from the Stack): Document the change.
Ken Brown [Wed, 27 Apr 2022 14:46:57 +0000 (10:46 -0400)]
Implement system_process_attributes on Cygwin
* src/sysdep.c (system_process_attributes) [CYGWIN]: Implement,
using the /proc filesystem. The code is identical to the
GNU/Linux code except for the 'ttname' attribute. (Bug#55153)
* lisp/textmodes/string-edit.el (string-edit)
(read-string-from-buffer): Rework the function arguments so that
they're more similar to `read-string'. Rename symbols throughout
the file from help-text to prompt.
* doc/emacs/killing.texi (Secondary Selection): Document it.
* lisp/isearch.el (isearch-mouse-2): Make isearch respond to
mouse-yank-at-point (bug#7787).
* lisp/mouse.el (mouse-yank-at-point): Mention it.