Avoid deprecated ELisp features

Activate `lexical-binding` in a few more files.
Use `advice-add` rather than `defadvice`.
Fix some compilation warnings.
Prefer #' to quote function names.
Adjust `Package-Requires:` accordingly.
This commit is contained in:
Stefan Monnier
2025-03-06 17:10:53 -05:00
parent 2cd802b1f7
commit ddd677091a
10 changed files with 93 additions and 83 deletions

View File

@@ -309,7 +309,7 @@ With zero ARG, skip the last one and mark next."
(mc/mark-previous-like-this arg)))
(defun mc/mark-lines (num-lines direction)
(dotimes (i (if (= num-lines 0) 1 num-lines))
(dotimes (_ (if (= num-lines 0) 1 num-lines))
(mc/save-excursion
(let ((furthest-cursor (cl-ecase direction
(forwards (mc/furthest-cursor-after-point))
@@ -500,10 +500,10 @@ remove the keymap depends on user input and KEEP-PRED:
(defvar mc/mark-more-like-this-extended-keymap (make-sparse-keymap))
(define-key mc/mark-more-like-this-extended-keymap (kbd "<up>") 'mc/mmlte--up)
(define-key mc/mark-more-like-this-extended-keymap (kbd "<down>") 'mc/mmlte--down)
(define-key mc/mark-more-like-this-extended-keymap (kbd "<left>") 'mc/mmlte--left)
(define-key mc/mark-more-like-this-extended-keymap (kbd "<right>") 'mc/mmlte--right)
(define-key mc/mark-more-like-this-extended-keymap (kbd "<up>") #'mc/mmlte--up)
(define-key mc/mark-more-like-this-extended-keymap (kbd "<down>") #'mc/mmlte--down)
(define-key mc/mark-more-like-this-extended-keymap (kbd "<left>") #'mc/mmlte--left)
(define-key mc/mark-more-like-this-extended-keymap (kbd "<right>") #'mc/mmlte--right)
;;;###autoload
(defun mc/mark-more-like-this-extended ()
@@ -706,7 +706,7 @@ already there."
(mc/maybe-multiple-cursors-mode)))
;;;###autoload
(defalias 'mc/add-cursor-on-click 'mc/toggle-cursor-on-click)
(defalias 'mc/add-cursor-on-click #'mc/toggle-cursor-on-click)
;;;###autoload
(defun mc/mark-sgml-tag-pair ()