emacs-diffs
[Top][All Lists]
Advanced

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

feature/android 28f6add67f8 08/10: Merge remote-tracking branch 'origin/


From: Po Lu
Subject: feature/android 28f6add67f8 08/10: Merge remote-tracking branch 'origin/master' into feature/android
Date: Sun, 26 Feb 2023 02:12:16 -0500 (EST)

branch: feature/android
commit 28f6add67f8c30999a3809b242fa66f558a27005
Merge: 39ddf1855bb 580bb8f46c4
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'origin/master' into feature/android
---
 etc/NEWS.29                            | 10 +++++-----
 lib-src/ebrowse.c                      |  5 -----
 lib/unistd.in.h                        | 18 ++++++++++++++++++
 lisp/eshell/esh-var.el                 | 18 +++++++++++++-----
 lisp/progmodes/elisp-mode.el           |  2 +-
 lisp/progmodes/python.el               |  2 +-
 src/bidi.c                             |  1 +
 test/lisp/emacs-lisp/bytecomp-tests.el | 12 ++++++++++--
 test/lisp/eshell/em-cmpl-tests.el      | 14 ++++++++++++++
 9 files changed, 63 insertions(+), 19 deletions(-)

diff --git a/etc/NEWS.29 b/etc/NEWS.29
index b6c6f2c6362..5a244285efa 100644
--- a/etc/NEWS.29
+++ b/etc/NEWS.29
@@ -828,12 +828,12 @@ filter/sentinel error has been handled.
 +++
 ** New faces for font-lock.
 These faces are primarily meant for use with tree-sitter.  They are:
-'font-lock-function-call-face', 'font-lock-variable-ref-face',
 'font-lock-bracket-face', 'font-lock-delimiter-face',
-'font-lock-escape-face', 'font-lock-misc-punctuation-face',
-'font-lock-number-face', 'font-lock-operator-face',
-'font-lock-property-name-face', 'font-lock-property-ref-face',
-'font-lock-punctuation-face', and 'font-lock-regexp-face'.
+'font-lock-escape-face', 'font-lock-function-call-face',
+'font-lock-misc-punctuation-face', 'font-lock-number-face',
+'font-lock-operator-face', 'font-lock-property-name-face',
+'font-lock-property-ref-face', 'font-lock-punctuation-face',
+'font-lock-regexp-face', and 'font-lock-variable-ref-face'.
 
 +++
 ** New face 'variable-pitch-text'.
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 469e90d04bb..371fa6c938b 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -31,11 +31,6 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include <min-max.h>
 #include <unlocked-io.h>
 
-/* The SunOS compiler doesn't have SEEK_END.  */
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
-
 /* Files are read in chunks of this number of bytes.  */
 
 enum { READ_CHUNK_SIZE = 100 * 1024 };
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index bfc501e5a7d..8ba9867894e 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -40,6 +40,24 @@
 # undef _GL_INCLUDING_UNISTD_H
 #endif
 
