]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/cedet: Remove always-nil variables
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 11 Mar 2021 18:21:22 +0000 (13:21 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 11 Mar 2021 18:21:22 +0000 (13:21 -0500)
* 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
lisp/cedet/ede/project-am.el
lisp/cedet/semantic/idle.el
lisp/cedet/semantic/scope.el
lisp/cedet/semantic/wisent/comp.el

index e1fe85659f8e8520f7662b2c05c85aeef75136cc..47bb0c61eb483f4925d7c487e2f50f7847b249a9 100644 (file)
@@ -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))
index d676c5749c36e20358a2c6b4e24a2642f10787a6..258917f01b949a42af978b098f2092a4c6a47932 100644 (file)
@@ -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
index 2b6d11f4580e650b5d6b26df2140d032ff7d30ff..9df9778043340394100b80fd0957ffdca3c6db61 100644 (file)
@@ -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
index 6bd04b2e34682dd09f52b52312f42d37a56430e2..2d806e58eeb17f73c2744b2f31f20f0ad1a35841 100644 (file)
@@ -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)
index 574922049f5c3b3b07deaf1aeb3ffdc1dcb5db1c..ae0823e669acbd9836a4a95d707642b81602c1f8 100644 (file)
 ;; 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."
          (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