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#19217: 25.0.50; `C-M-x' (`eval-defun') on a `defface' that is not top-level Date: Sun, 30 Nov 2014 20:29:18 -0800 (PST) Message-ID: <183f89bc-527c-48ad-80ae-fd73c52874fe@default> References: 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 1417408235 16283 80.91.229.3 (1 Dec 2014 04:30:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2014 04:30:35 +0000 (UTC) Cc: 19217@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 01 05:30:28 2014 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 1XvIcx-0006Vb-7Q for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Dec 2014 05:30:23 +0100 Original-Received: from localhost ([::1]:52725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvIcw-0003cS-Ll for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Nov 2014 23:30:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvIcm-0003cL-DW for bug-gnu-emacs@gnu.org; Sun, 30 Nov 2014 23:30:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvIcd-0002ax-NA for bug-gnu-emacs@gnu.org; Sun, 30 Nov 2014 23:30:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvIcd-0002a0-Jt for bug-gnu-emacs@gnu.org; Sun, 30 Nov 2014 23:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XvIcc-0007Wy-Uc for bug-gnu-emacs@gnu.org; Sun, 30 Nov 2014 23:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Dec 2014 04:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19217 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19217-submit@debbugs.gnu.org id=B19217.141740816628869 (code B ref 19217); Mon, 01 Dec 2014 04:30:02 +0000 Original-Received: (at 19217) by debbugs.gnu.org; 1 Dec 2014 04:29:26 +0000 Original-Received: from localhost ([127.0.0.1]:50283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XvIc1-0007VY-GQ for submit@debbugs.gnu.org; Sun, 30 Nov 2014 23:29:25 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:46360) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XvIbz-0007VQ-Fn for 19217@debbugs.gnu.org; Sun, 30 Nov 2014 23:29:24 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sB14TLhu023552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Dec 2014 04:29:22 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 sB14TJMn000187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 1 Dec 2014 04:29:20 GMT Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sB14TJ1R003516; Mon, 1 Dec 2014 04:29:19 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.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:96774 Archived-At: > > It is not uncommon to have a `defface' inside a condition such as > > (when (> emacs-major-version 23)...). >=20 > Obviously, I'm blindsided by looking mostly at bundled Elisp code, > but to get an idea of how common it might be, could you explain why > you'd want to wrap it in that way? I just did - when the defface (e.g. the given face itself) makes sense only for certain Emacs versions. It doesn't matter how common it is - it is common enough. There is no reason users should not have a simple way to redefine a defface, defvar, or defcustom, at top level or not. This should not need to be justified by showing how commonly it is needed. Obviously this is only a nice-to-have; we've been getting along without it for decades. So what? The current limitation to top-level is for what reason? For users? I'm guessing that the only answer is that this limitation simplifies the *implementation*, not that it simplifies things for users. 30 years later, we ought to be able to do a little better (for users). I suggested a simple improvement that can be made easily - let users do it at least when point is on the defface etc. symbol. That's a limitation, but it at least gives you some way to easily redefine the critter. The point is that there is currently *no* way for a user to do it. It's not about making things super general. Just give us some easy way to do it. Let's not let the search for something ideal become the enemy of making a simple improvement. > > How about letting users redefine a `defface' with `C-M-x' even in > > this case? >=20 > I think I'd welcome a patch which fixes this well enough > (including in the case of C-u C-M-x). I don't have a patch. I too welcome a simple improvement here.=20 > The current way C-M-x handled defvar/defface is hackish and ugly. I assume you're talking about the implementation and not the way users interact with Emacs using it. The current user interaction is simple and useful. > Extending this hack to code wrapped in a conditional test would > not be welcome. Sounds like we're in for a few more decades of the same. > But replacing the hack with something a bit more generic would > be nice. Provided we don't lose other functionality or convenience. "Beware the generic rewrite improvement." This should not be a big deal.