Use seq-position instead of string-search when setting hostname

Turns out string-search was only added pretty recently, so
seq-position is better in terms of portability (Debian still have an
old emacs in their repos, for example). Probably a tiny amount faster
too lol
This commit is contained in:
2022-10-31 10:31:43 +00:00
parent 8c4d592bf9
commit ae41e92137

View File

@@ -62,9 +62,9 @@
#+begin_src emacs-lisp
(defun cut-at (delimeter string)
(substring string 0 (string-search delimeter string)))
(substring string 0 (seq-position string delimeter)))
(defvar hostname (cut-at "." (system-name)))
(defvar hostname (cut-at ?. (system-name)))
#+end_src
* Emacs Server