summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el63
-rw-r--r--lisp/emacs-lisp/eieio-core.el2
-rw-r--r--lisp/emacs-lisp/ert.el2
-rw-r--r--lisp/emacs-lisp/pcase.el10
-rw-r--r--lisp/emacs-lisp/seq.el1
5 files changed, 32 insertions, 46 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index d732c730bff..f0d2ee48ed2 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -979,16 +979,6 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
(lambda (x) (if (symbolp x) (list 'prin1-to-string x) x))
args))))))
-(defvar byte-compile--interactive nil
- "Determine if `byte-compile--message' uses the minibuffer.")
-
-(defun byte-compile--message (format &rest args)
- "Like `message', except sometimes don't print to minibuffer.
-If the variable `byte-compile--interactive' is nil, the message
-is not displayed on the minibuffer."
- (let ((inhibit-message (not byte-compile--interactive)))
- (apply #'message format args)))
-
;; Log something that isn't a warning.
(defun byte-compile-log-1 (string)
(with-current-buffer byte-compile-log-buffer
@@ -996,7 +986,7 @@ is not displayed on the minibuffer."
(goto-char (point-max))
(byte-compile-warning-prefix nil nil)
(cond (noninteractive
- (byte-compile--message " %s" string))
+ (message " %s" string))
(t
(insert (format "%s\n" string)))))))
@@ -1600,10 +1590,7 @@ extra args."
"Recompile every `.el' file in DIRECTORY that already has a `.elc' file.
Files in subdirectories of DIRECTORY are processed also."
(interactive "DByte force recompile (directory): ")
- (let ((byte-compile--interactive
- (or byte-compile--interactive
- (called-interactively-p 'any))))
- (byte-recompile-directory directory nil t)))
+ (byte-recompile-directory directory nil t))
;;;###autoload
(defun byte-recompile-directory (directory &optional arg force)
@@ -1633,9 +1620,6 @@ that already has a `.elc' file."
(compilation-mode))
(let ((directories (list default-directory))
(default-directory default-directory)
- (byte-compile--interactive
- (or byte-compile--interactive
- (called-interactively-p 'any)))
(skip-count 0)
(fail-count 0)
(file-count 0)
@@ -1644,7 +1628,7 @@ that already has a `.elc' file."
(displaying-byte-compile-warnings
(while directories
(setq directory (car directories))
- (byte-compile--message "Checking %s..." directory)
+ (message "Checking %s..." directory)
(dolist (file (directory-files directory))
(let ((source (expand-file-name file directory)))
(if (file-directory-p source)
@@ -1669,13 +1653,13 @@ that already has a `.elc' file."
(`t file-count)
(_ fail-count)))
(or noninteractive
- (byte-compile--message "Checking %s..." directory))
+ (message "Checking %s..." directory))
(if (not (eq last-dir directory))
(setq last-dir directory
dir-count (1+ dir-count)))
)))))
(setq directories (cdr directories))))
- (byte-compile--message "Done (Total of %d file%s compiled%s%s%s)"
+ (message "Done (Total of %d file%s compiled%s%s%s)"
file-count (if (= file-count 1) "" "s")
(if (> fail-count 0) (format ", %d failed" fail-count) "")
(if (> skip-count 0) (format ", %d skipped" skip-count) "")
@@ -1722,10 +1706,7 @@ If compilation is needed, this functions returns the result of
current-prefix-arg)))
(let ((dest (byte-compile-dest-file filename))
;; Expand now so we get the current buffer's defaults
- (filename (expand-file-name filename))
- (byte-compile--interactive
- (or byte-compile--interactive
- (called-interactively-p 'any))))
+ (filename (expand-file-name filename)))
(if (if (file-exists-p dest)
;; File was already compiled
;; Compile if forced to, or filename newer
@@ -1737,7 +1718,7 @@ If compilation is needed, this functions returns the result of
filename "? ")))))
(progn
(if (and noninteractive (not byte-compile-verbose))
- (byte-compile--message "Compiling %s..." filename))
+ (message "Compiling %s..." filename))
(byte-compile-file filename load))
(when load
(load (if (file-exists-p dest) dest filename)))
@@ -1781,9 +1762,6 @@ The value is non-nil if there were no errors, nil if errors."
(let ((byte-compile-current-file filename)
(byte-compile-current-group nil)
(set-auto-coding-for-load t)
- (byte-compile--interactive
- (or byte-compile--interactive
- (called-interactively-p 'any)))
target-file input-buffer output-buffer
byte-compile-dest-file)
(setq target-file (byte-compile-dest-file filename))
@@ -1839,14 +1817,14 @@ The value is non-nil if there were no errors, nil if errors."
;; (byte-compile-abbreviate-file filename)
;; (with-current-buffer input-buffer no-byte-compile))
(when (file-exists-p target-file)
- (byte-compile--message "%s deleted because of `no-byte-compile: %s'"
+ (message "%s deleted because of `no-byte-compile: %s'"
(byte-compile-abbreviate-file target-file)
(buffer-local-value 'no-byte-compile input-buffer))
(condition-case nil (delete-file target-file) (error nil)))
;; We successfully didn't compile this file.
'no-byte-compile)
(when byte-compile-verbose
- (byte-compile--message "Compiling %s..." filename))
+ (message "Compiling %s..." filename))
(setq byte-compiler-error-flag nil)
;; It is important that input-buffer not be current at this call,
;; so that the value of point set in input-buffer
@@ -1858,7 +1836,7 @@ The value is non-nil if there were no errors, nil if errors."
(if byte-compiler-error-flag
nil
(when byte-compile-verbose
- (byte-compile--message "Compiling %s...done" filename))
+ (message "Compiling %s...done" filename))
(kill-buffer input-buffer)
(with-current-buffer output-buffer
(goto-char (point-max))
@@ -1884,7 +1862,7 @@ The value is non-nil if there were no errors, nil if errors."
;; recompiled). Previously this was accomplished by
;; deleting target-file before writing it.
(rename-file tempfile target-file t)
- (or noninteractive (byte-compile--message "Wrote %s" target-file)))
+ (or noninteractive (message "Wrote %s" target-file)))
;; This is just to give a better error message than write-region
(signal 'file-error
(list "Opening output file"
@@ -1918,9 +1896,6 @@ With argument ARG, insert value in current buffer after the form."
(byte-compile-read-position (point))
(byte-compile-last-position byte-compile-read-position)
(byte-compile-last-warned-form 'nothing)
- (byte-compile--interactive
- (or byte-compile--interactive
- (called-interactively-p 'any)))
(value (eval
(let ((read-with-symbol-positions (current-buffer))
(read-symbol-positions-list nil))
@@ -1928,10 +1903,10 @@ With argument ARG, insert value in current buffer after the form."
(byte-compile-sexp (read (current-buffer)))))
lexical-binding)))
(cond (arg
- (byte-compile--message "Compiling from buffer... done.")
+ (message "Compiling from buffer... done.")
(prin1 value (current-buffer))
(insert "\n"))
- ((byte-compile--message "%s" (prin1-to-string value)))))))
+ ((message "%s" (prin1-to-string value)))))))
(defun byte-compile-from-buffer (inbuffer)
(let ((byte-compile-current-buffer inbuffer)
@@ -2435,7 +2410,7 @@ not to take responsibility for the actual compilation of the code."
(byte-compile-arglist-warn name arglist macro))
(if byte-compile-verbose
- (byte-compile--message "Compiling %s... (%s)"
+ (message "Compiling %s... (%s)"
(or byte-compile-current-file "") name))
(cond ((not (or macro (listp body)))
;; We do not know positively if the definition is a macro
@@ -2605,7 +2580,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
;; error to a simple message for the known case where signaling an error
;; causes problems.
((byte-code-function-p fun)
- (byte-compile--message "Function %s is already compiled"
+ (message "Function %s is already compiled"
(if (symbolp form) form "provided"))
fun)
(t
@@ -4423,8 +4398,8 @@ binding slots have been popped."
name macro arglist body rest)
(when macro
(if (null fun)
- (byte-compile--message "Macro %s unrecognized, won't work in file" name)
- (byte-compile--message "Macro %s partly recognized, trying our luck" name)
+ (message "Macro %s unrecognized, won't work in file" name)
+ (message "Macro %s partly recognized, trying our luck" name)
(push (cons name (eval fun))
byte-compile-macro-environment)))
(byte-compile-keep-pending form))))
@@ -4550,11 +4525,11 @@ The call tree also lists those functions which are not known to be called
\(that is, to which no calls have been compiled\), and which cannot be
invoked interactively."
(interactive)
- (byte-compile--message "Generating call tree...")
+ (message "Generating call tree...")
(with-output-to-temp-buffer "*Call-Tree*"
(set-buffer "*Call-Tree*")
(erase-buffer)
- (byte-compile--message "Generating call tree... (sorting on %s)"
+ (message "Generating call tree... (sorting on %s)"
byte-compile-call-tree-sort)
(insert "Call tree for "
(cond ((null byte-compile-current-file) (or filename "???"))
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index 92d7234bc73..bf3f44206c4 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -730,7 +730,7 @@ Argument FN is the function calling this verifier."
(cl-check-type slot symbol)
(cl-check-type obj (or eieio-object class))
(let* ((class (cond ((symbolp obj)
- (error "eieio-oref called on a class!")
+ (error "eieio-oref called on a class: %s" obj)
(let ((c (eieio--class-v obj)))
(if (eieio--class-p c) (eieio-class-un-autoload obj))
c))
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 384fef546ae..8dc8261365f 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -269,7 +269,7 @@ DATA is displayed to the user and should state the reason for skipping."
(defun ert--special-operator-p (thing)
"Return non-nil if THING is a symbol naming a special operator."
(and (symbolp thing)
- (let ((definition (ignore-errors (indirect-function thing))))
+ (let ((definition (indirect-function thing)))
(and (subrp definition)
(eql (cdr (subr-arity definition)) 'unevalled)))))
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 978c3f0dd30..5a81bb20e57 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -91,6 +91,10 @@
(def-edebug-spec pcase-MACRO pcase--edebug-match-macro)
+;; Only called from edebug.
+(declare-function get-edebug-spec "edebug" (symbol))
+(declare-function edebug-match "edebug" (cursor specs))
+
(defun pcase--edebug-match-macro (cursor)
(let (specs)
(mapatoms
@@ -158,12 +162,18 @@ Currently, the following patterns are provided this way:"
;; (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize-2)
expansion))))
+(declare-function help-fns--signature "help-fns"
+ (function doc real-def real-function))
+
;; FIXME: Obviously, this will collide with nadvice's use of
;; function-documentation if we happen to advise `pcase'.
(put 'pcase 'function-documentation '(pcase--make-docstring))
(defun pcase--make-docstring ()
(let* ((main (documentation (symbol-function 'pcase) 'raw))
(ud (help-split-fundoc main 'pcase)))
+ ;; So that eg emacs -Q -l cl-lib --eval "(documentation 'pcase)" works,
+ ;; where cl-lib is anything using pcase-defmacro.
+ (require 'help-fns)
(with-temp-buffer
(insert (or (cdr ud) main))
(mapatoms
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 2f3f519e986..456debf5f7c 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -344,6 +344,7 @@ This is an optimization for lists in `seq-take-while'."
(defalias 'seq-do #'mapc)
(defalias 'seq-each #'seq-do)
(defalias 'seq-map #'mapcar)
+(defalias 'seq-p #'sequencep)
(unless (fboundp 'elisp--font-lock-flush-elisp-buffers)
;; In Emacs≄25, (via elisp--font-lock-flush-elisp-buffers and a few others)