]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years ago; * etc/NEWS: Fix typo in recent change.
Po Lu [Fri, 21 Jan 2022 05:49:57 +0000 (13:49 +0800)]
; * etc/NEWS: Fix typo in recent change.

2 years agoWork around GTK changing window backgrounds on colormapped displays
Po Lu [Fri, 21 Jan 2022 05:22:51 +0000 (13:22 +0800)]
Work around GTK changing window backgrounds on colormapped displays

* src/xterm.c (x_clear_window):
(x_clear_area): Fill the contents with the reverse GC instead of
using XClearArea and XClearWindow when not double buffered.

2 years agoFix BadValue crash when looking up empty color names on some X servers
Po Lu [Fri, 21 Jan 2022 03:37:19 +0000 (11:37 +0800)]
Fix BadValue crash when looking up empty color names on some X servers

* src/xterm.c (x_parse_color): Avoid parsing empty color names.

2 years agoruby-toggle-block-space-before-parameters: New user option
Dmitry Gutov [Fri, 21 Jan 2022 02:59:39 +0000 (04:59 +0200)]
ruby-toggle-block-space-before-parameters: New user option

* lisp/progmodes/ruby-mode.el (ruby-toggle-block-space-before-parameters):
New user option (bug#53321).
(ruby-do-end-to-brace): Handle it.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-toggle-block-to-brace-no-space): New test.

2 years agoUpdate menu bars when `use-system-tooltips' changes on Haiku
Po Lu [Fri, 21 Jan 2022 01:31:27 +0000 (01:31 +0000)]
Update menu bars when `use-system-tooltips' changes on Haiku

