emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 11ea333a5a 2/3: Merge branch 'master' of git.savannah.gnu.org:/sr


From: Eli Zaretskii
Subject: master 11ea333a5a 2/3: Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Date: Thu, 1 Dec 2022 10:09:07 -0500 (EST)

branch: master
commit 11ea333a5ae6a5718b0b441884645e8c67a5979a
Merge: 9210eac585 f7c3abb8d2
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
---
 doc/lispref/frames.texi             |  12 +++-
 lisp/org/ob-clojure.el              |   4 +-
 lisp/org/org-clock.el               |   7 ++-
 lisp/org/org.el                     |   2 +-
 lisp/org/ox-md.el                   |   2 +-
 lisp/progmodes/project.el           |   2 +-
 lisp/progmodes/python.el            |  15 +++--
 test/lisp/progmodes/python-tests.el | 108 ++++++++++++++++++++++++++++++------
 8 files changed, 120 insertions(+), 32 deletions(-)

diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index b3f1a29ae8..a656964198 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -2854,10 +2854,18 @@ The plural ``frames'' in the previous paragraph is 
deliberate: while
 Emacs itself has only one selected frame, Emacs can have frames on
 many different terminals (recall that a connection to a window system
 counts as a terminal), and each terminal has its own idea of which
-frame has input focus.  When you set the input focus to a frame, you
-set the focus for that frame's terminal, but frames on other terminals
+frame has input focus.  Under the X Window System, where user input is
+organized into individual ``seats'' of input, each seat in turn can
+have its own specific input focus.  When you set the input focus to a
+frame, you set the focus for that frame's terminal on the last seat
+which interacted with Emacs, but frames on other terminals and seats
 may still remain focused.
 
+If the input focus is set before any user interaction has occurred on
+the specified terminal, then the X server picks a random seat
+(normally the one with the lowest number) and sets the input focus
+there.
+
 Lisp programs can switch frames temporarily by calling the function
 @code{select-frame}.  This does not alter the window system's concept
 of focus; rather, it escapes from the window manager's control until
