Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have jdee use loop-for-each #181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jdee-classpath.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ zip files in those directories, excepting those specified by
existing paths are already normalized."
(if jdee-expand-classpath-p
(let (paths)
(loop for path in classpath do
(loop-for-each path in classpath do
(if (and
(file-exists-p path)
(file-directory-p path)
Expand Down
12 changes: 6 additions & 6 deletions jdee-db.el
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ to the active face."
(defun jdee-db-set-all-breakpoints-specified ()
"Changes the face of all breakpoints to `jdee-db-spec-breakpoint-face'
and sets the status of all breakpoints to `specified'."
(loop for bp-assoc in jdee-db-breakpoints do
(loop-for-each bp-assoc in jdee-db-breakpoints do
(let* ((bp (cdr bp-assoc))
(marker (oref bp marker)))
(oset bp status 'specified)
Expand Down Expand Up @@ -691,7 +691,7 @@ particular breakpoint and to select breakpoints to be clear."
(jdee-db-find-breakpoint-by-id assoc-x))
jdee-db-bp-list))
(jdee-db-exec-cmd debugger bp-cmd))
(loop for bp-assoc in jdee-db-bp-list do
(loop-for-each bp-assoc in jdee-db-bp-list do
(let ((bp (jdee-db-find-breakpoint-by-id bp-assoc)))
(jdee-db-delete-breakpoint bp))))))

Expand Down Expand Up @@ -728,7 +728,7 @@ particular breakpoint and to select breakpoints to be clear."
in the current buffer to nil."
(when (eq major-mode 'jdee-mode)
(let ((file (buffer-file-name)))
(loop for bp-assoc in jdee-db-breakpoints do
(loop-for-each bp-assoc in jdee-db-breakpoints do
(let ((bp (cdr bp-assoc)))
(when (string= (oref bp file) file)
(oset bp line (jdee-db-breakpoint-get-line bp))
Expand All @@ -740,7 +740,7 @@ in the current buffer to nil."
"Highlights all breakpoints in the current buffer if not
already highlighted."
(save-excursion
(loop for bp-assoc in jdee-db-breakpoints do
(loop-for-each bp-assoc in jdee-db-breakpoints do
(let* ((bp (cdr bp-assoc))
(file (buffer-file-name))
(line (oref bp line))
Expand Down Expand Up @@ -1203,7 +1203,7 @@ ready to accept the next command."
(response output)
(last-cmd (oref this last-cmd)))

(loop for listener in listeners do
(loop-for-each listener in listeners do
(setq output
(jdee-db-listener-filter-output listener output)))

Expand Down Expand Up @@ -1917,7 +1917,7 @@ in the current buffer."
(lambda (assoc-x) (cdr assoc-x))
jdee-db-breakpoints))
(jdee-db-exec-cmd debugger bp-cmd))
(loop for bp-assoc in jdee-db-breakpoints do
(loop-for-each bp-assoc in jdee-db-breakpoints do
(let ((bp (cdr bp-assoc)))
(jdee-db-delete-breakpoint bp))))))

Expand Down
4 changes: 2 additions & 2 deletions jdee-files.el
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ a list of matching files or directories which are interpolated into the sourcepa
"Get all the files in DIR, and any subdirectories of DIR, whose
names match INCLUDE-REGEXP."
(let (files)
(loop for file in (directory-files dir) do
(loop-for-each file in (directory-files dir) do
(if (not (member file '("." "..")))
(let ((file (concat dir "/" file)))
(if (file-directory-p file)
Expand All @@ -189,7 +189,7 @@ root names match EXCLUDE-REGEXPS. Return the files normalized against SYMBOL."
(let ((file-name
(file-name-nondirectory file-path)))
(catch 'match
(loop for regexp in exclude-regexps do
(loop-for-each regexp in exclude-regexps do
(if (string-match regexp file-name)
(throw 'match t))))))
(jdee-directory-files-recurs dir include-regexp))))
Expand Down
6 changes: 3 additions & 3 deletions jdee-gen.el
Original file line number Diff line number Diff line change
Expand Up @@ -3872,7 +3872,7 @@ Returns t, if the template has been inserted, otherwise nil."

(defun jdee-gen-load-abbrev-templates ()
"Defines jdee-mode abbrevs for the control flow templates."
(loop for template in jdee-gen-abbrev-templates do
(loop-for-each template in jdee-gen-abbrev-templates do
(let ((abbrev (car template)))
(define-abbrev
local-abbrev-table
Expand All @@ -3898,12 +3898,12 @@ Returns t, if the template has been inserted, otherwise nil."
(erase-buffer)
(insert "public class Test {\n\n}")
(backward-char 2)
(loop for flags in '((t . t) (t . nil) (nil . t) (nil . nil)) do
(loop-for-each flags in '((t . t) (t . nil) (nil . t) (nil . nil)) do
(let ((jdee-gen-k&r (car flags))
(jdee-gen-comments (cdr flags)))
(insert (format "/**** jdee-gen-comments: %S jdee-gen-k&r: %S ****/\n\n"
jdee-gen-comments jdee-gen-k&r))
(loop for abbrev in
(loop-for-each abbrev in
'(("if" (clause . "true"))
("else")
("ife" (clause . "true"))
Expand Down
2 changes: 1 addition & 1 deletion jdee-import.el
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ inserts the selected import in the buffer."
(deactivate-mark)
(if exclude
(setq new-imports (jdee-import-exclude-imports new-imports)))
(loop for new-import in new-imports do
(loop-for-each new-import in new-imports do
(when (> (length new-import) 0) ;; added to avoid insert empty import statements.
(insert (concat "import " new-import ";\n"))
(message "Imported %s" new-import)))
Expand Down
2 changes: 1 addition & 1 deletion jdee-jdb.el
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ expression at poing")
(defmethod jdee-jdb-set-breakpoint-listener ((this jdee-jdb-breakpoint-listener) output)
"Listens for set breakpoint messages."
(let ((msgs (split-string output "\n")))
(loop for msg in msgs do
(loop-for-each msg in msgs do
(if (and (string-match
"^.*Set .*breakpoint \\(.*\\):\\([0-9]+\\)"
msg)
Expand Down
2 changes: 1 addition & 1 deletion jdee-jdk-manager.el
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ by the current project."
(list
(quote radio-button-choice)
)))
(loop for jdk in val do
(loop-for-each jdk in val do
(setq
type
(append
Expand Down
2 changes: 1 addition & 1 deletion jdee-open-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ If CLASS is found in an archive, set both
".java"))
(package (jdee-parse-get-package-from-name outer-class)))
(catch 'found
(loop for path in (jdee-expand-wildcards-and-normalize jdee-sourcepath 'jdee-sourcepath) do
(loop-for-each path in (jdee-expand-wildcards-and-normalize jdee-sourcepath 'jdee-sourcepath) do
(let* ((pkg-path (subst-char-in-string ?. ?/ package))
(pkg-dir (expand-file-name pkg-path path))
(file-path (expand-file-name file pkg-dir)))
Expand Down
12 changes: 6 additions & 6 deletions jdee-parse.el
Original file line number Diff line number Diff line change
Expand Up @@ -954,11 +954,11 @@ otherwise nil."
(class-methods (semantic-brute-find-tag-by-class 'function class-parts)))

;; Is point in a method of a subclass of this class?
(loop for subclass in class-subclasses do
(loop-for-each subclass in class-subclasses do
(jdee-parse--search-class subclass pos))

;; Is point in any of the methods of this class?
(loop for method in class-methods do
(loop-for-each method in class-methods do
(let* ((method-name (semantic-tag-name method))
(method-start (semantic-tag-start method))
(method-end (semantic-tag-end method)))
Expand All @@ -975,7 +975,7 @@ in a method; otherwise, nil."
(tokens (semantic-fetch-tags))
(classes (semantic-brute-find-tag-by-class 'type tokens)))
(catch 'found
(loop for class in classes
(loop-for-each class in classes
do (jdee-parse--search-class class pos)))))

(defclass jdee-parse-method-map (jdee-avl-tree)
Expand All @@ -995,11 +995,11 @@ in a method; otherwise, nil."
(class-methods (semantic-brute-find-tag-by-class 'function class-parts)))

;; Add methods of subclasses
(loop for subclass in class-subclasses do
(loop-for-each subclass in class-subclasses do
(jdee-parse--add-methods method-map subclass))

;; Add methods of this class?
(loop for method in class-methods do
(loop-for-each method in class-methods do
(let* ((method-name (semantic-tag-name method))
(method-start (semantic-tag-start method))
(method-end (semantic-tag-end method)))
Expand All @@ -1019,7 +1019,7 @@ in a method; otherwise, nil."

(let* ((tokens (semantic-fetch-tags))
(classes (semantic-brute-find-tag-by-class 'type tokens)))
(loop for class in classes do
(loop-for-each class in classes do
(jdee-parse--add-methods this class))))

(defmethod jdee-parse-method-map-get-method-at ((this jdee-parse-method-map) &optional pos)
Expand Down
4 changes: 2 additions & 2 deletions jdee-plugins.el
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ This function loads jdee-PLUGIN.el."
"Get the plugin directories and jar files to include in the Beanshell classpath."
(let ((plugins (oref-default 'jdee-plugin plugins))
classpath)
(loop for plugin in plugins do
(loop-for-each plugin in plugins do
(setq classpath (append classpath (oref plugin bsh-cp))))
classpath))

Expand All @@ -141,7 +141,7 @@ jar program is on the system path."
(insert "JDEE Plugin Installation Log")
(pop-to-buffer buf)
(cd jdee-plugins-directory)
(loop for zip-file in zip-files do
(loop-for-each zip-file in zip-files do
(let ((result
(shell-command-to-string
(concat "jar xvf " zip-file))))
Expand Down
2 changes: 1 addition & 1 deletion jdee-project-file.el
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Emacs startup values."
(if prj-files
(progn
(jdee-set-variables-init-value)
(loop for file in prj-files do
(loop-for-each file in prj-files do
(setq jdee-loading-project-file file)
(jdee-log-msg "jdee-load-project-file: Loading %s" file)
;; reset project file version
Expand Down
4 changes: 2 additions & 2 deletions jdee-run.el
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ to a debugger."
((listp jdee-run-option-enable-assertions)
(if (car jdee-run-option-enable-assertions)
(setq args '("-ea:...")))
(loop for location in (cdr jdee-run-option-enable-assertions) do
(loop-for-each location in (cdr jdee-run-option-enable-assertions) do
(let ((type (car location))
(name (cdr location)))
(if (string= type "package")
Expand All @@ -1072,7 +1072,7 @@ to a debugger."
((listp jdee-run-option-disable-assertions)
(if (car jdee-run-option-disable-assertions)
(setq args '("-da:...")))
(loop for location in (cdr jdee-run-option-disable-assertions) do
(loop-for-each location in (cdr jdee-run-option-disable-assertions) do
(let ((type (car location))
(name (cdr location)))
(if (string= type "package")
Expand Down