* lisp/term/haiku-win.el: Add new function as variable watcher
for `use-system-tooltips'.
(haiku-use-system-tooltips-watcher): New function.

2 years agoAllow fractional values of `polling-period'
Po Lu [Fri, 21 Jan 2022 01:15:52 +0000 (09:15 +0800)]
Allow fractional values of `polling-period'

This allows C-g to be handled faster in the NS port at the cost
of some extra CPU time on slow machines.

* etc/NEWS: Announce new feature.
* src/keyboard.c (start_polling):
(bind_polling_period): Handle floating point values of
`polling-period'.
(syms_of_keyboard): Make `polling-period' a Lisp variable
instead of an int variable.

2 years agoAvoid FOCUS_IN_EVENTS not being sent on NS
Po Lu [Sat, 15 Jan 2022 13:11:57 +0000 (21:11 +0800)]
Avoid FOCUS_IN_EVENTS not being sent on NS

* src/nsterm.m ([EmacsView windowDidBecomeKey]): Work around
emacs_event being NULL by storing focus in events directly
into the keyboard buffer.  (bug#52376)

2 years agoIn early bootstrap, use byte-compiled compiler to native compile first files
Alan Mackenzie [Thu, 20 Jan 2022 18:40:15 +0000 (18:40 +0000)]
In early bootstrap, use byte-compiled compiler to native compile first files

This speeds up a make bootstrap by around 15%.

* lisp/Makefile.in (BYTE_COMPILE_FLAGS): set a value specific to compile-first
which doesn't contain the setting of Emacs variable load-prefer-newer.
Add a new make hunk which byte-compiles (rather then native compiles) when the
environment variable ANCIENT is "yes".  Set the date of the .elc files built
to 1971-01-01 to cause a second compilation of them later.

* src/Makefile.in: Add an extra invocation of directory lisp's MAKE with
target compile-first and the flag environment variable ANCIENT set to yes.

* src/verbose.mk.in: When ANCIENT is yes, output ELC, not ELC+ELN for
AM_V_ELC.

2 years agoRemove matching of whitespaces in LaTeX environment names
Arash Esbati [Thu, 20 Jan 2022 18:20:34 +0000 (19:20 +0100)]
Remove matching of whitespaces in LaTeX environment names

* lisp/textmodes/ispell.el (ispell-tex-skip-alists): Don't match
arbitrary number of whitespaces in LaTeX environment names.
(bug#53390)

2 years agoUpdate documentation of 'clone-indirect-buffer-hook'
Eli Zaretskii [Thu, 20 Jan 2022 17:18:54 +0000 (19:18 +0200)]
Update documentation of 'clone-indirect-buffer-hook'

* doc/emacs/buffers.texi (Indirect Buffers):
* src/buffer.c (syms_of_buffer) <clone-indirect-buffer-hook>:
Update the documentation of 'clone-indirect-buffer-hook' due the
recent changes.
* etc/NEWS: Mention the change in where the hook is run.

* lisp/face-remap.el (face-attrs--make-indirect-safe): Doc fix.

2 years agoMake textsec-link-suspicious-p less mistrustful
Lars Ingebrigtsen [Thu, 20 Jan 2022 17:12:44 +0000 (18:12 +0100)]
Make textsec-link-suspicious-p less mistrustful

* lisp/international/textsec.el (textsec-link-suspicious-p): Scale
back the suspicion -- only warn about texts that contain a full
explicit link.

2 years agoFix tabulated-list-widen-current-column widening wrong column
Thuna [Thu, 20 Jan 2022 14:22:22 +0000 (15:22 +0100)]
Fix tabulated-list-widen-current-column widening wrong column

* tabulated-list.el (tabulated-list-widen-current-column): Account
for the padding and the content width when calculating column
width (bug#53375).
Copyright-paperwork-exempt: yes

2 years agoMake image-dired-delete-marked more resilient
Peter Münster [Thu, 20 Jan 2022 14:16:46 +0000 (15:16 +0100)]
Make image-dired-delete-marked more resilient

* lisp/image-dired.el (image-dired-delete-marked): Don't bug out
on empty buffers (bug#53385).

2 years agoFix thinko in previous hi-lock-read-face-name change
Lars Ingebrigtsen [Thu, 20 Jan 2022 13:53:12 +0000 (14:53 +0100)]
Fix thinko in previous hi-lock-read-face-name change

* lisp/hi-lock.el (hi-lock-read-face-name): Fix the string/symbol
logic.

2 years agoFix indirect font changes incorrectly affecting original buffer
Andrew Hyatt [Thu, 20 Jan 2022 13:42:31 +0000 (14:42 +0100)]
Fix indirect font changes incorrectly affecting original buffer

* lisp/face-remap.el (face-attrs--make-indirect-safe):
(clone-indirect-buffer-hook): Set up a face remapping alist
(bug#53294).

* lisp/simple.el (clone-indirect-buffer): Move the point the hook
is run.

* src/buffer.c (Fmake_indirect_buffer, syms_of_buffer): Move the
place where the clone-indirect-buffer-hook variable is defined, so
that we can call it from C.

2 years agoConsider subcommands when deciding to invoke Eshell command directly
Jim Porter [Thu, 20 Jan 2022 13:37:54 +0000 (14:37 +0100)]
Consider subcommands when deciding to invoke Eshell command directly

When an Eshell command contains an asynchronous subcommand (such as
calling an external process), it must be evaluated iteratively.  See
bug#30725.

* lisp/eshell/esh-cmd.el (eshell-invoke-command): Move most of the
logic from here...
(eshell--invoke-command-directly): ... to here. Also add checks for
subcommands.

* test/lisp/eshell/eshell-tests.el (eshell-test--max-subprocess-time):
New variable.
(eshell-wait-for-subprocess): New function.
(eshell-command-result-p): Use 'eshell-wait-for-subprocess'.
(eshell-test/interp-cmd-external): New test (bug#30725).

2 years agoRename the textsec-check function to textsec-suspicious-p
Lars Ingebrigtsen [Thu, 20 Jan 2022 13:33:36 +0000 (14:33 +0100)]
Rename the textsec-check function to textsec-suspicious-p

* lisp/net/shr.el (shr-tag-a):
* lisp/international/textsec-check.el (textsec-suspicious-p):
* lisp/gnus/message.el (message-send-mail):
* lisp/gnus/gnus-art.el (article--check-suspicious-addresses):
* etc/NEWS (like):
* doc/lispref/text.texi (Suspicious Text):
(Suspicious Text): Rename the textsec-check function to
textsec-suspicious-p.

2 years agoMake the read-face-name completion buffer display samples
Lars Ingebrigtsen [Thu, 20 Jan 2022 13:22:05 +0000 (14:22 +0100)]
Make the read-face-name completion buffer display samples

* lisp/faces.el (read-face-name): Display face samples when
completing (bug#53255).

* lisp/hi-lock.el (hi-lock-read-face-name): Use read-face-name.

2 years agoImprove the textsec-domain-suspicious-p warning message
Lars Ingebrigtsen [Thu, 20 Jan 2022 12:37:26 +0000 (13:37 +0100)]
Improve the textsec-domain-suspicious-p warning message

* lisp/international/textsec.el (textsec-domain-suspicious-p):
Improve warning message.

2 years agoFix error when describing menu items that don't have equivalent keys
Po Lu [Thu, 20 Jan 2022 12:18:29 +0000 (20:18 +0800)]
Fix error when describing menu items that don't have equivalent keys

* lisp/help-fns.el (help-fns--key-bindings): Never pass nil to
insert.

2 years agoMake textsec-link-suspicious-p have fewer false positives
Lars Ingebrigtsen [Thu, 20 Jan 2022 11:37:31 +0000 (12:37 +0100)]
Make textsec-link-suspicious-p have fewer false positives

* lisp/international/textsec.el (textsec-link-suspicious-p):
Attempt to improve the domain-guessing logic.

2 years agoImprove how menus are described in *Help*
Lars Ingebrigtsen [Thu, 20 Jan 2022 11:03:49 +0000 (12:03 +0100)]
Improve how menus are described in *Help*

* lisp/help-fns.el (help-fns--insert-bindings): New function.
(help-fns--key-bindings): Split menu/key handling and output menu
bindings separately (bug#52870).

2 years agoMake system tooltips display in the menu bar on Haiku
Po Lu [Thu, 20 Jan 2022 10:53:49 +0000 (10:53 +0000)]
Make system tooltips display in the menu bar on Haiku

* doc/emacs/haiku.texi (Haiku Basics): Update documentation.
* src/haiku_support.cc (Highlight): Apply the hack used for
regular menus to the menu bar as well.
* src/haikumenu.c (digest_menu_items): Set help text on menu bar
if `tooltip-mode' is t and system tooltips are used.
(syms_of_haikumenu): New symbol `tooltip-mode'.

2 years agoFix Fchar_syntax for non-ASCII in unibyte buffers
Mattias Engdegård [Sun, 16 Jan 2022 10:58:00 +0000 (11:58 +0100)]
Fix Fchar_syntax for non-ASCII in unibyte buffers

Fchar_syntax did not convert unibyte characters to multibyte when the
current buffer was unibyte, in contrast to `char-syntax` in
byte-compiled code (bug#53260).

* src/bytecode.c (exec_byte_code): Call out to Fchar_syntax;
the dynamic frequency is too low to justify inlining here, and it
did lead to implementations diverging.
* src/syntax.c (Fchar_syntax): Convert non-ASCII unibyte values to
multibyte.
* test/src/syntax-tests.el (syntax-char-syntax): New test.

2 years agoRe-enable some textsec-tests after recent bidi.c fix
Lars Ingebrigtsen [Thu, 20 Jan 2022 10:06:58 +0000 (11:06 +0100)]
Re-enable some textsec-tests after recent bidi.c fix

2 years agoIn Eshell, allow "-n" to suppress the trailing newline for "plain" echo
Jim Porter [Thu, 20 Jan 2022 09:35:38 +0000 (10:35 +0100)]
In Eshell, allow "-n" to suppress the trailing newline for "plain" echo

* doc/misc/eshell.texi (Built-in commands): Expand on the
documentation of echo (bug#27361).
* lisp/eshell/em-basic.el (eshell-echo): Respect OUTPUT-NEWLINE even
when 'eshell-plain-echo-behavior' is non-nil.
(eshell/echo): Add "-N" option and recommend its use over "-n" in
Lisp-friendly echo.
(eshell/printnl): Simplify; 'eshell-stringify' is equivalent to
calling 'eshell-echo' here.

2 years agoFix 'bidi-find-overridden-directionality' for Lisp strings
Eli Zaretskii [Thu, 20 Jan 2022 10:02:27 +0000 (12:02 +0200)]
Fix 'bidi-find-overridden-directionality' for Lisp strings

* src/bidi.c (bidi_find_first_overridden): Don't use ZV for Lisp
strings.  Reported by Lars Ingebrigtsen <larsi@gnus.org>.

2 years agoMake the undelete-frame-mode menu item a toggle
Po Lu [Thu, 20 Jan 2022 09:55:07 +0000 (17:55 +0800)]
Make the undelete-frame-mode menu item a toggle

* lisp/menu-bar.el (menu-bar-file-menu): Make the undelete frame
mode option a toggle.  (bug#53382)
Also enable some options that were disabled on NS, but should no
longer be since NS now supports the tab bar.

2 years agoMake key-valid-p work in Turkey
Lars Ingebrigtsen [Thu, 20 Jan 2022 09:19:23 +0000 (10:19 +0100)]
Make key-valid-p work in Turkey

* lisp/keymap.el (key-valid-p): Inhibit case folding, otherwise
(key-valid-p "I") would return nil in tr_TR environments.

2 years agoTweak textsec-link-suspicious-p
Lars Ingebrigtsen [Thu, 20 Jan 2022 09:10:01 +0000 (10:10 +0100)]
Tweak textsec-link-suspicious-p

* lisp/international/textsec.el (textsec-link-suspicious-p): Don't
mark dates as suspicious.

2 years agoAdd test for bug#51733
Lars Ingebrigtsen [Thu, 20 Jan 2022 08:54:38 +0000 (09:54 +0100)]
Add test for bug#51733

2 years agoImprove documentation of textsec
Eli Zaretskii [Thu, 20 Jan 2022 09:04:41 +0000 (11:04 +0200)]
Improve documentation of textsec

* lisp/international/textsec-check.el (textsec-check): Doc fixes.

* doc/lispref/text.texi (Suspicious Text): Improve wording and
indexing.

2 years agoAllow suspicious names with some forms of bidi controls
Lars Ingebrigtsen [Thu, 20 Jan 2022 08:52:08 +0000 (09:52 +0100)]
Allow suspicious names with some forms of bidi controls

* lisp/international/textsec.el (textsec-name-suspicious-p): Allow
names with bidi-find-overridden-directionality.

2 years agoImprove textsec-domain-suspicious-p message
Lars Ingebrigtsen [Thu, 20 Jan 2022 08:36:04 +0000 (09:36 +0100)]
Improve textsec-domain-suspicious-p message

* lisp/international/textsec.el (textsec-domain-suspicious-p):
Improve warning message.

2 years agoAllow disabling 'undelete-frame-mode' from the menu bar
Eli Zaretskii [Thu, 20 Jan 2022 08:05:05 +0000 (10:05 +0200)]
Allow disabling 'undelete-frame-mode' from the menu bar

* lisp/menu-bar.el (menu-bar-file-menu): Add
'disable-undelete-frame-mode' menu item.  (Bug#53382)

2 years agoDocument textsec
Lars Ingebrigtsen [Thu, 20 Jan 2022 07:38:16 +0000 (08:38 +0100)]
Document textsec

* doc/lispref/elisp.texi (Top): Add menu.
* doc/lispref/text.texi (Text): Add menu.
(Suspicious Text): New node.

* lisp/international/textsec-check.el (textsec-check): Adjust doc
string.

2 years agoCheck link text domain suspiciousness
Lars Ingebrigtsen [Thu, 20 Jan 2022 07:01:20 +0000 (08:01 +0100)]
Check link text domain suspiciousness

* lisp/international/textsec.el (textsec-link-suspicious-p): Check
whether the domain in the link text is suspicious.

2 years agoExpand textsec-link-suspicious-p checking
Lars Ingebrigtsen [Thu, 20 Jan 2022 06:57:13 +0000 (07:57 +0100)]
Expand textsec-link-suspicious-p checking

* lisp/international/textsec.el (textsec-link-suspicious-p): Check
the text more thoroughly for link-like things.

2 years agoImprove textsec-domain-suspicious-p message
Lars Ingebrigtsen [Thu, 20 Jan 2022 06:45:33 +0000 (07:45 +0100)]
Improve textsec-domain-suspicious-p message

* lisp/international/textsec.el (textsec-domain-suspicious-p):
Ensure that we're not confusing the user if there's a directional
override in the string we're checking.

2 years agoAdd new bidi-string-strip-control-characters function
Lars Ingebrigtsen [Thu, 20 Jan 2022 06:44:49 +0000 (07:44 +0100)]
Add new bidi-string-strip-control-characters function

* lisp/international/characters.el
(bidi-string-strip-control-characters): New function.

2 years agoMake article--check-suspicious-addresses more resilient
Lars Ingebrigtsen [Thu, 20 Jan 2022 05:42:56 +0000 (06:42 +0100)]
Make article--check-suspicious-addresses more resilient

* lisp/gnus/gnus-art.el (article--check-suspicious-addresses): Be
more resilient to junk in headers.  (But all this should be rewritten
eventually, because the entire process is way too convoluted.)

2 years agoMake `nil' values of the `:position' underline property work correctly
Po Lu [Thu, 20 Jan 2022 05:06:51 +0000 (13:06 +0800)]
Make `nil' values of the `:position' underline property work correctly

* src/xfaces.c (Finternal_set_lisp_face_attribute): Handle cases
where the underline property `:position' is nil.

2 years agoPort hourglass display to XCB
Po Lu [Thu, 20 Jan 2022 03:27:17 +0000 (11:27 +0800)]
Port hourglass display to XCB

* src/xterm.c (x_show_hourglass):
(x_hide_hourglass): Use straightforward translations to XCB if
available.

2 years agoGet rid of calls to XRenderQueryExtension after terminal initialization
Po Lu [Thu, 20 Jan 2022 02:48:25 +0000 (10:48 +0800)]
Get rid of calls to XRenderQueryExtension after terminal initialization

* src/image.c (x_create_xrender_picture):
(Fimage_transforms_p): Use `xrender_supported_p'.

* src/xterm.c (x_term_init): Query for XRender support and
extension versions.

* src/xterm.h (struct x_display_info): New fields
`xrender_supported_p', `xrender_major' and `xrender_minor'.

2 years agoImplement selection ownership on Haiku
Po Lu [Thu, 20 Jan 2022 01:01:52 +0000 (01:01 +0000)]
Implement selection ownership on Haiku

* lisp/term/haiku-win.el (haiku-selection-owner-p): New
declaration.
(gui-backend-selection-owner-p): Implement using newly exposed
primitive.

* src/haiku_select.cc
(count_clipboard, count_primary, count_secondary): New
variables for tracking selection ownership.
(BClipboard_set_system_data):
(BClipboard_set_primary_selection_data):
(BClipboard_set_secondary_selection_data): Set ownership
variables.
(BClipboard_owns_clipboard):
(BClipboard_owns_primary):
(BClipboard_owns_secondary): New functions.

* src/haikuselect.c (Fhaiku_selection_owner_p): New function.
(syms_of_haikuselect): Define new subr.
* src/haikuselect.h: New prototypes.

2 years agoSuspend temp .elc production when native compiling till when necessary
Andrea Corallo [Wed, 19 Jan 2022 20:07:00 +0000 (21:07 +0100)]
Suspend temp .elc production when native compiling till when necessary

* lisp/emacs-lisp/bytecomp.el (byte-to-native-output-buffer-file):
Rename from `byte-to-native-output-file'.
(byte-write-target-file): Update.
(byte-compile-file): Write the temporary .elc only when not native
compiling.
(byte-compile-file): Kill the .elc buffer only when not native
compiling.
* lisp/emacs-lisp/comp.el (batch-byte+native-compile): Instead of just
renaming the temporary .elc make use of `byte-write-target-file' to
write it down and kill the temporary buffer.

2 years ago* Move some code in in `byte-write-target-file'.
Andrea Corallo [Wed, 19 Jan 2022 19:44:12 +0000 (20:44 +0100)]
* Move some code in in `byte-write-target-file'.

* lisp/emacs-lisp/bytecomp.el (byte-write-target-file): New function
spilling code from `byte-compile-file'.

2 years agoMake article--check-suspicious-addresses more resilient
Lars Ingebrigtsen [Wed, 19 Jan 2022 18:44:29 +0000 (19:44 +0100)]
Make article--check-suspicious-addresses more resilient

* lisp/gnus/gnus-art.el (article--check-suspicious-addresses):
Don't bug out on mbox-less addresses.

2 years agoTweak the previous suspicious Message change
Lars Ingebrigtsen [Wed, 19 Jan 2022 18:10:45 +0000 (19:10 +0100)]
Tweak the previous suspicious Message change

* lisp/gnus/message.el (message-check-recipients)
(message-send-mail): Move the check to after encoding.

2 years agoMake Message check for invalid recipients before sending
Lars Ingebrigtsen [Wed, 19 Jan 2022 18:00:13 +0000 (19:00 +0100)]
Make Message check for invalid recipients before sending

* lisp/gnus/message.el (message-check-recipients): Check for
suspicious addresses before sending (bug#51733).

2 years agoMake textsec-mixed-numbers-p actually work
Lars Ingebrigtsen [Wed, 19 Jan 2022 17:50:40 +0000 (18:50 +0100)]
Make textsec-mixed-numbers-p actually work

* lisp/international/textsec.el (textsec-mixed-numbers-p): Fix the
test.

2 years agoMake Gnus check for suspicious headers
Lars Ingebrigtsen [Wed, 19 Jan 2022 17:43:34 +0000 (18:43 +0100)]
Make Gnus check for suspicious headers

* lisp/gnus/gnus-art.el (gnus-treat-suspicious-headers): New user
option.
(gnus-article-treat-suspicious-headers): New function.
(article-decode-encoded-words): Hook into the machinery to check
headers.
(article--check-suspicious-addresses): New function.

2 years ago; * lisp/international/textsec.el (textsec-url-suspicious-p): Fix a typo.
Eli Zaretskii [Wed, 19 Jan 2022 17:26:46 +0000 (19:26 +0200)]
; * lisp/international/textsec.el (textsec-url-suspicious-p): Fix a typo.

2 years agoAdd text for suspicious links
Lars Ingebrigtsen [Wed, 19 Jan 2022 16:50:21 +0000 (17:50 +0100)]
Add text for suspicious links

* lisp/international/textsec-check.el (textsec-check): Note `link'.
(textsec-propertize): Fix typo.

* lisp/international/textsec.el (textsec-link-suspicious-p): New
function.

* lisp/net/shr.el (shr-tag-a): Check for sus links.

2 years agoDon't overwrite the link text in shr-tag-a for suspicious URLs
Lars Ingebrigtsen [Wed, 19 Jan 2022 16:17:42 +0000 (17:17 +0100)]
Don't overwrite the link text in shr-tag-a for suspicious URLs

* lisp/net/shr.el (shr-tag-a): Tweak how the suspiciousness
warning is handled.

2 years ago; Fix bug#53367
Michael Albinus [Wed, 19 Jan 2022 16:16:08 +0000 (17:16 +0100)]
; Fix bug#53367