diff --git a/lisp/org/ob-clojure.el b/lisp/org/ob-clojure.el
index 6f1425a842..b424cf48ff 100644
--- a/lisp/org/ob-clojure.el
+++ b/lisp/org/ob-clojure.el
@@ -101,13 +101,13 @@
 
 (defcustom ob-clojure-babashka-command (executable-find "bb")
   "Path to the babashka executable."
-  :type 'file
+  :type '(choice file (const nil))
   :group 'org-babel
   :package-version '(Org . "9.6"))
 
 (defcustom ob-clojure-nbb-command (executable-find "nbb")
   "Path to the nbb executable."
-  :type 'file
+  :type '(choice file (const nil))
   :group 'org-babel
   :package-version '(Org . "9.6"))
 
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 2758aeed40..f28805d5e6 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1198,8 +1198,11 @@ If `only-dangling-p' is non-nil, only ask to resolve 
dangling
   (string-to-number (shell-command-to-string "ioreg -c IOHIDSystem | perl -ane 
'if (/Idle/) {$idle=(pop @F)/1000000000; print $idle; last}'")))
 
 (defvar org-x11idle-exists-p
-  ;; Check that x11idle exists
-  (and (eq 0 (call-process-shell-command
+  ;; Check that x11idle exists.  But don't do that on DOS/Windows,
+  ;; since the command definitely does NOT exist there, and invoking
+  ;; COMMAND.COM on MS-Windows is a bad idea -- it hangs.
+  (and (null (memq system-type '(windows-nt ms-dos)))
+       (eq 0 (call-process-shell-command
               (format "command -v %s" org-clock-x11idle-program-name)))
        ;; Check that x11idle can retrieve the idle time
        ;; FIXME: Why "..-shell-command" rather than just `call-process'?
diff --git a/lisp/org/org.el b/lisp/org/org.el
index be922a5da0..ab6212dacc 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -1408,7 +1408,7 @@ URI regexps are applied to both URLs and Org files 
requesting
 remote resources."
   :group 'org
   :package-version '(Org . "9.6")
-  :type '(list regexp))
+  :type '(repeat regexp))
 
 (defcustom org-open-non-existing-files nil
   "Non-nil means `org-open-file' opens non-existing files.
diff --git a/lisp/org/ox-md.el b/lisp/org/ox-md.el
index dee6dbf1fc..01e0aa0491 100644
--- a/lisp/org/ox-md.el
+++ b/lisp/org/ox-md.el
@@ -87,7 +87,7 @@ included into another document or application that reserves 
top-level
 headings for its own use."
   :group 'org-export-md
   :package-version '(Org . "9.6")
-  :type 'string)
+  :type 'natnum)
 
 
 
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index dfd3d5c7ab..1cf50df036 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -453,7 +453,7 @@ repositories.
 
 In either case, their behavior will still obey the relevant
 variables, such as `project-vc-ignores' or `project-vc-name'."
-  :type 'list
+  :type '(repeat string)
   :version "29.1"
   :package-version '(project . "0.9.0")
   :safe (lambda (val) (and (listp val) (cl-every #'stringp val))))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index fc80c755e4..eb34b93e2f 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -454,7 +454,7 @@ This variant of `rx' supports common Python named REGEXPS."
             (close-paren       (or "}" "]" ")"))
             (simple-operator   (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%))
             (not-simple-operator (not (or simple-operator ?\n)))
-            (operator          (or "==" ">=" "is" "not"
+            (operator          (or "==" ">="
                                    "**" "//" "<<" ">>" "<=" "!="
                                    "+" "-" "/" "&" "^" "~" "|" "*" "<" ">"
                                    "=" "%"))
@@ -791,6 +791,7 @@ sign in chained assignment."
                    (? (or ")" "]") (* sp-bsnl))
                    (group assignment-operator)))
      (1 font-lock-variable-name-face)
+     (2 'font-lock-operator-face)
      (,(python-rx grouped-assignment-target)
       (progn
         (goto-char (match-end 1))       ; go back after the first symbol
@@ -806,8 +807,9 @@ sign in chained assignment."
        (python-rx (or line-start ?\;) (* sp-bsnl)
                   grouped-assignment-target (* sp-bsnl)
                   (? ?: (* sp-bsnl) (+ not-simple-operator) (* sp-bsnl))
-                  assignment-operator))
-     (1 font-lock-variable-name-face))
+                  (group assignment-operator)))
+     (1 font-lock-variable-name-face)
+     (2 'font-lock-operator-face))
     ;; special cases
     ;;   (a) = 5
     ;;   [a] = 5,
@@ -817,8 +819,11 @@ sign in chained assignment."
                   (or "[" "(") (* sp-nl)
                   grouped-assignment-target (* sp-nl)
                   (or ")" "]") (* sp-bsnl)
-                  assignment-operator))
-     (1 font-lock-variable-name-face))
+                  (group assignment-operator)))
+     (1 font-lock-variable-name-face)
+     (2 'font-lock-operator-face))
+    ;; Operators.
+    (,(python-rx operator) . 'font-lock-operator-face)
     ;; escape sequences within bytes literals
     ;;   "\\" "\'" "\a" "\b" "\f" "\n" "\r" "\t" "\v"
     ;;   "\ooo" character with octal value ooo
diff --git a/test/lisp/progmodes/python-tests.el 
b/test/lisp/progmodes/python-tests.el
index 3efc28c7ed..17d6d8aa70 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -280,28 +280,33 @@ aliqua."
    "a, b, c = 1, 2, 3"
    '((1 . font-lock-variable-name-face) (2)
      (4 . font-lock-variable-name-face) (5)
-     (7 . font-lock-variable-name-face) (8))))
+     (7 . font-lock-variable-name-face) (8)
+     (9 . font-lock-operator-face) (10))))
 
 (ert-deftest python-font-lock-assignment-statement-2 ()
   (python-tests-assert-faces
    "a, *b, c = 1, 2, 3, 4, 5"
    '((1 . font-lock-variable-name-face) (2)
+     (4 . font-lock-operator-face)
      (5 . font-lock-variable-name-face) (6)
-     (8 . font-lock-variable-name-face) (9))))
+     (8 . font-lock-variable-name-face) (9)
+     (10 . font-lock-operator-face) (11))))
 
 (ert-deftest python-font-lock-assignment-statement-3 ()
   (python-tests-assert-faces
    "[a, b] = (1, 2)"
    '((1)
      (2 . font-lock-variable-name-face) (3)
-     (5 . font-lock-variable-name-face) (6))))
+     (5 . font-lock-variable-name-face) (6)
+     (8 . font-lock-operator-face) (9))))
 
 (ert-deftest python-font-lock-assignment-statement-4 ()
   (python-tests-assert-faces
    "(l[1], l[2]) = (10, 11)"
    '((1)
      (2 . font-lock-variable-name-face) (3)
-     (8 . font-lock-variable-name-face) (9))))
+     (8 . font-lock-variable-name-face) (9)
+     (14 . font-lock-operator-face) (15))))
 
 (ert-deftest python-font-lock-assignment-statement-5 ()
   (python-tests-assert-faces
@@ -310,22 +315,29 @@ aliqua."
      (2 . font-lock-variable-name-face) (3)
      (5 . font-lock-variable-name-face) (6)
      (8 . font-lock-variable-name-face) (9)
+     (11 . font-lock-operator-face)
      (12 . font-lock-variable-name-face) (13)
+     (15 . font-lock-operator-face) (16)
+     (17 . font-lock-operator-face)
      (18 . font-lock-variable-name-face) (19)
-     (21 . font-lock-variable-name-face) (22))))
+     (21 . font-lock-variable-name-face) (22)
+     (23 . font-lock-operator-face) (24))))
 
 (ert-deftest python-font-lock-assignment-statement-6 ()
   (python-tests-assert-faces
    "(a,) = 'foo',"
    '((1)
      (2 . font-lock-variable-name-face) (3)
+     (6 . font-lock-operator-face) (7)
      (8 . font-lock-string-face) (13))))
 
 (ert-deftest python-font-lock-assignment-statement-7 ()
   (python-tests-assert-faces
    "(*a,) = ['foo', 'bar', 'baz']"
    '((1)
+     (2 . font-lock-operator-face)
      (3 . font-lock-variable-name-face) (4)
+     (7 . font-lock-operator-face) (8)
      (10 . font-lock-string-face) (15)
      (17 . font-lock-string-face) (22)
      (24 . font-lock-string-face) (29))))
