Re: [O] Bug? Changed behaviour makes tags in headlines without a title parsed as the title

2015-04-10 Thread Anders Johansson



Den 2015-04-10 18:24, Nicolas Goaziou skrev:

Hello,

Anders Johansson mejlaande...@gmail.com writes:


I have been using degenerate inlinetasks with empty titles but many
tags for implementing a kind of coding scheme for coding texts for
qualitative data analysis. Like this:
-

Some text that I want to tag (The inlinetask in my scheme refers to
the paragraph above it)
*** :tag1:tag2:tag3:

Other text (no inlinetask-END, mostly)
-

Building org from the master branch, I recently noticed a changed
behaviour in that these tags as are not parsed as tags but instead as
the title, meaning my exports don't work as expected (and possibly
other things, but searching for tags etc.doesn't seem to be affected.
Those functions don't use org-element perhaps?).


Indeed.


As far as I could see, this comes from the changes in commit

98ee73: org-element: Avoid `org-element-parse-secondary-string',

where tags are matched with the regexp:
(org-re [ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$)

which needs whitespace after the non-existent title.

I haven't checked all the different changes going on in org-element though.

I don't know if this changed behaviour is intended. Otherwise I guess
it's a bug.


Empty headings are a pathological case. What if I want to write

   *** :title:

? Your interpretation prevents that.

Of course, Org is expected to be consistent. However I'm not convinced
supporting empty headlines with tags is a good thing.

Regards,



Great, that sounds reasonable.
I guess I'll change my practice then.

Cheers,



[O] accessing source block header arguments from exporters

2015-04-10 Thread Robert Klein
Hi,

is there a way, to read header arguments to source blocks in the
exporters org-exporter-src-block funktions?

E.g. is there a way to access :firstline in the example below?

#+begin_src c++ -n :firstline 23
   static struct
  {
  char*entity;
  unsigned char   equiv;
  } entities[] =
{
  { lt,   '' } ,
  { gt,   '' } ,
  { amp,  '' } ,
  { quot, '' } ,
  { trade,153 } , /* trade mark */
#+end_src

I didn't find it in the `element' structure.

However, if I use

#+begin_src c++ firstline=23
  // random C++
#+end_src

I could access :parameters from `element' and parse the string.
However I'm not sure if I'd break some babel stuff or not.

If I'm trying to implement a firstline feature -- source blocks with
new line numbering (-n) beginning at a given line number -- I'd prefer
to use :firstline, but I didn't find anything to suggest `:XXX ZZ'
header arguments to source blocks are available to the exporters.

Any advice?

Thank you very much
Robert



Re: [O] [Feature Request] [ENTER] or [C-Alt ENTER] while on headline skip over drawers automatically

2015-04-10 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Eventually, we could introduce a `org-return-hook' where an user could
 add, e.g.,

   (lambda () (when (org-at-heading-p) (org-end-of-meta-data) (insert
   \n)))

 Opinions?

+1.

I'd also like a hook on C-RET.


-- 
Not everything that goes around comes back around, you know




Re: [O] Bug: Agenda Custom Command org-agenda-prefix-format %l returns error [8.3beta (release_8.3beta-1025-g7b97b6 @ /home/dominik/.emacs.d/org-mode/lisp/)]

2015-04-10 Thread Nicolas Goaziou
Hello,

Dominik Schrempf dominik.schre...@gmail.com writes:

 I tried to configure org-agenda-custom-commands by

 (setq org-agenda-custom-commands
   '((  Agenda
  ((tags-todo /!+TODO
  ((org-agenda-overriding-header University)
   (org-agenda-todo-ignore-scheduled t)
   (org-agenda-todo-ignore-deadlines t)
   (org-agenda-todo-ignore-with-date t)
   ;TODO: BUG, Indenting todo items does not work.
   (org-agenda-prefix-format  %i %-12:c%l%s)
   (org-agenda-sorting-strategy
'(category-keep)
  nil)))

 I want the todo items to be indented according to their level with '%l'.
 However, when I add the '%l' flag and try to open this agenda view, I
 get:

 concat: Wrong type argument: buffer-or-string-p, 2

Fixed in 9debffbe0f1c10e33514073264d2d5462c1fa0f8. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] accessing source block header arguments from exporters

2015-04-10 Thread Charles Berry
Robert Klein roklein at roklein.de writes:

 
 Hi,
 
 is there a way, to read header arguments to source blocks in the
 exporters org-exporter-src-block funktions?

Not directly. org-babel-exp-code has no provision for headers. 
They get dropped.


 E.g. is there a way to access :firstline in the example below?
 

Not exactly, but ...

If you precede the code block with

#+attr_firstline: 23 

then with point in the src block

(org-element-property :attr_firstline (org-element-context))

will return (23). And org-*-src-block functions can use it.

If you really want to use the :firstline idiom, you can add a hook in 
`org-export-before-processing-hook' to find :firstline headers and 
insert #+attr_firstline lines in the buffer copy that the exporter is using.

 #+begin_src c++ -n :firstline 23
static struct
   {
   char*entity;
   unsigned char   equiv;
   } entities[] =
 {
   { lt,   '' } ,
   { gt,   '' } ,
   { amp,  '' } ,
   { quot, '' } ,
   { trade,153 } , /* trade mark */
 #+end_src
 
 I didn't find it in the `element' structure.
 
 However, if I use
 
 #+begin_src c++ firstline=23
   // random C++
 #+end_src
 
 I could access :parameters from `element' and parse the string.
 However I'm not sure if I'd break some babel stuff or not.


C-c C-v C-i on that src block shows that 'firstline=23' is treated as 
a switch by babel. So if there is any language that tries to use that 
as a switch (or has a regexp that matches it), there could be trouble.  
 
But in C it looks innocuous.

 If I'm trying to implement a firstline feature -- source blocks with
 new line numbering (-n) beginning at a given line number -- I'd prefer
 to use :firstline, but I didn't find anything to suggest `:XXX ZZ'
 header arguments to source blocks are available to the exporters.
 

HTH,

Chuck