summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
-rw-r--r--lisp/emacs-lisp/edebug.el4
-rw-r--r--lisp/emacs-lisp/ert.el22
-rw-r--r--lisp/emacs-lisp/lisp-mode.el35
-rw-r--r--lisp/emacs-lisp/pcase.el4
-rw-r--r--lisp/emacs-lisp/seq.el2
-rw-r--r--lisp/emacs-lisp/thunk.el2
7 files changed, 42 insertions, 29 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index f45ae359f6c..2c2996ebab4 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -443,7 +443,7 @@ Return the compile-time value of FORM."
;; Macroexpand (not macroexpand-all!) form at toplevel in case it
;; expands into a toplevel-equivalent `progn'. See CLHS section
;; 3.2.3.1, "Processing of Top Level Forms". The semantics are very
- ;; subtle: see test/automated/bytecomp-tests.el for interesting
+ ;; subtle: see test/lisp/emacs-lisp/bytecomp-tests.el for interesting
;; cases.
(setf form (macroexp-macroexpand form byte-compile-macro-environment))
(if (eq (car-safe form) 'progn)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 60133055623..4116e31d0a9 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -733,9 +733,9 @@ Maybe clear the markers and delete the symbol's edebug property?"
((eq class 'string) (read (current-buffer)))
((eq class 'quote) (forward-char 1)
(list 'quote (edebug-read-sexp)))
- ((eq class 'backquote)
+ ((eq class 'backquote) (forward-char 1)
(list '\` (edebug-read-sexp)))
- ((eq class 'comma)
+ ((eq class 'comma) (forward-char 1)
(list '\, (edebug-read-sexp)))
(t ; anything else, just read it.
(read (current-buffer))))))
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index cadd66ca6ed..e7387e463cb 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1236,7 +1236,7 @@ SELECTOR is the selector that was used to select TESTS."
(funcall listener 'test-ended stats test result))
(setf (ert--stats-current-test stats) nil))))
-(defun ert-run-tests (selector listener)
+(defun ert-run-tests (selector listener &optional interactively)
"Run the tests specified by SELECTOR, sending progress updates to LISTENER."
(let* ((tests (ert-select-tests selector t))
(stats (ert--make-stats tests selector)))
@@ -1247,10 +1247,14 @@ SELECTOR is the selector that was used to select TESTS."
(let ((ert--current-run-stats stats))
(force-mode-line-update)
(unwind-protect
- (progn
- (cl-loop for test in tests do
- (ert-run-or-rerun-test stats test listener))
- (setq abortedp nil))
+ (cl-loop for test in tests do
+ (ert-run-or-rerun-test stats test listener)
+ (when (and interactively
+ (ert-test-quit-p
+ (ert-test-most-recent-result test))
+ (y-or-n-p "Abort testing? "))
+ (cl-return))
+ finally (setq abortedp nil))
(setf (ert--stats-aborted-p stats) abortedp)
(setf (ert--stats-end-time stats) (current-time))
(funcall listener 'run-ended stats abortedp)))
@@ -1442,7 +1446,8 @@ Returns the stats object."
(ert-test-result-expected-p
test result))
(1+ (ert--stats-test-pos stats test))
- (ert-test-name test)))))))))
+ (ert-test-name test)))))))
+ nil))
;;;###autoload
(defun ert-run-tests-batch-and-exit (&optional selector)
@@ -2033,9 +2038,8 @@ and how to display message."
test result)))
(ert--results-update-stats-display-maybe ewoc stats)
(ewoc-invalidate ewoc node))))))))
- (ert-run-tests
- selector
- listener)))
+ (ert-run-tests selector listener t)))
+
;;;###autoload
(defalias 'ert 'ert-run-tests-interactively)
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index eb07c18b03d..b7a5eb774da 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -259,6 +259,24 @@ This will generate compile-time constants from BINDINGS."
(funcall loop bindings)))))))
(funcall loop bindings)))
+(defun elisp--font-lock-backslash ()
+ (let* ((beg0 (match-beginning 0))
+ (end0 (match-end 0))
+ (ppss (save-excursion (syntax-ppss beg0))))
+ (and (nth 3 ppss) ;Inside a string.
+ (not (nth 5 ppss)) ;The \ is not itself \-escaped.
+ ;; Don't highlight the \( introduced because of
+ ;; `open-paren-in-column-0-is-defun-start'.
+ (not (eq ?\n (char-before beg0)))
+ (equal (ignore-errors
+ (car (read-from-string
+ (format "\"%s\""
+ (buffer-substring-no-properties
+ beg0 end0)))))
+ (buffer-substring-no-properties (1+ beg0) end0))
+ `(face ,font-lock-warning-face
+ help-echo "This \\ has no effect"))))
+
(let-when-compile
((lisp-fdefs '("defmacro" "defun"))
(lisp-vdefs '("defvar"))
@@ -413,17 +431,7 @@ This will generate compile-time constants from BINDINGS."
(1 font-lock-constant-face prepend))
;; Ineffective backslashes (typically in need of doubling).
("\\(\\\\\\)\\([^\"\\]\\)"
- (1 (let ((ppss (save-excursion (syntax-ppss (match-beginning 0)))))
- (and (nth 3 ppss) ;Inside a string.
- (not (nth 5 ppss)) ;The \ is not itself \-escaped.
- (equal (ignore-errors
- (car (read-from-string
- (format "\"%s\""
- (match-string-no-properties 0)))))
- (match-string-no-properties 2))
- `(face ,font-lock-warning-face
- help-echo "This \\ has no effect")))
- prepend))
+ (1 (elisp--font-lock-backslash) prepend))
;; Words inside ‘’ and `' tend to be symbol names.
(,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)"
lisp-mode-symbol-regexp "\\)['’]")
@@ -1083,7 +1091,8 @@ ENDPOS is encountered."
(init-depth (car state))
(next-depth init-depth)
(last-depth init-depth)
- (last-syntax-point (point)))
+ (last-syntax-point (point))
+ (real-endpos endpos))
(unless endpos
;; Get error now if we don't have a complete sexp after point.
(save-excursion (forward-sexp 1)
@@ -1116,6 +1125,8 @@ ENDPOS is encountered."
last-depth (- last-depth next-depth)
next-depth init-depth))
(forward-line 1)
+ (when (and (not real-endpos) (<= next-depth init-depth))
+ (goto-char endpos))
(when (< (point) endpos)
(let ((depth-delta (- next-depth last-depth)))
(cond ((< depth-delta 0)
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 289265abf27..fc5474ecc43 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -175,8 +175,8 @@ Emacs Lisp manual for more information and examples."
;; (when (gethash (car cases) pcase--memoize-2)
;; (message "pcase-memoize failed because of eq test on %S"
;; (car cases)))
- (when data
- (message "pcase-memoize: equal first branch, yet different"))
+ ;; (when data
+ ;; (message "pcase-memoize: equal first branch, yet different"))
(let ((expansion (pcase--expand exp cases)))
(puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize)
;; (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize-1)
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 41187646624..10de2484798 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -52,7 +52,7 @@
;; - `seq-copy'
;; - `seq-into'
;;
-;; All functions are tested in test/automated/seq-tests.el
+;; All functions are tested in test/lisp/emacs-lisp/seq-tests.el
;;; Code:
diff --git a/lisp/emacs-lisp/thunk.el b/lisp/emacs-lisp/thunk.el
index be0a90fefde..f4c075d22ce 100644
--- a/lisp/emacs-lisp/thunk.el
+++ b/lisp/emacs-lisp/thunk.el
@@ -42,8 +42,6 @@
;;
;; (thunk-force delayed)
-;; Tests are located at test/automated/thunk-tests.el
-
;;; Code:
(defmacro thunk-delay (&rest body)