commit 073d06e34e1eca224e33b5b350645b4c4af04244 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Tue Jun 10 09:34:28 2025 +0300 * test/lisp/repeat-tests.el: Add a command to continue but not activate. (repeat-tests-call-e): New command. (repeat-tests-global-map): Bind it to 'C-M-e'. (repeat-tests-another-repeat-map, repeat-tests-repeat-map): Add 'repeat-tests-call-e' to :continue. (repeat-tests-continue, repeat-tests-continue-another): Add 'C-M-e' that should continue but not activate. diff --git a/test/lisp/repeat-tests.el b/test/lisp/repeat-tests.el index bfa838d383b..f96d8df2ebd 100644 --- a/test/lisp/repeat-tests.el +++ b/test/lisp/repeat-tests.el @@ -24,8 +24,10 @@ (require 'ert) (require 'repeat) -;; Key mnemonics: a - Activate (enter, also b, s), c - Continue (also d, t), -;; o - continue-Only (not activate, also u), q - Quit (exit) +;; Key mnemonics: a - activate (enter, also b, s), +;; c - continue (also d, t, also o, u), +;; e - continue-only (not activate), +;; q - quit (exit) (defvar repeat-tests-calls nil) @@ -45,6 +47,10 @@ (interactive "p") (push `(,arg d) repeat-tests-calls)) +(defun repeat-tests-call-e (&optional arg) + (interactive "p") + (push `(,arg e) repeat-tests-calls)) + (defun repeat-tests-call-o (&optional arg) (interactive "p") (push `(,arg o) repeat-tests-calls)) @@ -71,6 +77,7 @@ "C-x w a" 'repeat-tests-call-a "C-M-a" 'repeat-tests-call-a "C-M-b" 'repeat-tests-call-b + "C-M-e" 'repeat-tests-call-e "C-M-o" 'repeat-tests-call-o "C-M-s" 'repeat-tests-call-s "C-M-u" 'repeat-tests-call-u) @@ -78,7 +85,8 @@ (defvar-keymap repeat-tests-another-repeat-map :doc "Keymap for repeating other sequences." :repeat ( :enter (repeat-tests-call-s) - :continue (repeat-tests-call-o + :continue (repeat-tests-call-e + repeat-tests-call-o repeat-tests-call-u)) "s" 'ignore ;; for non-nil repeat-check-key only "t" 'repeat-tests-call-t @@ -88,7 +96,8 @@ (defvar-keymap repeat-tests-repeat-map :doc "Keymap for repeating sequences." :repeat ( :enter (repeat-tests-call-a) - :continue (repeat-tests-call-o) + :continue (repeat-tests-call-e + repeat-tests-call-o) :exit (repeat-tests-call-q)) "a" 'ignore ;; for non-nil repeat-check-key only "c" 'repeat-tests-call-c @@ -206,14 +215,19 @@ (with-repeat-mode repeat-tests-global-map (let ((repeat-echo-function 'ignore) (repeat-check-key nil)) - ;; 'C-M-o' used as continue + ;; 'C-M-e' and 'C-M-o' used as continue (repeat-tests--check - "C-M-a c C-M-o c z" - '((1 a) (1 c) (1 o) (1 c)) "z") - ;; 'C-M-o' should not activate + "C-M-a c C-M-e C-M-o c z" + '((1 a) (1 c) (1 e) (1 o) (1 c)) "z") + ;; 'C-M-e' should not activate (repeat-tests--check - "C-M-o c z" - '((1 o)) "cz")))) + "C-M-e c z" + '((1 e)) "cz") + ;; 'C-M-o' should also activate + ;; (repeat-tests--check + ;; "C-M-o c z" + ;; '((1 o) (1 c)) "z") + ))) (ert-deftest repeat-tests-continue-another () (with-repeat-mode repeat-tests-global-map @@ -223,14 +237,18 @@ (repeat-tests--check "C-M-s t t z" '((1 s) (1 t) (1 t)) "z") - ;; 'C-M-u' used as continue + ;; 'C-M-e' and 'C-M-u' used as continue (repeat-tests--check - "C-M-s t C-M-u t z" - '((1 s) (1 t) (1 u) (1 t)) "z") - ;; 'C-M-u' should not activate + "C-M-s t C-M-e C-M-u t z" + '((1 s) (1 t) (1 e) (1 u) (1 t)) "z") + ;; 'C-M-e' should not activate (repeat-tests--check - "C-M-u t z" - '((1 u)) "tz") + "C-M-e t z" + '((1 e)) "tz") + ;; 'C-M-u' should also activate + ;; (repeat-tests--check + ;; "C-M-u t z" + ;; '((1 u) (1 t)) "z") ;; 'C-M-o' shared with another map should continue current map (repeat-tests--check "C-M-s t C-M-o C-M-o t z" commit f904ff5ca2535356e1353e5fc95d9b0643b8570b Author: Yuan Fu Date: Mon Jun 9 22:35:34 2025 -0700 Add tree-sitter version of prog-fill-reindent-defun (bug#78703) Add a tree-sitter version of prog-fill-reindent-defun that indents the defun that encloses point, rather than the sibling defun after point when there is one. * lisp/progmodes/prog-mode.el: (prog-fill-reindent-defun): Turns into a wrapper function. (prog-fill-reindent-defun-function): New variable. (prog-fill-reindent-defun-default): Old prog-fill-reindent-defun becomes this function. * lisp/treesit.el (treesit-fill-reindent-defun): New function. (treesit-major-mode-setup): Setup prog-fill-reindent-defun-function. diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index b81ff6ff7a5..50aac95dbc6 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -166,23 +166,37 @@ instead." (and (re-search-forward "\\s-*\\s<" (line-end-position) t) (nth 8 (syntax-ppss)))))) -(defun prog-fill-reindent-defun (&optional argument) - "Refill or reindent the paragraph or defun that contains point. - -If the point is in a string or a comment, fill the paragraph that -contains point or follows point. - -Otherwise, reindent the function definition that contains point -or follows point." +(defvar prog-fill-reindent-defun-function + #'prog-fill-reindent-defun-default + "Function called by `prog-fill-reindent-defun' to do the actual work. +It should take the same argument as `prog-fill-reindent-defun'.") + +(defun prog-fill-reindent-defun-default (&optional justify) + "Default implementation of `prog-fill-reindent-defun'. +JUSTIFY is the same as in `fill-paragraph'." (interactive "P") (save-excursion (if (prog--text-at-point-p) - (fill-paragraph argument (region-active-p)) + (fill-paragraph justify (region-active-p)) (beginning-of-defun) (let ((start (point))) (end-of-defun) (indent-region start (point) nil))))) +(defun prog-fill-reindent-defun (&optional justify) + "Refill or reindent the paragraph or defun that contains point. + +If the point is in a string or a comment, fill the paragraph that +contains point or follows point. + +Otherwise, reindent the function definition that contains point +or follows point. + +If JUSTIFY is non-nil (interactively, with prefix argument), justify as +well." + (interactive "P") + (funcall prog-fill-reindent-defun-function justify)) + (defun prog-first-column () "Return the indentation column normally used for top-level constructs." (or (car prog-indentation-context) 0)) diff --git a/lisp/treesit.el b/lisp/treesit.el index 30f163aa100..bc6b177e25e 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -58,6 +58,7 @@ (require 'cl-lib) (require 'font-lock) (require 'seq) +(require 'prog-mode) ; For `prog--text-at-point-p'. ;;; Function declarations @@ -3861,6 +3862,28 @@ The delimiter between nested defun names is controlled by (setq node (treesit-node-parent node))) name)) +;;; Prog mode + +(defun treesit-fill-reindent-defun (&optional justify) + "Refill/reindent the paragraph/defun that contains point. + +This is a tree-sitter implementation of `prog-fill-reindent-defun'. + +`treesit-major-mode-setup' assigns this function to +`prog-fill-reindent-defun-function' if the major mode defines the +`defun' thing. + +JUSTIFY is the same as in `fill-paragraph'." + (interactive "P") + (save-excursion + (if (prog--text-at-point-p) + (fill-paragraph justify (region-active-p)) + (let* ((treesit-defun-tactic 'parent-first) + (node (treesit-defun-at-point))) + (indent-region (treesit-node-start node) + (treesit-node-end node) + nil))))) + ;;; Imenu (defvar treesit-simple-imenu-settings nil @@ -4351,8 +4374,8 @@ and enable `font-lock-mode'. If `treesit-simple-indent-rules' is non-nil, set up indentation. If `treesit-defun-type-regexp' is non-nil or `defun' is defined -in `treesit-thing-settings', set up `beginning-of-defun-function' -and `end-of-defun-function'. +in `treesit-thing-settings', set up `beginning-of-defun-function', +`end-of-defun-function', and `prog-fill-reindent-defun-function'. If `treesit-defun-name-function' is non-nil, set up `add-log-current-defun'. @@ -4415,7 +4438,9 @@ before calling this function." ;; the variables. In future we should update `end-of-defun' to ;; work with nested defuns. (setq-local beginning-of-defun-function #'treesit-beginning-of-defun) - (setq-local end-of-defun-function #'treesit-end-of-defun)) + (setq-local end-of-defun-function #'treesit-end-of-defun) + (setq-local prog-fill-reindent-defun-function + #'treesit-fill-reindent-defun)) ;; Defun name. (when treesit-defun-name-function (setq-local add-log-current-defun-function commit 5390593c42d46942cd4016bf11653db96246986d Author: Yuan Fu Date: Mon Jun 9 22:34:11 2025 -0700 ; Create a new section for sexp functions in treesit.el. diff --git a/lisp/treesit.el b/lisp/treesit.el index db454fab9cc..30f163aa100 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2970,6 +2970,8 @@ BACKWARD and ALL are the same as in `treesit-search-forward'." (goto-char current-pos))) node)) +;;; Sexp functions + (make-obsolete 'treesit-sexp-type-regexp "`treesit-sexp-type-regexp' will be removed soon, use `treesit-thing-settings' instead." "30.1") commit 32bc6914e5fe696e51f03a035f7ca73c98dbb1a5 Author: Yuan Fu Date: Mon Jun 9 22:12:49 2025 -0700 Extract out prog--text-at-point-p from prog-fill-reindent-defun * lisp/progmodes/prog-mode.el (prog--text-at-point-p): New function. (prog-fill-reindent-defun): Use new function. diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 5df9f246b0f..b81ff6ff7a5 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -141,6 +141,31 @@ instead." (end (progn (forward-sexp 1) (point)))) (indent-region start end nil)))) +(defun prog--text-at-point-p () + "Return non-nil if point is in text (comment or string)." + ;; FIXME: For some reason, the comment-start syntax regexp doesn't + ;; work for me. But I kept it around to be safe, and in the hope + ;; that it can cover cases where comment-start-skip is unset. + (or (nth 8 (syntax-ppss)) + ;; If point is at the beginning of a comment delimiter, + ;; syntax-ppss doesn't consider point as being inside a + ;; comment. + (save-excursion + (beginning-of-line) + (and comment-start-skip + ;; FIXME: This doesn't work for the case where there + ;; are two matches of comment-start-skip, and the + ;; first one is, say, inside a string. We need to + ;; call re-search-forward repeatedly until either + ;; reached EOL or (nth 4 (syntax-ppss)) returns + ;; non-nil. + (re-search-forward comment-start-skip (pos-eol) t) + (nth 8 (syntax-ppss)))) + (save-excursion + (beginning-of-line) + (and (re-search-forward "\\s-*\\s<" (line-end-position) t) + (nth 8 (syntax-ppss)))))) + (defun prog-fill-reindent-defun (&optional argument) "Refill or reindent the paragraph or defun that contains point. @@ -151,28 +176,7 @@ Otherwise, reindent the function definition that contains point or follows point." (interactive "P") (save-excursion - ;; FIXME: For some reason, the comment-start syntax regexp doesn't - ;; work for me. But I kept it around to be safe, and in the hope - ;; that it can cover cases where comment-start-skip is unset. - (if (or (nth 8 (syntax-ppss)) - ;; If point is at the beginning of a comment delimiter, - ;; syntax-ppss doesn't consider point as being inside a - ;; comment. - (save-excursion - (beginning-of-line) - (and comment-start-skip - ;; FIXME: This doesn't work for the case where there - ;; are two matches of comment-start-skip, and the - ;; first one is, say, inside a string. We need to - ;; call re-search-forward repeatedly until either - ;; reached EOL or (nth 4 (syntax-ppss)) returns - ;; non-nil. - (re-search-forward comment-start-skip (pos-eol) t) - (nth 8 (syntax-ppss)))) - (save-excursion - (beginning-of-line) - (and (re-search-forward "\\s-*\\s<" (line-end-position) t) - (nth 8 (syntax-ppss))))) + (if (prog--text-at-point-p) (fill-paragraph argument (region-active-p)) (beginning-of-defun) (let ((start (point))) commit f9487d2b2898b455f9a828091c10adae312098c2 Author: Yuan Fu Date: Mon Jun 9 21:54:43 2025 -0700 ; * lisp/progmodes/prog-mode.el (prog-fill-reindent-defun): Typo. diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 62d22cb78c0..5df9f246b0f 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -153,7 +153,7 @@ or follows point." (save-excursion ;; FIXME: For some reason, the comment-start syntax regexp doesn't ;; work for me. But I kept it around to be safe, and in the hope - ;; that if can cover cases where comment-start-skip is unset. + ;; that it can cover cases where comment-start-skip is unset. (if (or (nth 8 (syntax-ppss)) ;; If point is at the beginning of a comment delimiter, ;; syntax-ppss doesn't consider point as being inside a commit 0a629abfbbdb34efcefe7b7d6f933bc7d90b5501 Author: Yuan Fu Date: Mon Jun 9 21:41:17 2025 -0700 Add new tactic to treesit-navigate-thing (bug#78703) * doc/emacs/programs.texi (Moving by Defuns): * doc/lispref/parsing.texi (User-defined Things): Describe the new tactic. * lisp/treesit.el (treesit-navigate-thing): Add new tactic. diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 446f1c864c7..f00d79f499a 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -267,13 +267,17 @@ bindings for that purpose. @cindex nested defuns @vindex treesit-defun-tactic Some programming languages supported @dfn{nested defuns}, whereby a -defun (such as a function or a method or a class) can be defined -inside (i.e., as part of the body) of another defun. The commands -described above by default find the beginning and the end of the -@emph{innermost} defun around point. Major modes based on the -tree-sitter library provide control of this behavior: if the variable -@code{treesit-defun-tactic} is set to the value @code{top-level}, the -defun commands will find the @emph{outermost} defuns instead. +defun (such as a function or a method or a class) can be defined inside +(i.e., as part of the body) of another defun. The commands described +above by default find the beginning and the end of the @emph{innermost} +defun around point. Major modes based on the tree-sitter library +provide control of this behavior: by default, the value of +@code{treesit-defun-tactic} is set to @code{nested}; if it's set +to@code{top-level}, the defun commands will find the @emph{outermost} +defuns instead; if the value is set to @code{parent-first}, the defun +command always tries to move out of the current enclosing defun rather +than moving to the previous or next defun around point; if there's no +enclosing defun, it moves to the previous or next defun. @node Moving by Sentences @subsection Moving by Sentences diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 2ff2e5f6160..e55e0edee71 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -1787,15 +1787,17 @@ Like in @code{treesit-thing-prev}, @var{thing} can be a thing symbol defined in @code{treesit-thing-settings}, or a predicate. @var{tactic} determines how this function moves between things. It can -be @code{nested}, @code{top-level}, @code{restricted}, or @code{nil}. -@code{nested} or @code{nil} means normal nested navigation: first try to -move across siblings; if there aren't any siblings left in the current -level, move to the parent, then its siblings, and so on. -@code{top-level} means only navigate across top-level things and ignore -nested things. @code{restricted} means movement is restricted within -the thing that encloses @var{position}, if there is such a thing. This -tactic is useful for commands that want to stop at the current nesting -level and not move up. +be @code{nested}, @code{top-level}, @code{restricted}, +@code{parent-first}, or @code{nil}. @code{nested} or @code{nil} means +normal nested navigation: first try to move across siblings; if there +aren't any siblings left in the current level, move to the parent, then +its siblings, and so on. @code{top-level} means only navigate across +top-level things and ignore nested things. @code{restricted} means +movement is restricted within the thing that encloses @var{position}, if +there is such a thing. This tactic is useful for commands that want to +stop at the current nesting level and not move up. @var{parent-first} +means move to the parent if there is one; and move to siblings if +there's no parent. @end defun @defun treesit-thing-at position thing &optional strict diff --git a/lisp/treesit.el b/lisp/treesit.el index 9bdea043bd3..db454fab9cc 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -3695,15 +3695,15 @@ across, return nil. THING can be a regexp, a predicate function, and more. See `treesit-thing-settings' for details. -TACTIC determines how does this function move between things. It -can be `nested', `top-level', `restricted', or nil. `nested' -means normal nested navigation: try to move to siblings first, -and if there aren't enough siblings, move to the parent and its -siblings. `top-level' means only consider top-level things, and -nested things are ignored. `restricted' means movement is -restricted inside the thing that encloses POS (i.e., parent), -should there be one. If omitted, TACTIC is considered to be -`nested'. +TACTIC determines how does this function move between things. It can be +`nested', `top-level', `restricted', `parent-first' or nil. `nested' +means normal nested navigation: try to move to siblings first, and if +there aren't enough siblings, move to the parent and its siblings. +`top-level' means only consider top-level things, and nested things are +ignored. `restricted' means movement is restricted inside the thing +that encloses POS (i.e., parent), should there be one. `parent' means +move to the parent if there is one; and move to siblings if there's no +parent. If omitted, TACTIC is considered to be `nested'. RECURSING is an internal parameter, if non-nil, it means this function is called recursively." @@ -3737,6 +3737,11 @@ function is called recursively." (setq parent (treesit-node-top-level parent thing t) prev nil next nil)) + ;; When PARENT is nil, `nested' and `parent-first' are the + ;; same, if there is a PARENT, pretend there is no nested PREV + ;; and NEXT so the following code moves to the parent. + (when (and (eq tactic 'parent-first) parent) + (setq prev nil next nil)) ;; If TACTIC is `restricted', the implementation is simple. ;; In principle we don't go to parent's beg/end for ;; `restricted' tactic, but if the parent is a "leaf thing" commit 1009e3d1fd6a40cf7a07a0f75a24f704737e4c6b Author: Philip Kaludercic Date: Mon Jun 9 15:13:19 2025 +0200 Support checking auth-source for NickServ password for rcirc * doc/misc/rcirc.texi: Mention new feature. * etc/NEWS: Mention new feature. * lisp/net/rcirc.el (rcirc-authinfo): Update type and documentation. (rcirc-authenticate): Handle a special type to indicate that the password is stored via auth-source. diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi index 5b298517e57..cee55ef6837 100644 --- a/doc/misc/rcirc.texi +++ b/doc/misc/rcirc.texi @@ -595,6 +595,10 @@ Before you can use this method, you will have to register your nick and pick a password for it. Contact @code{nickserv} and check out the details. (Using @code{/msg nickserv help}, for example.) +You can set the password to the symbol @code{:auth-source}, to fetch the +password from auth-source (@pxref{auth-source}), if you to not hard-code +your password in your configuration. + @item chanserv @cindex chanserv authentication Use this symbol if you need to identify yourself as follows if you want diff --git a/etc/NEWS b/etc/NEWS index 9cd015eb400..d5b62b9850a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1891,6 +1891,13 @@ the command will only copy those files. +++ *** package-x.el is now obsolete. + +** RCIRC + ++++ +*** Authentication via NickServ can access password from 'auth-source' +For details, consult 'rcirc-authinfo'. + ** Xref --- diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 23e649c6f09..bfa42ee8bb6 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -270,8 +270,13 @@ The ARGUMENTS for each METHOD symbol are: `sasl': NICK PASSWORD `certfp': KEY CERT +For `nickserv', PASSWORD may be the symbol `:auth-source', in which case +the host, nick and port will be used to query a password from an +available `auth-source' backend. + Examples: ((\"Libera.Chat\" nickserv \"bob\" \"p455w0rd\") + (\"Libera.Chat\" nickserv \"bob\" :auth-source) (\"Libera.Chat\" chanserv \"bob\" \"#bobland\" \"passwd99\") (\"Libera.Chat\" certfp \"/path/to/key\" \"/path/to/cert\") (\"bitlbee\" bitlbee \"robert\" \"sekrit\") @@ -282,7 +287,9 @@ Examples: :value-type (choice (list :tag "NickServ" (const nickserv) (string :tag "Nick") - (string :tag "Password")) + (choice + (string :tag "Password") + (const :tag "Use Auth-Source" :auth-source))) (list :tag "ChanServ" (const chanserv) (string :tag "Nick") @@ -3666,40 +3673,44 @@ specified in RFC2812, where 005 stood for RPL_BOUNCE." Passwords are stored in `rcirc-authinfo' (which see)." (interactive) (with-rcirc-server-buffer - (dolist (i rcirc-authinfo) - (let ((process (rcirc-buffer-process)) - (server (car i)) - (nick (nth 2 i)) - (method (cadr i)) - (args (cdddr i))) - (when (and (string-match server rcirc-server)) - (if (and (memq method '(nickserv chanserv bitlbee)) - (string-match nick rcirc-nick)) - ;; the following methods rely on the user's nickname. - (cl-case method - (nickserv - (rcirc-send-privmsg - process - (or (cadr args) "NickServ") - (concat "IDENTIFY " (car args)))) - (chanserv - (rcirc-send-privmsg - process - "ChanServ" - (format "IDENTIFY %s %s" (car args) (cadr args)))) - (bitlbee - (rcirc-send-privmsg - process - "&bitlbee" - (concat "IDENTIFY " (car args)))) - (sasl nil)) - ;; quakenet authentication doesn't rely on the user's nickname. - ;; the variable `nick' here represents the Q account name. - (when (eq method 'quakenet) - (rcirc-send-privmsg - process - "Q@CServe.quakenet.org" - (format "AUTH %s %s" nick (car args)))))))))) + (pcase-dolist (`(,(rx (regexp rcirc-server)) . ,ai) rcirc-authinfo) + (pcase ai + (`(nickserv ,(rx (regexp rcirc-nick)) :auth-source . ,(or `(,nickserv) '())) + (if-let* ((auth (auth-source-search + :host rcirc-server + :port (nth 1 rcirc-connection-info) + :user (nth 2 rcirc-connection-info))) + (password (auth-info-password (car auth)))) + (rcirc-send-privmsg + (rcirc-buffer-process) + (or nickserv "NickServ") + (concat "IDENTIFY " password)) + (rcirc-print + (rcirc-buffer-process) rcirc-nick "ERROR" nil + "No auth-source entry found for `nickserv' authentication"))) + (`(nickserv ,(rx (regexp rcirc-nick)) ,password . ,(or `(,nickserv) '())) + (rcirc-send-privmsg + (rcirc-buffer-process) + (or nickserv "NickServ") + (concat "IDENTIFY " password))) + (`(chanserv ,(rx (regexp rcirc-nick)) ,channel ,password) + (rcirc-send-privmsg + (rcirc-buffer-process) + "ChanServ" + (format "IDENTIFY %s %s" channel password))) + (`(bitlbee ,(rx (regexp rcirc-nick)) ,password) + (rcirc-send-privmsg + (rcirc-buffer-process) + "&bitlbee" + (concat "IDENTIFY " password))) + (`(quakenet ,account ,password) + ;; quakenet authentication doesn't rely on the user's + ;; nickname. the variable `account' here represents the Q + ;; account name. + (rcirc-send-privmsg + (rcirc-buffer-process) + "Q@CServe.quakenet.org" + (format "AUTH %s %s" account password))))))) (defun rcirc-handler-INVITE (process sender args _text) "Notify user of an invitation from SENDER. commit 2438aaf76413e7255136f9ec900f1900188a0887 Author: Philip Kaludercic Date: Mon Jun 9 13:16:17 2025 +0200 ; * lisp/net/rcirc.el (rcirc-channel-p): Simplify implementation diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 291cf39ab1c..23e649c6f09 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -1602,10 +1602,7 @@ If ALL is non-nil, update prompts in all IRC buffers." (defun rcirc-channel-p (target) "Return t if TARGET is a channel name." - (and target - (not (zerop (length target))) - (or (eq (aref target 0) ?#) - (eq (aref target 0) ?&)))) + (and (stringp target) (string-match-p (rx bos (or ?# ?&)) target))) (defcustom rcirc-log-directory (locate-user-emacs-file "rcirc-log") "Directory to keep IRC logfiles." commit d660ed0b4cdd59c4ba1b61a2e6384dc485ef0dea Author: Sean Whitton Date: Mon Jun 9 12:13:06 2025 +0100 Prompt just once when deleting multiple files with C-x v v * lisp/vc/vc.el (vc-delete-file): Accept lists of files in addition to single files. (vc-next-action): Call vc-delete-file once for all the files. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index b60055cdaeb..356eb2d7370 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1501,7 +1501,7 @@ from which to check out the file(s)." (t (vc-register vc-fileset)))) ((eq state 'missing) - (mapc #'vc-delete-file files)) + (vc-delete-file files)) ;; Files are up-to-date, or need a merge and user specified a revision ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update))) (cond @@ -3658,48 +3658,57 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. (vc-checkin file new-backend comment (stringp comment))))) ;;;###autoload -(defun vc-delete-file (file) +(defun vc-delete-file (file-or-files) "Delete file and mark it as such in the version control system. -If called interactively, read FILE, defaulting to the current -buffer's file name if it's under version control." +If called interactively, read FILE-OR-FILES, defaulting to the current +buffer's file name if it's under version control. +When called from Lisp, FILE-OR-FILES can be a file name or a list of +file names." (interactive (list (read-file-name "VC delete file: " nil (when (vc-backend buffer-file-name) buffer-file-name) t))) - (setq file (expand-file-name file)) - (let ((buf (get-file-buffer file)) - (backend (vc-backend file))) - (unless backend - (error "File %s is not under version control" - (file-name-nondirectory file))) - (unless (vc-find-backend-function backend 'delete-file) - (error "Deleting files under %s is not supported in VC" backend)) - (when (and buf (buffer-modified-p buf)) - (error "Please save or undo your changes before deleting %s" file)) - (let ((state (vc-state file))) - (when (eq state 'edited) - (error "Please commit or undo your changes before deleting %s" file)) - (when (eq state 'conflict) - (error "Please resolve the conflicts before deleting %s" file))) - (unless (y-or-n-p (format "Really want to delete %s? " - (file-name-nondirectory file))) - (error "Abort!")) - (unless (or (file-directory-p file) (null make-backup-files) - (not (file-exists-p file))) - (with-current-buffer (or buf (find-file-noselect file)) - (let ((backup-inhibited nil)) - (backup-buffer)))) - ;; Bind `default-directory' so that the command that the backend - ;; runs to remove the file is invoked in the correct context. - (let ((default-directory (file-name-directory file))) - (vc-call-backend backend 'delete-file file)) - ;; If the backend hasn't deleted the file itself, let's do it for him. - (when (file-exists-p file) (delete-file file)) - ;; Forget what VC knew about the file. - (vc-file-clearprops file) - ;; Make sure the buffer is deleted and the *vc-dir* buffers are - ;; updated after this. - (vc-resynch-buffer file nil t))) + (setq file-or-files (mapcar #'expand-file-name (ensure-list file-or-files))) + (dolist (file file-or-files) + (let ((buf (get-file-buffer file)) + (backend (vc-backend file))) + (unless backend + (error "File %s is not under version control" + (file-name-nondirectory file))) + (unless (vc-find-backend-function backend 'delete-file) + (error "Deleting files under %s is not supported in VC" backend)) + (when (and buf (buffer-modified-p buf)) + (error "Please save or undo your changes before deleting %s" file)) + (let ((state (vc-state file))) + (when (eq state 'edited) + (error "Please commit or undo your changes before deleting %s" file)) + (when (eq state 'conflict) + (error "Please resolve the conflicts before deleting %s" file))))) + (unless (y-or-n-p (if (cdr file-or-files) + (format "Really want to delete these %d files? " + (length file-or-files)) + (format "Really want to delete %s? " + (file-name-nondirectory (car file-or-files))))) + (error "Abort!")) + (dolist (file file-or-files) + (let ((buf (get-file-buffer file)) + (backend (vc-backend file))) + (unless (or (file-directory-p file) (null make-backup-files) + (not (file-exists-p file))) + (with-current-buffer (or buf (find-file-noselect file)) + (let ((backup-inhibited nil)) + (backup-buffer)))) + ;; Bind `default-directory' so that the command that the backend + ;; runs to remove the file is invoked in the correct context. + (let ((default-directory (file-name-directory file))) + (vc-call-backend backend 'delete-file file)) + ;; If the backend hasn't deleted the file itself, let's do it for him. + (when (file-exists-p file) (delete-file file)) + ;; Forget what VC knew about the file. + (vc-file-clearprops file) + ;; Make sure the buffer is deleted and the *vc-dir* buffers are + ;; updated after this. + (vc-resynch-buffer file nil t)))) ;;;###autoload (defun vc-rename-file (old new) commit 00a30a752ecdf927f532ccf504d52392ef9d98da Author: Philip Kaludercic Date: Mon Jun 9 13:09:53 2025 +0200 Require CertFP files for rcirc to exist * lisp/net/rcirc.el (rcirc-authinfo): Adjust the types for the key and certificate file from 'string' to 'file'. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 3f81672182b..291cf39ab1c 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -302,8 +302,8 @@ Examples: (string :tag "Password")) (list :tag "CertFP" (const certfp) - (string :tag "Key") - (string :tag "Certificate"))))) + (file :tag "Key" :must-match t) + (file :tag "Certificate" :must-match t))))) (defcustom rcirc-auto-authenticate-flag t "Non-nil means automatically send authentication string to server. commit 7f6244364b73f0200704708babf6d22367898912 Author: Mattias EngdegÄrd Date: Mon Jun 9 12:55:11 2025 +0200 Revert "Fix function arity check for noncompiled callees (bug#78685)" This reverts commit 8b0f5b05976a99e82e54d6c602d47a8668ccd9d5. This change wasn't quite right; the solution requires greater care. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 5fa65ff71a6..0ec8db214bc 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1456,7 +1456,10 @@ when printing the error message." (let ((fn name)) (while (and (symbolp fn) (fboundp fn) - (functionp (symbol-function fn))) + (or (symbolp (symbol-function fn)) + (consp (symbol-function fn)) + (and (not macro-p) + (compiled-function-p (symbol-function fn))))) (setq fn (symbol-function fn))) (let ((advertised (get-advertised-calling-convention (if (and (symbolp fn) (fboundp fn)) @@ -1468,7 +1471,7 @@ when printing the error message." (if macro-p `(macro lambda ,advertised) `(lambda ,advertised))) - ((and (not macro-p) (functionp fn)) fn) + ((and (not macro-p) (compiled-function-p fn)) fn) ((not (consp fn)) nil) ((eq 'macro (car fn)) (cdr fn)) (macro-p nil) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index d1f272f7a4d..8b0c1dad4c0 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1357,20 +1357,6 @@ byte-compiled. Run with dynamic binding." (concat ";;; -*-lexical-binding:nil-*-\n" some-code))) (should (cookie-warning some-code)))))) -(defun bytecomp-tests--f (x y &optional u v) (list x y u v)) - -(ert-deftest bytecomp-tests--warn-arity-noncompiled-callee () - "Check that calls to non-compiled functions are arity-checked (bug#78685)" - (should (not (compiled-function-p (symbol-function 'bytecomp-tests--f)))) - (let* ((source (concat ";;; -*-lexical-binding:t-*-\n" - "(defun my-fun () (bytecomp-tests--f 11))\n")) - (lexical-binding t) - (log (bytecomp-tests--log-from-compilation source))) - (should (string-search - (concat "Warning: `bytecomp-tests--f' called with 1 argument," - " but requires 2-4") - log)))) - (ert-deftest bytecomp-tests--unescaped-char-literals () "Check that byte compiling warns about unescaped character literals (Bug#20852)." commit e58635a184a6d725c0c89516132fe4c4b0ec850a Author: Sean Whitton Date: Mon Jun 9 11:51:48 2025 +0100 ; Document recent VC changes regarding file removal * doc/emacs/maintaining.texi (VC With A Merging VCS) (VC With A Locking VCS): Update text about 'C-x v v' with mixed file statuses. * etc/NEWS: Announce the recent improvements. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index b65df366f05..044f3f352fd 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -541,11 +541,10 @@ or Dired buffer: @itemize @bullet @item If there is more than one file in the VC fileset and the files have -inconsistent version control statuses, signal an error. (Note, -however, that a fileset is allowed to include both newly-added files -and modified files; @pxref{Registering}.) Also signal an error if the -files in the fileset are missing (removed from the filesystem, but -still tracked by version control), or are ignored by version control. +inconsistent version control statuses, signal an error. (Note, however, +that a fileset is allowed to include both newly-added files, removed +files and modified files; @pxref{Registering}.) Also signal an error if +any files in the fileset are ignored by version control. @item If every file in the VC fileset is registered and unchanged with @@ -612,8 +611,7 @@ its default mode), @kbd{C-x v v} does the following: @item If there is more than one file in the VC fileset and the files have inconsistent version control statuses, signal an error. Also signal -an error if the files in the fileset are missing (removed from the -filesystem, but still tracked by version control). +an error if any files in the fileset are ignored by version control. @item If each file in the VC fileset is not registered with a version diff --git a/etc/NEWS b/etc/NEWS index 1f29fe5f0b4..9cd015eb400 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1783,6 +1783,27 @@ were added, removed or edited, Emacs would refuse to proceed. Now Emacs prompts to first register the unregistered files, so that all files in the fileset are in a compatible state for a checkin. ++++ +*** 'C-x v v' handles missing and removed files more consistently. +Missing files are those which have been removed from the filesystem but +are still tracked by version control. Removed files are those scheduled +to be removed from version control in the next commit. Previously, +different backends were inconsistent about applying these statuses to +files, and 'C-x v v' behaved subtly differently for the two statuses. +The combination of these differences between backends and in 'C-x v v' +behavior was confusing. Now, + +- the Git backend properly marks files as missing if you just delete + them instead of using 'C-x v x' +- in VC-Dir, you can use 'C-x v v' on missing files to mark them as + removed +- when committing, you can include missing files in a set of files with + different statuses, just like you've always been able to include + removed files. + +There is still some further work to do to rationalize VC's handling of +file removal. + --- *** New user option 'vc-dir-hide-up-to-date-on-revert'. If you customize this variable to non-nil, the 'g' command to refresh