emacs-orgmode
[Top][All Lists]
Advanced

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

[BUG] org-mouse is activated without explicit require


From: Matt Lundin
Subject: [BUG] org-mouse is activated without explicit require
Date: Sat, 10 Dec 2022 21:25:10 -0600

I'm not too familiar with how emacs handles autoloads. However, I find
org-mouse is automatically loaded if I call describe-function and then
tab complete after typing "", "org-", "org-m", etc. This seems enough to
load the entirely of the org-mouse.el file.

The problem is that this adds a lambda function to org-mode-hook that
activates all org-mouse functionality at the next call of org-mode or
org-mode-restart. This has two unexpected effects:

1. It changes the behavior of mouse clicks without the user's explicit
   request.
2. It advise org-open-at-point, with the result that it is no longer
   possible to get a list of all links in an entry when calling
   org-open-at-point on a headline. (See separate bug report on this.)

I am able to reproduce this with a minimal .emacs config and the most
recent git version (after running "make clean && make").

Steps to reproduce:

1. /usr/bin/emacs -Q -l ~/minimal.el

where ~/minimal.el is...

--8<---------------cut here---------------start------------->8---
(add-to-list 'load-path "~/org-mode/lisp/")
--8<---------------cut here---------------end--------------->8---

2. C-h f org-m [tab]

Note that "org-mouse-" functions appear in the completion list. Even if
one aborts describe-function at this point, org-mouse has been loaded
and org-mode-hook now contains a lambda function to activate the
functionality of org-mouse (org-defkey, advice-add, etc.).

3. Open an org buffer for the first time or call "M-x org-mode-restart"
   in an already opened buffer

"C-h v org-open-at-point" now reports the following advice:

--8<---------------cut here---------------start------------->8---
This function has :around advice: ‘org--mouse-open-at-point’.
--8<---------------cut here---------------end--------------->8---

Also notice that org-mouse features are now active in org buffers.

Thanks,

Matt



reply via email to

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