From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#6615: bug#34130: Specifying File Variables: mention why can't specify "current file" Date: Wed, 02 Oct 2019 13:48:28 +0200 Message-ID: References: <875zul79a8.fsf@jidanni.org> <83sgxpaz4y.fsf@gnu.org> <877e5oxo3d.fsf@gnus.org> <87wodojlne.5.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="258287"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 6615@debbugs.gnu.org, Lars Ingebrigtsen , 34130@debbugs.gnu.org To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 02 13:49:22 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFd8D-00151Q-QV for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Oct 2019 13:49:21 +0200 Original-Received: from localhost ([::1]:54064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFd8C-0000RR-5z for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Oct 2019 07:49:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39499) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFd7w-0000Pu-4X for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 07:49:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFd7u-0002k0-WF for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 07:49:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55024) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFd7u-0002jj-Pp for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 07:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFd7u-0007PX-Nl for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 07:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Oct 2019 11:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6615 X-GNU-PR-Package: emacs Original-Received: via spool by 6615-submit@debbugs.gnu.org id=B6615.157001691928441 (code B ref 6615); Wed, 02 Oct 2019 11:49:02 +0000 Original-Received: (at 6615) by debbugs.gnu.org; 2 Oct 2019 11:48:39 +0000 Original-Received: from localhost ([127.0.0.1]:35610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFd7X-0007Ob-CW for submit@debbugs.gnu.org; Wed, 02 Oct 2019 07:48:39 -0400 Original-Received: from mail-wm1-f49.google.com ([209.85.128.49]:33921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFd7V-0007OC-5c; Wed, 02 Oct 2019 07:48:37 -0400 Original-Received: by mail-wm1-f49.google.com with SMTP id y135so4748465wmc.1; Wed, 02 Oct 2019 04:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=F+NhBr8sBqSGQjGegqG9SX7LIXbf+QgJMBV9O8bz7lI=; b=cuDrKWGWeg293Uae/rBrQgtoqy+H3Jf5+qIk8dU7gM5De8lzkXfNC8huZlc0AmMK0f wyhbKGdb545mdPTi953ReVgZu6sOHK3XprpLtQewBxEMQQNi7rUcshiiwq5lY72xl3+j CQRqnQOKNgnoHdbIONuskIbFqr4pxvNovDnqoUTC6C5KJJxWaVUFrFKVJTitKurSYyYv iahR4I1oSi4BoUiZ5mFmqr3vEaRhDzdvTsdkPa/JWvWYT/P9lNW6PUD5TkbQmjGAhKAk IscaRRl9FCGZt/B3NBdqgGA0SFqN1YpNS0WzOhyf/L06I7Eo0AvgVVOFfmDq4cCkWxh+ DHew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=F+NhBr8sBqSGQjGegqG9SX7LIXbf+QgJMBV9O8bz7lI=; b=XVaHNPGw9rA6hJLcHT2mj0N3z1WHe44MvWtsdlFI4yfgM2BGR6ShoRYVI7R0rPUCal /YTAoRO4ggCYtWwUDVPHjNQ2yGf8GxIUnjERkC9oPmvN5ZGkfJ61MiUrTS7NsefHtgQ+ CAQIisYrjBlTG89ENdkJXIxc8CoY4SqxYNiwi+PsWSiTYpzFyS/KgYGJMLGcLV3Ff3Ss 1dldVIbDRBFkh8LwigM3AG7BTNtBtTUecs4VUljZ1DGPaY6jwXU9BtbRQ/pbu/ccGtlg OLKnr9QRFcLor8Q6hl/y/qHTCSmKcP6SdkzHC2w1yq0RiqOvg8qEdc3SywHF8VhJOQ6X tolA== X-Gm-Message-State: APjAAAVRa5/Fy0s/VCm5oYUkhupvhGOHszQgk+p54oO4Ce79Bb0vq4Bm qGDGTy2KSEFHsJdoi1ymQSSnWiSk X-Google-Smtp-Source: APXvYqwN3lOaLDF05QGmlr9Z2VYcn+XvJf/7dwjq0Vz4sADLT47E/7TaGEyyJTyQQeG9dACvUQf9Bg== X-Received: by 2002:a05:600c:20c4:: with SMTP id y4mr2295748wmm.87.1570016910787; Wed, 02 Oct 2019 04:48:30 -0700 (PDT) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id o19sm19467538wro.50.2019.10.02.04.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 04:48:29 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <87wodojlne.5.fsf@jidanni.org> ("=?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson"'s message of "Wed, 02 Oct 2019 03:44:37 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:168138 Archived-At: >>>>> On Wed, 02 Oct 2019 03:44:37 +0800, =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan J= acobson said: >>>>> "LI" =3D=3D Lars Ingebrigtsen writes: LI> Eli Zaretskii writes: >>>> On (info "(emacs) Specifying File Variables") >>>> at >>>>=20 >>>> # Local Variables: >>>> # compile-command: "cc foo.c -Dfoo=3Dbar -Dhack=3Dwhatever \ >>>> # -Dmumble=3Dblaah" >>>> # End: >>>>=20 >>>> do also mention why there is absolutely no way to say "<<>>", >>>> $$$${current_file} etc. if one wanted to, instead of needing to ha= rdwire >>>> the filename (foo.c) of the file (foo.c) into the file (foo.c) its= elf! Thanks. >>>=20 >>> Is something wrong with using buffer-file-name? You could create >>> compile-command by using 'eval', which can accept Emacs functions. LI> Indeed, so I don't think there's anything here to be fixed. Closin= g. =E7=A9=8D=E4=B8=B9=E5=B0=BC> eval needs to be whitelisted as a safe loc= al variable, creating a security hole. How about this instead: before-hack-local-variables-hook is a variable defined in `files.el'. Its value is (c-before-hack-hook) This variable may be risky if used as a file-local variable. Probably introduced at or before Emacs version 23.1. Documentation: Normal hook run before setting file-local variables. It is called after checking for unsafe/risky variables and setting `file-local-variables-alist', and before applying the variables stored in `file-local-variables-alist'. A hook function is allowed to change the contents of this alist. This hook is called only if there is at least one file-local variable to set.