Function: projectile--read-search-string-with-default

projectile--read-search-string-with-default is a byte-compiled function defined in projectile.el.

Signature

(projectile--read-search-string-with-default PROMPT-LABEL)

Documentation

Read a search string, defaulting to the symbol or region at point.

PROMPT-LABEL is the action shown in the prompt (already carrying any faced tool tag its caller wants). The default value, when there is one, is appended and faced as (default VALUE).

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--read-search-string-with-default (prompt-label)
  "Read a search string, defaulting to the symbol or region at point.
PROMPT-LABEL is the action shown in the prompt (already carrying any
faced tool tag its caller wants).  The default value, when there is one,
is appended and faced as `(default VALUE)'."
  (let* ((prompt-label (projectile-prepend-project-name prompt-label))
         (default-value (projectile-symbol-or-selection-at-point))
         (default-label (if (or (not default-value)
                                (string= default-value ""))
                            ""
                          (format " (default: %s)"
                                  (propertize default-value
                                              'face 'projectile-search-prompt-default)))))
    (read-string (format "%s%s: " prompt-label default-label) nil nil default-value)))