diff options
author | Case Duckworth | 2021-08-25 23:07:06 -0500 |
---|---|---|
committer | Case Duckworth | 2021-08-25 23:07:06 -0500 |
commit | b584c1bccf1cbf4556dc711f47b90fb9c8c7b599 (patch) | |
tree | 498a91c2c506e56e185ad7a3a8034d15cd73c64b | |
parent | Fix typo bug when visiting non-file buffer (diff) | |
download | emacs-b584c1bccf1cbf4556dc711f47b90fb9c8c7b599.tar.gz emacs-b584c1bccf1cbf4556dc711f47b90fb9c8c7b599.zip |
Add repeat maps to acdw-compat.el
-rw-r--r-- | lisp/acdw-compat.el | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/lisp/acdw-compat.el b/lisp/acdw-compat.el index 2ce8898..17df856 100644 --- a/lisp/acdw-compat.el +++ b/lisp/acdw-compat.el | |||
@@ -439,6 +439,128 @@ When Repeat mode is enabled, and the command symbol has the property named | |||
439 | (princ (format-message " `%s'\n" command))) | 439 | (princ (format-message " `%s'\n" command))) |
440 | (princ "\n")))))) | 440 | (princ "\n")))))) |
441 | 441 | ||
442 | ;;; Bindings! | ||
443 | (safe-defvar undo-repeat-map | ||
444 | (let ((map (make-sparse-keymap))) | ||
445 | (define-key map "u" 'undo) | ||
446 | map) | ||
447 | "Keymap to repeat undo key sequences `C-x u u'. Used in `repeat-mode'.") | ||
448 | (put 'undo 'repeat-map 'undo-repeat-map) | ||
449 | |||
450 | |||
451 | (safe-defvar next-error-repeat-map | ||
452 | (let ((map (make-sparse-keymap))) | ||
453 | (define-key map "n" 'next-error) | ||
454 | (define-key map "\M-n" 'next-error) | ||
455 | (define-key map "p" 'previous-error) | ||
456 | (define-key map "\M-p" 'previous-error) | ||
457 | map) | ||
458 | "Keymap to repeat next-error key sequences. Used in `repeat-mode'.") | ||
459 | (put 'next-error 'repeat-map 'next-error-repeat-map) | ||
460 | (put 'previous-error 'repeat-map 'next-error-repeat-map) | ||
461 | |||
462 | |||
463 | (safe-defvar page-navigation-repeat-map | ||
464 | (let ((map (make-sparse-keymap))) | ||
465 | (define-key map "]" #'forward-page) | ||
466 | (define-key map "[" #'backward-page) | ||
467 | map) | ||
468 | "Keymap to repeat page navigation key sequences. Used in `repeat-mode'.") | ||
469 | |||
470 | (put 'forward-page 'repeat-map 'page-navigation-repeat-map) | ||
471 | (put 'backward-page 'repeat-map 'page-navigation-repeat-map) | ||
472 | |||
473 | |||
474 | (safe-defvar tab-bar-switch-repeat-map | ||
475 | (let ((map (make-sparse-keymap))) | ||
476 | (define-key map "o" 'tab-next) | ||
477 | (define-key map "O" 'tab-previous) | ||
478 | map) | ||
479 | "Keymap to repeat tab switch key sequences `C-x t o o O'. | ||
480 | Used in `repeat-mode'.") | ||
481 | (put 'tab-next 'repeat-map 'tab-bar-switch-repeat-map) | ||
482 | (put 'tab-previous 'repeat-map 'tab-bar-switch-repeat-map) | ||
483 | |||
484 | (safe-defvar tab-bar-move-repeat-map | ||
485 | (let ((map (make-sparse-keymap))) | ||
486 | (define-key map "m" 'tab-move) | ||
487 | (define-key map "M" (lambda () | ||
488 | (interactive) | ||
489 | (setq repeat-map 'tab-bar-move-repeat-map) | ||
490 | (tab-move -1))) | ||
491 | map) | ||
492 | "Keymap to repeat tab move key sequences `C-x t m m M'. | ||
493 | Used in `repeat-mode'.") | ||
494 | (put 'tab-move 'repeat-map 'tab-bar-move-repeat-map) | ||
495 | |||
496 | |||
497 | (safe-defvar other-window-repeat-map | ||
498 | (let ((map (make-sparse-keymap))) | ||
499 | (define-key map "o" 'other-window) | ||
500 | (define-key map "O" (lambda () | ||
501 | (interactive) | ||
502 | (setq repeat-map 'other-window-repeat-map) | ||
503 | (other-window -1))) | ||
504 | map) | ||
505 | "Keymap to repeat other-window key sequences. Used in `repeat-mode'.") | ||
506 | (put 'other-window 'repeat-map 'other-window-repeat-map) | ||
507 | |||
508 | (safe-defvar resize-window-repeat-map | ||
509 | (let ((map (make-sparse-keymap))) | ||
510 | ;; Standard keys: | ||
511 | (define-key map "^" 'enlarge-window) | ||
512 | (define-key map "}" 'enlarge-window-horizontally) | ||
513 | (define-key map "{" 'shrink-window-horizontally) | ||
514 | ;; Additional keys: | ||
515 | (define-key map "v" 'shrink-window) | ||
516 | map) | ||
517 | "Keymap to repeat window resizing commands. Used in `repeat-mode'.") | ||
518 | (put 'enlarge-window 'repeat-map 'resize-window-repeat-map) | ||
519 | (put 'enlarge-window-horizontally 'repeat-map 'resize-window-repeat-map) | ||
520 | (put 'shrink-window-horizontally 'repeat-map 'resize-window-repeat-map) | ||
521 | (put 'shrink-window 'repeat-map 'resize-window-repeat-map) | ||
522 | |||
523 | |||
524 | (with-eval-after-load 'outline | ||
525 | (safe-defvar outline-navigation-repeat-map | ||
526 | (let ((map (make-sparse-keymap))) | ||
527 | (define-key map (kbd "C-b") #'outline-backward-same-level) | ||
528 | (define-key map (kbd "b") #'outline-backward-same-level) | ||
529 | (define-key map (kbd "C-f") #'outline-forward-same-level) | ||
530 | (define-key map (kbd "f") #'outline-forward-same-level) | ||
531 | (define-key map (kbd "C-n") #'outline-next-visible-heading) | ||
532 | (define-key map (kbd "n") #'outline-next-visible-heading) | ||
533 | (define-key map (kbd "C-p") #'outline-previous-visible-heading) | ||
534 | (define-key map (kbd "p") #'outline-previous-visible-heading) | ||
535 | (define-key map (kbd "C-u") #'outline-up-heading) | ||
536 | (define-key map (kbd "u") #'outline-up-heading) | ||
537 | map)) | ||
538 | |||
539 | (dolist (command '(outline-backward-same-level | ||
540 | outline-forward-same-level | ||
541 | outline-next-visible-heading | ||
542 | outline-previous-visible-heading | ||
543 | outline-up-heading)) | ||
544 | (put command 'repeat-map 'outline-navigation-repeat-map)) | ||
545 | |||
546 | (safe-defvar outline-editing-repeat-map | ||
547 | (let ((map (make-sparse-keymap))) | ||
548 | (define-key map (kbd "C-v") #'outline-move-subtree-down) | ||
549 | (define-key map (kbd "v") #'outline-move-subtree-down) | ||
550 | (define-key map (kbd "C-^") #'outline-move-subtree-up) | ||
551 | (define-key map (kbd "^") #'outline-move-subtree-up) | ||
552 | (define-key map (kbd "C->") #'outline-demote) | ||
553 | (define-key map (kbd ">") #'outline-demote) | ||
554 | (define-key map (kbd "C-<") #'outline-promote) | ||
555 | (define-key map (kbd "<") #'outline-promote) | ||
556 | map)) | ||
557 | |||
558 | (dolist (command '(outline-move-subtree-down | ||
559 | outline-move-subtree-up | ||
560 | outline-demote | ||
561 | outline-promote)) | ||
562 | (put command 'repeat-map 'outline-editing-repeat-map)) | ||
563 | ) | ||
442 | 564 | ||
443 | (provide 'acdw-compat) | 565 | (provide 'acdw-compat) |
444 | ;;; acdw-compat.el ends here | 566 | ;;; acdw-compat.el ends here |