1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-22 18:35:09 +00:00
Commit Graph

161957 Commits

Author SHA1 Message Date
F. Jason Park
77d6351d60 Default to TLS port when calling erc-tls from lisp
* lisp/erc/erc.el (erc-normalize-port): Add standard IANA port-name
mappings for 6667 and 6697.
(erc-open): Add note to doc string explaining that params `connect'
and `channel' are mutually exclusive.
(erc-tls): Call `erc-compute-port' with override.
(erc-compute-port): Call `erc-normalize-port' with result'.
* test/lisp/erc/erc-tests.el (erc-tls): Add simplistic test focusing
on default parameters.  (Bug#56514.)
2022-11-16 21:34:36 -08:00
F. Jason Park
46c765ed09 Refactor erc-select-read-args
* lisp/erc/erc-backend.el (erc--server-connect-dumb-ipv6-regexp): Add
liberal pattern for matching bracketed IPv6 addresses.
(erc-server-connect): Remove brackets from IPv6 hosts before
connecting.
* lisp/erc/erc.el (erc--ensure-url): Add compat adapter to massage
partial URLs given as input that may be missing the scheme:// portion.
(erc-select-read-args): Keep bracketed IPv6 hosts
intact.  Make this function fully URL-aware (was only partially so).
Accept optional `input' argument.
* lisp/erc/erc-tests.el (erc-tests--ipv6-examples,
erc--server-connect-dumb-ipv6-regexp, erc-select-read-args): Add test
reading user input during interactive invocations of entry points.
(Bug#56514.)
2022-11-16 21:34:36 -08:00
F. Jason Park
5699e43f27 Accommodate ircs:// URLs in url-irc and browse-url
* lisp/url/url-irc.el (url-irc-function): Change signature of function
interface to expect a final "scheme" argument, such as "ircs".
(url-irc): Call `url-irc-function' with new positional argument, the
scheme extracted via `url-type' from the input URL.
(url-irc-erc, url-irc-rcirc, url-irc-zenirc): Accept a URL scheme as a
sixth positional arg.
(url-ircs-default-port, url-ircs): Add new autoloaded constant and
alias for `url-scheme-get-property' to recognize.  Do this to avoid
having to add another file.
* lisp/net/browse-url.el (browse-url-irc-function): Add new option.
(browse-url--irc): Add new function to call `browse-url-irc-function'.
(browse-url-default-handlers): Add "irc://" entry.
(browse-url-irc): Add new function to serve as general handler for
"irc://" URLS.  Accept trailing variadic args to accommodate
non-browse-url interfaces as well.
* test/lisp/net/browse-url-tests.el
(browse-url-tests-select-handler-irc): Add test for "irc://" URL
pattern.
* etc/NEWS: Mention select browse-url and url-irc
changes.  (Bug#56514.)
2022-11-16 21:34:36 -08:00
F. Jason Park
d4028ead89 Warn of future breaking change to erc-response.tags
* lisp/erc/erc-backend.el (erc-parse-tags-format): New option to
determine type of the `erc-response' "tags" field.
(erc-parse-tags): Defer to internal generic function.
(erc--parse-tags): New function to hold original `erc-parse-tags'
implementation.
(erc--parse-message-tags): New generic function that conditionally
calls `erc--parse-tags', perhaps emitting a warning beforehand.
(erc-parse-server-response): Call `erc--parse-message-tags'.
(Bug#58797.)
2022-11-16 21:34:36 -08:00
F. Jason Park
e7f2f6cd92 Improve auto-reconnect visibility in ERC
* lisp/erc/erc-backend.el (erc--server-reconnect-timer): New variable.
(erc-server-reconnect-function): New user option.
(erc-process-sentinel-2): Display time remaining until next
reconnection attempt.  Also remove condition case and move bulk of
else condition logic to `erc-schedule-reconnect'.  More importantly,
no longer set `erc--server-reconnecting here').
(erc-server-connect): Initialize `erc--server-reconnect-timer' to nil.
(erc-server-reconnect): Set `erc-server--reconnecting' here.
(erc--mode-line-process-reconnecting): New constant to store value for
"reconnect" state of `mode-line-process'.
(erc--cancel-auto-reconnect-timer): New function to cancel
auto-reconnect timer and print message.
(erc-schedule-reconnect): New function for scheduling another
reconnect attempt.

* lisp/erc/erc.el (erc-open): Only update mode line for target
buffers. For server buffers, let `erc-login' and/or process sentinels
take care of it.
(erc--cmd-reconnect, erc-cmd-RECONNECT): Rename latter to former, a
new function, but repurpose existing to recognize newly allowed
additional arguments and act accordingly.  In new internal function,
cancel an existing auto-reconnect timer, if any, before proceeding.
Defer to `erc-server-reconnect' to set `erc--server-reconnecting'.
Fix `with-suppressed-warnings' form.
(erc-update-mode-line-buffer): Show "reconnecting in Ns" for
`mode-line-process' when awaiting an automatic reconnect attempt.
(erc-message-english-reconnecting,
erc-message-english-reconnect-canceled): Add new message functions to
English catalog.

* lisp/erc/erc-pcomplete.el (pcomplete/erc-mode/RECONNECT): Perform
completion for newly subcommand-aware `erc-cmd-RECONNECT'.

* lisp/erc/erc-scenarios-base-reconnect
(erc-scenarios-base-cancel-reconnect): Add new test case for canceling
reconnect timers.  (Bug#58840.)
2022-11-16 21:34:36 -08:00
F. Jason Park
4351fb7161 ; Make some ERC test fixtures a bit more courteous
* test/lisp/erc/erc-dcc-tests.el (erc-dcc-tests--pcomplete-common):
Only emit messages when interactive.
* test/lisp/erc/resources/erc-d/erc-d-tests.el
(erc-d-tests-with-server): Shadow `erc-after-connect' so
`erc-autojoin-channels' doesn't affect other tests.
test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--make-bindings): Shadow `erc-after-connect' here
as well.  Also require erc instead of erc-backend to silence some new
compiler warnings the cropped up after the creation of erc-common.el.
2022-11-16 21:34:36 -08:00
F. Jason Park
c5d91358b5 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.

* lisp/erc/erc.el (erc--auth-source-search): Use own auth-source-pass
erc-compat backend.
* test/lisp/erc/erc-services-tests.el
(erc-join-tests--auth-source-pass-entries): Remove useless items.
(erc--auth-source-search--pass-standard,
erc--auth-source-search--pass-announced,
erc--auth-source-search--pass-overrides): Remove `ert-skip' guard.
(Bug#58985.)
2022-11-16 21:34:36 -08:00
F. Jason Park
2cf9e699ef Make auth-source-pass behave more like other backends
* lisp/auth-source-pass.el (auth-source-pass-extra-query-keywords): Add
new option to bring search behavior more in line with other backends.
(auth-source-pass-search): Add new keyword params `max' and `require'
and consider new option `auth-source-pass-extra-query-keywords' for
dispatch.
(auth-source-pass--match-regexp, auth-source-pass--retrieve-parsed,
auth-source-pass--match-parts): Add supporting variable and helpers.
(auth-source-pass--build-result-many,
auth-source-pass--find-match-many): Add "-many" variants for existing
workhorse functions.
* test/lisp/auth-source-pass-tests.el: Require `ert-x'.
(auth-source-pass-can-start-from-auth-source-search): Ensure
`auth-source-pass-extra-query-keywords' is enabled around test body.
(auth-source-pass-extra-query-keywords--wild-port-miss-netrc,
auth-source-pass-extra-query-keywords--wild-port-miss,
auth-source-pass-extra-query-keywords--wild-port-hit-netrc,
auth-source-pass-extra-query-keywords--wild-port-hit,
auth-source-pass-extra-query-keywords--wild-port-req-miss-netrc,
auth-source-pass-extra-query-keywords--wild-port-req-miss,
auth-source-pass-extra-query-keywords--netrc-akib,
auth-source-pass-extra-query-keywords--akib,
auth-source-pass-extra-query-keywords--netrc-host,
auth-source-pass-extra-query-keywords--host,
auth-source-pass-extra-query-keywords--baseline,
auth-source-pass-extra-query-keywords--port-type,
auth-source-pass-extra-query-keywords--hosts-first,
auth-source-pass-extra-query-keywords--ambiguous-user-host,
auth-source-pass-extra-query-keywords--suffixed-user,
auth-source-pass-extra-query-keywords--user-priorities): Add
juxtaposed netrc and extra-query-keywords pairs to demo optional
extra-compliant behavior.
* doc/misc/auth.texi: Add option
`auth-source-pass-extra-query-keywords' to auth-source-pass section.
* etc/NEWS: Mention `auth-source-pass-extra-query-keywords' in Emacs
29.1 package changes section.  (Bug#58985.)

Special thanks to Akib Azmain Turja <akib@disroot.org> for helping
improve this patch.
2022-11-16 21:34:36 -08:00
Jim Porter
0147e1ed83 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).
2022-11-16 21:15:19 -08:00
Karl Fogel
7781121c44 Fix two typos in a doc string 2022-11-16 20:34:28 -06:00
Juanma Barranquero
999027888c ; * src/comp.c (Fnative_elisp_load): Fix typo in docstring 2022-11-17 03:15:59 +01:00
Thomas Fitzsimmons
17075a975f EUDC: Fix eudc-capf-message-expand-name nil result
* lisp/net/eudc-capf.el (eudc-capf-message-expand-name): Return
nil if EUDC query returns no results.  (Bug#59314)
2022-11-16 20:29:26 -05:00
Stefan Monnier
f696d27d1c * src/itree.c: Use more uniform names starting with itree_
(struct itree_stack, itree_stack_create, itree_stack_destroy)
(itree_stack_clear, itree_stack_push_flagged, interval_stack_push)
(itree_stack_pop): Rename from `interval_stack*`.
(itree_max_height, itree_update_limit, itree_inherit_offset)
(itree_propagate_limit, itree_validate, itree_init)
(itree_rotate_left, itree_rotate_right, itree_insert_fix)
(itree_contains, itree_subtree_min, itree_remove_fix)
(itree_replace_child, itree_transplant): Rename from `interval_tree_*`.
(itree_insert_node): Rename from `interval_tree_insert`.
(itree_node_intersects): Rename from `interval_node_insert`.
2022-11-16 16:35:10 -05:00
Stephen Leake
1772d88c1f Call xref--analyze with correct project
* lisp/progmodes/xref.el (xref-show-definitions-buffer-at-bottom):
Call xref--analyze with correct project.
2022-11-16 09:52:09 -08:00
Gabriel do Nascimento Ribeiro
f793add175 Add flat-button to docstring of 'set-face-attribute'
* lisp/faces.el (set-face-attribute): Add 'flat-button' to
COLOR and STYLE sections of docstring.  (Bug#59266)
2022-11-16 16:43:05 +02:00
Eli Zaretskii
0a26b26217 Reduce buffer-tests noisiness even more
* test/src/buffer-tests.el (test-kill-buffer-auto-save-default)
(test-kill-buffer-auto-save-delete-yes)
(test-kill-buffer-auto-save-delete-no)
(test-buffer-modifications, test-restore-buffer-modified-p): Shut
up auto-save messages.  (Bug#59028)
2022-11-16 16:37:23 +02:00
Matt Armstrong
aee4d67b09 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.
2022-11-16 16:34:31 +02:00
Eli Zaretskii
4cf97969e6 ; * lisp/apropos.el (apropos): Doc fix. (Bug#59248) 2022-11-16 16:13:45 +02:00
Philip Kaludercic
277504584d Set vc-prepare-patches-separately to nil in .dir-locals.el
* .dir-locals.el (c-mode): Set 'vc-prepare-patches-separately'.

See https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00973.html.
2022-11-16 09:17:04 +01:00
Stefan Kangas
60f2bb862f Merge from origin/emacs-28
56026242e4 Explain how to bind keys to non-ASCII sequences
7d592db0ab Document that 'transient-mark-mode' is off in batch mode

# Conflicts:
#	doc/emacs/custom.texi
#	doc/emacs/mark.texi
2022-11-16 08:41:29 +01:00
Po Lu
690f7ac86a Fix calculation of tab bar lines during automatic height adjustment
* src/haikufns.c (haiku_change_tab_bar_height):
* src/nsfns.m (ns_change_tab_bar_height):
* src/pgtkfns.c (pgtk_change_tab_bar_height):
* src/w32fns.c (w32_change_tab_bar_height):
* src/xfns.c (x_change_tab_bar_height): Do not round tab bar
height up.  (bug#59285, bug#59271)
2022-11-16 11:19:20 +08:00
Po Lu
0600065ff2 Fix error trapping in x_focus_frame
* src/xterm.c (x_focus_frame): Improve commentary.  Dno not trap
errors around x_get_server_time.
2022-11-16 10:37:14 +08:00
Juanma Barranquero
d2ba4538cb ; * lisp/subr.el (match-buffers): Fix typo 2022-11-15 23:07:55 +01:00
Juri Linkov
125b5684c3 New command 'project-list-buffers' bound to 'C-x p C-b' (bug#59153)
* doc/emacs/maintaining.texi (Project Buffer Commands):
Add 'project-list-buffers'.

* 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.
2022-11-15 20:54:39 +02:00
Eli Zaretskii
69d1278527 ; Fix some doc strings in elisp-mode.el
* lisp/progmodes/elisp-mode.el (elisp-enable-lexical-binding)
(elisp--local-variables-1, elisp--expect-function-p)
(eval-print-last-sexp, eval-last-sexp, elisp--eval-defun-1)
(eval-defun, elisp--eldoc-last-data, elisp-eldoc-funcall)
(elisp-eldoc-var-docstring)
(elisp-eldoc-var-docstring-with-value)
(elisp-get-fnsym-args-string)
(elisp--highlight-function-argument): Doc fixes.
2022-11-15 19:58:52 +02:00
Eli Zaretskii
3b137bcbe8 ; Improve doc strings in seq.el
* lisp/emacs-lisp/seq.el (seq-doseq, seq-setq, seq-elt)
(seq-length, seq-rest, seq-do, seq-mapn, seq-drop, seq-take)
(seq-drop-while, seq-take-while, seq-sort, seq-sort-by)
(seq-concatenate, seq-into, seq-filter, seq-remove)
(seq-remove-at-position, seq-every-p, seq-some, seq-find)
(seq-count, seq-contains, seq-contains-p, seq-set-equal-p)
(seq-position, seq-positions, seq-uniq, seq-mapcat)
(seq-partition, seq-union, seq-intersection, seq-difference)
(seq--count-successive, seq--elt-safe, seq-random-elt)
(seq-split, seq-keep): Doc fixes.
2022-11-15 19:36:49 +02:00
Vibhav Pant
7d5cf08de9
; .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.
2022-11-15 20:18:44 +05:30
Po Lu
c63d77ac6b Fix last change again
* src/frame.c (Freconsider_frame_fonts): Apply value of default
face again.  (bug#59283)
2022-11-15 21:42:59 +08:00
Po Lu
c6df541783 More fixes to last change
* lisp/dynamic-setting.el (font-setting-change-default-font):
Call `reconsider-frame-fonts'.
* src/frame.c (Freconsider_frame_fonts): New function.
(syms_of_frame): Add new function.
2022-11-15 19:48:39 +08:00
Po Lu
833e60ae1a 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)
2022-11-15 19:48:39 +08:00
Stefan Kangas
0ac626f1d4 Use substitute-command-keys for buffer-menu help
* lisp/buff-menu.el (buffer-menu--display-help): New function.
(buffer-menu, buffer-menu-other-window): Fontify key bindings
using substitute-command-keys.
(Buffer-menu-delete): Advertise key binding as 'd'.
(Buffer-menu-this-window): Advertise key binding as 'f'.
2022-11-15 08:45:02 +01:00
Stefan Kangas
222c297032 ; Auto-commit of loaddefs files. 2022-11-15 05:09:10 +01:00
Stefan Kangas
9db6da5449 Add face to key bindings suggested by M-x
* lisp/simple.el (execute-extended-command--describe-binding-msg):
Use 'help-key-binding' face for keybinding.
2022-11-15 04:19:36 +01:00
Robert Pluim
56026242e4 Explain how to bind keys to non-ASCII sequences
* doc/emacs/custom.texi (Init Rebinding): Explain how to use `kbd'
when binding keys to non-ASCII sequences.
2022-11-14 17:16:40 +01:00
Po Lu
723ceaca1d 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'.
2022-11-14 19:06:37 +08:00
Alan Mackenzie
7e493b1773 CC Mode: Prevent over-eager recognition of a variable as a found type
This fixes bug #59233.  It occurred in the C source code fragment

    open_replies = alloca (nproviders )

, where typing a * before the closing parenthesis caused nproviders to be
prematurely recognized as a type.

* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): CASE 18 - set
unsafe-maybe to t, when needed.
2022-11-14 09:47:14 +00:00
Po Lu
83a497ee87 Prevent crashes upon trying to focus a child frame on click
* src/xterm.c (handle_one_xevent): Do not try to activate
override-redirect frames.  Explain why.
(x_focus_frame): Catch errors around XSetInputFocus.
2022-11-14 14:07:04 +08:00
Dmitry Gutov
c0474ca21d Hardcode "-name" instead of using find-name-arg
* lisp/progmodes/project.el (project--files-in-directory):
Hardcode "-name" instead of using find-name-arg (bug#59023).
2022-11-14 02:19:10 +02:00
Juri Linkov
9d5fc2c7eb * 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.
2022-11-13 20:57:50 +02:00
Stefan Kangas
a5bf6fb526 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.
2022-11-13 19:46:02 +01:00
Juri Linkov
443bd35e86 * 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.
2022-11-13 20:16:17 +02:00
Ingo Lohmar
7d53164162 Eglot: fix null scopeUri regression in workspace/configuration
* lisp/progmodes/eglot.el (eglot-handle-request):
Commit 1a2d603bb3 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.
2022-11-13 17:48:36 +01:00
Stefan Kangas
ae1a6b5bdf ; * lisp/simple.el (execute-extended-command): Improve comments. 2022-11-13 16:53:31 +01:00
Stefan Kangas
90a7dee79d New test for execute-extended-command helper defun
* test/lisp/simple-tests.el
(simple-execute-extended-command--shorter): New test.
2022-11-13 15:34:02 +01:00
Stefan Kangas
73c03d64ce Prefer defvar-keymap in sql.el
* lisp/progmodes/sql.el (sql-interactive-mode-map, sql-mode-map):
Prefer defvar-keymap.
2022-11-13 15:17:07 +01:00
Davide Masserut
ae9e441415 Add new Go modes to eglot-server-programs
* lisp/progmodes/eglot.el (eglot-server-programs): Add new major modes
for Go to be used with gopls.  (Bug#59245)
2022-11-13 14:40:45 +01:00
Po Lu
7a9beac461 Fix bug#59075
* src/nsimage.m (ns_can_use_native_image_api): Do not use native
image APIs for SVG images when RSVG is present.  (bug#59075)
2022-11-13 17:30:49 +08:00
Po Lu
756373a772 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.
2022-11-13 15:35:02 +08:00
Eli Zaretskii
695dbd3db4 ; Improve documentation of text-scale adjust commands
* lisp/face-remap.el (global-text-scale-adjust)
(text-scale-adjust): Doc fixes.  (Bug#59122)
2022-11-13 08:56:35 +02:00
Po Lu
47b377f64b 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.
2022-11-13 09:04:25 +08:00