Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elisp destructuring-bind for cons cell?

Tags:

emacs

elisp

I'd like to do

(destructuring-bind (start end) (bounds-of-thing-at-point 'symbol))

But bounds-of-thing-at-point returns a cons cell and not a list, so destructuring-bind doesn't work. What could work for this case?

like image 860
abo-abo Avatar asked Jul 18 '13 07:07

abo-abo


1 Answers

I'd use

(pcase-let ((`(,start . ,end) (bounds-of-thing-at-point 'symbol)))
  ...)
like image 52
Stefan Avatar answered Oct 03 '22 12:10

Stefan