* lisp/net/tramp.el (tramp-debug-buffer-command-completion-p):
Handle small buffers.  (Bug#53367)

2 years agoFix thinko in textsec-url-suspicious-p
Lars Ingebrigtsen [Wed, 19 Jan 2022 15:39:13 +0000 (16:39 +0100)]
Fix thinko in textsec-url-suspicious-p

* lisp/international/textsec.el (textsec-url-suspicious-p): Don't
bug out on non-HTTP URLs.

2 years agoMake shr mark links with suspicious URLs
Lars Ingebrigtsen [Wed, 19 Jan 2022 15:37:05 +0000 (16:37 +0100)]
Make shr mark links with suspicious URLs

* lisp/international/textsec-check.el (textsec-propertize): New
function.
(textsec-check): Only check, don't alter STRING.

* lisp/international/textsec.el (textsec-url-suspicious-p): New
function.

* lisp/net/shr.el (shr-tag-a): Mark suspicious links.

2 years agoAdd new file textsec-check.el
Lars Ingebrigtsen [Wed, 19 Jan 2022 15:22:16 +0000 (16:22 +0100)]
Add new file textsec-check.el

* lisp/international/textsec-check.el: New file.
* lisp/international/textsec.el
(textsec-email-address-header-suspicious-p): Rename.

2 years agoMark whole-script confusables as suspicious domains
Lars Ingebrigtsen [Wed, 19 Jan 2022 14:52:20 +0000 (15:52 +0100)]
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.)

2 years agoSplit textsec-email-address-suspicious-p into two functions
Lars Ingebrigtsen [Wed, 19 Jan 2022 14:21:43 +0000 (15:21 +0100)]
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.

2 years ago; Minor fix in 'textsec-domain-suspicious-p'
Eli Zaretskii [Wed, 19 Jan 2022 14:19:36 +0000 (16:19 +0200)]
; Minor fix in 'textsec-domain-suspicious-p'

* lisp/international/textsec.el (textsec-domain-suspicious-p): Fix
explanation string.

2 years agoMake textsec-suspicious-nonspacing-p work on marks
Lars Ingebrigtsen [Wed, 19 Jan 2022 13:42:39 +0000 (14:42 +0100)]
Make textsec-suspicious-nonspacing-p work on marks

* lisp/international/textsec.el (textsec-suspicious-nonspacing-p):
We're only interested in nonspacing marks, not control characters
in this test.

2 years agoFix recent change for big endian systems where `Atom' is 64 bits
Po Lu [Wed, 19 Jan 2022 13:26:38 +0000 (21:26 +0800)]
Fix recent change for big endian systems where `Atom' is 64 bits

* src/xfns.c (x_create_tip_frame): Cast atoms to xcb_atom_t
and pass a reference to that to xcb_change_property instead.

2 years ago* lisp/cus-face.el (custom-face-attributes): Expose the lambdas
Stefan Monnier [Wed, 19 Jan 2022 13:18:19 +0000 (08:18 -0500)]
* lisp/cus-face.el (custom-face-attributes): Expose the lambdas

2 years ago; Yet another improvement of doc strings in textsec
Eli Zaretskii [Wed, 19 Jan 2022 12:00:45 +0000 (14:00 +0200)]
; Yet another improvement of doc strings in textsec

* lisp/international/textsec.el (textsec-local-address-suspicious-p)
(textsec-name-suspicious-p): Fix wording of doc strings.

2 years agoPort some X11 tooltip code to XCB
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.

2 years agoDeconfuse textsec doc strings slightly
Lars Ingebrigtsen [Wed, 19 Jan 2022 10:34:48 +0000 (11:34 +0100)]
Deconfuse textsec doc strings slightly

* 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.

2 years agoImprove textsec doc strings
Robert Pluim [Wed, 19 Jan 2022 10:20:06 +0000 (11:20 +0100)]
Improve textsec doc strings

* lisp/international/textsec.el (textsec-domain-suspicious-p)
(textsec-local-address-suspicious-p, textsec-name-suspicious-p)
(textsec-suspicious-nonspacing-p): Improve doc strings.

2 years agoUse Cairo XCB surfaces when XCB is available
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.

2 years agoMinor improvement in textsec diagnostics
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.

2 years ago; * etc/NEWS ('use-system-tooltips'): Improve wording.
Eli Zaretskii [Wed, 19 Jan 2022 08:41:11 +0000 (10:41 +0200)]
; * etc/NEWS ('use-system-tooltips'): Improve wording.

2 years agoRespect structure of Tramp archive file names
Michael Albinus [Wed, 19 Jan 2022 08:07:49 +0000 (09:07 +0100)]
Respect structure of Tramp archive file names

* lisp/net/tramp.el (tramp-make-tramp-file-name):
Respect structure of archive file names.

2 years ago* src/haikufns.c (Fx_display_mm_width): Fix copy-paste error.
Po Lu [Wed, 19 Jan 2022 06:00:13 +0000 (06:00 +0000)]
* src/haikufns.c (Fx_display_mm_width): Fix copy-paste error.

2 years agoRename system tooltip variables to `use-system-tooltips'
Po Lu [Wed, 19 Jan 2022 05:12:18 +0000 (13:12 +0800)]
Rename system tooltip variables to `use-system-tooltips'

