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

@@ -73,7 +73,7 @@
(cursors-after-point (cl-remove-if (lambda (cursor)
(< (mc/cursor-beg cursor) point))
cursors))
(cursors-in-order (cl-sort cursors-after-point '< :key 'mc/cursor-beg)))
(cursors-in-order (cl-sort cursors-after-point #'< :key #'mc/cursor-beg)))
(car cursors-in-order)))
(defun mc/last-fake-cursor-before (point)
@@ -82,7 +82,7 @@
(cursors-before-point (cl-remove-if (lambda (cursor)
(> (mc/cursor-end cursor) point))
cursors))
(cursors-in-order (cl-sort cursors-before-point '> :key 'mc/cursor-end)))
(cursors-in-order (cl-sort cursors-before-point #'> :key #'mc/cursor-end)))
(car cursors-in-order)))
(cl-defun mc/cycle (next-cursor fallback-cursor loop-message)
@@ -110,8 +110,8 @@
(mc/last-fake-cursor-before (point-max))
"We're already at the last cursor"))
(define-key mc/keymap (kbd "C-v") 'mc/cycle-forward)
(define-key mc/keymap (kbd "M-v") 'mc/cycle-backward)
(define-key mc/keymap (kbd "C-v") #'mc/cycle-forward)
(define-key mc/keymap (kbd "M-v") #'mc/cycle-backward)
(provide 'mc-cycle-cursors)