Mercurial > emacs
comparison lisp/edmacro.el @ 11870:993431cf1f89
(edit-kbd-macro): Better error messages for undefined keys
or keys that are not keyboard macros.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Mon, 22 May 1995 22:08:18 +0000 |
parents | 58ab3325da3b |
children | 2e80892d4b39 |
comparison
equal
deleted
inserted
replaced
11869:ab2739454f2a | 11870:993431cf1f89 |
---|---|
112 (setq cmd (read-command "Name of keyboard macro to edit: ")) | 112 (setq cmd (read-command "Name of keyboard macro to edit: ")) |
113 (setq mac (symbol-function cmd))) | 113 (setq mac (symbol-function cmd))) |
114 ((eq cmd 'view-lossage) | 114 ((eq cmd 'view-lossage) |
115 (setq mac (recent-keys)) | 115 (setq mac (recent-keys)) |
116 (setq cmd 'last-kbd-macro)) | 116 (setq cmd 'last-kbd-macro)) |
117 ((null cmd) | |
118 (error "Key sequence %s is not defined" (key-description keys))) | |
117 ((symbolp cmd) | 119 ((symbolp cmd) |
118 (setq mac (symbol-function cmd))) | 120 (setq mac (symbol-function cmd))) |
119 (t | 121 (t |
120 (setq mac cmd) | 122 (setq mac cmd) |
121 (setq cmd nil))) | 123 (setq cmd nil))) |
122 (unless (arrayp mac) | 124 (unless (arrayp mac) |
123 (error "Not a keyboard macro: %s" cmd)) | 125 (error "Key sequence %s is not a keyboard macro" |
126 (key-description keys))) | |
124 (message "Formatting keyboard macro...") | 127 (message "Formatting keyboard macro...") |
125 (let* ((oldbuf (current-buffer)) | 128 (let* ((oldbuf (current-buffer)) |
126 (mmac (edmacro-fix-menu-commands mac)) | 129 (mmac (edmacro-fix-menu-commands mac)) |
127 (fmt (edmacro-format-keys mmac 1)) | 130 (fmt (edmacro-format-keys mmac 1)) |
128 (fmtv (edmacro-format-keys mmac (not prefix))) | 131 (fmtv (edmacro-format-keys mmac (not prefix))) |