+/* Avoid lseek bugs in FreeBSD, macOS <https://bugs.gnu.org/61386>.
+   This bug is fixed after FreeBSD 13; see <https://bugs.freebsd.org/256205>.
+   Use macOS "9999" to stand for a future fixed macOS version.  */
+#if defined __FreeBSD__ && __FreeBSD__ < 14
+# undef SEEK_DATA
+# undef SEEK_HOLE
+#elif defined __APPLE__ && defined __MACH__ && defined SEEK_DATA
+# ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+#  include <AvailabilityMacros.h>
+# endif
+# if (!defined MAC_OS_X_VERSION_MIN_REQUIRED \
+      || MAC_OS_X_VERSION_MIN_REQUIRED < 99990000)
+#  include <sys/fcntl.h> /* It also defines the two macros.  */
+#  undef SEEK_DATA
+#  undef SEEK_HOLE
+# endif
+#endif
+
 /* Get all possible declarations of gethostname().  */
 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
   && !defined _GL_INCLUDING_WINSOCK2_H
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 0031324b537..5d6299af564 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -862,11 +862,19 @@ START and END."
 
 (defun eshell-complete-variable-assignment ()
   "If there is a variable assignment, allow completion of entries."
-  (let ((arg (pcomplete-actual-arg)) pos)
-    (when (string-match (concat "\\`" eshell-variable-name-regexp "=") arg)
-      (setq pos (match-end 0))
-      (if (string-match "\\(:\\)[^:]*\\'" arg)
-         (setq pos (match-end 1)))
+  (catch 'not-assignment
+    ;; The current argument can only be a variable assignment if all
+    ;; arguments leading up to it are also variable assignments.  See
+    ;; `eshell-handle-local-variables'.
+    (dotimes (offset (1+ pcomplete-index))
+      (unless (string-match (concat "\\`" eshell-variable-name-regexp "=")
+                            (pcomplete-actual-arg 'first offset))
+        (throw 'not-assignment nil)))
+    ;; We have a variable assignment.  Handle it.
+    (let ((arg (pcomplete-actual-arg))
+          (pos (match-end 0)))
+      (when (string-match "\\(:\\)[^:]*\\'" arg)
+       (setq pos (match-end 1)))
       (setq pcomplete-stub (substring arg pos))
       (throw 'pcomplete-completions (pcomplete-entries)))))
 
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index f7cd9e90926..27e39900830 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -191,7 +191,7 @@ All commands in `lisp-mode-shared-map' are inherited by 
this map."
   menu)
 
 (defun emacs-lisp-byte-compile ()
-  "Byte compile the file containing the current buffer."
+  "Byte-compile the current buffer's file."
   (interactive nil emacs-lisp-mode)
   (if buffer-file-name
       (byte-compile-file buffer-file-name)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 8220e3086fd..5aab31c3ea8 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1070,7 +1070,7 @@ fontified."
     ;; Don't highlight string prefixes like f/r/b.
     (save-excursion
       (goto-char string-beg)
-      (when (search-forward "\"" string-end t)
+      (when (re-search-forward "[\"']" string-end t)
         (setq string-beg (match-beginning 0))))
     (treesit-fontify-with-override
      string-beg string-end face override start end)))
diff --git a/src/bidi.c b/src/bidi.c
index 93875d243e4..3c26ae19322 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1126,6 +1126,7 @@ bidi_set_paragraph_end (struct bidi_it *bidi_it)
   bidi_it->invalid_levels = 0;
   bidi_it->invalid_isolates = 0;
   bidi_it->stack_idx = 0;
+  bidi_it->isolate_level = 0;
   bidi_it->resolved_level = bidi_it->level_stack[0].level;
 }
 
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 00abe730948..185abaf5c22 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -888,8 +888,6 @@ byte-compiled.  Run with dynamic binding."
 
 (defun bytecomp--with-warning-test (re-warning form)
   (declare (indent 1))
-  `(bytecomp--with-warning-test-1 ,re-warning ,form))
-(defun bytecomp--with-warning-test-1 (re-warning form)
   (with-current-buffer (get-buffer-create "*Compile-Log*")
      (let ((inhibit-read-only t)) (erase-buffer))
      (let ((text-quoting-style 'grave)
@@ -901,6 +899,16 @@ byte-compiled.  Run with dynamic binding."
            (should (re-search-forward
                     (string-replace " " "[ \n]+" re-warning))))))))
 
+(ert-deftest bytecomp-warn--ignore ()
+  (bytecomp--with-warning-test "unused"
+    '(lambda (y) 6))
+  (bytecomp--with-warning-test "\\`\\'" ;No warning!
+    '(lambda (y) (ignore y) 6))
+  (bytecomp--with-warning-test "assq"
+    '(lambda (x y) (progn (assq x y) 5)))
+  (bytecomp--with-warning-test "\\`\\'" ;No warning!
+    '(lambda (x y) (progn (ignore (assq x y)) 5))))
+
 (ert-deftest bytecomp-warn-wrong-args ()
   (bytecomp--with-warning-test "remq.*3.*2"
     '(remq 1 2 3)))
diff --git a/test/lisp/eshell/em-cmpl-tests.el 
b/test/lisp/eshell/em-cmpl-tests.el
index ecab7332822..be2199c0464 100644
--- a/test/lisp/eshell/em-cmpl-tests.el
+++ b/test/lisp/eshell/em-cmpl-tests.el
@@ -217,6 +217,20 @@ See <lisp/eshell/esh-var.el>."
      (should (equal (eshell-insert-and-complete "VAR=f")
                     "VAR=file.txt ")))))
 
+(ert-deftest em-cmpl-test/variable-assign-completion/non-assignment ()
+  "Test completion of things that look like variable assignment, but aren't.
+For example, the second argument in \"tar --directory=dir\" looks
+like it could be a variable assignment, but it's not.  We should
+let `pcomplete-tar' handle it instead.
+
+See <lisp/eshell/esh-var.el>."
+  (with-temp-eshell
+   (ert-with-temp-directory default-directory
+     (write-region nil nil (expand-file-name "file.txt"))
+     (make-directory "dir")
+     (should (equal (eshell-insert-and-complete "tar --directory=")
+                    "tar --directory=dir/")))))
+
 (ert-deftest em-cmpl-test/user-ref-completion ()
   "Test completion of user references like \"~user\".
 See <lisp/eshell/em-dirs.el>."



reply via email to

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