[O] elfeed and orgmode integaration?

2015-12-03 Thread Xebar Saram
Hi all

I was wondering if anyone uses elfeed and org and how people integrate it
into orgmode.

It would be great if anyone can share code dealing with capturing from
elfeed into org, linking and any other uses people are coming up with

thx so much

best

Z


[O] footnote fontify causing massive slowdown

2015-12-03 Thread Derek Feichtinger
While diagnosing a server condition, I was listing parts of a system log
via a babel expression. The 130 lines in the babel output are wrapped in
an example block. This block caused massive slowdown of scrolling and
other operations.

Using the emacs profiler I see:

- redisplay_internal (C function) 8232  88%
 - jit-lock-function 8226  88%
  - jit-lock-fontify-now 8226  88%
   - funcall 8226  88%
- #  8226  88%
 - run-hook-with-args 8226  88%
  - font-lock-fontify-region 8226  88%
   - font-lock-default-fontify-region 8226  88%
- font-lock-fontify-keywords-region 8226  88%
 - org-activate-footnote-links 8158  87%
  - org-footnote-next-reference-or-definition 8158  87%
   - byte-code 8158  87%
- org-footnote-at-reference-p 4114  44%
 - org-footnote-in-valid-context-p 4106  44%
  + org-inside-LaTeX-fragment-p 2380  25%
  + org-in-block-p 1563  16%
  + org-in-verbatim-emphasis 159   1%
org-at-comment-p 4   0%

Checking for footnote pattern matches (org-footnote-re) in the wrapped
block, I see that
every line matches based on the very simple and trivial pattern of
number enclosed in angular brackets, so all the process numbers
following the "sshd" in these lines like "sshd[1234]" do match and cause load.

#
/var/log/secure-20151129:Nov 23 02:25:36 some-host sshd[20089]: Rhosts
authentication refused for userXYZ: bad ownership or modes for home directory.
/var/log/secure-20151129:Nov 23 02:25:36 some-host sshd[20089]: Rhosts
authentication refused for userXYZ: bad ownership or modes for home directory.
/var/log/secure-20151129:Nov 23 02:25:41 some-host sshd[20089]:
pam_ldap: error trying to bind as user "x" (Invalid credentials)
#

Since this kind of pattern is so common in logs and 130 lines are really not
a large number, it makes it hard to use
org for this purpose. Can this be turned off selectively, or can it be
prevented in example blocks?

Using [8.3.2 (8.3.2-37-gd45217-elpaplus @
/home/dfeich/.emacs.d/elpa/org-plus-contrib-20151116/)] with GNU Emacs 24.5.1.

Best regards,
Derek





Re: [O] problem with org-capture

2015-12-03 Thread Nicolas Goaziou
Hello,

Charles Millar  writes:

