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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user