commit a184a7edc58e1e053aa317a0f162df7e225597e1 (HEAD, refs/remotes/origin/master) Author: Evgeni Kolev Date: Mon Mar 27 09:30:10 2017 +0300 Propertize only perl prototype chars `][$%&*;+@\' as punctuation This prevents variables in signatures such as `sub add ($a, $b)' from being treated as punctuation. * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Strictly match only prototype characters as punctuation. (Bug#26037) Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index a516f07e72..b75f32ee20 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -255,9 +255,11 @@ ;; format statements ("^[ \t]*format.*=[ \t]*\\(\n\\)" (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end)))) - ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'. - ;; Be careful not to match "sub { (...) ... }". - ("\\ Date: Mon Mar 13 21:53:59 2017 +0100 fix two js-mode syntax propertization bugs Bug#26070: * lisp/progmodes/js.el (js--syntax-propertize-regexp-regexp): Add zero-or-one to regular expression. (js-syntax-propertize-regexp): Update. Propertize body of regexp literal up to END. * test/lisp/progmodes/js-tests.el (js-mode-propertize-bug-1) (js-mode-propertize-bug-2): New tests. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index aed42a8507..3c720c0561 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1713,7 +1713,7 @@ This performs fontification according to `js--class-styles'." (not (any ?\] ?\\)) (and "\\" not-newline))) "]"))) - (group "/")) + (group (zero-or-one "/"))) "Regular expression matching a JavaScript regexp literal.") (defun js-syntax-propertize-regexp (end) @@ -1721,12 +1721,13 @@ This performs fontification according to `js--class-styles'." (when (eq (nth 3 ppss) ?/) ;; A /.../ regexp. (goto-char (nth 8 ppss)) - (when (and (looking-at js--syntax-propertize-regexp-regexp) - ;; Don't touch text after END. - (<= (match-end 1) end)) - (put-text-property (match-beginning 1) (match-end 1) + (when (looking-at js--syntax-propertize-regexp-regexp) + ;; Don't touch text after END. + (when (> end (match-end 1)) + (setq end (match-end 1))) + (put-text-property (match-beginning 1) end 'syntax-table (string-to-syntax "\"/")) - (goto-char (match-end 0)))))) + (goto-char end))))) (defun js-syntax-propertize (start end) ;; JavaScript allows immediate regular expression objects, written /.../. diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index e030675e07..8e1bac10cd 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -140,6 +140,43 @@ if (!/[ (:,='\"]/.test(value)) { (font-lock-ensure) (should (eq (get-text-property (point) 'face) (caddr test)))))) +(ert-deftest js-mode-propertize-bug-1 () + (with-temp-buffer + (js-mode) + (save-excursion (insert "x")) + (insert "/") + ;; The bug was a hang. + (should t))) + +(ert-deftest js-mode-propertize-bug-2 () + (with-temp-buffer + (js-mode) + (insert "function f() { + function g() + { + 1 / 2; + } + + function h() { +") + (save-excursion + (insert " + 00000000000000000000000000000000000000000000000000; + 00000000000000000000000000000000000000000000000000; + 00000000000000000000000000000000000000000000000000; + 00000000000000000000000000000000000000000000000000; + 00000000000000000000000000000000000000000000000000; + 00000000000000000000000000000000000000000000000000; + 00000000000000000000000000000000000000000000000000; + 00000000000000000000000000000000000000000000000000; + 00; + } +} +")) + (insert "/") + ;; The bug was a hang. + (should t))) + (provide 'js-tests) ;;; js-tests.el ends here commit ac2ca82eb19bbf7f1cac7ec3f6c020ebf2b15882 Author: Paul Eggert Date: Sat Apr 1 12:15:03 2017 -0700 Simplify test dependency generation Generate default dependencies by using GNU extensions to ‘make’ rather than via a hacky auxiliary program and script. * .gitignore: Remove test/make-test-deps.mk. * test/Makefile.in (ELFILES, LOGFILES, TESTS): Use :=, not =, to avoid multiple redundant invocations of ‘find’. (test_template): Infer dependency directly instead of via make-test-deps.mk. (check-doit): Prepend ‘@’ to avoid excessively long ‘make’ output. (clean): No need to clean make-test-deps.mk. (make-test-deps.mk): Remove rule. * test/make-test-deps.emacs-lisp: Remove. diff --git a/.gitignore b/.gitignore index ce1866d616..aa9e1ff709 100644 --- a/.gitignore +++ b/.gitignore @@ -141,7 +141,6 @@ src/*.map # Tests. test/indent/*.new -test/make-test-deps.mk test/manual/biditest.txt test/manual/etags/srclist test/manual/etags/regexfile diff --git a/test/Makefile.in b/test/Makefile.in index c0056b6f44..d218b64005 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -124,12 +124,12 @@ endif $(emacs) -l ert -l $$loadfile \ --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG} -ELFILES = $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \ - -path "*resources" -prune -o -name "*el" -print) +ELFILES := $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \ + -name "*resources" -prune -o -name "*.el" -print) ## .log files may be in a different directory for out of source builds -LOGFILES = $(patsubst %.el,%.log, \ +LOGFILES := $(patsubst %.el,%.log, \ $(patsubst $(srcdir)%,.%,$(ELFILES))) -TESTS = $(subst ${srcdir}/,,$(LOGFILES:.log=)) +TESTS := $(subst ${srcdir}/,,$(LOGFILES:.log=)) ## If we have to interrupt a hanging test, preserve the log so we can ## see what the problem was. @@ -141,6 +141,11 @@ TESTS = $(subst ${srcdir}/,,$(LOGFILES:.log=)) ## Define an alias both with and without the directory name for ease ## of use. define test_template + ifeq (,$(patsubst $(srcdir)/src/%,,$(1))) + $(1): $(srcdir)/../src/$(1:.log=.c) + else + $(1): $(srcdir)/../lisp/$(1:.log=.el) + endif $(1): @test ! -f ./$(1).log || mv ./$(1).log ./$(1).log~ @${MAKE} ./$(1).log WRITE_LOG= @@ -157,11 +162,6 @@ $(foreach test,${TESTS},$(eval $(call test_template,${test}))) check-no-automated-subdir: test ! -d $(srcdir)/automated -## Include dependencies between test files and the files they test. -## We could do this without the file and eval directly, but then we -## would have to run Emacs for every make invocation, and it might not -## be available during clean. --include make-test-deps.mk ## Rerun all default tests. check: mostlyclean check-no-automated-subdir @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}" @@ -175,7 +175,7 @@ check-expensive: mostlyclean check-no-automated-subdir ## logfile is out-of-date with either the test file, or the source ## files that the tests depend on. The source file dependencies are ## determined by a heuristic and does not identify the full dependency -## graph. See make-test-deps.emacs-lisp for details. +## graph. See test_template for details. .PHONY: check-maybe check-maybe: check-no-automated-subdir @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}" @@ -183,7 +183,7 @@ check-maybe: check-no-automated-subdir ## Run the tests. .PHONY: check-doit check-doit: ${LOGFILES} - $(emacs) -l ert -f ert-summarize-tests-batch-and-exit $^ + @$(emacs) -l ert -f ert-summarize-tests-batch-and-exit $^ .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean @@ -193,7 +193,6 @@ mostlyclean: clean: find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE) - rm -f make-test-deps.mk bootstrap-clean: clean find $(srcdir) -name '*.elc' $(FIND_DELETE) @@ -202,11 +201,3 @@ distclean: clean rm -f Makefile maintainer-clean: distclean bootstrap-clean - -make-test-deps.mk: $(ELFILES) make-test-deps.emacs-lisp - $(EMACS) --batch -l $(srcdir)/make-test-deps.emacs-lisp \ - --eval "(make-test-deps \"$(srcdir)\")" \ - 2> $@.tmp - # Hack to elide any CANNOT_DUMP=yes chatter. - sed '/\.log: /!d' $@.tmp >$@ - rm -f $@.tmp diff --git a/test/make-test-deps.emacs-lisp b/test/make-test-deps.emacs-lisp deleted file mode 100644 index 609e927618..0000000000 --- a/test/make-test-deps.emacs-lisp +++ /dev/null @@ -1,98 +0,0 @@ -;; -*- emacs-lisp -*- - -;; Copyright (C) 2015-2017 Free Software Foundation, Inc. - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;; This file generates dependencies between test files and the files -;; that they test. - -;; It has an .emacs-lisp extension because it makes the Makefile easier! - -(require 'seq) - -(defun make-test-deps (src-dir) - (let ((src-dir (file-truename src-dir))) - (message - "%s" - (concat - (make-test-deps-lisp src-dir) - (make-test-deps-src src-dir))))) - -(defun make-test-deps-lisp (src-dir) - (mapconcat - (lambda (file-without-suffix) - (format "./%s-tests.log: %s/../%s.el\n" - file-without-suffix - src-dir - file-without-suffix)) - (make-test-test-files src-dir "lisp") "")) - -(defun make-test-deps-src (src-dir) - (mapconcat - (lambda (file-without-suffix) - (format "./%s-tests.log: %s/../%s.c\n" - file-without-suffix - src-dir - file-without-suffix)) - (make-test-test-files src-dir "src") "")) - -(defun make-test-test-files (src-dir sub-src-dir) - (make-test-munge-files - src-dir - (directory-files-recursively - (concat src-dir "/" sub-src-dir) - ".*-tests.el$"))) - -(defun make-test-munge-files (src-dir files) - (make-test-sans-suffix - (make-test-de-stem - src-dir - (make-test-no-legacy - (make-test-no-test-dir - (make-test-no-resources - files)))))) - -(defun make-test-sans-suffix (files) - (mapcar - (lambda (file) - (substring file 0 -9)) - files)) - -(defun make-test-de-stem (stem files) - (mapcar - (lambda (file) - (substring - file - (+ 1 (length stem)))) - files)) - -(defun make-test-no-legacy (list) - (make-test-remove list "legacy/")) - -(defun make-test-no-resources (list) - (make-test-remove list "-resources/")) - -(defun make-test-no-test-dir (list) - (make-test-remove list "-tests/")) - -(defun make-test-remove (list match) - (seq-remove - (lambda (file) - (string-match-p match file)) - list)) commit 1a55cc6094c2b762f005bbb70d448368786ff1a7 Author: Paul Eggert Date: Sat Apr 1 10:46:48 2017 -0700 ; Spelling fixes diff --git a/ChangeLog.3 b/ChangeLog.3 index 1c2f5b1d2f..f187c2852f 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -1015,7 +1015,7 @@ Upcase Path and ComSpec in process-environment Since 2016-07-18 "Keep w32 environment settings internal only", the - upcasing of environment variables "Path" and "ComSpec" occured after + upcasing of environment variables "Path" and "ComSpec" occurred after initializing process-environment. This meant that Lisp code trying to override "PATH" environment had no effect (Bug #24956). diff --git a/lisp/filenotify.el b/lisp/filenotify.el index dbf19cf2f2..8bbe348f33 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -422,7 +422,7 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'." ;; (This may be the desired behaviour.) ;; * Watching a file in a already watched directory ;; If the file is created and *then* a watch is added to that file, the -;; watch might receive events which occured prior to it being created, +;; watch might receive events which occurred prior to it being created, ;; due to the way events are propagated during idle time. Note: This ;; may be perfectly acceptable. diff --git a/lisp/ses.el b/lisp/ses.el index 5050713234..66fc0c5ebd 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -2276,7 +2276,7 @@ print area if NONARROW is nil." "Recalculate and reprint the current cell or range. If SES--CURCELL is non nil use it as current cell or range -without any check, otherwise fnuction (ses-check-curcell 'range) +without any check, otherwise function (ses-check-curcell 'range) is called. For an individual cell, shows the error if the formula or printer commit acce29d6c57f66646190595b5b9427602fc4a7fd Author: Stefan Monnier Date: Sat Apr 1 12:11:07 2017 -0400 * test/lisp/emacs-lisp/cl-lib-tests.el: Improve symbol-macrolet tests (cl-lib-symbol-macrolet): Fix last test so it doesn't break the whole test suite. (cl-lib-symbol-macrolet-2): New test. diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index b5946208f1..093cb3476c 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -494,12 +494,29 @@ (should-not (cl-typep 1 'cl-lib-test-type))) (ert-deftest cl-lib-symbol-macrolet () + ;; bug#26325 + :expected-result :failed (should (equal (cl-flet ((f (x) (+ x 5))) (let ((x 5)) (f (+ x 6)))) - (cl-symbol-macrolet ((f (+ x 6))) - (cl-flet ((f (x) (+ x 5))) - (let ((x 5)) - (f f))))))) + ;; Go through `eval', otherwise the macro-expansion + ;; error prevents running the whole test suite :-( + (eval '(cl-symbol-macrolet ((f (+ x 6))) + (cl-flet ((f (x) (+ x 5))) + (let ((x 5)) + (f f)))) + t)))) + +(defmacro cl-lib-symbol-macrolet-4+5 () + ;; bug#26068 + (let* ((sname "x") + (s1 (make-symbol sname)) + (s2 (make-symbol sname))) + `(cl-symbol-macrolet ((,s1 4) + (,s2 5)) + (+ ,s1 ,s2)))) + +(ert-deftest cl-lib-symbol-macrolet-2 () + (should (equal (cl-lib-symbol-macrolet-4+5) (+ 4 5)))) ;;; cl-lib.el ends here