Po Lu [Fri, 13 May 2022 08:32:10 +0000 (16:32 +0800)]
Minor cleanups to PGTK code
* src/pgtkterm.c (pgtk_text_scaling_factor): Rename to
`pgtk_get_text_scaling_factor', clean up coding style, and fix
leak of GSettings object.
(pgtk_term_init): Clean up coding style and fix scroll
increments.
* src/gtkutil.c (xg_widget_key_press_event_cb): Return
immediately if a popup is active.
* src/xterm.c (x_filter_event): Clear `xg_pending_quit_event' if
a popup is active.
Po Lu [Fri, 13 May 2022 04:03:36 +0000 (04:03 +0000)]
Allow setting cursor colors for custom cursors on Haiku
* src/haikufns.c: (struct user_cursor_bitmap_info):
(cursor_bitmaps): Fix hotspot for left arrow pointer.
(cursor_bitmaps_for_id): New array.
(haiku_set_mouse_color): If a color was specified, consult
`cursor_bitmaps_for_id' for user-specified cursors.
Po Lu [Fri, 13 May 2022 03:14:26 +0000 (03:14 +0000)]
Allow actually setting cursor colors on Haiku
* src/haiku_support.cc (be_create_pixmap_cursor): New function.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_create_frame): Change default cursor
color to "font-color".
(haiku_create_tip_frame): Likewise.
(struct user_cursor_bitmap_info): New struct.
(cursor_bitmaps): New list of bitmaps corresponding to cursors.
(haiku_create_colored_cursor): New function.
(haiku_free_custom_cursors): Set current cursor to the default
cursor before freeing the original value.
(haiku_set_mouse_color): Actually recolor cursors based on
built-in bitmaps.
* src/haikuterm.c (haiku_defined_color): Clean up coding style.
Paul Eggert [Fri, 13 May 2022 00:01:10 +0000 (17:01 -0700)]
Pacify GCC 12 in default developer build
This lets ‘./configure; make’ work on Fedora 36 x86-64 from a Git
checkout without generating false-alarm warnings.
* lib-src/etags.c (main): There appeared to be false alarm with
GCC 12. However, the code was wrong anyway, as it mishandled file
names containing "'" so fix that bug. This pacifies GCC.
(mercury_decl): Omit tests ‘s + pos != NULL’ that were apparently
intended to be ‘s[pos] != '\0'’ but which were miscoded to always
be true and which were mostly not needed anyway. In one place,
though, a test was needed, so fix that by using strchr instead.
* src/alloc.c (lisp_free) [!GC_MALLOC_CHECK]:
* src/term.c (Fsuspend_tty): Don’t look at a pointer after freeing
it, even just to test it for equality with some other pointer, as
this has undefined behavior in C and GCC 12 diagnoses this.
* src/dbusbind.c (xd_read_message_1): Rework the code a bit
so that it has fewer tests. This pacifies GCC 12 which was
complaining incorrectly about dereferencing a null pointer.
* src/intervals.c (copy_properties): Remove an eassume that should
no longer be needed even to pacify older GCCs, due to ...
* src/intervals.h (split_interval_left): ... this addition of
ATTRIBUTE_RETURNS_NONNULL to pacify a GCC 12 warning about
dereferencing a null pointer.
* src/regex-emacs.c (EXTEND_BUFFER): Use negative values rather
than auxiliary booleans to indicate null pointers. This pacifies
GCC 12 false alarms about using uninitialized variables.
* src/xdisp.c (clear_position): New function.
(append_space_for_newline, extend_face_to_end_of_line):
Use it to work around false alarms from GCC 12.
(display_and_set_cursor): Add an UNINIT to pacify GCC 12.
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
Defend against hypothetical bad code elsewhere;
this also pacifies GCC 12.
(x_term_init): Use fixed-size auto array rather than alloca,
as the array is small; this also pacifies GCC 12.
Fix retrieving images that contain ) characters in shr
* lisp/net/shr.el (shr-save-contents, shr-get-image-data): Don't call.
(shr-encode-url): Make obsolete. (This function makes no sense.)
(shr-tag-img): Don't call.
* lisp/url/url-http.el (url-http-parse-headers): Output the
headers we receive in the debug output.
* lisp/url/url-vars.el (url-extensions-header): Remove useless header.
Po Lu [Thu, 12 May 2022 04:11:12 +0000 (04:11 +0000)]
Make cursor display on Haiku consistent with X
* src/haikuterm.c (haiku_draw_image_glyph_string): Merge cursor
foregrounds correctly.
(haiku_draw_hollow_cursor, haiku_draw_bar_cursor): New
functions. Port code from X.
(haiku_draw_window_cursor): Port code from X so bar cursors on
top of images are treated right.
* lisp/emacs-lisp/package.el (package-update-all): New function
(bug#19146).
(package--updateable-packages): Factored out...
(package-update): ... from here.
Add new user option switch-to-prev-buffer-skip-regexp
* doc/lispref/windows.texi (Window History): Document it.
* lisp/window.el (switch-to-prev-buffer-skip): Mention it.
(switch-to-prev-buffer-skip-regexp): New user option (bug#19070).
(switch-to-prev-buffer-skip-p): Use it.
Fix non-variable widgets in the 'H' command in Cus-mode
* lisp/cus-edit.el (custom-mode-map):
(custom-commands): Adjust.
(custom-toggle-hide-all-widgets): Rename and work for all widget
types, not just variables.
* lisp/apropos.el (apropos-user-option): Include buttons in the
output always (bug#55376).
(apropos-print-doc): Don't insert three spaces in the
non-apropos-multi-type case.
Tino Calancha [Wed, 11 May 2022 16:01:11 +0000 (18:01 +0200)]
char-uppercase-p: New predicate
Return non-nil if its argument is an uppercase character.
Suggested in Bug#54804.
* lisp/subr.el (char-uppercase-p): New defun.
* etc/NEWS (Lisp Changes in Emacs 29.1): Announce it
* doc/lispref/display.texi (Size of Displayed Text): Document it.
* test/lisp/subr-tests.el (test-char-uppercase-p): Add a test.
* doc/emacs/maintaining.texi (VC Directory Commands): Document it.
* lisp/vc/vc-dir.el (vc-dir-mode-map): Bind it to `%'.
(vc-dir-mark-by-regexp): New command (bug#16460).
* src/haiku_support.cc (BCursor_from_id): Accept int instead of
enum.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_create_frame): Stop manually assigning
cursors and set default value of the mouse color property.
(haiku_free_frame_resources): Free custom cursors too.
(struct user_cursor_info, INIT_USER_CURSOR): New struct.
(haiku_free_custom_cursors): New function.
(haiku_set_mouse_color): New param handler.
(haiku_frame_parm_handlers): Add param handler.
(syms_of_haikufns): New cursor shape variables from X.
* lisp/emacs-lisp/check-declare.el (check-declare-directory): Don't
bug out if we don't find any files with declare-function:(bug#55354)
because this is a predicate function, and that's inconvenient.
Warn about quoted symbols in defcustom choice/other forms
* lisp/emacs-lisp/bytecomp.el
(byte-compile--suspicious-defcustom-choice): New function (bug#16271).
(byte-compile-nogroup-warn): Use it to warn about forms like
(choice (const :tag "foo" 'bar)).
Po Lu [Wed, 11 May 2022 08:01:32 +0000 (16:01 +0800)]
Fix mouse pointer avoidance in some configurations
* lisp/avoid.el (mouse-avoidance-random-shape): Ignore invisible
pointer.
(mouse-avoidance-ignore-p): Adjust for interprogram DND.
* lisp/term/x-win.el (x-pointer-invisible): Make value larger
than the maximum possible glyph.
* src/xfns.c (x_set_mouse_color): Use function that handles
`x-pointer-invisible' too.
* src/xterm.c (x_create_font_cursor): New function. Handle
invisible cursors.
* src/xterm.h: Update prototypes.
Juri Linkov [Wed, 11 May 2022 07:50:12 +0000 (10:50 +0300)]
* lisp/textmodes/string-edit.el: Improvements for pop-to-buffer (bug#33007)
* lisp/textmodes/string-edit.el (string-edit): Use pop-to-buffer
with fit-window-to-buffer after the buffer is filled with text.
(string-edit-done, string-edit-abort): Use (quit-window 'kill).
Po Lu [Wed, 11 May 2022 02:02:21 +0000 (02:02 +0000)]
Try to preserve font styles in the Haiku font dialog
* haiku_support.cc (class EmacsFontSelectionDialog)
(UpdateStylesForIndex): If a style was previously selected and
exists in the new family as well, select it after adding the new
items.
Alexander Adolf [Mon, 2 May 2022 21:01:11 +0000 (23:01 +0200)]
EUDC: Add completion-at-point support
* lisp/net/eudc-capf.el: New file.
* lisp/gnus/message.el (message-mode): Add `eudc-capf-complete' to
`completion-at-point-functions' when a `message-mode' buffer is
created.
* doc/misc/eudc.texi (Inline Query Expansion): Add a new subsection,
describing the new `completion-at-point' mechanism in `message-mode'.
* etc/NEWS (EUDC): Describe the new `completion-at-point' method.
* lisp/language/indian.el ("Siddham"): New language environment.
Add composition rules for Siddham. Add sample text and input
method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Siddham.
* lisp/leim/quail/indian.el ("siddham"): New input method.
* etc/HELLO: Add a Siddham greeting.
* etc/NEWS: Announce the new language environment and its
input method. (Bug#55350)
Use fields on log-edit headers (which changes `C-a' behaviour)
* lisp/vc/log-edit.el (log-edit-insert-message-template): Fieldify
headers so that `C-a' takes us to the start of the string, not the
line (bug#15645).