diff options
| author | Gerd Moellmann | 2000-01-31 21:38:34 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-01-31 21:38:34 +0000 |
| commit | 2cb750ba4459177e81165e2e7a299ec12faf42e2 (patch) | |
| tree | 6d6d7fc3e3f63e54bec33b301e3a11cdc458c03c | |
| parent | d1ed8492aceb305c8b0666040af55ce6118bd528 (diff) | |
| download | emacs-2cb750ba4459177e81165e2e7a299ec12faf42e2.tar.gz emacs-2cb750ba4459177e81165e2e7a299ec12faf42e2.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/loaddefs.el | 253 | ||||
| -rw-r--r-- | lisp/windmove.el | 604 | ||||
| -rw-r--r-- | src/ChangeLog | 2 |
4 files changed, 812 insertions, 57 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d8679d6897..b18b3dba4b5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,10 +1,18 @@ | |||
| 1 | 2000-01-31 Inge Frick <inge@nada.kth.se> | ||
| 2 | |||
| 3 | * view.el: Some changes in documentation. Removed some trailing | ||
| 4 | whitespace. Changed some parameter names to agree with | ||
| 5 | documentation. | ||
| 6 | (view-mode-exit): Keep entry in `view-return-to-alist' only when a | ||
| 7 | window is not deleted. Modifies change 1998-04-26. | ||
| 8 | |||
| 1 | 2000-01-31 Gerd Moellmann <gerd@gnu.org> | 9 | 2000-01-31 Gerd Moellmann <gerd@gnu.org> |
| 2 | 10 | ||
| 3 | * windmove.el: New file. | 11 | * windmove.el: New file. |
| 4 | 12 | ||
| 5 | * progmodes/ebnf2ps.el, progmodes/ebnf-bnf.el, | 13 | * progmodes/ebnf2ps.el, progmodes/ebnf-bnf.el, |
| 6 | progmodes/ebnf-iso.el, progmodes/ebnf-otz.el, | 14 | progmodes/ebnf-iso.el, progmodes/ebnf-otz.el, |
| 7 | progmodes/ebnf-yac.el: Update copyright. | 15 | progmodes/ebnf-yac.el: Update copyright and license info. |
| 8 | 16 | ||
| 9 | * jit-lock.el (jit-lock-function): Widen before calculating end | 17 | * jit-lock.el (jit-lock-function): Widen before calculating end |
| 10 | position. | 18 | position. |
diff --git a/lisp/loaddefs.el b/lisp/loaddefs.el index 360aa326336..b72edd58720 100644 --- a/lisp/loaddefs.el +++ b/lisp/loaddefs.el | |||
| @@ -381,7 +381,7 @@ Remove any highlighting that was added by `align-highlight-rule'." t nil) | |||
| 381 | ;;;*** | 381 | ;;;*** |
| 382 | 382 | ||
| 383 | ;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp" | 383 | ;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp" |
| 384 | ;;;;;; "ange-ftp.el" (14460 38616)) | 384 | ;;;;;; "ange-ftp.el" (14481 51915)) |
| 385 | ;;; Generated autoloads from ange-ftp.el | 385 | ;;; Generated autoloads from ange-ftp.el |
| 386 | (defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir) | 386 | (defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir) |
| 387 | 387 | ||
| @@ -1280,7 +1280,7 @@ corresponding bookmark function from Lisp (the one without the | |||
| 1280 | ;;;;;; browse-url-of-buffer browse-url-of-file browse-url-generic-program | 1280 | ;;;;;; browse-url-of-buffer browse-url-of-file browse-url-generic-program |
| 1281 | ;;;;;; browse-url-save-file browse-url-netscape-display browse-url-new-window-p | 1281 | ;;;;;; browse-url-save-file browse-url-netscape-display browse-url-new-window-p |
| 1282 | ;;;;;; browse-url-browser-function) "browse-url" "browse-url.el" | 1282 | ;;;;;; browse-url-browser-function) "browse-url" "browse-url.el" |
| 1283 | ;;;;;; (14454 73)) | 1283 | ;;;;;; (14477 53252)) |
| 1284 | ;;; Generated autoloads from browse-url.el | 1284 | ;;; Generated autoloads from browse-url.el |
| 1285 | 1285 | ||
| 1286 | (defvar browse-url-browser-function (if (eq system-type (quote windows-nt)) (quote browse-url-default-windows-browser) (quote browse-url-netscape)) "\ | 1286 | (defvar browse-url-browser-function (if (eq system-type (quote windows-nt)) (quote browse-url-default-windows-browser) (quote browse-url-netscape)) "\ |
| @@ -2308,7 +2308,7 @@ The return value is a vector of resulting CCL registers." nil nil) | |||
| 2308 | ;;;;;; checkdoc-continue checkdoc-start checkdoc-current-buffer | 2308 | ;;;;;; checkdoc-continue checkdoc-start checkdoc-current-buffer |
| 2309 | ;;;;;; checkdoc-eval-current-buffer checkdoc-message-interactive | 2309 | ;;;;;; checkdoc-eval-current-buffer checkdoc-message-interactive |
| 2310 | ;;;;;; checkdoc-interactive checkdoc) "checkdoc" "emacs-lisp/checkdoc.el" | 2310 | ;;;;;; checkdoc-interactive checkdoc) "checkdoc" "emacs-lisp/checkdoc.el" |
| 2311 | ;;;;;; (14456 31049)) | 2311 | ;;;;;; (14482 54417)) |
| 2312 | ;;; Generated autoloads from emacs-lisp/checkdoc.el | 2312 | ;;; Generated autoloads from emacs-lisp/checkdoc.el |
| 2313 | 2313 | ||
| 2314 | (autoload (quote checkdoc) "checkdoc" "\ | 2314 | (autoload (quote checkdoc) "checkdoc" "\ |
| @@ -2505,7 +2505,7 @@ and runs the normal hook `command-history-hook'." t nil) | |||
| 2505 | 2505 | ||
| 2506 | ;;;*** | 2506 | ;;;*** |
| 2507 | 2507 | ||
| 2508 | ;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (14432 37868)) | 2508 | ;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (14482 54434)) |
| 2509 | ;;; Generated autoloads from emacs-lisp/cl.el | 2509 | ;;; Generated autoloads from emacs-lisp/cl.el |
| 2510 | 2510 | ||
| 2511 | (defvar custom-print-functions nil "\ | 2511 | (defvar custom-print-functions nil "\ |
| @@ -3062,7 +3062,7 @@ Randomly permute the elements of VECTOR (all permutations equally likely)" nil n | |||
| 3062 | ;;;*** | 3062 | ;;;*** |
| 3063 | 3063 | ||
| 3064 | ;;;### (autoloads (copyright copyright-update) "copyright" "emacs-lisp/copyright.el" | 3064 | ;;;### (autoloads (copyright copyright-update) "copyright" "emacs-lisp/copyright.el" |
| 3065 | ;;;;;; (14454 138)) | 3065 | ;;;;;; (14463 42213)) |
| 3066 | ;;; Generated autoloads from emacs-lisp/copyright.el | 3066 | ;;; Generated autoloads from emacs-lisp/copyright.el |
| 3067 | 3067 | ||
| 3068 | (autoload (quote copyright-update) "copyright" "\ | 3068 | (autoload (quote copyright-update) "copyright" "\ |
| @@ -4692,6 +4692,120 @@ to implement dynamic menus." nil nil) | |||
| 4692 | 4692 | ||
| 4693 | ;;;*** | 4693 | ;;;*** |
| 4694 | 4694 | ||
| 4695 | ;;;### (autoloads (ebnf-pop-style ebnf-push-style ebnf-reset-style | ||
| 4696 | ;;;;;; ebnf-apply-style ebnf-merge-style ebnf-insert-style ebnf-setup | ||
| 4697 | ;;;;;; ebnf-syntax-region ebnf-syntax-buffer ebnf-eps-region ebnf-eps-buffer | ||
| 4698 | ;;;;;; ebnf-spool-region ebnf-spool-buffer ebnf-print-region ebnf-print-buffer | ||
| 4699 | ;;;;;; ebnf-customize) "ebnf2ps" "progmodes/ebnf2ps.el" (14485 59667)) | ||
| 4700 | ;;; Generated autoloads from progmodes/ebnf2ps.el | ||
| 4701 | |||
| 4702 | (autoload (quote ebnf-customize) "ebnf2ps" "\ | ||
| 4703 | Customization for ebnf group." t nil) | ||
| 4704 | |||
| 4705 | (autoload (quote ebnf-print-buffer) "ebnf2ps" "\ | ||
| 4706 | Generate and print a PostScript syntatic chart image of the buffer. | ||
| 4707 | |||
| 4708 | When called with a numeric prefix argument (C-u), prompts the user for | ||
| 4709 | the name of a file to save the PostScript image in, instead of sending | ||
| 4710 | it to the printer. | ||
| 4711 | |||
| 4712 | More specifically, the FILENAME argument is treated as follows: if it | ||
| 4713 | is nil, send the image to the printer. If FILENAME is a string, save | ||
| 4714 | the PostScript image in a file with that name. If FILENAME is a | ||
| 4715 | number, prompt the user for the name of the file to save in." t nil) | ||
| 4716 | |||
| 4717 | (autoload (quote ebnf-print-region) "ebnf2ps" "\ | ||
| 4718 | Generate and print a PostScript syntatic chart image of the region. | ||
| 4719 | Like `ebnf-print-buffer', but prints just the current region." t nil) | ||
| 4720 | |||
| 4721 | (autoload (quote ebnf-spool-buffer) "ebnf2ps" "\ | ||
| 4722 | Generate and spool a PostScript syntatic chart image of the buffer. | ||
| 4723 | Like `ebnf-print-buffer' except that the PostScript image is saved in a | ||
| 4724 | local buffer to be sent to the printer later. | ||
| 4725 | |||
| 4726 | Use the command `ebnf-despool' to send the spooled images to the printer." t nil) | ||
| 4727 | |||
| 4728 | (autoload (quote ebnf-spool-region) "ebnf2ps" "\ | ||
| 4729 | Generate a PostScript syntatic chart image of the region and spool locally. | ||
| 4730 | Like `ebnf-spool-buffer', but spools just the current region. | ||
| 4731 | |||
| 4732 | Use the command `ebnf-despool' to send the spooled images to the printer." t nil) | ||
| 4733 | |||
| 4734 | (autoload (quote ebnf-eps-buffer) "ebnf2ps" "\ | ||
| 4735 | Generate a PostScript syntatic chart image of the buffer in a EPS file. | ||
| 4736 | |||
| 4737 | Indeed, for each production is generated a EPS file. | ||
| 4738 | The EPS file name has the following form: | ||
| 4739 | |||
| 4740 | <PREFIX><PRODUCTION>.eps | ||
| 4741 | |||
| 4742 | <PREFIX> is given by variable `ebnf-eps-prefix'. | ||
| 4743 | The default value is \"ebnf--\". | ||
| 4744 | |||
| 4745 | <PRODUCTION> is the production name. | ||
| 4746 | The production name is mapped to form a valid file name. | ||
| 4747 | For example, the production name \"A/B + C\" is mapped to | ||
| 4748 | \"A_B_+_C\" and the EPS file name used is \"ebnf--A_B_+_C.eps\". | ||
| 4749 | |||
| 4750 | WARNING: It's *NOT* asked any confirmation to override an existing file." t nil) | ||
| 4751 | |||
| 4752 | (autoload (quote ebnf-eps-region) "ebnf2ps" "\ | ||
| 4753 | Generate a PostScript syntatic chart image of the region in a EPS file. | ||
| 4754 | |||
| 4755 | Indeed, for each production is generated a EPS file. | ||
| 4756 | The EPS file name has the following form: | ||
| 4757 | |||
| 4758 | <PREFIX><PRODUCTION>.eps | ||
| 4759 | |||
| 4760 | <PREFIX> is given by variable `ebnf-eps-prefix'. | ||
| 4761 | The default value is \"ebnf--\". | ||
| 4762 | |||
| 4763 | <PRODUCTION> is the production name. | ||
| 4764 | The production name is mapped to form a valid file name. | ||
| 4765 | For example, the production name \"A/B + C\" is mapped to | ||
| 4766 | \"A_B_+_C\" and the EPS file name used is \"ebnf--A_B_+_C.eps\". | ||
| 4767 | |||
| 4768 | WARNING: It's *NOT* asked any confirmation to override an existing file." t nil) | ||
| 4769 | |||
| 4770 | (defalias (quote ebnf-despool) (quote ps-despool)) | ||
| 4771 | |||
| 4772 | (autoload (quote ebnf-syntax-buffer) "ebnf2ps" "\ | ||
| 4773 | Does a syntatic analysis of the current buffer." t nil) | ||
| 4774 | |||
| 4775 | (autoload (quote ebnf-syntax-region) "ebnf2ps" "\ | ||
| 4776 | Does a syntatic analysis of a region." t nil) | ||
| 4777 | |||
| 4778 | (autoload (quote ebnf-setup) "ebnf2ps" "\ | ||
| 4779 | Return the current ebnf2ps setup." nil nil) | ||
| 4780 | |||
| 4781 | (autoload (quote ebnf-insert-style) "ebnf2ps" "\ | ||
| 4782 | Insert a new style NAME with inheritance INHERITS and values VALUES." t nil) | ||
| 4783 | |||
| 4784 | (autoload (quote ebnf-merge-style) "ebnf2ps" "\ | ||
| 4785 | Merge values of style NAME with style VALUES." t nil) | ||
| 4786 | |||
| 4787 | (autoload (quote ebnf-apply-style) "ebnf2ps" "\ | ||
| 4788 | Set STYLE to current style. | ||
| 4789 | |||
| 4790 | It returns the old style symbol." t nil) | ||
| 4791 | |||
| 4792 | (autoload (quote ebnf-reset-style) "ebnf2ps" "\ | ||
| 4793 | Reset current style. | ||
| 4794 | |||
| 4795 | It returns the old style symbol." t nil) | ||
| 4796 | |||
| 4797 | (autoload (quote ebnf-push-style) "ebnf2ps" "\ | ||
| 4798 | Push the current style and set STYLE to current style. | ||
| 4799 | |||
| 4800 | It returns the old style symbol." t nil) | ||
| 4801 | |||
| 4802 | (autoload (quote ebnf-pop-style) "ebnf2ps" "\ | ||
| 4803 | Pop a style and set it to current style. | ||
| 4804 | |||
| 4805 | It returns the old style symbol." t nil) | ||
| 4806 | |||
| 4807 | ;;;*** | ||
| 4808 | |||
| 4695 | ;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el" | 4809 | ;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el" |
| 4696 | ;;;;;; (13778 5499)) | 4810 | ;;;;;; (13778 5499)) |
| 4697 | ;;; Generated autoloads from ebuff-menu.el | 4811 | ;;; Generated autoloads from ebuff-menu.el |
| @@ -4726,7 +4840,7 @@ With prefix arg NOCONFIRM, execute current line as-is without editing." t nil) | |||
| 4726 | ;;;*** | 4840 | ;;;*** |
| 4727 | 4841 | ||
| 4728 | ;;;### (autoloads (edebug-eval-top-level-form def-edebug-spec edebug-all-forms | 4842 | ;;;### (autoloads (edebug-eval-top-level-form def-edebug-spec edebug-all-forms |
| 4729 | ;;;;;; edebug-all-defs) "edebug" "emacs-lisp/edebug.el" (14460 38617)) | 4843 | ;;;;;; edebug-all-defs) "edebug" "emacs-lisp/edebug.el" (14482 54435)) |
| 4730 | ;;; Generated autoloads from emacs-lisp/edebug.el | 4844 | ;;; Generated autoloads from emacs-lisp/edebug.el |
| 4731 | 4845 | ||
| 4732 | (defvar edebug-all-defs nil "\ | 4846 | (defvar edebug-all-defs nil "\ |
| @@ -5867,7 +5981,7 @@ with no args, if that value is non-nil." t nil) | |||
| 5867 | ;;;;;; facemenu-remove-special facemenu-remove-all facemenu-remove-face-props | 5981 | ;;;;;; facemenu-remove-special facemenu-remove-all facemenu-remove-face-props |
| 5868 | ;;;;;; facemenu-set-read-only facemenu-set-intangible facemenu-set-invisible | 5982 | ;;;;;; facemenu-set-read-only facemenu-set-intangible facemenu-set-invisible |
| 5869 | ;;;;;; facemenu-set-face-from-menu facemenu-set-background facemenu-set-foreground | 5983 | ;;;;;; facemenu-set-face-from-menu facemenu-set-background facemenu-set-foreground |
| 5870 | ;;;;;; facemenu-set-face) "facemenu" "facemenu.el" (14412 8701)) | 5984 | ;;;;;; facemenu-set-face) "facemenu" "facemenu.el" (14482 54416)) |
| 5871 | ;;; Generated autoloads from facemenu.el | 5985 | ;;; Generated autoloads from facemenu.el |
| 5872 | (define-key global-map "\M-g" 'facemenu-keymap) | 5986 | (define-key global-map "\M-g" 'facemenu-keymap) |
| 5873 | (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap) | 5987 | (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap) |
| @@ -5887,17 +6001,17 @@ Menu keymap for background colors") | |||
| 5887 | 6001 | ||
| 5888 | (defalias (quote facemenu-background-menu) facemenu-background-menu) | 6002 | (defalias (quote facemenu-background-menu) facemenu-background-menu) |
| 5889 | 6003 | ||
| 5890 | (defvar facemenu-special-menu (let ((map (make-sparse-keymap "Special"))) (define-key map [115] (cons "Remove Special" (quote facemenu-remove-special))) (define-key map [116] (cons "Intangible" (quote facemenu-set-intangible))) (define-key map [118] (cons "Invisible" (quote facemenu-set-invisible))) (define-key map [114] (cons "Read-Only" (quote facemenu-set-read-only))) map) "\ | 6004 | (defvar facemenu-special-menu (let ((map (make-sparse-keymap "Special"))) (define-key map [115] (cons (purecopy "Remove Special") (quote facemenu-remove-special))) (define-key map [116] (cons (purecopy "Intangible") (quote facemenu-set-intangible))) (define-key map [118] (cons (purecopy "Invisible") (quote facemenu-set-invisible))) (define-key map [114] (cons (purecopy "Read-Only") (quote facemenu-set-read-only))) map) "\ |
| 5891 | Menu keymap for non-face text-properties.") | 6005 | Menu keymap for non-face text-properties.") |
| 5892 | 6006 | ||
| 5893 | (defalias (quote facemenu-special-menu) facemenu-special-menu) | 6007 | (defalias (quote facemenu-special-menu) facemenu-special-menu) |
| 5894 | 6008 | ||
| 5895 | (defvar facemenu-justification-menu (let ((map (make-sparse-keymap "Justification"))) (define-key map [99] (cons "Center" (quote set-justification-center))) (define-key map [98] (cons "Full" (quote set-justification-full))) (define-key map [114] (cons "Right" (quote set-justification-right))) (define-key map [108] (cons "Left" (quote set-justification-left))) (define-key map [117] (cons "Unfilled" (quote set-justification-none))) map) "\ | 6009 | (defvar facemenu-justification-menu (let ((map (make-sparse-keymap "Justification"))) (define-key map [99] (cons (purecopy "Center") (quote set-justification-center))) (define-key map [98] (cons (purecopy "Full") (quote set-justification-full))) (define-key map [114] (cons (purecopy "Right") (quote set-justification-right))) (define-key map [108] (cons (purecopy "Left") (quote set-justification-left))) (define-key map [117] (cons (purecopy "Unfilled") (quote set-justification-none))) map) "\ |
| 5896 | Submenu for text justification commands.") | 6010 | Submenu for text justification commands.") |
| 5897 | 6011 | ||
| 5898 | (defalias (quote facemenu-justification-menu) facemenu-justification-menu) | 6012 | (defalias (quote facemenu-justification-menu) facemenu-justification-menu) |
| 5899 | 6013 | ||
| 5900 | (defvar facemenu-indentation-menu (let ((map (make-sparse-keymap "Indentation"))) (define-key map [decrease-right-margin] (cons "Indent Right Less" (quote decrease-right-margin))) (define-key map [increase-right-margin] (cons "Indent Right More" (quote increase-right-margin))) (define-key map [decrease-left-margin] (cons "Indent Less" (quote decrease-left-margin))) (define-key map [increase-left-margin] (cons "Indent More" (quote increase-left-margin))) map) "\ | 6014 | (defvar facemenu-indentation-menu (let ((map (make-sparse-keymap "Indentation"))) (define-key map [decrease-right-margin] (cons (purecopy "Indent Right Less") (quote decrease-right-margin))) (define-key map [increase-right-margin] (cons (purecopy "Indent Right More") (quote increase-right-margin))) (define-key map [decrease-left-margin] (cons (purecopy "Indent Less") (quote decrease-left-margin))) (define-key map [increase-left-margin] (cons (purecopy "Indent More") (quote increase-left-margin))) map) "\ |
| 5901 | Submenu for indentation commands.") | 6015 | Submenu for indentation commands.") |
| 5902 | 6016 | ||
| 5903 | (defalias (quote facemenu-indentation-menu) facemenu-indentation-menu) | 6017 | (defalias (quote facemenu-indentation-menu) facemenu-indentation-menu) |
| @@ -5907,9 +6021,9 @@ Facemenu top-level menu keymap.") | |||
| 5907 | 6021 | ||
| 5908 | (setq facemenu-menu (make-sparse-keymap "Text Properties")) | 6022 | (setq facemenu-menu (make-sparse-keymap "Text Properties")) |
| 5909 | 6023 | ||
| 5910 | (let ((map facemenu-menu)) (define-key map [dc] (cons "Display Colors" (quote list-colors-display))) (define-key map [df] (cons "Display Faces" (quote list-faces-display))) (define-key map [dp] (cons "List Properties" (quote list-text-properties-at))) (define-key map [ra] (cons "Remove Text Properties" (quote facemenu-remove-all))) (define-key map [rm] (cons "Remove Face Properties" (quote facemenu-remove-face-props))) (define-key map [s1] (list "-----------------"))) | 6024 | (let ((map facemenu-menu)) (define-key map [dc] (cons (purecopy "Display Colors") (quote list-colors-display))) (define-key map [df] (cons (purecopy "Display Faces") (quote list-faces-display))) (define-key map [dp] (cons (purecopy "List Properties") (quote list-text-properties-at))) (define-key map [ra] (cons (purecopy "Remove Text Properties") (quote facemenu-remove-all))) (define-key map [rm] (cons (purecopy "Remove Face Properties") (quote facemenu-remove-face-props))) (define-key map [s1] (list (purecopy "--")))) |
| 5911 | 6025 | ||
| 5912 | (let ((map facemenu-menu)) (define-key map [in] (cons "Indentation" (quote facemenu-indentation-menu))) (define-key map [ju] (cons "Justification" (quote facemenu-justification-menu))) (define-key map [s2] (list "-----------------")) (define-key map [sp] (cons "Special Properties" (quote facemenu-special-menu))) (define-key map [bg] (cons "Background Color" (quote facemenu-background-menu))) (define-key map [fg] (cons "Foreground Color" (quote facemenu-foreground-menu))) (define-key map [fc] (cons "Face" (quote facemenu-face-menu)))) | 6026 | (let ((map facemenu-menu)) (define-key map [in] (cons (purecopy "Indentation") (quote facemenu-indentation-menu))) (define-key map [ju] (cons (purecopy "Justification") (quote facemenu-justification-menu))) (define-key map [s2] (list (purecopy "--"))) (define-key map [sp] (cons (purecopy "Special Properties") (quote facemenu-special-menu))) (define-key map [bg] (cons (purecopy "Background Color") (quote facemenu-background-menu))) (define-key map [fg] (cons (purecopy "Foreground Color") (quote facemenu-foreground-menu))) (define-key map [fc] (cons (purecopy "Face") (quote facemenu-face-menu)))) |
| 5913 | 6027 | ||
| 5914 | (defalias (quote facemenu-menu) facemenu-menu) | 6028 | (defalias (quote facemenu-menu) facemenu-menu) |
| 5915 | 6029 | ||
| @@ -5997,7 +6111,7 @@ of colors that the current display can handle." t nil) | |||
| 5997 | ;;;*** | 6111 | ;;;*** |
| 5998 | 6112 | ||
| 5999 | ;;;### (autoloads (turn-on-fast-lock fast-lock-mode) "fast-lock" | 6113 | ;;;### (autoloads (turn-on-fast-lock fast-lock-mode) "fast-lock" |
| 6000 | ;;;;;; "fast-lock.el" (14263 35417)) | 6114 | ;;;;;; "fast-lock.el" (14477 53252)) |
| 6001 | ;;; Generated autoloads from fast-lock.el | 6115 | ;;; Generated autoloads from fast-lock.el |
| 6002 | 6116 | ||
| 6003 | (autoload (quote fast-lock-mode) "fast-lock" "\ | 6117 | (autoload (quote fast-lock-mode) "fast-lock" "\ |
| @@ -6461,7 +6575,7 @@ in your `~/.emacs' file, replacing [f7] by your favourite key: | |||
| 6461 | ;;;### (autoloads (font-lock-fontify-buffer global-font-lock-mode | 6575 | ;;;### (autoloads (font-lock-fontify-buffer global-font-lock-mode |
| 6462 | ;;;;;; global-font-lock-mode font-lock-remove-keywords font-lock-add-keywords | 6576 | ;;;;;; global-font-lock-mode font-lock-remove-keywords font-lock-add-keywords |
| 6463 | ;;;;;; turn-on-font-lock font-lock-mode) "font-lock" "font-lock.el" | 6577 | ;;;;;; turn-on-font-lock font-lock-mode) "font-lock" "font-lock.el" |
| 6464 | ;;;;;; (14424 65029)) | 6578 | ;;;;;; (14477 53252)) |
| 6465 | ;;; Generated autoloads from font-lock.el | 6579 | ;;; Generated autoloads from font-lock.el |
| 6466 | 6580 | ||
| 6467 | (defvar font-lock-mode-hook nil "\ | 6581 | (defvar font-lock-mode-hook nil "\ |
| @@ -6652,7 +6766,7 @@ Visit a file in Forms mode in other window." t nil) | |||
| 6652 | ;;;*** | 6766 | ;;;*** |
| 6653 | 6767 | ||
| 6654 | ;;;### (autoloads (fortran-mode fortran-tab-mode-default) "fortran" | 6768 | ;;;### (autoloads (fortran-mode fortran-tab-mode-default) "fortran" |
| 6655 | ;;;;;; "progmodes/fortran.el" (14454 142)) | 6769 | ;;;;;; "progmodes/fortran.el" (14477 53257)) |
| 6656 | ;;; Generated autoloads from progmodes/fortran.el | 6770 | ;;; Generated autoloads from progmodes/fortran.el |
| 6657 | 6771 | ||
| 6658 | (defvar fortran-tab-mode-default nil "\ | 6772 | (defvar fortran-tab-mode-default nil "\ |
| @@ -6778,6 +6892,17 @@ Some generic modes are defined in `generic-x.el'." t nil) | |||
| 6778 | 6892 | ||
| 6779 | ;;;*** | 6893 | ;;;*** |
| 6780 | 6894 | ||
| 6895 | ;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el" | ||
| 6896 | ;;;;;; (14480 59906)) | ||
| 6897 | ;;; Generated autoloads from progmodes/glasses.el | ||
| 6898 | |||
| 6899 | (autoload (quote glasses-mode) "glasses" "\ | ||
| 6900 | Minor mode for making identifiers likeThis readable. | ||
| 6901 | When this mode is active, it tries to add virtual separators (like underscores) | ||
| 6902 | at places they belong to." t nil) | ||
| 6903 | |||
| 6904 | ;;;*** | ||
| 6905 | |||
| 6781 | ;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server | 6906 | ;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server |
| 6782 | ;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (14030 49411)) | 6907 | ;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (14030 49411)) |
| 6783 | ;;; Generated autoloads from gnus/gnus.el | 6908 | ;;; Generated autoloads from gnus/gnus.el |
| @@ -8001,7 +8126,7 @@ of `inferior-lisp-program'). Runs the hooks from | |||
| 8001 | 8126 | ||
| 8002 | ;;;### (autoloads (Info-speedbar-browser Info-goto-emacs-key-command-node | 8127 | ;;;### (autoloads (Info-speedbar-browser Info-goto-emacs-key-command-node |
| 8003 | ;;;;;; Info-goto-emacs-command-node info-standalone info info-other-window) | 8128 | ;;;;;; Info-goto-emacs-command-node info-standalone info info-other-window) |
| 8004 | ;;;;;; "info" "info.el" (14412 8715)) | 8129 | ;;;;;; "info" "info.el" (14485 39769)) |
| 8005 | ;;; Generated autoloads from info.el | 8130 | ;;; Generated autoloads from info.el |
| 8006 | 8131 | ||
| 8007 | (autoload (quote info-other-window) "info" "\ | 8132 | (autoload (quote info-other-window) "info" "\ |
| @@ -8470,7 +8595,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to | |||
| 8470 | 8595 | ||
| 8471 | ;;;### (autoloads (iswitchb-buffer-other-frame iswitchb-display-buffer | 8596 | ;;;### (autoloads (iswitchb-buffer-other-frame iswitchb-display-buffer |
| 8472 | ;;;;;; iswitchb-buffer-other-window iswitchb-buffer iswitchb-default-keybindings | 8597 | ;;;;;; iswitchb-buffer-other-window iswitchb-buffer iswitchb-default-keybindings |
| 8473 | ;;;;;; iswitchb-read-buffer) "iswitchb" "iswitchb.el" (14384 5061)) | 8598 | ;;;;;; iswitchb-read-buffer) "iswitchb" "iswitchb.el" (14482 55434)) |
| 8474 | ;;; Generated autoloads from iswitchb.el | 8599 | ;;; Generated autoloads from iswitchb.el |
| 8475 | 8600 | ||
| 8476 | (autoload (quote iswitchb-read-buffer) "iswitchb" "\ | 8601 | (autoload (quote iswitchb-read-buffer) "iswitchb" "\ |
| @@ -8575,7 +8700,7 @@ If non-nil, second arg INITIAL-INPUT is a string to insert before reading." nil | |||
| 8575 | ;;;*** | 8700 | ;;;*** |
| 8576 | 8701 | ||
| 8577 | ;;;### (autoloads (turn-on-jit-lock jit-lock-mode) "jit-lock" "jit-lock.el" | 8702 | ;;;### (autoloads (turn-on-jit-lock jit-lock-mode) "jit-lock" "jit-lock.el" |
| 8578 | ;;;;;; (14275 59802)) | 8703 | ;;;;;; (14485 51270)) |
| 8579 | ;;; Generated autoloads from jit-lock.el | 8704 | ;;; Generated autoloads from jit-lock.el |
| 8580 | 8705 | ||
| 8581 | (autoload (quote jit-lock-mode) "jit-lock" "\ | 8706 | (autoload (quote jit-lock-mode) "jit-lock" "\ |
| @@ -8755,7 +8880,7 @@ The return value is number of composed characters." nil nil) | |||
| 8755 | ;;;*** | 8880 | ;;;*** |
| 8756 | 8881 | ||
| 8757 | ;;;### (autoloads (turn-on-lazy-lock lazy-lock-mode) "lazy-lock" | 8882 | ;;;### (autoloads (turn-on-lazy-lock lazy-lock-mode) "lazy-lock" |
| 8758 | ;;;;;; "lazy-lock.el" (14263 35461)) | 8883 | ;;;;;; "lazy-lock.el" (14477 53252)) |
| 8759 | ;;; Generated autoloads from lazy-lock.el | 8884 | ;;; Generated autoloads from lazy-lock.el |
| 8760 | 8885 | ||
| 8761 | (autoload (quote lazy-lock-mode) "lazy-lock" "\ | 8886 | (autoload (quote lazy-lock-mode) "lazy-lock" "\ |
| @@ -9123,8 +9248,8 @@ This function normally would be called when the message is sent." nil nil) | |||
| 9123 | 9248 | ||
| 9124 | ;;;### (autoloads (mail-fetch-field mail-unquote-printable-region | 9249 | ;;;### (autoloads (mail-fetch-field mail-unquote-printable-region |
| 9125 | ;;;;;; mail-unquote-printable mail-quote-printable mail-file-babyl-p | 9250 | ;;;;;; mail-unquote-printable mail-quote-printable mail-file-babyl-p |
| 9126 | ;;;;;; mail-use-rfc822) "mail-utils" "mail/mail-utils.el" (14263 | 9251 | ;;;;;; mail-use-rfc822) "mail-utils" "mail/mail-utils.el" (14480 |
| 9127 | ;;;;;; 33297)) | 9252 | ;;;;;; 16128)) |
| 9128 | ;;; Generated autoloads from mail/mail-utils.el | 9253 | ;;; Generated autoloads from mail/mail-utils.el |
| 9129 | 9254 | ||
| 9130 | (defvar mail-use-rfc822 nil "\ | 9255 | (defvar mail-use-rfc822 nil "\ |
| @@ -10526,34 +10651,6 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'." t nil) | |||
| 10526 | 10651 | ||
| 10527 | ;;;*** | 10652 | ;;;*** |
| 10528 | 10653 | ||
| 10529 | ;;;### (autoloads (ph-query-form ph-expand-inline ph-get-phone ph-get-email) | ||
| 10530 | ;;;;;; "ph" "ph.el" (13623 48480)) | ||
| 10531 | ;;; Generated autoloads from ph.el | ||
| 10532 | |||
| 10533 | (autoload (quote ph-get-email) "ph" "\ | ||
| 10534 | Get the email field of NAME from the PH/QI directory server." t nil) | ||
| 10535 | |||
| 10536 | (autoload (quote ph-get-phone) "ph" "\ | ||
| 10537 | Get the phone field of NAME from the PH/QI directory server." t nil) | ||
| 10538 | |||
| 10539 | (autoload (quote ph-expand-inline) "ph" "\ | ||
| 10540 | Query the PH server, and expand the query string before point. | ||
| 10541 | The query string consists of the buffer substring from the point back to | ||
| 10542 | the preceding comma, colon or beginning of line. If it contains more than | ||
| 10543 | one word, the variable `ph-inline-query-format-list' controls to map these | ||
| 10544 | onto CCSO database field names. | ||
| 10545 | After querying the server for the given string, the expansion specified by | ||
| 10546 | `ph-inline-expansion-format' is inserted in the buffer at point. | ||
| 10547 | If REPLACE is t, then this expansion replaces the name in the buffer. | ||
| 10548 | If `ph-expanding-overwrites-query' is t, that inverts the meaning of REPLACE." t nil) | ||
| 10549 | |||
| 10550 | (autoload (quote ph-query-form) "ph" "\ | ||
| 10551 | Display a form to query the CCSO PH/QI nameserver. | ||
| 10552 | If given a non-nil argument the function first queries the server | ||
| 10553 | for the existing fields and displays a corresponding form." t nil) | ||
| 10554 | |||
| 10555 | ;;;*** | ||
| 10556 | |||
| 10557 | ;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el" | 10654 | ;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el" |
| 10558 | ;;;;;; (14348 33291)) | 10655 | ;;;;;; (14348 33291)) |
| 10559 | ;;; Generated autoloads from textmodes/picture.el | 10656 | ;;; Generated autoloads from textmodes/picture.el |
| @@ -12809,7 +12906,7 @@ Pick your favourite shortcuts: | |||
| 12809 | 12906 | ||
| 12810 | ;;;### (autoloads (reverse-region sort-columns sort-regexp-fields | 12907 | ;;;### (autoloads (reverse-region sort-columns sort-regexp-fields |
| 12811 | ;;;;;; sort-fields sort-numeric-fields sort-pages sort-paragraphs | 12908 | ;;;;;; sort-fields sort-numeric-fields sort-pages sort-paragraphs |
| 12812 | ;;;;;; sort-lines sort-subr) "sort" "sort.el" (13304 43541)) | 12909 | ;;;;;; sort-lines sort-subr) "sort" "sort.el" (14481 36636)) |
| 12813 | ;;; Generated autoloads from sort.el | 12910 | ;;; Generated autoloads from sort.el |
| 12814 | 12911 | ||
| 12815 | (autoload (quote sort-subr) "sort" "\ | 12912 | (autoload (quote sort-subr) "sort" "\ |
| @@ -12873,7 +12970,9 @@ the sort order." t nil) | |||
| 12873 | (autoload (quote sort-numeric-fields) "sort" "\ | 12970 | (autoload (quote sort-numeric-fields) "sort" "\ |
| 12874 | Sort lines in region numerically by the ARGth field of each line. | 12971 | Sort lines in region numerically by the ARGth field of each line. |
| 12875 | Fields are separated by whitespace and numbered from 1 up. | 12972 | Fields are separated by whitespace and numbered from 1 up. |
| 12876 | Specified field must contain a number in each line of the region. | 12973 | Specified field must contain a number in each line of the region, |
| 12974 | which may begin with \"0x\" or \"0\" for hexadecimal and octal values. | ||
| 12975 | Otherwise, the number is interpreted according to sort-numeric-base. | ||
| 12877 | With a negative arg, sorts by the ARGth field counted from the right. | 12976 | With a negative arg, sorts by the ARGth field counted from the right. |
| 12878 | Called from a program, there are three arguments: | 12977 | Called from a program, there are three arguments: |
| 12879 | FIELD, BEG and END. BEG and END specify region to sort." t nil) | 12978 | FIELD, BEG and END. BEG and END specify region to sort." t nil) |
| @@ -13798,7 +13897,7 @@ Info `g*' command is inadequate." t nil) | |||
| 13798 | ;;;### (autoloads (thai-composition-function thai-post-read-conversion | 13897 | ;;;### (autoloads (thai-composition-function thai-post-read-conversion |
| 13799 | ;;;;;; thai-compose-buffer thai-compose-string thai-compose-region | 13898 | ;;;;;; thai-compose-buffer thai-compose-string thai-compose-region |
| 13800 | ;;;;;; setup-thai-environment) "thai-util" "language/thai-util.el" | 13899 | ;;;;;; setup-thai-environment) "thai-util" "language/thai-util.el" |
| 13801 | ;;;;;; (14423 51008)) | 13900 | ;;;;;; (14477 53255)) |
| 13802 | ;;; Generated autoloads from language/thai-util.el | 13901 | ;;; Generated autoloads from language/thai-util.el |
| 13803 | 13902 | ||
| 13804 | (autoload (quote setup-thai-environment) "thai-util" "\ | 13903 | (autoload (quote setup-thai-environment) "thai-util" "\ |
| @@ -14062,7 +14161,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"." nil | |||
| 14062 | ;;;*** | 14161 | ;;;*** |
| 14063 | 14162 | ||
| 14064 | ;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm" | 14163 | ;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm" |
| 14065 | ;;;;;; "tmm.el" (14459 43081)) | 14164 | ;;;;;; "tmm.el" (14467 13719)) |
| 14066 | ;;; Generated autoloads from tmm.el | 14165 | ;;; Generated autoloads from tmm.el |
| 14067 | (define-key global-map "\M-`" 'tmm-menubar) | 14166 | (define-key global-map "\M-`" 'tmm-menubar) |
| 14068 | (define-key global-map [f10] 'tmm-menubar) | 14167 | (define-key global-map [f10] 'tmm-menubar) |
| @@ -14388,7 +14487,7 @@ which specify the range to operate on." t nil) | |||
| 14388 | ;;;*** | 14487 | ;;;*** |
| 14389 | 14488 | ||
| 14390 | ;;;### (autoloads (unforward-rmail-message undigestify-rmail-message) | 14489 | ;;;### (autoloads (unforward-rmail-message undigestify-rmail-message) |
| 14391 | ;;;;;; "undigest" "mail/undigest.el" (13475 35727)) | 14490 | ;;;;;; "undigest" "mail/undigest.el" (14473 58848)) |
| 14392 | ;;; Generated autoloads from mail/undigest.el | 14491 | ;;; Generated autoloads from mail/undigest.el |
| 14393 | 14492 | ||
| 14394 | (autoload (quote undigestify-rmail-message) "undigest" "\ | 14493 | (autoload (quote undigestify-rmail-message) "undigest" "\ |
| @@ -14448,8 +14547,8 @@ The buffer in question is current when this function is called." nil nil) | |||
| 14448 | ;;;;;; vc-create-snapshot vc-directory vc-resolve-conflicts vc-merge | 14547 | ;;;;;; vc-create-snapshot vc-directory vc-resolve-conflicts vc-merge |
| 14449 | ;;;;;; vc-insert-headers vc-version-other-window vc-diff vc-register | 14548 | ;;;;;; vc-insert-headers vc-version-other-window vc-diff vc-register |
| 14450 | ;;;;;; vc-next-action edit-vc-file with-vc-file vc-annotate-mode-hook | 14549 | ;;;;;; vc-next-action edit-vc-file with-vc-file vc-annotate-mode-hook |
| 14451 | ;;;;;; vc-before-checkin-hook vc-checkin-hook) "vc" "vc.el" (14460 | 14550 | ;;;;;; vc-before-checkin-hook vc-checkin-hook) "vc" "vc.el" (14478 |
| 14452 | ;;;;;; 19361)) | 14551 | ;;;;;; 52465)) |
| 14453 | ;;; Generated autoloads from vc.el | 14552 | ;;; Generated autoloads from vc.el |
| 14454 | 14553 | ||
| 14455 | (defvar vc-checkin-hook nil "\ | 14554 | (defvar vc-checkin-hook nil "\ |
| @@ -15327,6 +15426,48 @@ Delete WIDGET." nil nil) | |||
| 15327 | 15426 | ||
| 15328 | ;;;*** | 15427 | ;;;*** |
| 15329 | 15428 | ||
| 15429 | ;;;### (autoloads (windmove-default-keybindings windmove-down windmove-right | ||
| 15430 | ;;;;;; windmove-up windmove-left) "windmove" "windmove.el" (14485 | ||
| 15431 | ;;;;;; 64019)) | ||
| 15432 | ;;; Generated autoloads from windmove.el | ||
| 15433 | |||
| 15434 | (autoload (quote windmove-left) "windmove" "\ | ||
| 15435 | Select the window to the left of the current one. | ||
| 15436 | With no prefix argument, or with prefix argument equal to zero, | ||
| 15437 | \"left\" is relative to the position of point in the window; otherwise | ||
| 15438 | it is relative to the top edge (for positive ARG) or the bottom edge | ||
| 15439 | \(for negative ARG) of the current window. | ||
| 15440 | If no window is at the desired location, an error is signaled." t nil) | ||
| 15441 | |||
| 15442 | (autoload (quote windmove-up) "windmove" "\ | ||
| 15443 | Select the window above the current one. | ||
| 15444 | With no prefix argument, or with prefix argument equal to zero, \"up\" | ||
| 15445 | is relative to the position of point in the window; otherwise it is | ||
| 15446 | relative to the left edge (for positive ARG) or the right edge (for | ||
| 15447 | negative ARG) of the current window. | ||
| 15448 | If no window is at the desired location, an error is signaled." t nil) | ||
| 15449 | |||
| 15450 | (autoload (quote windmove-right) "windmove" "\ | ||
| 15451 | Select the window to the right of the current one. | ||
| 15452 | With no prefix argument, or with prefix argument equal to zero, | ||
| 15453 | \"right\" is relative to the position of point in the window; | ||
| 15454 | otherwise it is relative to the top edge (for positive ARG) or the | ||
| 15455 | bottom edge (for negative ARG) of the current window. | ||
| 15456 | If no window is at the desired location, an error is signaled." t nil) | ||
| 15457 | |||
| 15458 | (autoload (quote windmove-down) "windmove" "\ | ||
| 15459 | Select the window below the current one. | ||
| 15460 | With no prefix argument, or with prefix argument equal to zero, | ||
| 15461 | \"down\" is relative to the position of point in the window; otherwise | ||
| 15462 | it is relative to the left edge (for positive ARG) or the right edge | ||
| 15463 | \(for negative ARG) of the current window. | ||
| 15464 | If no window is at the desired location, an error is signaled." t nil) | ||
| 15465 | |||
| 15466 | (autoload (quote windmove-default-keybindings) "windmove" "\ | ||
| 15467 | Set up default keybindings for `windmove'." t nil) | ||
| 15468 | |||
| 15469 | ;;;*** | ||
| 15470 | |||
| 15330 | ;;;### (autoloads (wordstar-mode) "ws-mode" "emulation/ws-mode.el" | 15471 | ;;;### (autoloads (wordstar-mode) "ws-mode" "emulation/ws-mode.el" |
| 15331 | ;;;;;; (13415 51576)) | 15472 | ;;;;;; (13415 51576)) |
| 15332 | ;;; Generated autoloads from emulation/ws-mode.el | 15473 | ;;; Generated autoloads from emulation/ws-mode.el |
diff --git a/lisp/windmove.el b/lisp/windmove.el new file mode 100644 index 00000000000..7d5d629d2cb --- /dev/null +++ b/lisp/windmove.el | |||
| @@ -0,0 +1,604 @@ | |||
| 1 | ;; windmove.el -- directional window-selection routines. | ||
| 2 | ;; | ||
| 3 | ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. | ||
| 4 | ;; | ||
| 5 | ;; Author: Hovav Shacham (hovav@cs.stanford.edu) | ||
| 6 | ;; Created: 17 October 1998 | ||
| 7 | ;; Keywords: window, movement | ||
| 8 | ;; | ||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | ;; | ||
| 11 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation; either version 2, or (at your option) | ||
| 14 | ;; any later version. | ||
| 15 | ;; | ||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | ;; | ||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 23 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 24 | ;; Boston, MA 02111-1307, USA. | ||
| 25 | ;; | ||
| 26 | ;; -------------------------------------------------------------------- | ||
| 27 | |||
| 28 | ;;; Commentary: | ||
| 29 | ;; | ||
| 30 | ;; This package defines a set of routines, windmove-{left,up,right, | ||
| 31 | ;; down}, for selection of windows in a frame geometrically. For | ||
| 32 | ;; example, `windmove-right' selects the window immediately to the | ||
| 33 | ;; right of the currently-selected one. This functionality is similar | ||
| 34 | ;; to the window-selection controls of the BRIEF editor of yore. | ||
| 35 | ;; | ||
| 36 | ;; One subtle point is what happens when the window to the right has | ||
| 37 | ;; been split vertically; for example, consider a call to | ||
| 38 | ;; `windmove-right' in this setup: | ||
| 39 | ;; | ||
| 40 | ;; ------------- | ||
| 41 | ;; | | A | | ||
| 42 | ;; | | | | ||
| 43 | ;; | |----- | ||
| 44 | ;; | * | | (* is point in the currently | ||
| 45 | ;; | | B | selected window) | ||
| 46 | ;; | | | | ||
| 47 | ;; ------------- | ||
| 48 | ;; | ||
| 49 | ;; There are (at least) three reasonable things to do: | ||
| 50 | ;; (1) Always move to the window to the right of the top edge of the | ||
| 51 | ;; selected window; in this case, this policy selects A. | ||
| 52 | ;; (2) Always move to the window to the right of the bottom edge of | ||
| 53 | ;; the selected window; in this case, this policy selects B. | ||
| 54 | ;; (3) Move to the window to the right of point in the slected | ||
| 55 | ;; window. This may select either A or B, depending on the | ||
| 56 | ;; position of point; in the illustrated example, it would select | ||
| 57 | ;; B. | ||
| 58 | ;; | ||
| 59 | ;; Similar issues arise for all the movement functions. Windmove | ||
| 60 | ;; resolves this problem by allowing the user to specify behavior | ||
| 61 | ;; through a prefix argument. The cases are thus: | ||
| 62 | ;; * if no argument is given to the movement functions, or the | ||
| 63 | ;; argument given is zero, movement is relative to point; | ||
| 64 | ;; * if a positive argument is given, movement is relative to the top | ||
| 65 | ;; or left edge of the selected window, depending on whether the | ||
| 66 | ;; movement is to be horizontal or vertical; | ||
| 67 | ;; * if a negative argument is given, movement is relative to the | ||
| 68 | ;; bottom or right edge of the selected window, depending on whether | ||
| 69 | ;; the movement is to be horizontal or vertical. | ||
| 70 | ;; | ||
| 71 | ;; | ||
| 72 | ;; Another feature enables wrap-around mode when the variable | ||
| 73 | ;; `windmove-wrap-around' is set to a non-nil value. In this mode, | ||
| 74 | ;; movement that falls off the edge of the frame will wrap around to | ||
| 75 | ;; find the window on the opposite side of the frame. Windmove does | ||
| 76 | ;; the Right Thing about the minibuffer; for example, consider: | ||
| 77 | ;; | ||
| 78 | ;; ------------- | ||
| 79 | ;; | * | | ||
| 80 | ;; |-----------| | ||
| 81 | ;; | A | | ||
| 82 | ;; |-----------| (* is point in the currently | ||
| 83 | ;; | B | C | selected window) | ||
| 84 | ;; | | | | ||
| 85 | ;; ------------- | ||
| 86 | ;; | ||
| 87 | ;; With wraparound enabled, windmove-down will move to A, while | ||
| 88 | ;; windmove-up will move to the minibuffer if it is active, or to | ||
| 89 | ;; either B or C depending on the prefix argument. | ||
| 90 | ;; | ||
| 91 | ;; | ||
| 92 | ;; A set of default keybindings is supplied: shift-{left,up,right,down} | ||
| 93 | ;; invoke the corresponding Windmove function. See the installation | ||
| 94 | ;; section if you wish to use these keybindings. | ||
| 95 | |||
| 96 | |||
| 97 | ;; Installation: | ||
| 98 | ;; | ||
| 99 | ;; Put the following line in your `.emacs' file: | ||
| 100 | ;; | ||
| 101 | ;; (windmove-default-keybindings) ; default keybindings | ||
| 102 | ;; | ||
| 103 | ;; | ||
| 104 | ;; If you wish to enable wrap-around, also add a line like: | ||
| 105 | ;; | ||
| 106 | ;; (setq windmove-wrap-around t) | ||
| 107 | ;; | ||
| 108 | ;; | ||
| 109 | ;; Note: If you have an Emacs that manifests a bug that sometimes | ||
| 110 | ;; causes the occasional creation of a "lost column" between windows, | ||
| 111 | ;; 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: | ||
| 113 | ;; | ||
| 114 | ;; (setq windmove-window-distance-delta 2) | ||
| 115 | ;; | ||
| 116 | |||
| 117 | ;; Acknowledgements: | ||
| 118 | ;; | ||
| 119 | ;; Special thanks to Julian Assange (proff@iq.org), whose | ||
| 120 | ;; change-windows-intuitively.el predates Windmove, and provided the | ||
| 121 | ;; inspiration for it. Kin Cho (kin@symmetrycomm.com) was the first | ||
| 122 | ;; to suggest wrap-around behavior. Thanks also to Gerd Moellmann | ||
| 123 | ;; (gerd@gnu.org) for his comments and suggestions. | ||
| 124 | |||
| 125 | ;; -------------------------------------------------------------------- | ||
| 126 | |||
| 127 | ;;; Code: | ||
| 128 | |||
| 129 | |||
| 130 | ;; User configurable variables: | ||
| 131 | |||
| 132 | ;; For customize ... | ||
| 133 | (defgroup windmove nil | ||
| 134 | "Directional selection of windows in a frame." | ||
| 135 | :prefix "windmove-" | ||
| 136 | :group 'windows | ||
| 137 | :group 'convenience) | ||
| 138 | |||
| 139 | |||
| 140 | (defcustom windmove-wrap-around nil | ||
| 141 | "Whether movement off the edge of the frame wraps around. | ||
| 142 | If this variable is set to t, moving left from the leftmost window in | ||
| 143 | a frame will find the rightmost one, and similarly for the other | ||
| 144 | directions. The minibuffer is skipped over in up/down movements if it | ||
| 145 | is inactive." | ||
| 146 | :type 'boolean | ||
| 147 | :group 'windmove) | ||
| 148 | |||
| 149 | ;; If your Emacs sometimes places an empty column between two adjacent | ||
| 150 | ;; windows, you may wish to set this delta to 2. | ||
| 151 | (defcustom windmove-window-distance-delta 1 | ||
| 152 | "How far away from the current window to look for an adjacent window. | ||
| 153 | Measured in characters either horizontally or vertically; setting this | ||
| 154 | to a value larger than 1 may be useful in getting around window- | ||
| 155 | placement bugs in old versions of Emacs." | ||
| 156 | :type 'number | ||
| 157 | :group 'windmove) | ||
| 158 | |||
| 159 | |||
| 160 | |||
| 161 | ;; Implementation overview: | ||
| 162 | ;; | ||
| 163 | ;; The conceptual framework behind this code is all fairly simple. We | ||
| 164 | ;; are on one window; we wish to move to another. The correct window | ||
| 165 | ;; to move to is determined by the position of point in the current | ||
| 166 | ;; window as well as the overall window setup. | ||
| 167 | ;; | ||
| 168 | ;; Early on, I made the decision to base my implementation around the | ||
| 169 | ;; built-in function `window-at'. This function takes a frame-based | ||
| 170 | ;; coordinate, and returns the window that contains it. Using this | ||
| 171 | ;; function, the job of the various top-level windmove functions can | ||
| 172 | ;; be decomposed: first, find the current frame-based location of | ||
| 173 | ;; point; second, manipulate it in some way to give a new location, | ||
| 174 | ;; that hopefully falls in the window immediately at left (or right, | ||
| 175 | ;; etc.); third, use `window-at' and `select-window' to select the | ||
| 176 | ;; window at that new location. | ||
| 177 | ;; | ||
| 178 | ;; This is probably not the only possible architecture, and it turns | ||
| 179 | ;; out to have some inherent cruftiness. (Well, okay, the third step | ||
| 180 | ;; is pretty clean....) We will consider each step in turn. | ||
| 181 | ;; | ||
| 182 | ;; A quick digression about coordinate frames: most of the functions | ||
| 183 | ;; in the windmove package deal with screen coordinates in one way or | ||
| 184 | ;; another. These coordinates are always relative to some reference | ||
| 185 | ;; points. Window-based coordinates have their reference point in the | ||
| 186 | ;; upper-left-hand corner of whatever window is being talked about; | ||
| 187 | ;; frame-based coordinates have their reference point in the | ||
| 188 | ;; upper-left-hand corner of the entire frame (of which the current | ||
| 189 | ;; window is a component). | ||
| 190 | ;; | ||
| 191 | ;; All coordinates are zero-based, which simply means that the | ||
| 192 | ;; reference point (whatever it is) is assigned the value (x=0, y=0). | ||
| 193 | ;; X-coordinates grow down the screen, and Y-coordinates grow towards | ||
| 194 | ;; the right of the screen. | ||
| 195 | ;; | ||
| 196 | ;; Okay, back to work. The first step is to gather information about | ||
| 197 | ;; the frame-based coordinates of point, or rather, the reference | ||
| 198 | ;; location. The reference location can be point, or the upper-left, | ||
| 199 | ;; or the lower-right corner of the window; the particular one used is | ||
| 200 | ;; controlled by the prefix argument to `windmove-left' and all the | ||
| 201 | ;; rest. | ||
| 202 | ;; | ||
| 203 | ;; This work is done by `windmove-reference-loc'. It can figure out | ||
| 204 | ;; the locations of the corners by calling `window-edges', but to | ||
| 205 | ;; calculate the frame-based location of point, it calls the workhorse | ||
| 206 | ;; function `windmove-coordinates-of-position', which itself calls the | ||
| 207 | ;; incredibly hairy builtin `compute-motion'. There is a good deal of | ||
| 208 | ;; black magic in getting all the arguments to this function just right. | ||
| 209 | ;; | ||
| 210 | ;; The second step is more messy. Conceptually, it is fairly simple: | ||
| 211 | ;; if we know the reference location, and the coordinates of the | ||
| 212 | ;; current window, we can "throw" our reference point just over the | ||
| 213 | ;; appropriate edge of the window, and see what other window is | ||
| 214 | ;; there. More explicitly, consider this example from the user | ||
| 215 | ;; documentation above. | ||
| 216 | ;; | ||
| 217 | ;; ------------- | ||
| 218 | ;; | | A | | ||
| 219 | ;; | | | | ||
| 220 | ;; | |----- | ||
| 221 | ;; | * | | (* is point in the currently | ||
| 222 | ;; | | B | selected window) | ||
| 223 | ;; | | | | ||
| 224 | ;; ------------- | ||
| 225 | ;; | ||
| 226 | ;; The asterisk marks the reference point; we wish to move right. | ||
| 227 | ;; Since we are moving horizontally, the Y coordinate of the new | ||
| 228 | ;; location will be the same. The X coordinate can be such that it is | ||
| 229 | ;; just past the edge of the present window. Obviously, the new point | ||
| 230 | ;; will be inside window B. This in itself is fairly simple: using | ||
| 231 | ;; the result of `windmove-reference-loc' and `window-edges', all the | ||
| 232 | ;; necessary math can be performed. (Having said that, there is a | ||
| 233 | ;; good deal of room for off-by-one errors, and Emacs 19.34, at least, | ||
| 234 | ;; sometimes manifests a bug where two windows don't actually touch, | ||
| 235 | ;; so a larger skip is required.) The actual math here is done by | ||
| 236 | ;; `windmove-other-window-loc'. | ||
| 237 | ;; | ||
| 238 | ;; But we can't just pass the result of `windmove-other-window-loc' to | ||
| 239 | ;; `window-at' directly. Why not? Suppose a move would take us off | ||
| 240 | ;; the edge of the screen, say to the left. We want to give a | ||
| 241 | ;; descriptive error message to the user. Or, suppose that a move | ||
| 242 | ;; would place us in the minibuffer. What if the minibuffer is | ||
| 243 | ;; inactive? | ||
| 244 | ;; | ||
| 245 | ;; Actually, the whole subject of the minibuffer edge of the frame is | ||
| 246 | ;; rather messy. It turns out that with a sufficiently large delta, | ||
| 247 | ;; we can fly off the bottom edge of the frame and miss the minibuffer | ||
| 248 | ;; altogther. This, I think, is never right: if there's a minibuffer | ||
| 249 | ;; and you're not in it, and you move down, the minibuffer should be | ||
| 250 | ;; in your way. | ||
| 251 | ;; | ||
| 252 | ;; (By the way, I'm not totally sure that the code does the right | ||
| 253 | ;; thing in really weird cases, like a frame with no minibuffer.) | ||
| 254 | ;; | ||
| 255 | ;; So, what we need is some ways to do constraining and such. The | ||
| 256 | ;; early versions of windmove took a fairly simplistic approach to all | ||
| 257 | ;; this. When I added the wrap-around option, those internals had to | ||
| 258 | ;; be rewritten. After a *lot* of futzing around, I came up with a | ||
| 259 | ;; two-step process that I think is general enough to cover the | ||
| 260 | ;; relevant cases. (I'm not totally happy with having to pass the | ||
| 261 | ;; window variable as deep as I do, but we can't have everything.) | ||
| 262 | ;; | ||
| 263 | ;; In the first phase, we make sure that the new location is sane. | ||
| 264 | ;; "Sane" means that we can only fall of the edge of the frame in the | ||
| 265 | ;; direction we're moving in, and that we don't miss the minibuffer if | ||
| 266 | ;; we're moving down and not already in the minibuffer. The function | ||
| 267 | ;; `windmove-constrain-loc-for-movement' takes care of all this. | ||
| 268 | ;; | ||
| 269 | ;; Then, we handle the wraparound, if it's enabled. The function | ||
| 270 | ;; `windmove-wrap-loc-for-movement' takes coordinate values (both X | ||
| 271 | ;; and Y) that fall off the edge of the frame, and replaces them with | ||
| 272 | ;; values on the other side of the frame. It also has special | ||
| 273 | ;; minibuffer-handling code again, because we want to wrap through the | ||
| 274 | ;; minibuffer if it's not enabled. | ||
| 275 | ;; | ||
| 276 | ;; So, that's it. Seems to work. All of this work is done by the fun | ||
| 277 | ;; function `windmove-find-other-window'. | ||
| 278 | ;; | ||
| 279 | ;; So, now we have a window to move to (or nil if something's gone | ||
| 280 | ;; wrong). The function `windmove-do-window-select' is the main | ||
| 281 | ;; driver function: it actually does the `select-window'. It is | ||
| 282 | ;; called by four little convenience wrappers, `windmove-left', | ||
| 283 | ;; `windmove-up', `windmove-right', and `windmove-down', which make | ||
| 284 | ;; for convenient keybinding. | ||
| 285 | |||
| 286 | |||
| 287 | ;; Quick & dirty utility function to add two (x . y) coords. | ||
| 288 | (defun windmove-coord-add (coord1 coord2) | ||
| 289 | "Add the two coordinates. | ||
| 290 | Both COORD1 and COORD2 are coordinate cons pairs, (HPOS . VPOS). The | ||
| 291 | result is another coordinate cons pair." | ||
| 292 | (cons (+ (car coord1) (car coord2)) | ||
| 293 | (+ (cdr coord1) (cdr coord2)))) | ||
| 294 | |||
| 295 | |||
| 296 | (defun windmove-constrain-to-range (n min-n max-n) | ||
| 297 | "Ensure that N is between MIN-N and MAX-N inclusive by constraining. | ||
| 298 | If N is less than MIN-N, return MIN-N; if greater than MAX-N, return | ||
| 299 | MAX-N." | ||
| 300 | (max min-n (min n max-n))) | ||
| 301 | |||
| 302 | (defun windmove-constrain-around-range (n min-n max-n) | ||
| 303 | "Ensure that N is between MIN-N and MAX-N inclusive by wrapping. | ||
| 304 | If N is less than MIN-N, return MAX-N; if greater than MAX-N, return | ||
| 305 | MIN-N." | ||
| 306 | (cond | ||
| 307 | ((< n min-n) max-n) | ||
| 308 | ((> n max-n) min-n) | ||
| 309 | (t n))) | ||
| 310 | |||
| 311 | (defun windmove-frame-edges (window) | ||
| 312 | "Return (X-MIN Y-MIN X-MAX Y-MAX) for the frame containing WINDOW. | ||
| 313 | If WINDOW is nil, return the edges for the selected frame. | ||
| 314 | (X-MIN, Y-MIN) is the zero-based coordinate of the top-left corner | ||
| 315 | of the frame; (X-MAX, Y-MAX) is the zero-based coordinate of the | ||
| 316 | bottom-right corner of the frame. | ||
| 317 | For example, if a frame has 76 rows and 181 columns, the return value | ||
| 318 | from `windmove-frame-edges' will be the list (0 0 180 75)." | ||
| 319 | (let ((frame (if window | ||
| 320 | (window-frame window) | ||
| 321 | (selected-frame)))) | ||
| 322 | (let ((x-min 0) | ||
| 323 | (y-min 0) | ||
| 324 | (x-max (1- (frame-width frame))) ; 1- for last row & col here | ||
| 325 | (y-max (1- (frame-height frame)))) | ||
| 326 | (list x-min y-min x-max y-max)))) | ||
| 327 | |||
| 328 | ;; it turns out that constraining is always a good thing, even when | ||
| 329 | ;; wrapping is going to happen. this is because: | ||
| 330 | ;; first, since we disallow exotic diagonal-around-a-corner type | ||
| 331 | ;; movements, so we can always fix the unimportant direction (the one | ||
| 332 | ;; we're not moving in). | ||
| 333 | ;; second, if we're moving down and we're not in the minibuffer, then | ||
| 334 | ;; constraining the y coordinate to max-y is okay, because if that | ||
| 335 | ;; falls in the minibuffer and the minibuffer isn't active, that y | ||
| 336 | ;; coordinate will still be off the bottom of the frame as the | ||
| 337 | ;; wrapping function sees it and so will get wrapped around anyway. | ||
| 338 | (defun windmove-constrain-loc-for-movement (coord window dir) | ||
| 339 | "Constrain COORD so that it is reasonable for the given movement. | ||
| 340 | This involves two things: first, make sure that the \"off\" coordinate | ||
| 341 | -- the one not being moved on, e.g., y for horizontal movement -- is | ||
| 342 | within frame boundaries; second, if the movement is down and we're not | ||
| 343 | moving from the minibuffer, make sure that the y coordinate does not | ||
| 344 | exceed the frame max-y, so that we don't overshoot the minibuffer | ||
| 345 | accidentally. WINDOW is the window that movement is relative to; DIR | ||
| 346 | is the direction of the movement, one of `left', `up', `right', | ||
| 347 | or `down'. | ||
| 348 | Returns the constrained coordinate." | ||
| 349 | (let ((frame-edges (windmove-frame-edges window)) | ||
| 350 | (in-minibuffer (window-minibuffer-p window))) | ||
| 351 | (let ((min-x (nth 0 frame-edges)) | ||
| 352 | (min-y (nth 1 frame-edges)) | ||
| 353 | (max-x (nth 2 frame-edges)) | ||
| 354 | (max-y (nth 3 frame-edges))) | ||
| 355 | (let ((new-x | ||
| 356 | (if (memq dir '(up down)) ; vertical movement | ||
| 357 | (windmove-constrain-to-range (car coord) min-x max-x) | ||
| 358 | (car coord))) | ||
| 359 | (new-y | ||
| 360 | (if (or (memq dir '(left right)) ; horizontal movement | ||
| 361 | (and (eq dir 'down) | ||
| 362 | (not in-minibuffer))) ; don't miss minibuffer | ||
| 363 | ;; (technically, we shouldn't constrain on min-y in the | ||
| 364 | ;; second case, but this shouldn't do any harm on a | ||
| 365 | ;; down movement.) | ||
| 366 | (windmove-constrain-to-range (cdr coord) min-y max-y) | ||
| 367 | (cdr coord)))) | ||
| 368 | (cons new-x new-y))))) | ||
| 369 | |||
| 370 | ;; having constrained in the limited sense of windmove-constrain-loc- | ||
| 371 | ;; for-movement, the wrapping code is actually much simpler than it | ||
| 372 | ;; otherwise would be. the only complication is that we need to check | ||
| 373 | ;; if the minibuffer is active, and, if not, pretend that it's not | ||
| 374 | ;; even part of the frame. | ||
| 375 | (defun windmove-wrap-loc-for-movement (coord window dir) | ||
| 376 | "Takes the constrained COORD and wraps it around for the movement. | ||
| 377 | This makes an out-of-range x or y coordinate and wraps it around the | ||
| 378 | frame, giving a coordinate (hopefully) in the window on the other edge | ||
| 379 | of the frame. WINDOW is the window that movement is relative to (nil | ||
| 380 | means the currently selected window); DIR is the direction of the | ||
| 381 | movement, one of `left', `up', `right',or `down'. | ||
| 382 | Returns the wrapped coordinate." | ||
| 383 | (let* ((frame-edges (windmove-frame-edges window)) | ||
| 384 | (frame-minibuffer (minibuffer-window (if window | ||
| 385 | (window-frame window) | ||
| 386 | (selected-frame)))) | ||
| 387 | (minibuffer-active (minibuffer-window-active-p | ||
| 388 | frame-minibuffer))) | ||
| 389 | (let ((min-x (nth 0 frame-edges)) | ||
| 390 | (min-y (nth 1 frame-edges)) | ||
| 391 | (max-x (nth 2 frame-edges)) | ||
| 392 | (max-y (if (not minibuffer-active) | ||
| 393 | (- (nth 3 frame-edges) | ||
| 394 | (window-height frame-minibuffer)) | ||
| 395 | (nth 3 frame-edges)))) | ||
| 396 | (cons | ||
| 397 | (windmove-constrain-around-range (car coord) min-x max-x) | ||
| 398 | (windmove-constrain-around-range (cdr coord) min-y max-y))))) | ||
| 399 | |||
| 400 | |||
| 401 | |||
| 402 | ;; `windmove-coordinates-of-position' is stolen and modified from the | ||
| 403 | ;; Emacs Lisp Reference Manual, section 27.2.5. It seems to work | ||
| 404 | ;; okay, although I am bothered by the fact that tab-offset (the cdr | ||
| 405 | ;; of the next-to- last argument) is set to 0. On the other hand, I | ||
| 406 | ;; can't find a single usage of `compute-motion' anywhere that doesn't | ||
| 407 | ;; set this component to zero, and I'm too lazy to grovel through the | ||
| 408 | ;; C source to figure out what's happening in the background. there | ||
| 409 | ;; also seems to be a good deal of fun in calculating the correct | ||
| 410 | ;; width of lines for telling `compute-motion' about; in particular, | ||
| 411 | ;; it seems we need to subtract 1 (for the continuation column) from | ||
| 412 | ;; the number that `window-width' gives, or continuation lines aren't | ||
| 413 | ;; counted correctly. I haven't seen anyone doing this before, | ||
| 414 | ;; though. | ||
| 415 | (defun windmove-coordinates-of-position (pos &optional window) | ||
| 416 | "Return the coordinates of position POS in window WINDOW. | ||
| 417 | Return the window-based coodinates in a cons pair: (HPOS . VPOS), | ||
| 418 | where HPOS and VPOS are the zero-based x and y components of the | ||
| 419 | screen location of POS. If WINDOW is nil, return the coordinates in | ||
| 420 | the currently selected window. | ||
| 421 | As an example, if point is in the top left corner of a window, then | ||
| 422 | the return value from `windmove-coordinates-of-position' is (0 . 0) | ||
| 423 | regardless of the where point is in the buffer and where the window | ||
| 424 | is placed in the frame." | ||
| 425 | (let* ((wind (if (null window) (selected-window) window)) | ||
| 426 | (usable-width (1- (window-width wind))) ; 1- for cont. column | ||
| 427 | (usable-height (1- (window-height wind))) ; 1- for mode line | ||
| 428 | (big-hairy-result (compute-motion | ||
| 429 | (window-start) | ||
| 430 | '(0 . 0) | ||
| 431 | pos | ||
| 432 | (cons usable-width usable-height) | ||
| 433 | usable-width | ||
| 434 | (cons (window-hscroll) | ||
| 435 | 0) ; why zero? | ||
| 436 | wind))) | ||
| 437 | (cons (nth 1 big-hairy-result) ; hpos, not vpos as documented | ||
| 438 | (nth 2 big-hairy-result)))) ; vpos, not hpos as documented | ||
| 439 | |||
| 440 | ;; This calculates the reference location in the current window: the | ||
| 441 | ;; frame-based (x . y) of either point, the top-left, or the | ||
| 442 | ;; bottom-right of the window, depending on ARG. | ||
| 443 | (defun windmove-reference-loc (&optional arg window) | ||
| 444 | "Return the reference location for directional window selection. | ||
| 445 | Return a coordinate (HPOS . VPOS) that is frame-based. If ARG is nil | ||
| 446 | or not supplied, the reference point is the buffer's point in the | ||
| 447 | currently-selected window, or WINDOW if supplied; otherwise, it is the | ||
| 448 | top-left or bottom-right corner of the selected window, or WINDOW if | ||
| 449 | supplied, if ARG is greater or smaller than zero, respectively." | ||
| 450 | (let ((effective-arg (if (null arg) 0 (prefix-numeric-value arg))) | ||
| 451 | (edges (window-edges window))) | ||
| 452 | (let ((top-left (cons (nth 0 edges) | ||
| 453 | (nth 1 edges))) | ||
| 454 | ;; if 1-'s are not there, windows actually extend too far. | ||
| 455 | ;; actually, -2 is necessary for bottom: (nth 3 edges) is | ||
| 456 | ;; the height of the window; -1 because we want 0-based max, | ||
| 457 | ;; -1 to get rid of mode line | ||
| 458 | (bottom-right (cons (- (nth 2 edges) 1) | ||
| 459 | (- (nth 3 edges) 2)))) | ||
| 460 | (cond | ||
| 461 | ((> effective-arg 0) | ||
| 462 | top-left) | ||
| 463 | ((< effective-arg 0) | ||
| 464 | bottom-right) | ||
| 465 | ((= effective-arg 0) | ||
| 466 | (windmove-coord-add | ||
| 467 | top-left | ||
| 468 | (windmove-coordinates-of-position (window-point window) | ||
| 469 | window))))))) | ||
| 470 | |||
| 471 | ;; This uses the reference location in the current window (calculated | ||
| 472 | ;; by `windmove-reference-loc' above) to find a reference location | ||
| 473 | ;; that will hopefully be in the window we want to move to. | ||
| 474 | (defun windmove-other-window-loc (dir &optional arg window) | ||
| 475 | "Return a location in the window to be moved to. | ||
| 476 | Return value is a frame-based (HPOS . VPOS) value that should be moved | ||
| 477 | to. DIR is one of `left', `up', `right', or `down'; an optional ARG | ||
| 478 | is handled as by `windmove-reference-loc'; WINDOW is the window that | ||
| 479 | movement is relative to." | ||
| 480 | (let ((edges (window-edges window)) ; edges: (x0, y0, x1, y1) | ||
| 481 | (refpoint (windmove-reference-loc arg window))) ; (x . y) | ||
| 482 | (cond | ||
| 483 | ((eq dir 'left) | ||
| 484 | (cons (- (nth 0 edges) | ||
| 485 | windmove-window-distance-delta) | ||
| 486 | (cdr refpoint))) ; (x0-d, y) | ||
| 487 | ((eq dir 'up) | ||
| 488 | (cons (car refpoint) | ||
| 489 | (- (nth 1 edges) | ||
| 490 | windmove-window-distance-delta))) ; (x, y0-d) | ||
| 491 | ((eq dir 'right) | ||
| 492 | (cons (+ (nth 2 edges) | ||
| 493 | windmove-window-distance-delta) | ||
| 494 | (cdr refpoint))) ; (x1+d, y) | ||
| 495 | ((eq dir 'down) | ||
| 496 | (cons (car refpoint) | ||
| 497 | (+ (nth 3 edges) | ||
| 498 | windmove-window-distance-delta))) ; (x, y1+d) | ||
| 499 | (t (error "Invalid direction of movement: %s" dir))))) | ||
| 500 | |||
| 501 | (defun windmove-find-other-window (dir &optional arg window) | ||
| 502 | "Return the window object in direction DIR. | ||
| 503 | DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'." | ||
| 504 | (let* ((actual-current-window (or window (selected-window))) | ||
| 505 | (raw-other-window-loc | ||
| 506 | (windmove-other-window-loc dir arg actual-current-window)) | ||
| 507 | (constrained-other-window-loc | ||
| 508 | (windmove-constrain-loc-for-movement raw-other-window-loc | ||
| 509 | actual-current-window | ||
| 510 | dir)) | ||
| 511 | (other-window-loc | ||
| 512 | (if windmove-wrap-around | ||
| 513 | (windmove-wrap-loc-for-movement constrained-other-window-loc | ||
| 514 | actual-current-window | ||
| 515 | dir) | ||
| 516 | constrained-other-window-loc))) | ||
| 517 | (window-at (car other-window-loc) | ||
| 518 | (cdr other-window-loc)))) | ||
| 519 | |||
| 520 | |||
| 521 | ;; Selects the window that's hopefully at the location returned by | ||
| 522 | ;; `windmove-other-window-loc', or screams if there's no window there. | ||
| 523 | (defun windmove-do-window-select (dir &optional arg window) | ||
| 524 | "Moves to the window at direction DIR. | ||
| 525 | DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'. | ||
| 526 | If no window is at direction DIR, an error is signaled." | ||
| 527 | (let ((other-window (windmove-find-other-window dir arg window))) | ||
| 528 | (cond ((null other-window) | ||
| 529 | (error "No window at %s" dir)) | ||
| 530 | ((and (window-minibuffer-p other-window) | ||
| 531 | (not (minibuffer-window-active-p other-window))) | ||
| 532 | (error "Can't move to inactive minibuffer")) | ||
| 533 | (t | ||
| 534 | (select-window other-window))))) | ||
| 535 | |||
| 536 | |||
| 537 | ;;; end-user functions | ||
| 538 | ;; these are all simple interactive wrappers to `windmove-do- | ||
| 539 | ;; window-select', meant to be bound to keys. | ||
| 540 | |||
| 541 | ;;;###autoload | ||
| 542 | (defun windmove-left (&optional arg) | ||
| 543 | "Select the window to the left of the current one. | ||
| 544 | With no prefix argument, or with prefix argument equal to zero, | ||
| 545 | \"left\" is relative to the position of point in the window; otherwise | ||
| 546 | it is relative to the top edge (for positive ARG) or the bottom edge | ||
| 547 | (for negative ARG) of the current window. | ||
| 548 | If no window is at the desired location, an error is signaled." | ||
| 549 | (interactive "P") | ||
| 550 | (windmove-do-window-select 'left arg)) | ||
| 551 | |||
| 552 | ;;;###autoload | ||
| 553 | (defun windmove-up (&optional arg) | ||
| 554 | "Select the window above the current one. | ||
| 555 | With no prefix argument, or with prefix argument equal to zero, \"up\" | ||
| 556 | is relative to the position of point in the window; otherwise it is | ||
| 557 | relative to the left edge (for positive ARG) or the right edge (for | ||
| 558 | negative ARG) of the current window. | ||
| 559 | If no window is at the desired location, an error is signaled." | ||
| 560 | (interactive "P") | ||
| 561 | (windmove-do-window-select 'up arg)) | ||
| 562 | |||
| 563 | ;;;###autoload | ||
| 564 | (defun windmove-right (&optional arg) | ||
| 565 | "Select the window to the right of the current one. | ||
| 566 | With no prefix argument, or with prefix argument equal to zero, | ||
| 567 | \"right\" is relative to the position of point in the window; | ||
| 568 | otherwise it is relative to the top edge (for positive ARG) or the | ||
| 569 | bottom edge (for negative ARG) of the current window. | ||
| 570 | If no window is at the desired location, an error is signaled." | ||
| 571 | (interactive "P") | ||
| 572 | (windmove-do-window-select 'right arg)) | ||
| 573 | |||
| 574 | ;;;###autoload | ||
| 575 | (defun windmove-down (&optional arg) | ||
| 576 | "Select the window below the current one. | ||
| 577 | With no prefix argument, or with prefix argument equal to zero, | ||
| 578 | \"down\" is relative to the position of point in the window; otherwise | ||
| 579 | it is relative to the left edge (for positive ARG) or the right edge | ||
| 580 | (for negative ARG) of the current window. | ||
| 581 | If no window is at the desired location, an error is signaled." | ||
| 582 | (interactive "P") | ||
| 583 | (windmove-do-window-select 'down arg)) | ||
| 584 | |||
| 585 | |||
| 586 | ;;; set up keybindings | ||
| 587 | ;; Idea for this function is from iswitchb.el, by Stephen Eglen | ||
| 588 | ;; (stephen@cns.ed.ac.uk). | ||
| 589 | ;; I don't think these bindings will work on non-X terminals; you | ||
| 590 | ;; probably want to use different bindings in that case. | ||
| 591 | |||
| 592 | ;;;###autoload | ||
| 593 | (defun windmove-default-keybindings () | ||
| 594 | "Set up default keybindings for `windmove'." | ||
| 595 | (interactive) | ||
| 596 | (global-set-key [(shift left)] 'windmove-left) | ||
| 597 | (global-set-key [(shift up)] 'windmove-up) | ||
| 598 | (global-set-key [(shift right)] 'windmove-right) | ||
| 599 | (global-set-key [(shift down)] 'windmove-down)) | ||
| 600 | |||
| 601 | |||
| 602 | (provide 'windmove) | ||
| 603 | |||
| 604 | ;;; windmove.el ends here | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 6d68c17c1ad..6a21198d046 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2000-01-31 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-01-31 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xterm.c (xim_open_dpy): Remove unused local variable. | ||
| 4 | |||
| 3 | * emacs.c (USAGE): Use term `display options' instead of `X | 5 | * emacs.c (USAGE): Use term `display options' instead of `X |
| 4 | options'. | 6 | options'. |
| 5 | 7 | ||