diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-12-16 03:14:31 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-12-16 03:14:31 +0100 |
commit | ab33404c65a5bcafa1a1de4816cd5f5b778a9d70 (patch) | |
tree | 90935b66502fa4631c14be6befbb9349ea9deca2 /lisp/ses.el | |
parent | 2893cb6a21af3384cf5d6dc2b6bbdd5ebba8e1ad (diff) | |
download | emacs-ab33404c65a5bcafa1a1de4816cd5f5b778a9d70.tar.gz emacs-ab33404c65a5bcafa1a1de4816cd5f5b778a9d70.tar.bz2 emacs-ab33404c65a5bcafa1a1de4816cd5f5b778a9d70.zip |
Prefer command remapping in ses.el
* lisp/ses.el (ses-mode-print-map): Use command remapping instead of
substitute-key-definition.
Diffstat (limited to 'lisp/ses.el')
-rw-r--r-- | lisp/ses.el | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lisp/ses.el b/lisp/ses.el index 5e2d254881b..8496aeec8e8 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -227,12 +227,6 @@ Used for listing local printers or renamed cells.") "w" ses-set-column-width "x" ses-export-keymap "\M-p" ses-read-column-printer)) - (repl '(;;We'll replace these wherever they appear in the keymap - clipboard-kill-region ses-kill-override - end-of-line ses-end-of-line - kill-line ses-delete-row - kill-region ses-kill-override - open-line ses-insert-row)) (numeric "0123456789.-") (newmap (make-keymap))) ;;Get rid of printables @@ -240,13 +234,11 @@ Used for listing local printers or renamed cells.") ;;These keys insert themselves as the beginning of a numeric value (dotimes (x (length numeric)) (define-key newmap (substring numeric x (1+ x)) 'ses-read-cell)) - ;;Override these global functions wherever they're bound - (while repl - (substitute-key-definition (car repl) (cadr repl) newmap - (current-global-map)) - (setq repl (cddr repl))) - ;;Apparently substitute-key-definition doesn't catch this? - (define-key newmap [(menu-bar) edit cut] 'ses-kill-override) + (define-key newmap [remap clipboard-kill-region] #'ses-kill-override) + (define-key newmap [remap end-of-line] #'ses-end-of-line) + (define-key newmap [remap kill-line] #'ses-delete-row) + (define-key newmap [remap kill-region] #'ses-kill-override) + (define-key newmap [remap open-line] #'ses-insert-row) ;;Define our other local keys (while keys (define-key newmap (car keys) (cadr keys)) |