From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#8856: 24.0.50; regression: special-display-frame is no longer dedicated Date: Thu, 23 Jun 2011 09:45:29 -0700 Message-ID: <5450FF6E1BAC409AB30733F9ABE51C31@us.oracle.com> References: <853BDEF1AA9646ACB90724066E1A5951@us.oracle.com><4DF65024.20305@gmx.at><0C191F638279437BADFCC697A5389F9E@us.oracle.com><4DF726A1.7020804@gmx.at><8E7452317D5B4FD183FD24E0FAA14F6F@us.oracle.com><4DFB6BBF.3080504@gmx.at><6FAF5DFD0E094823A512C3E0E87B6DF5@us.oracle.com><4DFE09A7.10500@gmx.at><0137606B527A48C69E3D6C704C5C6595@us.oracle.com><4DFF1709.3010409@gmx.at><309F7428711D4BEBB6063C60808D8069@us.oracle.com><4E00C54C.5080108@gmx.at><7AF0B637CAE14034973FBCC658AFEBD9@us.oracle.com> <31769215C0FF4E1E89F9F641C5843E91@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_009E_01CC318A.4A571290" X-Trace: dough.gmane.org 1308853737 2435 80.91.229.12 (23 Jun 2011 18:28:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2011 18:28:57 +0000 (UTC) Cc: 8856@debbugs.gnu.org To: "'martin rudalics'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 23 20:28:53 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QZoe4-0005AA-Q8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Jun 2011 20:28:53 +0200 Original-Received: from localhost ([::1]:43397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZoe3-0007X3-L3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Jun 2011 14:28:51 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZn2b-0005He-DS for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2011 12:46:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZn2Z-0004PK-Is for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2011 12:46:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZn2Z-0004PF-8h for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2011 12:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QZn2Y-0004sq-Gp; Thu, 23 Jun 2011 12:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Jun 2011 16:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8856 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8856-submit@debbugs.gnu.org id=B8856.130884755118753 (code B ref 8856); Thu, 23 Jun 2011 16:46:02 +0000 Original-Received: (at 8856) by debbugs.gnu.org; 23 Jun 2011 16:45:51 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QZn2N-0004sQ-7u for submit@debbugs.gnu.org; Thu, 23 Jun 2011 12:45:51 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QZn2K-0004sD-SO for 8856@debbugs.gnu.org; Thu, 23 Jun 2011 12:45:49 -0400 Original-Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by rcsinet10.oracle.com (Switch-3.4.4/Switch-3.4.2) with ESMTP id p5NGjeUb005019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 23 Jun 2011 16:45:42 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p5NGjdT8001412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2011 16:45:40 GMT Original-Received: from abhmt001.oracle.com (abhmt001.oracle.com [141.146.116.10]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p5NGjX6u002682; Thu, 23 Jun 2011 11:45:33 -0500 Original-Received: from dradamslap1 (/10.159.61.188) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 23 Jun 2011 09:45:32 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcwwMJAJgbB4AcwWRUKQOUT5Wc2+IgABpU7gAA6Nv/AAVM4y4A== In-Reply-To: <31769215C0FF4E1E89F9F641C5843E91@us.oracle.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: rtcsinet21.oracle.com [66.248.204.29] X-CT-RefId: str=0001.0A090208.4E036DB6.015E:SCFSTAT5015188, ss=1, re=-6.300, fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 23 Jun 2011 12:46:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47421 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_009E_01CC318A.4A571290 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > I comment out the two lines > ;; (load-file "c:/drews-lisp-20/hexrgb.el") > ;; (load-file "c:/drews-lisp-20/fit-frame.el") > at the beginning of the file. I hope they are not needed. Yes, that was an oversight. They are not needed at all. > > Note: In the file, both of these two lines are necessary, > > to cause the error: > > (add-hook 'post-command-hook '1on1-fit-minibuffer-frame) > > (setq w32-grab-focus-on-raise nil) > > Both are in here. Yes, they are needed. > With the `post-command-hook' active, focus remains always within the > Minibuffer frame at the bottom of my screen, whatever silly I > type. The Completions frame is never selected. So lets hope > this got fixed. > > I attach a copy of window.el as usual. If you think that > hexrgb and/or fit-frame are needed for showing the bug, > please tell me so. (No, those files are not needed. You can remove those two lines.) Testing with the latest window.el you just sent, here are the results: THE GOOD NEWS: With the last setup we both tried, no bug! That is: runemacs.exe -Q --debug-init -l "window-2011-06-23a-MARTIN.el" -l "throw-three.el" -f "1on1-emacs" THE BAD NEWS: So I pared down again. The bug happens if you make just this change in the definition of `1on1-emacs': Change these lines: (if 1on1-minibuffer-frame (modify-frame-parameters 1on1-minibuffer-frame 1on1-minibuffer-frame-alist) (setq 1on1-minibuffer-frame (make-frame 1on1-minibuffer-frame-alist))) To these, which is really what I use: (if 1on1-minibuffer-frame (modify-frame-parameters 1on1-minibuffer-frame 1on1-minibuffer-frame-alist) (setq 1on1-minibuffer-frame (let ((after-make-frame-functions nil)) (make-frame 1on1-minibuffer-frame-alist)))) IOW, the difference is that `after-make-frame-functions' is bound to nil when `make-frame' is called. I do that to inhibit my `fit-frame' from doing anything. I have `fit-frame' on `after-make-frame-functions'. I attached the file - just do as before, using this instead of throw-three.el. I can try removing just `fit-frame' from that hook and then restoring it. But I think I shouldn't have to. I think that correct behavior should not depend on `after-make-frame-functions'. Don't you agree? Can you please take a look and see why and whether it is necessary that a user _not_ bind `after-make-frame-functions' to nil here? Why should `after-make-frame-functions' have any effect on whether keyboard input for *Completions* gets properly redirected to the minibuffer frame? You don't use `after-make-frame-functions' in your code, do you? If so, that I think is probably a bad idea. Such hooks should be only for additional, user etc. things, not for necessary code for vanilla Emacs to work normally. Anyway, please let me know what you think. Give it a try with that `let' binding (just use the attached file), to confirm that you at least see the same problem as I. We can then worry about what to do to fix or work around the problem. Again, the problem happens only when the *Completions* is first created. What happens on MS Windows is that whenever a frame is created it gets selected (by the OS/window mgr - there is no way around this). And for some reason, I guess because of emptying `after-make-frame-functions', that Windows-frame-selection-on-creation is now also selecting the window/buffer, and in such a way that keyboard input is not being correctly redirected to the minibuffer frame. And as before (since you made some changes a few days ago), things do work correctly once the *Completions* frame has been created. If that frame is already showing and I repeat the recipe (M-x etc.) there is no problem. And that is true regardless of which frame is selected when I start with M-x: the *scratch* frame, the minibuffer frame, or even the *Completions* frame. When I hit M-x, the input is always correctly redirected to the minibuffer frame, so there is no error saying that *Completions* is read-only. (Again, this is when *Completions* was already showing.) I think (and hope) we are almost there. Something seems to be preventing the input-focus redirection just after the *Completions* frame is created, when `after-make-frame-functions' is nil. Thx - Drew ------=_NextPart_000_009E_01CC318A.4A571290 Content-Type: application/octet-stream; name="throw-fit-1.el" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="throw-fit-1.el" (setq debug-on-error t)=0A= =0A= ;;; Minibuffer frame: ********************************=0A= ;;;=0A= (defvar 1on1-minibuffer-frame nil "")=0A= =0A= (defcustom 1on1-minibuffer-frame-alist=0A= (list=0A= (assq 'foreground-color minibuffer-frame-alist)=0A= (or (assq 'background-color minibuffer-frame-alist)=0A= (cons 'background-color "LightBlue"))=0A= (assq 'font minibuffer-frame-alist)=0A= (assq 'mouse-color minibuffer-frame-alist)=0A= (assq 'cursor-color minibuffer-frame-alist)=0A= (or (assq 'menu-bar-lines minibuffer-frame-alist)=0A= (cons 'menu-bar-lines 0))=0A= (or (assq 'left minibuffer-frame-alist)=0A= (cons 'left 0))=0A= (or (assq 'height minibuffer-frame-alist)=0A= (cons 'height 2))=0A= (or (assq 'icon-type minibuffer-frame-alist)=0A= (cons 'icon-type (< emacs-major-version 21))) ; `t' for Emacs 21 = too?=0A= (or (assq 'minibuffer minibuffer-frame-alist)=0A= (cons 'minibuffer 'only))=0A= (or (assq 'user-position minibuffer-frame-alist)=0A= (cons 'user-position t))=0A= (or (assq 'vertical-scroll-bars minibuffer-frame-alist) ; No scroll = bar.=0A= (cons 'vertical-scroll-bars nil))=0A= (or (assq 'name minibuffer-frame-alist)=0A= (cons 'name "Emacs Minibuffer")))=0A= ""=0A= :type '(repeat (cons :format "%v" (symbol :tag "Frame Parameter") = (sexp :tag "Value")))=0A= :group 'One-On-One)=0A= =0A= ;;; *Completions* frame: ********************************=0A= (defcustom 1on1-default-frame-alist=0A= (list=0A= (assq 'foreground-color default-frame-alist)=0A= (or (assq 'background-color default-frame-alist)=0A= (cons 'background-color "LightBlue"))=0A= (assq 'font default-frame-alist)=0A= (assq 'mouse-color default-frame-alist)=0A= (assq 'cursor-color default-frame-alist)=0A= (assq 'cursor-type default-frame-alist)=0A= (or (assq 'menu-bar-lines default-frame-alist)=0A= (cons 'menu-bar-lines 1))=0A= (or (assq 'top default-frame-alist)=0A= (cons 'top 0))=0A= (or (assq 'left default-frame-alist)=0A= (cons 'left 0))=0A= (or (assq 'width default-frame-alist)=0A= (cons 'width 80))=0A= (or (assq 'height default-frame-alist)=0A= (cons 'height 35))=0A= (or (assq 'minibuffer default-frame-alist)=0A= (cons 'minibuffer nil))=0A= (or (assq 'user-position default-frame-alist)=0A= (cons 'user-position t))=0A= (or (assq 'vertical-scroll-bars default-frame-alist)=0A= (cons 'vertical-scroll-bars 'right))=0A= (or (assq 'icon-type default-frame-alist)=0A= (cons 'icon-type (< emacs-major-version 21))) ; `t' for Emacs 21 = too?=0A= (or (assq 'tool-bar-lines default-frame-alist)=0A= (cons 'tool-bar-lines 1)) ; Emacs 21+=0A= (if (cdr (assq 'left-fringe default-frame-alist))=0A= (assq 'left-fringe default-frame-alist)=0A= (cons 'left-fringe 0)) ; Emacs 21+=0A= (if (cdr (assq 'right-fringe default-frame-alist))=0A= (assq 'right-fringe default-frame-alist)=0A= (cons 'right-fringe 0)) ; Emacs 21+=0A= (or (assq 'fringe default-frame-alist)=0A= (cons 'fringe 0))) ; Emacs 21, but not 21.3.50 - = REMOVE after 22.x=0A= ""=0A= :type '(repeat (cons :format "%v" (symbol :tag "Frame Parameter") = (sexp :tag "Value")))=0A= :group 'frames)=0A= =0A= ;;; Special-display frames=0A= (defcustom 1on1-special-display-frame-alist=0A= (list=0A= (assq 'font special-display-frame-alist)=0A= (or (assq 'width special-display-frame-alist)=0A= (cons 'width 80))=0A= (or (assq 'height special-display-frame-alist)=0A= (cons 'height 20))=0A= (assq 'mouse-color special-display-frame-alist)=0A= (assq 'cursor-color special-display-frame-alist)=0A= (or (assq 'menu-bar-lines special-display-frame-alist)=0A= (cons 'menu-bar-lines 1))=0A= (assq 'foreground-color special-display-frame-alist)=0A= (or (assq 'background-color special-display-frame-alist)=0A= (cons 'background-color "LightSteelBlue"))=0A= (or (assq 'top special-display-frame-alist)=0A= (cons 'top 0))=0A= (or (assq 'left special-display-frame-alist)=0A= (cons 'left 0))=0A= (or (assq 'unsplittable special-display-frame-alist)=0A= (cons 'unsplittable t))=0A= (or (assq 'user-position special-display-frame-alist)=0A= (cons 'user-position t))=0A= (or (assq 'vertical-scroll-bars special-display-frame-alist)=0A= (cons 'vertical-scroll-bars 'right)))=0A= ""=0A= :type '(repeat (cons :format "%v" (symbol :tag "Frame Parameter") = (sexp :tag "Value")))=0A= :group 'frames)=0A= =0A= (defun 1on1-emacs ()=0A= ""=0A= (interactive)=0A= (unless (if (fboundp 'display-graphic-p) (display-graphic-p) = window-system)=0A= (error "Use `1on1-emacs' only with a graphics display, not with a = text terminal"))=0A= (setq default-frame-alist (append 1on1-default-frame-alist = default-frame-alist)=0A= special-display-frame-alist (append = 1on1-special-display-frame-alist=0A= special-display-frame-alist))=0A= (add-to-list ; *Help* frame=0A= 'special-display-buffer-names=0A= (list "*Help*" '1on1-display-*Help*-frame=0A= (list (cons 'background-color "Thistle")=0A= '(height . 40))))=0A= (add-to-list ; *Completions* frame=0A= 'special-display-buffer-names=0A= `("*Completions*" 1on1-display-*Completions*-frame=0A= ((background-color . "LavenderBlush2")=0A= (menu-bar-lines . 0) (tool-bar-lines . 0)=0A= (width . 100))))=0A= (setq pop-up-frames t)=0A= ;; Minibuffer frame=0A= (setq minibuffer-frame-alist (append 1on1-minibuffer-frame-alist=0A= minibuffer-frame-alist))=0A= =0A= (if 1on1-minibuffer-frame=0A= (modify-frame-parameters 1on1-minibuffer-frame = 1on1-minibuffer-frame-alist)=0A= (setq 1on1-minibuffer-frame=0A= (let ((after-make-frame-functions nil)) ; E.g. inhibit = `fit-frame'.=0A= (make-frame 1on1-minibuffer-frame-alist))))=0A= ;; (if 1on1-minibuffer-frame=0A= ;; (modify-frame-parameters 1on1-minibuffer-frame = 1on1-minibuffer-frame-alist)=0A= ;; (setq 1on1-minibuffer-frame=0A= ;; (make-frame 1on1-minibuffer-frame-alist)))=0A= (set-frame-width 1on1-minibuffer-frame 150)=0A= (modify-frame-parameters 1on1-minibuffer-frame `((top ,@ -50)))=0A= (setq minibuffer-auto-raise t)=0A= =0A= ;; Hooks.=0A= ;; @@@=0A= (add-hook 'post-command-hook '1on1-fit-minibuffer-frame)=0A= (setq w32-grab-focus-on-raise nil)=0A= ;; @@@=0A= )=0A= =0A= (defun 1on1-display-*Help*-frame (buf &optional args)=0A= ""=0A= (let (return-window)=0A= (setq return-window (select-window (funcall special-display-function = buf args)))=0A= (raise-frame)=0A= return-window))=0A= =0A= (defun 1on1-display-*Completions*-frame (buf &optional args)=0A= ""=0A= (let (return-window)=0A= (setq return-window (select-window (funcall special-display-function = buf args)))=0A= (raise-frame)=0A= (when (boundp '1on1-minibuffer-frame)=0A= (redirect-frame-focus (selected-frame) 1on1-minibuffer-frame))=0A= return-window))=0A= =0A= ;; @@@=0A= (defun 1on1-fit-minibuffer-frame ()=0A= ""=0A= (interactive)=0A= (when (and (active-minibuffer-window)=0A= (save-selected-window=0A= (select-window (minibuffer-window))=0A= (one-window-p nil 'selected-frame)))=0A= (let* ((frame (save-selected-window=0A= (select-window (minibuffer-window)) = (selected-frame)))=0A= (frame-height (frame-height frame)))=0A= (cond=0A= ((eq last-command '1on1-fit-minibuffer-frame)=0A= (set-frame-height frame (1+ (frame-height frame)))=0A= (modify-frame-parameters 1on1-minibuffer-frame `((top ,@ -50)))=0A= (condition-case nil (scroll-down (frame-height frame)) (error = nil)))=0A= (t=0A= (let ((window-min-height 2))=0A= (modify-frame-parameters 1on1-minibuffer-frame `((top ,@ = -50)))=0A= (condition-case nil (scroll-down (frame-height frame)) (error = nil))))))))=0A= =0A= ;; @@@=0A= =0A= =0C=0A= (load-file "c:/drews-lisp-20/window-2011-06-23a-MARTIN.el")=0A= ------=_NextPart_000_009E_01CC318A.4A571290--