comparison lisp/prim/frame.el @ 48:56c54cf7c5b6 r19-16b90

Import from CVS: tag r19-16b90
author cvs
date Mon, 13 Aug 2007 08:56:04 +0200
parents 8d2a9b52c682
children 131b0175ea99
comparison
equal deleted inserted replaced
47:11c6df210d7f 48:56c54cf7c5b6
719 (list frame-icon-title-format map-frame-hook frames) 719 (list frame-icon-title-format map-frame-hook frames)
720 frame-icon-title-format icon-name 720 frame-icon-title-format icon-name
721 map-frame-hook 'deiconify-emacs) 721 map-frame-hook 'deiconify-emacs)
722 (iconify-frame me))) 722 (iconify-frame me)))
723 723
724
724 (defun deiconify-emacs (&optional ignore) 725 (defun deiconify-emacs (&optional ignore)
725 (or iconification-data (error "not iconified?")) 726 (or iconification-data (error "not iconified?"))
726 (setq frame-icon-title-format (car iconification-data) 727 (setq frame-icon-title-format (car iconification-data)
727 map-frame-hook (car (cdr iconification-data)) 728 map-frame-hook (car (cdr iconification-data))
728 iconification-data (car (cdr (cdr iconification-data)))) 729 iconification-data (car (cdr (cdr iconification-data))))
729 (while iconification-data 730 (while iconification-data
730 (let ((visibility (cdr (car iconification-data)))) 731 (let ((visibility (cdr (car iconification-data))))
731 (cond ((eq visibility 't) 732 (cond (visibility ;; JV (Note non-nil means visible in XEmacs)
732 (make-frame-visible (car (car iconification-data)))) 733 (make-frame-visible (car (car iconification-data))))
733 ; (t ;; (eq visibility 'icon) 734 ; (t ;; (eq visibility 'icon) ;; JV Not in XEmacs!!!
734 ; (make-frame-visible (car (car iconification-data))) 735 ; (make-frame-visible (car (car iconification-data)))
735 ; (sleep-for 500 t) ; process X events; I really want to XSync() here 736 ; (sleep-for 500 t) ; process X events; I really want to XSync() here
736 ; (iconify-frame (car (car iconification-data)))) 737 ; (iconify-frame (car (car iconification-data))))
737 ;; (t nil) 738 ;; (t nil)
738 )) 739 ))
808 (save-excursion (set-buffer buffer) 809 (save-excursion (set-buffer buffer)
809 major-mode)))) 810 major-mode))))
810 (or (get mode 'frame-name) 811 (or (get mode 'frame-name)
811 get-frame-for-buffer-default-frame-name))) 812 get-frame-for-buffer-default-frame-name)))
812 813
813 814 (defun get-frame-for-buffer-make-new-frame (buffer &optional frame-name plist)
814 (defun get-frame-for-buffer-make-new-frame (buffer &optional frame-name) 815 (let* ((fr (make-frame plist))
815 (let* ((fr (make-frame (and frame-name (list (cons 'name frame-name)))))
816 (w (frame-root-window fr))) 816 (w (frame-root-window fr)))
817 ;; 817 ;;
818 ;; Make the one buffer being displayed in this newly created 818 ;; Make the one buffer being displayed in this newly created
819 ;; frame be the buffer of interest, instead of something 819 ;; frame be the buffer of interest, instead of something
820 ;; random, so that it won't be shown in two-window mode. 820 ;; random, so that it won't be shown in two-window mode.
845 ;; 845 ;;
846 ;; This buffer's mode expressed a preference for a frame of a particular 846 ;; This buffer's mode expressed a preference for a frame of a particular
847 ;; name. That always takes priority. 847 ;; name. That always takes priority.
848 ;; 848 ;;
849 (let ((limit (get name 'instance-limit)) 849 (let ((limit (get name 'instance-limit))
850 (defaults (get name 'frame-defaults))
850 (matching-frames '()) 851 (matching-frames '())
851 frames frame already-visible) 852 frames frame already-visible)
852 ;; Sort the list so that iconic frames will be found last. They 853 ;; Sort the list so that iconic frames will be found last. They
853 ;; will be used too, but mapped frames take precedence. And 854 ;; will be used too, but mapped frames take precedence. And
854 ;; fully visible frames come before occluded frames. 855 ;; fully visible frames come before occluded frames.
882 (cond (already-visible 883 (cond (already-visible
883 already-visible) 884 already-visible)
884 ((or (null matching-frames) 885 ((or (null matching-frames)
885 (eq limit 0) ; means create with reckless abandon 886 (eq limit 0) ; means create with reckless abandon
886 (and limit (< (length matching-frames) limit))) 887 (and limit (< (length matching-frames) limit)))
887 (get-frame-for-buffer-make-new-frame buffer name)) 888 (get-frame-for-buffer-make-new-frame
889 buffer
890 name
891 (alist-to-plist (acons 'name name
892 (plist-to-alist defaults)))))
888 (t 893 (t
889 ;; do not switch any of the window/buffer associations in an 894 ;; do not switch any of the window/buffer associations in an
890 ;; existing frame; this function only picks a frame; the 895 ;; existing frame; this function only picks a frame; the
891 ;; determination of which windows on it get reused is up to 896 ;; determination of which windows on it get reused is up to
892 ;; display-buffer itself. 897 ;; display-buffer itself.