* doc/emacs/frames.texi (Tooltips):
* doc/emacs/haiku.texi (Haiku Basics):
* doc/lispref/display.texi (Tooltips): Document
`use-system-tooltips' instead.

* etc/NEWS: Announce new option.
* lisp/cus-start.el (standard): Add new option.

* lisp/term/haiku-win.el (haiku-use-system-tooltips):
* lisp/term/pgtk-win.el (x-gtk-use-system-tooltips):
* lisp/term/x-win.el (x-gtk-use-system-tooltips): Add aliases
for old options.

* src/frame.c (syms_of_frame): New variable
`use-system-tooltips'.

* src/haikufns.c (Fx_show_tip):
(syms_of_haikufns):
* src/pgtkfns.c (x_hide_tip):
(Fx_show_tip):
(syms_of_pgtkfns):
* src/xfns.c (x_hide_tip):
(Fx_show_tip):
(syms_of_xfns): Use `use-system-tooltips' instead of the old
platform dependent options.

2 years agoUse more reliable timestamps for some kinds of events on Haiku
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.

2 years agoFix event timestamp generation on Haiku
Po Lu [Wed, 19 Jan 2022 01:14:19 +0000 (01:14 +0000)]
Fix event timestamp generation on Haiku

* src/haikuterm.c (haiku_read_socket): Use miliseconds for event
time.

2 years agocl-generic-tests.el: Fix warning
Stefan Monnier [Tue, 18 Jan 2022 21:53:28 +0000 (16:53 -0500)]
cl-generic-tests.el: Fix warning

* test/lisp/emacs-lisp/cl-generic-tests.el (ert): Require at run-time
for `ert--get-explainer`.

2 years agoVC: Fix tests for SCCS and Mtn
Stefan Monnier [Tue, 18 Jan 2022 21:42:19 +0000 (16:42 -0500)]
VC: Fix tests for SCCS and Mtn

* test/lisp/vc/vc-tests.el: Prefer closures to `(lambda ...).
(vc-test-mtn05-rename-file, vc-test-mtn06-version-diff): Skip.

* lisp/vc/vc.el (vc-responsible-backend): Fix vc-test--register on SCCS.

2 years agoautoload.el: Fix corner case and avoid encoding issues
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.

2 years agoImprove doc strings in textsec.el
Eli Zaretskii [Tue, 18 Jan 2022 19:08:19 +0000 (21:08 +0200)]
Improve doc strings in textsec.el

* lisp/international/textsec.el (textsec-mixed-numbers-p)
(textsec-ascii-confusable-p, textsec-resolved-script-set)
(textsec-single-script-confusable-p)
(textsec-mixed-script-confusable-p)
(textsec-whole-script-confusable-p, textsec-domain-suspicious-p)
(textsec-local-address-suspicious-p, textsec-name-suspicious-p)
(textsec-suspicious-nonspacing-p): Doc fix.

2 years agoRemove 'cuneiform-numbers-and-punctuation' from w32font.c
Eli Zaretskii [Tue, 18 Jan 2022 14:24:36 +0000 (16:24 +0200)]
Remove 'cuneiform-numbers-and-punctuation' from w32font.c

* src/w32font.c (syms_of_w32font, font_supported_scripts): Remove
'cuneiform-numbers-and-punctuation'.  Reported by Kévin Le Gouguec
<kevin.legouguec@gmail.com>.

2 years agoThe name in textsec-email-suspicious-p is optional
Lars Ingebrigtsen [Tue, 18 Jan 2022 12:34:39 +0000 (13:34 +0100)]
The name in textsec-email-suspicious-p is optional

* lisp/international/textsec.el (textsec-email-suspicious-p): The
name is optional.

2 years agoAdd textsec functions for verifying email addresses
Lars Ingebrigtsen [Tue, 18 Jan 2022 12:19:55 +0000 (13:19 +0100)]
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.

2 years agoIntern virtual modifier atoms the smart way on X
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.

2 years agoAdd textsec-domain-suspicious-p
Lars Ingebrigtsen [Tue, 18 Jan 2022 10:53:01 +0000 (11:53 +0100)]
Add textsec-domain-suspicious-p

* .gitignore: Ignore idna-mapping.el.

* admin/notes/unicode: Note idna-mapping file.
* admin/unidata/IdnaMappingTable.txt: New file.

* admin/unidata/Makefile.in (all): Generate idna-mapping.el.

* admin/unidata/unidata-gen.el (unidata-gen-idna-mapping): Generate.

* lisp/international/textsec.el (textsec-domain-suspicious-p): New
function.

2 years agoMorka handling of multi-hops in Tramp more consistent
Michael Albinus [Tue, 18 Jan 2022 10:27:15 +0000 (11:27 +0100)]
Morka handling of multi-hops in Tramp more consistent

