aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2019-04-29 09:08:19 -0700
committerGlenn Morris2019-04-29 09:08:19 -0700
commit666293861985480bc658f9fa399009027bc39f1e (patch)
treecbab6e4c77be3e5ee965b0e15b681b1030f2c3bb
parentf1a3a7d6caeb3f250d338217dfd4c476e812bc6e (diff)
parent0e8d452c1c166ff65a0325de23bc04b57aea68d8 (diff)
downloademacs-666293861985480bc658f9fa399009027bc39f1e.tar.gz
emacs-666293861985480bc658f9fa399009027bc39f1e.zip
Merge from origin/emacs-26
0e8d452 ; * doc/lispref/nonascii.texi (Coding System Basics): Fix gra... 25a2ff7 ; Add missing space in custom.texi 9ec18fb * admin/admin.el (set-version): Check for increase in version... 93912ba Be more careful about indent-sexp going over eol (Bug#35286)
-rw-r--r--admin/admin.el8
-rw-r--r--doc/emacs/custom.texi2
-rw-r--r--doc/lispref/nonascii.texi2
-rw-r--r--lisp/emacs-lisp/lisp-mode.el22
-rw-r--r--test/lisp/emacs-lisp/lisp-mode-tests.el28
5 files changed, 48 insertions, 14 deletions
diff --git a/admin/admin.el b/admin/admin.el
index 030bd54b521..d3a477fde80 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -138,10 +138,10 @@ Root must be the root of an Emacs source tree."
138 (if (eq 2 (length newversion)) 0 1)))) 138 (if (eq 2 (length newversion)) 0 1))))
139 (majorbump (and oldversion (not (equal oldmajor newmajor)))) 139 (majorbump (and oldversion (not (equal oldmajor newmajor))))
140 (minorbump (and oldversion (not majorbump) 140 (minorbump (and oldversion (not majorbump)
141 (or (not (equal (cadr oldversion) 141 (or (not (equal (cadr oldversion) (cadr newversion)))
142 (cadr newversion))) 142 ;; Eg 26.2 -> 26.2.50.
143 (and (equal (cadr oldversion) (cadr newversion)) 143 (and (> (length newversion)
144 (equal (nth 2 newversion) 50))))) 144 (length oldversion))))))
145 (newsfile (expand-file-name "etc/NEWS" root)) 145 (newsfile (expand-file-name "etc/NEWS" root))
146 (oldnewsfile (expand-file-name (format "etc/NEWS.%s" oldmajor) root))) 146 (oldnewsfile (expand-file-name (format "etc/NEWS.%s" oldmajor) root)))
147 (unless (> (length newversion) 2) ; pretest or release candidate? 147 (unless (> (length newversion) 2) ; pretest or release candidate?
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index c649c170293..22e352ef9f9 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1331,7 +1331,7 @@ On MS-DOS, the name of this file should be @file{_dir-locals.el}, due
1331to limitations of the DOS filesystems. If the filesystem is limited 1331to limitations of the DOS filesystems. If the filesystem is limited
1332to 8+3 file names, the name of the file will be truncated by the OS to 1332to 8+3 file names, the name of the file will be truncated by the OS to
1333@file{_dir-loc.el}. 1333@file{_dir-loc.el}.
1334}in a directory. Whenever Emacs visits any file in that directory or 1334} in a directory. Whenever Emacs visits any file in that directory or
1335any of its subdirectories, it will apply the directory-local variables 1335any of its subdirectories, it will apply the directory-local variables
1336specified in @file{.dir-locals.el}, as though they had been defined as 1336specified in @file{.dir-locals.el}, as though they had been defined as
1337file-local variables for that file (@pxref{File Variables}). Emacs 1337file-local variables for that file (@pxref{File Variables}). Emacs
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 9c64c3cf2ca..47206a406fd 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -1049,7 +1049,7 @@ is like @code{undecided}, but it prefers to choose @code{utf-8} when
1049possible. 1049possible.
1050 1050
1051 In general, a coding system doesn't guarantee roundtrip identity: 1051 In general, a coding system doesn't guarantee roundtrip identity:
1052decoding a byte sequence using coding system, then encoding the 1052decoding a byte sequence using a coding system, then encoding the
1053resulting text in the same coding system, can produce a different byte 1053resulting text in the same coding system, can produce a different byte
1054sequence. But some coding systems do guarantee that the byte sequence 1054sequence. But some coding systems do guarantee that the byte sequence
1055will be the same as what you originally decoded. Here are a few 1055will be the same as what you originally decoded. Here are a few
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 4c7a8bea3fb..fa6dc98d04c 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1210,19 +1210,25 @@ ENDPOS is encountered."
1210 ;; Get error now if we don't have a complete sexp 1210 ;; Get error now if we don't have a complete sexp
1211 ;; after point. 1211 ;; after point.
1212 (save-excursion 1212 (save-excursion
1213 (forward-sexp 1)
1213 (let ((eol (line-end-position))) 1214 (let ((eol (line-end-position)))
1214 (forward-sexp 1)
1215 ;; We actually look for a sexp which ends 1215 ;; We actually look for a sexp which ends
1216 ;; after the current line so that we properly 1216 ;; after the current line so that we properly
1217 ;; indent things like #s(...). This might not 1217 ;; indent things like #s(...). This might not
1218 ;; be needed if Bug#15998 is fixed. 1218 ;; be needed if Bug#15998 is fixed.
1219 (condition-case () 1219 (when (and (< (point) eol)
1220 (while (and (< (point) eol) (not (eobp))) 1220 ;; Check if eol is within a sexp.
1221 (forward-sexp 1)) 1221 (> (nth 0 (save-excursion
1222 ;; But don't signal an error for incomplete 1222 (parse-partial-sexp
1223 ;; sexps following the first complete sexp 1223 (point) eol)))
1224 ;; after point. 1224 0))
1225 (scan-error nil))) 1225 (condition-case ()
1226 (while (< (point) eol)
1227 (forward-sexp 1))
1228 ;; But don't signal an error for incomplete
1229 ;; sexps following the first complete sexp
1230 ;; after point.
1231 (scan-error nil))))
1226 (point))))) 1232 (point)))))
1227 (save-excursion 1233 (save-excursion
1228 (while (let ((indent (lisp-indent-calc-next parse-state)) 1234 (while (let ((indent (lisp-indent-calc-next parse-state))
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el
index a6370742ab4..63632449ca5 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -136,6 +136,34 @@ noindent\" 3
136 (indent-sexp) 136 (indent-sexp)
137 (should (equal (buffer-string) "(())")))) 137 (should (equal (buffer-string) "(())"))))
138 138
139(ert-deftest indent-sexp-stop-before-eol-comment ()
140 "`indent-sexp' shouldn't look for more sexps after an eol comment."
141 ;; See https://debbugs.gnu.org/35286.
142 (with-temp-buffer
143 (emacs-lisp-mode)
144 (let ((str "() ;;\n x"))
145 (insert str)
146 (goto-char (point-min))
147 (indent-sexp)
148 ;; The "x" is in the next sexp, so it shouldn't get indented.
149 (should (equal (buffer-string) str)))))
150
151(ert-deftest indent-sexp-stop-before-eol-non-lisp ()
152 "`indent-sexp' shouldn't be too agressive in non-Lisp modes."
153 ;; See https://debbugs.gnu.org/35286#13.
154 (with-temp-buffer
155 (prolog-mode)
156 (let ((str "\
157x(H) -->
158 {y(H)}.
159a(A) -->
160 b(A)."))
161 (insert str)
162 (search-backward "{")
163 (indent-sexp)
164 ;; There's no line-spanning sexp, so nothing should be indented.
165 (should (equal (buffer-string) str)))))
166
139(ert-deftest lisp-indent-region () 167(ert-deftest lisp-indent-region ()
140 "Test basics of `lisp-indent-region'." 168 "Test basics of `lisp-indent-region'."
141 (with-temp-buffer 169 (with-temp-buffer