Skip to content

Commit

Permalink
replace all calls to cl-lib 'first' with a more relieable 'car' #9
Browse files Browse the repository at this point in the history
  • Loading branch information
hlolli committed Nov 8, 2019
1 parent 7d3f784 commit ba4a5dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions csound-eldoc.el
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@
(when result
(let ((rate-list (split-string (replace-regexp-in-string "\n\s" "\n" result) "\n")))
(if (= (length rate-list) 1)
(list opcode (first rate-list) functional-syntax-p)
(let ((rate-candidate (or rate-cand (substring (first statement-list) 0 1))))
(list opcode (car rate-list) functional-syntax-p)
(let ((rate-candidate (or rate-cand (substring (car statement-list) 0 1))))
(dolist (xrate rate-list)
(when (string= rate-candidate (substring xrate 0 1))
(setq rate-match xrate)))
(if rate-match
(list opcode rate-match functional-syntax-p)
(list opcode (first rate-list) functional-syntax-p))))))))
(list opcode (car rate-list) functional-syntax-p))))))))


(defun csound-eldoc-argument-index (opcode-match opcode-index point-on-opcode?)
Expand Down Expand Up @@ -152,7 +152,7 @@
(statement-list (csound-eldoc-statement-list csound-statement))
(template-lookup (csound-eldoc-template-lookup statement-list)))
(when template-lookup
(let* ((opcode-match (first template-lookup))
(let* ((opcode-match (car template-lookup))
(point-on-opcode? (string= opcode-match (thing-at-point 'symbol)))
(csound-template (replace-regexp-in-string
"[^\\[]\\.\\.\\." ""
Expand Down
4 changes: 2 additions & 2 deletions csound-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
(buffer-read-only nil)
(lb (- (line-beginning-position) 5))
(input-string (-> input csound-util-chomp))
(first-chunk (first (split-string input-string))))
(first-chunk (car (split-string input-string))))
(when (and first-chunk (< 0 (length first-chunk)))
(read-csound-repl (intern (substring-no-properties first-chunk 0 1))
csound-repl--udp-client-proc input-string))
Expand Down Expand Up @@ -262,7 +262,7 @@
(let ((fallback (list (line-beginning-position) (line-end-position)))
(beg (search-backward-regexp "^\\s-*\\<instr\\>\\|^\\s-*\\<opcode\\>" nil t))
(end (search-forward-regexp "^\\s-*\\<endin\\>\\|^\\s-*\\<endop\\>" nil t)))
(if (and beg end (<= beg (first fallback) end))
(if (and beg end (<= beg (car fallback) end))
(list beg end)
fallback
;; (throw 'no-expression "No instrument or opcode expression was found.")
Expand Down
10 changes: 5 additions & 5 deletions csound-score.el
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ parameter are of same space width."
(lex-last-p3 last-p3)
(lex-p2-list (cons (if (< 2 (length lexical-p-list))
(if (string-equal "+" (nth 2 lexical-p-list))
(if (first p2-list)
(+ (first p2-list) lex-last-p3)
(if (car p2-list)
(+ (car p2-list) lex-last-p3)
last-p3)
(if (string-equal "." (nth 2 lexical-p-list))
(if (first p2-list)
(first p2-list)
(if (car p2-list)
(car p2-list)
0)
(string-to-number
(nth 2 lexical-p-list))))
Expand All @@ -186,7 +186,7 @@ parameter are of same space width."
(lambda (min-time)
(setf (nth 2 lexical-p-list)
(number-to-string
(- (first lex-p2-list)
(- (car lex-p2-list)
;;(nth 2 lexical-p-list)
min-time)))
;; (message "%s lastp3: %s" lex-p2-list lex-last-p3)
Expand Down

0 comments on commit ba4a5dd

Please sign in to comment.