Visuwesh <visuwe...@gmail.com> writes:

>> `org-mouse--old-mouse-map' is awkward.
>> May we use :enable + menu item instead?
>
> Hmm looking closely at the modifications org-mouse does to
> org-mouse-map, I see a severe interdependence between all the features
> in org-mouse-features.
>
> There's no way C-mouse-1 will move the trees with context-menu in the
> list [*] or drag-mouse-3 if move-tree is in the list if activate-stars
> is not enabled.  This is making me rethink if it is worth changing
> the org-mouse-map and why not just do
>
>     (when (memq 'activate-stars org-mouse-features)
>           (funcall fl-fun nil
>                    `((,org-outline-regexp
>                       0 `(face org-link mouse-face highlight keymap
>                                ,(let ((map (make-sparse-keymap)))
>                                   (set-keymap-parent map org-mouse-map)
>                                   (when (memq 'move-tree org-mouse-features)
>                                     (define-key map [C-drag-mouse-1] 
> #'org-mouse-move-tree)
>                                     ...)))
>                       'prepend))))
>
> and so on for the rest?  This would avoid the need for the
> org-mouse--old-mouse-map stub.

You are right.
Although I believe that using conditional menu entries in the keymap
will make the code even simpler. Or do I miss some problem with using menus?

-- 
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 via email to