F. Jason Park [Sun, 24 Apr 2022 13:20:09 +0000 (06:20 -0700)]
Support auth-source-pass in ERC
* doc/misc/erc.texi: Mention that the auth-source-pass backend is
supported.
* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search,
erc-compat--29-auth-source-pass--build-result-many,
erc-compat--29-auth-source-pass--retrieve-parsed,
erc-compat--29-auth-source-pass-backend-parse,
erc-compat--auth-source-backend-parser-functions): Adapt some yet
unreleased functions from auth-source-pass that mimic the netrc
backend, and add forward declarations to support them.
Jim Porter [Wed, 2 Nov 2022 16:22:43 +0000 (09:22 -0700)]
Enable/disable 'server-mode' when starting/stopping the server
* lisp/server.el (server-mode-map): New keymap...
(server-mode): ... use it.
(server-start): Update the 'server-mode' variable (and sync to
'global-minor-modes') when starting/stopping the server.
* test/lisp/server-tests.el: New file (bug#58909).
Matt Armstrong [Tue, 15 Nov 2022 18:33:00 +0000 (10:33 -0800)]
Reduce buffer-tests noisiness when run in batch mode.
* test/src/buffer-tests.el (overlay-modification-hooks): Remove noisy
`message' calls and use `ert-info' to log context of test
failures. (bug#59028)
(overlay-tests-start-recording-modification-hooks): ditto.
* lisp/buff-menu.el (Buffer-menu-filter-predicate): New defvar-local.
(list-buffers-noselect): Add new optional arg 'filter-predicate'.
Set 'Buffer-menu-filter-predicate' to 'filter-predicate'.
(list-buffers--refresh): Use 'Buffer-menu-filter-predicate'.
* lisp/progmodes/project.el (project-prefix-map): Bind "\C-b" to
'project-list-buffers'.
(project-list-buffers): New command.
Vibhav Pant [Tue, 15 Nov 2022 14:36:56 +0000 (20:06 +0530)]
; .clang-format: Support macros in comp.c, align operands correctly.
* .clang-format (WhitespaceSensitiveMacros): Add comp.c macros that
stringify arguments, telling clang-format to not format them.
(AlignOperands): Set to Align, to make clang-format correctly align
multi-line expressions involving binary and ternary expressions.
(ForEachMacros): Add FOR_EACH_ALIST_VALUE.
Po Lu [Tue, 15 Nov 2022 11:07:44 +0000 (19:07 +0800)]
Fix recent Cairo xsettings changes
* lisp/dynamic-setting.el (font-setting-change-default-font):
Instead of setting the font frame parameter, just clear the font
and face cache and redraw the display. This will re-open all
fonts as well.
* src/ftcrfont.c (ftcrfont_get_default_font_options): New
function.
* src/ftfont.h: Export.
* src/xsettings.c (apply_xft_settings): Call that function to
obtain the default font settings on Cairo. (bug#58912,
bug#59283, bug#59271)
Po Lu [Mon, 14 Nov 2022 11:06:12 +0000 (19:06 +0800)]
Make C-x 5 o work on GNOME Shell-like Wayland compositors
* src/pgtkterm.c (pgtk_free_frame_resources)
(fill_background_by_face)
(pgtk_draw_glyphless_glyph_string_foreground)
(pgtk_draw_window_cursor): Fix coding style.
(pgtk_focus_frame): Use gtk_window_present_with_time whenever
possible.
(key_press_event): Set the last user time.
(pgtk_display_info_for_display): New function.
(key_release_event, construct_mouse_click, button_event): Set
the last user time.
(scroll_event, pgtk_parse_color, syms_of_pgtkterm)
(pgtk_begin_cr_clip): Fix coding style.
* src/pgtkterm.h (struct pgtk_output): New field
`last_user_time'.
Juri Linkov [Sun, 13 Nov 2022 18:57:50 +0000 (20:57 +0200)]
* lisp/minibuffer.el (set-message-functions): New user option.
(set-message-function): Change the default from
'set-minibuffer-message' to 'set-message-functions'.
'set-minibuffer-message' is set as the default value
of the user option 'set-message-functions'.
(set-message-functions): New function.
(inhibit-message-regexps): New customizable variable (bug#52314).
(inhibit-message): New function.
(multi-message-timeout, multi-message-max): New defcustoms.
(multi-message-separator, multi-message-list): New variables.
(set-multi-message): New function.
Stefan Kangas [Sun, 13 Nov 2022 18:46:02 +0000 (19:46 +0100)]
Fix suggest-key-bindings displaying key as command
* lisp/simple.el (execute-extended-command--describe-binding-msg):
New function factored out from...
(execute-extended-command): ...here. Fix bug where a key binding was
displayed as a command with 'suggest-key-bindings'. (Bug#59247)
* test/lisp/simple-tests.el
(simple-execute-extended-command--describe-binding-msg): New test.
Juri Linkov [Sun, 13 Nov 2022 18:16:17 +0000 (20:16 +0200)]
* lisp/tab-bar.el: More improvements for tab-bar-auto-width (bug#59208)
(tab-bar-auto-width): Use add-face-text-property instead of propertize.
Prevent from going into infinite loops. More optimizations.
(tab-bar-format-align-right): Use add-face-text-property, not propertize.
Ingo Lohmar [Sun, 13 Nov 2022 16:27:12 +0000 (17:27 +0100)]
Eglot: fix null scopeUri regression in workspace/configuration
* lisp/progmodes/eglot.el (eglot-handle-request):
Commit 1a2d603bb3938ff68ed1a5412d131b41efd40a24 changed
`eglot--uri-to-path' to return a nil uri untouched. (Before,
`url-unhex-string' turned the parsed all-nil uri record into the empty
string.)
A nil return value must now be handled in the caller, do that for the
workspace/configuration handler to avoid an uncaught error.
Po Lu [Sun, 13 Nov 2022 07:34:16 +0000 (15:34 +0800)]
Fix warnings without XCB or XFixes
* src/xterm.c (x_term_init): Don't USE_SAFE_ALLOCA or call
SAFE_FREE outside of where it is actually used. For some reason
the compiler still emitted warnings despite the ((void)
SAFE_ALLOCA (0)) statement.
Po Lu [Sun, 13 Nov 2022 01:03:51 +0000 (09:03 +0800)]
Prevent non-local exits from ns-in-echo-area
* src/nsterm.m (ns_in_echo_area_1):
(ns_in_echo_area_2):
(ns_in_echo_area): New functions.
([EmacsView firstRectForCharacterRange:]): Call them instead.
(syms_of_nsterm): New defsym.
Eli Zaretskii [Sat, 12 Nov 2022 11:10:24 +0000 (13:10 +0200)]
Document that 'transient-mark-mode' is off in batch mode
* doc/emacs/mark.texi (Mark, Disabled Transient Mark): Document,
belatedly, that 'transient-mark-mode' is turned on by default only
in interactive sessions. (Bug#59201)
Po Lu [Sat, 12 Nov 2022 10:52:36 +0000 (18:52 +0800)]
Handle request serial wraparound more correctly
* src/xterm.c (X_COMPARE_SERIALS): Remove macro.
(x_is_serial_more_than, x_is_serial_more_than_or_equal_to)
(x_is_serial_less_than, x_is_serial_less_than_or_equal_to): New
functions.
(x_find_error_handler, x_request_can_fail)
(x_clean_failable_requests, x_stop_ignoring_errors): Use those
functions to perform request serial comparison.
Only send notifications of interest, as determined by the optional LSP
FileSystemWatcher.kind bitmask provided by the server.
When the FileSystemWatcher.kind property is omitted, use the default
value of 7, which is computed from taking the bitwise OR operation
WatchKind.Create (1) | WatchKind.Change (2) | WatchKind.Delete (4).
Stefan Kangas [Fri, 11 Nov 2022 12:55:11 +0000 (13:55 +0100)]
eglot: Remove menu entry for manual
* lisp/progmodes/eglot.el (eglot-manual): Make obsolete. Open the
eglot info manual instead of the less exhaustive README.
(eglot-menu): Remove entry for reading the manual. (Bug#58892)
Po Lu [Fri, 11 Nov 2022 02:31:14 +0000 (10:31 +0800)]
Slightly adjust EWMH frame activation code for child frames
* src/xterm.c (x_get_toplevel_parent): New function.
(x_focus_frame): Do not use EWMH activation in two cases: focus
transfers to child frames (this is not guaranteed to work if the
focus and the child frame do not share the same toplevel) or
focus transfers from child frames to their toplevel parents.
dannyfreeman [Thu, 3 Nov 2022 13:39:16 +0000 (09:39 -0400)]
Eglot: Only handle URIs with the file:// scheme (bug#58790)
Eglot will not attempt to parse URIs that are not file:// type at all.
Instead let 'file-name-handler-alist' entries to deal with those. Not
parsing them at all allows the 'file-name-handler-alist' regexps to
identify them more accurately.
By also checking if Eglot received a URI in 'eglot--path-to-uri',
'file-name-handler-alist' can provide the non-file type URI back to
the lsp server, which presumably will know how to handle them since it
is also giving them out to clients.
This issue originated with clojure-lsp sending clients "jar:" type
URIs that Emacs is unable to handle out of the box. Before this
change, "jar:" URIs were parsed once, but since they contain a nested
URI, this resulted in a file being dispatched with a partially parsed
path that looked like "file://path/to.jar!/path/in/jar".
* lisp/progmodes/eglot.el (eglot--path-to-uri): Noop if already an
URI. (eglot--uri-to-path): Only handle file:// URIs
João Távora [Thu, 10 Nov 2022 21:06:33 +0000 (21:06 +0000)]
Improve Eglot's docstrings and manual
The examples in the manual can now be copy-pasted to user's init
files as-is.
* doc/misc/eglot.texi (Setting Up LSP Servers): Use
`with-eval-after-load'. Add eglot-alternatives example.
(Customizing Eglot): Use 'require and fix a typo.
* lisp/progmodes/eglot.el (eglot-server-programs): Mention
eglot-alternatives in eglot-server-program's docstring.
Evgeni Kolev [Thu, 10 Nov 2022 17:17:44 +0000 (17:17 +0000)]
Ignore errors when shutting down all LSP servers (bug#59146)
eglot-shutdown-all has a bug that results in partially stopping
servers: when a server shutdown timeouts (1.5s), an error is
propagated and eglot-shutdown-all does not try to shutdown the rest of
the servers.
* eglot.el (eglot-shutdown-all): Ignore errors when shutting down
servers, converting errors to messages.
Matt Armstrong [Fri, 4 Nov 2022 19:43:30 +0000 (12:43 -0700)]
Rewrite the `kill-buffer-delete-auto-save' tests (bug#59028)
These tests had been annoying to me when run in interactive mode.
They failed to bind `kill-buffer-delete-auto-save' as needed, so they
depended on the user's settings, and they failed to mock out the
"Buffer modified, save?" prompt.
* test/src/buffer-tests.el (test-kill-buffer-auto-save): New helper
function that mocks the two different kinds of prompts that occur when
killing modified buffers that visit a file. Tests fail if expected
prompts are not issued.
(test-kill-buffer-auto-save-default): Use it, and explicitly bind
`kill-buffer-delete-auto-save' to nil.
(test-kill-buffer-auto-save-delete): Delete it.
(test-kill-buffer-auto-save-delete-yes): New test for the "yes" half
of the old `test-kill-buffer-auto-save-delete'.
(test-kill-buffer-auto-save-delete-yes): Ditto for the "no" half.
Po Lu [Thu, 10 Nov 2022 05:25:28 +0000 (13:25 +0800)]
Be a little more paranoid about XI 2.0 implementations
* src/xterm.c (xi_populate_device_from_info):
(xi_disable_devices): Do not restore valuator values if the
valuator info has a mode of Relative and a value of 0.0.
* lisp/bs.el (bs-visit-tags-table): Verify that the
buffer holds a tags-table file before using it as
such. This is identical to bug#54133 affecting
Buffer-menu, and this fix is copied from the one
by Eli Zaretskii in commit 794fbd1c07 of 2022-02-24.
Thanks to Bob Rogers <rogers@rgrjr.com> for noticing.
F. Jason Park [Wed, 13 Jul 2022 08:54:19 +0000 (01:54 -0700)]
Teach thing-at-point to recognize bracketed IPv6 URLs
* lisp/thingatpt.el (thing-at-point-bounds-of-url-at-point): Allow
IPv6 addresses as hosts. Overshoots in the case of bracketed markup
but is rescued by `thing-at-point--bounds-of-well-formed-url'.
* test/lisp/thingatpt-tests.el (thing-at-point-test-data): Add cases
for IPv6 URLs. Bug#56514.