emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <r.m.krug@gmail.com>
To: Vitalie Spinu <spinuvit@gmail.com>
Cc: Rainer M Krug <Rainer@krugs.de>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Wrong comment character when adding file local variables?
Date: Fri, 7 Jun 2013 17:40:53 +0200	[thread overview]
Message-ID: <CAGhLh6Gsp0a-ghjsKejAfT1E=QgqztyCMzHj9nLp0TKaPjU0EA@mail.gmail.com> (raw)
In-Reply-To: <87y5amdoae.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3784 bytes --]

On Friday, June 7, 2013, Vitalie Spinu wrote:

>
> All your examples are placed in fundamental mode. The comments are
> treated by org and thus are correct, local variables are inserted
> according to the major mode.
>
> The question is why - all .R files are automatically in r mode when I open
them and all other R files tangle fine.


> I don't how this could be easily fixed on org side, but you can solve it
> straightforwardly with:
>
>    (add-to-list 'auto-mode-alist (cons "NAME\\|DESC" 'R-mode))


Ok - I'check it out on Monday.

Cheers and have a nice weekend,

Rainer

>
>  Vitalie
>
>  >> Rainer M Krug <Rainer@krugs.de <javascript:;>>
>  >> on Fri, 07 Jun 2013 15:12:58 +0200 wrote:
>
>  > Hi
>
>  > when tangling the following file
>
>  > ,----
>  > | * Package Files
>  > | ** DESCRIPTION File
>  > | :PROPERTIES:
>  > | :tangle:   ./DESCRIPTION
>  > | :shebang:
>  > | :padline: no
>  > | :no-expand: TRUE
>  > | :comments: no
>  > | :END:
>  > | #+begin_src R
>  > |   Package: asmDrak
>  > | #+end_src
>  > |
>  > | ** NAMESPACE File
>  > | :PROPERTIES:
>  > | :tangle:   ./NAMESPACE
>  > | :shebang:
>  > | :padline: no
>  > | :no-expand: TRUE
>  > | :comments: no
>  > | :END:
>  > | #+begin_src R
>  > |  this is a test
>  > | #+end_src
>  > |
>  > |
>  > | ** DESC2 File
>  > | :PROPERTIES:
>  > | :tangle:   ./DESC2
>  > | :shebang:
>  > | :padline: no
>  > | :no-expand: TRUE
>  > | :comments: yes
>  > | :END:
>  > | #+begin_src R
>  > |   this is a test
>  > | #+end_src
>  > `----
>
>  > I get the following tangled files:
>
>  > DESCRIPTION:
>
>  > ,----
>  > | Package: asmDrak
>  > |
>  > | ;; Local Variables:
>  > | ;; org-babel-tangled-file: t
>  > | ;; buffer-read-only: t
>  > | ;; End:
>  > `----
>
>  > which has the wrong comment character (should have #)
>
>  > NAMESPACE:
>
>  > ,----
>  > | this is a test
>  > |
>  > | ## Local Variables:
>  > | ## org-babel-tangled-file: t
>  > | ## buffer-read-only: t
>  > | ## End:
>  > `----
>
>  > which has the correct comment characters, and
>
>  > DESC2
>
>  > ,----
>  > | ## [[file:~/tmp/tangle.org::*DESC2%20File][DESC2\ File:1]]
>  > | this is a test
>  > | ## DESC2\ File:1 ends here
>  > |
>  > | ;; Local Variables:
>  > | ;; org-babel-tangled-file: t
>  > | ;; buffer-read-only: t
>  > | ;; End:
>  > `----
>
>  > which has the correct comment characters for the comments, but the wrong
>  > ones for the file local variables.
>
>  > I use the following in my .emacs file to set the post-tangle-hook to add
>  > the local file variables:
>
>  > ,----
>  > |   (defvar org-babel-tangled-file nil
>  > |     "If non-nill, current file was tangled with org-babel-tangle")
>  > |   (put 'org-babel-tangled-file 'safe-local-variable 'booleanp)
>  > |
>  > |   (defun org-babel-mark-file-as-tangled ()
>  > |     (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))
>  > |
>  > |   (add-hook 'org-babel-post-tangle-hook
> 'org-babel-mark-file-as-tangled)
>  > `----
>
>  > I assume this is a bug somewhere?
>
>  > Org-mode version 8.0.3 (release_8.0.3-211-gf16b53 @
>  > /home/rkrug/.emacs.d/org-mode/lisp/)
>
>  > GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.6.4)
>  >  of 2013-04-14 on actinium, modified by Debian
>
>  > Cheers,
>
>  > Rainer
>


-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

[-- Attachment #2: Type: text/html, Size: 5225 bytes --]

  reply	other threads:[~2013-06-07 15:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 13:12 Wrong comment character when adding file local variables? Rainer M Krug
2013-06-07 13:48 ` Vitalie Spinu
2013-06-07 15:40   ` Rainer M Krug [this message]
2013-06-07 16:48     ` Vitalie Spinu
2013-06-10  8:27       ` Rainer M Krug
2013-06-10 13:19         ` Nick Dokos
2013-06-10 14:55           ` Rainer M Krug
2013-06-08  7:47     ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGhLh6Gsp0a-ghjsKejAfT1E=QgqztyCMzHj9nLp0TKaPjU0EA@mail.gmail.com' \
    --to=r.m.krug@gmail.com \
    --cc=Rainer@krugs.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=spinuvit@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).