From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14233: 24.3; Don't constrain frame size to character multiples Date: Tue, 23 Apr 2013 19:28:51 +0300 Message-ID: <834nexxlbw.fsf@gnu.org> References: <2r7gjy2gyy.fsf@fencepost.gnu.org> <83bo991z00.fsf@gnu.org> <517257A0.4080607@gmx.at> <071A708E-3A98-4D11-A15F-7AB92D5200DD@swipnet.se> <51727563.70905@gmx.at> <5172908F.7090206@swipnet.se> <83sj2lz6nm.fsf@gnu.org> <5172EBEF.7030301@swipnet.se> <5173B0D8.4010408@gmx.at> <9CE9273D-8550-478F-8CB9-0C0D693C0BB8@swipnet.se> <5175042E.5020508@gmx.at> <5064BF03-8A61-4C0E-AA6C-5197A177B61A@swipnet.se> <517558ED.7080907@gmx.at> <5175679B.8010903@gmx.at> <83ehe2xw7q.fsf@gnu.org> <51762F98.9060505@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1366734613 20699 80.91.229.3 (23 Apr 2013 16:30:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Apr 2013 16:30:13 +0000 (UTC) Cc: esabof@gmail.com, 14233@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 23 18:30:17 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UUg6i-0004a3-1P for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Apr 2013 18:30:16 +0200 Original-Received: from localhost ([::1]:53519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUg6h-0005Zp-Gz for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Apr 2013 12:30:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUg6Y-0005OD-Li for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2013 12:30:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUg6X-0002UE-BT for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2013 12:30:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUg6X-0002SO-94 for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2013 12:30:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UUgBJ-0004LP-SZ for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2013 12:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Apr 2013 16:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14233 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14233-submit@debbugs.gnu.org id=B14233.136673487716644 (code B ref 14233); Tue, 23 Apr 2013 16:35:01 +0000 Original-Received: (at 14233) by debbugs.gnu.org; 23 Apr 2013 16:34:37 +0000 Original-Received: from localhost ([127.0.0.1]:39252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUgAv-0004KO-97 for submit@debbugs.gnu.org; Tue, 23 Apr 2013 12:34:37 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:46151) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUgAs-0004K4-O0 for 14233@debbugs.gnu.org; Tue, 23 Apr 2013 12:34:36 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MLP00A00V35GM00@a-mtaout22.012.net.il> for 14233@debbugs.gnu.org; Tue, 23 Apr 2013 19:28:53 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MLP00AUKV448T40@a-mtaout22.012.net.il>; Tue, 23 Apr 2013 19:28:53 +0300 (IDT) In-reply-to: <51762F98.9060505@gmx.at> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:73606 Archived-At: > Date: Tue, 23 Apr 2013 08:52:08 +0200 > From: martin rudalics > CC: jan.h.d@swipnet.se, esabof@gmail.com, 14233@debbugs.gnu.org > > >> change_frame_size has no idea whether it is called for a text or a > >> graphical frame. > > > > That is done very easily, given the frame pointer (which > > change_frame_size accepts as its 1st argument). E.g.: > > > > if (FRAME_WINDOW_P (f)) > > /* do the GUI thing */ > > A couple of weeks ago I asked you whether HAVE_WINDOW_SYSTEM would be > sufficient but got no answer :-( The problem is that I'm still not sure > whether FRAME_WINDOW_P is sufficient. At least in frame.c all > FRAME_WINDOW_P calls are guarded by HAVE_WINDOW_SYSTEM checks as > > #ifdef HAVE_WINDOW_SYSTEM > if (FRAME_WINDOW_P (XFRAME (this))) > ... > #endif That's because the members of 'struct frame' that are tested by FRAME_WINDOW_P do not exist unless HAVE_WINDOW_SYSTEM is defined. Emacs caters to TTY frames both in a build --without-x, where HAVE_WINDOW_SYSTEM is not defined and none of the X code is compiled; and in a build that does support GUI frames, but just created a text-mode frame for some reason. Thus the need to have the code both ifdef'ed away at compile time and tested at run time. > so some doubt remains whether this predicate is correctly installed on > every platform. There's no doubt: it is, as described above. > In any case I'd want either an #ifdef or a simple and robust > predicate without having to care about #ifdefs. Sorry, you can't, not with the current infrastructure. You must do it with a predicate that is also protected with an ifdef. > >> Text frames might want to call it as before using character sizes. > > > > On text-mode frames, each character is one pixel. Emacs knows that > > already. > > In the past weeks I started to doubt whether Emacs really knows > everything it pretends to know. Maybe so, but "1 character == 1 pixel on TTY frames" does not belong to any gray areas. > >> In any case, the callers have to strip space used for tool- or > >> menubars because change_frame_size does not know whether these are > >> part of the frame or not. > > > > Why can't change_frame_size know that? > > The callers should know best whether a toolbar is part of their frames > or not. But we could obviously teach change_frame_size to check that. I think all the information is already stored in the frame object.