diff options
| author | Ken Raeburn | 2017-07-31 01:13:53 -0400 |
|---|---|---|
| committer | Ken Raeburn | 2017-07-31 01:13:53 -0400 |
| commit | 13f3370400031e2ac1c9be0932f411370fc6984e (patch) | |
| tree | 06f349b2b0f1cda9e36f7c4390d9d2d9bf49303c | |
| parent | cd0966b33c1fe975520e85e0e7af82c09e4754dc (diff) | |
| parent | dcfcaf40d577808d640016c886d4fae7280a7fd5 (diff) | |
| download | emacs-scratch/raeburn-startup.tar.gz emacs-scratch/raeburn-startup.zip | |
; Merge from branch 'master'scratch/raeburn-startup
90 files changed, 1701 insertions, 651 deletions
diff --git a/.gitignore b/.gitignore index 46ed4a137de..9229297833a 100644 --- a/.gitignore +++ b/.gitignore | |||
| @@ -111,7 +111,6 @@ lisp/mh-e/mh-autoloads.el | |||
| 111 | lisp/subdirs.el | 111 | lisp/subdirs.el |
| 112 | 112 | ||
| 113 | # Dependencies. | 113 | # Dependencies. |
| 114 | .deps/ | ||
| 115 | deps/ | 114 | deps/ |
| 116 | 115 | ||
| 117 | # Logs and temporaries. | 116 | # Logs and temporaries. |
| @@ -138,6 +137,7 @@ gmon.out | |||
| 138 | oo/ | 137 | oo/ |
| 139 | oo-spd/ | 138 | oo-spd/ |
| 140 | src/*.map | 139 | src/*.map |
| 140 | vgcore.*[0-9] | ||
| 141 | 141 | ||
| 142 | # Tests. | 142 | # Tests. |
| 143 | test/manual/biditest.txt | 143 | test/manual/biditest.txt |
diff --git a/CONTRIBUTE b/CONTRIBUTE index 3ed587c6918..365e4232499 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE | |||
| @@ -26,6 +26,7 @@ admin/notes/git-workflow. | |||
| 26 | 26 | ||
| 27 | ** Getting involved with development | 27 | ** Getting involved with development |
| 28 | 28 | ||
| 29 | Discussion about Emacs development takes place on emacs-devel@gnu.org. | ||
| 29 | You can subscribe to the emacs-devel@gnu.org mailing list, paying | 30 | You can subscribe to the emacs-devel@gnu.org mailing list, paying |
| 30 | attention to postings with subject lines containing "emacs-announce", | 31 | attention to postings with subject lines containing "emacs-announce", |
| 31 | as these discuss important events like feature freezes. See | 32 | as these discuss important events like feature freezes. See |
| @@ -35,11 +36,85 @@ own copy of the repository, and discuss proposed changes on the | |||
| 35 | mailing list. Frequent contributors to Emacs can request write access | 36 | mailing list. Frequent contributors to Emacs can request write access |
| 36 | there. | 37 | there. |
| 37 | 38 | ||
| 38 | ** Committing changes by others | 39 | Bug reports and fixes, feature requests and patches/implementations |
| 40 | should be sent to bug-gnu-emacs@gnu.org, the bug/feature list. This | ||
| 41 | is coupled to the http://debbugs.gnu.org tracker. It is best to use | ||
| 42 | the command 'M-x report-emacs-bug RET' to report issues to the tracker | ||
| 43 | (described below). Be prepared to receive comments and requests for | ||
| 44 | changes in your patches, following your submission. | ||
| 39 | 45 | ||
| 40 | If committing changes written by someone else, commit in their name, | 46 | The Savannah info page http://savannah.gnu.org/mail/?group=emacs |
| 41 | not yours. You can use 'git commit --author="AUTHOR"' to specify a | 47 | describes how to subscribe to the mailing lists, or see the list |
| 42 | change's author. | 48 | archives. |
| 49 | |||
| 50 | To email a patch you can use a shell command like 'git format-patch -1' | ||
| 51 | to create a file, and then attach the file to your email. This nicely | ||
| 52 | packages the patch's commit message and changes. To send just one | ||
| 53 | such patch without additional remarks, you can use a command like | ||
| 54 | 'git send-email --to=bug-gnu-emacs@gnu.org 0001-DESCRIPTION.patch'. | ||
| 55 | |||
| 56 | ** Issue tracker (a.k.a. "bug tracker") | ||
| 57 | |||
| 58 | The Emacs issue tracker at http://debbugs.gnu.org lets you view bug | ||
| 59 | reports and search the database for bugs matching several criteria. | ||
| 60 | Messages posted to the bug-gnu-emacs@gnu.org mailing list, mentioned | ||
| 61 | above, are recorded by the tracker with the corresponding bugs/issues. | ||
| 62 | |||
| 63 | GNU ELPA has a 'debbugs' package that allows accessing the tracker | ||
| 64 | database from Emacs. | ||
| 65 | |||
| 66 | Bugs needs regular attention. A large backlog of bugs is | ||
| 67 | disheartening to the developers, and a culture of ignoring bugs is | ||
| 68 | harmful to users, who expect software that works. Bugs have to be | ||
| 69 | regularly looked at and acted upon. Not all bugs are critical, but at | ||
| 70 | the least, each bug needs to be regularly re-reviewed to make sure it | ||
| 71 | is still reproducible. | ||
| 72 | |||
| 73 | The process of going through old or new bugs and acting on them is | ||
| 74 | called bug triage. This process is described in the file | ||
| 75 | admin/notes/bug-triage. | ||
| 76 | |||
| 77 | ** Documenting your changes | ||
| 78 | |||
| 79 | Any change that matters to end-users should have an entry in etc/NEWS. | ||
| 80 | |||
| 81 | Doc-strings should be updated together with the code. | ||
| 82 | |||
| 83 | Think about whether your change requires updating the manuals. If you | ||
| 84 | know it does not, mark the NEWS entry with "---". If you know | ||
| 85 | that *all* the necessary documentation updates have been made, mark | ||
| 86 | the entry with "+++". Otherwise do not mark it. | ||
| 87 | |||
| 88 | If your change requires updating the manuals to document new | ||
| 89 | functions/commands/variables/faces, then use the proper Texinfo | ||
| 90 | command to index them; for instance, use @vindex for variables and | ||
| 91 | @findex for functions/commands. For the full list of predefine indices, see | ||
| 92 | http://www.gnu.org/software/texinfo/manual/texinfo/html_node/Predefined-Indices.html | ||
| 93 | or run the shell command 'info "(texinfo)Predefined Indices"'. | ||
| 94 | |||
| 95 | For more specific tips on Emacs's doc style, see | ||
| 96 | http://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html | ||
| 97 | Use 'checkdoc' to check for documentation errors before submitting a patch. | ||
| 98 | |||
| 99 | ** Testing your changes | ||
| 100 | |||
| 101 | Please test your changes before committing them or sending them to the | ||
| 102 | list. If possible, add a new test along with any bug fix or new | ||
| 103 | functionality you commit (of course, some changes cannot be easily | ||
| 104 | tested). | ||
| 105 | |||
| 106 | Emacs uses ERT, Emacs Lisp Regression Testing, for testing. See | ||
| 107 | http://www.gnu.org/software/emacs/manual/html_node/ert/ | ||
| 108 | or run 'info "(ert)"' for for more information on writing and running | ||
| 109 | tests. | ||
| 110 | |||
| 111 | If your test lasts longer than some few seconds, mark it in its | ||
| 112 | 'ert-deftest' definition with ":tags '(:expensive-test)". | ||
| 113 | |||
| 114 | To run tests on the entire Emacs tree, run "make check" from the | ||
| 115 | top-level directory. Most tests are in the directory "test/". From | ||
| 116 | the "test/" directory, run "make <filename>" to run the tests for | ||
| 117 | <filename>.el(c). See "test/README" for more information. | ||
| 43 | 118 | ||
| 44 | ** Commit messages | 119 | ** Commit messages |
| 45 | 120 | ||
| @@ -176,6 +251,12 @@ them right the first time, so here are guidelines for formatting them: | |||
| 176 | with Emacs commands like 'C-x 4 a', and commit the change using the | 251 | with Emacs commands like 'C-x 4 a', and commit the change using the |
| 177 | shell command 'vc-dwim --commit'. Type 'vc-dwim --help' for more. | 252 | shell command 'vc-dwim --commit'. Type 'vc-dwim --help' for more. |
| 178 | 253 | ||
| 254 | ** Committing changes by others | ||
| 255 | |||
| 256 | If committing changes written by someone else, commit in their name, | ||
| 257 | not yours. You can use 'git commit --author="AUTHOR"' to specify a | ||
| 258 | change's author. | ||
| 259 | |||
| 179 | ** Branches | 260 | ** Branches |
| 180 | 261 | ||
| 181 | Future development normally takes place on the master branch. | 262 | Future development normally takes place on the master branch. |
| @@ -218,87 +299,6 @@ This repository does not contain the Emacs Lisp package archive | |||
| 218 | (elpa.gnu.org). See admin/notes/elpa for how to access the GNU ELPA | 299 | (elpa.gnu.org). See admin/notes/elpa for how to access the GNU ELPA |
| 219 | repository. | 300 | repository. |
| 220 | 301 | ||
| 221 | ** Emacs Mailing lists. | ||
| 222 | |||
| 223 | Discussion about Emacs development takes place on emacs-devel@gnu.org. | ||
| 224 | |||
| 225 | Bug reports and fixes, feature requests and implementations should be | ||
| 226 | sent to bug-gnu-emacs@gnu.org, the bug/feature list. This is coupled | ||
| 227 | to the http://debbugs.gnu.org tracker. | ||
| 228 | |||
| 229 | The Savannah info page http://savannah.gnu.org/mail/?group=emacs | ||
| 230 | describes how to subscribe to the mailing lists, or see the list | ||
| 231 | archives. | ||
| 232 | |||
| 233 | To email a patch you can use a shell command like 'git format-patch -1' | ||
| 234 | to create a file, and then attach the file to your email. This nicely | ||
| 235 | packages the patch's commit message and changes. To send just one | ||
| 236 | such patch without additional remarks, you can use a command like | ||
| 237 | 'git send-email --to=bug-gnu-emacs@gnu.org 0001-DESCRIPTION.patch'. | ||
| 238 | |||
| 239 | ** Issue tracker (a.k.a. "bug tracker") | ||
| 240 | |||
| 241 | The Emacs issue tracker at http://debbugs.gnu.org lets you view bug | ||
| 242 | reports and search the database for bugs matching several criteria. | ||
| 243 | Messages posted to the bug-gnu-emacs@gnu.org mailing list, mentioned | ||
| 244 | above, are recorded by the tracker with the corresponding bugs/issues. | ||
| 245 | |||
| 246 | GNU ELPA has a 'debbugs' package that allows accessing the tracker | ||
| 247 | database from Emacs. | ||
| 248 | |||
| 249 | Bugs needs regular attention. A large backlog of bugs is | ||
| 250 | disheartening to the developers, and a culture of ignoring bugs is | ||
| 251 | harmful to users, who expect software that works. Bugs have to be | ||
| 252 | regularly looked at and acted upon. Not all bugs are critical, but at | ||
| 253 | the least, each bug needs to be regularly re-reviewed to make sure it | ||
| 254 | is still reproducible. | ||
| 255 | |||
| 256 | The process of going through old or new bugs and acting on them is | ||
| 257 | called bug triage. This process is described in the file | ||
| 258 | admin/notes/bug-triage. | ||
| 259 | |||
| 260 | ** Documenting your changes | ||
| 261 | |||
| 262 | Any change that matters to end-users should have an entry in etc/NEWS. | ||
| 263 | |||
| 264 | Doc-strings should be updated together with the code. | ||
| 265 | |||
| 266 | Think about whether your change requires updating the manuals. If you | ||
| 267 | know it does not, mark the NEWS entry with "---". If you know | ||
| 268 | that *all* the necessary documentation updates have been made, mark | ||
| 269 | the entry with "+++". Otherwise do not mark it. | ||
| 270 | |||
| 271 | If your change requires updating the manuals to document new | ||
| 272 | functions/commands/variables/faces, then use the proper Texinfo | ||
| 273 | command to index them; for instance, use @vindex for variables and | ||
| 274 | @findex for functions/commands. For the full list of predefine indices, see | ||
| 275 | http://www.gnu.org/software/texinfo/manual/texinfo/html_node/Predefined-Indices.html | ||
| 276 | or run the shell command 'info "(texinfo)Predefined Indices"'. | ||
| 277 | |||
| 278 | For more specific tips on Emacs's doc style, see | ||
| 279 | http://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html | ||
| 280 | Use 'checkdoc' to check for documentation errors before submitting a patch. | ||
| 281 | |||
| 282 | ** Testing your changes | ||
| 283 | |||
| 284 | Please test your changes before committing them or sending them to the | ||
| 285 | list. If possible, add a new test along with any bug fix or new | ||
| 286 | functionality you commit (of course, some changes cannot be easily | ||
| 287 | tested). | ||
| 288 | |||
| 289 | Emacs uses ERT, Emacs Lisp Regression Testing, for testing. See | ||
| 290 | http://www.gnu.org/software/emacs/manual/html_node/ert/ | ||
| 291 | or run 'info "(ert)"' for for more information on writing and running | ||
| 292 | tests. | ||
| 293 | |||
| 294 | If your test lasts longer than some few seconds, mark it in its | ||
| 295 | 'ert-deftest' definition with ":tags '(:expensive-test)". | ||
| 296 | |||
| 297 | To run tests on the entire Emacs tree, run "make check" from the | ||
| 298 | top-level directory. Most tests are in the directory "test/". From | ||
| 299 | the "test/" directory, run "make <filename>" to run the tests for | ||
| 300 | <filename>.el(c). See "test/README" for more information. | ||
| 301 | |||
| 302 | ** Understanding Emacs internals | 302 | ** Understanding Emacs internals |
| 303 | 303 | ||
| 304 | The best way to understand Emacs internals is to read the code. Some | 304 | The best way to understand Emacs internals is to read the code. Some |
diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 2b1a16a10ec..18c9ee8def7 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib | |||
| @@ -35,10 +35,10 @@ GNULIB_MODULES=' | |||
| 35 | filemode filevercmp flexmember fstatat fsync | 35 | filemode filevercmp flexmember fstatat fsync |
| 36 | getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog | 36 | getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog |
| 37 | ignore-value intprops largefile lstat | 37 | ignore-value intprops largefile lstat |
| 38 | manywarnings memrchr minmax mkostemp mktime | 38 | manywarnings memrchr minmax mkostemp mktime nstrftime |
| 39 | pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat | 39 | pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat |
| 40 | sig2str socklen stat-time std-gnu11 stdalign stddef stdio | 40 | sig2str socklen stat-time std-gnu11 stdalign stddef stdio |
| 41 | stpcpy strftime strtoimax symlink sys_stat | 41 | stpcpy strtoimax symlink sys_stat |
| 42 | sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub | 42 | sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub |
| 43 | update-copyright unlocked-io utimens | 43 | update-copyright unlocked-io utimens |
| 44 | vla warnings | 44 | vla warnings |
diff --git a/build-aux/config.guess b/build-aux/config.guess index 2193702b12a..07785f54515 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Attempt to guess a canonical system name. | 2 | # Attempt to guess a canonical system name. |
| 3 | # Copyright 1992-2017 Free Software Foundation, Inc. | 3 | # Copyright 1992-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | timestamp='2017-05-27' | 5 | timestamp='2017-07-19' |
| 6 | 6 | ||
| 7 | # This file is free software; you can redistribute it and/or modify it | 7 | # This file is free software; you can redistribute it and/or modify it |
| 8 | # under the terms of the GNU General Public License as published by | 8 | # under the terms of the GNU General Public License as published by |
| @@ -1429,8 +1429,8 @@ cat >&2 <<EOF | |||
| 1429 | $0: unable to guess system type | 1429 | $0: unable to guess system type |
| 1430 | 1430 | ||
| 1431 | This script (version $timestamp), has failed to recognize the | 1431 | This script (version $timestamp), has failed to recognize the |
| 1432 | operating system you are using. If your script is old, overwrite | 1432 | operating system you are using. If your script is old, overwrite *all* |
| 1433 | config.guess and config.sub with the latest versions from: | 1433 | copies of config.guess and config.sub with the latest versions from: |
| 1434 | 1434 | ||
| 1435 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | 1435 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess |
| 1436 | and | 1436 | and |
diff --git a/configure.ac b/configure.ac index 7aaf772a1be..144d6881fe6 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -175,6 +175,7 @@ esac | |||
| 175 | 175 | ||
| 176 | canonical=$host | 176 | canonical=$host |
| 177 | configuration=${host_alias-${build_alias-$host}} | 177 | configuration=${host_alias-${build_alias-$host}} |
| 178 | emacs_uname_r=`uname -r` | ||
| 178 | 179 | ||
| 179 | dnl Support for --program-prefix, --program-suffix and | 180 | dnl Support for --program-prefix, --program-suffix and |
| 180 | dnl --program-transform-name options | 181 | dnl --program-transform-name options |
| @@ -352,7 +353,8 @@ OPTION_DEFAULT_OFF([w32], [use native MS Windows GUI in a Cygwin build]) | |||
| 352 | 353 | ||
| 353 | OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console]) | 354 | OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console]) |
| 354 | OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support]) | 355 | OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support]) |
| 355 | OPTION_DEFAULT_ON([gconf],[don't compile with GConf support]) | 356 | AC_ARG_WITH([gconf],[AS_HELP_STRING([--with-gconf], |
| 357 | [compile with Gconf support (Gsettings replaces this)])],[],[with_gconf=maybe]) | ||
| 356 | OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support]) | 358 | OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support]) |
| 357 | OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support]) | 359 | OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support]) |
| 358 | OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support]) | 360 | OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support]) |
| @@ -1221,8 +1223,8 @@ if test $opsys = gnu-linux; then | |||
| 1221 | AC_SUBST([SETFATTR]) | 1223 | AC_SUBST([SETFATTR]) |
| 1222 | fi | 1224 | fi |
| 1223 | fi | 1225 | fi |
| 1224 | case $opsys,$PAXCTL_notdumped in | 1226 | case $opsys,$PAXCTL_notdumped,$emacs_uname_r in |
| 1225 | gnu-linux, | netbsd,) | 1227 | gnu-linux,,* | netbsd,,[0-7].*) |
| 1226 | AC_PATH_PROG([PAXCTL], [paxctl], [], | 1228 | AC_PATH_PROG([PAXCTL], [paxctl], [], |
| 1227 | [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin]) | 1229 | [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin]) |
| 1228 | if test -n "$PAXCTL"; then | 1230 | if test -n "$PAXCTL"; then |
| @@ -2503,7 +2505,8 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}" | |||
| 2503 | if test "${with_imagemagick}" != "no"; then | 2505 | if test "${with_imagemagick}" != "no"; then |
| 2504 | ## 6.3.5 is the earliest version known to work; see Bug#17339. | 2506 | ## 6.3.5 is the earliest version known to work; see Bug#17339. |
| 2505 | ## 6.8.2 makes Emacs crash; see Bug#13867. | 2507 | ## 6.8.2 makes Emacs crash; see Bug#13867. |
| 2506 | IMAGEMAGICK_MODULE="Wand >= 6.3.5 Wand != 6.8.2" | 2508 | ## 7 and later have not been ported to; See Bug#25967. |
| 2509 | IMAGEMAGICK_MODULE="Wand >= 6.3.5 Wand != 6.8.2 Wand < 7" | ||
| 2507 | EMACS_CHECK_MODULES([IMAGEMAGICK], [$IMAGEMAGICK_MODULE]) | 2510 | EMACS_CHECK_MODULES([IMAGEMAGICK], [$IMAGEMAGICK_MODULE]) |
| 2508 | 2511 | ||
| 2509 | if test $HAVE_IMAGEMAGICK = yes; then | 2512 | if test $HAVE_IMAGEMAGICK = yes; then |
| @@ -2772,6 +2775,7 @@ if test "${HAVE_X11}" = "yes" && test "${with_gsettings}" = "yes"; then | |||
| 2772 | AC_DEFINE(HAVE_GSETTINGS, 1, [Define to 1 if using GSettings.]) | 2775 | AC_DEFINE(HAVE_GSETTINGS, 1, [Define to 1 if using GSettings.]) |
| 2773 | SETTINGS_CFLAGS="$GSETTINGS_CFLAGS" | 2776 | SETTINGS_CFLAGS="$GSETTINGS_CFLAGS" |
| 2774 | SETTINGS_LIBS="$GSETTINGS_LIBS" | 2777 | SETTINGS_LIBS="$GSETTINGS_LIBS" |
| 2778 | test "$with_gconf" = "yes" || with_gconf=no | ||
| 2775 | fi | 2779 | fi |
| 2776 | CFLAGS=$old_CFLAGS | 2780 | CFLAGS=$old_CFLAGS |
| 2777 | LIBS=$old_LIBS | 2781 | LIBS=$old_LIBS |
| @@ -2781,7 +2785,7 @@ fi | |||
| 2781 | dnl GConf has been tested under GNU/Linux only. | 2785 | dnl GConf has been tested under GNU/Linux only. |
| 2782 | dnl The version is really arbitrary, it is about the same age as Gtk+ 2.6. | 2786 | dnl The version is really arbitrary, it is about the same age as Gtk+ 2.6. |
| 2783 | HAVE_GCONF=no | 2787 | HAVE_GCONF=no |
| 2784 | if test "${HAVE_X11}" = "yes" && test "${with_gconf}" = "yes"; then | 2788 | if test "${HAVE_X11}" = "yes" && test "${with_gconf}" != "no"; then |
| 2785 | EMACS_CHECK_MODULES([GCONF], [gconf-2.0 >= 2.13]) | 2789 | EMACS_CHECK_MODULES([GCONF], [gconf-2.0 >= 2.13]) |
| 2786 | if test "$HAVE_GCONF" = yes; then | 2790 | if test "$HAVE_GCONF" = yes; then |
| 2787 | AC_DEFINE(HAVE_GCONF, 1, [Define to 1 if using GConf.]) | 2791 | AC_DEFINE(HAVE_GCONF, 1, [Define to 1 if using GConf.]) |
| @@ -3554,27 +3558,22 @@ AC_SUBST(LIBZ) | |||
| 3554 | LIBMODULES= | 3558 | LIBMODULES= |
| 3555 | HAVE_MODULES=no | 3559 | HAVE_MODULES=no |
| 3556 | MODULES_OBJ= | 3560 | MODULES_OBJ= |
| 3557 | MODULES_SUFFIX= | 3561 | case $opsys in |
| 3562 | cygwin|mingw32) MODULES_SUFFIX=".dll" ;; | ||
| 3563 | *) MODULES_SUFFIX=".so" ;; | ||
| 3564 | esac | ||
| 3558 | if test "${with_modules}" != "no"; then | 3565 | if test "${with_modules}" != "no"; then |
| 3559 | case $opsys in | 3566 | case $opsys in |
| 3560 | gnu|gnu-linux) | 3567 | gnu|gnu-linux) |
| 3561 | LIBMODULES="-ldl" | 3568 | LIBMODULES="-ldl" |
| 3562 | MODULES_SUFFIX=".so" | ||
| 3563 | HAVE_MODULES=yes | ||
| 3564 | ;; | ||
| 3565 | cygwin|mingw32) | ||
| 3566 | MODULES_SUFFIX=".dll" | ||
| 3567 | HAVE_MODULES=yes | 3569 | HAVE_MODULES=yes |
| 3568 | ;; | 3570 | ;; |
| 3569 | darwin) | 3571 | cygwin|mingw32|darwin) |
| 3570 | MODULES_SUFFIX=".so" | ||
| 3571 | HAVE_MODULES=yes | 3572 | HAVE_MODULES=yes |
| 3572 | ;; | 3573 | ;; |
| 3573 | *) | 3574 | *) |
| 3574 | # BSD systems have dlopen in libc. | 3575 | # BSD systems have dlopen in libc. |
| 3575 | AC_CHECK_FUNC([dlopen], | 3576 | AC_CHECK_FUNC([dlopen], [HAVE_MODULES=yes]) |
| 3576 | [MODULES_SUFFIX=".so" | ||
| 3577 | HAVE_MODULES=yes]) | ||
| 3578 | ;; | 3577 | ;; |
| 3579 | esac | 3578 | esac |
| 3580 | 3579 | ||
| @@ -5461,7 +5460,7 @@ AS_ECHO([" Does Emacs use -lXaw3d? ${HAVE_XAW3D | |||
| 5461 | Does Emacs use a png library? ${HAVE_PNG} $LIBPNG | 5460 | Does Emacs use a png library? ${HAVE_PNG} $LIBPNG |
| 5462 | Does Emacs use -lrsvg-2? ${HAVE_RSVG} | 5461 | Does Emacs use -lrsvg-2? ${HAVE_RSVG} |
| 5463 | Does Emacs use cairo? ${HAVE_CAIRO} | 5462 | Does Emacs use cairo? ${HAVE_CAIRO} |
| 5464 | Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK} | 5463 | Does Emacs use imagemagick (version 6)? ${HAVE_IMAGEMAGICK} |
| 5465 | Does Emacs support sound? ${HAVE_SOUND} | 5464 | Does Emacs support sound? ${HAVE_SOUND} |
| 5466 | Does Emacs use -lgpm? ${HAVE_GPM} | 5465 | Does Emacs use -lgpm? ${HAVE_GPM} |
| 5467 | Does Emacs use -ldbus? ${HAVE_DBUS} | 5466 | Does Emacs use -ldbus? ${HAVE_DBUS} |
| @@ -5508,13 +5507,12 @@ to run if these resources are not installed."]) | |||
| 5508 | echo | 5507 | echo |
| 5509 | fi | 5508 | fi |
| 5510 | 5509 | ||
| 5511 | if test "${opsys}" = "cygwin"; then | 5510 | case $opsys,$emacs_uname_r in |
| 5512 | case `uname -r` in | 5511 | cygwin,1.5.*) |
| 5513 | 1.5.*) AC_MSG_WARN([[building Emacs on Cygwin 1.5 is not supported.]]) | 5512 | AC_MSG_WARN([[building Emacs on Cygwin 1.5 is not supported.]]) |
| 5514 | echo | 5513 | echo |
| 5515 | ;; | 5514 | ;; |
| 5516 | esac | 5515 | esac |
| 5517 | fi | ||
| 5518 | 5516 | ||
| 5519 | # Remove any trailing slashes in these variables. | 5517 | # Remove any trailing slashes in these variables. |
| 5520 | case $prefix in | 5518 | case $prefix in |
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index a756a89e3f8..1c9c14a962a 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi | |||
| @@ -1701,6 +1701,7 @@ and mouse events: | |||
| 1701 | (global-set-key (kbd "C-c y") 'clipboard-yank) | 1701 | (global-set-key (kbd "C-c y") 'clipboard-yank) |
| 1702 | (global-set-key (kbd "C-M-q") 'query-replace) | 1702 | (global-set-key (kbd "C-M-q") 'query-replace) |
| 1703 | (global-set-key (kbd "<f5>") 'flyspell-mode) | 1703 | (global-set-key (kbd "<f5>") 'flyspell-mode) |
| 1704 | (global-set-key (kbd "C-<f5>") 'display-line-numbers-mode) | ||
| 1704 | (global-set-key (kbd "C-<right>") 'forward-sentence) | 1705 | (global-set-key (kbd "C-<right>") 'forward-sentence) |
| 1705 | (global-set-key (kbd "<mouse-2>") 'mouse-save-then-kill) | 1706 | (global-set-key (kbd "<mouse-2>") 'mouse-save-then-kill) |
| 1706 | @end example | 1707 | @end example |
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index ddd7229b0c8..150ac8427ab 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi | |||
| @@ -64,10 +64,22 @@ you to operate on the listed files. @xref{Directories}. | |||
| 64 | directory name using the minibuffer, and opens a @dfn{Dired buffer} | 64 | directory name using the minibuffer, and opens a @dfn{Dired buffer} |
| 65 | listing the files in that directory. You can also supply a wildcard | 65 | listing the files in that directory. You can also supply a wildcard |
| 66 | file name pattern as the minibuffer argument, in which case the Dired | 66 | file name pattern as the minibuffer argument, in which case the Dired |
| 67 | buffer lists all files matching that pattern. The usual history and | 67 | buffer lists all files matching that pattern. A wildcard may appear |
| 68 | completion commands can be used in the minibuffer; in particular, | 68 | in the directory part as well. |
| 69 | @kbd{M-n} puts the name of the visited file (if any) in the minibuffer | 69 | For instance, |
| 70 | (@pxref{Minibuffer History}). | 70 | |
| 71 | @example | ||
| 72 | C-x d ~/foo/*.el @key{RET} | ||
| 73 | C-x d ~/foo/*/*.el @key{RET} | ||
| 74 | @end example | ||
| 75 | |||
| 76 | The former lists all the files with extension @samp{.el} in directory | ||
| 77 | @samp{foo}. The latter lists the files with extension @samp{.el} | ||
| 78 | in subdirectories 2 levels of depth below @samp{foo}. | ||
| 79 | |||
| 80 | The usual history and completion commands can be used in the minibuffer; | ||
| 81 | in particular, @kbd{M-n} puts the name of the visited file (if any) in | ||
| 82 | the minibuffer (@pxref{Minibuffer History}). | ||
| 71 | 83 | ||
| 72 | You can also invoke Dired by giving @kbd{C-x C-f} (@code{find-file}) | 84 | You can also invoke Dired by giving @kbd{C-x C-f} (@code{find-file}) |
| 73 | a directory name. | 85 | a directory name. |
diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index 2ba3e26c484..f833f572dfc 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi | |||
| @@ -254,6 +254,7 @@ Restart the Aspell/Ispell/Hunspell process, using @var{dict} as the dictionary. | |||
| 254 | Kill the Aspell/Ispell/Hunspell subprocess. | 254 | Kill the Aspell/Ispell/Hunspell subprocess. |
| 255 | @item M-@key{TAB} | 255 | @item M-@key{TAB} |
| 256 | @itemx @key{ESC} @key{TAB} | 256 | @itemx @key{ESC} @key{TAB} |
| 257 | @itemx C-M-i | ||
| 257 | Complete the word before point based on the spelling dictionary | 258 | Complete the word before point based on the spelling dictionary |
| 258 | (@code{ispell-complete-word}). | 259 | (@code{ispell-complete-word}). |
| 259 | @item M-x flyspell-mode | 260 | @item M-x flyspell-mode |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index e3e59ad43ac..ee33a6848c5 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -575,7 +575,8 @@ font names in X resource files. | |||
| 575 | If you are running Emacs on the GNOME desktop, you can tell Emacs to | 575 | If you are running Emacs on the GNOME desktop, you can tell Emacs to |
| 576 | use the default system font by setting the variable | 576 | use the default system font by setting the variable |
| 577 | @code{font-use-system-font} to @code{t} (the default is @code{nil}). | 577 | @code{font-use-system-font} to @code{t} (the default is @code{nil}). |
| 578 | For this to work, Emacs must have been compiled with Gconf support. | 578 | For this to work, Emacs must have been compiled with support for |
| 579 | Gsettings (or the older Gconf). | ||
| 579 | 580 | ||
| 580 | @item | 581 | @item |
| 581 | Use the command line option @samp{-fn} (or @samp{--font}). @xref{Font | 582 | Use the command line option @samp{-fn} (or @samp{--font}). @xref{Font |
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index fd6df1c7e53..460ced0d21c 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi | |||
| @@ -320,12 +320,21 @@ search for non-customizable variables too. | |||
| 320 | Search for variables. With a prefix argument, search for | 320 | Search for variables. With a prefix argument, search for |
| 321 | customizable variables only. | 321 | customizable variables only. |
| 322 | 322 | ||
| 323 | @item M-x apropos-local-variable | ||
| 324 | @findex apropos-local-variable | ||
| 325 | Search for buffer-local variables. | ||
| 326 | |||
| 323 | @item M-x apropos-value | 327 | @item M-x apropos-value |
| 324 | @findex apropos-value | 328 | @findex apropos-value |
| 325 | Search for variables whose values match the specified pattern. With a | 329 | Search for variables whose values match the specified pattern. With a |
| 326 | prefix argument, search also for functions with definitions matching | 330 | prefix argument, search also for functions with definitions matching |
| 327 | the pattern, and Lisp symbols with properties matching the pattern. | 331 | the pattern, and Lisp symbols with properties matching the pattern. |
| 328 | 332 | ||
| 333 | @item M-x apropos-local-value | ||
| 334 | @findex apropos-local-value | ||
| 335 | Search for buffer-local variables whose values match the specified | ||
| 336 | pattern. | ||
| 337 | |||
| 329 | @item C-h d | 338 | @item C-h d |
| 330 | @kindex C-h d | 339 | @kindex C-h d |
| 331 | @findex apropos-documentation | 340 | @findex apropos-documentation |
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index eb0c88b2901..876431aa9e9 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi | |||
| @@ -225,6 +225,13 @@ Font-Lock mode automatically highlights certain textual units found in | |||
| 225 | programs. It is enabled globally by default, but you can disable it | 225 | programs. It is enabled globally by default, but you can disable it |
| 226 | in individual buffers. @xref{Faces}. | 226 | in individual buffers. @xref{Faces}. |
| 227 | 227 | ||
| 228 | @findex display-line-numbers-mode | ||
| 229 | @cindex display-line-numbers-mode | ||
| 230 | @item | ||
| 231 | Display Line Numbers mode is a convenience wrapper around | ||
| 232 | @code{display-line-numbers}, setting it using the value of | ||
| 233 | @code{display-line-numbers-type}. @xref{Display Custom}. | ||
| 234 | |||
| 228 | @item | 235 | @item |
| 229 | Outline minor mode provides similar facilities to the major mode | 236 | Outline minor mode provides similar facilities to the major mode |
| 230 | called Outline mode. @xref{Outline Mode}. | 237 | called Outline mode. @xref{Outline Mode}. |
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi index 7369f6b05b6..40e3e2c1c31 100644 --- a/doc/emacs/regs.texi +++ b/doc/emacs/regs.texi | |||
| @@ -15,7 +15,10 @@ jump back to that position once, or many times. | |||
| 15 | Each register has a name that consists of a single character, which | 15 | Each register has a name that consists of a single character, which |
| 16 | we will denote by @var{r}; @var{r} can be a letter (such as @samp{a}) | 16 | we will denote by @var{r}; @var{r} can be a letter (such as @samp{a}) |
| 17 | or a number (such as @samp{1}); case matters, so register @samp{a} is | 17 | or a number (such as @samp{1}); case matters, so register @samp{a} is |
| 18 | not the same as register @samp{A}. | 18 | not the same as register @samp{A}. You can also set a register in |
| 19 | non-alphanumeric characters, for instance @samp{*} or @samp{C-d}. | ||
| 20 | Note, it's not possible to set a register in @samp{C-g} or @samp{ESC}, | ||
| 21 | because these keys are reserved to terminate interactive commands. | ||
| 19 | 22 | ||
| 20 | @findex view-register | 23 | @findex view-register |
| 21 | A register can store a position, a piece of text, a rectangle, a | 24 | A register can store a position, a piece of text, a rectangle, a |
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index c9e83da173f..9f7e9a12cd7 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -1747,6 +1747,10 @@ at the first match after such line. | |||
| 1747 | You can also run @kbd{M-s o} when an incremental search is active; | 1747 | You can also run @kbd{M-s o} when an incremental search is active; |
| 1748 | this uses the current search string. | 1748 | this uses the current search string. |
| 1749 | 1749 | ||
| 1750 | Note that matches for the regexp you type are extended to include | ||
| 1751 | complete lines, and a match that starts before the previous match ends | ||
| 1752 | is not considered a match. | ||
| 1753 | |||
| 1750 | @kindex RET @r{(Occur mode)} | 1754 | @kindex RET @r{(Occur mode)} |
| 1751 | @kindex o @r{(Occur mode)} | 1755 | @kindex o @r{(Occur mode)} |
| 1752 | @kindex C-o @r{(Occur mode)} | 1756 | @kindex C-o @r{(Occur mode)} |
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi index 7e27ddd1d9a..eaefcee21c3 100644 --- a/doc/emacs/xresources.texi +++ b/doc/emacs/xresources.texi | |||
| @@ -250,6 +250,11 @@ specified if @samp{off}. | |||
| 250 | Gamma correction for colors, equivalent to the frame parameter | 250 | Gamma correction for colors, equivalent to the frame parameter |
| 251 | @code{screen-gamma}. | 251 | @code{screen-gamma}. |
| 252 | 252 | ||
| 253 | @item @code{scrollBar} (class @code{ScrollBar}) | ||
| 254 | @cindex tool bar | ||
| 255 | If the value of this resource is @samp{off} or @samp{false} or | ||
| 256 | @samp{0}, Emacs disables Scroll Bar mode at startup (@pxref{Scroll Bars}). | ||
| 257 | |||
| 253 | @item @code{scrollBarWidth} (class @code{ScrollBarWidth}) | 258 | @item @code{scrollBarWidth} (class @code{ScrollBarWidth}) |
| 254 | @cindex scrollbar width | 259 | @cindex scrollbar width |
| 255 | The scroll bar width in pixels, equivalent to the frame parameter | 260 | The scroll bar width in pixels, equivalent to the frame parameter |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index f5c73e55a4f..2ed848adf37 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -2423,7 +2423,9 @@ the values of the @code{:family}, @code{:foundry}, @code{:width}, | |||
| 2423 | The name of a face from which to inherit attributes, or a list of face | 2423 | The name of a face from which to inherit attributes, or a list of face |
| 2424 | names. Attributes from inherited faces are merged into the face like | 2424 | names. Attributes from inherited faces are merged into the face like |
| 2425 | an underlying face would be, with higher priority than underlying | 2425 | an underlying face would be, with higher priority than underlying |
| 2426 | faces (@pxref{Displaying Faces}). If a list of faces is used, | 2426 | faces (@pxref{Displaying Faces}). If the face to inherit from is |
| 2427 | @code{unspecified}, it is treated the same as @code{nil}, since Emacs | ||
| 2428 | never merges @code{:inherit} attributes. If a list of faces is used, | ||
| 2427 | attributes from faces earlier in the list override those from later | 2429 | attributes from faces earlier in the list override those from later |
| 2428 | faces. | 2430 | faces. |
| 2429 | @end table | 2431 | @end table |
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index d925c8c8f65..80dcb488983 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -468,6 +468,10 @@ runs the real definition as if it had been loaded all along. | |||
| 468 | Autoloading can also be triggered by looking up the documentation of | 468 | Autoloading can also be triggered by looking up the documentation of |
| 469 | the function or macro (@pxref{Documentation Basics}). | 469 | the function or macro (@pxref{Documentation Basics}). |
| 470 | 470 | ||
| 471 | @menu | ||
| 472 | * When to Autoload:: When to Use Autoload. | ||
| 473 | @end menu | ||
| 474 | |||
| 471 | There are two ways to set up an autoloaded function: by calling | 475 | There are two ways to set up an autoloaded function: by calling |
| 472 | @code{autoload}, and by writing a ``magic'' comment in the | 476 | @code{autoload}, and by writing a ``magic'' comment in the |
| 473 | source before the real definition. @code{autoload} is the low-level | 477 | source before the real definition. @code{autoload} is the low-level |
| @@ -699,6 +703,42 @@ symbol's new function value. If the value of the optional argument | |||
| 699 | function, only a macro. | 703 | function, only a macro. |
| 700 | @end defun | 704 | @end defun |
| 701 | 705 | ||
| 706 | @node When to Autoload | ||
| 707 | @subsection When to Use Autoload | ||
| 708 | @cindex autoload, when to use | ||
| 709 | |||
| 710 | Do not add an autoload comment unless it is really necessary. | ||
| 711 | Autoloading code means it is always globally visible. Once an item is | ||
| 712 | autoloaded, there is no compatible way to transition back to it not | ||
| 713 | being autoloaded (after people become accustomed to being able to use it | ||
| 714 | without an explicit load). | ||
| 715 | |||
| 716 | @itemize | ||
| 717 | @item | ||
| 718 | The most common items to autoload are the interactive entry points to a | ||
| 719 | library. For example, if @file{python.el} is a library defining a | ||
| 720 | major-mode for editing Python code, autoload the definition of the | ||
| 721 | @code{python-mode} function, so that people can simply use @kbd{M-x | ||
| 722 | python-mode} to load the library. | ||
| 723 | |||
| 724 | @item | ||
| 725 | Variables usually don't need to be autoloaded. An exception is if the | ||
| 726 | variable on its own is generally useful without the whole defining | ||
| 727 | library being loaded. (An example of this might be something like | ||
| 728 | @code{find-exec-terminator}.) | ||
| 729 | |||
| 730 | @item | ||
| 731 | Don't autoload a user option just so that a user can set it. | ||
| 732 | |||
| 733 | @item | ||
| 734 | Never add an autoload @emph{comment} to silence a compiler warning in | ||
| 735 | another file. In the file that produces the warning, use | ||
| 736 | @code{(defvar foo)} to silence an undefined variable warning, and | ||
| 737 | @code{declare-function} (@pxref{Declaring Functions}) to silence an | ||
| 738 | undefined function warning; or require the relevant library; or use an | ||
| 739 | explicit autoload @emph{statement}. | ||
| 740 | @end itemize | ||
| 741 | |||
| 702 | @node Repeated Loading | 742 | @node Repeated Loading |
| 703 | @section Repeated Loading | 743 | @section Repeated Loading |
| 704 | @cindex repeated loading | 744 | @cindex repeated loading |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 7108520e79f..b825b1d790b 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -4236,6 +4236,7 @@ A marker represents a buffer position to jump to. | |||
| 4236 | A string is text saved in the register. | 4236 | A string is text saved in the register. |
| 4237 | 4237 | ||
| 4238 | @item a rectangle | 4238 | @item a rectangle |
| 4239 | @cindex rectangle, as contents of a register | ||
| 4239 | A rectangle is represented by a list of strings. | 4240 | A rectangle is represented by a list of strings. |
| 4240 | 4241 | ||
| 4241 | @item @code{(@var{window-configuration} @var{position})} | 4242 | @item @code{(@var{window-configuration} @var{position})} |
| @@ -97,6 +97,10 @@ Terminal is automatically initialized to use 24-bit colors if the | |||
| 97 | required capabilities are found in terminfo. See the FAQ node | 97 | required capabilities are found in terminfo. See the FAQ node |
| 98 | "Colors on a TTY" for more information. | 98 | "Colors on a TTY" for more information. |
| 99 | 99 | ||
| 100 | +++ | ||
| 101 | ** Emacs now obeys the X resource "scrollBar" at startup. | ||
| 102 | The effect is similar to that of "toolBar" resource on the tool bar. | ||
| 103 | |||
| 100 | 104 | ||
| 101 | * Changes in Emacs 26.1 | 105 | * Changes in Emacs 26.1 |
| 102 | 106 | ||
| @@ -434,13 +438,18 @@ range of indentation. | |||
| 434 | This is similar to what linum-mode provides, but much faster and | 438 | This is similar to what linum-mode provides, but much faster and |
| 435 | doesn't usurp the display margin for the line numbers. Customize the | 439 | doesn't usurp the display margin for the line numbers. Customize the |
| 436 | buffer-local variable 'display-line-numbers' to activate this optional | 440 | buffer-local variable 'display-line-numbers' to activate this optional |
| 437 | display. If set to t, Emacs will display the number of each line | 441 | display. Alternatively, you can use the `display-line-numbers-mode' |
| 438 | before the line. If set to 'relative', Emacs will display the line | 442 | minor mode or the global `global-display-line-numbers-mode'. When |
| 439 | number relative to the line showing point, with that line's number | 443 | using these modes, customize `display-line-numbers-type' with the same |
| 440 | displayed as absolute. If set to 'visual', Emacs will display a | 444 | value as you would use with `display-line-numbers'. |
| 441 | relative number for every screen line, i.e. it will count screen lines | 445 | |
| 442 | rather than buffer lines. The default is nil, which doesn't display | 446 | If `display-line-numbers' is set to t, Emacs will display the number |
| 443 | the line numbers. | 447 | of each line before the line. If set to 'relative', Emacs will |
| 448 | display the line number relative to the line showing point, with that | ||
| 449 | line's number displayed as absolute. If set to 'visual', Emacs will | ||
| 450 | display a relative number for every screen line, i.e. it will count | ||
| 451 | screen lines rather than buffer lines. The default is nil, which | ||
| 452 | doesn't display the line numbers. | ||
| 444 | 453 | ||
| 445 | In 'relative' and 'visual' modes, the variable | 454 | In 'relative' and 'visual' modes, the variable |
| 446 | 'display-line-numbers-current-absolute' controls what number is | 455 | 'display-line-numbers-current-absolute' controls what number is |
| @@ -458,14 +467,23 @@ new face 'line-number-current-line' can be customized to display the | |||
| 458 | current line's number differently from all the other line numbers; by | 467 | current line's number differently from all the other line numbers; by |
| 459 | default these two faces are identical. | 468 | default these two faces are identical. |
| 460 | 469 | ||
| 461 | You can also customize the new variable 'display-line-numbers-width' to | 470 | You can also customize the new buffer-local variable |
| 462 | specify a fixed minimal with of the area allocated to line-number | 471 | 'display-line-numbers-width' to specify a fixed minimal with of the |
| 463 | display. The default is nil, meaning that Emacs will dynamically | 472 | area allocated to line-number display. The default is nil, meaning |
| 464 | calculate the area width, enlarging or shrinking it as needed. | 473 | that Emacs will dynamically calculate the area width, enlarging or |
| 465 | Setting it to a non-negative integer specifies that as the minimal | 474 | shrinking it as needed. Setting it to a non-negative integer |
| 466 | width; selecting a value that is large enough to display all line | 475 | specifies that as the minimal width; selecting a value that is large |
| 467 | numbers in a buffer will then keep the line-number display area of | 476 | enough to display all line numbers in a buffer will then keep the |
| 468 | constant width at all times, if that is desired. | 477 | line-number display area of constant width at all times, if that is |
| 478 | desired. | ||
| 479 | |||
| 480 | When using `display-line-numbers-mode', you can customize the variable | ||
| 481 | `display-line-numbers-grow-only' to a non-nil value; this means that | ||
| 482 | Emacs may grow the above area width dynamically, but never shrink it. | ||
| 483 | Under this mode, customizing the variable | ||
| 484 | `display-line-numbers-width-start' to a non-nil value will cause Emacs | ||
| 485 | to set `display-line-numbers-width' to the minimum width necessary to | ||
| 486 | display all line numbers in the current buffer when first visiting it. | ||
| 469 | 487 | ||
| 470 | Lisp programs can disable line-number display for a particular screen | 488 | Lisp programs can disable line-number display for a particular screen |
| 471 | line by putting the 'display-line-numbers-disable' text property or | 489 | line by putting the 'display-line-numbers-disable' text property or |
| @@ -572,6 +590,12 @@ different buffer while keeping point, mark, markers, and text | |||
| 572 | properties as intact as possible. | 590 | properties as intact as possible. |
| 573 | 591 | ||
| 574 | +++ | 592 | +++ |
| 593 | ** New commands 'apropos-local-variable' and 'apropos-local-value. | ||
| 594 | These are buffer-local versions of 'apropos-variable' and | ||
| 595 | 'apropos-value', respectively. They show buffer-local variables whose | ||
| 596 | names and values, respectively, match a given pattern. | ||
| 597 | |||
| 598 | +++ | ||
| 575 | ** More user control of reordering bidirectional text for display. | 599 | ** More user control of reordering bidirectional text for display. |
| 576 | The two new variables, 'bidi-paragraph-start-re' and | 600 | The two new variables, 'bidi-paragraph-start-re' and |
| 577 | 'bidi-paragraph-separate-re', allow customization of what exactly are | 601 | 'bidi-paragraph-separate-re', allow customization of what exactly are |
| @@ -580,9 +604,14 @@ paragraphs, for the purposes of bidirectional display. | |||
| 580 | 604 | ||
| 581 | * Changes in Specialized Modes and Packages in Emacs 26.1 | 605 | * Changes in Specialized Modes and Packages in Emacs 26.1 |
| 582 | 606 | ||
| 607 | ** New function `cl-generic-p'. | ||
| 608 | |||
| 583 | ** Dired | 609 | ** Dired |
| 584 | 610 | ||
| 585 | +++ | 611 | +++ |
| 612 | *** Dired supports wildcards in the directory part of the file names. | ||
| 613 | |||
| 614 | +++ | ||
| 586 | *** You can now use '`?`' in 'dired-do-shell-command'; as ' ? ', it gets replaced | 615 | *** You can now use '`?`' in 'dired-do-shell-command'; as ' ? ', it gets replaced |
| 587 | by the current file name. | 616 | by the current file name. |
| 588 | 617 | ||
| @@ -1058,6 +1087,9 @@ fontification, and commenting for embedded JavaScript and CSS. | |||
| 1058 | 1087 | ||
| 1059 | * Incompatible Lisp Changes in Emacs 26.1 | 1088 | * Incompatible Lisp Changes in Emacs 26.1 |
| 1060 | 1089 | ||
| 1090 | *** password-data is now a hash-table | ||
| 1091 | so that `password-read' can use any object for the `key' argument. | ||
| 1092 | |||
| 1061 | +++ | 1093 | +++ |
| 1062 | *** Command 'dired-mark-extension' now automatically prepends a '.' to the | 1094 | *** Command 'dired-mark-extension' now automatically prepends a '.' to the |
| 1063 | extension when not present. The new command 'dired-mark-suffix' behaves | 1095 | extension when not present. The new command 'dired-mark-suffix' behaves |
| @@ -1136,6 +1168,10 @@ instead of its first. | |||
| 1136 | renamed to 'lread--old-style-backquotes'. No user code should use | 1168 | renamed to 'lread--old-style-backquotes'. No user code should use |
| 1137 | this variable. | 1169 | this variable. |
| 1138 | 1170 | ||
| 1171 | ** To avoid confusion caused by "smart quotes", the reader no longer | ||
| 1172 | accepts Lisp symbols which begin with the following quotation | ||
| 1173 | characters: ‘’‛“”‟〞"', unless they are escaped with backslash. | ||
| 1174 | |||
| 1139 | +++ | 1175 | +++ |
| 1140 | ** Module functions are now implemented slightly differently; in | 1176 | ** Module functions are now implemented slightly differently; in |
| 1141 | particular, the function 'internal--module-call' has been removed. | 1177 | particular, the function 'internal--module-call' has been removed. |
| @@ -1145,6 +1181,8 @@ break. | |||
| 1145 | 1181 | ||
| 1146 | * Lisp Changes in Emacs 26.1 | 1182 | * Lisp Changes in Emacs 26.1 |
| 1147 | 1183 | ||
| 1184 | ** New function `define-symbol-prop'. | ||
| 1185 | |||
| 1148 | +++ | 1186 | +++ |
| 1149 | ** New optional argument TESTFN in 'alist-get', 'map-elt' and 'map-put'. | 1187 | ** New optional argument TESTFN in 'alist-get', 'map-elt' and 'map-put'. |
| 1150 | 1188 | ||
| @@ -1533,6 +1571,9 @@ manual. | |||
| 1533 | ** 'tcl-auto-fill-mode' is now declared obsolete. Its functionality | 1571 | ** 'tcl-auto-fill-mode' is now declared obsolete. Its functionality |
| 1534 | can be replicated simply by setting 'comment-auto-fill-only-comments'. | 1572 | can be replicated simply by setting 'comment-auto-fill-only-comments'. |
| 1535 | 1573 | ||
| 1574 | ** New pcase pattern 'rx' to match against a rx-style regular | ||
| 1575 | expression. | ||
| 1576 | |||
| 1536 | 1577 | ||
| 1537 | * Changes in Emacs 26.1 on Non-Free Operating Systems | 1578 | * Changes in Emacs 26.1 on Non-Free Operating Systems |
| 1538 | 1579 | ||
| @@ -1578,6 +1619,9 @@ debugger has been attached to it. | |||
| 1578 | ** 'set-mouse-position' and 'set-mouse-absolute-pixel-position' work | 1619 | ** 'set-mouse-position' and 'set-mouse-absolute-pixel-position' work |
| 1579 | on macOS. | 1620 | on macOS. |
| 1580 | 1621 | ||
| 1622 | ** Emacs can now be run as a GUI application from the command line on | ||
| 1623 | macOS. | ||
| 1624 | |||
| 1581 | 1625 | ||
| 1582 | ---------------------------------------------------------------------- | 1626 | ---------------------------------------------------------------------- |
| 1583 | This file is part of GNU Emacs. | 1627 | This file is part of GNU Emacs. |
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 6b2cc110403..ecd6447ab78 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -667,7 +667,9 @@ close_emacs_globals (ptrdiff_t num_symbols) | |||
| 667 | "#ifndef DEFINE_SYMBOLS\n" | 667 | "#ifndef DEFINE_SYMBOLS\n" |
| 668 | "extern\n" | 668 | "extern\n" |
| 669 | "#endif\n" | 669 | "#endif\n" |
| 670 | "struct Lisp_Symbol alignas (GCALIGNMENT) lispsym[%td];\n"), | 670 | "struct {\n" |
| 671 | " struct Lisp_Symbol alignas (GCALIGNMENT) s;\n" | ||
| 672 | "} lispsym[%td];\n"), | ||
| 671 | num_symbols); | 673 | num_symbols); |
| 672 | } | 674 | } |
| 673 | 675 | ||
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index e20487b10b4..3e57391372a 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | # the same distribution terms as the rest of that program. | 21 | # the same distribution terms as the rest of that program. |
| 22 | # | 22 | # |
| 23 | # Generated by gnulib-tool. | 23 | # Generated by gnulib-tool. |
| 24 | # Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stat --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=tzset --avoid=unsetenv --avoid=utime --avoid=utime-h --gnu-make --makefile-name=gnulib.mk.in --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-leading-zeros count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp flexmember fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr minmax mkostemp mktime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strftime strtoimax symlink sys_stat sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimens vla warnings | 24 | # Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stat --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=tzset --avoid=unsetenv --avoid=utime --avoid=utime-h --gnu-make --makefile-name=gnulib.mk.in --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-leading-zeros count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp flexmember fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr minmax mkostemp mktime nstrftime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strtoimax symlink sys_stat sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimens vla warnings |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | MOSTLYCLEANFILES += core *.stackdump | 27 | MOSTLYCLEANFILES += core *.stackdump |
| @@ -1811,6 +1811,16 @@ EXTRA_libgnu_a_SOURCES += mktime.c | |||
| 1811 | endif | 1811 | endif |
| 1812 | ## end gnulib module mktime-internal | 1812 | ## end gnulib module mktime-internal |
| 1813 | 1813 | ||
| 1814 | ## begin gnulib module nstrftime | ||
| 1815 | ifeq (,$(OMIT_GNULIB_MODULE_nstrftime)) | ||
| 1816 | |||
| 1817 | libgnu_a_SOURCES += nstrftime.c | ||
| 1818 | |||
| 1819 | EXTRA_DIST += strftime.h | ||
| 1820 | |||
| 1821 | endif | ||
| 1822 | ## end gnulib module nstrftime | ||
| 1823 | |||
| 1814 | ## begin gnulib module openat-h | 1824 | ## begin gnulib module openat-h |
| 1815 | ifeq (,$(OMIT_GNULIB_MODULE_openat-h)) | 1825 | ifeq (,$(OMIT_GNULIB_MODULE_openat-h)) |
| 1816 | 1826 | ||
| @@ -2399,16 +2409,6 @@ EXTRA_libgnu_a_SOURCES += stpcpy.c | |||
| 2399 | endif | 2409 | endif |
| 2400 | ## end gnulib module stpcpy | 2410 | ## end gnulib module stpcpy |
| 2401 | 2411 | ||
| 2402 | ## begin gnulib module strftime | ||
| 2403 | ifeq (,$(OMIT_GNULIB_MODULE_strftime)) | ||
| 2404 | |||
| 2405 | libgnu_a_SOURCES += strftime.c | ||
| 2406 | |||
| 2407 | EXTRA_DIST += strftime.h | ||
| 2408 | |||
| 2409 | endif | ||
| 2410 | ## end gnulib module strftime | ||
| 2411 | |||
| 2412 | ## begin gnulib module string | 2412 | ## begin gnulib module string |
| 2413 | ifeq (,$(OMIT_GNULIB_MODULE_string)) | 2413 | ifeq (,$(OMIT_GNULIB_MODULE_string)) |
| 2414 | 2414 | ||
diff --git a/lib/strftime.c b/lib/nstrftime.c index 99bee4ef978..99bee4ef978 100644 --- a/lib/strftime.c +++ b/lib/nstrftime.c | |||
diff --git a/lisp/apropos.el b/lisp/apropos.el index cbd9c71d3e3..86d9b514290 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -514,6 +514,19 @@ options only, i.e. behave like `apropos-user-option'." | |||
| 514 | (let ((apropos-do-all (if do-not-all nil t))) | 514 | (let ((apropos-do-all (if do-not-all nil t))) |
| 515 | (apropos-user-option pattern))) | 515 | (apropos-user-option pattern))) |
| 516 | 516 | ||
| 517 | ;;;###autoload | ||
| 518 | (defun apropos-local-variable (pattern &optional buffer) | ||
| 519 | "Show buffer-local variables that match PATTERN. | ||
| 520 | Optional arg BUFFER (default: current buffer) is the buffer to check. | ||
| 521 | |||
| 522 | The output includes variables that are not yet set in BUFFER, but that | ||
| 523 | will be buffer-local when set." | ||
| 524 | (interactive (list (apropos-read-pattern "buffer-local variable"))) | ||
| 525 | (unless buffer (setq buffer (current-buffer))) | ||
| 526 | (apropos-command pattern nil (lambda (symbol) | ||
| 527 | (and (local-variable-if-set-p symbol) | ||
| 528 | (get symbol 'variable-documentation))))) | ||
| 529 | |||
| 517 | ;; For auld lang syne: | 530 | ;; For auld lang syne: |
| 518 | ;;;###autoload | 531 | ;;;###autoload |
| 519 | (defalias 'command-apropos 'apropos-command) | 532 | (defalias 'command-apropos 'apropos-command) |
| @@ -795,6 +808,35 @@ Returns list of symbols and values found." | |||
| 795 | (let ((apropos-multi-type do-all)) | 808 | (let ((apropos-multi-type do-all)) |
| 796 | (apropos-print nil "\n----------------\n"))) | 809 | (apropos-print nil "\n----------------\n"))) |
| 797 | 810 | ||
| 811 | ;;;###autoload | ||
| 812 | (defun apropos-local-value (pattern &optional buffer) | ||
| 813 | "Show buffer-local variables whose values match PATTERN. | ||
| 814 | This is like `apropos-value', but only for buffer-local variables. | ||
| 815 | Optional arg BUFFER (default: current buffer) is the buffer to check." | ||
| 816 | (interactive (list (apropos-read-pattern "value of buffer-local variable"))) | ||
| 817 | (unless buffer (setq buffer (current-buffer))) | ||
| 818 | (apropos-parse-pattern pattern) | ||
| 819 | (setq apropos-accumulator ()) | ||
| 820 | (let ((var nil)) | ||
| 821 | (mapatoms | ||
| 822 | (lambda (symb) | ||
| 823 | (unless (memq symb '(apropos-regexp apropos-pattern apropos-all-words-regexp | ||
| 824 | apropos-words apropos-all-words apropos-accumulator symb var)) | ||
| 825 | (setq var (apropos-value-internal 'local-variable-if-set-p symb 'symbol-value))) | ||
| 826 | (when (and (fboundp 'apropos-false-hit-str) (apropos-false-hit-str var)) | ||
| 827 | (setq var nil)) | ||
| 828 | (when var | ||
| 829 | (setq apropos-accumulator (cons (list symb (apropos-score-str var) nil var) | ||
| 830 | apropos-accumulator)))))) | ||
| 831 | (let ((apropos-multi-type nil)) | ||
| 832 | (if (> emacs-major-version 20) | ||
| 833 | (apropos-print | ||
| 834 | nil "\n----------------\n" | ||
| 835 | (format "Buffer `%s' has the following local variables\nmatching %s`%s':" | ||
| 836 | (buffer-name buffer) | ||
| 837 | (if (consp pattern) "keywords " "") | ||
| 838 | pattern)) | ||
| 839 | (apropos-print nil "\n----------------\n")))) | ||
| 798 | 840 | ||
| 799 | ;;;###autoload | 841 | ;;;###autoload |
| 800 | (defun apropos-documentation (pattern &optional do-all) | 842 | (defun apropos-documentation (pattern &optional do-all) |
diff --git a/lisp/auth-source.el b/lisp/auth-source.el index d1747bda3da..d4b44a59529 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el | |||
| @@ -200,8 +200,6 @@ Note that if EPA/EPG is not available, this should NOT be used." | |||
| 200 | (const :tag "Save GPG-encrypted password tokens" gpg) | 200 | (const :tag "Save GPG-encrypted password tokens" gpg) |
| 201 | (const :tag "Don't encrypt tokens" never)))))) | 201 | (const :tag "Don't encrypt tokens" never)))))) |
| 202 | 202 | ||
| 203 | (defvar auth-source-magic "auth-source-magic ") | ||
| 204 | |||
| 205 | (defcustom auth-source-do-cache t | 203 | (defcustom auth-source-do-cache t |
| 206 | "Whether auth-source should cache information with `password-cache'." | 204 | "Whether auth-source should cache information with `password-cache'." |
| 207 | :group 'auth-source | 205 | :group 'auth-source |
| @@ -782,16 +780,16 @@ Returns the deleted entries." | |||
| 782 | (defun auth-source-forget-all-cached () | 780 | (defun auth-source-forget-all-cached () |
| 783 | "Forget all cached auth-source data." | 781 | "Forget all cached auth-source data." |
| 784 | (interactive) | 782 | (interactive) |
| 785 | (cl-do-symbols (sym password-data) | 783 | (maphash (lambda (key _password) |
| 786 | ;; when the symbol name starts with auth-source-magic | 784 | (when (eq 'auth-source (car-safe key)) |
| 787 | (when (string-match (concat "^" auth-source-magic) (symbol-name sym)) | 785 | ;; remove that key |
| 788 | ;; remove that key | 786 | (password-cache-remove key))) |
| 789 | (password-cache-remove (symbol-name sym)))) | 787 | password-data) |
| 790 | (setq auth-source-netrc-cache nil)) | 788 | (setq auth-source-netrc-cache nil)) |
| 791 | 789 | ||
| 792 | (defun auth-source-format-cache-entry (spec) | 790 | (defun auth-source-format-cache-entry (spec) |
| 793 | "Format SPEC entry to put it in the password cache." | 791 | "Format SPEC entry to put it in the password cache." |
| 794 | (concat auth-source-magic (format "%S" spec))) | 792 | `(auth-source . ,spec)) |
| 795 | 793 | ||
| 796 | (defun auth-source-remember (spec found) | 794 | (defun auth-source-remember (spec found) |
| 797 | "Remember FOUND search results for SPEC." | 795 | "Remember FOUND search results for SPEC." |
| @@ -822,18 +820,16 @@ This is not a full `auth-source-search' spec but works similarly. | |||
| 822 | For instance, \(:host \"myhost\" \"yourhost\") would find all the | 820 | For instance, \(:host \"myhost\" \"yourhost\") would find all the |
| 823 | cached data that was found with a search for those two hosts, | 821 | cached data that was found with a search for those two hosts, |
| 824 | while \(:host t) would find all host entries." | 822 | while \(:host t) would find all host entries." |
| 825 | (let ((count 0) | 823 | (let ((count 0)) |
| 826 | sname) | 824 | (maphash |
| 827 | (cl-do-symbols (sym password-data) | 825 | (lambda (key _password) |
| 828 | ;; when the symbol name matches with auth-source-magic | 826 | (when (and (eq 'auth-source (car-safe key)) |
| 829 | (when (and (setq sname (symbol-name sym)) | 827 | ;; and the spec matches what was stored in the cache |
| 830 | (string-match (concat "^" auth-source-magic "\\(.+\\)") | 828 | (auth-source-specmatchp spec (cdr key))) |
| 831 | sname) | 829 | ;; remove that key |
| 832 | ;; and the spec matches what was stored in the cache | 830 | (password-cache-remove key) |
| 833 | (auth-source-specmatchp spec (read (match-string 1 sname)))) | 831 | (cl-incf count))) |
| 834 | ;; remove that key | 832 | password-data) |
| 835 | (password-cache-remove sname) | ||
| 836 | (cl-incf count))) | ||
| 837 | count)) | 833 | count)) |
| 838 | 834 | ||
| 839 | (defun auth-source-specmatchp (spec stored) | 835 | (defun auth-source-specmatchp (spec stored) |
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index b89c1c2bbd5..1cb01e1ed9e 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -4527,11 +4527,9 @@ If the file already exists, overwrite it only on confirmation." | |||
| 4527 | 4527 | ||
| 4528 | (defcustom todo-print-buffer-function #'ps-print-buffer-with-faces | 4528 | (defcustom todo-print-buffer-function #'ps-print-buffer-with-faces |
| 4529 | "Function called by `todo-print-buffer' to print Todo mode buffers. | 4529 | "Function called by `todo-print-buffer' to print Todo mode buffers. |
| 4530 | The function should take an optional argument whose non-nil value | 4530 | Called with one argument which can either be: |
| 4531 | is a string naming a file to save the print image to; calling | 4531 | - a string, naming a file to save the print image to. |
| 4532 | `todo-print-buffer-to-file' prompts for the file name, which is | 4532 | - nil, to send the image to the printer." |
| 4533 | passed to this function. Calling this function with no or a nil | ||
| 4534 | argument sends the image to the printer." | ||
| 4535 | :type 'symbol | 4533 | :type 'symbol |
| 4536 | :group 'todo) | 4534 | :group 'todo) |
| 4537 | 4535 | ||
diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 42dc40cce04..df71508da7c 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el | |||
| @@ -189,26 +189,25 @@ This shell should support pipe redirect syntax." | |||
| 189 | ;; Return the answer | 189 | ;; Return the answer |
| 190 | ans)) | 190 | ans)) |
| 191 | 191 | ||
| 192 | (defconst semantic-symref-grep--line-re | ||
| 193 | "^\\(\\(?:[a-zA-Z]:\\)?[^:\n]+\\):\\([0-9]+\\):") | ||
| 194 | |||
| 195 | (cl-defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-tool-grep)) | 192 | (cl-defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-tool-grep)) |
| 196 | "Parse one line of grep output, and return it as a match list. | 193 | "Parse one line of grep output, and return it as a match list. |
| 197 | Moves cursor to end of the match." | 194 | Moves cursor to end of the match." |
| 198 | (cond ((eq (oref tool :resulttype) 'file) | 195 | (pcase-let |
| 199 | ;; Search for files | 196 | ((`(,grep-re ,file-group ,line-group . ,_) (car (grep-regexp-alist)))) |
| 200 | (when (re-search-forward "^\\([^\n]+\\)$" nil t) | 197 | (cond ((eq (oref tool :resulttype) 'file) |
| 201 | (match-string 1))) | 198 | ;; Search for files |
| 202 | ((eq (oref tool :resulttype) 'line-and-text) | 199 | (when (re-search-forward "^\\([^\n]+\\)$" nil t) |
| 203 | (when (re-search-forward semantic-symref-grep--line-re nil t) | 200 | (match-string 1))) |
| 204 | (list (string-to-number (match-string 2)) | 201 | ((eq (oref tool :resulttype) 'line-and-text) |
| 205 | (match-string 1) | 202 | (when (re-search-forward grep-re nil t) |
| 206 | (buffer-substring-no-properties (point) (line-end-position))))) | 203 | (list (string-to-number (match-string line-group)) |
| 207 | (t | 204 | (match-string file-group) |
| 208 | (when (re-search-forward semantic-symref-grep--line-re nil t) | 205 | (buffer-substring-no-properties (point) (line-end-position))))) |
| 209 | (cons (string-to-number (match-string 2)) | 206 | (t |
| 210 | (match-string 1)) | 207 | (when (re-search-forward grep-re nil t) |
| 211 | )))) | 208 | (cons (string-to-number (match-string line-group)) |
| 209 | (match-string file-group)) | ||
| 210 | ))))) | ||
| 212 | 211 | ||
| 213 | (provide 'semantic/symref/grep) | 212 | (provide 'semantic/symref/grep) |
| 214 | 213 | ||
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index ed913e32688..c28b8a147fc 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -584,7 +584,7 @@ since it could result in memory overflow and make Emacs crash." | |||
| 584 | (const :tag "Grow only" :value grow-only)) | 584 | (const :tag "Grow only" :value grow-only)) |
| 585 | "25.1") | 585 | "25.1") |
| 586 | (display-raw-bytes-as-hex display boolean "26.1") | 586 | (display-raw-bytes-as-hex display boolean "26.1") |
| 587 | (display-line-numbers display | 587 | (display-line-numbers display-line-numbers |
| 588 | (choice | 588 | (choice |
| 589 | (const :tag "Off (nil)" :value nil) | 589 | (const :tag "Off (nil)" :value nil) |
| 590 | (const :tag "Absolute line numbers" | 590 | (const :tag "Absolute line numbers" |
| @@ -594,7 +594,7 @@ since it could result in memory overflow and make Emacs crash." | |||
| 594 | (const :tag "Visually relative line numbers" | 594 | (const :tag "Visually relative line numbers" |
| 595 | :value visual)) | 595 | :value visual)) |
| 596 | "26.1") | 596 | "26.1") |
| 597 | (display-line-numbers-width display | 597 | (display-line-numbers-width display-line-numbers |
| 598 | (choice | 598 | (choice |
| 599 | (const :tag "Dynamically computed" | 599 | (const :tag "Dynamically computed" |
| 600 | :value nil) | 600 | :value nil) |
| @@ -602,14 +602,14 @@ since it could result in memory overflow and make Emacs crash." | |||
| 602 | :value 2 | 602 | :value 2 |
| 603 | :format "%v")) | 603 | :format "%v")) |
| 604 | "26.1") | 604 | "26.1") |
| 605 | (display-line-numbers-current-absolute display | 605 | (display-line-numbers-current-absolute display-line-numbers |
| 606 | (choice | 606 | (choice |
| 607 | (const :tag "Display actual number of current line" | 607 | (const :tag "Display actual number of current line" |
| 608 | :value t) | 608 | :value t) |
| 609 | (const :tag "Display zero as number of current line" | 609 | (const :tag "Display zero as number of current line" |
| 610 | :value nil)) | 610 | :value nil)) |
| 611 | "26.1") | 611 | "26.1") |
| 612 | (display-line-numbers-widen display | 612 | (display-line-numbers-widen display-line-numbers |
| 613 | (choice | 613 | (choice |
| 614 | (const :tag "Disregard narrowing when calculating line numbers" | 614 | (const :tag "Disregard narrowing when calculating line numbers" |
| 615 | :value t) | 615 | :value t) |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 17dae6085df..0a8ec26f7ca 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; dired-aux.el --- less commonly used parts of dired | 1 | ;;; dired-aux.el --- less commonly used parts of dired -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985-1986, 1992, 1994, 1998, 2000-2017 Free Software | 3 | ;; Copyright (C) 1985-1986, 1992, 1994, 1998, 2000-2017 Free Software |
| 4 | ;; Foundation, Inc. | 4 | ;; Foundation, Inc. |
| @@ -742,8 +742,6 @@ can be produced by `dired-get-marked-files', for example." | |||
| 742 | (string-match regexp res)))) | 742 | (string-match regexp res)))) |
| 743 | (let* ((on-each (not (dired--star-or-qmark-p command "*" 'keep))) | 743 | (let* ((on-each (not (dired--star-or-qmark-p command "*" 'keep))) |
| 744 | (no-subst (not (dired--star-or-qmark-p command "?" 'keep))) | 744 | (no-subst (not (dired--star-or-qmark-p command "?" 'keep))) |
| 745 | (star (string-match "\\*" command)) | ||
| 746 | (qmark (string-match "\\?" command)) | ||
| 747 | ;; Get confirmation for wildcards that may have been meant | 745 | ;; Get confirmation for wildcards that may have been meant |
| 748 | ;; to control substitution of a file name or the file name list. | 746 | ;; to control substitution of a file name or the file name list. |
| 749 | (ok (cond ((not (or on-each no-subst)) | 747 | (ok (cond ((not (or on-each no-subst)) |
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 915550991d0..1425278bdc9 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el | |||
| @@ -1629,10 +1629,11 @@ Binding direction based on `dired-x-hands-off-my-keys'." | |||
| 1629 | (if (called-interactively-p 'interactive) | 1629 | (if (called-interactively-p 'interactive) |
| 1630 | (setq dired-x-hands-off-my-keys | 1630 | (setq dired-x-hands-off-my-keys |
| 1631 | (not (y-or-n-p "Bind dired-x-find-file over find-file? ")))) | 1631 | (not (y-or-n-p "Bind dired-x-find-file over find-file? ")))) |
| 1632 | (define-key (current-global-map) [remap find-file] | 1632 | (unless dired-x-hands-off-my-keys |
| 1633 | (if (not dired-x-hands-off-my-keys) 'dired-x-find-file)) | 1633 | (define-key (current-global-map) [remap find-file] |
| 1634 | (define-key (current-global-map) [remap find-file-other-window] | 1634 | 'dired-x-find-file) |
| 1635 | (if (not dired-x-hands-off-my-keys) 'dired-x-find-file-other-window))) | 1635 | (define-key (current-global-map) [remap find-file-other-window] |
| 1636 | 'dired-x-find-file-other-window))) | ||
| 1636 | 1637 | ||
| 1637 | ;; Now call it so binding is correct. This could go in the :initialize | 1638 | ;; Now call it so binding is correct. This could go in the :initialize |
| 1638 | ;; slot, but then dired-x-bind-find-file has to be defined before the | 1639 | ;; slot, but then dired-x-bind-find-file has to be defined before the |
diff --git a/lisp/dired.el b/lisp/dired.el index 9d500a9f52d..a056ad679fa 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -920,11 +920,12 @@ periodically reverts at specified time intervals." | |||
| 920 | "Directory has changed on disk; type \\[revert-buffer] to update Dired"))))) | 920 | "Directory has changed on disk; type \\[revert-buffer] to update Dired"))))) |
| 921 | ;; Else a new buffer | 921 | ;; Else a new buffer |
| 922 | (setq default-directory | 922 | (setq default-directory |
| 923 | ;; We can do this unconditionally | 923 | (or (car-safe (insert-directory-wildcard-in-dir-p dirname)) |
| 924 | ;; because dired-noselect ensures that the name | 924 | ;; We can do this unconditionally |
| 925 | ;; is passed in directory name syntax | 925 | ;; because dired-noselect ensures that the name |
| 926 | ;; if it was the name of a directory at all. | 926 | ;; is passed in directory name syntax |
| 927 | (file-name-directory dirname)) | 927 | ;; if it was the name of a directory at all. |
| 928 | (file-name-directory dirname))) | ||
| 928 | (or switches (setq switches dired-listing-switches)) | 929 | (or switches (setq switches dired-listing-switches)) |
| 929 | (if mode (funcall mode) | 930 | (if mode (funcall mode) |
| 930 | (dired-mode dir-or-list switches)) | 931 | (dired-mode dir-or-list switches)) |
| @@ -1056,13 +1057,14 @@ wildcards, erases the buffer, and builds the subdir-alist anew | |||
| 1056 | (not file-list)) | 1057 | (not file-list)) |
| 1057 | ;; If we are reading a whole single directory... | 1058 | ;; If we are reading a whole single directory... |
| 1058 | (dired-insert-directory dir dired-actual-switches nil nil t) | 1059 | (dired-insert-directory dir dired-actual-switches nil nil t) |
| 1059 | (if (not (file-readable-p | 1060 | (if (and (not (insert-directory-wildcard-in-dir-p dir)) |
| 1060 | (directory-file-name (file-name-directory dir)))) | 1061 | (not (file-readable-p |
| 1061 | (error "Directory %s inaccessible or nonexistent" dir) | 1062 | (directory-file-name (file-name-directory dir))))) |
| 1062 | ;; Else treat it as a wildcard spec | 1063 | (error "Directory %s inaccessible or nonexistent" dir)) |
| 1063 | ;; unless we have an explicit list of files. | 1064 | ;; Else treat it as a wildcard spec |
| 1064 | (dired-insert-directory dir dired-actual-switches | 1065 | ;; unless we have an explicit list of files. |
| 1065 | file-list (not file-list) t))))) | 1066 | (dired-insert-directory dir dired-actual-switches |
| 1067 | file-list (not file-list) t)))) | ||
| 1066 | 1068 | ||
| 1067 | (defun dired-align-file (beg end) | 1069 | (defun dired-align-file (beg end) |
| 1068 | "Align the fields of a file to the ones of surrounding lines. | 1070 | "Align the fields of a file to the ones of surrounding lines. |
| @@ -1207,29 +1209,46 @@ If HDR is non-nil, insert a header line with the directory name." | |||
| 1207 | ;; as indicated by `ls-lisp-use-insert-directory-program'. | 1209 | ;; as indicated by `ls-lisp-use-insert-directory-program'. |
| 1208 | (not (and (featurep 'ls-lisp) | 1210 | (not (and (featurep 'ls-lisp) |
| 1209 | (null ls-lisp-use-insert-directory-program))) | 1211 | (null ls-lisp-use-insert-directory-program))) |
| 1210 | (or (if (eq dired-use-ls-dired 'unspecified) | 1212 | (not (and (featurep 'eshell) |
| 1213 | (bound-and-true-p eshell-ls-use-in-dired))) | ||
| 1214 | (or (file-remote-p dir) | ||
| 1215 | (if (eq dired-use-ls-dired 'unspecified) | ||
| 1211 | ;; Check whether "ls --dired" gives exit code 0, and | 1216 | ;; Check whether "ls --dired" gives exit code 0, and |
| 1212 | ;; save the answer in `dired-use-ls-dired'. | 1217 | ;; save the answer in `dired-use-ls-dired'. |
| 1213 | (or (setq dired-use-ls-dired | 1218 | (or (setq dired-use-ls-dired |
| 1214 | (eq 0 (call-process insert-directory-program | 1219 | (eq 0 (call-process insert-directory-program |
| 1215 | nil nil nil "--dired"))) | 1220 | nil nil nil "--dired"))) |
| 1216 | (progn | 1221 | (progn |
| 1217 | (message "ls does not support --dired; \ | 1222 | (message "ls does not support --dired; \ |
| 1218 | see `dired-use-ls-dired' for more details.") | 1223 | see `dired-use-ls-dired' for more details.") |
| 1219 | nil)) | 1224 | nil)) |
| 1220 | dired-use-ls-dired) | 1225 | dired-use-ls-dired))) |
| 1221 | (file-remote-p dir))) | ||
| 1222 | (setq switches (concat "--dired " switches))) | 1226 | (setq switches (concat "--dired " switches))) |
| 1223 | ;; We used to specify the C locale here, to force English month names; | 1227 | ;; Expand directory wildcards and fill file-list. |
| 1224 | ;; but this should not be necessary any more, | 1228 | (let ((dir-wildcard (insert-directory-wildcard-in-dir-p dir))) |
| 1225 | ;; with the new value of `directory-listing-before-filename-regexp'. | 1229 | (cond (dir-wildcard |
| 1226 | (if file-list | 1230 | (setq switches (concat "-d " switches)) |
| 1227 | (dolist (f file-list) | 1231 | (let ((default-directory (car dir-wildcard)) |
| 1228 | (let ((beg (point))) | 1232 | (script (format "ls %s %s" switches (cdr dir-wildcard)))) |
| 1229 | (insert-directory f switches nil nil) | 1233 | (unless |
| 1230 | ;; Re-align fields, if necessary. | 1234 | (zerop |
| 1231 | (dired-align-file beg (point)))) | 1235 | (process-file |
| 1232 | (insert-directory dir switches wildcard (not wildcard))) | 1236 | "/bin/sh" nil (current-buffer) nil "-c" script)) |
| 1237 | (user-error | ||
| 1238 | "%s: No files matching wildcard" (cdr dir-wildcard))) | ||
| 1239 | (insert-directory-clean (point) switches))) | ||
| 1240 | (t | ||
| 1241 | ;; We used to specify the C locale here, to force English | ||
| 1242 | ;; month names; but this should not be necessary any | ||
| 1243 | ;; more, with the new value of | ||
| 1244 | ;; `directory-listing-before-filename-regexp'. | ||
| 1245 | (if file-list | ||
| 1246 | (dolist (f file-list) | ||
| 1247 | (let ((beg (point))) | ||
| 1248 | (insert-directory f switches nil nil) | ||
| 1249 | ;; Re-align fields, if necessary. | ||
| 1250 | (dired-align-file beg (point)))) | ||
| 1251 | (insert-directory dir switches wildcard (not wildcard)))))) | ||
| 1233 | ;; Quote certain characters, unless ls quoted them for us. | 1252 | ;; Quote certain characters, unless ls quoted them for us. |
| 1234 | (if (not (dired-switches-escape-p dired-actual-switches)) | 1253 | (if (not (dired-switches-escape-p dired-actual-switches)) |
| 1235 | (save-excursion | 1254 | (save-excursion |
| @@ -1279,11 +1298,14 @@ see `dired-use-ls-dired' for more details.") | |||
| 1279 | ;; Note that dired-build-subdir-alist will replace the name | 1298 | ;; Note that dired-build-subdir-alist will replace the name |
| 1280 | ;; by its expansion, so it does not matter whether what we insert | 1299 | ;; by its expansion, so it does not matter whether what we insert |
| 1281 | ;; here is fully expanded, but it should be absolute. | 1300 | ;; here is fully expanded, but it should be absolute. |
| 1282 | (insert " " (directory-file-name (file-name-directory dir)) ":\n") | 1301 | (insert " " (or (car-safe (insert-directory-wildcard-in-dir-p dir)) |
| 1302 | (directory-file-name (file-name-directory dir))) ":\n") | ||
| 1283 | (setq content-point (point))) | 1303 | (setq content-point (point))) |
| 1284 | (when wildcard | 1304 | (when wildcard |
| 1285 | ;; Insert "wildcard" line where "total" line would be for a full dir. | 1305 | ;; Insert "wildcard" line where "total" line would be for a full dir. |
| 1286 | (insert " wildcard " (file-name-nondirectory dir) "\n"))) | 1306 | (insert " wildcard " (or (cdr-safe (insert-directory-wildcard-in-dir-p dir)) |
| 1307 | (file-name-nondirectory dir)) | ||
| 1308 | "\n"))) | ||
| 1287 | (dired-insert-set-properties content-point (point))))) | 1309 | (dired-insert-set-properties content-point (point))))) |
| 1288 | 1310 | ||
| 1289 | (defun dired-insert-set-properties (beg end) | 1311 | (defun dired-insert-set-properties (beg end) |
diff --git a/lisp/display-line-numbers.el b/lisp/display-line-numbers.el new file mode 100644 index 00000000000..a99474547bf --- /dev/null +++ b/lisp/display-line-numbers.el | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | ;;; display-line-numbers.el --- interface for display-line-numbers -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Maintainer: emacs-devel@gnu.org | ||
| 6 | ;; Keywords: convenience | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Commentary: | ||
| 24 | |||
| 25 | ;; Provides a minor mode interface for `display-line-numbers'. | ||
| 26 | ;; | ||
| 27 | ;; Toggle display of line numbers with M-x display-line-numbers-mode. | ||
| 28 | ;; To enable line numbering in all buffers, use M-x | ||
| 29 | ;; global-display-line-numbers-mode. To change the default type of | ||
| 30 | ;; line numbers displayed, customize display-line-numbers-type. | ||
| 31 | |||
| 32 | ;; NOTE: Customization variables for `display-line-numbers' itself are | ||
| 33 | ;; defined in cus-start.el. | ||
| 34 | |||
| 35 | ;;; Code: | ||
| 36 | |||
| 37 | (defgroup display-line-numbers nil | ||
| 38 | "Display line numbers in the buffer." | ||
| 39 | :group 'display) | ||
| 40 | |||
| 41 | ;;;###autoload | ||
| 42 | (defcustom display-line-numbers-type t | ||
| 43 | "The default type of line numbers to use in `display-line-numbers-mode'. | ||
| 44 | See `display-line-numbers' for value options." | ||
| 45 | :group 'display-line-numbers | ||
| 46 | :type '(choice (const :tag "Relative line numbers" relative) | ||
| 47 | (const :tag "Relative visual line numbers" visual) | ||
| 48 | (other :tag "Absolute line numbers" t)) | ||
| 49 | :version "26.1") | ||
| 50 | |||
| 51 | (defcustom display-line-numbers-grow-only nil | ||
| 52 | "If non-nil, do not shrink line number width." | ||
| 53 | :group 'display-line-numbers | ||
| 54 | :type 'boolean | ||
| 55 | :version "26.1") | ||
| 56 | |||
| 57 | (defcustom display-line-numbers-width-start nil | ||
| 58 | "If non-nil, count number of lines to use for line number width. | ||
| 59 | When `display-line-numbers-mode' is turned on, | ||
| 60 | `display-line-numbers-width' is set to the minimum width necessary | ||
| 61 | to display all line numbers in the buffer." | ||
| 62 | :group 'display-line-numbers | ||
| 63 | :type 'boolean | ||
| 64 | :version "26.1") | ||
| 65 | |||
| 66 | (defun display-line-numbers-update-width () | ||
| 67 | "Prevent the line number width from shrinking." | ||
| 68 | (let ((width (line-number-display-width))) | ||
| 69 | (when (> width (or display-line-numbers-width 1)) | ||
| 70 | (setq display-line-numbers-width width)))) | ||
| 71 | |||
| 72 | ;;;###autoload | ||
| 73 | (define-minor-mode display-line-numbers-mode | ||
| 74 | "Toggle display of line numbers in the buffer. | ||
| 75 | This uses `display-line-numbers' internally. | ||
| 76 | |||
| 77 | To change the type of line numbers displayed by default, | ||
| 78 | customize `display-line-numbers-type'. To change the type while | ||
| 79 | the mode is on, set `display-line-numbers' directly." | ||
| 80 | :lighter nil | ||
| 81 | (if display-line-numbers-mode | ||
| 82 | (progn | ||
| 83 | (when display-line-numbers-width-start | ||
| 84 | (setq display-line-numbers-width | ||
| 85 | (length (number-to-string | ||
| 86 | (count-lines (point-min) (point-max)))))) | ||
| 87 | (when display-line-numbers-grow-only | ||
| 88 | (add-hook 'pre-command-hook #'display-line-numbers-update-width nil t)) | ||
| 89 | (setq display-line-numbers display-line-numbers-type)) | ||
| 90 | (remove-hook 'pre-command-hook #'display-line-numbers-update-width t) | ||
| 91 | (setq display-line-numbers nil))) | ||
| 92 | |||
| 93 | (defun display-line-numbers--turn-on () | ||
| 94 | "Turn on `display-line-numbers-mode'." | ||
| 95 | (unless (or (minibufferp) | ||
| 96 | ;; taken from linum.el | ||
| 97 | (and (daemonp) (null (frame-parameter nil 'client)))) | ||
| 98 | (display-line-numbers-mode))) | ||
| 99 | |||
| 100 | ;;;###autoload | ||
| 101 | (define-globalized-minor-mode global-display-line-numbers-mode | ||
| 102 | display-line-numbers-mode display-line-numbers--turn-on) | ||
| 103 | |||
| 104 | (provide 'display-line-numbers) | ||
| 105 | |||
| 106 | ;;; display-line-numbers.el ends here | ||
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index c64376b940f..1a3f8e1f4d5 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el | |||
| @@ -166,6 +166,10 @@ SPECIALIZERS-FUNCTION takes as first argument a tag value TAG | |||
| 166 | (defmacro cl--generic (name) | 166 | (defmacro cl--generic (name) |
| 167 | `(get ,name 'cl--generic)) | 167 | `(get ,name 'cl--generic)) |
| 168 | 168 | ||
| 169 | (defun cl-generic-p (f) | ||
| 170 | "Return non-nil if F is a generic function." | ||
| 171 | (and (symbolp f) (cl--generic f))) | ||
| 172 | |||
| 169 | (defun cl-generic-ensure-function (name &optional noerror) | 173 | (defun cl-generic-ensure-function (name &optional noerror) |
| 170 | (let (generic | 174 | (let (generic |
| 171 | (origname name)) | 175 | (origname name)) |
| @@ -182,8 +186,7 @@ SPECIALIZERS-FUNCTION takes as first argument a tag value TAG | |||
| 182 | origname)) | 186 | origname)) |
| 183 | (if generic | 187 | (if generic |
| 184 | (cl-assert (eq name (cl--generic-name generic))) | 188 | (cl-assert (eq name (cl--generic-name generic))) |
| 185 | (setf (cl--generic name) (setq generic (cl--generic-make name))) | 189 | (setf (cl--generic name) (setq generic (cl--generic-make name)))) |
| 186 | (defalias name (cl--generic-make-function generic))) | ||
| 187 | generic)) | 190 | generic)) |
| 188 | 191 | ||
| 189 | ;;;###autoload | 192 | ;;;###autoload |
| @@ -410,7 +413,7 @@ The set of acceptable TYPEs (also called \"specializers\") is defined | |||
| 410 | \(and can be extended) by the various methods of `cl-generic-generalizers'. | 413 | \(and can be extended) by the various methods of `cl-generic-generalizers'. |
| 411 | 414 | ||
| 412 | \(fn NAME [QUALIFIER] ARGS &rest [DOCSTRING] BODY)" | 415 | \(fn NAME [QUALIFIER] ARGS &rest [DOCSTRING] BODY)" |
| 413 | (declare (doc-string 3) (indent 2) | 416 | (declare (doc-string 3) (indent defun) |
| 414 | (debug | 417 | (debug |
| 415 | (&define ; this means we are defining something | 418 | (&define ; this means we are defining something |
| 416 | [&or name ("setf" name :name setf)] | 419 | [&or name ("setf" name :name setf)] |
| @@ -501,25 +504,26 @@ The set of acceptable TYPEs (also called \"specializers\") is defined | |||
| 501 | (cons method mt) | 504 | (cons method mt) |
| 502 | ;; Keep the ordering; important for methods with :extra qualifiers. | 505 | ;; Keep the ordering; important for methods with :extra qualifiers. |
| 503 | (mapcar (lambda (x) (if (eq x (car me)) method x)) mt))) | 506 | (mapcar (lambda (x) (if (eq x (car me)) method x)) mt))) |
| 504 | (cl-pushnew `(cl-defmethod . ,(cl--generic-load-hist-format | 507 | (let ((sym (cl--generic-name generic))) ; Actual name (for aliases). |
| 505 | (cl--generic-name generic) | 508 | (unless (symbol-function sym) |
| 506 | qualifiers specializers)) | 509 | (defalias sym 'dummy)) ;Record definition into load-history. |
| 507 | current-load-list :test #'equal) | 510 | (cl-pushnew `(cl-defmethod . ,(cl--generic-load-hist-format |
| 508 | ;; FIXME: Try to avoid re-constructing a new function if the old one | 511 | (cl--generic-name generic) |
| 509 | ;; is still valid (e.g. still empty method cache)? | 512 | qualifiers specializers)) |
| 510 | (let ((gfun (cl--generic-make-function generic)) | 513 | current-load-list :test #'equal) |
| 511 | ;; Prevent `defalias' from recording this as the definition site of | 514 | ;; FIXME: Try to avoid re-constructing a new function if the old one |
| 512 | ;; the generic function. | 515 | ;; is still valid (e.g. still empty method cache)? |
| 513 | current-load-list) | 516 | (let ((gfun (cl--generic-make-function generic)) |
| 514 | ;; For aliases, cl--generic-name gives us the actual name. | 517 | ;; Prevent `defalias' from recording this as the definition site of |
| 515 | (let ((purify-flag | 518 | ;; the generic function. |
| 516 | ;; BEWARE! Don't purify this function definition, since that leads | 519 | current-load-list |
| 517 | ;; to memory corruption if the hash-tables it holds are modified | 520 | ;; BEWARE! Don't purify this function definition, since that leads |
| 518 | ;; (the GC doesn't trace those pointers). | 521 | ;; to memory corruption if the hash-tables it holds are modified |
| 519 | nil)) | 522 | ;; (the GC doesn't trace those pointers). |
| 523 | (purify-flag nil)) | ||
| 520 | ;; But do use `defalias', so that it interacts properly with nadvice, | 524 | ;; But do use `defalias', so that it interacts properly with nadvice, |
| 521 | ;; e.g. for tracing/debug-on-entry. | 525 | ;; e.g. for tracing/debug-on-entry. |
| 522 | (defalias (cl--generic-name generic) gfun))))) | 526 | (defalias sym gfun))))) |
| 523 | 527 | ||
| 524 | (defmacro cl--generic-with-memoization (place &rest code) | 528 | (defmacro cl--generic-with-memoization (place &rest code) |
| 525 | (declare (indent 1) (debug t)) | 529 | (declare (indent 1) (debug t)) |
| @@ -1023,6 +1027,20 @@ The value returned is a list of elements of the form | |||
| 1023 | (push (cl--generic-method-info method) docs)))) | 1027 | (push (cl--generic-method-info method) docs)))) |
| 1024 | docs)) | 1028 | docs)) |
| 1025 | 1029 | ||
| 1030 | (defun cl--generic-method-files (method) | ||
| 1031 | "Return a list of files where METHOD is defined by `cl-defmethod'. | ||
| 1032 | The list will have entries of the form (FILE . (METHOD ...)) | ||
| 1033 | where (METHOD ...) contains the qualifiers and specializers of | ||
| 1034 | the method and is a suitable argument for | ||
| 1035 | `find-function-search-for-symbol'. Filenames are absolute." | ||
| 1036 | (let (result) | ||
| 1037 | (pcase-dolist (`(,file . ,defs) load-history) | ||
| 1038 | (dolist (def defs) | ||
| 1039 | (when (and (eq (car-safe def) 'cl-defmethod) | ||
| 1040 | (eq (cadr def) method)) | ||
| 1041 | (push (cons file (cdr def)) result)))) | ||
| 1042 | result)) | ||
| 1043 | |||
| 1026 | ;;; Support for (head <val>) specializers. | 1044 | ;;; Support for (head <val>) specializers. |
| 1027 | 1045 | ||
| 1028 | ;; For both the `eql' and the `head' specializers, the dispatch | 1046 | ;; For both the `eql' and the `head' specializers, the dispatch |
| @@ -1210,5 +1228,18 @@ Used internally for the (major-mode MODE) context specializers." | |||
| 1210 | (progn (cl-assert (null modes)) mode) | 1228 | (progn (cl-assert (null modes)) mode) |
| 1211 | `(derived-mode ,mode . ,modes)))) | 1229 | `(derived-mode ,mode . ,modes)))) |
| 1212 | 1230 | ||
| 1231 | ;;; Support for unloading. | ||
| 1232 | |||
| 1233 | (cl-defmethod loadhist-unload-element ((x (head cl-defmethod))) | ||
| 1234 | (pcase-let* | ||
| 1235 | ((`(,name ,qualifiers . ,specializers) (cdr x)) | ||
| 1236 | (generic (cl-generic-ensure-function name 'noerror))) | ||
| 1237 | (when generic | ||
| 1238 | (let* ((mt (cl--generic-method-table generic)) | ||
| 1239 | (me (cl--generic-member-method specializers qualifiers mt))) | ||
| 1240 | (when me | ||
| 1241 | (setf (cl--generic-method-table generic) (delq (car me) mt))))))) | ||
| 1242 | |||
| 1243 | |||
| 1213 | (provide 'cl-generic) | 1244 | (provide 'cl-generic) |
| 1214 | ;;; cl-generic.el ends here | 1245 | ;;; cl-generic.el ends here |
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 1494ed1d9c3..c6ef8d7a99c 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -3213,8 +3213,8 @@ instrument cannot be found, signal an error." | |||
| 3213 | ((consp func-marker) | 3213 | ((consp func-marker) |
| 3214 | (message "%s is already instrumented." func) | 3214 | (message "%s is already instrumented." func) |
| 3215 | (list func)) | 3215 | (list func)) |
| 3216 | ((get func 'cl--generic) | 3216 | ((cl-generic-p func) |
| 3217 | (let ((method-defs (method-files func)) | 3217 | (let ((method-defs (cl--generic-method-files func)) |
| 3218 | symbols) | 3218 | symbols) |
| 3219 | (unless method-defs | 3219 | (unless method-defs |
| 3220 | (error "Could not find any method definitions for %s" func)) | 3220 | (error "Could not find any method definitions for %s" func)) |
diff --git a/lisp/emacs-lisp/eieio-compat.el b/lisp/emacs-lisp/eieio-compat.el index e6e6d118709..8403a8a655f 100644 --- a/lisp/emacs-lisp/eieio-compat.el +++ b/lisp/emacs-lisp/eieio-compat.el | |||
| @@ -165,7 +165,8 @@ Summary: | |||
| 165 | (if (memq method '(no-next-method no-applicable-method)) | 165 | (if (memq method '(no-next-method no-applicable-method)) |
| 166 | (symbol-function method) | 166 | (symbol-function method) |
| 167 | (let ((generic (cl-generic-ensure-function method))) | 167 | (let ((generic (cl-generic-ensure-function method))) |
| 168 | (symbol-function (cl--generic-name generic))))) | 168 | (or (symbol-function (cl--generic-name generic)) |
| 169 | (cl--generic-make-function generic))))) | ||
| 169 | 170 | ||
| 170 | ;;;###autoload | 171 | ;;;###autoload |
| 171 | (defun eieio--defmethod (method kind argclass code) | 172 | (defun eieio--defmethod (method kind argclass code) |
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index a05bd7cc4d4..bca40ab87da 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el | |||
| @@ -160,6 +160,10 @@ This is used to determine if `eldoc-idle-delay' is changed by the user.") | |||
| 160 | It should receive the same arguments as `message'.") | 160 | It should receive the same arguments as `message'.") |
| 161 | 161 | ||
| 162 | (defun eldoc-edit-message-commands () | 162 | (defun eldoc-edit-message-commands () |
| 163 | "Return an obarray containing common editing commands. | ||
| 164 | |||
| 165 | When `eldoc-print-after-edit' is non-nil, ElDoc messages are only | ||
| 166 | printed after commands contained in this obarray." | ||
| 163 | (let ((cmds (make-vector 31 0)) | 167 | (let ((cmds (make-vector 31 0)) |
| 164 | (re (regexp-opt '("delete" "insert" "edit" "electric" "newline")))) | 168 | (re (regexp-opt '("delete" "insert" "edit" "electric" "newline")))) |
| 165 | (mapatoms (lambda (s) | 169 | (mapatoms (lambda (s) |
| @@ -211,16 +215,21 @@ expression point is on." | |||
| 211 | 215 | ||
| 212 | ;;;###autoload | 216 | ;;;###autoload |
| 213 | (defun turn-on-eldoc-mode () | 217 | (defun turn-on-eldoc-mode () |
| 214 | "Turn on `eldoc-mode' if the buffer has eldoc support enabled. | 218 | "Turn on `eldoc-mode' if the buffer has ElDoc support enabled. |
| 215 | See `eldoc-documentation-function' for more detail." | 219 | See `eldoc-documentation-function' for more detail." |
| 216 | (when (eldoc--supported-p) | 220 | (when (eldoc--supported-p) |
| 217 | (eldoc-mode 1))) | 221 | (eldoc-mode 1))) |
| 218 | 222 | ||
| 219 | (defun eldoc--supported-p () | 223 | (defun eldoc--supported-p () |
| 224 | "Non-nil if an ElDoc function is set for this buffer." | ||
| 220 | (not (memq eldoc-documentation-function '(nil ignore)))) | 225 | (not (memq eldoc-documentation-function '(nil ignore)))) |
| 221 | 226 | ||
| 222 | 227 | ||
| 223 | (defun eldoc-schedule-timer () | 228 | (defun eldoc-schedule-timer () |
| 229 | "Ensure `eldoc-timer' is running. | ||
| 230 | |||
| 231 | If the user has changed `eldoc-idle-delay', update the timer to | ||
| 232 | reflect the change." | ||
| 224 | (or (and eldoc-timer | 233 | (or (and eldoc-timer |
| 225 | (memq eldoc-timer timer-idle-list)) ;FIXME: Why? | 234 | (memq eldoc-timer timer-idle-list)) ;FIXME: Why? |
| 226 | (setq eldoc-timer | 235 | (setq eldoc-timer |
| @@ -229,8 +238,7 @@ See `eldoc-documentation-function' for more detail." | |||
| 229 | (lambda () | 238 | (lambda () |
| 230 | (when (or eldoc-mode | 239 | (when (or eldoc-mode |
| 231 | (and global-eldoc-mode | 240 | (and global-eldoc-mode |
| 232 | (not (memq eldoc-documentation-function | 241 | (eldoc--supported-p))) |
| 233 | '(nil ignore))))) | ||
| 234 | (eldoc-print-current-symbol-info)))))) | 242 | (eldoc-print-current-symbol-info)))))) |
| 235 | 243 | ||
| 236 | ;; If user has changed the idle delay, update the timer. | 244 | ;; If user has changed the idle delay, update the timer. |
| @@ -268,16 +276,19 @@ Otherwise work like `message'." | |||
| 268 | (force-mode-line-update))) | 276 | (force-mode-line-update))) |
| 269 | (apply 'message format-string args))) | 277 | (apply 'message format-string args))) |
| 270 | 278 | ||
| 271 | (defun eldoc-message (&rest args) | 279 | (defun eldoc-message (&optional format-string &rest args) |
| 280 | "Display FORMAT-STRING formatted with ARGS as an ElDoc message. | ||
| 281 | |||
| 282 | Store the message (if any) in `eldoc-last-message', and return it." | ||
| 272 | (let ((omessage eldoc-last-message)) | 283 | (let ((omessage eldoc-last-message)) |
| 273 | (setq eldoc-last-message | 284 | (setq eldoc-last-message |
| 274 | (cond ((eq (car args) eldoc-last-message) eldoc-last-message) | 285 | (cond ((eq format-string eldoc-last-message) eldoc-last-message) |
| 275 | ((null (car args)) nil) | 286 | ((null format-string) nil) |
| 276 | ;; If only one arg, no formatting to do, so put it in | 287 | ;; If only one arg, no formatting to do, so put it in |
| 277 | ;; eldoc-last-message so eq test above might succeed on | 288 | ;; eldoc-last-message so eq test above might succeed on |
| 278 | ;; subsequent calls. | 289 | ;; subsequent calls. |
| 279 | ((null (cdr args)) (car args)) | 290 | ((null args) format-string) |
| 280 | (t (apply #'format-message args)))) | 291 | (t (apply #'format-message format-string args)))) |
| 281 | ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages | 292 | ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages |
| 282 | ;; are recorded in a log. Do not put eldoc messages in that log since | 293 | ;; are recorded in a log. Do not put eldoc messages in that log since |
| 283 | ;; they are Legion. | 294 | ;; they are Legion. |
| @@ -289,6 +300,7 @@ Otherwise work like `message'." | |||
| 289 | eldoc-last-message) | 300 | eldoc-last-message) |
| 290 | 301 | ||
| 291 | (defun eldoc--message-command-p (command) | 302 | (defun eldoc--message-command-p (command) |
| 303 | "Return non-nil if COMMAND is in `eldoc-message-commands'." | ||
| 292 | (and (symbolp command) | 304 | (and (symbolp command) |
| 293 | (intern-soft (symbol-name command) eldoc-message-commands))) | 305 | (intern-soft (symbol-name command) eldoc-message-commands))) |
| 294 | 306 | ||
| @@ -299,6 +311,7 @@ Otherwise work like `message'." | |||
| 299 | ;; before the next command executes, which does away with the flicker. | 311 | ;; before the next command executes, which does away with the flicker. |
| 300 | ;; This doesn't seem to be required for Emacs 19.28 and earlier. | 312 | ;; This doesn't seem to be required for Emacs 19.28 and earlier. |
| 301 | (defun eldoc-pre-command-refresh-echo-area () | 313 | (defun eldoc-pre-command-refresh-echo-area () |
| 314 | "Reprint `eldoc-last-message' in the echo area." | ||
| 302 | (and eldoc-last-message | 315 | (and eldoc-last-message |
| 303 | (not (minibufferp)) ;We don't use the echo area when in minibuffer. | 316 | (not (minibufferp)) ;We don't use the echo area when in minibuffer. |
| 304 | (if (and (eldoc-display-message-no-interference-p) | 317 | (if (and (eldoc-display-message-no-interference-p) |
| @@ -310,6 +323,7 @@ Otherwise work like `message'." | |||
| 310 | 323 | ||
| 311 | ;; Decide whether now is a good time to display a message. | 324 | ;; Decide whether now is a good time to display a message. |
| 312 | (defun eldoc-display-message-p () | 325 | (defun eldoc-display-message-p () |
| 326 | "Return non-nil when it is appropriate to display an ElDoc message." | ||
| 313 | (and (eldoc-display-message-no-interference-p) | 327 | (and (eldoc-display-message-no-interference-p) |
| 314 | ;; If this-command is non-nil while running via an idle | 328 | ;; If this-command is non-nil while running via an idle |
| 315 | ;; timer, we're still in the middle of executing a command, | 329 | ;; timer, we're still in the middle of executing a command, |
| @@ -322,6 +336,7 @@ Otherwise work like `message'." | |||
| 322 | ;; Check various conditions about the current environment that might make | 336 | ;; Check various conditions about the current environment that might make |
| 323 | ;; it undesirable to print eldoc messages right this instant. | 337 | ;; it undesirable to print eldoc messages right this instant. |
| 324 | (defun eldoc-display-message-no-interference-p () | 338 | (defun eldoc-display-message-no-interference-p () |
| 339 | "Return nil if displaying a message would cause interference." | ||
| 325 | (not (or executing-kbd-macro (bound-and-true-p edebug-active)))) | 340 | (not (or executing-kbd-macro (bound-and-true-p edebug-active)))) |
| 326 | 341 | ||
| 327 | 342 | ||
| @@ -347,6 +362,7 @@ variable) is taken into account if the major mode specific function does not | |||
| 347 | return any documentation.") | 362 | return any documentation.") |
| 348 | 363 | ||
| 349 | (defun eldoc-print-current-symbol-info () | 364 | (defun eldoc-print-current-symbol-info () |
| 365 | "Print the text produced by `eldoc-documentation-function'." | ||
| 350 | ;; This is run from post-command-hook or some idle timer thing, | 366 | ;; This is run from post-command-hook or some idle timer thing, |
| 351 | ;; so we need to be careful that errors aren't ignored. | 367 | ;; so we need to be careful that errors aren't ignored. |
| 352 | (with-demoted-errors "eldoc error: %s" | 368 | (with-demoted-errors "eldoc error: %s" |
| @@ -361,6 +377,13 @@ return any documentation.") | |||
| 361 | ;; truncated or eliminated entirely from the output to make room for the | 377 | ;; truncated or eliminated entirely from the output to make room for the |
| 362 | ;; description. | 378 | ;; description. |
| 363 | (defun eldoc-docstring-format-sym-doc (prefix doc &optional face) | 379 | (defun eldoc-docstring-format-sym-doc (prefix doc &optional face) |
| 380 | "Combine PREFIX and DOC, and shorten the result to fit in the echo area. | ||
| 381 | |||
| 382 | When PREFIX is a symbol, propertize its symbol name with FACE | ||
| 383 | before combining it with DOC. If FACE is not provided, just | ||
| 384 | apply the nil face. | ||
| 385 | |||
| 386 | See also: `eldoc-echo-area-use-multiline-p'." | ||
| 364 | (when (symbolp prefix) | 387 | (when (symbolp prefix) |
| 365 | (setq prefix (concat (propertize (symbol-name prefix) 'face face) ": "))) | 388 | (setq prefix (concat (propertize (symbol-name prefix) 'face face) ": "))) |
| 366 | (let* ((ea-multi eldoc-echo-area-use-multiline-p) | 389 | (let* ((ea-multi eldoc-echo-area-use-multiline-p) |
| @@ -390,22 +413,26 @@ return any documentation.") | |||
| 390 | ;; These functions do display-command table management. | 413 | ;; These functions do display-command table management. |
| 391 | 414 | ||
| 392 | (defun eldoc-add-command (&rest cmds) | 415 | (defun eldoc-add-command (&rest cmds) |
| 416 | "Add each of CMDS to the obarray `eldoc-message-commands'." | ||
| 393 | (dolist (name cmds) | 417 | (dolist (name cmds) |
| 394 | (and (symbolp name) | 418 | (and (symbolp name) |
| 395 | (setq name (symbol-name name))) | 419 | (setq name (symbol-name name))) |
| 396 | (set (intern name eldoc-message-commands) t))) | 420 | (set (intern name eldoc-message-commands) t))) |
| 397 | 421 | ||
| 398 | (defun eldoc-add-command-completions (&rest names) | 422 | (defun eldoc-add-command-completions (&rest names) |
| 423 | "Pass every prefix completion of NAMES to `eldoc-add-command'." | ||
| 399 | (dolist (name names) | 424 | (dolist (name names) |
| 400 | (apply #'eldoc-add-command (all-completions name obarray 'commandp)))) | 425 | (apply #'eldoc-add-command (all-completions name obarray 'commandp)))) |
| 401 | 426 | ||
| 402 | (defun eldoc-remove-command (&rest cmds) | 427 | (defun eldoc-remove-command (&rest cmds) |
| 428 | "Remove each of CMDS from the obarray `eldoc-message-commands'." | ||
| 403 | (dolist (name cmds) | 429 | (dolist (name cmds) |
| 404 | (and (symbolp name) | 430 | (and (symbolp name) |
| 405 | (setq name (symbol-name name))) | 431 | (setq name (symbol-name name))) |
| 406 | (unintern name eldoc-message-commands))) | 432 | (unintern name eldoc-message-commands))) |
| 407 | 433 | ||
| 408 | (defun eldoc-remove-command-completions (&rest names) | 434 | (defun eldoc-remove-command-completions (&rest names) |
| 435 | "Pass every prefix completion of NAMES to `eldoc-remove-command'." | ||
| 409 | (dolist (name names) | 436 | (dolist (name names) |
| 410 | (apply #'eldoc-remove-command | 437 | (apply #'eldoc-remove-command |
| 411 | (all-completions name eldoc-message-commands)))) | 438 | (all-completions name eldoc-message-commands)))) |
| @@ -418,9 +445,9 @@ return any documentation.") | |||
| 418 | "down-list" "end-of-" "exchange-point-and-mark" "forward-" "goto-" | 445 | "down-list" "end-of-" "exchange-point-and-mark" "forward-" "goto-" |
| 419 | "handle-select-window" "indent-for-tab-command" "left-" "mark-page" | 446 | "handle-select-window" "indent-for-tab-command" "left-" "mark-page" |
| 420 | "mark-paragraph" "mouse-set-point" "move-" "move-beginning-of-" | 447 | "mark-paragraph" "mouse-set-point" "move-" "move-beginning-of-" |
| 421 | "move-end-of-" "newline" "next-" "other-window" "pop-global-mark" "previous-" | 448 | "move-end-of-" "newline" "next-" "other-window" "pop-global-mark" |
| 422 | "recenter" "right-" "scroll-" "self-insert-command" "split-window-" | 449 | "previous-" "recenter" "right-" "scroll-" "self-insert-command" |
| 423 | "up-list") | 450 | "split-window-" "up-list") |
| 424 | 451 | ||
| 425 | (provide 'eldoc) | 452 | (provide 'eldoc) |
| 426 | 453 | ||
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index d4500f131a2..7bdd749d5ab 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el | |||
| @@ -583,6 +583,11 @@ displayed." | |||
| 583 | (elp-restore-all) | 583 | (elp-restore-all) |
| 584 | ;; continue standard unloading | 584 | ;; continue standard unloading |
| 585 | nil) | 585 | nil) |
| 586 | |||
| 587 | (cl-defmethod loadhist-unload-element :before :extra "elp" ((x (head defun))) | ||
| 588 | "Un-instrument before unloading a function." | ||
| 589 | (elp-restore-function (cdr x))) | ||
| 590 | |||
| 586 | 591 | ||
| 587 | (provide 'elp) | 592 | (provide 'elp) |
| 588 | 593 | ||
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index cee225cc8e0..d7bd331c11b 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -135,7 +135,7 @@ Emacs bug 6581 at URL `http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6581'." | |||
| 135 | ;; Note that nil is still a valid value for the `name' slot in | 135 | ;; Note that nil is still a valid value for the `name' slot in |
| 136 | ;; ert-test objects. It designates an anonymous test. | 136 | ;; ert-test objects. It designates an anonymous test. |
| 137 | (error "Attempt to define a test named nil")) | 137 | (error "Attempt to define a test named nil")) |
| 138 | (put symbol 'ert--test definition) | 138 | (define-symbol-prop symbol 'ert--test definition) |
| 139 | definition) | 139 | definition) |
| 140 | 140 | ||
| 141 | (defun ert-make-test-unbound (symbol) | 141 | (defun ert-make-test-unbound (symbol) |
| @@ -214,12 +214,6 @@ description of valid values for RESULT-TYPE. | |||
| 214 | ,@(when tags-supplied-p | 214 | ,@(when tags-supplied-p |
| 215 | `(:tags ,tags)) | 215 | `(:tags ,tags)) |
| 216 | :body (lambda () ,@body))) | 216 | :body (lambda () ,@body))) |
| 217 | ;; This hack allows `symbol-file' to associate `ert-deftest' | ||
| 218 | ;; forms with files, and therefore enables `find-function' to | ||
| 219 | ;; work with tests. However, it leads to warnings in | ||
| 220 | ;; `unload-feature', which doesn't know how to undefine tests | ||
| 221 | ;; and has no mechanism for extension. | ||
| 222 | (push '(ert-deftest . ,name) current-load-list) | ||
| 223 | ',name)))) | 217 | ',name)))) |
| 224 | 218 | ||
| 225 | ;; We use these `put' forms in addition to the (declare (indent)) in | 219 | ;; We use these `put' forms in addition to the (declare (indent)) in |
| @@ -2405,8 +2399,7 @@ To be used in the ERT results buffer." | |||
| 2405 | (buffer-disable-undo) | 2399 | (buffer-disable-undo) |
| 2406 | (erase-buffer) | 2400 | (erase-buffer) |
| 2407 | (ert-simple-view-mode) | 2401 | (ert-simple-view-mode) |
| 2408 | ;; Use unibyte because `debugger-setup-buffer' also does so. | 2402 | (set-buffer-multibyte t) ; mimic debugger-setup-buffer |
| 2409 | (set-buffer-multibyte nil) | ||
| 2410 | (setq truncate-lines t) | 2403 | (setq truncate-lines t) |
| 2411 | (ert--print-backtrace backtrace t) | 2404 | (ert--print-backtrace backtrace t) |
| 2412 | (goto-char (point-min)) | 2405 | (goto-char (point-min)) |
| @@ -2539,7 +2532,7 @@ To be used in the ERT results buffer." | |||
| 2539 | (insert (if test-name (format "%S" test-name) "<anonymous test>")) | 2532 | (insert (if test-name (format "%S" test-name) "<anonymous test>")) |
| 2540 | (insert " is a test") | 2533 | (insert " is a test") |
| 2541 | (let ((file-name (and test-name | 2534 | (let ((file-name (and test-name |
| 2542 | (symbol-file test-name 'ert-deftest)))) | 2535 | (symbol-file test-name 'ert--test)))) |
| 2543 | (when file-name | 2536 | (when file-name |
| 2544 | (insert (format-message " defined in `%s'" | 2537 | (insert (format-message " defined in `%s'" |
| 2545 | (file-name-nondirectory file-name))) | 2538 | (file-name-nondirectory file-name))) |
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 4a06ab25d3e..253b60e7534 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el | |||
| @@ -418,8 +418,8 @@ to this macro." | |||
| 418 | (when decl (setq body (remove decl body))) | 418 | (when decl (setq body (remove decl body))) |
| 419 | `(progn | 419 | `(progn |
| 420 | (defun ,fsym ,args ,@body) | 420 | (defun ,fsym ,args ,@body) |
| 421 | (put ',fsym 'edebug-form-spec ',(cadr (assq 'debug decl))) | 421 | (define-symbol-prop ',fsym 'edebug-form-spec ',(cadr (assq 'debug decl))) |
| 422 | (put ',name 'pcase-macroexpander #',fsym)))) | 422 | (define-symbol-prop ',name 'pcase-macroexpander #',fsym)))) |
| 423 | 423 | ||
| 424 | (defun pcase--match (val upat) | 424 | (defun pcase--match (val upat) |
| 425 | "Build a MATCH structure, hoisting all `or's and `and's outside." | 425 | "Build a MATCH structure, hoisting all `or's and `and's outside." |
| @@ -930,6 +930,5 @@ QPAT can take the following forms: | |||
| 930 | ((or (stringp qpat) (integerp qpat) (symbolp qpat)) `',qpat) | 930 | ((or (stringp qpat) (integerp qpat) (symbolp qpat)) `',qpat) |
| 931 | (t (error "Unknown QPAT: %S" qpat)))) | 931 | (t (error "Unknown QPAT: %S" qpat)))) |
| 932 | 932 | ||
| 933 | |||
| 934 | (provide 'pcase) | 933 | (provide 'pcase) |
| 935 | ;;; pcase.el ends here | 934 | ;;; pcase.el ends here |
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 386232c6eef..b66f2c6d512 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el | |||
| @@ -1169,6 +1169,62 @@ enclosed in `(and ...)'. | |||
| 1169 | (rx-to-string `(and ,@regexps) t)) | 1169 | (rx-to-string `(and ,@regexps) t)) |
| 1170 | (t | 1170 | (t |
| 1171 | (rx-to-string (car regexps) t)))) | 1171 | (rx-to-string (car regexps) t)))) |
| 1172 | |||
| 1173 | |||
| 1174 | (pcase-defmacro rx (&rest regexps) | ||
| 1175 | "Build a `pcase' pattern matching `rx' regexps. | ||
| 1176 | The REGEXPS are interpreted as by `rx'. The pattern matches if | ||
| 1177 | the regular expression so constructed matches the object, as if | ||
| 1178 | by `string-match'. | ||
| 1179 | |||
| 1180 | In addition to the usual `rx' constructs, REGEXPS can contain the | ||
| 1181 | following constructs: | ||
| 1182 | |||
| 1183 | (let VAR FORM...) creates a new explicitly numbered submatch | ||
| 1184 | that matches FORM and binds the match to | ||
| 1185 | VAR. | ||
| 1186 | (backref VAR) creates a backreference to the submatch | ||
| 1187 | introduced by a previous (let VAR ...) | ||
| 1188 | construct. | ||
| 1189 | |||
| 1190 | The VARs are associated with explicitly numbered submatches | ||
| 1191 | starting from 1. Multiple occurrences of the same VAR refer to | ||
| 1192 | the same submatch. | ||
| 1193 | |||
| 1194 | If a case matches, the match data is modified as usual so you can | ||
| 1195 | use it in the case body, but you still have to pass the correct | ||
| 1196 | string as argument to `match-string'." | ||
| 1197 | (let* ((vars ()) | ||
| 1198 | (rx-constituents | ||
| 1199 | `((let | ||
| 1200 | ,(lambda (form) | ||
| 1201 | (rx-check form) | ||
| 1202 | (let ((var (cadr form))) | ||
| 1203 | (cl-check-type var symbol) | ||
| 1204 | (let ((i (or (cl-position var vars :test #'eq) | ||
| 1205 | (prog1 (length vars) | ||
| 1206 | (setq vars `(,@vars ,var)))))) | ||
| 1207 | (rx-form `(submatch-n ,(1+ i) ,@(cddr form)))))) | ||
| 1208 | 1 nil) | ||
| 1209 | (backref | ||
| 1210 | ,(lambda (form) | ||
| 1211 | (rx-check form) | ||
| 1212 | (rx-backref | ||
| 1213 | `(backref ,(let ((var (cadr form))) | ||
| 1214 | (if (integerp var) var | ||
| 1215 | (1+ (cl-position var vars :test #'eq))))))) | ||
| 1216 | 1 1 | ||
| 1217 | ,(lambda (var) | ||
| 1218 | (cond ((integerp var) (rx-check-backref var)) | ||
| 1219 | ((memq var vars) t) | ||
| 1220 | (t (error "rx `backref' variable must be one of %s: %s" | ||
| 1221 | vars var))))) | ||
| 1222 | ,@rx-constituents)) | ||
| 1223 | (regexp (rx-to-string `(seq ,@regexps) :no-group))) | ||
| 1224 | `(and (pred (string-match ,regexp)) | ||
| 1225 | ,@(cl-loop for i from 1 | ||
| 1226 | for var in vars | ||
| 1227 | collect `(app (match-string ,i) ,var))))) | ||
| 1172 | 1228 | ||
| 1173 | ;; ;; sregex.el replacement | 1229 | ;; ;; sregex.el replacement |
| 1174 | 1230 | ||
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index 79799db30bc..4a5adc48f2b 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el | |||
| @@ -65,17 +65,19 @@ This is useful for enabling human-readable format (-h), for example." | |||
| 65 | "If non-nil, use `eshell-ls' to read directories in Dired. | 65 | "If non-nil, use `eshell-ls' to read directories in Dired. |
| 66 | Changing this without using customize has no effect." | 66 | Changing this without using customize has no effect." |
| 67 | :set (lambda (symbol value) | 67 | :set (lambda (symbol value) |
| 68 | (if value | 68 | (cond (value |
| 69 | (advice-add 'insert-directory :around | 69 | (require 'dired) |
| 70 | #'eshell-ls--insert-directory) | 70 | (advice-add 'insert-directory :around |
| 71 | (advice-remove 'insert-directory | 71 | #'eshell-ls--insert-directory) |
| 72 | #'eshell-ls--insert-directory)) | 72 | (advice-add 'dired :around #'eshell-ls--dired)) |
| 73 | (t | ||
| 74 | (advice-remove 'insert-directory | ||
| 75 | #'eshell-ls--insert-directory) | ||
| 76 | (advice-remove 'dired #'eshell-ls--dired))) | ||
| 73 | (set symbol value)) | 77 | (set symbol value)) |
| 74 | :type 'boolean | 78 | :type 'boolean |
| 75 | :require 'em-ls) | 79 | :require 'em-ls) |
| 76 | (add-hook 'eshell-ls-unload-hook | 80 | (add-hook 'eshell-ls-unload-hook #'eshell-ls-unload-function) |
| 77 | (lambda () (advice-remove 'insert-directory | ||
| 78 | #'eshell-ls--insert-directory))) | ||
| 79 | 81 | ||
| 80 | 82 | ||
| 81 | (defcustom eshell-ls-default-blocksize 1024 | 83 | (defcustom eshell-ls-default-blocksize 1024 |
| @@ -279,6 +281,36 @@ instead." | |||
| 279 | eshell-ls-dired-initial-args) | 281 | eshell-ls-dired-initial-args) |
| 280 | (eshell-do-ls (append switches (list file))))))))) | 282 | (eshell-do-ls (append switches (list file))))))))) |
| 281 | 283 | ||
| 284 | (declare-function eshell-extended-glob "em-glob" (glob)) | ||
| 285 | (declare-function dired-read-dir-and-switches "dired" (str)) | ||
| 286 | (declare-function dired-goto-next-file "dired" ()) | ||
| 287 | |||
| 288 | (defun eshell-ls--dired (orig-fun dir-or-list &optional switches) | ||
| 289 | (interactive (dired-read-dir-and-switches "")) | ||
| 290 | (require 'em-glob) | ||
| 291 | (if (consp dir-or-list) | ||
| 292 | (funcall orig-fun dir-or-list switches) | ||
| 293 | (let ((dir-wildcard (insert-directory-wildcard-in-dir-p | ||
| 294 | (expand-file-name dir-or-list)))) | ||
| 295 | (if (not dir-wildcard) | ||
| 296 | (funcall orig-fun dir-or-list switches) | ||
| 297 | (let* ((default-directory (car dir-wildcard)) | ||
| 298 | (files (eshell-extended-glob (cdr dir-wildcard))) | ||
| 299 | (dir (car dir-wildcard))) | ||
| 300 | (if files | ||
| 301 | (let ((inhibit-read-only t) | ||
| 302 | (buf | ||
| 303 | (apply orig-fun | ||
| 304 | (nconc (list dir) files) | ||
| 305 | (and switches (list switches))))) | ||
| 306 | (with-current-buffer buf | ||
| 307 | (save-excursion | ||
| 308 | (goto-char (point-min)) | ||
| 309 | (dired-goto-next-file) | ||
| 310 | (forward-line 0) | ||
| 311 | (insert " wildcard " (cdr dir-wildcard) "\n")))) | ||
| 312 | (user-error "No files matching regexp"))))))) | ||
| 313 | |||
| 282 | (defsubst eshell/ls (&rest args) | 314 | (defsubst eshell/ls (&rest args) |
| 283 | "An alias version of `eshell-do-ls'." | 315 | "An alias version of `eshell-do-ls'." |
| 284 | (let ((insert-func 'eshell-buffered-print) | 316 | (let ((insert-func 'eshell-buffered-print) |
| @@ -909,6 +941,11 @@ to use, and each member of which is the width of that column | |||
| 909 | (car file))))) | 941 | (car file))))) |
| 910 | (car file)) | 942 | (car file)) |
| 911 | 943 | ||
| 944 | (defun eshell-ls-unload-function () | ||
| 945 | (advice-remove 'insert-directory #'eshell-ls--insert-directory) | ||
| 946 | (advice-remove 'dired #'eshell-ls--dired) | ||
| 947 | nil) | ||
| 948 | |||
| 912 | (provide 'em-ls) | 949 | (provide 'em-ls) |
| 913 | 950 | ||
| 914 | ;; Local Variables: | 951 | ;; Local Variables: |
diff --git a/lisp/faces.el b/lisp/faces.el index 97c32165b9c..c0c1c7b59f0 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -104,7 +104,9 @@ a font height that isn't optimal." | |||
| 104 | ;; when combined with Monospaced and with other standard fonts. | 104 | ;; when combined with Monospaced and with other standard fonts. |
| 105 | ;; One of its uses is for 'tex-verbatim' and 'Info-quoted' faces, | 105 | ;; One of its uses is for 'tex-verbatim' and 'Info-quoted' faces, |
| 106 | ;; so the result must be different from the default face's font, | 106 | ;; so the result must be different from the default face's font, |
| 107 | ;; and must be monospaced. | 107 | ;; and must be monospaced. For 'tex-verbatim', it is desirable |
| 108 | ;; that the font really is a Serif font, so as to look like | ||
| 109 | ;; TeX's 'verbatim'. | ||
| 108 | ("Monospace Serif" | 110 | ("Monospace Serif" |
| 109 | 111 | ||
| 110 | ;; This looks good on GNU/Linux. | 112 | ;; This looks good on GNU/Linux. |
diff --git a/lisp/files.el b/lisp/files.el index 2f3efa33c28..96647fb2626 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -978,12 +978,15 @@ or mount points potentially requiring authentication as a different user.") | |||
| 978 | ;; nil))) | 978 | ;; nil))) |
| 979 | 979 | ||
| 980 | (defun locate-dominating-file (file name) | 980 | (defun locate-dominating-file (file name) |
| 981 | "Look up the directory hierarchy from FILE for a directory containing NAME. | 981 | "Starting from FILE, look up directory hierarchy for directory containing NAME. |
| 982 | FILE can be a file or a directory. If it's a file, its directory will | ||
| 983 | serve as the starting point for searching the hierarchy of directories. | ||
| 982 | Stop at the first parent directory containing a file NAME, | 984 | Stop at the first parent directory containing a file NAME, |
| 983 | and return the directory. Return nil if not found. | 985 | and return the directory. Return nil if not found. |
| 984 | Instead of a string, NAME can also be a predicate taking one argument | 986 | Instead of a string, NAME can also be a predicate taking one argument |
| 985 | \(a directory) and returning a non-nil value if that directory is the one for | 987 | \(a directory) and returning a non-nil value if that directory is the one for |
| 986 | which we're looking." | 988 | which we're looking. The predicate will be called with every file/directory |
| 989 | the function needs to examine, starting with FILE." | ||
| 987 | ;; We used to use the above locate-dominating-files code, but the | 990 | ;; We used to use the above locate-dominating-files code, but the |
| 988 | ;; directory-files call is very costly, so we're much better off doing | 991 | ;; directory-files call is very costly, so we're much better off doing |
| 989 | ;; multiple calls using the code in here. | 992 | ;; multiple calls using the code in here. |
| @@ -1596,8 +1599,8 @@ automatically choosing a major mode, use \\[find-file-literally]." | |||
| 1596 | (confirm-nonexistent-file-or-buffer))) | 1599 | (confirm-nonexistent-file-or-buffer))) |
| 1597 | (let ((value (find-file-noselect filename nil nil wildcards))) | 1600 | (let ((value (find-file-noselect filename nil nil wildcards))) |
| 1598 | (if (listp value) | 1601 | (if (listp value) |
| 1599 | (mapcar 'switch-to-buffer (nreverse value)) | 1602 | (mapcar 'pop-to-buffer-same-window (nreverse value)) |
| 1600 | (switch-to-buffer value)))) | 1603 | (pop-to-buffer-same-window value)))) |
| 1601 | 1604 | ||
| 1602 | (defun find-file-other-window (filename &optional wildcards) | 1605 | (defun find-file-other-window (filename &optional wildcards) |
| 1603 | "Edit file FILENAME, in another window. | 1606 | "Edit file FILENAME, in another window. |
| @@ -2543,7 +2546,7 @@ since only a single case-insensitive search through the alist is made." | |||
| 2543 | ("\\.[ckz]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode) | 2546 | ("\\.[ckz]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode) |
| 2544 | ("\\.bash\\'" . sh-mode) | 2547 | ("\\.bash\\'" . sh-mode) |
| 2545 | ("\\(/\\|\\`\\)\\.\\(bash_\\(profile\\|history\\|log\\(in\\|out\\)\\)\\|z?log\\(in\\|out\\)\\)\\'" . sh-mode) | 2548 | ("\\(/\\|\\`\\)\\.\\(bash_\\(profile\\|history\\|log\\(in\\|out\\)\\)\\|z?log\\(in\\|out\\)\\)\\'" . sh-mode) |
| 2546 | ("\\(/\\|\\`\\)\\.\\(shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) | 2549 | ("\\(/\\|\\`\\)\\.\\(shrc\\|zshrc\\|m?kshrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) |
| 2547 | ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) | 2550 | ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) |
| 2548 | ("\\.m?spec\\'" . sh-mode) | 2551 | ("\\.m?spec\\'" . sh-mode) |
| 2549 | ("\\.m[mes]\\'" . nroff-mode) | 2552 | ("\\.m[mes]\\'" . nroff-mode) |
| @@ -6552,6 +6555,75 @@ regardless of the language.") | |||
| 6552 | 6555 | ||
| 6553 | (defvar insert-directory-ls-version 'unknown) | 6556 | (defvar insert-directory-ls-version 'unknown) |
| 6554 | 6557 | ||
| 6558 | (defun insert-directory-wildcard-in-dir-p (dir) | ||
| 6559 | "Return non-nil if DIR contents a shell wildcard in the directory part. | ||
| 6560 | The return value is a cons (DIR . WILDCARDS); DIR is the | ||
| 6561 | `default-directory' in the Dired buffer, and WILDCARDS are the wildcards. | ||
| 6562 | |||
| 6563 | Valid wildcards are '*', '?', '[abc]' and '[a-z]'." | ||
| 6564 | (let ((wildcards "[?*")) | ||
| 6565 | (when (and (or (not (featurep 'ls-lisp)) | ||
| 6566 | ls-lisp-support-shell-wildcards) | ||
| 6567 | (string-match (concat "[" wildcards "]") (file-name-directory dir)) | ||
| 6568 | (not (file-exists-p dir))) ; Prefer an existing file to wildcards. | ||
| 6569 | (let ((regexp (format "\\`\\([^%s]+/\\)\\([^%s]*[%s].*\\)" | ||
| 6570 | wildcards wildcards wildcards))) | ||
| 6571 | (string-match regexp dir) | ||
| 6572 | (cons (match-string 1 dir) (match-string 2 dir)))))) | ||
| 6573 | |||
| 6574 | (defun insert-directory-clean (beg switches) | ||
| 6575 | (when (if (stringp switches) | ||
| 6576 | (string-match "--dired\\>" switches) | ||
| 6577 | (member "--dired" switches)) | ||
| 6578 | ;; The following overshoots by one line for an empty | ||
| 6579 | ;; directory listed with "--dired", but without "-a" | ||
| 6580 | ;; switch, where the ls output contains a | ||
| 6581 | ;; "//DIRED-OPTIONS//" line, but no "//DIRED//" line. | ||
| 6582 | ;; We take care of that case later. | ||
| 6583 | (forward-line -2) | ||
| 6584 | (when (looking-at "//SUBDIRED//") | ||
| 6585 | (delete-region (point) (progn (forward-line 1) (point))) | ||
| 6586 | (forward-line -1)) | ||
| 6587 | (if (looking-at "//DIRED//") | ||
| 6588 | (let ((end (line-end-position)) | ||
| 6589 | (linebeg (point)) | ||
| 6590 | error-lines) | ||
| 6591 | ;; Find all the lines that are error messages, | ||
| 6592 | ;; and record the bounds of each one. | ||
| 6593 | (goto-char beg) | ||
| 6594 | (while (< (point) linebeg) | ||
| 6595 | (or (eql (following-char) ?\s) | ||
| 6596 | (push (list (point) (line-end-position)) error-lines)) | ||
| 6597 | (forward-line 1)) | ||
| 6598 | (setq error-lines (nreverse error-lines)) | ||
| 6599 | ;; Now read the numeric positions of file names. | ||
| 6600 | (goto-char linebeg) | ||
| 6601 | (forward-word-strictly 1) | ||
| 6602 | (forward-char 3) | ||
| 6603 | (while (< (point) end) | ||
| 6604 | (let ((start (insert-directory-adj-pos | ||
| 6605 | (+ beg (read (current-buffer))) | ||
| 6606 | error-lines)) | ||
| 6607 | (end (insert-directory-adj-pos | ||
| 6608 | (+ beg (read (current-buffer))) | ||
| 6609 | error-lines))) | ||
| 6610 | (if (memq (char-after end) '(?\n ?\s)) | ||
| 6611 | ;; End is followed by \n or by " -> ". | ||
| 6612 | (put-text-property start end 'dired-filename t) | ||
| 6613 | ;; It seems that we can't trust ls's output as to | ||
| 6614 | ;; byte positions of filenames. | ||
| 6615 | (put-text-property beg (point) 'dired-filename nil) | ||
| 6616 | (end-of-line)))) | ||
| 6617 | (goto-char end) | ||
| 6618 | (beginning-of-line) | ||
| 6619 | (delete-region (point) (progn (forward-line 1) (point)))) | ||
| 6620 | ;; Take care of the case where the ls output contains a | ||
| 6621 | ;; "//DIRED-OPTIONS//"-line, but no "//DIRED//"-line | ||
| 6622 | ;; and we went one line too far back (see above). | ||
| 6623 | (forward-line 1)) | ||
| 6624 | (if (looking-at "//DIRED-OPTIONS//") | ||
| 6625 | (delete-region (point) (progn (forward-line 1) (point)))))) | ||
| 6626 | |||
| 6555 | ;; insert-directory | 6627 | ;; insert-directory |
| 6556 | ;; - must insert _exactly_one_line_ describing FILE if WILDCARD and | 6628 | ;; - must insert _exactly_one_line_ describing FILE if WILDCARD and |
| 6557 | ;; FULL-DIRECTORY-P is nil. | 6629 | ;; FULL-DIRECTORY-P is nil. |
| @@ -6611,13 +6683,19 @@ normally equivalent short `-D' option is just passed on to | |||
| 6611 | default-file-name-coding-system)))) | 6683 | default-file-name-coding-system)))) |
| 6612 | (setq result | 6684 | (setq result |
| 6613 | (if wildcard | 6685 | (if wildcard |
| 6614 | ;; Run ls in the directory part of the file pattern | 6686 | ;; If the wildcard is just in the file part, then run ls in |
| 6615 | ;; using the last component as argument. | 6687 | ;; the directory part of the file pattern using the last |
| 6616 | (let ((default-directory | 6688 | ;; component as argument. Otherwise, run ls in the longest |
| 6617 | (if (file-name-absolute-p file) | 6689 | ;; subdirectory of the directory part free of wildcards; use |
| 6618 | (file-name-directory file) | 6690 | ;; the remaining of the file pattern as argument. |
| 6619 | (file-name-directory (expand-file-name file)))) | 6691 | (let* ((dir-wildcard (insert-directory-wildcard-in-dir-p file)) |
| 6620 | (pattern (file-name-nondirectory file))) | 6692 | (default-directory |
| 6693 | (cond (dir-wildcard (car dir-wildcard)) | ||
| 6694 | (t | ||
| 6695 | (if (file-name-absolute-p file) | ||
| 6696 | (file-name-directory file) | ||
| 6697 | (file-name-directory (expand-file-name file)))))) | ||
| 6698 | (pattern (if dir-wildcard (cdr dir-wildcard) (file-name-nondirectory file)))) | ||
| 6621 | ;; NB since switches is passed to the shell, be | 6699 | ;; NB since switches is passed to the shell, be |
| 6622 | ;; careful of malicious values, eg "-l;reboot". | 6700 | ;; careful of malicious values, eg "-l;reboot". |
| 6623 | ;; See eg dired-safe-switches-p. | 6701 | ;; See eg dired-safe-switches-p. |
| @@ -6665,7 +6743,8 @@ normally equivalent short `-D' option is just passed on to | |||
| 6665 | (setq file (expand-file-name file))) | 6743 | (setq file (expand-file-name file))) |
| 6666 | (list | 6744 | (list |
| 6667 | (if full-directory-p | 6745 | (if full-directory-p |
| 6668 | (concat (file-name-as-directory file) ".") | 6746 | ;; (concat (file-name-as-directory file) ".") |
| 6747 | file | ||
| 6669 | file)))))))) | 6748 | file)))))))) |
| 6670 | 6749 | ||
| 6671 | ;; If we got "//DIRED//" in the output, it means we got a real | 6750 | ;; If we got "//DIRED//" in the output, it means we got a real |
| @@ -6736,59 +6815,7 @@ normally equivalent short `-D' option is just passed on to | |||
| 6736 | ;; Unix. Access the file to get a suitable error. | 6815 | ;; Unix. Access the file to get a suitable error. |
| 6737 | (access-file file "Reading directory") | 6816 | (access-file file "Reading directory") |
| 6738 | (error "Listing directory failed but `access-file' worked"))) | 6817 | (error "Listing directory failed but `access-file' worked"))) |
| 6739 | 6818 | (insert-directory-clean beg switches) | |
| 6740 | (when (if (stringp switches) | ||
| 6741 | (string-match "--dired\\>" switches) | ||
| 6742 | (member "--dired" switches)) | ||
| 6743 | ;; The following overshoots by one line for an empty | ||
| 6744 | ;; directory listed with "--dired", but without "-a" | ||
| 6745 | ;; switch, where the ls output contains a | ||
| 6746 | ;; "//DIRED-OPTIONS//" line, but no "//DIRED//" line. | ||
| 6747 | ;; We take care of that case later. | ||
| 6748 | (forward-line -2) | ||
| 6749 | (when (looking-at "//SUBDIRED//") | ||
| 6750 | (delete-region (point) (progn (forward-line 1) (point))) | ||
| 6751 | (forward-line -1)) | ||
| 6752 | (if (looking-at "//DIRED//") | ||
| 6753 | (let ((end (line-end-position)) | ||
| 6754 | (linebeg (point)) | ||
| 6755 | error-lines) | ||
| 6756 | ;; Find all the lines that are error messages, | ||
| 6757 | ;; and record the bounds of each one. | ||
| 6758 | (goto-char beg) | ||
| 6759 | (while (< (point) linebeg) | ||
| 6760 | (or (eql (following-char) ?\s) | ||
| 6761 | (push (list (point) (line-end-position)) error-lines)) | ||
| 6762 | (forward-line 1)) | ||
| 6763 | (setq error-lines (nreverse error-lines)) | ||
| 6764 | ;; Now read the numeric positions of file names. | ||
| 6765 | (goto-char linebeg) | ||
| 6766 | (forward-word-strictly 1) | ||
| 6767 | (forward-char 3) | ||
| 6768 | (while (< (point) end) | ||
| 6769 | (let ((start (insert-directory-adj-pos | ||
| 6770 | (+ beg (read (current-buffer))) | ||
| 6771 | error-lines)) | ||
| 6772 | (end (insert-directory-adj-pos | ||
| 6773 | (+ beg (read (current-buffer))) | ||
| 6774 | error-lines))) | ||
| 6775 | (if (memq (char-after end) '(?\n ?\s)) | ||
| 6776 | ;; End is followed by \n or by " -> ". | ||
| 6777 | (put-text-property start end 'dired-filename t) | ||
| 6778 | ;; It seems that we can't trust ls's output as to | ||
| 6779 | ;; byte positions of filenames. | ||
| 6780 | (put-text-property beg (point) 'dired-filename nil) | ||
| 6781 | (end-of-line)))) | ||
| 6782 | (goto-char end) | ||
| 6783 | (beginning-of-line) | ||
| 6784 | (delete-region (point) (progn (forward-line 1) (point)))) | ||
| 6785 | ;; Take care of the case where the ls output contains a | ||
| 6786 | ;; "//DIRED-OPTIONS//"-line, but no "//DIRED//"-line | ||
| 6787 | ;; and we went one line too far back (see above). | ||
| 6788 | (forward-line 1)) | ||
| 6789 | (if (looking-at "//DIRED-OPTIONS//") | ||
| 6790 | (delete-region (point) (progn (forward-line 1) (point))))) | ||
| 6791 | |||
| 6792 | ;; Now decode what read if necessary. | 6819 | ;; Now decode what read if necessary. |
| 6793 | (let ((coding (or coding-system-for-read | 6820 | (let ((coding (or coding-system-for-read |
| 6794 | file-name-coding-system | 6821 | file-name-coding-system |
diff --git a/lisp/find-dired.el b/lisp/find-dired.el index a92d477e1e0..2292b5f32d4 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; find-dired.el --- run a `find' command and dired the output | 1 | ;;; find-dired.el --- run a `find' command and dired the output -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992, 1994-1995, 2000-2017 Free Software Foundation, | 3 | ;; Copyright (C) 1992, 1994-1995, 2000-2017 Free Software Foundation, |
| 4 | ;; Inc. | 4 | ;; Inc. |
diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el index e9f844487bc..a795211f4fe 100644 --- a/lisp/find-lisp.el +++ b/lisp/find-lisp.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; find-lisp.el --- emulation of find in Emacs Lisp | 1 | ;;; find-lisp.el --- emulation of find in Emacs Lisp -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Author: Peter Breton | 3 | ;; Author: Peter Breton |
| 4 | ;; Created: Fri Mar 26 1999 | 4 | ;; Created: Fri Mar 26 1999 |
diff --git a/lisp/frame.el b/lisp/frame.el index 99d9159be9e..67b6bb53d87 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -2158,7 +2158,7 @@ To adjust bottom dividers for frames individually, use the frame | |||
| 2158 | parameter `bottom-divider-width'." | 2158 | parameter `bottom-divider-width'." |
| 2159 | :type '(restricted-sexp | 2159 | :type '(restricted-sexp |
| 2160 | :tag "Default width of bottom dividers" | 2160 | :tag "Default width of bottom dividers" |
| 2161 | :match-alternatives (frame-window-divider-width-valid-p)) | 2161 | :match-alternatives (window-divider-width-valid-p)) |
| 2162 | :initialize 'custom-initialize-default | 2162 | :initialize 'custom-initialize-default |
| 2163 | :set (lambda (symbol value) | 2163 | :set (lambda (symbol value) |
| 2164 | (set-default symbol value) | 2164 | (set-default symbol value) |
| @@ -2175,7 +2175,7 @@ To adjust right dividers for frames individually, use the frame | |||
| 2175 | parameter `right-divider-width'." | 2175 | parameter `right-divider-width'." |
| 2176 | :type '(restricted-sexp | 2176 | :type '(restricted-sexp |
| 2177 | :tag "Default width of right dividers" | 2177 | :tag "Default width of right dividers" |
| 2178 | :match-alternatives (frame-window-divider-width-valid-p)) | 2178 | :match-alternatives (window-divider-width-valid-p)) |
| 2179 | :initialize 'custom-initialize-default | 2179 | :initialize 'custom-initialize-default |
| 2180 | :set (lambda (symbol value) | 2180 | :set (lambda (symbol value) |
| 2181 | (set-default symbol value) | 2181 | (set-default symbol value) |
diff --git a/lisp/ido.el b/lisp/ido.el index 07a5bcf7229..defb744201d 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; ido.el --- interactively do things with buffers and files | 1 | ;;; ido.el --- interactively do things with buffers and files -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996-2017 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1996-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 838a492b6cb..2db8061fa4a 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; kmacro.el --- enhanced keyboard macros | 1 | ;;; kmacro.el --- enhanced keyboard macros -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2002-2017 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2002-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -565,7 +565,8 @@ Use \\[kmacro-insert-counter] to insert (and increment) the macro counter. | |||
| 565 | The counter value can be set or modified via \\[kmacro-set-counter] and \\[kmacro-add-counter]. | 565 | The counter value can be set or modified via \\[kmacro-set-counter] and \\[kmacro-add-counter]. |
| 566 | The format of the counter can be modified via \\[kmacro-set-format]. | 566 | The format of the counter can be modified via \\[kmacro-set-format]. |
| 567 | 567 | ||
| 568 | Use \\[kmacro-name-last-macro] to give it a permanent name. | 568 | Use \\[kmacro-name-last-macro] to give it a name that will remain valid even |
| 569 | after another macro is defined. | ||
| 569 | Use \\[kmacro-bind-to-key] to bind it to a key sequence." | 570 | Use \\[kmacro-bind-to-key] to bind it to a key sequence." |
| 570 | (interactive "P") | 571 | (interactive "P") |
| 571 | (if (or defining-kbd-macro executing-kbd-macro) | 572 | (if (or defining-kbd-macro executing-kbd-macro) |
| @@ -628,8 +629,8 @@ just the last key in the key sequence that you used to call this | |||
| 628 | command. See `kmacro-call-repeat-key' and `kmacro-call-repeat-with-arg' | 629 | command. See `kmacro-call-repeat-key' and `kmacro-call-repeat-with-arg' |
| 629 | for details on how to adjust or disable this behavior. | 630 | for details on how to adjust or disable this behavior. |
| 630 | 631 | ||
| 631 | To make a macro permanent so you can call it even after defining | 632 | To give a macro a name so you can call it even after defining others, |
| 632 | others, use \\[kmacro-name-last-macro]." | 633 | use \\[kmacro-name-last-macro]." |
| 633 | (interactive "p") | 634 | (interactive "p") |
| 634 | (let ((repeat-key (and (or (and (null no-repeat) | 635 | (let ((repeat-key (and (or (and (null no-repeat) |
| 635 | (> (length (this-single-command-keys)) 1)) | 636 | (> (length (this-single-command-keys)) 1)) |
| @@ -730,8 +731,8 @@ With \\[universal-argument], call second macro in macro ring." | |||
| 730 | With numeric prefix ARG, repeat macro that many times. | 731 | With numeric prefix ARG, repeat macro that many times. |
| 731 | Zero argument means repeat until there is an error. | 732 | Zero argument means repeat until there is an error. |
| 732 | 733 | ||
| 733 | To give a macro a permanent name, so you can call it | 734 | To give a macro a name, so you can call it even after defining other |
| 734 | even after defining other macros, use \\[kmacro-name-last-macro]." | 735 | macros, use \\[kmacro-name-last-macro]." |
| 735 | (interactive "P") | 736 | (interactive "P") |
| 736 | (if defining-kbd-macro | 737 | (if defining-kbd-macro |
| 737 | (kmacro-end-macro nil)) | 738 | (kmacro-end-macro nil)) |
diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 28d0b18c812..18c30f781f0 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el | |||
| @@ -162,6 +162,70 @@ documentation of `unload-feature' for details.") | |||
| 162 | ;; mode, or proposed is not nil and not major-mode, and so we use it. | 162 | ;; mode, or proposed is not nil and not major-mode, and so we use it. |
| 163 | (funcall (or proposed 'fundamental-mode))))))) | 163 | (funcall (or proposed 'fundamental-mode))))))) |
| 164 | 164 | ||
| 165 | (cl-defgeneric loadhist-unload-element (x) | ||
| 166 | "Unload an element from the `load-history'." | ||
| 167 | (message "Unexpected element %S in load-history" x)) | ||
| 168 | |||
| 169 | ;; In `load-history', the definition of a previously autoloaded | ||
| 170 | ;; function is represented by 2 entries: (t . SYMBOL) comes before | ||
| 171 | ;; (defun . SYMBOL) and says we should restore SYMBOL's autoload when | ||
| 172 | ;; we undefine it. | ||
| 173 | ;; So we use this auxiliary variable to keep track of the last (t . SYMBOL) | ||
| 174 | ;; that occurred. | ||
| 175 | (defvar loadhist--restore-autoload | ||
| 176 | "If non-nil, this is a symbol for which we should | ||
| 177 | restore a previous autoload if possible.") | ||
| 178 | |||
| 179 | (cl-defmethod loadhist-unload-element ((x (head t))) | ||
| 180 | (setq loadhist--restore-autoload (cdr x))) | ||
| 181 | |||
| 182 | (defun loadhist--unload-function (x) | ||
| 183 | (let ((fun (cdr x))) | ||
| 184 | (when (fboundp fun) | ||
| 185 | (when (fboundp 'ad-unadvise) | ||
| 186 | (ad-unadvise fun)) | ||
| 187 | (let ((aload (get fun 'autoload))) | ||
| 188 | (defalias fun | ||
| 189 | (if (and aload (eq fun loadhist--restore-autoload)) | ||
| 190 | (cons 'autoload aload) | ||
| 191 | nil))))) | ||
| 192 | (setq loadhist--restore-autoload nil)) | ||
| 193 | |||
| 194 | (cl-defmethod loadhist-unload-element ((x (head defun))) | ||
| 195 | (loadhist--unload-function x)) | ||
| 196 | (cl-defmethod loadhist-unload-element ((x (head autoload))) | ||
| 197 | (loadhist--unload-function x)) | ||
| 198 | |||
| 199 | (cl-defmethod loadhist-unload-element ((_ (head require))) nil) | ||
| 200 | (cl-defmethod loadhist-unload-element ((_ (head defface))) nil) | ||
| 201 | |||
| 202 | (cl-defmethod loadhist-unload-element ((x (head provide))) | ||
| 203 | ;; Remove any feature names that this file provided. | ||
| 204 | (setq features (delq (cdr x) features))) | ||
| 205 | |||
| 206 | (cl-defmethod loadhist-unload-element ((x symbol)) | ||
| 207 | ;; Kill local values as much as possible. | ||
| 208 | (dolist (buf (buffer-list)) | ||
| 209 | (with-current-buffer buf | ||
| 210 | (if (and (boundp x) (timerp (symbol-value x))) | ||
| 211 | (cancel-timer (symbol-value x))) | ||
| 212 | (kill-local-variable x))) | ||
| 213 | (if (and (boundp x) (timerp (symbol-value x))) | ||
| 214 | (cancel-timer (symbol-value x))) | ||
| 215 | ;; Get rid of the default binding if we can. | ||
| 216 | (unless (local-variable-if-set-p x) | ||
| 217 | (makunbound x))) | ||
| 218 | |||
| 219 | (cl-defmethod loadhist-unload-element ((x (head define-type))) | ||
| 220 | (let* ((name (cdr x))) | ||
| 221 | ;; Remove the struct. | ||
| 222 | (setf (cl--find-class name) nil))) | ||
| 223 | |||
| 224 | (cl-defmethod loadhist-unload-element ((x (head define-symbol-props))) | ||
| 225 | (pcase-dolist (`(,symbol . ,props) (cdr x)) | ||
| 226 | (dolist (prop props) | ||
| 227 | (put symbol prop nil)))) | ||
| 228 | |||
| 165 | ;;;###autoload | 229 | ;;;###autoload |
| 166 | (defun unload-feature (feature &optional force) | 230 | (defun unload-feature (feature &optional force) |
| 167 | "Unload the library that provided FEATURE. | 231 | "Unload the library that provided FEATURE. |
| @@ -200,9 +264,6 @@ something strange, such as redefining an Emacs function." | |||
| 200 | (prin1-to-string dependents) file)))) | 264 | (prin1-to-string dependents) file)))) |
| 201 | (let* ((unload-function-defs-list (feature-symbols feature)) | 265 | (let* ((unload-function-defs-list (feature-symbols feature)) |
| 202 | (file (pop unload-function-defs-list)) | 266 | (file (pop unload-function-defs-list)) |
| 203 | ;; If non-nil, this is a symbol for which we should | ||
| 204 | ;; restore a previous autoload if possible. | ||
| 205 | restore-autoload | ||
| 206 | (name (symbol-name feature)) | 267 | (name (symbol-name feature)) |
| 207 | (unload-hook (intern-soft (concat name "-unload-hook"))) | 268 | (unload-hook (intern-soft (concat name "-unload-hook"))) |
| 208 | (unload-func (intern-soft (concat name "-unload-function")))) | 269 | (unload-func (intern-soft (concat name "-unload-function")))) |
| @@ -245,43 +306,7 @@ something strange, such as redefining an Emacs function." | |||
| 245 | ;; Change major mode in all buffers using one defined in the feature being unloaded. | 306 | ;; Change major mode in all buffers using one defined in the feature being unloaded. |
| 246 | (unload--set-major-mode) | 307 | (unload--set-major-mode) |
| 247 | 308 | ||
| 248 | (when (fboundp 'elp-restore-function) ; remove ELP stuff first | 309 | (mapc #'loadhist-unload-element unload-function-defs-list) |
| 249 | (dolist (elt unload-function-defs-list) | ||
| 250 | (when (symbolp elt) | ||
| 251 | (elp-restore-function elt)))) | ||
| 252 | |||
| 253 | (dolist (x unload-function-defs-list) | ||
| 254 | (if (consp x) | ||
| 255 | (pcase (car x) | ||
| 256 | ;; Remove any feature names that this file provided. | ||
| 257 | (`provide | ||
| 258 | (setq features (delq (cdr x) features))) | ||
| 259 | ((or `defun `autoload) | ||
| 260 | (let ((fun (cdr x))) | ||
| 261 | (when (fboundp fun) | ||
| 262 | (when (fboundp 'ad-unadvise) | ||
| 263 | (ad-unadvise fun)) | ||
| 264 | (let ((aload (get fun 'autoload))) | ||
| 265 | (if (and aload (eq fun restore-autoload)) | ||
| 266 | (fset fun (cons 'autoload aload)) | ||
| 267 | (fmakunbound fun)))))) | ||
| 268 | ;; (t . SYMBOL) comes before (defun . SYMBOL) | ||
| 269 | ;; and says we should restore SYMBOL's autoload | ||
| 270 | ;; when we undefine it. | ||
| 271 | (`t (setq restore-autoload (cdr x))) | ||
| 272 | ((or `require `defface) nil) | ||
| 273 | (_ (message "Unexpected element %s in load-history" x))) | ||
| 274 | ;; Kill local values as much as possible. | ||
| 275 | (dolist (buf (buffer-list)) | ||
| 276 | (with-current-buffer buf | ||
| 277 | (if (and (boundp x) (timerp (symbol-value x))) | ||
| 278 | (cancel-timer (symbol-value x))) | ||
| 279 | (kill-local-variable x))) | ||
| 280 | (if (and (boundp x) (timerp (symbol-value x))) | ||
| 281 | (cancel-timer (symbol-value x))) | ||
| 282 | ;; Get rid of the default binding if we can. | ||
| 283 | (unless (local-variable-if-set-p x) | ||
| 284 | (makunbound x)))) | ||
| 285 | ;; Delete the load-history element for this file. | 310 | ;; Delete the load-history element for this file. |
| 286 | (setq load-history (delq (assoc file load-history) load-history)))) | 311 | (setq load-history (delq (assoc file load-history) load-history)))) |
| 287 | ;; Don't return load-history, it is not useful. | 312 | ;; Don't return load-history, it is not useful. |
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index b368efbbc95..2f723ca8ac8 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; ls-lisp.el --- emulate insert-directory completely in Emacs Lisp | 1 | ;;; ls-lisp.el --- emulate insert-directory completely in Emacs Lisp -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992, 1994, 2000-2017 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1992, 1994, 2000-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -60,6 +60,8 @@ | |||
| 60 | 60 | ||
| 61 | ;;; Code: | 61 | ;;; Code: |
| 62 | 62 | ||
| 63 | |||
| 64 | |||
| 63 | (defgroup ls-lisp nil | 65 | (defgroup ls-lisp nil |
| 64 | "Emulate the ls program completely in Emacs Lisp." | 66 | "Emulate the ls program completely in Emacs Lisp." |
| 65 | :version "21.1" | 67 | :version "21.1" |
| @@ -477,6 +479,37 @@ not contain `d', so that a full listing is expected." | |||
| 477 | (message "%s: doesn't exist or is inaccessible" file) | 479 | (message "%s: doesn't exist or is inaccessible" file) |
| 478 | (ding) (sit-for 2))))) ; to show user the message! | 480 | (ding) (sit-for 2))))) ; to show user the message! |
| 479 | 481 | ||
| 482 | |||
| 483 | (declare-function eshell-extended-glob "em-glob" (glob)) | ||
| 484 | (declare-function dired-read-dir-and-switches "dired" (str)) | ||
| 485 | (declare-function dired-goto-next-file "dired" ()) | ||
| 486 | |||
| 487 | (defun ls-lisp--dired (orig-fun dir-or-list &optional switches) | ||
| 488 | (interactive (dired-read-dir-and-switches "")) | ||
| 489 | (require 'em-glob) | ||
| 490 | (if (consp dir-or-list) | ||
| 491 | (funcall orig-fun dir-or-list switches) | ||
| 492 | (let ((dir-wildcard (insert-directory-wildcard-in-dir-p | ||
| 493 | (expand-file-name dir-or-list)))) | ||
| 494 | (if (not dir-wildcard) | ||
| 495 | (funcall orig-fun dir-or-list switches) | ||
| 496 | (let* ((default-directory (car dir-wildcard)) | ||
| 497 | (files (eshell-extended-glob (cdr dir-wildcard))) | ||
| 498 | (dir (car dir-wildcard))) | ||
| 499 | (if files | ||
| 500 | (let ((inhibit-read-only t) | ||
| 501 | (buf | ||
| 502 | (apply orig-fun (nconc (list dir) files) (and switches (list switches))))) | ||
| 503 | (with-current-buffer buf | ||
| 504 | (save-excursion | ||
| 505 | (goto-char (point-min)) | ||
| 506 | (dired-goto-next-file) | ||
| 507 | (forward-line 0) | ||
| 508 | (insert " wildcard " (cdr dir-wildcard) "\n")))) | ||
| 509 | (user-error "No files matching regexp"))))))) | ||
| 510 | |||
| 511 | (advice-add 'dired :around #'ls-lisp--dired) | ||
| 512 | |||
| 480 | (defun ls-lisp-sanitize (file-alist) | 513 | (defun ls-lisp-sanitize (file-alist) |
| 481 | "Sanitize the elements in FILE-ALIST. | 514 | "Sanitize the elements in FILE-ALIST. |
| 482 | Fixes any elements in the alist for directory entries whose file | 515 | Fixes any elements in the alist for directory entries whose file |
| @@ -866,6 +899,13 @@ All ls time options, namely c, t and u, are handled." | |||
| 866 | file-size) | 899 | file-size) |
| 867 | (format " %6s" (file-size-human-readable file-size)))) | 900 | (format " %6s" (file-size-human-readable file-size)))) |
| 868 | 901 | ||
| 902 | (defun ls-lisp-unload-function () | ||
| 903 | "Unload ls-lisp library." | ||
| 904 | (advice-remove 'insert-directory #'ls-lisp--insert-directory) | ||
| 905 | (advice-remove 'dired #'ls-lisp--dired) | ||
| 906 | ;; Continue standard unloading. | ||
| 907 | nil) | ||
| 908 | |||
| 869 | (provide 'ls-lisp) | 909 | (provide 'ls-lisp) |
| 870 | 910 | ||
| 871 | ;;; ls-lisp.el ends here | 911 | ;;; ls-lisp.el ends here |
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 4a569783293..05a336bfe28 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -1101,23 +1101,68 @@ The selected font will be the default on both the existing and future frames." | |||
| 1101 | :button (:radio . (eq tool-bar-mode nil)))) | 1101 | :button (:radio . (eq tool-bar-mode nil)))) |
| 1102 | menu))) | 1102 | menu))) |
| 1103 | 1103 | ||
| 1104 | (defun toggle-display-line-numbers () | 1104 | (defun menu-bar-display-line-numbers-mode (type) |
| 1105 | (interactive) | 1105 | (setq display-line-numbers-type type) |
| 1106 | (if display-line-numbers | 1106 | (if global-display-line-numbers-mode |
| 1107 | (setq display-line-numbers nil) | 1107 | (global-display-line-numbers-mode) |
| 1108 | (setq display-line-numbers t)) | 1108 | (display-line-numbers-mode))) |
| 1109 | (force-mode-line-update)) | 1109 | |
| 1110 | (defvar menu-bar-showhide-line-numbers-menu | ||
| 1111 | (let ((menu (make-sparse-keymap "Line Numbers"))) | ||
| 1112 | |||
| 1113 | (bindings--define-key menu [visual] | ||
| 1114 | `(menu-item "Visual Line Numbers" | ||
| 1115 | ,(lambda () | ||
| 1116 | (interactive) | ||
| 1117 | (menu-bar-display-line-numbers-mode 'visual) | ||
| 1118 | (message "Visual line numbers enabled")) | ||
| 1119 | :help "Enable visual line numbers" | ||
| 1120 | :button (:radio . (eq display-line-numbers 'visual)) | ||
| 1121 | :visible (menu-bar-menu-frame-live-and-visible-p))) | ||
| 1122 | |||
| 1123 | (bindings--define-key menu [relative] | ||
| 1124 | `(menu-item "Relative Line Numbers" | ||
| 1125 | ,(lambda () | ||
| 1126 | (interactive) | ||
| 1127 | (menu-bar-display-line-numbers-mode 'relative) | ||
| 1128 | (message "Relative line numbers enabled")) | ||
| 1129 | :help "Enable relative line numbers" | ||
| 1130 | :button (:radio . (eq display-line-numbers 'relative)) | ||
| 1131 | :visible (menu-bar-menu-frame-live-and-visible-p))) | ||
| 1132 | |||
| 1133 | (bindings--define-key menu [absolute] | ||
| 1134 | `(menu-item "Absolute Line Numbers" | ||
| 1135 | ,(lambda () | ||
| 1136 | (interactive) | ||
| 1137 | (menu-bar-display-line-numbers-mode t) | ||
| 1138 | (setq display-line-numbers t) | ||
| 1139 | (message "Absolute line numbers enabled")) | ||
| 1140 | :help "Enable absolute line numbers" | ||
| 1141 | :button (:radio . (eq display-line-numbers t)) | ||
| 1142 | :visible (menu-bar-menu-frame-live-and-visible-p))) | ||
| 1143 | |||
| 1144 | (bindings--define-key menu [none] | ||
| 1145 | `(menu-item "No Line Numbers" | ||
| 1146 | ,(lambda () | ||
| 1147 | (interactive) | ||
| 1148 | (menu-bar-display-line-numbers-mode nil) | ||
| 1149 | (message "Line numbers disabled")) | ||
| 1150 | :help "Disable line numbers" | ||
| 1151 | :button (:radio . (null display-line-numbers)) | ||
| 1152 | :visible (menu-bar-menu-frame-live-and-visible-p))) | ||
| 1153 | |||
| 1154 | (bindings--define-key menu [global] | ||
| 1155 | (menu-bar-make-mm-toggle global-display-line-numbers-mode | ||
| 1156 | "Global Line Numbers Mode" | ||
| 1157 | "Set line numbers globally")) | ||
| 1158 | menu)) | ||
| 1110 | 1159 | ||
| 1111 | (defvar menu-bar-showhide-menu | 1160 | (defvar menu-bar-showhide-menu |
| 1112 | (let ((menu (make-sparse-keymap "Show/Hide"))) | 1161 | (let ((menu (make-sparse-keymap "Show/Hide"))) |
| 1113 | 1162 | ||
| 1114 | (bindings--define-key menu [display-line-numbers] | 1163 | (bindings--define-key menu [display-line-numbers] |
| 1115 | `(menu-item "Line Numbers for All Lines" | 1164 | `(menu-item "Line Numbers for All Lines" |
| 1116 | ,(lambda () | 1165 | ,menu-bar-showhide-line-numbers-menu)) |
| 1117 | (interactive) | ||
| 1118 | (toggle-display-line-numbers)) | ||
| 1119 | :help "Show the line number alongside each line" | ||
| 1120 | :button (:toggle . display-line-numbers))) | ||
| 1121 | 1166 | ||
| 1122 | (bindings--define-key menu [column-number-mode] | 1167 | (bindings--define-key menu [column-number-mode] |
| 1123 | (menu-bar-make-mm-toggle column-number-mode | 1168 | (menu-bar-make-mm-toggle column-number-mode |
| @@ -2375,10 +2420,6 @@ FROM-MENU-BAR, if non-nil, means we are dropping one of menu-bar's menus." | |||
| 2375 | ;; `setup-specified-language-environment', for instance, | 2420 | ;; `setup-specified-language-environment', for instance, |
| 2376 | ;; expects this to be set from a menu keymap. | 2421 | ;; expects this to be set from a menu keymap. |
| 2377 | (setq last-command-event (car (last event))) | 2422 | (setq last-command-event (car (last event))) |
| 2378 | ;; Update `this-command' and run `pre-command-hook' so that | ||
| 2379 | ;; things like `delete-selection-pre-hook' will work correctly. | ||
| 2380 | (setq this-command cmd) | ||
| 2381 | (run-hooks 'pre-command-hook) | ||
| 2382 | ;; mouse-major-mode-menu was using `command-execute' instead. | 2423 | ;; mouse-major-mode-menu was using `command-execute' instead. |
| 2383 | (call-interactively cmd)))) | 2424 | (call-interactively cmd)))) |
| 2384 | 2425 | ||
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 4d4e8a809e1..fe93fc32ad3 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -945,6 +945,7 @@ If EXTERNAL, browse the URL using `shr-external-browser'." | |||
| 945 | (when (and (buffer-name buffer) | 945 | (when (and (buffer-name buffer) |
| 946 | (not (plist-get status :error))) | 946 | (not (plist-get status :error))) |
| 947 | (url-store-in-cache image-buffer) | 947 | (url-store-in-cache image-buffer) |
| 948 | (goto-char (point-min)) | ||
| 948 | (when (or (search-forward "\n\n" nil t) | 949 | (when (or (search-forward "\n\n" nil t) |
| 949 | (search-forward "\r\n\r\n" nil t)) | 950 | (search-forward "\r\n\r\n" nil t)) |
| 950 | (let ((data (shr-parse-image-data))) | 951 | (let ((data (shr-parse-image-data))) |
| @@ -998,7 +999,7 @@ element is the data blob and the second element is the content-type." | |||
| 998 | (create-image data nil t :ascent 100 | 999 | (create-image data nil t :ascent 100 |
| 999 | :format content-type)) | 1000 | :format content-type)) |
| 1000 | ((eq content-type 'image/svg+xml) | 1001 | ((eq content-type 'image/svg+xml) |
| 1001 | (create-image data 'imagemagick t :ascent 100)) | 1002 | (create-image data 'svg t :ascent 100)) |
| 1002 | ((eq size 'full) | 1003 | ((eq size 'full) |
| 1003 | (ignore-errors | 1004 | (ignore-errors |
| 1004 | (shr-rescale-image data content-type | 1005 | (shr-rescale-image data content-type |
diff --git a/lisp/password-cache.el b/lisp/password-cache.el index 7be3c6fdb6f..cbc248b9ecf 100644 --- a/lisp/password-cache.el +++ b/lisp/password-cache.el | |||
| @@ -66,7 +66,7 @@ Whether passwords are cached at all is controlled by `password-cache'." | |||
| 66 | :type '(choice (const :tag "Never" nil) | 66 | :type '(choice (const :tag "Never" nil) |
| 67 | (integer :tag "Seconds"))) | 67 | (integer :tag "Seconds"))) |
| 68 | 68 | ||
| 69 | (defvar password-data (make-vector 7 0)) | 69 | (defvar password-data (make-hash-table :test #'equal)) |
| 70 | 70 | ||
| 71 | (defun password-read-from-cache (key) | 71 | (defun password-read-from-cache (key) |
| 72 | "Obtain passphrase for KEY from time-limited passphrase cache. | 72 | "Obtain passphrase for KEY from time-limited passphrase cache. |
| @@ -74,20 +74,20 @@ Custom variables `password-cache' and `password-cache-expiry' | |||
| 74 | regulate cache behavior." | 74 | regulate cache behavior." |
| 75 | (and password-cache | 75 | (and password-cache |
| 76 | key | 76 | key |
| 77 | (symbol-value (intern-soft key password-data)))) | 77 | (gethash key password-data))) |
| 78 | 78 | ||
| 79 | ;;;###autoload | 79 | ;;;###autoload |
| 80 | (defun password-in-cache-p (key) | 80 | (defun password-in-cache-p (key) |
| 81 | "Check if KEY is in the cache." | 81 | "Check if KEY is in the cache." |
| 82 | (and password-cache | 82 | (and password-cache |
| 83 | key | 83 | key |
| 84 | (intern-soft key password-data))) | 84 | (gethash key password-data))) |
| 85 | 85 | ||
| 86 | (defun password-read (prompt &optional key) | 86 | (defun password-read (prompt &optional key) |
| 87 | "Read password, for use with KEY, from user, or from cache if wanted. | 87 | "Read password, for use with KEY, from user, or from cache if wanted. |
| 88 | KEY indicate the purpose of the password, so the cache can | 88 | KEY indicate the purpose of the password, so the cache can |
| 89 | separate passwords. The cache is not used if KEY is nil. It is | 89 | separate passwords. The cache is not used if KEY is nil. |
| 90 | typically a string. | 90 | KEY is typically a string but can be anything (compared via `equal'). |
| 91 | The variable `password-cache' control whether the cache is used." | 91 | The variable `password-cache' control whether the cache is used." |
| 92 | (or (password-read-from-cache key) | 92 | (or (password-read-from-cache key) |
| 93 | (read-passwd prompt))) | 93 | (read-passwd prompt))) |
| @@ -115,29 +115,27 @@ but can be invoked at any time to forcefully remove passwords | |||
| 115 | from the cache. This may be useful when it has been detected | 115 | from the cache. This may be useful when it has been detected |
| 116 | that a password is invalid, so that `password-read' query the | 116 | that a password is invalid, so that `password-read' query the |
| 117 | user again." | 117 | user again." |
| 118 | (let ((sym (intern-soft key password-data))) | 118 | (let ((password (gethash key password-data))) |
| 119 | (when sym | 119 | (when (stringp password) |
| 120 | (let ((password (symbol-value sym))) | 120 | (if (fboundp 'clear-string) |
| 121 | (when (stringp password) | 121 | (clear-string password) |
| 122 | (if (fboundp 'clear-string) | 122 | (fillarray password ?_))) |
| 123 | (clear-string password) | 123 | (remhash key password-data))) |
| 124 | (fillarray password ?_))) | ||
| 125 | (unintern key password-data))))) | ||
| 126 | 124 | ||
| 127 | (defun password-cache-add (key password) | 125 | (defun password-cache-add (key password) |
| 128 | "Add password to cache. | 126 | "Add password to cache. |
| 129 | The password is removed by a timer after `password-cache-expiry' seconds." | 127 | The password is removed by a timer after `password-cache-expiry' seconds." |
| 130 | (when (and password-cache-expiry (null (intern-soft key password-data))) | 128 | (when (and password-cache-expiry (null (gethash key password-data))) |
| 131 | (run-at-time password-cache-expiry nil | 129 | (run-at-time password-cache-expiry nil |
| 132 | #'password-cache-remove | 130 | #'password-cache-remove |
| 133 | key)) | 131 | key)) |
| 134 | (set (intern key password-data) password) | 132 | (puthash key password password-data) |
| 135 | nil) | 133 | nil) |
| 136 | 134 | ||
| 137 | (defun password-reset () | 135 | (defun password-reset () |
| 138 | "Clear the password cache." | 136 | "Clear the password cache." |
| 139 | (interactive) | 137 | (interactive) |
| 140 | (fillarray password-data 0)) | 138 | (clrhash password-data)) |
| 141 | 139 | ||
| 142 | (provide 'password-cache) | 140 | (provide 'password-cache) |
| 143 | 141 | ||
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 22f5b906e4e..59dc96af030 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -6089,14 +6089,8 @@ comment at the start of cc-engine.el for more info." | |||
| 6089 | 6089 | ||
| 6090 | (defsubst c-clear-found-types () | 6090 | (defsubst c-clear-found-types () |
| 6091 | ;; Clears `c-found-types'. | 6091 | ;; Clears `c-found-types'. |
| 6092 | (setq c-found-types (make-vector 53 0))) | 6092 | (setq c-found-types |
| 6093 | 6093 | (make-hash-table :test #'equal :weakness nil))) | |
| 6094 | (defun c-copy-found-types () | ||
| 6095 | (let ((copy (make-vector 53 0))) | ||
| 6096 | (mapatoms (lambda (sym) | ||
| 6097 | (intern (symbol-name sym) copy)) | ||
| 6098 | c-found-types) | ||
| 6099 | copy)) | ||
| 6100 | 6094 | ||
| 6101 | (defun c-add-type (from to) | 6095 | (defun c-add-type (from to) |
| 6102 | ;; Add the given region as a type in `c-found-types'. If the region | 6096 | ;; Add the given region as a type in `c-found-types'. If the region |
| @@ -6110,29 +6104,27 @@ comment at the start of cc-engine.el for more info." | |||
| 6110 | ;; | 6104 | ;; |
| 6111 | ;; This function might do hidden buffer changes. | 6105 | ;; This function might do hidden buffer changes. |
| 6112 | (let ((type (c-syntactic-content from to c-recognize-<>-arglists))) | 6106 | (let ((type (c-syntactic-content from to c-recognize-<>-arglists))) |
| 6113 | (unless (intern-soft type c-found-types) | 6107 | (unless (gethash type c-found-types) |
| 6114 | (unintern (substring type 0 -1) c-found-types) | 6108 | (remhash (substring type 0 -1) c-found-types) |
| 6115 | (intern type c-found-types)))) | 6109 | (puthash type t c-found-types)))) |
| 6116 | 6110 | ||
| 6117 | (defun c-unfind-type (name) | 6111 | (defun c-unfind-type (name) |
| 6118 | ;; Remove the "NAME" from c-found-types, if present. | 6112 | ;; Remove the "NAME" from c-found-types, if present. |
| 6119 | (unintern name c-found-types)) | 6113 | (remhash name c-found-types)) |
| 6120 | 6114 | ||
| 6121 | (defsubst c-check-type (from to) | 6115 | (defsubst c-check-type (from to) |
| 6122 | ;; Return non-nil if the given region contains a type in | 6116 | ;; Return non-nil if the given region contains a type in |
| 6123 | ;; `c-found-types'. | 6117 | ;; `c-found-types'. |
| 6124 | ;; | 6118 | ;; |
| 6125 | ;; This function might do hidden buffer changes. | 6119 | ;; This function might do hidden buffer changes. |
| 6126 | (intern-soft (c-syntactic-content from to c-recognize-<>-arglists) | 6120 | (gethash (c-syntactic-content from to c-recognize-<>-arglists) c-found-types)) |
| 6127 | c-found-types)) | ||
| 6128 | 6121 | ||
| 6129 | (defun c-list-found-types () | 6122 | (defun c-list-found-types () |
| 6130 | ;; Return all the types in `c-found-types' as a sorted list of | 6123 | ;; Return all the types in `c-found-types' as a sorted list of |
| 6131 | ;; strings. | 6124 | ;; strings. |
| 6132 | (let (type-list) | 6125 | (let (type-list) |
| 6133 | (mapatoms (lambda (type) | 6126 | (maphash (lambda (type _) |
| 6134 | (setq type-list (cons (symbol-name type) | 6127 | (setq type-list (cons type type-list))) |
| 6135 | type-list))) | ||
| 6136 | c-found-types) | 6128 | c-found-types) |
| 6137 | (sort type-list 'string-lessp))) | 6129 | (sort type-list 'string-lessp))) |
| 6138 | 6130 | ||
| @@ -7066,7 +7058,7 @@ comment at the start of cc-engine.el for more info." | |||
| 7066 | ;; This function might do hidden buffer changes. | 7058 | ;; This function might do hidden buffer changes. |
| 7067 | 7059 | ||
| 7068 | (let ((start (point)) | 7060 | (let ((start (point)) |
| 7069 | (old-found-types (c-copy-found-types)) | 7061 | (old-found-types (copy-hash-table c-found-types)) |
| 7070 | ;; If `c-record-type-identifiers' is set then activate | 7062 | ;; If `c-record-type-identifiers' is set then activate |
| 7071 | ;; recording of any found types that constitute an argument in | 7063 | ;; recording of any found types that constitute an argument in |
| 7072 | ;; the arglist. | 7064 | ;; the arglist. |
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 66f2575f49f..b35d33a5fd3 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -1182,10 +1182,15 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1182 | (goto-char match-pos) | 1182 | (goto-char match-pos) |
| 1183 | (backward-char) | 1183 | (backward-char) |
| 1184 | (c-backward-token-2) | 1184 | (c-backward-token-2) |
| 1185 | (or (looking-at c-block-stmt-2-key) | 1185 | (cond |
| 1186 | (looking-at c-block-stmt-1-2-key) | 1186 | ((looking-at c-paren-stmt-key) |
| 1187 | (looking-at c-typeof-key)))) | 1187 | ;; Allow comma separated <> arglists in for statements. |
| 1188 | (cons nil t)) | 1188 | (cons nil nil)) |
| 1189 | ((or (looking-at c-block-stmt-2-key) | ||
| 1190 | (looking-at c-block-stmt-1-2-key) | ||
| 1191 | (looking-at c-typeof-key)) | ||
| 1192 | (cons nil t)) | ||
| 1193 | (t nil))))) | ||
| 1189 | ;; Near BOB. | 1194 | ;; Near BOB. |
| 1190 | ((<= match-pos (point-min)) | 1195 | ((<= match-pos (point-min)) |
| 1191 | (cons 'arglist t)) | 1196 | (cons 'arglist t)) |
| @@ -1226,13 +1231,16 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1226 | ;; Got a cached hit in some other type of arglist. | 1231 | ;; Got a cached hit in some other type of arglist. |
| 1227 | (type | 1232 | (type |
| 1228 | (cons 'arglist t)) | 1233 | (cons 'arglist t)) |
| 1229 | (not-front-decl | 1234 | ((and not-front-decl |
| 1230 | ;; The point is within the range of a previously | 1235 | ;; The point is within the range of a previously |
| 1231 | ;; encountered type decl expression, so the arglist | 1236 | ;; encountered type decl expression, so the arglist |
| 1232 | ;; is probably one that contains declarations. | 1237 | ;; is probably one that contains declarations. |
| 1233 | ;; However, if `c-recognize-paren-inits' is set it | 1238 | ;; However, if `c-recognize-paren-inits' is set it |
| 1234 | ;; might also be an initializer arglist. | 1239 | ;; might also be an initializer arglist. |
| 1235 | ;; | 1240 | (or (not c-recognize-paren-inits) |
| 1241 | (save-excursion | ||
| 1242 | (goto-char match-pos) | ||
| 1243 | (not (c-back-over-member-initializers))))) | ||
| 1236 | ;; The result of this check is cached with a char | 1244 | ;; The result of this check is cached with a char |
| 1237 | ;; property on the match token, so that we can look | 1245 | ;; property on the match token, so that we can look |
| 1238 | ;; it up again when refontifying single lines in a | 1246 | ;; it up again when refontifying single lines in a |
| @@ -1243,17 +1251,21 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1243 | ;; Got an open paren preceded by an arith operator. | 1251 | ;; Got an open paren preceded by an arith operator. |
| 1244 | ((and (eq (char-before match-pos) ?\() | 1252 | ((and (eq (char-before match-pos) ?\() |
| 1245 | (save-excursion | 1253 | (save-excursion |
| 1254 | (goto-char match-pos) | ||
| 1246 | (and (zerop (c-backward-token-2 2)) | 1255 | (and (zerop (c-backward-token-2 2)) |
| 1247 | (looking-at c-arithmetic-op-regexp)))) | 1256 | (looking-at c-arithmetic-op-regexp)))) |
| 1248 | (cons nil nil)) | 1257 | (cons nil nil)) |
| 1249 | ;; In a C++ member initialization list. | 1258 | ;; In a C++ member initialization list. |
| 1250 | ((and (eq (char-before match-pos) ?,) | 1259 | ((and (eq (char-before match-pos) ?,) |
| 1251 | (c-major-mode-is 'c++-mode) | 1260 | (c-major-mode-is 'c++-mode) |
| 1252 | (save-excursion (c-back-over-member-initializers))) | 1261 | (save-excursion |
| 1262 | (goto-char match-pos) | ||
| 1263 | (c-back-over-member-initializers))) | ||
| 1253 | (c-put-char-property (1- match-pos) 'c-type 'c-not-decl) | 1264 | (c-put-char-property (1- match-pos) 'c-type 'c-not-decl) |
| 1254 | (cons 'not-decl nil)) | 1265 | (cons 'not-decl nil)) |
| 1255 | ;; At start of a declaration inside a declaration paren. | 1266 | ;; At start of a declaration inside a declaration paren. |
| 1256 | ((save-excursion | 1267 | ((save-excursion |
| 1268 | (goto-char match-pos) | ||
| 1257 | (and (memq (char-before match-pos) '(?\( ?\,)) | 1269 | (and (memq (char-before match-pos) '(?\( ?\,)) |
| 1258 | (c-go-up-list-backward match-pos) | 1270 | (c-go-up-list-backward match-pos) |
| 1259 | (eq (char-after) ?\() | 1271 | (eq (char-after) ?\() |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index bf0439ffe8a..0bf89b9a36a 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -1539,6 +1539,21 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") | |||
| 1539 | (setq new-pos capture-opener)) | 1539 | (setq new-pos capture-opener)) |
| 1540 | (and (/= new-pos pos) new-pos))) | 1540 | (and (/= new-pos pos) new-pos))) |
| 1541 | 1541 | ||
| 1542 | (defun c-fl-decl-end (pos) | ||
| 1543 | ;; If POS is inside a declarator, return the end of the token that follows | ||
| 1544 | ;; the declarator, otherwise return nil. | ||
| 1545 | (goto-char pos) | ||
| 1546 | (let ((lit-start (c-literal-start)) | ||
| 1547 | pos1) | ||
| 1548 | (if lit-start (goto-char lit-start)) | ||
| 1549 | (c-backward-syntactic-ws) | ||
| 1550 | (when (setq pos1 (c-on-identifier)) | ||
| 1551 | (goto-char pos1) | ||
| 1552 | (when (and (c-forward-declarator) | ||
| 1553 | (eq (c-forward-token-2) 0)) | ||
| 1554 | (c-backward-syntactic-ws) | ||
| 1555 | (point))))) | ||
| 1556 | |||
| 1542 | (defun c-change-expand-fl-region (_beg _end _old-len) | 1557 | (defun c-change-expand-fl-region (_beg _end _old-len) |
| 1543 | ;; Expand the region (c-new-BEG c-new-END) to an after-change font-lock | 1558 | ;; Expand the region (c-new-BEG c-new-END) to an after-change font-lock |
| 1544 | ;; region. This will usually be the smallest sequence of whole lines | 1559 | ;; region. This will usually be the smallest sequence of whole lines |
| @@ -1552,18 +1567,16 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") | |||
| 1552 | (setq c-new-BEG | 1567 | (setq c-new-BEG |
| 1553 | (or (c-fl-decl-start c-new-BEG) (c-point 'bol c-new-BEG)) | 1568 | (or (c-fl-decl-start c-new-BEG) (c-point 'bol c-new-BEG)) |
| 1554 | c-new-END | 1569 | c-new-END |
| 1555 | (save-excursion | 1570 | (or (c-fl-decl-end c-new-END) |
| 1556 | (goto-char c-new-END) | 1571 | (c-point 'bonl (max (1- c-new-END) (point-min))))))) |
| 1557 | (if (bolp) | ||
| 1558 | (point) | ||
| 1559 | (c-point 'bonl c-new-END)))))) | ||
| 1560 | 1572 | ||
| 1561 | (defun c-context-expand-fl-region (beg end) | 1573 | (defun c-context-expand-fl-region (beg end) |
| 1562 | ;; Return a cons (NEW-BEG . NEW-END), where NEW-BEG is the beginning of a | 1574 | ;; Return a cons (NEW-BEG . NEW-END), where NEW-BEG is the beginning of a |
| 1563 | ;; "local" declaration containing BEG (see `c-fl-decl-start') or BOL BEG is | 1575 | ;; "local" declaration containing BEG (see `c-fl-decl-start') or BOL BEG is |
| 1564 | ;; in. NEW-END is beginning of the line after the one END is in. | 1576 | ;; in. NEW-END is beginning of the line after the one END is in. |
| 1565 | (cons (or (c-fl-decl-start beg) (c-point 'bol beg)) | 1577 | (c-save-buffer-state () |
| 1566 | (c-point 'bonl end))) | 1578 | (cons (or (c-fl-decl-start beg) (c-point 'bol beg)) |
| 1579 | (or (c-fl-decl-end end) (c-point 'bonl (1- end)))))) | ||
| 1567 | 1580 | ||
| 1568 | (defun c-before-context-fl-expand-region (beg end) | 1581 | (defun c-before-context-fl-expand-region (beg end) |
| 1569 | ;; Expand the region (BEG END) as specified by | 1582 | ;; Expand the region (BEG END) as specified by |
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index c0f1aaf39d4..c69eca22413 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -3734,7 +3734,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', | |||
| 3734 | "\\(\\`\n?\\|^\n\\)=" ; POD | 3734 | "\\(\\`\n?\\|^\n\\)=" ; POD |
| 3735 | "\\|" | 3735 | "\\|" |
| 3736 | ;; One extra () before this: | 3736 | ;; One extra () before this: |
| 3737 | "<<" ; HERE-DOC | 3737 | "<<~?" ; HERE-DOC |
| 3738 | "\\(" ; 1 + 1 | 3738 | "\\(" ; 1 + 1 |
| 3739 | ;; First variant "BLAH" or just ``. | 3739 | ;; First variant "BLAH" or just ``. |
| 3740 | "[ \t]*" ; Yes, whitespace is allowed! | 3740 | "[ \t]*" ; Yes, whitespace is allowed! |
| @@ -4000,7 +4000,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', | |||
| 4000 | (setq b (point)) | 4000 | (setq b (point)) |
| 4001 | ;; We do not search to max, since we may be called from | 4001 | ;; We do not search to max, since we may be called from |
| 4002 | ;; some hook of fontification, and max is random | 4002 | ;; some hook of fontification, and max is random |
| 4003 | (or (and (re-search-forward (concat "^" qtag "$") | 4003 | (or (and (re-search-forward (concat "^[ \t]*" qtag "$") |
| 4004 | stop-point 'toend) | 4004 | stop-point 'toend) |
| 4005 | ;;;(eq (following-char) ?\n) ; XXXX WHY??? | 4005 | ;;;(eq (following-char) ?\n) ; XXXX WHY??? |
| 4006 | ) | 4006 | ) |
diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el index 389ddfca6b1..7a666e95297 100644 --- a/lisp/progmodes/ld-script.el +++ b/lisp/progmodes/ld-script.el | |||
| @@ -85,10 +85,12 @@ | |||
| 85 | ;; 3.4.5 Other Linker Script Commands | 85 | ;; 3.4.5 Other Linker Script Commands |
| 86 | "ASSERT" "EXTERN" "FORCE_COMMON_ALLOCATION" | 86 | "ASSERT" "EXTERN" "FORCE_COMMON_ALLOCATION" |
| 87 | "INHIBIT_COMMON_ALLOCATION" "INSERT" "AFTER" "BEFORE" | 87 | "INHIBIT_COMMON_ALLOCATION" "INSERT" "AFTER" "BEFORE" |
| 88 | "NOCROSSREFS" "OUTPUT_ARCH" "LD_FEATURE" | 88 | "NOCROSSREFS" "NOCROSSREFS_TO" "OUTPUT_ARCH" "LD_FEATURE" |
| 89 | ;; 3.5.2 PROVIDE | 89 | ;; 3.5.2 HIDDEN |
| 90 | "HIDDEN" | ||
| 91 | ;; 3.5.3 PROVIDE | ||
| 90 | "PROVIDE" | 92 | "PROVIDE" |
| 91 | ;; 3.5.3 PROVIDE_HIDDEN | 93 | ;; 3.5.4 PROVIDE_HIDDEN |
| 92 | "PROVIDE_HIDDEN" | 94 | "PROVIDE_HIDDEN" |
| 93 | ;; 3.6 SECTIONS Command | 95 | ;; 3.6 SECTIONS Command |
| 94 | "SECTIONS" | 96 | "SECTIONS" |
| @@ -142,6 +144,7 @@ | |||
| 142 | "DEFINED" | 144 | "DEFINED" |
| 143 | "LENGTH" "len" "l" | 145 | "LENGTH" "len" "l" |
| 144 | "LOADADDR" | 146 | "LOADADDR" |
| 147 | "LOG2CEIL" | ||
| 145 | "MAX" | 148 | "MAX" |
| 146 | "MIN" | 149 | "MIN" |
| 147 | "NEXT" | 150 | "NEXT" |
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 3def37a2ea8..6197a53ee66 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el | |||
| @@ -213,25 +213,6 @@ | |||
| 213 | (regexp-opt perl--syntax-exp-intro-keywords) | 213 | (regexp-opt perl--syntax-exp-intro-keywords) |
| 214 | "\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*"))) | 214 | "\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*"))) |
| 215 | 215 | ||
| 216 | ;; FIXME: handle here-docs and regexps. | ||
| 217 | ;; <<EOF <<"EOF" <<'EOF' (no space) | ||
| 218 | ;; see `man perlop' | ||
| 219 | ;; ?...? | ||
| 220 | ;; /.../ | ||
| 221 | ;; m [...] | ||
| 222 | ;; m /.../ | ||
| 223 | ;; q /.../ = '...' | ||
| 224 | ;; qq /.../ = "..." | ||
| 225 | ;; qx /.../ = `...` | ||
| 226 | ;; qr /.../ = precompiled regexp =~=~ m/.../ | ||
| 227 | ;; qw /.../ | ||
| 228 | ;; s /.../.../ | ||
| 229 | ;; s <...> /.../ | ||
| 230 | ;; s '...'...' | ||
| 231 | ;; tr /.../.../ | ||
| 232 | ;; y /.../.../ | ||
| 233 | ;; | ||
| 234 | ;; <file*glob> | ||
| 235 | (defun perl-syntax-propertize-function (start end) | 216 | (defun perl-syntax-propertize-function (start end) |
| 236 | (let ((case-fold-search nil)) | 217 | (let ((case-fold-search nil)) |
| 237 | (goto-char start) | 218 | (goto-char start) |
| @@ -324,23 +305,25 @@ | |||
| 324 | ((concat | 305 | ((concat |
| 325 | "\\(?:" | 306 | "\\(?:" |
| 326 | ;; << "EOF", << 'EOF', or << \EOF | 307 | ;; << "EOF", << 'EOF', or << \EOF |
| 327 | "<<[ \t]*\\('[^'\n]*'\\|\"[^\"\n]*\"\\|\\\\[[:alpha:]][[:alnum:]]*\\)" | 308 | "<<\\(~\\)?[ \t]*\\('[^'\n]*'\\|\"[^\"\n]*\"\\|\\\\[[:alpha:]][[:alnum:]]*\\)" |
| 328 | ;; The <<EOF case which needs perl--syntax-exp-intro-regexp, to | 309 | ;; The <<EOF case which needs perl--syntax-exp-intro-regexp, to |
| 329 | ;; disambiguate with the left-bitshift operator. | 310 | ;; disambiguate with the left-bitshift operator. |
| 330 | "\\|" perl--syntax-exp-intro-regexp "<<\\(?1:\\sw+\\)\\)" | 311 | "\\|" perl--syntax-exp-intro-regexp "<<\\(?2:\\sw+\\)\\)" |
| 331 | ".*\\(\n\\)") | 312 | ".*\\(\n\\)") |
| 332 | (3 (let* ((st (get-text-property (match-beginning 3) 'syntax-table)) | 313 | (4 (let* ((st (get-text-property (match-beginning 4) 'syntax-table)) |
| 333 | (name (match-string 1))) | 314 | (name (match-string 2)) |
| 334 | (goto-char (match-end 1)) | 315 | (indented (match-beginning 1))) |
| 316 | (goto-char (match-end 2)) | ||
| 335 | (if (save-excursion (nth 8 (syntax-ppss (match-beginning 0)))) | 317 | (if (save-excursion (nth 8 (syntax-ppss (match-beginning 0)))) |
| 336 | ;; Leave the property of the newline unchanged. | 318 | ;; Leave the property of the newline unchanged. |
| 337 | st | 319 | st |
| 338 | (cons (car (string-to-syntax "< c")) | 320 | (cons (car (string-to-syntax "< c")) |
| 339 | ;; Remember the names of heredocs found on this line. | 321 | ;; Remember the names of heredocs found on this line. |
| 340 | (cons (pcase (aref name 0) | 322 | (cons (cons (pcase (aref name 0) |
| 341 | (`?\\ (substring name 1)) | 323 | (`?\\ (substring name 1)) |
| 342 | ((or `?\" `?\' `?\`) (substring name 1 -1)) | 324 | ((or `?\" `?\' `?\`) (substring name 1 -1)) |
| 343 | (_ name)) | 325 | (_ name)) |
| 326 | indented) | ||
| 344 | (cdr st))))))) | 327 | (cdr st))))))) |
| 345 | ;; We don't call perl-syntax-propertize-special-constructs directly | 328 | ;; We don't call perl-syntax-propertize-special-constructs directly |
| 346 | ;; from the << rule, because there might be other elements (between | 329 | ;; from the << rule, because there might be other elements (between |
| @@ -383,7 +366,9 @@ | |||
| 383 | (goto-char (nth 8 state))) | 366 | (goto-char (nth 8 state))) |
| 384 | (while (and names | 367 | (while (and names |
| 385 | (re-search-forward | 368 | (re-search-forward |
| 386 | (concat "^" (regexp-quote (pop names)) "\n") | 369 | (pcase-let ((`(,name . ,indented) (pop names))) |
| 370 | (concat "^" (if indented "[ \t]*") | ||
| 371 | (regexp-quote name) "\n")) | ||
| 387 | limit 'move)) | 372 | limit 'move)) |
| 388 | (unless names | 373 | (unless names |
| 389 | (put-text-property (1- (point)) (point) 'syntax-table | 374 | (put-text-property (1- (point)) (point) 'syntax-table |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 35b555e6879..23e79f6ac59 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1683,6 +1683,7 @@ with your script for an edit-interpret-debug cycle." | |||
| 1683 | ((string-match "[.]sh\\>" buffer-file-name) "sh") | 1683 | ((string-match "[.]sh\\>" buffer-file-name) "sh") |
| 1684 | ((string-match "[.]bash\\>" buffer-file-name) "bash") | 1684 | ((string-match "[.]bash\\>" buffer-file-name) "bash") |
| 1685 | ((string-match "[.]ksh\\>" buffer-file-name) "ksh") | 1685 | ((string-match "[.]ksh\\>" buffer-file-name) "ksh") |
| 1686 | ((string-match "[.]mkshrc\\>" buffer-file-name) "mksh") | ||
| 1686 | ((string-match "[.]t?csh\\(rc\\)?\\>" buffer-file-name) "csh") | 1687 | ((string-match "[.]t?csh\\(rc\\)?\\>" buffer-file-name) "csh") |
| 1687 | ((string-match "[.]zsh\\(rc\\|env\\)?\\>" buffer-file-name) "zsh") | 1688 | ((string-match "[.]zsh\\(rc\\|env\\)?\\>" buffer-file-name) "zsh") |
| 1688 | ((equal (file-name-nondirectory buffer-file-name) ".profile") "sh") | 1689 | ((equal (file-name-nondirectory buffer-file-name) ".profile") "sh") |
diff --git a/lisp/register.el b/lisp/register.el index 7cc3ccd870c..e395963f56a 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -164,6 +164,10 @@ display such a window regardless." | |||
| 164 | help-chars) | 164 | help-chars) |
| 165 | (unless (get-buffer-window buffer) | 165 | (unless (get-buffer-window buffer) |
| 166 | (register-preview buffer 'show-empty))) | 166 | (register-preview buffer 'show-empty))) |
| 167 | (when (or (eq ?\C-g last-input-event) | ||
| 168 | (eq 'escape last-input-event) | ||
| 169 | (eq ?\C-\[ last-input-event)) | ||
| 170 | (keyboard-quit)) | ||
| 167 | (if (characterp last-input-event) last-input-event | 171 | (if (characterp last-input-event) last-input-event |
| 168 | (error "Non-character input-event"))) | 172 | (error "Non-character input-event"))) |
| 169 | (and (timerp timer) (cancel-timer timer)) | 173 | (and (timerp timer) (cancel-timer timer)) |
diff --git a/lisp/replace.el b/lisp/replace.el index 64dfe7da22d..a5024943e64 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1395,6 +1395,11 @@ invoke `occur'." | |||
| 1395 | "Show all lines in the current buffer containing a match for REGEXP. | 1395 | "Show all lines in the current buffer containing a match for REGEXP. |
| 1396 | If a match spreads across multiple lines, all those lines are shown. | 1396 | If a match spreads across multiple lines, all those lines are shown. |
| 1397 | 1397 | ||
| 1398 | Each match is extended to include complete lines. Only non-overlapping | ||
| 1399 | matches are considered. (Note that extending matches to complete | ||
| 1400 | lines could cause some of the matches to overlap; if so, they will not | ||
| 1401 | be shown as separate matches.) | ||
| 1402 | |||
| 1398 | Each line is displayed with NLINES lines before and after, or -NLINES | 1403 | Each line is displayed with NLINES lines before and after, or -NLINES |
| 1399 | before if NLINES is negative. | 1404 | before if NLINES is negative. |
| 1400 | NLINES defaults to `list-matching-lines-default-context-lines'. | 1405 | NLINES defaults to `list-matching-lines-default-context-lines'. |
diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index 7b0588dfead..fdfd5c61be9 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el | |||
| @@ -696,6 +696,10 @@ Optional argument PROPS specifies other text properties to apply." | |||
| 696 | ;; Create an "clean" ruler. | 696 | ;; Create an "clean" ruler. |
| 697 | (ruler | 697 | (ruler |
| 698 | (propertize | 698 | (propertize |
| 699 | ;; FIXME: `make-string' returns a unibyte string if it's ASCII-only, | ||
| 700 | ;; which prevents further `aset' from inserting non-ASCII chars, | ||
| 701 | ;; hence the need for `string-to-multibyte'. | ||
| 702 | ;; http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00841.html | ||
| 699 | (string-to-multibyte | 703 | (string-to-multibyte |
| 700 | (make-string w ruler-mode-basic-graduation-char)) | 704 | (make-string w ruler-mode-basic-graduation-char)) |
| 701 | 'face 'ruler-mode-default | 705 | 'face 'ruler-mode-default |
diff --git a/lisp/startup.el b/lisp/startup.el index bc60bbd08b8..0fbba1bea23 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1432,6 +1432,7 @@ settings will be marked as \"CHANGED outside of Customize\"." | |||
| 1432 | (let ((no-vals '("no" "off" "false" "0")) | 1432 | (let ((no-vals '("no" "off" "false" "0")) |
| 1433 | (settings '(("menuBar" "MenuBar" menu-bar-mode nil) | 1433 | (settings '(("menuBar" "MenuBar" menu-bar-mode nil) |
| 1434 | ("toolBar" "ToolBar" tool-bar-mode nil) | 1434 | ("toolBar" "ToolBar" tool-bar-mode nil) |
| 1435 | ("scrollBar" "ScrollBar" scroll-bar-mode nil) | ||
| 1435 | ("cursorBlink" "CursorBlink" no-blinking-cursor t)))) | 1436 | ("cursorBlink" "CursorBlink" no-blinking-cursor t)))) |
| 1436 | (dolist (x settings) | 1437 | (dolist (x settings) |
| 1437 | (if (member (x-get-resource (nth 0 x) (nth 1 x)) no-vals) | 1438 | (if (member (x-get-resource (nth 0 x) (nth 1 x)) no-vals) |
diff --git a/lisp/subr.el b/lisp/subr.el index d9d918ed12d..b3f9f902349 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1789,7 +1789,8 @@ Return the new history list. | |||
| 1789 | If MAXELT is non-nil, it specifies the maximum length of the history. | 1789 | If MAXELT is non-nil, it specifies the maximum length of the history. |
| 1790 | Otherwise, the maximum history length is the value of the `history-length' | 1790 | Otherwise, the maximum history length is the value of the `history-length' |
| 1791 | property on symbol HISTORY-VAR, if set, or the value of the `history-length' | 1791 | property on symbol HISTORY-VAR, if set, or the value of the `history-length' |
| 1792 | variable. | 1792 | variable. The possible values of maximum length have the same meaning as |
| 1793 | the values of `history-length'. | ||
| 1793 | Remove duplicates of NEWELT if `history-delete-duplicates' is non-nil. | 1794 | Remove duplicates of NEWELT if `history-delete-duplicates' is non-nil. |
| 1794 | If optional fourth arg KEEP-ALL is non-nil, add NEWELT to history even | 1795 | If optional fourth arg KEEP-ALL is non-nil, add NEWELT to history even |
| 1795 | if it is empty or a duplicate." | 1796 | if it is empty or a duplicate." |
| @@ -1998,6 +1999,25 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label." | |||
| 1998 | ;; "Return the name of the file from which AUTOLOAD will be loaded. | 1999 | ;; "Return the name of the file from which AUTOLOAD will be loaded. |
| 1999 | ;; \n\(fn AUTOLOAD)") | 2000 | ;; \n\(fn AUTOLOAD)") |
| 2000 | 2001 | ||
| 2002 | (defun define-symbol-prop (symbol prop val) | ||
| 2003 | "Define the property PROP of SYMBOL to be VAL. | ||
| 2004 | This is to `put' what `defalias' is to `fset'." | ||
| 2005 | ;; Can't use `cl-pushnew' here (nor `push' on (cdr foo)). | ||
| 2006 | ;; (cl-pushnew symbol (alist-get prop | ||
| 2007 | ;; (alist-get 'define-symbol-props | ||
| 2008 | ;; current-load-list))) | ||
| 2009 | (let ((sps (assq 'define-symbol-props current-load-list))) | ||
| 2010 | (unless sps | ||
| 2011 | (setq sps (list 'define-symbol-props)) | ||
| 2012 | (push sps current-load-list)) | ||
| 2013 | (let ((ps (assq prop sps))) | ||
| 2014 | (unless ps | ||
| 2015 | (setq ps (list prop)) | ||
| 2016 | (setcdr sps (cons ps (cdr sps)))) | ||
| 2017 | (unless (member symbol (cdr ps)) | ||
| 2018 | (setcdr ps (cons symbol (cdr ps)))))) | ||
| 2019 | (put symbol prop val)) | ||
| 2020 | |||
| 2001 | (defun symbol-file (symbol &optional type) | 2021 | (defun symbol-file (symbol &optional type) |
| 2002 | "Return the name of the file that defined SYMBOL. | 2022 | "Return the name of the file that defined SYMBOL. |
| 2003 | The value is normally an absolute file name. It can also be nil, | 2023 | The value is normally an absolute file name. It can also be nil, |
| @@ -2007,47 +2027,30 @@ file name without extension. | |||
| 2007 | 2027 | ||
| 2008 | If TYPE is nil, then any kind of definition is acceptable. If | 2028 | If TYPE is nil, then any kind of definition is acceptable. If |
| 2009 | TYPE is `defun', `defvar', or `defface', that specifies function | 2029 | TYPE is `defun', `defvar', or `defface', that specifies function |
| 2010 | definition, variable definition, or face definition only." | 2030 | definition, variable definition, or face definition only. |
| 2031 | Otherwise TYPE is assumed to be a symbol property." | ||
| 2011 | (if (and (or (null type) (eq type 'defun)) | 2032 | (if (and (or (null type) (eq type 'defun)) |
| 2012 | (symbolp symbol) | 2033 | (symbolp symbol) |
| 2013 | (autoloadp (symbol-function symbol))) | 2034 | (autoloadp (symbol-function symbol))) |
| 2014 | (nth 1 (symbol-function symbol)) | 2035 | (nth 1 (symbol-function symbol)) |
| 2015 | (let ((files load-history) | 2036 | (catch 'found |
| 2016 | file match) | 2037 | (pcase-dolist (`(,file . ,elems) load-history) |
| 2017 | (while files | 2038 | (when (if type |
| 2018 | (if (if type | 2039 | (if (eq type 'defvar) |
| 2019 | (if (eq type 'defvar) | 2040 | ;; Variables are present just as their names. |
| 2020 | ;; Variables are present just as their names. | 2041 | (member symbol elems) |
| 2021 | (member symbol (cdr (car files))) | 2042 | ;; Many other types are represented as (TYPE . NAME). |
| 2022 | ;; Other types are represented as (TYPE . NAME). | 2043 | (or (member (cons type symbol) elems) |
| 2023 | (member (cons type symbol) (cdr (car files)))) | 2044 | (memq symbol (alist-get type |
| 2024 | ;; We accept all types, so look for variable def | 2045 | (alist-get 'define-symbol-props |
| 2025 | ;; and then for any other kind. | 2046 | elems))))) |
| 2026 | (or (member symbol (cdr (car files))) | 2047 | ;; We accept all types, so look for variable def |
| 2027 | (and (setq match (rassq symbol (cdr (car files)))) | 2048 | ;; and then for any other kind. |
| 2028 | (not (eq 'require (car match)))))) | 2049 | (or (member symbol elems) |
| 2029 | (setq file (car (car files)) files nil)) | 2050 | (let ((match (rassq symbol elems))) |
| 2030 | (setq files (cdr files))) | 2051 | (and match |
| 2031 | file))) | 2052 | (not (eq 'require (car match))))))) |
| 2032 | 2053 | (throw 'found file)))))) | |
| 2033 | (defun method-files (method) | ||
| 2034 | "Return a list of files where METHOD is defined by `cl-defmethod'. | ||
| 2035 | The list will have entries of the form (FILE . (METHOD ...)) | ||
| 2036 | where (METHOD ...) contains the qualifiers and specializers of | ||
| 2037 | the method and is a suitable argument for | ||
| 2038 | `find-function-search-for-symbol'. Filenames are absolute." | ||
| 2039 | (let ((files load-history) | ||
| 2040 | result) | ||
| 2041 | (while files | ||
| 2042 | (let ((defs (cdr (car files)))) | ||
| 2043 | (while defs | ||
| 2044 | (let ((def (car defs))) | ||
| 2045 | (if (and (eq (car-safe def) 'cl-defmethod) | ||
| 2046 | (eq (cadr def) method)) | ||
| 2047 | (push (cons (car (car files)) (cdr def)) result))) | ||
| 2048 | (setq defs (cdr defs)))) | ||
| 2049 | (setq files (cdr files))) | ||
| 2050 | result)) | ||
| 2051 | 2054 | ||
| 2052 | (defun locate-library (library &optional nosuffix path interactive-call) | 2055 | (defun locate-library (library &optional nosuffix path interactive-call) |
| 2053 | "Show the precise file name of Emacs library LIBRARY. | 2056 | "Show the precise file name of Emacs library LIBRARY. |
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 596570ca4e2..cdc2af4a7ad 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el | |||
| @@ -4889,7 +4889,7 @@ If optional argument STATE is positive, turn borders on." | |||
| 4889 | (select-window (posn-window (event-start last-input-event))) | 4889 | (select-window (posn-window (event-start last-input-event))) |
| 4890 | (list last-input-event | 4890 | (list last-input-event |
| 4891 | (if (display-popup-menus-p) | 4891 | (if (display-popup-menus-p) |
| 4892 | (x-popup-menu last-nonmenu-event artist-popup-menu-table) | 4892 | (x-popup-menu t artist-popup-menu-table) |
| 4893 | 'no-popup-menus)))) | 4893 | 'no-popup-menus)))) |
| 4894 | 4894 | ||
| 4895 | (if (eq op 'no-popup-menus) | 4895 | (if (eq op 'no-popup-menus) |
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index b37e6dce1af..19cb7b4fea8 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el | |||
| @@ -835,7 +835,7 @@ cannot be completed sensibly: `custom-ident', | |||
| 835 | (defface css-selector '((t :inherit font-lock-function-name-face)) | 835 | (defface css-selector '((t :inherit font-lock-function-name-face)) |
| 836 | "Face to use for selectors." | 836 | "Face to use for selectors." |
| 837 | :group 'css) | 837 | :group 'css) |
| 838 | (defface css-property '((t :inherit font-lock-variable-name-face)) | 838 | (defface css-property '((t :inherit font-lock-keyword-face)) |
| 839 | "Face to use for properties." | 839 | "Face to use for properties." |
| 840 | :group 'css) | 840 | :group 'css) |
| 841 | (defface css-proprietary-property '((t :inherit (css-property italic))) | 841 | (defface css-proprietary-property '((t :inherit (css-property italic))) |
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 4912db6c53b..0edc93c9649 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; url-cookie.el --- URL cookie support | 1 | ;;; url-cookie.el --- URL cookie support -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996-1999, 2004-2017 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1996-1999, 2004-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -227,21 +227,17 @@ telling Microsoft that." | |||
| 227 | :group 'url-cookie) | 227 | :group 'url-cookie) |
| 228 | 228 | ||
| 229 | (defun url-cookie-host-can-set-p (host domain) | 229 | (defun url-cookie-host-can-set-p (host domain) |
| 230 | (let ((last nil) | 230 | (cond |
| 231 | (case-fold-search t)) | 231 | ((string= host domain) ; Apparently netscape lets you do this |
| 232 | (cond | 232 | t) |
| 233 | ((string= host domain) ; Apparently netscape lets you do this | 233 | ((zerop (length domain)) |
| 234 | t) | 234 | nil) |
| 235 | ((zerop (length domain)) | 235 | (t |
| 236 | nil) | 236 | ;; Remove the dot from wildcard domains before matching. |
| 237 | (t | 237 | (when (eq ?. (aref domain 0)) |
| 238 | ;; Remove the dot from wildcard domains before matching. | 238 | (setq domain (substring domain 1))) |
| 239 | (when (eq ?. (aref domain 0)) | 239 | (and (url-domsuf-cookie-allowed-p domain) |
| 240 | (setq domain (substring domain 1))) | 240 | (string-suffix-p domain host 'ignore-case))))) |
| 241 | (and (url-domsuf-cookie-allowed-p domain) | ||
| 242 | ;; Need to check and make sure the host is actually _in_ the | ||
| 243 | ;; domain it wants to set a cookie for though. | ||
| 244 | (string-match (concat (regexp-quote domain) "$") host)))))) | ||
| 245 | 241 | ||
| 246 | (defun url-cookie-handle-set-cookie (str) | 242 | (defun url-cookie-handle-set-cookie (str) |
| 247 | (setq url-cookies-changed-since-last-save t) | 243 | (setq url-cookies-changed-since-last-save t) |
| @@ -380,8 +376,8 @@ instead delete all cookies that do not match REGEXP." | |||
| 380 | "Display a buffer listing the current URL cookies, if there are any. | 376 | "Display a buffer listing the current URL cookies, if there are any. |
| 381 | Use \\<url-cookie-mode-map>\\[url-cookie-delete] to remove cookies." | 377 | Use \\<url-cookie-mode-map>\\[url-cookie-delete] to remove cookies." |
| 382 | (interactive) | 378 | (interactive) |
| 383 | (when (and (null url-cookie-secure-storage) | 379 | (unless (or url-cookie-secure-storage |
| 384 | (null url-cookie-storage)) | 380 | url-cookie-storage) |
| 385 | (error "No cookies are defined")) | 381 | (error "No cookies are defined")) |
| 386 | 382 | ||
| 387 | (pop-to-buffer "*url cookies*") | 383 | (pop-to-buffer "*url cookies*") |
| @@ -442,20 +438,13 @@ Use \\<url-cookie-mode-map>\\[url-cookie-delete] to remove cookies." | |||
| 442 | (forward-line 1) | 438 | (forward-line 1) |
| 443 | (point))))) | 439 | (point))))) |
| 444 | 440 | ||
| 445 | (defun url-cookie-quit () | ||
| 446 | "Kill the current buffer." | ||
| 447 | (interactive) | ||
| 448 | (kill-buffer (current-buffer))) | ||
| 449 | |||
| 450 | (defvar url-cookie-mode-map | 441 | (defvar url-cookie-mode-map |
| 451 | (let ((map (make-sparse-keymap))) | 442 | (let ((map (make-sparse-keymap))) |
| 452 | (suppress-keymap map) | ||
| 453 | (define-key map "q" 'url-cookie-quit) | ||
| 454 | (define-key map [delete] 'url-cookie-delete) | 443 | (define-key map [delete] 'url-cookie-delete) |
| 455 | (define-key map [(control k)] 'url-cookie-delete) | 444 | (define-key map [(control k)] 'url-cookie-delete) |
| 456 | map)) | 445 | map)) |
| 457 | 446 | ||
| 458 | (define-derived-mode url-cookie-mode nil "URL Cookie" | 447 | (define-derived-mode url-cookie-mode special-mode "URL Cookie" |
| 459 | "Mode for listing cookies. | 448 | "Mode for listing cookies. |
| 460 | 449 | ||
| 461 | \\{url-cookie-mode-map}" | 450 | \\{url-cookie-mode-map}" |
diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 21c39c85ca8..f94f8a6d4d2 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el | |||
| @@ -938,15 +938,15 @@ It has the following disadvantages: | |||
| 938 | - cannot use `diff -w' because the weighting causes added spaces in a line | 938 | - cannot use `diff -w' because the weighting causes added spaces in a line |
| 939 | to be represented as added copies of some line, so `diff -w' can't do the | 939 | to be represented as added copies of some line, so `diff -w' can't do the |
| 940 | right thing any more. | 940 | right thing any more. |
| 941 | - may in degenerate cases take a 1KB input region and turn it into a 1MB | 941 | - Is a bit more costly (may in degenerate cases use temp files that are 10x |
| 942 | file to pass to diff.") | 942 | larger than the refined regions).") |
| 943 | 943 | ||
| 944 | (defun smerge--refine-forward (n) | 944 | (defun smerge--refine-forward (n) |
| 945 | (let ((case-fold-search nil) | 945 | (let ((case-fold-search nil) |
| 946 | (re "[[:upper:]]?[[:lower:]]+\\|[[:upper:]]+\\|[[:digit:]]+\\|.\\|\n")) | 946 | (re "[[:upper:]]?[[:lower:]]+\\|[[:upper:]]+\\|[[:digit:]]+\\|.\\|\n")) |
| 947 | (when (and smerge-refine-ignore-whitespace | 947 | (when (and smerge-refine-ignore-whitespace |
| 948 | ;; smerge-refine-weight-hack causes additional spaces to | 948 | ;; smerge-refine-weight-hack causes additional spaces to |
| 949 | ;; appear as additional lines as well, so even if diff ignore | 949 | ;; appear as additional lines as well, so even if diff ignores |
| 950 | ;; whitespace changes, it'll report added/removed lines :-( | 950 | ;; whitespace changes, it'll report added/removed lines :-( |
| 951 | (not smerge-refine-weight-hack)) | 951 | (not smerge-refine-weight-hack)) |
| 952 | (setq re (concat "[ \t]*\\(?:" re "\\)"))) | 952 | (setq re (concat "[ \t]*\\(?:" re "\\)"))) |
| @@ -954,6 +954,8 @@ It has the following disadvantages: | |||
| 954 | (unless (looking-at re) (error "Smerge refine internal error")) | 954 | (unless (looking-at re) (error "Smerge refine internal error")) |
| 955 | (goto-char (match-end 0))))) | 955 | (goto-char (match-end 0))))) |
| 956 | 956 | ||
| 957 | (defvar smerge--refine-long-words) | ||
| 958 | |||
| 957 | (defun smerge--refine-chopup-region (beg end file &optional preproc) | 959 | (defun smerge--refine-chopup-region (beg end file &optional preproc) |
| 958 | "Chopup the region into small elements, one per line. | 960 | "Chopup the region into small elements, one per line. |
| 959 | Save the result into FILE. | 961 | Save the result into FILE. |
| @@ -976,18 +978,46 @@ chars to try and eliminate some spurious differences." | |||
| 976 | (subst-char-in-region (point-min) (point-max) ?\n ?\s)) | 978 | (subst-char-in-region (point-min) (point-max) ?\n ?\s)) |
| 977 | (goto-char (point-min)) | 979 | (goto-char (point-min)) |
| 978 | (while (not (eobp)) | 980 | (while (not (eobp)) |
| 979 | (funcall smerge-refine-forward-function 1) | 981 | (cl-assert (bolp)) |
| 980 | (let ((s (if (prog2 (forward-char -1) (bolp) (forward-char 1)) | 982 | (let ((start (point))) |
| 981 | nil | 983 | (funcall smerge-refine-forward-function 1) |
| 982 | (buffer-substring (line-beginning-position) (point))))) | 984 | (let ((len (- (point) start))) |
| 983 | ;; We add \n after each char except after \n, so we get | 985 | (cl-assert (>= len 1)) |
| 984 | ;; one line per text char, where each line contains | 986 | ;; We add \n after each chunk except after \n, so we get |
| 985 | ;; just one char, except for \n chars which are | 987 | ;; one line per text chunk, where each line contains |
| 986 | ;; represented by the empty line. | 988 | ;; just one chunk, except for \n chars which are |
| 987 | (unless (eq (char-before) ?\n) (insert ?\n)) | 989 | ;; represented by the empty line. |
| 988 | ;; HACK ALERT!! | 990 | (unless (bolp) (insert ?\n)) |
| 989 | (if smerge-refine-weight-hack | 991 | (when (and smerge-refine-weight-hack (> len 1)) |
| 990 | (dotimes (_i (1- (length s))) (insert s "\n"))))) | 992 | (let ((s (buffer-substring-no-properties start (point)))) |
| 993 | ;; The weight-hack inserts N copies of words of size N, | ||
| 994 | ;; so it naturally suffers from an O(N²) blow up. | ||
| 995 | ;; To circumvent this, we map each long word | ||
| 996 | ;; to a shorter (but still unique) replacement. | ||
| 997 | ;; Another option would be to change smerge--refine-forward | ||
| 998 | ;; so it chops up long words into smaller ones. | ||
| 999 | (when (> len 8) | ||
| 1000 | (let ((short (gethash s smerge--refine-long-words))) | ||
| 1001 | (unless short | ||
| 1002 | ;; To avoid accidental conflicts with ≤8 words, | ||
| 1003 | ;; we make sure the replacement is >8 chars. Overall, | ||
| 1004 | ;; this should bound the blowup factor to ~10x, | ||
| 1005 | ;; tho if those chars end up encoded as multiple bytes | ||
| 1006 | ;; each, it could probably still reach ~30x in | ||
| 1007 | ;; pathological cases. | ||
| 1008 | (setq short | ||
| 1009 | (concat (substring s 0 7) | ||
| 1010 | " " | ||
| 1011 | (string | ||
| 1012 | (+ ?0 | ||
| 1013 | (hash-table-count | ||
| 1014 | smerge--refine-long-words))) | ||
| 1015 | "\n")) | ||
| 1016 | (puthash s short smerge--refine-long-words)) | ||
| 1017 | (delete-region start (point)) | ||
| 1018 | (insert short) | ||
| 1019 | (setq s short))) | ||
| 1020 | (dotimes (_i (1- len)) (insert s))))))) | ||
| 991 | (unless (bolp) (error "Smerge refine internal error")) | 1021 | (unless (bolp) (error "Smerge refine internal error")) |
| 992 | (let ((coding-system-for-write 'emacs-internal)) | 1022 | (let ((coding-system-for-write 'emacs-internal)) |
| 993 | (write-region (point-min) (point-max) file nil 'nomessage)))) | 1023 | (write-region (point-min) (point-max) file nil 'nomessage)))) |
| @@ -1042,7 +1072,9 @@ used to replace chars to try and eliminate some spurious differences." | |||
| 1042 | (let* ((pos (point)) | 1072 | (let* ((pos (point)) |
| 1043 | deactivate-mark ; The code does not modify any visible buffer. | 1073 | deactivate-mark ; The code does not modify any visible buffer. |
| 1044 | (file1 (make-temp-file "diff1")) | 1074 | (file1 (make-temp-file "diff1")) |
| 1045 | (file2 (make-temp-file "diff2"))) | 1075 | (file2 (make-temp-file "diff2")) |
| 1076 | (smerge--refine-long-words | ||
| 1077 | (if smerge-refine-weight-hack (make-hash-table :test #'equal)))) | ||
| 1046 | (unless (markerp beg1) (setq beg1 (copy-marker beg1))) | 1078 | (unless (markerp beg1) (setq beg1 (copy-marker beg1))) |
| 1047 | (unless (markerp beg2) (setq beg2 (copy-marker beg2))) | 1079 | (unless (markerp beg2) (setq beg2 (copy-marker beg2))) |
| 1048 | ;; Chop up regions into smaller elements and save into files. | 1080 | ;; Chop up regions into smaller elements and save into files. |
| @@ -1062,7 +1094,7 @@ used to replace chars to try and eliminate some spurious differences." | |||
| 1062 | ;; also and more importantly because otherwise it | 1094 | ;; also and more importantly because otherwise it |
| 1063 | ;; may happen that diff doesn't behave like | 1095 | ;; may happen that diff doesn't behave like |
| 1064 | ;; smerge-refine-weight-hack expects it to. | 1096 | ;; smerge-refine-weight-hack expects it to. |
| 1065 | ;; See http://thread.gmane.org/gmane.emacs.devel/82685. | 1097 | ;; See http://thread.gmane.org/gmane.emacs.devel/82685, aka https://lists.gnu.org/archive/html/emacs-devel/2007-11/msg00401.html |
| 1066 | "-awd" "-ad") | 1098 | "-awd" "-ad") |
| 1067 | file1 file2)) | 1099 | file1 file2)) |
| 1068 | ;; Process diff's output. | 1100 | ;; Process diff's output. |
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index c6d5b16caeb..4198b9bd0e7 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; whitespace.el --- minor mode to visualize TAB, (HARD) SPACE, NEWLINE | 1 | ;;; whitespace.el --- minor mode to visualize TAB, (HARD) SPACE, NEWLINE -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000-2017 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 038d78aafea..2f135773930 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -113,6 +113,7 @@ AC_DEFUN([gl_EARLY], | |||
| 113 | # Code from module mktime-internal: | 113 | # Code from module mktime-internal: |
| 114 | # Code from module multiarch: | 114 | # Code from module multiarch: |
| 115 | # Code from module nocrash: | 115 | # Code from module nocrash: |
| 116 | # Code from module nstrftime: | ||
| 116 | # Code from module openat-h: | 117 | # Code from module openat-h: |
| 117 | # Code from module pipe2: | 118 | # Code from module pipe2: |
| 118 | # Code from module pselect: | 119 | # Code from module pselect: |
| @@ -139,7 +140,6 @@ AC_DEFUN([gl_EARLY], | |||
| 139 | # Code from module stdio: | 140 | # Code from module stdio: |
| 140 | # Code from module stdlib: | 141 | # Code from module stdlib: |
| 141 | # Code from module stpcpy: | 142 | # Code from module stpcpy: |
| 142 | # Code from module strftime: | ||
| 143 | # Code from module string: | 143 | # Code from module string: |
| 144 | # Code from module strtoimax: | 144 | # Code from module strtoimax: |
| 145 | # Code from module strtoll: | 145 | # Code from module strtoll: |
| @@ -314,6 +314,7 @@ AC_DEFUN([gl_INIT], | |||
| 314 | fi | 314 | fi |
| 315 | gl_TIME_MODULE_INDICATOR([mktime]) | 315 | gl_TIME_MODULE_INDICATOR([mktime]) |
| 316 | gl_MULTIARCH | 316 | gl_MULTIARCH |
| 317 | gl_FUNC_GNU_STRFTIME | ||
| 317 | gl_FUNC_PIPE2 | 318 | gl_FUNC_PIPE2 |
| 318 | gl_UNISTD_MODULE_INDICATOR([pipe2]) | 319 | gl_UNISTD_MODULE_INDICATOR([pipe2]) |
| 319 | gl_FUNC_PSELECT | 320 | gl_FUNC_PSELECT |
| @@ -365,7 +366,6 @@ AC_DEFUN([gl_INIT], | |||
| 365 | gl_PREREQ_STPCPY | 366 | gl_PREREQ_STPCPY |
| 366 | fi | 367 | fi |
| 367 | gl_STRING_MODULE_INDICATOR([stpcpy]) | 368 | gl_STRING_MODULE_INDICATOR([stpcpy]) |
| 368 | gl_FUNC_GNU_STRFTIME | ||
| 369 | gl_HEADER_STRING_H | 369 | gl_HEADER_STRING_H |
| 370 | gl_FUNC_STRTOIMAX | 370 | gl_FUNC_STRTOIMAX |
| 371 | if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then | 371 | if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then |
| @@ -893,6 +893,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 893 | lib/mkostemp.c | 893 | lib/mkostemp.c |
| 894 | lib/mktime-internal.h | 894 | lib/mktime-internal.h |
| 895 | lib/mktime.c | 895 | lib/mktime.c |
| 896 | lib/nstrftime.c | ||
| 896 | lib/openat-priv.h | 897 | lib/openat-priv.h |
| 897 | lib/openat-proc.c | 898 | lib/openat-proc.c |
| 898 | lib/openat.h | 899 | lib/openat.h |
| @@ -924,7 +925,6 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 924 | lib/stdio.in.h | 925 | lib/stdio.in.h |
| 925 | lib/stdlib.in.h | 926 | lib/stdlib.in.h |
| 926 | lib/stpcpy.c | 927 | lib/stpcpy.c |
| 927 | lib/strftime.c | ||
| 928 | lib/strftime.h | 928 | lib/strftime.h |
| 929 | lib/string.in.h | 929 | lib/string.in.h |
| 930 | lib/strtoimax.c | 930 | lib/strtoimax.c |
| @@ -1013,6 +1013,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 1013 | m4/mktime.m4 | 1013 | m4/mktime.m4 |
| 1014 | m4/multiarch.m4 | 1014 | m4/multiarch.m4 |
| 1015 | m4/nocrash.m4 | 1015 | m4/nocrash.m4 |
| 1016 | m4/nstrftime.m4 | ||
| 1016 | m4/off_t.m4 | 1017 | m4/off_t.m4 |
| 1017 | m4/pipe2.m4 | 1018 | m4/pipe2.m4 |
| 1018 | m4/pselect.m4 | 1019 | m4/pselect.m4 |
| @@ -1037,7 +1038,6 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 1037 | m4/stdio_h.m4 | 1038 | m4/stdio_h.m4 |
| 1038 | m4/stdlib_h.m4 | 1039 | m4/stdlib_h.m4 |
| 1039 | m4/stpcpy.m4 | 1040 | m4/stpcpy.m4 |
| 1040 | m4/strftime.m4 | ||
| 1041 | m4/string_h.m4 | 1041 | m4/string_h.m4 |
| 1042 | m4/strtoimax.m4 | 1042 | m4/strtoimax.m4 |
| 1043 | m4/strtoll.m4 | 1043 | m4/strtoll.m4 |
diff --git a/m4/strftime.m4 b/m4/nstrftime.m4 index d2dac9e2328..d2dac9e2328 100644 --- a/m4/strftime.m4 +++ b/m4/nstrftime.m4 | |||
diff --git a/nextstep/INSTALL b/nextstep/INSTALL index 799cd4d866a..b7e84e018ee 100644 --- a/nextstep/INSTALL +++ b/nextstep/INSTALL | |||
| @@ -21,15 +21,23 @@ In the top-level directory, use: | |||
| 21 | 21 | ||
| 22 | (On macOS, --with-ns is enabled by default.) | 22 | (On macOS, --with-ns is enabled by default.) |
| 23 | 23 | ||
| 24 | This will compile all the files, but emacs will not be able to be run except | 24 | Then run: |
| 25 | in -nw (terminal) mode. | ||
| 26 | 25 | ||
| 27 | In order to run Emacs.app, you must run: | 26 | make |
| 27 | |||
| 28 | This will compile all the files. | ||
| 29 | |||
| 30 | In order to run Emacs, you must run: | ||
| 31 | |||
| 32 | src/emacs | ||
| 33 | |||
| 34 | In order to install Emacs, you must run: | ||
| 28 | 35 | ||
| 29 | make install | 36 | make install |
| 30 | 37 | ||
| 31 | This will assemble the app in nextstep/Emacs.app (i.e., the --prefix | 38 | This will assemble the app in nextstep/Emacs.app (i.e., the --prefix |
| 32 | argument has no effect in this case). | 39 | argument has no effect in this case). You can then move the Emacs.app |
| 40 | bundle to a location of your choice. | ||
| 33 | 41 | ||
| 34 | If you pass the --disable-ns-self-contained option to configure, the lisp | 42 | If you pass the --disable-ns-self-contained option to configure, the lisp |
| 35 | files will be installed under whatever 'prefix' is set to (defaults to | 43 | files will be installed under whatever 'prefix' is set to (defaults to |
diff --git a/src/alloc.c b/src/alloc.c index 5d02bb3cfbb..73d33564843 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6943,7 +6943,7 @@ sweep_symbols (void) | |||
| 6943 | symbol_free_list = NULL; | 6943 | symbol_free_list = NULL; |
| 6944 | 6944 | ||
| 6945 | for (int i = 0; i < ARRAYELTS (lispsym); i++) | 6945 | for (int i = 0; i < ARRAYELTS (lispsym); i++) |
| 6946 | lispsym[i].gcmarkbit = 0; | 6946 | lispsym[i].s.gcmarkbit = 0; |
| 6947 | 6947 | ||
| 6948 | for (sblk = symbol_block; sblk; sblk = *sprev) | 6948 | for (sblk = symbol_block; sblk; sblk = *sprev) |
| 6949 | { | 6949 | { |
diff --git a/src/lisp.h b/src/lisp.h index 9464bf8559f..cffaf954b3b 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -838,13 +838,13 @@ make_lisp_symbol (struct Lisp_Symbol *sym) | |||
| 838 | INLINE Lisp_Object | 838 | INLINE Lisp_Object |
| 839 | builtin_lisp_symbol (int index) | 839 | builtin_lisp_symbol (int index) |
| 840 | { | 840 | { |
| 841 | return make_lisp_symbol (lispsym + index); | 841 | return make_lisp_symbol (&lispsym[index].s); |
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | INLINE void | 844 | INLINE void |
| 845 | (CHECK_SYMBOL) (Lisp_Object x) | 845 | (CHECK_SYMBOL) (Lisp_Object x) |
| 846 | { | 846 | { |
| 847 | lisp_h_CHECK_SYMBOL (x); | 847 | lisp_h_CHECK_SYMBOL (x); |
| 848 | } | 848 | } |
| 849 | 849 | ||
| 850 | /* In the size word of a vector, this bit means the vector has been marked. */ | 850 | /* In the size word of a vector, this bit means the vector has been marked. */ |
diff --git a/src/lread.c b/src/lread.c index 901e40b3489..dbaadce4b40 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -3479,6 +3479,24 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 3479 | if (! NILP (result)) | 3479 | if (! NILP (result)) |
| 3480 | return unbind_to (count, result); | 3480 | return unbind_to (count, result); |
| 3481 | } | 3481 | } |
| 3482 | if (!quoted && multibyte) | ||
| 3483 | { | ||
| 3484 | int ch = STRING_CHAR ((unsigned char *) read_buffer); | ||
| 3485 | switch (ch) | ||
| 3486 | { | ||
| 3487 | case 0x2018: /* LEFT SINGLE QUOTATION MARK */ | ||
| 3488 | case 0x2019: /* RIGHT SINGLE QUOTATION MARK */ | ||
| 3489 | case 0x201B: /* SINGLE HIGH-REVERSED-9 QUOTATION MARK */ | ||
| 3490 | case 0x201C: /* LEFT DOUBLE QUOTATION MARK */ | ||
| 3491 | case 0x201D: /* RIGHT DOUBLE QUOTATION MARK */ | ||
| 3492 | case 0x201F: /* DOUBLE HIGH-REVERSED-9 QUOTATION MARK */ | ||
| 3493 | case 0x301E: /* DOUBLE PRIME QUOTATION MARK */ | ||
| 3494 | case 0xFF02: /* FULLWIDTH QUOTATION MARK */ | ||
| 3495 | case 0xFF07: /* FULLWIDTH APOSTROPHE */ | ||
| 3496 | xsignal2 (Qinvalid_read_syntax, build_string ("strange quote"), | ||
| 3497 | CALLN (Fstring, make_number (ch))); | ||
| 3498 | } | ||
| 3499 | } | ||
| 3482 | { | 3500 | { |
| 3483 | Lisp_Object result; | 3501 | Lisp_Object result; |
| 3484 | ptrdiff_t nbytes = p - read_buffer; | 3502 | ptrdiff_t nbytes = p - read_buffer; |
diff --git a/src/minibuf.c b/src/minibuf.c index d4128ce01c1..010152930bc 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -497,6 +497,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 497 | Fcons (Vminibuffer_history_position, | 497 | Fcons (Vminibuffer_history_position, |
| 498 | Fcons (Vminibuffer_history_variable, | 498 | Fcons (Vminibuffer_history_variable, |
| 499 | minibuf_save_list)))))); | 499 | minibuf_save_list)))))); |
| 500 | minibuf_save_list | ||
| 501 | = Fcons (Fthis_command_keys_vector (), minibuf_save_list); | ||
| 500 | 502 | ||
| 501 | record_unwind_protect_void (read_minibuf_unwind); | 503 | record_unwind_protect_void (read_minibuf_unwind); |
| 502 | minibuf_level++; | 504 | minibuf_level++; |
| @@ -836,6 +838,11 @@ read_minibuf_unwind (void) | |||
| 836 | Fset_buffer (XWINDOW (window)->contents); | 838 | Fset_buffer (XWINDOW (window)->contents); |
| 837 | 839 | ||
| 838 | /* Restore prompt, etc, from outer minibuffer level. */ | 840 | /* Restore prompt, etc, from outer minibuffer level. */ |
| 841 | Lisp_Object key_vec = Fcar (minibuf_save_list); | ||
| 842 | eassert (VECTORP (key_vec)); | ||
| 843 | this_command_key_count = XFASTINT (Flength (key_vec)); | ||
| 844 | this_command_keys = key_vec; | ||
| 845 | minibuf_save_list = Fcdr (minibuf_save_list); | ||
| 839 | minibuf_prompt = Fcar (minibuf_save_list); | 846 | minibuf_prompt = Fcar (minibuf_save_list); |
| 840 | minibuf_save_list = Fcdr (minibuf_save_list); | 847 | minibuf_save_list = Fcdr (minibuf_save_list); |
| 841 | minibuf_prompt_width = XFASTINT (Fcar (minibuf_save_list)); | 848 | minibuf_prompt_width = XFASTINT (Fcar (minibuf_save_list)); |
diff --git a/src/nsterm.m b/src/nsterm.m index a3c7031331a..36d906a7cec 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -5497,6 +5497,19 @@ ns_term_shutdown (int sig) | |||
| 5497 | object:nil]; | 5497 | object:nil]; |
| 5498 | #endif | 5498 | #endif |
| 5499 | 5499 | ||
| 5500 | #ifdef NS_IMPL_COCOA | ||
| 5501 | if ([NSApp activationPolicy] == NSApplicationActivationPolicyProhibited) { | ||
| 5502 | /* Set the app's activation policy to regular when we run outside | ||
| 5503 | of a bundle. This is already done for us by Info.plist when we | ||
| 5504 | run inside a bundle. */ | ||
| 5505 | [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; | ||
| 5506 | [NSApp setApplicationIconImage: | ||
| 5507 | [EmacsImage | ||
| 5508 | allocInitFromFile: | ||
| 5509 | build_string("icons/hicolor/128x128/apps/emacs.png")]]; | ||
| 5510 | } | ||
| 5511 | #endif | ||
| 5512 | |||
| 5500 | ns_send_appdefined (-2); | 5513 | ns_send_appdefined (-2); |
| 5501 | } | 5514 | } |
| 5502 | 5515 | ||
diff --git a/src/regex.c b/src/regex.c index fb48765c96c..0dbb47309e4 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -1942,7 +1942,7 @@ struct range_table_work_area | |||
| 1942 | returned. If name is not a valid character class name zero, or RECC_ERROR, | 1942 | returned. If name is not a valid character class name zero, or RECC_ERROR, |
| 1943 | is returned. | 1943 | is returned. |
| 1944 | 1944 | ||
| 1945 | Otherwise, if *strp doesn’t begin with "[:name:]", -1 is returned. | 1945 | Otherwise, if *strp doesn't begin with "[:name:]", -1 is returned. |
| 1946 | 1946 | ||
| 1947 | The function can be used on ASCII and multibyte (UTF-8-encoded) strings. | 1947 | The function can be used on ASCII and multibyte (UTF-8-encoded) strings. |
| 1948 | */ | 1948 | */ |
| @@ -1954,8 +1954,8 @@ re_wctype_parse (const unsigned char **strp, unsigned limit) | |||
| 1954 | if (limit < 4 || beg[0] != '[' || beg[1] != ':') | 1954 | if (limit < 4 || beg[0] != '[' || beg[1] != ':') |
| 1955 | return -1; | 1955 | return -1; |
| 1956 | 1956 | ||
| 1957 | beg += 2; /* skip opening ‘[:’ */ | 1957 | beg += 2; /* skip opening "[:" */ |
| 1958 | limit -= 3; /* opening ‘[:’ and half of closing ‘:]’; --limit handles rest */ | 1958 | limit -= 3; /* opening "[:" and half of closing ":]"; --limit handles rest */ |
| 1959 | for (it = beg; it[0] != ':' || it[1] != ']'; ++it) | 1959 | for (it = beg; it[0] != ':' || it[1] != ']'; ++it) |
| 1960 | if (!--limit) | 1960 | if (!--limit) |
| 1961 | return -1; | 1961 | return -1; |
| @@ -1985,7 +1985,7 @@ re_wctype_parse (const unsigned char **strp, unsigned limit) | |||
| 1985 | 2 [:cntrl:] | 1985 | 2 [:cntrl:] |
| 1986 | 1 [:ff:] | 1986 | 1 [:ff:] |
| 1987 | 1987 | ||
| 1988 | If you update this list, consider also updating chain of or’ed conditions | 1988 | If you update this list, consider also updating chain of or'ed conditions |
| 1989 | in execute_charset function. | 1989 | in execute_charset function. |
| 1990 | */ | 1990 | */ |
| 1991 | 1991 | ||
diff --git a/src/regex.h b/src/regex.h index 1d439de259c..5e3a79763ec 100644 --- a/src/regex.h +++ b/src/regex.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #define _REGEX_H 1 | 21 | #define _REGEX_H 1 |
| 22 | 22 | ||
| 23 | #if defined emacs && (defined _REGEX_RE_COMP || defined _LIBC) | 23 | #if defined emacs && (defined _REGEX_RE_COMP || defined _LIBC) |
| 24 | /* We’re not defining re_set_syntax and using a different prototype of | 24 | /* We're not defining re_set_syntax and using a different prototype of |
| 25 | re_compile_pattern when building Emacs so fail compilation early with | 25 | re_compile_pattern when building Emacs so fail compilation early with |
| 26 | a (somewhat helpful) error message when conflict is detected. */ | 26 | a (somewhat helpful) error message when conflict is detected. */ |
| 27 | # error "_REGEX_RE_COMP nor _LIBC can be defined if emacs is defined." | 27 | # error "_REGEX_RE_COMP nor _LIBC can be defined if emacs is defined." |
diff --git a/src/xdisp.c b/src/xdisp.c index 3e5657ffe6f..422912e57a6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -32745,7 +32745,7 @@ even if the actual number needs less space. | |||
| 32745 | The default value of nil means compute the space dynamically. | 32745 | The default value of nil means compute the space dynamically. |
| 32746 | Any other value is treated as nil. */); | 32746 | Any other value is treated as nil. */); |
| 32747 | Vdisplay_line_numbers_width = Qnil; | 32747 | Vdisplay_line_numbers_width = Qnil; |
| 32748 | DEFSYM (Qdisplay_line_numbers_width, "display-line-number-width"); | 32748 | DEFSYM (Qdisplay_line_numbers_width, "display-line-numbers-width"); |
| 32749 | Fmake_variable_buffer_local (Qdisplay_line_numbers_width); | 32749 | Fmake_variable_buffer_local (Qdisplay_line_numbers_width); |
| 32750 | 32750 | ||
| 32751 | DEFVAR_LISP ("display-line-numbers-current-absolute", | 32751 | DEFVAR_LISP ("display-line-numbers-current-absolute", |
diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el index 2634777c7db..9753029f198 100644 --- a/test/lisp/auth-source-tests.el +++ b/test/lisp/auth-source-tests.el | |||
| @@ -215,7 +215,7 @@ | |||
| 215 | 215 | ||
| 216 | (ert-deftest auth-source-test-remembrances-of-things-past () | 216 | (ert-deftest auth-source-test-remembrances-of-things-past () |
| 217 | (let ((password-cache t) | 217 | (let ((password-cache t) |
| 218 | (password-data (make-vector 7 0))) | 218 | (password-data (copy-hash-table password-data))) |
| 219 | (auth-source-remember '(:host "wedd") '(4 5 6)) | 219 | (auth-source-remember '(:host "wedd") '(4 5 6)) |
| 220 | (should (auth-source-remembered-p '(:host "wedd"))) | 220 | (should (auth-source-remembered-p '(:host "wedd"))) |
| 221 | (should-not (auth-source-remembered-p '(:host "xedd"))) | 221 | (should-not (auth-source-remembered-p '(:host "xedd"))) |
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index bd1816172e7..cd58edaa3f8 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el | |||
| @@ -38,19 +38,21 @@ | |||
| 38 | (file "test") | 38 | (file "test") |
| 39 | (full-name (expand-file-name file dir)) | 39 | (full-name (expand-file-name file dir)) |
| 40 | (regexp "bar") | 40 | (regexp "bar") |
| 41 | (dired-always-read-filesystem t)) | 41 | (dired-always-read-filesystem t) buffers) |
| 42 | (if (file-exists-p dir) | 42 | (if (file-exists-p dir) |
| 43 | (delete-directory dir 'recursive)) | 43 | (delete-directory dir 'recursive)) |
| 44 | (make-directory dir) | 44 | (make-directory dir) |
| 45 | (with-temp-file full-name (insert "foo")) | 45 | (with-temp-file full-name (insert "foo")) |
| 46 | (find-file-noselect full-name) | 46 | (push (find-file-noselect full-name) buffers) |
| 47 | (dired dir) | 47 | (push (dired dir) buffers) |
| 48 | (with-temp-file full-name (insert "bar")) | 48 | (with-temp-file full-name (insert "bar")) |
| 49 | (dired-mark-files-containing-regexp regexp) | 49 | (dired-mark-files-containing-regexp regexp) |
| 50 | (unwind-protect | 50 | (unwind-protect |
| 51 | (should (equal (dired-get-marked-files nil nil nil 'distinguish-1-mark) | 51 | (should (equal (dired-get-marked-files nil nil nil 'distinguish-1-mark) |
| 52 | `(t ,full-name))) | 52 | `(t ,full-name))) |
| 53 | ;; Clean up | 53 | ;; Clean up |
| 54 | (dolist (buf buffers) | ||
| 55 | (when (buffer-live-p buf) (kill-buffer buf))) | ||
| 54 | (delete-directory dir 'recursive)))) | 56 | (delete-directory dir 'recursive)))) |
| 55 | 57 | ||
| 56 | (ert-deftest dired-test-bug25609 () | 58 | (ert-deftest dired-test-bug25609 () |
| @@ -60,7 +62,8 @@ | |||
| 60 | (target (expand-file-name (file-name-nondirectory from) to)) | 62 | (target (expand-file-name (file-name-nondirectory from) to)) |
| 61 | (nested (expand-file-name (file-name-nondirectory from) target)) | 63 | (nested (expand-file-name (file-name-nondirectory from) target)) |
| 62 | (dired-dwim-target t) | 64 | (dired-dwim-target t) |
| 63 | (dired-recursive-copies 'always)) ; Don't prompt me. | 65 | (dired-recursive-copies 'always) ; Don't prompt me. |
| 66 | buffers) | ||
| 64 | (advice-add 'dired-query ; Don't ask confirmation to overwrite a file. | 67 | (advice-add 'dired-query ; Don't ask confirmation to overwrite a file. |
| 65 | :override | 68 | :override |
| 66 | (lambda (_sym _prompt &rest _args) (setq dired-query t)) | 69 | (lambda (_sym _prompt &rest _args) (setq dired-query t)) |
| @@ -70,8 +73,8 @@ | |||
| 70 | (lambda (_prompt _coll &optional _pred _match init _hist _def _inherit _keymap) | 73 | (lambda (_prompt _coll &optional _pred _match init _hist _def _inherit _keymap) |
| 71 | init) | 74 | init) |
| 72 | '((name . "advice-completing-read"))) | 75 | '((name . "advice-completing-read"))) |
| 73 | (dired to) | 76 | (push (dired to) buffers) |
| 74 | (dired-other-window temporary-file-directory) | 77 | (push (dired-other-window temporary-file-directory) buffers) |
| 75 | (dired-goto-file from) | 78 | (dired-goto-file from) |
| 76 | (dired-do-copy) | 79 | (dired-do-copy) |
| 77 | (dired-do-copy); Again. | 80 | (dired-do-copy); Again. |
| @@ -79,18 +82,80 @@ | |||
| 79 | (progn | 82 | (progn |
| 80 | (should (file-exists-p target)) | 83 | (should (file-exists-p target)) |
| 81 | (should-not (file-exists-p nested))) | 84 | (should-not (file-exists-p nested))) |
| 85 | (dolist (buf buffers) | ||
| 86 | (when (buffer-live-p buf) (kill-buffer buf))) | ||
| 82 | (delete-directory from 'recursive) | 87 | (delete-directory from 'recursive) |
| 83 | (delete-directory to 'recursive) | 88 | (delete-directory to 'recursive) |
| 84 | (advice-remove 'dired-query "advice-dired-query") | 89 | (advice-remove 'dired-query "advice-dired-query") |
| 85 | (advice-remove 'completing-read "advice-completing-read")))) | 90 | (advice-remove 'completing-read "advice-completing-read")))) |
| 86 | 91 | ||
| 87 | (ert-deftest dired-test-bug27243 () | 92 | ;; (ert-deftest dired-test-bug27243 () |
| 88 | "Test for http://debbugs.gnu.org/27243 ." | 93 | ;; "Test for http://debbugs.gnu.org/27243 ." |
| 94 | ;; (let ((test-dir (make-temp-file "test-dir-" t)) | ||
| 95 | ;; (dired-auto-revert-buffer t) buffers) | ||
| 96 | ;; (with-current-buffer (find-file-noselect test-dir) | ||
| 97 | ;; (make-directory "test-subdir")) | ||
| 98 | ;; (push (dired test-dir) buffers) | ||
| 99 | ;; (unwind-protect | ||
| 100 | ;; (let ((buf (current-buffer)) | ||
| 101 | ;; (pt1 (point)) | ||
| 102 | ;; (test-file (concat (file-name-as-directory "test-subdir") | ||
| 103 | ;; "test-file"))) | ||
| 104 | ;; (write-region "Test" nil test-file nil 'silent nil 'excl) | ||
| 105 | ;; ;; Sanity check: point should now be on the subdirectory. | ||
| 106 | ;; (should (equal (dired-file-name-at-point) | ||
| 107 | ;; (concat (file-name-as-directory test-dir) | ||
| 108 | ;; (file-name-as-directory "test-subdir")))) | ||
| 109 | ;; (push (dired-find-file) buffers) | ||
| 110 | ;; (let ((pt2 (point))) ; Point is on test-file. | ||
| 111 | ;; (switch-to-buffer buf) | ||
| 112 | ;; ;; Sanity check: point should now be back on the subdirectory. | ||
| 113 | ;; (should (eq (point) pt1)) | ||
| 114 | ;; ;; Case 1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#5 | ||
| 115 | ;; (push (dired-find-file) buffers) | ||
| 116 | ;; (should (eq (point) pt2)) | ||
| 117 | ;; ;; Case 2: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#28 | ||
| 118 | ;; (push (dired test-dir) buffers) | ||
| 119 | ;; (should (eq (point) pt1)))) | ||
| 120 | ;; (dolist (buf buffers) | ||
| 121 | ;; (when (buffer-live-p buf) (kill-buffer buf))) | ||
| 122 | ;; (delete-directory test-dir t)))) | ||
| 123 | |||
| 124 | (ert-deftest dired-test-bug27243-01 () | ||
| 125 | "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#5 ." | ||
| 126 | (let ((test-dir (make-temp-file "test-dir-" t)) | ||
| 127 | (dired-auto-revert-buffer t) buffers) | ||
| 128 | (with-current-buffer (find-file-noselect test-dir) | ||
| 129 | (make-directory "test-subdir")) | ||
| 130 | (push (dired test-dir) buffers) | ||
| 131 | (unwind-protect | ||
| 132 | (let ((buf (current-buffer)) | ||
| 133 | (pt1 (point)) | ||
| 134 | (test-file (concat (file-name-as-directory "test-subdir") | ||
| 135 | "test-file"))) | ||
| 136 | (write-region "Test" nil test-file nil 'silent nil 'excl) | ||
| 137 | ;; Sanity check: point should now be on the subdirectory. | ||
| 138 | (should (equal (dired-file-name-at-point) | ||
| 139 | (concat (file-name-as-directory test-dir) | ||
| 140 | (file-name-as-directory "test-subdir")))) | ||
| 141 | (push (dired-find-file) buffers) | ||
| 142 | (let ((pt2 (point))) ; Point is on test-file. | ||
| 143 | (switch-to-buffer buf) | ||
| 144 | ;; Sanity check: point should now be back on the subdirectory. | ||
| 145 | (should (eq (point) pt1)) | ||
| 146 | (push (dired-find-file) buffers) | ||
| 147 | (should (eq (point) pt2)))) | ||
| 148 | (dolist (buf buffers) | ||
| 149 | (when (buffer-live-p buf) (kill-buffer buf))) | ||
| 150 | (delete-directory test-dir t)))) | ||
| 151 | |||
| 152 | (ert-deftest dired-test-bug27243-02 () | ||
| 153 | "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#28 ." | ||
| 89 | (let ((test-dir (make-temp-file "test-dir-" t)) | 154 | (let ((test-dir (make-temp-file "test-dir-" t)) |
| 90 | (dired-auto-revert-buffer t)) | 155 | (dired-auto-revert-buffer t) buffers) |
| 91 | (with-current-buffer (find-file-noselect test-dir) | 156 | (with-current-buffer (find-file-noselect test-dir) |
| 92 | (make-directory "test-subdir")) | 157 | (make-directory "test-subdir")) |
| 93 | (dired test-dir) | 158 | (push (dired test-dir) buffers) |
| 94 | (unwind-protect | 159 | (unwind-protect |
| 95 | (let ((buf (current-buffer)) | 160 | (let ((buf (current-buffer)) |
| 96 | (pt1 (point)) | 161 | (pt1 (point)) |
| @@ -101,17 +166,48 @@ | |||
| 101 | (should (equal (dired-file-name-at-point) | 166 | (should (equal (dired-file-name-at-point) |
| 102 | (concat (file-name-as-directory test-dir) | 167 | (concat (file-name-as-directory test-dir) |
| 103 | (file-name-as-directory "test-subdir")))) | 168 | (file-name-as-directory "test-subdir")))) |
| 104 | (dired-find-file) | 169 | (push (dired-find-file) buffers) |
| 105 | (let ((pt2 (point))) ; Point is on test-file. | 170 | (let ((pt2 (point))) ; Point is on test-file. |
| 106 | (switch-to-buffer buf) | 171 | (switch-to-buffer buf) |
| 107 | ;; Sanity check: point should now be back on the subdirectory. | 172 | ;; Sanity check: point should now be back on the subdirectory. |
| 108 | (should (eq (point) pt1)) | 173 | (should (eq (point) pt1)) |
| 109 | ;; Case 1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#5 | 174 | (push (dired test-dir) buffers) |
| 110 | (dired-find-file) | ||
| 111 | (should (eq (point) pt2)) | ||
| 112 | ;; Case 2: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#28 | ||
| 113 | (dired test-dir) | ||
| 114 | (should (eq (point) pt1)))) | 175 | (should (eq (point) pt1)))) |
| 176 | (dolist (buf buffers) | ||
| 177 | (when (buffer-live-p buf) (kill-buffer buf))) | ||
| 178 | (delete-directory test-dir t)))) | ||
| 179 | |||
| 180 | (ert-deftest dired-test-bug27243-03 () | ||
| 181 | "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#61 ." | ||
| 182 | (let ((test-dir (make-temp-file "test-dir-" t)) | ||
| 183 | (dired-auto-revert-buffer t) | ||
| 184 | test-subdir1 test-subdir2 allbufs) | ||
| 185 | (unwind-protect | ||
| 186 | (progn | ||
| 187 | (with-current-buffer (find-file-noselect test-dir) | ||
| 188 | (push (current-buffer) allbufs) | ||
| 189 | (make-directory "test-subdir1") | ||
| 190 | (make-directory "test-subdir2") | ||
| 191 | (let ((test-file1 "test-file1") | ||
| 192 | (test-file2 "test-file2")) | ||
| 193 | (with-current-buffer (find-file-noselect "test-subdir1") | ||
| 194 | (push (current-buffer) allbufs) | ||
| 195 | (write-region "Test1" nil test-file1 nil 'silent nil 'excl)) | ||
| 196 | (with-current-buffer (find-file-noselect "test-subdir2") | ||
| 197 | (push (current-buffer) allbufs) | ||
| 198 | (write-region "Test2" nil test-file2 nil 'silent nil 'excl)))) | ||
| 199 | ;; Call find-file with a wild card and test point in each file. | ||
| 200 | (let ((buffers (find-file (concat (file-name-as-directory test-dir) | ||
| 201 | "*") | ||
| 202 | t))) | ||
| 203 | (dolist (buf buffers) | ||
| 204 | (let ((pt (with-current-buffer buf (point)))) | ||
| 205 | (switch-to-buffer (find-file-noselect test-dir)) | ||
| 206 | (find-file (buffer-name buf)) | ||
| 207 | (should (equal (point) pt)))) | ||
| 208 | (append buffers allbufs))) | ||
| 209 | (dolist (buf allbufs) | ||
| 210 | (when (buffer-live-p buf) (kill-buffer buf))) | ||
| 115 | (delete-directory test-dir t)))) | 211 | (delete-directory test-dir t)))) |
| 116 | 212 | ||
| 117 | (ert-deftest dired-test-bug27693 () | 213 | (ert-deftest dired-test-bug27693 () |
| @@ -168,5 +264,56 @@ | |||
| 168 | (should (looking-at "src"))) | 264 | (should (looking-at "src"))) |
| 169 | (when (buffer-live-p buf) (kill-buffer buf))))) | 265 | (when (buffer-live-p buf) (kill-buffer buf))))) |
| 170 | 266 | ||
| 267 | (ert-deftest dired-test-bug27817 () | ||
| 268 | "Test for http://debbugs.gnu.org/27817 ." | ||
| 269 | (require 'em-ls) | ||
| 270 | (let ((orig eshell-ls-use-in-dired) | ||
| 271 | (dired-use-ls-dired 'unspecified) | ||
| 272 | buf insert-directory-program) | ||
| 273 | (unwind-protect | ||
| 274 | (progn | ||
| 275 | (customize-set-variable 'eshell-ls-use-in-dired t) | ||
| 276 | (should (setq buf (dired source-directory)))) | ||
| 277 | (customize-set-variable 'eshell-ls-use-in-dired orig) | ||
| 278 | (and (buffer-live-p buf) (kill-buffer))))) | ||
| 279 | |||
| 280 | (ert-deftest dired-test-bug27631 () | ||
| 281 | "Test for http://debbugs.gnu.org/27631 ." | ||
| 282 | (let* ((dir (make-temp-file "bug27631" 'dir)) | ||
| 283 | (dir1 (expand-file-name "dir1" dir)) | ||
| 284 | (dir2 (expand-file-name "dir2" dir)) | ||
| 285 | (default-directory dir) | ||
| 286 | buf) | ||
| 287 | (unwind-protect | ||
| 288 | (progn | ||
| 289 | (make-directory dir1) | ||
| 290 | (make-directory dir2) | ||
| 291 | (with-temp-file (expand-file-name "a.txt" dir1)) | ||
| 292 | (with-temp-file (expand-file-name "b.txt" dir2)) | ||
| 293 | (setq buf (dired (expand-file-name "dir*/*.txt" dir))) | ||
| 294 | (dired-toggle-marks) | ||
| 295 | (should (cdr (dired-get-marked-files))) | ||
| 296 | ;; Must work with ls-lisp ... | ||
| 297 | (require 'ls-lisp) | ||
| 298 | (kill-buffer buf) | ||
| 299 | (setq default-directory dir) | ||
| 300 | (let (ls-lisp-use-insert-directory-program) | ||
| 301 | (setq buf (dired (expand-file-name "dir*/*.txt" dir))) | ||
| 302 | (dired-toggle-marks) | ||
| 303 | (should (cdr (dired-get-marked-files)))) | ||
| 304 | ;; ... And with em-ls as well. | ||
| 305 | (kill-buffer buf) | ||
| 306 | (setq default-directory dir) | ||
| 307 | (unload-feature 'ls-lisp 'force) | ||
| 308 | (require 'em-ls) | ||
| 309 | (let ((orig eshell-ls-use-in-dired)) | ||
| 310 | (customize-set-value 'eshell-ls-use-in-dired t) | ||
| 311 | (setq buf (dired (expand-file-name "dir*/*.txt" dir))) | ||
| 312 | (dired-toggle-marks) | ||
| 313 | (should (cdr (dired-get-marked-files))))) | ||
| 314 | (delete-directory dir 'recursive) | ||
| 315 | (when (buffer-live-p buf) (kill-buffer buf))))) | ||
| 316 | |||
| 317 | |||
| 171 | (provide 'dired-tests) | 318 | (provide 'dired-tests) |
| 172 | ;; dired-tests.el ends here | 319 | ;; dired-tests.el ends here |
diff --git a/test/lisp/emacs-lisp/cl-generic-tests.el b/test/lisp/emacs-lisp/cl-generic-tests.el index 0768e31f7e6..31f65413c88 100644 --- a/test/lisp/emacs-lisp/cl-generic-tests.el +++ b/test/lisp/emacs-lisp/cl-generic-tests.el | |||
| @@ -219,5 +219,29 @@ | |||
| 219 | (should (equal (cl--generic-1 '(5) nil) '("cinq" (5)))) | 219 | (should (equal (cl--generic-1 '(5) nil) '("cinq" (5)))) |
| 220 | (should (equal (cl--generic-1 '(6) nil) '("six" a)))) | 220 | (should (equal (cl--generic-1 '(6) nil) '("six" a)))) |
| 221 | 221 | ||
| 222 | (cl-defgeneric cl-generic-tests--generic (x)) | ||
| 223 | (cl-defmethod cl-generic-tests--generic ((x string)) | ||
| 224 | (message "%s is a string" x)) | ||
| 225 | (cl-defmethod cl-generic-tests--generic ((x integer)) | ||
| 226 | (message "%s is a number" x)) | ||
| 227 | (cl-defgeneric cl-generic-tests--generic-without-methods (x y)) | ||
| 228 | (defvar cl-generic-tests--this-file | ||
| 229 | (file-truename (or load-file-name buffer-file-name))) | ||
| 230 | |||
| 231 | (ert-deftest cl-generic-tests--method-files--finds-methods () | ||
| 232 | "`method-files' returns a list of files and methods for a generic function." | ||
| 233 | (let ((retval (cl--generic-method-files 'cl-generic-tests--generic))) | ||
| 234 | (should (equal (length retval) 2)) | ||
| 235 | (mapc (lambda (x) | ||
| 236 | (should (equal (car x) cl-generic-tests--this-file)) | ||
| 237 | (should (equal (cadr x) 'cl-generic-tests--generic))) | ||
| 238 | retval) | ||
| 239 | (should-not (equal (nth 0 retval) (nth 1 retval))))) | ||
| 240 | |||
| 241 | (ert-deftest cl-generic-tests--method-files--nonexistent-methods () | ||
| 242 | "`method-files' returns nil if asked to find a method which doesn't exist." | ||
| 243 | (should-not (cl--generic-method-files 'cl-generic-tests--undefined-generic)) | ||
| 244 | (should-not (cl--generic-method-files 'cl-generic-tests--generic-without-methods))) | ||
| 245 | |||
| 222 | (provide 'cl-generic-tests) | 246 | (provide 'cl-generic-tests) |
| 223 | ;;; cl-generic-tests.el ends here | 247 | ;;; cl-generic-tests.el ends here |
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el index 317838b250f..57463ad932d 100644 --- a/test/lisp/emacs-lisp/ert-tests.el +++ b/test/lisp/emacs-lisp/ert-tests.el | |||
| @@ -352,7 +352,7 @@ This macro is used to test if macroexpansion in `should' works." | |||
| 352 | (let ((abc (ert-get-test 'ert-test-abc))) | 352 | (let ((abc (ert-get-test 'ert-test-abc))) |
| 353 | (should (equal (ert-test-tags abc) '(bar))) | 353 | (should (equal (ert-test-tags abc) '(bar))) |
| 354 | (should (equal (ert-test-documentation abc) "foo"))) | 354 | (should (equal (ert-test-documentation abc) "foo"))) |
| 355 | (should (equal (symbol-file 'ert-test-deftest 'ert-deftest) | 355 | (should (equal (symbol-file 'ert-test-deftest 'ert--test) |
| 356 | (symbol-file 'ert-test--which-file 'defun))) | 356 | (symbol-file 'ert-test--which-file 'defun))) |
| 357 | 357 | ||
| 358 | (ert-deftest ert-test-def () :expected-result ':passed) | 358 | (ert-deftest ert-test-def () :expected-result ':passed) |
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 8b7945c9d27..8f353b7e863 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el | |||
| @@ -33,5 +33,15 @@ | |||
| 33 | (number-sequence ?< ?\]) | 33 | (number-sequence ?< ?\]) |
| 34 | (number-sequence ?- ?:)))))) | 34 | (number-sequence ?- ?:)))))) |
| 35 | 35 | ||
| 36 | (ert-deftest rx-pcase () | ||
| 37 | (should (equal (pcase "a 1 2 3 1 1 b" | ||
| 38 | ((rx (let u (+ digit)) space | ||
| 39 | (let v (+ digit)) space | ||
| 40 | (let v (+ digit)) space | ||
| 41 | (backref u) space | ||
| 42 | (backref 1)) | ||
| 43 | (list u v))) | ||
| 44 | '("1" "3")))) | ||
| 45 | |||
| 36 | (provide 'rx-tests) | 46 | (provide 'rx-tests) |
| 37 | ;; rx-tests.el ends here. | 47 | ;; rx-tests.el ends here. |
diff --git a/test/lisp/ls-lisp.el b/test/lisp/ls-lisp.el new file mode 100644 index 00000000000..5ef7c78f4df --- /dev/null +++ b/test/lisp/ls-lisp.el | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | ;;; ls-lisp-tests.el --- tests for ls-lisp.el -*- lexical-binding: t-*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Tino Calacha <tino.calancha@gmail.com> | ||
| 6 | ;; Keywords: | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Commentary: | ||
| 24 | |||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | (require 'ert) | ||
| 28 | |||
| 29 | (ert-deftest ls-lisp-unload () | ||
| 30 | "Test for http://debbugs.gnu.org/xxxxx ." | ||
| 31 | (require 'ls-lisp) | ||
| 32 | (should (advice-member-p 'ls-lisp--insert-directory 'insert-directory)) | ||
| 33 | (unload-feature 'ls-lisp 'force) | ||
| 34 | (should-not (advice-member-p 'ls-lisp--insert-directory 'insert-directory))) | ||
| 35 | |||
| 36 | (provide 'ls-lisp-tests) | ||
| 37 | ;;; ls-lisp-tests.el ends here | ||
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 94e91b79300..979f674f0f1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -149,6 +149,7 @@ handled properly. BODY shall not contain a timeout." | |||
| 149 | (debug-ignored-errors | 149 | (debug-ignored-errors |
| 150 | (cons "^make-symbolic-link not supported$" debug-ignored-errors)) | 150 | (cons "^make-symbolic-link not supported$" debug-ignored-errors)) |
| 151 | inhibit-message) | 151 | inhibit-message) |
| 152 | (message "tramp--test-instrument-test-case %s" tramp-verbose) | ||
| 152 | (unwind-protect | 153 | (unwind-protect |
| 153 | (let ((tramp--test-instrument-test-case-p t)) ,@body) | 154 | (let ((tramp--test-instrument-test-case-p t)) ,@body) |
| 154 | ;; Unwind forms. | 155 | ;; Unwind forms. |
| @@ -2201,6 +2202,108 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 2201 | ;; Cleanup. | 2202 | ;; Cleanup. |
| 2202 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) | 2203 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) |
| 2203 | 2204 | ||
| 2205 | (ert-deftest tramp-test17-dired-with-wildcards () | ||
| 2206 | "Check `dired' with wildcards." | ||
| 2207 | (skip-unless (tramp--test-enabled)) | ||
| 2208 | (skip-unless (fboundp 'insert-directory-wildcard-in-dir-p)) | ||
| 2209 | |||
| 2210 | (dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | ||
| 2211 | (let* ((tmp-name1 | ||
| 2212 | (expand-file-name (tramp--test-make-temp-name nil quoted))) | ||
| 2213 | (tmp-name2 | ||
| 2214 | (expand-file-name (tramp--test-make-temp-name nil quoted))) | ||
| 2215 | (tmp-name3 (expand-file-name "foo" tmp-name1)) | ||
| 2216 | (tmp-name4 (expand-file-name "bar" tmp-name2)) | ||
| 2217 | (tramp-test-temporary-file-directory | ||
| 2218 | (funcall | ||
| 2219 | (if quoted 'tramp-compat-file-name-quote 'identity) | ||
| 2220 | tramp-test-temporary-file-directory)) | ||
| 2221 | buffer) | ||
| 2222 | (unwind-protect | ||
| 2223 | (progn | ||
| 2224 | (make-directory tmp-name1) | ||
| 2225 | (write-region "foo" nil tmp-name3) | ||
| 2226 | (should (file-directory-p tmp-name1)) | ||
| 2227 | (should (file-exists-p tmp-name3)) | ||
| 2228 | (make-directory tmp-name2) | ||
| 2229 | (write-region "foo" nil tmp-name4) | ||
| 2230 | (should (file-directory-p tmp-name2)) | ||
| 2231 | (should (file-exists-p tmp-name4)) | ||
| 2232 | |||
| 2233 | ;; Check for expanded directory names. | ||
| 2234 | (with-current-buffer | ||
| 2235 | (setq buffer | ||
| 2236 | (dired-noselect | ||
| 2237 | (expand-file-name | ||
| 2238 | "tramp-test*" tramp-test-temporary-file-directory))) | ||
| 2239 | (goto-char (point-min)) | ||
| 2240 | (should | ||
| 2241 | (re-search-forward | ||
| 2242 | (regexp-quote | ||
| 2243 | (file-relative-name | ||
| 2244 | tmp-name1 tramp-test-temporary-file-directory)))) | ||
| 2245 | (goto-char (point-min)) | ||
| 2246 | (should | ||
| 2247 | (re-search-forward | ||
| 2248 | (regexp-quote | ||
| 2249 | (file-relative-name | ||
| 2250 | tmp-name2 tramp-test-temporary-file-directory))))) | ||
| 2251 | (kill-buffer buffer) | ||
| 2252 | |||
| 2253 | ;; Check for expanded directory and file names. | ||
| 2254 | (with-current-buffer | ||
| 2255 | (setq buffer | ||
| 2256 | (dired-noselect | ||
| 2257 | (expand-file-name | ||
| 2258 | "tramp-test*/*" tramp-test-temporary-file-directory))) | ||
| 2259 | (goto-char (point-min)) | ||
| 2260 | (should | ||
| 2261 | (re-search-forward | ||
| 2262 | (regexp-quote | ||
| 2263 | (file-relative-name | ||
| 2264 | tmp-name3 tramp-test-temporary-file-directory)))) | ||
| 2265 | (goto-char (point-min)) | ||
| 2266 | (should | ||
| 2267 | (re-search-forward | ||
| 2268 | (regexp-quote | ||
| 2269 | (file-relative-name | ||
| 2270 | tmp-name4 | ||
| 2271 | tramp-test-temporary-file-directory))))) | ||
| 2272 | (kill-buffer buffer) | ||
| 2273 | |||
| 2274 | ;; Check for special characters. | ||
| 2275 | (setq tmp-name3 (expand-file-name "*?" tmp-name1)) | ||
| 2276 | (setq tmp-name4 (expand-file-name "[a-z0-9]" tmp-name2)) | ||
| 2277 | (write-region "foo" nil tmp-name3) | ||
| 2278 | (should (file-exists-p tmp-name3)) | ||
| 2279 | (write-region "foo" nil tmp-name4) | ||
| 2280 | (should (file-exists-p tmp-name4)) | ||
| 2281 | |||
| 2282 | (with-current-buffer | ||
| 2283 | (setq buffer | ||
| 2284 | (dired-noselect | ||
| 2285 | (expand-file-name | ||
| 2286 | "tramp-test*/*" tramp-test-temporary-file-directory))) | ||
| 2287 | (goto-char (point-min)) | ||
| 2288 | (should | ||
| 2289 | (re-search-forward | ||
| 2290 | (regexp-quote | ||
| 2291 | (file-relative-name | ||
| 2292 | tmp-name3 tramp-test-temporary-file-directory)))) | ||
| 2293 | (goto-char (point-min)) | ||
| 2294 | (should | ||
| 2295 | (re-search-forward | ||
| 2296 | (regexp-quote | ||
| 2297 | (file-relative-name | ||
| 2298 | tmp-name4 | ||
| 2299 | tramp-test-temporary-file-directory))))) | ||
| 2300 | (kill-buffer buffer)) | ||
| 2301 | |||
| 2302 | ;; Cleanup. | ||
| 2303 | (ignore-errors (kill-buffer buffer)) | ||
| 2304 | (ignore-errors (delete-directory tmp-name1 'recursive)) | ||
| 2305 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | ||
| 2306 | |||
| 2204 | (ert-deftest tramp-test18-file-attributes () | 2307 | (ert-deftest tramp-test18-file-attributes () |
| 2205 | "Check `file-attributes'. | 2308 | "Check `file-attributes'. |
| 2206 | This tests also `file-readable-p', `file-regular-p' and | 2309 | This tests also `file-readable-p', `file-regular-p' and |
| @@ -3680,6 +3783,10 @@ Use the `ls' command." | |||
| 3680 | tramp-connection-properties))) | 3783 | tramp-connection-properties))) |
| 3681 | (tramp--test-utf8))) | 3784 | (tramp--test-utf8))) |
| 3682 | 3785 | ||
| 3786 | (defun tramp--test-timeout-handler () | ||
| 3787 | (interactive) | ||
| 3788 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) | ||
| 3789 | |||
| 3683 | ;; This test is inspired by Bug#16928. | 3790 | ;; This test is inspired by Bug#16928. |
| 3684 | (ert-deftest tramp-test36-asynchronous-requests () | 3791 | (ert-deftest tramp-test36-asynchronous-requests () |
| 3685 | "Check parallel asynchronous requests. | 3792 | "Check parallel asynchronous requests. |
| @@ -3689,10 +3796,15 @@ process sentinels. They shall not disturb each other." | |||
| 3689 | (skip-unless (tramp--test-enabled)) | 3796 | (skip-unless (tramp--test-enabled)) |
| 3690 | (skip-unless (tramp--test-sh-p)) | 3797 | (skip-unless (tramp--test-sh-p)) |
| 3691 | 3798 | ||
| 3692 | ;; This test could be blocked on hydra. | 3799 | ;; This test could be blocked on hydra. So we set a timeout of 300 |
| 3693 | (with-timeout | 3800 | ;; seconds, and we send a SIGUSR1 signal after 300 seconds. |
| 3694 | (300 (ert-fail "`tramp-test36-asynchronous-requests' timed out")) | 3801 | (with-timeout (300 (tramp--test-timeout-handler)) |
| 3695 | (let* ((tmp-name (tramp--test-make-temp-name)) | 3802 | (define-key special-event-map [sigusr1] 'tramp--test-timeout-handler) |
| 3803 | (let* ((watchdog | ||
| 3804 | (start-process | ||
| 3805 | "*watchdog*" nil shell-file-name shell-command-switch | ||
| 3806 | (format "sleep 300; kill -USR1 %d" (emacs-pid)))) | ||
| 3807 | (tmp-name (tramp--test-make-temp-name)) | ||
| 3696 | (default-directory tmp-name) | 3808 | (default-directory tmp-name) |
| 3697 | ;; Do not cache Tramp properties. | 3809 | ;; Do not cache Tramp properties. |
| 3698 | (remote-file-name-inhibit-cache t) | 3810 | (remote-file-name-inhibit-cache t) |
| @@ -3802,9 +3914,11 @@ process sentinels. They shall not disturb each other." | |||
| 3802 | (tramp--test-message | 3914 | (tramp--test-message |
| 3803 | "Trace 2 action %d %s %s" count buf (current-time-string)) | 3915 | "Trace 2 action %d %s %s" count buf (current-time-string)) |
| 3804 | (accept-process-output proc 0.1 nil 0) | 3916 | (accept-process-output proc 0.1 nil 0) |
| 3805 | ;; Regular operation. | ||
| 3806 | (tramp--test-message | 3917 | (tramp--test-message |
| 3807 | "Trace 3 action %d %s %s" count buf (current-time-string)) | 3918 | "Trace 3 action %d %s %s" count buf (current-time-string)) |
| 3919 | ;; Give the watchdog a chance. | ||
| 3920 | (read-event nil nil 0.01) | ||
| 3921 | ;; Regular operation. | ||
| 3808 | (if (= count 2) | 3922 | (if (= count 2) |
| 3809 | (if (= (length buffers) 1) | 3923 | (if (= (length buffers) 1) |
| 3810 | (tramp--test-instrument-test-case 10 | 3924 | (tramp--test-instrument-test-case 10 |
| @@ -3820,8 +3934,7 @@ process sentinels. They shall not disturb each other." | |||
| 3820 | ;; Checks. All process output shall exists in the | 3934 | ;; Checks. All process output shall exists in the |
| 3821 | ;; respective buffers. All created files shall be | 3935 | ;; respective buffers. All created files shall be |
| 3822 | ;; deleted. | 3936 | ;; deleted. |
| 3823 | (tramp--test-message | 3937 | (tramp--test-message "Check %s" (current-time-string)) |
| 3824 | "Check %s" (current-time-string)) | ||
| 3825 | (dolist (buf buffers) | 3938 | (dolist (buf buffers) |
| 3826 | (with-current-buffer buf | 3939 | (with-current-buffer buf |
| 3827 | (should (string-equal (format "%s\n" buf) (buffer-string))))) | 3940 | (should (string-equal (format "%s\n" buf) (buffer-string))))) |
| @@ -3830,6 +3943,8 @@ process sentinels. They shall not disturb each other." | |||
| 3830 | tmp-name nil directory-files-no-dot-files-regexp))) | 3943 | tmp-name nil directory-files-no-dot-files-regexp))) |
| 3831 | 3944 | ||
| 3832 | ;; Cleanup. | 3945 | ;; Cleanup. |
| 3946 | (define-key special-event-map [sigusr1] 'ignore) | ||
| 3947 | (ignore-errors (quit-process watchdog)) | ||
| 3833 | (dolist (buf buffers) | 3948 | (dolist (buf buffers) |
| 3834 | (ignore-errors (delete-process (get-buffer-process buf))) | 3949 | (ignore-errors (delete-process (get-buffer-process buf))) |
| 3835 | (ignore-errors (kill-buffer buf))) | 3950 | (ignore-errors (kill-buffer buf))) |
| @@ -3906,6 +4021,14 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 3906 | (not (string-match "^tramp--?test" (symbol-name x))) | 4021 | (not (string-match "^tramp--?test" (symbol-name x))) |
| 3907 | (not (string-match "unload-hook$" (symbol-name x))) | 4022 | (not (string-match "unload-hook$" (symbol-name x))) |
| 3908 | (ert-fail (format "`%s' still bound" x))))) | 4023 | (ert-fail (format "`%s' still bound" x))))) |
| 4024 | ;; The defstruct `tramp-file-name' and all its internal functions | ||
| 4025 | ;; shall be purged. | ||
| 4026 | (should-not (cl--find-class 'tramp-file-name)) | ||
| 4027 | (mapatoms | ||
| 4028 | (lambda (x) | ||
| 4029 | (and (functionp x) | ||
| 4030 | (string-match "tramp-file-name" (symbol-name x)) | ||
| 4031 | (ert-fail (format "Structure function `%s' still exists" x))))) | ||
| 3909 | ;; There shouldn't be left a hook function containing a Tramp | 4032 | ;; There shouldn't be left a hook function containing a Tramp |
| 3910 | ;; function. We do not regard the Tramp unload hooks. | 4033 | ;; function. We do not regard the Tramp unload hooks. |
| 3911 | (mapatoms | 4034 | (mapatoms |
diff --git a/test/lisp/register-tests.el b/test/lisp/register-tests.el new file mode 100644 index 00000000000..0425bc0e0f4 --- /dev/null +++ b/test/lisp/register-tests.el | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | ;;; register-tests.el --- tests for register.el -*- lexical-binding: t-*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Tino Calacha <tino.calancha@gmail.com> | ||
| 6 | ;; Keywords: | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Commentary: | ||
| 24 | |||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | (require 'ert) | ||
| 28 | (require 'cl-lib) | ||
| 29 | |||
| 30 | (ert-deftest register-test-bug27634 () | ||
| 31 | "Test for http://debbugs.gnu.org/27634 ." | ||
| 32 | (dolist (event (list ?\C-g 'escape ?\C-\[)) | ||
| 33 | (cl-letf (((symbol-function 'read-key) #'ignore) | ||
| 34 | (last-input-event event) | ||
| 35 | (register-alist nil)) | ||
| 36 | (should (equal 'quit | ||
| 37 | (condition-case err | ||
| 38 | (call-interactively 'point-to-register) | ||
| 39 | (quit (car err))))) | ||
| 40 | (should-not register-alist)))) | ||
| 41 | |||
| 42 | (provide 'register-tests) | ||
| 43 | ;;; register-tests.el ends here | ||
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 7e50429a5bf..a59f0ca90e1 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el | |||
| @@ -292,31 +292,6 @@ cf. Bug#25477." | |||
| 292 | (should-error (eval '(dolist "foo") t) | 292 | (should-error (eval '(dolist "foo") t) |
| 293 | :type 'wrong-type-argument)) | 293 | :type 'wrong-type-argument)) |
| 294 | 294 | ||
| 295 | (require 'cl-generic) | ||
| 296 | (cl-defgeneric subr-tests--generic (x)) | ||
| 297 | (cl-defmethod subr-tests--generic ((x string)) | ||
| 298 | (message "%s is a string" x)) | ||
| 299 | (cl-defmethod subr-tests--generic ((x integer)) | ||
| 300 | (message "%s is a number" x)) | ||
| 301 | (cl-defgeneric subr-tests--generic-without-methods (x y)) | ||
| 302 | (defvar subr-tests--this-file | ||
| 303 | (file-truename (or load-file-name buffer-file-name))) | ||
| 304 | |||
| 305 | (ert-deftest subr-tests--method-files--finds-methods () | ||
| 306 | "`method-files' returns a list of files and methods for a generic function." | ||
| 307 | (let ((retval (method-files 'subr-tests--generic))) | ||
| 308 | (should (equal (length retval) 2)) | ||
| 309 | (mapc (lambda (x) | ||
| 310 | (should (equal (car x) subr-tests--this-file)) | ||
| 311 | (should (equal (cadr x) 'subr-tests--generic))) | ||
| 312 | retval) | ||
| 313 | (should-not (equal (nth 0 retval) (nth 1 retval))))) | ||
| 314 | |||
| 315 | (ert-deftest subr-tests--method-files--nonexistent-methods () | ||
| 316 | "`method-files' returns nil if asked to find a method which doesn't exist." | ||
| 317 | (should-not (method-files 'subr-tests--undefined-generic)) | ||
| 318 | (should-not (method-files 'subr-tests--generic-without-methods))) | ||
| 319 | |||
| 320 | (ert-deftest subr-tests-bug22027 () | 295 | (ert-deftest subr-tests-bug22027 () |
| 321 | "Test for http://debbugs.gnu.org/22027 ." | 296 | "Test for http://debbugs.gnu.org/22027 ." |
| 322 | (let ((default "foo") res) | 297 | (let ((default "foo") res) |
diff --git a/test/manual/indent/perl.perl b/test/manual/indent/perl.perl index f86a09b2733..06f32e7f090 100755 --- a/test/manual/indent/perl.perl +++ b/test/manual/indent/perl.perl | |||
| @@ -53,6 +53,14 @@ EOF1 | |||
| 53 | bar | 53 | bar |
| 54 | EOF2 | 54 | EOF2 |
| 55 | 55 | ||
| 56 | print <<~"EOF1" . <<\EOF2 . s/he"llo/th'ere/; | ||
| 57 | foo | ||
| 58 | EOF2 | ||
| 59 | bar | ||
| 60 | EOF1 | ||
| 61 | bar | ||
| 62 | EOF2 | ||
| 63 | |||
| 56 | print $'; # This should not start a string! | 64 | print $'; # This should not start a string! |
| 57 | 65 | ||
| 58 | print "hello" for /./; | 66 | print "hello" for /./; |
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index a0a317feeeb..dd5a2003b41 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el | |||
| @@ -142,6 +142,23 @@ literals (Bug#20852)." | |||
| 142 | "unescaped character literals " | 142 | "unescaped character literals " |
| 143 | "`?\"', `?(', `?)', `?;', `?[', `?]' detected!"))))) | 143 | "`?\"', `?(', `?)', `?;', `?[', `?]' detected!"))))) |
| 144 | 144 | ||
| 145 | (ert-deftest lread-tests--funny-quote-symbols () | ||
| 146 | "Check that 'smart quotes' or similar trigger errors in symbol names." | ||
| 147 | (dolist (quote-char | ||
| 148 | '(#x2018 ;; LEFT SINGLE QUOTATION MARK | ||
| 149 | #x2019 ;; RIGHT SINGLE QUOTATION MARK | ||
| 150 | #x201B ;; SINGLE HIGH-REVERSED-9 QUOTATION MARK | ||
| 151 | #x201C ;; LEFT DOUBLE QUOTATION MARK | ||
| 152 | #x201D ;; RIGHT DOUBLE QUOTATION MARK | ||
| 153 | #x201F ;; DOUBLE HIGH-REVERSED-9 QUOTATION MARK | ||
| 154 | #x301E ;; DOUBLE PRIME QUOTATION MARK | ||
| 155 | #xFF02 ;; FULLWIDTH QUOTATION MARK | ||
| 156 | #xFF07 ;; FULLWIDTH APOSTROPHE | ||
| 157 | )) | ||
| 158 | (let ((str (format "%cfoo" quote-char))) | ||
| 159 | (should-error (read str) :type 'invalid-read-syntax) | ||
| 160 | (should (eq (read (concat "\\" str)) (intern str)))))) | ||
| 161 | |||
| 145 | (ert-deftest lread-test-bug26837 () | 162 | (ert-deftest lread-test-bug26837 () |
| 146 | "Test for http://debbugs.gnu.org/26837 ." | 163 | "Test for http://debbugs.gnu.org/26837 ." |
| 147 | (let ((load-path (cons | 164 | (let ((load-path (cons |