branch: externals/realgud commit 90fe351f3297b70c7f0aebb80796f81736e76e6c Author: rocky <ro...@gnu.org> Commit: rocky <ro...@gnu.org>
More Emacs-gaurded handling of realgud:join-string --- realgud/common/utils.el | 14 +++++++++----- test/test-track.el | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/realgud/common/utils.el b/realgud/common/utils.el index e6aec5a..a4460e3 100644 --- a/realgud/common/utils.el +++ b/realgud/common/utils.el @@ -30,11 +30,15 @@ (t (append (realgud:flatten (car mylist)) (realgud:flatten (cdr mylist)))))) -;; From https://stackoverflow.com/questions/12999530/is-there-a-function-that-joins-a-string-into-a-delimited-string -(defun realgud:join-string (list joiner) - (if (< emacs-major-version 25) - (mapconcat 'identity list joiner) - (string-join list joiner))) +(if (or (< emacs-major-version 24) + (and (= emacs-major-version 24 (< 4 emacs-minor-version)))) + ;; From + ;; https://stackoverflow.com/questions/12999530/is-there-a-function-that-joins-a-string-into-a-delimited-string + (defun realgud:join-string (list joiner) + (mapconcat 'identity list joiner)) + (progn + (require 'subr-x) + (defalias 'realgud:join-string 'string-join))) (defun realgud:canonic-major-mode() "Return diff --git a/test/test-track.el b/test/test-track.el index c3f8f9d..e3befb0 100644 --- a/test/test-track.el +++ b/test/test-track.el @@ -105,8 +105,9 @@ trepan: That's all, folks... (note "realgud:eval-command-p") (setq test-command-name-hash (make-hash-table :test 'equal)) -(puthash "eval" "eval" test-command-name-hash) (set (make-local-variable 'realgud-command-name-hash) test-command-name-hash) +(assert-nil (realgud:eval-command-p "eval 'cow'\n'cow'\n(pdb)")) +(puthash "eval" "eval" test-command-name-hash) (assert-t (realgud:eval-command-p "eval 'cow'\n'cow'\n(pdb)")) (assert-nil (realgud:eval-command-p "next 1"))