emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Automatically adding local variables to tangled file


From: Rainer M Krug
Subject: Re: [O] Automatically adding local variables to tangled file
Date: Mon, 10 Jun 2013 10:02:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Eric Schulte <address@hidden> writes:

>>>
>>> We already set the permission of tangled files to be executable when
>>> they include a shebang line.  Perhaps we could add an option (or change
>>> the default) to set the permissions of tangled files to be read only.
>>>
>>> Perhaps this could be done using the post-tangle hook with something
>>> like the following.
>>>
>>>     ;; -*- emacs-lisp -*-
>>>     (defun org-babel-mark-tangled-as-read-only ()
>>>       "Mark the current file read only.
>>>     If it is executable keep it executable."
>>>       (if (= #o755 (file-modes (buffer-file-name)))
>>>           (set-file-modes (buffer-file-name) #o555)
>>>           (set-file-modes (buffer-file-name) #o444)))
>>>
>>>     (add-hook 'org-babel-post-tangle-hook 
>>> 'org-babel-mark-tangled-as-read-only)
>>>
>>
>> I think that would be a good idea to add this in a way so that it is
>> controled by a variable
>
> I've added a :tangle-mode header argument which may be used to control
> the permissions of tangled files.  See the manual for instructions on
> it's usage.


Thanks a lot. I will try it out today or tomorrow.

Cheers,

Rainer



-- 
Rainer M. Krug

email: RMKrug<at>gmail<dot>com

Attachment: pgpOEp0xHUNU_.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]