diff options
author | Syohei YOSHIDA <syohex@gmail.com> | 2015-04-22 16:12:08 +0900 |
---|---|---|
committer | Syohei YOSHIDA <syohex@gmail.com> | 2015-04-22 16:12:08 +0900 |
commit | b7d0b16a480d6dddec71f029f8057c69590ac571 (patch) | |
tree | 50736b22552d489fcf29541c29593313427c76d6 | |
parent | 1c8fb7edc4a2c670720266d12630de9709844fbf (diff) |
Use string-match-p/looking-at-p as possible
-rw-r--r-- | cider-client.el | 2 | ||||
-rw-r--r-- | cider-debug.el | 2 | ||||
-rw-r--r-- | cider-interaction.el | 2 | ||||
-rw-r--r-- | cider-repl.el | 8 | ||||
-rw-r--r-- | cider-selector.el | 2 | ||||
-rw-r--r-- | cider-test.el | 2 | ||||
-rw-r--r-- | nrepl-client.el | 10 |
7 files changed, 14 insertions, 14 deletions
diff --git a/cider-client.el b/cider-client.el index 251daf68..bac89289 100644 --- a/cider-client.el +++ b/cider-client.el @@ -91,7 +91,7 @@ ;;; Evaluation helpers (defun cider-ns-form-p (form) "Check if FORM is an ns form." - (string-match "^[[:space:]]*\(ns\\([[:space:]]*$\\|[[:space:]]+\\)" form)) + (string-match-p "^[[:space:]]*\(ns\\([[:space:]]*$\\|[[:space:]]+\\)" form)) (define-obsolete-function-alias 'cider-eval 'nrepl-request:eval) diff --git a/cider-debug.el b/cider-debug.el index 0f57a265..03e1b9d0 100644 --- a/cider-debug.el +++ b/cider-debug.el @@ -147,7 +147,7 @@ the following keys are available: (eval-buffer (current-buffer)) (position (cider-defun-at-point-start-pos)) (prefix - (if (string-match "\\`(defn-? " expression) + (if (string-match-p "\\`(defn-? " expression) "Instrumented => " "=> ")) (instrumented (format cider--instrument-format (buffer-file-name) diff --git a/cider-interaction.el b/cider-interaction.el index 094d4d08..4db1c639 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -1358,7 +1358,7 @@ until we find a delimiters that's not inside a string." (if (and (looking-back "[])}]") (null (nth 3 (syntax-ppss)))) (backward-sexp) - (while (or (not (looking-at "[({[]")) + (while (or (not (looking-at-p "[({[]")) (nth 3 (syntax-ppss))) (backward-char)))) diff --git a/cider-repl.el b/cider-repl.el index c743faed..ae85a81e 100644 --- a/cider-repl.el +++ b/cider-repl.el @@ -513,7 +513,7 @@ the symbol." "Return t if the region from START to END is a complete sexp." (save-excursion (goto-char start) - (cond ((looking-at "\\s *[@'`#]?[(\"]") + (cond ((looking-at-p "\\s *[@'`#]?[(\"]") (ignore-errors (save-restriction (narrow-to-region start end) @@ -571,7 +571,7 @@ If NEWLINE is true then add a newline at the end of the input." (goto-char (point-max)) (cider-repl--mark-input-start) (cider-repl--mark-output-start) - (if (and (not (string-match "\\`[ \t\r\n]*\\'" input)) + (if (and (not (string-match-p "\\`[ \t\r\n]*\\'" input)) cider-repl-use-pretty-printing) (nrepl-request:pprint-eval input @@ -763,7 +763,7 @@ Return -1 resp the length of the history if no item matches." (cl-loop for pos = (+ start-pos step) then (+ pos step) if (< pos 0) return -1 if (<= len pos) return len - if (string-match regexp (nth pos history)) return pos))) + if (string-match-p regexp (nth pos history)) return pos))) (defun cider-repl--history-replace (direction &optional regexp) "Replace the current input with the next line in DIRECTION. @@ -846,7 +846,7 @@ If USE-CURRENT-INPUT is non-nil, use the current input." (use-current-input (assert (<= cider-repl-input-start-mark (point))) (let ((str (cider-repl--current-input t))) - (cond ((string-match "^[ \n]*$" str) nil) + (cond ((string-match-p "^[ \n]*$" str) nil) (t (concat "^" (regexp-quote str)))))) (t nil))) diff --git a/cider-selector.el b/cider-selector.el index 9c77f658..162e3a6a 100644 --- a/cider-selector.el +++ b/cider-selector.el @@ -50,7 +50,7 @@ DESCRIPTION is a one-line description of what the key selects.") Only considers buffers that are not already visible." (cl-loop for buffer in (buffer-list) when (and (with-current-buffer buffer (eq major-mode mode)) - (not (string-match "^ " (buffer-name buffer))) + (not (string-match-p "^ " (buffer-name buffer))) (null (get-buffer-window buffer 'visible))) return buffer finally (error "Can't find unshown buffer in %S" mode))) diff --git a/cider-test.el b/cider-test.el index f55aac16..b5ffa170 100644 --- a/cider-test.el +++ b/cider-test.el @@ -401,7 +401,7 @@ This uses the Leiningen convention of appending '-test' to the namespace name." (when ns (let ((suffix "-test")) ;; string-suffix-p is only available in Emacs 24.4+ - (if (string-match (rx-to-string `(: ,suffix eos) t) ns) + (if (string-match-p (rx-to-string `(: ,suffix eos) t) ns) ns (concat ns suffix))))) diff --git a/nrepl-client.el b/nrepl-client.el index 90f294f5..66043d33 100644 --- a/nrepl-client.el +++ b/nrepl-client.el @@ -511,7 +511,7 @@ object is a root list or dict." ((eobp) (cons :eob stack)) ;; truncation in the middle of an integer or in 123: string prefix - ((looking-at "[0-9i]") + ((looking-at-p "[0-9i]") (cons :stub stack)) ;; else, throw a quiet error (t @@ -703,7 +703,7 @@ If NO-ERROR is non-nil, show messages instead of throwing an error." "Return a process filter that waits for PORT to appear in process output." (let ((port-string (format "LOCALHOST:%s" port))) (lambda (proc string) - (when (string-match port-string string) + (when (string-match-p port-string string) (process-put proc :waiting-for-port nil)) (when (and (process-live-p proc) (buffer-live-p (process-buffer proc))) @@ -1121,12 +1121,12 @@ Return a newly created process." (when nrepl-buffer (kill-buffer nrepl-buffer)) (cond - ((string-match "^killed" event) + ((string-match-p "^killed" event) nil) - ((string-match "^hangup" event) + ((string-match-p "^hangup" event) (when connection-buffer (nrepl-close connection-buffer))) - ((string-match "Wrong number of arguments to repl task" problem) + ((string-match-p "Wrong number of arguments to repl task" problem) (error "Leiningen 2.x is required by CIDER")) (t (error "Could not start nREPL server: %s" problem))))) |