emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master fe84429: * lisp/cedet: Remove always-nil variables


From: Stefan Monnier
Subject: master fe84429: * lisp/cedet: Remove always-nil variables
Date: Thu, 11 Mar 2021 13:21:28 -0500 (EST)

branch: master
commit fe844299a4432ef2443ac89b63df985fc58b2752
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * 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`.
---
 lisp/cedet/ede/pmake.el            |  4 +-
 lisp/cedet/ede/project-am.el       |  8 ++--
 lisp/cedet/semantic/idle.el        | 94 +++++++++++++++++++-------------------
 lisp/cedet/semantic/scope.el       |  4 +-
 lisp/cedet/semantic/wisent/comp.el | 27 +++++------
 5 files changed, 67 insertions(+), 70 deletions(-)

diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el
index e1fe856..47bb0c6 100644
--- a/lisp/cedet/ede/pmake.el
+++ b/lisp/cedet/ede/pmake.el
@@ -428,11 +428,11 @@ sources variable."
   (let* ((proj (ede-target-parent this))
         (conf-table (ede-proj-makefile-configuration-variables
                      this (oref proj configuration-default)))
-        (conf-done nil)
+        ;; (conf-done nil)
         )
     ;; Add in all variables from the configuration not already covered.
     (mapc (lambda (c)
-           (if (member (car c) conf-done)
+           (if nil ;; (member (car c) conf-done)
                nil
              (insert (car c) "=" (cdr c) "\n")))
          conf-table))
diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el
index d676c57..258917f 100644
--- a/lisp/cedet/ede/project-am.el
+++ b/lisp/cedet/ede/project-am.el
@@ -596,10 +596,8 @@ Strip out duplicates, and recurse on variables."
                (project-am-expand-subdirlist
                 place (makefile-macro-file-list var))
              ;; Else, add SP in if it isn't a dup.
-             (if (member sp (symbol-value place))
-                 nil ; don't do it twice.
-               (set place (cons sp (symbol-value place))) ;; add
-               ))))
+             (cl-pushnew sp (gv-deref place) :test #'equal) ;; add
+             )))
        subdirs)
   )
 
@@ -645,7 +643,7 @@ Strip out duplicates, and recurse on variables."
       ;; We still have a list of targets.  For all buffers, make sure
       ;; their object still exists!
       ;; FIGURE THIS OUT
-      (project-am-expand-subdirlist 'csubprojexpanded csubproj)
+      (project-am-expand-subdirlist (gv-ref csubprojexpanded) csubproj)
       ;; Ok, now let's look at all our sub-projects.
       (mapc (lambda (sp)
              (let* ((subdir (file-name-as-directory
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 2b6d11f..9df9778 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -348,54 +348,56 @@ Returns t if all processing succeeded."
 Visits Semantic controlled buffers, and makes sure all needed
 include files have been parsed, and that the typecache is up to date.
 Uses `semantic-idle-work-for-on-buffer' to do the work."
-  (let ((errbuf nil)
-       (interrupted
-        (semantic-exit-on-input 'idle-work-timer
-          (let* ((inhibit-quit nil)
-                 (cb (current-buffer))
-                 (buffers (delq (current-buffer)
-                                (delq nil
-                                      (mapcar #'(lambda (b)
-                                                  (and (buffer-file-name b)
-                                                       b))
-                                              (buffer-list)))))
-                 safe errbuf)
-            ;; First, handle long tasks in the current buffer.
-            (when (semantic-idle-scheduler-enabled-p)
-              (save-excursion
-                (setq safe (semantic-idle-work-for-one-buffer (current-buffer))
-                      )))
-            (when (not safe) (push (current-buffer) errbuf))
-
-            ;; Now loop over other buffers with same major mode, trying to
-            ;; update them as well.  Stop on keypress.
-            (dolist (b buffers)
-              (semantic-throw-on-input 'parsing-mode-buffers)
-              (with-current-buffer b
-                (when (semantic-idle-scheduler-enabled-p)
-                  (and (semantic-idle-scheduler-enabled-p)
-                       (unless (semantic-idle-work-for-one-buffer 
(current-buffer))
-                         (push (current-buffer) errbuf)))
-                  ))
-              )
-
-            (when (and (featurep 'semantic/db) (semanticdb-minor-mode-p))
-              ;; Save everything.
-              (semanticdb-save-all-db-idle)
-
-              ;; Parse up files near our active buffer
-              (when semantic-idle-work-parse-neighboring-files-flag
-                (semantic-safe "Idle Work Parse Neighboring Files: %S"
-                  (set-buffer cb)
-                  (semantic-idle-scheduler-work-parse-neighboring-files))
-                t)
+  (let*
+      ((errbuf nil)
+       (interrupted
+       (semantic-exit-on-input 'idle-work-timer
+         (let* ((inhibit-quit nil)
+                (cb (current-buffer))
+                (buffers (delq (current-buffer)
+                               (delq nil
+                                     (mapcar #'(lambda (b)
+                                                 (and (buffer-file-name b)
+                                                      b))
+                                             (buffer-list)))))
+                safe) ;; errbuf
+           ;; First, handle long tasks in the current buffer.
+           (when (semantic-idle-scheduler-enabled-p)
+             (save-excursion
+               (setq safe (semantic-idle-work-for-one-buffer (current-buffer))
+                     )))
+           (when (not safe) (push (current-buffer) errbuf))
+
+           ;; Now loop over other buffers with same major mode, trying to
+           ;; update them as well.  Stop on keypress.
+           (dolist (b buffers)
+             (semantic-throw-on-input 'parsing-mode-buffers)
+             (with-current-buffer b
+               (when (semantic-idle-scheduler-enabled-p)
+                 (and (semantic-idle-scheduler-enabled-p)
+                      (unless (semantic-idle-work-for-one-buffer
+                               (current-buffer))
+                        (push (current-buffer) errbuf)))
+                 ))
+             )
 
-              ;; Save everything... again
-              (semanticdb-save-all-db-idle)
-              )
+           (when (and (featurep 'semantic/db) (semanticdb-minor-mode-p))
+             ;; Save everything.
+             (semanticdb-save-all-db-idle)
+
+             ;; Parse up files near our active buffer
+             (when semantic-idle-work-parse-neighboring-files-flag
+               (semantic-safe "Idle Work Parse Neighboring Files: %S"
+                 (set-buffer cb)
+                 (semantic-idle-scheduler-work-parse-neighboring-files))
+               t)
+
+             ;; Save everything... again
+             (semanticdb-save-all-db-idle)
+             )
 
-            ;; Done w/ processing
-            nil))))
+           ;; Done w/ processing
+           nil))))
 
     ;; Done
     (if interrupted
diff --git a/lisp/cedet/semantic/scope.el b/lisp/cedet/semantic/scope.el
index 6bd04b2..2d806e5 100644
--- a/lisp/cedet/semantic/scope.el
+++ b/lisp/cedet/semantic/scope.el
@@ -562,7 +562,7 @@ such as `public' or `private'."
           ;; @TODO - is this line needed??  Try w/out for a while
           ;; @note - I think C++ says no.  elisp might, but methods
           ;;         look like defuns, so it makes no difference.
-          (extmeth nil) ; (semantic-tag-external-member-children type t))
+          ;;(extmeth nil) ; (semantic-tag-external-member-children type t))
 
           ;; INHERITED are tags found in classes that our TYPE tag
           ;; inherits from.  Do not do this if it was not requested.
@@ -584,7 +584,7 @@ such as `public' or `private'."
          (setq slots (nreverse copyslots))
          ))
       ;; Flatten the database output.
-      (append slots extmeth inherited)
+      (append slots nil inherited) ;; extmeth
       )))
 
 (defun semantic-analyze-scoped-inherited-tags (type scope access)
diff --git a/lisp/cedet/semantic/wisent/comp.el 
b/lisp/cedet/semantic/wisent/comp.el
index 5749220..ae0823e 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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]