@@ -334,6 +346,7 @@ aliqua."
   (python-tests-assert-faces
    "d = D('a', ['b'], 'c')"
    '((1 . font-lock-variable-name-face) (2)
+     (3 . font-lock-operator-face) (4)
      (7 . font-lock-string-face) (10)
      (13 . font-lock-string-face) (16)
      (19 . font-lock-string-face) (22))))
@@ -344,7 +357,9 @@ aliqua."
    '((1)
      (3 . font-lock-variable-name-face) (4)
      (8 . font-lock-variable-name-face) (9)
+     (14 . font-lock-operator-face) (15)
      (17 . font-lock-variable-name-face) (18)
+     (19 . font-lock-operator-face) (20)
      (21 . font-lock-string-face) (24)
      (26 . font-lock-string-face) (29)
      (31 . font-lock-string-face) (34)
@@ -355,7 +370,8 @@ aliqua."
   (python-tests-assert-faces
    "a: int = 5"
    '((1 . font-lock-variable-name-face) (2)
-     (4 . font-lock-builtin-face) (7))))
+     (4 . font-lock-builtin-face) (7)
+     (8 . font-lock-operator-face) (9))))
 
 (ert-deftest python-font-lock-assignment-statement-11 ()
   (python-tests-assert-faces
@@ -364,13 +380,15 @@ aliqua."
      (19 . font-lock-builtin-face) (22)
      (40 . font-lock-builtin-face) (43)
      (46 . font-lock-builtin-face) (49)
+     (52 . font-lock-operator-face) (53)
      (55 . font-lock-constant-face) (59)
      (61 . font-lock-string-face) (66))))
 
 (ert-deftest python-font-lock-assignment-statement-12 ()
   (python-tests-assert-faces
    "c: Collection = {1, 2, 3}"
-   '((1 . font-lock-variable-name-face) (2))))
+   '((1 . font-lock-variable-name-face) (2)
+     (15 . font-lock-operator-face) (16))))
 
 (ert-deftest python-font-lock-assignment-statement-13 ()
   (python-tests-assert-faces
@@ -378,6 +396,7 @@ aliqua."
    '((1 . font-lock-variable-name-face) (2)
      (12 . font-lock-builtin-face) (15)
      (17 . font-lock-builtin-face) (20)
+     (22 . font-lock-operator-face) (23)
      (28 . font-lock-string-face) (33)
      (38 . font-lock-string-face) (43))))
 
