emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Matt Lundin <mdl@imapmail.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-mouse.el breaks org-open-at-point
Date: Wed, 14 Dec 2022 08:05:19 +0000	[thread overview]
Message-ID: <87zgbqqukg.fsf@localhost> (raw)
In-Reply-To: <87k02v5ls8.fsf@fastmail.fm>

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	other threads:[~2022-12-14  8:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-11  3:26 [BUG] org-mouse.el breaks org-open-at-point Matt Lundin
2022-12-11  9:37 ` Ihor Radchenko
2022-12-13 16:08   ` Matt Lundin
2022-12-14  8:05     ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgbqqukg.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=mdl@imapmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).