Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c176054f
Commit
c176054f
authored
Jan 13, 2014
by
Daniel Colascione
Browse files
Fix rst-mode deprecated keybindings
parent
1b49bd5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
11 deletions
+28
-11
lisp/ChangeLog
lisp/ChangeLog
+6
-0
lisp/textmodes/rst.el
lisp/textmodes/rst.el
+22
-11
No files found.
lisp/ChangeLog
View file @
c176054f
2014-01-13 Daniel Colascione <dancol@dancol.org>
* textmodes/rst.el (rst-define-key): Provide deprecated
keybindings through named functions instead of anonymous ones so
that "??" doesn't appear in describe-mode output.
2014-01-13 Bastien Guerry <bzg@gnu.org>
* simple.el (define-alternatives): Call the selected command
...
...
lisp/textmodes/rst.el
View file @
c176054f
...
...
@@ -611,17 +611,28 @@ KEYMAP, KEY, and DEF are as in `define-key'. DEPRECATED key
definitions should be in vector notation. These are defined as
well but give an additional message."
(define-key keymap key def)
(dolist (dep-key deprecated)
(define-key keymap dep-key
`(lambda ()
,(format "Deprecated binding for %s, use \\[%s] instead." def def)
(interactive)
(call-interactively ',def)
(message "[Deprecated use of key %s; use key %s instead]"
(key-description (this-command-keys))
(key-description ,key))))))
;; Key bindings.
(when deprecated
(let* ((command-name (symbol-name def))
(forwarder-function-name
(if (string-match "^rst-\\(.*\\)$" command-name)
(concat "rst-deprecated-"
(match-string 1 command-name))
(error "not an RST command: %s" command-name)))
(forwarder-function (intern forwarder-function-name)))
(unless (fboundp forwarder-function)
(defalias forwarder-function
(lexical-let ((key key) (def def))
(lambda ()
(interactive)
(call-interactively def)
(message "[Deprecated use of key %s; use key %s instead]"
(key-description (this-command-keys))
(key-description key))))
(format "Deprecated binding for %s, use \\[%s] instead."
def def)))
(dolist (dep-key deprecated)
(define-key keymap dep-key forwarder-function)))))
;; Key bindings.
(defvar rst-mode-map
(let ((map (make-sparse-keymap)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment