all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Visuwesh <visuweshm@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Turn org-mouse features into minor-modes
Date: Thu, 09 Jan 2025 17:47:45 +0000	[thread overview]
Message-ID: <87a5bz6fr2.fsf@localhost> (raw)
In-Reply-To: <8734htvkvz.fsf@gmail.com>

Visuwesh <visuweshm@gmail.com> writes:

> Subject: [PATCH] org-mouse: Make it possible to turn on and off the feature

Thanks for the update!
See my comments inline.

> +*** ~org-mouse~ is no longer activated by default by anymore

+ by anymore+

> +To enable the ~org-mouse~ features, the new minor-modes
> +~org-mouse-minor-mode~ and ~org-mouse-agenda-minor-mode~ should be
> +enabled.
> +
> +To turn on the features in all ~org-mode~ and ~org-agenda-mode~
> +buffers, you can use the globalized versions
> +~global-org-mouse-minor-mode~ and ~global-org-mouse-agenda-minor-mode~.

Please also add a small code snippet users may put into config to enable
the previous behavior.
Something like

#+begin_src emacs-lisp
(global-org-mouse-minor-mode +1)
(global-org-mouse-agenda-minor-mode +1)
#+end_src

We likely want to autoload the minor modes.

> +(defvar-local org-mouse--old-mouse-map (copy-keymap org-mouse-map))
> ...
> +    (when org-mouse-minor-mode
> +      ;; Without `copy-keymap', later `org-defkey' calls modify the
> +      ;; value of keymap `org-mouse--old-mouse-map' holds.
> +      (setq org-mouse--old-mouse-map (copy-keymap org-mouse-map)))
> +    (setq org-mouse-map (copy-keymap org-mouse--old-mouse-map))
> +    (org-defkey org-mouse-minor-mode-map [S-mouse-2] nil)
> +    (org-defkey org-mouse-minor-mode-map [drag-mouse-3] nil)
> +    (when org-mouse-minor-mode
> +      (when (memq 'context-menu org-mouse-features)
> +        (org-defkey org-mouse-map [mouse-3] nil)
> +        (org-defkey org-mouse-map [C-drag-mouse-1] #'org-mouse-move-tree)
> +        (org-defkey org-mouse-map [C-down-mouse-1] #'org-mouse-move-tree-start))
> ...

`org-mouse--old-mouse-map' is awkward.
May we use :enable + menu item instead?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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:[~2025-01-09 17:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-26 13:14 [PATCH] Turn org-mouse features into minor-modes Visuwesh
2024-12-27  8:25 ` Ihor Radchenko
2024-12-27  8:35   ` Visuwesh
2024-12-27  8:40     ` Ihor Radchenko
2025-01-08  4:27   ` Visuwesh
2025-01-08  7:13     ` Visuwesh
2025-01-09 17:47       ` 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

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

  git send-email \
    --in-reply-to=87a5bz6fr2.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=visuweshm@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.