Created
January 13, 2014 00:53
-
-
Save ShingoFukuyama/8392961 to your computer and use it in GitHub Desktop.
[Emacs] Get overlay property cons list at the argument $position pointed, or the cursor on.
This file contains 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
;; On the overlay, do `M-: (my-get-overlay-property-list-at)` | |
;; Return cons list like below | |
;; ((edit-buffer . t) (face . helm-swoop-target-word-face)) | |
(defun my-get-overlay-property-cons-list-at (&optional $position) | |
(interactive) | |
"Get overlay property cons list at the argument $position pointed, | |
or the cursor on. " | |
(or $position (setq $position (point))) | |
(let ($list $ov) | |
(setq $ov (overlay-properties | |
(car (overlays-in $position (1+ $position))))) | |
(mapc (lambda ($elt) | |
(let (($key (car $elt)) | |
($value (cdr $elt))) | |
(setq $list (cons (cons $key $value) $list)))) | |
(let ($ret) | |
(while $ov | |
(setq $ret (cons (cons (car $ov) (cadr $ov)) $ret)) | |
(setq $ov (cddr $ov))) | |
$ret)) | |
$list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment