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".
Po Lu [Sat, 14 May 2022 13:18:27 +0000 (21:18 +0800)]
Fix processing of dialog box items on NS
* src/nsmenu.m (pop_down_menu): Remove old hack and discard menu
items.
(ns_popup_dialog):
([EmacsDialogPanel initWithContentRect:styleMask:backing:defer:]):
([EmacsDialogPanel windowShouldClose:]):
([EmacsDialogPanel dealloc]):
([EmacsDialogPanel processdialog:]):
([EmacsDialogPanel addButton:value:row:]):
([EmacsDialogPanel addString:row:]):
([EmacsDialogPanel clicked:]):
([EmacsDialogPanel initFromContents:isQuestion:]):
([EmacsDialogPanel timeouthandler:]):
([EmacsDialogPanel runDialogAt:]): Use the regular menu item
machinery to parse dialog items instead of the incorrect ad-hoc
code used previously.
Eli Zaretskii [Sat, 14 May 2022 08:30:54 +0000 (11:30 +0300)]
Fix undigest-tests on MS-Windows
* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Accept a new
keyword argument :coding CODING to use as the encoding when
writing initial text to the temporary file.
* test/lisp/mail/undigest-tests.el (rmail-undigest-test-rfc934-digest)
(rmail-undigest-test-rfc1153-digest-strict)
(rmail-undigest-test-rfc1153-less-strict-digest)
(rmail-undigest-test-rfc1153-sloppy-digest)
(rmail-undigest-test-rfc1521-mime-digest)
(rmail-undigest-test-multipart-mixed-digest): Force the temporary
mbox files to have Unix-style EOL format.
Po Lu [Sat, 14 May 2022 06:12:39 +0000 (14:12 +0800)]
Try to restore valuator values when a device is enabled
* src/xterm.c (struct xi_known_valuator): New struct.
(xi_populate_device_from_info): Figure out all the values of the
valuators and set the scroll valuators's current_value to it.
Po Lu [Sat, 14 May 2022 05:50:52 +0000 (13:50 +0800)]
Better fix for disappearing menu items on NS
* src/frame.c (delete_frame): Revert last change.
* src/nsmenu.m (free_frame_menubar): Only free if that frame's
menu bar is actually being displayed.
(ns_update_menubar): Note the last frame to have updated the
menu bar.
Po Lu [Sat, 14 May 2022 03:29:43 +0000 (11:29 +0800)]
Implement non-system tooltips on NS
* src/nsfns.m (unwind_create_frame): Return Lisp_Object like on
X.
(do_unwind_create_frame): New function.
(Fx_create_frame): Adjust accordingly.
(compute_tip_xy): Fix coding style.
(unwind_create_tip_frame, ns_create_tip_frame): New functions.
(x_hide_tip, Fx_show_tip, Fx_hide_tip): Create and hide actual
tooltip frames.
(syms_of_nsfns): New defvar `x-max-tooltip-size' and staticpros.
Put help-fns--compiler-macro last in the *Help* buffer
* lisp/help-fns.el (help-fns-describe-function-functions): Make
help-fns--compiler-macro the last entry (because it's not the most
interesting information).
Stefan Kangas [Fri, 13 May 2022 19:30:05 +0000 (21:30 +0200)]
Remove some XEmacs compat code from eudc-bob.el
* lisp/net/eudc-bob.el (eudc-bob-can-display-inline-images): Make
into obsolete alias for display-graphic-p. Update all callers.
(eudc-bob-display-jpeg): Remove XEmacs compat code.
This is mostly factored out from tabulated-list.el (with bugs fixed).
* doc/lispref/modes.texi (Header Lines): Document it.
* lisp/display-line-numbers.el (header-line-indent): New variable.
(header-line-indent--line-number-width)
(header-line-indent--watch-line-number-width)
(header-line-indent--window-scroll-function): New helper functions.
(header-line-indent-mode): New minor mode.
* lisp/display-line-numbers.el (header-line-indent-width): New
variable.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width)
(tabulated-list-watch-line-number-width)
(tabulated-list-window-scroll-function): Make into obsolete aliases.
(tabulated-list-mode): Use 'header-line-indent-mode'.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header):
Adjust the header line format and computation.
* lisp/help.el (with-help-window): Don't be a wrapper around
`with-temp-buffer-window', because that made the macro big and
difficult to understand.
(help--window-setup): Implement the relevant bits from
`with-temp-buffer-window'. Also don't clear out local variables,
because that makes things like `text-scale-mode' not work (bug#25979).
Allow substitute-command-keys to include menus in \{...} output
* doc/lispref/help.texi (Keys in Documentation): Document it.
* lisp/help.el (substitute-command-keys): Add an argument to
include menus in the \{...-map} output (bug#24236).
Use gsettings font rendering entries for pgtk builds
If present, apply the gsettings font hinting and antialiasing
entries when creating a font in cairo. Do this at
initialization and when the entries change, re-rendering the
frames.
* src/ftcrfont.c (ftcrfont_open): Use the font_options derived
from gsettings when opening a font.
(ftcrfont_cached_font_ok): Report a cached font as invalid if
its font options differ from the current options inside
gsettings.
* src/xsettings.c (apply_gsettings_font_hinting)
(apply_gsettings_font_alias, apply_gsettings_font_rgba_order):
Convert the settings from GSettings to the cairo_font_options_t
object.
(init_gsettings, something_changed_gsettingsCB): Invoke the
apply functions if the relevant settings changed.
(store_font_options_changed): Store an event to re-render the
fonts.
(xsetting_get_font_options)
* src/xsettings.h (xsettings_get_font_options): New function.
Fix dabbrev expansion after recent file-name buffer addition
* lisp/dabbrev.el (dabbrev--find-expansion): Remove the now-dead
file name buffer from dabbrev--friend-buffer-list, so that we
don't trip over the killed buffer later (bug introduced in 2d0085f756).
Eli Zaretskii [Fri, 13 May 2022 12:00:21 +0000 (15:00 +0300)]
Fix lexical-binding fallout in vhdl-mode.el
* lisp/progmodes/vhdl-mode.el (arch-alist, pack-alist)
(file-alist, unit-alist, rule-alist): Defvar them, since vhdl-aput
expects them to be dynamically bound. (Bug#55389)
(vhdl-speedbar-insert-hierarchy): Rename the PACK-ALIST argument
to PACKAGE-ALIST, to avoid shadowing the global variable.
Po Lu [Fri, 13 May 2022 11:46:43 +0000 (19:46 +0800)]
Allow changing the face used for text and frame colors in tooltips
* etc/NEWS: Announce new arguments to `tooltip-show'.
* lisp/tooltip.el (tooltip-show): Accept new arguments
`text-face' and `frame-face'. Use them to display text and
determine the foreground, background and border colors of the
tooltip frame respectively.
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.