From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: enable-local-variables and emacs --batch Date: Thu, 1 Nov 2018 10:54:02 -0400 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1541084385 15221 195.159.176.226 (1 Nov 2018 14:59:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2018 14:59:45 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 01 15:59:41 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gIERg-0003sJ-Rn for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Nov 2018 15:59:40 +0100 Original-Received: from localhost ([::1]:42444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIETn-0003qK-86 for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Nov 2018 11:01:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIESj-0003ag-PL for help-gnu-emacs@gnu.org; Thu, 01 Nov 2018 11:00:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIEMr-00029a-6I for help-gnu-emacs@gnu.org; Thu, 01 Nov 2018 10:54:41 -0400 Original-Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:36400) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gIEMq-00028o-TI for help-gnu-emacs@gnu.org; Thu, 01 Nov 2018 10:54:41 -0400 Original-Received: by mail-lj1-x234.google.com with SMTP id s15-v6so18332139lji.3 for ; Thu, 01 Nov 2018 07:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=P3fox+SWr9LUaSS5TVTLfKsOJOzULN8V+qsL7IlY//A=; b=M9xWPKMZ5oLww8IaTOTfNsA36QtJHd7w+eda4mnCDmnzAddyb+H07yBoQPZzLIPy2c kB/vQ8IxrysEbARqDlkeodOZQ38unFCDTlzA0LqUzWXtrJKRI6Y7PyBAIzYXjh9gLGMP 737Xe6+w82eiGacom9OAo9giaxFsM9iNsW9QE76chgxmKS8j89HLyEMmMs7jfQIhE3qW w2C7uRRZclBeyQe0YC90s3PXIgF6slcPjTj+ZGMIm8NSJ+N9muYx7YkjMUT0iSUfz1/V jtJ9Y6BgjUi/w2UB/ZHywvfhlSpvWmqIDtaxCka3C9jYgMZjSA8XdlfhSOK210XrOKgL 7LSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=P3fox+SWr9LUaSS5TVTLfKsOJOzULN8V+qsL7IlY//A=; b=dRe1doEsUaybFOSVQgiVEWf8OANJPqglXlbxDJRmwNCDV/lx07saZAbYs760hbwhHV KvW1eOVXtPKiOE/5MLNi51vpsNvH4jcKSbq+4RJyQQEppY85rweFEpVyyntA2Gp2n6kY h2lOz6riZFnlzMpY28ye/k+UDVWOkGbXKCGr4fBNw11mojVY7oWVs+jirEY+Z4U3Qkq+ qsXm7gW2vjgEwKB6msVfv7Pi+hcZiZjEGU+KX2lAfIn90yZmY0LqBWjUh+GODwv65XXw 3SE4yqxCDdPIMi3meqTKrdxK5Cw1ZwDDIM+TfbfJIUJAosiU1tAE/+I6Bd8c7De4RKjM vfvg== X-Gm-Message-State: AGRZ1gKbN64a0oRKZA5ZtZFvy8JFyOzKJ4dmKV4qwMn5BmNwdYW2JfU3 ppE4YluqBgctEbtbkoF30SurfP6fbLxPvXelAhfJIg== X-Google-Smtp-Source: AJdET5cqzgouUTkJvo+MdpejRirh3x27avitm4k5g1t5Y36uJvIyKgLwU8GZNbSd288ymUc6eq6H8te7YB6lUH1GSbo= X-Received: by 2002:a2e:1456:: with SMTP id 22-v6mr5064494lju.116.1541084078729; Thu, 01 Nov 2018 07:54:38 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::234 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118547 Archived-At: Hello, I am unable to get the safe-marked variables to evaluate from .dir-locals.el *only* when running emacs --batch. For example, I have the below evaluated in emacs --batch --eval before I load an Org file: (put 'org-hugo-section 'safe-local-variable 'stringp) And this in .dir-locals.el: ((org-mode . ((org-hugo-section . "foo")))) But the org-hugo-section does not get set to "foo". If I open an Org file in the directory with that .dir-locals.el in a non-batch regular Emacs session, C-h v org-hugo-section shows that it's set to "foo", and I get no prompts to apply/save that local variable (as expected because I have marked it as safe-local-variable). So the only way I can make the .dir-locals.el apply that value is if I do (setq enable-local-variables :all) when running emacs --batch. But I don't consider that safe. Why isn't the 'safe-local-variable attribute ignored only when running emacs --batch? My Emacs version: GNU Emacs 27.0.50 (build 34, x86_64-pc-linux-gnu, GTK+ Version 2.24.23) of 2018-10-31, built using commit 42681c54bf5ea2ff9d2a3ec6553766b194454caf. Thanks. -- Kaushal Modi