Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Nicolas Goaziou
Hello,

"Thomas S. Dye"  writes:

> I'm happy if someone moves it to contrib/.

Done.

> Is there anything for me to do before/after that happens?

Not really. Of course, feel free to help keeping (making) it up-to-date
if your spare time allows it.

Once the manual is up-to-date, we might consider moving it to doc/ in
main distribution.


Regards,

-- 
Nicolas Goaziou



Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Eric Abrahamsen
"Thomas S. Dye"  writes:

> Aloha Eric,
>
> Eric Abrahamsen writes:
>
>> "Thomas S. Dye"  writes:
>>
>>> Rasmus writes:
>>>
 Once upon a time Tom ported the Org manual.  It's on his github, probably
 under tsdye.
>>>
>>> https://github.com/tsdye/orgmanual
>>
>> Hey, that's perfect! Dunno if that's what I was remembering, but that's
>> exactly what I was after. Even better if it ends up in contrib/
>>
>> Off to copy and paste now...
>
> I hope you find it useful.  Still, I'd be interested to see Oleh
> Krehel's approach.  It is bound to be more sophisticated than mine.

Well, we can cobble something together :) Mostly I was interested in the
index macros -- Info manuals are far more useful with indexes, and to be
honest I was doing anything to avoid learning how to write texinfo.

What might be nice to have in contrib is an exporter derived from the
current texinfo exporter, but specifically set up for Gnu project
manuals: so it does the copyright header, and index macros, and maybe
even the proper DIR integration (?).

I remember where I originally saw this: it was a long thread on
emacs.devel about moving documentation to HTML, which struck me as a
terrible idea. I think Org was raised as a way of lowering the barrier
to writing texinfo manuals for packages, so that we get the best of both
worlds: write in Org, read in Info. I think it would be a great idea to
facilitate that, if possible.

E




[O] Starting source code export at non-zero (-n value)

2016-05-16 Thread Brian Carlson
Hello other org mode aficionados! (I apologize for the errant email I 
send a minute ago. )


I have created a (possible) patch to the export (ox.el and other 
ox-XXX.el) files that allow for "source code" and "example" blocks to 
have line numbers starting at an arbitrary number. Before the 
(wonderful) ox redesign I used to have advice around some functions. I 
hadn't needed this functionality for a while, but now that I did I 
thought I would share.



The code is written with the following design:

-n   is the same as -n 1 : The functionality is unchanged
+n   is the same as +n 1 :  The functionality is unchanged

-n X   will "reset" and start new code block starting at line X
+n X   will "add" X to the last line of the block before.



example:
* Heading 1

  * ~-n 10~
#+BEGIN_SRC emacs-lisp -n 10
  (save-excursion ;; This is line 10
 (goto-char (point-min))) ;; 11
#+END_SRC
  * ~-n~
#+BEGIN_SRC emacs-lisp -n
  (save-excursion   ;; line 1
 (goto-char (point-min))) ;; line 2
#+END_SRC
  * ~+n 155~
#+BEGIN_SRC emacs-lisp +n 155
  (save-excursion;; line 157
 (goto-char (point-min))) ;; line 158
#+END_SRC

Gives the following "Text - ascii output"


1 Heading 1
===

  * `-n 10'
,
| 10  (save-excursion ;; This is line 10
| 11 (goto-char (point-min))) ;; 11
`
  * `-n'
,
| 1  (save-excursion   ;; line 1
| 2 (goto-char (point-min))) ;; line 2
`
  * `+n 155'
,
| 157  (save-excursion;; line 157
| 158 (goto-char (point-min))) ;; line 158
`


I have tested the code (using make test) and generated (hand verified) 
the LaTeX and HTML output. ODT has an issue already with +n in that each 
code block starts at line 1. (I did not address that).



I have included the git format patch output.

This is a fairly small set of changes, but I do assign the Copyright to 
the Free Software Foundation.



Thanks,
;-b
>From 6b4db0a978cc3492f0d0ac7e29008de6846fbe4a Mon Sep 17 00:00:00 2001
From: Brian Carlson 
Date: Mon, 16 May 2016 10:58:01 -0400
Subject: [PATCH] ox: provide [+-]n  functionality

---
 contrib/lisp/ox-groff.el |  4 ++--
 lisp/org-element.el  | 16 +++-
 lisp/ox-html.el  |  4 ++--
 lisp/ox-latex.el |  4 ++--
 lisp/ox-odt.el   |  4 ++--
 lisp/ox.el   | 16 ++--
 6 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/contrib/lisp/ox-groff.el b/contrib/lisp/ox-groff.el
index b49edce..517da9a 100644
--- a/contrib/lisp/ox-groff.el
+++ b/contrib/lisp/ox-groff.el
@@ -1488,9 +1488,9 @@ contextual information."
  (custom-env (and lang
   (cadr (assq (intern lang)
   org-groff-custom-lang-environments
- (num-start (case (org-element-property :number-lines src-block)
+ (num-start (case (car (org-element-property :number-lines src-block))
   (continued (org-export-get-loc src-block info))
-  (new 0)))
+  (new (or (cdr (org-element-property :number-lines src-block)) 0
  (retain-labels (org-element-property :retain-labels src-block))
  (caption (and (not (org-export-read-attribute
 			 :attr_groff src-block :disable-caption))
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 368da60..65f9833 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -1896,8 +1896,11 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent',
 		 ;; Switches analysis
 		 (number-lines
 		  (cond ((not switches) nil)
-			((string-match "-n\\>" switches) 'new)
-			((string-match "+n\\>" switches) 'continued)))
+			((string-match "-n *\\([0-9]+\\)" switches) (cons 'new (- (string-to-number (match-string 1 switches)) 1 )))
+			((string-match "+n *\\([0-9]+\\)" switches) (cons 'continued (- (string-to-number (match-string 1 switches)) 1 )))
+			((string-match "-n" switches) (cons 'new 0))
+			((string-match "+n" switches) (cons 'continued 0))
+			))
 		 (preserve-indent
 		  (and switches (string-match "-i\\>" switches)))
 		 ;; Should labels be retained in (or stripped from) example
@@ -2393,7 +2396,7 @@ Assume point is at the beginning of the block."
 		(looking-at
 		 (concat "^[ \t]*#\\+BEGIN_SRC"
 			 "\\(?: +\\(\\S-+\\)\\)?"
-			 "\\(\\(?: +\\(?:-l \".*?\"\\|[-+][A-Za-z]\\)\\)+\\)?"
+			 "\\(\\(?: +\\(?:-l \".+\"\\|[+-]n *[[:digit:]]+\\|[+-][[:alpha:]]\\)\\)+\\)?"
 			 "\\(.*\\)[ \t]*$"))
 		(org-match-string-no-properties 1)))
 		 ;; Get switches.
@@ -2403,8 +2406,11 @@ Assume point is at the beginning of the block."
 		 ;; Switches analysis
 		 (number-lines
 		  (cond ((not switches) nil)
-			((string-match "-n\\>" switches) 'new)
-			((string-match "+n\\>" switches) 'continued)))
+			((string-match "-n 

Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Thomas S. Dye
Aloha Eric,

Eric Abrahamsen writes:

> "Thomas S. Dye"  writes:
>
>> Rasmus writes:
>>
>>> Once upon a time Tom ported the Org manual.  It's on his github, probably
>>> under tsdye.
>>
>> https://github.com/tsdye/orgmanual
>
> Hey, that's perfect! Dunno if that's what I was remembering, but that's
> exactly what I was after. Even better if it ends up in contrib/
>
> Off to copy and paste now...

I hope you find it useful.  Still, I'd be interested to see Oleh
Krehel's approach.  It is bound to be more sophisticated than mine.

All the best,
Tom

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



Re: [O] Agenda filter by any tag seems to be broken

2016-05-16 Thread Eric Abrahamsen
Kaushal Modi  writes:

> On Mon, May 16, 2016 at 1:50 PM Eric Abrahamsen
>  wrote:
>
> Is anyone else seeing this?
>
> Go into a tags-type agenda, hit "/" to start filtering, then SPC
> for
> "filter to any tag". That gives me this backtrace:
>
> Can you add more detail on how to recreate the problem you are seeing
> in an emacs -Q session.
>
> I do not use tag filtering heavily, so "tags-type agenda" is not clear
> to me.
>
> I tried M-x org-agenda, followed by m, followed by / and then SPC. But
> I do not see that error.
> -- 

Also, if you're willing to spend a moment on this, would you start the
agenda with the "t" key, then edebug the function
`org-agenda-filter-make-matcher-tag-exp', then do the "/ SPC" thing, and
tell me what arguments the function receives?

Thank you!
Eric




Re: [O] (v6) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-16 Thread tumashu
If we need 4 cmmand to convert test.dvi to test.png
1. cmd1 test.dvi  test.a
2. cmd2 test.a test.b
3. cmd4 test.b test.png

does it work correctly?  can %b.a convert to  text.a ? 
("cmd1 %b.dvi %b.a"
 "cmd2 %b.a %b.b"
"cmd3  %b.b %b.png")

if it works properly,  i suggest  merge org-compile-file feature first, i will 
rebase my patch to it before merge.






Re: [O] Agenda filter by any tag seems to be broken

2016-05-16 Thread Eric Abrahamsen
Kaushal Modi  writes:

> On Mon, May 16, 2016 at 1:50 PM Eric Abrahamsen
>  wrote:
>
> Is anyone else seeing this?
>
> Go into a tags-type agenda, hit "/" to start filtering, then SPC
> for
> "filter to any tag". That gives me this backtrace:
>
> Can you add more detail on how to recreate the problem you are seeing
> in an emacs -Q session.
>
> I do not use tag filtering heavily, so "tags-type agenda" is not clear
> to me.
>
> I tried M-x org-agenda, followed by m, followed by / and then SPC. But
> I do not see that error.
> -- 

Starting with emacs -Q, then adding the org-plus-contrib directory to
load-path:

M-x org-agenda
t ;; all todos, an empty list of course
/
SPC

And I get the error.

I have a mostly-baseless hunch that the reason I seem to get more
mysterious errors than other people is that I'm running emacs master
from git, and emacs master forces more lexical scoping stuff than
previous versions. I'm mostly pulling that out of nowhere, but there
must be other people on the list who are running emacs git, and I'd be
curious to know if they see the same error...

Thanks!
Eric




Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Eric Abrahamsen
"Thomas S. Dye"  writes:

> Rasmus writes:
>
>> Once upon a time Tom ported the Org manual.  It's on his github, probably
>> under tsdye.
>
> https://github.com/tsdye/orgmanual

Hey, that's perfect! Dunno if that's what I was remembering, but that's
exactly what I was after. Even better if it ends up in contrib/

Off to copy and paste now...

E




Re: [O] (v6) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-16 Thread tumashu

i see your mean, i think org-compile-file can do more thing, for example: 
handle dvipng or dvisvgm, 

what i need to know is the different of call-process and run shell command.  
can we use run shell command instead of call-process in converting dvi to png?

special string need to do more work, i think.






--
发自我的网易邮箱手机智能版


在 2016-05-17 05:17:45,"Nicolas Goaziou"  写道:
>Hello,
>
>"Feng Shu"  writes:
>
>> This is my modified patch (v6), fix the problems you stated. please review
>> again, thank!
>
>Thank you. Comments follow.
>
>> From 29760e5c5876fb6b772f7a6004b7160bc06efba8 Mon Sep 17 00:00:00 2001
>> From: Feng Shu 
>> Date: Sat, 14 May 2016 22:42:53 +0800
>> Subject: [PATCH] New feature: Use dvisvgm to preview latex formular
>>
>> * ox-latex.el (org-latex-pdf-process): org-latex-pdf-process can be a
>>   configure generator (a plist with :generator keyword).
>> (org-latex-preview-process): new variable, which is used to process
>>  latex snippet.
>> (org-latex-compile): Add a new optional argument: extra-info.
>
>As discussed in another message, I don't think we should mess with
>`org-latex-compile'. Instead, we could factor out the needed part in
>`org-latex-compile' and make it a generic function. Then we can
>introduce a new function to specifically handle previewing related
>compilation.
>
>Note that I'm not asking you to implement the factoring out part in your
>patch, but to tell me if the following would fulfill your needs for
>`org-create-formula-image'. I'm sending its docstring again.
>
>  (defun org-compile-file (source process extension  spec log-buffer)
>"Compile a SOURCE file using PROCESS.
>
>  PROCESS is either a function or a list of shell commands, as
>  strings.
>
>  If PROCESS is a function, it is called with a single argument:
>  SOURCE file.  It must create a file with the same base name and
>  directory as SOURCE, but using extension.
>
>  If it is a list of commands, each of them is called using
>  `shell-command'.  By default, in each command, %b, %f and %o are
>  replaced, respectively, with SOURCE base name, SOURCE full name
>  and SOURCE directory.  It is possible, however, to use different
>  place-holders by specifying them in optional argument SPEC.  In
>  this case, SPEC should be an alist (STRING REPLACEMENT-STRING).
>
>  When PROCESS is a list of commands, optional argument LOG-BUFFER
>  can be set to a buffer or a buffer name.  `shell-command' then
>  uses it as an output buffer, which may be used for collecting
>  errors.
>
>  `default-directory' is set to SOURCE directory during the whole
>  process.
>
>  Generated file is expected to use the same directory and base
>  name as SOURCE, and end with EXTENSION.  Return its filename or
>  raise an error if it wasn't generated upon executing PROCESS."
>...)
>
>
>> +If you have a working @LaTeX{} installation and @file{dvipng}, 
>> @file{dvisvgm}
>> +or @file{convert} installed@footnote{These are respectively available at
>> +@url{http://sourceforge.net/projects/dvipng/}, 
>> @url{http://dvisvgm.bplaced.net/}
>> +and from the @file{imagemagick} suite. Choose the converter by setting the 
>> variable
>
>You need to use two spaces to separate sentences.
>
>>  +(defcustom org-latex-to-image-backends
>
>You could remove it `org-preview-latex-backends' since it doesn't belong
>to the "org-latex" namespace.
>
>> +dvisvgm Process the LaTeX fragments to dvi/xdv file, then convert
>> +dvi/xdv files to svg files using dvipng.
>
>You probably mean "using dvisvgm".
>
>> +Org mode can use some external commands to generate TeX snippet's image for
>> +previewing or inserting into HTML files, e.g. dvipng, dvisvgm or imagemagick
>> +this variable tells `org-create-formula-image' how to use external commands.
>
>or imagemagick.  This variable tells...
>
>> +  :class  symbol, this setting may be useful in future.
>
>Meanwhile, I suggest to remove it, unless you have a clear plan in mind.
>
>> +  :name   string, the backend's name.
>> +  :programs   list of strings, required programs.
>> +  :messagestring, message it when required program can't be 
>> found.
>
>required programs
>
>> +  :color  symbol, if set to `latex', LaTeX \"xcolor\" macro is 
>> used
>> +  to deal with background and foreground color of image,
>> +  if set to `divpng', dvipng style background and 
>> foregroud color
>> +  format will be generated, you should use them in 
>> command options
>> +  with special string: \"%fg\"% and \"%bg%\".
>
>are generated; you should used them in ... with special strings: ...
>
>> +  :size-adjustcons of numbers, the car element is used to adjust 
>> latex image
>> +  size showed in buffer and the cdr element is for html 
>> file.
>> +

Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Thomas S. Dye
Aloha Nicolas,

Nicolas Goaziou writes:

> Hello,
>
> "Thomas S. Dye"  writes:
>
>> Rasmus writes:
>>
>>> Once upon a time Tom ported the Org manual.  It's on his github, probably
>>> under tsdye.
>>
>> https://github.com/tsdye/orgmanual
>
> What about moving it to "contrib/"? It could help keeping it up-to-date.

I'm happy if someone moves it to contrib/.  Is there anything for me to
do before/after that happens?

All the best,
Tom

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



Re: [O] (v6) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-16 Thread Nicolas Goaziou
Hello,

"Feng Shu"  writes:

> This is my modified patch (v6), fix the problems you stated. please review
> again, thank!

Thank you. Comments follow.

> From 29760e5c5876fb6b772f7a6004b7160bc06efba8 Mon Sep 17 00:00:00 2001
> From: Feng Shu 
> Date: Sat, 14 May 2016 22:42:53 +0800
> Subject: [PATCH] New feature: Use dvisvgm to preview latex formular
>
> * ox-latex.el (org-latex-pdf-process): org-latex-pdf-process can be a
>   configure generator (a plist with :generator keyword).
> (org-latex-preview-process): new variable, which is used to process
>  latex snippet.
> (org-latex-compile): Add a new optional argument: extra-info.

As discussed in another message, I don't think we should mess with
`org-latex-compile'. Instead, we could factor out the needed part in
`org-latex-compile' and make it a generic function. Then we can
introduce a new function to specifically handle previewing related
compilation.

Note that I'm not asking you to implement the factoring out part in your
patch, but to tell me if the following would fulfill your needs for
`org-create-formula-image'. I'm sending its docstring again.

  (defun org-compile-file (source process extension  spec log-buffer)
"Compile a SOURCE file using PROCESS.

  PROCESS is either a function or a list of shell commands, as
  strings.

  If PROCESS is a function, it is called with a single argument:
  SOURCE file.  It must create a file with the same base name and
  directory as SOURCE, but using extension.

  If it is a list of commands, each of them is called using
  `shell-command'.  By default, in each command, %b, %f and %o are
  replaced, respectively, with SOURCE base name, SOURCE full name
  and SOURCE directory.  It is possible, however, to use different
  place-holders by specifying them in optional argument SPEC.  In
  this case, SPEC should be an alist (STRING REPLACEMENT-STRING).

  When PROCESS is a list of commands, optional argument LOG-BUFFER
  can be set to a buffer or a buffer name.  `shell-command' then
  uses it as an output buffer, which may be used for collecting
  errors.

  `default-directory' is set to SOURCE directory during the whole
  process.

  Generated file is expected to use the same directory and base
  name as SOURCE, and end with EXTENSION.  Return its filename or
  raise an error if it wasn't generated upon executing PROCESS."
...)


> +If you have a working @LaTeX{} installation and @file{dvipng}, @file{dvisvgm}
> +or @file{convert} installed@footnote{These are respectively available at
> +@url{http://sourceforge.net/projects/dvipng/}, 
> @url{http://dvisvgm.bplaced.net/}
> +and from the @file{imagemagick} suite. Choose the converter by setting the 
> variable

You need to use two spaces to separate sentences.

>  +(defcustom org-latex-to-image-backends

You could remove it `org-preview-latex-backends' since it doesn't belong
to the "org-latex" namespace.

> +dvisvgm Process the LaTeX fragments to dvi/xdv file, then convert
> +dvi/xdv files to svg files using dvipng.

You probably mean "using dvisvgm".

> +Org mode can use some external commands to generate TeX snippet's image for
> +previewing or inserting into HTML files, e.g. dvipng, dvisvgm or imagemagick
> +this variable tells `org-create-formula-image' how to use external commands.

or imagemagick.  This variable tells...

> +  :class  symbol, this setting may be useful in future.

Meanwhile, I suggest to remove it, unless you have a clear plan in mind.

> +  :name   string, the backend's name.
> +  :programs   list of strings, required programs.
> +  :messagestring, message it when required program can't be 
> found.

required programs

> +  :color  symbol, if set to `latex', LaTeX \"xcolor\" macro is 
> used
> +  to deal with background and foreground color of image,
> +  if set to `divpng', dvipng style background and 
> foregroud color
> +  format will be generated, you should use them in 
> command options
> +  with special string: \"%fg\"% and \"%bg%\".

are generated; you should used them in ... with special strings: ...

> +  :size-adjustcons of numbers, the car element is used to adjust 
> latex image
> +  size showed in buffer and the cdr element is for html 
> file.
> +  this option is only useful for backend developers, user
> +  should use variable `org-format-latex-options' instead.

This option... users...

> +  :org-latex-compile  boolean, when non-nil, `org-create-formula-image' uses
> +  `org-latex-compile' to compile tex file, otherwise, 
> you need
> +  to set latex command in `:commands' option.
> +  :need-clean list of strings, files matched are to be cleaned up 
> once the
> +

Re: [O] Title/Author missing in Markdown export?

2016-05-16 Thread Doherty, Daniel
Thanks for pointing out that my manual was out of date.  Looks to me like I
needed to delete the stock org manual before the package-based one would
show up in info.




Daniel E. Doherty
Law Offices of Daniel E. Doherty
7300 W. 110th Street, Suite 930
Overland Park, KS 66210
913.338.7182 (Phone)
913.338.7164 (FAX)
ded-...@ddoherty.net


On Sat, May 7, 2016 at 7:12 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> "Daniel E. Doherty"  writes:
>
> > On Tue, 28 Apr 2015 09:08:45 -0500,
> > Rasmus  wrote:
> >>
> >> Andreas Hilboll  writes:
> >>
> >> > Using the current git master, any exported Markdown doesn't include
> >> > title, author, and date information.  Is this desired behaviour, or is
> >> > it a bug?
> >>
> >> AFAIK it's a "feature".
> >>
> >> --
> >> ⠠⠵
> >>
> >>
> > Rasmus,
> >
> > Not sure whether you were being ironic on this,
>
> Rasmus is correct. Vanilla Mardown doesn't provide any way to specify
> a title or an author in a document.
>
> Of course, if there's some standard way to do this, we can extend
> "ox-md.el" accordingly. The same goes for table of contents, generated
> as HTML for the time being.
>
> > but I've noticed that exports in LaTeX, odt, and HTML, not longer seem
> > to pick up the buffer name as the title as formerly and as the manual
> > claims.
> >
> > `TITLE'
> >  The title to be shown (otherwise derived from buffer's name).  You
> >  can use several such keywords for long titles.
> >
> > Same is true of author:
> >
> > `AUTHOR'
> >  The document author (`user-full-name').
> >
> > I rather liked having this be the default with the option to change it.
> So,
> > is this the intended behavior, or is the manual wrong?
>
> You are looking at an outdated manual. This change was introduced
> 2 years ago (commit 604b93892caa8a646ced1ac7089461614bb9bffa). You may
> want to search ML archives for the discussion about it.
>
> You can probably use something like
>
>  #+TITLE: {{{input-file}}}
>
> to get the old behaviour back.
>
> Regards,
>
> --
> Nicolas Goaziou
>
>


Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Nicolas Goaziou
Hello,

"Thomas S. Dye"  writes:

> Rasmus writes:
>
>> Once upon a time Tom ported the Org manual.  It's on his github, probably
>> under tsdye.
>
> https://github.com/tsdye/orgmanual

What about moving it to "contrib/"? It could help keeping it up-to-date.

Regards,

-- 
Nicolas Goaziou



Re: [O] Tags management strategies

2016-05-16 Thread Samuel Wales
i skip tags almost entirely in favor of regular expression search.  :)

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  And
ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] Agenda filter by any tag seems to be broken

2016-05-16 Thread Kaushal Modi
On Mon, May 16, 2016 at 1:50 PM Eric Abrahamsen 
wrote:

> Is anyone else seeing this?
>
> Go into a tags-type agenda, hit "/" to start filtering, then SPC for
> "filter to any tag". That gives me this backtrace:
>

Can you add more detail on how to recreate the problem you are seeing in an
emacs -Q session.

I do not use tag filtering heavily, so "tags-type agenda" is not clear to
me.

I tried M-x org-agenda, followed by m, followed by / and then SPC. But I do
not see that error.
-- 

-- 
Kaushal Modi


Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Thomas S. Dye

Rasmus writes:

> Once upon a time Tom ported the Org manual.  It's on his github, probably
> under tsdye.

https://github.com/tsdye/orgmanual
-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Repeated tasks

2016-05-16 Thread N. Raghavendra
At 2016-05-13T22:07:58+02:00, Leandro Noferini wrote:

> "N. Raghavendra"  writes:
>
>> Is there a way to specify the timestamp for a repeated task which has
>> to be done on the second Sunday of every month?  I'd like the todo
>> state of the task to go back to TODO after it has been marked DONE, as
>> described in the section on repeated tasks in the Org manual.
>
> You can use sexp expressions: look at the chapter 8.3 of the manual, 8.3
> Deadlines and scheduling
>
> For example I use this expression for the first sunday of every month:
>
> <%%(diary-float t 0 1)>

Thanks for the reply.  Yes, I know this diary-sexp, but the trouble with
it is that after I change the state of such a task to DONE, it remains
DONE.  What I want is that when I change the state to DONE, the task
must be rescheduled for the second Sunday of the next month, and the
state reverted to TODO.  This will be like the repeated task
functionality described in the manual.

Cheers,
Raghu.

-- 
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/



[O] Repeated tasks

2016-05-16 Thread N. Raghavendra
Is there a way to specify the timestamp for a repeated task which has to
be done on the second Sunday of every month, after a certain date, say
25 May 2016?  I'd like the todo state of the task to go back to TODO
after it has been marked DONE, as described in the section on repeated
tasks in the Org manual.

Thanks,
Raghu.

-- 
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/




[O] Repeated tasks

2016-05-16 Thread N. Raghavendra
Is there a way to specify the timestamp for a repeated task which has to
be done on the second Sunday of every month?  I'd like the todo state of
the task to go back to TODO after it has been marked DONE, as described
in the section on repeated tasks in the Org manual.

Thanks,
Raghu.

-- 
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/




[O] problem with load-after-eval

2016-05-16 Thread Stefan Huchler

I did try to change following code in in the org.el file,
inside the org-cycle-internal-local function.
So that instead of having 3 tab expansions it only shows the next level
of expansion.
I am not 100% shure thats the perfect solution but it seemed to work:

;; THAT IS THE ORIGINAL CODE OF THE TWO LINES I CHANGED:
;; (unless (org-before-first-heading-p)
;;   (run-hook-with-args 'org-pre-cycle-hook 'subtree))
(unless (org-before-first-heading-p)
  (run-hook-with-args 'org-pre-cycle-hook 'folded))


the problem is, I wanted not to modify the systemwide org.el file, so I
thought, either redefine the whole modified function with defun, or add a
eval-after-load call around it, so that it gets overridden when org gets
loaded.

But both does not work, defining it straight had no effect I think, and the
eval-after-load raised an error when I tried to use this function in a
org-file (with tab).

It didnt find the outline-show-children function that gets called in
that function. It gets defined in org-compat, requiring that before that
block did not fix it, too.

I looked at devadvise, if thats maybe the solution but its a very
complex construct and the docu is very bad no easy examples.

But in general it should work with one of the two other solutions I
tried.

But somehow it seems to be not in the same scope as the original
function.

hope somebody can say me what I am doing wrong. Must be something pretty
simple, but I dont find the solution.




Re: [O] [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-16 Thread Feng Shu
"Feng Shu"  writes:

I will refactor the latex previewing code, this patch should be delay
reviewd.

> "Feng Shu"  writes:
>
> This is version 2, make diff more easy read.
>
> From 66804cf5642256a38beb0b84ad8194562f34bfce Mon Sep 17 00:00:00 2001
> From: Feng Shu 
> Date: Sat, 14 May 2016 22:42:53 +0800
> Subject: [PATCH] New feature: Use dvisvgm to preview latex formular
>
> Tester should set like below:
>
> (setq org-latex-create-formula-image-program 'dvisvgm)
> (setq org-latex-pdf-process
>   '(:fetcher my-org-latex-pdf-process-format))
> (defun my-org-latex-pdf-process-format ( texfile snippet 
> caller-info)
>   (cond
>(snippet '("latex -interaction nonstopmode -output-directory %o %f"))
>(t '("%latex -interaction nonstopmode -output-directory %o %f"
> "%latex -interaction nonstopmode -output-directory %o %f"
> "%latex -interaction nonstopmode -output-directory %o %f"
>
> * ox-latex.el (org-latex-pdf-process): Add a new config method, :fetcher.
> (org-latex-compile): Add a new optional argument: caller-info,
>  which used to record the caller's info
>
> * ox-html.el (org-html-with-latex): Add dvisvgm support.
> (org-html-with-latex): Add dvisvgm support.
> (org-html-format-latex): "ltxpng" -> "ltximg".
> (org-html-latex-environment): Add dvisvgm support.
> (org-html-latex-fragment): Add dvisvgm support.
>
> * org.el (org-latex-create-formula-image-program): Add dvisvgm.
> (org-latex-preview-ltximg-directory): Rename from 
> `org-latex-preview-ltximg-directory'.
> (org--format-latex-make-overlay): Add optional image-type, which used to deal 
> with svg.
> (org-toggle-latex-fragment): "org-ltxpng" -> "org-ltximg".
> (org-format-latex): Add dvisvgm support.
> (org-create-formula-image): Add dvisvgm case.
> (org-create-formula-image-with-dvisvgm): New function, deal with latex 
> formula with dvisvgm command.
>
> * org.texi (@LaTeX{} fragments): Add dvisvgm information.
> (Previewing @LaTeX{} fragments): Add dvisvgm information.
> (Math formatting in HTML export): Add dvisvgm information.
> (Working with @LaTeX{} math snippets): Add dvisvgm information.
> ---
>  doc/org.texi |  39 +-
>  lisp/org.el  | 101 --
>  lisp/ox-html.el  |  19 ---
>  lisp/ox-latex.el | 161 
> +++
>  4 files changed, 225 insertions(+), 95 deletions(-)
>
> diff --git a/doc/org.texi b/doc/org.texi
> index 17b01c2..286fabb 100644
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -10393,10 +10393,10 @@ snippets will be identified as @LaTeX{} source code:
>  @item
>  Environments of any kind@footnote{When MathJax is used, only the
>  environments recognized by MathJax will be processed.  When
> -@file{dvipng} program or @file{imagemagick} suite is used to create images,
> -any @LaTeX{} environment will be handled.}.  The only requirement is that the
> -@code{\begin} statement appears on a new line, at the beginning of the line
> -or after whitespaces only.
> +@file{dvipng} program, @file{dvisvgm} program or @file{imagemagick} suite is
> +used to create images, any @LaTeX{} environment will be handled.}.  The only
> +requirement is that the @code{\begin} statement appears on a new line, at the
> +beginning of the line or after whitespaces only.
>  @item
>  Text within the usual @LaTeX{} math delimiters.  To avoid conflicts with
>  currency specifications, single @samp{$} characters are only recognized as
> @@ -10444,10 +10444,10 @@ lines:
>  @cindex @LaTeX{} fragments, preview
>  
>  @vindex org-latex-create-formula-image-program
> -If you have a working @LaTeX{} installation and either @file{dvipng} or
> -@file{convert} installed@footnote{These are respectively available at
> -@url{http://sourceforge.net/projects/dvipng/} and from the @file{imagemagick}
> -suite. Choose the converter by setting the variable
> +If you have a working @LaTeX{} installation and @file{dvipng}, @file{dvisvgm}
> +or @file{convert} installed@footnote{These are respectively available at
> +@url{http://sourceforge.net/projects/dvipng/}, 
> @url{http://dvisvgm.bplaced.net/}
> +and from the @file{imagemagick} suite. Choose the converter by setting the 
> variable
>  @code{org-latex-create-formula-image-program} accordingly.}, @LaTeX{}
>  fragments can be processed to produce images of the typeset expressions to be
>  used for inclusion while exporting to HTML (see @pxref{@LaTeX{} fragments}),
> @@ -11713,6 +11713,7 @@ You could use @code{http} addresses just as well.
>  @subsection Math formatting in HTML export
>  @cindex MathJax
>  @cindex dvipng
> +@cindex dvisvgm
>  @cindex imagemagick
>  
>  @LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be displayed in two
> @@ -11737,13 +11738,18 @@ template can be configure via 
> @code{org-html-mathjax-template}.
>  If you prefer, you can also request that @LaTeX{} 

[O] Repeated tasks

2016-05-16 Thread N. Raghavendra
Is there a way to specify the timestamp for a repeated task which has to
be done on the second Sunday of every month?  I'd like the todo state of
the task to go back to TODO after it has been marked DONE, as described
in the section on repeated tasks in the Org manual.

Thanks,
Raghu.

-- 
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/




Re: [O] Use dvisvgm to preview latex fragments

2016-05-16 Thread Rasmus
Hi tumashu,

tumashu  writes:

> I find a new tool: dvisvgm (https://github.com/mgieseki/dvisvgm)
> ,which we can use it to preview latex fregments, it can deal with
> xetex's xdv file as well (it will available in texlive2016).

That looks very cool.  Thanks for the pointer!

Will you be working on a patch for supporting dvisvg?

> The questions are:
> 1.  which path we should use:   "dvi/xdv -> svg" or "dvi/xdv -> svg -> png" ?

Depends on which format Emacs supports.  If it’s compiled with svg support
I’d guess it’s better since it’s vector graph and potentially could scale
nicer when increasing font size.  But I don’t know how easy it would be to
incorporate inlined svg display.  At the very minimum you will have to
look at e.g. org-create-formula-image and "surrounding" functions, which
will bark at "dvisvg" ATM.

It might also be nice to make it possible to incorporate svg images for
math in odt where formula support is a bit lackluster.

> 2. if we use the first path, how to deal with
> org-latex-preview-ltxpng-directory?  should we rename it to
> org-latex-preview-ltximg-directory or
>org-latex-preview-ltxpic-directory ?

If you provide a patch that enables svg support you can change the default
value.

Rasmus

-- 
I hear there's rumors on the, uh, Internets. . .




Re: [O] looking for a variable which allows formatting the agenda clock report

2016-05-16 Thread Rainer Stengele

Am 11.05.2016 um 21:45 schrieb Rainer Stengele:

Am 11.05.2016 um 18:22 schrieb Marco Wahl:

Hi Rainer,


I could not find a variable which allows formatting the clock report
that is created in the org agenda by "v R".
Any quick pointer to such one or other ideas?


org-agenda-clockreport-parameter-plist



Thanks Marco,

now my question is how can I extract the category of a clock entry and
display it in the report? I tried a bit with properties but have no
real clue. Can somebody help here?


You can filter a certain category for the clock report afaics.

E.g.

org-agenda-clockreport-parameter-plist value

(:link t :maxlevel 2 :tags "+CATEGORY=\"busi\"")

only takes the clockings from items in category "busi" for the
org-agenda-clockreport.


HTH,


Hi Marco,

thanks for this, very useful.
What I really meant was how can I change the output format of the clock report,
so how do I change the first column from "File" to "Category" of the clock 
entry.

Thanks,
Rainer




Hi,

does anybody have an example for the :formatter item to format the 
clocktable output as needed?


Thank you.
Regards, Rainer




Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread John Hendy
I don't recall it, but these look along similar lines?
- 
https://www.reddit.com/r/emacs/comments/2bummt/changing_emacs_documentation_system_from_texinfo/
- https://lwn.net/Articles/625072/


John

On Sat, May 14, 2016 at 2:21 AM, Eric Abrahamsen
 wrote:
> I remember a while ago there was a discussion (on emacs.devel? I can't
> remember) about the format for Emacs manuals, and Org came into it, and
> at some point someone (Rasmus? Achim Gratz? I can't remember this
> either) posted a template for doing Emacs manuals in Org. It was
> particularly useful because it had all the macros set up to create the
> texinfo index, and it wasn't simple.
>
> I can't remember enough of the details to find the post anymore, though
> I've tried. Does anyone recall this, or know how to find it? Or does
> anyone have a good setup for exporting to Emacs manuals, plus index?
>
> Let's add it to Worg once we've got it!
>
> Thanks,
> Eric
>
>



Re: [O] Repeated tasks

2016-05-16 Thread Leandro Noferini
"N. Raghavendra"  writes:

> Is there a way to specify the timestamp for a repeated task which has
> to be done on the second Sunday of every month?  I'd like the todo
> state of the task to go back to TODO after it has been marked DONE, as
> described in the section on repeated tasks in the Org manual.

You can use sexp expressions: look at the chapter 8.3 of the manual, 8.3
Deadlines and scheduling

For example I use this expression for the first sunday of every month:

<%%(diary-float t 0 1)>


-- 
leandro Scegli sempre un'idea che ti permetta poi di cambiarla
http://6xukrlqedfabdjrb.onion


signature.asc
Description: PGP signature


Re: [O] speed keys for plain lists?

2016-05-16 Thread Grant Rettke
On Thu, May 12, 2016 at 12:12 PM, Bill White  wrote:
> But I'm open to suggestions & discussion - now's the time to play around
> with formats to find the right balance between playing with words and
> slogging through markup.  Perhaps this isn't the right mailing list for
> that discussion, though.

If it isn't then please post the name of that list when you find it.

I started out using only lists too because they are exactly as you
describe them.

Eventually I wanted to attach metadata to the lists, and now I love headings.

The case for Org-Mode only as a markup alone isn't very interesting
because it is competing against everything from SGML to ASCIIDoc. When
you throw in the community and infrastructure of tools and literature
then Org-Mode wins. It takes some time for it all to sink in though.

My gut reaction to learning Org-Mode (all aspects listed above) was
recalling this quote from Eric Weisstein:

"Created, developed, and nurtured by Eric Weisstein at Wolfram
Research" [http://mathworld.wolfram.com/]

Org-Mode makes it easy to do that with whatever document you are nurturing.



Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Rasmus
Eric Abrahamsen  writes:

> I remember a while ago there was a discussion (on emacs.devel? I can't
> remember) about the format for Emacs manuals, and Org came into it, and
> at some point someone (Rasmus? Achim Gratz? I can't remember this
> either) posted a template for doing Emacs manuals in Org. It was
> particularly useful because it had all the macros set up to create the
> texinfo index, and it wasn't simple.

Magit is the biggest project that I know of that is using Org for its
manual "in production".

Once upon a time Tom ported the Org manual.  It's on his github, probably
under tsdye.

Hope it helps,
Rasmus

-- 
This is the kind of tedious nonsense up with which I will not put




Re: [O] New Beamer environment selection problem

2016-05-16 Thread Julien Cubizolles
Nicolas Goaziou  writes:

> Hello,
>
> Julien Cubizolles  writes:
>
>> I'm still experiencing this problem with the following example
>>
>> #+BEGIN_SRC elisp
>>   (add-to-list 'load-path "~/git-repositories/org-mode/lisp")
>>   (add-to-list 'load-path "~/git-repositories/org-mode/contrib/lisp")
>> #+END_SRC
>>
>> #+RESULTS:
>> : Successfully reloaded Org
>> : Org-mode version 8.3.4 (release_8.3.4-695-gf07580 @ 
>> /home/wilk/git-repositories/org-mode/lisp/)
>
> This release is too old. You need to update Org.

I was only doing byte-recompile-directory after pulling from git (from
magit actually). According to the doc (that I should have read...) I
should run make update.

Julien.




[O] Tags management strategies

2016-05-16 Thread Martin Leduc

Hi !

Tags are a very useful feature to filter information in org-mode. After 
few years of developing a system to organize my life with org-mode, I 
realize that tags can become rather difficult to deal with as we tend to 
define a lot of tags spread out over several org files.


One general issue is to track all the tags that you have defined in all 
your org files. Rather than requesting an org-mode feature that would 
make a dynamical list of all the defined tags, I personally prefer the 
approach of making a static list of all preferred tags in one place and 
to try to keep this list as small as I can. I can achieve this by 
defining a global list of tags through the variable "org-tag-alist", 
which allows to access all the tags from any of my org files, and also 
because it allows to make "grouptags" which are very convenient to 
organize tags by themes.


The latter approach seems however limited to the use of a rather small 
number of tags since in the fast-tag-selection interface, tags entries 
beyond the 33th are marked with extended ASCCI characters such as ^?, 
\200, \201,... So my first question is how can I access these tags, and 
if it is possible, what is the physical limit in terms of the number of 
tags I can define and access ?


My second question is a bit more general, but I would like to know what 
peoples are currently doing to manage, track and make an efficient use 
of their numerous tags.


Many thanks,

Martin





[O] Agenda filter by any tag seems to be broken

2016-05-16 Thread Eric Abrahamsen
Is anyone else seeing this?

Go into a tags-type agenda, hit "/" to start filtering, then SPC for
"filter to any tag". That gives me this backtrace:

Debugger entered--Lisp error: (args-out-of-range "" 0 1)
  substring("" 0 1)
  (equal "{" (substring tag 0 1))
  (and (equal "{" (substring tag 0 1)) (equal "}" (substring tag -1)))

  org-agenda-filter-make-matcher-tag-exp(("+") 43)

Once ("+") is added to `org-agenda-tag-filter', all subsequent filtering
actions will fail, until you remove all filters with "/ /".

`org-agenda-filter-make-matcher-tag-exp' always removes the first
character of the tag-matcher string, and then operates on what's left.
In the case of "+", nothing's left!

Thanks,
Eric




[O] Repeated tasks

2016-05-16 Thread N . Raghavendra
Is there a way to specify the timestamp for a repeated task which has to
be done on the second Sunday of every month?  I'd like the todo state of
the task to go back to TODO after it has been marked DONE, as described
in the section on repeated tasks in the Org manual.

Thanks,
Raghu.





Re: [O] Problem with Including subsection by CUSTOM_ID

2016-05-16 Thread Rasmus
Hi,

Ilya Filippov  writes:

> I try to include subsection from one org-file to another
> (http://orgmode.org/manual/Include-files.html) with using CUSTOM_ID.
>
> In first-file.org:
>
> ** Subsection name
> :PROPERTIES:
> :CUSTOM_ID: subsec_to_include
> :END:
>
> bla-bla
>
>
> In second-file.org I use construction:
>
> * I want include here
>
> #+INCLUDE: "./first-file.org::#funcNT10"
>
>
> And when I export second file to PDF, org-mode gives an error message: 
> "Cannot include file /org/first-file.org::#funcNT10"

Maybe you need to use "./first-file.org:#subsec_to_include", or maybe it's
just a typo in your email.  You need Org 8.3.

Hope it helps,
Rasmus

-- 
However beautiful the theory, one should occasionally look at the evidence




[O] Agenda filter by any tag seems to be broken

2016-05-16 Thread Eric Abrahamsen
Apparently there's some networking devilry going on with gmane at the
moment, and this never got sent -- I'm trying again. Original message
was:



Is anyone else seeing this?

Go into a tags-type agenda, hit "/" to start filtering, then SPC for
"filter to any tag". That gives me this backtrace:

Debugger entered--Lisp error: (args-out-of-range "" 0 1)
  substring("" 0 1)
  (equal "{" (substring tag 0 1))
  (and (equal "{" (substring tag 0 1)) (equal "}" (substring tag -1)))

  org-agenda-filter-make-matcher-tag-exp(("+") 43)

Once ("+") is added to `org-agenda-tag-filter', all subsequent filtering
actions will fail, until you remove all filters with "/ /".

`org-agenda-filter-make-matcher-tag-exp' always removes the first
character of the tag-matcher string, and then operates on what's left.
In the case of "+", nothing's left!

Thanks,
Eric




Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread Kaushal Modi
Copying Oleh as I believe he uses org to generate Info manual for his ivy
package.
-- 

-- 
Kaushal Modi


[O] template for writing Emacs manuals in Org

2016-05-16 Thread Eric Abrahamsen
I remember a while ago there was a discussion (on emacs.devel? I can't
remember) about the format for Emacs manuals, and Org came into it, and
at some point someone (Rasmus? Achim Gratz? I can't remember this
either) posted a template for doing Emacs manuals in Org. It was
particularly useful because it had all the macros set up to create the
texinfo index, and it wasn't simple.

I can't remember enough of the details to find the post anymore, though
I've tried. Does anyone recall this, or know how to find it? Or does
anyone have a good setup for exporting to Emacs manuals, plus index?

Let's add it to Worg once we've got it!

Thanks,
Eric




Re: [O] speed keys for plain lists?

2016-05-16 Thread Bill White
On Tue May 10 2016 at 03:21, Karl Voit  wrote:

> * Bill White  wrote:
>>
>> Thank you all for the suggestions thus far.  I'll attach the org file
>> I'm working with:
>
> Being curious on your motivation: why do you use only plain list items
> instead of headings with paragraphs or headings with plain lists?

Mainly because I'm still playing around with possible formats.  Some
manual correction of the ocr text is required for each entry, which
provides a frictionless opportunity to add a little bit of list markup
and then get on with the next entry.

My final goal is a simple electronic version of the old Oxford English
Dictionary as outlined by Corey Doctorow
http://www.theguardian.com/technology/2013/aug/23/oxford-english-dictionary-future-digitally
based on files at the Internet Archive - volume 1 is at
https://archive.org/details/oed01arch

I'd like the thing to be as close to plaintext as possible with a
minimum of markup:
 - org list notation is minimal
 - it's useful within orgmode
 - it doesn't get in the user's way in non-emacs ecosystems
 - it avoids the endless quagmire of adding significant markup to such a
   huge body of text
 - it's a necessary first step for some other brave soul who wants to
   add markup & organization

But I'm open to suggestions & discussion - now's the time to play around
with formats to find the right balance between playing with words and
slogging through markup.  Perhaps this isn't the right mailing list for
that discussion, though.

Cheers -

bw
Bill White . bi...@wolfram.com
"No ma'am, we're musicians."




[O] Orgzly mobile Org-Mode app for Android now with folding

2016-05-16 Thread Paul Harper

I just noticed that Orgzly the mobile app for Android now has folding. I
think this will be replacing Mobile-Org for me.

1.4-beta.4 is out. It should be the last beta, if no issues are found.

• Add "Fold content" option
• Add "Display content in search" option
• Rearrange Settings
• Update "What's New" dialog's button when DB upgrade is in progress
• Use large bullet for folded notes with children

Opt-in to receive beta releases if you haven't already:
https://play.google.com/apps/testing/com.orgzly

Regards,

Paul



[O] Unique org version for dev builds? (Was: org -> org export ignores latex ..)

2016-05-16 Thread Kaushal Modi
Hi Bastien, Achim,

I have added you to this thread to get help on how to make it easy to
identify if the current version of org-mode is the dev build.

As of now, M-x org-version shows "Org-mode version 8.3.4 .." for both
master and maint build of org-mode. Would it be possible to have the
version show something like "Org-mode version 8.3.4-dev .." for master
branch builds?

That allows a quick visual confirmation if someone is using the dev or
stable build. Also it would be useful in creating version checking elisp
wrappers around not-yet-released org-mode code in personal configs.

Something like below would then be possible

(if (org-mode-dev-p)
(progn
  ;; new style
  )
  (progn
;; old style
))

Thanks.


On Fri, May 13, 2016 at 11:45 AM Nicolas Goaziou 
wrote:

> Hello,
>
> Kaushal Modi  writes:
>
> > It would have been nice if the master branch built version showed a
> > different numerical version number than the one on the maint branch. Or
> > probably some prefix like dev/master? Nicolas?
>
> Deciding the next version number ahead of time isn't always right from
> the beginning of the branch. I guess a "dev" suffix should be enough.
>
> However, I don't know how to change the release tag, which is defined in
> a somewhat convoluted way. Bastien or Achim probably know how to do it.
>
> --

-- 
Kaushal Modi


Re: [O] (version 3) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-16 Thread tumashu





--
发自我的网易邮箱手机智能版


在 2016-05-16 21:18:20,"Nicolas Goaziou"  写道:
>Hello,
>
>"Feng Shu"  writes:
>
>> I suggest to add (:generator my-generator-function) style configure
>> to `org-latex-pdf-process', it is simple and powerful feature, we
>> can use this feature to switch latex commands dynamicially, for example:
>>
>> (defun my-latex-pdf-process-generator (texfile snippet extra-info)
>>   (cond
>>(() ()
>>(() ()
>>
>> although we can set org-latex-pdf-process to a function to do the same work,
>> but this function is hard to write as org-latex-compile, it may only
>> useful for developer instead of user
>>
>> caller-info argument is for the above feature.
>
>I understand the need to extend `org-latex-pdf-process'. However this
>isn't a good way to look at it. In fact, it makes little sense to load
>the whole export framework when you're only after displaying a LaTeX
>snippet in the current buffer.
>
>I think a better approach would be to create a generic tool to compile
>a file to another format, e.g. `org-compile-file'. It would take a command
>(as a list of strings or a function) and apply it to the source file
>name. Then it would check if the output file was produced. Optionally,
>it would allow to create a buffer so as to retrieve error messages.
>
>Then, e.g., `org-latex-compile' or `org-preview-generate-image', could
>extend this function, i.e., handle specific variables (e.g.,
>`org-latex-pdf-process') and call it with appropriate arguments.
>
>As example, here's a proof of concept for `org-compile-file' and
>`org-latex-compile'.
>
>  (defun org-compile-file (source process extension  spec log-buffer)
>"Compile a SOURCE file using PROCESS.
>
>  PROCESS is either a function or a list of shell commands, as
>  strings.
>
>  If PROCESS is a function, it is called with a single argument:
>  SOURCE file.  It must create a file with the same base name and
>  directory as SOURCE, but using extension.
>
>  If it is a list of commands, each of them is called using
>  `shell-command'.  By default, in each command, %b, %f and %o are
>  replaced, respectively, with SOURCE base name, SOURCE full name
>  and SOURCE directory.  It is possible, however, to use different
>  place-holders by specifying them in optional argument SPEC.  In
>  this case, SPEC should be an alist (CHARACTER REPLACEMENT-STRING).
>
>  When PROCESS is a list of commands, optional argument LOG-BUFFER
>  can be set to a buffer or a buffer name.  `shell-command' then
>  uses it as an output buffer, which may be used for collecting
>  errors.
>
>  `default-directory' is set to SOURCE directory during the whole
>  process.
>
>  Return output file or raise an error if it wasn't generated upon
>  executing PROCESS."
>(let* ((base-name (file-name-sans-extension (file-name-nondirectory 
> source)))
>(full-name (file-truename source))
>(out-dir (file-name-directory source))
>;; Properly set working directory for compilation.
>(default-directory (if (file-name-absolute-p source)
>   (file-name-directory full-name)
> default-directory))
>(time (current-time)))
>  (save-window-excursion
>(pcase process
>  ((pred functionp) (funcall process (shell-quote-argument source)))
>  ((pred consp)
>   (let ((log (and log-buffer (get-buffer-create log-buffer)))
> (spec (or spec
>   `((?b ,(shell-quote-argument base-name))
> (?f ,(shell-quote-argument full-name))
> (?o ,(shell-quote-argument out-dir))
> (dolist (command process)
>   (shell-command (format-spec command spec) log
>  (t (error "No valid command to process %S" source)))
>;; Check for process failure.
>(let ((output (concat out-dire base-name extension)))
>  (when (or (not (file-exists-p output))
>;; Only compare times up to whole seconds as some
>;; file-systems (e.g. HFS+) do not retain any finer
>;; granularity.
>(time-less-p (cl-subseq (nth 5 (file-attributes output)) 0 
> 2)
> (cl-subseq time 0 2)))
>(error (format "File %S wasn't produced" output)))
>  output
>
>  (defun org-latex-compile (texfile)
>"Compile a TeX file.
>
>  TEXFILE is the name of the file being compiled.  Processing is
>  done through the command specified in `org-latex-pdf-process'.
>
>  Return PDF file name or an error if it couldn't be produced."
>(message "Processing LaTeX file %s..." texfile)
>(let* ((base-name (file-name-sans-extension (file-name-nondirectory 
> texfile)))
>(full-name (file-truename texfile))
>(compiler (or (with-temp-buffer
>(save-excursion (insert-file-contents 

Re: [O] (version 3) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-16 Thread Nicolas Goaziou
"Feng Shu"  writes:

> Nicolas Goaziou  writes:

>>> +  :type 'alist)
>
> I need to help to deal with it, what about just remove :type?

You cannot remove :type as it would make the defcustom invalid. However,
I wouldn't bother much at the moment since the design is not yet finalized.

Regards,



Re: [O] (version 3) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-16 Thread Nicolas Goaziou
Hello,

"Feng Shu"  writes:

> I suggest to add (:generator my-generator-function) style configure
> to `org-latex-pdf-process', it is simple and powerful feature, we
> can use this feature to switch latex commands dynamicially, for example:
>
> (defun my-latex-pdf-process-generator (texfile snippet extra-info)
>   (cond
>(() ()
>(() ()
>
> although we can set org-latex-pdf-process to a function to do the same work,
> but this function is hard to write as org-latex-compile, it may only
> useful for developer instead of user
>
> caller-info argument is for the above feature.

I understand the need to extend `org-latex-pdf-process'. However this
isn't a good way to look at it. In fact, it makes little sense to load
the whole export framework when you're only after displaying a LaTeX
snippet in the current buffer.

I think a better approach would be to create a generic tool to compile
a file to another format, e.g. `org-compile-file'. It would take a command
(as a list of strings or a function) and apply it to the source file
name. Then it would check if the output file was produced. Optionally,
it would allow to create a buffer so as to retrieve error messages.

Then, e.g., `org-latex-compile' or `org-preview-generate-image', could
extend this function, i.e., handle specific variables (e.g.,
`org-latex-pdf-process') and call it with appropriate arguments.

As example, here's a proof of concept for `org-compile-file' and
`org-latex-compile'.

  (defun org-compile-file (source process extension  spec log-buffer)
"Compile a SOURCE file using PROCESS.

  PROCESS is either a function or a list of shell commands, as
  strings.

  If PROCESS is a function, it is called with a single argument:
  SOURCE file.  It must create a file with the same base name and
  directory as SOURCE, but using extension.

  If it is a list of commands, each of them is called using
  `shell-command'.  By default, in each command, %b, %f and %o are
  replaced, respectively, with SOURCE base name, SOURCE full name
  and SOURCE directory.  It is possible, however, to use different
  place-holders by specifying them in optional argument SPEC.  In
  this case, SPEC should be an alist (CHARACTER REPLACEMENT-STRING).

  When PROCESS is a list of commands, optional argument LOG-BUFFER
  can be set to a buffer or a buffer name.  `shell-command' then
  uses it as an output buffer, which may be used for collecting
  errors.

  `default-directory' is set to SOURCE directory during the whole
  process.

  Return output file or raise an error if it wasn't generated upon
  executing PROCESS."
(let* ((base-name (file-name-sans-extension (file-name-nondirectory 
source)))
 (full-name (file-truename source))
 (out-dir (file-name-directory source))
 ;; Properly set working directory for compilation.
 (default-directory (if (file-name-absolute-p source)
(file-name-directory full-name)
  default-directory))
 (time (current-time)))
  (save-window-excursion
(pcase process
  ((pred functionp) (funcall process (shell-quote-argument source)))
  ((pred consp)
   (let ((log (and log-buffer (get-buffer-create log-buffer)))
 (spec (or spec
   `((?b ,(shell-quote-argument base-name))
 (?f ,(shell-quote-argument full-name))
 (?o ,(shell-quote-argument out-dir))
 (dolist (command process)
   (shell-command (format-spec command spec) log
  (t (error "No valid command to process %S" source)))
;; Check for process failure.
(let ((output (concat out-dire base-name extension)))
  (when (or (not (file-exists-p output))
;; Only compare times up to whole seconds as some
;; file-systems (e.g. HFS+) do not retain any finer
;; granularity.
(time-less-p (cl-subseq (nth 5 (file-attributes output)) 0 
2)
 (cl-subseq time 0 2)))
(error (format "File %S wasn't produced" output)))
  output

  (defun org-latex-compile (texfile)
"Compile a TeX file.

  TEXFILE is the name of the file being compiled.  Processing is
  done through the command specified in `org-latex-pdf-process'.

  Return PDF file name or an error if it couldn't be produced."
(message "Processing LaTeX file %s..." texfile)
(let* ((base-name (file-name-sans-extension (file-name-nondirectory 
texfile)))
 (full-name (file-truename texfile))
 (compiler (or (with-temp-buffer
 (save-excursion (insert-file-contents full-name))
 (when (and (search-forward-regexp
 (regexp-opt org-latex-compilers) 
(line-end-position 2) t)
   

Re: [O] (v6) [PATCH] New feature: Use dvisvgm to preview latex formular

2016-05-16 Thread Feng Shu
Nicolas Goaziou  writes:

This is my modified patch (v6), fix the problems you stated. please review
again, thank!

>From 29760e5c5876fb6b772f7a6004b7160bc06efba8 Mon Sep 17 00:00:00 2001
From: Feng Shu 
Date: Sat, 14 May 2016 22:42:53 +0800
Subject: [PATCH] New feature: Use dvisvgm to preview latex formular

* ox-latex.el (org-latex-pdf-process): org-latex-pdf-process can be a
  configure generator (a plist with :generator keyword).
(org-latex-preview-process): new variable, which is used to process
 latex snippet.
(org-latex-compile): Add a new optional argument: extra-info.

* ox-html.el (org-html-with-latex): Add dvisvgm support.
(org-html-with-latex): Add dvisvgm support.
(org-html-format-latex): "ltxpng" -> "ltximg".
(org-html-latex-environment): Add dvisvgm support.
(org-html-latex-fragment): Add dvisvgm support.

* org.el (org-latex-create-formula-image-program): Add dvisvgm.
(org-latex-preview-ltximg-directory): Rename from `org-latex-preview-ltximg-directory'.
(org--format-latex-make-overlay): Add optional image-type, which used to deal with svg.
(org-toggle-latex-fragment): "org-ltxpng" -> "org-ltximg".
(org-format-latex): Add dvisvgm support.
(org-create-formula-image): Big refactor, merge dvipng and imagemagick backend's feature.
Add dvisvgm feature.
(org-latex-to-image-backends): Add new variable, which used to set latex2image program.
(org-create-formula-image-with-dvipng): Useless, removed.
(org-create-formula-image-with-imagemagick): Useless, removed.

* org.texi (@LaTeX{} fragments): Add dvisvgm information.
(Previewing @LaTeX{} fragments): Add dvisvgm information.
(Math formatting in HTML export): Add dvisvgm information.
(Working with @LaTeX{} math snippets): Add dvisvgm information.
---
 doc/org.texi |  39 --
 lisp/org.el  | 380 ---
 lisp/ox-html.el  |  28 ++--
 lisp/ox-latex.el | 171 -
 4 files changed, 374 insertions(+), 244 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 17b01c2..286fabb 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10393,10 +10393,10 @@ snippets will be identified as @LaTeX{} source code:
 @item
 Environments of any kind@footnote{When MathJax is used, only the
 environments recognized by MathJax will be processed.  When
-@file{dvipng} program or @file{imagemagick} suite is used to create images,
-any @LaTeX{} environment will be handled.}.  The only requirement is that the
-@code{\begin} statement appears on a new line, at the beginning of the line
-or after whitespaces only.
+@file{dvipng} program, @file{dvisvgm} program or @file{imagemagick} suite is
+used to create images, any @LaTeX{} environment will be handled.}.  The only
+requirement is that the @code{\begin} statement appears on a new line, at the
+beginning of the line or after whitespaces only.
 @item
 Text within the usual @LaTeX{} math delimiters.  To avoid conflicts with
 currency specifications, single @samp{$} characters are only recognized as
@@ -10444,10 +10444,10 @@ lines:
 @cindex @LaTeX{} fragments, preview
 
 @vindex org-latex-create-formula-image-program
-If you have a working @LaTeX{} installation and either @file{dvipng} or
-@file{convert} installed@footnote{These are respectively available at
-@url{http://sourceforge.net/projects/dvipng/} and from the @file{imagemagick}
-suite. Choose the converter by setting the variable
+If you have a working @LaTeX{} installation and @file{dvipng}, @file{dvisvgm}
+or @file{convert} installed@footnote{These are respectively available at
+@url{http://sourceforge.net/projects/dvipng/}, @url{http://dvisvgm.bplaced.net/}
+and from the @file{imagemagick} suite. Choose the converter by setting the variable
 @code{org-latex-create-formula-image-program} accordingly.}, @LaTeX{}
 fragments can be processed to produce images of the typeset expressions to be
 used for inclusion while exporting to HTML (see @pxref{@LaTeX{} fragments}),
@@ -11713,6 +11713,7 @@ You could use @code{http} addresses just as well.
 @subsection Math formatting in HTML export
 @cindex MathJax
 @cindex dvipng
+@cindex dvisvgm
 @cindex imagemagick
 
 @LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be displayed in two
@@ -11737,13 +11738,18 @@ template can be configure via @code{org-html-mathjax-template}.
 If you prefer, you can also request that @LaTeX{} fragments are processed
 into small images that will be inserted into the browser page.  Before the
 availability of MathJax, this was the default method for Org files.  This
-method requires that the @file{dvipng} program or @file{imagemagick} suite is
-available on your system.  You can still get this processing with
+method requires that the @file{dvipng} program, @file{dvisvgm} or
+@file{imagemagick} suite is available on your system.  You can still get
+this processing with
 
 @example
 #+OPTIONS: tex:dvipng
 @end 

[O] Bug: orgtbl-self-insert-command does not overwrite whitespace [8.3.4 (8.3.4-50-g83e373-elpa @ /home/alex/.emacs.d/elpa/org-20160509/)]

2016-05-16 Thread Alex
As per the title, orgtbl-mode doesn't overwrite whitespace in tables
like it does normally in org-mode. Backspace works as expected, however.

This was produced in emacs -Q in fundamental-mode.

Emacs  : GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.18.9)
 of 2016-04-11 on buildvm-25.phx2.fedoraproject.org
Package: Org-mode version 8.3.4 (8.3.4-50-g83e373-elpa @ 
/home/alex/.emacs.d/elpa/org-20160509/)

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



Re: [O] Bug: Write file while editing babel code block doesn't work as expected [8.3.4 (release_8.3.4-778-g8127b3 @ /usr/local/share/emacs/site-lisp/org/)]

2016-05-16 Thread Nicolas Goaziou
Hello,

Vladimir Lomov  writes:

> This works fine, though at first I thought it would be enough to add
> only following code
> #+BEGIN_SRC emacs-lisp
>   (define-key org-src-mode-map [f2] 'org-edit-src-save)
> #+END_SRC
> into emacs init file. Of course, this don't work and emacs complains about
> ~org-src-mode-map~. Only one thing bother me: is it normal to add such
> hook into ~org-src-mode-hook~ ?

I think so. I also add keybindings through mode hooks.

Another way to achieve this it to use `with-eval-after-load'.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] org-capture.el: Support all capture template target-file variants in Customize

2016-05-16 Thread Nicolas Goaziou
Hello,

Phil Hudson  writes:

>  org-capture.el: Support all capture template target-file variants in 
> Customize
>
> * lisp/org-capture.el (`org-capture-templates'): Adjust the
>   `org-capture-templates' defcustom template to support specifying the capture
>   target file using either a literal pathname, a function, a variable or a
>   form, as documented.  Previously the Customize UI supported specifying only 
> a
>   literal pathname.
>   (org-capture-templates): Clarify the documentation for the 'function' method
>   for setting up the capture target.
>
> * doc/org.texi (Template elements): Clarify the 'function' method for setting 
> up
>   the capture target.

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou



[O] ask for an advice for org-display-inline-images

2016-05-16 Thread numbch...@gmail.com
I hope somebody can provide an advice for `org-display-inline-images` to
set image background color.

Here is an link on StackExchange.Emacs:

http://emacs.stackexchange.com/questions/20574/default-inline-image-background-in-org-mode/20598?noredirect=1#comment32482_20598

I don't know how to write this advice.

I try the following code, but not work. (I'm not good at elisp)

```lisp
(defun create-image-with-background (file width background-color)
  (create-image file
(and width 'imagemagick)
nil
:width width
:background background-color))

(advice-add 'org-display-inline-images :filter-return
(lambda (r)
  (create-image-with-background r)))
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] [PATCH] org-capture.el: Support all capture template target-file variants in Customize

2016-05-16 Thread Phil Hudson
>From ef813011fbe2fd47e5bdd623a6cff0878074de0c Mon Sep 17 00:00:00 2001
From: Phil Hudson 
Date: Mon, 16 May 2016 09:32:06 +0100
Subject: [PATCH] org-capture.el: Support all capture template target-file
 variants in Customize

* lisp/org-capture.el (`org-capture-templates'): Adjust the
  `org-capture-templates' defcustom template to support specifying the capture
  target file using either a literal pathname, a function, a variable or a
  form, as documented.  Previously the Customize UI supported specifying only a
  literal pathname.
  (org-capture-templates): Clarify the documentation for the 'function' method
  for setting up the capture target.

* doc/org.texi (Template elements): Clarify the 'function' method for setting up
  the capture target.
---
 doc/org.texi|  4 ++--
 lisp/org-capture.el | 31 ++-
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 17b01c2..0bfee39 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -7206,8 +7206,8 @@ A function to find the right location in the file.
 File to the entry that is currently being clocked.
 
 @item (function function-finding-location)
-Most general way, write your own function to find both
-file and location.
+Most general way: write your own function which both visits
+the file and moves point to the right location.
 @end table
 
 @item template
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 34a6817..2b0cb0c 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -166,8 +166,8 @@ target   Specification of where the captured item 
should be placed.
 File to the entry that is currently being clocked
 
  (function function-finding-location)
-Most general way, write your own function to find both
-file and location
+Most general way: write your own function which both visits
+the file and moves point to the right location
 
 template The template for creating the capture item.  If you leave this
  empty, an appropriate default template will be used.  See below
@@ -299,7 +299,12 @@ you can escape ambiguous cases with a backward slash, 
e.g., \\%i."
   :group 'org-capture
   :version "24.1"
   :type
-  '(repeat
+  (let ((file-variants '(choice :tag "  Filename"
+   (file :tag "  Literal")
+   (function :tag "  Function")
+   (variable :tag "  Variable")
+   (sexp :tag "  Form"
+  `(repeat
 (choice :value ("" "" entry (file "~/org/notes.org") "")
(list :tag "Multikey description"
  (string :tag "Keys   ")
@@ -316,38 +321,38 @@ you can escape ambiguous cases with a backward slash, 
e.g., \\%i."
  (choice :tag "Target location"
  (list :tag "File"
(const :format "" file)
-   (file :tag "  File"))
+   ,file-variants)
  (list :tag "ID"
(const :format "" id)
(string :tag "  ID"))
  (list :tag "File & Headline"
(const :format "" file+headline)
-   (file   :tag "  File")
+   ,file-variants
(string :tag "  Headline"))
  (list :tag "File & Outline path"
(const :format "" file+olp)
-   (file   :tag "  File")
+   ,file-variants
(repeat :tag "Outline path" :inline t
(string :tag "Headline")))
  (list :tag "File & Regexp"
(const :format "" file+regexp)
-   (file   :tag "  File  ")
+   ,file-variants
(regexp :tag "  Regexp"))
  (list :tag "File & Date tree"
(const :format "" file+datetree)
-   (file :tag "  File"))
+   ,file-variants)
  (list :tag "File & Date tree, prompt for date"
(const :format "" file+datetree+prompt)
-   (file :tag "  File"))
+   ,file-variants)
  (list :tag "File & Week tree"
(const :format "" file+weektree)
-   (file :tag "  File"))
+   ,file-variants)
  (list :tag "File & Week tree, prompt for date"

Re: [O] ATTR_LATEX :options ignored for source code

2016-05-16 Thread Jeff Trull
Ah, I see...

I was expecting the "option to the environment" to look like:

\begin{lstlisting}[commentstyle=\bfseries]

Though doing it with \lstset will produce the same result if the option is
placed at the end, which it is.

Thanks for your help,
Jeff

On Sun, May 15, 2016 at 12:33 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> Jeff Trull  writes:
>
> > According to the manual users can supply #+ATTR_LATEX: :options ... prior
> > to a source section and the options present will be supplied to the
> > environment (lstlistings in my case).  I find that this does not work -
> > regardless of settings, no options are supplied to the lstlistings
> > environment.  Attached is a test case that demonstrates the problem.  It
> is
> > taken from the manual.
>
> FWIW, I cannot reproduce it. I get
>
>   \lstset{language=C++,label= ,caption=
> ,captionpos=b,numbers=none,commentstyle=\bfseries}
>   \begin{lstlisting}
>   using foo_t = int;
>   struct bar_t {
>   foo_t a; // this comment should be bold
>   };
>   \end{lstlisting}
>
> What Org version are you using?
>
> Regards,
>
> --
> Nicolas Goaziou
>