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.
Augusto Stoffel [Sat, 14 May 2022 15:21:27 +0000 (17:21 +0200)]
Make minibuffer lazy highlight setup buffer-local where appropriate
* lisp/isearch.el (minibuffer-lazy-highlight-setup): Modify hooks
buffer-locally, so that recursive minibuffers are not affected by the
special behavior of lazy-highlight. Also make
'isearch-filter-predicate' buffer-local, so that isearch in the
minibuffer is not affected by the region filter (bug#55110).
* src/print.c (Fprin1): Take an OVERRIDES parameter.
(print_bind_overrides, print_bind_all_defaults): New functions.
(Fprin1_to_string): Take an OVERRIDES parameter.
Michael Albinus [Sun, 15 May 2022 13:09:26 +0000 (15:09 +0200)]
Hide temporary FUSE files in Tramp
* lisp/net/tramp-fuse.el (tramp-fuse-remove-hidden-files): New defsubst.
(tramp-fuse-handle-directory-files)
(tramp-fuse-handle-file-name-all-completions): Use it.
Po Lu [Sun, 15 May 2022 08:33:34 +0000 (08:33 +0000)]
Improve return value of `haiku-roster-launch'
* src/haikuselect.c (Fhaiku_roster_launch): Return
`already-running' if no PID is available since the target
application is already running.
(syms_of_haikuselect): New defsym.
* lisp/language/indian.el ("Syloti Nagri"): New language environment.
Add composition rules for Syloti Nagri. Add sample text and input
method.
Improve composition rules for Kaithi, Tirhuta, Sharada and Siddham.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Syloti Nagri.
* lisp/leim/quail/indian.el ("syloti-nagri"): New input method.
* etc/HELLO: Add two Syloti Nagri greetings.
* etc/NEWS: Announce the new language environment and its
input method.
Visuwesh [Fri, 13 May 2022 07:39:55 +0000 (13:09 +0530)]
describe-keymap: Suggest symbol at point
* lisp/help-fns.el (describe-keymap): Suggest symbol at point
if it is a keymap. (Bug#55393)
* etc/NEWS: Announce change in behavior of 'describe-keymap'.
Po Lu [Sun, 15 May 2022 01:30:07 +0000 (09:30 +0800)]
Prevent crashes trying to access nonexistent key
* src/xsettings.c (xg_settings_key_valid_p): New function.
(apply_gsettings_font_antialias): Test that `font-aliasing' is
actually available. (bug#55416)
Eli Zaretskii [Sat, 14 May 2022 16:08:55 +0000 (19:08 +0300)]
Make 'check-declare-directory' more portable
* lisp/emacs-lisp/check-declare.el (check-declare-directory): Use
'directory-files-recursively' instead of running Find and Grep in
a subprocess. (Bug#55386)
Stefan Kangas [Sat, 14 May 2022 13:47:35 +0000 (15:47 +0200)]
Drop ancient OEmacs support from vcursor.el
* lisp/vcursor.el (vcursor-bind-keys, vcursor-key-bindings)
(vcursor-other-window): Drop OEmacs support. OEmacs was "a
version of GNU Emacs V19.19" that worked "under plain MSDOS,
Windows, or DESQview/X".