3

Hi I'm on Linux and Emacs version is 26.3.

I would like to expand or collapse a block by mouse click, instead of moving the cursor to the header and press tab.

I actually have a windows computer does so, but do not work on my Linux one. I’ve tried to copy relevant files, however doesn’t work.

I also googled, but to be honest, cannot find where to start.

So if anyone can help? Thanks a lot!!

2
  • 1
    org-mouse might help: emacs.stackexchange.com/a/34474/19819 Commented Feb 4, 2020 at 20:51
  • Thanks a lot @Hubisan would you like to post and I'll accept your answer. Commented Feb 5, 2020 at 3:36

1 Answer 1

6

You can use the built-in org-mouse which adds support for subtree expansion/collapsing (org-cycle) with the left mouse button.

To use it either

  • add (require 'org-mouse) to your init file
  • or activate it in the current session with M-: (require 'org-mouse) RET M-x org-mode-restart RET.

Org mouse implements the following features (taken from the package commentary):

;; * following links with the left mouse button ;; * subtree expansion/collapse (org-cycle) with the left mouse button ;; * several context menus on the right mouse button: ;; + general text ;; + headlines ;; + timestamps ;; + priorities ;; + links ;; + tags ;; * promoting/demoting/moving subtrees with mouse-3 ;; + if the drag starts and ends in the same line then promote/demote ;; + otherwise move the subtree 

You have to click the heading bullet (usually the *) or list bullet and not the text to expand or collapse its subtree.

1
  • Took me a while of clicking uselessly to realise that I have to click on the heading's bullet point, not the heading text or ellipsis, to toggle expand/collapse Commented Jan 2 at 3:31

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.