Re: contact management in emacs

2021-03-07 Thread Alan Schmitt
Hello,

On 2021-03-08 01:13, Jean Louis  writes:

> I am recommending that you start using PostgreSQL database. I can
> guide you. My software is not so finished for public, but I can guide
> you personally and you will get stable system that lasts for years.

Thank you for the suggestion, but for the moment I think I will
experiment with text-based solutions.

Best,

Alan


signature.asc
Description: PGP signature


Re: [PATCH] org-mac-link: Disable Evernote capture by default

2021-02-28 Thread Alan Schmitt
On 2021-02-27 17:58, Kyle Meyer  writes:

>> Any chance of getting this merged in? It's a pretty nasty one for mac users.
>
> Thanks for the patch.  Ideally someone that uses macOS would provide a
> review.  Based on the history of the file, I've cc'd two people that may
> be willing/able to do so.

Sorry, but I’ve switched to Linux a couple years ago.

Best,

Alan


signature.asc
Description: PGP signature


Re: contact management in emacs

2021-02-28 Thread Alan Schmitt
Hello,

Thanks a lot for all the replies. I migrated from bbdb to ebdb a long
time ago, and I may go back following your suggestions.

Thanks again,

Alan


signature.asc
Description: PGP signature


contact management in emacs

2021-02-27 Thread Alan Schmitt
Hello,

This may be slightly off-topic for the list, but as I’m considering
org-contacts for my question, I hope it will be of interest here.

I would like to migrate my contact management to emacs, as I’m already
using it for email. My requirements are the following ones:
- address completion in emacs email clients (I currently use notmuch)
- support for multiple email addresses and custom fields
- creation of org links to contacts
- export to vcard format for synchronization to my mobile phone (using
vdirsyncer)
- keep the data under version control

I have looked at two tools, which almost seem fit for the job.
- ebdb does most of this, with the exception of vcard export (it seems
to be worked on, https://github.com/girzel/ebdb/issues/60), and I’m not
sure using version control on an sqlite file is a good idea.
- org-contacts also seem to have all the required features, including
vcard export (and if not sufficient there is
https://github.com/novoid/org-contacts2vcard). I was worried it was
unmaintained when looking at the copyright line, but I see in
https://code.orgmode.org/bzg/org-mode/commits/master/contrib/lisp/org-contacts.el
that there are recent commits to the file.

Do you manage your contacts in emacs? And if so, what tools or workflow
do you recommend?

Best,

Alan


signature.asc
Description: PGP signature


Re: org-agenda for a day different than today

2021-02-21 Thread Alan Schmitt
On 2021-02-21 01:23, Kyle Meyer  writes:

> Okay, thanks for checking.  Added a basic test and applied (3a522ad53).

Great, thanks a lot!

Best,

Alan


signature.asc
Description: PGP signature


Re: org-agenda for a day different than today

2021-02-18 Thread Alan Schmitt
Hello,

On 2021-02-18 00:32, Kyle Meyer  writes:

>> Looking at the code, I don’t see how it could cause trouble elsewhere
>> (but understanding agenda code is always tricky…)
>
> Yeah, I too think it's safe.  If you have the time, I'd appreciate if
> you could skim through the above threads and see if there are any
> minimal examples or test cases.  If so, it be good to verify that they
> still work with the patch.

I tested the first thread (where two agendas are displayed) and it still
works.

The second thread was about the beginning of the week wrongly set in a
custom file.

Best,

Alan


signature.asc
Description: PGP signature


Re: refreshing files for agenda building

2021-02-17 Thread Alan Schmitt
On 2021-02-17 22:20, Peter Hardy  writes:

> I occasionally run in to this as well, using webdav to sync my org
> files. Currently using org-revert-all-org-buffers to revert all Org
> buffers, followed by org-agenda-redo (bound to r in the agenda view) to
> rebuild the agenda.

Thanks a lot, this is most useful!

Best,

Alan


signature.asc
Description: PGP signature


refreshing files for agenda building

2021-02-17 Thread Alan Schmitt
Hello,

I have some files that are changed on disk by an external process, and
it seems that calling org-agenda does not see the changes until I visit
the file in emacs. The buffers are loaded and they are auto-reverted,
but for some reason (some cache somewhere?) their contents are not
up-to-date with what is produced by org-agenda.

Is there a command to refresh such files? Should I programatically visit
them? (And if so, do you have a suggestion as to which command I should
use, I could not find one?)

Thanks,

Alan


signature.asc
Description: PGP signature


Re: org-agenda for a day different than today

2021-02-17 Thread Alan Schmitt
Hello Kyle,

On 2021-02-16 23:01, Kyle Meyer  writes:

>> By the way, I’m surprised by the code of this function, as it is defined
>> as:
>>
>> (defun org-agenda-goto-date (span)
>>   "Jump to DATE in agenda."
>>   …
>> )
>>
>> and "span" is never mentioned in the function. Am I missing something?
>
> That does look wrong.  Among other changes, 93fcfe4d3 (org-agenda.el:
> Fix org-agenda-goto-date' again, 2012-08-30) switched the DATE argument
> to SPAN, moving the org-read-date call out of the interactive form.
> From that commit alone, I don't have a good guess at why and am
> wondering if the above change was an unfinished thought that came along
> with the other changes.
>
> Here are two threads from around that time that may be related, though I
> haven't reviewed either of them:
>
>  https://orgmode.org/list/blu0-smtp912fc379760ee431d3d68ebb...@phx.gbl/T/#u
>  https://orgmode.org/list/blu0-smtp950e9387b34fa390c4fd9cbb...@phx.gbl/T/#u
>
> Moving org-read-date back to the interactive form would allow lisp
> callers to pass in the date, though perhaps it'd bring back some
> misbehavior discussed in the above threads.

I’ve tried this change here and it works great, thanks a lot.

Looking at the code, I don’t see how it could cause trouble elsewhere
(but understanding agenda code is always tricky…)

Should I file a bug regarding this?

Best,

Alan


signature.asc
Description: PGP signature


org-agenda for a day different than today

2021-02-16 Thread Alan Schmitt
Hello,

I’ve been reading the documentation around org-agenda, and I cannot find
a way to call it to get an agenda for a day different than today. I’ve
found org-agenda-goto-date, but I don’t know how to call it from
emacs-lisp with the target date.

By the way, I’m surprised by the code of this function, as it is defined
as:

(defun org-agenda-goto-date (span)
  "Jump to DATE in agenda."
  …
)

and "span" is never mentioned in the function. Am I missing something?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: programatically generate an agenda

2021-02-15 Thread Alan Schmitt
On 2021-02-14 12:12, John Kitchin  writes:

> If it is possible to set up what you want in an entry in
> org-agenda-custom-commands, then you can call it in a program like
>
> #+BEGIN_SRC emacs-lisp
> (org-agenda nil "w" nil)
> #+END_SRC

This is what I ended up doing.

- set up an agenda view with only the current day and the events:

#+begin_src emacs-lisp
  ("d" "Daily schedule"
   ((agenda ""
((org-agenda-span 'day)
 (org-agenda-use-time-grid nil)
 (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))
 
#+end_src

- use it with org-agenda write, massaging the results a little

#+begin_src emacs-lisp
(defun as/get-daily-agenda ()
  "Return the agenda for the day as a string."
  (interactive)
  (let ((file (make-temp-file "daily-agenda" nil ".txt")))
(org-agenda nil "d" nil)
(org-agenda-write file nil nil "*Org Agenda(d)*")
(kill-buffer)
(with-temp-buffer
  (insert-file-contents file)
  (goto-char (point-min))
  (kill-line 2)
  (while (re-search-forward "^  " nil t)
(replace-match "- " nil nil))
  (buffer-string
#+end_src

Thanks again for your suggestion.

Best,

Alan


signature.asc
Description: PGP signature


Re: programatically generate an agenda

2021-02-15 Thread Alan Schmitt
On 2021-02-14 12:12, John Kitchin  writes:

> If it is possible to set up what you want in an entry in
> org-agenda-custom-commands, then you can call it in a program like
>
> #+BEGIN_SRC emacs-lisp
> (org-agenda nil "w" nil)
> #+END_SRC
>
> In that snippet, I have the key in an org-agenda-custom-commands set to
> "w".
>
> that generates an agenda buffer for me, which I assume you can then use
> the org-agenda-write command on.

Thank you for the suggestion, this is most useful.

Best,

Alan


signature.asc
Description: PGP signature


programatically generate an agenda

2021-02-13 Thread Alan Schmitt
Hello,

In my quest/endeavor/struggle to generate an org file for what I want to
do during the day, I’m trying to leverage the power of org-agenda (that
does a lot of what I want to do) to create an org file. I learned of
org-agenda-write, which I could use to write to file what I want then
include it in my org file, but for that I need to create the correct
org-agenda buffer. What is the elisp way of doing it?

I tried using org-agenda-list, but it only seems to restore the current
agenda view. For instance, (org-agenda-list nil nil 1) generates an
agenda for the week (which is my default), even though I pass a SPAN
argument of 1. I also don’t know how to set the org-agenda-skip steps
before calling that function…

Thanks a lot for any suggestion on how to do this.

Best,

Alan


signature.asc
Description: PGP signature


Re: generate an org file for today's appointments

2020-12-04 Thread Alan Schmitt
Hello,

On 2020-12-03 20:15, TRS-80  writes:

> I am also not someone who uses one of these "daily journal" workflows,
> so I can't help but wonder how you link these daily notes back to the
> underlying project that generated the event on the agenda in the first
> place.  Becasue in my mind, I would jump from the agenda to the
> underlying project or task and be making my notes in there directly.
> Those linking considerations, in my mind anyway, would really dictate
> the rest of the workflow.

This is a very good point. My appointments do not currently have links
to the related projects (the "database of trust" is the calendar one,
which is caldav outside of emacs… maybe I should change that, but I need
to synchronize my calendar with my phone). So I currently add the links
manually. I'll have to think about this.

Best,

Alan


signature.asc
Description: PGP signature


Re: generate an org file for today's appointments

2020-12-04 Thread Alan Schmitt
Hello,

On 2020-12-03 12:01, Mikhail Skorzhisnkii  writes:

> I'd suggest to use function "org-agenda-write". You can export 
> your agenda views to org files too! However, the formatting will 
> be different. Probably something like:
>
> * Event A
>   SCHEDULED: <2020-12-03 Thu 10:00-12:00>
> * Event B
>   SCHEDULED: <2020-12-03 Thu 10:00-11:00>
> * Event C
>   SCHEDULED: <2020-12-03 Thu 14:00-15:30>
> * Event D
>   SCHEDULED: <2020-12-03 Thu 20:00-21:30>
>
> I personally do this to generate separate org-file and then 
> generate ics file based on that and upload this ics file through 
> WebDAV to my calendar server.

This is most useful, thanks a lot! This should be more than sufficient
for my needs.

Best,

Alan


signature.asc
Description: PGP signature


generate an org file for today's appointments

2020-12-02 Thread Alan Schmitt
Hello,

I have my calendars converted to org files (using ical2orgpy), and as I
include them as agenda files, I have this nice view in org-agenda:

   9:10.. now - - - - - - - - - - - - - - - - - - - - - - - - -
  AlanWork:   10:00-12:00 Event A -
  Chris:  10:00-11:00 Event B -
  10:00.. 
  12:00.. 
  AlanWork:   14:00-15:30 Event C -
  14:00.. 
  16:00.. 
  18:00.. 
  Alan:   20:00-21:30 Event D -

Is there a way to piggy-back on all the work that org-agenda already did
to generate something like:

** 10:00 Event A
** 10:00 Event B
** 14:00 Event C
** 20:00 Event D

This would then be inserted in my daily journal file.

I guess the alternative is using org-element to extract the information
from the calendars in org format, but it seems to me org-agenda already
did all the hard work.

Do you have suggestions to do this?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: Bring up a screen giving option to open a series of orgmode files

2020-11-27 Thread Alan Schmitt
Hello,

On 2020-11-27 05:40, Jean Louis  writes:

> Now we have `evince' PDF viewer that can open PDF I think by page
> number and by query but it cannot do the equivalent
> `evince-store-link' so user has to think about the file name and page
> number and so on.

For that I recommend pdf-tools (great pdf viewer for emacs, supporting
annotations and synctex, https://github.com/politza/pdf-tools) and
org-pdftools (provides org links for it,
https://github.com/fuxialexander/org-pdftools). There is also the
org-noter option (https://github.com/weirdNox/org-noter) to link
external annotations to pdfs.

> We have browsers that each of them think for themselves. Each can
> store bookmarks but hardly provide such to external programs.

For that org-protocol was mentioned. There is eww as well to browse
within emacs (and thus have links).

> File managers do not provide `file-manager-store-link' but they should
> as it would be very useful to have programs integrate with each other
> that hyperdocument systems can be built.

dired is a nice file manager. I agree having something at the level of
the OS would be great, but emacs is a pretty good OS ;)

Best,

Alan


signature.asc
Description: PGP signature


Re: storing a link to a task from an agenda view

2020-11-22 Thread Alan Schmitt
On 2020-11-22 13:36, Ihor Radchenko  writes:

>> Do you have suggestions on how to store such a link from an agenda view?
>> It can either end up in ~org-stored-links~ or captured in a variable.
>
> (org-store-link nil) -> (org-store-link nil 'interactive)
>
> Or you can just save the return value of (org-store-link nil)

Thanks a lot, that worked great!

I've written a small post about it (which is a bit org-roam specific)
here:
https://org-roam.discourse.group/t/daily-task-management-with-org-agenda-and-org-roam-dailies/989

Best,

Alan


signature.asc
Description: PGP signature


storing a link to a task from an agenda view

2020-11-21 Thread Alan Schmitt
Hello,

I'm trying to store a link to a task while the cursor is on it in the
agenda view. I tried ~org-store-link~ on it, but it tells me there is no
method to do so. So I looked at some of the org-agenda code to find a
way to get to the underlying task, and I tried this:

#+begin_src emacs-lisp
(defun as/mk-agenda-link ()
  (interactive)
  (let* ((marker (or (org-get-at-bol 'org-marker)
 (org-agenda-error)))
 (buffer (marker-buffer marker))
 (pos (marker-position marker)))
(with-current-buffer buffer
  (save-excursion
(goto-char pos)
(org-store-link nil)

#+end_src

but it does not store anything. (I have to put the ~nil~ at the
~org-store-link~ code otherwise I have an error, and looking at some of
the ~org-capture~ code, I saw it there.)

Do you have suggestions on how to store such a link from an agenda view?
It can either end up in ~org-stored-links~ or captured in a variable.

Thanks,

Alan


signature.asc
Description: PGP signature


Re: add linked files to agenda files

2020-11-16 Thread Alan Schmitt
Hello Nick,

On 2020-11-16 16:33, Nick Dokos  writes:

> Just guessing at this point, I would imagine you'd want something like
> this:
>
> --8<---cut here---start->8---
> (defun path-from-link (link)
>(org-element-property :path link))
>
> (setq org-agenda-files (with-current-buffer
>  (find-file-noselect "master.org")
>  (org-element-map (org-element-parse-buffer)
>   '(link)
>   #'path-from-link)))
> --8<---cut here---end--->8---

Thanks a lot, this is most useful! I did not think it could be this
simple.

Best,

Alan


signature.asc
Description: PGP signature


add linked files to agenda files

2020-11-14 Thread Alan Schmitt
Hello,

I'm experimenting with a setup where each project is its own org file,
and where I have a master file linking to active projects. How can I
configure org to add every linked file of that master file to the
org-agenda-files?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: recursive checkbox counting

2020-10-02 Thread Alan Schmitt
On 2020-10-02 09:40, Nick Dokos  writes:

> Not sure whether this will work (or whether it will help in your case):
>
> https://emacs.stackexchange.com/questions/60710/is-there-any-way-of-getting-overview-statistics-for-all-checkboxes-in-a-given-or/60747#60747
>
> There are some links to other questions on Emacs SE that might (or
> might not) be helpful.

Thank you for the suggestion. I think I might stay with nested lists at
the moment, as it works for me.

Best,

Alan


signature.asc
Description: PGP signature


Re: recursive checkbox counting

2020-10-02 Thread Alan Schmitt
On 2020-10-01 14:24, torys.ander...@gmail.com (Tory S. Anderson) writes:

> The way I've made this work is with the following property:
>
>:COOKIE_DATA: ALL
>
> But I suppose I haven't tried if that's fully recursive.

Thank you for the suggestion. I gave it a try, and unfortunately it does
not work.

Best,

Alan


signature.asc
Description: PGP signature


Re: recursive checkbox counting

2020-10-01 Thread Alan Schmitt
Hello Eric,

On 2020-10-01 12:26, Eric S Fraga  writes:

> On Thursday,  1 Oct 2020 at 08:44, Alan Schmitt wrote:
>> I'm trying to recursively count checkboxes, with intermediate counting:
>
> I think you can only do this for lists of lists.  In your case, you
> would have the 2020 headline but all subheadings would be list elements
> with the cookie.  You would keep the recursive property in the top
> headline.

Thank you for the suggestion, it works indeed.

> But, for the record, I would like to be able to do what you want as
> well.  It just doesn't seem possible currently.

I agree.

Best,

Alan


signature.asc
Description: PGP signature


Re: Reciprocal links between items

2020-10-01 Thread Alan Schmitt
On 2020-10-01 10:53, "Victor A. Stoichita"  writes:

> I wonder whether org-mode has a way to indicate reciprocal A↔B 
> relations between two items. If item A points to item B, then 
> automatically B also points to A.  Accordingly, when the relation 
> is removed on A, it is also removed from B. 
>
> I’m in the process of bringing my notes from Zotero to Org. 
> What I’m after is something like Zotero’s "related" feature. 
> Is there a way to represent that kind of relation in org?

You might want to have a look at org-roam, that implements such
backlinks.

https://github.com/org-roam/org-roam

Best,

Alan


signature.asc
Description: PGP signature


recursive checkbox counting

2020-10-01 Thread Alan Schmitt
Hello,

I'm trying to recursively count checkboxes, with intermediate counting:

* [0/0] 2020
:PROPERTIES:
:COOKIE_DATA: checkbox recursive
:END:
** [1/1] Week 39
- [X] [[file:2020-09-29.org][§:2020-09-29 (Tuesday)]]
** [2/2] Week 36
- [X] [[file:2020-09-08.org][§:2020-09-08 (Tuesday)]]
- [X] [[file:2020-09-07.org][§:2020-09-07 (Monday)]]

Unfortunately I don't know what property I need to set on the top-level
node to recursively count everything. I would like to see [3/3] there.
Is there a way to do it?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: org-tables with monetary amounts

2020-09-25 Thread Alan Schmitt
Hello,

On 2020-09-25 13:20, Daniele Nicolodi  writes:

> I use beancoount (another text-based accounting software, very similar
> to ledger) for accounting purposes and I am very happy with it. I use
> org-mode for planning and management tasks or simply to compare quotes,
> things better handled in a a spreadsheet table.

I use ledger, and I wrote a small page about how I use org with it:
http://alan.petitepomme.net/tips/ledger_and_org.html

> I think it is time to have a look at how org-tables can be extended to
> handle monetary quantities.

Yes! I'm currently writing a tutorial about envelope budgeting (using
org-mode, of course), and it would help to have my table examples with
monetary quantities.

Best,

Alan


signature.asc
Description: PGP signature


Re: multiple EXPORT_LATEX_HEADER lines

2020-06-16 Thread Alan Schmitt
Hello Eric,

On 2020-06-15 10:20, Eric S Fraga  writes:

> On Saturday, 13 Jun 2020 at 17:02, Alan Schmitt wrote:
>> This is the crux of the issue: there does not seem to be any way to
>> generate a multi-line header. And this causes problems with LaTeX.
>
> Is the problem solvable in LaTeX?  Does \makeatletter expect to be on a
> single line?  As I said before, I've seldom played with @ variables or
> functions in LaTeX.  However, I had the impression that LaTeX was quite
> robust with respect to whitespace & newlines.

You're right, it should work in a single line. I don't what I did that
made it fail, and I no longer can reproduce it. Sorry for the noise.

Best,

Alan


signature.asc
Description: PGP signature


Re: multiple EXPORT_LATEX_HEADER lines

2020-06-13 Thread Alan Schmitt
Hello,

On 2020-06-12 16:01, Eric S Fraga  writes:

> The snippet from the OP will collate all three LaTeX header lines into a
> single line on export, which is expected in terms of org's
> behaviour.  This appears to cause problems with LaTeX, which is maybe
> expected or not; I don't know what LaTeX expects when working in @
> letter mode as I've seldom (if ever?) had to redefine @ variables.

This is the crux of the issue: there does not seem to be any way to
generate a multi-line header. And this causes problems with LaTeX.

There are two workarounds for this that I know of: put the latex in some
other file and \input it, or use a dedicated file and use multiple
#+LATEX_HEADER. I ended up doing it that way.

Thanks,

Alan


signature.asc
Description: PGP signature


Re: multiple EXPORT_LATEX_HEADER lines

2020-06-12 Thread Alan Schmitt
Hello Dominik,

On 2020-06-12 10:31, Dominik Schrempf  writes:

> are you looking for, e.g.,
>
> #+latex_header: \addbibresource{bibliography.bib}
> #+latex_header_extra: do some stuff
> #+latex_header_extra: and even more
>
> I don't use the EXPORT keyword at the beginning, I am not sure if it is 
> needed.

To be more precise, I want to emulate
#+LATEX_HEADER: \makeatletter
#+LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
#+LATEX_HEADER+: \makeatother

(as a full file export, which yields 3 separate lines), for a subtree
export, were the property :EXPORT_LATEX_HEADER: is used.

Best,

Alan


signature.asc
Description: PGP signature


multiple EXPORT_LATEX_HEADER lines

2020-06-12 Thread Alan Schmitt
Hello,

I would like to have a multi-line export header when exporting a
subtree. I tried this:

:EXPORT_LATEX_HEADER: \makeatletter
:EXPORT_LATEX_HEADER+: \@setplength{refvpos}{\useplength{toaddrvpos}}
:EXPORT_LATEX_HEADER+: \makeatother

The problem is that it's exported on a single line, and as such it does
not work. Is there a way to have the multiple properties exported as
multiple lines, or to specify in the property there is a line break?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: links are not parsed in keyword context

2020-04-13 Thread Alan Schmitt
Hello Nicolas,

On 2020-04-13 11:19, Nicolas Goaziou  writes:

> This is a feature. With a few exception, keyword value is not parsed,
> i.e., Org does not need to understand what happens in there.

Thank you for the explanation.

>> Alternatively, should I suggest org-ref uses an approach similar to
>> the one in ~org-return~?
>
> I think Org Ref can parse the value of the keyword (a string), instead.
> There is, for example, `org-element-parse-secondary-string'.

I mentioned your suggestion in the issue on the org-ref repo
(https://github.com/jkitchin/org-ref/issues/718). Thanks again.

Best,

Alan




links are not parsed in keyword context

2020-04-13 Thread Alan Schmitt
Hello,

If you consider the following line in an org file

#+begin_src org
#+FOO: http://alan.petitepomme.net/
#+end_src

then calling ~org-element-context~ returns

#+begin_src emacs-lisp
(keyword
 (:key "FOO"
  :value "http://alan.petitepomme.net/;
  :begin 1
  :end 38
  :post-blank 1
  :post-affiliated 1
  :parent nil))
#+end_src

If the same link is in the body of the org file, one gets

#+begin_src emacs-lisp
(link
 (:type "http"
  :path "//alan.petitepomme.net/"
  :format plain
  :raw-link "http://alan.petitepomme.net/;
  :application nil
  :search-option nil
  :begin 38
  :end 66
  :contents-begin nil
  :contents-end nil
  :post-blank 0
  :parent (paragraph
   (:begin 38
:end 68
:contents-begin 38
:contents-end 67
:post-blank 1
:post-affiliated 38
:parent nil
#+end_src

The link can still be opened in both cases using ~org-open-at-point~,
but it is a problem for org-ref that relies on the second format to
extract the link information (see
https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L2045,
where the link is set to ~nil~ because there is no ~:path~ property).

I see that orgmode uses a workaround in ~org-return~ when
~org-return-follows-link~ is set to true, to detect if there is a link
using a regexp
(https://code.orgmode.org/bzg/org-mode/src/maint/lisp/org.el#L18106):
#+begin_src emacs-link
((and org-return-follows-link
  (or (org-in-regexp org-ts-regexp-both nil t)
  (org-in-regexp org-tsr-regexp-both nil  t)
  (org-in-regexp org-any-link-re nil t)))
(call-interactively #'org-open-at-point))
#+end_src

Could is be possible to parse a link in keyword context? Alternatively,
should I suggest org-ref uses an approach similar to the one in ~org-return~?

Thanks,

Alan




Re: org-ref: xxx-add-bibtex-entry with an org-capture like interface

2020-04-10 Thread Alan Schmitt
Hello,

On 2020-04-09 15:43, John Kitchin  writes:

> This is basically what doi-add-bibtex-entry does. There isn't one
> function that does arxiv too, but there is arxiv-add-bibtex-entry. Those
> are both commands in org-ref. These don't pop up a buffer for approval,
> that is something you would have to build yourself.
>
> There are many workflows people want, the one above works for me when I
> am writing, and just want to add entries with minimal disruption. I
> usually polish the entries later if needed. I can see a slower, approach
> like you describe too.

There is also the biblio-lookup command (from biblio.el,
https://github.com/cpitclaudel/biblio.el) that might be useful for this.

Best,

Alan




Re: problem when linking to headlines?

2020-02-26 Thread Alan Schmitt
On 2020-02-26 16:38, Nicolas Goaziou  writes:

> Oops. Fixed. Thank you!

Thanks a lot for the quick fix!

Best,

Alan



problem when linking to headlines?

2020-02-26 Thread Alan Schmitt
Hello,

I have these two files:

link1.org:

* Test

link2.org:

[[file:link1.org::*Test][Test]]

When I click on the first link, I get this in a dired buffer (there is
no error).

  /home/schmitta/tmp:
  wildcard link1.org::*Test
  zsh:1: no matches found: link1.org::*Test

I'm using Org Mode 9.4, and this issue started occurring recently after
I upgraded org.

Is this a consequence of the recent change on file links? How can I
debug which link handler is used?

Thanks,

Alan



Re: org link to OCaml comment

2020-02-20 Thread Alan Schmitt
On 2020-02-19 18:49, Nicolas Goaziou  writes:

> Alan Schmitt  writes:
>
>> I understand, and I can be careful (and easily fix the link if needed).
>> If `org-store-link' could do it for me, that would be perfect.
>
> I pushed some changes to `org-store-link' in order to fix this.  Please
> report if there is anything wrong.

Thanks a lot!

Best,

Alan



Re: org link to OCaml comment

2020-02-07 Thread Alan Schmitt
On 2020-02-07 15:33, Nicolas Goaziou  writes:

> *shivers* Please never suggest again url-encoding links in Org! ;) We
> only got out of this hell recently. I don't want to dive in again.

Sorry, I should have put a smiley there.

> There is some specific syntax in links. More specifically, the
> following are meaningful:
>
> - a star at the beginning of the link (or search option)
> - a hash at the beginning of the link
> - forward slashes around the link
> - parenthesis around the link
>
> I think that `org-store-link' should be careful about it and prevent
> these pathological cases if necessary.
>
> In any other situation, however, I think the user is responsible for
> not using these specific constructs.
>
> WDYT?

I understand, and I can be careful (and easily fix the link if needed).
If `org-store-link' could do it for me, that would be perfect.

Thanks again for the explanation.

Best,

Alan



Re: org link to OCaml comment

2020-02-06 Thread Alan Schmitt
Hello Nicolas,

On 2020-02-06 18:10, Nicolas Goaziou  writes:

> Link enclosed within parens meant coderef links, i.e., the syntax is
> reserved. You can probably remove the closing parenthesis to avoid this.

Thank you for the explanation. Is there a way to either escape the
parentheses (maybe url-encode them), or to automatically not include the
closing one as you suggest when creating the link?

(I'm asking someone who does not know org-mode to document his code, use
links to point to the relevant code. I'm afraid it will be tricky to ask
him to tweak the links that org create so that they work.)

Thanks again,

Alan



Re: org link to OCaml comment

2020-02-06 Thread Alan Schmitt
Hello John,

On 2020-02-06 09:58, John Kitchin  writes:

> I think you need to do it like this:
>
> #+BEGIN_SRC test.ml -r
>
> (* Object projection functions  *) (ref:opf)
>
>
> #+END_SRC
>
> [[file:2020-02-05.org::(opf)]]
>
> The -r in the header removes the coderef when you run it.

Thank you for the suggestion. Unfortunately I need to link to an
external ml file. I can change it, but I need to get a syntactically
valid file.

I tried putting the ref part inside the comment and unfortunately it
does not work.

The strange part is that linking to arbitrary code works. It seems that
the OCaml comment syntax is problematic here.

Best,

Alan



org link to OCaml comment

2020-02-06 Thread Alan Schmitt
Hello,

I'm trying to create an org link to a specific place in an OCaml file. I
thought I would use some specific target in an OCaml comment, but it
does not work.

Here is an OCaml comment:

(* Object projection functions *)

Here is the link create by `org-store-link` (I put it here with no
description)

[[file:~/work/jsexplain/jsexplain/jsref/JsSyntax.ml::(* Object projection 
functions *)]]

When I try to follow this link, I get the following error (note the
missing parentheses):

org-open-file: No match for coderef: * Object projection functions *

and I am moved to the top of the file (instead of where I stored the
link).

Is there an escape problem here? And if so, is it a bug of
`org-store-link` of not doing the escaping?

Thanks,

Alan



Re: debugging why a latex preview fails

2020-01-29 Thread Alan Schmitt
Hello Fabrice and Eric,

Thanks a lot for your suggestions. I ended up edebugging
'org-create-formula-image' to have a look at the created tex file (that
is indeed cleaned up after the generation). The file was fine, but
dvipng failed on it (with errors like "raw PostScriptdvipng warning:
PostScript environment contains DVI commands dvipng warning: No image
output from inclusion of raw PostScript"). I switched to imagemagick to
do the conversion and everything now works.

The warnings were in the *Org Preview Latex Output* buffer, which
I realized afterwards. However it's still tricky to debug because
intermediate files are erased, so I could not initially run the command
by hand to try to tweak it.

Thanks again,

Alan



debugging why a latex preview fails

2020-01-28 Thread Alan Schmitt
Hello,

I'm trying to add some diagrams in a note, and I want to use latex
preview for that. Unfortunately the result is not what I expect: I do
see an image, but there seem to be errors in the latex processing. How
can I see what latex is produced to find where the issue is?

To be precise, my note has this:

\begin{tikzcd}
A \arrow[r, "u"] \arrow[d, "i"] & B \arrow[d, "f"] \\
C \arrow[r, "v"] & D
\end{tikzcd}

and I have put this in my configuration files:

  (add-to-list 'org-latex-packages-alist '("" "tikz-cd" t nil))

The following latex file compiles correctly:

\documentclass{article}

\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
A \arrow[r, "u"] \arrow[d, "i"] & B \arrow[d, "f"] \\
C \arrow[r, "v"] & D
\end{tikzcd}
\end{document}

So I expect I misconfigured something. Is my org-latex-packages-alist
setting wrong?

Thanks,

Alan



Re: automatic completion of file tags

2020-01-26 Thread Alan Schmitt
Hi Bastien,

On 2020-01-26 18:04, Bastien  writes:

> I'm not entirely sure: you want to tag all headline in a file with
> multiple pre-defined tags?

There are no headlines in the file (it's a small note). I want to tag
the file itself (or its content). It's mostly to help with full-text
search (I prefix my tags with '#' so they don't occur otherwise). I
think the notion of file tag does not really exist in org mode, but as
there is a '+#FILETAGS:' cookie (?), I was wondering if there was
infrastructure to help me enter the tags there.

> With `org-loop-over-headlines-in-active-region' set to `t', you can
> tag multiple headlines by selecting a region with the headlines you
> want to tag, then C-c C-q to tag them one after another.
>
> You cannot add multiple tags for each headline this way, though.
>
> I would go for defining a temporary local tag like "replaceme" to
> tag multiple (all) headline in the file, then simpy search/replace
> occurrences of "replaceme" with your:list:of:tags

Thank you. This is not what I want to do, but it's nice to know how to
do this.

Alan



automatic completion of file tags

2020-01-23 Thread Alan Schmitt
Hello,

I'm playing with an implementation of Zettelkasten using deft and org
files, and I want to tag each note with some tags taken from a list (I'm
using the ~#FILETAGS:~ line for that at the moment). Is there a builtin
org way of doing it (have a list of tags defined somewhere and tag a
whole file with them using some completion mechanism, as for headlines),
or do I need to roll up my own?

Thanks,

Alan



Re: [O] moving an entry from one date tree to another

2019-09-28 Thread Alan Schmitt

On 2019-09-28 04:55, Adam Porter  writes:


See unpackaged/org-refile-to-datetree from:

https://github.com/alphapapa/unpackaged.el#refile-to-datetree-file-using-earliestlatest-timestamp-in-entry


This is great, thanks!

Alan


signature.asc
Description: PGP signature


[O] moving an entry from one date tree to another

2019-09-27 Thread Alan Schmitt

Hello,

Is there an easy way to move an entry from one date tree to 
another? I

guess I need two things:
- figure out where in the date tree the entry is,
- create the parents if needed, and move it there.

This might be a more general question: given an entry in some 
file, can
I move it recreating the path form the root of the file to another 
file?


Thanks,

Alan


signature.asc
Description: PGP signature


Re: [O] org-ref question: create a note from a bibliography entry

2019-07-18 Thread Alan Schmitt
On 2019-07-18 15:54, John Kitchin  
writes:


M-x org-ref-open-bibtex-notes  should do that when your cursor 
is in a

bibtex entry.


Thank you very much, I don't know how I missed it.

Best,

Alan


signature.asc
Description: PGP signature


[O] org-ref question: create a note from a bibliography entry

2019-07-18 Thread Alan Schmitt

Hello,

I have a question about org-ref. Is there a way to directly create 
a
note when being inside a bibliography entry? I currently insert a 
cite
link and using it I can create the note, but I would like to skip 
the

"insert a cite link" part.

Thanks,

Alan


signature.asc
Description: PGP signature


Re: [O] converting many ics files to a single org file

2019-06-20 Thread Alan Schmitt

On 2019-06-19 14:01, Robert Horn  writes:

The golang ical2org (https://github.com/rjhorniii/ical2org) 
definitely

does this.


It seems to have many features that I would use. Thanks!

Alan


signature.asc
Description: PGP signature


Re: [O] converting many ics files to a single org file

2019-06-11 Thread Alan Schmitt

On 2019-06-10 22:20, Thomas Plass  writes:

As per its docstring it's one file per invocation.  But the 
docstring

also lists:

$ cat in.ical | ical2orgpy - - > out.org

I haven't tried, but something like this might work (on 
Unixoids):


$ echo -n > out.org
$ for i in *.ical; do cat $i | ical2orgpy - - >> out.org; echo 
>> out.org; done


Thank you for the suggestion, I'll give it a try.

Best,

Alan


signature.asc
Description: PGP signature


[O] converting many ics files to a single org file

2019-06-10 Thread Alan Schmitt

Hello,

I'm using vdirsyncer to keep a local copy of my calendars. I would 
now

like to have them in org-mode, so I'm looking for a tool to do the
conversion. One important constraint is that, by default, 
vdirsyncer

generates one ics file for each event. I've found this tool
https://github.com/asoroa/ical2org.py but it's not clear if it can
handle many files.

Do you have suggestions for such a workflow? I could try to 
concatenate

the files, but I probably need a tool for that.

Best,

Alan


signature.asc
Description: PGP signature


Re: [O] Advance notice of birthdays in org-mode via org-contacts

2019-05-28 Thread Alan Schmitt

Hi Eric,

On 2019-05-28 04:34, Eric Abrahamsen  
writes:



And (shameless plug) if you're using EBDB, you can set both
`ebdb-use-diary' and `org-agenda-include-diary' to t, and 
anniversaries

will show in the agenda.


Thank you for the plug, I've been wanting to look at EBDB for a 
while. I
have a few questions: is it easy to migrate data from BBDB? Can 
you have

org links to EBDB records? Does it work with mu4e for address
completion?

Thanks,

Alan


signature.asc
Description: PGP signature


[O] refreshing pictures that are results of code blocks

2019-05-15 Thread Alan Schmitt

Hello,

I'm playing with picture generating code like this:

#+begin_src python :results file :session :var 
matplot_lib_filename="figure2.png" :exports both

import matplotlib.pyplot as plt

data = [14.0, 7.6, 11.2, 12.8, 12.5, 9.9, 14.9, 9.4, 16.9, 10.2, 
14.9, 18.1, 7.3, 9.8, 10.9, 12.2, 9.9, 2.9, 2.8, 15.4, 15.7, 9.7, 
13.1, 13.2, 12.3, 11.7, 16.0, 12.4, 17.9, 12.2, 16.2, 18.7, 8.9, 
11.9, 12.1, 14.6, 12.1, 4.7, 3.9, 16.9, 16.8, 11.3, 14.4, 15.7, 
14.0, 13.6, 18.0, 13.6, 19.9, 13.7, 17.0, 20.5, 9.9, 12.5, 13.2, 
16.1, 13.5, 6.3, 6.4, 17.6, 19.1, 12.8, 15.5, 16.3, 15.2, 14.6, 
19.1, 14.4, 21.4, 15.1, 19.6, 21.7, 11.3, 15.0, 14.3, 16.8, 14.0, 
6.8, 8.2, 19.9, 20.4, 14.6, 16.4, 18.7, 16.8, 15.8, 20.4, 15.8, 
22.4, 16.2, 20.3, 23.4, 12.1, 15.5, 15.4, 18.4, 15.7, 10.2, 8.9, 
21.0]


plt.clf()
plt.hist(data, bins=10, edgecolor='black')
plt.grid(True)
plt.axis([0, 25, 0, 25])

plt.savefig(matplot_lib_filename)
matplot_lib_filename
#+end_src

and it works great when I evaluate it: it creates a link to the 
picture,

and when I hit Enter on the link, the picture is displayed in the
buffer.

The problem is when I modify the code block and run it again, if I 
hit
Enter on the resulting link, I see the old picture. The new one is 
there
(if I open it, it is modified), but somehow the old picture is 
cached.


Is there a way to disable this cache?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: [O] Bug: Can't access org agenda custom command [9.2.1 (9.2.1-33-g029cf6-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20190225/)]

2019-02-26 Thread Alan Schmitt
On 2019-02-26 09:14, Nicolas Goaziou  
writes:



I think the problem is on line 3036 of org-agenda.el. The code

(propertize match nil 'face 'org-warning))

should be
(propertize match 'face 'org-warning))

(I changed it locally and it now works)


This was fixed yesterday.


Thank you. I did not know that as I updated org-plus-contrib this
morning and had the bug.

Best,

Alan



signature.asc
Description: PGP signature


Re: [O] Bug: Can't access org agenda custom command [9.2.1 (9.2.1-33-g029cf6-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20190225/)]

2019-02-25 Thread Alan Schmitt
On 2019-02-26 02:19, Gustavo Barros  
writes:


I've been having trouble with my custom agenda commands since 
the latest

update.

The agenda dispatcher used to work fine until the last update, 
but now,

given one of my custom agenda commands, it issues the error
"org-agenda-get-restriction-and-command: Wrong number of 
arguments".


I think the problem is on line 3036 of org-agenda.el. The code

(propertize match nil 'face 'org-warning))

should be
(propertize match 'face 'org-warning))

(I changed it locally and it now works)

Best,

Alan


signature.asc
Description: PGP signature


Re: [O] Inlining TikZ blocks as SVG in HTML export

2019-01-21 Thread Alan Schmitt
On 2019-01-09 22:46, Christophe Garion  
writes:



Hello,

I would like to be able to export Org files containing TikZ 
pictures to
HTML files with SVG pictures corresponding to TikZ pictures 
inlined
directly in the HTML files. My use case is to produce quizz 
questions
with graph drawings for the Moodle LMS (https://moodle.org/) 
used at our
university. It is really painful to upload picture files to 
Moodle and link
them to text and Moodle accepts plain HTML5 for text 
description, so it

seems to be a rather food solution.


Here is an example of how I do it. The by-backend is defined as 
follows:


;; to export to both latex and html
(defmacro by-backend ( body)
 `(cl-case org-export-current-backend ,@body))

  #+header: :file (by-backend (latex "sigma3.tikz") (t 
  "sigma3.png"))
  #+header: :imagemagick yes :iminoptions -density 600 
  :imoutoptions -geometry 800

  #+header: :results raw graphics
  #+header: :fit yes
  #+header: :packages '(("" "tikz"))
  #+begin_src latex
  \usetikzlibrary{matrix,arrows}
  \begin{tikzpicture}
 \matrix (m) [matrix of nodes, row sep=1em, column sep=4em]
 { iterate & map & reduce \\
   & & $acci$  \\
   $a_{0} = a$   & $f(a_{0})$ & \\ & &  $acc_{0} = fc\; 
   (f\; a_{0})\; acci$ \\
   $a_1 = a_0+i$  & $f(a_{1})$  &\\ & & $acc_{1} = fc\; 
   (f\; a_{1})\; acc_{0}$ \\

   $\ldots$ & $\ldots$   &\\ & & ~ \\
   $a_{n-1} = a_{n-2} + i$ & $f(a_{n-1})$ &\\ & & $acc_{n-1} = 
   fc\; (f \; a_{n-1})\; acc_{n-2}$  \\

   $a_n = a_{n-1} + i$ & $f(a_{n})$ &\\
   $a_{n+1} = a_n + i > b$& & $res = fc\; (f\; a_{n})\; 
   acc_{n-1}$  \\

 };
  \draw (m-3-1) edge[->,thick] node[auto]{\scriptsize $f$} 
  (m-3-2);
  \draw (m-5-1) edge[->,thick] node[auto]{\scriptsize $f$} 
  (m-5-2);
  \draw (m-9-1) edge[->,thick] node[auto]{\scriptsize $f$} 
  (m-9-2);
  \draw (m-11-1) edge[->,thick] node[auto]{\scriptsize $f$} 
  (m-11-2);


  \draw (m-6-3) edge[dotted] (m-8-3);

  \draw[in=90,out=0] (m-3-2) edge[thick] (m-4-3.north);
  \draw (m-2-3) edge[->,thick] node[right]{\scriptsize $fc$} 
  (m-4-3);


  \draw[in=90,out=0] (m-5-2) edge[thick] (m-6-3.north);
  \draw (m-4-3) edge[->,thick] node[right]{\scriptsize $fc$} 
  (m-6-3);


  \draw[in=90,out=0] (m-9-2) edge[thick] (m-10-3.north);
  \draw (m-8-3) edge[->,thick] node[right]{\scriptsize $fc$} 
  (m-10-3);


  \draw[in=90,out=0] (m-11-2) edge[thick] (m-12-3.north);
  \draw (m-10-3) edge[->,thick] node[right]{\scriptsize $fc$} 
  (m-12-3);

  \end{tikzpicture}
  #+end_src

Best,

Alan


signature.asc
Description: PGP signature


Re: [O] a couple tangle questions (tangle a single block, comment syntax)

2018-10-11 Thread Alan Schmitt
On 2018-10-11 16:12, Alan Schmitt  writes:

> Now I just need to find a way to specify the syntax for comments in the
> headers, and I'm all set.

I'm feeling silly. What I need to use is the "conf" language, not
"config". Sorry for the noise.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-09: 405.51, 2017-09: 403.37


signature.asc
Description: PGP signature


Re: [O] a couple tangle questions (tangle a single block, comment syntax)

2018-10-11 Thread Alan Schmitt
On 2018-10-11 08:06, John Kitchin  writes:

> Do you mean interactively?  With org-babel-tangle you can:
>
> With one universal prefix argument, only tangle the block at point.
>
> When two universal prefix arguments, only tangle blocks for the
> tangle file of the block at point.

Thank you! I looked at the manual but forgot to look at the function's
documentation.

Now I just need to find a way to specify the syntax for comments in the
headers, and I'm all set.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-09: 405.51, 2017-09: 403.37


signature.asc
Description: PGP signature


[O] a couple tangle questions (tangle a single block, comment syntax)

2018-10-11 Thread Alan Schmitt
Hello,

I'm moving my configuration files to an org file to be tangled, and I
have a couple questions.

First, is there a command to tangle a single block, or blocks in a
subtree?

Second, I like to have the :comments link option in my tangled files (to
reference where they were tangled from), but some files do not have an
emacs mode, so I use a "config" source block. For these files, org does
not know the syntax of comments, so it asks me for it. Can I specify the
syntax for comments in the header of the source block?

Thanks a lot,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-09: 405.51, 2017-09: 403.37


signature.asc
Description: PGP signature


Re: [O] Emacs mobile org

2018-09-10 Thread Alan Schmitt
On 2018-09-10 11:41, Marcin Borkowski  writes:

> On 2018-09-10, at 09:46, Alan Schmitt  wrote:
>
>> I use orgzly, and it works great with syncthing https://syncthing.net/
>
> BTW, in my experience syncthing seems quite flaky.  I turn it on on both
> the coputer and my phone, but I'm not sure what to do to start syncing.
> Sometimes it just works, sometimes it doesn't (or takes a lot of time,
> I'm not sure).  Any hints?  Is it possible to make the phone start
> syncing manually?  (I'm almost sure that my problems stem from my
> incompetence, hence the question.)

One thing to make sure is that they run on the same network. But besides
this I have not much advice to give, as it just works here.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-08: 406.99, 2017-08: 405.07


signature.asc
Description: PGP signature


Re: [O] Emacs mobile org

2018-09-10 Thread Alan Schmitt
On 2018-09-09 21:43, Kaushal Modi  writes:

> On Sun, Sep 9, 2018 at 7:53 PM M. P.  wrote:
>
>> Hello I am running emacs on a mac I have a galaxy s8 android phone. I am
>> wanting to sync my phone with emacs on my computer.
>> I would prefer not to use a cloud service but instead use
>> something like a usb or ther to sync with.
>>
>
> So, what is the question? :)
>
> Looking at just "Org" and "Android phone", I can suggest the Orgzly app.
>
> It can sync notes to a directory on your phone, and you can sync that dir
> to your computer via USB if you like (I like the Dropbox sync option).

I use orgzly, and it works great with syncthing https://syncthing.net/

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-08: 406.99, 2017-08: 405.07


signature.asc
Description: PGP signature


[O] gnus link no longer work

2018-09-06 Thread Alan Schmitt
Hello,

I've recently noticed that following gnus links (created by
org-store-link) no longer work. When I try to open one, I get an error,
and I see the gnus summary populated with the message I need, but I
cannot read it.

Here is the backtrace when I follow the link

Debugger entered--Lisp error: (wrong-type-argument consp nil)
  nnir-request-update-info("nnir:work" nil)
  nnir-request-group("work" "nnimap:inria" t nil)
  gnus-request-group("nnimap+inria:work" t)
  gnus-check-group-server()
  gnus-request-article-this-buffer(-1 "nnimap+inria:work")
  gnus-article-prepare(-1 nil)
  gnus-summary-display-article(-1 nil)
  gnus-summary-select-article(nil nil nil -1)
  gnus-summary-refer-article("ef188abb-9586-4b61-b82f-48fdc37da...@inria.fr")
  gnus-summary-goto-article("ef188abb-9586-4b61-b82f-48fdc37da...@inria.fr" nil 
t)
  org-gnus-follow-link("nnimap+inria:work" 
"ef188abb-9586-4b61-b82f-48fdc37da...@inria.fr")
  
org-gnus-open("nnimap+inria:work#ef188abb-9586-4b61-b82f-48fdc37da...@inria.fr")
  org-open-at-point()
  (if (and path (image-type-from-file-name path)) (+org/refresh-inline-images) 
(org-open-at-point))
  (let ((path (org-element-property :path (org-element-lineage context '(link) 
t (if (and path (image-type-from-file-name path)) 
(+org/refresh-inline-images) (org-open-at-point)))
  (cond ((org-element-property :checkbox (org-element-lineage context '(item) 
t)) (let ((match (and (org-at-item-checkbox-p) (match-string 1 
(org-toggle-checkbox (if (equal match "[ ]") '(16) ((eq type 'headline) 
(cond ((org-element-property :todo-type context) (org-todo (if (eq 
(org-element-property :todo-type context) 'done) 'todo 'done))) ((string= 
"ARCHIVE" (car-safe (org-get-tags))) (org-force-cycle-archived)) (t 
(+org/refresh-inline-images) (org-remove-latex-fragment-image-overlays) 
(org-toggle-latex-fragment '(4) ((eq type 'clock) 
(org-clock-update-time-maybe)) ((eq type 'footnote-reference) 
(org-footnote-goto-definition (org-element-property :label context))) ((eq type 
'footnote-definition) (org-footnote-goto-previous-reference 
(org-element-property :label context))) ((memq type '(timestamp planning)) 
(org-follow-timestamp-link)) ((memq type '(table-row table)) (if 
(org-at-TBLFM-p) (org-table-calc-current-TBLFM) (condition-case nil (progn 
(save-excursion (goto-char (org-element-property :contents-begin context)) 
(org-call-with-arg 'org-table-recalculate (or arg t (error nil ((eq 
type 'table-cell) (org-table-blank-field) (org-table-recalculate) (if (and 
(string-empty-p (string-trim (org-table-get-field))) (and (boundp 'evil-mode) 
evil-mode)) (progn (evil-change-state 'insert ((eq type 'babel-call) 
(org-babel-lob-execute-maybe)) ((eq type 'statistics-cookie) (save-excursion 
(org-update-statistics-cookies nil))) ((memq type '(inline-src-block 
src-block)) (org-babel-execute-src-block)) ((memq type '(latex-environment 
latex-fragment)) (org-toggle-latex-fragment)) ((eq type 'link) (let ((path 
(org-element-property :path (org-element-lineage context '(link) t (if (and 
path (image-type-from-file-name path)) (+org/refresh-inline-images) 
(org-open-at-point (t (+org/refresh-inline-images)))
  (let* ((context (org-element-context)) (type (org-element-type context))) 
(while (and context (memq type '(verbatim code bold italic underline 
strike-through subscript superscript))) (setq context (org-element-property 
:parent context) type (org-element-type context))) (cond ((org-element-property 
:checkbox (org-element-lineage context '(item) t)) (let ((match (and 
(org-at-item-checkbox-p) (match-string 1 (org-toggle-checkbox (if (equal 
match "[ ]") '(16) ((eq type 'headline) (cond ((org-element-property 
:todo-type context) (org-todo (if (eq (org-element-property :todo-type context) 
'done) 'todo 'done))) ((string= "ARCHIVE" (car-safe (org-get-tags))) 
(org-force-cycle-archived)) (t (+org/refresh-inline-images) 
(org-remove-latex-fragment-image-overlays) (org-toggle-latex-fragment '(4) 
((eq type 'clock) (org-clock-update-time-maybe)) ((eq type 'footnote-reference) 
(org-footnote-goto-definition (org-element-property :label context))) ((eq type 
'footnote-definition) (org-footnote-goto-previous-reference 
(org-element-property :label context))) ((memq type '(timestamp planning)) 
(org-follow-timestamp-link)) ((memq type '(table-row table)) (if 
(org-at-TBLFM-p) (org-table-calc-current-TBLFM) (condition-case nil (progn 
(save-excursion (goto-char (org-element-property :contents-begin context)) 
(org-call-with-arg 'org-table-recalculate (or arg t (error nil ((eq 
type 'table-cell) (org-table-blank-field) (org-table-recalculate) (if (and 
(string-empty-p (string-trim (org-table-get-field))) (and (boundp 'evil-mode) 
evil-mode)) (progn (evil-change-state 'insert ((eq type 'babel-call) 
(org-babel-lob-execute-maybe)) ((eq type 'statistics-cookie) (save-excursion 
(org-update-statistics-cookies nil))) ((memq type '(inline-src-block 

Re: [O] including the | character in a table

2018-07-25 Thread Alan Schmitt
On 2018-07-25 07:43, Kevin Foley  writes:

> You can use \vert to insert pipes in exported tables.

Thank you Michel and Kevin for these proposals. \vert works great (as
long as it's outside ~~, but I can deal with it).

Thanks!

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-06: 410.79, 2017-06: 408.84


signature.asc
Description: PGP signature


[O] including the | character in a table

2018-07-25 Thread Alan Schmitt
Hello,

I'm writing a cheat sheet for a programming language, and I'm having
trouble with operators that use |. For instance:

| match expr with   | pattern matching |
| | pattern -> expr | action   |

How can I escape the |? I tried putting a \ before but it does not work.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-06: 410.79, 2017-06: 408.84


signature.asc
Description: PGP signature


Re: [O] Orgalist notes

2018-05-04 Thread Alan Schmitt
 Hello,

  I'm having the same indentation, as can be seen here. For some
  strange reason, as soon as I get to the next line (using
  return) I get extra space. I just refilled this paragraph
  and it looks like this.

  - this is a list
  - another list, and let's make is super long, even
  - longer, and I have the same problem.

Here is the list of minor modes that I have:

Abbrev Anzu Async-Bytecomp-Package Auto-Composition Auto-Compression
Auto-Encryption Auto-Fill Beacon Clean-Aindent Column-Number
Company-Childframe Counsel Diff-Auto-Refine Diredp-Highlight-Autofiles
Editorconfig Electric-Indent Eval-Sexp-Fu-Flash Evil Evil-Escape
Evil-Lion Evil-Local Evil-Search-Highlight-Persist Evil-Surround
Eyebrowse File-Name-Shadow Flx-Ido Flyspell Font-Lock Global-Anzu
Global-Auto-Revert Global-Eldoc Global-Evil-Search-Highlight-Persist
Global-Evil-Surround Global-Font-Lock Global-Git-Commit
Global-Git-Gutter+ Global-Page-Break-Lines
Global-Spacemacs-Leader-Override Global-Undo-Tree Global-Vi-Tilde-Fringe
Global-Xah-Math-Input Gnus-Message-Citation Hl-Todo Ido-Vertical
Info-Breadcrumbs-In-Mode-Line Ivy Line-Number Mac-Mouse-Wheel Menu-Bar
Mixed-Pitch Mml Orgalist Override-Global Persp Projectile Pupo Purpose
Recentf Save-Place Savehist Shell-Dirtrack Show-Smartparens
Show-Smartparens-Global Spaceline-Helm Spaceline-Info
Spacemacs-Leader-Override Transient-Mark Undo-Tree Vi-Tilde-Fringe
Volatile-Highlights Which-Key Winner Winum Xah-Math-Input Xterm-Mouse
Yas Yas-Global

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-03: 409.46, 2017-03: 407.18


signature.asc
Description: PGP signature


Re: [O] preview embedded latex fragments error with my settings

2018-03-27 Thread Alan Schmitt
According to the log, you need to configure the export to use xelatex.

The error using xelatex is at this point, where it seems you should not
use math-mode:

l.86 $\LaTeX
$

Do you have this in your code? Did you try removing the enclosing $?

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42


signature.asc
Description: PGP signature


Re: [O] preview embedded latex fragments error with my settings

2018-03-27 Thread Alan Schmitt
On 2018-03-27 08:57, stardiviner  writes:

> I have divsvgm program on my arch linuxsystem. And "/tmp/orgtexhClnu9.dvi" 
> does
> not exist, it is not produced. Only "/tmp/orgtexhClnu9.tex" and
> "/tmp/orgtexhClnu9.log" two file.

What does the log file say? There will probably be a hint about what is
wrong. (The fact that it is there suggests latex started running, but
did not produce the dvi file.)

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42


signature.asc
Description: PGP signature


Re: [O] [PATCH v2 0/3] org-sbe fixes

2018-03-26 Thread Alan Schmitt
On 2018-03-25 23:06, Nicolas Goaziou  writes:

> I have reverted your changes from maint.

Should there be a new release? This change is present in 9.1.8.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42


signature.asc
Description: PGP signature


Re: [O] [PATCH v2 0/3] org-sbe fixes

2018-03-25 Thread Alan Schmitt
Hello,

On 2018-03-20 00:07, Nicolas Goaziou  writes:

> Hello,
>
> Vladimir Panteleev  writes:
>
>> OK, here is v2 with table-based tests.
>>
>> Vladimir Panteleev (3):
>>   ob-table: Fix org-sbe's handling of quotes in cell values
>>   ob-table: Fix org-sbe's handling of list arguments
>>   ob-table: Mention passing ranges as lists in org-sbe's documentation
>
> Applied. Thank you!

I think this has been applied to the maint branch, but I cannot find a
mention of it in the ORG-NEWS file. Maybe it should be mentioned there
as it is a breaking change. For instance,(I had to modify table formulas like

#+TBLFM: @2$3..@>>$3='(org-sbe call_ledger (bucket (concat "\"" $1 "\"")) 
(prefix "\"Bucket:Expenses:\""))

into

#+TBLFM: @2$3..@>>$3='(org-sbe call_ledger (bucket $$1) (prefix 
"\"Bucket:Expenses:\""))

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-02 Thread Alan Schmitt
On 2018-02-02 18:41, Yasushi SHOJI  writes:

> https://github.com/yashi/multi-html-single-pdf
>
> I have to use macro expansion and `org-export-global-macros` to swap the link.
> I don't think we have conditionals to switch an internal and an external link.
>
> HTML outputs are still not good at all (wrong chapter number, excess toc, 
> etc.),
> but at least you can see the body of the text.

This is impressive, thanks a lot. Changing the macro just before calling
the exporter is a great idea.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-02 Thread Alan Schmitt
> What you want is to have multiple pdf files, say a.pdf and b.pdf, and link 
> from
> a.pdf to some specific page on the b.pdf, right?

No, I want multiple html files and a single pdf file generated from
multiple org files. It seems the simplest solution is to call a function
that fixes the links for the pdf export. I'll report here once I have
that function.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-01 Thread Alan Schmitt
On 2018-02-01 13:56, Nicolas Goaziou  writes:

>> Not here. If I try to export the second file (the one with the link to
>> the first file), I get an error:
>>
>> user-error: Unable to resolve link: "*A headline"
>>
>> This is why I think I need to have the target file name in the link when
>> exporting it as a standalone file.
>
> If you don't mind broken links, there's also
> `org-export-with-broken-links'.

Unfortunately I need working links, so I'll try something else.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] is there a macro to have backend-specific behavior?

2018-02-01 Thread Alan Schmitt
On 2018-02-01 13:02, Nicolas Goaziou  writes:

>> My use case is this one: I have a link to a custom id, and I want to
>> export it as [[#id]] in latex and [[file:file.org::#id]] for html
>> *before* link resolution happens (so that the custom id in the latex
>> export is substituted with the correct label).
>>
>> Is this possible?
>
> Could you simply preprocess the document to export with a function doing
> the change above? Functions in `org-export-before-parsing-hook' are
> called with the back-end as the sole argument.

Thank you for the suggestion, I think this is the simplest solution.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-01 Thread Alan Schmitt
On 2018-02-01 20:09, Yasushi SHOJI  writes:

>> How do I change the link in the second headline so that I can split the
>> second headline into its own file and export it by itself?
>
> Using [[*A headline]] ?
>
> I might be still missing something but I got following:
>
> $ cat a.org
> * A headline
>
> This is the first file.
>
> #+INCLUDE: b.org :minlevel 1
>
> $ cat b.org
> * Second headline
>
> The first headline is number [[*A headline]]

…

> hmm... latex export will generate \ref{sec:\#head}
> if you have CUSTOM_ID set.  html exporter works, though.

Not here. If I try to export the second file (the one with the link to
the first file), I get an error:

user-error: Unable to resolve link: "*A headline"

This is why I think I need to have the target file name in the link when
exporting it as a standalone file.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


[O] is there a macro to have backend-specific behavior?

2018-02-01 Thread Alan Schmitt
Hello,

Is there a way to define a macro that has different behaviors depending
on export backend? I have macros that use the @@latex:foo@@ syntax, but
in that case I "foo" is supposed to be literal latex.

My use case is this one: I have a link to a custom id, and I want to
export it as [[#id]] in latex and [[file:file.org::#id]] for html
*before* link resolution happens (so that the custom id in the latex
export is substituted with the correct label).

Is this possible?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] exporting a big project in multiple files to both pdf and html

2018-02-01 Thread Alan Schmitt
On 2018-02-01 11:17, Yasushi SHOJI <yasushi.sh...@gmail.com> writes:

> On Fri, Jan 26, 2018 at 2:37 AM, Alan Schmitt
> <alan.schm...@polytechnique.org> wrote:
>> I'm working on a project that is becoming too big to manage as a single
>> file, so I'm looking at splitting it in several files. This would also
>> have the benefit of generating several smaller html pages instead of a
>> single huge one.
>
> Does Org support this? or do you just export each file?

I was planning on exporting each file individually. (It's the main goal,
actually, as exporting the whole thing is taking too long.)

>> My question is about pdf export. Is it possible to take a document made
>> of multiple org files and generate a single book from it? I'm worried
>> that if I use a master org file that includes the other ones, the links
>> between chapters would break.
>
> You can just use '#+INCLUDE' construct and Org will take care.

My problem is links. To give a concrete example, here is the file I want
to split in two:

* A headline
  :PROPERTIES:
  :CUSTOM_ID: head1
  :END:

This is the first file.

* Second headline

The first headline is number [[#head1]]


How do I change the link in the second headline so that I can split the
second headline into its own file and export it by itself? Right now it
cannot resolve the link. Maybe a solution would be to create a custom
link with different ways to export it…


> In the html-master.org, you use links to connect.  And
> in the pdf-master.org, you can just #+INCLUDE your files.

This is the plan, if I find out how to deal with links.

> BTW, I don't think we have direct pdf exporter.  So, you must be talking about
> the latex exporter, right?

Yes, sorry for the confusion.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] computing the size of a tikz to png image during export

2018-01-29 Thread Alan Schmitt
On 2018-01-28 16:37, Fabrice Popineau  writes:

> I jump on this example to ask: does this by-backend trick still work with
> Org 9.1.6?

It works here. I did not provide the definition, here it is:

(defmacro by-backend ( body)
  `(cl-case org-export-current-backend ,@body))

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


[O] exporting a big project in multiple files to both pdf and html

2018-01-25 Thread Alan Schmitt
Hello,

I'm working on a project that is becoming too big to manage as a single
file, so I'm looking at splitting it in several files. This would also
have the benefit of generating several smaller html pages instead of a
single huge one.

My question is about pdf export. Is it possible to take a document made
of multiple org files and generate a single book from it? I'm worried
that if I use a master org file that includes the other ones, the links
between chapters would break.

Is this something you have tackled with? How did you do it?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] computing the size of a tikz to png image during export

2018-01-25 Thread Alan Schmitt
On 2018-01-25 06:46, Eric S Fraga <esfli...@gmail.com> writes:

> On Wednesday, 24 Jan 2018 at 08:54, Alan Schmitt wrote:
>> If I understand how it works in the png case, a standalone latex file is
>> first generated, then it is compiled to pdf and converted to png using
>> imagemagick. Instead of specifying the geometry of the image (width of
>> 800 pixels above), I would like to compute it using its original size.
>> Is it possible?
>
> Have you tried removing the -geometry setting?  Imagemagick should be
> fine with just the density option.

Thank you for the suggestion. Unfortunately the image is very large with
a density of 600, and if I use a lower density then it is too low
resolution.

I found a solution using an -resize argument. It seems to work fairly
well.

Thanks again,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


[O] computing the size of a tikz to png image during export

2018-01-24 Thread Alan Schmitt
Hello,

I use this great trick to have both a pdf and html export of tikz
images:

#+header: :file (by-backend (latex "tp6-tree.tikz") (t "tp6-tree.png"))
#+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 800
#+header: :results file raw
#+header: :fit yes
#+header: :headers '("\\usepackage{tikz}")
#+begin_src latex
\begin{tikzpicture}
…
\end{tikzpicture}
#+end_src

If I understand how it works in the png case, a standalone latex file is
first generated, then it is compiled to pdf and converted to png using
imagemagick. Instead of specifying the geometry of the image (width of
800 pixels above), I would like to compute it using its original size.
Is it possible?

Thanks a lot,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-12: 406.82, 2016-12: 404.42


signature.asc
Description: PGP signature


Re: [O] Can export the files with bibliography only to LaTeX

2017-12-14 Thread Alan Schmitt
Hello,

org-ref (https://github.com/jkitchin/org-ref) has some bibliography
support for html (and looking back at it for plain text, although I
never tried it).

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-11: 405.14, 2016-11: 403.53


signature.asc
Description: PGP signature


Re: [O] Problems with Org-mode & Minted

2017-12-07 Thread Alan Schmitt
Hello,

On 2017-12-07 10:42, jerome moliere  writes:

> org-latex-minted-options   '(("frame" "lines") ("linenos=true")
> ("fontsize=\scriptsize") )

I think this is wrong, you should have two strings in each list. Have
you tried
'(("frame" "lines") ("linenos" "true") ("fontsize" "\\scriptsize")
?

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-11: 405.14, 2016-11: 403.53


signature.asc
Description: PGP signature


Re: [O] mentioning EXPORT_LATEX_HEADER in the latex header info node

2017-11-17 Thread Alan Schmitt
On 2017-11-16 22:00, Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Alan Schmitt <alan.schm...@polytechnique.org> writes:
>
>> The LaTeX header and sectioning structure info node talks about
>> LATEX_HEADER and LATEX_HEADER_EXTRA. Maybe it could mention the EXPORT
>> version as well, as is done for the LATEX_CLASS_OPTION.
>
> Since adding "EXPORT_" prefixed version of all keywords could be
> overwhelming, I'd rather do it the other way and remove
> EXPORT_LATEX_CLASS_OPTION reference. We could consider that all is said
> in the last paragraph of (info "(org)Export settings").
>
> WDYT?

It makes sense. Reading the text there, I'm a bit surprised:

For example, `DATE' and `EXPORT_FILE_NAME' keywords become,
respectively, `EXPORT_DATE' and `EXPORT_FILE_NAME'.

Is the `EXPORT_FILE_NAME' a real example (i.e., a node property that has
a global and subtree meaning with the same name)?

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-10: 403.64, 2016-10: 401.57


signature.asc
Description: PGP signature


[O] mentioning EXPORT_LATEX_HEADER in the latex header info node

2017-11-13 Thread Alan Schmitt
Hello,

The LaTeX header and sectioning structure info node talks about
LATEX_HEADER and LATEX_HEADER_EXTRA. Maybe it could mention the EXPORT
version as well, as is done for the LATEX_CLASS_OPTION.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-10: 403.64, 2016-10: 401.57


signature.asc
Description: PGP signature


Re: [O] Applescript help

2017-11-13 Thread Alan Schmitt
On 2017-11-11 20:06, Jay Iyer  writes:

> Hi, in my Org workflow, I am trying to use the do-applescript function to
> hide an active Emacs session.  Can you tell me what I am doing wrong with
> the following that I think should work but is not?  Thanks. -jay
>
> (do-applescript "tell application \"Finder\" set visible of application
> process \"Emacs\" to false")

Don't you need an "end tell"?

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-10: 403.64, 2016-10: 401.57


signature.asc
Description: PGP signature


[O] tiny bug in ox-koma-letter.el

2017-10-13 Thread Alan Schmitt
Hello,

I'm exporting a letter without a to-address, and it generates a spurious
"mbox" in the letter. I found that if I change line 708 of
ox-koma-letter.el from "mbox{}" to "\\mbox{}" the problem goes away.
Is this a (known) bug?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-09: 403.38, 2016-09: 401.03


signature.asc
Description: PGP signature


Re: [O] [RFC] org-agenda: Jump directly to line in case of a timestamp

2017-10-09 Thread Alan Schmitt
On 2017-10-09 09:19, Eric S Fraga <esfli...@gmail.com> writes:

> On Monday,  9 Oct 2017 at 08:54, Alan Schmitt wrote:
>> One thing I would really like is the timestamp behavior of
>> org-agenda-goto with the windows behavior of org-agenda-switch-to.
>
> You could "advise" the function?
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html

Yes, this is something I could do. Thanks for the suggestion.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-09: 403.38, 2016-09: 401.03


signature.asc
Description: PGP signature


Re: [O] [RFC] org-agenda: Jump directly to line in case of a timestamp

2017-10-09 Thread Alan Schmitt
Hello,

On 2017-10-07 22:23, Matt Lundin  writes:

> The only difference, if I remember correctly, is that
> org-agenda-switch-to replaces the agenda buffer with the target org
> buffer, whereas org-agenda-goto shows the target org buffer in another
> window. 

One thing I would really like is the timestamp behavior of
org-agenda-goto with the windows behavior of org-agenda-switch-to.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-09: 403.38, 2016-09: 401.03


signature.asc
Description: PGP signature


Re: [O] M-RET is not working in the ogr-plus-contrib-20170918

2017-09-19 Thread Alan Schmitt
On 2017-09-18 17:17, Nicolas Goaziou  writes:

> For the record, we changed
>
>   (org-defkey org-mode-map [(meta return)] 'org-meta-return)
>
> into
>
>   (org-defkey org-mode-map (kbd "M-RET") #'org-meta-return)
>
> This may be related to a binding priority order.

Thank you. I updated my bug report on the Spacemacs issue tracker with
this information. The problem has been confirmed by other users there.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-08: 405.07, 2016-08: 402.25


signature.asc
Description: PGP signature


Re: [O] M-RET is not working in the ogr-plus-contrib-20170918

2017-09-18 Thread Alan Schmitt
On 2017-09-18 16:06, Nicolas Goaziou  writes:

> Hello,
>
> Ярослав Данько  writes:
>
>> Hi, all. After installing the latest ogr-plus-contrib 20170918 i noticed
>> that M-RET is not working anymore to continue the list or to insert a new
>> heading. If this is a intended change, what combination of keys is now
>> instead of the old one? Thanks in advance.
>
> We recently messed with M-RET binding, but it should still be there.
> I cannot reproduce your problem. You may want to restart your Emacs
> session.
>
> Also, what is the return value for "F1 c M-RET"? Do you run Emacs from
> a terminal?

I'm using Spacemacs and I'm seeing the same thing. M-RET now has the
default Spacemacs binding (it's a prefix). I'm wondering if
evil-org-mode should be updated.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-08: 405.07, 2016-08: 402.25


signature.asc
Description: PGP signature


Re: [O] shift-return no longer increments dates?

2017-09-13 Thread Alan Schmitt
On 2017-09-13 14:17, Nicolas Goaziou  writes:

>> I just updated emacs and org-mode, and I am having a small issue. When I
>> hit shift-return on a date field, it simply copies it and no longer
>> increments it.
>
> Fixed. Thank you.

Thanks!

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-08: 405.07, 2016-08: 402.25


signature.asc
Description: PGP signature


[O] shift-return no longer increments dates?

2017-09-13 Thread Alan Schmitt
Hello,

I just updated emacs and org-mode, and I am having a small issue. When I
hit shift-return on a date field, it simply copies it and no longer
increments it.

I do have `org-table-copy-increment' set to t:

> org-table-copy-increment is a variable defined in ‘org-table.el’.
> Its value is t

> Documentation:
> Non-nil means increment when copying current field with ‘M-x 
> org-table-copy-down’.

> You can customize this variable.

> This variable was introduced, or its default value was changed, in
> version 26.1 of Emacs.

(I don't know why it's talking about 26.1, I have this version of emacs:
GNU Emacs 25.3.1 (x86_64-apple-darwin16.7.0, Carbon Version 157 AppKit
1504.83) of 2017-09-13)

I'm using this version of org:
Org mode version 9.1 (9.1-20-ga4f139-elpaplus @ 
/Users/schmitta/.emacs.d/elpa/org-plus-contrib-20170911/)

Is this a known bug?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-08: 405.07, 2016-08: 402.25


signature.asc
Description: PGP signature


Re: [O] org mode moves to GNU emacs core

2017-07-03 Thread Alan Schmitt
"ESF" == Eric S Fraga  writes:

ESF> On Monday,  3 Jul 2017 at 08:33, Uwe Brauer wrote:
>> But the release cycles are very different, so in order to have always
>> the latest stable org package, I need to compile and install the whole
>> GNU emacs beast. I thought the whole idea of a package system is to
>> avoid this headache. 

ESF> I agree.  I like tracking org development but would not be at all keen
ESF> on tracking emacs in the same way.  I was actually quite disappointed
ESF> when gnus went into emacs master as I can no longer easily play with any
ESF> experimental branches etc.

Same here. I stopped trying to debug some gnus issues when I could no
longer easily compile and install new versions independently of emacs.
(I use a port of emacs for macOS, so I cannot simply recompile emacs. I
need to wait until the changes are incorporated in that port.) It would
be too bad if the same happened with org mode.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-05: 409.65, 2016-05: 407.70


signature.asc
Description: PGP signature


Re: [O] Capture template 'C': nil

2017-06-30 Thread Alan Schmitt
"MM" == Mario Martelli  writes:

MM> I tried your template once again. And it turned out that the file must be 
existent.

MM> ("c" "capture CWN through org protocol" item (file 
"~/org/notes.org")
MM> "- %?%:description\n  %:link\n\n")

MM> Does work for me. So giving a path to file might help.

Thank you for testing. There is another thread where someone has the
same problem. It seems that for item templates one has to give the full
path.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-05: 409.65, 2016-05: 407.70


signature.asc
Description: PGP signature


Re: [O] Capture template stopped working: nil

2017-06-30 Thread Alan Schmitt
Hello,

"FL" == Florian Lindner  writes:

FL> Hey Nicolas, hey Bastien,
FL> might you give a hint why

FL>  ("j" "Journal" item
FL>   (file+datetree "journal.org")
FL>   "%?\n%i" :kill-buffer t)

FL> which still gives the same error: org-capture: Capture template ‘j’: nil

I'm having the same problem (see the thread "Capture template 'C':
nil"), also with an "item" template. I suspect there is a bug in that
specific case (since "entry" template works fine) where one must
specify the full path of the file.

The really surprising thing is that org actually finds the file (there
is text appended to it).

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-05: 409.65, 2016-05: 407.70


signature.asc
Description: PGP signature


Re: [O] Capture template 'C': nil

2017-06-30 Thread Alan Schmitt
"MM" == Mario Martelli  writes:

MM> Try to use ‘entry’ instead of ‘item’

Unfortunately I need an item. It used to work, unfortunately it no
longer does.

MM> “C” is usually bound to “Customise org-capture-templates”. Probably
MM> it’s better to choose another key.

Thank you for the suggestion. I changed it and it did not fix it.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-05: 409.65, 2016-05: 407.70


signature.asc
Description: PGP signature


[O] Capture template 'C': nil

2017-06-30 Thread Alan Schmitt
Hello,

I'm having a problem with a capture template called from org-protocol,
both with old and new style links.

Here is the template

  ("C" "capture CWN through org protocol" item (file "next-cwn.org")
   "- %?%:description\n  %:link\n\n")

When I use it on a page, it directly adds the entry to the file, without
going through the capture interface, and it adds an extra %? in the
text. For instance, using it on http://orgmode.org/ I get

- %?Org mode for Emacs – Your Life in Plain Text
  http://orgmode.org/

In the *Messages* buffer I see this:

Greedy org-protocol handler.  Killing client.
No server editing buffers exist
Capture template ‘C’: nil

Is this a bug, or a misconfiguration on my side?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-05: 409.65, 2016-05: 407.70


signature.asc
Description: PGP signature


[O] problem with bibtex-parse-buffers-stealthily

2017-04-10 Thread Alan Schmitt
Hello,

I'm having `bibtex-parse-buffers-stealthily' fail when there is an
org-mode buffer with a bibtex source block. For instance, if you have
the following block in an org file

#+begin_src bibtex
@article{FernandezGabbay2007,
  number = {6},
  volume = {205},
  pages = {917--965},
  year = {2007},
  journaltitle = {Information \& Computation},
  title = {Nominal rewriting},
  author = {Fernández, Maribel and Gabbay, Murdoch J.},
}
#+end_src

then when the bibtex-parse-buffers-stealthily runs, there is this error:

Error running timer ‘bibtex-parse-buffers-stealthily’:
(wrong-type-argument number-or-marker-p nil)

I tried to debug it, and the problems is that in the list of buffers,
there is one buffer

#

that is in bibtex mode but for which `bibtex-parse-keys' fail. I assume
it is because the source block is not a well formed bibtex file.

Should this be considered an emacs bug or an org-mode bug? I'm using
emacs 25.2.1 and current org-mode-with-contrib.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-03: 407.18, 2016-03: 404.83


signature.asc
Description: PGP signature


Re: [O] How do you store web pages for reference?

2017-03-17 Thread Alan Schmitt
On 2017-03-16 09:04, Bob Newell  writes:

> Scott Otterson  writes:
>
>> I use Evernote, which has handy annotation, tagging, and search
>
> I use this also, but I wanted something working within Emacs similar to
> the Evernote web-clipper. Org-board is very powerful but requires an
> intermediate step of creating a headline with a URL property.

I have this automated with org-capture and a hook:

#+BEGIN_SRC emacs-lisp
  (setq org-board-capture-file "my-org-board.org")

  (setq org-capture-templates
`(...
  ("c" "capture through org protocol" entry
   (file+headline ,org-board-capture-file "Unsorted")
   "* %?%:description\n:PROPERTIES:\n:URL: %:link\n:END:\n\n Added %U")
  ...))

  (defun do-org-board-dl-hook ()
(when (equal (buffer-name)
 (concat "CAPTURE-" org-board-capture-file))
  (org-board-archive)))

  (add-hook 'org-capture-before-finalize-hook 'do-org-board-dl-hook)
#+END_SRC

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-02: 406.42, 2016-02: 404.04


signature.asc
Description: PGP signature


  1   2   3   4   5   6   7   8   9   >