Function: with-editor-locate-emacsclient-1
with-editor-locate-emacsclient-1 is a byte-compiled function defined
in with-editor.el.
Signature
(with-editor-locate-emacsclient-1 PATH DEPTH)
Source Code
;; Defined in ~/.emacs.d/elpa/with-editor-20260731.2234/with-editor.el
(defun with-editor-locate-emacsclient-1 (path depth)
(let* ((version-lst (cl-subseq (split-string emacs-version "\\.") 0 depth))
(version-reg (concat "^" (string-join version-lst "\\."))))
(or (locate-file
(cond ((equal (downcase invocation-name) "remacs")
"remacsclient")
((bound-and-true-p emacsclient-program-name))
("emacsclient"))
path
(mapcan (lambda (suffix) (mapcar (##concat suffix %) exec-suffixes))
(nconc (and (boundp 'debian-emacs-flavor)
(list (format ".%s" debian-emacs-flavor)))
(cl-mapcon (lambda (ver)
(setq ver (string-join (reverse ver) "."))
(list ver
(concat "-" ver)
(concat ".emacs" ver)))
(reverse version-lst))
(cons "" with-editor-emacsclient-program-suffixes)))
(lambda (exec)
(ignore-errors
(string-match-p version-reg
(with-editor-emacsclient-version exec)))))
(and (> depth 1)
(with-editor-locate-emacsclient-1 path (1- depth))))))