]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer command remapping in cperl-mode.el
authorStefan Kangas <stefan@marxist.se>
Tue, 14 Dec 2021 03:41:45 +0000 (04:41 +0100)
committerStefan Kangas <stefan@marxist.se>
Tue, 14 Dec 2021 11:27:54 +0000 (12:27 +0100)
* lisp/progmodes/cperl-mode.el (cperl-mode-map): Use command remapping
instead of substitute-key-definition.

lisp/progmodes/cperl-mode.el

index a23505a9d3b5bffe0994f64d34f23106975c2240..fe9612a09a95630e1445bebc1fc9e1deeb9ef1bc 100644 (file)
@@ -1019,15 +1019,9 @@ Unless KEEP, removes the old indentation."
       (define-key map [(control ?c) (control ?h) ?v]
        ;;(concat (char-to-string help-char) "v") ; does not work
        'cperl-get-help))
-    (substitute-key-definition
-     'indent-sexp 'cperl-indent-exp
-     map global-map)
-    (substitute-key-definition
-     'indent-region 'cperl-indent-region
-     map global-map)
-    (substitute-key-definition
-     'indent-for-comment 'cperl-indent-for-comment
-     map global-map)
+    (define-key map [remap indent-sexp]        #'cperl-indent-exp)
+    (define-key map [remap indent-region]      #'cperl-indent-region)
+    (define-key map [remap indent-for-comment] #'cperl-indent-for-comment)
     map)
   "Keymap used in CPerl mode.")