diff options
| author | Artur Malabarba | 2015-05-01 15:23:52 +0100 |
|---|---|---|
| committer | Artur Malabarba | 2015-05-01 15:25:02 +0100 |
| commit | 9b909c4265e9c0394fdb7a12d9dcdc545395078c (patch) | |
| tree | a272e24e9012af2494267266fd2f244d45d0c467 | |
| parent | 8588e3548ce59c6af41f8747a15fb94065f8e5de (diff) | |
| download | emacs-9b909c4265e9c0394fdb7a12d9dcdc545395078c.tar.gz emacs-9b909c4265e9c0394fdb7a12d9dcdc545395078c.zip | |
* lisp/emacs-lisp/bytecomp.el: Revert "Silence noninteractive compilations"
This reverts commit 9a7ddde977378cb5276a81476ae458889c403267.
This reverts commit 3c0ea587daf8b17960b90603a70e3ac4057d883d.
With message: "* lisp/emacs-lisp/bytecomp.el: Use `inhibit-message'".
(Bug#20445).
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 63 |
1 files changed, 19 insertions, 44 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'." | |||
| 979 | (lambda (x) (if (symbolp x) (list 'prin1-to-string x) x)) | 979 | (lambda (x) (if (symbolp x) (list 'prin1-to-string x) x)) |
| 980 | args)))))) | 980 | args)))))) |
| 981 | 981 | ||
| 982 | (defvar byte-compile--interactive nil | ||
| 983 | "Determine if `byte-compile--message' uses the minibuffer.") | ||
| 984 | |||
| 985 | (defun byte-compile--message (format &rest args) | ||
| 986 | "Like `message', except sometimes don't print to minibuffer. | ||
| 987 | If the variable `byte-compile--interactive' is nil, the message | ||
| 988 | is not displayed on the minibuffer." | ||
| 989 | (let ((inhibit-message (not byte-compile--interactive))) | ||
| 990 | (apply #'message format args))) | ||
| 991 | |||
| 992 | ;; Log something that isn't a warning. | 982 | ;; Log something that isn't a warning. |
| 993 | (defun byte-compile-log-1 (string) | 983 | (defun byte-compile-log-1 (string) |
| 994 | (with-current-buffer byte-compile-log-buffer | 984 | (with-current-buffer byte-compile-log-buffer |
| @@ -996,7 +986,7 @@ is not displayed on the minibuffer." | |||
| 996 | (goto-char (point-max)) | 986 | (goto-char (point-max)) |
| 997 | (byte-compile-warning-prefix nil nil) | 987 | (byte-compile-warning-prefix nil nil) |
| 998 | (cond (noninteractive | 988 | (cond (noninteractive |
| 999 | (byte-compile--message " %s" string)) | 989 | (message " %s" string)) |
| 1000 | (t | 990 | (t |
| 1001 | (insert (format "%s\n" string))))))) | 991 | (insert (format "%s\n" string))))))) |
| 1002 | 992 | ||
| @@ -1600,10 +1590,7 @@ extra args." | |||
| 1600 | "Recompile every `.el' file in DIRECTORY that already has a `.elc' file. | 1590 | "Recompile every `.el' file in DIRECTORY that already has a `.elc' file. |
| 1601 | Files in subdirectories of DIRECTORY are processed also." | 1591 | Files in subdirectories of DIRECTORY are processed also." |
| 1602 | (interactive "DByte force recompile (directory): ") | 1592 | (interactive "DByte force recompile (directory): ") |
| 1603 | (let ((byte-compile--interactive | 1593 | (byte-recompile-directory directory nil t)) |
| 1604 | (or byte-compile--interactive | ||
| 1605 | (called-interactively-p 'any)))) | ||
| 1606 | (byte-recompile-directory directory nil t))) | ||
| 1607 | 1594 | ||
| 1608 | ;;;###autoload | 1595 | ;;;###autoload |
| 1609 | (defun byte-recompile-directory (directory &optional arg force) | 1596 | (defun byte-recompile-directory (directory &optional arg force) |
| @@ -1633,9 +1620,6 @@ that already has a `.elc' file." | |||
| 1633 | (compilation-mode)) | 1620 | (compilation-mode)) |
| 1634 | (let ((directories (list default-directory)) | 1621 | (let ((directories (list default-directory)) |
| 1635 | (default-directory default-directory) | 1622 | (default-directory default-directory) |
| 1636 | (byte-compile--interactive | ||
| 1637 | (or byte-compile--interactive | ||
| 1638 | (called-interactively-p 'any))) | ||
| 1639 | (skip-count 0) | 1623 | (skip-count 0) |
| 1640 | (fail-count 0) | 1624 | (fail-count 0) |
| 1641 | (file-count 0) | 1625 | (file-count 0) |
| @@ -1644,7 +1628,7 @@ that already has a `.elc' file." | |||
| 1644 | (displaying-byte-compile-warnings | 1628 | (displaying-byte-compile-warnings |
| 1645 | (while directories | 1629 | (while directories |
| 1646 | (setq directory (car directories)) | 1630 | (setq directory (car directories)) |
| 1647 | (byte-compile--message "Checking %s..." directory) | 1631 | (message "Checking %s..." directory) |
| 1648 | (dolist (file (directory-files directory)) | 1632 | (dolist (file (directory-files directory)) |
| 1649 | (let ((source (expand-file-name file directory))) | 1633 | (let ((source (expand-file-name file directory))) |
| 1650 | (if (file-directory-p source) | 1634 | (if (file-directory-p source) |
| @@ -1669,13 +1653,13 @@ that already has a `.elc' file." | |||
| 1669 | (`t file-count) | 1653 | (`t file-count) |
| 1670 | (_ fail-count))) | 1654 | (_ fail-count))) |
| 1671 | (or noninteractive | 1655 | (or noninteractive |
| 1672 | (byte-compile--message "Checking %s..." directory)) | 1656 | (message "Checking %s..." directory)) |
| 1673 | (if (not (eq last-dir directory)) | 1657 | (if (not (eq last-dir directory)) |
| 1674 | (setq last-dir directory | 1658 | (setq last-dir directory |
| 1675 | dir-count (1+ dir-count))) | 1659 | dir-count (1+ dir-count))) |
| 1676 | ))))) | 1660 | ))))) |
| 1677 | (setq directories (cdr directories)))) | 1661 | (setq directories (cdr directories)))) |
| 1678 | (byte-compile--message "Done (Total of %d file%s compiled%s%s%s)" | 1662 | (message "Done (Total of %d file%s compiled%s%s%s)" |
| 1679 | file-count (if (= file-count 1) "" "s") | 1663 | file-count (if (= file-count 1) "" "s") |
| 1680 | (if (> fail-count 0) (format ", %d failed" fail-count) "") | 1664 | (if (> fail-count 0) (format ", %d failed" fail-count) "") |
| 1681 | (if (> skip-count 0) (format ", %d skipped" skip-count) "") | 1665 | (if (> skip-count 0) (format ", %d skipped" skip-count) "") |
| @@ -1722,10 +1706,7 @@ If compilation is needed, this functions returns the result of | |||
| 1722 | current-prefix-arg))) | 1706 | current-prefix-arg))) |
| 1723 | (let ((dest (byte-compile-dest-file filename)) | 1707 | (let ((dest (byte-compile-dest-file filename)) |
| 1724 | ;; Expand now so we get the current buffer's defaults | 1708 | ;; Expand now so we get the current buffer's defaults |
| 1725 | (filename (expand-file-name filename)) | 1709 | (filename (expand-file-name filename))) |
| 1726 | (byte-compile--interactive | ||
| 1727 | (or byte-compile--interactive | ||
| 1728 | (called-interactively-p 'any)))) | ||
| 1729 | (if (if (file-exists-p dest) | 1710 | (if (if (file-exists-p dest) |
| 1730 | ;; File was already compiled | 1711 | ;; File was already compiled |
| 1731 | ;; Compile if forced to, or filename newer | 1712 | ;; Compile if forced to, or filename newer |
| @@ -1737,7 +1718,7 @@ If compilation is needed, this functions returns the result of | |||
| 1737 | filename "? "))))) | 1718 | filename "? "))))) |
| 1738 | (progn | 1719 | (progn |
| 1739 | (if (and noninteractive (not byte-compile-verbose)) | 1720 | (if (and noninteractive (not byte-compile-verbose)) |
| 1740 | (byte-compile--message "Compiling %s..." filename)) | 1721 | (message "Compiling %s..." filename)) |
| 1741 | (byte-compile-file filename load)) | 1722 | (byte-compile-file filename load)) |
| 1742 | (when load | 1723 | (when load |
| 1743 | (load (if (file-exists-p dest) dest filename))) | 1724 | (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." | |||
| 1781 | (let ((byte-compile-current-file filename) | 1762 | (let ((byte-compile-current-file filename) |
| 1782 | (byte-compile-current-group nil) | 1763 | (byte-compile-current-group nil) |
| 1783 | (set-auto-coding-for-load t) | 1764 | (set-auto-coding-for-load t) |
| 1784 | (byte-compile--interactive | ||
| 1785 | (or byte-compile--interactive | ||
| 1786 | (called-interactively-p 'any))) | ||
| 1787 | target-file input-buffer output-buffer | 1765 | target-file input-buffer output-buffer |
| 1788 | byte-compile-dest-file) | 1766 | byte-compile-dest-file) |
| 1789 | (setq target-file (byte-compile-dest-file filename)) | 1767 | (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." | |||
| 1839 | ;; (byte-compile-abbreviate-file filename) | 1817 | ;; (byte-compile-abbreviate-file filename) |
| 1840 | ;; (with-current-buffer input-buffer no-byte-compile)) | 1818 | ;; (with-current-buffer input-buffer no-byte-compile)) |
| 1841 | (when (file-exists-p target-file) | 1819 | (when (file-exists-p target-file) |
| 1842 | (byte-compile--message "%s deleted because of `no-byte-compile: %s'" | 1820 | (message "%s deleted because of `no-byte-compile: %s'" |
| 1843 | (byte-compile-abbreviate-file target-file) | 1821 | (byte-compile-abbreviate-file target-file) |
| 1844 | (buffer-local-value 'no-byte-compile input-buffer)) | 1822 | (buffer-local-value 'no-byte-compile input-buffer)) |
| 1845 | (condition-case nil (delete-file target-file) (error nil))) | 1823 | (condition-case nil (delete-file target-file) (error nil))) |
| 1846 | ;; We successfully didn't compile this file. | 1824 | ;; We successfully didn't compile this file. |
| 1847 | 'no-byte-compile) | 1825 | 'no-byte-compile) |
| 1848 | (when byte-compile-verbose | 1826 | (when byte-compile-verbose |
| 1849 | (byte-compile--message "Compiling %s..." filename)) | 1827 | (message "Compiling %s..." filename)) |
| 1850 | (setq byte-compiler-error-flag nil) | 1828 | (setq byte-compiler-error-flag nil) |
| 1851 | ;; It is important that input-buffer not be current at this call, | 1829 | ;; It is important that input-buffer not be current at this call, |
| 1852 | ;; so that the value of point set in input-buffer | 1830 | ;; 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." | |||
| 1858 | (if byte-compiler-error-flag | 1836 | (if byte-compiler-error-flag |
| 1859 | nil | 1837 | nil |
| 1860 | (when byte-compile-verbose | 1838 | (when byte-compile-verbose |
| 1861 | (byte-compile--message "Compiling %s...done" filename)) | 1839 | (message "Compiling %s...done" filename)) |
| 1862 | (kill-buffer input-buffer) | 1840 | (kill-buffer input-buffer) |
| 1863 | (with-current-buffer output-buffer | 1841 | (with-current-buffer output-buffer |
| 1864 | (goto-char (point-max)) | 1842 | (goto-char (point-max)) |
| @@ -1884,7 +1862,7 @@ The value is non-nil if there were no errors, nil if errors." | |||
| 1884 | ;; recompiled). Previously this was accomplished by | 1862 | ;; recompiled). Previously this was accomplished by |
| 1885 | ;; deleting target-file before writing it. | 1863 | ;; deleting target-file before writing it. |
| 1886 | (rename-file tempfile target-file t) | 1864 | (rename-file tempfile target-file t) |
| 1887 | (or noninteractive (byte-compile--message "Wrote %s" target-file))) | 1865 | (or noninteractive (message "Wrote %s" target-file))) |
| 1888 | ;; This is just to give a better error message than write-region | 1866 | ;; This is just to give a better error message than write-region |
| 1889 | (signal 'file-error | 1867 | (signal 'file-error |
| 1890 | (list "Opening output file" | 1868 | (list "Opening output file" |
| @@ -1918,9 +1896,6 @@ With argument ARG, insert value in current buffer after the form." | |||
| 1918 | (byte-compile-read-position (point)) | 1896 | (byte-compile-read-position (point)) |
| 1919 | (byte-compile-last-position byte-compile-read-position) | 1897 | (byte-compile-last-position byte-compile-read-position) |
| 1920 | (byte-compile-last-warned-form 'nothing) | 1898 | (byte-compile-last-warned-form 'nothing) |
| 1921 | (byte-compile--interactive | ||
| 1922 | (or byte-compile--interactive | ||
| 1923 | (called-interactively-p 'any))) | ||
| 1924 | (value (eval | 1899 | (value (eval |
| 1925 | (let ((read-with-symbol-positions (current-buffer)) | 1900 | (let ((read-with-symbol-positions (current-buffer)) |
| 1926 | (read-symbol-positions-list nil)) | 1901 | (read-symbol-positions-list nil)) |
| @@ -1928,10 +1903,10 @@ With argument ARG, insert value in current buffer after the form." | |||
| 1928 | (byte-compile-sexp (read (current-buffer))))) | 1903 | (byte-compile-sexp (read (current-buffer))))) |
| 1929 | lexical-binding))) | 1904 | lexical-binding))) |
| 1930 | (cond (arg | 1905 | (cond (arg |
| 1931 | (byte-compile--message "Compiling from buffer... done.") | 1906 | (message "Compiling from buffer... done.") |
| 1932 | (prin1 value (current-buffer)) | 1907 | (prin1 value (current-buffer)) |
| 1933 | (insert "\n")) | 1908 | (insert "\n")) |
| 1934 | ((byte-compile--message "%s" (prin1-to-string value))))))) | 1909 | ((message "%s" (prin1-to-string value))))))) |
| 1935 | 1910 | ||
| 1936 | (defun byte-compile-from-buffer (inbuffer) | 1911 | (defun byte-compile-from-buffer (inbuffer) |
| 1937 | (let ((byte-compile-current-buffer inbuffer) | 1912 | (let ((byte-compile-current-buffer inbuffer) |
| @@ -2435,7 +2410,7 @@ not to take responsibility for the actual compilation of the code." | |||
| 2435 | (byte-compile-arglist-warn name arglist macro)) | 2410 | (byte-compile-arglist-warn name arglist macro)) |
| 2436 | 2411 | ||
| 2437 | (if byte-compile-verbose | 2412 | (if byte-compile-verbose |
| 2438 | (byte-compile--message "Compiling %s... (%s)" | 2413 | (message "Compiling %s... (%s)" |
| 2439 | (or byte-compile-current-file "") name)) | 2414 | (or byte-compile-current-file "") name)) |
| 2440 | (cond ((not (or macro (listp body))) | 2415 | (cond ((not (or macro (listp body))) |
| 2441 | ;; We do not know positively if the definition is a macro | 2416 | ;; 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." | |||
| 2605 | ;; error to a simple message for the known case where signaling an error | 2580 | ;; error to a simple message for the known case where signaling an error |
| 2606 | ;; causes problems. | 2581 | ;; causes problems. |
| 2607 | ((byte-code-function-p fun) | 2582 | ((byte-code-function-p fun) |
| 2608 | (byte-compile--message "Function %s is already compiled" | 2583 | (message "Function %s is already compiled" |
| 2609 | (if (symbolp form) form "provided")) | 2584 | (if (symbolp form) form "provided")) |
| 2610 | fun) | 2585 | fun) |
| 2611 | (t | 2586 | (t |
| @@ -4423,8 +4398,8 @@ binding slots have been popped." | |||
| 4423 | name macro arglist body rest) | 4398 | name macro arglist body rest) |
| 4424 | (when macro | 4399 | (when macro |
| 4425 | (if (null fun) | 4400 | (if (null fun) |
| 4426 | (byte-compile--message "Macro %s unrecognized, won't work in file" name) | 4401 | (message "Macro %s unrecognized, won't work in file" name) |
| 4427 | (byte-compile--message "Macro %s partly recognized, trying our luck" name) | 4402 | (message "Macro %s partly recognized, trying our luck" name) |
| 4428 | (push (cons name (eval fun)) | 4403 | (push (cons name (eval fun)) |
| 4429 | byte-compile-macro-environment))) | 4404 | byte-compile-macro-environment))) |
| 4430 | (byte-compile-keep-pending form)))) | 4405 | (byte-compile-keep-pending form)))) |
| @@ -4550,11 +4525,11 @@ The call tree also lists those functions which are not known to be called | |||
| 4550 | \(that is, to which no calls have been compiled\), and which cannot be | 4525 | \(that is, to which no calls have been compiled\), and which cannot be |
| 4551 | invoked interactively." | 4526 | invoked interactively." |
| 4552 | (interactive) | 4527 | (interactive) |
| 4553 | (byte-compile--message "Generating call tree...") | 4528 | (message "Generating call tree...") |
| 4554 | (with-output-to-temp-buffer "*Call-Tree*" | 4529 | (with-output-to-temp-buffer "*Call-Tree*" |
| 4555 | (set-buffer "*Call-Tree*") | 4530 | (set-buffer "*Call-Tree*") |
| 4556 | (erase-buffer) | 4531 | (erase-buffer) |
| 4557 | (byte-compile--message "Generating call tree... (sorting on %s)" | 4532 | (message "Generating call tree... (sorting on %s)" |
| 4558 | byte-compile-call-tree-sort) | 4533 | byte-compile-call-tree-sort) |
| 4559 | (insert "Call tree for " | 4534 | (insert "Call tree for " |
| 4560 | (cond ((null byte-compile-current-file) (or filename "???")) | 4535 | (cond ((null byte-compile-current-file) (or filename "???")) |