Mark whole-script confusables as suspicious domains
* lisp/international/textsec.el (textsec-domain-suspicious-p):
Consider domain names that are whole-script confusables with ASCII
to be suspicious. (I think this is what the Unicode standard is
recommending, but I'm not 100% sure.)
Split textsec-email-address-suspicious-p into two functions
* lisp/international/textsec.el
(textsec-email-address-suspicious-p): Made into its own function.
(textsec-email-suspicious-p): Use it and adjust doc strings.
Po Lu [Wed, 19 Jan 2022 11:06:53 +0000 (19:06 +0800)]
Port some X11 tooltip code to XCB
* configure.ac: Require `xcb-aux' to be present before using
XCB.
* src/xfns.c (x_sync):
(x_create_tip_frame):
(Fx_show_tip): Port window related code to XCB.
* lisp/international/textsec.el (textsec-name-suspicious-p):
(textsec-domain-suspicious-p):
(textsec-local-address-suspicious-p):
(textsec-name-suspicious-p):
(textsec-suspicious-nonspacing-p):
(textsec-email-suspicious-p): Suspiciosness isn't only about
homoglyphs, so don't claim so in the doc strings.
Po Lu [Wed, 19 Jan 2022 09:39:04 +0000 (17:39 +0800)]
Use Cairo XCB surfaces when XCB is available
This lets us get at goodies such as shm support, which aren't
available with the xlib surface. (bug#52120)
* configure.ac: Test for cairo-xcb if cairo is available on X.
* src/xterm.c (USE_CAIRO_XCB_SURFACE): New define.
(x_begin_cr_clip): Create XCB surfaces if available.
(x_try_cr_xlib_drawable):
(x_scroll_run): Handle XCB surfaces.
(x_term_init): Find XCB visualtype structure.
* src/xterm.h (struct x_display_info): New field `xcb_visual'.
* src/xwidget.c (x_draw_xwidget_glyph_string): Fix integer
overflow.
Eli Zaretskii [Wed, 19 Jan 2022 08:57:03 +0000 (10:57 +0200)]
Minor improvement in textsec diagnostics
* lisp/international/textsec.el (textsec-suspicious-nonspacing-p):
Clarify wording of the strings returned to explain the suspicious
use of nonspacing characters.
Po Lu [Wed, 19 Jan 2022 02:08:52 +0000 (02:08 +0000)]
Use more reliable timestamps for some kinds of events on Haiku
* src/haiku_support.cc (DispatchMessage):
(MouseMoved):
(MouseDown):
(MouseUp): Set `time' field of event structures to input server
time.
* src/haiku_support.h (struct haiku_key_event):
(struct haiku_mouse_motion_event):
(struct haiku_button_event): New field `time'.
* src/haikuterm.c (haiku_read_socket): Use input server time
if provided.
Stefan Monnier [Tue, 18 Jan 2022 21:40:32 +0000 (16:40 -0500)]
autoload.el: Fix corner case and avoid encoding issues
* lisp/emacs-lisp/autoload.el (autoload-print-form): Don't burp when
autoloading a `cl-defmethod`.
(autoload-rubric): Support non-UTF-8 chars and enforce Unix EOLs.
Add textsec functions for verifying email addresses
* lisp/international/characters.el (bidi-control-characters):
Rename from glyphless--bidi-control-characters for use in textsec,
and add LRM/RLM/ALM.
(update-glyphless-char-display): Adjust the code.
* lisp/international/textsec.el (textsec-local-address-suspicious-p)
(textsec-name-suspicious-p, textsec-suspicious-nonspacing-p)
(textsec-email-suspicious-p): New functions.
Po Lu [Tue, 18 Jan 2022 11:52:51 +0000 (19:52 +0800)]
Intern virtual modifier atoms the smart way on X
* src/xterm.c (x_find_modifier_meanings): Get rid of calls to
XInternAtom.
(x_term_init): Initialize atom refs for virtual modifiers and
make sure to only call `x_find_modifier_meanings' after they
are interned.
* src/xterm.h (struct x_display_info): New fields for virtual
modifier atoms.
Po Lu [Tue, 18 Jan 2022 08:25:02 +0000 (08:25 +0000)]
* src/haikuterm.c (haiku_read_socket): Add work for frame size bug.
BWindow::ResizeTo seems to have the same rounding issues that
BRect has, but I have no idea how to solve it there. As a
temporary workaround until a solution has been found, avoid
garbaging tooltip frames when FrameResized reports different
dimensions from what they were set to.
Po Lu [Tue, 18 Jan 2022 08:15:08 +0000 (08:15 +0000)]
Improve tooltip implementation on Haiku
This fixes several issues: tooltips having no right internal
border, reusing tooltips occasionally freezing Emacs, and
inconsistent behaviour when compared to X.
* src/haiku_support.cc (BWindow_resize): Revert a recent change.
(BView_move_frame):
(BWindow_set_avoid_focus): Stop sync'ing when locked. This
tends to cause lockups for an unknown reason.
* src/haikufns.c (initial_setup_back_buffer): New function.
(haiku_create_frame): Remove tooltip related code.
(haiku_set_internal_border_width): Handle cases where the face
cache is NULL and/or the window has not been created.
(haiku_set_inhibit_double_buffering): Likewise.
(haiku_create_tip_frame): New function.
(Fx_create_frame): Remove tooltip specific code.
(Fx_show_tip): Synchronize code with X.
* src/haikuterm.c (haiku_new_font): Don't adjust size on tooltip
frames.
(haiku_read_socket): Draw internal border on tooltip frames
during resize.
(haiku_clear_under_internal_border): Handle cases where the face
cache is NULL.
Po Lu [Tue, 18 Jan 2022 02:06:00 +0000 (02:06 +0000)]
Allow non-system tooltips to display above menus on Haiku
* doc/emacs/haiku.texi (Haiku Basics): Document that tooltips
can now be displayed above the menu bar.
* lisp/tooltip.el (tooltip-show-help): Only display help text in
the echo area if Haiku system tooltips are enabled.
* src/haiku_support.cc (FlipBuffers): Stop flushing view.
* src/haikufns.c (Fx_show_tip): Fix a sizing bug leading to
tooltips needing two redisplays to display correctly.
* src/haikuterm.c (haiku_read_socket): Ignore resize events on
tooltips.
* admin/unidata/Scripts.txt:
* admin/unidata/ScriptExtensions.txt:
* admin/unidata/PropertyValueAliases.txt: New files from Unicode.
* admin/unidata/README: Update.
* admin/unidata/unidata-gen.el (unidata-gen-charprop): Allow
writing other data, too.
(unidata-gen-scripts, unidata-gen--read-script-aliases)
(unidata-gen--insert-file): New functions to parse the Script* files.
* lisp/international/textsec.el: Implement some functions that
work on scripts.
Po Lu [Mon, 17 Jan 2022 11:09:50 +0000 (11:09 +0000)]
Fix Emacs icon not appearing on Haiku
* lib-src/be_resources.cc (main): Scale input bitmap
appropriately before setting it as the mini and large icons.
* src/Makefile.in (Emacs): Add dependency on
`lib-src/be-resources'.
Po Lu [Mon, 17 Jan 2022 10:08:04 +0000 (10:08 +0000)]
Display override redirect frames in all workspaces on Haiku
* src/haiku_support.cc (class EmacsWindow): New field
`pre_override_redirect_workspaces'.
(BWindow_set_override_redirect): Set window to display on all
workspaces.
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Use `tramp-sshfs-handle-set-file-times'.
(tramp-sshfs-handle-set-file-times): New defun.
Po Lu [Mon, 17 Jan 2022 04:52:00 +0000 (04:52 +0000)]
Really eliminate tooltip flicker on Haiku
* src/haikufns.c (tip_frame): Make non-static.
* src/haikuterm.c (haiku_read_socket): Ignore motion events that
didn't actually move when a tip frame is visible.
* src/haikuterm.h (tip_frame): Declare.
Juri Linkov [Sun, 16 Jan 2022 20:58:30 +0000 (22:58 +0200)]
Add undelete-frame-max instead of undelete-frame-mode (bug#51883)
* doc/emacs/frames.texi (Frame Commands): Replace
undelete-frame-mode with undelete-frame-max.
* lisp/frame.el (undelete-frame-max): New defcustom, by default 1.
(undelete-frame--handle-delete-frame): Use undelete-frame-max
instead of hard-coded 16.
(undelete-frame-mode): Remove function.
(after-init-hook): Add hook undelete-frame--handle-delete-frame to
delete-frame-functions using after-init-hook to not store the
initial frame.
(undelete-frame): Remove undelete-frame-mode. Use undelete-frame-max
instead of hard-coded 16.
* lisp/menu-bar.el (menu-bar-file-menu): Remove menu item undelete-frame-mode.
* src/frame.c (Fdelete_frame): Replace `undelete-frame-mode' with
`undelete-frame-max' in the docstring.
Matthias Meulien [Sun, 16 Jan 2022 18:13:21 +0000 (20:13 +0200)]
Extend Outline mode with default visibility state
* etc/NEWS: Announce support for default visibility state (bug#51809).
* lisp/outline.el (outline-mode, outline-minor-mode): Ensure default
visibility state is applied with outline-apply-default-state.
(outline-default-state, outline-default-rules)
(outline-default-long-line, outline-default-line-count): New defcustoms.
(outline-apply-default-state, outline-show-only-headings)
(outline--show-headings-up-to-level): New functions.
Po Lu [Sun, 16 Jan 2022 11:02:58 +0000 (11:02 +0000)]
Use kMenuWindowFeel on Haiku toolkip windows
* src/haiku_support.cc (BWindow_set_tooltip_decoration): Use
kMenuWindowFeel and set flags here.
* src/haikufns.c (Fx_show_tip): Don't set_avoid_focus manually
since setting tooltip decorations already does that.
Po Lu [Sun, 16 Jan 2022 10:12:22 +0000 (10:12 +0000)]
Reduce poll time for Haiku file dialogs
* src/haiku_support.c (be_popup_file_dialog): Reduce idle
processor load by increasing timeout. The timeout is still too
low to be noticable by the user.
Po Lu [Sun, 16 Jan 2022 05:57:14 +0000 (05:57 +0000)]
Avoid focus and allow monospace text in tooltip frames on Haiku
* src/haikufns.c (Fx_show_tip): Set avoid focus on tooltip
frames.
* src/haikuterm.c (haiku_default_font_parameter): Don't special
case the default font on tooltip frames, since the bug that was
supposed to work around has already been fixed.
Po Lu [Sun, 16 Jan 2022 00:47:41 +0000 (00:47 +0000)]
Fix a minor snafu when resizing frames on Haiku
* src/haiku_support.cc (BWindow_resize): Adjust for minor snafu
where BWindow::ResizeTo uses BRect-style width and height
instead of actual width and height.
Tassilo Horn [Sat, 15 Jan 2022 22:59:20 +0000 (23:59 +0100)]
Add some more mailcap tests.
* test/lisp/net/mailcap-resources/mailcap: New file.
* test/lisp/net/mailcap-resources/test.test: New file.
* test/lisp/net/mailcap-tests.el (with-pristine-mailcap): New macro.
(mailcap-parsing-and-mailcap-mime-info): New test for parsing mailcap
files and selecting the right viewer.
(mailcap--test-result): New variable.
(mailcap--test-viewer): New function.
(mailcap-view-file): New test for mailcap-view-file.
Juri Linkov [Sat, 15 Jan 2022 18:33:45 +0000 (20:33 +0200)]
More fixes for recently committed context-menu additions from bug#52973
* lisp/hi-lock.el (highlight-symbol-at-mouse): New defalias.
(hi-lock-face-symbol-at-mouse): Rename from hi-lock-symbol-at-mouse.
(hi-lock-context-menu): Use thing-at-mouse and middle-separator.
* lisp/man.el (Man-context-menu): Fix Man-at-mouse and use middle-separator.
* lisp/mouse.el (context-menu-functions): Remove context-menu-online-search.
Add occur-context-menu and dictionary-context-menu (bug#50552).