Visuwesh <visuwe...@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>