@@ -386,28 +405,38 @@ aliqua."
    "(a) = 5; (b) = 6"
    '((1)
      (2 . font-lock-variable-name-face) (3)
-     (11 . font-lock-variable-name-face) (12))))
+     (5 . font-lock-operator-face) (6)
+     (11 . font-lock-variable-name-face) (12)
+     (14 . font-lock-operator-face) (15))))
 
 (ert-deftest python-font-lock-assignment-statement-15 ()
   (python-tests-assert-faces
    "[a] = 5,; [b] = 6,"
    '((1)
      (2 . font-lock-variable-name-face) (3)
-     (12 . font-lock-variable-name-face) (13))))
+     (5 . font-lock-operator-face) (6)
+     (12 . font-lock-variable-name-face) (13)
+     (15 . font-lock-operator-face) (16))))
 
 (ert-deftest python-font-lock-assignment-statement-16 ()
   (python-tests-assert-faces
    "[*a] = 5, 6; [*b] = 7, 8"
    '((1)
+     (2 . font-lock-operator-face)
      (3 . font-lock-variable-name-face) (4)
-     (16 . font-lock-variable-name-face) (17))))
+     (6 . font-lock-operator-face) (7)
+     (15 . font-lock-operator-face)
+     (16 . font-lock-variable-name-face) (17)
+     (19 . font-lock-operator-face) (20))))
 
 (ert-deftest python-font-lock-assignment-statement-17 ()
   (python-tests-assert-faces
    "(a) = (b) = 1"
-   `((1)
+   '((1)
      (2 . font-lock-variable-name-face) (3)
-     (8 . font-lock-variable-name-face) (9))))
+     (5 . font-lock-operator-face) (6)
+     (8 . font-lock-variable-name-face) (9)
+     (11 . font-lock-operator-face) (12))))
 
 (ert-deftest python-font-lock-assignment-statement-18 ()
   (python-tests-assert-faces
@@ -420,13 +449,21 @@ def f(x: CustomInt) -> CustomInt:
     return res
 "
    '((1 . font-lock-variable-name-face) (10)
+     (11 . font-lock-operator-face) (12)
      (13 . font-lock-builtin-face) (16)
      (18 . font-lock-keyword-face) (21)
      (22 . font-lock-function-name-face) (23)
+     (38 . font-lock-operator-face) (40)
      (56 . font-lock-variable-name-face) (57)
+     (58 . font-lock-operator-face) (59)
+     (62 . font-lock-operator-face) (63)
      (70 . font-lock-variable-name-face) (72)
+     (94 . font-lock-operator-face) (95)
+     (102 . font-lock-operator-face) (103)
      (111 . font-lock-variable-name-face) (114)
+     (126 . font-lock-operator-face) (127)
      (128 . font-lock-builtin-face) (131)
+     (136 . font-lock-operator-face) (137)
      (144 . font-lock-keyword-face) (150))))
 
 (ert-deftest python-font-lock-assignment-statement-multiline-1 ()
@@ -442,7 +479,8 @@ def f(x: CustomInt) -> CustomInt:
 "
    '((1)
      (8 . font-lock-variable-name-face) (9)
-     (15 . font-lock-variable-name-face) (16))
+     (15 . font-lock-variable-name-face) (16)
+     (19 . font-lock-operator-face) (20))
    "#" "="))
 
 (ert-deftest python-font-lock-assignment-statement-multiline-2 ()
@@ -453,7 +491,9 @@ def f(x: CustomInt) -> CustomInt:
 ] # 5, 6
 "
    '((1)
-     (9 . font-lock-variable-name-face) (10))
+     (8 . font-lock-operator-face)
+     (9 . font-lock-variable-name-face) (10)
+     (13 . font-lock-operator-face) (14))
    "#" "="))
 
 (ert-deftest python-font-lock-assignment-statement-multiline-3 ()
@@ -471,7 +511,8 @@ def f(x: CustomInt) -> CustomInt:
     3"
    '((1 . font-lock-variable-name-face) (2)
      (15 . font-lock-variable-name-face) (16)
-     (29 . font-lock-variable-name-face) (30))
+     (29 . font-lock-variable-name-face) (30)
+     (36 . font-lock-operator-face) (37))
    "#" "="))
 
 (ert-deftest python-font-lock-assignment-statement-multiline-4 ()
@@ -482,7 +523,8 @@ def f(x: CustomInt) -> CustomInt:
     #\\
     5"
    '((1 . font-lock-variable-name-face) (2)
-     (15 . font-lock-builtin-face) (18))
+     (15 . font-lock-builtin-face) (18)
+     (24 . font-lock-operator-face) (25))
    "#" "="))
 
 (ert-deftest python-font-lock-assignment-statement-multiline-5 ()
@@ -500,7 +542,9 @@ def f(x: CustomInt) -> CustomInt:
     6"
    '((1)
      (8 . font-lock-variable-name-face) (9)
-     (46 . font-lock-variable-name-face) (47))
+     (18 . font-lock-operator-face) (19)
+     (46 . font-lock-variable-name-face) (47)
+     (60 . font-lock-operator-face) (61))
    "#" "="))
 
 (ert-deftest python-font-lock-assignment-statement-multiline-6 ()
@@ -518,9 +562,33 @@ def f(x: CustomInt) -> CustomInt:
     6"
    '((1)
      (7 . font-lock-variable-name-face) (8)
-     (43 . font-lock-variable-name-face) (44))
+     (16 . font-lock-operator-face) (17)
+     (43 . font-lock-variable-name-face) (44)
+     (56 . font-lock-operator-face) (57))
    "#" "="))
 
+(ert-deftest python-font-lock-operator-1 ()
+  (python-tests-assert-faces
+   "1 << 2 ** 3 == +4%-5|~6&7^8%9"
+   '((1)
+     (3 . font-lock-operator-face) (5)
+     (8 . font-lock-operator-face) (10)
+     (13 . font-lock-operator-face) (15)
+     (16 . font-lock-operator-face) (17)
+     (18 . font-lock-operator-face) (20)
+     (21 . font-lock-operator-face) (23)
+     (24 . font-lock-operator-face) (25)
+     (26 . font-lock-operator-face) (27)
+     (28 . font-lock-operator-face) (29))))
+
+(ert-deftest python-font-lock-operator-2 ()
+  "Keyword operators are font-locked as keywords."
+  (python-tests-assert-faces
+   "is_ is None"
+   '((1)
+     (5 . font-lock-keyword-face) (7)
+     (8 . font-lock-constant-face))))
+
 (ert-deftest python-font-lock-escape-sequence-string-newline ()
   (python-tests-assert-faces
    "'\\n'
@@ -603,12 +671,16 @@ u\"\\n\""
      (196 . font-lock-constant-face)
      (215 . font-lock-string-face) (218)
      (221 . font-lock-string-face) (254)
+     (259 . font-lock-operator-face) (260)
      (271 . font-lock-string-face) (274)
      (277 . font-lock-string-face) (310)
+     (315 . font-lock-operator-face) (316)
      (327 . font-lock-string-face) (330)
      (333 . font-lock-string-face) (366)
+     (371 . font-lock-operator-face) (372)
      (383 . font-lock-string-face) (386)
      (389 . font-lock-string-face) (422)
+     (427 . font-lock-operator-face) (428)
      (439 . font-lock-string-face) (442)
      (444 . font-lock-string-face) (497)
      (499 . font-lock-string-face) (552)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]