diff options
author | Pierre Courtieu <Pierre.Courtieu@cnam.fr> | 2018-06-15 09:34:30 +0200 |
---|---|---|
committer | Pierre Courtieu <Pierre.Courtieu@cnam.fr> | 2018-06-15 09:34:30 +0200 |
commit | d04888c966ebbf0ea5532b44766697f6fa8e04c3 (patch) | |
tree | 4486f1392ab49d5b6bd0ff58ff11951053488523 | |
parent | c54b17d14e57eb77093ec0006d2db5e9e3754902 (diff) |
Fix #368 (emacs < 25 split-string has no trim arg).
Copied some code from company-coq.
-rw-r--r-- | coq/coq-syntax.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/coq/coq-syntax.el b/coq/coq-syntax.el index d6850a0a..722167bb 100644 --- a/coq/coq-syntax.el +++ b/coq/coq-syntax.el @@ -23,6 +23,7 @@ (require 'proof-utils) ; proof-locate-executable (require 'coq-db) (require 'span) +(require 'subr-x) ;;; keyword databases @@ -1392,12 +1393,12 @@ endhypname beg end)." (let ((res '())) (goto-char (point-min)) (while (search-forward-regexp coq-hyp-name-in-goal-or-response-regexp limit t) - (let* ((str (match-string 2)) + (let* ((str (replace-regexp-in-string "\\`[ \r\n\t]+\\|[ \r\n\t]+\\'" "" (match-string 2) t t)) (beghypname (match-beginning 2)) (beg (match-end 0)) (begcross (match-beginning 1)) (endhypname (match-end 2)) - (splitstr (split-string str ",\\|,$\\|:" t "\\s-")) + (splitstr (split-string str ",\\|,$\\|:" t)) ; 4th arg of split-string errors in emacs24 (end (save-excursion ; looking for next hyp and return its leftest part (search-forward-regexp coq-hyp-name-or-goalsep-in-goal-or-response-regexp nil t) (goto-char (match-beginning 1)) |