From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 51e7e46: Font-lock elisp macros/special forms dynamically Date: Mon, 16 Mar 2015 08:54:57 +0100 Message-ID: <87sid52x7y.fsf@gnu.org> References: <20150315082509.21193.18465@vcs.savannah.gnu.org> <55054CE9.6010702@dancol.org> <87bnjt4e00.fsf@gnu.org> <550681E3.7080407@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1426492522 19390 80.91.229.3 (16 Mar 2015 07:55:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Mar 2015 07:55:22 +0000 (UTC) Cc: Stefan Monnier , Artur Malabarba , emacs-devel To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 16 08:55:10 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YXPrf-0005f8-PU for ged-emacs-devel@m.gmane.org; Mon, 16 Mar 2015 08:55:07 +0100 Original-Received: from localhost ([::1]:47745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXPre-00042N-Tb for ged-emacs-devel@m.gmane.org; Mon, 16 Mar 2015 03:55:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXPrb-00042F-6p for emacs-devel@gnu.org; Mon, 16 Mar 2015 03:55:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXPrX-0002rl-4L for emacs-devel@gnu.org; Mon, 16 Mar 2015 03:55:03 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:56088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXPrW-0002rg-Tk for emacs-devel@gnu.org; Mon, 16 Mar 2015 03:54:59 -0400 Original-Received: from thinkpad-t440p (dhcp132.uni-koblenz.de [141.26.71.132]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id D3F061A8454; Mon, 16 Mar 2015 08:54:57 +0100 (CET) Mail-Followup-To: Daniel Colascione , Stefan Monnier , Artur Malabarba , emacs-devel In-Reply-To: <550681E3.7080407@dancol.org> (Daniel Colascione's message of "Mon, 16 Mar 2015 00:10:27 -0700") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183898 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Daniel Colascione writes: >>> Loading Elisp files should be fairly rare. But there might be cases >>> where it can be done repeatedly, but if/when faced with such a >>> situation we should be able to handle it efficiently e.g. by >>> checking the load-history (make sure the file did include some >>> definitions before we bother to scan symbols and rebuild the regexp) >>> since such "run-time loading" probably won't define new functions. >>=20 >> Like so? > > Instead of doing it this way, why not make a font-lock matcher that > looks at *every* initial sexp atom, calls intern-soft on it, and > applies a face that depends on properties of the found symbol? This > way, we'd update fontification not only after load, but also after > eval-defun, and it'd be easy to make a `declare'-form that provided > for exceptions from the general rule. Also sounds good to me, and even simpler implementation-wise. So I'm happy to implement it that way if nobody comes up with a reason why that's not the right way. And we need to decide if we're opt-in, e.g., (defmacro foo () (declare font-lock-keyword) ...) makes foo highlighted as a keyword, or if we're opt-out, e.g., all macros are highlighted by default unless declared as (defmacro foo () (declare no-font-lock-keyword) ...) And I'm open to a better declaration names than the ones above. Bye, Tassilo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlUGjFEACgkQ795mVA/1wV3gbQEAoI+Ojgo2d+f4gKz6/e49nIr+ CZthzI2Qo5YavE9qNcYA/38ZbfsVhxEXfL3veDDcetqAIk9taFN78y/3KUg5BL8j =12ch -----END PGP SIGNATURE----- --=-=-=--