Re: ICalendar export

2023-10-04 Thread Henrik Frisk
Den sön 17 sep. 2023 kl 11:49 skrev Ihor Radchenko :

> Jack Kamm  writes:
>
> >> Does the attached patch fix the problem for you?
> >
> > I can reproduce the bug by calling `org-icalendar-export-current-agenda'
> > in my agenda buffer. It seems to mainly happen when subsequent agenda
> > entries originate from different files.
> >
> > Ihor's patch fixes the problem on my end.
>
> Thanks for testing!
> Applied, onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=14bde5aba
> Fixed.
>
> Thank you both, I ran in to some other work issues, sorry for not replying
earlier. Thanks for fixing Ihor!

/Henrik


ICalendar export

2023-09-12 Thread Henrik Frisk
hi,

I've had an iCal export setup working fine for several years. I have an
org-agenda-custom-commands defined with:

(org-agenda-start-day "2022-09-01")
(org-agenda-span 120) ;; number of days
(org-agenda-include-diary nil))

Recently (not sure when) the ics output came out malformed and a newline is
omitted between the end of one event and the beginning of another:

END:VEVENT
BEGIN:VEVENT

is now

END:VEVENTBEGIN:VEVENT

I can't figure out wha the pattern is, for some events the output is
correct.

This is on Org mode version 9.7-pre release_9.6.8-719-gf299fb and emacs 29.1

best,
/Henrik


Re: ob-lilypond fontification

2023-08-27 Thread Henrik Frisk
Den sön 27 aug. 2023 kl 09:49 skrev Ihor Radchenko :

> Henrik Frisk  writes:
>
> >> Hmm. Did you customize `org-src-fontify-natively'?
> >>
> >
> > This is what I have:
> >
> > (setq org-confirm-babel-evaluate nil
> >   org-src-fontify-natively t
> >   org-src-tab-acts-natively t)
>
> Then, might be https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63579
> If it is, putting (defvar font-lock-reference-face nil) into your config
> should help; and, ideally, also reporting the bug to lilypond devs.
>

Yes, that did it, thanks!
/Henrik


Re: ob-lilypond fontification

2023-08-27 Thread Henrik Frisk
Den lör 26 aug. 2023 kl 18:23 skrev Ihor Radchenko :

> Henrik Frisk  writes:
>
> >> Is lilypond library is loaded when you open Org file?
> >> What happens if you run C-c ' on an src-block?
> >>
> >
> > That works fine, code is syntax highlighted.
>
> Hmm. Did you customize `org-src-fontify-natively'?
>

This is what I have:

(setq org-confirm-babel-evaluate nil
  org-src-fontify-natively t
  org-src-tab-acts-natively t)


Re: ob-lilypond fontification

2023-08-26 Thread Henrik Frisk
Den lör 26 aug. 2023 kl 14:27 skrev Ihor Radchenko :

> Henrik Frisk  writes:
>
> > So I changed to the main branch of
> >
> > git://git.savannah.gnu.org/emacs/org-mode.git
> >
> > and the new features you added to ob-lilypond is working (much
> > appreciated) but I still don' have syntax highlight in source blocks
> > though it works fine in lilypond-mode.
>
> Is lilypond library is loaded when you open Org file?
> What happens if you run C-c ' on an src-block?
>

That works fine, code is syntax highlighted.


Re: ob-lilypond fontification

2023-08-26 Thread Henrik Frisk
Den ons 23 aug. 2023 kl 08:04 skrev Henrik Frisk :

>
>
> On Tue, Aug 22, 2023, 6:17 PM Ihor Radchenko  wrote:
>
>> Henrik Frisk  writes:
>>
>> > So I grabbed the file ob-lilypond from another inactive install of Emacs
>> > 29.1 and linked to it in my init file. Everythin appears to work fine
>> > except I dont get syntax highlightning unless I hit C-c '
>>
>> I recommend installing Org mode from ELPA to make sure that you are
>> using the latest version.
>>
>> Also, there were possibly relevant changes on development branch. So you
>> might need ELPA devel version.
>>
>
> Makes sense. I will try that, thanks!
>

So I changed to the main branch of

git://git.savannah.gnu.org/emacs/org-mode.git

and the new features you added to ob-lilypond is working (much
appreciated) but I still don' have syntax highlight in source blocks
though it works fine in lilypond-mode.

/Henrik


Re: ob-lilypond fontification

2023-08-23 Thread Henrik Frisk
On Tue, Aug 22, 2023, 6:17 PM Ihor Radchenko  wrote:

> Henrik Frisk  writes:
>
> > So I grabbed the file ob-lilypond from another inactive install of Emacs
> > 29.1 and linked to it in my init file. Everythin appears to work fine
> > except I dont get syntax highlightning unless I hit C-c '
>
> I recommend installing Org mode from ELPA to make sure that you are
> using the latest version.
>
> Also, there were possibly relevant changes on development branch. So you
> might need ELPA devel version.
>

Makes sense. I will try that, thanks!

>


ob-lilypond fontification

2023-08-22 Thread Henrik Frisk
Hi,

Embarressed but happy that I realised I dont have to keep updating the
twelve year old version of ob-lilypond that I have been using I ran into a
problem. First of all, ob-lilypond is not part of the precompiled version
of emacs that I just switched to :
https://github.com/railwaycat/homebrew-emacsmacport/releases

So I grabbed the file ob-lilypond from another inactive install of Emacs
29.1 and linked to it in my init file. Everythin appears to work fine
except I dont get syntax highlightning unless I hit C-c '

The error I get is:

Org mode fontification error in #

Any suggestions?

/Henrik


Re: [BUG] WORG example for ob-lilypond is no longer working as described (was: Moving some lisp/ob-*.el files to org-contrib - your advice?)

2023-08-15 Thread Henrik Frisk
On Tue, Aug 15, 2023, 12:41 PM Ihor Radchenko  wrote:

> Henrik Frisk  writes:
>
> > Sorry for being late in this discussion. As a user of ob-lilypond I'm
> very
> > happy about these changes. On my last install, as well as my current I
> have
> > had to change the following:
> >
> > (org-babel-get-header params :var) which appears to be outdated, to:
> >
> > (org-babel--get-vars params)
>
> There is no such function `org-babel-get-header'.
>
> > in the version of ob-lilypond.el from here:
> > https://github.com/mjago/ob-lilypond/blob/master/lisp/ob-lilypond.el.
> Which
> > version of the file are you patching now?
>
> ob-lilypond is distributed together with Org mode
> (
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/ob-lilypond.el
> ).
> And you are looking at 12 years old early version of the library.
>

I know it is and I didn't know it was maintained so I've kept using this
old version updating it myself. In that case you can probably safely ignore
what I wrote below. Great to know it's part of org...


Re: [BUG] WORG example for ob-lilypond is no longer working as described (was: Moving some lisp/ob-*.el files to org-contrib - your advice?)

2023-08-15 Thread Henrik Frisk
Den fre 11 aug. 2023 kl 09:04 skrev Ihor Radchenko :

> Jonathan Gregory  writes:
>
> >> Jonathan, do you think that your original patch is still what
> >> you want to get merged?
> >
> > Yes, the one I sent on 20 Jul 2023. I haven't had any issues with
> > it so far.
>
> Ok. Would you mind adding a commit message, as described in
> https://orgmode.org/worg/org-contribute.html#first-patch?
>
> And do I understand correctly that no changes in
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
> are needed?
>
> Sorry for being late in this discussion. As a user of ob-lilypond I'm very
happy about these changes. On my last install, as well as my current I have
had to change the following:

(org-babel-get-header params :var) which appears to be outdated, to:

(org-babel--get-vars params)

in the version of ob-lilypond.el from here:
https://github.com/mjago/ob-lilypond/blob/master/lisp/ob-lilypond.el. Which
version of the file are you patching now?

Another request would be to have the variables ly-XXX-pdf-path and
ly-XXX-midi-path settable, or, perhaps, read from the lilypond settings of
corresponding variables. I'm not an elisp programmer but I could look into
that if it's of interest.

/Henrik


Re: [BUG] WORG example for ob-lilypond is no longer working as described (was: Moving some lisp/ob-*.el files to org-contrib - your advice?)

2023-07-25 Thread Henrik Frisk
Den tis 25 juli 2023 kl 19:26 skrev Jonathan Gregory :

> Hi Henrik,
>
> On 25 Jul 2023, Henrik Frisk wrote:
>
> > Den tis 25 juli 2023 kl 18:16 skrev Henrik Frisk
> > :
>
> > My bad, putting :file ionian.cropped.png only results in
> > ionian.cropped.cropped.png (as expected). Unclear why it worked
> > the first couple of times.
> >
> > /Henrik
>
> No need to crop the output. If you need png, you should use:
>
> #(ly:set-option 'tall-page-formats 'png)
>
> Makes sense, but I have to admit that I find this a bit confusing. I was
under the impression that the 'crop' option was the preferred way to
accomplish this.

Thanks for resolving this anyway!

/Henrik


Re: [BUG] WORG example for ob-lilypond is no longer working as described (was: Moving some lisp/ob-*.el files to org-contrib - your advice?)

2023-07-25 Thread Henrik Frisk
Den tis 25 juli 2023 kl 18:16 skrev Henrik Frisk :

> Hi,
>
> I have been struggling with the same issues to but have completely missed
> this thread. I haven't tried the patch of ob-lilypond but testing the file
> https://git.sr.ht/~bzg/worg/tree/6f69d212f41bc372426dc9b4df286638fe8f2a92/item/org-contrib/babel/examples/lilypond.org
> I'm getting cropped output with pdf, but not png (generates full page).
> Also, omitting the paper stuff I still get the same cropped output wit pdf:
>
> #+begin_src lilypond :file ionian.png
>  \version "2.24.1"
> \relative c' {
>   c d e f
>   g a b c
>   b a g f
>   e d c d
>   e f g a
>   b c b a
>   g f e d
>   c1
> }
> #+end_src
>
> Adding  #(ly:set-option 'crop #t) to the file gives a cropped output in
> the file 'ionian.cropped.png' but the ionian.png is still fullpage. I was
> looking in ob-lilypond to change the outputfile name but the easy solution
> is to just give the cropped name as the :file argument:
>
> :file ionian.cropped.png
>
> Then the file is shown inline in the #+RESULT: block. This works for other
> file formats two, like pdf and eps.
>
> Here's a short version:
>
> #+begin_src lilypond :file ionian.cropped.png
>   \Version "2.24.1"
> #(ly:set-option 'crop #t)
> \relative c' {
>   c d e f
> }
> #+end_src
>
> My bad, putting :file ionian.cropped.png only results in
ionian.cropped.cropped.png (as expected). Unclear why it worked the first
couple of times.

/Henrik


Re: [BUG] WORG example for ob-lilypond is no longer working as described (was: Moving some lisp/ob-*.el files to org-contrib - your advice?)

2023-07-25 Thread Henrik Frisk
Hi,

I have been struggling with the same issues to but have completely missed
this thread. I haven't tried the patch of ob-lilypond but testing the file
https://git.sr.ht/~bzg/worg/tree/6f69d212f41bc372426dc9b4df286638fe8f2a92/item/org-contrib/babel/examples/lilypond.org
I'm getting cropped output with pdf, but not png (generates full page).
Also, omitting the paper stuff I still get the same cropped output wit pdf:

#+begin_src lilypond :file ionian.png
 \version "2.24.1"
\relative c' {
  c d e f
  g a b c
  b a g f
  e d c d
  e f g a
  b c b a
  g f e d
  c1
}
#+end_src

Adding  #(ly:set-option 'crop #t) to the file gives a cropped output in the
file 'ionian.cropped.png' but the ionian.png is still fullpage. I was
looking in ob-lilypond to change the outputfile name but the easy solution
is to just give the cropped name as the :file argument:

:file ionian.cropped.png

Then the file is shown inline in the #+RESULT: block. This works for other
file formats two, like pdf and eps.

Here's a short version:

#+begin_src lilypond :file ionian.cropped.png
  \Version "2.24.1"
#(ly:set-option 'crop #t)
\relative c' {
  c d e f
}
#+end_src

/Henrik


Den lör 22 juli 2023 kl 10:13 skrev Ihor Radchenko :

> Jonathan Gregory  writes:
>
> > On 21 Jul 2023, Ihor Radchenko wrote:
> >
> >> The png is still a full page on my side.
> >
> > That's not what I get. You're probably missing the paper settings:
> >
> > #+begin_src lilypond :exports none
> > \version "2.20"
> > \paper {
> >   indent=0\mm
> >   tagline=""
> >   line-width=170\mm
> >   oddFooterMarkup=##f
> >   oddHeaderMarkup=##f
> >   bookTitleMarkup=##f
> >   scoreTitleMarkup=##f
> > }
> > #+end_src
>
> I feel confused. Isn't you patch aiming for auto-sizing the resulting
> page to fit the music fragment?
>
> >> Also, I am getting
> >>
> >> Processing `/tmp/babel-xQweBZ/lilypond-WGdEvi'
> >> Parsing...
> >> /tmp/babel-xQweBZ/lilypond-WGdEvi:1: warning: no \version
> >> statement found, please add
> >>
> >> \version "2.24.0"
> >>
> >> which does not look necessary.
> >
> > What is not necessary? The warning is expected. Other than that
> > everything looks fine.
>
> I guess I do not fully understand what your patch is trying to achieve.
> I thought that the patch would make it not necessary to write some extra
> boilerplate code, like \version or specifying the page size.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
>


Re: org-fontify-emphasized-text

2023-07-17 Thread Henrik Frisk
On Mon, Jul 17, 2023, 1:23 PM Ihor Radchenko  wrote:

> Henrik Frisk  writes:
>
> > For the first time I tried to enable the fontification of emphasized text
> > but quickly decided I didn't want it. But I can't seem to get rid of it.
> > For example, any part of a filename that is after an underscore is still
> > printed as subtext (expected if fontification is on). Is there anything
> > else than the above variable that controls this? emacs -Q works of course
> > fine.
>
> Can't get rid even after re-starting Emacs?
>

Exactly, I've had it for weeks annoyingly.

Henrik

>


org-fontify-emphasized-text

2023-07-17 Thread Henrik Frisk
Hi,

For the first time I tried to enable the fontification of emphasized text
but quickly decided I didn't want it. But I can't seem to get rid of it.
For example, any part of a filename that is after an underscore is still
printed as subtext (expected if fontification is on). Is there anything
else than the above variable that controls this? emacs -Q works of course
fine.

Thanks
/h


Re: Slightly OT

2023-04-03 Thread Henrik Frisk
> >> Check your org-ctrl-c-ctrl-c-hook
>> >>
>> >> I don't have it defined, but maybe you mean to do something else?
>> Calling
>> > org-set-tags gives the same result as dos C-c C-q.
>>
>> Then, `org-after-tags-change-hook'.
>>
>> More generally, you can M-x toggle-debug-on-error to see more detailed
>> backtrace.
>>
>> Ah, thanks. The only message I get is:
>
> Symbol’s function definition is void: consult-completing-read-multiple
>
> It's most definitely something in my setup, I just can't seem to find what
> :/
>

>
I finally found the problem so if someone else should run into, here it is.
I had this in my consult setup:

 (advice-add #'completing-read-multiple :override
#'consult-completing-read-multiple)

which I should have found earlier. Sorry for the noise.

/Henrik


Re: Slightly OT

2023-03-30 Thread Henrik Frisk
Den tis 28 mars 2023 kl 12:16 skrev Ihor Radchenko :

> Henrik Frisk  writes:
>
> > I've been having trouble with the deprecated function
> > consult-completing-read-multiple being undefined. This happens when I try
> > C-c C-c in org-mode to add a tag to a header. I know I fixed this issue
> on
> > my old computer, but not how.
>
> Check your org-ctrl-c-ctrl-c-hook
>
> I don't have it defined, but maybe you mean to do something else? Calling
org-set-tags gives the same result as dos C-c C-q.

Thanks!
/h


Slightly OT

2023-03-28 Thread Henrik Frisk
IHi,

I've been having trouble with the deprecated function
consult-completing-read-multiple being undefined. This happens when I try
C-c C-c in org-mode to add a tag to a header. I know I fixed this issue on
my old computer, but not how.

Any ideas?

Thanks
/Henrik


Re: org-agenda on Mac M1

2023-03-17 Thread Henrik Frisk
Den tors 16 mars 2023 kl 16:46 skrev Henrik Frisk :

>
>
> Den tors 16 mars 2023 kl 14:58 skrev Ruijie Yu :
>
>> Henrik Frisk  writes:
>>
>> > When I run org-agenda I get the sub menu but if I hit 'a' emacs hangs,
>> > though I can get it back if I hit C-g.  [...]
>> >
>> > I have no experience in debugging, but I tried to run debug-on-error
>> > with org-agenda and I got the following, which is not so helpful (to
>> > me):
>> >
>> > [...]
>> >
>> > Anyone else has a suggestion on a next step here?
>>
>> What happens when you run `M-x toggle-debug-on-quit RET' right after you
>> run `emacs -Q', and do your usual steps to reproduce the issue?  That
>> might provide a more detailed backtrace for investigation.
>>
>> Well, with emacs -Q there hasn't been a problem so far, so it's in my
> configuration or in one of the agenda files, but it appears to happen on
> random: taking out one agenda file may make it work, but then after a
> restart it doesn't work, etc.
>
>
>> In addition, what version of Emacs and of org are you using?  Posting
>> the results of these two commands would help a lot:
>>
> Ah yes, sorry!
>
>
>> - `M-: emacs-repository-version RET'
>>
> That evaluates to nil. M-x emacs-version is GNU Emacs 28.2 (build 1,
> aarch64-apple-darwin21.6.0, Carbon Version 165 AppKit 2113.6) of 2023-02-12
>
>> - `M-x org-version RET'
>>
> 9.6.1
>

After some more testing it appears that there is something in my
calendar.org file that makes org-agenda hickup. The same file works fine on
my other computer (linux) and the same emacs / org version. I have not been
able to pinpoint exactly what the error is. If I find it I will post it.

/Henrik


Re: org-agenda on Mac M1

2023-03-16 Thread Henrik Frisk
Den tors 16 mars 2023 kl 14:58 skrev Ruijie Yu :

> Henrik Frisk  writes:
>
> > When I run org-agenda I get the sub menu but if I hit 'a' emacs hangs,
> > though I can get it back if I hit C-g.  [...]
> >
> > I have no experience in debugging, but I tried to run debug-on-error
> > with org-agenda and I got the following, which is not so helpful (to
> > me):
> >
> > [...]
> >
> > Anyone else has a suggestion on a next step here?
>
> What happens when you run `M-x toggle-debug-on-quit RET' right after you
> run `emacs -Q', and do your usual steps to reproduce the issue?  That
> might provide a more detailed backtrace for investigation.
>
> Well, with emacs -Q there hasn't been a problem so far, so it's in my
configuration or in one of the agenda files, but it appears to happen on
random: taking out one agenda file may make it work, but then after a
restart it doesn't work, etc.


> In addition, what version of Emacs and of org are you using?  Posting
> the results of these two commands would help a lot:
>
Ah yes, sorry!


> - `M-: emacs-repository-version RET'
>
That evaluates to nil. M-x emacs-version is GNU Emacs 28.2 (build 1,
aarch64-apple-darwin21.6.0, Carbon Version 165 AppKit 2113.6) of 2023-02-12

> - `M-x org-version RET'
>
9.6.1


org-agenda on Mac M1

2023-03-16 Thread Henrik Frisk
Hi,

I have rrecently had to move from Linux to MacOS and setting up on an M1
computer I have run inte to ann issue I can't figure out. When I run
org-agenda I get the sub menu but if I hit 'a' emacs hangs, though I can
get it back if I hit C-g. Without my init file it works. I have gone
through all my claendar files, adding the one at a time and I have gone
through my init file using this method:

1. Remove everything except the org-agenda stuff: org-agenda works as
expected
2. Adding one piece of the config file at a time: org-agenda works after
eache addition
3. After a emacs restart org agenda fails.

I have no experience in debugging, but I tried to run debug-on-error with
org-agenda and I got the following, which is not so helpful (to me):

* org-agenda(nil)
  funcall-interactively(org-agenda nil)
  call-interactively(org-agenda record nil)
  command-execute(org-agenda record)
  execute-extended-command(nil "org-agenda" "org-agenda")
  funcall-interactively(execute-extended-command nil "org-agenda"
"org-agenda")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Anyone else has a suggestion on a next step here?

/Henrik


Re: Adding #+name to result block in babel

2022-11-29 Thread Henrik Frisk
Den tis 29 nov. 2022 kl 06:20 skrev Bill Burdick :

> Hi Henrik,
>
> On Tue, Nov 29, 2022 at 2:11 AM Henrik Frisk  wrote:
>
>> Hi,
>>
>> Maybe I'm missing something obvious but is it possible to have a name be
>> added to the result block such as running:
>>
>> #+begin_src shell
>>   echo "Hello"
>> #+end_src
>>
>> results in
>>
>> #+RESULTS:
>> #+name: my_result
>> : Hello
>>
>> Thank you!
>>
>
> Name your block, like this:
> #+name: my_result
> #+begin_src sh
> echo hello
> #+end_src
>
> When you evaluate it, you'll get this:
>
> #+name: my_result
> #+begin_src sh
> echo hello
> #+end_src
>
> #+RESULTS: my_result
> : hello
>
> Then you can use the result like this:
>
> #+begin_src sh :var value=my_result
> echo $value
> #+end_src
>
> #+RESULTS:
> : hello
>
Thank you! That was good to be reminded of, but I should have been more
explicit in my first email. I'm working with a language (sclang) that for
various reasons does not have support for variables in this way. The only
option I have to include the results from one block is by using a noweb
referens:

#+begin_src shell
   echo "Hello"
#+end_src

#+RESULTS:
#+name: my_result
: Hello

#+begin_src sclang :noweb yes
  <>
#+end_src


Adding #+name to result block in babel

2022-11-28 Thread Henrik Frisk
Hi,

Maybe I'm missing something obvious but is it possible to have a name be
added to the result block such as running:

#+begin_src shell
  echo "Hello"
#+end_src

results in

#+RESULTS:
#+name: my_result
: Hello

Thank you!


Re: citar--library-file-action

2022-10-29 Thread Henrik Frisk
Den tis 25 okt. 2022 kl 22:42 skrev Bruce D'Arcus :

> For citar support/bugs, you should report on the github issue tracker.
>
> But my guess: you need to install citar-embark, as a while ago, we
> moved the embark-related functionality into a separate package. If
> it's been a few months since you've updated, that would likely explain
> it.
>
If someone should come acress this thread I can confirm that Bruce's
suggestion works. Just install citar-embark and configure it according to
the instructions on the github page. Should I add this to the issue tracker
as well Bruce?


citar--library-file-action

2022-10-25 Thread Henrik Frisk
Hi,

After updating a bunch of packages I'm getting this error message when I
try to open an associated file via a reference:

[cite:@key]

Before it was working fine via emark either by clicking on the reference or
by running embark-act on it. Now I get this instead:

citar--library-file-action: Symbol’s function definition is void: open

Any suggestions?

/Henrik


Re: org-cature-ref

2022-07-26 Thread Henrik Frisk
Den tis 19 juli 2022 kl 15:39 skrev Ihor Radchenko :

>
> There is nothing fancy there. Just
>
> "%{fetch-bibtex}* TODO %?%(org-capture-ref-get-bibtex-field :title)"
> ":PROPERTIES:"
> ":ID: %(org-capture-ref-get-bibtex-field :key)"
> ":CREATED: %U"
> ":END:"
> "#+begin_src bibtex"
> "%(org-capture-ref-get-bibtex-field :bibtex)"
> "#+end_src bibtex"
>
> Yeah, now that I see it I'm embarrased I didn't figure it out by myself.
Sigh.


> > 2. When you write that there is support for Google Scholar "BiBTeX page",
> > what do you mean? In a Google scholar search, if I click "Cite" and then
> > choose BiBTeX, I don't get the expected result, but maybe you are
> referring
> > to something else?
>
> I am referring to what you said: "Cite" → "BibTeX". The opened page
> should contain the BibTeX entry text. This page can be captured.
>
> For example, the first item (Cite → BibTeX) in
> https://scholar.google.com.sg/scholar?q=test
>
> can be captured on my side.
>
> I do not recommend this method though. Google Scholar does not provide
> high quality BibTeX entries with DOI and sometimes provides plain wrong
> entries.
>
> This doesn't actually work for me. From the link above I'm getting:

#+begin_src bibtex
@misc{Scholar_Googleusercontent__506,
  created =  {[2022-07-26 tis 12:31]},
  howpublished = {Scholar.Googleusercontent},
  note = {Online; accessed 26 juli 2022},
  url =
  {
https://scholar.googleusercontent.com/scholar.bib?q=info:4QIfrBW26fcJ:scholar.google.com/=citation=CgXRptZKEN2CnUnCgY8:AAGBfm0AYt_EmY-OX1Eyi54caLD4JrIGdgFtjnKP=AAGBfm0AYt_EmSP-yLhTDNSeuVdqtJ0UcrDks5SL=4=citation=-1=sv
},
}
#+end_src bibtex

where the expected would be

#+begin_src bibtex
@article{algozzine2001effects,
  title={Effects of interventions to promote self-determination for
individuals with disabilities},
  author={Algozzine, Bob and Browder, Diane and Karvonen, Meagan and
Test, David W and Wood, Wendy M},
  journal={Review of Educational Research},
  volume={71},
  number={2},
  pages={219--277},
  year={2001},
  publisher={Sage Publications Sage CA: Thousand Oaks, CA}
}
#+end_src bibtex

But, for the reasons you note below, this is not that important. I'm really
happy to have the general capture template working.

Thanks again!


Re: org-cature-ref

2022-07-18 Thread Henrik Frisk
Den mån 18 juli 2022 kl 01:56 skrev Ihor Radchenko :

> Henrik Frisk  writes:
>
> >> Could you please provide a bit more details on what you did, what you
> >> expected to get, and what you got?
> >>
> >> Yes, of course!
> >
> > I saw in another thread recently that you had the bibtex captured as a
> code
> > block (begin_src bibtex) which I wasn't able to get. In the documentation
> > at https://github.com/yantar92/org-capture-ref#org819faa2 it says:
> >
> > "Alternatively it is possible to use org-capture-ref-get-bibtex-field to
> > get metadata directly (:bibtex-string field will contain formatted BiBTeX
> > entry).
> >
> > This, I thought, was the way to achieve this. What I get is:
> >
> > :BOOKMARK:misc:
> > :PROPERTIES:
> > :TITLE:Something
> > :BTYPE:misc
> > :ID:   Something_org_captur_ref_extrac_9c0
> > :AUTHOR:   someone
> > :CREATED:  [2022-07-12 tis 17:26]
> > :HOWPUBLISHED: Github
> > :NOTE: Online; accessed 12 juli 2022
> > :RSS:  https://something.org
> > :URL:   https://something.org
> > :END:
>
> Did you try to customize org-capture-ref-capture-template?
>
> Its default template is
>
> "%{fetch-bibtex}* TODO %?%{space}%{org-entry}"
> "%{extra}"
>
> %{org-entry} part is responsible for generating property drawer via
> org-capture-ref-headline-format-function.
>
> If you prefer adding bibtex directly, you may want something like
>
> "%{fetch-bibtex}* TODO %?%(org-capture-ref-get-bibtex-field :title)"
> "#+begin_src bibtex"
> "%(org-capture-ref-get-bibtex-field :bibtex)"
> "#+end_src bibtex"
>
> That's what I was trying to do, but now it works! This is really
brilliant, thank you!
Note: it should be:

"%(org-capture-ref-get-bibtex-field :bibtex-string)"

in the above example.

A couple of questions more:

1. In the examples at the beginning of the project's  github you have
examples that have a combination of prperties and bibtex source, with
preperties such as ID and CREATED. These could be helpful but I can't
figure out how to add them with my limited knowledge.
2. When you write that there is support for Google Scholar "BiBTeX page",
what do you mean? In a Google scholar search, if I click "Cite" and then
choose BiBTeX, I don't get the expected result, but maybe you are referring
to something else?

Again, thank you. This will make my life easier!

/henrik


Re: org-cature-ref

2022-07-17 Thread Henrik Frisk
Den lör 16 juli 2022 kl 11:16 skrev Ihor Radchenko :

> Henrik Frisk  writes:
>
> >>> Is so, you probably need
> >>>
> >>> org-protocol://capture?template...
> >>> instead of
> >>> org-protocol://capture-html?template...
> >>>
> >>> Thanks, that was the issue and it works fine now. However, I can't seem
> >> to get the org-capture-ref-get-bibtex-field to work by simply replacing
> org-capture-ref-headline-format
> >> with it. Not sure where the ":bibtex-string" should go in the template
> >> which is probably why it doesn't work.
>
> Could you please provide a bit more details on what you did, what you
> expected to get, and what you got?
>
> Yes, of course!

I saw in another thread recently that you had the bibtex captured as a code
block (begin_src bibtex) which I wasn't able to get. In the documentation
at https://github.com/yantar92/org-capture-ref#org819faa2 it says:

"Alternatively it is possible to use org-capture-ref-get-bibtex-field to
get metadata directly (:bibtex-string field will contain formatted BiBTeX
entry).

This, I thought, was the way to achieve this. What I get is:

:BOOKMARK:misc:
:PROPERTIES:
:TITLE:Something
:BTYPE:misc
:ID:   Something_org_captur_ref_extrac_9c0
:AUTHOR:   someone
:CREATED:  [2022-07-12 tis 17:26]
:HOWPUBLISHED: Github
:NOTE: Online; accessed 12 juli 2022
:RSS:  https://something.org
:URL:   https://something.org
:END:

/Henrik


Re: org-cature-ref

2022-07-12 Thread Henrik Frisk
Den tis 12 juli 2022 17:51Henrik Frisk  skrev:

>
>
> Den tors 7 juli 2022 kl 12:48 skrev Ihor Radchenko :
>
>> Henrik Frisk  writes:
>>
>> > Ihor Radchenko recently mentioned org-capture-ref and I decided to try
>> to
>> > use it, but I'm having trouble getting it to work. I have org-protocl
>> > working for me so I'm suspecting that it is the syntax of the
>> bookmarklet
>> > I'm using that is at fault. I merely changed the capture template key
>> from
>> > the example here:
>> >
>> >
>> https://github.com/alphapapa/org-protocol-capture-html#org-protocol-instructions
>> >
>> > but that doesn't work (I get an empty buffer with what looks as the the
>> > link contents as name). Apart from that I have just copied the template
>> > from here:
>>
>> Do I understand correctly that you used the following bookmarklet:
>>
>> javascript:location.href = 'org-protocol://capture-html?template=w=...
>>
>> ?
>>
>> Is so, you probably need
>>
>> org-protocol://capture?template...
>> instead of
>> org-protocol://capture-html?template...
>>
>> Thanks, that was the issue and it works fine now. However, I can't seem
> to get the org-capture-ref-get-bibtex-field to work by simply replacing 
> org-capture-ref-headline-format
> with it. Not sure where the ":bibtex-string" should go in the template
> which is probably why it doesn't work.
>
> /h
>
> Failed to reply to list. Sorry.

>
>


org-cature-ref

2022-07-06 Thread Henrik Frisk
Hi,

Ihor Radchenko recently mentioned org-capture-ref and I decided to try to
use it, but I'm having trouble getting it to work. I have org-protocl
working for me so I'm suspecting that it is the syntax of the bookmarklet
I'm using that is at fault. I merely changed the capture template key from
the example here:

https://github.com/alphapapa/org-protocol-capture-html#org-protocol-instructions

but that doesn't work (I get an empty buffer with what looks as the the
link contents as name). Apart from that I have just copied the template
from here:

https://github.com/yantar92/org-capture-ref

Thanks for any hints!

/H


Re: About babel and header arguments

2022-04-11 Thread Henrik Frisk
> > #+begin_src scheme :var y=10 :results value
> >   (+ 10 y)
> > #+end_src
> >
> > #+RESULTS:
> > : 10
>
> I'm surprised by this one - shouldn't we expect the result 20 ?
>

Hi Neil, yes, that was a typo, I pasted in the wrong result. Sorry for the
confusion!

/h


Re: About babel and header arguments

2022-04-10 Thread Henrik Frisk
> Hm. You are expecting (12 10)?
>
> Yes, sorry for not being clear.


>
> > #+begin_src scheme :var y=10 :results output
> >   ((lambda (x) (display x)) '(12 y))
> > #+end_src
>
> The quote extends to the whole (parenthesized) expression, i.e.
> the y is quoted too, in there, so it's the symbol y, so that
> output is correct:
>
> > #+RESULTS:
> > : (12 y)

Yes, that makes sense now that I see it.


>
> (That's Scheme, not Babel doing it). I don't know where you
> want to go to, but perhaps try:
>
>   (list 12 y)
>
> instead: this would make a list of whatever 12 evaluates to (this
> would be 12) and y evaluates to (this would be 10).
>

Yes, that  works, thank you!
/h


About babel and header arguments

2022-04-10 Thread Henrik Frisk
Hi,

I'm not a skilled (scheme) programmer so maybe there is something obvious
I'm missing here. In the first example the header argument y is interpreted
as I would expect it, but in the second it isn't:

#+begin_src scheme :var y=10 :results value
  (+ 10 y)
#+end_src

#+RESULTS:
: 10

but not this:

#+begin_src scheme :var y=10 :results output
  ((lambda (x) (display x)) '(12 y))
#+end_src

#+RESULTS:
: (12 y)

Thanks in advance.


Re: org-cite and org-ref-cite

2022-02-27 Thread Henrik Frisk
Den lör 26 feb. 2022 kl 16:11 skrev John Kitchin :

> I would not recommend org-ref-cite (
> https://github.com/jkitchin/org-ref-cite). It was an early approach to
> trying to integrate org-ref with oc-cite. As far as I know, it worked fine
> for that, and was pretty complete for citations, but I have abandoned this
> approach and archived the repo. If anyone would like to take over this repo
> I would be happy to transfer it.
>
> If you are looking for something above and beyond the default oc-cite
> capabilities, https://github.com/bdarcus/citar is probably a better
> choice than org-ref-cite as it is actively developed.
>
>
I see. Didn't realize that. I will look into citar then, thanks!

/Henrik


Re: org-cite and org-ref-cite

2022-02-26 Thread Henrik Frisk
Den fre 25 feb. 2022 kl 13:56 skrev Eric S Fraga :

> On Friday, 25 Feb 2022 at 08:50, Henrik Frisk wrote:
> > The only thing I can't seem to sort out is to change the style of the
> > citation. Regardless where I do it I get the error "Wrong type
> > argument: org-cite-processor,"
>
> It would help if you could post a minimal example.
>
> Of course, I should have done it right away. This is related to
org-ref-cite:

If I click on a reference, say [cite/t:@Smith2022] I get a hydra menu in
which I can choose 's: Change style'. Choosing that generates a 'Wrong type
argument: org-cite-processor,' message. Same if I do C-u C-c \ to insert a
new refernce and choose style.

>
> > Another question: if I would like to export to LaTeX but with citation
> > commands rather than formated citations, would that be possible? I am
> > sorry if I'm missing something obviuos.
>
> Yes, definitely possible.  I have the following:
>
> #+cite_export: bibtex plain
>
> Excellent, that was what I was looking for. Thanks!
>

/Henrik


org-cite and org-ref-cite

2022-02-25 Thread Henrik Frisk
Hi,

I have now finally got around to changing my setup to  org-cte. It works
really well! The only thing I can't seem to sort out is to change the style
of the citation. Regardless where I do it I get the error "Wrong type
argument: org-cite-processor,"

Another question: if I would like to export to LaTeX but with citation
commands rather than formated citations, would that be possible? I am sorry
if I'm missing something obviuos.

Thanks,
/Henrik


Re: Tables and org babel

2021-11-08 Thread Henrik Frisk
Den mån 8 nov. 2021 kl 12:54 skrev Greg Minshall :

> sorry, in fact, =-Q= doesn't matter:
>
> failing:
> - Org mode version 9.5 (9.5-g531577 @
> /home/minshall/.emacs.d/straight/build/org/)
>
> succeeding:
> - Org mode version 9.5 (9.5-gced2b3 @
> /home/minshall/.emacs.d/straight/build/org/)
>
> cheers, Greg
>

Thanks Greg,

I updated to latest org and it worked again. God, this was driving me crazy
last night!

Problem solved with Org mode version 9.5 (release_9.5-220-g343e22)

/Henrik


Tables and org babel

2021-11-07 Thread Henrik Frisk
Hi,

I'm having troubles getting more than one cell from an org table as a
variable in org-babel. Trying this example from the orgmode manual (
https://orgmode.org/manual/Environment-of-a-Code-Block.html):

#+NAME: example-table
| 1 | a |
| 2 | b |
| 3 | c |
| 4 | d |

#+BEGIN_SRC emacs-lisp :var data=example-table[,0]
  data
#+END_SRC

yields no result and in the *Messages* buffer:

executing Emacs-Lisp code block...
(data '(1 2 3 4))
Loading reftex...done
org-babel-insert-result: Wrong type argument: markerp, nil

This has worked for me in the past so I'm not sure what has changed other
than upgrading to emacs 27.2. Referencing a single cell [0,0] works as
expected.

Org 9.5
Emacs 27.2

Thanks for any help
Henrik


Re: Build agenda asynchronously

2021-08-17 Thread Henrik Frisk
Den ons 18 aug. 2021 kl 02:17 skrev Tim Cross :

>
> Milan Zamazal  writes:
>
> Actually, that one has been on my todo list to cehck out for a while.
> Might be time to bump the priority a bit!
>
> I just started using it and it works really well so far!


Re: Build agenda asynchronously

2021-08-17 Thread Henrik Frisk
Den tis 17 aug. 2021 kl 08:54 skrev Dr. Arne Babenhauserheide <
arne_...@web.de>:

>
> Tim Cross  writes:
>
> > Emacs' support for asynchronous operations is at best primitive. There
> > is built-in support for calling processes asynchonously and
> > there is some other development work to set the stage for adding threads,
> > but I think general asynchronous processing inside Emacs is a long way
> > off. A lot of how Emacs lisp works fundamentally lacks the low level
> > control structures necessary to make data structures and operations on
> > those structures thread safe. This means you have to work at a very low
> > level in order to ensure code is thread safe and that simply isn't
> > practical. Even defining the basic model for an asynchronous emacs lisp
> > is non-trivial and once you have the model, you ahve to implement it.
>
> Maybe it could be possible to fire up a second Emacs and retrieve the
> agenda-buffer?
>
> This is what I do for commands like exporting the agenda which can take a
while with the -nw flag, but that is of course unsatisfactory for most use
cases.

/Henrik


Re: a repeater doesn't increment

2021-07-22 Thread Henrik Frisk
Hi!

Den tors 22 juli 2021 03:49Jude DaShiell  skrev:

> Does enough material exist on werg tutorials that document how to get a
> repeater operational?  That or maybe I don't understand repeaters.  Had
> the repeater I tried to use worked correctly it would have advanced the
> original date by 4 weeks when that date got copied down to another cell.
> I selected the whole line including both verticals and perhaps this works
> when only a time stamp is copied.
>

Check out this explanation:

https://karl-voit.at/2017/01/15/org-clone-subtree-with-time-shift/

I find it helpful and most of the time i prefer to use the
org-clone-subtree-with-time-shift function as it gives me more control. In
general, the date notation (+1w) is intended for the agenda wiew.

Hope it helps,
/Henrik


Re: org-attach a directory?

2021-06-15 Thread Henrik Frisk
Den fre 11 juni 2021 18:37John Kitchin  skrev:

> I discovered another way to do this that is already built in with
> `org-attach-dired-to-subtree` that would help sometimes.
>
> You split your window, open dired in one of them, mark some files, and
> then run that command in the dired window.
>
> John
>
>> Should have thought of this when you first asked if i had understood your
question. This is a very useful function.

/Henrik

>
>>
>>


Re: org-attach a directory?

2021-06-08 Thread Henrik Frisk
Den tis 8 juni 2021 kl 17:56 skrev John Kitchin :

> Is it possible to attach a directory to an org heading?
>
>
> Yes, you do arg-attach-set-directory. After that you need to sync it to
make the files in the directory visible: org-attach-sync

It's quite neat, I use it all the time.

/Henrik


Symolic link messes up org-attach?

2021-02-22 Thread Henrik Frisk
Hi,

I have migrated from a OSX based system to a linux/debian system. I have
all my main org files in a directory ~/org and in OSX this was a symbolic
link to ~/a-hard-disk/org (it may have been an alias, ot sure). In Ubuntu,
however, I have lots of trouble with org-attach: I attach a file using say
copy and when I call C-c C-a o there are no attachments. Sometimes it works
but next time I open the file there are no attachments. I experienced
similar issues with links:

[[file:./img/myimage.png]]

was not found but a qualified path worked.

Could this be because of the symlink to my org directory? Is there a better
way to do it?

Best,
Henrik


Re: [O] ox-pandoc fails to load

2019-08-03 Thread Henrik Frisk
Sorry about the noise. It turned out to be something other than org that
was the fault.

/Henrik

Den lör 3 aug. 2019 kl 11:49 skrev Henrik Frisk :

> Hi,
>
> I've been trying to get the ox-pandoc (
> https://github.com/kawabata/ox-pandoc) exporter to work. I have installed
> it from MELPA but when I try to load it, manually or as is recommended on
> the above page:
>
> (with-eval-after-load 'ox
>   (require 'ox-pandoc))
>
> I get a "Cannot use unknown "org" backend as parent" error.
>
> Any suggestions?
>
> Thanks,
> /Henrik
>


[O] ox-pandoc fails to load

2019-08-03 Thread Henrik Frisk
Hi,

I've been trying to get the ox-pandoc (
https://github.com/kawabata/ox-pandoc) exporter to work. I have installed
it from MELPA but when I try to load it, manually or as is recommended on
the above page:

(with-eval-after-load 'ox
  (require 'ox-pandoc))

I get a "Cannot use unknown "org" backend as parent" error.

Any suggestions?

Thanks,
/Henrik


Re: [O] ob-lilypond and 'Symbol’s function definition is void: org-babel-get-header'

2018-09-02 Thread Henrik Frisk
Den tis 21 aug. 2018 23:39Nicolas Goaziou  skrev:

> Hello,
>
> Henrik Frisk  writes:
>
> > I have been trying out ob-lilypond and it works really well, except for
> the
> > arrange mode. Any attempt to run ly-tangle results in 'Symbol’s function
> > definition is void: org-babel-get-header' and so does an attempt to
> export
> > a file, such as the example file, in basic mode to html for instance.
> >
> > I was thinking it was related to sh/shell since this appears to be a
> common
> > issue with regard to this error, but the ob-lilypond does not appear to
> use
> > any reference to sh (the doc for ob-lilypond does). I also tried to load
> > ob-core as was suggested in some post but that didn't work either.
> >
> > Other tangle other languages works fine.
> >
> > Any suggestions?
>
> `org-babel-get-header' was removed in Org 9.0 and current ob-lilypond.el
> doesn't call this function. My guess is you are mixing a new Org release
> with an old "ob-lilypond.el".
>

Sorry for not replying earlier, I missed this message. Thanks, that points
me in a useful direction I think!

Best,
Henrik

>


[O] Newbie question

2018-08-01 Thread Henrik Frisk
Hi,

I'm new with Scheme and new with org babel so excuse me if I am missing
something obvious.
I have this bit of (simplified) Scheme code to generate a list of lists:

#+name: chromatic
#+begin_src scheme :noweb yes
  (map (lambda (x)
 (cond ((< x 4) (list 0 1))
   ((equal? x 4) (list 2 0))
   ((> x 4) (list 1 1
   (list 0 1 2 3 4 5 6 7 8 9 10 11))
#+end_src

It appears to be working fine outputting a table such as

#+RESULTS:
| 0 | 1 |
| 0 | 1 |
| 0 | 1 |
 ...

For another function in Lilypond, also in scheme I need it to be a (list
(list 0 1) (list 0 1)...) as in the variable seq below:

 #+begin_src scheme :noweb yes
 $(let ((random-state (seed->random-state (current-time)))
   (seq (list (list 0 0) (list 0 1/2) (list 1 0) (list 1 1/2) (list 2
0) (list 3 0) (list 3 1/2) (list 4 0) (list 4 1/2) (list 5 0) (list 5 1/2)
(list 6 0
   (make-sequential-music
(map (lambda (x p)
   (let ((idx (random 12 random-state)))
 (make-music 'NoteEvent
'duration (ly:make-duration 2 0 1/1)
'pitch (ly:make-pitch 0 (car p) (car (cdr p))
   (make-list (length seq)) seq)))
 #+end_src

I can do:

(seq <>)

if alist is:

#+name: alist
#+begin_src scheme
  (list (list 0 0) (list 0 1/2) (list 1 0) (list 1 1/2) (list 2 0)
(list 3 0) (list 3 1/2) (list 4 0) (list 4 1/2) (list 5 0) (list 5 1/2)
(list 6 0))
#+end_src

but what I would like to be able to do is to have have the noweb reference
be to the 'chromatic' function above as in:

(seq <>)

but that doesn't work. Maybe what I am trying to do is not possible, maybe
there is a limitation on ob-lilypond, but it seems to me that the result of
my function chromatic above spits out ((0 1) (0 1)... ) and that this is
the cause it doesn't work.

Again, I am really new to this...

The workaround I am doing is to format the output of chromatic into a
proper list och lists and then add it by noweb reference.

Any hints welcome.
/Henrik


[O] ob-lilypond and 'Symbol’s function definition is void: org-babel-get-header'

2018-07-29 Thread Henrik Frisk
Hi,

I have been trying out ob-lilypond and it works really well, except for the
arrange mode. Any attempt to run ly-tangle results in 'Symbol’s function
definition is void: org-babel-get-header' and so does an attempt to export
a file, such as the example file, in basic mode to html for instance.

I was thinking it was related to sh/shell since this appears to be a common
issue with regard to this error, but the ob-lilypond does not appear to use
any reference to sh (the doc for ob-lilypond does). I also tried to load
ob-core as was suggested in some post but that didn't work either.

Other tangle other languages works fine.

Any suggestions?

/H