>> > What doesn't work well in mouse-1 clicks on the fringes? >> >> Apparently the fringe keymap does not work if the overlay is not created >> from BOL: >> >> e.g. >> >> The mouse-1 clicks works for this since it is created at BOL: >> >> #+begin_src elisp >> |+| (defvar-local var nil >> | | "Docstring.") >> #+end_src >> >> But for code blocks that are not at BOL this will not work: >> >> #+begin_src elisp >> |+| (defvar-local var ; <- This works >> |+| (when foo ; <- This does not >> | | (bar)) >> | | "Docstring.") >> #+end_src > > Maybe it's a bug? Can you show a simple Lisp program that I could > evaluate in *scratch* and use to look into this issue? Sure, here is a recipe: 1. M-x fundamental-mode 2. M-: (insert " " (propertize "x" 'display '(left-fringe left-arrow error) 'keymap (let ((map (make-sparse-keymap))) (define-key map (kbd " ") (lambda () (interactive) (print "message!"))) map))) 3. Click on the fringe icon, it should not work an throw the " is undefined" message. 4. M-: ; (Same code but without the spaces at BOL) (insert (propertize "x" 'display '(left-fringe left-arrow error) 'keymap (let ((map (make-sparse-keymap))) (define-key map (kbd " ") (lambda () (interactive) (print "message!"))) map))) 5. Click on the fringe icon, it should display the message "message!". I'm not sure if this is a known bug, but I've seen packages that locally (in the buffer local map) bind mouse-1 to a command that scans for the overlay in some region of the buffer, probably the fringe keymap doesn't support this yet. For the patch, I have already solved this problem, although I am not happy with the solution, it is possibly the only way to solve this: