commit 4d1d43e41fafaa5beecba57686f5d5f4146746c8 (HEAD, refs/remotes/origin/master) Author: Theodor Thornhill Date: Mon Jan 9 07:52:38 2023 +0100 Add named defun for transpose-sexps-default-function (bug#60654) * lisp/simple.el (transpose-sexps-default-function): Move the lambda into its own function. (transpose-sexps-function): Refer to it by name. * etc/NEWS: Mention the change. diff --git a/etc/NEWS b/etc/NEWS index 60dab575da6..3aa8f2abb77 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -57,6 +57,10 @@ trash when deleting. Default is nil. Emacs now can set this variable to customize the behavior of the 'transpose-sexps' function. +** New function 'transpose-sexps-default-function'. +The previous implementation is moved into its own function, to be +bound by transpose-sexps-function'. + ** New function 'treesit-transpose-sexps'. treesit.el now unconditionally sets 'transpose-sexps-function' for all Tree-sitter modes. This functionality utilizes the new diff --git a/lisp/simple.el b/lisp/simple.el index 690968ca938..c8c5542caee 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8436,37 +8436,39 @@ transpose-words (interactive "*p") (transpose-subr 'forward-word arg)) -(defvar transpose-sexps-function - (lambda (arg) - ;; Here we should try to simulate the behavior of - ;; (cons (progn (forward-sexp x) (point)) - ;; (progn (forward-sexp (- x)) (point))) - ;; Except that we don't want to rely on the second forward-sexp - ;; putting us back to where we want to be, since forward-sexp-function - ;; might do funny things like infix-precedence. - (if (if (> arg 0) - (looking-at "\\sw\\|\\s_") - (and (not (bobp)) - (save-excursion - (forward-char -1) - (looking-at "\\sw\\|\\s_")))) - ;; Jumping over a symbol. We might be inside it, mind you. - (progn (funcall (if (> arg 0) - #'skip-syntax-backward #'skip-syntax-forward) - "w_") - (cons (save-excursion (forward-sexp arg) (point)) (point))) - ;; Otherwise, we're between sexps. Take a step back before jumping - ;; to make sure we'll obey the same precedence no matter which - ;; direction we're going. - (funcall (if (> arg 0) #'skip-syntax-backward #'skip-syntax-forward) - " .") - (cons (save-excursion (forward-sexp arg) (point)) - (progn (while (or (forward-comment (if (> arg 0) 1 -1)) - (not (zerop (funcall (if (> arg 0) - #'skip-syntax-forward - #'skip-syntax-backward) - "."))))) - (point))))) +(defun transpose-sexps-default-function (arg) + "Default method to locate a pair of points for transpose-sexps." + ;; Here we should try to simulate the behavior of + ;; (cons (progn (forward-sexp x) (point)) + ;; (progn (forward-sexp (- x)) (point))) + ;; Except that we don't want to rely on the second forward-sexp + ;; putting us back to where we want to be, since forward-sexp-function + ;; might do funny things like infix-precedence. + (if (if (> arg 0) + (looking-at "\\sw\\|\\s_") + (and (not (bobp)) + (save-excursion + (forward-char -1) + (looking-at "\\sw\\|\\s_")))) + ;; Jumping over a symbol. We might be inside it, mind you. + (progn (funcall (if (> arg 0) + #'skip-syntax-backward #'skip-syntax-forward) + "w_") + (cons (save-excursion (forward-sexp arg) (point)) (point))) + ;; Otherwise, we're between sexps. Take a step back before jumping + ;; to make sure we'll obey the same precedence no matter which + ;; direction we're going. + (funcall (if (> arg 0) #'skip-syntax-backward #'skip-syntax-forward) + " .") + (cons (save-excursion (forward-sexp arg) (point)) + (progn (while (or (forward-comment (if (> arg 0) 1 -1)) + (not (zerop (funcall (if (> arg 0) + #'skip-syntax-forward + #'skip-syntax-backward) + "."))))) + (point))))) + +(defvar transpose-sexps-function #'transpose-sexps-default-function "If non-nil, `transpose-sexps' delegates to this function. This function takes one argument ARG, a number. Its expected commit 5259f144d95d92dbda3d8db06b4f870bcfbb4a93 Author: Eli Zaretskii Date: Mon Jan 9 22:05:40 2023 +0200 Remove unneeded restriction in using AEAD ciphers with GnuTLS * src/gnutls.c (gnutls_symmetric_aead): Disable the enforcement of block size on input data. (Bug#60693) diff --git a/src/gnutls.c b/src/gnutls.c index e8528381efd..ca7e9fc4c73 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -2405,6 +2405,9 @@ gnutls_symmetric_aead (bool encrypting, gnutls_cipher_algorithm_t gca, aead_auth_size = aend_byte - astart_byte; } + /* Only block ciphers require that ISIZE be a multiple of the block + size, and AEAD ciphers are not block ciphers. */ +#if 0 ptrdiff_t expected_remainder = encrypting ? 0 : cipher_tag_size; ptrdiff_t cipher_block_size = gnutls_cipher_get_block_size (gca); @@ -2414,6 +2417,7 @@ gnutls_symmetric_aead (bool encrypting, gnutls_cipher_algorithm_t gca, "is not %"pD"d greater than a multiple of the required %"pD"d"), gnutls_cipher_get_name (gca), desc, isize, expected_remainder, cipher_block_size); +#endif ret = ((encrypting ? gnutls_aead_cipher_encrypt : gnutls_aead_cipher_decrypt) (acipher, vdata, vsize, aead_auth_data, aead_auth_size,