diff options
| author | Dave Love | 1999-07-30 18:39:32 +0000 |
|---|---|---|
| committer | Dave Love | 1999-07-30 18:39:32 +0000 |
| commit | 40d34803a76d5a0bb6851ba5e38e35adbcc7789e (patch) | |
| tree | 6967d19ce2ede4da9b31d0676aa8ad7b4f4471b8 | |
| parent | 16b6c96620319a25e97e43047a39d2295045e9a6 (diff) | |
| download | emacs-40d34803a76d5a0bb6851ba5e38e35adbcc7789e.tar.gz emacs-40d34803a76d5a0bb6851ba5e38e35adbcc7789e.zip | |
Change comments to doc strings and other doc fixes.
(frame-delete-all): Moved to subr.el as `assoc-delete-all'. Callers
changed.
(set-background-color, set-foreground-color, set-cursor-color)
(set-mouse-color, set-border-color): Offer completion of colours.
(cursor): Add :version to defgroup.
| -rw-r--r-- | lisp/frame.el | 94 |
1 files changed, 43 insertions, 51 deletions
diff --git a/lisp/frame.el b/lisp/frame.el index ef15f9ab78e..2c9f38d8f98 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -99,14 +99,14 @@ These supersede the values given in `default-frame-alist'." | |||
| 99 | (sexp :tag "Value"))) | 99 | (sexp :tag "Value"))) |
| 100 | :group 'frames) | 100 | :group 'frames) |
| 101 | 101 | ||
| 102 | ;; Display BUFFER in its own frame, reusing an existing window if any. | ||
| 103 | ;; Return the window chosen. | ||
| 104 | ;; Currently we do not insist on selecting the window within its frame. | ||
| 105 | ;; If ARGS is an alist, use it as a list of frame parameter specs. | ||
| 106 | ;; If ARGS is a list whose car is a symbol, | ||
| 107 | ;; use (car ARGS) as a function to do the work. | ||
| 108 | ;; Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args. | ||
| 109 | (defun special-display-popup-frame (buffer &optional args) | 102 | (defun special-display-popup-frame (buffer &optional args) |
| 103 | "Display BUFFER in its own frame, reusing an existing window if any. | ||
| 104 | Return the window chosen. | ||
| 105 | Currently we do not insist on selecting the window within its frame. | ||
| 106 | If ARGS is an alist, use it as a list of frame parameter specs. | ||
| 107 | If ARGS is a list whose car is a symbol, | ||
| 108 | use (car ARGS) as a function to do the work. | ||
| 109 | Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args." | ||
| 110 | (if (and args (symbolp (car args))) | 110 | (if (and args (symbolp (car args))) |
| 111 | (apply (car args) buffer (cdr args)) | 111 | (apply (car args) buffer (cdr args)) |
| 112 | (let ((window (get-buffer-window buffer t))) | 112 | (let ((window (get-buffer-window buffer t))) |
| @@ -122,8 +122,8 @@ These supersede the values given in `default-frame-alist'." | |||
| 122 | (set-window-dedicated-p (frame-selected-window frame) t) | 122 | (set-window-dedicated-p (frame-selected-window frame) t) |
| 123 | (frame-selected-window frame)))))) | 123 | (frame-selected-window frame)))))) |
| 124 | 124 | ||
| 125 | ;; Handle delete-frame events from the X server. | ||
| 126 | (defun handle-delete-frame (event) | 125 | (defun handle-delete-frame (event) |
| 126 | "Handle delete-frame events from the X server." | ||
| 127 | (interactive "e") | 127 | (interactive "e") |
| 128 | (let ((frame (posn-window (event-start event))) | 128 | (let ((frame (posn-window (event-start event))) |
| 129 | (i 0) | 129 | (i 0) |
| @@ -167,7 +167,7 @@ These supersede the values given in `default-frame-alist'." | |||
| 167 | ;;; file - if there is no frame with a minibuffer open now, create | 167 | ;;; file - if there is no frame with a minibuffer open now, create |
| 168 | ;;; one to display messages while loading the init file. | 168 | ;;; one to display messages while loading the init file. |
| 169 | (defun frame-initialize () | 169 | (defun frame-initialize () |
| 170 | 170 | "Create an in initial frame if necessary." | |
| 171 | ;; Are we actually running under a window system at all? | 171 | ;; Are we actually running under a window system at all? |
| 172 | (if (and window-system (not noninteractive) (not (eq window-system 'pc))) | 172 | (if (and window-system (not noninteractive) (not (eq window-system 'pc))) |
| 173 | (progn | 173 | (progn |
| @@ -215,7 +215,8 @@ These supersede the values given in `default-frame-alist'." | |||
| 215 | ;;; file. Now default-frame-alist and initial-frame-alist contain | 215 | ;;; file. Now default-frame-alist and initial-frame-alist contain |
| 216 | ;;; information to which we must react; do what needs to be done. | 216 | ;;; information to which we must react; do what needs to be done. |
| 217 | (defun frame-notice-user-settings () | 217 | (defun frame-notice-user-settings () |
| 218 | 218 | "Act on user's init file settings of frame parameters. | |
| 219 | React to settings of `default-frame-alist', `initial-frame-alist' there." | ||
| 219 | ;; Make menu-bar-mode and default-frame-alist consistent. | 220 | ;; Make menu-bar-mode and default-frame-alist consistent. |
| 220 | (if (boundp 'menu-bar-mode) | 221 | (if (boundp 'menu-bar-mode) |
| 221 | (let ((default (assq 'menu-bar-lines default-frame-alist))) | 222 | (let ((default (assq 'menu-bar-lines default-frame-alist))) |
| @@ -272,13 +273,13 @@ These supersede the values given in `default-frame-alist'." | |||
| 272 | ;; when we first made the frame. | 273 | ;; when we first made the frame. |
| 273 | (setq parms (cons '(reverse) (delq (assq 'reverse parms) parms))) | 274 | (setq parms (cons '(reverse) (delq (assq 'reverse parms) parms))) |
| 274 | (if (assq 'height frame-initial-geometry-arguments) | 275 | (if (assq 'height frame-initial-geometry-arguments) |
| 275 | (setq parms (frame-delete-all 'height parms))) | 276 | (setq parms (assoc-delete-all 'height parms))) |
| 276 | (if (assq 'width frame-initial-geometry-arguments) | 277 | (if (assq 'width frame-initial-geometry-arguments) |
| 277 | (setq parms (frame-delete-all 'width parms))) | 278 | (setq parms (assoc-delete-all 'width parms))) |
| 278 | (if (assq 'left frame-initial-geometry-arguments) | 279 | (if (assq 'left frame-initial-geometry-arguments) |
| 279 | (setq parms (frame-delete-all 'left parms))) | 280 | (setq parms (assoc-delete-all 'left parms))) |
| 280 | (if (assq 'top frame-initial-geometry-arguments) | 281 | (if (assq 'top frame-initial-geometry-arguments) |
| 281 | (setq parms (frame-delete-all 'top parms))) | 282 | (setq parms (assoc-delete-all 'top parms))) |
| 282 | (setq new | 283 | (setq new |
| 283 | (make-frame | 284 | (make-frame |
| 284 | ;; Use the geometry args that created the existing | 285 | ;; Use the geometry args that created the existing |
| @@ -344,13 +345,13 @@ These supersede the values given in `default-frame-alist'." | |||
| 344 | (setq allparms (append initial-frame-alist | 345 | (setq allparms (append initial-frame-alist |
| 345 | default-frame-alist)) | 346 | default-frame-alist)) |
| 346 | (if (assq 'height frame-initial-geometry-arguments) | 347 | (if (assq 'height frame-initial-geometry-arguments) |
| 347 | (setq allparms (frame-delete-all 'height allparms))) | 348 | (setq allparms (assoc-delete-all 'height allparms))) |
| 348 | (if (assq 'width frame-initial-geometry-arguments) | 349 | (if (assq 'width frame-initial-geometry-arguments) |
| 349 | (setq allparms (frame-delete-all 'width allparms))) | 350 | (setq allparms (assoc-delete-all 'width allparms))) |
| 350 | (if (assq 'left frame-initial-geometry-arguments) | 351 | (if (assq 'left frame-initial-geometry-arguments) |
| 351 | (setq allparms (frame-delete-all 'left allparms))) | 352 | (setq allparms (assoc-delete-all 'left allparms))) |
| 352 | (if (assq 'top frame-initial-geometry-arguments) | 353 | (if (assq 'top frame-initial-geometry-arguments) |
| 353 | (setq allparms (frame-delete-all 'top allparms))) | 354 | (setq allparms (assoc-delete-all 'top allparms))) |
| 354 | (setq tail allparms) | 355 | (setq tail allparms) |
| 355 | ;; Find just the parms that have changed since we first | 356 | ;; Find just the parms that have changed since we first |
| 356 | ;; made this frame. Those are the ones actually set by | 357 | ;; made this frame. Those are the ones actually set by |
| @@ -394,23 +395,12 @@ These supersede the values given in `default-frame-alist'." | |||
| 394 | (make-frame-on-display display parms) | 395 | (make-frame-on-display display parms) |
| 395 | (make-frame parms)))) | 396 | (make-frame parms)))) |
| 396 | 397 | ||
| 397 | ;; Delete from ALIST all elements whose car is KEY. | ||
| 398 | ;; Return the modified alist. | ||
| 399 | (defun frame-delete-all (key alist) | ||
| 400 | (setq alist (copy-sequence alist)) | ||
| 401 | (let ((tail alist)) | ||
| 402 | (while tail | ||
| 403 | (if (eq (car (car tail)) key) | ||
| 404 | (setq alist (delq (car tail) alist))) | ||
| 405 | (setq tail (cdr tail))) | ||
| 406 | alist)) | ||
| 407 | |||
| 408 | ;;;; Creation of additional frames, and other frame miscellanea | 398 | ;;;; Creation of additional frames, and other frame miscellanea |
| 409 | 399 | ||
| 410 | ;;; Return some frame other than the current frame, creating one if | ||
| 411 | ;;; necessary. Note that the minibuffer frame, if separate, is not | ||
| 412 | ;;; considered (see next-frame). | ||
| 413 | (defun get-other-frame () | 400 | (defun get-other-frame () |
| 401 | "Return some frame other than the current frame. | ||
| 402 | Create one if necessary. Note that the minibuffer frame, if separate, | ||
| 403 | is not considered (see `next-frame')." | ||
| 414 | (let ((s (if (equal (next-frame (selected-frame)) (selected-frame)) | 404 | (let ((s (if (equal (next-frame (selected-frame)) (selected-frame)) |
| 415 | (make-frame) | 405 | (make-frame) |
| 416 | (next-frame (selected-frame))))) | 406 | (next-frame (selected-frame))))) |
| @@ -665,7 +655,7 @@ If FRAME is omitted, describe the currently selected frame." | |||
| 665 | 655 | ||
| 666 | (defalias 'set-default-font 'set-frame-font) | 656 | (defalias 'set-default-font 'set-frame-font) |
| 667 | (defun set-frame-font (font-name) | 657 | (defun set-frame-font (font-name) |
| 668 | "Set the font of the selected frame to FONT. | 658 | "Set the font of the selected frame to FONT-NAME. |
| 669 | When called interactively, prompt for the name of the font to use. | 659 | When called interactively, prompt for the name of the font to use. |
| 670 | To get the frame's current default font, use `frame-parameters'." | 660 | To get the frame's current default font, use `frame-parameters'." |
| 671 | (interactive "sFont name: ") | 661 | (interactive "sFont name: ") |
| @@ -676,36 +666,36 @@ To get the frame's current default font, use `frame-parameters'." | |||
| 676 | (run-hooks 'after-setting-font-hooks)) | 666 | (run-hooks 'after-setting-font-hooks)) |
| 677 | 667 | ||
| 678 | (defun set-background-color (color-name) | 668 | (defun set-background-color (color-name) |
| 679 | "Set the background color of the selected frame to COLOR. | 669 | "Set the background color of the selected frame to COLOR-NAME. |
| 680 | When called interactively, prompt for the name of the color to use. | 670 | When called interactively, prompt for the name of the color to use. |
| 681 | To get the frame's current background color, use `frame-parameters'." | 671 | To get the frame's current background color, use `frame-parameters'." |
| 682 | (interactive "sColor: ") | 672 | (interactive (list (facemenu-read-color))) |
| 683 | (modify-frame-parameters (selected-frame) | 673 | (modify-frame-parameters (selected-frame) |
| 684 | (list (cons 'background-color color-name))) | 674 | (list (cons 'background-color color-name))) |
| 685 | (frame-update-face-colors (selected-frame))) | 675 | (frame-update-face-colors (selected-frame))) |
| 686 | 676 | ||
| 687 | (defun set-foreground-color (color-name) | 677 | (defun set-foreground-color (color-name) |
| 688 | "Set the foreground color of the selected frame to COLOR. | 678 | "Set the foreground color of the selected frame to COLOR-NAME. |
| 689 | When called interactively, prompt for the name of the color to use. | 679 | When called interactively, prompt for the name of the color to use. |
| 690 | To get the frame's current foreground color, use `frame-parameters'." | 680 | To get the frame's current foreground color, use `frame-parameters'." |
| 691 | (interactive "sColor: ") | 681 | (interactive (list (facemenu-read-color))) |
| 692 | (modify-frame-parameters (selected-frame) | 682 | (modify-frame-parameters (selected-frame) |
| 693 | (list (cons 'foreground-color color-name))) | 683 | (list (cons 'foreground-color color-name))) |
| 694 | (frame-update-face-colors (selected-frame))) | 684 | (frame-update-face-colors (selected-frame))) |
| 695 | 685 | ||
| 696 | (defun set-cursor-color (color-name) | 686 | (defun set-cursor-color (color-name) |
| 697 | "Set the text cursor color of the selected frame to COLOR. | 687 | "Set the text cursor color of the selected frame to COLOR-NAME. |
| 698 | When called interactively, prompt for the name of the color to use. | 688 | When called interactively, prompt for the name of the color to use. |
| 699 | To get the frame's current cursor color, use `frame-parameters'." | 689 | To get the frame's current cursor color, use `frame-parameters'." |
| 700 | (interactive "sColor: ") | 690 | (interactive (list (facemenu-read-color))) |
| 701 | (modify-frame-parameters (selected-frame) | 691 | (modify-frame-parameters (selected-frame) |
| 702 | (list (cons 'cursor-color color-name)))) | 692 | (list (cons 'cursor-color color-name)))) |
| 703 | 693 | ||
| 704 | (defun set-mouse-color (color-name) | 694 | (defun set-mouse-color (color-name) |
| 705 | "Set the color of the mouse pointer of the selected frame to COLOR. | 695 | "Set the color of the mouse pointer of the selected frame to COLOR-NAME. |
| 706 | When called interactively, prompt for the name of the color to use. | 696 | When called interactively, prompt for the name of the color to use. |
| 707 | To get the frame's current mouse color, use `frame-parameters'." | 697 | To get the frame's current mouse color, use `frame-parameters'." |
| 708 | (interactive "sColor: ") | 698 | (interactive (list (facemenu-read-color))) |
| 709 | (modify-frame-parameters (selected-frame) | 699 | (modify-frame-parameters (selected-frame) |
| 710 | (list (cons 'mouse-color | 700 | (list (cons 'mouse-color |
| 711 | (or color-name | 701 | (or color-name |
| @@ -713,10 +703,10 @@ To get the frame's current mouse color, use `frame-parameters'." | |||
| 713 | (frame-parameters)))))))) | 703 | (frame-parameters)))))))) |
| 714 | 704 | ||
| 715 | (defun set-border-color (color-name) | 705 | (defun set-border-color (color-name) |
| 716 | "Set the color of the border of the selected frame to COLOR. | 706 | "Set the color of the border of the selected frame to COLOR-NAME. |
| 717 | When called interactively, prompt for the name of the color to use. | 707 | When called interactively, prompt for the name of the color to use. |
| 718 | To get the frame's current border color, use `frame-parameters'." | 708 | To get the frame's current border color, use `frame-parameters'." |
| 719 | (interactive "sColor: ") | 709 | (interactive (list (facemenu-read-color))) |
| 720 | (modify-frame-parameters (selected-frame) | 710 | (modify-frame-parameters (selected-frame) |
| 721 | (list (cons 'border-color color-name)))) | 711 | (list (cons 'border-color color-name)))) |
| 722 | 712 | ||
| @@ -763,18 +753,18 @@ one frame, otherwise the name is displayed on the frame's caption bar." | |||
| 763 | (defalias 'screen-width 'frame-width) | 753 | (defalias 'screen-width 'frame-width) |
| 764 | 754 | ||
| 765 | (defun set-screen-width (cols &optional pretend) | 755 | (defun set-screen-width (cols &optional pretend) |
| 766 | "Obsolete function to change the size of the screen to COLS columns.\n\ | 756 | "Obsolete function to change the size of the screen to COLS columns. |
| 767 | Optional second arg non-nil means that redisplay should use COLS columns\n\ | 757 | Optional second arg non-nil means that redisplay should use COLS columns |
| 768 | but that the idea of the actual width of the frame should not be changed.\n\ | 758 | but that the idea of the actual width of the frame should not be changed. |
| 769 | This function is provided only for compatibility with Emacs 18; new code\n\ | 759 | This function is provided only for compatibility with Emacs 18; new code |
| 770 | should use `set-frame-width instead'." | 760 | should use `set-frame-width instead'." |
| 771 | (set-frame-width (selected-frame) cols pretend)) | 761 | (set-frame-width (selected-frame) cols pretend)) |
| 772 | 762 | ||
| 773 | (defun set-screen-height (lines &optional pretend) | 763 | (defun set-screen-height (lines &optional pretend) |
| 774 | "Obsolete function to change the height of the screen to LINES lines.\n\ | 764 | "Obsolete function to change the height of the screen to LINES lines. |
| 775 | Optional second arg non-nil means that redisplay should use LINES lines\n\ | 765 | Optional second arg non-nil means that redisplay should use LINES lines |
| 776 | but that the idea of the actual height of the screen should not be changed.\n\ | 766 | but that the idea of the actual height of the screen should not be changed. |
| 777 | This function is provided only for compatibility with Emacs 18; new code\n\ | 767 | This function is provided only for compatibility with Emacs 18; new code |
| 778 | should use `set-frame-height' instead." | 768 | should use `set-frame-height' instead." |
| 779 | (set-frame-height (selected-frame) lines pretend)) | 769 | (set-frame-height (selected-frame) lines pretend)) |
| 780 | 770 | ||
| @@ -801,6 +791,7 @@ should use `set-frame-height' instead." | |||
| 801 | 791 | ||
| 802 | (defgroup cursor nil | 792 | (defgroup cursor nil |
| 803 | "Cursor on frames." | 793 | "Cursor on frames." |
| 794 | :version "21.1" | ||
| 804 | :group 'frames) | 795 | :group 'frames) |
| 805 | 796 | ||
| 806 | (defcustom blink-cursor-delay 0.5 | 797 | (defcustom blink-cursor-delay 0.5 |
| @@ -906,3 +897,4 @@ the timer blink-cursor-timer and removes itself from the hook." | |||
| 906 | (provide 'frame) | 897 | (provide 'frame) |
| 907 | 898 | ||
| 908 | ;;; frame.el ends here | 899 | ;;; frame.el ends here |
| 900 | (frame-notice-user-settings): | ||