From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: setting minor mode via file local variable from function Date: Fri, 14 Jun 2013 00:03:34 +0200 Message-ID: <8738slbrd5.fsf@rosalinde.fritz.box> References: <87ip1i2lax.fsf@krugs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371161044 15088 80.91.229.3 (13 Jun 2013 22:04:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Jun 2013 22:04:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 14 00:04:04 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UnFch-0008Eb-Oz for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Jun 2013 00:04:03 +0200 Original-Received: from localhost ([::1]:55113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnFch-0007ao-4o for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Jun 2013 18:04:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnFcT-0007ah-Ut for help-gnu-emacs@gnu.org; Thu, 13 Jun 2013 18:03:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnFcR-0003WY-BS for help-gnu-emacs@gnu.org; Thu, 13 Jun 2013 18:03:49 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:38849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnFcR-0003WH-5A for help-gnu-emacs@gnu.org; Thu, 13 Jun 2013 18:03:47 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UnFcO-00081G-PM for help-gnu-emacs@gnu.org; Fri, 14 Jun 2013 00:03:44 +0200 Original-Received: from i59f57a13.versanet.de ([89.245.122.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Jun 2013 00:03:44 +0200 Original-Received: from stephen.berman by i59f57a13.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Jun 2013 00:03:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i59f57a13.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91532 Archived-At: On Thu, 13 Jun 2013 14:16:40 +0200 Rainer M Krug wrote: > Hi > > I have the following function definition: > > ,---- > | (defun org-babel-mark-file-as-tangled () > | (when (string-match "[.]R" (buffer-file-name)) > | (add-file-local-variable 'org-babel-tangled-file t) > | (add-file-local-variable 'buffer-read-only t) > | (basic-save-buffer))) > `---- > > Now I would like to set the minor mode (auto-revert-mode) as > well. According to the manual, one should use > > ,---- > | eval: (auto-revert-mode) > `---- > > But how can I include this in my function above? How about this: (defun org-babel-mark-file-as-tangled () (when (string-match "[.]R" (buffer-file-name)) (add-file-local-variable 'org-babel-tangled-file t) (add-file-local-variable 'buffer-read-only t) (add-file-local-variable 'eval '(auto-revert-mode)) (basic-save-buffer))) Steve Berman