From afe99bf81928ce113e9b30955cd2544cffdf0937 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 23 Sep 2016 17:56:49 -0700 Subject: [PATCH] [Emacs] Add toggle-lexical-binding function --- dotfiles/emacs.d/README.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index b49a4e67..a192a2ae 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -757,6 +757,14 @@ A macro for composing functions together to build an interactive command to copy (ido-completing-read "Select a script to edit: " (imalison:get-executables-on-path))))) #+END_SRC +** Toggle lexical binding in the current buffer +#+BEGIN_SRC emacs-lisp +(defun imalison:toggle-lexical-binding () + (interactive) + (let ((new-binding (not lexical-binding))) + (message "Setting lexical-binding to: %s" new-binding) + (setq lexical-binding new-binding))) +#+END_SRC ** Other #+BEGIN_SRC emacs-lisp (defun imalison:join-paths (&rest paths)