comparison lisp/windmove.el @ 45166:8de5fa67b6cb

(windmove-default-keybindings): Add optional parameter to allow using a modifier other than 'shift.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 07 May 2002 16:37:01 +0000
parents 62d7faafb853
children 26d468be5b3c d7ddb3e565de
comparison
equal deleted inserted replaced
45165:036035c23b67 45166:8de5fa67b6cb
96 96
97 ;; Installation: 97 ;; Installation:
98 ;; 98 ;;
99 ;; Put the following line in your `.emacs' file: 99 ;; Put the following line in your `.emacs' file:
100 ;; 100 ;;
101 ;; (windmove-default-keybindings) ; default keybindings 101 ;; (windmove-default-keybindings) ; shifted arrow keys
102 ;;
103 ;; or
104 ;;
105 ;; (windmove-default-keybindings 'hyper) ; etc.
106 ;;
107 ;; to use another modifier key.
102 ;; 108 ;;
103 ;; 109 ;;
104 ;; If you wish to enable wrap-around, also add a line like: 110 ;; If you wish to enable wrap-around, also add a line like:
105 ;; 111 ;;
106 ;; (setq windmove-wrap-around t) 112 ;; (setq windmove-wrap-around t)
108 ;; 114 ;;
109 ;; Note: If you have an Emacs that manifests a bug that sometimes 115 ;; Note: If you have an Emacs that manifests a bug that sometimes
110 ;; causes the occasional creation of a "lost column" between windows, 116 ;; causes the occasional creation of a "lost column" between windows,
111 ;; so that two adjacent windows do not actually touch, you may want to 117 ;; so that two adjacent windows do not actually touch, you may want to
112 ;; increase the value of `windmove-window-distance-delta' to 2 or 3: 118 ;; increase the value of `windmove-window-distance-delta' to 2 or 3:
113 ;; 119 ;;
114 ;; (setq windmove-window-distance-delta 2) 120 ;; (setq windmove-window-distance-delta 2)
115 ;; 121 ;;
116 122
117 ;; Acknowledgements: 123 ;; Acknowledgements:
118 ;; 124 ;;
587 ;; (stephen@cns.ed.ac.uk). 593 ;; (stephen@cns.ed.ac.uk).
588 ;; I don't think these bindings will work on non-X terminals; you 594 ;; I don't think these bindings will work on non-X terminals; you
589 ;; probably want to use different bindings in that case. 595 ;; probably want to use different bindings in that case.
590 596
591 ;;;###autoload 597 ;;;###autoload
592 (defun windmove-default-keybindings () 598 (defun windmove-default-keybindings (&optional modifier)
593 "Set up default keybindings for `windmove'." 599 "Set up keybindings for `windmove'.
600 Keybindings are of the form MODIFIER-{left,right,up,down}.
601 Default MODIFIER is 'shift."
594 (interactive) 602 (interactive)
595 (global-set-key [(shift left)] 'windmove-left) 603 (unless modifier (setq modifier 'shift))
596 (global-set-key [(shift up)] 'windmove-up) 604 (global-set-key (vector (list modifier 'left)) 'windmove-left)
597 (global-set-key [(shift right)] 'windmove-right) 605 (global-set-key (vector (list modifier 'right)) 'windmove-right)
598 (global-set-key [(shift down)] 'windmove-down)) 606 (global-set-key (vector (list modifier 'up)) 'windmove-up)
607 (global-set-key (vector (list modifier 'down)) 'windmove-down))
599 608
600 609
601 (provide 'windmove) 610 (provide 'windmove)
602 611
603 ;;; windmove.el ends here 612 ;;; windmove.el ends here