Mercurial > hg > xemacs-beta
comparison lisp/frame.el @ 245:51092a27c943 r20-5b21
Import from CVS: tag r20-5b21
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:17:54 +0200 |
parents | 262b8bb4a523 |
children | 11cf20601dec |
comparison
equal
deleted
inserted
replaced
244:78d4f1140794 | 245:51092a27c943 |
---|---|
755 (setq iconification-data (cdr iconification-data)))) | 755 (setq iconification-data (cdr iconification-data)))) |
756 | 756 |
757 (defun suspend-or-iconify-emacs () | 757 (defun suspend-or-iconify-emacs () |
758 "Calls iconify-emacs if frame is an X frame, otherwise calls suspend-emacs" | 758 "Calls iconify-emacs if frame is an X frame, otherwise calls suspend-emacs" |
759 (interactive) | 759 (interactive) |
760 (cond | 760 (cond ((device-on-window-system-p) |
761 ((eq (frame-type) 'x) | 761 (iconify-emacs)) |
762 (iconify-emacs)) | 762 ((and (eq (frame-type) 'tty) |
763 ((and (eq (frame-type) 'tty) | 763 (console-tty-controlling-process (selected-console))) |
764 (console-tty-controlling-process (selected-console))) | 764 (suspend-console (selected-console))) |
765 (suspend-console (selected-console))) | 765 (t |
766 (t | 766 (suspend-emacs)))) |
767 (suspend-emacs)))) | |
768 | 767 |
769 ;; This is quite a mouthful, but it should be descriptive, as it's | 768 ;; This is quite a mouthful, but it should be descriptive, as it's |
770 ;; bound to C-z | 769 ;; bound to C-z. FSF takes the easy way out by binding C-z to |
770 ;; different things depending on window-system. We can't do the same, | |
771 ;; because we allow simultaneous X and TTY consoles. | |
771 (defun suspend-emacs-or-iconify-frame () | 772 (defun suspend-emacs-or-iconify-frame () |
772 "Iconify current frame if it is an X frame, otherwise suspend Emacs." | 773 "Iconify current frame if it is an X frame, otherwise suspend Emacs." |
773 (interactive) | 774 (interactive) |
774 (cond ((eq (frame-type) 'x) | 775 (cond ((device-on-window-system-p) |
775 (iconify-frame)) | 776 (iconify-frame)) |
776 ((and (eq (frame-type) 'tty) | 777 ((and (eq (frame-type) 'tty) |
777 (console-tty-controlling-process (selected-console))) | 778 (console-tty-controlling-process (selected-console))) |
778 (suspend-console (selected-console))) | 779 (suspend-console (selected-console))) |
779 (t | 780 (t |
898 ;; creation-hook. If that's the case, leave it alone.) | 899 ;; creation-hook. If that's the case, leave it alone.) |
899 ;; | 900 ;; |
900 (if (window-buffer w) | 901 (if (window-buffer w) |
901 (set-window-buffer w buffer)) | 902 (set-window-buffer w buffer)) |
902 fr)) | 903 fr)) |
904 | |
905 (defcustom get-frame-for-buffer-default-to-current nil | |
906 "*When non-nil, `get-frame-for-buffer' will default to the current frame." | |
907 :type 'boolean | |
908 :group 'frames) | |
903 | 909 |
904 (defun get-frame-for-buffer-noselect (buffer | 910 (defun get-frame-for-buffer-noselect (buffer |
905 &optional not-this-window-p on-frame) | 911 &optional not-this-window-p on-frame) |
906 "Return a frame in which to display BUFFER. | 912 "Return a frame in which to display BUFFER. |
907 This is a subroutine of `get-frame-for-buffer' (which see)." | 913 This is a subroutine of `get-frame-for-buffer' (which see)." |
1004 (if (or (eq limit 0) ; means create with reckless abandon | 1010 (if (or (eq limit 0) ; means create with reckless abandon |
1005 (< (length frames) limit)) | 1011 (< (length frames) limit)) |
1006 (get-frame-for-buffer-make-new-frame buffer) | 1012 (get-frame-for-buffer-make-new-frame buffer) |
1007 (car frames)))) | 1013 (car frames)))) |
1008 | 1014 |
1015 ;; | |
1016 ;; This buffer's mode did not express a preference for a frame of a | |
1017 ;; particular name. However, the user wants the frame to be the | |
1018 ;; current one in that case. | |
1019 ;; | |
1020 (get-frame-for-buffer-default-to-current nil) | |
1021 | |
1009 (t | 1022 (t |
1010 ;; | 1023 ;; |
1011 ;; This buffer's mode did not express a preference for a frame of a | 1024 ;; This buffer's mode did not express a preference for a frame of a |
1012 ;; particular name. So try to find a frame already displaying this | 1025 ;; particular name. So try to find a frame already displaying this |
1013 ;; buffer. | 1026 ;; buffer. |