From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] allow function values for `enable-local-eval' Date: 01 Jul 2002 23:26:12 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xr8inrvgr.fsf@kfs2.cua.dk> References: <200206281741.g5SHfAa04345@santafe.santafe.edu> <87u1nnnqlp.fsf@floss.i-did-not-set--mail-host-address--so-shoot-me> <5xit42rjic.fsf@kfs2.cua.dk> <200206292222.g5TMMKx10256@santafe.santafe.edu> <5x8z4wzbw7.fsf@kfs2.cua.dk> <200207011410.g61EA0Q07792@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1025555219 13647 127.0.0.1 (1 Jul 2002 20:26:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 1 Jul 2002 20:26:59 +0000 (UTC) Cc: kfogel@red-bean.com, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17P7lD-0003Y0-00 for ; Mon, 01 Jul 2002 22:26:59 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17P7pu-0004zT-00 for ; Mon, 01 Jul 2002 22:31:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17P7lL-0002w3-00; Mon, 01 Jul 2002 16:27:07 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17P7jr-0002rY-00; Mon, 01 Jul 2002 16:25:35 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 863227C017; Mon, 1 Jul 2002 20:25:33 +0000 (GMT) Original-To: rms@gnu.org In-Reply-To: <200207011410.g61EA0Q07792@aztec.santafe.edu> Original-Lines: 40 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5295 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5295 Richard Stallman writes: > I edited out the details but here it is: > > eval: (c-add-style "StyleX" (quote ((c-basic-offset . 4) (c-offsets-alist (label . *) ...))) t) > > This suggests we add a feature where a function can be marked > as "ok to call", provided its arguments are all constant. > That way, this would work with no user customization required. > Similar cases with other functions could be enabled globally, > and local customization would be easy too. This sounds like a good feature. > > We can add something more completely general if desired, > but I suspect this will handle all actual needs. Its advantage > is that we can make it DTRT for most of the cases, straight out > of the box. Well, I still need to do (put 'c-add-style 'safe-local-eval-function t) in my .emacs, but that's easier than writing my own hook function. > > Please try this code. It seemed to work for me. Works for me too. Thanks. The following comment seems corrupted; "expues" should be "values". I guess one too many replacement of "val" by "exp" :-) ;; Only allow safe expues of lisp-indent-hook; ;; not functions. (or (numberp (nth 3 exp)) (equal (nth 3 exp) ''defun))) -- Kim F. Storm http://www.cua.dk