Re: [O] color header based on priority/tags rather than level

2014-01-14 Thread Sebastien Vauban
David Rees wrote:
> Is there way to set the color/face of a header line based on priority/tags
> rather than level? Maybe a way of setting a hook method that takes header line
> info and returns color/face info?
>
> I've found that I can use org-priority-face to color the priority cookie and
> I can use org-agenda-fontify-priorities to apply color to the agenda line, but
> I want to color the header line in the original buffer.
>
> FYI, Here is a link to old post on this, but it ended just with solution for
> agenda lines
> http://article.gmane.org/gmane.emacs.orgmode/17143/match=color+entire+header

Once again, not what you're looking for, but John Wiegley once shared
his code to highlight agenda lines depending of a tag (home, work,
etc.).

Though, can't find it anymore...

Best regards,
  Seb

-- 
Sebastien Vauban




[O] Change section (headings) numbering style

2014-01-14 Thread Axel E. Retif

Greetings!

I need to change the numbering style of the first level sections (*) in 
the exported html file.


Right now they are exported as

1 First section  ;; for * First section

1.1 First subsection ;; for ** First subsection

etc.

For the first part of the document that's all right, but for the next 
part I need


A First new section  ;; for * First new section

A.1 First new subsection ;; for ** First new subsection

and so on.

I've tried with different combinations of #+ATTR_HTML and #+OPTIONS with 
section-number-2 with no success.


TIA


Best,

Axel




Re: [O] Change section (headings) numbering style

2014-01-14 Thread Sebastien Vauban
"Axel E. Retif" wrote:
> I need to change the numbering style of the first level sections (*) in the
> exported html file.
>
> Right now they are exported as
>
> 1 First section  ;; for * First section
>
> 1.1 First subsection ;; for ** First subsection
>
> etc.
>
> For the first part of the document that's all right, but for the next part
> I need
>
> A First new section  ;; for * First new section
>
> A.1 First new subsection ;; for ** First new subsection
>
> and so on.
>
> I've tried with different combinations of #+ATTR_HTML and #+OPTIONS with
> section-number-2 with no success.

AFAICT, this is not possible right now. Though, you have a fallback in
the name of jQuery, for example (or JavaScript, in general).

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Citations and references in ODT

2014-01-14 Thread Jambunathan K

I have introduced a new variable `org-odt-cite-regexp'.  You can use M-x
customize-variable to change the default settings. [1, 4]

I would like to (eventually) add support for prenote and postnote
options for ODT export [2].  These intext options could be quite useful
when citation references use text rather than numbers [3].

[1] Download ox-odt.el and ox-jabref.el from my private repo at
http://repo.or.cz/w/org-mode/org-kjn.git

[2] http://orgmode.org/worg/org-tutorials/org-latex-export.html

[3]

(custom-set-variables
 '(org-jabref-odt-citation-transcoders
   (quote (org-jabref-odt-citation-reference/text
   . org-jabref-odt-bibliography/numbered

[4]

,[ C-h v org-odt-cite-regexp RET ]
| org-odt-cite-regexp is a variable defined in `ox-odt.el'.
| Its value is
| 
"\\(?:\\(cite[[:word:]]*\\)\\(\\(?:\\[\\(?:.\\|\n\\)*]\\)?\\)\\({.*?}\\)\\)"
| 
| Documentation:
| Regular expression to identify \cite[]{} fragments.
| After a match against this regular expression, various portions
| of the latex fragment - command, options and argument - is
| available in `match-string's 1, 2 and 3 respectively.
| 
| For example, given the following cite command
| 
| \citep[see][chap. 2]{jon90}
| 
| a match against the above regexp, will result in `match-string's
| as below:
| 
| 1 => citep
| 2 => [see][chap. 2]
| 3 => {jon90}.
| 
| You can customize this variable.
| 
| This variable was introduced, or its default value was changed, in
| version 24.4 of Emacs.
| 
| [back]
`

Ken Mankoff  writes:

> Hi,
>
> I find the ODT export very useful. Working on another document
> imported from LaTeX I have a lot of \citep{} and \citet{} in addition
> to \cite{}. Is it possible for ox-jabref.el to support this even if it
> does not distinguish between the T and P?
>
> I edited the line near the bottom with the regex and changed
>
> (value (∧ (string-match "cite{\\(.*?\\)}" latex-frag)
>
> to
>
> (value (∧ (string-match "cite?{\\(.*?\\)}" latex-frag)
>
> But it did not help.
>
> -k.




Re: [O] wide images in LaTex and HTML export

2014-01-14 Thread Peter Salazar
Thanks! That works great, though I'm finding that setting the width
manually gets it wider than \pagewidth:

#+begin_center
#+ATTR_LATEX: :height 10in :options angle=90
[[./profit-and-loss-monthly.jpg]]
#+end_center



On Mon, Jan 13, 2014 at 10:03 AM, John Hendy  wrote:

> On Mon, Jan 13, 2014 at 2:27 AM, Peter Salazar 
> wrote:
> > Has anyone had success recently working with wide images? I have source
> > documents and I'm trying to export to both LaTeX/PDF and HTML.
> >
> > Working from the manual, my image links look like this (the wide
> dimension
> > becomes height when rotated):
> >
> > #+ATTR_LATEX: :height 9in :options angle=90 :float t
> > [[file:./image-files/cash-flow-(monthly).jpg]]
> >
> > On the LaTeX/PDFs, the image is still coming out pretty small. Is there
> an
> > easy way to get it to suppress the page header and ignore the top margin
> so
> > I can get more room to work with?
>
> Here's some ideas on the LaTeX side; I don't use HTML nearly as much...
>
> Do you have anything setting margins in your header? I can't stand the
> default LaTeX margins, so every one of my article-style documents has
> the following header:
> #+latex_header: \usepackage[hmargin=2.5cm,vmargin=2.5cm]{geometry}
>
> You can also ditch the title/date with this line:
> #+BIND: org-latex-title-command ""
>
> Note that to use this, you need the following in your config (or at
> least to customize it to prompt the user if using #+bind is okay):
> (setq org-export-allow-bind-keywords t)
>
> Lastly, you can remove the footer (centered page number) with setting
> an empty pagestyle:
> \pagestyle{empty}
>
> Putting it all together, see what you think of this result (I get a
> pretty big image, with just the heading and the image).
>
>
> #+begin_src example
>
> #+options: toc:nil
> #+latex_header: \usepackage[hmargin=2.5cm,vmargin=2.5cm]{geometry}
> #+BIND: org-latex-title-command ""
>
> \pagestyle{empty}
>
>
> * test
>
> #+begin_center
> #+attr_latex: :width \textwidth
> [[./tux.png]]
> #+end_center
>
> #+end_src
>
> I downloaded this image as tux.png (same directory as the test file):
> http://post.putorius.net/images/originaltux.png
>
>
> Hope that helps a bit,
> John
>
> >
> > For HTML export, the image comes out wider than the screen on my MacBook
> > 13-inch. Has anyone had success using a lightbox-style plugin with org
> HTML
> > export? Ideally I wouldn't have to use image links with a "rel" tag,
> which
> > would break the LaTeX images.
> >
> > For HTML export, does anyone have a way to automatically turn all images
> > into lightbox-style image links that would expand to full screen on
> click?
> > (Or maybe even a jQuery way to expand images on click without even using
> > href links? But again, something that would do this to all images in the
> > document, ideally without the need to hand-tag each image.)
> >
> > Thanks!
>


Re: [O] Citations and references in ODT

2014-01-14 Thread Jambunathan K
Aric Gregson  writes:

> Ken Mankoff  writes:
>
>> I find the ODT export very useful. Working on another document imported
>> from LaTeX I have a lot of \citep{} and \citet{} in addition to \cite{}. Is
>> it possible for ox-jabref.el to support this even if it does not
>> distinguish between the T and P?
>
> On a similar note, would it be possible to add support for the markdown
> style of references?
>
> [@Authoryear; @anotherauthoryear]
>
> I have so many like this across files.

This will be an one-off change, so I am hesitant to consider this.

Side Note:
==

As far as Org is concerned, Citations are not standardized (i.e., They
are not defined as part of org-syntax [1]).  But, the current practive
is to support \cite[]{ } style of markups using non-core, contrib
modules like ox-bibtex and ox-jabref.

I am interested in considering all suggestions or use-cases that extends
or improves upon the current practice. For example, handling of prenote
and postnote arguments[2, 3].

[1] http://orgmode.org/worg/dev/org-syntax.html
[2] http://permalink.gmane.org/gmane.emacs.orgmode/80846
[3] This would require changes to JabRef *.layout files.

> Thanks, Aric




Re: [O] Change section (headings) numbering style

2014-01-14 Thread Axel E. Retif

On 01/14/2014 02:39 AM, Sebastien Vauban wrote:


"Axel E. Retif" wrote:

I need to change the numbering style [from arabic to Alpha] of the
first level sections (*) in the exported html file.


[...]


AFAICT, this is not possible right now. Though, you have a fallback
in the name of jQuery, for example (or JavaScript, in general).


Thank you very much! I have to confess, though, that I don't know 
anything about JavaScript.


I don't even know html! The only markup language I know is LaTeX!


Thank you again and best regards

Axel




Re: [O] color header based on priority/tags rather than level

2014-01-14 Thread Bastien


"Sebastien Vauban" 
writes:

> Once again, not what you're looking for, but John Wiegley once shared
> his code to highlight agenda lines depending of a tag (home, work,
> etc.).

(font-lock-add-keywords 'org-mode
  '(("^.*:write:.*$" . font-lock-keyword-face)))

will use `font-lock-keyword-face' for headings tagged with ":write:"
in org-mode.

The following snippet can be used for boldifying ":write:"-tagged
lines in the agenda:

