Created
November 17, 2015 02:34
-
-
Save zeph1e/d03bf01ff8edeac1538c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; handle left click on left window margin & return text in position | |
(global-set-key (kbd "<left-margin> <mouse-1>") (lambda (p) (interactive "e") | |
(message "%S" (posn-string (car (cdr p)))))) | |
;; unset key bind | |
(global-unset-key (kbd "<left-margin> <mouse-1>")) | |
;; make overlay on window start pos & insert propertized text | |
;; mouse-face doesn't work but help echo works..... weird.... | |
(let ((str (propertize "hello" 'face '(:foreground "cyan") 'help-echo "mouse-1: say hello" 'mouse-face 'highlight))) | |
(setq ov (make-overlay (window-start) (window-start))) | |
(overlay-put ov 'before-string (propertize " " 'display `((margin left-margin) ,str)))) | |
;; remove overlay | |
(delete-overlay ov) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment