Re: [O] koma letter exporter: changing the priority of options

2013-06-10 Thread Alan Schmitt
Viktor Rosenfeld writes:

 Hi Alan,

 Alan Schmitt wrote:

 Hello,
 
 I just had to write a new letter with a fresh LCO file, and I would like
 to propose to change the priority of options. The current priority is:
 local options  emacs variables  lco file.
 
 Unfortunately emacs variables have a default value, which means they are
 output in the .tex file even if they are not set. Thus it is impossible
 to set some options in the lco file (such as foldmarks or backaddress).

 Why not simply set these Emacs variables to nil? Then they are not
 written in the TeX file and the LCO file works as expected.


Yes, this would be a good choice. I'll do it, unless someone complains.

Thanks,

Alan



Re: [O] A simple way to search only headlines

2013-06-10 Thread Sebastien Vauban
Hi Nick,

Nick Dokos wrote:
 The OP probably wants this in the global keymap, rather than in the
 org-mode-map: just like the agenda dispatcher C-c a, this functionality is
 useful outside an org file.

 (global-set-key (kbd C-M-h) (lambda () (interactive) (org-agenda nil s 
 )))

Not sure to understand when this functionality would be useful outside of Org.
Can you explain?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] org-cut-subtree, bug?

2013-06-10 Thread Carsten Dominik

On 10 jun. 2013, at 07:39, Andreas Röhler andreas.roeh...@easy-emacs.de wrote:

 Issue doesn't show up with Emacs built from trunk

Thank your for following up, Andreas.

- Carsten


 
 GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.18) of 2013-06-07
 
 Thanks,
 
 Andreas
 




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

2013-06-10 Thread Rainer M Krug

Eric Schulte schulte.e...@gmail.com 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: RMKrugatgmaildotcom


pgp1GVTMFuQJL.pgp
Description: PGP signature


Re: [O] :session question

2013-06-10 Thread Rainer M Krug

top post - sorry: I overlooked this thread somehow.

Eric Schulte schulte.e...@gmail.com writes:

 Achim Gratz strom...@nexgo.de writes:

 Eric Schulte writes:
 If you mean that there should be new syntax for setting header arguments
 on a file or sub-tree basis w/o using file local variables, I'd be happy
 to apply a patch.

 I'm thinking that something like

 #+PROPERTY: header-args:R :session *R* :exports none

 should work.

 I hate to change syntax, but the syntax you mention above does look both
 appealing and natural.  Even with working file local variables [1].

I agree - it looks very intuitive.


 I've checked that the property interface returns the data as expected,
 but I haven't implemented anything yet.  It does not seem to be an
 overly difficult endeavour, however.


 That is very good news.  With that portion working I would agree that
 this should be a fairly straightforward task.


 But importantly, there should be no way to set a default session name
 without also specifying the language, regardless of which way one
 tries to set this up.

 If you can think of a clean way to implement this then we should go for
 it.  I doubt many existing configurations rely on this behavior.

 General settings for all languages should be effected by

 #+PROPERTY: header-args :results value :exports none

 and there'd be a list of header arguments (or specific values) that are
 either ignored or warned about when not associated with a particular
 language.

 BTW, I think the current property syntax for header arguments should be
 deprecated since it is the only place where the leading : is missing
 for those.

 Comments, thoughts?


 I think these are great ideas.  Personally I'd love to see them
 implemented.  Unfortunately I don't have time to work on an
 implementation currently.  I'm surprised that none of the users who
 motivated this discussion have chimed in.  Their opinions may be more

Shame on my head - here are now a few comments (and praises) following
in next emails.

Cheers,

