diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-11 13:21:22 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-11 13:21:22 -0500 |
commit | fe844299a4432ef2443ac89b63df985fc58b2752 (patch) | |
tree | 5ca93ba28f8eeb4cd1fa6e68ac6bc17a34c363eb /lisp/cedet/semantic/wisent/comp.el | |
parent | 2c9594ae0626abe3838b8f0ec33122c94e02ddf1 (diff) | |
download | emacs-fe844299a4432ef2443ac89b63df985fc58b2752.tar.gz |
* lisp/cedet: Remove always-nil variables
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-variables):
Remove always-nil variable `conf-done`.
* lisp/cedet/ede/project-am.el: Use ref instead of dynbound var.
(project-rescan): Pass the ref.
(project-am-expand-subdirlist): Use it.
* lisp/cedet/semantic/idle.el (semantic-idle-work-core-handler):
Fix misuse of the wrong `errbuf `variable.
* lisp/cedet/semantic/scope.el (semantic-analyze-scoped-type-parts):
Remove always-nil variable `extmeth`.
* lisp/cedet/semantic/wisent/comp.el (wisent-context-name)
(wisent-context-bindings): Make them into functions.
(wisent-with-context): Use `dlet`.
Diffstat (limited to 'lisp/cedet/semantic/wisent/comp.el')
-rw-r--r-- | lisp/cedet/semantic/wisent/comp.el | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 574922049f5..ae0823e669a 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -54,15 +54,16 @@ ;; bound locally, without all these "reference to free variable" ;; compiler warnings! -(defmacro wisent-context-name (name) - "Return the context name from NAME." - `(if (and ,name (symbolp ,name)) - (intern (format "wisent-context-%s" ,name)) - (error "Invalid context name: %S" ,name))) +(eval-when-compile + (defun wisent-context-name (name) + "Return the context name from NAME." + (if (and name (symbolp name)) + (intern (format "wisent-context-%s" name)) + (error "Invalid context name: %S" name))) -(defmacro wisent-context-bindings (name) - "Return the variables in context NAME." - `(symbol-value (wisent-context-name ,name))) + (defun wisent-context-bindings (name) + "Return the variables in context NAME." + (symbol-value (wisent-context-name name)))) (defmacro wisent-defcontext (name &rest vars) "Define a context NAME that will bind variables VARS." @@ -71,18 +72,14 @@ (declarations (mapcar #'(lambda (v) (list 'defvar v)) vars))) `(progn ,@declarations - (eval-and-compile + (eval-when-compile (defvar ,context ',vars))))) (defmacro wisent-with-context (name &rest body) "Bind variables in context NAME then eval BODY." (declare (indent 1)) - (let ((bindings (wisent-context-bindings name))) - `(progn - ,@(mapcar (lambda (binding) `(defvar ,(or (car-safe binding) binding))) - bindings) - (let* ,bindings - ,@body)))) + `(dlet ,(wisent-context-bindings name) + ,@body)) ;; Other utilities |