Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-05-14 Thread Tor-björn Claesson
"' org menu. > > + > > +This option uses the same syntax as `transient-define-prefix', see Info > node > > +`(transient)Binding Suffix and Infix Commands'. In addition, it is > possible > > +to specify a function call for the COMMAND part, where ARGUME

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-04-15 Thread Tor-björn Claesson
thesis-book without problem. I have not tested using a menu system other than transient. What would be a good candidate for this? Does this look generally ok otherwise? If so I'll start fixing documentation. Cheers, Tor-björn Den sön 13 apr. 2025 kl 21:48 skrev Tor-björn Claesson : >

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-04-13 Thread Tor-björn Claesson
tation-object !prefix)) > fails where (plist-get (transient-scope) :prefix) complains because > :prefix is a void-variable. > > I feel the two problems point to some lack of understanding on my part, > and I would be very grateful for some pointers on how to proceed. Why is > the literal :prefix different from the :prefix I generate with make-symbol? > > Cheers, > Tor-björn >

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-04-13 Thread Tor-björn Claesson
lains because :prefix is a void-variable. I feel the two problems point to some lack of understanding on my part, and I would be very grateful for some pointers on how to proceed. Why is the literal :prefix different from the :prefix I generate with make-symbol? Cheers, T

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-03-17 Thread Tor-björn Claesson
er, during runtime. Something like `(progn (setq ..) > (transient-define-prefix ...)) Thanks! I was wondering how to to (begin ...) in elisp=) This still does not fix the problem for some reason, I will dig some more! > Tor-björn Claesson writes: > >> It adds om.el, which contains the sta

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-02-27 Thread Tor-björn Claesson
ry to follow citations. Cheers Tor-björn Den lör 22 feb. 2025 kl 21:41 skrev Tor-björn Claesson : > Thanks again, I'll be back :-) > > Cheers, > Torbjörn > > Den lör 22 feb. 2025 16.18Ihor Radchenko skrev: > >> Tor-björn Claesson writes: >> >> >&g

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-02-22 Thread Tor-björn Claesson
Thanks again, I'll be back :-) Cheers, Torbjörn Den lör 22 feb. 2025 16.18Ihor Radchenko skrev: > Tor-björn Claesson writes: > > >> 1. I am looking at C-- C-u prefix, and I am not sure if it is ideal > >>What I think might be better is: > >>- mak

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-02-21 Thread Tor-björn Claesson
g to make this work. Is it OK to use (eval `(transient-define-prefix ...)) here? Also, I find it a bit easier to write this as a function rather than a macro, but this makes calling it a bit uglier. Should I try define this as a macro, or is a function acceptable? Cheers, Tor-björn

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2025-01-26 Thread Tor-björn Claesson
lowing: > Sounds good! > > 1. You finish your patch for org-cite > My current version is attached. The difference vs. v5 is that the default action is customizeable. What do you think? Cheers, Tor-björn From 571935cbb91589a20a9cc05b37156bb7c9186e24 Mon Sep 17 00:00:00 2001 From: =

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2024-12-24 Thread Tor-björn Claesson
Excellent! I'll finish the citation follower prototype, so we know what kind of shape we are aiming for:) Merry christmas! Torbjörn Den tis 24 dec. 2024 09.17Juri Linkov skrev: > > What I am leaning towards now (although, I hope that more ideas can > > still surface in this thread), is simply r

Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?

2024-12-22 Thread Tor-björn Claesson
uld be happy to try to make this, but am a bit swamped with the holidays, so it would have to wait a bit. Cheers, Tor-björn

Re: Fwd: Org-cite: Replace basic follow-processor with transient menu?

2024-12-11 Thread Tor-björn Claesson
and `org-cite-basic--get-field'. And this time with a patch, apologies. /Tor-björn >From 7e9e0c64fbda2dcb67d8c8421d1c9923ca93e8b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= Date: Tue, 12 Nov 2024 11:09:16 +0200 Subject: [PATCH] lisp/oc-basic.el: Transien

Re: Fwd: Org-cite: Replace basic follow-processor with transient menu?

2024-12-11 Thread Tor-björn Claesson
e-basic--get-key helper function, which takes the behaviour of org-cite-basic-goto to extract citation keys from a citation-or-citation-reference. The other option is of course to just use (org-element-property :key !citation). Which approach would be better? Cheers, Tor-björn

Re: Fwd: Org-cite: Replace basic follow-processor with transient menu?

2024-11-25 Thread Tor-björn Claesson
cope))) >> +(!prefix (cadr (transient-scope > > This can be improved a bit. > Rather than storing transient scope as (list citation prefix), we can > use plist: (list :citation citation :prefix prefix). Then, we can do > (let ((!citation (plist-get (trans

Fwd: Org-cite: Replace basic follow-processor with transient menu?

2024-11-17 Thread Tor-björn Claesson
Ihor Radchenko writes: > Tor-björn Claesson writes: > >> Den tis 12 nov. 2024 kl 20:02 skrev Ihor Radchenko : >>> >>> I am not sure if it is a good idea. >>> Commands in org-cite-basic-follow-actions may or may not need it, while >>> your code w

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-11-12 Thread Tor-björn Claesson
(org-element-property :key (car (transient-scope) > > `org-open-at-point' may be called with point at citation rather than > citation reference. Citation object does not have :key property. > > I think that we should drop !citation-key spec and instead specify

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-11-11 Thread Tor-björn Claesson
Here is my first attempt. I have read the commit guidelines, but it is very possible that I have misunderstood or just missed something, so I'm grateful for any feedback! Cheers, Tor-björn Den sön 10 nov. 2024 kl 18:40 skrev Ihor Radchenko : > > Tor-björn Claesson writes: > >

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-11-10 Thread Tor-björn Claesson
; > FSF threshold for "tiny" changes is 15 lines of code. > I doubt that you can fit the changes within 15 lines, so yes, you do > need copyright assignment. See > https://orgmode.org/worg/org-contribute.html#copyright Ok, thanks! Cheers Tor-björn

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-11-05 Thread Tor-björn Claesson
Ihor Radchenko writes: > Tor-björn Claesson writes: > >> I feel that the guard option does the right thing by directly fixing >> the pattern matching - but what approach do you prefer? > > I provided the guard example just for your reference. > The preference for a

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-11-02 Thread Tor-björn Claesson
ent-property :key (car > (transient-scope) > (,fn ,@fn-args))) > ,@other))) > (other other))) I feel that the guard option does the right thing by directly fixing the pattern matching - but what approach do you prefer? Is this starting to be a good time for me to produce a patch? Cheers, Tor-björn

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-11-02 Thread Tor-björn Claesson
eparately? This just keeps getting better=) Thanks and cheers! Tor-björn

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-11-01 Thread Tor-björn Claesson
'vector #'org-cite-basic-follow--parse-suffix-specification group)) org-cite-basic-follow-actions))) Cheers! Tor-björn Den tors 31 okt. 2024 kl 22:48 skrev Tor-björn Claesson : > > Thanks! > > Here is another take=) > > (defcustom org-cite

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-10-31 Thread Tor-björn Claesson
(lambda (group) (cl-map 'vector #'org-cite-basic-follow--parse-suffix-specification group)) org-cite-basic-follow-actions))) Cheers, Tor-björn

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-10-31 Thread Tor-björn Claesson
king the time to help me with this=) Cheers, Tor-björn

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-10-29 Thread Tor-björn Claesson
) (`(,key ,desc ,suffix) (list key desc suffix group)) org-cite-basic-follow-actions))) Prefixes of :class transient-columns expect a vector of vectors of a string and lists, so we need to use a map that produces vectors. This works. Do the code look OK to you? I'll prepare a patch if that is the case. Cheers, Tor-björn

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-10-28 Thread Tor-björn Claesson
point of view! Thanks! I will keep trying, but I must find the spare time to learn more about mapping and pattern matching in elisp, so this might take a while. In case Ihor wants to just fix it, please go ahead :-) It would be good if we could match against the case of '(key desc suffix) as well, so that we could include otherwhere defined suffixes. Cheers, Tor-björn

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-10-27 Thread Tor-björn Claesson
Hi and thanks for these suggestions! I have some time away from the family tomorrow evening, and will try to make a new prototype along those lines:) Getting back! Cheers/Tor-björn Den sön 27 okt. 2024 10.07Ihor Radchenko skrev: > Jonas Bernoulli writes: > > > ... > > But t

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-10-22 Thread Tor-björn Claesson
d knowledge of these transient > details (how to get the arglist) from users. > > I am wondering if we can somehow plug the existing commands passing the > arguments without any extra setup on the user side. The lambda form is much neater with your (transient-scope) suggestion: (lambda (citation prefix) (interactive (transient-scope)) ...) Is this simple enough? I don't feel a macro would improve the situation. Best regards, Tor-björn

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-09-24 Thread Tor-björn Claesson
Ihor Radchenko writes: > Tor-björn Claesson writes: > >>> I do think that having extended menus for org-open-at-point could be >>> useful. Not by default, but, for example, with a prefix argument. >>> >> This is a good point, but of much larger scope tha

Re: Org-cite: Replace basic follow-processor with transient menu?

2024-09-17 Thread Tor-björn Claesson
doi.org/"; "" doi))]] (interactive) (transient-setup 'org-cite-basic-follow nil nil :scope (list datum _))) Best regards, Tor-björn Claesson

Org-cite: Replace basic follow-processor with transient menu?

2024-09-14 Thread Tor-björn Claesson
-mode, in case you would be interested. Best regards, Tor-björn Claesson (transient-define-prefix tbc/follow-reference (datum &optional _) "How should we follow references?" [["Open" ("b" "bibliography entry" (lambda () (interacti

Re: Feature request: IDs for everything

2024-03-06 Thread Tor Erlend Fjelde
Oh, that's great news! Will be very useful; thanks Ihor! Unfortunately life has come in the way so I haven't had the chance to pursue this further at the moment. All the best, Tor On Wed, 06/03/2024, Ihor Radchenko wrote: > Tor Erlend Fjelde writes: > >>> As an alt

Re: Feature request: IDs for everything

2023-10-25 Thread Tor Erlend Fjelde
m like a sub-optimal solution vs. just adding support for more general IDs, and so I thought it would be better to see if that could be done first (hence I'm here). All the best, Tor On Sat, 21/10/2023, Ihor Radchenko wrote: > Tor Erlend Fjelde writes: > >> I was wondering

Re: Feature request: IDs for everything

2023-10-21 Thread Tor Erlend Fjelde
les and -headlines. Hope that clearifies a bit! All the best, Tor On Fri, 20/10/2023, Rodrigo Morales wrote: > Currently, headlines can have an ID (see minimal working example below): > > #+BEGIN_SRC org > * My headline 1 > * My headline 2 > :PROPERTIES: > :ID: e8745be0-

Feature request: IDs for everything

2023-10-20 Thread Tor Erlend Fjelde
and make use of. All the best, Tor

Re: [BUG] inserting notes at end

2022-07-27 Thread Tor Kringeland
Ihor Radchenko writes: > I get note after empty lines below the headline in both the cases. > This behavior is intentional according to org-log-beginning. I see. Maybe this could be noted in the docstring for org-add-note? If org-log-into-drawer is non-nil, then the behavior is different (the

Re: [PATCH] * lisp/org.el (org-store-log-note): Do not indent empty lines

2022-07-27 Thread Tor Kringeland
Ihor Radchenko writes: > See the attached patch. Thanks! This works as expected now.

[BUG] inserting notes at end

2022-07-26 Thread Tor Kringeland
If our Org file is #+begin_example * a heading text #+end_example And we insert an empty note, we get #+begin_example * a heading - Note taken on [2022-07-26 Tue 16:10] text #+end_example instead of the expected #+begin_example * a heading - Note taken on [2022-07-26 Tue 16:10] text #+end_e

[WISH LIST] Remove leading spaces in notes

2022-07-26 Thread Tor Kringeland
Currently if you insert a note on a heading that has double newlines in it, the empty newlines will be padded with spaces. For example #+begin_example * heading - Note taken on [2022-07-26 Tue 16:00] \\ note with newlines it in #+end_example It would be nice to (if this is not con

Re: [BUG] Avoid folding drawers using `org-clock-goto'

2022-07-23 Thread Tor Kringeland
Ihor Radchenko writes: > Could you please elaborate why you prefer not folding drawers in > `org-clock-goto'? If I already unfolded a drawer (for example with notes), then I want to keep it open, at least as long as the heading itself is unfolded. For example if I have #+begin_example * some t

[BUG] Avoid folding drawers using `org-clock-goto'

2022-07-23 Thread Tor Kringeland
When calling `org-clock-goto' the drawers of the heading it goes to are closed, if they're open.

Re: Taking notes of videos in Emacs

2022-07-08 Thread Tor Kringeland
Gerardo Moro writes: > Is there something similar in Emacs? mpv.el [1] is a starting point. You can play videos from YouTube (and other websites) in mpv if you install yt-dlp [2] (or another youtube-dl fork). With a little bit of hacking you can get all the features of the package you mention

Re: [BUG] formatting at edges of link

2022-07-04 Thread Tor Kringeland
Ihor Radchenko writes: > All the examples above are not valid links. > Note that Org link consist of link itself and a description: > [[link][description]]. I was a bit fast in my explanation. I mean formatting the description, of course. > > Descriptions will be correctly formatted. > > [[htt

Re: [BUG] wrapping links

2022-07-04 Thread Tor Kringeland
Ihor Radchenko writes: > Could you please elaborate? > The above link (if changed to more correct [[https://orgmode.org][this > link looks ugly]] will be exported without the newlines and extra > spaces. Yes. I don't mean in export, but in org-mode itself. Since the second line in the example

[BUG] wrapping links

2022-07-03 Thread Tor Kringeland
When a link goes over a (real) line wrap for indented lines, the leading spaces get formatted as part of the link and this looks ugly. #+begin_example - [[this link looks ugly]] #+end_example It would be nice to at least have an option to disable formatting of the leading (and trailing) spaces.

[BUG] formatting at edges of link

2022-07-03 Thread Tor Kringeland
For example [[normal /italic/ normal]] formats correctly as a link, but [[/italic/]] doesn't format to italic. A workaround is to write /[[italic]]/ but sometimes the formatting is part of my link names, so it's a bit annoying to reformat to get correct formatting.

Re: [PATCH] Re: [BUG] Adding note to heading without newline at the end

2022-06-22 Thread Tor Kringeland
Ihor Radchenko writes: > Confirmed. > > Samuel, do you want to try fixing this? > It should be fairly easy to debug. Nice. But these are distinct bugs, it seems like. The one you sent a patch for earlier fixes the former bug (which is also present in Org 9.5). While my original problem is onl

Re: [PATCH] Re: [BUG] Adding note to heading without newline at the end

2022-06-21 Thread Tor Kringeland
Ihor Radchenko writes: > Aha. Not saving is an important piece of information. > (said the person with compulsive saving syndrome) Thanks! This fixes the bug (which was present in both Org 9.5 and 9.6) for me. However, my original bug, which is only present in Org 9.6, is still there. Do the

Re: [BUG] Adding note to heading without newline at the end

2022-06-20 Thread Tor Kringeland
Samuel Banya writes: > Unable to reproduce this bug with 'emacs -Q -L ./lisp -l org' on the > latest version of Org Mode Hmm ... this occurs to me both in Org 9.5 and in the latest Org version on Emacs 29. The error message I get says Before first headline at position 1 in buffer test.org H

[BUG] Editing link hides text

2022-06-20 Thread Tor Kringeland
Using Org 9.6 with Emacs 29, write a link: [[123][test]] Most of the text will then be hidden, with "test" showing as a link, as expected. However if I remove the last ], the link highlighting disappears and only "test" is shown like regular text (/i.e./ instead of "[[123][test]" as would be e

Re: [BUG] Adding note to heading without newline at the end

2022-06-20 Thread Tor Kringeland
Ihor Radchenko writes: > Can you reproduce the problem starting from emacs -Q? I did. The bug only occurs if there is no newline at the end. So for example if you open a new buffer and don't save it, the bug should occur. Similarly, in my own config (where I have enabled org-log-into-drawer),

[BUG] Adding note to heading without newline at the end

2022-06-19 Thread Tor Kringeland
Consider the following buffer #+begin_example * test #+end_example without a newline at the end. Calling `org-add-note' will result in an error and the note being placed /before/ the heading.

Re: [PATCH] Re: Change in `org-cycle-hook' breaks behavior

2022-05-28 Thread Tor Kringeland
Ihor Radchenko writes: > If you want all the drawers in all the children to be opened, you can > instead do the following: > > (let* ((headline (save-excursion (org-back-to-heading) > (org-element-at-point > (when headline > (org-fold-region > (org-element-property :begin headline

Re: [PATCH] Re: Change in `org-cycle-hook' breaks behavior

2022-05-28 Thread Tor Kringeland
Tor Kringeland writes: > a part of was opened. (So pressing TAB multiple times would first show > the outline with the first headline open, then the next would show > sub-headlines with their drawers open.) Correction: it wouldn't show the drawer of the headline on the first TAB

Re: [PATCH] Re: Change in `org-cycle-hook' breaks behavior

2022-05-28 Thread Tor Kringeland
Ihor Radchenko writes: > Sure. Now, you need to call a different function to open all the drawers > unconditionally. That function is: > > (let* ((headline (save-excursion (org-back-to-heading) > (org-element-at-point))) >(section (org-element-lineage >(org-element-at-poi

Re: [PATCH] Re: Change in `org-cycle-hook' breaks behavior

2022-05-27 Thread Tor Kringeland
Ihor Radchenko writes: > I assume that you have org-startup-folded set to 't. Then, what you are > seeing is caused by org-cycle-set-startup-visibility that folds all the > drawers unless org-startup-folded is set to 'showeverything. Yes, that is my customization :) > A more efficient way could

