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: Re: enable-local-variables and emacs --batch Date: Sat, 3 Nov 2018 07:18:23 -0400 Message-ID: References: <83a7mqfrll.fsf@gnu.org> <8336sifnfx.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1541243856 4913 195.159.176.226 (3 Nov 2018 11:17:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Nov 2018 11:17:36 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 03 12:17:32 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 1gItvi-00014r-Gt for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Nov 2018 12:17:26 +0100 Original-Received: from localhost ([::1]:55128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gItxm-0006fr-Mp for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Nov 2018 07:19:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gItxI-0006a8-5k for help-gnu-emacs@gnu.org; Sat, 03 Nov 2018 07:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gItxH-0003qo-Ab for help-gnu-emacs@gnu.org; Sat, 03 Nov 2018 07:19:04 -0400 Original-Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:42435) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gItxF-0003n7-JD; Sat, 03 Nov 2018 07:19:01 -0400 Original-Received: by mail-lj1-x22e.google.com with SMTP id f3-v6so3912296ljk.9; Sat, 03 Nov 2018 04:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iEh3/wmTMKBDdxVdIvgJF/fLwbFRQc5m56WA+AW/Agw=; b=a7QrKgc1xeRqmewwzI1jjaEeL1jphMmbEVDfm+drD4EOUHtKIJgs4ANs/E7NjUqDeV wG4gQQDGyVpRyBZ3qSgPPeNsP7LoX01ePvcK9sHkKVjpYOZMYMuNCtQgvGEqLKiHaGrz YPP9UDUiT0DXKRTW6Bi/yNqDpDr4h6NWkJj14Q6ZXm901Xd2IUW+XB6lc7pR851l0n/Q vUzTpqBOQ8JV/FmTuqkXU5/qEy17M5SYYBwiObWfT4fxfjYB0nL/ZvHULRHPNpy6YbME Bm+2FoTYgTGkrQmLXrKNiQsek6Exn7tKYWDyUw9rsZPprun2FJLVA/10OhIjDxjBPZHA l0Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iEh3/wmTMKBDdxVdIvgJF/fLwbFRQc5m56WA+AW/Agw=; b=Lmqiga8RzbpPjITe/b20Ror3VidPE/Yku4PdnCRV3jwioTIJV7WDCa2jJ4fQDBfBK8 3hw6TyJ3Qi28CJ8uVmX/lLVZZIiRYUBHTDzZBoBfK8TEUoZb7lL1GmBTkCXxNpbSsFnU YSdJKxZzWG/VT2GLeI9IgwUxrjSCVA6CAw9qlyhKK/swknuvRv1fpNOPDiymAULikZGx 8LkJE3nIMC+NkdS49OwObuva4gpABrRReUsVk8UovBs0ziDp2KGRKdjom/M7lsuiY9y1 hv+lZkVGHWjHNO+9QaTuJZWCxJWrAja/93IC+siKi5HX1A+Pv0gCmbn3riHbTTGjaOTp wp2g== X-Gm-Message-State: AGRZ1gLF0wAb82wnrtKU/gg3Cy3uCPhkDwclL2JNT87WilY13zwgvTW3 o+Lnz7Yzu7VOlAqHyOtmmCHHqFlVz53eYo4xM+bUrXTQ X-Google-Smtp-Source: AJdET5fm8E07dUBr7PFSm1l9P4LlHhm9mgHczkGTV3ibFSBFFTLtq08Rrrv5jY+QWIZDwiC2JT3soeWgzv/nPjJHvRo= X-Received: by 2002:a2e:5109:: with SMTP id f9-v6mr9719032ljb.52.1541243939692; Sat, 03 Nov 2018 04:18:59 -0700 (PDT) In-Reply-To: <8336sifnfx.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22e 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:118576 Archived-At: On Sat, Nov 3, 2018 at 6:47 AM Eli Zaretskii wrote: > > If you are going to have a small reproducer (and don't find the > problem while working on that), then why not step through the relevant > code in Edebug and see why it doesn't work? How can I Edebug in emacs --batch (also what to edebug?). I see that enable-local-variables is `t' (default value), and still the .dir-locals.el is ineffective in --batch. Otherwise, in regular emacs sessions, the put safe-local-variable + .dir-locals.el combo works well. Here's a minimal example. 1. Create a temp dir 2. Create the below setup-foo.el file in there. 3. touch foo.org 4. emacs --batch --eval '(load-file "setup-foo.el")' foo.org -f echo-foo ===== setup-foo.el ===== (defconst foo nil) (put 'foo 'safe-local-variable 'stringp) ;; Uncomment below to make the .dir-locals.el set value to apply. ;; (setq enable-local-variables :all) (defun echo-foo () (message "enable-local-variables = %S" enable-local-variables) (if (boundp 'foo) (progn (message "foo = %S" foo) (if foo (message "The value of `foo' from .dir-locals.el was applied.") (message "The value of `foo' from .dir-locals.el was *not* applied."))) (message "`foo' is not defined"))) =====