Skip to content

Instantly share code, notes, and snippets.

@ShingoFukuyama
Created January 13, 2014 00:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShingoFukuyama/8392961 to your computer and use it in GitHub Desktop.
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.
;; 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