> I think it is still broken in another way
>
> my template for capturing time as I work on a files -
>
> ("s" "timeslip" table-line
>  (file "/mnt/Data/ActiveFiles/EmacsFiles/timeslips.org")
>  "\| %(org-read-date)\| %^{FileName} %i\| %^{Narrative}
> %i\| %^{Time} %i\| %^{Expense} %i"
>
> Last week the prompt org-read-date would pull up the calendar first;
> now the template jumps first to FileName, then Narrative,then Time,
> then Expense, then back to org-read-date.

Well, this one is to be expected. S-exp placeholders are evaluated only
once. This currently happens at the end of the process because some
users do

  %(do-stuff "%i")

Here you want it to happen at the beginning of the process, which is not
quite compatible with the behaviour above.

I guess we could check if the S-exp contains any placeholder to decide
if it should be evaluated at the beginning or the end of the process,
but that somehow sounds cheesy.

> After C-c C-c there is anywhere 5 to 20 second delay.

I'm not sure this is related to the change. Could you use
elp-intrument-package and post the details?


Regards,

-- 
Nicolas Goaziou



Re: [O] problem with org-capture

2015-12-03 Thread Eric S Fraga
On Wednesday,  2 Dec 2015 at 22:24, Nicolas Goaziou wrote:
> Hello,
>
> Eric S Fraga  writes:
>
>> However, it only partially fixed.  The system does now prompt as it
>> should but the mini-buffer input only allows single words.  Hitting
>> space bar attempts to do completion.  I believe the input should be free
>> form?
>
> Fixed (again). Thank you.

Thanks (again :-).

Okay, this now works in that I can enter the text.  However, there seems
to be a very strange side effect: I get the error message

  Error running timer: `org-indent-initialize-agent': (error "Marker
  points into wrong buffer" #

Re: [O] problem with org-capture

2015-12-03 Thread Charles Millar



On 12/03/2015 04:02 AM, Nicolas Goaziou wrote:

Hello,

Charles Millar  writes:


I think it is still broken in another way

my template for capturing time as I work on a files -

 ("s" "timeslip" table-line
  (file "/mnt/Data/ActiveFiles/EmacsFiles/timeslips.org")
  "\| %(org-read-date)\| %^{FileName} %i\| %^{Narrative}
%i\| %^{Time} %i\| %^{Expense} %i"

Last week the prompt org-read-date would pull up the calendar first;
now the template jumps first to FileName, then Narrative,then Time,
then Expense, then back to org-read-date.

Well, this one is to be expected. S-exp placeholders are evaluated only
once. This currently happens at the end of the process because some
users do

   %(do-stuff "%i")

Here you want it to happen at the beginning of the process, which is not
quite compatible with the behaviour above.

I guess we could check if the S-exp contains any placeholder to decide
if it should be evaluated at the beginning or the end of the process,
but that somehow sounds cheesy.
OK; however, why should this change within the past few days (at least 
in my case)? I have been using this template for over three and I 
believe four years and the calendar prompt always started first, not last.

After C-c C-c there is anywhere 5 to 20 second delay.

I'm not sure this is related to the change. Could you use
elp-intrument-package and post the details?



You are right, it's not.

Charlie



Re: [O] plantuml: Terminal 0 is locked

2015-12-03 Thread Johann Spies
Sorry for the noise,  plantuml.jar was not in the correct place.

Regards
Johann

On 3 December 2015 at 14:22, Johann Spies  wrote:

> When I evaluate this:
>
> @startuml
> Alice -> Bob: Authentication Request
> Bob --> Alice: Authentication Response
>
> Alice -> Bob: Another authentication Request
> Alice <-- Bob: another authentication Response
> @enduml
>
> I get an error message:
>
> Terminal 0 is locked, cannot read from it
>
> What is causing this?
>
> Regards
>
> Johann
>
>
>
>
> --
> Because experiencing your loyal love is better than life itself,
> my lips will praise you.  (Psalm 63:3)
>



-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


[O] LaTeX export with section number, name and page in internal links

2015-12-03 Thread Ilya
I export my Org-Mode notes with internal links to LaTeX and I want it to
look like this ''Section 1.1 [Section name], page 99'' (Like in the Org
Manual). I use this construction:

#+BEGIN_EXAMPLE
 * Chapter 1
 ** Section 1.1
:PROPERTIES:
:CUSTOM_ID: section-1
:END:
 * Chapter 2
 ** Section 2.1
I want reference to Section 1.1 from here (See #section-1)
#+END_EXAMPLE

But as a result I get only the number of the section ''1.1'', not the
''Section 1.1 [Section name], page 99''.
What options I need to use?

Here
(http://emacs.stackexchange.com/questions/18547/org-mode-latex-export-with-section-number-name-and-page-in-internal-links),
I was advised to use a Fancyref, but I have no idea how I may use it with
Org-Mode syntax.




[O] plantuml: Terminal 0 is locked

2015-12-03 Thread Johann Spies
When I evaluate this:

@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml

I get an error message:

Terminal 0 is locked, cannot read from it

What is causing this?

Regards

Johann




-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


Re: [O] ox-latex

2015-12-03 Thread Rasmus
Raimund  writes:

> Hi,
>
> I'm a bloody beginner on org-mode so I still am searching my way
> through the oceans of informations about getting along with org-mode.
>
> At the moment I am struggling with using latex-export and setting up
> (a) latex-class(es).
>
> I found some great instructions on worg: Latex Export vor org-mode <
> 8.0 
>  and it says to make some changes in .emacs like:
>
>> (require  'ox-latex)
>
> If I do that and eval-buffer emacs it reads:
>
>
>> eval-buffer: Cannot open load file: ox-latex
>
> Now I don't know if it means ox-latex doesn't exist at all
> ... however, I thought to look out for ox-latex in the web to download
> and push it in my .emacs.d ... hmmm ... even though there are bunches
> of ox-whatsoever-files I failed to find ox-latex ... so I think I'm
> thinking wrong ... :-(
>
> Can anyone help me out here?

It sounds like you don't have a recent version of Org.   Please see the
installation instructions in the manual,

 http://orgmode.org/org.html

Hope it helps,
Rasmus

-- 
To err is human. To screw up 10⁶ times per second, you need a computer




Re: [O] LaTeX export with section number, name and page in internal links

2015-12-03 Thread John Kitchin
Try this.

* Chapter 1
** Section 1.1  \label{manual-section-1}
:PROPERTIES:
:CUSTOM_ID: section-1
:END:
* Chapter 2
** Section 2.1
I want reference to Section 1.1 from here (See Section
\ref{manual-section-1} on page \pageref{manual-section-1})



John

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


On Thu, Dec 3, 2015 at 6:08 AM, Ilya  wrote:

> I export my Org-Mode notes with internal links to LaTeX and I want it to
> look like this ''Section 1.1 [Section name], page 99'' (Like in the Org
> Manual). I use this construction:
>
> #+BEGIN_EXAMPLE
>  * Chapter 1
>  ** Section 1.1
> :PROPERTIES:
> :CUSTOM_ID: section-1
> :END:
>  * Chapter 2
>  ** Section 2.1
> I want reference to Section 1.1 from here (See #section-1)
> #+END_EXAMPLE
>
> But as a result I get only the number of the section ''1.1'', not the
> ''Section 1.1 [Section name], page 99''.
> What options I need to use?
>
> Here
> (
> http://emacs.stackexchange.com/questions/18547/org-mode-latex-export-with-section-number-name-and-page-in-internal-links
> ),
> I was advised to use a Fancyref, but I have no idea how I may use it with
> Org-Mode syntax.
>
>
>


[O] limit orgmode re-use of header faces after 8 levels?

2015-12-03 Thread Xebar Saram
Hi all

I use a emacs theme (leuven-theme.el) that has nice faces for 8 levels of
org headers (ol1--ol8).
I was wondering if there was a way to make org not start over and use ol1
face when the 9th level is reached but rather skip to the ol2 face (or any
other level).
is that possible at all?

best

Z


Re: [O] org-reveal questions

2015-12-03 Thread Xebar Saram
Thx John (again sorry for late response)

the html block example dosent seem to work for me , i tried adding the
block before the first header and below the first header with no success.
does this go into the property drawer or literally as a html code block?

best

Z

On Mon, Nov 23, 2015 at 4:55 AM, John Hendy  wrote:

> On Sun, Nov 22, 2015 at 3:58 PM, Matt Price  wrote:
> >
> >
> > On Sun, Nov 22, 2015 at 11:47 AM, Xebar Saram  wrote:
> >>
> >> Thanks so much Eric
> >>
> >> this works great!
> >>
> >> but i found that i have to prepend the #+ATTR_HTML: :class left before
> >> every line. is there a way to make it work for the whole section (under
> the
> >> header) or for the whole document?
> >
> >
> > If you want it to work for the whole document, you probalby want to
> replace
> >
> > p.left {...}
> >
> > simply with p {}
> >
> > To do it for a whole section -- I think you mean a whole slide? -- I
> think
> > you would want
> >
> > .left p {...}
> >
> > in your css file, and to add a property to the containing header like so:
> >
> > :PROPERTIES:
> > :HTML_CONTAINER_CLASS: left
> > :END:
> >
> > You can add a property easily with C-c C-x p
> >
>
> I'm not sure if this is the same desired result, but I recently played
> around with org-reveal and wanted it left-aligned, ending up finding
> this:
> -
> http://stackoverflow.com/questions/21019476/how-can-i-get-left-justified-paragraphs-in-reveal-js
>
> So I added this before my first headline:
>
> #+begin_html
> .reveal .slides { text-align: left; }
> .reveal .slides .section>* { margin-left: 0; margin-right: 0; }
> #+end_html
>
> Seems to work for my whole exported document, though again, I'm not
> sure if that was exactly what you were trying to do (absolutely
> everything seems to be left aligned now, title slide included).
>
>
> John
>
>
> > HTH,
> > Matt
> >
>


[O] ox-latex

2015-12-03 Thread Raimund

Hi,

I'm a bloody beginner on org-mode so I still am searching my way through 
the oceans of informations about getting along with org-mode.


At the moment I am struggling with using latex-export and setting up (a) 
latex-class(es).


I found some great instructions on worg: Latex Export vor org-mode < 8.0 


 and it says to make some changes in .emacs like:


(require  'ox-latex)


If I do that and eval-buffer emacs it reads:



eval-buffer: Cannot open load file: ox-latex


Now I don't know if it means ox-latex doesn't exist at all ... however, 
I thought to look out for ox-latex in the web to download and push it in 
my .emacs.d ... hmmm ... even though there are bunches of 
ox-whatsoever-files I failed to find ox-latex ... so I think I'm 
thinking wrong ... :-(


Can anyone help me out here?




[O] [ANN] Radio lists update

2015-12-03 Thread Nicolas Goaziou
Hello,

I just pushed a patch which should make radio lists on par with radio
tables. In particular, it fixes a long standing issue with
`org-list-to-generic' which was not really usable, and thus side-stepped
in every back-end transformer (e.g. `org-list-to-latex').

Internally `org-list-parse-list' is obsoleted in favor of
`org-list-to-lisp' (much like `org-table-to-lisp'), which is a simpler
representation of lists. It is now easier to define programmatically
a plain list. See docstring for details.

Feedback welcome.


Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Matt Lundin
Christian Wittern  writes:

> On 2015-12-03 8:27, Matt Lundin wrote:
>> Given these complexities, it seems that if we went the zotero route we
>> could end up with a fairly large installation chain (firefox, zotero,
>> zotxt, plugin for zotero). And this would require installing items from
>> multiple, heterogeneous sources.
> I guess it depends on where you come from.  For those who already maintain
> the bibliography in Zotero this is not much of an extra load.

Yes, I think this is the key point. For those of us who maintain bib
databases within emacs, importing in zotero is problematic (overhead,
potential of data loss, etc.).

>> As a GNU/Linux user, I would find installing zotero and all the add-ons
>> messier and more cumbersome than installing pandoc and/or node-js (were
>> we to use citeproc-js) from the command line.
> Maybe the best situation would be to support both the pandoc and zotero
> toolchain as backends and let the user decide what to use. If the result is
> in both cases org-formated citations, that should not make it too difficult, 
> no?

That sounds right. Ideally, org-cite could support zotero *and* bibtex
users (i.e., gui and text based/command line) solutions.

Matt



[O] Fwd: LaTeX export with section number, name and page in internal links

2015-12-03 Thread Ilya Filippov
Thank's John, it is working, but I hope to use something like (setq org-export-latex-hyperref-format "\\ref{%s}") for hyperref customization. (I want join \\ref{%s} and \\pageref{%s} for org-export-latex-hyperref-format). If it will be work we may simple use [[#section-1]] to different templates for internal references, also like ''Section 1.1 [Section name], page 99''.  Пересылаемое сообщение03.12.2015, 16:31, "John Kitchin" : Try this. * Chapter 1** Section 1.1  \label{manual-section-1}    :PROPERTIES:    :CUSTOM_ID: section-1    :END:* Chapter 2** Section 2.1I want reference to Section 1.1 from here (See Section \ref{manual-section-1} on page \pageref{manual-section-1})   John---Professor John Kitchin Doherty Hall A207FDepartment of Chemical EngineeringCarnegie Mellon UniversityPittsburgh, PA 15213412-268-7803@johnkitchinhttp://kitchingroup.cheme.cmu.edu  On Thu, Dec 3, 2015 at 6:08 AM, Ilya  wrote:I export my Org-Mode notes with internal links to LaTeX and I want it tolook like this ''Section 1.1 [Section name], page 99'' (Like in the OrgManual). I use this construction:#+BEGIN_EXAMPLE * Chapter 1 ** Section 1.1    :PROPERTIES:    :CUSTOM_ID: section-1    :END: * Chapter 2 ** Section 2.1I want reference to Section 1.1 from here (See #section-1)#+END_EXAMPLEBut as a result I get only the number of the section ''1.1'', not the''Section 1.1 [Section name], page 99''.What options I need to use?Here(http://emacs.stackexchange.com/questions/18547/org-mode-latex-export-with-section-number-name-and-page-in-internal-links),I was advised to use a Fancyref, but I have no idea how I may use it withOrg-Mode syntax.   Завершение пересылаемого сообщения   - - - - - - - - - - -Ilya FilippovYugra State University  

Re: [O] ox-latex

2015-12-03 Thread Thomas S . Dye
Aloha Raimund,

Raimund  writes:

> Hi,
>
> I'm a bloody beginner on org-mode so I still am searching my way through 
> the oceans of informations about getting along with org-mode.
>
> At the moment I am struggling with using latex-export and setting up (a) 
> latex-class(es).
>
> I found some great instructions on worg: Latex Export vor org-mode < 8.0 
> 
>   and it says to make some changes in .emacs like:

These instructions are for the old exporter.  The new exporter made many
of the old instructions obsolete.

I presume you're using Org mode 8?
>
>> (require  'ox-latex)
>
> If I do that and eval-buffer emacs it reads:
>
>
>> eval-buffer: Cannot open load file: ox-latex
>
> Now I don't know if it means ox-latex doesn't exist at all ... however, 
> I thought to look out for ox-latex in the web to download and push it in 
> my .emacs.d ... hmmm ... even though there are bunches of 
> ox-whatsoever-files I failed to find ox-latex ... so I think I'm 
> thinking wrong ... :-(
>
> Can anyone help me out here?

The manual is a good starting place.

There are a couple of LaTeX export templates here:
http://orgmode.org/worg/exporters/index.html

There is one for annotated bibliographies and another for the Journal
PLOS One.  They should give examples of how the LaTeX exporter can be
customized.

hth,
Tom

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



Re: [O] problem with org-capture

2015-12-03 Thread Matt Lundin
Nicolas Goaziou  writes:

> Hello,
>
> Eric S Fraga  writes:
>
>> However, it only partially fixed.  The system does now prompt as it
>> should but the mini-buffer input only allows single words.  Hitting
>> space bar attempts to do completion.  I believe the input should be free
>> form?
>
> Fixed (again). Thank you.

Thanks Nicolas. One more issue. In the past, non-interactive escapes
were expanded when the capture buffer was displayed, which enabled me to
see what I had just clipped while entering the interactive data. Now
non-interactive escapes are expanded at the end of the capture process.

Take the following template:

(setq org-capture-templates
  '(("a" "Appointment" entry
 (file "~/org/inbox.org")
 "* %^{Appt}\n %^t%?\n %U\n %a\n\n %i")))

In the past, if I called this from the org-mode website with a region of
text selected, I would get a buffer that looked like this before
completing the interactive prompts:

--8<---cut here---start->8---
* 
 %^t%?
 [2015-12-03 Thu 11:02]
 [[http://orgmode.org/][Org mode for Emacs – Your Life in Plain Text]]

 Org mode is for keeping notes, maintaining TODO lists, planning
 projects, and authoring documents with a fast and effective plain-text
 system.
--8<---cut here---end--->8---

After the recent changes, the initial capture buffer looks like this:

--8<---cut here---start->8---
* 
 %^t%?
 %U
 %a

 %i
 --8<---cut here---end--->8---

Thanks,
Matt



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Matt Lundin
Hi Richard, 

Richard Lawrence  writes:

> Hi Matt and all,
>
> Matt Lundin  writes:
>
>> Given these complexities, it seems that if we went the zotero route we
>> could end up with a fairly large installation chain (firefox, zotero,
>> zotxt, plugin for zotero). And this would require installing items from
>> multiple, heterogeneous sources.
>
> Well, I would guess that many people who are interested in this already
> have Firefox installed, and after that, you just need to install two
> Firefox plugins: Zotero and zotxt.  Open a couple of links, give your
> permission, and that's it.
>
> If you're skeptical, I encourage you to try it:
>
> https://www.zotero.org/download/
> https://addons.mozilla.org/en-US/firefox/addon/zotxt/
>
> It's pretty easy.  And removing the plugins via about:addons is just as
> easy.

Thanks for the links. I'll try them out. But for bibtex users, wouldn't
there presumably have to be another zotero plugin that would allow for
live, automated importing of bibtex into zotero? (If anyone knows
whether such a plugin exists, please do let me know.)

> We have discussed this before, and in fact, I already started work along
> this route: see https://github.com/wyleyr/org-citeproc
>
> I stopped because people objected that distributing a Haskell program is
> too difficult.  Even if you can install pandoc-citeproc via your
> system's package manager, to build org-citeproc against it you need a
> complete Haskell build environment, which is (somewhat notoriously)
> difficult to work with, and too much to expect for the average person
> who just wants citation support in their Org documents.  Nor has anyone
> volunteered to take care of building and distributing a binary for every
> platform we'd want to support (including, I assume, Windows and OS
> X...).

Thanks for your work on this. I would agree that compile a haskell
program makes this a nonstarter for many users.

A thought experiment... Do we need a fork of pandoc-citeproc? Or could
we rather write an emacs-lisp wrapper that would feed citation data and
a bibliography to pandoc and receive a string containing citations
formatted in org syntax (one of pandoc's outputs). This could be done
via an export filter, with all the necessary manipulation being done on
the emacs/org side of things.

Pandoc is available in several linux distributions (in addition to the
deb file released by the project) and installers are available OS
Windows, so most people wouldn't need to compile it.

> The nice thing about Firefox (and these days, Emacs) is that it's a sort
> of cross-platform package manager.  If the citation processing
> dependencies are just Firefox plugins, they'll be much more accessible
> to a much wider group of people without a lot of work on our part.  So,
> that's why I'd prefer depending on Zotero to depending on something like
> org-citeproc or citeproc-node.

Javascript interpreters/engines are widely available for all platforms
if we create a wrapper script around citeproc-js. Node itself is also
easily available for most platforms. But we wouldn't need to set it up
as a node server à la citeproc-node.

Thanks so much for all your work on this. I'm happy to help out wherever
I can.

Best,
Matt



[O] [PATCH] [BUG] org-table.el: Fix `org-table-eval-formula'

2015-12-03 Thread Piotr Gajewski
Hello,

I have found a little bug that results in formulas of a table being
computed incorrectly. When there are tabs in front of a data row (instead of 
spaces),
the list of values extracted from the row contains superfluous items.
All genuine values are shifted to the right. Consequently, when references
to fields are resolved, a formula gets the wrong values.

Example:

    |---+--+--+---++-|
    | ! |  sum |  | a |  b |   c |
    |---+--+--+---++-|
    | # | 1011 | 1000 | 1 | 10 | 100 |
    |---+--+--+---++-|
    #+TBLFM: $2=$a+$b+$c

The list of extracted values is ("\t" "#" "" "1000" "1" "10" "100").
Should be ("#" "" "1000" "1" "10" "100").

Piotr Gajewski

>From 1c943f1ea833b9cdaa172fd96cf6bf6d86c4d86e Mon Sep 17 00:00:00 2001
From: Piotr Gajewski 
Date: Thu, 3 Dec 2015 16:46:32 +0100
Subject: [PATCH] org-table.el: Fix `org-table-eval-formula'

* lisp/org-table.el (org-table-eval-formula): Fix regexp used for
  extracting values from fields of a table.

TINYCHANGE
---
 lisp/org-table.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 17424be..9ed8b6e 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2723,7 +2723,7 @@ not overwrite the stored one."
   (while (> ndown 0)
 (setq fields (org-split-string
       (buffer-substring-no-properties (point-at-bol) (point-at-eol))
-          " *| *"))
+          "[ \t]*|[ \t]*"))
 ;; replace fields with duration values if relevant
 (if duration
     (setq fields
-- 
1.9.5.msysgit.0



  


Re: [O] [PATCH] org-protocol: Allow optional port specification

2015-12-03 Thread Aaron Ecay
Hi Sacha,

Thanks for your patch.

2015ko abenudak 2an, Sacha Chua-ek idatzi zuen:
> 
> I was trying to get org-protocol to work on KDE Plasma 5.4.2. I set up
> my ~/.kde/share/kde4/services/org.protocol, but the standard
> org-protocol sample syntax:
> 
>org-protocol://store-link://URL/TITLE
> 
> resulted in the error:
> 
>Malformed URL
>Port field was empty; source was "..."; scheme = "org-protocol",
>host = "store-link", path = "// ..."
> 
> Modifying my Javascript to create links of the form:
> 
>org-protocol://store-link:0//URL/TITLE

I think that the original format is an ad-hoc manipulation of the url
format which tries to pack two PROTOCOL:// sequences into one string.
Rather than adding a bogus port which just doubles down on this, a
better solution IMO would be to make org-protocol links valid urls in
another way, using the query string format:

org-protocol://store-link?url=[...]=[...]

This corresponds better to the url format: the protocol is org-protocol,
which determines emacs shall handle this link.  The location is
store-link, which indicates a handler function which is an element of
‘org-protocol-protocol-alist’, and the query string gives the arguments
to this function.

Does that make sense?

Aaron

-- 
Aaron Ecay



Re: [O] Featur request org-table-iterate-table-subtree

2015-12-03 Thread Aaron Ecay
Hi Charlie,

2015ko azaroak 27an, Charles Millar-ek idatzi zuen:
> 
> Any thoughts? Any body?

Well, FWIW...

#+tblname’s should be unique within a document.  Your problems stem from
that, and your proposed solutions all work around it in some way.  I
can’t think of any better way to address your desired usage than the
ones you listed (and would caution you that using narrowing to defeat
the uniqueness assumption, while perhaps adequate for the short term, is
fragile and could break at any time).

-- 
Aaron Ecay



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Thomas S . Dye
Aloha all,

At the risk of introducing noise, I've long wondered if tex4ht might
help with citation processing in Org mode?  IIUC, tex4ht uses the
device-independent dvi file produced by TeX to make html, odt, and other
formats. With an Org mode that relied on tex4ht, users would use BibTeX
bibliographies, and Org mode documents with citations would be processed
by LaTeX and a tex4ht script that would yield the correctly formatted
in-text citations and bibliography in the desired output format.  Org mode
would then parse this output and plug in the pieces at the right places.

This approach, if feasible, would please LaTeX users happy with BibTeX
and wary of translating bibliographic databases to Zotero.  It would
only require a working LaTeX installation, and so would avoid the
Haskell hassle, etc.  And, it would make use of BibTex/BibLaTeX,
arguably the best bibliography software out there.

I'm in way over my head here and won't be surprised to learn that this
idea is a bad one.  Given the wide-ranging nature of this discussion, I
thought this might be the time to suggest it.

All the best,
Tom

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



Re: [O] refontifying links

2015-12-03 Thread Aaron Ecay
Hi John,

2015ko azaroak 25an, John Kitchin-ek idatzi zuen:
> 
> Hi,
> 
> I am trying to find a nice way to change the color of some links. So far
> the only solution I have found is to create a new face, and use
> highlight-regexp to do it.
> 
> I would prefer to just use font-lock to change the color of the link. so
> far I have not found a way to do that.
> 
> I have found the org-activate-plain-links, and org-font-lock-keywords
> and the org-font-lock-hook, but so far have not figured out how to
> overwrite the org-link face.
> 
> I am kind of looking for a general approach to fontifying here, but the
> specific problem I want to solve is to be able to write:
> 
> [[color:Orangered1][Some text I want colored]] and have it show in my
> buffer in Orangered1.
> 
> Any thoughts?

Links are currently defined by an open function and an export function.
It might be interesting if org added a third function to this set, a
fontification function.

OTOH we would have to consider if links are the best place to add this
functionality.  The work you have done on org-ref and other projects
(which I greatly admire!) (ab)uses links as an analogue of HTML’s span
element: a way to encapsulate and attach attributes to a
sub-paragraph-sized chunk of text whose semantics are somewhat
amorphous.  Your example here pushes that further, using the link for
pure formatting: it no longer “links” to anything at all (and thus
probably should not have an associated open function nor be click-active
in the buffer).

I think “Spans” are something org should support, but not by co-opting
links to do it.  We ought to either make new syntax, or change the name
of “links” to “spans” and say the former are a special case of the
latter (preserving backwards compatibility of existing documents to the
extent possible of course, but also doing our best to free ourselves of
link-specific implementation details like percent-escaping).

FWIW, HTH,
Aaron

PS I think if we had spans 2-3 years ago, then you would have used them
to implement org-ref, and that code would already be in core.  I think
the same would be true of annotations, for which we’ve recently had a
well-responded thread with several code contribtions, including from you
IIRC.  On the other hand I don’t think we want org to become like Latex,
where almost all documents require a complicated web of third-party
dependencies to “work” at all.  It’s a delicate balance...

-- 
Aaron Ecay



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Matt Lundin
Matt Lundin  writes:
>
> If we chose node, we could try to package the wrapper script so it can
> be installed via npm. Then the installation process would be:
>
> a) install node
> b) npm install citeproc-js-wrapper [or whatever]

I forgot. They would need to install npm as well.

Matt



Re: [O] problem with org-capture

2015-12-03 Thread Mike McLean
At the risk of piling on, I too am having problems with Org Capture
templates that haven't changed in a long time. The sample below used to
function like:

   1. I would call it from org-capture, select the “af” template
   2. I would get prompted for a date from file+datetree+prompt and I would
   select the date
   3. I would get prompted for the week number from the
   ~%^{prompt|%<%Y-W%V>}~ clause. This would default to the current week in
   ISO format (2015-W49). I would change it or not (usually not)
   4. The ISO week entered from that prompt would get substituted into the
   AR_DATE property in multiple places.

The two big differences with release_8.3.2-381-gb7ee96 are

   1. The substitution for %Y and %V does not happen before the prompt in
   step 3; I get a default value of [%<%Y-W%V>]
   2. Even if I manually type the ISO week string (2015-W09) it no longer
   gets substituted into the AR_DATE properties via %\1

I maintain some of my more complex capture templates in standalone files
and reference the file in org-capture-templates

(setq org-capture-templates (quote (
("a" "Templates for Agile Results")

("af" "Friday Afternoon Weekly Close /
Reflection"
 entry
 (file+datetree+prompt
"~/Documents/OrgMaster/org/Agile_Results.org")
 (file
"~/.init/emacs/org-capture-templates/friday.reflection.org_template")
 :jump-to-captured t :immediate-finish
t

The
file "~/.init/emacs/org-capture-templates/friday.reflection.org_template"
contains:

#+begin_example
  ,* Friday Reflection %^{prompt|%<%Y-W%V>}
  :PROPERTIES:
  :AR_DATE:  %\1
  :VISIBILITY: all
  :END:
  %u
  ,** Three Things Going Well
  + %?
  +
  +
  ,** Three Things to Improve
  +
  +
  +
  ,** Review Outcomes and Results Compared to the Monday Vision
 :Weekly_Win_Review:
  :PROPERTIES:
  :AR_DATE:  %\1
  :VISIBILITY: all
  :END:
  %<[%Y-%m-%d %a %H:%M]>
  - What got in my way? How might I do it differently? Review each of my
target Monday
Vision Outcomes; What did I get done or did not get done?
 +
 +
 +
  ,** Delta File: What will I change immediately or when my role or
influence changes :NOTE:Delta_File:
  %<[%Y-%m-%d %a %H:%M]>

#+end_example




On Thu, Dec 3, 2015 at 12:05 PM, Matt Lundin  wrote:

> Nicolas Goaziou  writes:
>
> > Hello,
> >
> > Eric S Fraga  writes:
> >
> >> However, it only partially fixed.  The system does now prompt as it
> >> should but the mini-buffer input only allows single words.  Hitting
> >> space bar attempts to do completion.  I believe the input should be free
> >> form?
> >
> > Fixed (again). Thank you.
>
> Thanks Nicolas. One more issue. In the past, non-interactive escapes
> were expanded when the capture buffer was displayed, which enabled me to
> see what I had just clipped while entering the interactive data. Now
> non-interactive escapes are expanded at the end of the capture process.
>
> Take the following template:
>
> (setq org-capture-templates
>   '(("a" "Appointment" entry
>  (file "~/org/inbox.org")
>  "* %^{Appt}\n %^t%?\n %U\n %a\n\n %i")))
>
> In the past, if I called this from the org-mode website with a region of
> text selected, I would get a buffer that looked like this before
> completing the interactive prompts:
>
> --8<---cut here---start->8---
> *
>  %^t%?
>  [2015-12-03 Thu 11:02]
>  [[http://orgmode.org/][Org mode for Emacs – Your Life in Plain Text]]
>
>  Org mode is for keeping notes, maintaining TODO lists, planning
>  projects, and authoring documents with a fast and effective plain-text
>  system.
> --8<---cut here---end--->8---
>
> After the recent changes, the initial capture buffer looks like this:
>
> --8<---cut here---start->8---
> *
>  %^t%?
>  %U
>  %a
>
>  %i
>  --8<---cut here---end--->8---
>
> Thanks,
> Matt
>
>


Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Rasmus
Hi,

Thomas S. Dye  writes:

> At the risk of introducing noise, I've long wondered if tex4ht might
> help with citation processing in Org mode?  IIUC, tex4ht uses the
> device-independent dvi file produced by TeX to make html, odt, and other
> formats. With an Org mode that relied on tex4ht, users would use BibTeX
> bibliographies, and Org mode documents with citations would be processed
> by LaTeX and a tex4ht script that would yield the correctly formatted
> in-text citations and bibliography in the desired output format.  Org mode
> would then parse this output and plug in the pieces at the right places.

tex4ht is beautiful piece of software.  For odt it creates perfect
citations and reference list.

I was thinking about utilizing biber for this purpose at some point.  I
forgot why I stopped looking at it...

It might be possible and if it is, it would be very nice, as biber and
biblatex are arguably the better tools.

> I'm in way over my head here and won't be surprised to learn that this
> idea is a bad one.  Given the wide-ranging nature of this discussion, I
> thought this might be the time to suggest it.

The last time I had to produce a "word document" with citations I used
tex4ht to generate the end-of-file bibliography and bibtex.el + hacks for
creating in-text citations.

Here’s snippets from my Makefile:

  paper_.docx: paper_.odm
  soffice --headless --convert-to odt paper_.odm; \
  soffice --headless --convert-to docx:"MS Word 2007 XML" paper_.odt

  paper_.odm: all_refs.odt paper.odt

  paper.odt: paper.org lit.bib
  emacs --batch --no-init-file --load paper-config/org-conf.el 
paper.org --funcall org-odt-export-to-odt; \
  $(call LO-TBLWIDTH, paper.odt)

  all_refs.odt: all_refs.tex paper.pdf
  biber paper.bcf --output_format=bibtex -O cited.bib; \
  latexmk -dvi all_refs.tex; \
  mk4ht oolatex all_refs.tex; \
  abiword --to=odt all_refs.odt

With all_refs.tex:

 \documentclass{article}
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
 \usepackage[style=authoryear]{biblatex}
 \addbibresource{cited.bib}
 \begin{document}
 \nocite{*}
 \printbibliography[heading=none]
 \end{document}

Rasmus

-- 
May contains speling mistake





Re: [O] problem with org-capture

2015-12-03 Thread Nicolas Goaziou
Hello,

Mike McLean  writes:

> At the risk of piling on, I too am having problems with Org Capture
> templates that haven't changed in a long time. The sample below used to
> function like:
>
>1. I would call it from org-capture, select the “af” template
>2. I would get prompted for a date from file+datetree+prompt and I would
>select the date
>3. I would get prompted for the week number from the
>~%^{prompt|%<%Y-W%V>}~ clause. This would default to the current week in
>ISO format (2015-W49). I would change it or not (usually not)
>4. The ISO week entered from that prompt would get substituted into the
>AR_DATE property in multiple places.
>
> The two big differences with release_8.3.2-381-gb7ee96 are
>
>1. The substitution for %Y and %V does not happen before the prompt in
>step 3; I get a default value of [%<%Y-W%V>]
>2. Even if I manually type the ISO week string (2015-W09) it no longer
>gets substituted into the AR_DATE properties via %\1

I pushed a commit which should fix these issues and the others mentioned
in the thread. Thank you.

Let me know if something is still wrong.

Regards,

-- 
Nicolas Goaziou



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Matt Lundin
Hi Richard, 

Thanks so much for this very helpful explanation!

Richard Lawrence  writes:

> Hi Matt and all,
>
> Matt Lundin  writes:
>
>> But for bibtex users, wouldn't there presumably have to be another
>> zotero plugin that would allow for live, automated importing of bibtex
>> into zotero? (If anyone knows whether such a plugin exists, please do
>> let me know.)
>
> Well, my hope is that this could be added to zotxt without much effort,
> so we could still just depend on Zotero and zotxt.  The translation
> capability already exists in Zotero; it's just a matter of exposing it
> as an API, and I imagine that Erik would happily accept a patch to zotxt
> that does so.

That sounds like a great plan. 

> Yes, you're basically describing the approach that I eventually realized
> org-citeproc should take: use the full capabilities of Pandoc to render
> citations and bibliography in Org format, then re-parse these on the Org
> side.  I did start to work on this, though I didn't finish and I'm not
> sure if I pushed it to the public repo.
>
> If we want to use pandoc-citeproc directly, instead of wrapping it
> with something like org-citeproc, what we'd need to do is be able to
> translate an Org document (or at least the citations within it) both
> to and from pandoc-compatible JSON, since pandoc-citeproc reads and
> writes in that format.

I'm probably missing something, but would we necessarily need to convert
to pandoc's JSON format? A quick and dirty approach might be to use an
org export filter function to grab citations and insert some temporary
unique ids in the export string as placeholders for each citation. Then
we could create a temporary buffer that looks like this:

--8<---cut here---start->8---
unique_id1 [@some_citation, pp. 1-10]

unique_id2 [@another_citation, p. 23]
--8<---cut here---end--->8---

We could then run a shell command on the buffer (i.e., "pandoc
--filter=pandoc-citeproc --csl=/path/to/csl
--bibligoraphy=/path/to/bibdata -t org"), resulting in formatted
citations for each id. With some simple mapping, we could use a filter
function to insert the citations in the export string/buffer.

Obviously, JSON would be way more elegant. But would still need to run
the results through pandoc to get strings of formatted org output.

> I am not opposed to this idea -- indeed, I kind of like it, which is why
> I started work on org-citeproc in the first place.  Still, it would be a
> non-trivial amount of work to develop this solution even to the point
> that it can do what Zotero and zotxt can do right now.

Thanks for this explanation. I vote for you going full speed ahead with
the zotero/zotxt plans. I'd be happy to build on the work you've already
done to try to make pandoc-citeproc work.

>> Javascript interpreters/engines are widely available for all platforms
>> if we create a wrapper script around citeproc-js. Node itself is also
>> easily available for most platforms. But we wouldn't need to set it up
>> as a node server à la citeproc-node.
>
> My concern here is with the wrapper script.  Yes, it's pretty easy to
> install a javascript interpreter; but getting from there to the point
> where you have a fully-working toolchain for processing citations from
> Org mode is the problem.  What I think we should avoid is a process that
> looks like:
>
> 1) Install node (or whatever interpreter)
> 2) Install citeproc-js and the wrapper script
> 3) Make sure the wrapper script is available as an executable that can
> be called from Emacs
> 4) ...

If we chose node, we could try to package the wrapper script so it can
be installed via npm. Then the installation process would be:

a) install node
b) npm install citeproc-js-wrapper [or whatever]

> It's a question of where to focus the limited resources we've got. My
> impression is that going with the combination of Zotero and zotxt will
> represent the least amount of effort to get citations working on
> non-LaTeX backends, for both Org developers and users I fully
> support that. But until more people have time to work on this, it
> seems to me that Zotero and zotxt represent the most practical path
> forward.

That makes a lot of sense. Thanks for all the work you've already put
into this. I'm happy to help out wherever I can.

Matt



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread John Kitchin
I clearly had some super important academic work to do today, so instead
I played around with citations ;)

I am not yet convinced a citation processor will get us where we want
because of the complexity of the external dependencies, and the
potential/probable need for us to define new CSL files for different
backends, or at a minimum for org-formatted citations and
bibliographies. Hacking bst files is no fun, and it doesn't look like
CSL files are much better! Plus you have to find them and install them
somehow.

I wanted to get a sense for how well I could manipulate citation and
bibliography format from org-ref with a bibtex database. The answer is
it is pretty easy, not perfect, but pretty good, and could certainly be
made better with dedicated effort. You can see how here, and some
discussion about its limitations:

http://kitchingroup.cheme.cmu.edu/blog/2015/12/03/Exporting-numbered-citations-in-html-with-unsorted-numbered-bibliography/

I am pointing this out because I think the approach I used could allow
for plugins for different database backends, different ways to get the
replacements, etc... you could substitute org-ref links for the citation
syntax at some point with no real loss of generality. org-ref could
insert the new syntax as soon as it is available in a main org branch.
Some code will have to be rewritten to get the key under point, but that
probably won't be too hard.

We could provide a solution like this for some backends, using bibtex as
the database, for pretty immediate use. Then other more advanced
solutions could come along that would likely be superior in output
quality if they use real citation processors, but only if there are CSLs
for different backends (if I understand how they work). These would be
optional, and only needed if higher quality and flexibility in output
was required.

What do you think?




Matt Lundin writes:

> Richard Lawrence  writes:
>
>> Eric S Fraga  writes:
>>
>>> 2. How would I use this starting from an org-bibtex database (which I
>>>typically export to bibtex)?
>>
>> I can envision a couple of possibilities.  One simple option would be to
>> switch to managing your reference database with Zotero, by exporting
>> from org-bibtex to .bib, and then importing the .bib into Zotero.
>>
>> I don't want to force that on anyone, though.  Another option is to
>> use the org-bibtex to produce .bib at export time, and then use Zotero
>> to read the .bib and process citations when exporting to non-LaTeX formats.
>>
>> This second option is more work, as I don't know of any API for loading
>> items into Zotero's citation processor in BibTeX format.  But given that
>> Zotero is able to import .bib files, I imagine this API would not be too
>> much work to build.
>
> Given these complexities, it seems that if we went the zotero route we
> could end up with a fairly large installation chain (firefox, zotero,
> zotxt, plugin for zotero). And this would require installing items from
> multiple, heterogeneous sources.
>
> I wonder at this point whether pandoc-citeproc (packaged with pandoc)
> would actually be the simpler route. It can parse bibtex files directly
> and (as a filter within pandoc) can output formatted citations in org
> format.
>
> As a GNU/Linux user, I would find installing zotero and all the add-ons
> messier and more cumbersome than installing pandoc and/or node-js (were
> we to use citeproc-js) from the command line.
>
> Best,
> Matt
>
> Footnotes:

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



Re: [O] refontifying links

2015-12-03 Thread John Kitchin

>
> Links are currently defined by an open function and an export function.
> It might be interesting if org added a third function to this set, a
> fontification function.
>
> OTOH we would have to consider if links are the best place to add this
> functionality.  The work you have done on org-ref and other projects
> (which I greatly admire!) (ab)uses links as an analogue of HTML’s span
> element: a way to encapsulate and attach attributes to a
> sub-paragraph-sized chunk of text whose semantics are somewhat
> amorphous.  Your example here pushes that further, using the link for
> pure formatting: it no longer “links” to anything at all (and thus
> probably should not have an associated open function nor be click-active
> in the buffer).

Thanks! I have had a lot fun stretching the intended uses of the mighty
link ;) you might click on it to change its color, or remove the link,
maybe all red text is glossary word that you can click on to get a
definition... I think there is a lot of potential advantage in changing
the color of a link. org-ref does already, to differentiate cite, ref
and label links, but the faces are static.

> I think “Spans” are something org should support, but not by co-opting
> links to do it.  We ought to either make new syntax, or change the name
> of “links” to “spans” and say the former are a special case of the
> latter (preserving backwards compatibility of existing documents to the
> extent possible of course, but also doing our best to free ourselves of
> link-specific implementation details like percent-escaping).

Spans sounds like a generalized link syntax to me. Something like here:
http://kitchingroup.cheme.cmu.edu/blog/2015/02/05/Extending-the-org-mode-link-syntax-with-attributes/

In the end I am not sure it makes much difference if we call it a link
or span. I have often wanted something different than a link, but that
was "linky", and still an org-element and more like the example above.
It would make a lot of things easier, like citations, annotations,
etc...

Wait till you see the (ab)use of the new citation syntax which looks
more like a span than anything else ;)

>
> FWIW, HTH,
> Aaron
>
> PS I think if we had spans 2-3 years ago, then you would have used them
> to implement org-ref, and that code would already be in core.  I think
> the same would be true of annotations, for which we’ve recently had a
> well-responded thread with several code contribtions, including from you
> IIRC.  On the other hand I don’t think we want org to become like Latex,
> where almost all documents require a complicated web of third-party
> dependencies to “work” at all.  It’s a delicate balance...

Agreed. The documents are still plain text in the end, and readable if
you do it right.


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



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Rasmus
John Kitchin  writes:

> I clearly had some super important academic work to do today, so instead
> I played around with citations ;)
>
> I am not yet convinced a citation processor will get us where we want
> because of the complexity of the external dependencies, and the
> potential/probable need for us to define new CSL files for different
> backends, or at a minimum for org-formatted citations and
> bibliographies. Hacking bst files is no fun, and it doesn't look like
> CSL files are much better! Plus you have to find them and install them
> somehow.
>
> I wanted to get a sense for how well I could manipulate citation and
> bibliography format from org-ref with a bibtex database. The answer is
> it is pretty easy, not perfect, but pretty good, and could certainly be
> made better with dedicated effort. You can see how here, and some
> discussion about its limitations:
>
> http://kitchingroup.cheme.cmu.edu/blog/2015/12/03/Exporting-numbered-citations-in-html-with-unsorted-numbered-bibliography/
>
> I am pointing this out because I think the approach I used could allow
> for plugins for different database backends, different ways to get the
> replacements, etc... you could substitute org-ref links for the citation
> syntax at some point with no real loss of generality. org-ref could
> insert the new syntax as soon as it is available in a main org branch.
> Some code will have to be rewritten to get the key under point, but that
> probably won't be too hard.
>
> We could provide a solution like this for some backends, using bibtex as
> the database, for pretty immediate use. Then other more advanced
> solutions could come along that would likely be superior in output
> quality if they use real citation processors, but only if there are CSLs
> for different backends (if I understand how they work). These would be
> optional, and only needed if higher quality and flexibility in output
> was required.
>
> What do you think?

My guess is that it is orders of magnitudes harder with author (year) and
footnotes and whatnot.  But bibtex.el helps in some regards (indeed in an
ancestor to this thread we discussed whether bibtex.el + reftex.el could
be used).  Then comes the formatting and sorting of the bibliography, also
when using different languages (Marcin talks about this) or types of
publications (bibtex.el lists 27 when you switch the dialect to
biblatex)...

As a small example comes out of your example which has mistakes such as
"17()".

The fact that the documentation of biblatex-chicago (a biblatex *style*)
is 149 pages might also serve as a warning.

Note, I use a similar system myself when exporting citations outside of
latex (lookup stuff from bibtex and cross-fingers), but fitted to
author-year.  It’s certainly doable when you know your fixed needs, but it
is harder to convince yourself it’s a good general solution.

It would be nice if you could prove me wrong.

Rasmus

-- 
What will be next?




Re: [O] problem with org-capture

2015-12-03 Thread Charles Millar



On 12/03/2015 05:38 PM, Nicolas Goaziou wrote:

Hello,

Mike McLean  writes:


At the risk of piling on, I too am having problems with Org Capture
templates that haven't changed in a long time. The sample below used to
function like:

1. I would call it from org-capture, select the “af” template
2. I would get prompted for a date from file+datetree+prompt and I would
select the date
3. I would get prompted for the week number from the
~%^{prompt|%<%Y-W%V>}~ clause. This would default to the current week in
ISO format (2015-W49). I would change it or not (usually not)
4. The ISO week entered from that prompt would get substituted into the
AR_DATE property in multiple places.

The two big differences with release_8.3.2-381-gb7ee96 are

1. The substitution for %Y and %V does not happen before the prompt in
step 3; I get a default value of [%<%Y-W%V>]
2. Even if I manually type the ISO week string (2015-W09) it no longer
gets substituted into the AR_DATE properties via %\1

I pushed a commit which should fix these issues and the others mentioned
in the thread. Thank you.

Let me know if something is still wrong.

Regards,


Works for me. Thank you, Nicholas.

Regards,

Charlie Millar




Re: [O] problem with org-capture

2015-12-03 Thread Mike McLean
Great

Everything seems to(*) work again; thank you.

Mike

(*) I have another small issue that I think is ~helm~ related based on the
initial backtrace, I'll do full checks (tomorrow or weekend) with -Q and
report back if I think it is Org related. Gut feeling right no: not.


On Thu, Dec 3, 2015 at 5:38 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> Mike McLean  writes:
>
> > At the risk of piling on, I too am having problems with Org Capture
> > templates that haven't changed in a long time. The sample below used to
> > function like:
> >
> >1. I would call it from org-capture, select the “af” template
> >2. I would get prompted for a date from file+datetree+prompt and I
> would
> >select the date
> >3. I would get prompted for the week number from the
> >~%^{prompt|%<%Y-W%V>}~ clause. This would default to the current week
> in
> >ISO format (2015-W49). I would change it or not (usually not)
> >4. The ISO week entered from that prompt would get substituted into
> the
> >AR_DATE property in multiple places.
> >
> > The two big differences with release_8.3.2-381-gb7ee96 are
> >
> >1. The substitution for %Y and %V does not happen before the prompt in
> >step 3; I get a default value of [%<%Y-W%V>]
> >2. Even if I manually type the ISO week string (2015-W09) it no longer
> >gets substituted into the AR_DATE properties via %\1
>
> I pushed a commit which should fix these issues and the others mentioned
> in the thread. Thank you.
>
> Let me know if something is still wrong.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Error "No :file header argument given" - minor bug?

2015-12-03 Thread Aaron Ecay
Hi Loris,

It’s difficult to say without more context, but I think you might not
need :results graphics on the code block that you are #+call-ing.
:results graphics is intended for situations where Org should arrange
for the plot to be written, whereas you have undertaken this yourself.

-- 
Aaron Ecay



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread John Kitchin
>> What do you think?
>
> My guess is that it is orders of magnitudes harder with author (year) and
> footnotes and whatnot.

footnotes... The only place I can see this is in org/odt export. In org
I can see it ok with the approach I described. For odt, I guess it would
be about the same, if you know the markup code to insert for a footnote.
Other formats are continuous pages, so the footnotes would end up at the
end of the document.

> But bibtex.el helps in some regards (indeed in an
> ancestor to this thread we discussed whether bibtex.el + reftex.el could
> be used).  Then comes the formatting and sorting of the bibliography, also
> when using different languages (Marcin talks about this) or types of
> publications (bibtex.el lists 27 when you switch the dialect to
> biblatex)...

CSL does not currently support multiple languages according to
http://citationstyles.org/styles/, although a fork of zotero is supposed
to support it. CSL also does not support composite citations, e.g. that
are common in chemistry journals. It doesn't support journal
abbreviations.

If a reference type is not listed in the CSL, it also will not be
supported by CSL I suppose.

I also suppose the CSL must be backend specific to output formats
appropriate to org, html, LaTeX, markdown, etc... for any particular
style.

The point is there is no single solution now, or ever that will easily
handle all reference databases, all reference types, to any output, in
arbitrary format/style.

We should not try to support all of these things. We could support a
small number of things that could be improved or increased in the
future.

> As a small example comes out of your example which has mistakes such as
> "17()".

this is from missing information in the bibtex file, and the single
format string in reftex. This kind of error is easy to fix. More
difficult changes are to the authors (e.g. initials, et al after 3
authors, etc...), journal abbreviations, and for different types of
references.

For a blogpost I consider that acceptable. For a publication/proposal
not so much. For that, I would use LaTeX export which wouldn't have that
issue. A key point here is I don't think you can have it both ways. A
bibtex file with LaTeX markup of equations cannot be used to make an
html/org/markdown/etc.. bibliography that looks right without handling
the LateX markup in it and converting it some way to the right format. A
bibtex file that uses strings to switch between full journal names and
abbreviated journal names will be challenging for any system other than
bibtex. This is not special to bibtex, it is general to any reference
database I think. CSL does not save us from this.

No doubt there are many corner cases that could be problematic. I don't
have the feeling there would be more than using CSL though. Good luck
getting the CSL to make the in text citations clickable hyperlinks with
tooltips of the citation in html. I would rather learn to use elisp for
this than CSL for that sole purpose.

> The fact that the documentation of biblatex-chicago (a biblatex *style*)
> is 149 pages might also serve as a warning.

The CSL for this is only 651 lines
(https://github.com/citation-style-language/styles/blob/master/chicago-author-date.csl).
Its either very concise, or not complete ;)

There are plenty of warning signs ;) If you want perfect
biblatex-chicago, I think the answer is use biblatex. The issue as I see
it is one of balancing something that mostly works, and is improveable
and something that currently doesn't exist for org-mode for something
other than latex.

> Note, I use a similar system myself when exporting citations outside of
> latex (lookup stuff from bibtex and cross-fingers), but fitted to
> author-year.  It’s certainly doable when you know your fixed needs, but it
> is harder to convince yourself it’s a good general solution.
>
> It would be nice if you could prove me wrong.

I cannot. I don't think you are wrong. The only time-tested, publication
quality solutions for citations in my opinion right now are bib(la)tex, MS
Word/reference manager, and "by hand". Even these get "edited" in their
final print versions by journals.

I think we can provide some fixed solutions for non-LaTeX exports that
will be pretty good. At least until a proven external cite-processor
solution exists.

As a finishing thought:

Just imagine if this CSL snippet 
(https://github.com/citation-style-language/styles/blob/master/acs-nano.csl):


  


  

  

was really this much more readable sexp form :)

(citation (:collapse "citation-number")
  (sort ()
   (key (:variable "citation-number")))
  (layout (:delimiter "," :vertical-align "sup")
  (text (:variable "citation-number"

It might start making more sense to think of a lisp based citation
processor. It might even address some limitations of bib(la)tex.

Now, about those cross-references and labels...

>
> Rasmus

--
Professor John 

Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Matt Lundin
John Kitchin  writes:
>
> I am not yet convinced a citation processor will get us where we want
> because of the complexity of the external dependencies, and the
> potential/probable need for us to define new CSL files for different
> backends, or at a minimum for org-formatted citations and
> bibliographies. Hacking bst files is no fun, and it doesn't look like
> CSL files are much better! Plus you have to find them and install them
> somehow.

As I understand it, we would not need to hack the CSL files to get org
markup. With a good processor, such as citeproc-js, it should be trivial
to modify the output format.[fn:1]

What CSL implementations do offer is the complexity to handle all the
nuances of multiple citation styles, languages, etc. (e.g., something
like Chicago Manual of Style footnotes). My suspicion is that it would
take years to code something in emacs-lisp that offers all of the
functionality of CSL processors.

> http://kitchingroup.cheme.cmu.edu/blog/2015/12/03/Exporting-numbered-citations-in-html-with-unsorted-numbered-bibliography/
>
> I am pointing this out because I think the approach I used could allow
> for plugins for different database backends, different ways to get the
> replacements, etc... you could substitute org-ref links for the
> citation syntax at some point with no real loss of generality. org-ref
> could insert the new syntax as soon as it is available in a main org
> branch. Some code will have to be rewritten to get the key under
> point, but that probably won't be too hard.

Thanks for sharing this. I use something like this myself for *basic*
Chicago Manual of Style formatting when I can't rely on
biblatex-chicago. Might I ask: What is org-ref syntax as opposed to
citation syntax?

>  Then other more advanced solutions could come along that would likely
> be superior in output quality if they use real citation processors,
> but only if there are CSLs for different backends (if I understand how
> they work).

I don't think modifying CSL styles would be necessary. A huge number
already exist.[fn:2] I think all we would need to do is to convert the
final CSL output to org syntax, which pandoc can already do and which
citeproc-js could do with minor additions.

Best,
Matt

Footnotes:

[fn:1]
See 
https://bitbucket.org/fbennett/citeproc-js/src/tip/src/formats.js?fileviewer=file-view-default

[fn:2] https://github.com/citation-style-language/styles



Re: [O] Citation processing via Zotero + zotxt

2015-12-03 Thread Richard Lawrence
Hi Matt and all,

Matt Lundin  writes:

> But for bibtex users, wouldn't there presumably have to be another
> zotero plugin that would allow for live, automated importing of bibtex
> into zotero? (If anyone knows whether such a plugin exists, please do
> let me know.)

Well, my hope is that this could be added to zotxt without much effort,
so we could still just depend on Zotero and zotxt.  The translation
capability already exists in Zotero; it's just a matter of exposing it
as an API, and I imagine that Erik would happily accept a patch to zotxt
that does so.

> A thought experiment... Do we need a fork of pandoc-citeproc?

(The name "org-citeproc" might be a bit misleading: it's not a fork of
pandoc-citeproc, but a small wrapper script that takes care of
marshalling data into and out of Pandoc, in a format that's easy to
generate and read from Emacs lisp.  But because it's written in Haskell,
building it still requires a full Haskell build chain, and distributing
it is non-trivial.)

> Or could we rather write an emacs-lisp wrapper that would feed
> citation data and a bibliography to pandoc and receive a string
> containing citations formatted in org syntax (one of pandoc's
> outputs). This could be done via an export filter, with all the
> necessary manipulation being done on the emacs/org side of things.

Yes, you're basically describing the approach that I eventually realized
org-citeproc should take: use the full capabilities of Pandoc to render
citations and bibliography in Org format, then re-parse these on the Org
side.  I did start to work on this, though I didn't finish and I'm not
sure if I pushed it to the public repo.

If we want to use pandoc-citeproc directly, instead of wrapping it with
something like org-citeproc, what we'd need to do is be able to
translate an Org document (or at least the citations within it) both to
and from pandoc-compatible JSON, since pandoc-citeproc reads and writes
in that format.  This can certainly be done in Emacs Lisp, and maybe it
would be worth doing, because it would mean that we'd gain a nice
serialization format for Org documents.

I am not opposed to this idea -- indeed, I kind of like it, which is why
I started work on org-citeproc in the first place.  Still, it would be a
non-trivial amount of work to develop this solution even to the point
that it can do what Zotero and zotxt can do right now.

> Javascript interpreters/engines are widely available for all platforms
> if we create a wrapper script around citeproc-js. Node itself is also
> easily available for most platforms. But we wouldn't need to set it up
> as a node server à la citeproc-node.

My concern here is with the wrapper script.  Yes, it's pretty easy to
install a javascript interpreter; but getting from there to the point
where you have a fully-working toolchain for processing citations from
Org mode is the problem.  What I think we should avoid is a process that
looks like:

1) Install node (or whatever interpreter)
2) Install citeproc-js and the wrapper script
3) Make sure the wrapper script is available as an executable that can
be called from Emacs
4) ...

Steps 2 and 3 are a bit much to ask people to do manually, and we don't
have the option of doing them through the system package manager.  They
could of course be automated by packaging up citeproc-js and a wrapper
script into a node package.  But again, that requires some work that no
one so far has volunteered to do; and anyway, it doesn't get away from
the worry about having to install packages/plugins from heterogeneous
sources.  (Also, we'd have to develop the wrapper script, and our own
way of translating items stored in BibTeX format into a format
compatible with citeproc-js.  This means duplicating efforts that have
already been put into both pandoc-citeproc and Zotero.)

It's a question of where to focus the limited resources we've got.  My
impression is that going with the combination of Zotero and zotxt will
represent the least amount of effort to get citations working on
non-LaTeX backends, for both Org developers and users.  I understand
that it won't be ideal for everyone, and there is time enough later on
to develop an alternative toolchain if that would better suit the needs
of people who don't want to depend on a GUI, etc.  I fully support that.
But until more people have time to work on this, it seems to me that
Zotero and zotxt represent the most practical path forward.
 
Best,
Richard



Re: [O] fixmee / syntax-ppss

2015-12-03 Thread Aaron Ecay
Hi Jeremy,

2015ko abenudak 1an, Jeremy Hankins-ek idatzi zuen:
> 
> I recently started using org-mode, so forgive me if this is covered
> somewhere that I missed.  But I'm trying to use fixmee.el with org-mode;
> it works by finding "fixme" tags in comments, but it's not finding
> anything in my orgmode files.  I've traced the problem to the fact that
> syntax-ppss fails to accurately report that it's in a comment.

I would not expect this to work: because of the way that org-mode
comments work, I don’t see a way for them to be fit into the syntax
table machinery.  Something with syntaxtic fontification
(info "(elisp) Syntactic Font Lock") might be able to be put together,
but to what end I’m not sure.

Org mode provides built-in functionality to create “TODO” annotations
(called inline tasks).  These might server your purpose better than what
you are trying to do with fixmee.  You need to put the following line in
your emacs init file:

(require 'org-inlinetask)

You may also want:

(setq org-inlinetask-default-state "TODO")

Then C-c C-x t in an org file will insert an inline task.  You can get a
view of the TODO headlines in a buffer (including but not limited to
inlinetasks) by pressing C-c / t.  (This is just the tip of the iceberg
wrt listing/sorting/filtering org headlines.)

-- 
Aaron Ecay