diff options
| author | Paul Eggert | 2017-11-02 21:01:04 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-11-02 21:01:04 -0700 |
| commit | c66a3944edca6150c9252e15a0ea75c96225481b (patch) | |
| tree | 888bfa31967a17c174ba61d0a8547dd64658060a | |
| parent | 770f245cdf2cf9e74e49bb32afb77562d9b1ad6d (diff) | |
| parent | 7f089aa5f6d208209b2cfef8e0d3d9530e191248 (diff) | |
| download | emacs-c66a3944edca6150c9252e15a0ea75c96225481b.tar.gz emacs-c66a3944edca6150c9252e15a0ea75c96225481b.zip | |
Merge from origin/emacs-26
7f089aa5f6 Require seq in rmc.el
53aaad1dfc Make an example code introduced in the Gnus info work (bug...
7b29db222f Enable gnus-read-ephemeral-* to run multiple times (bug#29...
015f0bb2d8 Port thread.c to OpenBSD ARM
ad68bbd0da Fix another "wrong side of point" error in CC Mode.
646e56e150 Fix Bug#28959
685fd77959 Fix duplicate .o file on QNX
e562356c3f Fix two js indentation problems
b8cf159bbc Update documentation for windows build
46540a1c7a Fix a "wrong side of point" error in CC Mode. Fixes bug #...
57ca409111 Fix autoload of flymake from elisp-mode during bootstrap (...
aee0bc8775 Fix non-native fullscreen on NS (bug#28872)
d6c1a9cb8a ; Fix author email address in test/lisp/url/url-tramp-test...
761c630766 Fix Bug#28982
628b653209 Fix windows build errors
e8a06a5f9a Fix compile warning for non-w32 builds
0c536a20fb Display commit in package description, if available (Bug#2...
1d83257a1d Port to QNX
19667f44ef * configure.ac: Tweak libcurses diagnostic.
3fc05cfaec Scripts to automate windows binary distribution
928a106939 Fix Edebug specs for map-let and with-maps-do
46f2ee0d4c * test/lisp/net/tramp-tests.el (tramp-test41-delay-load): ...
b51009d7f0 * admin/authors.el (authors-canonical-author-name): Ignore...
a015db90e3 * test/lisp/progmodes/sql-tests.el (sql-tests-postgres-lis...
529a9c09d3 Further work on Bug#28889
c6deabaf4d Improve Tramp backward compatibility
8093e82e42 Improve backward compatibility of tramp-tests.el
46cdc01daa Fix some ‘window-normalize-’ prefixed functions (Bug#28947)
6360611457 Port to OpenIndiana
a012ec766c Don't fill keywords after Emacs Lisp docstring
b7c4aa951c Refactor c-forward-token-2 with new function c-forward-ove...
3aee7be62e Avoid unnecessary rounding errors in timestamps
2bfa42855b Fix xdg timestamp error on 32-bit Emacs
237e96bc52 Test that advice doesn't trigger bytecomp warnings (Bug#28...
d719ea6ad5 Another fix for unsafe directory error message (Bug#865)
b060e091c3 Handle https url for debbugs mbox (Bug#28831)
9e4265ef91 Ignore string properties when saving eshell history (Bug#2...
0f286ca85a Fix Bug#28889
50 files changed, 1202 insertions, 272 deletions
diff --git a/admin/MAINTAINERS b/admin/MAINTAINERS index c13cb552a78..753a676e81a 100644 --- a/admin/MAINTAINERS +++ b/admin/MAINTAINERS | |||
| @@ -62,6 +62,7 @@ Michael Albinus | |||
| 62 | lisp/url/url-tramp.el | 62 | lisp/url/url-tramp.el |
| 63 | doc/misc/tramp*.texi | 63 | doc/misc/tramp*.texi |
| 64 | test/lisp/net/tramp-tests.el | 64 | test/lisp/net/tramp-tests.el |
| 65 | test/lisp/url/url-tramp-tests.el | ||
| 65 | 66 | ||
| 66 | D-Bus | 67 | D-Bus |
| 67 | src/dbusbind.c | 68 | src/dbusbind.c |
diff --git a/admin/authors.el b/admin/authors.el index 71995d5764c..603ceb3fa08 100644 --- a/admin/authors.el +++ b/admin/authors.el | |||
| @@ -1321,9 +1321,10 @@ it is found in `authors-fixed-case'." | |||
| 1321 | (setq author (replace-regexp-in-string "[ \t]+" " " author)) | 1321 | (setq author (replace-regexp-in-string "[ \t]+" " " author)) |
| 1322 | ;; NB this ignores the first name only case. | 1322 | ;; NB this ignores the first name only case. |
| 1323 | (unless (string-match "[-, \t]" author) | 1323 | (unless (string-match "[-, \t]" author) |
| 1324 | (push (format-message "%s:%d: ignored `%s'" | 1324 | (or (authors-lax-changelog-p file) |
| 1325 | file (1+ (count-lines (point-min) pos)) author) | 1325 | (push (format-message "%s:%d: ignored `%s'" |
| 1326 | authors-ignored-names) | 1326 | file (1+ (count-lines (point-min) pos)) author) |
| 1327 | authors-ignored-names)) | ||
| 1327 | (setq author "")) | 1328 | (setq author "")) |
| 1328 | (or (car (member author authors-fixed-case)) | 1329 | (or (car (member author authors-fixed-case)) |
| 1329 | (capitalize author)))) | 1330 | (capitalize author)))) |
diff --git a/admin/nt/dist-build/README-scripts b/admin/nt/dist-build/README-scripts new file mode 100644 index 00000000000..a20099e4eb6 --- /dev/null +++ b/admin/nt/dist-build/README-scripts | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | Distribution Build Scripts for Windows | ||
| 2 | ====================================== | ||
| 3 | |||
| 4 | The scripts are used to build the binary distribution zip files for windows. | ||
| 5 | |||
| 6 | File System Organisation | ||
| 7 | ------------------------ | ||
| 8 | |||
| 9 | |||
| 10 | They are relatively strict about the file system organisation. In | ||
| 11 | general, they should work across several more than just the version of | ||
| 12 | Emacs they come with, as the dependencies of Emacs change relatively slowly. | ||
| 13 | |||
| 14 | The file system needs to be organised like so: | ||
| 15 | |||
| 16 | ~/emacs-build/git | ||
| 17 | |||
| 18 | Contains a checkout of the Emacs git repository, organised according | ||
| 19 | to branches, with git worktree | ||
| 20 | |||
| 21 | ~/emacs-build/git/emacs-$branch | ||
| 22 | |||
| 23 | A branch of the git repository containing the current release | ||
| 24 | branch. This has to be created by hand. | ||
| 25 | |||
| 26 | ~/emacs-build/git/emacs-$version | ||
| 27 | |||
| 28 | A branch of the git repository containing the last release. The | ||
| 29 | build-zips.sh file will create this for you. | ||
| 30 | |||
| 31 | ~/emacs-build/deps | ||
| 32 | |||
| 33 | A location for the dependencies. This needs to contain two zip files | ||
| 34 | with the dependencies. build-dep-zips.py will create these files for you. | ||
| 35 | |||
| 36 | ~/emacs-build/deps/libXpm/i686 | ||
| 37 | ~/emacs-build/deps/libXpm/x86_64 | ||
| 38 | |||
| 39 | Contain libXpm-noX4.dll. This file is used to load images for the | ||
| 40 | splash screen, menu items and so on. Emacs runs without it, but looks | ||
| 41 | horrible. The x86_64 comes from msys2, while the i686 comes from | ||
| 42 | ezwinports because it itself has no dependencies. These have to be | ||
| 43 | placed manually (but probably never need updating). | ||
| 44 | |||
| 45 | |||
| 46 | ~/emacs-build/build/$version/i686 | ||
| 47 | ~/emacs-build/build/$version/x86_64 | ||
| 48 | |||
| 49 | We build Emacs out-of-source here. This directory is created by | ||
| 50 | build-zips.sh. This directory can be freely deleted after zips have | ||
| 51 | been created | ||
| 52 | |||
| 53 | |||
| 54 | ~/emacs-build/install/$version/i686 | ||
| 55 | ~/emacs-build/install/$version/x86_64 | ||
| 56 | |||
| 57 | We install Emacs here. This directory is created by build-zips.sh. | ||
| 58 | This directory can and *should* be deleted after zips have been | ||
| 59 | created. | ||
| 60 | |||
| 61 | ~/emacs-upload | ||
| 62 | |||
| 63 | Zips are created and moved here from where they can be, well, | ||
| 64 | uploaded. | ||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | Build Process | ||
| 69 | ------------- | ||
| 70 | |||
| 71 | For each major version: | ||
| 72 | |||
| 73 | The dependencies files need to be created. This can be around the time | ||
| 74 | of the pre-tests, then used for all releases of that version, to | ||
| 75 | ensure the maximum stability. | ||
| 76 | |||
| 77 | To do this: | ||
| 78 | |||
| 79 | Update msys to the latest version with `pacman -Syu`. | ||
| 80 | |||
| 81 | Then run build-dep-zips.py, in this directory. Three zips will be | ||
| 82 | created, containing the 64bit and 32bit dependencies, as well as the | ||
| 83 | source for these. | ||
| 84 | |||
| 85 | For emacs release or pre-test version: | ||
| 86 | |||
| 87 | Run `build-zips.sh -g` in the release branch. This will create a worktree | ||
| 88 | with the tag of the last version. | ||
| 89 | |||
| 90 | Then run `build-zips.sh` in this worktree. Eventually, four new zip | ||
| 91 | files will be created in ~/emacs-upload from where they can be signed | ||
| 92 | and uploaded with `gnupload`. | ||
diff --git a/admin/nt/dist-build/README-windows-binaries b/admin/nt/dist-build/README-windows-binaries new file mode 100644 index 00000000000..27a5483c02b --- /dev/null +++ b/admin/nt/dist-build/README-windows-binaries | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | Windows Binaries | ||
| 2 | ================ | ||
| 3 | |||
| 4 | Currently, we provide four different binary packages for Emacs, which | ||
| 5 | are: | ||
| 6 | |||
| 7 | emacs-$VERSION-x86_64.zip | ||
| 8 | |||
| 9 | Contains a 64-bit build of Emacs with dependencies. Mostly, this is | ||
| 10 | the best one to install. | ||
| 11 | |||
| 12 | emacs-$VERSION-x86_64-no-deps.zip | ||
| 13 | |||
| 14 | Contains a 64-bit build of Emacs without any dependencies. This may be | ||
| 15 | useful if you wish to install where the dependencies are already | ||
| 16 | available, or if you want the small possible Emacs. | ||
| 17 | |||
| 18 | emacs-$VERSION-i686.zip | ||
| 19 | |||
| 20 | Contains a 32-bit build of Emacs with dependencies. This is useful for | ||
| 21 | running on a 32-bit machine. | ||
| 22 | |||
| 23 | emacs-$VERSION-i686-no-deps.zip | ||
| 24 | |||
| 25 | Contains a 32-bit build of Emacs without dependencies | ||
| 26 | |||
| 27 | In addition, we provide the following files which will not be useful | ||
| 28 | for most end-users. | ||
| 29 | |||
| 30 | emacs-26-x86_64-deps.zip | ||
| 31 | |||
| 32 | The dependencies. Unzipping this file on top of | ||
| 33 | emacs-$VERSION-x86_64-no-deps.zip should result in the same install as | ||
| 34 | emacs-$VERSION-x86_64.zip. | ||
| 35 | |||
| 36 | emacs-26-i686-deps.zip | ||
| 37 | |||
| 38 | The 32-bit version of the dependencies. | ||
| 39 | |||
| 40 | emacs-26-deps-mingw-w64-src.zip | ||
| 41 | |||
| 42 | The source for the dependencies. Source for Emacs itself is available | ||
| 43 | in the main distribution tarball. These dependencies were produced | ||
| 44 | from an updated msys2 at the point of the first pre-test. It is not | ||
| 45 | intended that these will be updated after that point. \ No newline at end of file | ||
diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py new file mode 100755 index 00000000000..33bc4b586c9 --- /dev/null +++ b/admin/nt/dist-build/build-dep-zips.py | |||
| @@ -0,0 +1,223 @@ | |||
| 1 | #!/usr/bin/python3 | ||
| 2 | |||
| 3 | ## Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ## This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ## GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ## it under the terms of the GNU General Public License as published by | ||
| 9 | ## the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ## (at your option) any later version. | ||
| 11 | |||
| 12 | ## GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ## GNU General Public License for more details. | ||
| 16 | |||
| 17 | ## You should have received a copy of the GNU General Public License | ||
| 18 | ## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | import argparse | ||
| 20 | import multiprocessing as mp | ||
| 21 | import glob | ||
| 22 | import os | ||
| 23 | import shutil | ||
| 24 | import re | ||
| 25 | |||
| 26 | from subprocess import check_output | ||
| 27 | |||
| 28 | ## Constants | ||
| 29 | EMACS_MAJOR_VERSION="26" | ||
| 30 | |||
| 31 | |||
| 32 | ## Options | ||
| 33 | DRY_RUN=False | ||
| 34 | |||
| 35 | ## Packages to fiddle with | ||
| 36 | SKIP_PKGS=["mingw-w64-gcc-libs"] | ||
| 37 | MUNGE_PKGS ={"mingw-w64-libwinpthread-git":"mingw-w64-winpthreads-git"} | ||
| 38 | ARCH_PKGS=["mingw-w64-mpc", | ||
| 39 | "mingw-w64-termcap", | ||
| 40 | "mingw-w64-xpm-nox"] | ||
| 41 | SRC_REPO="https://sourceforge.net/projects/msys2/files/REPOS/MINGW/Sources" | ||
| 42 | |||
| 43 | |||
| 44 | def check_output_maybe(*args,**kwargs): | ||
| 45 | if(DRY_RUN): | ||
| 46 | print("Calling: {}{}".format(args,kwargs)) | ||
| 47 | else: | ||
| 48 | return check_output(*args,**kwargs) | ||
| 49 | |||
| 50 | def extract_deps(): | ||
| 51 | |||
| 52 | # This list derives from the features we want Emacs to compile with. | ||
| 53 | PKG_REQ='''mingw-w64-x86_64-giflib | ||
| 54 | mingw-w64-x86_64-gnutls | ||
| 55 | mingw-w64-x86_64-libjpeg-turbo | ||
| 56 | mingw-w64-x86_64-libpng | ||
| 57 | mingw-w64-x86_64-librsvg | ||
| 58 | mingw-w64-x86_64-libtiff | ||
| 59 | mingw-w64-x86_64-libxml2 | ||
| 60 | mingw-w64-x86_64-xpm-nox | ||
| 61 | mingw-w64-x86_64-lcms2'''.split() | ||
| 62 | |||
| 63 | # Get a list of all dependencies needed for packages mentioned above. | ||
| 64 | # Run `pactree -lu' for each elment of $PKG_REQ | ||
| 65 | pkgs = set() | ||
| 66 | for x in PKG_REQ: | ||
| 67 | pkgs.update( | ||
| 68 | check_output(["pactree", "-lu", x]).decode("utf-8").split() | ||
| 69 | ) | ||
| 70 | |||
| 71 | return sorted(pkgs) | ||
| 72 | |||
| 73 | def gather_deps(deps, arch, directory): | ||
| 74 | |||
| 75 | os.mkdir(arch) | ||
| 76 | os.chdir(arch) | ||
| 77 | |||
| 78 | ## Replace the architecture with the correct one | ||
| 79 | deps = [re.sub(r"x86_64",arch,x) for x in deps] | ||
| 80 | |||
| 81 | ## find all files the transitive dependencies | ||
| 82 | deps_files = check_output( | ||
| 83 | ["pacman", "-Ql"] + deps | ||
| 84 | ).decode("utf-8").split("\n") | ||
| 85 | |||
| 86 | ## Produces output like | ||
| 87 | ## mingw-w64-x86_64-zlib /mingw64/lib/libminizip.a | ||
| 88 | |||
| 89 | ## drop the package name | ||
| 90 | tmp = deps_files.copy() | ||
| 91 | deps_files=[] | ||
| 92 | for d in tmp: | ||
| 93 | slt = d.split() | ||
| 94 | if(not slt==[]): | ||
| 95 | deps_files.append(slt[1]) | ||
| 96 | |||
| 97 | ## sort uniq | ||
| 98 | deps_files = sorted(list(set(deps_files))) | ||
| 99 | ## copy all files into local | ||
| 100 | print("Copying dependencies: {}".format(arch)) | ||
| 101 | check_output_maybe(["rsync", "-R"] + deps_files + ["."]) | ||
| 102 | |||
| 103 | ## And package them up | ||
| 104 | os.chdir(directory) | ||
| 105 | print("Zipping: {}".format(arch)) | ||
| 106 | check_output_maybe("zip -9r ../../emacs-26-{}-deps.zip *".format(arch), | ||
| 107 | shell=True) | ||
| 108 | os.chdir("../../") | ||
| 109 | |||
| 110 | |||
| 111 | def download_source(tarball): | ||
| 112 | print("Downloading {}...".format(tarball)) | ||
| 113 | check_output_maybe( | ||
| 114 | "wget -a ../download.log -O {} {}/{}/download" | ||
| 115 | .format(tarball, SRC_REPO, tarball), | ||
| 116 | shell=True | ||
| 117 | ) | ||
| 118 | print("Downloading {}... done".format(tarball)) | ||
| 119 | |||
| 120 | def gather_source(deps): | ||
| 121 | |||
| 122 | |||
| 123 | ## Source for gcc-libs is part of gcc | ||
| 124 | ## Source for libwinpthread is in libwinpthreads | ||
| 125 | ## mpc, termcap, xpm -- has x86_64, and i686 versions | ||
| 126 | |||
| 127 | ## This needs to have been run first at the same time as the | ||
| 128 | ## system was udpated. | ||
| 129 | os.mkdir("emacs-src") | ||
| 130 | os.chdir("emacs-src") | ||
| 131 | |||
| 132 | to_download = [] | ||
| 133 | for pkg in deps: | ||
| 134 | pkg_name_and_version= \ | ||
| 135 | check_output(["pacman","-Q", pkg]).decode("utf-8").strip() | ||
| 136 | |||
| 137 | ## Produces output like: | ||
| 138 | ## mingw-w64-x86_64-zlib 2.43.2 | ||
| 139 | pkg_name_components = pkg_name_and_version.split() | ||
| 140 | pkg_name=pkg_name_components[0] | ||
| 141 | pkg_version=pkg_name_components[1] | ||
| 142 | |||
| 143 | ## make a simple name to make lookup easier | ||
| 144 | simple_pkg_name = re.sub(r"x86_64-","",pkg_name) | ||
| 145 | |||
| 146 | if(simple_pkg_name in SKIP_PKGS): | ||
| 147 | continue | ||
| 148 | |||
| 149 | ## Some packages have different source files for different | ||
| 150 | ## architectures. For these we need two downloads. | ||
| 151 | if(simple_pkg_name in ARCH_PKGS): | ||
| 152 | downloads = [pkg_name, | ||
| 153 | re.sub(r"x86_64","i686",pkg_name)] | ||
| 154 | else: | ||
| 155 | downloads = [simple_pkg_name] | ||
| 156 | |||
| 157 | for d in downloads: | ||
| 158 | ## Switch names if necessary | ||
| 159 | d = MUNGE_PKGS.get(d,d) | ||
| 160 | |||
| 161 | tarball = "{}-{}.src.tar.gz".format(d,pkg_version) | ||
| 162 | |||
| 163 | to_download.append(tarball) | ||
| 164 | |||
| 165 | ## Download in parallel or it is just too slow | ||
| 166 | p = mp.Pool(16) | ||
| 167 | p.map(download_source,to_download) | ||
| 168 | |||
| 169 | print("Zipping") | ||
| 170 | check_output_maybe("zip -9 ../emacs-{}-deps-mingw-w64-src.zip *" | ||
| 171 | .format(EMACS_MAJOR_VERSION), | ||
| 172 | shell=True) | ||
| 173 | |||
| 174 | os.chdir("..") | ||
| 175 | |||
| 176 | |||
| 177 | def clean(): | ||
| 178 | print("Cleaning") | ||
| 179 | os.path.isdir("emacs-src") and shutil.rmtree("emacs-src") | ||
| 180 | os.path.isdir("i686") and shutil.rmtree("i686") | ||
| 181 | os.path.isdir("x86_64") and shutil.rmtree("x86_64") | ||
| 182 | os.path.isfile("download.log") and os.remove("download.log") | ||
| 183 | |||
| 184 | |||
| 185 | if(os.environ["MSYSTEM"] != "MSYS"): | ||
| 186 | print("Run this script in an MSYS-shell!") | ||
| 187 | exit(1) | ||
| 188 | |||
| 189 | |||
| 190 | parser = argparse.ArgumentParser() | ||
| 191 | parser.add_argument("-t", help="32 bit deps only", | ||
| 192 | action="store_true") | ||
| 193 | |||
| 194 | parser.add_argument("-f", help="64 bit deps only", | ||
| 195 | action="store_true") | ||
| 196 | |||
| 197 | parser.add_argument("-s", help="source code only", | ||
| 198 | action="store_true") | ||
| 199 | |||
| 200 | parser.add_argument("-c", help="clean only", | ||
| 201 | action="store_true") | ||
| 202 | |||
| 203 | parser.add_argument("-d", help="dry run", | ||
| 204 | action="store_true") | ||
| 205 | |||
| 206 | args = parser.parse_args() | ||
| 207 | do_all=not (args.c or args.s or args.f or args.t) | ||
| 208 | |||
| 209 | deps=extract_deps() | ||
| 210 | |||
| 211 | DRY_RUN=args.d | ||
| 212 | |||
| 213 | if( do_all or args.t ): | ||
| 214 | gather_deps(deps,"i686","mingw32") | ||
| 215 | |||
| 216 | if( do_all or args.f ): | ||
| 217 | gather_deps(deps,"x86_64","mingw64") | ||
| 218 | |||
| 219 | if( do_all or args.s ): | ||
| 220 | gather_source(deps) | ||
| 221 | |||
| 222 | if( args.c ): | ||
| 223 | clean() | ||
diff --git a/admin/nt/dist-build/build-zips.sh b/admin/nt/dist-build/build-zips.sh new file mode 100755 index 00000000000..fb44c31c70d --- /dev/null +++ b/admin/nt/dist-build/build-zips.sh | |||
| @@ -0,0 +1,145 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | ## Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ## This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ## GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ## it under the terms of the GNU General Public License as published by | ||
| 9 | ## the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ## (at your option) any later version. | ||
| 11 | |||
| 12 | ## GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ## GNU General Public License for more details. | ||
| 16 | |||
| 17 | ## You should have received a copy of the GNU General Public License | ||
| 18 | ## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | |||
| 21 | function git_up { | ||
| 22 | echo Making git worktree for Emacs $VERSION | ||
| 23 | cd $HOME/emacs-build/git/emacs-$MAJOR_VERSION | ||
| 24 | git pull | ||
| 25 | git worktree add ../emacs-$BRANCH emacs-$BRANCH | ||
| 26 | |||
| 27 | cd ../emacs-$BRANCH | ||
| 28 | ./autogen.sh | ||
| 29 | |||
| 30 | } | ||
| 31 | |||
| 32 | function build_zip { | ||
| 33 | |||
| 34 | ARCH=$1 | ||
| 35 | PKG=$2 | ||
| 36 | HOST=$3 | ||
| 37 | |||
| 38 | echo Building Emacs-$VERSION for $ARCH | ||
| 39 | if [ $ARCH == "i686" ] | ||
| 40 | then | ||
| 41 | PATH=/mingw32/bin:$PATH | ||
| 42 | MSYSTEM=MINGW32 | ||
| 43 | fi | ||
| 44 | |||
| 45 | mkdir --parents $HOME/emacs-build/build/emacs-$VERSION/$ARCH | ||
| 46 | cd $HOME/emacs-build/build/emacs-$VERSION/$ARCH | ||
| 47 | |||
| 48 | export PKG_CONFIG_PATH=$PKG | ||
| 49 | ../../../git/emacs-$BRANCH/configure \ | ||
| 50 | --without-dbus \ | ||
| 51 | --host=$HOST --without-compress-install \ | ||
| 52 | CFLAGS="-O2 -static -g3" | ||
| 53 | make -j 8 install \ | ||
| 54 | prefix=$HOME/emacs-build/install/emacs-$VERSION/$ARCH | ||
| 55 | cd $HOME/emacs-build/install/emacs-$VERSION/$ARCH | ||
| 56 | cp $HOME/emacs-build/deps/libXpm/$ARCH/libXpm-noX4.dll bin | ||
| 57 | zip -r -9 emacs-$VERSION-$ARCH-no-deps.zip * | ||
| 58 | mv emacs-$VERSION-$ARCH-no-deps.zip $HOME/emacs-upload | ||
| 59 | rm bin/libXpm-noX4.dll | ||
| 60 | unzip $HOME/emacs-build/deps/emacs-26-$ARCH-deps.zip | ||
| 61 | zip -r -9 emacs-$VERSION-$ARCH.zip * | ||
| 62 | mv emacs-$VERSION-$ARCH.zip ~/emacs-upload | ||
| 63 | } | ||
| 64 | |||
| 65 | |||
| 66 | ##set -o xtrace | ||
| 67 | set -o errexit | ||
| 68 | |||
| 69 | SNAPSHOT= | ||
| 70 | |||
| 71 | BUILD_32=1 | ||
| 72 | BUILD_64=1 | ||
| 73 | GIT_UP=0 | ||
| 74 | |||
| 75 | while getopts "36ghsV:" opt; do | ||
| 76 | case $opt in | ||
| 77 | 3) | ||
| 78 | BUILD_32=1 | ||
| 79 | BUILD_64=0 | ||
| 80 | GIT_UP=0 | ||
| 81 | ;; | ||
| 82 | 6) | ||
| 83 | BUILD_32=0 | ||
| 84 | BUILD_64=1 | ||
| 85 | GIT_UP=0 | ||
| 86 | ;; | ||
| 87 | |||
| 88 | g) | ||
| 89 | BUILD_32=0 | ||
| 90 | BUILD_64=0 | ||
| 91 | GIT_UP=1 | ||
| 92 | ;; | ||
| 93 | V) | ||
| 94 | VERSION=$OPTARG | ||
| 95 | ;; | ||
| 96 | s) | ||
| 97 | SNAPSHOT="-snapshot" | ||
| 98 | ;; | ||
| 99 | h) | ||
| 100 | echo "build-zips.sh" | ||
| 101 | echo " -3 32 bit build only" | ||
| 102 | echo " -6 64 bit build only" | ||
| 103 | echo " -g git update and worktree only" | ||
| 104 | exit 0 | ||
| 105 | ;; | ||
| 106 | \?) | ||
| 107 | echo "Invalid option: -$OPTARG" >&2 | ||
| 108 | ;; | ||
| 109 | esac | ||
| 110 | done | ||
| 111 | |||
| 112 | if [ -z $VERSION ]; | ||
| 113 | then | ||
| 114 | echo "doing version thing" | ||
| 115 | VERSION=` | ||
| 116 | sed -n 's/^AC_INIT(GNU Emacs,[ ]*\([^ ,)]*\).*/\1/p' < ../../../configure.ac | ||
| 117 | ` | ||
| 118 | fi | ||
| 119 | |||
| 120 | if [ -z $VERSION ]; | ||
| 121 | then | ||
| 122 | echo Cannot determine Emacs version | ||
| 123 | exit 1 | ||
| 124 | fi | ||
| 125 | |||
| 126 | MAJOR_VERSION="$(echo $VERSION | cut -d'.' -f1)" | ||
| 127 | BRANCH=$VERSION | ||
| 128 | VERSION=$VERSION$SNAPSHOT | ||
| 129 | |||
| 130 | if (($GIT_UP)) | ||
| 131 | then | ||
| 132 | git_up | ||
| 133 | fi | ||
| 134 | |||
| 135 | if (($BUILD_64)) | ||
| 136 | then | ||
| 137 | build_zip x86_64 /mingw64/lib/pkgconfig x86_64-w64-mingw32 | ||
| 138 | fi | ||
| 139 | |||
| 140 | ## Do the 64 bit build first, because we reset some environment | ||
| 141 | ## variables during the 32 bit which will break the build. | ||
| 142 | if (($BUILD_32)) | ||
| 143 | then | ||
| 144 | build_zip i686 /mingw32/lib/pkgconfig i686-w64-mingw32 | ||
| 145 | fi | ||
diff --git a/configure.ac b/configure.ac index 7437eb90d2e..5ab95991ef0 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -699,6 +699,12 @@ case "${canonical}" in | |||
| 699 | esac | 699 | esac |
| 700 | ;; | 700 | ;; |
| 701 | 701 | ||
| 702 | ## QNX Neutrino | ||
| 703 | *-nto-qnx* ) | ||
| 704 | opsys=qnxnto | ||
| 705 | CFLAGS="$CFLAGS -D__NO_EXT_QNX" | ||
| 706 | ;; | ||
| 707 | |||
| 702 | ## Intel 386 machines where we don't care about the manufacturer. | 708 | ## Intel 386 machines where we don't care about the manufacturer. |
| 703 | i[3456]86-*-* ) | 709 | i[3456]86-*-* ) |
| 704 | case "${canonical}" in | 710 | case "${canonical}" in |
| @@ -1507,6 +1513,8 @@ case "$opsys" in | |||
| 1507 | 1513 | ||
| 1508 | hpux*) LIBS_SYSTEM="-l:libdld.sl" ;; | 1514 | hpux*) LIBS_SYSTEM="-l:libdld.sl" ;; |
| 1509 | 1515 | ||
| 1516 | qnxnto) LIBS_SYSTEM="-lsocket" ;; | ||
| 1517 | |||
| 1510 | sol2*) LIBS_SYSTEM="-lsocket -lnsl" ;; | 1518 | sol2*) LIBS_SYSTEM="-lsocket -lnsl" ;; |
| 1511 | 1519 | ||
| 1512 | ## Motif needs -lgen. | 1520 | ## Motif needs -lgen. |
| @@ -2210,7 +2218,8 @@ test "$CANNOT_DUMP" = yes || | |||
| 2210 | case "$opsys" in | 2218 | case "$opsys" in |
| 2211 | ## darwin ld insists on the use of malloc routines in the System framework. | 2219 | ## darwin ld insists on the use of malloc routines in the System framework. |
| 2212 | darwin | mingw32 | nacl | sol2-10) ;; | 2220 | darwin | mingw32 | nacl | sol2-10) ;; |
| 2213 | cygwin) hybrid_malloc=yes | 2221 | cygwin | qnxto) |
| 2222 | hybrid_malloc=yes | ||
| 2214 | system_malloc= ;; | 2223 | system_malloc= ;; |
| 2215 | *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;; | 2224 | *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;; |
| 2216 | esac | 2225 | esac |
| @@ -4033,9 +4042,8 @@ AC_CACHE_CHECK([for library containing tputs], [emacs_cv_tputs_lib], | |||
| 4033 | [if test "${opsys}" = "mingw32"; then | 4042 | [if test "${opsys}" = "mingw32"; then |
| 4034 | emacs_cv_tputs_lib='none required' | 4043 | emacs_cv_tputs_lib='none required' |
| 4035 | else | 4044 | else |
| 4036 | # Maybe curses should be tried earlier? | 4045 | # curses precedes termcap because of AIX (Bug#9736#35) and OpenIndiana. |
| 4037 | # See https://debbugs.gnu.org/9736#35 | 4046 | for tputs_library in '' tinfo ncurses terminfo curses termcap; do |
| 4038 | for tputs_library in '' tinfo ncurses terminfo termcap curses; do | ||
| 4039 | OLIBS=$LIBS | 4047 | OLIBS=$LIBS |
| 4040 | if test -z "$tputs_library"; then | 4048 | if test -z "$tputs_library"; then |
| 4041 | emacs_cv_tputs_lib='none required' | 4049 | emacs_cv_tputs_lib='none required' |
| @@ -4054,7 +4062,7 @@ fi]) | |||
| 4054 | AS_CASE(["$emacs_cv_tputs_lib"], | 4062 | AS_CASE(["$emacs_cv_tputs_lib"], |
| 4055 | [no], [AC_MSG_ERROR([The required function 'tputs' was not found in any library. | 4063 | [no], [AC_MSG_ERROR([The required function 'tputs' was not found in any library. |
| 4056 | The following libraries were tried (in order): | 4064 | The following libraries were tried (in order): |
| 4057 | libtinfo, libncurses, libterminfo, libtermcap, libcurses | 4065 | libtinfo, libncurses, libterminfo, libcurses, libtermcap |
| 4058 | Please try installing whichever of these libraries is most appropriate | 4066 | Please try installing whichever of these libraries is most appropriate |
| 4059 | for your system, together with its header files. | 4067 | for your system, together with its header files. |
| 4060 | For example, a libncurses-dev(el) or similar package.])], | 4068 | For example, a libncurses-dev(el) or similar package.])], |
| @@ -4604,7 +4612,7 @@ case $opsys in | |||
| 4604 | AC_DEFINE(PTY_TTY_NAME_SPRINTF, []) | 4612 | AC_DEFINE(PTY_TTY_NAME_SPRINTF, []) |
| 4605 | ;; | 4613 | ;; |
| 4606 | 4614 | ||
| 4607 | gnu | openbsd ) | 4615 | gnu | openbsd | qnxnto ) |
| 4608 | AC_DEFINE(FIRST_PTY_LETTER, ['p']) | 4616 | AC_DEFINE(FIRST_PTY_LETTER, ['p']) |
| 4609 | ;; | 4617 | ;; |
| 4610 | 4618 | ||
diff --git a/lisp/desktop.el b/lisp/desktop.el index 66e2aef9798..0aa5dcfe8a3 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el | |||
| @@ -1046,7 +1046,8 @@ without further confirmation." | |||
| 1046 | (or (not new-modtime) ; nothing to overwrite | 1046 | (or (not new-modtime) ; nothing to overwrite |
| 1047 | (equal desktop-file-modtime new-modtime) | 1047 | (equal desktop-file-modtime new-modtime) |
| 1048 | (yes-or-no-p (if desktop-file-modtime | 1048 | (yes-or-no-p (if desktop-file-modtime |
| 1049 | (if (> (float-time new-modtime) (float-time desktop-file-modtime)) | 1049 | (if (time-less-p desktop-file-modtime |
| 1050 | new-modtime) | ||
| 1050 | "Desktop file is more recent than the one loaded. Save anyway? " | 1051 | "Desktop file is more recent than the one loaded. Save anyway? " |
| 1051 | "Desktop file isn't the one loaded. Overwrite it? ") | 1052 | "Desktop file isn't the one loaded. Overwrite it? ") |
| 1052 | "Current desktop was not loaded from a file. Overwrite this desktop file? ")) | 1053 | "Current desktop was not loaded from a file. Overwrite this desktop file? ")) |
diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el index ed23d9f5cc2..014b4b21122 100644 --- a/lisp/ecomplete.el +++ b/lisp/ecomplete.el | |||
| @@ -55,7 +55,7 @@ | |||
| 55 | 55 | ||
| 56 | (defun ecomplete-add-item (type key text) | 56 | (defun ecomplete-add-item (type key text) |
| 57 | (let ((elems (assq type ecomplete-database)) | 57 | (let ((elems (assq type ecomplete-database)) |
| 58 | (now (string-to-number (format "%.0f" (float-time)))) | 58 | (now (string-to-number (format-time-string "%s"))) |
| 59 | entry) | 59 | entry) |
| 60 | (unless elems | 60 | (unless elems |
| 61 | (push (setq elems (list type)) ecomplete-database)) | 61 | (push (setq elems (list type)) ecomplete-database)) |
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index aeeea2178b3..7d38052fd40 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -1269,7 +1269,8 @@ and initial semicolons." | |||
| 1269 | ;; case). The `;' and `:' stop the paragraph being filled at following | 1269 | ;; case). The `;' and `:' stop the paragraph being filled at following |
| 1270 | ;; comment lines and at keywords (e.g., in `defcustom'). Left parens are | 1270 | ;; comment lines and at keywords (e.g., in `defcustom'). Left parens are |
| 1271 | ;; escaped to keep font-locking, filling, & paren matching in the source | 1271 | ;; escaped to keep font-locking, filling, & paren matching in the source |
| 1272 | ;; file happy. | 1272 | ;; file happy. The `:' must be preceded by whitespace so that keywords |
| 1273 | ;; inside of the docstring don't start new paragraphs (Bug#7751). | ||
| 1273 | ;; | 1274 | ;; |
| 1274 | ;; `paragraph-separate': A clever regexp distinguishes the first line of | 1275 | ;; `paragraph-separate': A clever regexp distinguishes the first line of |
| 1275 | ;; a docstring and identifies it as a paragraph separator, so that it | 1276 | ;; a docstring and identifies it as a paragraph separator, so that it |
| @@ -1282,13 +1283,7 @@ and initial semicolons." | |||
| 1282 | ;; `emacs-lisp-docstring-fill-column' if that value is an integer. | 1283 | ;; `emacs-lisp-docstring-fill-column' if that value is an integer. |
| 1283 | (let ((paragraph-start | 1284 | (let ((paragraph-start |
| 1284 | (concat paragraph-start | 1285 | (concat paragraph-start |
| 1285 | (format "\\|\\s-*\\([(;%s\"]\\|`(\\|#'(\\)" | 1286 | "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)")) |
| 1286 | ;; If we're inside a string (like the doc | ||
| 1287 | ;; string), don't consider a colon to be | ||
| 1288 | ;; a paragraph-start character. | ||
| 1289 | (if (nth 3 (syntax-ppss)) | ||
| 1290 | "" | ||
| 1291 | ":")))) | ||
| 1292 | (paragraph-separate | 1287 | (paragraph-separate |
| 1293 | (concat paragraph-separate "\\|\\s-*\".*[,\\.]$")) | 1288 | (concat paragraph-separate "\\|\\s-*\".*[,\\.]$")) |
| 1294 | (fill-column (if (and (integerp emacs-lisp-docstring-fill-column) | 1289 | (fill-column (if (and (integerp emacs-lisp-docstring-fill-column) |
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index 0f9a74422b4..2a3e1d0a4b0 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el | |||
| @@ -73,7 +73,8 @@ KEYS can also be a list of (KEY VARNAME) pairs, in which case | |||
| 73 | KEY is an unquoted form. | 73 | KEY is an unquoted form. |
| 74 | 74 | ||
| 75 | MAP can be a list, hash-table or array." | 75 | MAP can be a list, hash-table or array." |
| 76 | (declare (indent 2) (debug t)) | 76 | (declare (indent 2) |
| 77 | (debug ((&rest &or symbolp ([form symbolp])) form body))) | ||
| 77 | `(pcase-let ((,(map--make-pcase-patterns keys) ,map)) | 78 | `(pcase-let ((,(map--make-pcase-patterns keys) ,map)) |
| 78 | ,@body)) | 79 | ,@body)) |
| 79 | 80 | ||
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 3c34caa17d4..68ca1972d1e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -2260,6 +2260,7 @@ Otherwise no newline is inserted." | |||
| 2260 | (archive (if desc (package-desc-archive desc))) | 2260 | (archive (if desc (package-desc-archive desc))) |
| 2261 | (extras (and desc (package-desc-extras desc))) | 2261 | (extras (and desc (package-desc-extras desc))) |
| 2262 | (homepage (cdr (assoc :url extras))) | 2262 | (homepage (cdr (assoc :url extras))) |
| 2263 | (commit (cdr (assoc :commit extras))) | ||
| 2263 | (keywords (if desc (package-desc--keywords desc))) | 2264 | (keywords (if desc (package-desc--keywords desc))) |
| 2264 | (built-in (eq pkg-dir 'builtin)) | 2265 | (built-in (eq pkg-dir 'builtin)) |
| 2265 | (installable (and archive (not built-in))) | 2266 | (installable (and archive (not built-in))) |
| @@ -2332,6 +2333,8 @@ Otherwise no newline is inserted." | |||
| 2332 | (and version | 2333 | (and version |
| 2333 | (package--print-help-section "Version" | 2334 | (package--print-help-section "Version" |
| 2334 | (package-version-join version))) | 2335 | (package-version-join version))) |
| 2336 | (when commit | ||
| 2337 | (package--print-help-section "Commit" commit)) | ||
| 2335 | (when desc | 2338 | (when desc |
| 2336 | (package--print-help-section "Summary" | 2339 | (package--print-help-section "Summary" |
| 2337 | (package-desc-summary desc))) | 2340 | (package-desc-summary desc))) |
diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 0be6971992c..ca11c596638 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Code: | 24 | ;;; Code: |
| 25 | 25 | ||
| 26 | (require 'seq) | ||
| 27 | |||
| 26 | ;;;###autoload | 28 | ;;;###autoload |
| 27 | (defun read-multiple-choice (prompt choices) | 29 | (defun read-multiple-choice (prompt choices) |
| 28 | "Ask user a multiple choice question. | 30 | "Ask user a multiple choice question. |
diff --git a/lisp/epg.el b/lisp/epg.el index 407b0f5d5d3..fee6ad75119 100644 --- a/lisp/epg.el +++ b/lisp/epg.el | |||
| @@ -757,9 +757,8 @@ callback data (if any)." | |||
| 757 | ;; Restore Emacs frame on text terminal, when pinentry-curses has terminated. | 757 | ;; Restore Emacs frame on text terminal, when pinentry-curses has terminated. |
| 758 | (if (with-current-buffer (process-buffer (epg-context-process context)) | 758 | (if (with-current-buffer (process-buffer (epg-context-process context)) |
| 759 | (and epg-agent-file | 759 | (and epg-agent-file |
| 760 | (> (float-time (or (nth 5 (file-attributes epg-agent-file)) | 760 | (time-less-p epg-agent-mtime |
| 761 | '(0 0 0 0))) | 761 | (or (nth 5 (file-attributes epg-agent-file)) 0)))) |
| 762 | (float-time epg-agent-mtime)))) | ||
| 763 | (redraw-frame)) | 762 | (redraw-frame)) |
| 764 | (epg-context-set-result-for | 763 | (epg-context-set-result-for |
| 765 | context 'error | 764 | context 'error |
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 1ab3c60b2c7..8084c126530 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el | |||
| @@ -444,7 +444,6 @@ line, with the most recent command last. See also | |||
| 444 | (ignore-dups eshell-hist-ignoredups)) | 444 | (ignore-dups eshell-hist-ignoredups)) |
| 445 | (with-temp-buffer | 445 | (with-temp-buffer |
| 446 | (insert-file-contents file) | 446 | (insert-file-contents file) |
| 447 | ;; Save restriction in case file is already visited... | ||
| 448 | ;; Watch for those date stamps in history files! | 447 | ;; Watch for those date stamps in history files! |
| 449 | (goto-char (point-max)) | 448 | (goto-char (point-max)) |
| 450 | (while (and (< count size) | 449 | (while (and (< count size) |
| @@ -488,7 +487,9 @@ See also `eshell-read-history'." | |||
| 488 | (while (> index 0) | 487 | (while (> index 0) |
| 489 | (setq index (1- index)) | 488 | (setq index (1- index)) |
| 490 | (let ((start (point))) | 489 | (let ((start (point))) |
| 491 | (insert (ring-ref ring index) ?\n) | 490 | ;; Remove properties before inserting, to avoid trouble |
| 491 | ;; with read-only strings (Bug#28700). | ||
| 492 | (insert (substring-no-properties (ring-ref ring index)) ?\n) | ||
| 492 | (subst-char-in-region start (1- (point)) ?\n ?\177))) | 493 | (subst-char-in-region start (1- (point)) ?\n ?\177))) |
| 493 | (eshell-with-private-file-modes | 494 | (eshell-with-private-file-modes |
| 494 | (write-region (point-min) (point-max) file append | 495 | (write-region (point-min) (point-max) file append |
diff --git a/lisp/files.el b/lisp/files.el index 666654da2c9..cda2c1abd5e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3947,11 +3947,12 @@ This function returns either: | |||
| 3947 | ;; The entry MTIME should match the most recent | 3947 | ;; The entry MTIME should match the most recent |
| 3948 | ;; MTIME among matching files. | 3948 | ;; MTIME among matching files. |
| 3949 | (and cached-files | 3949 | (and cached-files |
| 3950 | (= (float-time (nth 2 dir-elt)) | 3950 | (equal (nth 2 dir-elt) |
| 3951 | (apply #'max (mapcar (lambda (f) | 3951 | (let ((latest 0)) |
| 3952 | (float-time | 3952 | (dolist (f cached-files latest) |
| 3953 | (nth 5 (file-attributes f)))) | 3953 | (let ((f-time (nth 5 (file-attributes f)))) |
| 3954 | cached-files)))))) | 3954 | (if (time-less-p latest f-time) |
| 3955 | (setq latest f-time))))))))) | ||
| 3955 | ;; This cache entry is OK. | 3956 | ;; This cache entry is OK. |
| 3956 | dir-elt | 3957 | dir-elt |
| 3957 | ;; This cache entry is invalid; clear it. | 3958 | ;; This cache entry is invalid; clear it. |
| @@ -3973,10 +3974,15 @@ Return the new class name, which is a symbol named DIR." | |||
| 3973 | (let* ((class-name (intern dir)) | 3974 | (let* ((class-name (intern dir)) |
| 3974 | (files (dir-locals--all-files dir)) | 3975 | (files (dir-locals--all-files dir)) |
| 3975 | (read-circle nil) | 3976 | (read-circle nil) |
| 3976 | (success nil) | 3977 | ;; If there was a problem, use the values we could get but |
| 3978 | ;; don't let the cache prevent future reads. | ||
| 3979 | (latest 0) (success 0) | ||
| 3977 | (variables)) | 3980 | (variables)) |
| 3978 | (with-demoted-errors "Error reading dir-locals: %S" | 3981 | (with-demoted-errors "Error reading dir-locals: %S" |
| 3979 | (dolist (file files) | 3982 | (dolist (file files) |
| 3983 | (let ((file-time (nth 5 (file-attributes file)))) | ||
| 3984 | (if (time-less-p latest file-time) | ||
| 3985 | (setq latest file-time))) | ||
| 3980 | (with-temp-buffer | 3986 | (with-temp-buffer |
| 3981 | (insert-file-contents file) | 3987 | (insert-file-contents file) |
| 3982 | (condition-case-unless-debug nil | 3988 | (condition-case-unless-debug nil |
| @@ -3985,18 +3991,9 @@ Return the new class name, which is a symbol named DIR." | |||
| 3985 | variables | 3991 | variables |
| 3986 | (read (current-buffer)))) | 3992 | (read (current-buffer)))) |
| 3987 | (end-of-file nil)))) | 3993 | (end-of-file nil)))) |
| 3988 | (setq success t)) | 3994 | (setq success latest)) |
| 3989 | (dir-locals-set-class-variables class-name variables) | 3995 | (dir-locals-set-class-variables class-name variables) |
| 3990 | (dir-locals-set-directory-class | 3996 | (dir-locals-set-directory-class dir class-name success) |
| 3991 | dir class-name | ||
| 3992 | (seconds-to-time | ||
| 3993 | (if success | ||
| 3994 | (apply #'max (mapcar (lambda (file) | ||
| 3995 | (float-time (nth 5 (file-attributes file)))) | ||
| 3996 | files)) | ||
| 3997 | ;; If there was a problem, use the values we could get but | ||
| 3998 | ;; don't let the cache prevent future reads. | ||
| 3999 | 0))) | ||
| 4000 | class-name)) | 3997 | class-name)) |
| 4001 | 3998 | ||
| 4002 | (define-obsolete-function-alias 'dir-locals-read-from-file | 3999 | (define-obsolete-function-alias 'dir-locals-read-from-file |
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 1174f90e1ad..89f17316cf1 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el | |||
| @@ -2373,7 +2373,10 @@ specified by `gnus-gmane-group-download-format'." | |||
| 2373 | (with-temp-file tmpfile | 2373 | (with-temp-file tmpfile |
| 2374 | (url-insert-file-contents | 2374 | (url-insert-file-contents |
| 2375 | (format gnus-gmane-group-download-format | 2375 | (format gnus-gmane-group-download-format |
| 2376 | group start (+ start range))) | 2376 | group start (+ start range)) |
| 2377 | t) | ||
| 2378 | ;; `url-insert-file-contents' sets this because of the 2nd arg. | ||
| 2379 | (setq buffer-file-name nil) | ||
| 2377 | (write-region (point-min) (point-max) tmpfile) | 2380 | (write-region (point-min) (point-max) tmpfile) |
| 2378 | (gnus-group-read-ephemeral-group | 2381 | (gnus-group-read-ephemeral-group |
| 2379 | (format "nndoc+ephemeral:%s.start-%s.range-%s" group start range) | 2382 | (format "nndoc+ephemeral:%s.start-%s.range-%s" group start range) |
| @@ -2463,13 +2466,11 @@ the bug number, and browsing the URL must return mbox output." | |||
| 2463 | (if (and (not gnus-plugged) | 2466 | (if (and (not gnus-plugged) |
| 2464 | (file-exists-p file)) | 2467 | (file-exists-p file)) |
| 2465 | (insert-file-contents file) | 2468 | (insert-file-contents file) |
| 2466 | (url-insert-file-contents (format mbox-url id))))) | 2469 | (url-insert-file-contents (format mbox-url id) t)))) |
| 2467 | ;; Add the debbugs address so that we can respond to reports easily. | 2470 | ;; Add the debbugs address so that we can respond to reports easily. |
| 2468 | (let ((address | 2471 | (let ((address |
| 2469 | (format "%s@%s" (car ids) | 2472 | (format "%s@%s" (car ids) |
| 2470 | (replace-regexp-in-string | 2473 | (url-host (url-generic-parse-url mbox-url))))) |
| 2471 | "/.*$" "" | ||
| 2472 | (replace-regexp-in-string "^http://" "" mbox-url))))) | ||
| 2473 | (goto-char (point-min)) | 2474 | (goto-char (point-min)) |
| 2474 | (while (re-search-forward (concat "^" message-unix-mail-delimiter) | 2475 | (while (re-search-forward (concat "^" message-unix-mail-delimiter) |
| 2475 | nil t) | 2476 | nil t) |
| @@ -2490,7 +2491,9 @@ the bug number, and browsing the URL must return mbox output." | |||
| 2490 | (insert ", " address)) | 2491 | (insert ", " address)) |
| 2491 | (insert "To: " address "\n"))) | 2492 | (insert "To: " address "\n"))) |
| 2492 | (goto-char (point-max)) | 2493 | (goto-char (point-max)) |
| 2493 | (widen))))) | 2494 | (widen))) |
| 2495 | ;; `url-insert-file-contents' sets this because of the 2nd arg. | ||
| 2496 | (setq buffer-file-name nil))) | ||
| 2494 | (gnus-group-read-ephemeral-group | 2497 | (gnus-group-read-ephemeral-group |
| 2495 | (format "nndoc+ephemeral:bug#%s" | 2498 | (format "nndoc+ephemeral:bug#%s" |
| 2496 | (mapconcat 'number-to-string ids ",")) | 2499 | (mapconcat 'number-to-string ids ",")) |
| @@ -2514,6 +2517,8 @@ the bug number, and browsing the URL must return mbox output." | |||
| 2514 | (interactive (list (string-to-number | 2517 | (interactive (list (string-to-number |
| 2515 | (read-string "Enter bug number: " | 2518 | (read-string "Enter bug number: " |
| 2516 | (thing-at-point 'word) nil)))) | 2519 | (thing-at-point 'word) nil)))) |
| 2520 | (when (stringp ids) | ||
| 2521 | (setq ids (string-to-number ids))) | ||
| 2517 | (unless (listp ids) | 2522 | (unless (listp ids) |
| 2518 | (setq ids (list ids))) | 2523 | (setq ids (list ids))) |
| 2519 | (gnus-read-ephemeral-bug-group | 2524 | (gnus-read-ephemeral-bug-group |
diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 30ecc2befc7..175d9df5e8c 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el | |||
| @@ -582,10 +582,11 @@ Create the thumbnails directory if it does not exist." | |||
| 582 | "Return the image descriptor for a thumbnail of image file FILE." | 582 | "Return the image descriptor for a thumbnail of image file FILE." |
| 583 | (unless (string-match (image-file-name-regexp) file) | 583 | (unless (string-match (image-file-name-regexp) file) |
| 584 | (error "%s is not a valid image file" file)) | 584 | (error "%s is not a valid image file" file)) |
| 585 | (let ((thumb-file (image-dired-thumb-name file))) | 585 | (let* ((thumb-file (image-dired-thumb-name file)) |
| 586 | (unless (and (file-exists-p thumb-file) | 586 | (thumb-attr (file-attributes thumb-file))) |
| 587 | (<= (float-time (nth 5 (file-attributes file))) | 587 | (when (or (not thumb-attr) |
| 588 | (float-time (nth 5 (file-attributes thumb-file))))) | 588 | (time-less-p (nth 5 thumb-attr) |
| 589 | (nth 5 (file-attributes file)))) | ||
| 589 | (image-dired-create-thumb file thumb-file)) | 590 | (image-dired-create-thumb file thumb-file)) |
| 590 | (create-image thumb-file) | 591 | (create-image thumb-file) |
| 591 | ;; (list 'image :type 'jpeg | 592 | ;; (list 'image :type 'jpeg |
| @@ -748,10 +749,8 @@ Increase at own risk.") | |||
| 748 | 'image-dired-cmd-create-thumbnail-program) | 749 | 'image-dired-cmd-create-thumbnail-program) |
| 749 | (let* ((width (int-to-string (image-dired-thumb-size 'width))) | 750 | (let* ((width (int-to-string (image-dired-thumb-size 'width))) |
| 750 | (height (int-to-string (image-dired-thumb-size 'height))) | 751 | (height (int-to-string (image-dired-thumb-size 'height))) |
| 751 | (modif-time | 752 | (modif-time (format-time-string |
| 752 | (format "%.0f" | 753 | "%s" (nth 5 (file-attributes original-file)))) |
| 753 | (ffloor (float-time | ||
| 754 | (nth 5 (file-attributes original-file)))))) | ||
| 755 | (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png" | 754 | (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png" |
| 756 | thumbnail-file)) | 755 | thumbnail-file)) |
| 757 | (spec | 756 | (spec |
diff --git a/lisp/info.el b/lisp/info.el index 6f87adb04e8..e2f9953f7c7 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -649,7 +649,7 @@ Do the right thing if the file has been compressed or zipped." | |||
| 649 | (attribs-new (and (stringp fullname) (file-attributes fullname))) | 649 | (attribs-new (and (stringp fullname) (file-attributes fullname))) |
| 650 | (modtime-new (and attribs-new (nth 5 attribs-new)))) | 650 | (modtime-new (and attribs-new (nth 5 attribs-new)))) |
| 651 | (when (and modtime-old modtime-new | 651 | (when (and modtime-old modtime-new |
| 652 | (> (float-time modtime-new) (float-time modtime-old))) | 652 | (time-less-p modtime-old modtime-new)) |
| 653 | (setq Info-index-nodes (remove (assoc (or Info-current-file filename) | 653 | (setq Info-index-nodes (remove (assoc (or Info-current-file filename) |
| 654 | Info-index-nodes) | 654 | Info-index-nodes) |
| 655 | Info-index-nodes)) | 655 | Info-index-nodes)) |
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 4abc571db44..5729f2fc8d3 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -111,6 +111,7 @@ | |||
| 111 | ;;; Code: | 111 | ;;; Code: |
| 112 | 112 | ||
| 113 | ;; Customization: | 113 | ;; Customization: |
| 114 | (require 'replace) | ||
| 114 | 115 | ||
| 115 | (defgroup kmacro nil | 116 | (defgroup kmacro nil |
| 116 | "Simplified keyboard macro user interface." | 117 | "Simplified keyboard macro user interface." |
diff --git a/lisp/loadup.el b/lisp/loadup.el index d048f0736be..40e5651aa1d 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el | |||
| @@ -76,6 +76,7 @@ | |||
| 76 | (setq max-lisp-eval-depth 2200) | 76 | (setq max-lisp-eval-depth 2200) |
| 77 | (setq load-path (list (expand-file-name "." dir) | 77 | (setq load-path (list (expand-file-name "." dir) |
| 78 | (expand-file-name "emacs-lisp" dir) | 78 | (expand-file-name "emacs-lisp" dir) |
| 79 | (expand-file-name "progmodes" dir) | ||
| 79 | (expand-file-name "language" dir) | 80 | (expand-file-name "language" dir) |
| 80 | (expand-file-name "international" dir) | 81 | (expand-file-name "international" dir) |
| 81 | (expand-file-name "textmodes" dir) | 82 | (expand-file-name "textmodes" dir) |
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 280e7f4bc3e..caddc7f760b 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el | |||
| @@ -567,6 +567,8 @@ Responds to the window width as ls should but may not!" | |||
| 567 | (setq list (cdr list))) | 567 | (setq list (cdr list))) |
| 568 | result)) | 568 | result)) |
| 569 | 569 | ||
| 570 | (defvar w32-collate-ignore-punctuation) ; Declare for non-w32 builds. | ||
| 571 | |||
| 570 | (defsubst ls-lisp-string-lessp (s1 s2) | 572 | (defsubst ls-lisp-string-lessp (s1 s2) |
| 571 | "Return t if string S1 should sort before string S2. | 573 | "Return t if string S1 should sort before string S2. |
| 572 | Case is significant if `ls-lisp-ignore-case' is nil. | 574 | Case is significant if `ls-lisp-ignore-case' is nil. |
| @@ -861,7 +863,7 @@ Use the same method as ls to decide whether to show time-of-day or year, | |||
| 861 | depending on distance between file date and the current time. | 863 | depending on distance between file date and the current time. |
| 862 | All ls time options, namely c, t and u, are handled." | 864 | All ls time options, namely c, t and u, are handled." |
| 863 | (let* ((time (nth (or time-index 5) file-attr)) ; default is last modtime | 865 | (let* ((time (nth (or time-index 5) file-attr)) ; default is last modtime |
| 864 | (diff (- (float-time time) (float-time))) | 866 | (diff (time-subtract time nil)) |
| 865 | ;; Consider a time to be recent if it is within the past six | 867 | ;; Consider a time to be recent if it is within the past six |
| 866 | ;; months. A Gregorian year has 365.2425 * 24 * 60 * 60 == | 868 | ;; months. A Gregorian year has 365.2425 * 24 * 60 * 60 == |
| 867 | ;; 31556952 seconds on the average, and half of that is 15778476. | 869 | ;; 31556952 seconds on the average, and half of that is 15778476. |
| @@ -878,7 +880,8 @@ All ls time options, namely c, t and u, are handled." | |||
| 878 | (if (member locale '("C" "POSIX")) | 880 | (if (member locale '("C" "POSIX")) |
| 879 | (setq locale nil)) | 881 | (setq locale nil)) |
| 880 | (format-time-string | 882 | (format-time-string |
| 881 | (if (and (<= past-cutoff diff) (<= diff 0)) | 883 | (if (and (not (time-less-p diff past-cutoff)) |
| 884 | (not (time-less-p 0 diff))) | ||
| 882 | (if (and locale (not ls-lisp-use-localized-time-format)) | 885 | (if (and locale (not ls-lisp-use-localized-time-format)) |
| 883 | "%m-%d %H:%M" | 886 | "%m-%d %H:%M" |
| 884 | (nth 0 ls-lisp-format-time-list)) | 887 | (nth 0 ls-lisp-format-time-list)) |
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 73f62c85519..cf65e10e510 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el | |||
| @@ -3479,7 +3479,7 @@ system TYPE.") | |||
| 3479 | (f2-mt (nth 5 (file-attributes f2)))) | 3479 | (f2-mt (nth 5 (file-attributes f2)))) |
| 3480 | (cond ((null f1-mt) nil) | 3480 | (cond ((null f1-mt) nil) |
| 3481 | ((null f2-mt) t) | 3481 | ((null f2-mt) t) |
| 3482 | (t (> (float-time f1-mt) (float-time f2-mt))))) | 3482 | (t (time-less-p f2-mt f1-mt)))) |
| 3483 | (ange-ftp-real-file-newer-than-file-p f1 f2)))) | 3483 | (ange-ftp-real-file-newer-than-file-p f1 f2)))) |
| 3484 | 3484 | ||
| 3485 | (defun ange-ftp-file-writable-p (file) | 3485 | (defun ange-ftp-file-writable-p (file) |
| @@ -3561,7 +3561,7 @@ Value is (0 0) if the modification time cannot be determined." | |||
| 3561 | (let ((file-mdtm (ange-ftp-file-modtime name)) | 3561 | (let ((file-mdtm (ange-ftp-file-modtime name)) |
| 3562 | (buf-mdtm (with-current-buffer buf (visited-file-modtime)))) | 3562 | (buf-mdtm (with-current-buffer buf (visited-file-modtime)))) |
| 3563 | (or (zerop (car file-mdtm)) | 3563 | (or (zerop (car file-mdtm)) |
| 3564 | (<= (float-time file-mdtm) (float-time buf-mdtm)))) | 3564 | (not (time-less-p buf-mdtm file-mdtm)))) |
| 3565 | (ange-ftp-real-verify-visited-file-modtime buf)))) | 3565 | (ange-ftp-real-verify-visited-file-modtime buf)))) |
| 3566 | 3566 | ||
| 3567 | (defun ange-ftp-file-size (file &optional ascii-mode) | 3567 | (defun ange-ftp-file-size (file &optional ascii-mode) |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 5c785daa8a2..3b6b6c8c807 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -2333,7 +2333,7 @@ With a prefix arg, prompt for new topic." | |||
| 2333 | 2333 | ||
| 2334 | (defun rcirc-ctcp-sender-PING (process target _request) | 2334 | (defun rcirc-ctcp-sender-PING (process target _request) |
| 2335 | "Send a CTCP PING message to TARGET." | 2335 | "Send a CTCP PING message to TARGET." |
| 2336 | (let ((timestamp (format "%.0f" (float-time)))) | 2336 | (let ((timestamp (format-time-string "%s"))) |
| 2337 | (rcirc-send-ctcp process target "PING" timestamp))) | 2337 | (rcirc-send-ctcp process target "PING" timestamp))) |
| 2338 | 2338 | ||
| 2339 | (defun rcirc-cmd-me (args &optional process target) | 2339 | (defun rcirc-cmd-me (args &optional process target) |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 214ad040a17..9326f7b1864 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -235,6 +235,12 @@ If NAME is a remote file name, the local part of NAME is unquoted." | |||
| 235 | ((eq tramp-syntax 'sep) 'separate) | 235 | ((eq tramp-syntax 'sep) 'separate) |
| 236 | (t tramp-syntax))) | 236 | (t tramp-syntax))) |
| 237 | 237 | ||
| 238 | ;; `cl-struct-slot-info' has been introduced with Emacs 25. | ||
| 239 | (defmacro tramp-compat-tramp-file-name-slots () | ||
| 240 | (if (fboundp 'cl-struct-slot-info) | ||
| 241 | `(cdr (mapcar 'car (cl-struct-slot-info 'tramp-file-name))) | ||
| 242 | `(cdr (mapcar 'car (get 'tramp-file-name 'cl-struct-slots))))) | ||
| 243 | |||
| 238 | (provide 'tramp-compat) | 244 | (provide 'tramp-compat) |
| 239 | 245 | ||
| 240 | ;;; TODO: | 246 | ;;; TODO: |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index c8b6e68f719..e300b3a58ed 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -660,7 +660,7 @@ Useful for \"rsync\" like methods.") | |||
| 660 | (make-variable-buffer-local 'tramp-temp-buffer-file-name) | 660 | (make-variable-buffer-local 'tramp-temp-buffer-file-name) |
| 661 | (put 'tramp-temp-buffer-file-name 'permanent-local t) | 661 | (put 'tramp-temp-buffer-file-name 'permanent-local t) |
| 662 | 662 | ||
| 663 | ;;;###autoload | 663 | ;;;###tramp-autoload |
| 664 | (defcustom tramp-syntax 'default | 664 | (defcustom tramp-syntax 'default |
| 665 | "Tramp filename syntax to be used. | 665 | "Tramp filename syntax to be used. |
| 666 | 666 | ||
| @@ -674,48 +674,54 @@ Do not change the value by `setq', it must be changed only by | |||
| 674 | `custom-set-variables'. See also `tramp-change-syntax'." | 674 | `custom-set-variables'. See also `tramp-change-syntax'." |
| 675 | :group 'tramp | 675 | :group 'tramp |
| 676 | :version "26.1" | 676 | :version "26.1" |
| 677 | :package-version '(Tramp . "2.3.2") | 677 | :package-version '(Tramp . "2.3.3") |
| 678 | :type '(choice (const :tag "Default" default) | 678 | :type '(choice (const :tag "Default" default) |
| 679 | (const :tag "Ange-FTP" simplified) | 679 | (const :tag "Ange-FTP" simplified) |
| 680 | (const :tag "XEmacs" separate)) | 680 | (const :tag "XEmacs" separate)) |
| 681 | :require 'tramp | 681 | :require 'tramp |
| 682 | :initialize 'custom-initialize-set | 682 | :initialize 'custom-initialize-set |
| 683 | :set (lambda (symbol value) | 683 | :set 'tramp-set-syntax) |
| 684 | ;; Check allowed values. | 684 | |
| 685 | (unless (memq value (tramp-syntax-values)) | 685 | (defun tramp-set-syntax (symbol value) |
| 686 | (tramp-compat-user-error "Wrong `tramp-syntax' %s" tramp-syntax)) | 686 | "Set SYMBOL to value VALUE. |
| 687 | ;; Cleanup existing buffers. | 687 | Used in user option `tramp-syntax'. There are further variables |
| 688 | (unless (eq (symbol-value symbol) value) | 688 | to be set, depending on VALUE." |
| 689 | (tramp-cleanup-all-buffers)) | 689 | ;; Check allowed values. |
| 690 | ;; Set the value: | 690 | (unless (memq value (tramp-syntax-values)) |
| 691 | (set-default symbol value) | 691 | (tramp-compat-user-error "Wrong `tramp-syntax' %s" tramp-syntax)) |
| 692 | ;; Reset the depending variables. | 692 | ;; Cleanup existing buffers. |
| 693 | (with-no-warnings | 693 | (unless (eq (symbol-value symbol) value) |
| 694 | (setq tramp-prefix-format (tramp-build-prefix-format) | 694 | (tramp-cleanup-all-buffers)) |
| 695 | tramp-prefix-regexp (tramp-build-prefix-regexp) | 695 | ;; Set the value: |
| 696 | tramp-method-regexp (tramp-build-method-regexp) | 696 | (set-default symbol value) |
| 697 | tramp-postfix-method-format (tramp-build-postfix-method-format) | 697 | ;; Reset the depending variables. |
| 698 | tramp-postfix-method-regexp (tramp-build-postfix-method-regexp) | 698 | (with-no-warnings |
| 699 | tramp-prefix-ipv6-format (tramp-build-prefix-ipv6-format) | 699 | (setq tramp-prefix-format (tramp-build-prefix-format) |
| 700 | tramp-prefix-ipv6-regexp (tramp-build-prefix-ipv6-regexp) | 700 | tramp-prefix-regexp (tramp-build-prefix-regexp) |
| 701 | tramp-postfix-ipv6-format (tramp-build-postfix-ipv6-format) | 701 | tramp-method-regexp (tramp-build-method-regexp) |
| 702 | tramp-postfix-ipv6-regexp (tramp-build-postfix-ipv6-regexp) | 702 | tramp-postfix-method-format (tramp-build-postfix-method-format) |
| 703 | tramp-postfix-host-format (tramp-build-postfix-host-format) | 703 | tramp-postfix-method-regexp (tramp-build-postfix-method-regexp) |
| 704 | tramp-postfix-host-regexp (tramp-build-postfix-host-regexp) | 704 | tramp-prefix-ipv6-format (tramp-build-prefix-ipv6-format) |
| 705 | tramp-remote-file-name-spec-regexp | 705 | tramp-prefix-ipv6-regexp (tramp-build-prefix-ipv6-regexp) |
| 706 | (tramp-build-remote-file-name-spec-regexp) | 706 | tramp-postfix-ipv6-format (tramp-build-postfix-ipv6-format) |
| 707 | tramp-file-name-structure (tramp-build-file-name-structure) | 707 | tramp-postfix-ipv6-regexp (tramp-build-postfix-ipv6-regexp) |
| 708 | tramp-file-name-regexp (tramp-build-file-name-regexp) | 708 | tramp-postfix-host-format (tramp-build-postfix-host-format) |
| 709 | tramp-completion-file-name-regexp | 709 | tramp-postfix-host-regexp (tramp-build-postfix-host-regexp) |
| 710 | (tramp-build-completion-file-name-regexp))) | 710 | tramp-remote-file-name-spec-regexp |
| 711 | ;; Rearrange file name handlers. | 711 | (tramp-build-remote-file-name-spec-regexp) |
| 712 | (tramp-register-file-name-handlers))) | 712 | tramp-file-name-structure (tramp-build-file-name-structure) |
| 713 | tramp-file-name-regexp (tramp-build-file-name-regexp) | ||
| 714 | tramp-completion-file-name-regexp | ||
| 715 | (tramp-build-completion-file-name-regexp))) | ||
| 716 | ;; Rearrange file name handlers. | ||
| 717 | (tramp-register-file-name-handlers)) | ||
| 713 | 718 | ||
| 714 | ;; Initialize the Tramp syntax variables. We want to override initial | 719 | ;; Initialize the Tramp syntax variables. We want to override initial |
| 715 | ;; values of `tramp-file-name-regexp' and | 720 | ;; value of `tramp-file-name-regexp'. Other Tramp syntax variables |
| 716 | ;; `tramp-completion-file-name-regexp'. | 721 | ;; must be initialized as well to proper values. We do not call |
| 722 | ;; `custom-set-variable', this would load Tramp via custom.el. | ||
| 717 | (eval-after-load 'tramp | 723 | (eval-after-load 'tramp |
| 718 | '(custom-set-variables `(tramp-syntax ',(tramp-compat-tramp-syntax)))) | 724 | '(tramp-set-syntax 'tramp-syntax (tramp-compat-tramp-syntax))) |
| 719 | 725 | ||
| 720 | (defun tramp-syntax-values () | 726 | (defun tramp-syntax-values () |
| 721 | "Return possible values of `tramp-syntax', a list" | 727 | "Return possible values of `tramp-syntax', a list" |
| @@ -978,7 +984,6 @@ This regexp should match Tramp file names but no other file | |||
| 978 | names. When calling `tramp-register-file-name-handlers', the | 984 | names. When calling `tramp-register-file-name-handlers', the |
| 979 | initial value is overwritten by the car of `tramp-file-name-structure'.") | 985 | initial value is overwritten by the car of `tramp-file-name-structure'.") |
| 980 | 986 | ||
| 981 | ;;;###autoload | ||
| 982 | (defconst tramp-completion-file-name-regexp-default | 987 | (defconst tramp-completion-file-name-regexp-default |
| 983 | (concat | 988 | (concat |
| 984 | "\\`/\\(" | 989 | "\\`/\\(" |
| @@ -1042,10 +1047,19 @@ updated after changing this variable. | |||
| 1042 | Also see `tramp-file-name-structure'.") | 1047 | Also see `tramp-file-name-structure'.") |
| 1043 | 1048 | ||
| 1044 | ;;;###autoload | 1049 | ;;;###autoload |
| 1045 | (defconst tramp-initial-completion-file-name-regexp | 1050 | (defconst tramp-autoload-file-name-regexp |
| 1046 | tramp-completion-file-name-regexp-default | 1051 | (concat |
| 1047 | "Value for `tramp-completion-file-name-regexp' for autoload. | 1052 | "\\`/" |
| 1048 | It must match the initial `tramp-syntax' settings.") | 1053 | (if (memq system-type '(cygwin windows-nt)) |
| 1054 | ;; The method is either "-", or at least two characters. | ||
| 1055 | "\\(-\\|[^/|:]\\{2,\\}\\)" | ||
| 1056 | ;; At least one character for method. | ||
| 1057 | "[^/|:]+") | ||
| 1058 | ":\\'") | ||
| 1059 | "Regular expression matching file names handled by Tramp autoload. | ||
| 1060 | It must match the initial `tramp-syntax' settings. It should not | ||
| 1061 | match file names at root of the underlying local file system, | ||
| 1062 | like \"/sys\" or \"/C:\".") | ||
| 1049 | 1063 | ||
| 1050 | ;; Chunked sending kludge. We set this to 500 for black-listed constellations | 1064 | ;; Chunked sending kludge. We set this to 500 for black-listed constellations |
| 1051 | ;; known to have a bug in `process-send-string'; some ssh connections appear | 1065 | ;; known to have a bug in `process-send-string'; some ssh connections appear |
| @@ -1186,7 +1200,6 @@ means to use always cached values for the directory contents." | |||
| 1186 | (defvar tramp-current-connection nil | 1200 | (defvar tramp-current-connection nil |
| 1187 | "Last connection timestamp.") | 1201 | "Last connection timestamp.") |
| 1188 | 1202 | ||
| 1189 | ;;;###autoload | ||
| 1190 | (defconst tramp-completion-file-name-handler-alist | 1203 | (defconst tramp-completion-file-name-handler-alist |
| 1191 | '((file-name-all-completions | 1204 | '((file-name-all-completions |
| 1192 | . tramp-completion-handle-file-name-all-completions) | 1205 | . tramp-completion-handle-file-name-all-completions) |
| @@ -1740,20 +1753,20 @@ Second arg VAR is a symbol. It is used as a variable name to hold | |||
| 1740 | the filename structure. It is also used as a prefix for the variables | 1753 | the filename structure. It is also used as a prefix for the variables |
| 1741 | holding the components. For example, if VAR is the symbol `foo', then | 1754 | holding the components. For example, if VAR is the symbol `foo', then |
| 1742 | `foo' will be bound to the whole structure, `foo-method' will be bound to | 1755 | `foo' will be bound to the whole structure, `foo-method' will be bound to |
| 1743 | the method component, and so on for `foo-user', `foo-host', `foo-localname', | 1756 | the method component, and so on for `foo-user', `foo-domain', `foo-host', |
| 1744 | `foo-hop'. | 1757 | `foo-port', `foo-localname', `foo-hop'. |
| 1745 | 1758 | ||
| 1746 | Remaining args are Lisp expressions to be evaluated (inside an implicit | 1759 | Remaining args are Lisp expressions to be evaluated (inside an implicit |
| 1747 | `progn'). | 1760 | `progn'). |
| 1748 | 1761 | ||
| 1749 | If VAR is nil, then we bind `v' to the structure and `method', `user', | 1762 | If VAR is nil, then we bind `v' to the structure and `method', `user', |
| 1750 | `host', `localname', `hop' to the components." | 1763 | `domain', `host', `port', `localname', `hop' to the components." |
| 1751 | (let ((bindings | 1764 | (let ((bindings |
| 1752 | (mapcar (lambda (elem) | 1765 | (mapcar (lambda (elem) |
| 1753 | `(,(if var (intern (format "%s-%s" var elem)) elem) | 1766 | `(,(if var (intern (format "%s-%s" var elem)) elem) |
| 1754 | (,(intern (format "tramp-file-name-%s" elem)) | 1767 | (,(intern (format "tramp-file-name-%s" elem)) |
| 1755 | ,(or var 'v)))) | 1768 | ,(or var 'v)))) |
| 1756 | '(method user domain host port localname hop)))) | 1769 | `,(tramp-compat-tramp-file-name-slots)))) |
| 1757 | `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename)) | 1770 | `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename)) |
| 1758 | ,@bindings) | 1771 | ,@bindings) |
| 1759 | ;; We don't know which of those vars will be used, so we bind them all, | 1772 | ;; We don't know which of those vars will be used, so we bind them all, |
| @@ -2281,7 +2294,6 @@ Falls back to normal file name handler if no Tramp file name handler exists." | |||
| 2281 | ;; we don't do anything. | 2294 | ;; we don't do anything. |
| 2282 | (tramp-run-real-handler operation args)))) | 2295 | (tramp-run-real-handler operation args)))) |
| 2283 | 2296 | ||
| 2284 | ;;;###autoload | ||
| 2285 | (defun tramp-completion-file-name-handler (operation &rest args) | 2297 | (defun tramp-completion-file-name-handler (operation &rest args) |
| 2286 | "Invoke Tramp file name completion handler. | 2298 | "Invoke Tramp file name completion handler. |
| 2287 | Falls back to normal file name handler if no Tramp file name handler exists." | 2299 | Falls back to normal file name handler if no Tramp file name handler exists." |
| @@ -2304,17 +2316,9 @@ Falls back to normal file name handler if no Tramp file name handler exists." | |||
| 2304 | (progn (defun tramp-register-autoload-file-name-handlers () | 2316 | (progn (defun tramp-register-autoload-file-name-handlers () |
| 2305 | "Add Tramp file name handlers to `file-name-handler-alist' during autoload." | 2317 | "Add Tramp file name handlers to `file-name-handler-alist' during autoload." |
| 2306 | (add-to-list 'file-name-handler-alist | 2318 | (add-to-list 'file-name-handler-alist |
| 2307 | (cons tramp-initial-file-name-regexp | 2319 | (cons tramp-autoload-file-name-regexp |
| 2308 | 'tramp-autoload-file-name-handler)) | 2320 | 'tramp-autoload-file-name-handler)) |
| 2309 | (put 'tramp-autoload-file-name-handler 'safe-magic t) | 2321 | (put 'tramp-autoload-file-name-handler 'safe-magic t))) |
| 2310 | |||
| 2311 | (add-to-list 'file-name-handler-alist | ||
| 2312 | (cons tramp-initial-completion-file-name-regexp | ||
| 2313 | 'tramp-completion-file-name-handler)) | ||
| 2314 | (put 'tramp-completion-file-name-handler 'safe-magic t) | ||
| 2315 | ;; Mark `operations' the handler is responsible for. | ||
| 2316 | (put 'tramp-completion-file-name-handler 'operations | ||
| 2317 | (mapcar 'car tramp-completion-file-name-handler-alist)))) | ||
| 2318 | 2322 | ||
| 2319 | ;;;###autoload | 2323 | ;;;###autoload |
| 2320 | (tramp-register-autoload-file-name-handlers) | 2324 | (tramp-register-autoload-file-name-handlers) |
| @@ -2455,7 +2459,8 @@ not in completion mode." | |||
| 2455 | 2459 | ||
| 2456 | ;; Method, host name and user name completion. | 2460 | ;; Method, host name and user name completion. |
| 2457 | ;; `tramp-completion-dissect-file-name' returns a list of | 2461 | ;; `tramp-completion-dissect-file-name' returns a list of |
| 2458 | ;; tramp-file-name structures. For all of them we return possible completions. | 2462 | ;; `tramp-file-name' structures. For all of them we return possible |
| 2463 | ;; completions. | ||
| 2459 | (defun tramp-completion-handle-file-name-all-completions (filename directory) | 2464 | (defun tramp-completion-handle-file-name-all-completions (filename directory) |
| 2460 | "Like `file-name-all-completions' for partial Tramp files." | 2465 | "Like `file-name-all-completions' for partial Tramp files." |
| 2461 | 2466 | ||
| @@ -2536,9 +2541,9 @@ not in completion mode." | |||
| 2536 | (tramp-connectable-p (expand-file-name filename directory))) | 2541 | (tramp-connectable-p (expand-file-name filename directory))) |
| 2537 | (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) | 2542 | (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) |
| 2538 | 2543 | ||
| 2539 | ;; I misuse a little bit the tramp-file-name structure in order to | 2544 | ;; I misuse a little bit the `tramp-file-name' structure in order to |
| 2540 | ;; handle completion possibilities for partial methods / user names / | 2545 | ;; handle completion possibilities for partial methods / user names / |
| 2541 | ;; host names. Return value is a list of tramp-file-name structures | 2546 | ;; host names. Return value is a list of `tramp-file-name' structures |
| 2542 | ;; according to possible completions. If "localname" is non-nil it | 2547 | ;; according to possible completions. If "localname" is non-nil it |
| 2543 | ;; means there shouldn't be a completion anymore. | 2548 | ;; means there shouldn't be a completion anymore. |
| 2544 | 2549 | ||
| @@ -3221,9 +3226,9 @@ User is always nil." | |||
| 3221 | (car x) | 3226 | (car x) |
| 3222 | (if (and (stringp (cdr x)) | 3227 | (if (and (stringp (cdr x)) |
| 3223 | (file-name-absolute-p (cdr x)) | 3228 | (file-name-absolute-p (cdr x)) |
| 3224 | (not (tramp-file-name-p (cdr x)))) | 3229 | (not (tramp-tramp-file-p (cdr x)))) |
| 3225 | (tramp-make-tramp-file-name | 3230 | (tramp-make-tramp-file-name |
| 3226 | method user domain host port (cdr x)) | 3231 | method user domain host port (cdr x) hop) |
| 3227 | (cdr x)))) | 3232 | (cdr x)))) |
| 3228 | tramp-backup-directory-alist) | 3233 | tramp-backup-directory-alist) |
| 3229 | backup-directory-alist))) | 3234 | backup-directory-alist))) |
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 5c8bbebf31b..ca64b544200 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -1852,7 +1852,7 @@ with a brace block." | |||
| 1852 | ;; struct, union, enum, or similar: | 1852 | ;; struct, union, enum, or similar: |
| 1853 | ((looking-at c-type-prefix-key) | 1853 | ((looking-at c-type-prefix-key) |
| 1854 | (let ((key-pos (point))) | 1854 | (let ((key-pos (point))) |
| 1855 | (c-forward-token-2 1) ; over "struct ". | 1855 | (c-forward-over-token-and-ws) ; over "struct ". |
| 1856 | (cond | 1856 | (cond |
| 1857 | ((looking-at c-symbol-key) ; "struct foo { ..." | 1857 | ((looking-at c-symbol-key) ; "struct foo { ..." |
| 1858 | (buffer-substring-no-properties key-pos (match-end 0))) | 1858 | (buffer-substring-no-properties key-pos (match-end 0))) |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 37928357526..457f95f2ca3 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -4297,6 +4297,47 @@ comment at the start of cc-engine.el for more info." | |||
| 4297 | "\\w\\|\\s_\\|\\s\"\\|\\s|" | 4297 | "\\w\\|\\s_\\|\\s\"\\|\\s|" |
| 4298 | "\\w\\|\\s_\\|\\s\"")) | 4298 | "\\w\\|\\s_\\|\\s\"")) |
| 4299 | 4299 | ||
| 4300 | (defun c-forward-over-token-and-ws (&optional balanced) | ||
| 4301 | "Move forward over a token and any following whitespace | ||
| 4302 | Return t if we moved, nil otherwise (i.e. we were at EOB, or a | ||
| 4303 | non-token or BALANCED is non-nil and we can't move). If we | ||
| 4304 | are at syntactic whitespace, move over this in place of a token. | ||
| 4305 | |||
| 4306 | If BALANCED is non-nil move over any balanced parens we are at, and never move | ||
| 4307 | out of an enclosing paren. | ||
| 4308 | |||
| 4309 | This function differs from `c-forward-token-2' in that it will move forward | ||
| 4310 | over the final token in a buffer, up to EOB." | ||
| 4311 | (let ((jump-syntax (if balanced | ||
| 4312 | c-jump-syntax-balanced | ||
| 4313 | c-jump-syntax-unbalanced)) | ||
| 4314 | (here (point))) | ||
| 4315 | (when | ||
| 4316 | (condition-case nil | ||
| 4317 | (cond | ||
| 4318 | ((/= (point) | ||
| 4319 | (progn (c-forward-syntactic-ws) (point))) | ||
| 4320 | ;; If we're at whitespace, count this as the token. | ||
| 4321 | t) | ||
| 4322 | ((eobp) nil) | ||
| 4323 | ((looking-at jump-syntax) | ||
| 4324 | (goto-char (scan-sexps (point) 1)) | ||
| 4325 | t) | ||
| 4326 | ((looking-at c-nonsymbol-token-regexp) | ||
| 4327 | (goto-char (match-end 0)) | ||
| 4328 | t) | ||
| 4329 | ((save-restriction | ||
| 4330 | (widen) | ||
| 4331 | (looking-at c-nonsymbol-token-regexp)) | ||
| 4332 | nil) | ||
| 4333 | (t | ||
| 4334 | (forward-char) | ||
| 4335 | t)) | ||
| 4336 | (error (goto-char here) | ||
| 4337 | nil)) | ||
| 4338 | (c-forward-syntactic-ws) | ||
| 4339 | t))) | ||
| 4340 | |||
| 4300 | (defun c-forward-token-2 (&optional count balanced limit) | 4341 | (defun c-forward-token-2 (&optional count balanced limit) |
| 4301 | "Move forward by tokens. | 4342 | "Move forward by tokens. |
| 4302 | A token is defined as all symbols and identifiers which aren't | 4343 | A token is defined as all symbols and identifiers which aren't |
| @@ -4326,15 +4367,11 @@ comment at the start of cc-engine.el for more info." | |||
| 4326 | (if (< count 0) | 4367 | (if (< count 0) |
| 4327 | (- (c-backward-token-2 (- count) balanced limit)) | 4368 | (- (c-backward-token-2 (- count) balanced limit)) |
| 4328 | 4369 | ||
| 4329 | (let ((jump-syntax (if balanced | 4370 | (let ((here (point)) |
| 4330 | c-jump-syntax-balanced | 4371 | (last (point))) |
| 4331 | c-jump-syntax-unbalanced)) | 4372 | (when (zerop count) |
| 4332 | (last (point)) | 4373 | ;; If count is zero we should jump if in the middle of a token. |
| 4333 | (prev (point))) | 4374 | (c-end-of-current-token)) |
| 4334 | |||
| 4335 | (if (zerop count) | ||
| 4336 | ;; If count is zero we should jump if in the middle of a token. | ||
| 4337 | (c-end-of-current-token)) | ||
| 4338 | 4375 | ||
| 4339 | (save-restriction | 4376 | (save-restriction |
| 4340 | (if limit (narrow-to-region (point-min) limit)) | 4377 | (if limit (narrow-to-region (point-min) limit)) |
| @@ -4348,43 +4385,15 @@ comment at the start of cc-engine.el for more info." | |||
| 4348 | ;; Moved out of bounds. Make sure the returned count isn't zero. | 4385 | ;; Moved out of bounds. Make sure the returned count isn't zero. |
| 4349 | (progn | 4386 | (progn |
| 4350 | (if (zerop count) (setq count 1)) | 4387 | (if (zerop count) (setq count 1)) |
| 4351 | (goto-char last)) | 4388 | (goto-char here)) |
| 4352 | 4389 | (while (and | |
| 4353 | ;; Use `condition-case' to avoid having the limit tests | 4390 | (> count 0) |
| 4354 | ;; inside the loop. | 4391 | (c-forward-over-token-and-ws balanced) |
| 4355 | (condition-case nil | 4392 | (not (eobp))) |
| 4356 | (while (and | 4393 | (setq last (point) |
| 4357 | (> count 0) | 4394 | count (1- count))) |
| 4358 | (progn | 4395 | (if (eobp) |
| 4359 | (setq last (point)) | 4396 | (goto-char last)))) |
| 4360 | (cond ((looking-at jump-syntax) | ||
| 4361 | (goto-char (scan-sexps (point) 1)) | ||
| 4362 | t) | ||
| 4363 | ((looking-at c-nonsymbol-token-regexp) | ||
| 4364 | (goto-char (match-end 0)) | ||
| 4365 | t) | ||
| 4366 | ;; `c-nonsymbol-token-regexp' above should always | ||
| 4367 | ;; match if there are correct tokens. Try to | ||
| 4368 | ;; widen to see if the limit was set in the | ||
| 4369 | ;; middle of one, else fall back to treating | ||
| 4370 | ;; the offending thing as a one character token. | ||
| 4371 | ((and limit | ||
| 4372 | (save-restriction | ||
| 4373 | (widen) | ||
| 4374 | (looking-at c-nonsymbol-token-regexp))) | ||
| 4375 | nil) | ||
| 4376 | (t | ||
| 4377 | (forward-char) | ||
| 4378 | t)))) | ||
| 4379 | (c-forward-syntactic-ws) | ||
| 4380 | (setq prev last | ||
| 4381 | count (1- count))) | ||
| 4382 | (error (goto-char last))) | ||
| 4383 | |||
| 4384 | (when (eobp) | ||
| 4385 | (goto-char prev) | ||
| 4386 | (setq count (1+ count))))) | ||
| 4387 | |||
| 4388 | count))) | 4397 | count))) |
| 4389 | 4398 | ||
| 4390 | (defun c-backward-token-2 (&optional count balanced limit) | 4399 | (defun c-backward-token-2 (&optional count balanced limit) |
| @@ -6424,7 +6433,8 @@ comment at the start of cc-engine.el for more info." | |||
| 6424 | (not (eq (c-get-char-property (point) 'c-type) | 6433 | (not (eq (c-get-char-property (point) 'c-type) |
| 6425 | 'c-decl-arg-start))))))) | 6434 | 'c-decl-arg-start))))))) |
| 6426 | (or (c-forward-<>-arglist nil) | 6435 | (or (c-forward-<>-arglist nil) |
| 6427 | (c-forward-token-2))))) | 6436 | (c-forward-over-token-and-ws) |
| 6437 | (goto-char c-new-END))))) | ||
| 6428 | 6438 | ||
| 6429 | 6439 | ||
| 6430 | ;; Functions to handle C++ raw strings. | 6440 | ;; Functions to handle C++ raw strings. |
| @@ -7142,7 +7152,7 @@ comment at the start of cc-engine.el for more info." | |||
| 7142 | (let ((c-promote-possible-types t) | 7152 | (let ((c-promote-possible-types t) |
| 7143 | (c-record-found-types t)) | 7153 | (c-record-found-types t)) |
| 7144 | (c-forward-type)) | 7154 | (c-forward-type)) |
| 7145 | (c-forward-token-2)))) | 7155 | (c-forward-over-token-and-ws)))) |
| 7146 | 7156 | ||
| 7147 | (c-forward-syntactic-ws) | 7157 | (c-forward-syntactic-ws) |
| 7148 | 7158 | ||
| @@ -8102,12 +8112,14 @@ comment at the start of cc-engine.el for more info." | |||
| 8102 | ;; initializing brace lists. | 8112 | ;; initializing brace lists. |
| 8103 | (let (found) | 8113 | (let (found) |
| 8104 | (while | 8114 | (while |
| 8105 | (and (progn | 8115 | (and (< (point) limit) |
| 8116 | (progn | ||
| 8106 | ;; In the next loop, we keep searching forward whilst | 8117 | ;; In the next loop, we keep searching forward whilst |
| 8107 | ;; we find ":"s which aren't single colons inside C++ | 8118 | ;; we find ":"s which aren't single colons inside C++ |
| 8108 | ;; "for" statements. | 8119 | ;; "for" statements. |
| 8109 | (while | 8120 | (while |
| 8110 | (and | 8121 | (and |
| 8122 | (< (point) limit) | ||
| 8111 | (setq found | 8123 | (setq found |
| 8112 | (c-syntactic-re-search-forward | 8124 | (c-syntactic-re-search-forward |
| 8113 | "[;:,]\\|\\s)\\|\\(=\\|\\s(\\)" | 8125 | "[;:,]\\|\\s)\\|\\(=\\|\\s(\\)" |
| @@ -8129,7 +8141,7 @@ comment at the start of cc-engine.el for more info." | |||
| 8129 | (c-go-up-list-forward)) | 8141 | (c-go-up-list-forward)) |
| 8130 | (setq brackets-after-id t)) | 8142 | (setq brackets-after-id t)) |
| 8131 | (when found (backward-char)) | 8143 | (when found (backward-char)) |
| 8132 | t)) | 8144 | (<= (point) limit))) |
| 8133 | (list id-start id-end brackets-after-id (match-beginning 1) decorated) | 8145 | (list id-start id-end brackets-after-id (match-beginning 1) decorated) |
| 8134 | 8146 | ||
| 8135 | (goto-char here) | 8147 | (goto-char here) |
| @@ -9722,8 +9734,8 @@ comment at the start of cc-engine.el for more info." | |||
| 9722 | ;; identifiers? | 9734 | ;; identifiers? |
| 9723 | (progn | 9735 | (progn |
| 9724 | (goto-char before-lparen) | 9736 | (goto-char before-lparen) |
| 9725 | (c-forward-token-2) ; to first token inside parens | ||
| 9726 | (and | 9737 | (and |
| 9738 | (c-forward-over-token-and-ws) ; to first token inside parens | ||
| 9727 | (setq id-start (c-on-identifier)) ; Must be at least one. | 9739 | (setq id-start (c-on-identifier)) ; Must be at least one. |
| 9728 | (catch 'id-list | 9740 | (catch 'id-list |
| 9729 | (while | 9741 | (while |
| @@ -9735,7 +9747,7 @@ comment at the start of cc-engine.el for more info." | |||
| 9735 | ids) | 9747 | ids) |
| 9736 | (c-forward-syntactic-ws) | 9748 | (c-forward-syntactic-ws) |
| 9737 | (eq (char-after) ?\,)) | 9749 | (eq (char-after) ?\,)) |
| 9738 | (c-forward-token-2) | 9750 | (c-forward-over-token-and-ws) |
| 9739 | (unless (setq id-start (c-on-identifier)) | 9751 | (unless (setq id-start (c-on-identifier)) |
| 9740 | (throw 'id-list nil))) | 9752 | (throw 'id-list nil))) |
| 9741 | (eq (char-after) ?\))))) | 9753 | (eq (char-after) ?\))))) |
| @@ -10525,10 +10537,10 @@ comment at the start of cc-engine.el for more info." | |||
| 10525 | ((and after-type-id-pos | 10537 | ((and after-type-id-pos |
| 10526 | (save-excursion | 10538 | (save-excursion |
| 10527 | (when (eq (char-after) ?\;) | 10539 | (when (eq (char-after) ?\;) |
| 10528 | (c-forward-token-2 1 t)) | 10540 | (c-forward-over-token-and-ws t)) |
| 10529 | (setq bufpos (point)) | 10541 | (setq bufpos (point)) |
| 10530 | (when (looking-at c-opt-<>-sexp-key) | 10542 | (when (looking-at c-opt-<>-sexp-key) |
| 10531 | (c-forward-token-2) | 10543 | (c-forward-over-token-and-ws) |
| 10532 | (when (and (eq (char-after) ?<) | 10544 | (when (and (eq (char-after) ?<) |
| 10533 | (c-get-char-property (point) 'syntax-table)) | 10545 | (c-get-char-property (point) 'syntax-table)) |
| 10534 | (c-go-list-forward nil after-type-id-pos) | 10546 | (c-go-list-forward nil after-type-id-pos) |
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 02b685d240d..d352e5b08c9 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -292,12 +292,17 @@ | |||
| 292 | nil))))) | 292 | nil))))) |
| 293 | res)))) | 293 | res)))) |
| 294 | 294 | ||
| 295 | (defun c-make-font-lock-search-form (regexp highlights) | 295 | (defun c-make-font-lock-search-form (regexp highlights &optional check-point) |
| 296 | ;; Return a lisp form which will fontify every occurrence of REGEXP | 296 | ;; Return a lisp form which will fontify every occurrence of REGEXP |
| 297 | ;; (a regular expression, NOT a function) between POINT and `limit' | 297 | ;; (a regular expression, NOT a function) between POINT and `limit' |
| 298 | ;; with HIGHLIGHTS, a list of highlighters as specified on page | 298 | ;; with HIGHLIGHTS, a list of highlighters as specified on page |
| 299 | ;; "Search-based Fontification" in the elisp manual. | 299 | ;; "Search-based Fontification" in the elisp manual. If CHECK-POINT |
| 300 | `(while (re-search-forward ,regexp limit t) | 300 | ;; is non-nil, we will check (< (point) limit) in the main loop. |
| 301 | `(while | ||
| 302 | ,(if check-point | ||
| 303 | `(and (< (point) limit) | ||
| 304 | (re-search-forward ,regexp limit t)) | ||
| 305 | `(re-search-forward ,regexp limit t)) | ||
| 301 | (unless (progn | 306 | (unless (progn |
| 302 | (goto-char (match-beginning 0)) | 307 | (goto-char (match-beginning 0)) |
| 303 | (c-skip-comments-and-strings limit)) | 308 | (c-skip-comments-and-strings limit)) |
| @@ -476,7 +481,9 @@ | |||
| 476 | ,(c-make-font-lock-search-form | 481 | ,(c-make-font-lock-search-form |
| 477 | regexp highlights))))) | 482 | regexp highlights))))) |
| 478 | state-stanzas) | 483 | state-stanzas) |
| 479 | ,(c-make-font-lock-search-form (car normal) (cdr normal)) | 484 | ;; In the next form, check that point hasn't been moved beyond |
| 485 | ;; `limit' in any of the above stanzas. | ||
| 486 | ,(c-make-font-lock-search-form (car normal) (cdr normal) t) | ||
| 480 | nil)))) | 487 | nil)))) |
| 481 | 488 | ||
| 482 | ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. | 489 | ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. |
| @@ -1062,7 +1069,7 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1062 | ;; The following `while' fontifies a single declarator id each time round. | 1069 | ;; The following `while' fontifies a single declarator id each time round. |
| 1063 | ;; It loops only when LIST is non-nil. | 1070 | ;; It loops only when LIST is non-nil. |
| 1064 | (while | 1071 | (while |
| 1065 | (and pos (setq decl-res (c-forward-declarator limit))) | 1072 | (and pos (setq decl-res (c-forward-declarator))) |
| 1066 | (setq next-pos (point) | 1073 | (setq next-pos (point) |
| 1067 | id-start (car decl-res) | 1074 | id-start (car decl-res) |
| 1068 | id-face (if (and (eq (char-after) ?\() | 1075 | id-face (if (and (eq (char-after) ?\() |
| @@ -1091,7 +1098,7 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1091 | (throw 'is-function nil)) | 1098 | (throw 'is-function nil)) |
| 1092 | ((not (eq got-type 'maybe)) | 1099 | ((not (eq got-type 'maybe)) |
| 1093 | (throw 'is-function t))) | 1100 | (throw 'is-function t))) |
| 1094 | (c-forward-declarator limit t) | 1101 | (c-forward-declarator nil t) |
| 1095 | (eq (char-after) ?,)) | 1102 | (eq (char-after) ?,)) |
| 1096 | (forward-char) | 1103 | (forward-char) |
| 1097 | (c-forward-syntactic-ws)) | 1104 | (c-forward-syntactic-ws)) |
| @@ -1730,7 +1737,7 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1730 | (c-syntactic-skip-backward "^;{}" decl-search-lim) | 1737 | (c-syntactic-skip-backward "^;{}" decl-search-lim) |
| 1731 | (c-forward-syntactic-ws) | 1738 | (c-forward-syntactic-ws) |
| 1732 | (setq in-typedef (looking-at c-typedef-key)) | 1739 | (setq in-typedef (looking-at c-typedef-key)) |
| 1733 | (if in-typedef (c-forward-token-2)) | 1740 | (if in-typedef (c-forward-over-token-and-ws)) |
| 1734 | (when (and c-opt-block-decls-with-vars-key | 1741 | (when (and c-opt-block-decls-with-vars-key |
| 1735 | (looking-at c-opt-block-decls-with-vars-key)) | 1742 | (looking-at c-opt-block-decls-with-vars-key)) |
| 1736 | (goto-char ps-elt) | 1743 | (goto-char ps-elt) |
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 2bbacf7bae4..1f86909362e 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -1834,10 +1834,15 @@ This performs fontification according to `js--class-styles'." | |||
| 1834 | (save-excursion | 1834 | (save-excursion |
| 1835 | (back-to-indentation) | 1835 | (back-to-indentation) |
| 1836 | (if (js--looking-at-operator-p) | 1836 | (if (js--looking-at-operator-p) |
| 1837 | (or (not (memq (char-after) '(?- ?+))) | 1837 | (if (eq (char-after) ?/) |
| 1838 | (progn | 1838 | (prog1 |
| 1839 | (forward-comment (- (point))) | 1839 | (not (nth 3 (syntax-ppss (1+ (point))))) |
| 1840 | (not (memq (char-before) '(?, ?\[ ?\())))) | 1840 | (forward-char -1)) |
| 1841 | (or | ||
| 1842 | (not (memq (char-after) '(?- ?+))) | ||
| 1843 | (progn | ||
| 1844 | (forward-comment (- (point))) | ||
| 1845 | (not (memq (char-before) '(?, ?\[ ?\()))))) | ||
| 1841 | (and (js--find-newline-backward) | 1846 | (and (js--find-newline-backward) |
| 1842 | (progn | 1847 | (progn |
| 1843 | (skip-chars-backward " \t") | 1848 | (skip-chars-backward " \t") |
| @@ -1972,8 +1977,12 @@ statement spanning multiple lines; otherwise, return nil." | |||
| 1972 | (save-excursion | 1977 | (save-excursion |
| 1973 | (back-to-indentation) | 1978 | (back-to-indentation) |
| 1974 | (when (not (looking-at js--declaration-keyword-re)) | 1979 | (when (not (looking-at js--declaration-keyword-re)) |
| 1975 | (when (looking-at js--indent-operator-re) | 1980 | (let ((pt (point))) |
| 1976 | (goto-char (match-end 0))) | 1981 | (when (looking-at js--indent-operator-re) |
| 1982 | (goto-char (match-end 0))) | ||
| 1983 | ;; The "operator" is probably a regexp literal opener. | ||
| 1984 | (when (nth 3 (syntax-ppss)) | ||
| 1985 | (goto-char pt))) | ||
| 1977 | (while (and (not at-opening-bracket) | 1986 | (while (and (not at-opening-bracket) |
| 1978 | (not (bobp)) | 1987 | (not (bobp)) |
| 1979 | (let ((pos (point))) | 1988 | (let ((pos (point))) |
diff --git a/lisp/replace.el b/lisp/replace.el index a5548f461d8..cdaeb9240ad 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | ;;; Code: | 29 | ;;; Code: |
| 30 | 30 | ||
| 31 | (require 'text-mode) | ||
| 31 | (eval-when-compile (require 'cl-lib)) | 32 | (eval-when-compile (require 'cl-lib)) |
| 32 | 33 | ||
| 33 | (defcustom case-replace t | 34 | (defcustom case-replace t |
diff --git a/lisp/server.el b/lisp/server.el index 33800a98682..4c591a5ee7c 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -546,14 +546,15 @@ See variable `server-auth-dir' for details." | |||
| 546 | ;; group recorded as the owner. | 546 | ;; group recorded as the owner. |
| 547 | (/= uid 544) (/= (user-uid) 500))) | 547 | (/= uid 544) (/= (user-uid) 500))) |
| 548 | (format "it is not owned by you (owner = %s (%d))" | 548 | (format "it is not owned by you (owner = %s (%d))" |
| 549 | (user-full-name (user-uid)) (user-uid))) | 549 | (user-full-name uid) uid)) |
| 550 | (w32 nil) ; on NTFS? | 550 | (w32 nil) ; on NTFS? |
| 551 | ((/= 0 (logand ?\077 (file-modes dir))) | 551 | ((/= 0 (logand ?\077 (file-modes dir))) |
| 552 | (format "it is accessible by others (%03o)" | 552 | (format "it is accessible by others (%03o)" |
| 553 | (file-modes dir))) | 553 | (file-modes dir))) |
| 554 | (t nil)))) | 554 | (t nil)))) |
| 555 | (when unsafe | 555 | (when unsafe |
| 556 | (error "`%s' is not a safe directory because %s" dir unsafe))))) | 556 | (error "`%s' is not a safe directory because %s" |
| 557 | (expand-file-name dir) unsafe))))) | ||
| 557 | 558 | ||
| 558 | (defun server-generate-key () | 559 | (defun server-generate-key () |
| 559 | "Generate and return a random authentication key. | 560 | "Generate and return a random authentication key. |
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index dafc0b2dca6..7300af06f49 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el | |||
| @@ -349,7 +349,7 @@ In which case `remember-mailbox' should be the name of the mailbox. | |||
| 349 | Each piece of pseudo-mail created will have an `X-Todo-Priority' | 349 | Each piece of pseudo-mail created will have an `X-Todo-Priority' |
| 350 | field, for the purpose of appropriate splitting." | 350 | field, for the purpose of appropriate splitting." |
| 351 | (let ((who (read-string "Who is this item related to? ")) | 351 | (let ((who (read-string "Who is this item related to? ")) |
| 352 | (moment (format "%.0f" (float-time))) | 352 | (moment (format-time-string "%s")) |
| 353 | (desc (remember-buffer-desc)) | 353 | (desc (remember-buffer-desc)) |
| 354 | (text (buffer-string))) | 354 | (text (buffer-string))) |
| 355 | (with-temp-buffer | 355 | (with-temp-buffer |
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 0a3103264d9..fbd905b8bc7 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el | |||
| @@ -210,7 +210,7 @@ i.e. 1970-1-1) are loaded as expiring one year from now instead." | |||
| 210 | (let ((exp (url-cookie-expires cookie))) | 210 | (let ((exp (url-cookie-expires cookie))) |
| 211 | (and (> (length exp) 0) | 211 | (and (> (length exp) 0) |
| 212 | (condition-case () | 212 | (condition-case () |
| 213 | (> (float-time) (float-time (date-to-time exp))) | 213 | (time-less-p nil (date-to-time exp)) |
| 214 | (error nil))))) | 214 | (error nil))))) |
| 215 | 215 | ||
| 216 | (defun url-cookie-retrieve (host &optional localpart secure) | 216 | (defun url-cookie-retrieve (host &optional localpart secure) |
diff --git a/lisp/url/url-tramp.el b/lisp/url/url-tramp.el index c28cf6c23a1..0b07bd0d1aa 100644 --- a/lisp/url/url-tramp.el +++ b/lisp/url/url-tramp.el | |||
| @@ -37,33 +37,41 @@ They must also be covered by `url-handler-regexp'." | |||
| 37 | :type '(repeat string)) | 37 | :type '(repeat string)) |
| 38 | 38 | ||
| 39 | (defun url-tramp-convert-url-to-tramp (url) | 39 | (defun url-tramp-convert-url-to-tramp (url) |
| 40 | "Convert URL to a Tramp file name." | 40 | "Convert URL to a Tramp file name. |
| 41 | (let ((obj (url-generic-parse-url (and (stringp url) url)))) | 41 | If URL contains a password, it will be added to the `password-data' cache. |
| 42 | (if (member (url-type obj) url-tramp-protocols) | 42 | In case URL is not convertable, nil is returned." |
| 43 | (progn | 43 | (let* ((obj (url-generic-parse-url (and (stringp url) url))) |
| 44 | (if (url-password obj) | 44 | (port |
| 45 | (password-cache-add | 45 | (and (natnump (url-portspec obj)) |
| 46 | (tramp-make-tramp-file-name | 46 | (number-to-string (url-portspec obj))))) |
| 47 | (url-type obj) (url-user obj) (url-host obj) "") | 47 | (when (member (url-type obj) url-tramp-protocols) |
| 48 | (url-password obj)) | 48 | (when (url-password obj) |
| 49 | (tramp-make-tramp-file-name | 49 | (password-cache-add |
| 50 | (url-type obj) (url-user obj) (url-host obj) (url-filename obj)))) | 50 | (tramp-make-tramp-file-name |
| 51 | url))) | 51 | (url-type obj) (url-user obj) nil |
| 52 | (url-host obj) port "") | ||
| 53 | (url-password obj))) | ||
| 54 | (tramp-make-tramp-file-name | ||
| 55 | (url-type obj) (url-user obj) nil | ||
| 56 | (url-host obj) port (url-filename obj))))) | ||
| 52 | 57 | ||
| 53 | (defun url-tramp-convert-tramp-to-url (file) | 58 | (defun url-tramp-convert-tramp-to-url (file) |
| 54 | "Convert FILE, a Tramp file name, to a URL." | 59 | "Convert FILE, a Tramp file name, to a URL. |
| 55 | (let ((obj (ignore-errors (tramp-dissect-file-name file)))) | 60 | In case FILE is not convertable, nil is returned." |
| 56 | (if (member (tramp-file-name-method obj) url-tramp-protocols) | 61 | (let* ((obj (ignore-errors (tramp-dissect-file-name file))) |
| 57 | (url-recreate-url | 62 | (port |
| 58 | (url-parse-make-urlobj | 63 | (and (stringp (tramp-file-name-port obj)) |
| 59 | (tramp-file-name-method obj) | 64 | (string-to-number (tramp-file-name-port obj))))) |
| 60 | (tramp-file-name-user obj) | 65 | (when (member (tramp-file-name-method obj) url-tramp-protocols) |
| 61 | nil ; password. | 66 | (url-recreate-url |
| 62 | (tramp-file-name-host obj) | 67 | (url-parse-make-urlobj |
| 63 | nil ; port. | 68 | (tramp-file-name-method obj) |
| 64 | (tramp-file-name-localname obj) | 69 | (tramp-file-name-user obj) |
| 65 | nil nil t)) ; target attributes fullness. | 70 | nil ; password. |
| 66 | file))) | 71 | (tramp-file-name-host obj) |
| 72 | port | ||
| 73 | (tramp-file-name-localname obj) | ||
| 74 | nil nil t))))) ; target attributes fullness. | ||
| 67 | 75 | ||
| 68 | ;;;###autoload | 76 | ;;;###autoload |
| 69 | (defun url-tramp-file-handler (operation &rest args) | 77 | (defun url-tramp-file-handler (operation &rest args) |
diff --git a/lisp/window.el b/lisp/window.el index 5ba9a305f96..c0a9ecd093c 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -320,22 +320,34 @@ WINDOW can be any window." | |||
| 320 | 320 | ||
| 321 | (defun window-normalize-buffer (buffer-or-name) | 321 | (defun window-normalize-buffer (buffer-or-name) |
| 322 | "Return buffer specified by BUFFER-OR-NAME. | 322 | "Return buffer specified by BUFFER-OR-NAME. |
| 323 | BUFFER-OR-NAME must be either a buffer or a string naming a live | 323 | BUFFER-OR-NAME must be a live buffer, a string naming a live |
| 324 | buffer and defaults to the current buffer." | 324 | buffer or nil which means to return the current buffer. |
| 325 | (cond | 325 | |
| 326 | ((not buffer-or-name) | 326 | This function is commonly used to process the (usually optional) |
| 327 | (current-buffer)) | 327 | \"BUFFER-OR-NAME\" argument of window related functions where nil |
| 328 | ((bufferp buffer-or-name) | 328 | stands for the current buffer." |
| 329 | (if (buffer-live-p buffer-or-name) | 329 | (let ((buffer |
| 330 | buffer-or-name | 330 | (cond |
| 331 | (error "Buffer %s is not a live buffer" buffer-or-name))) | 331 | ((not buffer-or-name) |
| 332 | ((get-buffer buffer-or-name)) | 332 | (current-buffer)) |
| 333 | (t | 333 | ((bufferp buffer-or-name) |
| 334 | (error "No such buffer %s" buffer-or-name)))) | 334 | buffer-or-name) |
| 335 | ((stringp buffer-or-name) | ||
| 336 | (get-buffer buffer-or-name)) | ||
| 337 | (t | ||
| 338 | (error "No such buffer %s" buffer-or-name))))) | ||
| 339 | (if (buffer-live-p buffer) | ||
| 340 | buffer | ||
| 341 | (error "No such live buffer %s" buffer-or-name)))) | ||
| 335 | 342 | ||
| 336 | (defun window-normalize-frame (frame) | 343 | (defun window-normalize-frame (frame) |
| 337 | "Return frame specified by FRAME. | 344 | "Return frame specified by FRAME. |
| 338 | FRAME must be a live frame and defaults to the selected frame." | 345 | FRAME must be a live frame or nil which means to return the |
| 346 | selected frame. | ||
| 347 | |||
| 348 | This function is commonly used to process the (usually optional) | ||
| 349 | \"FRAME\" argument of window and frame related functions where | ||
| 350 | nil stands for the selected frame." | ||
| 339 | (if frame | 351 | (if frame |
| 340 | (if (frame-live-p frame) | 352 | (if (frame-live-p frame) |
| 341 | frame | 353 | frame |
| @@ -343,11 +355,15 @@ FRAME must be a live frame and defaults to the selected frame." | |||
| 343 | (selected-frame))) | 355 | (selected-frame))) |
| 344 | 356 | ||
| 345 | (defun window-normalize-window (window &optional live-only) | 357 | (defun window-normalize-window (window &optional live-only) |
| 346 | "Return the window specified by WINDOW. | 358 | "Return window specified by WINDOW. |
| 347 | If WINDOW is nil, return the selected window. Otherwise, if | 359 | If WINDOW is nil, return the selected window. Otherwise, if |
| 348 | WINDOW is a live or an internal window, return WINDOW; if | 360 | WINDOW is a live or an internal window, return WINDOW; if |
| 349 | LIVE-ONLY is non-nil, return WINDOW for a live window only. | 361 | LIVE-ONLY is non-nil, return WINDOW for a live window only. |
| 350 | Otherwise, signal an error." | 362 | Otherwise, signal an error. |
| 363 | |||
| 364 | This function is commonly used to process the (usually optional) | ||
| 365 | \"WINDOW\" argument of window related functions where nil stands | ||
| 366 | for the selected window." | ||
| 351 | (cond | 367 | (cond |
| 352 | ((null window) | 368 | ((null window) |
| 353 | (selected-window)) | 369 | (selected-window)) |
diff --git a/lisp/xdg.el b/lisp/xdg.el index 4250faaeb4b..9edc3d2629c 100644 --- a/lisp/xdg.el +++ b/lisp/xdg.el | |||
| @@ -94,8 +94,8 @@ file:///foo/bar.jpg" | |||
| 94 | (concat (md5 (xdg-thumb-uri filename)) ".png")) | 94 | (concat (md5 (xdg-thumb-uri filename)) ".png")) |
| 95 | 95 | ||
| 96 | (defun xdg-thumb-mtime (filename) | 96 | (defun xdg-thumb-mtime (filename) |
| 97 | "Return modification time of FILENAME as integral seconds from the epoch." | 97 | "Return modification time of FILENAME as an Emacs timestamp." |
| 98 | (floor (float-time (nth 5 (file-attributes filename))))) | 98 | (file-attribute-modification-time (file-attributes filename))) |
| 99 | 99 | ||
| 100 | 100 | ||
| 101 | ;; XDG User Directories | 101 | ;; XDG User Directories |
diff --git a/src/nsterm.m b/src/nsterm.m index 709e905ec8f..a382e5f7130 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -6804,14 +6804,19 @@ not_in_argv (NSString *arg) | |||
| 6804 | 6804 | ||
| 6805 | if (! [self isFullscreen]) | 6805 | if (! [self isFullscreen]) |
| 6806 | { | 6806 | { |
| 6807 | int toolbar_height; | ||
| 6807 | #ifdef NS_IMPL_GNUSTEP | 6808 | #ifdef NS_IMPL_GNUSTEP |
| 6808 | // GNUstep does not always update the tool bar height. Force it. | 6809 | // GNUstep does not always update the tool bar height. Force it. |
| 6809 | if (toolbar && [toolbar isVisible]) | 6810 | if (toolbar && [toolbar isVisible]) |
| 6810 | update_frame_tool_bar (emacsframe); | 6811 | update_frame_tool_bar (emacsframe); |
| 6811 | #endif | 6812 | #endif |
| 6812 | 6813 | ||
| 6814 | toolbar_height = FRAME_TOOLBAR_HEIGHT (emacsframe); | ||
| 6815 | if (toolbar_height < 0) | ||
| 6816 | toolbar_height = 35; | ||
| 6817 | |||
| 6813 | extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe) | 6818 | extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe) |
| 6814 | + FRAME_TOOLBAR_HEIGHT (emacsframe); | 6819 | + toolbar_height; |
| 6815 | } | 6820 | } |
| 6816 | 6821 | ||
| 6817 | if (wait_for_tool_bar) | 6822 | if (wait_for_tool_bar) |
| @@ -6858,11 +6863,12 @@ not_in_argv (NSString *arg) | |||
| 6858 | SET_FRAME_GARBAGED (emacsframe); | 6863 | SET_FRAME_GARBAGED (emacsframe); |
| 6859 | cancel_mouse_face (emacsframe); | 6864 | cancel_mouse_face (emacsframe); |
| 6860 | 6865 | ||
| 6861 | /* The next two lines appear to be setting the frame to the same | 6866 | /* The next two lines set the frame to the same size as we've |
| 6862 | size as it already is. Why are they there? */ | 6867 | already set above. We need to do this when we switch back |
| 6863 | // wr = NSMakeRect (0, 0, neww, newh); | 6868 | from non-native fullscreen, in other circumstances it appears |
| 6864 | 6869 | to be a noop. (bug#28872) */ | |
| 6865 | // [view setFrame: wr]; | 6870 | wr = NSMakeRect (0, 0, neww, newh); |
| 6871 | [view setFrame: wr]; | ||
| 6866 | 6872 | ||
| 6867 | // to do: consider using [NSNotificationCenter postNotificationName:]. | 6873 | // to do: consider using [NSNotificationCenter postNotificationName:]. |
| 6868 | [self windowDidMove: // Update top/left. | 6874 | [self windowDidMove: // Update top/left. |
diff --git a/src/thread.c b/src/thread.c index c03cdda0fae..6f12d796ff9 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -26,7 +26,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 26 | #include "coding.h" | 26 | #include "coding.h" |
| 27 | #include "syssignal.h" | 27 | #include "syssignal.h" |
| 28 | 28 | ||
| 29 | static struct thread_state main_thread; | 29 | static struct thread_state alignas (GCALIGNMENT) main_thread; |
| 30 | 30 | ||
| 31 | struct thread_state *current_thread = &main_thread; | 31 | struct thread_state *current_thread = &main_thread; |
| 32 | 32 | ||
diff --git a/src/unexelf.c b/src/unexelf.c index 1cdcfeb44e4..756de5835ce 100644 --- a/src/unexelf.c +++ b/src/unexelf.c | |||
| @@ -58,9 +58,11 @@ what you give them. Help stamp out software-hoarding! */ | |||
| 58 | #include <sys/types.h> | 58 | #include <sys/types.h> |
| 59 | #include <unistd.h> | 59 | #include <unistd.h> |
| 60 | 60 | ||
| 61 | #if !defined (__NetBSD__) && !defined (__OpenBSD__) | 61 | #ifdef __QNX__ |
| 62 | #include <elf.h> | 62 | # include <sys/elf.h> |
| 63 | #endif /* not __NetBSD__ and not __OpenBSD__ */ | 63 | #elif !defined __NetBSD__ && !defined __OpenBSD__ |
| 64 | # include <elf.h> | ||
| 65 | #endif | ||
| 64 | #include <sys/mman.h> | 66 | #include <sys/mman.h> |
| 65 | #if defined (_SYSTYPE_SYSV) | 67 | #if defined (_SYSTYPE_SYSV) |
| 66 | #include <sys/elf_mips.h> | 68 | #include <sys/elf_mips.h> |
| @@ -222,7 +224,6 @@ unexec (const char *new_name, const char *old_name) | |||
| 222 | { | 224 | { |
| 223 | int new_file, old_file; | 225 | int new_file, old_file; |
| 224 | off_t new_file_size; | 226 | off_t new_file_size; |
| 225 | void *new_break; | ||
| 226 | 227 | ||
| 227 | /* Pointers to the base of the image of the two files. */ | 228 | /* Pointers to the base of the image of the two files. */ |
| 228 | caddr_t old_base, new_base; | 229 | caddr_t old_base, new_base; |
| @@ -326,11 +327,13 @@ unexec (const char *new_name, const char *old_name) | |||
| 326 | if (old_bss_index == -1) | 327 | if (old_bss_index == -1) |
| 327 | fatal ("no bss section found"); | 328 | fatal ("no bss section found"); |
| 328 | 329 | ||
| 330 | void *no_break = (void *) (intptr_t) -1; | ||
| 331 | void *new_break = no_break; | ||
| 329 | #ifdef HAVE_SBRK | 332 | #ifdef HAVE_SBRK |
| 330 | new_break = sbrk (0); | 333 | new_break = sbrk (0); |
| 331 | #else | ||
| 332 | new_break = (byte *) old_bss_addr + old_bss_size; | ||
| 333 | #endif | 334 | #endif |
| 335 | if (new_break == no_break) | ||
| 336 | new_break = (byte *) old_bss_addr + old_bss_size; | ||
| 334 | new_bss_addr = (ElfW (Addr)) new_break; | 337 | new_bss_addr = (ElfW (Addr)) new_break; |
| 335 | bss_size_growth = new_bss_addr - old_bss_addr; | 338 | bss_size_growth = new_bss_addr - old_bss_addr; |
| 336 | new_data2_size = bss_size_growth; | 339 | new_data2_size = bss_size_growth; |
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 30d2a4753cf..f508c365427 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el | |||
| @@ -564,6 +564,17 @@ and will be removed soon. See (elisp)Backquote in the manual."))))))) | |||
| 564 | (byte-compile-file source t) | 564 | (byte-compile-file source t) |
| 565 | (should (equal bytecomp-tests--foobar (cons 1 2))))) | 565 | (should (equal bytecomp-tests--foobar (cons 1 2))))) |
| 566 | 566 | ||
| 567 | (ert-deftest bytecomp-tests--test-no-warnings-with-advice () | ||
| 568 | (defun f ()) | ||
| 569 | (define-advice f (:around (oldfun &rest args) test) | ||
| 570 | (apply oldfun args)) | ||
| 571 | (with-current-buffer (get-buffer-create "*Compile-Log*") | ||
| 572 | (let ((inhibit-read-only t)) (erase-buffer))) | ||
| 573 | (test-byte-comp-compile-and-load t '(defun f ())) | ||
| 574 | (with-current-buffer (get-buffer-create "*Compile-Log*") | ||
| 575 | (goto-char (point-min)) | ||
| 576 | (should-not (search-forward "Warning" nil t)))) | ||
| 577 | |||
| 567 | ;; Local Variables: | 578 | ;; Local Variables: |
| 568 | ;; no-byte-compile: t | 579 | ;; no-byte-compile: t |
| 569 | ;; End: | 580 | ;; End: |
diff --git a/test/lisp/emacs-lisp/lisp-tests.el b/test/lisp/emacs-lisp/lisp-tests.el index ae1302bdce4..654d949d388 100644 --- a/test/lisp/emacs-lisp/lisp-tests.el +++ b/test/lisp/emacs-lisp/lisp-tests.el | |||
| @@ -589,5 +589,36 @@ region." | |||
| 589 | (should (= (point) before)) | 589 | (should (= (point) before)) |
| 590 | (should (= (mark) after)))) | 590 | (should (= (mark) after)))) |
| 591 | 591 | ||
| 592 | (ert-deftest lisp-fill-paragraph-colon () | ||
| 593 | "Keywords below Emacs Lisp docstrings should not be filled (Bug#24622). | ||
| 594 | Keywords inside docstrings should be filled (Bug#7751)." | ||
| 595 | (elisp-tests-with-temp-buffer | ||
| 596 | " | ||
| 597 | \(defcustom custom value | ||
| 598 | \"First\n | ||
| 599 | Second\n | ||
| 600 | =!inside=Third line\" | ||
| 601 | =!keywords=:type 'sexp | ||
| 602 | :version \"26.1\" | ||
| 603 | :group 'lisp-tests)" | ||
| 604 | (goto-char inside) | ||
| 605 | (fill-paragraph) | ||
| 606 | (goto-char keywords) | ||
| 607 | (beginning-of-line) | ||
| 608 | (should (looking-at " :type 'sexp\n :version \"26.1\"\n :"))) | ||
| 609 | (elisp-tests-with-temp-buffer | ||
| 610 | " | ||
| 611 | \(defun foo () | ||
| 612 | \"Summary. | ||
| 613 | =!inside=Testing keywords: :one :two :three\" | ||
| 614 | (body))" ; FIXME: Remove parens around body to test Bug#28937 once it's fixed | ||
| 615 | (goto-char inside) | ||
| 616 | (let ((emacs-lisp-docstring-fill-column 30)) | ||
| 617 | (fill-paragraph)) | ||
| 618 | (forward-line) | ||
| 619 | (should (looking-at ":three")) | ||
| 620 | (end-of-line) | ||
| 621 | (should-not (eq (preceding-char) ?\))))) | ||
| 622 | |||
| 592 | (provide 'lisp-tests) | 623 | (provide 'lisp-tests) |
| 593 | ;;; lisp-tests.el ends here | 624 | ;;; lisp-tests.el ends here |
diff --git a/test/lisp/emacs-lisp/map-tests.el b/test/lisp/emacs-lisp/map-tests.el index 0a888d88b72..a434c9bd066 100644 --- a/test/lisp/emacs-lisp/map-tests.el +++ b/test/lisp/emacs-lisp/map-tests.el | |||
| @@ -36,7 +36,7 @@ Each map is built from the following alist data: | |||
| 36 | Evaluate BODY for each created map. | 36 | Evaluate BODY for each created map. |
| 37 | 37 | ||
| 38 | \(fn (var map) body)" | 38 | \(fn (var map) body)" |
| 39 | (declare (indent 1) (debug t)) | 39 | (declare (indent 1) (debug (symbolp body))) |
| 40 | (let ((alist (make-symbol "alist")) | 40 | (let ((alist (make-symbol "alist")) |
| 41 | (vec (make-symbol "vec")) | 41 | (vec (make-symbol "vec")) |
| 42 | (ht (make-symbol "ht"))) | 42 | (ht (make-symbol "ht"))) |
diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el new file mode 100644 index 00000000000..7ab79fda774 --- /dev/null +++ b/test/lisp/emacs-lisp/rmc-tests.el | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | ;;; rmc-tests.el --- Test suite for rmc.el -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Tino Calancha <tino.calancha@gmail.com> | ||
| 6 | ;; Keywords: | ||
| 7 | |||
| 8 | ;; This program is free software; you can redistribute it and/or modify | ||
| 9 | ;; it under the terms of the GNU General Public License as published by | ||
| 10 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 11 | ;; (at your option) any later version. | ||
| 12 | |||
| 13 | ;; This program is distributed in the hope that it will be useful, | ||
| 14 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | ;; GNU General Public License for more details. | ||
| 17 | |||
| 18 | ;; You should have received a copy of the GNU General Public License | ||
| 19 | ;; along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 20 | |||
| 21 | ;;; Commentary: | ||
| 22 | |||
| 23 | ;; | ||
| 24 | |||
| 25 | ;;; Code: | ||
| 26 | |||
| 27 | (require 'ert) | ||
| 28 | (require 'rmc) | ||
| 29 | (eval-when-compile (require 'cl-lib)) | ||
| 30 | |||
| 31 | |||
| 32 | (ert-deftest test-read-multiple-choice () | ||
| 33 | (dolist (char '(?y ?n)) | ||
| 34 | (cl-letf* (((symbol-function #'read-char) (lambda () char)) | ||
| 35 | (str (if (eq char ?y) "yes" "no"))) | ||
| 36 | (should (equal (list char str) | ||
| 37 | (read-multiple-choice "Do it? " '((?y "yes") (?n "no")))))))) | ||
| 38 | |||
| 39 | |||
| 40 | (provide 'rmc-tests) | ||
| 41 | ;;; rmc-tests.el ends here | ||
diff --git a/test/lisp/eshell/em-hist-tests.el b/test/lisp/eshell/em-hist-tests.el new file mode 100644 index 00000000000..7e0d6142812 --- /dev/null +++ b/test/lisp/eshell/em-hist-tests.el | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | ;;; tests/em-hist-tests.el --- em-hist test suite | ||
| 2 | |||
| 3 | ;; Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Code: | ||
| 21 | |||
| 22 | (require 'ert) | ||
| 23 | (require 'em-hist) | ||
| 24 | |||
| 25 | (ert-deftest eshell-write-readonly-history () | ||
| 26 | "Test that having read-only strings in history is okay." | ||
| 27 | (let ((histfile (make-temp-file "eshell-history")) | ||
| 28 | (eshell-history-ring (make-ring 2))) | ||
| 29 | (ring-insert eshell-history-ring | ||
| 30 | (propertize "echo foo" 'read-only t)) | ||
| 31 | (ring-insert eshell-history-ring | ||
| 32 | (propertize "echo bar" 'read-only t)) | ||
| 33 | (unwind-protect | ||
| 34 | (eshell-write-history histfile) | ||
| 35 | (delete-file histfile)))) | ||
| 36 | |||
| 37 | (provide 'em-hist-test) | ||
| 38 | |||
| 39 | ;;; em-hist-tests.el ends here | ||
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 4e0d6dc7621..58b8aa58bf1 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el | |||
| @@ -247,6 +247,6 @@ chars" | |||
| 247 | (goto-char eshell-last-input-start) | 247 | (goto-char eshell-last-input-start) |
| 248 | (string= (eshell-get-old-input) "echo alpha"))) | 248 | (string= (eshell-get-old-input) "echo alpha"))) |
| 249 | 249 | ||
| 250 | (provide 'esh-test) | 250 | (provide 'eshell-tests) |
| 251 | 251 | ||
| 252 | ;;; tests/eshell-tests.el ends here | 252 | ;;; tests/eshell-tests.el ends here |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index e92d1b6203c..af707f85007 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -3638,8 +3638,103 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3638 | (ignore-errors (delete-file tmp-name1)) | 3638 | (ignore-errors (delete-file tmp-name1)) |
| 3639 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 3639 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 3640 | 3640 | ||
| 3641 | (ert-deftest tramp-test34-find-backup-file-name () | ||
| 3642 | "Check `find-backup-file-name'." | ||
| 3643 | (skip-unless (tramp--test-enabled)) | ||
| 3644 | |||
| 3645 | (dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | ||
| 3646 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) | ||
| 3647 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | ||
| 3648 | ;; These settings are not used by Tramp, so we ignore them. | ||
| 3649 | version-control delete-old-versions | ||
| 3650 | (kept-old-versions (default-toplevel-value 'kept-old-versions)) | ||
| 3651 | (kept-new-versions (default-toplevel-value 'kept-new-versions))) | ||
| 3652 | |||
| 3653 | (unwind-protect | ||
| 3654 | ;; Use default `backup-directory-alist' mechanism. | ||
| 3655 | (let (backup-directory-alist tramp-backup-directory-alist) | ||
| 3656 | (should | ||
| 3657 | (equal | ||
| 3658 | (find-backup-file-name tmp-name1) | ||
| 3659 | (list | ||
| 3660 | (funcall | ||
| 3661 | (if quoted 'tramp-compat-file-name-quote 'identity) | ||
| 3662 | (expand-file-name | ||
| 3663 | (format "%s~" (file-name-nondirectory tmp-name1)) | ||
| 3664 | tramp-test-temporary-file-directory))))))) | ||
| 3665 | |||
| 3666 | (unwind-protect | ||
| 3667 | ;; Map `backup-directory-alist'. | ||
| 3668 | (let ((backup-directory-alist `(("." . ,tmp-name2))) | ||
| 3669 | tramp-backup-directory-alist) | ||
| 3670 | (should | ||
| 3671 | (equal | ||
| 3672 | (find-backup-file-name tmp-name1) | ||
| 3673 | (list | ||
| 3674 | (funcall | ||
| 3675 | (if quoted 'tramp-compat-file-name-quote 'identity) | ||
| 3676 | (expand-file-name | ||
| 3677 | (format | ||
| 3678 | "%s~" | ||
| 3679 | ;; This is taken from `make-backup-file-name-1'. | ||
| 3680 | (subst-char-in-string | ||
| 3681 | ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1))) | ||
| 3682 | tmp-name2))))) | ||
| 3683 | ;; The backup directory is created. | ||
| 3684 | (should (file-directory-p tmp-name2))) | ||
| 3685 | |||
| 3686 | ;; Cleanup. | ||
| 3687 | (ignore-errors (delete-directory tmp-name2 'recursive))) | ||
| 3688 | |||
| 3689 | (unwind-protect | ||
| 3690 | ;; Map `tramp-backup-directory-alist'. | ||
| 3691 | (let ((tramp-backup-directory-alist `(("." . ,tmp-name2))) | ||
| 3692 | backup-directory-alist) | ||
| 3693 | (should | ||
| 3694 | (equal | ||
| 3695 | (find-backup-file-name tmp-name1) | ||
| 3696 | (list | ||
| 3697 | (funcall | ||
| 3698 | (if quoted 'tramp-compat-file-name-quote 'identity) | ||
| 3699 | (expand-file-name | ||
| 3700 | (format | ||
| 3701 | "%s~" | ||
| 3702 | ;; This is taken from `make-backup-file-name-1'. | ||
| 3703 | (subst-char-in-string | ||
| 3704 | ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1))) | ||
| 3705 | tmp-name2))))) | ||
| 3706 | ;; The backup directory is created. | ||
| 3707 | (should (file-directory-p tmp-name2))) | ||
| 3708 | |||
| 3709 | ;; Cleanup. | ||
| 3710 | (ignore-errors (delete-directory tmp-name2 'recursive))) | ||
| 3711 | |||
| 3712 | (unwind-protect | ||
| 3713 | ;; Map `tramp-backup-directory-alist' with local file name. | ||
| 3714 | (let ((tramp-backup-directory-alist | ||
| 3715 | `(("." . ,(file-remote-p tmp-name2 'localname)))) | ||
| 3716 | backup-directory-alist) | ||
| 3717 | (should | ||
| 3718 | (equal | ||
| 3719 | (find-backup-file-name tmp-name1) | ||
| 3720 | (list | ||
| 3721 | (funcall | ||
| 3722 | (if quoted 'tramp-compat-file-name-quote 'identity) | ||
| 3723 | (expand-file-name | ||
| 3724 | (format | ||
| 3725 | "%s~" | ||
| 3726 | ;; This is taken from `make-backup-file-name-1'. | ||
| 3727 | (subst-char-in-string | ||
| 3728 | ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1))) | ||
| 3729 | tmp-name2))))) | ||
| 3730 | ;; The backup directory is created. | ||
| 3731 | (should (file-directory-p tmp-name2))) | ||
| 3732 | |||
| 3733 | ;; Cleanup. | ||
| 3734 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | ||
| 3735 | |||
| 3641 | ;; The functions were introduced in Emacs 26.1. | 3736 | ;; The functions were introduced in Emacs 26.1. |
| 3642 | (ert-deftest tramp-test34-make-nearby-temp-file () | 3737 | (ert-deftest tramp-test35-make-nearby-temp-file () |
| 3643 | "Check `make-nearby-temp-file' and `temporary-file-directory'." | 3738 | "Check `make-nearby-temp-file' and `temporary-file-directory'." |
| 3644 | (skip-unless (tramp--test-enabled)) | 3739 | (skip-unless (tramp--test-enabled)) |
| 3645 | ;; Since Emacs 26.1. | 3740 | ;; Since Emacs 26.1. |
| @@ -3678,7 +3773,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3678 | (defun tramp--test-emacs26-p () | 3773 | (defun tramp--test-emacs26-p () |
| 3679 | "Check for Emacs version >= 26.1. | 3774 | "Check for Emacs version >= 26.1. |
| 3680 | Some semantics has been changed for there, w/o new functions or | 3775 | Some semantics has been changed for there, w/o new functions or |
| 3681 | variables, so we check function Emacs version directly." | 3776 | variables, so we check the Emacs version directly." |
| 3682 | (>= emacs-major-version 26)) | 3777 | (>= emacs-major-version 26)) |
| 3683 | 3778 | ||
| 3684 | (defun tramp--test-adb-p () | 3779 | (defun tramp--test-adb-p () |
| @@ -3904,7 +3999,7 @@ This requires restrictions of file name syntax." | |||
| 3904 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 3999 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 3905 | 4000 | ||
| 3906 | (defun tramp--test-special-characters () | 4001 | (defun tramp--test-special-characters () |
| 3907 | "Perform the test in `tramp-test35-special-characters*'." | 4002 | "Perform the test in `tramp-test36-special-characters*'." |
| 3908 | ;; Newlines, slashes and backslashes in file names are not | 4003 | ;; Newlines, slashes and backslashes in file names are not |
| 3909 | ;; supported. So we don't test. And we don't test the tab | 4004 | ;; supported. So we don't test. And we don't test the tab |
| 3910 | ;; character on Windows or Cygwin, because the backslash is | 4005 | ;; character on Windows or Cygwin, because the backslash is |
| @@ -3947,7 +4042,7 @@ This requires restrictions of file name syntax." | |||
| 3947 | "{foo}bar{baz}")) | 4042 | "{foo}bar{baz}")) |
| 3948 | 4043 | ||
| 3949 | ;; These tests are inspired by Bug#17238. | 4044 | ;; These tests are inspired by Bug#17238. |
| 3950 | (ert-deftest tramp-test35-special-characters () | 4045 | (ert-deftest tramp-test36-special-characters () |
| 3951 | "Check special characters in file names." | 4046 | "Check special characters in file names." |
| 3952 | (skip-unless (tramp--test-enabled)) | 4047 | (skip-unless (tramp--test-enabled)) |
| 3953 | (skip-unless (not (tramp--test-rsync-p))) | 4048 | (skip-unless (not (tramp--test-rsync-p))) |
| @@ -3955,7 +4050,7 @@ This requires restrictions of file name syntax." | |||
| 3955 | 4050 | ||
| 3956 | (tramp--test-special-characters)) | 4051 | (tramp--test-special-characters)) |
| 3957 | 4052 | ||
| 3958 | (ert-deftest tramp-test35-special-characters-with-stat () | 4053 | (ert-deftest tramp-test36-special-characters-with-stat () |
| 3959 | "Check special characters in file names. | 4054 | "Check special characters in file names. |
| 3960 | Use the `stat' command." | 4055 | Use the `stat' command." |
| 3961 | :tags '(:expensive-test) | 4056 | :tags '(:expensive-test) |
| @@ -3973,7 +4068,7 @@ Use the `stat' command." | |||
| 3973 | tramp-connection-properties))) | 4068 | tramp-connection-properties))) |
| 3974 | (tramp--test-special-characters))) | 4069 | (tramp--test-special-characters))) |
| 3975 | 4070 | ||
| 3976 | (ert-deftest tramp-test35-special-characters-with-perl () | 4071 | (ert-deftest tramp-test36-special-characters-with-perl () |
| 3977 | "Check special characters in file names. | 4072 | "Check special characters in file names. |
| 3978 | Use the `perl' command." | 4073 | Use the `perl' command." |
| 3979 | :tags '(:expensive-test) | 4074 | :tags '(:expensive-test) |
| @@ -3994,7 +4089,7 @@ Use the `perl' command." | |||
| 3994 | tramp-connection-properties))) | 4089 | tramp-connection-properties))) |
| 3995 | (tramp--test-special-characters))) | 4090 | (tramp--test-special-characters))) |
| 3996 | 4091 | ||
| 3997 | (ert-deftest tramp-test35-special-characters-with-ls () | 4092 | (ert-deftest tramp-test36-special-characters-with-ls () |
| 3998 | "Check special characters in file names. | 4093 | "Check special characters in file names. |
| 3999 | Use the `ls' command." | 4094 | Use the `ls' command." |
| 4000 | :tags '(:expensive-test) | 4095 | :tags '(:expensive-test) |
| @@ -4017,7 +4112,7 @@ Use the `ls' command." | |||
| 4017 | (tramp--test-special-characters))) | 4112 | (tramp--test-special-characters))) |
| 4018 | 4113 | ||
| 4019 | (defun tramp--test-utf8 () | 4114 | (defun tramp--test-utf8 () |
| 4020 | "Perform the test in `tramp-test36-utf8*'." | 4115 | "Perform the test in `tramp-test37-utf8*'." |
| 4021 | (let* ((utf8 (if (and (eq system-type 'darwin) | 4116 | (let* ((utf8 (if (and (eq system-type 'darwin) |
| 4022 | (memq 'utf-8-hfs (coding-system-list))) | 4117 | (memq 'utf-8-hfs (coding-system-list))) |
| 4023 | 'utf-8-hfs 'utf-8)) | 4118 | 'utf-8-hfs 'utf-8)) |
| @@ -4032,7 +4127,7 @@ Use the `ls' command." | |||
| 4032 | "银河系漫游指南系列" | 4127 | "银河系漫游指南系列" |
| 4033 | "Автостопом по гала́ктике"))) | 4128 | "Автостопом по гала́ктике"))) |
| 4034 | 4129 | ||
| 4035 | (ert-deftest tramp-test36-utf8 () | 4130 | (ert-deftest tramp-test37-utf8 () |
| 4036 | "Check UTF8 encoding in file names and file contents." | 4131 | "Check UTF8 encoding in file names and file contents." |
| 4037 | (skip-unless (tramp--test-enabled)) | 4132 | (skip-unless (tramp--test-enabled)) |
| 4038 | (skip-unless (not (tramp--test-docker-p))) | 4133 | (skip-unless (not (tramp--test-docker-p))) |
| @@ -4042,7 +4137,7 @@ Use the `ls' command." | |||
| 4042 | 4137 | ||
| 4043 | (tramp--test-utf8)) | 4138 | (tramp--test-utf8)) |
| 4044 | 4139 | ||
| 4045 | (ert-deftest tramp-test36-utf8-with-stat () | 4140 | (ert-deftest tramp-test37-utf8-with-stat () |
| 4046 | "Check UTF8 encoding in file names and file contents. | 4141 | "Check UTF8 encoding in file names and file contents. |
| 4047 | Use the `stat' command." | 4142 | Use the `stat' command." |
| 4048 | :tags '(:expensive-test) | 4143 | :tags '(:expensive-test) |
| @@ -4062,7 +4157,7 @@ Use the `stat' command." | |||
| 4062 | tramp-connection-properties))) | 4157 | tramp-connection-properties))) |
| 4063 | (tramp--test-utf8))) | 4158 | (tramp--test-utf8))) |
| 4064 | 4159 | ||
| 4065 | (ert-deftest tramp-test36-utf8-with-perl () | 4160 | (ert-deftest tramp-test37-utf8-with-perl () |
| 4066 | "Check UTF8 encoding in file names and file contents. | 4161 | "Check UTF8 encoding in file names and file contents. |
| 4067 | Use the `perl' command." | 4162 | Use the `perl' command." |
| 4068 | :tags '(:expensive-test) | 4163 | :tags '(:expensive-test) |
| @@ -4085,7 +4180,7 @@ Use the `perl' command." | |||
| 4085 | tramp-connection-properties))) | 4180 | tramp-connection-properties))) |
| 4086 | (tramp--test-utf8))) | 4181 | (tramp--test-utf8))) |
| 4087 | 4182 | ||
| 4088 | (ert-deftest tramp-test36-utf8-with-ls () | 4183 | (ert-deftest tramp-test37-utf8-with-ls () |
| 4089 | "Check UTF8 encoding in file names and file contents. | 4184 | "Check UTF8 encoding in file names and file contents. |
| 4090 | Use the `ls' command." | 4185 | Use the `ls' command." |
| 4091 | :tags '(:expensive-test) | 4186 | :tags '(:expensive-test) |
| @@ -4108,7 +4203,7 @@ Use the `ls' command." | |||
| 4108 | tramp-connection-properties))) | 4203 | tramp-connection-properties))) |
| 4109 | (tramp--test-utf8))) | 4204 | (tramp--test-utf8))) |
| 4110 | 4205 | ||
| 4111 | (ert-deftest tramp-test37-file-system-info () | 4206 | (ert-deftest tramp-test38-file-system-info () |
| 4112 | "Check that `file-system-info' returns proper values." | 4207 | "Check that `file-system-info' returns proper values." |
| 4113 | (skip-unless (tramp--test-enabled)) | 4208 | (skip-unless (tramp--test-enabled)) |
| 4114 | ;; Since Emacs 27.1. | 4209 | ;; Since Emacs 27.1. |
| @@ -4130,7 +4225,7 @@ Use the `ls' command." | |||
| 4130 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) | 4225 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) |
| 4131 | 4226 | ||
| 4132 | ;; This test is inspired by Bug#16928. | 4227 | ;; This test is inspired by Bug#16928. |
| 4133 | (ert-deftest tramp-test38-asynchronous-requests () | 4228 | (ert-deftest tramp-test39-asynchronous-requests () |
| 4134 | "Check parallel asynchronous requests. | 4229 | "Check parallel asynchronous requests. |
| 4135 | Such requests could arrive from timers, process filters and | 4230 | Such requests could arrive from timers, process filters and |
| 4136 | process sentinels. They shall not disturb each other." | 4231 | process sentinels. They shall not disturb each other." |
| @@ -4287,7 +4382,7 @@ process sentinels. They shall not disturb each other." | |||
| 4287 | (ignore-errors (cancel-timer timer)) | 4382 | (ignore-errors (cancel-timer timer)) |
| 4288 | (ignore-errors (delete-directory tmp-name 'recursive))))))) | 4383 | (ignore-errors (delete-directory tmp-name 'recursive))))))) |
| 4289 | 4384 | ||
| 4290 | (ert-deftest tramp-test39-recursive-load () | 4385 | (ert-deftest tramp-test40-recursive-load () |
| 4291 | "Check that Tramp does not fail due to recursive load." | 4386 | "Check that Tramp does not fail due to recursive load." |
| 4292 | (skip-unless (tramp--test-enabled)) | 4387 | (skip-unless (tramp--test-enabled)) |
| 4293 | 4388 | ||
| @@ -4310,7 +4405,7 @@ process sentinels. They shall not disturb each other." | |||
| 4310 | (mapconcat 'shell-quote-argument load-path " -L ") | 4405 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4311 | (shell-quote-argument code)))))))) | 4406 | (shell-quote-argument code)))))))) |
| 4312 | 4407 | ||
| 4313 | (ert-deftest tramp-test40-remote-load-path () | 4408 | (ert-deftest tramp-test41-remote-load-path () |
| 4314 | "Check that Tramp autoloads its packages with remote `load-path'." | 4409 | "Check that Tramp autoloads its packages with remote `load-path'." |
| 4315 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. | 4410 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. |
| 4316 | ;; It shall still work, when a remote file name is in the | 4411 | ;; It shall still work, when a remote file name is in the |
| @@ -4333,11 +4428,36 @@ process sentinels. They shall not disturb each other." | |||
| 4333 | (mapconcat 'shell-quote-argument load-path " -L ") | 4428 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4334 | (shell-quote-argument code))))))) | 4429 | (shell-quote-argument code))))))) |
| 4335 | 4430 | ||
| 4336 | (ert-deftest tramp-test41-unload () | 4431 | (ert-deftest tramp-test42-delay-load () |
| 4432 | "Check that Tramp is loaded lazily, only when needed." | ||
| 4433 | ;; Tramp is neither loaded at Emacs startup, nor when completing a | ||
| 4434 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file | ||
| 4435 | ;; name like "/foo:" autoloads Tramp. | ||
| 4436 | (let ((code | ||
| 4437 | "(progn \ | ||
| 4438 | (message \"Tramp loaded: %s\" (featurep 'tramp)) \ | ||
| 4439 | (file-name-all-completions \"/foo\" \"/\") \ | ||
| 4440 | (message \"Tramp loaded: %s\" (featurep 'tramp)) \ | ||
| 4441 | (file-name-all-completions \"/foo:\" \"/\") \ | ||
| 4442 | (message \"Tramp loaded: %s\" (featurep 'tramp)))")) | ||
| 4443 | (should | ||
| 4444 | (string-match | ||
| 4445 | "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: t[\n\r]+" | ||
| 4446 | (shell-command-to-string | ||
| 4447 | (format | ||
| 4448 | "%s -batch -Q -L %s --eval %s" | ||
| 4449 | (expand-file-name invocation-name invocation-directory) | ||
| 4450 | (mapconcat 'shell-quote-argument load-path " -L ") | ||
| 4451 | (shell-quote-argument code))))))) | ||
| 4452 | |||
| 4453 | (ert-deftest tramp-test43-unload () | ||
| 4337 | "Check that Tramp and its subpackages unload completely. | 4454 | "Check that Tramp and its subpackages unload completely. |
| 4338 | Since it unloads Tramp, it shall be the last test to run." | 4455 | Since it unloads Tramp, it shall be the last test to run." |
| 4339 | :tags '(:expensive-test) | 4456 | :tags '(:expensive-test) |
| 4340 | (skip-unless noninteractive) | 4457 | (skip-unless noninteractive) |
| 4458 | ;; The autoloaded Tramp objects are different since Emacs 26.1. We | ||
| 4459 | ;; cannot test older Emacsen, therefore. | ||
| 4460 | (skip-unless (tramp--test-emacs26-p)) | ||
| 4341 | 4461 | ||
| 4342 | (when (featurep 'tramp) | 4462 | (when (featurep 'tramp) |
| 4343 | (unload-feature 'tramp 'force) | 4463 | (unload-feature 'tramp 'force) |
| @@ -4383,7 +4503,6 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 4383 | ;; * file-acl | 4503 | ;; * file-acl |
| 4384 | ;; * file-name-case-insensitive-p | 4504 | ;; * file-name-case-insensitive-p |
| 4385 | ;; * file-selinux-context | 4505 | ;; * file-selinux-context |
| 4386 | ;; * find-backup-file-name | ||
| 4387 | ;; * set-file-acl | 4506 | ;; * set-file-acl |
| 4388 | ;; * set-file-selinux-context | 4507 | ;; * set-file-selinux-context |
| 4389 | 4508 | ||
| @@ -4392,7 +4511,7 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 4392 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. | 4511 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. |
| 4393 | ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). | 4512 | ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). |
| 4394 | ;; * Fix `tramp-test28-interrupt-process', timeout doesn't work reliably. | 4513 | ;; * Fix `tramp-test28-interrupt-process', timeout doesn't work reliably. |
| 4395 | ;; * Fix Bug#16928 in `tramp-test38-asynchronous-requests'. | 4514 | ;; * Fix Bug#16928 in `tramp-test39-asynchronous-requests'. |
| 4396 | 4515 | ||
| 4397 | (defun tramp-test-all (&optional interactive) | 4516 | (defun tramp-test-all (&optional interactive) |
| 4398 | "Run all tests for \\[tramp]." | 4517 | "Run all tests for \\[tramp]." |
diff --git a/test/lisp/progmodes/sql-tests.el b/test/lisp/progmodes/sql-tests.el index ad22906ecf1..15f59529b2a 100644 --- a/test/lisp/progmodes/sql-tests.el +++ b/test/lisp/progmodes/sql-tests.el | |||
| @@ -50,7 +50,7 @@ | |||
| 50 | (lambda (_command) t)) | 50 | (lambda (_command) t)) |
| 51 | ((symbol-function 'process-lines) | 51 | ((symbol-function 'process-lines) |
| 52 | (lambda (_program &rest _args) | 52 | (lambda (_program &rest _args) |
| 53 | (error)))) | 53 | (error "some error")))) |
| 54 | (should-not (sql-postgres-list-databases)))) | 54 | (should-not (sql-postgres-list-databases)))) |
| 55 | 55 | ||
| 56 | (provide 'sql-tests) | 56 | (provide 'sql-tests) |
diff --git a/test/lisp/url/url-tramp-tests.el b/test/lisp/url/url-tramp-tests.el new file mode 100644 index 00000000000..1154d4cb118 --- /dev/null +++ b/test/lisp/url/url-tramp-tests.el | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | ;;; url-tramp-tests.el --- Test suite for Tramp / URL conversion. | ||
| 2 | |||
| 3 | ;; Copyright (C) 2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Michael Albinus <michael.albinus@gmx.de> | ||
| 6 | |||
| 7 | ;; This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 10 | ;; it under the terms of the GNU General Public License as published by | ||
| 11 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 12 | ;; (at your option) any later version. | ||
| 13 | |||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | ;; GNU General Public License for more details. | ||
| 18 | |||
| 19 | ;; You should have received a copy of the GNU General Public License | ||
| 20 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 21 | |||
| 22 | ;;; Code: | ||
| 23 | |||
| 24 | (require 'url-tramp) | ||
| 25 | (require 'ert) | ||
| 26 | |||
| 27 | (ert-deftest url-tramp-test-convert-url-to-tramp () | ||
| 28 | "Test that URLs are converted into proper Tramp file names." | ||
| 29 | (should | ||
| 30 | (string-equal | ||
| 31 | (url-tramp-convert-url-to-tramp "ftp://ftp.is.co.za/rfc/rfc1808.txt") | ||
| 32 | "/ftp:ftp.is.co.za:/rfc/rfc1808.txt")) | ||
| 33 | |||
| 34 | (should | ||
| 35 | (string-equal | ||
| 36 | (url-tramp-convert-url-to-tramp "ssh://user@localhost") | ||
| 37 | "/ssh:user@localhost:")) | ||
| 38 | |||
| 39 | (should | ||
| 40 | (string-equal | ||
| 41 | (url-tramp-convert-url-to-tramp "telnet://remotehost:42") | ||
| 42 | "/telnet:remotehost#42:")) | ||
| 43 | |||
| 44 | ;; The password will be added to the cache. The password cache key | ||
| 45 | ;; is the remote file name identification of the Tramp file. | ||
| 46 | (should | ||
| 47 | (string-equal | ||
| 48 | (url-tramp-convert-url-to-tramp "scp://user:geheim@somewhere/localfile") | ||
| 49 | "/scp:user@somewhere:/localfile")) | ||
| 50 | (let ((key | ||
| 51 | (file-remote-p | ||
| 52 | (url-tramp-convert-url-to-tramp "scp://user@somewhere/localfile")))) | ||
| 53 | (should (password-in-cache-p key)) | ||
| 54 | (should (string-equal (password-read-from-cache key) "geheim")) | ||
| 55 | (password-cache-remove key) | ||
| 56 | (should-not (password-in-cache-p key))) | ||
| 57 | |||
| 58 | ;; "http" does not belong to `url-tramp-protocols'. | ||
| 59 | (should-not (url-tramp-convert-url-to-tramp "http://www.gnu.org"))) | ||
| 60 | |||
| 61 | (ert-deftest url-tramp-test-convert-tramp-to-url () | ||
| 62 | "Test that Tramp file names are converted into proper URLs." | ||
| 63 | (should | ||
| 64 | (string-equal | ||
| 65 | (url-tramp-convert-tramp-to-url "/ftp:ftp.is.co.za:/rfc/rfc1808.txt") | ||
| 66 | "ftp://ftp.is.co.za/rfc/rfc1808.txt")) | ||
| 67 | |||
| 68 | (should | ||
| 69 | (string-equal | ||
| 70 | (url-tramp-convert-tramp-to-url "/ssh:user@localhost:") | ||
| 71 | "ssh://user@localhost")) | ||
| 72 | |||
| 73 | (should | ||
| 74 | (string-equal | ||
| 75 | (url-tramp-convert-tramp-to-url "/telnet:user@remotehost#42:") | ||
| 76 | "telnet://user@remotehost:42")) | ||
| 77 | |||
| 78 | ;; "sftp" does not belong to `url-tramp-protocols'. | ||
| 79 | (should-not (url-tramp-convert-tramp-to-url "/sftp:user@localhost:"))) | ||
| 80 | |||
| 81 | (provide 'url-tramp-tests) | ||
| 82 | |||
| 83 | ;;; url-tramp-tests.el ends here | ||
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js index 1ad76a83e18..b0d8bcabd20 100644 --- a/test/manual/indent/js.js +++ b/test/manual/indent/js.js | |||
| @@ -7,6 +7,9 @@ let c = 1, | |||
| 7 | var e = 100500, | 7 | var e = 100500, |
| 8 | + 1; | 8 | + 1; |
| 9 | 9 | ||
| 10 | // Don't misinterpret "const" | ||
| 11 | /const/ | ||
| 12 | |||
| 10 | function test () | 13 | function test () |
| 11 | { | 14 | { |
| 12 | return /[/]/.test ('/') // (bug#19397) | 15 | return /[/]/.test ('/') // (bug#19397) |
| @@ -135,6 +138,12 @@ if (1) { | |||
| 135 | : 4 | 138 | : 4 |
| 136 | } | 139 | } |
| 137 | 140 | ||
| 141 | // Regexp is not a continuation | ||
| 142 | bar( | ||
| 143 | "string arg1", | ||
| 144 | /abc/ | ||
| 145 | ) | ||
| 146 | |||
| 138 | // Local Variables: | 147 | // Local Variables: |
| 139 | // indent-tabs-mode: nil | 148 | // indent-tabs-mode: nil |
| 140 | // js-indent-level: 2 | 149 | // js-indent-level: 2 |