From b09ca27450f339a07db952ed54451c8f11d9b85f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 25 Apr 2016 15:19:55 -0700 Subject: [PATCH 1/9] Say why text-quoting-style is not a user option * doc/lispref/help.texi (Keys in Documentation): * etc/NEWS: Document why text-quoting-style is not a customizable variable (Bug#23372). --- doc/lispref/help.texi | 4 ++++ etc/NEWS | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 0b8182c521a..58a11f29a4c 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -362,6 +362,10 @@ this'} with grave accent and apostrophe, the standard style before Emacs version 25. The default value @code{nil} acts like @code{curve} if curved single quotes are displayable, and like @code{grave} otherwise. + +This variable can be used by experts on platforms that have problems +with curved quotes. As it is not intended for casual use, it is not a +user option. @end defvar @defun substitute-command-keys string diff --git a/etc/NEWS b/etc/NEWS index 7bedcedae63..a50469c0f56 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1472,7 +1472,8 @@ Set it to 'curve' for curved single quotes, to 'straight' for straight apostrophes, and to 'grave' for grave accent and apostrophe. The default value nil acts like 'curve' if curved single quotes are displayable, and like 'grave' otherwise. The new variable affects -display of diagnostics and help, but not of info. +display of diagnostics and help, but not of info. As the variable is +not intended for casual use, it is not a user option. +++ ** substitute-command-keys now replaces quotes. From 8ee168a798d7995cb9f16c9a2a8539761833907b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 26 Apr 2016 08:49:29 +0300 Subject: [PATCH 2/9] ; * etc/NEWS: Update entry about color fonts on OS X with a workaround. --- etc/NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index a50469c0f56..b5d2b44d39f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2027,6 +2027,9 @@ emoji) display is disabled. This feature was accidentally added when Emacs 24.4 included the new Core Text based font backend code that was originally implemented for a non-mainline port. This will be enabled again once it is also implemented in Emacs on free operating systems. +If some symbols, such as emoji, do not display, we suggest to install +an appropriate font, such as Symbola; then they will be displayed, +albeit without the color effects. --- ** The new function 'w32-application-type' returns the type of an From ccb75d72bd02885109c7c339c1f72a393a9d3d22 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Tue, 26 Apr 2016 11:42:53 -0400 Subject: [PATCH 3/9] Partially revert previous change. This commit partially reverts 0f332848cdb2ed6d46771914a911cbca194cd51a. * lisp/rect.el (rectangle--highlight-for-redisplay): Use region face. This function is for rectangle-mark-mode, not string-rectangle. --- lisp/rect.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/rect.el b/lisp/rect.el index 6056b14734d..e9a4f4574e3 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -783,7 +783,7 @@ Ignores `line-move-visual'." (if (not old) (let ((ol (make-overlay left right))) (overlay-put ol 'window window) - (overlay-put ol 'face 'rectangle-preview) + (overlay-put ol 'face 'region) ol) (let ((ol (pop old))) (move-overlay ol left right (current-buffer)) From fa7886a46ff8d611cd75eaf651944f0fbc260324 Mon Sep 17 00:00:00 2001 From: Lele Gaifax Date: Wed, 6 Apr 2016 10:38:23 +0200 Subject: [PATCH 4/9] Add new keywords of Python 3.5 Python 3.5, released in mid September 2015, introduced a few new keywords to better support asynchronous code, "async" and "await" in particular. See https://www.python.org/dev/peps/pep-0492/ for details. (Bug#21783) * lisp/progmodes/python.el (python-rx-constituents): Add async def/for/with as block-start and async def as defun. * lisp/progmodes/python.el (python-font-lock-keywords): Add async def/for/with as keyword. * test/automated/python-tests.el (python-indent-after-async-block-1, python-indent-after-async-block-2, python-indent-after-async-block-3, python-nav-beginning-of-defun-3): New tests to test indentation and navigation for the async keyword. --- lisp/progmodes/python.el | 13 ++++++-- test/automated/python-tests.el | 56 ++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 90097df7ef1..9c23655b911 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -372,7 +372,10 @@ (defconst python-rx-constituents `((block-start . ,(rx symbol-start (or "def" "class" "if" "elif" "else" "try" - "except" "finally" "for" "while" "with") + "except" "finally" "for" "while" "with" + ;; Python 3.5+ PEP492 + (and "async" (+ space) + (or "def" "for" "with"))) symbol-end)) (dedenter . ,(rx symbol-start (or "elif" "else" "except" "finally") @@ -383,7 +386,11 @@ symbol-end)) (decorator . ,(rx line-start (* space) ?@ (any letter ?_) (* (any word ?_)))) - (defun . ,(rx symbol-start (or "def" "class") symbol-end)) + (defun . ,(rx symbol-start + (or "def" "class" + ;; Python 3.5+ PEP492 + (and "async" (+ space) "def")) + symbol-end)) (if-name-main . ,(rx line-start "if" (+ space) "__name__" (+ space) "==" (+ space) (any ?' ?\") "__main__" (any ?' ?\") @@ -515,6 +522,8 @@ The type returned can be `comment', `string' or `paren'." ;; fontified like that in order to keep font-lock consistent between ;; Python versions. "nonlocal" + ;; Python 3.5+ PEP492 + (and "async" (+ space) (or "def" "for" "with")) ;; Extra: "self") symbol-end) diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index ec93c01059c..54ed92212b8 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -614,6 +614,42 @@ something (should (eq (car (python-indent-context)) :after-line)) (should (= (python-indent-calculate-indentation) 0)))) +(ert-deftest python-indent-after-async-block-1 () + "Test PEP492 async def." + (python-tests-with-temp-buffer + " +async def foo(a, b, c=True): +" + (should (eq (car (python-indent-context)) :no-indent)) + (should (= (python-indent-calculate-indentation) 0)) + (goto-char (point-max)) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4)))) + +(ert-deftest python-indent-after-async-block-2 () + "Test PEP492 async with." + (python-tests-with-temp-buffer + " +async with foo(a) as mgr: +" + (should (eq (car (python-indent-context)) :no-indent)) + (should (= (python-indent-calculate-indentation) 0)) + (goto-char (point-max)) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4)))) + +(ert-deftest python-indent-after-async-block-3 () + "Test PEP492 async for." + (python-tests-with-temp-buffer + " +async for a in sequencer(): +" + (should (eq (car (python-indent-context)) :no-indent)) + (should (= (python-indent-calculate-indentation) 0)) + (goto-char (point-max)) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4)))) + (ert-deftest python-indent-after-backslash-1 () "The most common case." (python-tests-with-temp-buffer @@ -1493,6 +1529,26 @@ class C(object): (beginning-of-line) (point)))))) +(ert-deftest python-nav-beginning-of-defun-3 () + (python-tests-with-temp-buffer + " +class C(object): + + async def m(self): + return await self.c() + + async def c(self): + pass +" + (python-tests-look-at "self.c()") + (should (= (save-excursion + (python-nav-beginning-of-defun) + (point)) + (save-excursion + (python-tests-look-at "async def m" -1) + (beginning-of-line) + (point)))))) + (ert-deftest python-nav-end-of-defun-1 () (python-tests-with-temp-buffer " From 40bfebec83b7571b4ee5e3140e2b5a99105325bd Mon Sep 17 00:00:00 2001 From: Jorgen Schaefer Date: Thu, 21 Apr 2016 10:00:39 +0200 Subject: [PATCH 5/9] Add Python 3.5 keyword "await" * lisp/progmodes/python.el (python-font-lock-keywords): Add await as keyword. --- lisp/progmodes/python.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9c23655b911..2d22bb2ce88 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -524,6 +524,7 @@ The type returned can be `comment', `string' or `paren'." "nonlocal" ;; Python 3.5+ PEP492 (and "async" (+ space) (or "def" "for" "with")) + "await" ;; Extra: "self") symbol-end) From ca87b349af02cf6761da576ae892d77d167d863e Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Tue, 26 Apr 2016 20:05:57 -0400 Subject: [PATCH 6/9] ; Fix errant revert ccb75d7 * lisp/rect.el (rectangle--highlight-for-redisplay): Use region face. --- lisp/rect.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/rect.el b/lisp/rect.el index e9a4f4574e3..6aa7b8b585b 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -815,7 +815,7 @@ Ignores `line-move-visual'." (overlay-put ol 'after-string nil))) ((< mright rightcol) ;`rightcol' is past EOL. (let ((str (rectangle--space-to rightcol))) - (put-text-property 0 (length str) 'face 'rectangle-preview str) + (put-text-property 0 (length str) 'face 'region str) ;; If cursor happens to be here, draw it at the right place. (rectangle--place-cursor leftcol left str) (overlay-put ol 'after-string str))) @@ -827,7 +827,7 @@ Ignores `line-move-visual'." (overlay-put ol 'after-string nil) (goto-char right) (let ((str (rectangle--space-to rightcol))) - (put-text-property 0 (length str) 'face 'rectangle-preview str) + (put-text-property 0 (length str) 'face 'region str) (when (= left right) (rectangle--place-cursor leftcol left str)) (overlay-put ol 'after-string str)))) @@ -837,7 +837,7 @@ Ignores `line-move-visual'." ;; Make zero-width rectangles visible! (overlay-put ol 'after-string (concat (propertize " " - 'face '(rectangle-preview (:height 0.2))) + 'face '(region (:height 0.2))) (overlay-get ol 'after-string)))) (push ol nrol))) start end)) From e55d0db95700edd11e71660729566c67b6c563b3 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Wed, 27 Apr 2016 13:18:04 +0800 Subject: [PATCH 7/9] Fix revision calculation in vc-git-mode-line-string * lisp/vc/vc-git.el (vc-git-mode-line-string): Use vc-git-working-revision because vc-working-revision needs to decide the backend and may return nil. --- lisp/vc/vc-git.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 5d06bf7f357..d5ba0c8be7d 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -278,7 +278,7 @@ Should be consistent with the Git config value i18n.logOutputEncoding." (defun vc-git-mode-line-string (file) "Return a string for `vc-mode-line' to put in the mode line for FILE." - (let* ((rev (vc-working-revision file)) + (let* ((rev (vc-git-working-revision file)) (disp-rev (or (vc-git--symbolic-ref file) (substring rev 0 7))) (def-ml (vc-default-mode-line-string 'Git file)) From 6858e77c410a2bbaa96897a0283cf9571de9007b Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Wed, 27 Apr 2016 10:18:02 +0200 Subject: [PATCH 8/9] Todo mode doc bug fix * lisp/calendar/todo-mode.el (todo-show): Correct obsolete and no longer correct information in doc string. --- lisp/calendar/todo-mode.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 9574c03043e..0529e970333 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -612,11 +612,12 @@ Otherwise, `todo-show' always visits `todo-default-todo-file'." (defun todo-show (&optional solicit-file interactive) "Visit a todo file and display one of its categories. -When invoked in Todo mode, prompt for which todo file to visit. -When invoked outside of Todo mode with non-nil prefix argument -SOLICIT-FILE prompt for which todo file to visit; otherwise visit -`todo-default-todo-file'. Subsequent invocations from outside -of Todo mode revisit this file or, with option +When invoked in Todo mode, Todo Archive mode or Todo Filtered +Items mode, or when invoked anywhere else with a prefix argument, +prompt for which todo file to visit. When invoked outside of a +Todo mode buffer without a prefix argument, visit +`todo-default-todo-file'. Subsequent invocations from outside of +Todo mode revisit this file or, with option `todo-show-current-file' non-nil (the default), whichever todo file was last visited. @@ -643,10 +644,7 @@ In Todo mode just the category's unfinished todo items are shown by default. The done items are hidden, but typing `\\[todo-toggle-view-done-items]' displays them below the todo items. With non-nil user option `todo-show-with-done' both todo -and done items are always shown on visiting a category. - -Invoking this command in Todo Archive mode visits the -corresponding todo file, displaying the corresponding category." +and done items are always shown on visiting a category." (interactive "P\np") (when todo-default-todo-file (todo-check-file (todo-absolute-file-name todo-default-todo-file))) From 71fb0e06e7e04d8300be10feffd3d314a76b4d27 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Wed, 27 Apr 2016 22:12:12 +0800 Subject: [PATCH 9/9] Improve last change to vc-git-mode-line-string * lisp/vc/vc-git.el (vc-git-mode-line-string): Better fix that caches the result. --- lisp/vc/vc-git.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index d5ba0c8be7d..f35c84d50c5 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -278,7 +278,7 @@ Should be consistent with the Git config value i18n.logOutputEncoding." (defun vc-git-mode-line-string (file) "Return a string for `vc-mode-line' to put in the mode line for FILE." - (let* ((rev (vc-git-working-revision file)) + (let* ((rev (vc-working-revision file 'Git)) (disp-rev (or (vc-git--symbolic-ref file) (substring rev 0 7))) (def-ml (vc-default-mode-line-string 'Git file))