1

I use mouse-2 quite often for mouse-yank-primary. However, if I am at the start of an org-mode headline, instead of yanking from my cut buffer, it toggles the level of the headline. For example, if I have the cursor at the start of a level 1 headline(| used to represent cursor):

* |

Press mouse-2 and it becomes:

** |

...instead of yanking the text I want as the headline. Then if I press mouse-2 again, it becomes a level 1 headline again, and will keep toggling between the two on subsequent presses. How can I change this behavior to yank instead of changing the headline level? Normally I can figure these things out on my own, but I have had trouble in the past when it comes to changing the behavior of mouse buttons.

Update:

I tried describe-key before asking this question, and it seemed like mouse-2 should do what I want, but I just noticed at the bottom of the describe-key description for theup-event it says:

<mouse-2> at that spot runs the command (lambda (e) (interactive "e") (mouse-set-point e) (org-cycle)), which is an interactive Lisp function.

It is bound to <mouse-2>.

(anonymous E)

Not documented.

I assume this is what is causing my issue, but it doesn't seem clear to me where this is coming from.

  • Does this also happen when you start emacs with -Q? It does not happen in my setup (emacs 25.1.50.2, org-version 8.2.10). – Tobias Apr 3 '16 at 9:16
  • @Tobias with -Q it works as I want it to. See my update though. – elethan Apr 3 '16 at 14:49
  • A search for the binding delivers: org-bullets.el If this is what hurts you see the documentation of org-bullets-bullet-map. They propertize the bullets with this: (put-text-property (match-beginning 0) (match-end 0) 'keymap org-bullets-bullet-map) – Tobias Apr 3 '16 at 15:11
  • @Tobias yep, that is it. The docs for org-bullets-bullet-map also mention of the behaviour: "Should this be undesirable, one can remove them with (setcdr org-bullets-bullet-map nil)" Which is exactly what I did, and it worked. How did you search the binding? I was not sure the best way to find where this was being defined. Also, you can post this as an answer if you want and I will accept it. Thank you! – elethan Apr 3 '16 at 15:22
1

A search for the binding delivers: org-bullets.el.

See the documentation of org-bullets-bullet-map. There you find:

Should this be undesirable, one can remove them with (setcdr org-bullets-bullet-map nil)

They propertize the bullets with this:

(put-text-property (match-beginning 0) (match-end 0)
                   'keymap org-bullets-bullet-map)`

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.