]> git.eshelyaron.com Git - emacs.git/commit
Add let-when-compile macro instead of using pcase-let
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 19 May 2015 07:49:12 +0000 (09:49 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Wed, 20 May 2015 13:20:37 +0000 (15:20 +0200)
commit5d752c8a1c28e003ded0f2daa0d93eb12a31195a
tree51afc7bcc5a4374141c52f1390f04c199091f3a0
parent1972e49f924dc8706aef512a0d69fd7c29a4f1f6
Add let-when-compile macro instead of using pcase-let

* lisp/subr.el (let-when-compile): New let-like macro that makes its
bindings known to macros like `eval-when-compile' in the body.

* lisp/emacs-lisp/lisp-mode.el: Change the top-level `pcase-let' to a
  `let-when-compile'. Also comment out the unused lexical var
  `el-kws-re'.

The change greatly improves readability, while providing almost the
same (even shorter) byte code: instead of pre-evaluating 10 variables,
tossing them into a list, and destructuring that list a full screen
page later, the variables are simply bound as they are evaluated,
wrapped individually in `eval-when-compile'.
lisp/emacs-lisp/lisp-mode.el
lisp/subr.el