[BUG] Hide leading space when hiding keyword

2022-05-26 Thread Tor Kringeland
`org-hidden-keywords' was introduced in Org 9.5 and allows hiding keywords like "#+title:" at the beginning of the buffer. However if you have something like #+title: A nice title " A nice title" is displayed at the beginning. AFAIK it's common to have a space after "#+title: " in Org files (

Change in `org-cycle-hook' breaks behavior

2022-05-26 Thread Tor Kringeland
In Org 9.5, `org-cycle-hook' includes `org-cycle-hide-drawers', which hides the drawer after opening the contents of a headline with `org-cycle'. However, if you removed `org-cycle-hide-drawers' from the hook, `org-cycle' would show you the drawers (at least the PROPERTIES one). I relied on this

[BUG] `org-fill-paragraph' doesn't respect formatting

2021-12-07 Thread Tor Kringeland
Applying `org-fill-paragraph' to /e.g./ /Some text./ Some more text. when `sentence-end-double-space' is t removes the double space to a single space. The same happens with other formatting like *bold* and _underline_. In other instances it is more context aware. /E.g./ applying it to (S

Question about using `org-add-note' programmatically

2021-11-30 Thread Tor Kringeland
I'm trying to write a function that adds a note to the current `org-mode' heading. Naively I write it as (defun my/add-note () (interactive) (org-add-note) (insert "some text") (org-ctrl-c-ctrl-c)) but this does not work. Calling the function (on a recent build of Emacs 29) in

[O] `fill-paragraph' on headings

2017-10-25 Thread Tor
this is a feature request for having the ability to use `fill-paragraph' on headings. An example from Emacs news: '*** New variable 'xterm-set-window-title' controls whether Emacs sets the XTerm window title. The default is to set the window title.' -> '*** New variable 'xterm-set-window-title

Re: [O] Problem with automatic recursive adding of org-agenda-files

2013-10-26 Thread Tor Eriksson
uot; Sorry for any confusion. /Tor 2013/10/23 Tor Eriksson > Hello all, > > I have searched the web without finding a solution to the following > problem: > > I am using this snippet in my .emacs.d (using emacs starterkit) to > dynamically and recursively load all org

[O] Problem with automatic recursive adding of org-agenda-files

2013-10-26 Thread Tor Eriksson
under it's old name. This is causing serious trouble to me, since I use this system to keep track of deadlines that are really important. Does anybody have any ideas? Kind regards, Tor

Re: [O] Problem with automatic recursive adding of org-agenda-files

2013-10-24 Thread Tor Eriksson
lving this problem; it feels great to be able to again use my system for monitoring dates for different set terms I closely have to follow. It would have been a mess should I had to reconstruct those dates some other way. Case closed! /Tor 2013/10/24 Nicolas Richard > Tor Eriksson write

Re: [O] Problem with automatic recursive adding of org-agenda-files

2013-10-24 Thread Tor Eriksson
emacs. Could there be something in the org code for agenda that spurs this behaviour? How could I debug this? /Tor 2013/10/24 Nick Dokos > > [I got a private reply from Tor Eriksson which was obviously meant for > the list, so I am taking the liberty of reposting it here.]

[O] Problem with automatic recursive adding of org-agenda-files

2013-10-23 Thread Tor Eriksson
under it's old name. This is causing serious trouble to me, since I use this system to keep track of deadlines that are really important. Does anybody have any ideas? Kind regards, Tor