Re: [O] Is it possible to add a class to a paragraph in HTML export?

2014-04-02 Thread Nicolas Goaziou
Hello,

Bastien b...@gnu.org writes:

 +  (class0 (org-export-read-attribute :attr_html paragraph :class))
 +  (class (if class0 (format  class=\%s\ class0)))
(extra (or (cadr (assoc parent-type style)) )))
  (cond
   ((and (eq (org-element-type parent) 'item)
 @@ -2925,7 +2927,7 @@ the plist used as a communication channel.
   (label (org-element-property :name paragraph)))
   (org-html--wrap-image contents info caption label)))
   ;; Regular paragraph.
 - (t (format p%s\n%s/p extra contents)
 + (t (format p%s%s\n%s/p class extra contents)

If deemed useful, I think this patch should use
`org-html--make-attribute-string' instead of hard-coding class
attribute:

  (attributes (org-html--make-attribute-string
   (org-export-read-attribute :attr_html paragraph)))

...

  (t (format p%s%s\n%s/p attributes extra contents))

This way, attributes will not be limited to class only. See, for
example, `org-html-special-block'.


Regards,

-- 
Nicolas Goaziou



Re: [O] Is it possible to add a class to a paragraph in HTML export?

2014-04-02 Thread Christian Moe

Nicolas Goaziou writes:

 If deemed useful, I think this patch should use
 `org-html--make-attribute-string' instead of hard-coding class
 attribute

+1. I would find this change useful.

Yours,
Christian



Re: [O] how to enter ==

2014-04-02 Thread Eric S Fraga
On Tuesday,  1 Apr 2014 at 02:52, Rustom Mody wrote:
 If I enter code inline that has an == that is taken as an escape for code
 So how to enter '==' literally

How about ~==~?


-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.5h-660-gef207f



[O] parse #+MYVAR?

2014-04-02 Thread Martin
Hi there,

I'd like to extend org-mode and its a bit hard to find all the
functions, but I don't like to redefine the wheel.

I have some special buffers for my case, and I'd like to mark them with
#+MYSPECIAL foo

so later I'd like to find all buffers having MYSPECIAL set and get the
foo which differs in my buffers, this is an identifyer of the special
org file.

How can I do that?

Thanks,
Martin



Re: [O] how to enter ==

2014-04-02 Thread Rustom Mody
On Wed, Apr 2, 2014 at 3:11 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Tuesday,  1 Apr 2014 at 02:52, Rustom Mody wrote:
  If I enter code inline that has an == that is taken as an escape for code
  So how to enter '==' literally

 How about ~==~?


In that case the full ~==~ appears on export :-(


[O] Computing the value of some cells of a table using a named code block

2014-04-02 Thread Alan Schmitt
Hello,

I have a table that summarizes my monthly budget, and I would like to
add a column where I compute my actual spending. I can get this
information using a shell script, but I don't know how to integrate it
in the table.

Here is a contrived example:
--8---cut here---start-8---
#+name: spending
#+begin_src sh :var category=foo
echo $category
#+end_src

| Category | Budget | Spending |
|--++--|
| Food |   1000 |  |
| Rent |   1000 |  |
#+TBLFM: $3=call_spending($1)
--8---cut here---end---8---

My question is: how do I write the TBLFM so that every cell of column
3 is the result of call the named block with column 1 as argument?

Thanks,

Alan



Re: [O] Computing the value of some cells of a table using a named code block

2014-04-02 Thread Michael Brand
Hi Alan

On Wed, Apr 2, 2014 at 1:58 PM, Alan Schmitt
alan.schm...@polytechnique.org wrote:
 I have a table that summarizes my monthly budget, and I would like to
 add a column where I compute my actual spending. I can get this
 information using a shell script, but I don't know how to integrate it
 in the table.

 Here is a contrived example:
 --8---cut here---start-8---
 #+name: spending
 #+begin_src sh :var category=foo
 echo $category
 #+end_src

 | Category | Budget | Spending |
 |--++--|
 | Food |   1000 |  |
 | Rent |   1000 |  |
 #+TBLFM: $3=call_spending($1)
 --8---cut here---end---8---

 My question is: how do I write the TBLFM so that every cell of column
 3 is the result of call the named block with column 1 as argument?

When there is no named source block involved I use just

| Category | Budget | Spending |
|--++--|
| Food |   1000 | Food |
| Rent |   1000 | Rent |
#+TBLFM: $3 = '(org-trim (shell-command-to-string (concat echo  $1)))

For named source blocks there is sbe, see Worg.

Michael



[O] A file with 'org-mode rot'?

2014-04-02 Thread Sharon Kimble
I have been keeping my diary in an org-mode file since the beginning of the
year, with this format -

--8---cut here---start-8---
* April
** 01 Tue
blah de blah
--8---cut here---end---8---

Today I have had to create a new file, even though the old one was only 194kb
in size and of 2673 lines. However, it was very slow in opening, navigating to
any desired place, and appeared to be getting confused as to whether it was in
org-mode or not! Its set up for continuous org-mode, but recently to correct
formatting I've had to turn on org-mode in the middle of a diary posting, or
even close the file and then reopen it again.

On opening the master file for the year which will contain *all* my postings
for the year, it is still very slow and ponderous. But it is called
'2014.org', which is a renaming of my working file '2014a.org'.

Has '2014.org' got org-mode rot, so many hidden commands of change of
org-mode functionality still within its meta-post that it makes the whole file
difficult to work with? I know that org-mode files are just plain text
formatted in a certain way that emacs recognises and then performs certain
predestined actions on, but somehow this file is slowing down in its
interactions with the rest of emacs.

So how can I keep a file 'healthy' and working well over many months please?

Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, Fluxbox 1.3.5, emacs 24.3.1


pgpmz8cNIBAaa.pgp
Description: PGP signature


Re: [O] radio links should not match empty text

2014-04-02 Thread Nicolas Goaziou
Hello,

Daniel Clemente n142...@gmail.com writes:

 Hi, recently this syntax:   started highlighting all spaces (spaces 
 between words) as if they were links. I see them with a blue underline.
   I found this because I used some Unicode-art like   where 
 I certainly didn't mean to define a radio link.

This should be fixed. Thank you for reporting it.


Regards,

-- 
Nicolas Goaziou



Re: [O] Computing the value of some cells of a table using a named code block

2014-04-02 Thread Alan Schmitt
Hi Michael,

Michael Brand michael.ch.br...@gmail.com writes:

 When there is no named source block involved I use just

 | Category | Budget | Spending |
 |--++--|
 | Food |   1000 | Food |
 | Rent |   1000 | Rent |
 #+TBLFM: $3 = '(org-trim (shell-command-to-string (concat echo  $1)))

 For named source blocks there is sbe, see Worg.

This is most useful, thanks a lot!

For the record, here is the solution using org-sbe:

--8---cut here---start-8---
#+name: spending
#+begin_src sh :var c=bar :results silent
expr $c
#+end_src

| Category | Budget | Spending |
|--++--|
| Food |   1000 | Food |
| Rent |   1000 | Rent |
#+TBLFM: $3='(org-sbe spending (c (concat \ $1 \)))
--8---cut here---end---8---

Thanks again,

Alan



Re: [O] how to enter ==

2014-04-02 Thread Eric S Fraga
On Wednesday,  2 Apr 2014 at 12:08, Rustom Mody wrote:
 On Wed, Apr 2, 2014 at 3:11 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Tuesday,  1 Apr 2014 at 02:52, Rustom Mody wrote:
  If I enter code inline that has an == that is taken as an escape for code
  So how to enter '==' literally

 How about ~==~?


 In that case the full ~==~ appears on export :-(

ummm, it doesn't for me but I guess you have the == within a larger code
segment?  Maybe post an example?  What version of org are you using?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.5h-660-gef207f



Re: [O] how to enter ==

2014-04-02 Thread Rustom Mody
On Wed, Apr 2, 2014 at 6:39 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 On Wednesday,  2 Apr 2014 at 12:08, Rustom Mody wrote:
  On Wed, Apr 2, 2014 at 3:11 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 
  On Tuesday,  1 Apr 2014 at 02:52, Rustom Mody wrote:
   If I enter code inline that has an == that is taken as an escape for
 code
   So how to enter '==' literally
 
  How about ~==~?
 
 
  In that case the full ~==~ appears on export :-(

 ummm, it doesn't for me but I guess you have the == within a larger code
 segment?  Maybe post an example?  What version of org are you using?


Heres a file
--
#+TITLE: Python for Unicode
#+OPTIONS: toc:nil
* Collections

However there is a catch: =⦃1,2,3⦄ ~==~ ⦃1,2,3,1,2⦄= \\
Remember that in python =set([1,2,3,1,2]) ~==~ set([1,2,3])= \\
--

And now do C-c C-e h o
Do not the tilde's remain?

org-version: 8.2.5e
emacs started with -Q (except for putting this in the path)


 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.5h-660-gef207f




-- 
http://www.the-magus.in
http://blog.languager.org


[O] radio links in middle of words. (was: Re: radio links should not match empty text)

2014-04-02 Thread Daniel Clemente
El Wed, 02 Apr 2014 14:59:42 +0200 Nicolas Goaziou va escriure:
  Hi, recently this syntax:   started highlighting all spaces (spaces 
  between words) as if they were links. I see them with a blue underline.
I found this because I used some Unicode-art like   
  where I certainly didn't mean to define a radio link.
 
 This should be fixed. Thank you for reporting it.

  Now it works, thanks.
  I also found a strange behaviour where links appear in the middle of words. 
Explanatory example:


** Languages
*** C language
*** JavaScript
*** etc.
Etc. ← should the C in etc be highlighted as a link to „C“? Now it is and it's 
a bit annoying. This is new behaviour.




Re: [O] radio links in middle of words.

2014-04-02 Thread Nicolas Goaziou
Hello,

Daniel Clemente n142...@gmail.com writes:

 ** Languages
 *** C language
 *** JavaScript
 *** etc.
 Etc. ← should the C in etc be highlighted as a link to „C“? Now it is and 
 it's a bit annoying. This is new behaviour.

Indeed, this is expected. The patch you pointed out allows mid-word
radio-targets. See related thread for more information.

You could use a regular target here, although it will be more verbose:

  *** cC language
  ...
  Etc. But here I really talk about [[c][C]].


Regards,

-- 
Nicolas Goaziou



Re: [O] Export Org checkboxes in ox-html using UTF-8 symbols

2014-04-02 Thread Rick Frankel

On 2014-03-29 10:12, Marcin Borkowski wrote:

Dnia 2014-03-28, o godz. 10:59:43
Rick Frankel r...@rickster.com napisał(a):

On 2014-03-28 10:01, Sebastien Vauban wrote:
 Rick Frankel wrote:
 BTW, i used [nbsp;] for the unchecked box (we use the same for
 checked and trans)... I think i'll change the unchecked box to
 #x2610; to match the checked box (same as sachua).

Wouldn't it be better to have (maybe in addition) three distinct
classes for the li elements with checkboxes in various states?  This
would make styling them with CSS possible.


Nice idea. I'll look at adding classes to each (checked, or transient)
=li=. I think that the use of classes is minimal due to the orginal
stand-alone (inline css) nature of the html exporter. I certainly
agree that more modern html output is desireable, but it's a big
project...

rick



Re: [O] Bug? org-set-tags never uses ido

2014-04-02 Thread Anders Johansson
A hack to get ido selection for multiple tags. It uses 
ido-completing-read-multiple (available here and included below: 
https://gist.github.com/mgalgs/1329188) to allow for completing one tag 
at a time and ending it by typing :.


I haven't tested it much and it might possibly break things (or most 
certainly it's implemented in an ugly way). Perhaps someone more than me 
will find it useful.


Cheers,
Anders



(defadvice org-icompleting-read
  (around org-use-ido-for-tags
  (prompt coll optional pred reqm initial hist def)
  activate)
  Advised to use ido for multiple completion of tags
  (setq ad-return-value
(if (string= Tags:  prompt)
(mapconcat 'identity
   (ido-completing-read-multiple
prompt
(mapcan
 'copy-list org-last-tags-completion-table)
pred reqm initial hist def :)
   :)
  ad-do-it)))


(defun ido-completing-read-multiple (prompt choices optional predicate 
require-match initial-input hist def sentinel)

  Read multiple items with ido-completing-read. Reading stops
  when the user enters SENTINEL. By default, SENTINEL is
  \*done*\. SENTINEL is disambiguated with clashing completions
  by appending _ to SENTINEL until it becomes unique. So if there
  are multiple values that look like SENTINEL, the one with the
  most _ at the end is the actual sentinel value. See
  documentation for `ido-completing-read' for details on the
  other parameters.
  (let
  ((sentinel (if sentinel sentinel *done*))
   (done-reading nil)
   (res ()))

;; uniquify the SENTINEL value
(while (find sentinel choices)
  (setq sentinel (concat sentinel _)))
(setq choices (cons sentinel choices))

;; read some choices
(while (not done-reading)
  (setq this-choice (ido-completing-read prompt choices predicate 
require-match initial-input hist def))

  (if (equal this-choice sentinel)
  (setq done-reading t)
(setq res (cons this-choice res

;; return the result
res
))




[O] Help tangling

2014-04-02 Thread Andreas Hilboll
Hi,

I want to write a SConstruct file (for SCons, a Python make
alternative) in orgmode, using literate programming.  So I have a file
SConstruct.org, where I include the code blocks with #+begin_src ...
#+end_src.  My question:

   How can I specify that *all* code blocks shall be tangled into one
single file called SConstruct?

I know I could do this by writing

   #+begin_src python :tangle SConstruct
   [...]
   #+end_src

instead of

   #+begin_src
   [...]
   #+end_src

but is there some way to define the python and the :tangle
SConstruct 'globally' for the whole file?

Thanks for helping me orgmode-newbie!

-- Andreas.



Re: [O] Help tangling

2014-04-02 Thread Eric Schulte
Andreas Hilboll li...@hilboll.de writes:

 Hi,

 I want to write a SConstruct file (for SCons, a Python make
 alternative) in orgmode, using literate programming.  So I have a file
 SConstruct.org, where I include the code blocks with #+begin_src ...
 #+end_src.  My question:

How can I specify that *all* code blocks shall be tangled into one
 single file called SConstruct?

 I know I could do this by writing

#+begin_src python :tangle SConstruct
[...]
#+end_src

 instead of

#+begin_src
[...]
#+end_src

 but is there some way to define the python

no

 and the :tangle SConstruct

yes

#+Property: tangle SConstruct

 'globally' for the whole file?

 Thanks for helping me orgmode-newbie!


Best,


 -- Andreas.


-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] Help tangling

2014-04-02 Thread Andreas Hilboll
On 02.04.2014 23:04, Eric Schulte wrote:
 Andreas Hilboll li...@hilboll.de writes:
 
 Hi,

 I want to write a SConstruct file (for SCons, a Python make
 alternative) in orgmode, using literate programming.  So I have a file
 SConstruct.org, where I include the code blocks with #+begin_src ...
 #+end_src.  My question:

How can I specify that *all* code blocks shall be tangled into one
 single file called SConstruct?

 I know I could do this by writing

#+begin_src python :tangle SConstruct
[...]
#+end_src

 instead of

#+begin_src
[...]
#+end_src

 but is there some way to define the python
 
 no
 
 and the :tangle SConstruct
 
 yes
 
 #+Property: tangle SConstruct
 

Thanks for your feedback, Eric!  However, it doesn't seem to work properly.

The first two lines of my file read

   #+OPTIONS: toc:4 h:4
   #+PROPERTY: tangle SConstruct

and I have several code blocks like

   #+begin_src python
   [...]
   #+end_src

However, when I invoke org-babel-tangle, I get the message Tangled 0
code blocks from SConstruct.org, and no output file is created.

Have I misunderstood you?  What am I doing wrong?

Cheers, Andreas.

 'globally' for the whole file?

 Thanks for helping me orgmode-newbie!

 
 Best,
 

 -- Andreas.

 


-- 
-- Andreas.



Re: [O] parse #+MYVAR?

2014-04-02 Thread John Kitchin
maybe this post:
http://kitchingroup.cheme.cmu.edu/blog/2013/05/05/Getting-keyword-options-in-org-files/is
close what you are looking for. you have to figure out how to go
through
all the buffers,but the code here should do the parsing for you.

John

---
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Wed, Apr 2, 2014 at 6:27 AM, Martin kleinerdra...@gmx.at wrote:

 Hi there,

 I'd like to extend org-mode and its a bit hard to find all the
 functions, but I don't like to redefine the wheel.

 I have some special buffers for my case, and I'd like to mark them with
 #+MYSPECIAL foo

 so later I'd like to find all buffers having MYSPECIAL set and get the
 foo which differs in my buffers, this is an identifyer of the special
 org file.

 How can I do that?

 Thanks,
 Martin