From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: "Why is emacs so square?" Date: Fri, 17 Apr 2020 11:27:56 -0400 Message-ID: <6479af83-2cab-05b0-3042-8030ec3f1e1d@gmail.com> References: <8wXYP4GY9hwW-9mYv6_LGMETZ8Vz3Ob1Bec6yh6kPT7yxjTkxA3V6dXY4ELra9tYiJUxJmgXKSIEX4w8HFiPRoeGVSQHDSoBVy1voj1e3Qo=@protonmail.com> <87wo6h1kwl.fsf@emailmessageidheader.nil> <83k12hgt43.fsf@gnu.org> <838siwhmco.fsf@gnu.org> <0348a76e-d55a-2e75-8ed1-1beaa6649ed6@gmail.com> <837dyfe45q.fsf@gnu.org> <245308ec-5154-7d4b-dba4-0b21f42a0e95@gmail.com> <835zdze1gs.fsf@gnu.org> <51cb2788-3086-367d-ec05-ea324da49a12@gmail.com> <83imhyd1w1.fsf@gnu.org> <83f35fb6-806e-1b28-da76-31919a398045@gmail.com> <833692cgr4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------852BCA930A222E0F05FA3CE1" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="46249"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 17 17:28:50 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jPSvC-000Bvp-Ba for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Apr 2020 17:28:50 +0200 Original-Received: from localhost ([::1]:48506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPSvB-0007j6-E1 for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Apr 2020 11:28:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52259) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPSuS-0006rz-Dn for emacs-devel@gnu.org; Fri, 17 Apr 2020 11:28:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPSuQ-0004BC-OZ for emacs-devel@gnu.org; Fri, 17 Apr 2020 11:28:04 -0400 Original-Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:45234) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPSuQ-00049U-3f; Fri, 17 Apr 2020 11:28:02 -0400 Original-Received: by mail-qk1-x734.google.com with SMTP id m67so2726873qke.12; Fri, 17 Apr 2020 08:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=LxP0r6LdptHncGPzl1GLukBbufBh0oO5Os2Tropj2fE=; b=sC+HYB7Fi5Wu17jxFV9wUOxuvKUqiGvE77DxbISEKEoMBsTm3MuUHOIgDycJ7w+Jrk z5+pIrtVy1WTIw0HlAOxORe8mIFHgM50RDgcxm30XyNWj+WzbM54aQ36eHAW4J+w45L5 vs6Ytds6D4BmQGoVEVRNM/7yyoxtWT2L9Hlm6sBql8WLUiFGdvdFVxJDnQNauDFvEEmM iq6JVdEAANl8p5zlhqTxHtBEx1mKu7Xhlvkezs2JUSwqfodHCbkxSL4aqewOujFmTYHE xfkIHzUdqTcPW7jyXtpSTTRxrMyp4Vs6McgsSHPa7t2cm/iB7RHh9nKdOlpc5GM4KCbl QZbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=LxP0r6LdptHncGPzl1GLukBbufBh0oO5Os2Tropj2fE=; b=sgPnUKU8HNET6HOUuaHjkFOZlZI6nR4Rvb3OxAiImr2Pbq/+T+d7vl9K0JQM8ZJSHw bDeu6TDJz6DwgcdrgFESpeFh+FQ1p0Hy/IQNpfB3tAHhe3kq/q8WDA3m7K6kr/4uR0TR HKub/vjZDYA3rLxIe1d139fL9GJ8IoqNsAwk5yaOuIQcmvSk00npc4NaeB6VjVznxhmf ymdWp+vkkknD0WbTI6imii0ALOWzm/v5m6HUTjilidBdfhy+fjeH+MKDoIyRZlTA+Wn+ aOyOhJHQ01iZWJT6SBhpvnp56tr5VSk9TtcTG2fn0JyU7yFW6ywxm8R7hfUFnEbMoVNu t+aA== X-Gm-Message-State: AGi0PubfDrRz1RcVtJLWN9b9+Q4YKEEyoVndTJyxyXI1lR2/1sLMGKlG Zn7vAdI5QLPSkSVxBGAvRnxrVcWH X-Google-Smtp-Source: APiQypLEZen6lvuuXQx1WNiYCY/bnLRxvajaAy6QxoWlsP3ah1enSdLESHR6QJjbRnql5+lD3zldgQ== X-Received: by 2002:a37:54e:: with SMTP id 75mr3800046qkf.257.1587137278279; Fri, 17 Apr 2020 08:27:58 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:9ded:7322:a320:d8bc? ([2601:184:4180:66e7:9ded:7322:a320:d8bc]) by smtp.googlemail.com with ESMTPSA id 134sm4225358qki.16.2020.04.17.08.27.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Apr 2020 08:27:57 -0700 (PDT) In-Reply-To: <833692cgr4.fsf@gnu.org> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::734 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:247174 Archived-At: This is a multi-part message in MIME format. --------------852BCA930A222E0F05FA3CE1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 17/04/2020 10.46, Eli Zaretskii wrote: >> From: Clément Pit-Claudel >> Date: Fri, 17 Apr 2020 10:13:58 -0400 >> Cc: emacs-devel@gnu.org >> >> This definition is evaluated once and for all, instead of once per frame. Isn't that a bug? > > I don't know. AFAIK, we don't have infrastructure for deciding when > stuff like that needs to be re-evaluated and how to use different > results for different frames. If someone wants to work on such > infrastructure, I think it will bring us a step closer to being able > to support different GUI frame types (like GTK, w32, NS, etc.) in the > same session. I may be missing something, but I don't think such infrastructure is needed here — we already have most of what's needed with conditional faces. The attached patch gets us 90% of the way, with the only remaining issue being wrapping buttons in square brackets on text terminals. We'd also need a similar trick for check-boxes and the like. WDYT? --------------852BCA930A222E0F05FA3CE1 Content-Type: text/x-patch; charset=UTF-8; name="custom-raised-buttons.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="custom-raised-buttons.diff" diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index d3d17fda7a..2f29a00de2 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1599,8 +1599,7 @@ custom-search-field :version "24.1" :group 'custom-buffer) -(defcustom custom-raised-buttons (not (equal (face-valid-attribute-values :box) - '(("unspecified" . unspecified)))) +(defcustom custom-raised-buttons t "If non-nil, indicate active buttons in a raised-button style. Otherwise use brackets." :type 'boolean @@ -2113,7 +2112,8 @@ custom-magic-reset (defface custom-button '((((type x w32 ns) (class color)) ; Like default mode line :box (:line-width 2 :style released-button) - :background "lightgrey" :foreground "black")) + :background "lightgrey" :foreground "black") + (t :inherit custom-button-unraised)) "Face for custom buffer buttons if `custom-raised-buttons' is non-nil." :version "21.1" :group 'custom-faces) @@ -2137,17 +2137,23 @@ custom-button-unraised :version "22.1" :group 'custom-faces) +(defface custom-button-mouse-unraised + '((t :inherit highlight)) + "Mouse face for custom buffer buttons if `custom-raised-buttons' is nil." + :version "22.1" + :group 'custom-faces) + (setq custom-button (if custom-raised-buttons 'custom-button 'custom-button-unraised)) (setq custom-button-mouse - (if custom-raised-buttons 'custom-button-mouse 'highlight)) + (if custom-raised-buttons 'custom-button-mouse 'custom-button-mouse-unraised)) (defface custom-button-pressed '((((type x w32 ns) (class color)) :box (:line-width 2 :style pressed-button) :background "lightgrey" :foreground "black") - (t :inverse-video t)) + (t :inherit custom-button-pressed-unraised)) "Face for pressed custom buttons if `custom-raised-buttons' is non-nil." :version "21.1" :group 'custom-faces) --------------852BCA930A222E0F05FA3CE1--