]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoAccommodate nonstandard turbo file senders in erc-dcc
F. Jason Park [Sat, 30 Apr 2022 09:16:46 +0000 (02:16 -0700)]
Accommodate nonstandard turbo file senders in erc-dcc

* lisp/erc/erc-dcc.el (erc-dcc-list): Document optional :turbo item.
(erc-message-english-dcc-list-{head,line,item}): Adjust format strings
to make room for "(T)" turbo indicator.
(erc-dcc-do-GET-command): Optionally set :turbo in `erc-dcc-list'
entry when passed "-t" in the "/DCC GET" slash command.  Also add
switch to command line in front-matter Commentary, but refrain from
publicizing further because our implementation is only defensive and
only for receiving.
(erc-dcc-do-LIST): Print message with new format specifier for turbo
status.
(erc-dcc-ctcp-query-send-regexp): Account for T- and S-prefixed
commands.  Receiving from an SSEND-capable sender will be added in a
subsequent commit.
(erc-dcc-handle-ctcp-send): Set :turbo item in `erc-dcc-list' member
when new match group is nonempty.
(erc-dcc--X-send-final-turbo-ack): New internal variable and potential
future option for extreme corner cases involving maverick turbo
senders, like WeeChat, who don't use the TSEND command variant.
(erc-dcc-get-filter): Don't send when turbo is active.

* test/lisp/erc/erc-dcc-tests.el: Add new file.
(Bug#54458)

2 years agoAllow matching against string values in erc-dcc-member
F. Jason Park [Sun, 10 Apr 2022 06:32:22 +0000 (23:32 -0700)]
Allow matching against string values in erc-dcc-member

* lisp/erc/erc-dcc.el (erc-dcc-member): Be more tolerant in the
catch-all case by testing for equality instead of identity.
(erc-dcc-do-GET-command): Pass file name when querying
`erc-dcc-member'. (Bug#54458)

2 years agoDon't send reports in erc-dcc-get-filter when nested
F. Jason Park [Mon, 28 Mar 2022 09:24:43 +0000 (02:24 -0700)]
Don't send reports in erc-dcc-get-filter when nested

* lisp/erc/erc-dcc.el (erc-dcc-get-filter): Don't bother sending a
"received so far" receipt if another attempt is still ongoing.
(Bug#54458)

2 years agoSummarize failed transfers in erc-dcc
F. Jason Park [Thu, 31 Mar 2022 00:16:11 +0000 (17:16 -0700)]
Summarize failed transfers in erc-dcc

* lisp/erc/erc-dcc.el (erc-dcc-get-sentinel): Display error when total
byte count received is lower than expected.
(erc-message-english-dcc-get-failed): Add `dcc-get-failed' to the
English messages catalog.
(erc-dcc-get-file): Tweak initialization of `erc-dcc-entry-data'.
(Bug#54458)

2 years ago* lisp/cedet/semantic/fw.el: Fix typo
Stefan Monnier [Sun, 22 May 2022 20:27:21 +0000 (16:27 -0400)]
* lisp/cedet/semantic/fw.el: Fix typo

2 years agomode-local: Revert the deprecation of buffer-local overrides
Stefan Monnier [Sun, 22 May 2022 20:10:58 +0000 (16:10 -0400)]
mode-local: Revert the deprecation of buffer-local overrides

Obviously, I did not understand how the <foo>--install-parser was invoked.

Revert "mode-local: Deprecate buffer-local overrides"
Revert "semantic-install-function-overrides: Declare obsolete"
Revert "wisent.el: Prefer `define-mode-local-override`"

This reverts commits 91bc24c46768aab4a851c87edaea05c7476ff779,
d2e0d1452b976a51579cf044257326850804c562, and
3294ad44ebcd024b4ada68d00bedca33acc52de6.

2 years agoFix bytecomp-test--with-suppressed-warnings test
Lars Ingebrigtsen [Sun, 22 May 2022 18:16:01 +0000 (20:16 +0200)]
Fix bytecomp-test--with-suppressed-warnings test

* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Adjust test to change
in warning message.

2 years agoFix previous warning suppression change
Lars Ingebrigtsen [Sun, 22 May 2022 18:14:03 +0000 (20:14 +0200)]
Fix previous warning suppression change

* lisp/emacs-lisp/bytecomp.el (byte-compile-emit-callargs-warn)
(byte-compile-subr-wrong-args):
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings):
* lisp/cedet/semantic/fw.el (semantic-install-function-overrides):
The `wrong-args' warning is really called `callargs'.

2 years agoFix compilation warning in semantic-install-function-overrides
Lars Ingebrigtsen [Sun, 22 May 2022 18:07:14 +0000 (20:07 +0200)]
Fix compilation warning in semantic-install-function-overrides

* lisp/cedet/semantic/fw.el (semantic-install-function-overrides):
Suppress message about wrong number of arguments.

2 years agoAllow suppressing messages about the wrong number of arguments
Lars Ingebrigtsen [Sun, 22 May 2022 18:06:24 +0000 (20:06 +0200)]
Allow suppressing messages about the wrong number of arguments

* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Add
`wrong-args'.
* lisp/emacs-lisp/bytecomp.el (byte-compile-emit-callargs-warn)
(byte-compile-subr-wrong-args): Allow suppressing wrong number of
arguments.

2 years agoEnable keys M-down, M-up, M-RET for in-buffer completion
Juri Linkov [Sun, 22 May 2022 17:55:35 +0000 (20:55 +0300)]
Enable keys M-down, M-up, M-RET for in-buffer completion

* lisp/minibuffer.el (completion-in-region-mode-map): Add keybindings M-<up>
for minibuffer-previous-completion, M-<down> for minibuffer-next-completion,
M-RET for minibuffer-choose-completion.
(completion-in-region-mode): Set buffer-local
'minibuffer-completion-auto-choose' to nil.
(minibuffer-next-completion): Get the value of
'minibuffer-completion-auto-choose' from the minibuffer.
(minibuffer-previous-completion): Simplify by delegating to
'minibuffer-next-completion'.

* doc/emacs/programs.texi (Symbol Completion): Add description of keys
M-down, M-up, M-RET.

https://lists.gnu.org/archive/html/emacs-devel/2022-05/msg00916.html

2 years agoCC Mode: Restore string fence properties at each relevant external entry point
Alan Mackenzie [Sun, 22 May 2022 16:55:05 +0000 (16:55 +0000)]
CC Mode: Restore string fence properties at each relevant external entry point

This fixes bug #55230.

* lisp/progmodes/cc-defs.el (c-string-fences-set-flag, c-with-string-fences):
New variable and macro.

* lisp/progmodes/cc-mode.el (c-called-from-text-property-change-p): Add
remove-text-properties to the list of accepted functions.
(c-clear-string-fences, c-restore-string-fences): Surround the functions'
innards with c-save-buffer-state to prevent text property changes causing
change functions to be called.
(c-before-change, c-after-change, c-font-lock-fontify-region): Replace the
explicit calls to c-restore-string-fences and c-clear-string-fences with
invocations of the new macro c-with-string-fences.

* lisp/progmodes/cc-awk.el (c-awk-extend-and-syntax-tablify-region)
(c-awk-end-of-defun)
* lisp/progmodes/cc-cmds.el (c-show-syntactic-information)
(c-electric-backspace, c-hungry-delete-backwards, c-electric-delete-forward)
(c-hungry-delete-forward, c-electric-pound, c-electric-brace)
(c-electric-slash, c-electric-star, c-electric-semi&comma, c-electric-colon)
(c-electric-lt-gt, c-electric-paren, c-beginning-of-defun, c-end-of-defun)
(c-display-defun-name, c-mark-function, c-beginning-of-statement)
(c-end-of-statement, c-indent-command, c-indent-exp, c-indent-defun)
(c-indent-line-or-region, c-fill-paragraph, c-indent-new-comment-line)
(c-context-line-break)
* lisp/progmodes/cc-guess.el (c-guess-region-no-install): These are all
"boundary" functions to CC Mode.  Surround each by c-with-string-fences.

2 years agoDon't font-lock invalid invalid class/function names
kobarity [Sun, 22 May 2022 16:53:00 +0000 (18:53 +0200)]
Don't font-lock invalid invalid class/function names

* lisp/progmodes/python.el (python-font-lock-keywords-level-1):
Don't font-lock invalid invalid class/function names (bug#55573).

2 years agomode-local: Deprecate buffer-local overrides
Stefan Monnier [Sun, 22 May 2022 16:52:42 +0000 (12:52 -0400)]
mode-local: Deprecate buffer-local overrides

* lisp/cedet/mode-local.el (mode-local-bind): Make all args mandatory.
Deprecate the use of a nil `mode` argument.

2 years agosemantic-install-function-overrides: Declare obsolete
Stefan Monnier [Sun, 22 May 2022 16:22:40 +0000 (12:22 -0400)]
semantic-install-function-overrides: Declare obsolete

* lisp/cedet/semantic/fw.el (semantic-install-function-overrides):
Declare obsolete.

2 years agowisent.el: Prefer `define-mode-local-override`
Stefan Monnier [Sun, 22 May 2022 16:21:23 +0000 (12:21 -0400)]
wisent.el: Prefer `define-mode-local-override`

* lisp/cedet/semantic/wisent.el (wisent--parse-stream): Rename from
`wisent-parse-stream` and mark the old name obsolete.
(semantic-parse-stream): Override with `define-mode-local-override`.

* lisp/cedet/semantic/wisent/grammar.el
(semantic-grammar-setupcode-builder): Don't override
`semantic-parse-stream` manually here via
`semantic-install-function-overrides`.

* lisp/cedet/semantic/grm-wy-boot.el: Refresh.

2 years agowisent/grammar.el: Prefer `define-mode-local-override`
Stefan Monnier [Sun, 22 May 2022 16:13:28 +0000 (12:13 -0400)]
wisent/grammar.el: Prefer `define-mode-local-override`

* lisp/cedet/semantic/wisent/grammar.el
(semantic-grammar-parsetable-builder, semantic-grammar-setupcode-builder):
Override with `define-mode-local-override`.
(wisent-grammar-mode): Don't override them with
`semantic-install-function-overrides`.

2 years agocedet/html.el: Prefer `define-mode-local-override`
Stefan Monnier [Sun, 22 May 2022 16:10:47 +0000 (12:10 -0400)]
cedet/html.el: Prefer `define-mode-local-override`

* lisp/cedet/semantic/html.el (semantic-tag-components): Override via
`define-mode-local-override`.
(semantic-default-html-setup): Don't override via
`semantic-install-function-overrides`.

2 years agobovine/grammar.el: Prefer `define-mode-local-override`
Stefan Monnier [Sun, 22 May 2022 15:22:29 +0000 (11:22 -0400)]
bovine/grammar.el: Prefer `define-mode-local-override`

* lisp/cedet/semantic/bovine/grammar.el
(semantic-grammar-parsetable-builder, semantic-grammar-setupcode-builder):
Override with `define-mode-local-override`.
(bovine-grammar-mode): Don't override them with
`semantic-install-function-overrides`.

2 years agocedet/texi.el: prefer `define-mode-local-override`
Stefan Monnier [Sun, 22 May 2022 15:13:27 +0000 (11:13 -0400)]
cedet/texi.el: prefer `define-mode-local-override`

* lisp/cedet/semantic/texi.el (semantic-parse-region)
(semantic-parse-changes): Override with `define-mode-local-override`.
(semantic-default-texi-setup): Don't override them with
`semantic-install-function-overrides`.

2 years agocomp.el: Cosmetic changes
Stefan Monnier [Sun, 22 May 2022 14:48:58 +0000 (10:48 -0400)]
comp.el: Cosmetic changes

* lisp/emacs-lisp/comp.el (comp-run-async-workers): Tweak code.
(comp-run-async-workers): Don't set `buffer-read-only` directly.
(native--compile-async): Fix misuse of "path".

2 years agoRun `minibuffer-exit-hook` in the right buffer
Stefan Monnier [Sun, 22 May 2022 14:35:02 +0000 (10:35 -0400)]
Run `minibuffer-exit-hook` in the right buffer

* src/minibuf.c (run_exit_minibuf_hook): Take the minibuffer as arg
and run the hook in that buffer.
(read_minibuf): Adjust accordingly.

2 years ago* lisp/window.el (display-buffer-avoid-small-windows): Fix :type.
Michael Albinus [Sun, 22 May 2022 12:48:30 +0000 (14:48 +0200)]
* lisp/window.el (display-buffer-avoid-small-windows): Fix :type.

2 years agoClean up Haiku code
Po Lu [Sun, 22 May 2022 12:22:44 +0000 (12:22 +0000)]
Clean up Haiku code

* src/haiku_support.cc (movement_locker, class EmacsWindow)
(MouseMoved): Delete `movement_locker' and associated hack,
since it's superseeded by some code in haiku_read_socket.
(key_map, key_chars, dpy_color_space, popup_track_message)
(alert_popup_value, grab_view, grab_view_locker)
(drag_and_drop_in_progress): Write comments and fix
initializers.

* src/haikuterm.c (haiku_read_socket): Update comment.

2 years agoFix two typos in comments in python.el
kobarity [Sun, 22 May 2022 11:26:34 +0000 (13:26 +0200)]
Fix two typos in comments in python.el

* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration): Fix typos in
comments (bug#55557).

2 years agoFix submit-emacs-patch
Damien Cassou [Sun, 22 May 2022 06:32:38 +0000 (08:32 +0200)]
Fix submit-emacs-patch

submit-emacs-patch creates a new message and immediately inserts new
lines without first moving the point to the message body.  This
doesn't work with notmuch (and its notmuch-user-agent symbol) because
the point starts in the headers and nothing in Emacs specifies that
the mua should move point to the body automatically.

* lisp/mail/emacsbug.el (submit-emacs-patch): Make sure point is in
the body before inserting new lines (bug#55571).

2 years agoProperly indent Python PEP634 match/case blocks
Lele Gaifax [Sun, 22 May 2022 08:44:31 +0000 (10:44 +0200)]
Properly indent Python PEP634 match/case blocks

Python 3.10 introduced the "structural pattern matching" syntax, and
commit 139042eb8629e6fd49b2c3002a8fc4d1aabd174d told font-lock about the
new keywords. This adds them also as block-start statements, to enable
proper indentation of such blocks.

* lisp/progmodes/python.el (python-rx): Add "match" and "case" as
block-start keywords.
* test/lisp/progmodes/python-tests.el (python-indent-after-match-block,
python-indent-after-case-block): New tests to verify indentation of
"match" and "case" blocks (bug#55572).

2 years agoImplement `display-monitors-changed-functions' on MS Windows
Po Lu [Sun, 22 May 2022 09:15:10 +0000 (17:15 +0800)]
Implement `display-monitors-changed-functions' on MS Windows

* src/w32term.c (w32_read_socket): Handle WM_DISPLAYCHANGE by
sending monitor change events.

2 years agoFix uninitialized use of xm drag receiver data
Po Lu [Sun, 22 May 2022 07:56:11 +0000 (15:56 +0800)]
Fix uninitialized use of xm drag receiver data

* src/xterm.c (xm_read_drag_receiver_info): Just return if the
protocol is invalid.  Reported by Jashank Jeremy
<jashank@rulingia.com.au>.

2 years agoFix build with --enable-check-lisp-object-type
Po Lu [Sun, 22 May 2022 07:33:50 +0000 (15:33 +0800)]
Fix build with --enable-check-lisp-object-type

* src/xterm.c (handle_one_xevent): Fix use of Fequal.  Reported
by Jashank Jeremy <jashank@rulingia.com.au>.

2 years ago; Fix documentation of Tagalog
Eli Zaretskii [Sun, 22 May 2022 07:23:35 +0000 (10:23 +0300)]
; Fix documentation of Tagalog

* lisp/leim/quail/philippine.el ("tagalog"):
* lisp/language/philippine.el ("Tagalog"): Fix doc string.
(Bug#55529)

2 years agoAdd support for the Tagalog script
समीर सिंह Sameer Singh [Thu, 19 May 2022 22:07:38 +0000 (03:37 +0530)]
Add support for the Tagalog script

* lisp/language/philippine.el ("Tagalog"): New language environment.
Add composition rules for Tagalog.  Add sample text and input
method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Tagalog.
* lisp/leim/quail/philippine.el ("tagalog"): New input method.
* lisp/loadup.el: Preload lisp/language/philippine.el.

* etc/HELLO: Add a Tagalog greeting.
* etc/NEWS: Announce the new language environment and its
input method.
(Bug#55529)

2 years agoFix use-after-free in x_destroy_window
Po Lu [Sun, 22 May 2022 05:13:01 +0000 (13:13 +0800)]
Fix use-after-free in x_destroy_window

* src/xterm.c (x_destroy_window): Fix use after free of the
dpyinfo.

2 years agoFix focus redirection to/from surrogate minibuffer frames on Haiku
Po Lu [Sun, 22 May 2022 05:03:12 +0000 (05:03 +0000)]
Fix focus redirection to/from surrogate minibuffer frames on Haiku

* src/haikuterm.c (haiku_get_focus_frame): New function.
(haiku_create_terminal): Register new hook.

2 years agoFix GNUstep build
Po Lu [Sun, 22 May 2022 03:18:32 +0000 (11:18 +0800)]
Fix GNUstep build

* src/nsfns.m (ns_implicitly_set_icon_type): Don't use UTType if
GNUstep.

2 years agoFix compiler warnings on Mac OS X 10.12
Po Lu [Sun, 22 May 2022 03:02:24 +0000 (11:02 +0800)]
Fix compiler warnings on Mac OS X 10.12

* configure.ac: Check for Mac OS X 12 and link with
UniformTypeIdentifiers.framework.

* src/nsfns.m (IOMasterPort): Define to `IOMainPort' on Mac OS X
12.
(ns_implicitly_set_icon_type, Fns_read_file_name):
* src/nsxwidget.m: ([XwWebView
initWithFrame:configuration:xwidget:]): Fix uses of obsolete
things.

2 years agoSet display size upon RRScreenChangeNotify
Po Lu [Sun, 22 May 2022 01:38:21 +0000 (09:38 +0800)]
Set display size upon RRScreenChangeNotify

* src/xterm.c (handle_one_xevent): Handle RRScreenChangeNotify
correctly.

2 years agoDon't unnecessarily call monitor change functions
Po Lu [Sun, 22 May 2022 01:27:46 +0000 (09:27 +0800)]
Don't unnecessarily call monitor change functions

* src/xterm.c (handle_one_xevent): If monitor attributes didn't
change, don't send monitor change event.
(x_term_init, mark_xterm): Mark and init new field.
* src/xterm.h (struct x_display_info): New field
`last_monitor_attributes_list'.

2 years ago; * doc/emacs/dired.texi (Entering Dired): Fix typo.
Sean Whitton [Sat, 21 May 2022 23:15:01 +0000 (16:15 -0700)]
; * doc/emacs/dired.texi (Entering Dired): Fix typo.

2 years ago; Rename enable-theme and disable-theme hooks
Eli Zaretskii [Sat, 21 May 2022 13:55:15 +0000 (16:55 +0300)]
; Rename enable-theme and disable-theme hooks

* lisp/custom.el (enable-theme-functions)
(disable-theme-functions): Rename from enable-theme-hook and
disable-theme-hook.  All users changed.  (Bug#37802)

2 years agoSome cleanups in tramp-tests.el
Michael Albinus [Sat, 21 May 2022 13:44:22 +0000 (15:44 +0200)]
Some cleanups in tramp-tests.el

* test/lisp/net/tramp-tests.el (tramp-fuse-remove-hidden-files): Declare.
(tramp-test16-directory-files)
(tramp-test16-file-expand-wildcards)
(tramp-test26-file-name-completion, tramp--test-check-files): Use it.
(tramp--test-check-files): Delete directory recursively.
(tramp-test43-file-system-info): Make test more robust.

2 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Sat, 21 May 2022 13:43:34 +0000 (15:43 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

2 years agoFix recently introduced Python font lock breakage of chained assignments
kobarity [Sat, 21 May 2022 13:23:21 +0000 (15:23 +0200)]
Fix recently introduced Python font lock breakage of chained assignments

* lisp/progmodes/python.el (python-font-lock-assignment-matcher):
Fix fontification of chained assignments (bug#54992).

2 years ago; Merge from origin/emacs-28
Michael Albinus [Sat, 21 May 2022 13:20:10 +0000 (15:20 +0200)]
; Merge from origin/emacs-28

The following commit was skipped:

fa6a0962c5 Fix Tramp sshfs tests (don't merge)

2 years agoMerge from origin/emacs-28
Michael Albinus [Sat, 21 May 2022 13:20:10 +0000 (15:20 +0200)]
Merge from origin/emacs-28

f836ed098f Some minor Tramp fixes

2 years agoAdd new hooks when enabling and disabling themes
Lars Ingebrigtsen [Sat, 21 May 2022 12:56:13 +0000 (14:56 +0200)]
Add new hooks when enabling and disabling themes

* lisp/custom.el (enable-theme-hook, disable-theme-hook): New
hooks (bug#37802).
(enable-theme, disable-theme): Call them.

2 years ago; * etc/NEWS: Fix wording of 'zap-to-char's entry.
Eli Zaretskii [Sat, 21 May 2022 09:55:12 +0000 (12:55 +0300)]
; * etc/NEWS: Fix wording of 'zap-to-char's entry.

2 years agozap-to-char: case sensitive for upper-case characters
Tino Calancha [Sat, 21 May 2022 09:23:17 +0000 (11:23 +0200)]
zap-to-char: case sensitive for upper-case characters

In interactive calls, behave case-sensitively if the given char
is an upper-case character.  Same for zap-up-to-char (Bug#54804).

This is analog to what the user-level incremental search feature does.

* lisp/misc.el (zap-up-to-char): Add an optional arg INTERACTIVE.
Perform a case-sensitive search when INTERACTIVE is non-nil and
CHAR is an upper-case character.
* lisp/simple.el (zap-to-char): Same.

* etc/NEWS (Editing Changes in Emacs 29.1): Announce this change.
* test/lisp/misc-tests.el (misc-test-zap-up-to-char): Add test cases.
* test/lisp/simple-tests.el (with-zap-to-char-test): Add helper macro.
(simple-tests-zap-to-char): Add a test.

2 years agoImprove doc for `display-monitors-changed-functions'
Po Lu [Sat, 21 May 2022 08:41:34 +0000 (16:41 +0800)]
Improve doc for `display-monitors-changed-functions'

* doc/lispref/frames.texi (Multiple Terminals): Describe how to
retrieve the new monitor configuration inside
`display-monitor-attributes-list'.

2 years ago; * etc/HELLO: Improve wording of preamble text. (Bug#55439)
Eli Zaretskii [Sat, 21 May 2022 08:04:58 +0000 (11:04 +0300)]
; * etc/HELLO: Improve wording of preamble text.  (Bug#55439)

2 years agoFix compiler warnings in printer code on 32-bit systems
Po Lu [Sat, 21 May 2022 06:46:57 +0000 (14:46 +0800)]
Fix compiler warnings in printer code on 32-bit systems

* print.c (enum print_entry_type, struct print_stack_entry):
Clean up coding style.
(struct print_stack): Make print_stack_entry.list.idx intmax_t,
like it was before the nonrecursive printing was installed.
Also clarify what "Brent cycle detection" means in the comments.

2 years agoCompute frame workareas on Haiku
Po Lu [Sat, 21 May 2022 06:28:06 +0000 (06:28 +0000)]
Compute frame workareas on Haiku

* lisp/frame.el (display-monitor-attributes-list): Implement
specially on Haiku as well.
* src/haiku_support.cc (get_zoom_rect): New function.  Extract
CalculateZoomRect here.
(class EmacsWindow, SetFullscreen): Use that instead of
CalculateZoomRect.
(be_get_explicit_workarea): New function.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (Fhaiku_display_monitor_attributes_list): New
function.
(syms_of_haikufns): Register new subr.

2 years agoImplement monitor change hooks on NS
Po Lu [Sat, 21 May 2022 03:50:08 +0000 (11:50 +0800)]
Implement monitor change hooks on NS

This hasn't been tested with anything more complicated than
removing an emulated monitor.

* nsterm.m (ns_displays_reconfigured): New function.
(ns_term_init): Register display reconfiguration callbacks.

2 years agoCall XRRUpdateConfiguration when the root window geometry changes
Po Lu [Sat, 21 May 2022 03:34:51 +0000 (11:34 +0800)]
Call XRRUpdateConfiguration when the root window geometry changes

* src/xterm.c (handle_one_xevent): Call XRRUpdateConfiguration
on RRScreenChangeNotify and upon ConfigureNotify events for the
root window.

2 years agoImplement `display-monitors-changed-hook' on PGTK
Po Lu [Sat, 21 May 2022 03:29:22 +0000 (11:29 +0800)]
Implement `display-monitors-changed-hook' on PGTK

* src/pgtkterm.c (pgtk_draw_glyphless_glyph_string_foreground):
Pacify GCC 12.
(pgtk_monitors_changed_cb): New function.
(pgtk_term_init): Attach new signal handler.

2 years agoAdd a hook run upon monitor configuration changes
Po Lu [Sat, 21 May 2022 03:17:34 +0000 (11:17 +0800)]
Add a hook run upon monitor configuration changes

* doc/lispref/frames.texi (Multiple Terminals): Document new
hook `display-monitors-changed-functions'.
* etc/NEWS: Announce new abnormal hook.

* src/keyboard.c (kbd_buffer_get_event): Handle
MONITORS_CHANGED_EVENT.
(syms_of_keyboard): New hook and defsyms.
* src/termhooks.h (enum event_kind): Add new event
`MONITORS_CHANGED_EVENT'.

* src/xterm.c (handle_one_xevent): Handle RRNotify and
RRScreenChangeNotify events.
(x_term_init): Select for RRScreenChange, RRCrtcChange and
RROutputChange.
* src/xterm.h (struct x_display_info): Improve RandR version
detection.

2 years agoRemove compat code; assume imenu.el exists
Stefan Kangas [Fri, 20 May 2022 18:56:54 +0000 (20:56 +0200)]
Remove compat code; assume imenu.el exists

* lisp/progmodes/antlr-mode.el (antlr-mode):
* lisp/progmodes/cperl-mode.el (cperl-menu):
* lisp/progmodes/f90.el (f90-mode-map):
* lisp/progmodes/fortran.el (fortran-menu):
* lisp/speedbar.el (speedbar-use-imenu-flag): Remove compat code;
assume imenu.el exists.

2 years ago; * src/xterm.c (struct x_client_list_window): Improve comment.
Po Lu [Fri, 20 May 2022 12:08:06 +0000 (20:08 +0800)]
; * src/xterm.c (struct x_client_list_window): Improve comment.

2 years agoCheck for allocation errors when setting XdndActionDescription
Po Lu [Fri, 20 May 2022 12:03:05 +0000 (20:03 +0800)]
Check for allocation errors when setting XdndActionDescription

* src/xterm.c (x_dnd_begin_drag_and_drop): Check for BadAlloc
when setting action descriptions.

2 years ago; * doc/lispref/text.texi (Yanking): Fix wording.
Eli Zaretskii [Fri, 20 May 2022 12:06:44 +0000 (15:06 +0300)]
; * doc/lispref/text.texi (Yanking): Fix wording.

2 years agoDocument 'enriched-toggle-markup'
Eli Zaretskii [Fri, 20 May 2022 12:03:06 +0000 (15:03 +0300)]
Document 'enriched-toggle-markup'

* etc/enriched.txt: Document the new 'enriched-toggle-markup'
command.  (Bug#33855)

2 years ago; * lisp/simple.el (yank-transform-functions): Doc fix.
Eli Zaretskii [Fri, 20 May 2022 11:51:07 +0000 (14:51 +0300)]
; * lisp/simple.el (yank-transform-functions): Doc fix.

2 years ago; Improve documentation of 'display-buffer-avoid-small-windows'
Eli Zaretskii [Fri, 20 May 2022 11:35:03 +0000 (14:35 +0300)]
; Improve documentation of 'display-buffer-avoid-small-windows'

* lisp/window.el (display-buffer-avoid-small-windows)
(get-lru-window):
* etc/NEWS:
* doc/lispref/windows.texi (Choosing Window Options): Improve
documentation of 'display-buffer-avoid-small-windows'.
(Bug#10186)

2 years agoAdd new user option display-buffer-avoid-small-windows
Lars Ingebrigtsen [Fri, 20 May 2022 10:05:34 +0000 (12:05 +0200)]
Add new user option display-buffer-avoid-small-windows

* doc/lispref/windows.texi (Choosing Window Options): Document it.
* lisp/window.el (display-buffer-avoid-small-windows): New user
option (bug#10186).
(get-lru-window): Use it.

2 years agoClarify select-active-regions doc string
Lars Ingebrigtsen [Fri, 20 May 2022 09:06:49 +0000 (11:06 +0200)]
Clarify select-active-regions doc string

* src/keyboard.c (syms_of_keyboard): Clarify doc string (bug#29889).

2 years agoFix race conditions processing zoom events on Haiku
Po Lu [Fri, 20 May 2022 09:28:19 +0000 (09:28 +0000)]
Fix race conditions processing zoom events on Haiku

* src/haiku_support.cc (Zoom):
* src/haiku_support.h (struct haiku_zoom_event): Include the
current fullscreen mode in the event.

* src/haikuterm.c (haiku_read_socket): Use that instead of the
current frame's fullscreen mode.

2 years agoRe-fix previous `&' dired change
Lars Ingebrigtsen [Fri, 20 May 2022 08:37:15 +0000 (10:37 +0200)]
Re-fix previous `&' dired change

* lisp/dired-aux.el (dired-shell-stuff-it): Re-fix the previous
change -- the &wait was in the wrong place (bug#36331).

2 years agoAdd option to kill a shell buffer when the process ends
Philip Kaludercic [Sun, 15 May 2022 00:09:46 +0000 (02:09 +0200)]
Add option to kill a shell buffer when the process ends

* shell.el (shell-kill-buffer-on-quit): Add new option (bug#55426).
(shell): Respect 'shell-kill-buffer-on-quit'.
* NEWS: Mention 'shell-kill-buffer-on-quit'.

2 years agoFix NS port warnings with GCC 12
Po Lu [Fri, 20 May 2022 06:46:45 +0000 (14:46 +0800)]
Fix NS port warnings with GCC 12

* src/nsterm.m (ns_draw_glyphless_glyph_string_foreground):
Clear s->char2b after function returns.

2 years agoRemove flickering when toggling between different fullscreen states on Haiku
Po Lu [Fri, 20 May 2022 05:34:04 +0000 (05:34 +0000)]
Remove flickering when toggling between different fullscreen states on Haiku

* src/haiku_support.cc (FrameMoved): Don't allow moving the
frame along the "filled" axis when fullwidth or fullheight.
(ClearFullscreen): New argument `mode'.  Return the previous
rect but don't revert the frame to it if the target mode is not
NONE.
(SetFullscreen): Use rect provided by ClearFullscreen instead.

2 years agoMinor cleanups to X drag-and-drop code
Po Lu [Fri, 20 May 2022 03:21:47 +0000 (11:21 +0800)]
Minor cleanups to X drag-and-drop code

* src/xterm.c (struct x_client_list_window): Write comments
describing the meaning of each field.
(XM_DRAG_PROTOCOL_VERSION, xm_setup_dnd_targets)
(xm_setup_drag_info, xm_read_drag_receiver_info)
(x_dnd_compute_toplevels): Don't hard-code the supported Motif
protocol version.

2 years agoImplement `cross-disabled-images' on Haiku
Po Lu [Fri, 20 May 2022 02:27:06 +0000 (02:27 +0000)]
Implement `cross-disabled-images' on Haiku

* src/haiku_draw_support.cc (be_draw_cross_on_pixmap_1)
(be_draw_cross_on_pixmap): New functions.

* src/haiku_support.h: Update prototypes.

* src/image.c (image_pixmap_draw_cross, image_disable_image):
Implement drawing cross on Haiku.

2 years agoRename compare-window-configurations and update doc
Lars Ingebrigtsen [Fri, 20 May 2022 02:23:32 +0000 (04:23 +0200)]
Rename compare-window-configurations and update doc

* doc/lispref/windows.texi (Window Configurations): Update name.
* lisp/strokes.el (strokes-window-configuration-changed-p):
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Update
callers and references.

* lisp/subr.el (compare-window-configurations): Make into obsolete
alias.

* src/window.c (Fwindow_configuration_equal_p): Rename (bug#14964).

2 years agoDon't have the tutorial ask to save if we haven't moved
Lars Ingebrigtsen [Fri, 20 May 2022 01:59:03 +0000 (03:59 +0200)]
Don't have the tutorial ask to save if we haven't moved

* lisp/tutorial.el (tutorial--save-on-kill): Don't ask if the user
hasn't moved point (bug#37326).
(help-with-tutorial): Set the start point.

2 years agoImplement more data type conversions for Haiku selections
Po Lu [Fri, 20 May 2022 01:49:43 +0000 (01:49 +0000)]
Implement more data type conversions for Haiku selections

* src/haikuselect.c (haiku_message_to_lisp):
(lisp_to_type_code):
(haiku_lisp_to_message):
(Fhaiku_drag_message): Recognize `double' and `float' types.
(syms_of_haikuselect): New defsyms.

2 years agoFix font-locking of (defun foo (function ...))
Lars Ingebrigtsen [Fri, 20 May 2022 01:46:35 +0000 (03:46 +0200)]
Fix font-locking of (defun foo (function ...))

* lisp/emacs-lisp/lisp-mode.el (lisp--el-funcall-position-p):
Don't colorize the `function' in (defun foo (function ...)) as a
special form (bug#37074).

2 years agoMake diff--font-lock-prettify do less if we don't have a left fringe
Lars Ingebrigtsen [Fri, 20 May 2022 01:38:27 +0000 (03:38 +0200)]
Make diff--font-lock-prettify do less if we don't have a left fringe

* lisp/vc/diff-mode.el (diff--font-lock-prettify): Don't remove
insert/deletions from the buffer if we don't have a left fringe
(bug#37019).

2 years agoAdd a new command 'yank-in-context'
Lars Ingebrigtsen [Fri, 20 May 2022 01:24:30 +0000 (03:24 +0200)]
Add a new command 'yank-in-context'

* lisp/simple.el (escaped-string-quote): New variable.
(yank-in-context): New command.
(yank-in-context--transform): Helper function.

* lisp/progmodes/sh-script.el (sh-mode): Set up an
escaped-string-quote function.
* lisp/progmodes/sql.el (sql-mode): Define escaped-string-quote.

2 years agoFix session management detection of the first X display
Po Lu [Fri, 20 May 2022 01:11:38 +0000 (09:11 +0800)]
Fix session management detection of the first X display

* src/xterm.c (x_term_init): Check that there is no other
display in the chain instead of testing the terminal ID.

2 years agoClarify yank-transform-functions doc string
Lars Ingebrigtsen [Fri, 20 May 2022 00:09:43 +0000 (02:09 +0200)]
Clarify yank-transform-functions doc string

* lisp/simple.el (yank-transform-functions): Clarify calling
convention.

2 years agoMake completion in emacs-lisp-mode intern fewer symbols
Lars Ingebrigtsen [Fri, 20 May 2022 00:02:12 +0000 (02:02 +0200)]
Make completion in emacs-lisp-mode intern fewer symbols

* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Don't
intern the string before point just to check whether we're looking
at `ignore-error' (bug#55491).

2 years agoMake `&' in dired be more consistent wrt. user input
Lars Ingebrigtsen [Thu, 19 May 2022 23:35:58 +0000 (01:35 +0200)]
Make `&' in dired be more consistent wrt. user input

* lisp/dired-aux.el (dired-do-async-shell-command): Mention that
commands here don't accept input.

2 years agoAdd new command 'enriched-toggle-markup'
Lars Ingebrigtsen [Thu, 19 May 2022 23:17:02 +0000 (01:17 +0200)]
Add new command 'enriched-toggle-markup'

* lisp/textmodes/enriched.el (enriched-toggle-markup): New command
(bug#33855).

2 years agoAdd new user option 'yank-transform-functions'
Lars Ingebrigtsen [Thu, 19 May 2022 22:15:28 +0000 (00:15 +0200)]
Add new user option 'yank-transform-functions'

* doc/lispref/text.texi (Yanking): Mention it.
(Yanking): Document it.

* lisp/simple.el (yank-transform-functions): New user option.
(yank): Mention it.

* lisp/subr.el (insert-for-yank): Use it.

2 years ago; * etc/NEWS: Announce renaming of "Oriya" to "Odia". (Bug#55493)
Eli Zaretskii [Thu, 19 May 2022 12:34:29 +0000 (15:34 +0300)]
; * etc/NEWS: Announce renaming of "Oriya" to "Odia".  (Bug#55493)

2 years agoProvide Oriya language-environment alongside Odia
Eli Zaretskii [Thu, 19 May 2022 12:29:14 +0000 (15:29 +0300)]
Provide Oriya language-environment alongside Odia

* lisp/language/indian.el ("Oriya"): Add another name for the Odia
language-environment.  (Bug#55493)

2 years agoRename Oriya to Odia, and more
समीर सिंह Sameer Singh [Wed, 18 May 2022 19:38:14 +0000 (01:08 +0530)]
Rename Oriya to Odia, and more

Due to "The Orissa (Alteration of Name) Act, 2011"
(https://legislative.gov.in/sites/default/files/A2011-15.pdf)
Oriya has been renamed to Odia.

* lisp/language/indian.el (set-language-info-alist): Rename
Oriya to Odia.  Improve Oriya composition rules.
* lisp/leim/quail/indian.el ("odia"): New input method.
* lisp/erc/erc-lang.el: Obsolete the iso-638-languages variable
(which was a typo) and replace it with iso-639-1-languages.

* etc/HELLO: Rename Oriya to Odia.
Replace the old Odia greeting with the new one.
Add a Hindi greeting separate from the Devanagari one.
(Bug#55493)

2 years agoWhitelist some incorrectly labeled "color" fonts under Xft
Po Lu [Thu, 19 May 2022 12:10:19 +0000 (20:10 +0800)]
Whitelist some incorrectly labeled "color" fonts under Xft

* etc/PROBLEMS: Document problem with fonts incorrectly labeled
as color fonts under Xft.

* src/ftfont.c (xft_color_font_whitelisted_p): New function.
(ftfont_spec_pattern, ftfont_list): Respect whitelisting of
"color" fonts under Xft.
* src/xftfont.c (syms_of_xftfont): New variable
`xft-color-font-whitelist'.

2 years agoFix tooltip buffer flipping inside popup menus
Po Lu [Thu, 19 May 2022 09:36:24 +0000 (17:36 +0800)]
Fix tooltip buffer flipping inside popup menus

* src/xterm.c (x_flip_and_flush): Don't ignore if
`inhibit-redisplay' but F is a tooltip frame.  (bug#55519)

2 years agoFix error handling when allowing touch events
Po Lu [Thu, 19 May 2022 09:02:38 +0000 (17:02 +0800)]
Fix error handling when allowing touch events

* src/xterm.c (handle_one_xevent): Catch errors correctly when
linking touch points.

2 years ago; * doc/misc/efaq.texi: Replace copyright years with ranges.
Stefan Kangas [Thu, 19 May 2022 08:12:43 +0000 (10:12 +0200)]
; * doc/misc/efaq.texi: Replace copyright years with ranges.

2 years agoFix Flymake diagnostics reporting in non-UTF-8 locales
Eli Zaretskii [Thu, 19 May 2022 08:00:36 +0000 (11:00 +0300)]
Fix Flymake diagnostics reporting in non-UTF-8 locales

* lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile)
(elisp-flymake--batch-compile-for-flymake): Bind I/O encoding to
UTF-8, instead of relying on the locale's defaults.  This is
needed because ELisp files use UTF-8 by default, but Flymake
doesn't know about that, since it isn't specific to ELisp.

2 years agoFix specifying terminal names to some functions on Haiku
Po Lu [Thu, 19 May 2022 06:46:21 +0000 (06:46 +0000)]
Fix specifying terminal names to some functions on Haiku

* src/haikufns.c (haiku_display_info_for_name): Implement
correctly.

2 years agoSatisfy Valgrind when iconifying frames
Po Lu [Thu, 19 May 2022 05:50:39 +0000 (13:50 +0800)]
Satisfy Valgrind when iconifying frames

* src/xterm.c (x_iconify_frame): Set the rest of data in the
WM_CHANGE_STATE message to 0 instead of leaving it
uninitialized.

2 years agoFix race conditions processing frame fullscreen state on Haiku
Po Lu [Thu, 19 May 2022 03:43:39 +0000 (03:43 +0000)]
Fix race conditions processing frame fullscreen state on Haiku

* doc/lispref/frames.texi (Size Parameters): Remove note saying
Haiku doesn't support `fullwidth' and `fullboth'.

* src/haiku_support.cc (subset_windows, class EmacsWindow)
(Unparent, ParentTo): Stop calling old fullscreen functions.
(ClearFullscreen, FullscreenRectForMode, SetFullscreen): New
functions.  Completely rewrite old zoom and fullscreen handling
code.
(Zoom): Send a ZOOM_EVENT and don't actually zoom.
(BWindow_zoom, EmacsWindow_make_fullscreen, EmacsWindow_unzoom):
Delete functions.
(be_set_window_fullscreen_mode): New function.

* src/haiku_support.h (struct haiku_zoom_event): Remove
`zoomed_p' parameter.
(enum haiku_fullscreen_mode): New enum.  Update prototypes.

* src/haikufns.c (Fx_display_pixel_height): Return height
instead of width.

* src/haikuterm.c (haiku_make_fullscreen_consistent)
(haiku_read_socket, haiku_fullscreen): Adjust to always set zoom
and fullscreen in the main thread instead of the UI threads.

* src/haikuterm.h (struct haiku_output): Remove flag `zoomed_p'
and add field `fullscreen_mode'.

2 years agoRespond to changes to the size of the root window
Po Lu [Thu, 19 May 2022 01:30:33 +0000 (09:30 +0800)]
Respond to changes to the size of the root window

* src/xterm.c (x_display_pixel_height, x_display_pixel_width):
Move here instead.
(handle_one_xevent): Handle ConfigureNotify for the root window.
(x_term_init): Select for structure events on the root window.

* src/xterm.h (struct x_display_info): New fields `screen_width'
and `screen_height'.
(x_display_pixel_height, x_display_pixel_width): Make
prototypes.

2 years agoDelete entry on SPC completes file names from FAQ
Stefan Kangas [Wed, 18 May 2022 23:41:44 +0000 (01:41 +0200)]
Delete entry on SPC completes file names from FAQ

* doc/misc/efaq.texi (SPC no longer completes file names): Delete
node: this is about a change that took place over 15 years ago and is
not likely to be a FAQ these days.

2 years agoDon't refer to obsolete Ultrix support in FAQ
Stefan Kangas [Wed, 18 May 2022 23:27:31 +0000 (01:27 +0200)]
Don't refer to obsolete Ultrix support in FAQ

* doc/misc/efaq.texi (Meta key does not work in xterm): Delete
reference to Ultrix; that platform support was removed in Emacs 23.1.

2 years agoAvoid formatting twice in flymake
Paul Eggert [Wed, 18 May 2022 19:39:30 +0000 (12:39 -0700)]
Avoid formatting twice in flymake

* lisp/progmodes/flymake.el (flymake-error): Don't format a
message twice, as that can translate quotes we don't want
translated.

2 years agoFix last change in minibuffer-lazy-highlight-setup
Augusto Stoffel [Sun, 15 May 2022 20:48:50 +0000 (22:48 +0200)]
Fix last change in minibuffer-lazy-highlight-setup

* lisp/isearch.el (minibuffer-lazy-highlight-setup): Apply advices
buffer-locally.