Add new user option display-buffer-avoid-small-windows
* doc/lispref/windows.texi (Choosing Window Options): Document it.
* lisp/window.el (display-buffer-avoid-small-windows): New user
option (bug#10186).
(get-lru-window): Use it.
Po Lu [Fri, 20 May 2022 05:34:04 +0000 (05:34 +0000)]
Remove flickering when toggling between different fullscreen states on Haiku
* src/haiku_support.cc (FrameMoved): Don't allow moving the
frame along the "filled" axis when fullwidth or fullheight.
(ClearFullscreen): New argument `mode'. Return the previous
rect but don't revert the frame to it if the target mode is not
NONE.
(SetFullscreen): Use rect provided by ClearFullscreen instead.
Po Lu [Fri, 20 May 2022 03:21:47 +0000 (11:21 +0800)]
Minor cleanups to X drag-and-drop code
* src/xterm.c (struct x_client_list_window): Write comments
describing the meaning of each field.
(XM_DRAG_PROTOCOL_VERSION, xm_setup_dnd_targets)
(xm_setup_drag_info, xm_read_drag_receiver_info)
(x_dnd_compute_toplevels): Don't hard-code the supported Motif
protocol version.
* lisp/emacs-lisp/lisp-mode.el (lisp--el-funcall-position-p):
Don't colorize the `function' in (defun foo (function ...)) as a
special form (bug#37074).
Make completion in emacs-lisp-mode intern fewer symbols
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Don't
intern the string before point just to check whether we're looking
at `ignore-error' (bug#55491).
Due to "The Orissa (Alteration of Name) Act, 2011"
(https://legislative.gov.in/sites/default/files/A2011-15.pdf)
Oriya has been renamed to Odia.
* lisp/language/indian.el (set-language-info-alist): Rename
Oriya to Odia. Improve Oriya composition rules.
* lisp/leim/quail/indian.el ("odia"): New input method.
* lisp/erc/erc-lang.el: Obsolete the iso-638-languages variable
(which was a typo) and replace it with iso-639-1-languages.
* etc/HELLO: Rename Oriya to Odia.
Replace the old Odia greeting with the new one.
Add a Hindi greeting separate from the Devanagari one.
(Bug#55493)
Po Lu [Thu, 19 May 2022 12:10:19 +0000 (20:10 +0800)]
Whitelist some incorrectly labeled "color" fonts under Xft
* etc/PROBLEMS: Document problem with fonts incorrectly labeled
as color fonts under Xft.
* src/ftfont.c (xft_color_font_whitelisted_p): New function.
(ftfont_spec_pattern, ftfont_list): Respect whitelisting of
"color" fonts under Xft.
* src/xftfont.c (syms_of_xftfont): New variable
`xft-color-font-whitelist'.
Eli Zaretskii [Thu, 19 May 2022 08:00:36 +0000 (11:00 +0300)]
Fix Flymake diagnostics reporting in non-UTF-8 locales
* lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile)
(elisp-flymake--batch-compile-for-flymake): Bind I/O encoding to
UTF-8, instead of relying on the locale's defaults. This is
needed because ELisp files use UTF-8 by default, but Flymake
doesn't know about that, since it isn't specific to ELisp.
* src/haikufns.c (Fx_display_pixel_height): Return height
instead of width.
* src/haikuterm.c (haiku_make_fullscreen_consistent)
(haiku_read_socket, haiku_fullscreen): Adjust to always set zoom
and fullscreen in the main thread instead of the UI threads.
* src/haikuterm.h (struct haiku_output): Remove flag `zoomed_p'
and add field `fullscreen_mode'.
Po Lu [Thu, 19 May 2022 01:30:33 +0000 (09:30 +0800)]
Respond to changes to the size of the root window
* src/xterm.c (x_display_pixel_height, x_display_pixel_width):
Move here instead.
(handle_one_xevent): Handle ConfigureNotify for the root window.
(x_term_init): Select for structure events on the root window.
* src/xterm.h (struct x_display_info): New fields `screen_width'
and `screen_height'.
(x_display_pixel_height, x_display_pixel_width): Make
prototypes.
Stefan Kangas [Wed, 18 May 2022 23:41:44 +0000 (01:41 +0200)]
Delete entry on SPC completes file names from FAQ
* doc/misc/efaq.texi (SPC no longer completes file names): Delete
node: this is about a change that took place over 15 years ago and is
not likely to be a FAQ these days.
Po Lu [Wed, 18 May 2022 12:36:50 +0000 (12:36 +0000)]
Implement gamma-correction on Haiku
* src/dispextern.h: Add `gamma_correct' prototype on Haiku as
well.
* src/haikufns.c (gamma_correct): New function.
* src/haikuterm.c (haiku_defined_color): Gamma-correct colors if
their pixels are being allocated.
Alan Mackenzie [Wed, 18 May 2022 09:18:15 +0000 (09:18 +0000)]
Fix M-x compile-defun when an interactive form is (list ...)
This is for when lexical-binding is nil. The problem fixed was M-x
compile-defun leaving symbols with position in the compiled function's arglist
and interactive form. This fixes bug #55323. Also ensure the doc string is
correctly stripped when lexical-binding is t.
* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): For a (list ...)
interactive form when lexical-binding is nil, strip the positions from the
symbols in the form. Also strip the position from the symbols in the arglist.
(byte-compile-make-closure): (Twice) strip symbols from positions in the doc
string expression. Add comments.
Martin Rudalics [Wed, 18 May 2022 09:09:58 +0000 (11:09 +0200)]
Clean up and simplify 'quit-restore-window' code
* lisp/window.el (window--quit-restore-select-window): New internal
name for 'quit-restore-select-window'.
(quit-restore-window): Use 'window--quit-restore-select-window'
instead of 'quit-restore-select-window'. Simplify code.
Introduce explicit stacks for traversing common data types during
printing: conses, vectors, records, byte-code, hash-tables and
char-tables, all previously traversed using recursion in C. This
greatly reduces the risk of crashing Emacs from C stack overflow
when printing deeply nested data.
* src/print.c (Fprinc, print, PRINT_CIRCLE_CANDIDATE_P):
Special-case Fprinc with a plain string argument to eliminate the need
for keeping track of print_depth during the preprocessing phase.
This also improves performance.
(struct print_pp_entry, struct print_pp_stack, ppstack)
(grow_pp_stack, pp_stack_push_value, pp_stack_push_values)
(pp_stack_empty_p, pp_stack_pop):
New stack for preprocessing.
(print_preprocess):
Make mostly nonrecursive, except for string properties.
(enum print_entry_type, struct print_stack_entry)
(struct print_stack, prstack, grow_print_stack)
(print_stack_push, print_stack_push_vector):
New stack for printing.
(print_vectorlike, print_object):
Make mostly nonrecursive, except for string properties and some less
heavily used types.
* test/src/print-tests.el (print-deeply-nested):
New test.
* lisp/language/indian.el ("Modi"): New language environment.
Add composition rules for Modi. Add sample text and input
method.
Add sample text to various scripts.
Rename Punjabi to Gurmukhi.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Modi.
* lisp/leim/quail/indian.el ("modi"): New input method.
(Bug#55439)
* etc/HELLO: Add a Modi greeting.
Rename Hindi to Devanagari.
Add a Gurmukhi greeting.
Replace Odia greeting.
* etc/NEWS: Announce the new language environment and its
input method.
Alan Mackenzie [Tue, 17 May 2022 11:26:05 +0000 (11:26 +0000)]
CC Mode: Correct a rare error in the state cache
* lisp/progmodes/cc-engine.el (c-append-lower-brace-pair-to-state-cache): Do
not record a position in a macro as the starting position in
c-state-brace-pair-desert. Instead record the position at the beginning of
that macro.
Alan Mackenzie [Tue, 17 May 2022 10:30:05 +0000 (10:30 +0000)]
Correct indentation of opening brace in xdisp.c, which isn't at start of defun
* xdisp.c (calc_pixel_width_or_height): indent the opening brace of a
substatement correctly. It's previous position, in column 0, caused
indentation errors in C Mode.
Po Lu [Tue, 17 May 2022 09:40:57 +0000 (09:40 +0000)]
Rewrite Haiku frame geometry code to handle decorator frames
* doc/lispref/frames.texi (Frame Layout): Document changes to
Haiku frame layout.
* src/haiku_support.cc (class EmacsWindow, MoveToIncludingFrame)
(EmacsMoveTo, MakeFullscreen): Move to an offset including the
decorator frames.
(be_get_window_decorator_dimensions):
(be_get_window_decorator_frame): New functions.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_update_after_decoration_change): New
function.
(haiku_create_frame, haiku_set_undecorated)
(haiku_set_override_redirect): Call that function.
(frame_geometry): Actually calculate frame geometry based on
decorator and frame sizes.
* src/haikuterm.c (haiku_coords_from_parent): Use frame width
instead.
(haiku_read_socket): Set left and top positions based on
decorator width and height.
* src/haikuterm.h (struct haiku_output): New field `frame_x' and
`frame_y'.
* lisp/emacs-lisp/package.el (package-quickstart-refresh): Work
around syntax-ppss now clobbering match data (but it's not clear
whether that's supposed to be allowed) (bug#55447).
Po Lu [Tue, 17 May 2022 03:11:23 +0000 (03:11 +0000)]
Remove extra EmacsPopUpMenu class
* src/haiku_support.cc (class EmacsPopUpMenu): Delete class that
does nothing.
(BPopUpMenu_new): Use BPopUpMenu directly.
(BMenu_add_title): Clean up coding style.
* doc/emacs/building.texi (Compilation Mode): Document it.
* lisp/progmodes/compile.el (compilation-hidden-output): New user
option.
(compilation-filter): Use it.
(compilation--hide-output): New function.
* src/print.c: Don't expose Vprint_variable_mapping to the Lisp
world, because it really should be immutable.
(print_create_variable_mapping): Initialization moved here from
syms_of_print.
(print_bind_overrides): Call it.
(syms_of_print): Protect the mapping variable.
This patch was mostly written by mailj2@protonmail.com, but was then
rewritten by me, and has some contributions from Xavier Capaldi (which
doesn't need copyright assignment).
Tassilo Horn [Thu, 12 May 2022 21:24:47 +0000 (23:24 +0200)]
Improve cycle-spacing and bind it to M-SPC by default
* lisp/bindings.el (esc-map): Bind M-SPC to cycle-spacing instead of
just-one-space.
* lisp/simple.el (delete-space--internal): New function.
(delete-horizontal-space): Use it.
(delete-all-space): New command.
(just-one-space): Implement on its own instead of calling
cycle-spacing with a special flag.
(cycle-spacing--context): Make it a plist instead of a list. Adapt
docstring accordingly.
(cycle-spacing-actions): New user option.
(cycle-spacing): Rewrite so that it performs the actions in
cycle-spacing-actions instead of the hard-coded ones.
* doc/emacs/killing.texi (characters): Mention and add a variable
index entry for cycle-spacing-actions.
* etc/NEWS: Document that M-SPC is now cycle-spacing instead of
just-one-space.
Po Lu [Mon, 16 May 2022 03:05:32 +0000 (11:05 +0800)]
Improve safety of handling unsupported drop events on X
* src/keyboard.c (kbd_buffer_get_event):
* src/xterm.c (handle_one_xevent): Check that the event frame is
still live after calling arbitrary Lisp code.
Po Lu [Mon, 16 May 2022 01:18:33 +0000 (09:18 +0800)]
Handle pointer axes changing along with scroll valuators
* xterm.c (x_get_scroll_valuator_delta): Set valuator_return to
NULL if no valuator was found.
(handle_one_xevent): Assume pointer axes might've changed if no
scroll valuator was found but valuators were set when handling
motion events.