diff options
| author | Stefan Monnier | 2022-04-04 09:13:10 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2022-04-04 09:13:10 -0400 |
| commit | 877893303bfc7ce447f4acc33f2f9c8caf809489 (patch) | |
| tree | 80425aa083c634394f46eb97ab94a612be5c3f0c /lisp | |
| parent | 84cf3be6f77f61dd361acdb3683ab9d71e76c995 (diff) | |
| download | emacs-877893303bfc7ce447f4acc33f2f9c8caf809489.tar.gz emacs-877893303bfc7ce447f4acc33f2f9c8caf809489.zip | |
edmacro.el: Silence warnings due to kmacro changes
* lisp/edmacro.el (edit-kbd-macro): Use `kmacro-p` and kmacro accessors.
(edmacro-finish-edit): Use `kmacro-p` and the new `kmacro` constructor.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/edmacro.el | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 2561994f7bd..179fea786d0 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el | |||
| @@ -99,8 +99,7 @@ With a prefix argument, format the macro in a more concise way." | |||
| 99 | (when keys | 99 | (when keys |
| 100 | (let ((cmd (if (arrayp keys) (key-binding keys) keys)) | 100 | (let ((cmd (if (arrayp keys) (key-binding keys) keys)) |
| 101 | (cmd-noremap (when (arrayp keys) (key-binding keys nil t))) | 101 | (cmd-noremap (when (arrayp keys) (key-binding keys nil t))) |
| 102 | (mac nil) (mac-counter nil) (mac-format nil) | 102 | (mac nil) (mac-counter nil) (mac-format nil)) |
| 103 | kmacro) | ||
| 104 | (cond (store-hook | 103 | (cond (store-hook |
| 105 | (setq mac keys) | 104 | (setq mac keys) |
| 106 | (setq cmd nil)) | 105 | (setq cmd nil)) |
| @@ -131,10 +130,10 @@ With a prefix argument, format the macro in a more concise way." | |||
| 131 | (t | 130 | (t |
| 132 | (setq mac cmd) | 131 | (setq mac cmd) |
| 133 | (setq cmd nil))) | 132 | (setq cmd nil))) |
| 134 | (when (setq kmacro (kmacro-extract-lambda mac)) | 133 | (when (kmacro-p mac) |
| 135 | (setq mac (car kmacro) | 134 | (setq mac (kmacro--keys mac) |
| 136 | mac-counter (nth 1 kmacro) | 135 | mac-counter (kmacro--counter mac) |
| 137 | mac-format (nth 2 kmacro))) | 136 | mac-format (kmacro--format mac))) |
| 138 | (unless (arrayp mac) | 137 | (unless (arrayp mac) |
| 139 | (error "Key sequence %s is not a keyboard macro" | 138 | (error "Key sequence %s is not a keyboard macro" |
| 140 | (key-description keys))) | 139 | (key-description keys))) |
| @@ -260,7 +259,7 @@ or nil, use a compact 80-column format." | |||
| 260 | (push key keys) | 259 | (push key keys) |
| 261 | (let ((b (key-binding key))) | 260 | (let ((b (key-binding key))) |
| 262 | (and b (commandp b) (not (arrayp b)) | 261 | (and b (commandp b) (not (arrayp b)) |
| 263 | (not (kmacro-extract-lambda b)) | 262 | (not (kmacro-p b)) |
| 264 | (or (not (fboundp b)) | 263 | (or (not (fboundp b)) |
| 265 | (not (or (arrayp (symbol-function b)) | 264 | (not (or (arrayp (symbol-function b)) |
| 266 | (get b 'kmacro)))) | 265 | (get b 'kmacro)))) |
| @@ -313,10 +312,7 @@ or nil, use a compact 80-column format." | |||
| 313 | (when cmd | 312 | (when cmd |
| 314 | (if (= (length mac) 0) | 313 | (if (= (length mac) 0) |
| 315 | (fmakunbound cmd) | 314 | (fmakunbound cmd) |
| 316 | (fset cmd | 315 | (fset cmd (kmacro mac mac-counter mac-format)))) |
| 317 | (if (and mac-counter mac-format) | ||
| 318 | (kmacro-lambda-form mac mac-counter mac-format) | ||
| 319 | mac)))) | ||
| 320 | (if no-keys | 316 | (if no-keys |
| 321 | (when cmd | 317 | (when cmd |
| 322 | (cl-loop for key in (where-is-internal cmd '(keymap)) do | 318 | (cl-loop for key in (where-is-internal cmd '(keymap)) do |
| @@ -327,10 +323,8 @@ or nil, use a compact 80-column format." | |||
| 327 | (cl-loop for key in keys do | 323 | (cl-loop for key in keys do |
| 328 | (global-set-key key | 324 | (global-set-key key |
| 329 | (or cmd | 325 | (or cmd |
| 330 | (if (and mac-counter mac-format) | 326 | (kmacro mac mac-counter |
| 331 | (kmacro-lambda-form | 327 | mac-format)))))))))) |
| 332 | mac mac-counter mac-format) | ||
| 333 | mac)))))))))) | ||
| 334 | (kill-buffer buf) | 328 | (kill-buffer buf) |
| 335 | (when (buffer-name obuf) | 329 | (when (buffer-name obuf) |
| 336 | (switch-to-buffer obuf)) | 330 | (switch-to-buffer obuf)) |
| @@ -645,9 +639,9 @@ This function assumes that the events can be stored in a string." | |||
| 645 | 639 | ||
| 646 | ;;; Parsing a human-readable keyboard macro. | 640 | ;;; Parsing a human-readable keyboard macro. |
| 647 | 641 | ||
| 648 | (defun edmacro-parse-keys (string &optional need-vector) | 642 | (defun edmacro-parse-keys (string &optional _need-vector) |
| 649 | (let ((result (kbd string))) | 643 | (let ((result (kbd string))) |
| 650 | (if (and need-vector (stringp result)) | 644 | (if (stringp result) |
| 651 | (seq-into result 'vector) | 645 | (seq-into result 'vector) |
| 652 | result))) | 646 | result))) |
| 653 | 647 | ||