Merge remote-tracking branch 'savannah/master' into HEAD
This commit is contained in:
commit
d5791ba5fe
78 changed files with 5235 additions and 1419 deletions
|
@ -1,4 +1,4 @@
|
|||
;;; backquote.el --- implement the ` Lisp construct
|
||||
;;; backquote.el --- implement the ` Lisp construct -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 1990, 1992, 1994, 2001-2020 Free Software Foundation,
|
||||
;; Inc.
|
||||
|
|
|
@ -4461,7 +4461,6 @@ reinstrument it."
|
|||
(defun edebug-temp-display-freq-count ()
|
||||
"Temporarily display the frequency count data for the current definition.
|
||||
It is removed when you hit any char."
|
||||
;; This seems not to work with Emacs 18.59. It undoes too far.
|
||||
(interactive)
|
||||
(let ((inhibit-read-only t))
|
||||
(undo-boundary)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
(eval-when-compile (require 'cl-lib))
|
||||
(require 'ert)
|
||||
(require 'subr-x) ; string-trim
|
||||
|
||||
|
||||
;;; Test buffers.
|
||||
|
@ -353,6 +354,45 @@ convert it to a string and pass it to COLLECTOR first."
|
|||
(funcall func object)))
|
||||
(funcall func object printcharfun))))
|
||||
|
||||
(defvar ert-resource-directory-format "%s-resources/"
|
||||
"Format for `ert-resource-directory'.")
|
||||
(defvar ert-resource-directory-trim-left-regexp ""
|
||||
"Regexp for `string-trim' (left) used by `ert-resource-directory'.")
|
||||
(defvar ert-resource-directory-trim-right-regexp "\\(-tests?\\)?\\.el"
|
||||
"Regexp for `string-trim' (right) used by `ert-resource-directory'.")
|
||||
|
||||
;; Has to be a macro for `load-file-name'.
|
||||
(defmacro ert-resource-directory ()
|
||||
"Return absolute file name of the resource directory for this file.
|
||||
|
||||
The path to the resource directory is the \"resources\" directory
|
||||
in the same directory as the test file.
|
||||
|
||||
If that directory doesn't exist, use the directory named like the
|
||||
test file but formatted by `ert-resource-directory-format' and trimmed
|
||||
using `string-trim' with arguments
|
||||
`ert-resource-directory-trim-left-regexp' and
|
||||
`ert-resource-directory-trim-right-regexp'. The default values mean
|
||||
that if called from a test file named \"foo-tests.el\", return
|
||||
the absolute file name for \"foo-resources\"."
|
||||
`(let* ((testfile ,(or (bound-and-true-p byte-compile-current-file)
|
||||
(and load-in-progress load-file-name)
|
||||
buffer-file-name))
|
||||
(default-directory (file-name-directory testfile)))
|
||||
(file-truename
|
||||
(if (file-accessible-directory-p "resources/")
|
||||
(expand-file-name "resources/")
|
||||
(expand-file-name
|
||||
(format ert-resource-directory-format
|
||||
(string-trim testfile
|
||||
ert-resource-directory-trim-left-regexp
|
||||
ert-resource-directory-trim-right-regexp)))))))
|
||||
|
||||
(defmacro ert-resource-file (file)
|
||||
"Return file name of resource file named FILE.
|
||||
A resource file is in the resource directory as per
|
||||
`ert-resource-directory'."
|
||||
`(expand-file-name ,file (ert-resource-directory)))
|
||||
|
||||
(provide 'ert-x)
|
||||
|
||||
|
|
|
@ -2152,6 +2152,7 @@ Downloads and installs required packages as needed."
|
|||
(unless (package--user-selected-p name)
|
||||
(package--save-selected-packages
|
||||
(cons name package-selected-packages)))
|
||||
(package--quickstart-maybe-refresh)
|
||||
pkg-desc))
|
||||
|
||||
;;;###autoload
|
||||
|
|
|
@ -164,8 +164,11 @@ With argument, pretty-print output into current buffer.
|
|||
Ignores leading comment characters."
|
||||
(interactive "P")
|
||||
(if arg
|
||||
(insert (pp-to-string (eval (pp-last-sexp) lexical-binding)))
|
||||
(pp-eval-expression (pp-last-sexp))))
|
||||
(insert (pp-to-string (eval (elisp--eval-defun-1
|
||||
(macroexpand (pp-last-sexp)))
|
||||
lexical-binding)))
|
||||
(pp-eval-expression (elisp--eval-defun-1
|
||||
(macroexpand (pp-last-sexp))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun pp-macroexpand-last-sexp (arg)
|
||||
|
|
|
@ -294,7 +294,7 @@ entirely by setting `warning-suppress-types' or
|
|||
message)
|
||||
;; Don't output the buttons when doing batch compilation
|
||||
;; and similar.
|
||||
(unless noninteractive
|
||||
(unless (or noninteractive (eq type 'bytecomp))
|
||||
(insert " ")
|
||||
(insert-button "Disable showing"
|
||||
'type 'warning-suppress-warning
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue