mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2026-02-04 14:22:24 +00:00
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:
@@ -1,4 +1,6 @@
|
||||
(require 'cl) ;; For lexical-let
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
(require 'multiple-cursors-core)
|
||||
|
||||
(When "^I mark next like this$"
|
||||
(lambda () (call-interactively 'mc/mark-next-like-this)))
|
||||
@@ -109,26 +111,22 @@
|
||||
|
||||
(When "^I copy \"\\(.+\\)\" in another program$"
|
||||
(lambda (text)
|
||||
(lexical-let ((text text))
|
||||
(setq interprogram-paste-function
|
||||
#'(lambda () (let ((r text)) (setq text nil) r))))))
|
||||
(setq interprogram-paste-function
|
||||
#'(lambda () (let ((r text)) (setq text nil) r)))))
|
||||
|
||||
(Given "^I have bound C-! to a lambda that inserts \"\\(.+\\)\"$"
|
||||
(lambda (ins)
|
||||
(lexical-let ((ins ins))
|
||||
(global-set-key (kbd "C-!") #'(lambda () (interactive) (insert ins))))))
|
||||
(global-set-key (kbd "C-!") #'(lambda () (interactive) (insert ins)))))
|
||||
|
||||
(Given "^I have bound C-! to a new command that inserts \"\\(.+\\)\"$"
|
||||
(lambda (ins)
|
||||
(lexical-let ((ins ins))
|
||||
(defun mc-test-temp-command () (interactive) (insert ins))
|
||||
(global-set-key (kbd "C-!") 'mc-test-temp-command))))
|
||||
(defun mc-test-temp-command () (interactive) (insert ins))
|
||||
(global-set-key (kbd "C-!") 'mc-test-temp-command)))
|
||||
|
||||
(Given "^I have bound C-! to another new command that inserts \"\\(.+\\)\"$"
|
||||
(lambda (ins)
|
||||
(lexical-let ((ins ins))
|
||||
(defun mc-test-temp-command-2 () (interactive) (insert ins))
|
||||
(global-set-key (kbd "C-!") 'mc-test-temp-command-2))))
|
||||
(defun mc-test-temp-command-2 () (interactive) (insert ins))
|
||||
(global-set-key (kbd "C-!") 'mc-test-temp-command-2)))
|
||||
|
||||
(Given "^I have bound C-! to a new command that inserts two read-chars$"
|
||||
(lambda ()
|
||||
@@ -171,7 +169,7 @@
|
||||
|
||||
(When "^I mark all \\(.+\\)$"
|
||||
(lambda (rest)
|
||||
(let ((func (intern (mapconcat 'identity
|
||||
(let ((func (intern (mapconcat #'identity
|
||||
(cons "mc/mark-all"
|
||||
(split-string rest))
|
||||
"-"))))
|
||||
|
||||
Reference in New Issue
Block a user