diff options
| author | K. Handa | 2015-05-02 22:39:54 +0900 |
|---|---|---|
| committer | K. Handa | 2015-05-02 22:39:54 +0900 |
| commit | 40e720d049693dfe0c5559a8a8285a0b5cc6c5e2 (patch) | |
| tree | 46b84f79be0930e7fa729ae06836b90892e3d9b5 /lisp | |
| parent | c3c9dab41b637b53034dd2f3dce6bf042380adae (diff) | |
| parent | 0bbc027356b680f32ac7b2d47d43a65d01091032 (diff) | |
| download | emacs-40e720d049693dfe0c5559a8a8285a0b5cc6c5e2.tar.gz emacs-40e720d049693dfe0c5559a8a8285a0b5cc6c5e2.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/cedet/ede/locate.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 63 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/pcase.el | 10 | ||||
| -rw-r--r-- | lisp/emacs-lisp/seq.el | 1 | ||||
| -rw-r--r-- | lisp/files.el | 12 | ||||
| -rw-r--r-- | lisp/isearch.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cmacexp.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/elisp-mode.el | 21 | ||||
| -rw-r--r-- | lisp/progmodes/etags.el | 9 | ||||
| -rw-r--r-- | lisp/progmodes/xref.el | 43 | ||||
| -rw-r--r-- | lisp/simple.el | 5 | ||||
| -rw-r--r-- | lisp/whitespace.el | 53 |
14 files changed, 148 insertions, 81 deletions
diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el index 2ff83418f78..a076c46513c 100644 --- a/lisp/cedet/ede/locate.el +++ b/lisp/cedet/ede/locate.el | |||
| @@ -353,7 +353,7 @@ that created this EDE locate object." | |||
| 353 | 353 | ||
| 354 | (cl-defmethod ede-locate-create/update-root-database | 354 | (cl-defmethod ede-locate-create/update-root-database |
| 355 | ((loc (subclass ede-locate-cscope)) root) | 355 | ((loc (subclass ede-locate-cscope)) root) |
| 356 | "Create or update the GNU Global database for the current project." | 356 | "Create or update the Cscope database for the current project." |
| 357 | (require 'cedet-cscope) | 357 | (require 'cedet-cscope) |
| 358 | (cedet-cscope-create/update-database root)) | 358 | (cedet-cscope-create/update-database root)) |
| 359 | 359 | ||
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 "???")) |
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." | |||
| 730 | (cl-check-type slot symbol) | 730 | (cl-check-type slot symbol) |
| 731 | (cl-check-type obj (or eieio-object class)) | 731 | (cl-check-type obj (or eieio-object class)) |
| 732 | (let* ((class (cond ((symbolp obj) | 732 | (let* ((class (cond ((symbolp obj) |
| 733 | (error "eieio-oref called on a class!") | 733 | (error "eieio-oref called on a class: %s" obj) |
| 734 | (let ((c (eieio--class-v obj))) | 734 | (let ((c (eieio--class-v obj))) |
| 735 | (if (eieio--class-p c) (eieio-class-un-autoload obj)) | 735 | (if (eieio--class-p c) (eieio-class-un-autoload obj)) |
| 736 | c)) | 736 | 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." | |||
| 269 | (defun ert--special-operator-p (thing) | 269 | (defun ert--special-operator-p (thing) |
| 270 | "Return non-nil if THING is a symbol naming a special operator." | 270 | "Return non-nil if THING is a symbol naming a special operator." |
| 271 | (and (symbolp thing) | 271 | (and (symbolp thing) |
| 272 | (let ((definition (ignore-errors (indirect-function thing)))) | 272 | (let ((definition (indirect-function thing))) |
| 273 | (and (subrp definition) | 273 | (and (subrp definition) |
| 274 | (eql (cdr (subr-arity definition)) 'unevalled))))) | 274 | (eql (cdr (subr-arity definition)) 'unevalled))))) |
| 275 | 275 | ||
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 @@ | |||
| 91 | 91 | ||
| 92 | (def-edebug-spec pcase-MACRO pcase--edebug-match-macro) | 92 | (def-edebug-spec pcase-MACRO pcase--edebug-match-macro) |
| 93 | 93 | ||
| 94 | ;; Only called from edebug. | ||
| 95 | (declare-function get-edebug-spec "edebug" (symbol)) | ||
| 96 | (declare-function edebug-match "edebug" (cursor specs)) | ||
| 97 | |||
| 94 | (defun pcase--edebug-match-macro (cursor) | 98 | (defun pcase--edebug-match-macro (cursor) |
| 95 | (let (specs) | 99 | (let (specs) |
| 96 | (mapatoms | 100 | (mapatoms |
| @@ -158,12 +162,18 @@ Currently, the following patterns are provided this way:" | |||
| 158 | ;; (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize-2) | 162 | ;; (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize-2) |
| 159 | expansion)))) | 163 | expansion)))) |
| 160 | 164 | ||
| 165 | (declare-function help-fns--signature "help-fns" | ||
| 166 | (function doc real-def real-function)) | ||
| 167 | |||
| 161 | ;; FIXME: Obviously, this will collide with nadvice's use of | 168 | ;; FIXME: Obviously, this will collide with nadvice's use of |
| 162 | ;; function-documentation if we happen to advise `pcase'. | 169 | ;; function-documentation if we happen to advise `pcase'. |
| 163 | (put 'pcase 'function-documentation '(pcase--make-docstring)) | 170 | (put 'pcase 'function-documentation '(pcase--make-docstring)) |
| 164 | (defun pcase--make-docstring () | 171 | (defun pcase--make-docstring () |
| 165 | (let* ((main (documentation (symbol-function 'pcase) 'raw)) | 172 | (let* ((main (documentation (symbol-function 'pcase) 'raw)) |
| 166 | (ud (help-split-fundoc main 'pcase))) | 173 | (ud (help-split-fundoc main 'pcase))) |
| 174 | ;; So that eg emacs -Q -l cl-lib --eval "(documentation 'pcase)" works, | ||
| 175 | ;; where cl-lib is anything using pcase-defmacro. | ||
| 176 | (require 'help-fns) | ||
| 167 | (with-temp-buffer | 177 | (with-temp-buffer |
| 168 | (insert (or (cdr ud) main)) | 178 | (insert (or (cdr ud) main)) |
| 169 | (mapatoms | 179 | (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'." | |||
| 344 | (defalias 'seq-do #'mapc) | 344 | (defalias 'seq-do #'mapc) |
| 345 | (defalias 'seq-each #'seq-do) | 345 | (defalias 'seq-each #'seq-do) |
| 346 | (defalias 'seq-map #'mapcar) | 346 | (defalias 'seq-map #'mapcar) |
| 347 | (defalias 'seq-p #'sequencep) | ||
| 347 | 348 | ||
| 348 | (unless (fboundp 'elisp--font-lock-flush-elisp-buffers) | 349 | (unless (fboundp 'elisp--font-lock-flush-elisp-buffers) |
| 349 | ;; In Emacs≥25, (via elisp--font-lock-flush-elisp-buffers and a few others) | 350 | ;; In Emacs≥25, (via elisp--font-lock-flush-elisp-buffers and a few others) |
diff --git a/lisp/files.el b/lisp/files.el index 045eeaf154c..ef6ac7b8c92 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -654,10 +654,14 @@ the value of `default-directory'." | |||
| 654 | 'file-directory-p)) | 654 | 'file-directory-p)) |
| 655 | 655 | ||
| 656 | 656 | ||
| 657 | (defun pwd () | 657 | (defun pwd (&optional insert) |
| 658 | "Show the current default directory." | 658 | "Show the current default directory. |
| 659 | (interactive nil) | 659 | With prefix argument INSERT, insert the current default directory |
| 660 | (message "Directory %s" default-directory)) | 660 | at point instead." |
| 661 | (interactive "P") | ||
| 662 | (if insert | ||
| 663 | (insert default-directory) | ||
| 664 | (message "Directory %s" default-directory))) | ||
| 661 | 665 | ||
| 662 | (defvar cd-path nil | 666 | (defvar cd-path nil |
| 663 | "Value of the CDPATH environment variable, as a list. | 667 | "Value of the CDPATH environment variable, as a list. |
diff --git a/lisp/isearch.el b/lisp/isearch.el index c714ba0055d..dc10502309f 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -452,7 +452,7 @@ This is like `describe-bindings', but displays only Isearch keys." | |||
| 452 | (define-key map "\M-\C-s" 'isearch-repeat-forward) | 452 | (define-key map "\M-\C-s" 'isearch-repeat-forward) |
| 453 | (define-key map "\M-\C-r" 'isearch-repeat-backward) | 453 | (define-key map "\M-\C-r" 'isearch-repeat-backward) |
| 454 | (define-key map "\177" 'isearch-delete-char) | 454 | (define-key map "\177" 'isearch-delete-char) |
| 455 | (define-key map [backspace] 'isearch-delete-char) | 455 | (define-key map [backspace] 'undefined) ;bug#20466. |
| 456 | (define-key map "\C-g" 'isearch-abort) | 456 | (define-key map "\C-g" 'isearch-abort) |
| 457 | 457 | ||
| 458 | ;; This assumes \e is the meta-prefix-char. | 458 | ;; This assumes \e is the meta-prefix-char. |
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el index 357625d10cf..19d0473c42d 100644 --- a/lisp/progmodes/cmacexp.el +++ b/lisp/progmodes/cmacexp.el | |||
| @@ -364,8 +364,8 @@ Optional arg DISPLAY non-nil means show messages in the echo area." | |||
| 364 | ;; Find and delete the mark of the start of the expansion. | 364 | ;; Find and delete the mark of the start of the expansion. |
| 365 | ;; Look for `# nn "file.c"' lines and delete them. | 365 | ;; Look for `# nn "file.c"' lines and delete them. |
| 366 | (goto-char (point-min)) | 366 | (goto-char (point-min)) |
| 367 | (search-forward startmarker) | 367 | (if (search-forward startmarker nil t) |
| 368 | (delete-region 1 (point))) | 368 | (delete-region 1 (point)))) |
| 369 | (while (re-search-forward (concat "^# [0-9]+ \"" | 369 | (while (re-search-forward (concat "^# [0-9]+ \"" |
| 370 | (regexp-quote filename) | 370 | (regexp-quote filename) |
| 371 | "\"") nil t) | 371 | "\"") nil t) |
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index f2890686e79..2bb661a59c8 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el | |||
| @@ -587,6 +587,8 @@ It can be quoted, or be inside a quoted form." | |||
| 587 | (let ((sym (intern-soft id))) | 587 | (let ((sym (intern-soft id))) |
| 588 | (when sym | 588 | (when sym |
| 589 | (elisp--xref-find-definitions sym)))) | 589 | (elisp--xref-find-definitions sym)))) |
| 590 | (`references | ||
| 591 | (elisp--xref-find-references id)) | ||
| 590 | (`apropos | 592 | (`apropos |
| 591 | (elisp--xref-find-apropos id)))) | 593 | (elisp--xref-find-apropos id)))) |
| 592 | 594 | ||
| @@ -635,6 +637,25 @@ It can be quoted, or be inside a quoted form." | |||
| 635 | lst)))) | 637 | lst)))) |
| 636 | lst))) | 638 | lst))) |
| 637 | 639 | ||
| 640 | (defun elisp--xref-find-references (symbol) | ||
| 641 | (let* ((dirs (sort | ||
| 642 | (mapcar | ||
| 643 | (lambda (dir) | ||
| 644 | (file-name-as-directory (expand-file-name dir))) | ||
| 645 | (cons package-user-dir load-path)) | ||
| 646 | #'string<)) | ||
| 647 | (ref dirs)) | ||
| 648 | ;; Delete subdirectories from the list. | ||
| 649 | (while (cdr ref) | ||
| 650 | (if (string-prefix-p (car ref) (cadr ref)) | ||
| 651 | (setcdr ref (cddr ref)) | ||
| 652 | (setq ref (cdr ref)))) | ||
| 653 | (cl-mapcan | ||
| 654 | (lambda (dir) | ||
| 655 | (and (file-exists-p dir) | ||
| 656 | (xref-collect-references symbol dir))) | ||
| 657 | dirs))) | ||
| 658 | |||
| 638 | (defun elisp--xref-find-apropos (regexp) | 659 | (defun elisp--xref-find-apropos (regexp) |
| 639 | (apply #'nconc | 660 | (apply #'nconc |
| 640 | (let (lst) | 661 | (let (lst) |
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index b4ce8b11c9c..4e923aac197 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -2082,6 +2082,15 @@ for \\[find-tag] (which see)." | |||
| 2082 | (defun etags-xref-find (action id) | 2082 | (defun etags-xref-find (action id) |
| 2083 | (pcase action | 2083 | (pcase action |
| 2084 | (`definitions (etags--xref-find-definitions id)) | 2084 | (`definitions (etags--xref-find-definitions id)) |
| 2085 | (`references | ||
| 2086 | (let ((dirs (if tags-table-list | ||
| 2087 | (mapcar #'file-name-directory tags-table-list) | ||
| 2088 | ;; If no tags files are loaded, prompt for the dir. | ||
| 2089 | (list (read-directory-name "In directory: " nil nil t))))) | ||
| 2090 | (cl-mapcan | ||
| 2091 | (lambda (dir) | ||
| 2092 | (xref-collect-references id dir)) | ||
| 2093 | dirs))) | ||
| 2085 | (`apropos (etags--xref-find-definitions id t)))) | 2094 | (`apropos (etags--xref-find-definitions id t)))) |
| 2086 | 2095 | ||
| 2087 | (defun etags--xref-find-definitions (pattern &optional regexp?) | 2096 | (defun etags--xref-find-definitions (pattern &optional regexp?) |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index fc27c268845..099c08045b2 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -674,6 +674,49 @@ and just use etags." | |||
| 674 | (setq-local xref-identifier-completion-table-function | 674 | (setq-local xref-identifier-completion-table-function |
| 675 | (cdr xref-etags-mode--saved)))) | 675 | (cdr xref-etags-mode--saved)))) |
| 676 | 676 | ||
| 677 | (declare-function semantic-symref-find-references-by-name "semantic/symref") | ||
| 678 | (declare-function semantic-find-file-noselect "semantic/fw") | ||
| 679 | |||
| 680 | (defun xref-collect-references (name dir) | ||
| 681 | "Collect mentions of NAME inside DIR. | ||
| 682 | Uses the Semantic Symbol Reference API, see | ||
| 683 | `semantic-symref-find-references-by-name' for details on which | ||
| 684 | tools are used, and when." | ||
| 685 | (require 'semantic/symref) | ||
| 686 | (defvar semantic-symref-tool) | ||
| 687 | (cl-assert (directory-name-p dir)) | ||
| 688 | (let* ((default-directory dir) | ||
| 689 | (semantic-symref-tool 'detect) | ||
| 690 | (res (semantic-symref-find-references-by-name name 'subdirs)) | ||
| 691 | (hits (and res (oref res :hit-lines))) | ||
| 692 | (orig-buffers (buffer-list))) | ||
| 693 | (unwind-protect | ||
| 694 | (delq nil | ||
| 695 | (mapcar (lambda (hit) (xref--collect-reference hit name)) hits)) | ||
| 696 | (mapc #'kill-buffer | ||
| 697 | (cl-set-difference (buffer-list) orig-buffers))))) | ||
| 698 | |||
| 699 | (defun xref--collect-reference (hit name) | ||
| 700 | (pcase-let* ((`(,line . ,file) hit) | ||
| 701 | (buf (or (find-buffer-visiting file) | ||
| 702 | (semantic-find-file-noselect file)))) | ||
| 703 | (with-current-buffer buf | ||
| 704 | (save-excursion | ||
| 705 | (goto-char (point-min)) | ||
| 706 | (forward-line (1- line)) | ||
| 707 | (when (re-search-forward (format "\\_<%s\\_>" | ||
| 708 | (regexp-quote name)) | ||
| 709 | (line-end-position) t) | ||
| 710 | (goto-char (match-beginning 0)) | ||
| 711 | (xref-make (format | ||
| 712 | "%d: %s" | ||
| 713 | line | ||
| 714 | (buffer-substring | ||
| 715 | (line-beginning-position) | ||
| 716 | (line-end-position))) | ||
| 717 | (xref-make-file-location file line | ||
| 718 | (current-column)))))))) | ||
| 719 | |||
| 677 | 720 | ||
| 678 | (provide 'xref) | 721 | (provide 'xref) |
| 679 | 722 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index cf1912ade4f..31efe3896d4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -6992,8 +6992,9 @@ The function should return non-nil if the two tokens do not match.") | |||
| 6992 | (buffer-substring blinkpos (1+ blinkpos)))) | 6992 | (buffer-substring blinkpos (1+ blinkpos)))) |
| 6993 | ;; There is nothing to show except the char itself. | 6993 | ;; There is nothing to show except the char itself. |
| 6994 | (t (buffer-substring blinkpos (1+ blinkpos)))))) | 6994 | (t (buffer-substring blinkpos (1+ blinkpos)))))) |
| 6995 | (message "Matches %s" | 6995 | (minibuffer-message |
| 6996 | (substring-no-properties open-paren-line-string))))))))) | 6996 | "Matches %s" |
| 6997 | (substring-no-properties open-paren-line-string))))))))) | ||
| 6997 | 6998 | ||
| 6998 | (defvar blink-paren-function 'blink-matching-open | 6999 | (defvar blink-paren-function 'blink-matching-open |
| 6999 | "Function called, if non-nil, whenever a close parenthesis is inserted. | 7000 | "Function called, if non-nil, whenever a close parenthesis is inserted. |
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index b4cd67ff6b9..fad3e2f3ea6 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -538,31 +538,34 @@ cleaning up a buffer. See `whitespace-cleanup' and | |||
| 538 | `whitespace-cleanup-region' for documentation. | 538 | `whitespace-cleanup-region' for documentation. |
| 539 | 539 | ||
| 540 | See also `whitespace-display-mappings' for documentation." | 540 | See also `whitespace-display-mappings' for documentation." |
| 541 | :type '(repeat :tag "Kind of Blank" | 541 | :type '(set :tag "Kind of Blank" |
| 542 | (choice :tag "Kind of Blank Face" | 542 | (const :tag "(Face) Face visualization" face) |
| 543 | (const :tag "(Face) Face visualization" | 543 | (const :tag "(Face) Trailing TABs, SPACEs and HARD SPACEs" |
| 544 | face) | 544 | trailing) |
| 545 | (const :tag "(Face) Trailing TABs, SPACEs and HARD SPACEs" | 545 | (const :tag "(Face) TABs" tabs) |
| 546 | trailing) | 546 | (const :tag "(Face) SPACEs and HARD SPACEs" spaces) |
| 547 | (const :tag "(Face) SPACEs and HARD SPACEs" | 547 | (const :tag "(Face) Lines" lines) |
| 548 | spaces) | 548 | (const :tag "(Face) Lines, only overlong part" lines-tail) |
| 549 | (const :tag "(Face) TABs" tabs) | 549 | (const :tag "(Face) NEWLINEs" newline) |
| 550 | (const :tag "(Face) Lines" lines) | 550 | (const :tag "(Face) Empty Lines At BOB And/Or EOB" empty) |
| 551 | (const :tag "(Face) SPACEs before TAB" | 551 | (const :tag "(Face) Indentation SPACEs" indentation::tab) |
| 552 | space-before-tab) | 552 | (const :tag "(Face) Indentation TABs" |
| 553 | (const :tag "(Face) NEWLINEs" newline) | 553 | indentation::space) |
| 554 | (const :tag "(Face) Indentation SPACEs" | 554 | (const :tag "(Face) Indentation TABs or SPACEs" indentation) |
| 555 | indentation) | 555 | (const :tag "(Face) Too much line indentation" big-indent) |
| 556 | (const :tag "(Face) Too much line indentation" | 556 | (const :tag "(Face) SPACEs after TAB: SPACEs" |
| 557 | big-indent) | 557 | space-after-tab::tab) |
| 558 | (const :tag "(Face) Empty Lines At BOB And/Or EOB" | 558 | (const :tag "(Face) SPACEs after TAB: TABs" |
| 559 | empty) | 559 | space-after-tab::space) |
| 560 | (const :tag "(Face) SPACEs after TAB" | 560 | (const :tag "(Face) SPACEs after TAB" space-after-tab) |
| 561 | space-after-tab) | 561 | (const :tag "(Face) SPACEs before TAB: SPACEs" |
| 562 | (const :tag "(Mark) SPACEs and HARD SPACEs" | 562 | space-before-tab::tab) |
| 563 | space-mark) | 563 | (const :tag "(Face) SPACEs before TAB: TABs" |
| 564 | (const :tag "(Mark) TABs" tab-mark) | 564 | space-before-tab::space) |
| 565 | (const :tag "(Mark) NEWLINEs" newline-mark))) | 565 | (const :tag "(Face) SPACEs before TAB" space-before-tab) |
| 566 | (const :tag "(Mark) SPACEs and HARD SPACEs" space-mark) | ||
| 567 | (const :tag "(Mark) TABs" tab-mark) | ||
| 568 | (const :tag "(Mark) NEWLINEs" newline-mark)) | ||
| 566 | :group 'whitespace) | 569 | :group 'whitespace) |
| 567 | 570 | ||
| 568 | (defvar whitespace-space 'whitespace-space | 571 | (defvar whitespace-space 'whitespace-space |