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: 02 Jul 2002 23:49:53 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5x7kkder5q.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> <5xr8inrvgr.fsf@kfs2.cua.dk> <200207021946.g62Jk9502033@aztec.santafe.edu> <200207022011.g62KBBv20071@rum.cs.yale.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1025643079 20918 127.0.0.1 (2 Jul 2002 20:51:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 2 Jul 2002 20:51:19 +0000 (UTC) Cc: Richard Stallman , 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 17PUcJ-0005RH-00 for ; Tue, 02 Jul 2002 22:51:19 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17PUhU-0004em-00 for ; Tue, 02 Jul 2002 22:56:40 +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 17PUc3-00062q-00; Tue, 02 Jul 2002 16:51:03 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17PUaK-0005vo-00; Tue, 02 Jul 2002 16:49:16 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 1C9FE7C016; Tue, 2 Jul 2002 20:49:15 +0000 (GMT) Original-To: "Stefan Monnier" In-Reply-To: <200207022011.g62KBBv20071@rum.cs.yale.edu> Original-Lines: 30 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:5366 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5366 "Stefan Monnier" writes: > > 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. > > > > We will do that by default for c-add-style, and various other > > safe functions for which users request it. > > I'm sure crackers will be happy about it. > The argument passed to `c-add-style' allows you to buffer-locally > set any variable to any value whatsoever. Hardly "safe" in my book. > I think it would be both simpler and safer to just provide a list variable, e.g. safe-local-eval-list, and let the user add his well-known eval hooks to it; the hook-code should then simply see if a questionable eval hook is a "member" of that list. E.g. I could add that specific '(c-add-style "StyleX" '(....))) to the list. And Karl could add his '(load "...") to the list. A much better approach IMHO. -- Kim F. Storm http://www.cua.dk