Re: [O] Org Protocol error, does not recognize template

2017-06-10 Thread Samuel W. Flint
> Samuel W Flint writes:

SF> Hello, I have an issue with org-protocol at the moment.  If
SF> using new-style links, one of my templates is not recognized.
SF> If I try the following link:
SF> 
org-protocol://capture?template=b=FlintFam.org+Home=http%3A%2F%2Fflintfam.org

SF> I get an error:

SF> *ERROR*: Capture template ‘b’: nil

As it turns out, it can't find that template in any situation (including
if it's called accurately).

org-capture-templates is set as follows:

(setq org-capture-templates
  `(("a" "Create Appointment" entry
 (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
 (file "~/.emacs.d/org-capture-templates/appointment-template.org")
 :empty-lines 1 :prepend nil)
("t" "TODO Items")
("tt" "Standard TODO" entry
 (file+headline "~/org/main.org" "To Do")
 (file "~/.emacs.d/org-capture-templates/todo-template.org")
 :empty-lines 1)
("td" "Deadline TODO" entry
 (file+headline "~/org/main.org" "To Do")
 (file "~/.emacs.d/org-capture-templates/todo-deadline-template.org")
 :empty-lines 1)
("tl" "Linked TODO" entry
 (file+headline "~/org/main.org" "To Do")
 (file "~/.emacs.d/org-capture-templates/todo-link-template.org")
 :empty-lines 1)
("n" "Notes")
("nn" "General Notes" entry
 (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
 (file "~/.emacs.d/org-capture-templates/notes-journal-template.org")
 :empty-lines 1)
("nl" "Linked Note" entry
 (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
 (file 
"~/.emacs.d/org-capture-templates/linked-note-journal-template.org")
 :empty-lines 1)
("nq" "Quoting Note" entry
 (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
 (file 
"~/.emacs.d/org-capture-templates/quoting-note-journal-template.org")
 :empty-lines 1)
("nt" "Linked/Quoted Notes" entry
 (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
 (file 
"~/.emacs.d/org-capture-templates/technical-journal-template.org")
 :empty-lines 1)
("nd" "Note on Date" entry
 (file+datetree+prompt ,(format-time-string "~/org/notes/%Y.org"))
 (file "~/.emacs.d/org-capture-templates/notes-journal-template.org")
 :empty-lines 1)
("nc" "Clocking Notes")
("ncn" "General Notes" entry
 (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
 (file 
"~/.emacs.d/org-capture-templates/notes-journal-template-clocking.org")
 :empty-lines 1)
("ncl" "Linked Note" entry
 (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
 (file 
"~/.emacs.d/org-capture-templates/linked-note-journal-template-clocking.org")
 :empty-lines 1)
("ncq" "Quoting Note" entry
 (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
 (file 
"~/.emacs.d/org-capture-templates/quoting-note-journal-template-clocking.org")
 :empty-lines 1)
("nct" "Linked/Quoted Notes" entry
 (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
 (file 
"~/.emacs.d/org-capture-templates/technical-journal-template-clocking.org")
 :empty-lines 1)
("A" "Assignment" entry
 (file "~/org/school.org")
 (file "~/.emacs.d/org-capture-templates/assignment-template.org")
 :empty-lines 1)
("j" "Journal Entry" entry
 (file+datetree ,(format-time-string "~/org/journal/%Y.org.gpg"))
 (file "~/.emacs.d/org-capture-templates/journal-template.org")
 :empty-lines 1)
("c" "calfw2org" entry
 (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
 (file "~/.emacs.d/org-capture-templates/clfw-template.org")
 :empty-lines 1)
("b" "Bookmark" item
 (file+olp "~/org/bookmarks.org" "Unsorted Bookmarks")
 "%a"
 :immediate-finish t)
("m" "Mail Message Follow-up" entry
 (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Mail 
Message Follow-up")
 (file "~/.emacs.d/org-capture-templates/mail-followup-template.org")
 :immediate-finish t :empty-lines 1)))

SF> What can I do to fix this?

SF> Thanks,

SF> Sam Flint

SF> -- Samuel W. Flint 4096R/266596F4 (9477 D23E 389E 40C5 2F10 DE19
SF> 68E5 318E 2665 96F4) λs.(s s) λs.(s s)


-- 
Samuel W. Flint
4096R/266596F4
  (9477 D23E 389E 40C5 2F10  DE19 68E5 318E 2665 96F4)
λs.(s s) λs.(s s)



[O] Org Protocol error, does not recognize template

2017-06-10 Thread Samuel W. Flint
Hello,

I have an issue with org-protocol at the moment.  If using new-style
links, one of my templates is not recognized.  If I try the following
link:
org-protocol://capture?template=b=FlintFam.org+Home=http%3A%2F%2Fflintfam.org

I get an error:

*ERROR*: Capture template ‘b’: nil

What can I do to fix this?

Thanks,

Sam Flint

-- 
Samuel W. Flint
4096R/266596F4
  (9477 D23E 389E 40C5 2F10  DE19 68E5 318E 2665 96F4)
λs.(s s) λs.(s s)



Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-10 Thread numbch...@gmail.com
Yeah, I have used to contrib to org-mode, but need to sign FSF papers spend
my time, and I don't know how. So I decide to move code in `contrib/`.
When I back home, I will try to sign FSF papers, because I have time and
fixed location.
If I move code into `contrib/`, do I need to do more in this code?
I will add `lexical-binding`, but don't know how to write test for this.
Could org-mode team pull branch code on my github repo directory? Or should
I send a patch from `git format-patch`?

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

On Sat, Jun 10, 2017 at 4:17 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > Here is my branch
> > https://github.com/stardiviner/org-mode/tree/feature/ob-sclang
> > Merge this branch?
>
> Thank you for your work.
>
> I'd like to refrain more packages to contrib, unless the intent is to
> eventually merge them into core later.
>
> However, I think this can go into core. Would you like to clean it up
> a bit, activate lexical-binding, provide some tests, and send a patch
> (using git format-patch)?
>
> You will need to sign FSF papers to do that, if you haven't done
> already. If you are willing to do this, we can also move your library to
> "contrib/" temporarily.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Custom keymaps on org blocks

2017-06-10 Thread John Kitchin
In case anyone would like to try this themselves, I documented what I tried
here:
http://kitchingroup.cheme.cmu.edu/blog/2017/06/10/Adding-keymaps-to-src-blocks-via-org-font-lock-hook/

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 Sat, Jun 10, 2017 at 9:58 AM, John Kitchin 
wrote:

>
> Nicolas Goaziou writes:
>
> > Hello,
> >
> > John Kitchin  writes:
> >
> >> On the other hand, there are times when I am working on a document that
> has
> >> a lot of short code blocks, e.g. for lecture notes or blog posts, where
> it
> >> is sufficiently tedious to me to switch in and out of the special edit
> mode
> >> that I wanted to try this solution out, and it became clear you can't
> >> really try it out without modifying the core org code that does the
> >> font-locking on a block.
> >
> > Are you sure about it? There are two hooks related to fontification:
> > `org-font-lock-set-keywords-hook' and `org-font-lock-hook'. I'm
> > surprised none can help you in this case.
>
> You are totally right on this. I can use org-font-lock-hook to take care
> of this. Thanks for the pointer.
>
> >
> >> I don't think we have to go so far as to say we make multiple major mode
> >> keybindings available, so much as context specific keybindings available
> >> where there is value in it. We already have this in org-speed keys for
> >> example, and even these can be context specific to do different things
> on
> >> headings (even different things on headings with specific properties)
> and
> >> blocks (
> >> http://kitchingroup.cheme.cmu.edu/blog/2016/12/22/Context-
> specific-org-mode-speed-keys/
> >> ).
> >
> > Neat hack.
>
> Thanks!
>
> >
> >> If there was a change to org to enable this, I wouldn't expect the core
> to
> >> change behavior for anyone, it would just make it possible for users to
> >> change this if they wanted to. The same way they can customize the face
> of
> >> a code block for different languages.
> >
> > Fair enough. Would you want to provide a proper patch?
>
> With the hook I don't think it is necessary. Thanks for all the
> discussion though (everyone) it was helpful to think it through.
> >
> > Thank you.
> >
> >
> > Regards,
>
>
> --
> 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] org to static site?

2017-06-10 Thread Scott Randby
On 06/10/2017 05:21 AM, Nicolas Goaziou wrote:
> Hello,
> 
> Scott Randby  writes:
> 
>> On 06/05/2017 05:16 PM, Nick Dokos wrote:
> 
>>> Can this paragraph please be added to 
>>> http://orgmode.org/worg/org-quotes.html?
>>> It certainly added a smile to my day.
>>
>> Sure, it can be added. I'm glad you liked it.
> 
> I added it. Thank you.

Just one comment. When I click on the "Show Org source" button at the
bottom of the page, it doesn't work. The button works on the Worg index
page, and the file org-quotes.org.html exists, so I don't know what the
problem is.

Scott

> 
> Regards,
> 




Re: [O] How to export LaTeX amsmath align bmatrix to ODT?

2017-06-10 Thread edgar

On 2017-06-10 04:54, ed...@openmail.cc wrote:

Hello,

I have been making progress with my export procedure to ODT. I would
like to know if someone knows how to export the following LaTeX block
to ODT correctly:

\[\begin{align} \begin{bmatrix} a = 1 & b=2 \\ c=3 & d = 4
\end{bmatrix} \end{align}\]
https://www.vfemail.net/roundcube/?_task=mail&_action=compose&_id=289067995593b7fd683a1f#
\[\begin{align}  a = & 1 + 2 + 3 + 4 \\ c = &  4 \end{bmatrix} 
\end{align}\]


As always, any help is welcome :) .


Edgar


By the way, I tried with latexmlmath and mathtoweb.jar without success.

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



[O] How to export LaTeX amsmath align bmatrix to ODT?

2017-06-10 Thread edgar

Hello,

I have been making progress with my export procedure to ODT. I would 
like to know if someone knows how to export the following LaTeX block to 
ODT correctly:


\[\begin{align} \begin{bmatrix} a = 1 & b=2 \\ c=3 & d = 4 \end{bmatrix} 
\end{align}\]


\[\begin{align}  a = & 1 + 2 + 3 + 4 \\ c = &  4 \end{bmatrix} 
\end{align}\]


As always, any help is welcome :) .


Edgar

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] Custom keymaps on org blocks

2017-06-10 Thread John Kitchin

Nicolas Goaziou writes:

> Hello,
>
> John Kitchin  writes:
>
>> On the other hand, there are times when I am working on a document that has
>> a lot of short code blocks, e.g. for lecture notes or blog posts, where it
>> is sufficiently tedious to me to switch in and out of the special edit mode
>> that I wanted to try this solution out, and it became clear you can't
>> really try it out without modifying the core org code that does the
>> font-locking on a block.
>
> Are you sure about it? There are two hooks related to fontification:
> `org-font-lock-set-keywords-hook' and `org-font-lock-hook'. I'm
> surprised none can help you in this case.

You are totally right on this. I can use org-font-lock-hook to take care
of this. Thanks for the pointer.

>
>> I don't think we have to go so far as to say we make multiple major mode
>> keybindings available, so much as context specific keybindings available
>> where there is value in it. We already have this in org-speed keys for
>> example, and even these can be context specific to do different things on
>> headings (even different things on headings with specific properties) and
>> blocks (
>> http://kitchingroup.cheme.cmu.edu/blog/2016/12/22/Context-specific-org-mode-speed-keys/
>> ).
>
> Neat hack.

Thanks!

>
>> If there was a change to org to enable this, I wouldn't expect the core to
>> change behavior for anyone, it would just make it possible for users to
>> change this if they wanted to. The same way they can customize the face of
>> a code block for different languages.
>
> Fair enough. Would you want to provide a proper patch?

With the hook I don't think it is necessary. Thanks for all the
discussion though (everyone) it was helpful to think it through.
>
> Thank you.
>
>
> Regards,


--
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] order of evaluation upon export: macros are evaluated too soon

2017-06-10 Thread Eric S Fraga

(Nicolas, forgot to send this to the list so apologies if you get this
twice)


On Thursday,  8 Jun 2017 at 12:36, Nicolas Goaziou wrote:
> Macros are expanded prior to Babel code evaluation—they can make nice
> shortcuts for long Babel calls—so they have to obey to the same rules as
> Babel code evaluation, which ignores ":noexport:" directive. I do

Ah, okay, this is a reasonable use case for ignoring the noexport
directive.  Thanks for this.

> Of course, if we accept to limit more macro expansion scope, we get more
> latitude in choosing the position of the expansion stage during the
> export process. I'm open to discussions about it, and more generally,
> about macros' features.

Consistency is the most important feature, in many ways, especially as
the (eco-)system grows.  For my own use case, the little bit of elisp
posted earlier is sufficient for me so I'm happy with the current
configuration, especially as I like hiding babel blocks in non-exported
subtrees but still want them executed on export.

Thanks again,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.6-425-gf4fca1


signature.asc
Description: PGP signature


Re: [O] org to static site?

2017-06-10 Thread Nicolas Goaziou
Hello,

Scott Randby  writes:

> On 06/05/2017 05:16 PM, Nick Dokos wrote:

>> Can this paragraph please be added to 
>> http://orgmode.org/worg/org-quotes.html?
>> It certainly added a smile to my day.
>
> Sure, it can be added. I'm glad you liked it.

I added it. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Custom keymaps on org blocks

2017-06-10 Thread Nicolas Goaziou
Hello,

John Kitchin  writes:

> On the other hand, there are times when I am working on a document that has
> a lot of short code blocks, e.g. for lecture notes or blog posts, where it
> is sufficiently tedious to me to switch in and out of the special edit mode
> that I wanted to try this solution out, and it became clear you can't
> really try it out without modifying the core org code that does the
> font-locking on a block.

Are you sure about it? There are two hooks related to fontification:
`org-font-lock-set-keywords-hook' and `org-font-lock-hook'. I'm
surprised none can help you in this case.

> I don't think we have to go so far as to say we make multiple major mode
> keybindings available, so much as context specific keybindings available
> where there is value in it. We already have this in org-speed keys for
> example, and even these can be context specific to do different things on
> headings (even different things on headings with specific properties) and
> blocks (
> http://kitchingroup.cheme.cmu.edu/blog/2016/12/22/Context-specific-org-mode-speed-keys/
> ).

Neat hack.

> If there was a change to org to enable this, I wouldn't expect the core to
> change behavior for anyone, it would just make it possible for users to
> change this if they wanted to. The same way they can customize the face of
> a code block for different languages.

Fair enough. Would you want to provide a proper patch?

Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-10 Thread Nicolas Goaziou
Hello,

"numbch...@gmail.com"  writes:

> Here is my branch
> https://github.com/stardiviner/org-mode/tree/feature/ob-sclang
> Merge this branch?

Thank you for your work.

I'd like to refrain more packages to contrib, unless the intent is to
eventually merge them into core later.

However, I think this can go into core. Would you like to clean it up
a bit, activate lexical-binding, provide some tests, and send a patch
(using git format-patch)?

You will need to sign FSF papers to do that, if you haven't done
already. If you are willing to do this, we can also move your library to
"contrib/" temporarily.

Regards,

-- 
Nicolas Goaziou



Re: [O] Moving and resetting attachments

2017-06-10 Thread Nicolas Goaziou
Hello,

Florian Lindner  writes:

> Ok, my new version is here. It should be able to replace
> org-attach-set-directory

Thank you. Comments follow.

> Some questions about the code
>
> * Is that the correct way to deal with a boolean prefix arg? I'm not 
> interested in the value of the prefix arg, only if
> it's given or not.

No, it should be (interactive "P") so PREFIX, or more commonly, ARG, is
nil when not provided.

> * The code changes the semantics of org-attach-set-directory, because it 
> creates the newly set attach dir. IMHO this
> makes more sense.

OK.

> * It deletes only the first part of the dir, e.g. data/83/1234567, it only 
> deletes the 1234567 dir, even if 83 is empty
> afterwards. But I think that's ok.

OK.

Here is an update of your function, with comments and FIXME. The
docstring could certainly be improved, but you get the idea.

  (defun flo/org-attach-move ( arg)
"Move current attachements to another directory.
  When ARG is non-nil, reset attach directory.  Create directory if
  needed."
(interactive "P")
(let ((old (org-attach-dir))
  (new
   (progn
 (if arg (org-entry-delete nil "ATTACH_DIR")
   (let ((dir (read-directory-name
   "Attachment directory: "
   (org-entry-get nil
  "ATTACH_DIR"
  (and org-attach-allow-inheritance 
t)
 (org-entry-put nil "ATTACH_DIR" dir)))
 (org-attach-dir t
  (message "old-attach-dir = %S" old) ;FIXME: remove?
  (message "new-attach-dir = %S" new) ;FIXME: remove?
  (unless (or (string= old new)
  (not old))
;; FIXME: Need a special case for directory reset (non-nil ARG).
;; FIXME: Maybe `yes-or-no-p' is safer when moving data around?
(when (y-or-n-p "Copy over attachments from old directory? ")
  (copy-directory old-attach-dir new t nil t))
(when (y-or-n-p (concat "Delete " old))
  ;; FIXME: Why not `delete-directory'?
  (shell-command (format "rm -fr %s" old))

Regards,

-- 
Nicolas Goaziou