Merge remote-tracking branch 'origin/master' into feature/android

This commit is contained in:
Po Lu 2023-02-26 14:11:18 +08:00
commit 28f6add67f
9 changed files with 63 additions and 19 deletions

View file

@ -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'.

View file

@ -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 };

View file

@ -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

View file

@ -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)))))

View file

@ -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)

View file

@ -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)))

View file

@ -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;
}

View file

@ -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)))

View file

@ -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>."