Rainer

 valuable than my own in this regard (as I'm not a heavy #+Property
 user).

 Thanks for the clean and initially tested implementation idea!



 Regards,
 Achim.


 Footnotes: 

 [1]  Thanks to Bastien my patch allowing variables like
  `org-babel-default-header-args:R' to be set file-local has been
  applied to Emacs.

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom


pgpqMMj3gichR.pgp
Description: PGP signature


Re: [O] :session question

2013-06-10 Thread Rainer M Krug
Achim Gratz strom...@nexgo.de writes:

 Achim Gratz writes:
 The change on the Babel side was just a few lines, but reconciling Org's
 notion of property syntax in various places proved to be more difficult.

 It's still not very well tested (it does survive the test suite
 obviously) and I'll need to write tests and documentation (help is
 welcome).  Also, a new-style form of specifying header arguments for all
 languages (to then deprecate the old form) is missing at the moment
 since I'd like to get feedback on the language specific side first.

 No comments?

Not tested, but it I like the idea and the syntax - very nice indeed.

Cheers,

Rainer



 Regards,
 Achim.


-- 
Rainer M. Krug

email: RMKrugatgmaildotcom


pgpWK6YALK9zj.pgp
Description: PGP signature


Re: [O] :session question -- and changes to #+Property: syntax

2013-06-10 Thread Rainer M Krug
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi Achim,

 Achim Gratz strom...@nexgo.de writes:

 Eric Schulte writes:
 As I recall I was fully in favor of applying these changes, however I am
 not qualified to address the changes to property behaviors.  Hopefully
 someone who works more on that side of things can address those aspects.

 I am still hoping that one of the users that was asking for a way to
 specify header args at a finer granularity than just file variables
 would have a say.

 As a clarification: I'm not changing property syntax at all, I'm adding
 new properties that happen to have values that look like the header
 arguments to a source block.  I've also implemented default
 (non-language-specific) header arguments just now.  Unless you use the
 new property names none of the current behaviour changes (I do think the
 old properties should be removed some time later when people had time to
 convert their documents), but using the new property names will take
 precedence.  This means if you specify 'cache yes' and also
 'header-args :cache no' via properties, then the latter will take
 effect.

 Documentation and tests are still missing, but it shouldn't take too
 long I hope.


 I just applied your patches.  Besides a quick test that went very well,
 I can not say much.  The functionality is exactly what would help me a
 lot to separate session information for R and shell blocks.  But given
 the example in the code, this is known to you.

 I would love to see that functionality in org and did not experience any
 problems after applying the patches.

OK - I will change my syntax to the new property syntax and report back,
likely not before middle of the week.

Thanks,

Rainer


 Regards,
 Andreas



#secure method=pgpmime mode=sign

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom




Re: [O] Wrong comment character when adding file local variables?

2013-06-10 Thread Rainer M Krug
Vitalie Spinu spinu...@gmail.com writes:

   Rainer M Krug r.m.k...@gmail.com
   on Fri, 7 Jun 2013 17:40:53 +0200 wrote:

   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.

 Because they are placed automatically in R mode, your files are in
 fundamental mode.

I think I get it now: my files are interpreted by emacs as fundamental
files. But when I visit them in a buffer, the buffer is interpreted as
an R buffer.

Thanks.

Rainer



 Vitalie



#secure method=pgpmime mode=sign

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom




Re: [O] :session question -- and changes to #+Property: syntax

2013-06-10 Thread Rainer M Krug

Achim Gratz strom...@nexgo.de writes:

 Eric Schulte writes:
 Great.  Would you be willing to go ahead and apply these changes
 (including documentation)?  If it upsets anyone we'll sort things out on
 the mailing list.

 All right, then.  I've pushed the first part as it is a preparation for
 the actual change.  I can push that second part as well, but I'll need
 another week or so for properly documenting it in the manual and setting
 up a test.  Unless someone urgently wants to do something with it, I'd
 rather push these things together.

As mentioned, I would then change my optional syntax of PROPERTY
tomorrow. If you prefer earlier feedback, I could give it.

Cheers,

Rainer




 Regards,
 Achim.


-- 
Rainer M. Krug

email: RMKrugatgmaildotcom


pgpVlMFfPiake.pgp
Description: PGP signature


Re: [O] koma letter exporter: changing the priority of options

2013-06-10 Thread Rasmus
Viktor Rosenfeld listuse...@gmail.com writes:

 ,
 | \KOMAoption{backaddress}{true}
 | \KOMAoption{foldmarks}{true}
 | \KOMAoption{fromphone}{true}
 | \KOMAoption{fromemail}{true}
 `

 Perhaps the best option would be to change the default value of these
 variables to nil? We have almost every option that personalizes
 a letter, e.g., opening and closing, set to nil already. The only
 benefit of having default values is to show off the features of
 org-koma-letter. But it seems to be interfering with people's workflow
 so best turn them off.

Doesn't this also more or less correspond to the default value of
scrlttr2?  If so there's no reason to add it to the tex file and nil
is indeed a better default. 

–Rasmus

-- 
Hooray!




[O] [PATCH] org-contacts: Provide ordering when using cycle completion

2013-06-10 Thread Øyvind Stegard
Hello list,

I have recently switched to using org-contacts, after several years of
BBDB usage. When completing contacts in message-mode, I prefer cycling
the completion alternatives, for instance when a single contact has
multiple email addresses. So I set `completion-cycle-threshold' to some
value other than nil.

However, the cycle ordering was not consistent with the order in which
email addresses appeared in the contact (actually, cycle order was
shortest candidate first, which I understand is a default). So the
preferred email address (or the first one defined in :EMAIL: property
of contact node) was typically not always chosen as first completion
suggestion in the cycle.

I attach a patch here (against current org-mode git) which also provides
the display sort function for cycle completions in metadata. That seems
to resolve the problem for me.


Regards,

Øyvind Stegard
-- 
 Øyvind Stegard
  http://stegard.net/

From 64623274f0a040c452df43b2a3f7b23b0af8fd57 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Stegard?= oyvind.steg...@ifi.uio.no
Date: Mon, 10 Jun 2013 11:08:56 +0200
Subject: [PATCH] org-contacts: Provide ordering when using cycle completion

* contrib/lisp/org-contacts.el (org-contacts-metadata-prefix):
Provide same function for cycle ordering as is used for display ordering
in completion metadata.

When using cycle completion style for contacts, by setting
`completion-cycle-threshold' to some value, the ordering was not consistent
with order of email addresses in contact definition, nor the order
which was used for regular display completion. Fix that by also
supplying sort function for cycle completion in metadata.
---
 contrib/lisp/org-contacts.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 5d63fcc..71f7bf4 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -452,7 +452,8 @@ prefixes rather than just the beginning of the string.
 
 (defun org-contacts-metadata-prefix (string collection predicate)
   '(metadata .
-	 ((display-sort-function . org-contacts-display-sort-function
+	 ((cycle-sort-function . org-contacts-display-sort-function)
+	  (display-sort-function . org-contacts-display-sort-function
 
 (defun org-contacts-complete-group (start end string)
   Complete text at START from a group.
-- 
1.8.1.2



[O] Problem in tangle-mode -- WAS: Automatically adding local variables to tangled file

2013-06-10 Thread Rainer M Krug
Rainer M Krug rai...@krugs.de writes:

 Eric Schulte schulte.e...@gmail.com 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.

I did, and there is a problem with tangling multiple blocks into a
single file:

The following does not work:

,
| #+PROPERTY: tangle-mode (identity #o444)
| #+PROPERTY: tangle ./tools.R
| * Two blocks
| Block 1
| #+begin_src R
|   suitName - function(species)
| {
|   return( paste(species$layer, suitability, sep=_) )
| }
| #+end_src  
| 
| Block 2
| #+begin_src R
|   statDistName - function(species){
|   return( paste(species$layer, disturbances_static, sep=_) )
|   }
| #+end_src  
`

It seems that the second block can not be written, as the file is
already set to read-only.

For the moment, I exclude this setting again but will try it out as son
as it is fixed.

Cheers,

Rainer



 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 :   +33 - (0)9 58 10 27 44

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

email:  rai...@krugs.de

Skype:  RMkrug


pgptdQzb6gji1.pgp
Description: PGP signature


Re: [O] cannot open org files without heading

2013-06-10 Thread henry atts
henry atts s...@online.de writes:

 Let's say I have an org file without any heading. When I want to open it
 in emacs I have to try twice. First time nothing happens and emacs tells
 me ``before first heading''. It only will be opened at the second try.
 Okay, org files do need a heading and that is the way emacs urges me to
 insert one at last.
 I can live with it and try it twice. But if I want to open an org file
 without heading on the commandline with emacsclient (or if I want to
 create a new one this way) like: `emacsclient -t new.org' then nothing
 at all happens and I have to kill the unfinished process with CTRL-C.

 I afterwards have to reset the terminal because it `looks weird' (line
 breaks and spacings are gone) which I find rather inconvenient. 


The culprit is:

(add-hook 'org-mode-hook 'org-tree-slide-mode)

(add-hook 'find-file-hook
  '(lambda () (when (eq major-mode 'org-mode)

(org-tree-slide-mode

henry

-- 
web: http://literaturlatenight.de
jabberID: att...@jabber.at




[O] absurd (was: Xemacs 21.5.32 org-8.03 almost)

2013-06-10 Thread Uwe Brauer

Now the make process is getting absurd. 
For example I put in org-agenda.el

(if (featurep 'xemacs)
(define-obsolete-variable-alias 'org-agenda-menu-two-column 
'org-agenda-menu-two-columns)
  (define-obsolete-variable-alias 'org-agenda-menu-two-column 
'org-agenda-menu-two-columns 24.3))

Now when I run make, with the local.mk for Xemacs, 

oldorg: # do what the old Makefile did by default.

,
[+]
| ##--
| ##  CHECK AND ADAPT THE FOLLOWING DEFINITIONS
| ##--
| .PHONY: xemacs
| xemacs: up0 doc uncompiled
| EMACS   = /usr/local/bin/xemacs
| prefix  = /home/oub/xemacs/site-lisp/packages
| lispdir = $(prefix)/org
| datadir = $(prefix)/etc/org
| infodir = $(prefix)/info
| 
| BTEST = /bin/true
| BATCH = $(EMACS) -batch -q -vanilla # XEmacs
| # How to byte-compile the whole source directory
| ELCDIR  = $(BATCH) \
| --eval '(add-to-list '''load-path .)' \
| --eval '(byte-recompile-directory . 0)'
`




I obtain

,
[+]
| While compiling toplevel forms in file
| /home/oub/ALLES/xemacs/site-lisp/packages/org-8.0.3/lisp/org-agenda.el:
|   !! Wrong number of arguments ((define-obsolete-function-alias 2))
|   !! Wrong number of arguments ((define-obsolete-function-alias 2))
| 
| xemacs exiting.
`


But  according to the docstring:

,
[+]
| 
| `define-obsolete-function-alias' is a built-in compiled Lisp function
|   -- loaded from
| /home/oub/ALLES/Add-Import/xemacs-21.5.32-xsymbol/lisp/obsolete.elc
| (define-obsolete-function-alias OLDFUN NEWFUN)
| 
| Documentation:
| Define OLDFUN as an obsolete alias for function NEWFUN.
| This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN
| as obsolete.
`

When I byte compile org-agenda.el individually no such problem occurs. 

What is wrong?

thanks

Uwe Brauer 



smime.p7s
Description: S/MIME cryptographic signature


Re: [O] org-agenda-files defvar directory evaluation ?

2013-06-10 Thread 'Mash

Resolved this via stackoverflow.

(setq org-agenda-files (list org-dir))

http://stackoverflow.com/questions/17020119/org-mode-org-agenda-files-defvar-directory-evaluation/17021834

Quoting 'Mash mash...@toshine.net:


Sorry not quite sure how to phrase the problem in the subject line there.

I have the following setup in my .emacs ...

(defvar org-dir /home/mash/read/org/)

And use it around such as ...

(setq org-directory org-dir)
(setq org-default-notes-file (concat org-dir mash.org))

Now I understand that you can specify a directory such as ...

(setq org-agenda-files '(/home/mash/read/org/))

But how would I do this with the variable?

(setq org-agenda-files '(org-dir))
(setq org-agenda-files '(,(org-dir))

Any ideas as I would like to use it in my capture templates too ...

(setq org-capture-templates
  '(
(t Test entry (file+headline (concat org-dir test.org test)
 * %?)
))



Many thanks,

'Mash



'to life is doxology | http://toshine.org




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

2013-06-10 Thread Rainer M Krug

Eric Schulte schulte.e...@gmail.com writes:

[snip (41 lines)]

 He added the following to his config file to test the approach:
 
 ,
 |  (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)
 |  (basic-save-buffer))
 | 
 |(add-hook 'org-babel-post-tangle-hook 'org-babel-mark-file-as-tangled)
 `
 

[snip (5 lines)]


I tried the above approach, but I was struggling with setting up the
rules in the function definition which files should get the local
variables and which not.

I ended up with the following:

,
| (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 ()
|   
|   (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)))
| 
| (add-hook 'org-babel-post-tangle-hook 'org-babel-mark-file-as-tangled)
`

Thanks everybody for their help,

Rainer





-- 
Rainer M. Krug

email: RMKrugatgmaildotcom


pgpueI_WtlIe2.pgp
Description: PGP signature


Re: [O] A simple way to search only headlines

2013-06-10 Thread Nick Dokos
Sebastien Vauban sva-n...@mygooglest.com
writes:

 Hi Nick,

 Nick Dokos wrote:
 The OP probably wants this in the global keymap, rather than in the
 org-mode-map: just like the agenda dispatcher C-c a, this functionality is
 useful outside an org file.

 (global-set-key (kbd C-M-h) (lambda () (interactive) (org-agenda nil s 
 )))

 Not sure to understand when this functionality would be useful outside of Org.
 Can you explain?


I meant org buffer: you might want to issue the command from an
arbitrary buffer, not just an org mode buffer, so the key should be
defined globally.

-- 
Nick




Re: [O] org-agenda-files defvar directory evaluation ?

2013-06-10 Thread Nick Dokos
'Mash mash...@toshine.net writes:

 Resolved this via stackoverflow.

 (setq org-agenda-files (list org-dir))


Equivalently

  (setq org-agenda-files `(,org-dir))

That's a backquote (on a US keyboard, it's the key to the left of the
1 key in the top row), not a normal quote. See

  (info (elisp) Backquote)

The (list org-dir) form is quite readable here, but when things get
more complicated, the backquote form tends to be more readable than
manufacturing list structure by hand.


 http://stackoverflow.com/questions/17020119/org-mode-org-agenda-files-defvar-directory-evaluation/17021834

 Quoting 'Mash mash...@toshine.net:


 ...
 But how would I do this with the variable?

 (setq org-agenda-files '(org-dir))
 (setq org-agenda-files '(,(org-dir))


-- 
Nick




Re: [O] org-agenda-files defvar directory evaluation ?

2013-06-10 Thread 'Mash

Thanks,

I did use a comma to evaluate the variable but without the backtick  
which I believed caused that old style backticks warning.


Quoting Nick Dokos ndo...@gmail.com:


'Mash mash...@toshine.net writes:


Resolved this via stackoverflow.

(setq org-agenda-files (list org-dir))



Equivalently

  (setq org-agenda-files `(,org-dir))

That's a backquote (on a US keyboard, it's the key to the left of the
1 key in the top row), not a normal quote. See

  (info (elisp) Backquote)

The (list org-dir) form is quite readable here, but when things get
more complicated, the backquote form tends to be more readable than
manufacturing list structure by hand.



http://stackoverflow.com/questions/17020119/org-mode-org-agenda-files-defvar-directory-evaluation/17021834

Quoting 'Mash mash...@toshine.net:




...
But how would I do this with the variable?

(setq org-agenda-files '(org-dir))
(setq org-agenda-files '(,(org-dir))



--
Nick








Re: [O] Wrong comment character when adding file local variables?

2013-06-10 Thread Rainer M Krug

Nick Dokos ndo...@gmail.com writes:

 Rainer M Krug rai...@krugs.de writes:

 Vitalie Spinu spinu...@gmail.com writes:

   Rainer M Krug r.m.k...@gmail.com
   on Fri, 7 Jun 2013 17:40:53 +0200 wrote:

   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.

 Because they are placed automatically in R mode, your files are in
 fundamental mode.

 I think I get it now: my files are interpreted by emacs as fundamental
 files. But when I visit them in a buffer, the buffer is interpreted as
 an R buffer.


 Almost. Files are *opened* in some mode: if no other mode is
 found, they are opened in fundamental mode - by themselves, they are not
 fundamental files or R-mode files or ... That's an interpretation
 that emacs superimposes on them when it visits them. To do that, it uses
 information in auto-mode-alist, or in any mode specification in the file
 itself (using file-local variables embedded in comments).

 So when you open a file foo, it will be opened in fundamental mode
 (absent some other specification in the auto-mode-alist). When you add
 contents, the mode does not change. If you save it as file foo and
 then reopen it, it will still be in fundamental mode.  But if you save
 it as foo.org and then reopen it, the auto-mode-alist will tell emacs
 to change the mode to org-mode (assuming that the .org suffix has been
 set up correctly in the auto-mode-alist).  It does not matter what the
 contents were: it could be a C program e.g.  and it would still be
 opened in org mode.

Thanks for this very clear description of how this happened. I think I
understand what is going here.

And now I see why the block NAMESPACE file uses the R comment character,
while the others don't: NAMESPACE is in the auto-mode-alist defined as
an R file.
Adding DESCRIPTION as an R file would not be useful, as it is not an R
file - it follows the Debian Control File rules. I dont think there is a
mode for these?

But wouldn't this mechanism be an argument for a header argument to
enable adding of the mode of the file as tangled?
Always adding a local variable to the tangled file might cause problems
with certain formats which do not support comments.

Cheers,

Rainer

-- Rainer M. Krug

email: RMKrugatgmaildotcom


pgpmhqlJX6lTC.pgp
Description: PGP signature


[O] koma letter export

2013-06-10 Thread Vikas Rawal
I am trying to use ox-koma-letter for my correspondence. I have a
functioning test file that produces a nice pdf. But I would like to
set it up so as to have one letter per headline, and do subtree export
to produce the pdf. 

I am attaching the test file for the purpose. When I export it using
C-c @ C-c C-e k o, this file gives me the following error:

let*: Wrong type argument: char-or-string-p, nil

Have I made a mistake or is there a bug somewhere?

Vikas


* A Simple letter
:PROPERTIES:
:EXPORT_LATEX_CLASS: vikasletter
:EXPORT_LCO: DefaultAddress
:EXPORT_AUTHOR: Vikas Rawal
:EXPORT_DATE: April 22, 2013
:EXPORT_EMAIL: vikasra...@gmail.com
:EXPORT_TO_ADDRESS: John Doe\\
:EXPORT_TO_ADDRESS: Other Street 1\\
:EXPORT_TO_ADDRESS: 54321 Other City
:EXPORT_OPENING: Dear ,
:EXPORT_CLOSING: Yours sincerely,
:EXPORT_OPTIONS: backaddress:nil
:END:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.


Re: [O] Problem in tangle-mode -- WAS: Automatically adding local variables to tangled file

2013-06-10 Thread Eric Schulte

 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.

 I did, and there is a problem with tangling multiple blocks into a
 single file:


Oh, stupid of me.  Thanks for sending this alert, I've just pushed up a
change which should fix this problem.  We now wait to set the file modes
until after all blocks are tangled and after the post-tangle-hook has
been run.

Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



[O] Org-mode and Taskjuggler

2013-06-10 Thread Louis Turk
 Hi Christian,

I'm very interested in your work to get Org-mode to export to
Taskjuggler version 3 --- very exciting! Being able to export to tj3
from org-mode would be extremely helpful to me. However, I'm having
trouble getting it to work. I suspect that the documentation I've been
reading is too old --- for version 2 of Taskjuggler---, and I have
version 3 installed.

Would you please send me:

 1. The related code in your .emacs file.
 2. A sample full-featured org-mode file that compiles successfully to tj3.
 3. Any up-to-date documentation that is available.
 4. Anything other information needed to get it to work.


 Thank you in advance for your help. And thanks for all your work
already done on this project.

Louis





Re: [O] absurd

2013-06-10 Thread Achim Gratz
Uwe Brauer writes:
 Now the make process is getting absurd. 

What does that problem have to do with make?

 For example I put in org-agenda.el

 (if (featurep 'xemacs)
   (define-obsolete-variable-alias 'org-agenda-menu-two-column 
 'org-agenda-menu-two-columns)
   (define-obsolete-variable-alias 'org-agenda-menu-two-column 
 'org-agenda-menu-two-columns 24.3))

That cannot work since the byte-compiler necessarily sees both branches
of the if clause.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Waldorf MIDI Implementation  additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs




[O] [PATCH] List: fix creation of new items with incorrect checkbox

2013-06-10 Thread Craig Tanis
In 8.0.3, org-meta-return  at the end of a list wrongly adds a checkbox:

1. foo
_  -- cursor here, org-meta-return



1. foo
2. [ ] 

to fix, this patches org-insert-heading to make sure that 
`org-list-full-item-re' actually matches before passing `(match-string 3)' to 
`org-insert-item'






0001-List-fix-creation-of-new-items-with-incorrect-checkb.patch
Description: Binary data


Re: [O] absurd

2013-06-10 Thread Achim Gratz
Achim Gratz writes:
 That cannot work since the byte-compiler necessarily sees both branches
 of the if clause.

I've changed the advices to actually remove any arguments past the
second from the argument list.  That should allow you to compile and
load Org (at least it works with my copy of XEmacs).  Expect further
incompatibilities when trying advanced Org features (for instance Babel
doesn't seem to work, or at least ob-perl doesn't).


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Go to heading using LISP

2013-06-10 Thread Myles English

Hi Alexander,

Alexander Wingård writes:

 I want to create special key-bindings that use the org-refile goto
 interface to jump to specific headings.

It doesn't use org-refile but this is what I use:

(defun my-goto-heading(file heading-text)
  Visit file `file' and goto headline `heading-text'
  (find-file file)
  (org-element-map (org-element-parse-buffer 'headline) 'headline
  (lambda (x)
  (if (string= (org-element-property :raw-value x) heading-text)
  (goto-char (org-element-property :begin x))
  nil))
   nil t)) ;; stop at first find

(defun gtd()
  (interactive)
  (my-goto-heading (concat org-directory /gtd.org) Daily work)
  (org-show-entry)
  ;;(org-show-subtree)
  (reposition-window)
  (org-agenda-list))

In the gtd function I also set org-agenda-files but left it out for
clarity.

Myles



Re: [O] :session question -- and changes to #+Property: syntax

2013-06-10 Thread Achim Gratz
Rainer M Krug writes:
 As mentioned, I would then change my optional syntax of PROPERTY
 tomorrow. If you prefer earlier feedback, I could give it.

An actual user document is much better than me trying to construct test
cases (I'll still have do that later along with the documentation in the
manual), so I've just pushed the actual code change to master.  There's
minimal documentation in the commit message.

Any old-style properties (cache, session…) should still work, so please
test this first before doing the changes to your documents.  If you
simply add new-style default properties (not specific to any language),
simply use property header-args.  This should _override_ any still
existing old-style properties for the same header argument (please test
this as well).  Finally, the non-language-specific properties will be
ignored if a language-specific property for the same header argument
exists.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra




Re: [O] koma letter export

2013-06-10 Thread Viktor Rosenfeld
Hi Vikas,

Vikas Rawal wrote:

 I am trying to use ox-koma-letter for my correspondence. I have a
 functioning test file that produces a nice pdf. But I would like to
 set it up so as to have one letter per headline, and do subtree export
 to produce the pdf. 
 
 I am attaching the test file for the purpose. When I export it using
 C-c @ C-c C-e k o, this file gives me the following error:

I'm not sure about the C-c @ keys. On OS X this results in a message
that C-c M-l are not bound. (The @ key is accessed using Alt-L and Alt
is mapped to Meta in Emacs.)

However, using C-c C-e C-s k o I can create a letter from your example
just fine. Note the C-s in the middle which selects the current subtree.

Cheers,
Viktor

 
 let*: Wrong type argument: char-or-string-p, nil
 
 Have I made a mistake or is there a bug somewhere?
 
 Vikas
 

 
 * A Simple letter
 :PROPERTIES:
 :EXPORT_LATEX_CLASS: vikasletter
 :EXPORT_LCO: DefaultAddress
 :EXPORT_AUTHOR: Vikas Rawal
 :EXPORT_DATE: April 22, 2013
 :EXPORT_EMAIL: vikasra...@gmail.com
 :EXPORT_TO_ADDRESS: John Doe\\
 :EXPORT_TO_ADDRESS: Other Street 1\\
 :EXPORT_TO_ADDRESS: 54321 Other City
 :EXPORT_OPENING: Dear ,
 :EXPORT_CLOSING: Yours sincerely,
 :EXPORT_OPTIONS: backaddress:nil
 :END:
 
 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
 eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
 minim veniam, quis nostrud exercitation ullamco laboris nisi ut
 aliquip ex ea commodo consequat. Duis aute irure dolor in
 reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
 culpa qui officia deserunt mollit anim id est laborum.




Re: [O] absurd

2013-06-10 Thread Uwe Brauer
 Achim == Achim Gratz strom...@nexgo.de writes:

Uwe Brauer writes:
Now the make process is getting absurd. 

What does that problem have to do with make?

Because I can byte compile it manually, in dired via Shift-B!
That I consider as bizarre, byte compiling works, but via make it does
not.


For example I put in org-agenda.el

(if (featurep 'xemacs)
(define-obsolete-variable-alias 'org-agenda-menu-two-column
'org-agenda-menu-two-columns)
(define-obsolete-variable-alias 'org-agenda-menu-two-column
'org-agenda-menu-two-columns 24.3))

That cannot work since the byte-compiler necessarily sees both branches
of the if clause.
I don't understand:

(defun my-test-if ()
  (interactive)
  (if (featurep 'xemacs)
  (message Xemacs)
(message GNUS)))


when executed in Xemacs returns Xemacs, when executed in GNU emacs returns
GNUS.

In any case I removed the ifs leaving 

(define-obsolete-variable-alias 'org-agenda-menu-two-column
 'org-agenda-menu-two-columns)

And again make failed with the same error message!

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] absurd

2013-06-10 Thread Uwe Brauer
 Achim == Achim Gratz strom...@nexgo.de writes:

Achim Gratz writes:
That cannot work since the byte-compiler necessarily sees both branches
of the if clause.

I've changed the advices to actually remove any arguments past the
second from the argument list.  That should allow you to compile and
load Org (at least it works with my copy of XEmacs).  Expect further
incompatibilities when trying advanced Org features (for instance Babel
doesn't seem to work, or at least ob-perl doesn't).

Oops I just saw you second message. This new version I can obtain via 
git clone git://orgmode.org/org-mode.git 
I presume.

Lets see whats happening
thanks

Uwe  


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] absurd

2013-06-10 Thread Uwe Brauer
 Achim == Achim Gratz strom...@nexgo.de writes:

Achim Gratz writes:
That cannot work since the byte-compiler necessarily sees both branches
of the if clause.

I've changed the advices to actually remove any arguments past the
second from the argument list.  That should allow you to compile and
load Org (at least it works with my copy of XEmacs).  Expect further
incompatibilities when trying advanced Org features (for instance Babel
doesn't seem to work, or at least ob-perl doesn't).

Hm no the version I obtain via 

git clone git://orgmode.org/org-mode.git
Still contains 

(define-obsolete-variable-alias 'org-agenda-menu-two-column
'org-agenda-menu-two-columns 24.3) 

But according to the webpage this is the most recent version, the one in
which you just performed the changes you indicated.

I don't understand

regards


Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] absurd

2013-06-10 Thread Achim Gratz
Uwe Brauer writes:
 Oops I just saw you second message. This new version I can obtain via 
 git clone git://orgmode.org/org-mode.git 
 I presume.

If your current version was also obtained via git, then simply

git checkout master
git pull

will update your work tree.  You don't need to copy all the history
again since you already have it.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] absurd

2013-06-10 Thread Achim Gratz
Uwe Brauer writes:
 I don't understand:

 (defun my-test-if ()
   (interactive)
   (if (featurep 'xemacs)
   (message Xemacs)
 (message GNUS)))


 when executed in Xemacs returns Xemacs, when executed in GNU emacs returns
 GNUS.

Yes, but the byte-compiler has to compile both branches, since the if is
actually resolved at run-time.  You'd need to use a compatibility macro
to make that decision at compile-time and only use the XEmacs branch.
That was once in Org, but later reverted by Bastien.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves




Re: [O] absurd

2013-06-10 Thread Uwe Brauer
 Achim == Achim Gratz strom...@nexgo.de writes:

Uwe Brauer writes:
Oops I just saw you second message. This new version I can obtain via 
git clone git://orgmode.org/org-mode.git 
I presume.

If your current version was also obtained via git, then simply

git checkout master
git pull

will update your work tree.  You don't need to copy all the history
again since you already have it.

Well I already downloaded it again, but as I said, the change you
describe is not in, and returning to my previous post, I still don't
understand why I can byte compile it manually but make *fails*.



smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Go to heading using LISP

2013-06-10 Thread Alexander Wingård

On 10 jun 2013, at 21:00, Myles English mylesengl...@gmail.com wrote:

 
 Hi Alexander,
 
 Alexander Wingård writes:
 
 I want to create special key-bindings that use the org-refile goto
 interface to jump to specific headings.
 
 It doesn't use org-refile but this is what I use:
 
 (defun my-goto-heading(file heading-text)
  Visit file `file' and goto headline `heading-text'
  (find-file file)
  (org-element-map (org-element-parse-buffer 'headline) 'headline
  (lambda (x)
  (if (string= (org-element-property :raw-value x) heading-text)
  (goto-char (org-element-property :begin x))
  nil))
   nil t)) ;; stop at first find
 

Thanks alot! This is exactly what I was asking for. This will suffice for me 
now.
Maybe some day I will learn some LISP and teach it to navigate the hierarchical 
structure.

Best Regards /Alexander


Re: [O] absurd

2013-06-10 Thread Uwe Brauer
 Achim == Achim Gratz strom...@nexgo.de writes:


when executed in Xemacs returns Xemacs, when executed in GNU emacs
returns GNUS.

Yes, but the byte-compiler has to compile both branches, since the
if is actually resolved at run-time.  You'd need to use a
compatibility macro to make that decision at compile-time and only
use the XEmacs branch.  That was once in Org, but later reverted by
Bastien.

Ok, maybe this is off topic, but what would be a correct construction, I
am asking since my changes to icalendar.el suffer from the same mistake.

BTW I still do not understand why manual byte-compiling works, while
make does not.

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


[O] Bug: Babel Haskell mode [8.0.3 (8.0.3-30-g56b864-elpa @ /Users/ix/.emacs.d/elpa/org-20130610/)]

2013-06-10 Thread Simon Beaumont

Whenever I try and evaluate the Haskell code block I get:
Code block returned no value.

#+begin_src haskell :results value
  let fac n = product [1..n]
  [(x,fac x) | x - [0..11]]
#+end_src

#+results:


I am using ghci as my haskell-program
The Haskell source is correctly executed in the *haskell* inferior mode.

 let fac n = product [1..n]
[(x,fac x) | x - [0..11]]
org-babel-haskell-eoe
 [(0,1),(1,1),(2,2),(3,6),(4,24),(5,120),(6,720),(7,5040),(8,40320),(9,362880),(10,3628800),(11,39916800)]
 org-babel-haskell-eoe
 

The raw binding receives appropriate data below but the parse is
always null
 
...
(defun org-babel-execute:haskell (body params)
  Execute a block of Haskell code.
  (let* ((session (cdr (assoc :session params)))
 (vars (mapcar #'cdr (org-babel-get-header params :var)))
 (result-type (cdr (assoc :result-type params)))
 (full-body (org-babel-expand-body:generic
 body params
 (org-babel-variable-assignments:haskell params)))
 (session (org-babel-haskell-initiate-session session params))
 ;; ++ we get something like the above here
 (raw (org-babel-comint-with-output
  (session org-babel-haskell-eoe t full-body)
(insert (org-babel-trim full-body))
(comint-send-input nil t)
(insert org-babel-haskell-eoe)
(comint-send-input nil t)))
 ;; ++ this is null
 (results (mapcar
   #'org-babel-haskell-read-string
   (cdr (member org-babel-haskell-eoe
(reverse (mapcar #'org-babel-trim raw)))
...

What am I doing wrong?
Thanks for any assistance to fix this - what should we be getting in results?

_
Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin12.3.0)
 of 2013-05-04 on psi
Package: Org-mode version 8.0.3 (8.0.3-30-g56b864-elpa @ 
/Users/ix/.emacs.d/elpa/org-20130610/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all 
append local] 5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-hide-inline-tasks
  org-cycle-show-empty-lines 
org-optimize-window-after-visibility-change)
 org-babel-tangle-lang-exts '((haskell . hs) (python . py) 
(emacs-lisp . el))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-babel-load-languages '((python . t) (R . t) (haskell . t) (emacs-lisp . t))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



Re: [O] Bug: Babel Haskell mode [8.0.3 (8.0.3-30-g56b864-elpa @ /Users/ix/.emacs.d/elpa/org-20130610/)]

2013-06-10 Thread Eric Schulte
Simon Beaumont si...@datalligator.com writes:

 Whenever I try and evaluate the Haskell code block I get:
 Code block returned no value.

 #+begin_src haskell :results value
   let fac n = product [1..n]
   [(x,fac x) | x - [0..11]]
 #+end_src

 #+results:


I can't reproduce this problem.  With a minimal emacs config started
with -Q, and loading the attached init.el file (you'll have to update
the paths to work with your system).



init.el
Description: application/emacs-lisp

I'm able to execute the following Org-mode file returning a table of
results as expected (although I have to execute it twice, presumably to
clear out some cruft at the beginning of the haskell session).

#+begin_src haskell
  let fac n = product [1..n]
  [(x,fac x) | x - [0..11]]
#+end_src

I'm using

$ emacs --version
GNU Emacs 24.3.1
Copyright (C) 2013 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

Org-mode version 8.0.3 (release_8.0.3-215-g8e1e6f @ 
/home/eschulte/src/org-mode/lisp/)

-- 
Eric Schulte
http://cs.unm.edu/~eschulte


Re: [O] koma letter export

2013-06-10 Thread Vikas Rawal

 
 However, using C-c C-e C-s k o I can create a letter from your example
 just fine. Note the C-s in the middle which selects the current subtree.

Thank you. Works perfect.

Vikas



[O] ox-koma-letter support for \cc and \encl?

2013-06-10 Thread Vikas Rawal
Does ox-koma-letter support \cc and \encl?

Vikas



Re: [O] A simple way to search only headlines

2013-06-10 Thread Nick Dokos
Sebastien Vauban sva-n...@mygooglest.com
writes:

 Hi Nick,

 Nick Dokos wrote:
 Sebastien Vauban sva-n...@mygooglest.com writes:
 Nick Dokos wrote:
 The OP probably wants this in the global keymap, rather than in the
 org-mode-map: just like the agenda dispatcher C-c a, this functionality is
 useful outside an org file.

 (global-set-key (kbd C-M-h) (lambda () (interactive) (org-agenda nil s 
 )))

 Not sure to understand when this functionality would be useful outside of 
 Org.
 Can you explain?

 I meant org buffer: you might want to issue the command from an
 arbitrary buffer, not just an org mode buffer, so the key should be
 defined globally.

 I still don't understand.


You understand all too well :-)

 Here, the command is for searching among (Org) headlines of the current buffer
 -- see the restriction . I don't see how it would make sense to call that
 on something other than an Org mode buffer?

 Maybe you missed the  restriction?  Or do I miss something else?


I did. Sorry about that.

-- 
Nick




Re: [O] ox-koma-letter support for \cc and \encl?

2013-06-10 Thread Viktor Rosenfeld
Hi Vikas,

Vikas Rawal wrote:

 Does ox-koma-letter support \cc and \encl?
 
 Vikas
 

Yes. Add two headlines to your letter, one tagged with :CC: and one with
:ENCL:. The content below these headlines will be converted to the
relevant LaTeX code. This also works with :PS:. However, you need a
fairly recent version of ox-koma-letter.

Cheers,
Viktor