From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Automatically adding local variables to tangled file Date: Mon, 10 Jun 2013 10:02:39 +0200 Message-ID: <87k3m21jhc.fsf@krugs.de> References: <878v2omz5g.fsf@krugs.de> <51af4bfd.0c95ec0a.2372.097e@mx.google.com> <87ehcf6xey.fsf@gmail.com> <87ehcewdye.fsf@krugs.de> <8738ssmoyl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulx44-0006OM-5d for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 04:02:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ulx42-0007dH-Qp for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 04:02:56 -0400 Received: from plane.gmane.org ([80.91.229.3]:42818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulx42-0007d8-KZ for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 04:02:54 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ulx41-0007xw-Mw for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 10:02:53 +0200 Received: from arn78-1-88-186-171-7.fbx.proxad.net ([88.186.171.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Jun 2013 10:02:53 +0200 Received: from Rainer by arn78-1-88-186-171-7.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Jun 2013 10:02:53 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eric Schulte 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 (=3D #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-re= ad-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 =2D-=20 Rainer M. Krug email: RMKruggmailcom --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJRtYgfAAoJENvXNx4PUvmC4MkIAJAoeJ1KXuji5XW14sHGxqis fjjlYJunz0uaGwqbao30QVn21PJE9DbX+4eZH7VnqQ2EnPBXzorzg4oNco8JKvqy mxHCPwTfj3iN32oJIjLsm0tobbVxAq64yo/9poTaXt9Dza/gP4M0ZG3y/cwRd7Hw /lI4b5RXK8QxcOlyJnBQXzRhjs3myAKU2lfc6FlTpUXFBBBp/9dTp7Gx3oCC+L66 08PEM6XPK6Aj5UIKApip6gUJRoCU1e/g6QM+6tPRYufYphevNUkA2co/CeOUH3T8 WUud1bHPjEQGL3+5pTLsN9/3gxm6/JUz0ul5HhLLFWKhSGKk8wpGoIHzmk3PI30= =rVDB -----END PGP SIGNATURE----- --=-=-=--