From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15880: Compute C declarations for DEFSYMs automatically. Date: Wed, 13 Nov 2013 19:26:08 -0500 Message-ID: References: <5282C8F4.5010806@cs.ucla.edu> <52830A35.2020005@cs.ucla.edu> <5283A805.7030609@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384388837 29488 80.91.229.3 (14 Nov 2013 00:27:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Nov 2013 00:27:17 +0000 (UTC) Cc: 15880@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 14 01:27:20 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 1VgkmG-0006Ot-Ji for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2013 01:27:20 +0100 Original-Received: from localhost ([::1]:51801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgkmG-0002er-1k for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Nov 2013 19:27:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgkm6-0002dq-Gr for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2013 19:27:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vgklz-0004js-27 for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2013 19:27:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgkly-0004jn-VB for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2013 19:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vgkly-0007WI-B1 for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2013 19:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2013 00:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15880 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 15880-submit@debbugs.gnu.org id=B15880.138438878028853 (code B ref 15880); Thu, 14 Nov 2013 00:27:02 +0000 Original-Received: (at 15880) by debbugs.gnu.org; 14 Nov 2013 00:26:20 +0000 Original-Received: from localhost ([127.0.0.1]:50867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgklH-0007VJ-EY for submit@debbugs.gnu.org; Wed, 13 Nov 2013 19:26:19 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:32766) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgklD-0007Uv-Gk for 15880@debbugs.gnu.org; Wed, 13 Nov 2013 19:26:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFsr+b0/2dsb2JhbABEDr8AF3OCHgEBBAFWIwULCzQSFBgNJIgeBsEtkQoDiGGcGYFegjlc X-IPAS-Result: Av4EABK/CFFsr+b0/2dsb2JhbABEDr8AF3OCHgEBBAFWIwULCzQSFBgNJIgeBsEtkQoDiGGcGYFegjlc X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="37835182" Original-Received: from 108-175-230-244.dsl.teksavvy.com (HELO pastel.home) ([108.175.230.244]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 Nov 2013 19:26:09 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 08ACF60333; Wed, 13 Nov 2013 19:26:09 -0500 (EST) In-Reply-To: <5283A805.7030609@cs.ucla.edu> (Paul Eggert's message of "Wed, 13 Nov 2013 08:25:41 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:80399 Archived-At: >> I was thinking of doing it only for the DEFSYMs (which would obviously >> need to be kept in a separate file). > There still might be problems with existing symbols that are not > DEFSYMed. For example, suppose we add 'DEFSYM (Qprotected_field, > "protected-field");' to window.c. The new include file will be rebuilt > and only window.c will be recompiled, and 'make' will succeed. But > buffer.c (which declares Qprotected_field as a static var and > defines it by hand) will disagree with window.c about where > Qprotected_field is, so Emacs might not work right, and the > problems might be hard to find and diagnose. Doesn't sound like a serious problem to me. The two variables have the same name and same content and are read-only, so the redundancy is harmless. > Second, preallocate each DEFSYM's struct Lisp_Symbol, so that its > address is known at link-time. Not sure the performance impact would be significant. But I'm not opposed to such a change. As for the other change: ideally, I'd like to get rid of DEFSYM and introduce instead a new macro that would replace: ... Qfoo_bar ... syms_of_bar () { ... DEFSYM (Qfoo_bar, "foo-bar"); ... } with ... INTERN ("foo-bar") ... syms_of_bar () { ... /* nothing here */ ... } Now, I don't think we could do it with INTERN("foo-bar"). But we could probably do it with: ... INTERN (Qfoo_bar) ... syms_of_bar () { ... /* nothing here */ ... } such that make-docfile finds the "INTERN", infers the Lisp name from the C name and writes a "syms.c" file which does little else but initialize all those symbols. Stefan