branch: elpa/with-editor
commit b591c286c9487dd37fa212ea888f2fcffbaab931
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
with-editor-locate-emacsclient: don't assume version string length
Emacs usually identifies itself as "N.M.1" or "N.0.[59][0-9]"
but at least one users Emacs identifies itself as just "N.M",
so stop assuming that the version string always consist of at
least three elements.
Fixes #33.
---
with-editor.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/with-editor.el b/with-editor.el
index fb60724..af8fc25 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -106,7 +106,9 @@
(defun with-editor-locate-emacsclient ()
"Search for a suitable Emacsclient executable."
- (or (with-editor-locate-emacsclient-1 (with-editor-emacsclient-path) 3)
+ (or (with-editor-locate-emacsclient-1
+ (with-editor-emacsclient-path)
+ (length (split-string emacs-version "\\.")))
(prog1 nil (display-warning 'with-editor "\
Cannot determine a suitable Emacsclient