(setq org-agenda-face-for-tagged-lines
   '(("write" . bold)))

(defun org-agenda-fontify-tagged-line ()
  "Use `org-agenda-face-for-tagged-lines' to fontify lines with certain tags."
  (goto-char (point-min))
  (let (tags)
(while (progn (forward-line 1) (not (eobp)))
  (if (setq tags (get-text-property (point) 'tags))
  (mapcar
   (lambda (pair)
 (if (member (car pair) tags)
 (add-text-properties (point-at-bol) (point-at-eol) `(face 
,(cdr pair)
   org-agenda-face-for-tagged-lines)

(add-hook 'org-agenda-finalize-hook 'org-agenda-fontify-tagged-line)

HTH,

-- 
 Bastien




Re: [O] Citations and references in ODT

2014-01-14 Thread Jambunathan K
Aric Gregson  writes:

> OpenDocument export failed: Symbol's function definition is void:
> org-element-cache-reset

You have some installation issues.  Try the following commands and try
to address any inconsistencies in the various paths.

C-h v org-version
M-x find-library org-loaddefs
M-x find-library ox
M-x find-library ox-odt
M-x find-library ox-jabref
M-x list-load-path-shadows org




Re: [O] Org Export to ODT Problem Files

2014-01-14 Thread Jambunathan K
Aric Gregson  writes:

>>>   4. Figure and table references are by section, sort of like old
>>> fashioned latex.
>
> For me, I am not writing a book or anything very long, just
> manuscripts. Thus, I would prefer just to label each figure in order and
> each table in order. I would therefore get Figure 1, Figure 2, etc and
> Table 1, Table 2, etc in the order of appearance in the text. There is
> no reference to section that way.

You are looking for this

(custom-set-variables
 '(org-odt-display-outline-level 0))




Re: [O] No ODT export option

2014-01-14 Thread Jambunathan K

Debian lags quite a bit (from few months to years).  It is difficult to
say what version they are packaging.

The best and easiest way to install latest Org would be to via GNU ELPA
or Org ELPA.  See http://orgmode.org/elpa.html.

M-x list-packages

Once you insall the package, restart Emacs and do

M-x customize-variable org-export-backends

and enable ODT.

ps: If you are new to Emacs/Org, you will have less troubles if you
start with an empty .emacs (or more specifically a .emacs that doesn't
have any Org specific configuration.)

Hendrik Boom  writes:

> On Fri, 10 Jan 2014 11:32:55 -0500, Ista Zahn wrote:
>
>> Hi Ken,
>> 
>> ODT export isn't enabled by default. You can enable it by putting
>> 
>> (require 'ox-odt)
>> 
>> in your config file and restart emacs.
>> 
>> Best,
>> Ista
>
> I'm having this problem on Debian testing, but not on Debian stable.
> I have installed the org-mode package on both systems.
>
> Inserting (require 'ox-odt) at the end of my  !/.emacs file gives me
> Warning (initialization): An error occurred while loading `/home/
> hendrik/.emacs':
>
> File error: Cannot open load file, ox-odt
>
> To ensure normal operation, you should investigate and remove the
> cause of the error in your initialization file.  Start Emacs with
> the `--debug-init' option to view a complete error backtrace.
>
> so it doesn't look as if it worked.
>
> For the record, there is a  /usr/share/emacs/site-lisp/org-mode/ ox-odt.el 
> file.
>
> Also, export to html works, presumably using the ox-html.el file in that 
> same directory, and I don't have to say (require 'ox-odt).  I'd preume 
> that file is found by the same mechanism, so not finding ox-odt by 
> default is a bit of a puzzle.
>
> The Debian testing system, which works, has similar files in teh same 
> place, but their names start with org- instead of ox-




Re: [O] working on cloud

2014-01-14 Thread Renato Pontefice
Ok! Can I set this variable? Or Do I have to run emacs with -u ?

TIA

Renato


2014/1/13 Bastien 

> Renato Pontefice  writes:
>
> > How do you obtain that?
>
> C-h v user-init-file RET
> C-h v user-emacs-directory RET
>
> --
>  Bastien
>


Re: [O] working on cloud

2014-01-14 Thread Nick Dokos
Renato Pontefice  writes:

> Ok! Can I set this variable? Or Do I have to run emacs with -u ?
>
> TIA
>
> Renato
>
> 2014/1/13 Bastien 
>
> Renato Pontefice  writes:
>
> > How do you obtain that?
>
> C-h v user-init-file RET
> C-h v user-emacs-directory RET
>
> --
>  Bastien
>

It seems to me that you have enough problems with basic emacs questions
that you would be better off either a) finding a local emacs guru who
could help you (it is much less frustrating to be able to ask a question
and get an immediate answer rather than waiting for days) or b) asking
your questions on the emacs IRC channel (somebody else will have to
provide a reference to that though - I don't know what it is off the top
of my head.)

If neither of these is possible, then the gnu.emacs.help newsgroup is
probably a better bet than the orgmode group.

I'm not trying to discourage you from asking questions, just trying to
suggest more efficient ways to get answers.

-- 
Nick




Re: [O] Change section (headings) numbering style

2014-01-14 Thread Vladimir Lomov
Hello,
** Axel E. Retif [2014-01-14 02:36:30 -0600]:

> Greetings!

> I need to change the numbering style of the first level sections (*) in the
> exported html file.

> Right now they are exported as

> 1 First section  ;; for * First section

> 1.1 First subsection ;; for ** First subsection

> etc.

> For the first part of the document that's all right, but for the next part I
> need

> A First new section  ;; for * First new section

> A.1 First new subsection ;; for ** First new subsection

> and so on.

> I've tried with different combinations of #+ATTR_HTML and #+OPTIONS with
> section-number-2 with no success.

I can suggest CSS way to accomplish this. I checked that it works with
firefox, but not sure for other browsers.

Minimal Org example:
#+BEGIN_SRC org

#+TITLE: An example
  ,#+OPTIONS: num:nil
  ,#+HTML_HEAD_EXTRA: 

  ,* This is title on top level

  Text for document body.

  ,** Title for subtop level

  Text for body of subtop level.

  ,* This is title of next top level heading

  Text text text.

  ,** Title of second order

  Text text text.
#+END_SRC

Additional CSS
#+BEGIN_SRC css

body {
  counter-reset: level;
}
#table-of-contents > h2:before {
  content: normal;
  counter-increment: level;
}
h2:before {
  content: counter(level, upper-latin) "  ";
  counter-increment: level;
}
h2 {
  counter-reset: sublevel;
}
h3:before {
  content: counter(level, upper-latin) "." counter(sublevel) "  ";
  counter-increment: sublevel;
}
#+END_SRC

Note, that use have to turn off 'automatic' numbering when exporting
from Org, this is because export routine inserts numbers 'by-hand' don't
relying on CSS (imho, not bad because there are browsers that don't
support CSS, but it would be great to have option to switch this
on/off).

Second, in example only headings of two levels (top, subtop) will have
desired format.

---
WBR, Vladimir Lomov


-- 
The difference between the right word and the almost right word is the
difference between lightning and the lightning bug.
-- Mark Twain



Re: [O] working on cloud

2014-01-14 Thread Alexander Baier
On 2014-01-14 13:24 Nick Dokos wrote:

> b) asking your questions on the emacs IRC channel (somebody else will
> have to provide a reference to that though - I don't know what it is
> off the top of my head.)

#emacs on freenode.

HTH,
-- 
 Alexander Baier



[O] python :session does return

2014-01-14 Thread Ken Mankoff


I've seen various historical issues with :session but it seems I may 
have a different problem. This is the latest org in emacs 24.3. If I 
do not have :session, then everything works just fine.


If I C-c C-c in the following code:

#+BEGIN_SRC python :session transect
import numpy as np
x = np.arange(12)
#+END_SRC

Emacs hangs the first time with minibuffer message of "Sent 
python-eldoc-setup-code". If I C-g, I can edit the org buffer again. 
All other invocations of that code and the minibuffer message is 
"executing Python code block...", but still emacs hangs until I C-g.


If I look at the *transect* buffer, I see the following. The code 
runs just fine, but for some reason it does not return.


  -k.



Enthought Canopy Python 2.7.3 | 64-bit | (default, Dec  2 2013, 
16:19:29)

[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more 
information.

import numpy as np
Start .pythonrc
End .pythonrc

import numpy as np

x = np.arange(12)
x = np.arange(12)


open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022Yjm', 
'w').write(str(_))
open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022Yjm', 
'w').write(str(_))





'org_babel_python_eoe'
'org_babel_python_eoe'

>>> >>> >>> >>> >>> Traceback (most recent call last):

  File "", line 1, in 
NameError: name '_' is not defined

>>> >>> 'org_babel_python_eoe'
import numpy as np

import numpy as np
x = np.arange(12)

x = np.arange(12)




open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022lts', 
'w').write(str(_))


open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022lts', 
'w').write(str(_))









'org_babel_python_eoe'

'org_babel_python_eoe'

'org_babel_python_eoe'









[O] colorize html output when batch exporting

2014-01-14 Thread Alan Schmitt
Hello,

I'm trying to batch export a file, and I don't seem to have colorization
working. Reading the documentation a bit, I found this information:

,
| org-html-htmlize-output-type is a variable defined in `ox-html.el'.
| Its value is inline-css
| 
| Documentation:
| Output type to be used by htmlize when formatting code snippets.
| Choices are `css', to export the CSS selectors only, or `inline-css', to
| export the CSS attribute values inline in the HTML.  We use as default
| `inline-css', in order to make the resulting HTML self-containing.
| 
| However, this will fail when using Emacs in batch mode for export, because
| then no rich font definitions are in place.  It will also not be good if
| people with different Emacs setup contribute HTML files to a website,
| because the fonts will represent the individual setups.  In these cases,
| it is much better to let Org/Htmlize assign classes only, and to use
| a style file to define the look of these classes.
| To get a start for your css file, start Emacs session and make sure that
| all the faces you are interested in are defined, for example by loading files
| in all modes you want.  Then, use the command
| M-x org-html-htmlize-generate-css to extract class definitions.
`

Following these instructions, I set up this variable in the init.el
called upon batch exporting, among other things:

#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path (file-name-directory load-file-name))

(require 'local_settings)

(require 'org)
(require 'ox-html)

(setq org-html-postamble nil)
(setq org-html-htmlize-output-type 'css)
(setq org-confirm-babel-evaluate nil)
#+END_SRC

Unfortunately I could not complete the next step (to get a start on the
css file), as `org-html-htmlize-generate-css` results in an error
"face-attribute: Invalid face: font-lock-comment". I tried to toggle
debug on error, but it does nothing.

Are there suggestions on how to generate this css file for a nice
coloring of my code?

Thanks,

Alan



[O] feature request: reloading settings in an org file should reload file local variables

2014-01-14 Thread Eric S Fraga
Hello,

I constantly run into an annoying side effect of org's handling of
settings in a document.  When writing a document for export, usually to
LaTeX, I find myself playing around with the document wide
setting variables, e.g. 

   #+options: toc:nil
   #+latex_header: \usepackage{tikz}

and similar.  Org requires me to re-load the document settings by
hitting C-c C-c on any such document setting line.  This is fine.

The problem is that org appears to reset *all* variables to default
(custom?)  settings.  This includes variables that have been set using
file local variables in the given document.  Of particular note is the
variable ~org-export-allow-bind-keywords~.  I normally have this set to
nil for safety reasons but wish to set this to t in some documents.  I
use something like this quite often on documents I *know* are safe:

,
| # Local Variables:
| # org-confirm-babel-evaluate: nil
| # org-export-allow-bind-keywords: t
| # End:
`

The problem is that hitting C-c C-c on a settings line clears these
variables.  Having the bind one reset is particularly confusing at
times.  In the end, I have to kill the buffer and re-visit the file to
have things set up properly.

Is it possible to have org reload the whole file when reloading
settings?  Or not reset any variables at all?  Either approach would be
exhibit more consistent behaviour possibly?  Obviously, the position in
the file would have to be remembered should the file be reloaded
automatically.

This is not a major issue but a niggly one...

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.5c-451-gf75f3d




Re: [O] feature request: reloading settings in an org file should reload file local variables

2014-01-14 Thread Carsten Dominik
Hi Eric,

On Jan 14, 2014, at 3:03 PM, Eric S Fraga  wrote:

> Hello,
> 
> I constantly run into an annoying side effect of org's handling of
> settings in a document.  When writing a document for export, usually to
> LaTeX, I find myself playing around with the document wide
> setting variables, e.g. 
> 
>   #+options: toc:nil
>   #+latex_header: \usepackage{tikz}
> 
> and similar.  Org requires me to re-load the document settings by
> hitting C-c C-c on any such document setting line.  This is fine.
> 
> The problem is that org appears to reset *all* variables to default
> (custom?)  settings.  This includes variables that have been set using
> file local variables in the given document.  Of particular note is the
> variable ~org-export-allow-bind-keywords~.  I normally have this set to
> nil for safety reasons but wish to set this to t in some documents.  I
> use something like this quite often on documents I *know* are safe:
> 
> ,
> | # Local Variables:
> | # org-confirm-babel-evaluate: nil
> | # org-export-allow-bind-keywords: t
> | # End:
> `
> 
> The problem is that hitting C-c C-c on a settings line clears these
> variables.  Having the bind one reset is particularly confusing at
> times.  In the end, I have to kill the buffer and re-visit the file to
> have things set up properly.
> 
> Is it possible to have org reload the whole file when reloading
> settings?  Or not reset any variables at all?  Either approach would be
> exhibit more consistent behaviour possibly?  Obviously, the position in
> the file would have to be remembered should the file be reloaded
> automatically.
> 
> This is not a major issue but a niggly one...

Could you try the following patch?

- Carsten

diff --git a/lisp/org.el b/lisp/org.el
index 549f1f8..6fca255 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20482,11 +20482,9 @@ This command does many different things, depending on 
context:
 Also updates the keyword regular expressions."
   (interactive)
   ;; this will set the mode *and* set file local variables.
-  (normal-mode)
-  ;; but it may leave us in some unrelated mode
-  (unless (derived-mode-p "org-mode")
-(org-mode))
-  (message "Org-mode restarted"))
+  (funcall major-mode)
+  (hack-local-variables)
+  (message "Mode restarted"))




Re: [O] Sh-ALT-RightArrow behavior has changed to demote only first subheader when subheaders collapsed

2014-01-14 Thread Bastien
Hi Susan,

this is now fixed in maint.

Thanks a lot for reporting this bug!

-- 
 Bastien



[O] How to signal end of a section or subsection

2014-01-14 Thread Ken Mankoff


I just re-watched the Carsten Google Tech Talk from 2008. He 
explains that Org was created as a hybrid note taker and TODO list, 
and that the TODOs should be embedded in the text. This leads me to 
a strange situation and I hope list members can explain how they 
deal with it.



* ONE: Sometimes I have as section of text as I take notes.

** TWO: And under that subsections

   A And there there are multiple paragraphs of text like this.

   B And like this.

   C And if one of these becomes an item that should be turned into 
a TODO item, how do I best do this?


For example, if "B" needs to be a TODO item, I could set it equal to 
TWO (subsection) like so: "** TODO B" or keep it in its current area 
under TWO (subsubsection) like so "*** TODO B".


The first doesn't make sense because I've elevated the notes under 
"** TWO" to be equal to it. The second option makes sense, but the 
problem is now that "C" is suddenly contained in "B" because there 
is no way to signal that the subsubsection "B" has ended and further 
text is in its original level of under subsection TWO.


I could go through and make A, B, and C all subsubsections, but now 
I need to make up titles for each paragraph of text under "TWO".


Perhaps the best-practice is what I wrote last - not paragraphs of 
text, but each paragraph is its own sub(sub(sub))section with as 
summary title. Is this what others do? Any other advice how do deal 
with this?


Thanks,

  -k.



Re: [O] tooltips

2014-01-14 Thread Bastien
Hi Rustom,

Rustom Mody  writes:

> I was wondering if org-mode html generation has some automatic way of
> generating tooltips.
>
> Something along the lines that instead of generating a footnote, a
> footnote should generate a tooltip.  The html would be something like
> this:
>
> 
> 
> 
> hover me
> 

Instead of changing the current HTML, I'd rather go and find a
solution where some javascript can display the tooltip.

Did you look for this?

-- 
 Bastien



Re: [O] Adding a new column in the agenda view

2014-01-14 Thread Bastien
Hi Marcelo,

Marcelo de Moraes Serpa  writes:

> I'd like to add a new column to display some information about the
> scheduled item in the agenda. Take the following screenshot: https://
> www.dropbox.com/s/gkcnbjrivhvql46/orgmode.jpg
>
> I'd like to add a colum there that shows the closest parent with the
> :project: tag. Does org provide any APIs for that? 

Nope -- check the org column tutorial to see the possibilities:
  http://orgmode.org/worg/org-tutorials/org-column-view-tutorial.html

Also check org-agenda-filter-by-top-headline (which is ^ in agenda 
mode): I think it can help you *not* implementing this view...

-- 
 Bastien



Re: [O] python :session does return

2014-01-14 Thread Ken Mankoff

On Tue, 14 Jan 2014, Ken Mankoff wrote:



I've seen various historical issues with :session but it seems I may have a 
different problem. This is the latest org in emacs 24.3. If I do not have 
:session, then everything works just fine.


If I C-c C-c in the following code:

#+BEGIN_SRC python :session transect
import numpy as np
x = np.arange(12)
#+END_SRC

Emacs hangs the first time with minibuffer message of "Sent 
python-eldoc-setup-code". If I C-g, I can edit the org buffer again. All 
other invocations of that code and the minibuffer message is "executing 
Python code block...", but still emacs hangs until I C-g.





Hmm. If I run IPython instead of regular python by setting this:
(setq org-babel-python-command "ipython --pylab --pdb --nosep")

Then org does not hang. It returns as expected. However, the 
capturing of output doesn't seem to work right.


In Org, the following:

#+begin_src python :session foo
x = 42
print x
#+end_src

Produces no RESULTS, and in the Python *foo* buffer I see:

In [8]: x = 42
In [9]: print x
42
In [10]: 
open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-35562TZV/python-3$
In [11]: 'org_babel_python_eoe'
Out[11]: 'org_babel_python_eoe'


But if I remove the "print" statment in Org:

#+begin_src python :session foo
x = 42
x
#+end_src

Then the RESULTS shows me 42, and the Python *foo* buffer is:

In [12]: x = 42
In [13]: x
Out[13]: 42
In [14]: 
open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-35562TZV/python-3$
In [15]: 'org_babel_python_eoe'
In [15]: Out[15]: 'org_babel_python_eoe'



Re: [O] feature request: reloading settings in an org file should reload file local variables

2014-01-14 Thread Nick Dokos
Carsten Dominik  writes:

> Hi Eric,
>
> On Jan 14, 2014, at 3:03 PM, Eric S Fraga  wrote:
>
>> Hello,
>> 
>> I constantly run into an annoying side effect of org's handling of
>> settings in a document.  When writing a document for export, usually to
>> LaTeX, I find myself playing around with the document wide
>> setting variables, e.g. 
>> 
>>   #+options: toc:nil
>>   #+latex_header: \usepackage{tikz}
>> 
>> and similar.  Org requires me to re-load the document settings by
>> hitting C-c C-c on any such document setting line.  This is fine.
>> 
>> The problem is that org appears to reset *all* variables to default
>> (custom?)  settings.  This includes variables that have been set using
>> file local variables in the given document.  Of particular note is the
>> variable ~org-export-allow-bind-keywords~.  I normally have this set to
>> nil for safety reasons but wish to set this to t in some documents.  I
>> use something like this quite often on documents I *know* are safe:
>> 
>> ,
>> | # Local Variables:
>> | # org-confirm-babel-evaluate: nil
>> | # org-export-allow-bind-keywords: t
>> | # End:
>> `
>> 
>> The problem is that hitting C-c C-c on a settings line clears these
>> variables.  Having the bind one reset is particularly confusing at
>> times.  In the end, I have to kill the buffer and re-visit the file to
>> have things set up properly.
>> 
>> Is it possible to have org reload the whole file when reloading
>> settings?  Or not reset any variables at all?  Either approach would be
>> exhibit more consistent behaviour possibly?  Obviously, the position in
>> the file would have to be remembered should the file be reloaded
>> automatically.
>> 
>> This is not a major issue but a niggly one...
>
> Could you try the following patch?
>
> - Carsten
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 549f1f8..6fca255 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -20482,11 +20482,9 @@ This command does many different things, depending 
> on context:
>  Also updates the keyword regular expressions."
>(interactive)
>;; this will set the mode *and* set file local variables.
> -  (normal-mode)
> -  ;; but it may leave us in some unrelated mode
> -  (unless (derived-mode-p "org-mode")
> -(org-mode))
> -  (message "Org-mode restarted"))
> +  (funcall major-mode)
> +  (hack-local-variables)
> +  (message "Mode restarted"))


I thought this was fixed, originally with commit 5ea0228
and after York Zhao found a problem (see the thread at
http://thread.gmane.org/gmane.emacs.orgmode/79187)
with commit 0911edfac881ab17a2cd1670f169ff4bdf1ac486
and two subsequent commits by Achim to fix some problems:

commit e655e664bff9fb6e98478682f03e713f990acba5
commit f2483ec4bbe196ab29ef6312b0d7c1c179a9eafe

Is this another maint vs master issue perhaps?

Nick




[O] [BUG, PATCH] org-indent-mode not correctly deactivated

2014-01-14 Thread Bastien
With a file like

,
| #+STARTUP: indent
| 
| * Heading
| ** Subheading
`

org-mode will correctly use org-indent-mode when displaying it.

Now edit the file to deactivate org-indent:

,
| #+STARTUP: noindent
| 
| * Heading
| ** Subheading
`

Go to #+STARTUP and hit C-c C-c : org-indent-mode will not be
activated, but it will not be properly deactivated, leaving a
confusing whitespace before indented headlines.

The attached patch fixes the problem, but it is wrong, because it
"actively" deactivates org-indent-mode each time a buffer is not
using org-indent-mode, in sessions where org-indent-mode has been
used at least once.

I could not come up with a better fix -- Nicolas, Carsten, do
you have an idea on how to fix this?

Thanks!

-- 
 Bastien




Re: [O] feature request: reloading settings in an org file should reload file local variables

2014-01-14 Thread Bastien
Carsten Dominik  writes:

> Could you try the following patch?

I just tried this and it does the right thing.

-- 
 Bastien



Re: [O] Filter for recursive counting (org-hierarchical-todo-statistics)

2014-01-14 Thread Fletcher Charest
Hi,

Okay, actually, after using this solution, there is just one thing I think
that could be considered a bug (not very problematic though). Consider the
following subtree:

* TOCOMPLETE Project A [0/3]
** TOCOMPLETE Subproject[0/2]
*** TODO Task 1
*** TODO Task 2
** TODO Task

I excluded the keyword TOCOMPLETE from 'org-provide-todo-statistics' so it
won't appear in the statistics. This is why I get [0/3] at the top of the
subtree. But if I mark the 2 tasks in the subproject as DONE, then I also
want to mark the subproject itself as DONE (using a special keyword, like
COMPLETED). However, marking it as COMPLETED will include it again in the
statistics: instead of getting [2/3], I will get [3/4].

Is there any way to explicitly include the DONE keyword in
org-provide-todo-statistics (and consequently, implicitly exclude other
DONE keywords)? I tried to include DONE but it doesn't work.

Thank you very much and sorry for the nitpicking ;)

FC


On Fri, Jan 10, 2014 at 11:29 PM, Fletcher Charest <
fletcher.char...@gmail.com> wrote:

> Dear Bastien,
>
> Thank you very much! It works perfectly.
>
> Best regards,
>
> FC
>
>
> On Sat, Jan 4, 2014 at 3:32 PM, Bastien  wrote:
>
>> Hi Fletcher,
>>
>> Fletcher Charest  writes:
>>
>> > My org-hierarchical-todo-statistics variable is set to nil in order
>> > to obtain a recursive count of my TODO items in subtrees. However, I
>> > would like to know if it is possible to filter this count to include
>> > only some TODO keywords.
>>
>> You may want to customize `org-provide-todo-statistics' and set it to
>> a list of TODO keywords for which you want statistics.
>>
>> HTH,
>>
>> --
>>  Bastien
>>
>


[O] subtree export title w/ tags

2014-01-14 Thread Robert Klein
Hi,

when I subtree (html-)export a text where the headline has a tag, the
title of the exported document includes the tag, e.g.


#+begin_src org

** headline   :mytag:

bla bla bla
#+end_src

results in

#+begin_src html
...
headline   :mytag:
...
#+end_src


Is there something I can do, so the tag doesn't end up in the title?


Thanks and best regards
Robert



Re: [O] subtree export title w/ tags

2014-01-14 Thread Bastien
Hi Robert,

Robert Klein  writes:

> Is there something I can do, so the tag doesn't end up in the title?

You can add the :EXPORT_TITLE: property in the subtree.

Still, I think tags should be removed from the title by default,
I will look into this.

HTH,

-- 
 Bastien



Re: [O] python :session does return

2014-01-14 Thread Nick Dokos
Ken Mankoff  writes:

> On Tue, 14 Jan 2014, Ken Mankoff wrote:
>
>>
>> I've seen various historical issues with :session but it seems I may have a 
>> different problem. This is the latest org in emacs 24.3. If I do not have 
>> :session, then everything works just fine.
>>
>> If I C-c C-c in the following code:
>>
>> #+BEGIN_SRC python :session transect
>> import numpy as np
>> x = np.arange(12)
>> #+END_SRC
>>
>> Emacs hangs the first time with minibuffer message of "Sent 
>> python-eldoc-setup-code". If I C-g, I can edit the org buffer again. All 
>> other invocations of that code and the minibuffer message is "executing 
>> Python code block...", but still emacs hangs until I C-g.
>>
>
>
> Hmm. If I run IPython instead of regular python by setting this:
> (setq org-babel-python-command "ipython --pylab --pdb --nosep")
>
> Then org does not hang. It returns as expected. However, the 
> capturing of output doesn't seem to work right.
>
> In Org, the following:
>
> #+begin_src python :session foo
> x = 42
> print x
> #+end_src
>
> Produces no RESULTS, and in the Python *foo* buffer I see:
>
> In [8]: x = 42
> In [9]: print x
> 42
> In [10]: 
> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-35562TZV/python-3$
> In [11]: 'org_babel_python_eoe'
> Out[11]: 'org_babel_python_eoe'
>
>
> But if I remove the "print" statment in Org:
>
> #+begin_src python :session foo
> x = 42
> x
> #+end_src
>
> Then the RESULTS shows me 42, and the Python *foo* buffer is:
>
> In [12]: x = 42
> In [13]: x
> Out[13]: 42
> In [14]: 
> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-35562TZV/python-3$
> In [15]: 'org_babel_python_eoe'
> In [15]: Out[15]: 'org_babel_python_eoe'

I believe that's the expected behaviour: the defaults value of :results
for python (and most other) source blocks is "value" and the print statement 
has no
value. If you want the output to appear in the results, try :results output.

Nick




Re: [O] tooltips

2014-01-14 Thread Christian Moe

Bastien writes:

> Instead of changing the current HTML, I'd rather go and find a
> solution where some javascript can display the tooltip.

E.g.:

---

$(document).ready(fntooltips);

function fntooltips() {
$(".footnum").each(
function () {
$("[href='#" + this.id + "']")
.attr("title",
  this.parentNode.parentNode.textContent);
   }
)
}

-

Tested with JQuery 1.9.1 and a recent Org.

Yours,
Christian



Re: [O] python :session does return

2014-01-14 Thread Ken Mankoff
On Tue, Jan 14, 2014 at 11:32 AM, Nick Dokos  wrote:

> Ken Mankoff  writes:
>
> > On Tue, 14 Jan 2014, Ken Mankoff wrote:
> >>
> >> I've seen various historical issues with :session but it seems I may
> have a
> >> different problem. This is the latest org in emacs 24.3. If I do not
> have
> >> :session, then everything works just fine.
> >>
> >> If I C-c C-c in the following code:
> >>
> >> #+BEGIN_SRC python :session transect
> >> import numpy as np
> >> x = np.arange(12)
> >> #+END_SRC
> >>
> >> Emacs hangs the first time with minibuffer message of "Sent
> >> python-eldoc-setup-code". If I C-g, I can edit the org buffer again. All
> >> other invocations of that code and the minibuffer message is "executing
> >> Python code block...", but still emacs hangs until I C-g.
> >>
> >
> >
> > Hmm. If I run IPython instead of regular python by setting this:
> > (setq org-babel-python-command "ipython --pylab --pdb --nosep")
> >
> > Then org does not hang. It returns as expected. However, the
> > capturing of output doesn't seem to work right.
> >
> > In Org, the following:
> >
> > #+begin_src python :session foo
> > x = 42
> > print x
> > #+end_src
> >
> > Produces no RESULTS, and in the Python *foo* buffer I see:
> >
> > In [8]: x = 42
> > In [9]: print x
> > 42
> > In [10]:
> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-35562TZV/python-3$
> > In [11]: 'org_babel_python_eoe'
> > Out[11]: 'org_babel_python_eoe'
> >
> >
> > But if I remove the "print" statment in Org:
> >
> > #+begin_src python :session foo
> > x = 42
> > x
> > #+end_src
> >
> > Then the RESULTS shows me 42, and the Python *foo* buffer is:
> >
> > In [12]: x = 42
> > In [13]: x
> > Out[13]: 42
> > In [14]:
> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-35562TZV/python-3$
> > In [15]: 'org_babel_python_eoe'
> > In [15]: Out[15]: 'org_babel_python_eoe'
>
> I believe that's the expected behaviour: the defaults value of :results
> for python (and most other) source blocks is "value" and the print
> statement has no
> value. If you want the output to appear in the results, try :results
> output.
>

Nope. If I don't use IPython, everything hangs regardless of :results.
When I do use IPython, ":results output" doesn't show "print" statement.
The plain "x" showing up in the output goes away if I use ":results output".

   -k.


Re: [O] python :session does return

2014-01-14 Thread Nick Dokos
Ken Mankoff  writes:

> On Tue, Jan 14, 2014 at 11:32 AM, Nick Dokos  wrote:
>
> Ken Mankoff  writes:
>
> > On Tue, 14 Jan 2014, Ken Mankoff wrote:
> >>
> >> I've seen various historical issues with :session but it seems I may 
> have a
> >> different problem. This is the latest org in emacs 24.3. If I do not 
> have
> >> :session, then everything works just fine.
> >>
> >> If I C-c C-c in the following code:
> >>
> >> #+BEGIN_SRC python :session transect
> >> import numpy as np
> >> x = np.arange(12)
> >> #+END_SRC
> >>
> >> Emacs hangs the first time with minibuffer message of "Sent
> >> python-eldoc-setup-code". If I C-g, I can edit the org buffer again. 
> All
> >> other invocations of that code and the minibuffer message is "executing
> >> Python code block...", but still emacs hangs until I C-g.
> >>
> >
> >
> > Hmm. If I run IPython instead of regular python by setting this:
> > (setq org-babel-python-command "ipython --pylab --pdb --nosep")
> >
> > Then org does not hang. It returns as expected.
> >
> > In Org, the following:
> >
> > #+begin_src python :session foo
> > x = 42
> > print x
> > #+end_src
> >
> > Produces no RESULTS, and in the Python *foo* buffer I see:
> >
> > In [8]: x = 42
> > In [9]: print x
> > 42
> > In [10]: 
> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-35562TZV/python-3$
> > In [11]: 'org_babel_python_eoe'
> > Out[11]: 'org_babel_python_eoe'
> >
> >
> > But if I remove the "print" statment in Org:
> >
> > #+begin_src python :session foo
> > x = 42
> > x
> > #+end_src
> >
> > Then the RESULTS shows me 42, and the Python *foo* buffer is:
> >
> > In [12]: x = 42
> > In [13]: x
> > Out[13]: 42
> > In [14]: 
> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-35562TZV/python-3$
> > In [15]: 'org_babel_python_eoe'
> > In [15]: Out[15]: 'org_babel_python_eoe'
>
> I believe that's the expected behaviour: the defaults value of :results
> for python (and most other) source blocks is "value" and the print 
> statement has no
> value. If you want the output to appear in the results, try :results 
> output.
>
> Nope. If I don't use IPython, everything hangs regardless of :results.
> When I do use IPython, ":results output" doesn't show "print" statement. 
> The plain "x" showing up in the output goes away if I use ":results output".
>

I'm not talking about the hang: that's a problem (although I can't
reproduce it, so it may -or may not - be a problem with your particular
setup.)

I was specifically addressing this comment:

> However, the capturing of output doesn't seem to work right.

Nick





Re: [O] How to signal end of a section or subsection

2014-01-14 Thread Eric S Fraga
Ken Mankoff  writes:

> I just re-watched the Carsten Google Tech Talk from 2008. He explains

Great talk that was!  Changed my life.

> that Org was created as a hybrid note taker and TODO list, and that
> the TODOs should be embedded in the text. This leads me to a strange
> situation and I hope list members can explain how they deal with it.
>
>
> * ONE: Sometimes I have as section of text as I take notes.
>
> ** TWO: And under that subsections
>
>A And there there are multiple paragraphs of text like this.
>
>B And like this.
>
>C And if one of these becomes an item that should be turned into a
> TODO item, how do I best do this?

What I would do is make the A, B and C paragraph items.  Then add
checkboxes (C-u C-c C-x C-b) to any list item you want to mark as a todo
item.  You can set/unset using C-c C-x C-b.  If you add the text [/] to
the headline with the TODO on it, it will be updated to indicate the
number of completed checkboxes and the total number of such boxes each
time you set or unset one.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.4-322-gece429




Re: [O] Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)]

2014-01-14 Thread Eric S Fraga
Hello and apologies for jumping uninvited into this thread.

I very often make use of the [] feature in itemised lists to change
individual bullet points, for instance.  I would not like this feature
to disappear: it would break many of my documents, especially my beamer
presentations.

In fact, I had started preparing an email to ask the check lists make
use of this feature to make these lists look nicer when exported to
LaTeX.  For instance, if we have

  - [ ] not yet done
  - [X] this has been done

the exporter currently generates

\item $\square$ not yet done
\item $\boxtimes$ this has been done

I would like to have this instead which looks much nicer:

\item [$\square$] not yet done
\item [$\boxtimes$] this has been done

Try it and see how much nicer the list looks...

Thanks,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.4-322-gece429




Re: [O] python :session does return

2014-01-14 Thread Ken Mankoff

On Tue, 14 Jan 2014, Nick Dokos wrote:


When I do use IPython, ":results output" doesn't show "print" 
statement. The plain "x" showing up in the output goes away if I 
use ":results output".




I'm not talking about the hang: that's a problem (although I can't 
reproduce it, so it may -or may not - be a problem with your 
particular setup.)


I was specifically addressing this comment:


However, the capturing of output doesn't seem to work right.




Yes I got your comment. The :results output doesn't work either.

  -k.



Re: [O] colorize html output when batch exporting

2014-01-14 Thread Rick Frankel

On 2014-01-14 08:45, Alan Schmitt wrote:

Hello,

I'm trying to batch export a file, and I don't seem to have 
colorization

working. Reading the documentation a bit, I found this information:

Following these instructions, I set up this variable in the init.el
called upon batch exporting, among other things:



Unfortunately I could not complete the next step (to get a start on the
css file), as `org-html-htmlize-generate-css` results in an error
"face-attribute: Invalid face: font-lock-comment". I tried to toggle
debug on error, but it does nothing.

Are there suggestions on how to generate this css file for a nice
coloring of my code?


Which version of emacs are you using? FWIW, I just had this problem
yesterday (although it choked on a different face) in emacs trunk
(24.4.x). But on my machine @work on (24.3.8) it is working fine.

It seems that htmlize is choking on invalid face definitions.
Somewhere you have a reference to a face "font-lock-comment" which
does not exist (the correct definition in this case is
"font-lock-comment-face"), so if you can find the customization that
refers to "font-lock-comment" and fix it you should be able to
generate the CSS.

rick



Re: [O] tooltips

2014-01-14 Thread Rustom Mody
On Tue, Jan 14, 2014 at 11:16 PM, Christian Moe  wrote:
>
> Bastien writes:
>
>> Instead of changing the current HTML, I'd rather go and find a
>> solution where some javascript can display the tooltip.
>
> E.g.:
>
> ---
>
> $(document).ready(fntooltips);
>
> function fntooltips() {
> $(".footnum").each(
> function () {
> $("[href='#" + this.id + "']")
> .attr("title",
>   this.parentNode.parentNode.textContent);
>}
> )
> }
>
> -
>
> Tested with JQuery 1.9.1 and a recent Org.
>
> Yours,
> Christian


May I have the setup?
ie where do I put that JS, the invocation/import or whatever of JQuery etc
[I really dont know any JS!]



[O] Italicise block of text

2014-01-14 Thread Roger Mason

Hello,

Is there a way to italicise a block of text rather that just single 
words? (org-mode 8.0.3).


Thanks,
Roger



Re: [O] Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)]

2014-01-14 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> I very often make use of the [] feature in itemised lists to change
> individual bullet points, for instance.  I would not like this feature
> to disappear: it would break many of my documents, especially my beamer
> presentations.

I sometimes use this feature, too. But, admittedly, it is a hack.

I though about escaping first opening square bracket, but only if the
item doesn't start with an export snippet. E.g,

  - [item-->  \item\relax [item
  
but,

  - @@latex:[\blacktriangle]@@ item  --> \item [\blacktriangle]

Unfortunately, I can't see how to not break your documents if we fix the
problem.

> In fact, I had started preparing an email to ask the check lists make
> use of this feature to make these lists look nicer when exported to
> LaTeX.  For instance, if we have
>
>   - [ ] not yet done
>   - [X] this has been done
>
> the exporter currently generates
>
> \item $\square$ not yet done
> \item $\boxtimes$ this has been done
>
> I would like to have this instead which looks much nicer:
>
> \item [$\square$] not yet done
> \item [$\boxtimes$] this has been done
>
> Try it and see how much nicer the list looks...

This is orthogonal to the issue at hand. The problem is not the checkbox
but what comes after. IOW, this feature can be implemented with or
without fixing the bug above (also, a filter can do the job).


Regards,

-- 
Nicolas Goaziou



[O] Buffer local alias?

2014-01-14 Thread Thomas S. Dye
Aloha all,

My evolving reproducible research documents make use of Dan Davison's
idea recently re-introduced by Seb Vauban:

  * Local variables  :noexport:

  # Local Variables:
  # eval: (org-sbe "setup-common-lisp")
  # End:

Here, the source code block named `setup-common-lisp' is defined
elsewhere in the file.

The problem from the point of view of reproducible research is that
org-sbe used to be named sbe, so for the research to be reproducible
across that recent change I need to be able to configure things so the
command that happens to be on the user's computer is used.

I read about defalias and saw that this should be used at the
point that the original definition is made, so I followed the pointer to
fset and naively tried this in the local variables:

# eval: (and (boundp 'org-sbe) (not (boundp 'sbe)) (fset 'sbe 'org-sbe))
# eval: (sbe "setup-common-lisp)

But this gets me the following error:

  File local-variables error: (void-function sbe)

Can someone offer a suggestion?

All the best,
Tom

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] tooltips

2014-01-14 Thread Bastien
Christian Moe  writes:

> $(document).ready(fntooltips);
>
> function fntooltips() {
> $(".footnum").each(
>   function () {
>   $("[href='#" + this.id + "']")
>   .attr("title",
> this.parentNode.parentNode.textContent);
>  }
>   )
> }

Yes, exactly, thanks!

-- 
 Bastien



[O] Angular brackets break LaTex environment in html-export

2014-01-14 Thread Axel

Hi,

When I use angular brackets in a LaTeX environment, sometimes they break 
the mathjax-rendering when exported to html/Rhtml (See example below). 
Export into LaTeX-pdf works fine in all cases, but export into html 
fails without whitespaces. Is this due to interference with the 
timestamps in org-mode?


--8<---cut here---start->8---

* heading

\(  \sim t \)

\( < R^2 > \sim t \)

\[ \left \sim t \]

\[ \left< R^2 \right> \sim t \]

-8<---cut here---end->8---

Cheers
Axel



Re: [O] Citations and references in ODT

2014-01-14 Thread Aric Gregson
Jambunathan K  writes:

> This will be an one-off change, so I am hesitant to consider this.
...
> I am interested in considering all suggestions or use-cases that extends
> or improves upon the current practice. 

Clearly for me, this would not be a one off change...

Thanks, Aric



Re: [O] Citations and references in ODT

2014-01-14 Thread Aric Gregson
Jambunathan K  writes:

> C-h v org-version

org-version is a variable defined in `org.el'.
Its value is "8.2.5c"

> M-x find-library org-loaddefs

;;; org-loaddefs.el --- autogenerated file, do not edit
;;
;;; Code:

;;;### (autoloads (org-babel-mark-block org-babel-previous-src-block
;;  org-babel-next-src-block org-babel-goto-named-result 
org-babel-goto-named-src-block
...

> M-x find-library ox

;;; ox.el --- Generic Export Engine for Org Mode

;; Copyright (C) 2012-2014 Free Software Foundation, Inc.

;; Author: Nicolas Goaziou 
;; Keywords: outlines, hypermedia, calendar, wp

;; This file is part of GNU Emacs.
...

> M-x find-library ox-odt

;;; ox-odt.el --- OpenDocument Text Exporter for Org Mode

;; Copyright (C) 2010-2013 Free Software Foundation, Inc.

;; Author: Jambunathan K 
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org

;; This file is part of GNU Emacs.
...

> M-x find-library ox-jabref

;;; ox-jabref.el --- JabRef Citation Processor for Orgmode

;; Copyright (C) 2013 Jambunathan K 

;; Author: Jambunathan K 
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 8.0.6

;;; Commentary:

 Quick start guide:
;;
;; 1. Install [[http://jabref.sourceforge.net/][JabRef]]
;;
;;This module is tested with version JabRef-2.9.2.jar.
;;
...

> M-x list-load-path-shadows org

I am not able to put in the org. It just runs after the command and does
not allow options. Sorry for the large output. 

/fitz/home/aorchid/.emacs.d/gnus/lisp/sasl-ntlm hides 
/usr/local/share/emacs/24.3/site-lisp/flim/sasl-ntlm
/fitz/home/aorchid/.emacs.d/gnus/lisp/hmac-md5 hides 
/usr/local/share/emacs/24.3/site-lisp/flim/hmac-md5
/fitz/home/aorchid/.emacs.d/gnus/lisp/md4 hides 
/usr/local/share/emacs/24.3/site-lisp/flim/md4
/fitz/home/aorchid/.emacs.d/gnus/lisp/sasl-cram hides 
/usr/local/share/emacs/24.3/site-lisp/flim/sasl-cram
/fitz/home/aorchid/.emacs.d/gnus/lisp/hex-util hides 
/usr/local/share/emacs/24.3/site-lisp/flim/hex-util
/fitz/home/aorchid/.emacs.d/gnus/lisp/sasl-digest hides 
/usr/local/share/emacs/24.3/site-lisp/flim/sasl-digest
/fitz/home/aorchid/.emacs.d/gnus/lisp/hmac-def hides 
/usr/local/share/emacs/24.3/site-lisp/flim/hmac-def
/fitz/home/aorchid/.emacs.d/gnus/lisp/ntlm hides 
/usr/local/share/emacs/24.3/site-lisp/flim/ntlm
/fitz/home/aorchid/.emacs.d/gnus/lisp/sasl hides 
/usr/local/share/emacs/24.3/site-lisp/flim/sasl
/fitz/home/aorchid/.emacs.d/gnus/lisp/sha1 hides 
/usr/local/share/emacs/24.3/site-lisp/flim/sha1
/fitz/home/aorchid/.emacs.d/gnus/lisp/smime hides 
/usr/local/share/emacs/24.3/site-lisp/semi/smime
/fitz/home/aorchid/.emacs.d/gnus/lisp/utf7 hides 
/usr/local/share/emacs/24.3/site-lisp/wl/utf7
/fitz/home/aorchid/.emacs.d/gnus/lisp/hex-util hides 
/usr/local/share/emacs/24.3/lisp/hex-util
/fitz/home/aorchid/.emacs.d/gnus/lisp/password-cache hides 
/usr/local/share/emacs/24.3/lisp/password-cache
/fitz/home/aorchid/.emacs.d/gnus/lisp/format-spec hides 
/usr/local/share/emacs/24.3/lisp/format-spec
/fitz/home/aorchid/.emacs.d/gnus/lisp/color hides 
/usr/local/share/emacs/24.3/lisp/color
/fitz/home/aorchid/.emacs.d/gnus/lisp/md4 hides 
/usr/local/share/emacs/24.3/lisp/md4
/fitz/home/aorchid/.emacs.d/gnus/lisp/dns-mode hides 
/usr/local/share/emacs/24.3/lisp/textmodes/dns-mode
~/.emacs.d/remember/remember hides 
/usr/local/share/emacs/24.3/lisp/textmodes/remember
~/.emacs.d/org-mode/lisp/ob-picolisp hides 
/usr/local/share/emacs/24.3/lisp/org/ob-picolisp
~/.emacs.d/org-mode/lisp/org-eshell hides 
/usr/local/share/emacs/24.3/lisp/org/org-eshell
~/.emacs.d/org-mode/lisp/org-capture hides 
/usr/local/share/emacs/24.3/lisp/org/org-capture
~/.emacs.d/org-mode/lisp/ob-keys hides 
/usr/local/share/emacs/24.3/lisp/org/ob-keys
~/.emacs.d/org-mode/lisp/org-archive hides 
/usr/local/share/emacs/24.3/lisp/org/org-archive
~/.emacs.d/org-mode/lisp/ob-asymptote hides 
/usr/local/share/emacs/24.3/lisp/org/ob-asymptote
~/.emacs.d/org-mode/lisp/org-mouse hides 
/usr/local/share/emacs/24.3/lisp/org/org-mouse
~/.emacs.d/org-mode/lisp/org-agenda hides 
/usr/local/share/emacs/24.3/lisp/org/org-agenda
~/.emacs.d/org-mode/lisp/ob-lob hides 
/usr/local/share/emacs/24.3/lisp/org/ob-lob
~/.emacs.d/org-mode/lisp/ob-js hides /usr/local/share/emacs/24.3/lisp/org/ob-js
~/.emacs.d/org-mode/lisp/ob-gnuplot hides 
/usr/local/share/emacs/24.3/lisp/org/ob-gnuplot
~/.emacs.d/org-mode/lisp/org-loaddefs hides 
/usr/local/share/emacs/24.3/lisp/org/org-loaddefs
~/.emacs.d/org-mode/lisp/ob-fortran hides 
/usr/local/share/emacs/24.3/lisp/org/ob-fortran
~/.emacs.d/org-mode/lisp/ob-scheme hides 
/usr/local/share/emacs/24.3/lisp/org/ob-scheme
~/.emacs.d/org-mode/lisp/org-plot hides 
/usr/local/share/emacs/24.3/lisp/org/org-plot
~/.emacs.d/org-mode/lisp/ob-sh hides /usr/local/share/emacs/24.3/lisp/org/ob-sh
~/.emacs.d/org-mode/lisp/org-footnote hides 
/usr/local/share/emacs/24.3/lisp/org/org-footnote
~/.emacs.d/org-mode/contrib/lisp/or

Re: [O] Org Export to ODT Problem Files

2014-01-14 Thread Aric Gregson
Jambunathan K  writes:

> You are looking for this
>
> (custom-set-variables
>  '(org-odt-display-outline-level 0))

Thanks, Aric



[O] Local variables and babel

2014-01-14 Thread Thomas S. Dye
Aloha all,

Impressed by the many problems described on the ML that are caused by a
setting in .emacs, I've slowly been working to make my configuration
buffer local, using source code blocks stored in my local library of
babel or placed in a noexport section of the Org mode file and then
evaluated in the local variables section at the bottom of the file.  So
far, I like this approach.

This led me to try to incorporate some of the file-specific setup steps
into the local variables as well.  For instance, in a file where I'm
working with Common Lisp source code blocks and a graph library, I have
this: 

  # eval: (slime)
  # eval: (org-sbe "graph-setup")

My goal is to open the Org mode file and find that everything is ready
for me to work.

What I've found is that the graph-setup doesn't have any effect on the
Common Lisp environment when run this way. It works fine if, after slime
is up and running, I go to the graph-setup source code block and
evaluate it with C-c C-c.

I'm guessing that I might be running into a concurrency problem here,
such that the local variable evaluation of graph-setup is taking place
before slime has finished setting itself up (which takes many seconds on
my machine).

I am well beyond my programming abilities here and would like to have
opinions on whether this approach is potentially workable and, if so,
how it might be implemented.

All the best,
Tom

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] Buffer local alias?

2014-01-14 Thread Nick Dokos
t...@tsdye.com (Thomas S. Dye) writes:

> Aloha all,
>
> My evolving reproducible research documents make use of Dan Davison's
> idea recently re-introduced by Seb Vauban:
>
>   * Local variables  
> :noexport:
>
>   # Local Variables:
>   # eval: (org-sbe "setup-common-lisp")
>   # End:
>
> Here, the source code block named `setup-common-lisp' is defined
> elsewhere in the file.
>
> The problem from the point of view of reproducible research is that
> org-sbe used to be named sbe, so for the research to be reproducible
> across that recent change I need to be able to configure things so the
> command that happens to be on the user's computer is used.
>
> I read about defalias and saw that this should be used at the
> point that the original definition is made, so I followed the pointer to
> fset and naively tried this in the local variables:
>
> # eval: (and (boundp 'org-sbe) (not (boundp 'sbe)) (fset 'sbe 'org-sbe))
> # eval: (sbe "setup-common-lisp)
>
> But this gets me the following error:
>
>   File local-variables error: (void-function sbe)
>
> Can someone offer a suggestion?
>

Use fboundp, instead of boundp: the latter checks the variable binding
slot, whereas the former checks the function binding slot.

Nick




Re: [O] Buffer local alias?

2014-01-14 Thread Bastien
Nick Dokos  writes:

> Use fboundp, instead of boundp: the latter checks the variable binding
> slot, whereas the former checks the function binding slot.

Also, I thought sbe was unknown enough to rename it directly
instead of creating an alias.  If many people are using sbe,
maybe an alias is better -- but I'd rather not to add it.

-- 
 Bastien



Re: [O] Angular brackets break LaTex environment in html-export

2014-01-14 Thread Nick Dokos
Axel  writes:

> Hi,
>
> When I use angular brackets in a LaTeX environment, sometimes they break 
> the mathjax-rendering when exported to html/Rhtml (See example below). 
> Export into LaTeX-pdf works fine in all cases, but export into html 
> fails without whitespaces. Is this due to interference with the 
> timestamps in org-mode?
>

No, it's a mathjax limitation: see

   http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-in-html-documents

>
> * heading
>
> \(  \sim t \)
>
> \( < R^2 > \sim t \)
>
> \[ \left \sim t \]
>
> \[ \left< R^2 \right> \sim t \]
>
>
> Cheers
> Axel

Nick




Re: [O] feature request: reloading settings in an org file should reload file local variables

2014-01-14 Thread Carsten Dominik

On 14 Jan 2014, at 16:33, Nick Dokos  wrote:

> Carsten Dominik  writes:
> 
>> Hi Eric,
>> 
>> On Jan 14, 2014, at 3:03 PM, Eric S Fraga  wrote:
>> 
>>> Hello,
>>> 
>>> I constantly run into an annoying side effect of org's handling of
>>> settings in a document.  When writing a document for export, usually to
>>> LaTeX, I find myself playing around with the document wide
>>> setting variables, e.g. 
>>> 
>>>  #+options: toc:nil
>>>  #+latex_header: \usepackage{tikz}
>>> 
>>> and similar.  Org requires me to re-load the document settings by
>>> hitting C-c C-c on any such document setting line.  This is fine.
>>> 
>>> The problem is that org appears to reset *all* variables to default
>>> (custom?)  settings.  This includes variables that have been set using
>>> file local variables in the given document.  Of particular note is the
>>> variable ~org-export-allow-bind-keywords~.  I normally have this set to
>>> nil for safety reasons but wish to set this to t in some documents.  I
>>> use something like this quite often on documents I *know* are safe:
>>> 
>>> ,
>>> | # Local Variables:
>>> | # org-confirm-babel-evaluate: nil
>>> | # org-export-allow-bind-keywords: t
>>> | # End:
>>> `
>>> 
>>> The problem is that hitting C-c C-c on a settings line clears these
>>> variables.  Having the bind one reset is particularly confusing at
>>> times.  In the end, I have to kill the buffer and re-visit the file to
>>> have things set up properly.
>>> 
>>> Is it possible to have org reload the whole file when reloading
>>> settings?  Or not reset any variables at all?  Either approach would be
>>> exhibit more consistent behaviour possibly?  Obviously, the position in
>>> the file would have to be remembered should the file be reloaded
>>> automatically.
>>> 
>>> This is not a major issue but a niggly one...
>> 
>> Could you try the following patch?
>> 
>> - Carsten
>> 
>> diff --git a/lisp/org.el b/lisp/org.el
>> index 549f1f8..6fca255 100644
>> --- a/lisp/org.el
>> +++ b/lisp/org.el
>> @@ -20482,11 +20482,9 @@ This command does many different things, depending 
>> on context:
>> Also updates the keyword regular expressions."
>>   (interactive)
>>   ;; this will set the mode *and* set file local variables.
>> -  (normal-mode)
>> -  ;; but it may leave us in some unrelated mode
>> -  (unless (derived-mode-p "org-mode")
>> -(org-mode))
>> -  (message "Org-mode restarted"))
>> +  (funcall major-mode)
>> +  (hack-local-variables)
>> +  (message "Mode restarted"))
> 
> 
> I thought this was fixed, originally with commit 5ea0228
> and after York Zhao found a problem (see the thread at
> http://thread.gmane.org/gmane.emacs.orgmode/79187)
> with commit 0911edfac881ab17a2cd1670f169ff4bdf1ac486
> and two subsequent commits by Achim to fix some problems:
> 
> commit e655e664bff9fb6e98478682f03e713f990acba5
> commit f2483ec4bbe196ab29ef6312b0d7c1c179a9eafe
> 
> Is this another maint vs master issue perhaps?
> 
> Nick
> 
> 


Indeed, there were differences between maint and master.  Now fixed in both.
- Carsten




Re: [O] Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)]

2014-01-14 Thread Eric S Fraga
Nicolas Goaziou  writes:

[...]

> I sometimes use this feature, too. But, admittedly, it is a hack.

I guess it depends on the definition of /hack/...  I think of it as a
feature of lists in LaTeX.  Whether this is view extends to org is of
course open to debate.

[...]

> Unfortunately, I can't see how to not break your documents if we fix the
> problem.

If this is considered a problem, and you intend to fix it, then there is
no way to avoid causing me difficulties.  Although I would obviously
prefer to keep the status quo, as I find this "feature" convenient,
please don't let the inconvenience to me stop you fixing this.  It won't
take me that long to fix.

>> In fact, I had started preparing an email to ask the check lists make
>> use of this feature to make these lists look nicer when exported to
>> LaTeX.  For instance, if we have

[...]

> This is orthogonal to the issue at hand. 

It is indeed.  Apologies for conflating the two.

> The problem is not the checkbox but what comes after.

I am not sure what you mean here?

> IOW, this feature can be implemented with or
> without fixing the bug above (also, a filter can do the job).

Yes, I appreciate this.  A filter is likely what I will end up
using.  Today I simply edited the LaTeX as I needed to get a document of
actions etc. out to a bunch of people quickly.

Thanks for your quick response and please do change the handling of []s
if you think it would be for the org community's benefit.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.5d-479-g8694aa




Re: [O] feature request: reloading settings in an org file should reload file local variables

2014-01-14 Thread Eric S Fraga
Carsten Dominik  writes:

> Hi Eric,

[...]

> Could you try the following patch?
>
> - Carsten

Seems to work just fine!  Thanks.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.5d-479-g8694aa




[O] Changing behaviour of {:} in column view?

2014-01-14 Thread Luke Crook


In column view, org-mode sums 3xSubtasks each having an effort of "1d" as "1d 
0:00".  Is there a way to change the sum to display this as "3d"?

/Luke




Re: [O] Change section (headings) numbering style

2014-01-14 Thread Axel E. Retif

On 01/14/2014 06:43 AM, Vladimir Lomov wrote:


Hello, ** Axel E. Retif [2014-01-14 02:36:30 -0600]:


I need to change the numbering style of the first level sections
(*) in the exported html file.


[...]


I can suggest CSS way to accomplish this. I checked that it works
with firefox, but not sure for other browsers.


Sorry for not replying earlier ---I wasn't around.

I'll try to use your kind suggestion.

Thank you so much for digging into this!


Best

Axel




Re: [O] Buffer local alias?

2014-01-14 Thread Thomas S. Dye
Bastien  writes:

> Nick Dokos  writes:
>
>> Use fboundp, instead of boundp: the latter checks the variable binding
>> slot, whereas the former checks the function binding slot.
>
> Also, I thought sbe was unknown enough to rename it directly
> instead of creating an alias.  If many people are using sbe,
> maybe an alias is better -- but I'd rather not to add it.

Thanks Nick. This works:

  * Local variables  :noexport:

  # Local Variables:
  # eval: (and (fboundp 'org-sbe) (not (fboundp 'sbe)) (fset 'sbe 'org-sbe))
  # eval: (sbe "setup-common-lisp")
  # End:

Bastien, for my use case there is no reason to define an alias.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Local variables and babel

2014-01-14 Thread Michael Albinus
t...@tsdye.com (Thomas S. Dye) writes:

> Aloha all,

Hi,

> This led me to try to incorporate some of the file-specific setup steps
> into the local variables as well.  For instance, in a file where I'm
> working with Common Lisp source code blocks and a graph library, I have
> this:
>
>   # eval: (slime)
>   # eval: (org-sbe "graph-setup")
>
> What I've found is that the graph-setup doesn't have any effect on the
> Common Lisp environment when run this way. It works fine if, after slime
> is up and running, I go to the graph-setup source code block and
> evaluate it with C-c C-c.
>
> I'm guessing that I might be running into a concurrency problem here,
> such that the local variable evaluation of graph-setup is taking place
> before slime has finished setting itself up (which takes many seconds on
> my machine).
>
> I am well beyond my programming abilities here and would like to have
> opinions on whether this approach is potentially workable and, if so,
> how it might be implemented.

I don't know slime, but usual there are hooks where you could add your
code to run once a package (like slime) has finished its
initialization. Look for such a hook in slime, and add the call to
graph-setup there.

> All the best,
> Tom

Best regards, Michael.



Re: [O] [poll] Fontify code in code blocks

2014-01-14 Thread Bastien


Hi Sébastien,

"Sebastien Vauban" 
writes:

> I think this overall results of the poll is quite clear, no?

Well, I think we should wait for Carsten's vote on this.

Carsten, do you think `org-src-fontify-natively' should
be set to `t' by default for Org 8.3?  Votes are for this
default in majority so far, but there are only a few votes.

-- 
 Bastien




Re: [O] [poll] Fontify code in code blocks

2014-01-14 Thread Bastien


When `org-src-fontify-natively' will be `t' by default,
it will be important to keep the distinction between source
blocks and HTML/LaTeX blocks.

So HTML blocks should remain unfontified by default, just
to mark the difference with "active" source blocks.

I still think an option to highlight them would be nice.

> That would be the same for #+HTML/LaTeX one-liners, yes!

For this I disagree... this would encourage using such
one-liners too much.

> Now, I have no idea about what's the work required. But I definitely
> would love to see that implemented.

Well, it's not hard but not straightforward -- and I'd rather
be sure that the decision is to take that route before I try to
implement this.

Waiting to read what other think.

-- 
 Bastien




Re: [O] Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)]

2014-01-14 Thread Nicolas Goaziou
Eric S Fraga  writes:

> I guess it depends on the definition of /hack/...  I think of it as a
> feature of lists in LaTeX.  Whether this is view extends to org is of
> course open to debate.

I was only talking about Org. The problem there is that a square bracket
at the beginning of an item can prevent you from exporting the document,
which is clearly a bug.

>> Unfortunately, I can't see how to not break your documents if we fix the
>> problem.
>
> If this is considered a problem, and you intend to fix it, then there is
> no way to avoid causing me difficulties.

I'd like to fix it, yes. It will not help you with older documents, but
what do you think about the export snippet exception I suggested?

> Although I would obviously prefer to keep the status quo, as I find
> this "feature" convenient, please don't let the inconvenience to me
> stop you fixing this. It won't take me that long to fix.

I'm open to alternative solutions. Though, I'd like to have a solution
pushed to maint before Emacs release.

>> The problem is not the checkbox but what comes after.
>
> I am not sure what you mean here?

Not much. We want to take action when item's contents start with
a square bracket. But that will not happen if that item already has
a checkbox (in this case, contents first character doesn't mean much).


Regards,

-- 
Nicolas Goaziou



Re: [O] File mode specification error: (error ":END: line missing at position 63362")

2014-01-14 Thread Bastien
Hi Martin,

maybe you can use this helper function:

(defun bzg-find-corrupted-property-drawers ()
  "Find corrupted property drawers."
  (interactive)
  (let (msgs)
(save-excursion
  (goto-char (point-min))
  (while (search-forward ":PROPERTIES:" nil t)
(let ((search-end (save-excursion (org-end-of-subtree t
  (if (not (search-forward ":END:" search-end t))
  (push (format "Missing :END: at %d in %s\n"
(point) (buffer-name))
msgs)
(if (not msgs)
(message "No corrupted property drawers")
  (switch-to-buffer-other-window " *Org missing :END:")
  (mapcar 'insert msgs

A bit rought at the edges, but perhaps useful.

-- 
 Bastien



[O] org-store-link without having to press Enter?

2014-01-14 Thread Sebastien Vauban
Hello,

I'd like to use org-store-link in a piece of code. However, it currently
requires the user to select some link from a list of store links.

If I always want to select the last one -- that is, the default
option --, how can I bypass the required RET?

I can do this:

  (execute-kbd-macro "\C-c\C-l\C-m")

But I find it fragile because it relies on key bindings which could
change in time.

How could I do otherwise?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Buffer local alias?

2014-01-14 Thread Andreas Leha
t...@tsdye.com (Thomas S. Dye) writes:

> Bastien  writes:
>
>> Nick Dokos  writes:
>>
>>> Use fboundp, instead of boundp: the latter checks the variable binding
>>> slot, whereas the former checks the function binding slot.
>>
>> Also, I thought sbe was unknown enough to rename it directly
>> instead of creating an alias.  If many people are using sbe,
>> maybe an alias is better -- but I'd rather not to add it.
>
> Thanks Nick. This works:
>
>   * Local variables  
> :noexport:
>
>   # Local Variables:
>   # eval: (and (fboundp 'org-sbe) (not (fboundp 'sbe)) (fset 'sbe 'org-sbe))
>   # eval: (sbe "setup-common-lisp")
>   # End:
>
> Bastien, for my use case there is no reason to define an alias.

I am in favor of such an alias.  In that particular case it seems that
it would not hurt much (IMO) and it would increase backward
compatibility.


Let me take the opportunity to sigh a little bit:

I am not as organized as Tom is.  So the chances to use my up-to-date
orgmode and successfully export any of my org documents from a year ago
(they are almost all 'Literate Programming' documents and, thus, maybe
more fragile?) are slim.  I do not have numbers, but it seems like I'll
need to adapt such documents all the time.

I know that this problem is a problem of balancing backward
compatibility with new features, better design, etc and cannot be
solved.  And I see the win in (most of) the breaking changes.

But let me just express my vote for even more awareness of people like
me, who do not read all release notes, forget most of the messages from
the mailing list and as a result need 2 hours to export some document
from last year again today.

A change like this one (renaming sbe to org-sbe) is a small change and
will only be an annoyance in one years time.  The drop of the implicit
naming of call lines, for example, was (and still will be for some of my
files) a bigger issue.


Regards,
Andreas




Re: [O] Change section (headings) numbering style

2014-01-14 Thread Axel E. Retif

On 01/14/2014 06:43 AM, Vladimir Lomov wrote:

[...]


I can suggest CSS way to accomplish this.  [...]


It works! Thank you very much!

I have to export separately the arabic-numbered and alpha-numbered 
parts, but that's all right.



Thanks again!

Axel





Re: [O] Italicise block of text

2014-01-14 Thread Alexander Baier
On 2014-01-14 19:45 Roger Mason wrote:
> Hello,
>
> Is there a way to italicise a block of text rather that just single
> words? (org-mode 8.0.3).
>
> Thanks,
> Roger

Does this work?

/This is a block of text./
/This is a block of text./
/This is a block of text./

HTH,
-- 
 Alexander Baier



Re: [O] org-store-link without having to press Enter?

2014-01-14 Thread Nick Dokos
"Sebastien Vauban" 
writes:

> Hello,
>
> I'd like to use org-store-link in a piece of code. However, it currently
> requires the user to select some link from a list of store links.
>

I think you mean org-insert-link, right?

> If I always want to select the last one -- that is, the default
> option --, how can I bypass the required RET?
>
> I can do this:
>
>   (execute-kbd-macro "\C-c\C-l\C-m")
>
> But I find it fragile because it relies on key bindings which could
> change in time.
>
> How could I do otherwise?
>

I don't know if there is an API, but org-store-link just adds the link
info to the front of the list org-stored-links, so the last link added
is (car org-stored-links).  Each element of org-stored-links is a
two-element list (link description). Both of these are strings (possibly
strings with text properties).

So something like this might work:

(let ((link (car org-stored-links)))
 (insert (format "[[%s][%s]]" (car link) (cadr link

at least for now... It's imo "better" than the keyboard macro but it's
still pretty low level and ugly.

Nick







Re: [O] python :session does return

2014-01-14 Thread John Hendy
On Tue, Jan 14, 2014 at 7:38 AM, Ken Mankoff  wrote:
>
> I've seen various historical issues with :session but it seems I may have a
> different problem. This is the latest org in emacs 24.3. If I do not have
> :session, then everything works just fine.
>

This sounded familiar to me, so I googled around for Org mailing list
discussions I was involved in related to python. Does this shed any
new light?
- https://www.mail-archive.com/emacs-orgmode@gnu.org/msg68542.html

Seems that the discussion ended with the possibility that it was an
emacs change to python.el, and not related to Org, but I'm not sure if
any actions were ever taken regarding that. In any case, the
discussion features a discrepancy between python behavior with
`:session name` and without, so it seemed like a possible candidate to
pass along!



Best regards,
John

> If I C-c C-c in the following code:
>
> #+BEGIN_SRC python :session transect
> import numpy as np
> x = np.arange(12)
> #+END_SRC
>
> Emacs hangs the first time with minibuffer message of "Sent
> python-eldoc-setup-code". If I C-g, I can edit the org buffer again. All
> other invocations of that code and the minibuffer message is "executing
> Python code block...", but still emacs hangs until I C-g.
>
> If I look at the *transect* buffer, I see the following. The code runs just
> fine, but for some reason it does not return.
>
>   -k.
>
>
>
> Enthought Canopy Python 2.7.3 | 64-bit | (default, Dec  2 2013, 16:19:29)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> import numpy as np
> Start .pythonrc
> End .pythonrc

 import numpy as np
>
> x = np.arange(12)
> x = np.arange(12)
>
>
> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022Yjm',
> 'w').write(str(_))
> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022Yjm',
> 'w').write(str(_))
>
>
>
>
> 'org_babel_python_eoe'
> 'org_babel_python_eoe'

 >>> >>> >>> >>> >>> Traceback (most recent call last):
>
>   File "", line 1, in 
> NameError: name '_' is not defined

 >>> >>> 'org_babel_python_eoe'
 import numpy as np
>
> import numpy as np
> x = np.arange(12)

 x = np.arange(12)
>
>

> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022lts',
> 'w').write(str(_))


> open('/var/folders/60/jb7kfrsn2jd90hpcgj4m_wrcgn/T/babel-28022EFF/python-28022lts',
> 'w').write(str(_))
>

>

> 'org_babel_python_eoe'

 'org_babel_python_eoe'
>
> 'org_babel_python_eoe'


>
>
>
>



Re: [O] Angular brackets break LaTex environment in html-export

2014-01-14 Thread Vladimir Lomov
Hello,
** Axel [2014-01-14 20:00:58 +0100]:

> Hi,

> When I use angular brackets in a LaTeX environment, sometimes they break the
> mathjax-rendering when exported to html/Rhtml (See example below). Export
> into LaTeX-pdf works fine in all cases, but export into html fails without
> whitespaces. Is this due to interference with the timestamps in org-mode?

> --8<---cut here---start->8---

> * heading

> \(  \sim t \)

> \( < R^2 > \sim t \)

> \[ \left \sim t \]

> \[ \left< R^2 \right> \sim t \]

> -8<---cut here---end->8---

Did you try to use \langle and \rangle instead of < and >? IMO, use of
< and > only "possible" in relations.

> Cheers
> Axel

---
WBR, Vladimir Lomov

-- 
The major sin is the sin of being born.
-- Samuel Beckett



Re: [O] Buffer local alias?

2014-01-14 Thread Thomas S. Dye
Aloha Andreas,

Andreas Leha  writes:

> I am not as organized as Tom is.  So the chances to use my up-to-date
> orgmode and successfully export any of my org documents from a year ago
> (they are almost all 'Literate Programming' documents and, thus, maybe
> more fragile?) are slim.  I do not have numbers, but it seems like I'll
> need to adapt such documents all the time.
>
> I know that this problem is a problem of balancing backward
> compatibility with new features, better design, etc and cannot be
> solved.  And I see the win in (most of) the breaking changes.
>
> But let me just express my vote for even more awareness of people like
> me, who do not read all release notes, forget most of the messages from
> the mailing list and as a result need 2 hours to export some document
> from last year again today.
>
> A change like this one (renaming sbe to org-sbe) is a small change and
> will only be an annoyance in one years time.  The drop of the implicit
> naming of call lines, for example, was (and still will be for some of my
> files) a bigger issue.

I fully agree that it is challenging to prepare an Org mode file that
can be "moth-balled" for a while, then resuscitated to full
functionality without a lot of work.

Perhaps one way to deal with this is to have the Org mode literate
programming (reproducible research) file choose which version of
Org-mode to use.  Something like the following?

  #+name: org-mode-version
  #+begin_src sh
  cd path/to/org-mode-git-repo
  git checkout rev
  #+end_src

  # Local Variables:
  # eval: (and (fboundp 'org-sbe) (not (fboundp 'sbe)) (fset 'sbe 'org-sbe))
  # eval: (sbe "org-mode-version")
  # eval: (org-reload t)
  # End:

I haven't the faintest idea if this is a "good idea" or a snake pit of
potential problems. Is the idea worth experimenting with?

Pleased to appear well-organized,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



[O] [PATCH] Fix org-outline-overlay-data marker insertion-type

2014-01-14 Thread Sylvain Chouleur
Hi all,

here is a patch that fixes outline visibility saving.

The root issue I've found is that when you call org-babel-execute-subtree
on a folded outline, the result is shown visible so the visibility property
is not well kept.

The root cause is the markers used by org-outline-overlay-data to bound the
invisible area.
When org-babel-insert-result is called by org-babel-execute-subtree, text
is added from the position of marker that mark the end of invisible area.
As the insertion-type of the marker is by default nil, the marker stays
where it is but text is inserted after, so the inserted text becomes
visible.

I'm not sure about the fix, I'm fearing some side effect I can't see in my
usage so it's open to any comments

Thanks

-- 
Sylvain
From a4bb85d9577e0454e01abe596f92b152007c0d9f Mon Sep 17 00:00:00 2001
From: Sylvain Chouleur 
Date: Wed, 15 Jan 2014 00:38:55 +0100
Subject: [PATCH] Fix org-outline-overlay-data marker insertion-type

* org.el: Set the insertion-type of bounds markers of
org-outline-overlay-data to t (means marker advances when you insert
text at it)

This is to conserve outline visibility property when changes are made
at the bounds of the data.
For example: try org-babel-execute-subtree on a folded outline:
The new result will be shown after the folded part of the outline
whereas the outline body should not be visible.
---
 lisp/org.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a53597e477e2..fc0f0ccb7125 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7191,8 +7191,12 @@ If USE-MARKERS is set, return the positions as markers."
 end (overlay-end o))
 			  (and beg end (> end beg)
 			   (if use-markers
-   (cons (move-marker (make-marker) beg)
-	 (move-marker (make-marker) end))
+   (let ((bound
+	  (cons (move-marker (make-marker) beg)
+		(move-marker (make-marker) end
+ (set-marker-insertion-type (car bound) t)
+ (set-marker-insertion-type (cdr bound) t)
+ bound)
  (cons beg end)
 		  (overlays-in (point-min) (point-max
 
-- 
1.8.5.2



[O] using lightbox plugins in HTML export

2014-01-14 Thread Peter Salazar
Does anyone know of a lightbox-style plug-in that will work with org-mode
HTML export that will automatically, on click, expand images to fill the
screen,  i.e. one doesn't require me to manually add an "href" and
"rel=lightbox" manually to each image?

(Most lightbox-style plugins require you to not just include IMG tags, but
to wrap them in something like )

Alternatively, is there a way to direct org to automatically add href and
rel="lightbox" to all images on HTML export in a way that won't break LaTeX
export?

Thanks!


Re: [O] Adding a new column in the agenda view

2014-01-14 Thread Marcelo de Moraes Serpa
Thanks Bastien!

Is org-agenda-filter-by-top-headline a new func? I can't find it in org
7.9.4.

Thanks,


On Tue, Jan 14, 2014 at 9:26 AM, Bastien  wrote:

> Hi Marcelo,
>
> Marcelo de Moraes Serpa  writes:
>
> > I'd like to add a new column to display some information about the
> > scheduled item in the agenda. Take the following screenshot: https://
> > www.dropbox.com/s/gkcnbjrivhvql46/orgmode.jpg
> >
> > I'd like to add a colum there that shows the closest parent with the
> > :project: tag. Does org provide any APIs for that?
>
> Nope -- check the org column tutorial to see the possibilities:
>   http://orgmode.org/worg/org-tutorials/org-column-view-tutorial.html
>
> Also check org-agenda-filter-by-top-headline (which is ^ in agenda
> mode): I think it can help you *not* implementing this view...
>
> --
>  Bastien
>


[O] Automatically add a repeater when scheduling

2014-01-14 Thread Marcelo de Moraes Serpa
Hey list,

Does org allow automatically adding a repeater (say, +1d) to a schedule
when adding it with C-c C-s?

If not, I think it wouldn't be so hard to monkeypatch the method to do so,
would it?

Thanks,

--
Marcelo.


[O] Add "legacy" time tracking as CLOCK entries

2014-01-14 Thread Richard Walker
Hi, while I've been using org-mode for some time, I'm now working
on a project where I've decided to use the time-tracking functions.
But I've got some "legacy" time on the project that I would like
to incorporate. I.e., I have in my (paper) log book a record of
(say) half an hour spent on a certain day, but I don't have a record
of the start and end time and I don't want to invent them.

I note that I can add an entry that looks like this:

CLOCK: => 0:30

and have this contribute to totals. But I would
also like to record the date for this entry.

Checking the regular expression in org-clock-sum
and a bit of trial and error showed that
this _doesn't_ work:

CLOCK: [2013-12-11 Wed] => 0:30

and nor does:

CLOCK: [2013-12-11 Wed]--[2013-12-11 Wed] => 0:30

But this does seem to work:

CLOCK: => 0:30 [2013-12-11 Wed]

I've figured this out myself on the basis of not finding anything
about it in the manual. Nevertheless, is there a "standard"
way of doing this that I missed?