emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] org-mouse.el breaks org-open-at-point


From: Ihor Radchenko
Subject: Re: [BUG] org-mouse.el breaks org-open-at-point
Date: Wed, 14 Dec 2022 08:05:19 +0000

Matt Lundin <mdl@imapmail.org> writes:

>> Patches welcome!
>>
>> I think we need to modify `org-open-at-mouse' directly instead of
>> using advice.
>
> I can give this a try.
>
> The advice in org-mouse.el currently does the following:
>
>  - cycles when on headline
>  - toggles checkbox when on checkbox
>  - cycles plain lists when on a list item
>
> Would it make any sense to make this part of the default behavior or
> org-open-at-mouse? 

Not really. These advised extras do not really belong to "opening"
links. We usually use "action" (C-c C-c) for toggling staff and
"cycling" (TAB) to cycle staff. It's just that "clicking" falls into
"open" paradigm in Emacs, but users also expect "toggle" and "switch
state" as in other applications.

> If not, I think I can make it dependent on the value of
> org-mouse-features, thus giving user the option of turning off the extra
> mouse click behavior via that variable (as a workaround to avoid
> undesired side effects of calling interactive help). This would be a
> temporary workaround until the org-mouse is converted to a global minor
> mode.

I think we can do the following:

1. Introduce new `org-open-at-mouse-first-hook' hook that will be run by
   `org-open-at-mouse' before calling `org-open-at-point'.

2. Introduce `org-mouse-features' as you suggested.

3. Make org-mouse.el add appropriate hooks into
   `org-open-at-mouse-first-hook' according to the value of
   `org-mouse-features'.  The default should keep the current behaviour
   for `org-open-at-mouse'.

4. The new variables are to be documented in etc/ORG-NEWS

5. Ideally, we can convert org-mouse.el to global minor mode immediately
   and turn it on when org-mouse.el is loaded. Then, moving to
   side effect-free loading will be simply a question of removing a
   single statement from org-mouse.el.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]