summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2021-02-25 22:37:11 +0800
committerLeo Liu <sdl.web@gmail.com>2021-02-25 22:38:08 +0800
commit62b89d5202b3b520cfdfb79f7b7bf7039a02b386 (patch)
treeb2bf778b292d1b3e29dd3200a431cf0f99df30e3 /lib
parent1084da14ebb07b93366f1c0c282898fe45262b8a (diff)
downloaderlang-62b89d5202b3b520cfdfb79f7b7bf7039a02b386.tar.gz
Address failed tests in emacs_SUITE
Diffstat (limited to 'lib')
-rw-r--r--lib/tools/emacs/erlang-eunit.el2
-rw-r--r--lib/tools/emacs/erlang.el4
-rw-r--r--lib/tools/emacs/erldoc.el4
-rw-r--r--lib/tools/test/emacs_SUITE.erl2
4 files changed, 7 insertions, 5 deletions
diff --git a/lib/tools/emacs/erlang-eunit.el b/lib/tools/emacs/erlang-eunit.el
index 73c25246df..6212553611 100644
--- a/lib/tools/emacs/erlang-eunit.el
+++ b/lib/tools/emacs/erlang-eunit.el
@@ -216,7 +216,7 @@ buffer and vice versa"
With prefix arg, compiles for debug and runs tests with the verbose flag set."
(interactive)
- (case (erlang-eunit-recent 'mode)
+ (cl-case (erlang-eunit-recent 'mode)
('test-mode
(erlang-eunit-compile-and-test
'erlang-eunit-run-test (list (erlang-eunit-recent 'module)
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index b096bab2f0..de5dd4955f 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -81,7 +81,9 @@
(require 'tempo)
;;; `caddr' is builtin since Emacs 26.
-(or (fboundp 'caddr) (defun caddr (x) (car (cdr (cdr x)))))
+(eval-and-compile
+ (or (fboundp 'caddr)
+ (defun caddr (x) (car (cdr (cdr x))))))
;; Variables:
diff --git a/lib/tools/emacs/erldoc.el b/lib/tools/emacs/erldoc.el
index a8ac81ecb3..51fc67c513 100644
--- a/lib/tools/emacs/erldoc.el
+++ b/lib/tools/emacs/erldoc.el
@@ -60,9 +60,10 @@
;;; Code:
-(eval-when-compile (require 'url-parse))
(require 'cl-lib)
+(require 'json)
(require 'erlang)
+(eval-when-compile (require 'url-parse))
(eval-and-compile ;for emacs < 24.3
(or (fboundp 'user-error) (defalias 'user-error 'error)))
@@ -268,7 +269,6 @@ up the indexing."
(with-temp-buffer
(if (not json)
(pp table (current-buffer))
- (eval-and-compile (require 'json))
(let ((json-encoding-pretty-print t))
(insert (json-encode table))))
(unless (file-directory-p (file-name-directory output))
diff --git a/lib/tools/test/emacs_SUITE.erl b/lib/tools/test/emacs_SUITE.erl
index e5587b35b1..f74a159cd2 100644
--- a/lib/tools/test/emacs_SUITE.erl
+++ b/lib/tools/test/emacs_SUITE.erl
@@ -107,7 +107,7 @@ compile_and_load(_Config) ->
%% Workaround byte-compile-error-on-warn which seem broken in
%% Emacs 25.
"\"(advice-add #'display-warning :after "
- "(lambda (_ f _ _) (error \"%s\" f)))\"";
+ "(lambda (_ f &optional _ _) (error \\\"%s\\\" f)))\"";
_ ->
"\"(setq byte-compile-error-on-warn t)\""
end,