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#16028: 24.3.50; Latest build completely breaks my thumnail frames code Date: Fri, 13 Dec 2013 10:05:12 -0800 (PST) Message-ID: References: <746cd4cb-c69d-4cff-8dee-f7ccde3cb2f4@default> <52A1E5A6.3010901@gmx.at> <52A1F967.5070403@gmx.at> <6ee939f5-138d-4e5c-830e-8a20f8e45bea@default> <52A207C5.4070404@gmx.at> <12e899a3-dbf2-4b44-9b87-a0b9fc24f317@default> <52A2EE7B.4030105@gmx.at> <723644fb-f171-4bed-b8d0-7f9a1c8b9f7d@default> <52A4428F.4030101@gmx.at> <600e7b0c-73bb-4163-8d03-a8579f250045@default> <52A4B23E.9080609@gmx.at> <837gbeymiy.fsf@gnu.org> <52A60DD2.1020303@gmx.at> <83r49lxsxf.fsf@gnu.org> <52A6ED85.8020206@gmx.at> <52A6F1C4.3040803@gmx.at> <941b1292-a5c6-442d-afe8-d83aebf4b41c@default> <52A734F2.8020203@gmx.at> <52A98D4A.5000000@gmx.at> <039ebe72-12f8-49df-ae49-f1b7c56302e5@default> <52A9FC07.7040304@gmx.at> <3f787f9b-58e4-40b5-b012-59bf359af421@default> <52AADDAE.7030302@gmx.at> <6f8190dd-2b3c-4c83-b74b-b8a816611af4@default> <52AB42E5.3030306@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1386957980 7562 80.91.229.3 (13 Dec 2013 18:06:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Dec 2013 18:06:20 +0000 (UTC) Cc: 16028@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 13 19:06:25 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 1VrX85-000118-1b for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Dec 2013 19:06:25 +0100 Original-Received: from localhost ([::1]:44119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrX84-0006Jx-Gi for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Dec 2013 13:06:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrX7r-0006IU-Co for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2013 13:06:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrX7i-0000dc-Pm for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2013 13:06:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrX7i-0000dY-My for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2013 13:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VrX7i-0001HM-1H for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2013 13:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Dec 2013 18:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16028 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16028-submit@debbugs.gnu.org id=B16028.13869579214846 (code B ref 16028); Fri, 13 Dec 2013 18:06:01 +0000 Original-Received: (at 16028) by debbugs.gnu.org; 13 Dec 2013 18:05:21 +0000 Original-Received: from localhost ([127.0.0.1]:48789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrX72-0001G5-Dj for submit@debbugs.gnu.org; Fri, 13 Dec 2013 13:05:20 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:42031) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrX6y-0001Fv-Im for 16028@debbugs.gnu.org; Fri, 13 Dec 2013 13:05:17 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rBDI5E6k013717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Dec 2013 18:05:15 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rBDI5Dnx017884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Dec 2013 18:05:14 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rBDI5DRU000230; Fri, 13 Dec 2013 18:05:13 GMT In-Reply-To: <52AB42E5.3030306@gmx.at> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:81899 Archived-At: > > What solution was that? Can you state it again, in the context of > > the thumb-frm.el code? I believe I've tried everything I saw suggeste= d > > here, but I'm open to a fix for my code, of course. I've been asking > > for it. The last suggestion I recall was to change the order, and I > > reported the problems that caused. >=20 > To thumbify > (1) Save the current frame pixel size, font and scrollbar width. > (2) Set the new font size. > (3) Set the new scrollbar width. > (4) Set the new pixel size to some calculated from the one saved in > (1) and the scale factor used in (2). >=20 > To dethumbify > (5) Set the new font size to the one saved in (1). > (6) Set the new scrollbar width to the one saved in (1). > (7) Set the new frame pixel size to the one saved in (1). a. I don't know how to get the frame pixel size. Do you mean only `frame-pixel-width'? b. I need to allow users to specify settings for thumbified frames (option `thumfr-frame-parameters'). c. I need to be able to record the current frame parameters and use them to restore - for both thumbified and non-thumbified frames. I store this info in frame parameters `thumfr-thumbnail-frame' and `thumfr-non-thumbnail-frame'. Perhaps you can make a concrete suggestion, since you seem to understand what you have in mind by (1)-(7). I do not. But when I asked for concrete suggestions for "trying to get my code to work properly with your new code" you replied "I'm afraid there's not much you can do here." The code for `thumfr-thumbify-frame' and `thumfr-dethumbify-frame' is only 50 lines long, and (i) some of that is for stacking offsets, which is irrelevant here, and (ii) some of it is `font-too-small' error handling, to retry with a slightly larger font. Here is the essential code (30 lines): (defun thumfr-thumbify-frame (&optional frame) (interactive) (setq frame (or frame (selected-frame))) (let* ((tf-params (frame-parameter frame 'thumfr-non-thumbnail-frame= )) (non-tf-params (cl-remove-if #'thumfr-thumfr-parameter-p (frame-parameters frame)))) (unless (frame-parameter frame 'thumfr-thumbnail-frame) (set-frame-parameter frame 'thumfr-thumbnail-frame non-tf-params) (set-frame-parameter frame 'thumfr-non-thumbnail-frame nil) (condition-case thumfr-thumbify-frame (progn (enlarge-font (- thumfr-font-difference) frame) (when tf-params (modify-frame-parameters frame tf-params)) (modify-frame-parameters frame thumfr-frame-parameters)) (error (set-frame-parameter frame 'thumfr-non-thumbnail-frame tf-pa= rams) (set-frame-parameter frame 'thumfr-thumbnail-frame nil) (error (error-message-string thumfr-thumbify-frame))))))) (defun thumfr-dethumbify-frame (&optional frame) (interactive) (setq frame (or frame (selected-frame))) (let* ((non-tf-params (frame-parameter frame 'thumfr-thumbnail-frame)) (tf-params (cl-remove-if #'thumfr-thumfr-parameter-p (frame-parameters frame)))) (when non-tf-params (set-frame-parameter frame 'thumfr-non-thumbnail-frame tf-params) (set-frame-parameter frame 'thumfr-thumbnail-frame nil) (condition-case thumfr-dethumbify-frame (progn (enlarge-font thumfr-font-difference frame) (modify-frame-parameters frame non-tf-params)) (error (set-frame-parameter frame 'thumfr-thumbnail-frame non-tf-pa= rams) (set-frame-parameter frame 'thumfr-non-thumbnail-frame nil) (error (error-message-string thumfr-dethumbify-frame))))))) Helper code: (defun thumfr-thumfr-parameter-p (parameter+value) (memq (car parameter+value) '(thumfr-thumbnail-frame thumfr-non-thumbnail-frame))) (defcustom thumfr-frame-parameters '((menu-bar-lines . 0) (tool-bar-lines . 0) (scroll-bar-width . 6)) :type '(repeat (cons symbol sexp)) :group 'Thumbnail-Frames :set (lambda (sym defs) (custom-set-default sym defs) (dolist (frm (frame-list)) (when (and (frame-live-p frm) (frame-parameter frm 'thumfr-thumbnail-frame)) (modify-frame-parameters frm thumfr-frame-parameters)))))