* lisp/net/tramp.el (tramp-make-tramp-file-name): Adapt argument list.
Add hops to `tramp-default-proxies-alist'.
(tramp-find-foreign-file-name-handler): Adapt argument list.
(tramp-handle-abbreviate-file-name): Abbreviate multi-hops.
(tramp-handle-file-remote-p): Adapt handling of hops.
(tramp-add-hops): New defun.
(tramp-compute-multi-hops): Use it.

* lisp/net/tramp.el (tramp-make-tramp-hop-name, tramp-get-buffer)
(tramp-file-name-handler, tramp-handle-file-truename)
(tramp-handle-insert-file-contents, tramp-local-host-p)
(tramp-read-passwd, tramp-clear-passwd):
* lisp/net/tramp-archive.el (tramp-archive-dissect-file-name)
(tramp-archive-gvfs-file-name):
* lisp/net/tramp-cache.el (tramp-get-hash-table):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename)
(tramp-sh-handle-make-process, tramp-sh-handle-process-file)
(tramp-sh-file-name-handler-p, tramp-get-remote-path):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-truename):
Adapt callees.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate)
(tramp-test07-abbreviate-file-name): Adapt tests.

2 years ago* src/haikuterm.c (haiku_read_socket): Add work for frame size bug.
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.

2 years agoAdd textsec predicates for different types of confusability
Lars Ingebrigtsen [Tue, 18 Jan 2022 09:24:32 +0000 (10:24 +0100)]
Add textsec predicates for different types of confusability

* lisp/international/textsec.el (textsec-resolved-script-set)
(textsec-single-script-confusable-p)
(textsec-mixed-script-confusable-p)
(textsec-whole-script-confusable-p): New functions.

2 years agoAdd textsec support for confusable characters
Lars Ingebrigtsen [Tue, 18 Jan 2022 08:57:43 +0000 (09:57 +0100)]
Add textsec support for confusable characters

* admin/notes/unicode: Note the confusables.txt file.
* admin/unidata/Makefile.in (${unidir}/uni-confusable.el):
Generate the confusable file.

* admin/unidata/README (https): Add confusables.txt.

* admin/unidata/confusables.txt: New file.

* admin/unidata/unidata-gen.el (unidata-gen-confusable): Parse the
confusables.txt file.

* lisp/international/textsec.el (textsec-ascii-confusable-p)
(textsec-unconfuse-string): New functions.

2 years agoImprove textsec-restriction-level doc string
Lars Ingebrigtsen [Mon, 17 Jan 2022 17:29:12 +0000 (18:29 +0100)]
Improve textsec-restriction-level doc string

* lisp/international/textsec.el (textsec-restriction-level):
Improve doc string.

2 years ago* src/haikufns.c (Fx_show_tip): Fix typo.
Po Lu [Tue, 18 Jan 2022 08:20:37 +0000 (08:20 +0000)]
* src/haikufns.c (Fx_show_tip): Fix typo.

2 years agoFix default value of `no-special-glyphs' frame parameter on Haiku
Po Lu [Tue, 18 Jan 2022 08:19:16 +0000 (08:19 +0000)]
Fix default value of `no-special-glyphs' frame parameter on Haiku

* src/haikufns.c (haiku_create_frame): Make `no-special-glyphs'
nil by default.

2 years agoImprove tooltip implementation on Haiku
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.

2 years ago* lisp/tooltip.el (tooltip-show-help): Fix typo.
Po Lu [Tue, 18 Jan 2022 07:56:08 +0000 (15:56 +0800)]
* lisp/tooltip.el (tooltip-show-help): Fix typo.

2 years ago* lisp/tooltip.el: Fix warning when built on a non-Haiku system.
Po Lu [Tue, 18 Jan 2022 03:34:55 +0000 (11:34 +0800)]
* lisp/tooltip.el: Fix warning when built on a non-Haiku system.

2 years ago; * lisp/international/fontset.el (setup-default-fontset): Fix last change.
Eli Zaretskii [Tue, 18 Jan 2022 03:33:28 +0000 (05:33 +0200)]
; * lisp/international/fontset.el (setup-default-fontset): Fix last change.

2 years agoFix system tooltips above menus
Po Lu [Tue, 18 Jan 2022 02:41:29 +0000 (02:41 +0000)]
Fix system tooltips above menus

* src/haikufns.c (Fx_show_tip): Disable frame reuse inside a
menu.
(syms_of_haikufns): New symbol `tooltip-reuse-hidden-frame'.

2 years agoAllow non-system tooltips to display above menus on Haiku
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.

2 years ago(hack-local-variables--find-variables): Use `user-error`
Stefan Monnier [Mon, 17 Jan 2022 21:28:02 +0000 (16:28 -0500)]
(hack-local-variables--find-variables): Use `user-error`

* lisp/files.el (hack-local-variables--find-variables):
Incorrect formatting are not coding errors.