summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-06-02 07:31:06 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-06-02 07:33:14 -0700
commita158324abdab59ea28f58a4af9311d447d4a1879 (patch)
tree88b4b3b3f9bcbc816e038f508633f170bb2144de
parentc7695d0adb125a3817f3df015137287e801e457a (diff)
downloademacs-a158324abdab59ea28f58a4af9311d447d4a1879.tar.gz
Generate curved quotes in ert doc
* lisp/emacs-lisp/ert.el (ert--print-test-for-ewoc) (ert-results-mode-menu) (ert-results-pop-to-backtrace-for-test-at-point) (ert-results-pop-to-messages-for-test-at-point) (ert-results-pop-to-should-forms-for-test-at-point) (ert-describe-test): Quote ‘like this’, not `like this', when generating doc strings and the like. * test/automated/ert-x-tests.el (ert-test-describe-test): Allow quoting ‘like this’.
-rw-r--r--lisp/emacs-lisp/ert.el27
-rw-r--r--test/automated/ert-x-tests.el5
2 files changed, 18 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index b678e122c11..99c5ede33a0 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1849,7 +1849,9 @@ non-nil, returns the face for expected results.."
(when (ert-test-documentation test)
(insert " "
(propertize
- (ert--string-first-line (ert-test-documentation test))
+ (ert--string-first-line
+ (substitute-command-keys
+ (ert-test-documentation test)))
'font-lock-face 'font-lock-doc-face)
"\n"))
(cl-etypecase result
@@ -2063,7 +2065,7 @@ and how to display message."
"--"
["Show backtrace" ert-results-pop-to-backtrace-for-test-at-point]
["Show messages" ert-results-pop-to-messages-for-test-at-point]
- ["Show `should' forms" ert-results-pop-to-should-forms-for-test-at-point]
+ ["Show ‘should’ forms" ert-results-pop-to-should-forms-for-test-at-point]
["Describe test" ert-results-describe-test-at-point]
"--"
["Delete test" ert-delete-test]
@@ -2375,9 +2377,9 @@ To be used in the ERT results buffer."
(ert--print-backtrace backtrace)
(debugger-make-xrefs)
(goto-char (point-min))
- (insert "Backtrace for test `")
+ (insert "Backtrace for test ‘")
(ert-insert-test-name-button (ert-test-name test))
- (insert "':\n")))))))
+ (insert "’:\n")))))))
(defun ert-results-pop-to-messages-for-test-at-point ()
"Display the part of the *Messages* buffer generated during the test at point.
@@ -2396,9 +2398,9 @@ To be used in the ERT results buffer."
(ert-simple-view-mode)
(insert (ert-test-result-messages result))
(goto-char (point-min))
- (insert "Messages for test `")
+ (insert "Messages for test ‘")
(ert-insert-test-name-button (ert-test-name test))
- (insert "':\n")))))
+ (insert "’:\n")))))
(defun ert-results-pop-to-should-forms-for-test-at-point ()
"Display the list of `should' forms executed during the test at point.
@@ -2426,9 +2428,9 @@ To be used in the ERT results buffer."
(ert--pp-with-indentation-and-newline form-description)
(ert--make-xrefs-region begin (point)))))
(goto-char (point-min))
- (insert "`should' forms executed during test `")
+ (insert "‘should’ forms executed during test ‘")
(ert-insert-test-name-button (ert-test-name test))
- (insert "':\n")
+ (insert "’:\n")
(insert "\n")
(insert (concat "(Values are shallow copies and may have "
"looked different during the test if they\n"
@@ -2505,9 +2507,9 @@ To be used in the ERT results buffer."
(let ((file-name (and test-name
(symbol-file test-name 'ert-deftest))))
(when file-name
- (insert " defined in `" (file-name-nondirectory file-name) "'")
+ (insert " defined in ‘" (file-name-nondirectory file-name) "’")
(save-excursion
- (re-search-backward "`\\([^`']+\\)'" nil t)
+ (re-search-backward "‘\\([^‘’]+\\)’" nil t)
(help-xref-button 1 'help-function-def test-name file-name)))
(insert ".")
(fill-region-as-paragraph (point-min) (point))
@@ -2519,8 +2521,9 @@ To be used in the ERT results buffer."
"this documentation refers to an old definition.")
(fill-region-as-paragraph begin (point)))
(insert "\n\n"))
- (insert (or (ert-test-documentation test-definition)
- "It is not documented.")
+ (insert (substitute-command-keys
+ (or (ert-test-documentation test-definition)
+ "It is not documented."))
"\n")))))))
(defun ert-results-describe-test-at-point ()
diff --git a/test/automated/ert-x-tests.el b/test/automated/ert-x-tests.el
index 81d0f7c65c6..617213386e2 100644
--- a/test/automated/ert-x-tests.el
+++ b/test/automated/ert-x-tests.el
@@ -195,8 +195,9 @@
(let ((case-fold-search nil))
(should (string-match (concat
"\\`ert-test-describe-test is a test"
- " defined in `ert-x-tests.elc?'\\.\n\n"
- "Tests `ert-describe-test'\\.\n\\'")
+ " defined in"
+ " [`‘]ert-x-tests.elc?['’]\\.\n\n"
+ "Tests [`‘]ert-describe-test['’]\\.\n\\'")
(buffer-string)))))))))
(ert-deftest ert-test-message-log-truncation ()