emacs-diffs
[Top][All Lists]
Advanced

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

master 0d60579b6b 5/5: Merge from origin/emacs-29


From: Stefan Kangas
Subject: master 0d60579b6b 5/5: Merge from origin/emacs-29
Date: Thu, 15 Dec 2022 15:34:52 -0500 (EST)

branch: master
commit 0d60579b6b6f2648a881572783322b1bcf931a73
Merge: e17c1b01d8 99aa00e6e3
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Merge from origin/emacs-29
    
    99aa00e6e34 Revert 21b387c39bd with last-minute hasty changes (bug#60...
    386d6e74d83 Replace an erroneous eq with an equal in cc-defs.el
    eb069470631 * lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' i...
    26243f7b65e compile.el: Fix regression with nb of errors in modeline
    6e2923d80f8 Make tab-bar-tab-group-format-function backwards-compatib...
    b211a63455c Make tab-bar-tab-group-format-function also handle curren...
    367022f316e Ensure package directories for source packages from check...
    3a633bdd6df ; * etc/NEWS: Fix recent changes.
    6aa5d16c643 * test/README (SELECTOR): Add eglot-tests.el to remote fi...
    bb27be36ddf Fix bug#60060 in Tramp
    d4c2aa4f913 ; * lisp/net/tramp-crypt.el: Fix comment.
    8404253d17a * .gitignore: Ignore GDB history files.
    12684c3a199 Mention 'tree-sitter' in user manual and NEWS
    49d7e0cec6a ; * etc/NEWS: Rearrange entries for tree-sitter supported...
    0ad2112a2f0 ; Announce 'toml-ts-mode' in NEWS.
    
    # Conflicts:
    #       etc/NEWS
---
 .gitignore                    |   4 ++
 doc/emacs/programs.texi       |  13 ++++-
 etc/NEWS.29                   | 117 +++++++++++++++++++++++-------------------
 lisp/emacs-lisp/package-vc.el |   1 +
 lisp/net/tramp-crypt.el       |   2 +-
 lisp/net/tramp-sh.el          |   1 +
 lisp/progmodes/cc-defs.el     |   2 +-
 lisp/progmodes/compile.el     |   1 +
 lisp/simple.el                |  72 +-------------------------
 lisp/tab-bar.el               |  23 ++++++---
 test/README                   |   2 +-
 11 files changed, 103 insertions(+), 135 deletions(-)

diff --git a/.gitignore b/.gitignore
index f4d2c15f51..af0ba0eb41 100644
--- a/.gitignore
+++ b/.gitignore
@@ -334,3 +334,7 @@ lib-src/seccomp-filter-exec.pfc
 # Ignore a directory used by dap-mode.
 .vscode
 /test/gmp.h
+
+# GDB history
+.gdb_history
+_gdb_history
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index a668857213..3812c2aa28 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -88,6 +88,10 @@ mode for the C programming language is @code{c-mode}.
 @cindex JSON mode
 @cindex SQL mode
 @cindex TypeScript mode
+@cindex CSS mode
+@cindex Dockerfile mode
+@cindex CMake mode
+@cindex TOML mode
   Emacs has programming language modes for Lisp, Scheme, the
 Scheme-based DSSSL expression language, Ada, ASM, AWK, C, C++, C#,
 Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, M4, Makefiles,
@@ -97,13 +101,20 @@ Python, Ruby, Simula, SQL, Tcl, TypeScript, Verilog, and 
VHDL@.  An
 alternative mode for Perl is called CPerl mode.  Modes are also
 available for the scripting languages of the common GNU and Unix
 shells, and MS-DOS/MS-Windows @samp{BAT} files, JSON, DNS master
-files, and various sorts of configuration files.
+files, CSS (Cascading Style Sheets), Dockerfiles, CMake files, and various 
sorts of configuration files.
 
   Ideally, Emacs should have a major mode for each programming
 language that you might want to edit.  If it doesn't have a mode for
 your favorite language, the mode might be implemented in a package not
 distributed with Emacs (@pxref{Packages}); or you can contribute one.
 
+@cindex tree-sitter library, supported major modes
+  If Emacs has been compiled with the @samp{tree-sitter} library, it
+offers several optional editing modes based on that library, which
+utilize the incremental parsing capabilities provided by
+@samp{tree-sitter}.  These modes have @samp{-ts-} in their names; for
+example @code{c-ts-mode}, @code{python-ts-mode}, etc.
+
 @kindex DEL @r{(programming modes)}
 @findex backward-delete-char-untabify
   In most programming languages, indentation should vary from line to
diff --git a/etc/NEWS.29 b/etc/NEWS.29
index 662c3125e0..701e414fdb 100644
--- a/etc/NEWS.29
+++ b/etc/NEWS.29
@@ -30,6 +30,16 @@ Use '--with-native-compilation=aot' to specify that all the 
Lisp files
 in the Emacs tree should be natively compiled ahead of time.  (This is
 slow on most machines.)
 
++++
+** Emacs can be built with the 'tree-sitter' parsing library.
+This library, together with grammar libraries, provides incremental
+parsing capabilities for several popular programming languages and
+other formatted files.  Emacs built with this library offers major
+modes, described elsewhere in this file, that are based on the
+'tree-sitter's parsers.  If you have the 'tree-sitter' library
+installed, the configure script will automatically include it in the
+build; use '--without-tree-sitter' at configure time to disable that.
+
 +++
 ** Emacs can be built with built-in support for accessing SQLite databases.
 This uses the popular sqlite3 library, and can be disabled by using
@@ -1742,10 +1752,9 @@ the second one will switch to the "*Completions*" buffer.
 
 ---
 *** New user option 'completion-auto-wrap'.
-When non-nil, the commands 'next-completion', 'previous-completion',
-'next-line-completion' and 'previous-line-completion' automatically
-wrap around on reaching the beginning or the end of the "*Completions*"
-buffer.
+When non-nil, the commands 'next-completion' and 'previous-completion'
+automatically wrap around on reaching the beginning or the end of
+the "*Completions*" buffer.
 
 +++
 *** New values for the 'completion-auto-help' user option.
@@ -3003,70 +3012,74 @@ Emacs buffers, like indentation and the like.  The new 
ert function
 This is a lightweight variant of 'js-mode' that is used by default
 when visiting JSON files.
 
-** New major mode 'typescript-ts-mode'.
-A major mode based on the tree-sitter library for editing programs
-in the TypeScript language.  It includes support for font-locking,
-indentation, and navigation.  This mode will be auto-enabled for
-files with the ".ts" extension.
+** New major mode 'csharp-mode'.
+A major mode based on CC Mode for editing programs in the C# language.
+This mode is auto-enabled for files with the ".cs" extension.
 
-** New major mode 'tsx-ts-mode'.
-A major mode based on the tree-sitter library for editing programs
-in the TypeScript language, with support for TSX.  It includes
-support for font-locking, indentation, and navigation.  This mode
-will be auto-enabled for files with the ".tsx" extension.
+** New major modes based on the tree-sitter library.
+These new major modes are available if Emacs was built with the
+tree-sitter library.  They provide support for font-locking,
+indentation, and navigation by defuns based on parsing the buffer text
+by a tree-sitter parser.  Some major modes also offer support for
+Imenu and 'which-func'.
 
-** New major mode 'c-ts-mode'.
+*** New major mode 'typescript-ts-mode'.
 A major mode based on the tree-sitter library for editing programs
-in the C language.  It includes support for font-locking,
-indentation, Imenu, which-func, and navigation.
+in the TypeScript language.  This mode is auto-enabled for files with
+the ".ts" extension.
 
-** New major mode 'c++-ts-mode'.
+*** New major mode 'tsx-ts-mode'.
 A major mode based on the tree-sitter library for editing programs
-in the C++ language.  It includes support for font-locking,
-indentation, Imenu, which-func, and navigation.
+in the TypeScript language, with support for TSX.  This mode is
+auto-enabled for files with the ".tsx" extension.
 
-** New major mode 'java-ts-mode'.
-A major mode based on the tree-sitter library for editing programs
-in the Java language.  It includes support for font-locking,
-indentation, Imenu, which-func, and navigation.
+*** New major mode 'c-ts-mode'.
+An optional major mode based on the tree-sitter library for editing
+programs in the C language.
 
-** New major mode 'python-ts-mode'.
-A major mode based on the tree-sitter library for editing programs
-in the Python language.  It includes support for font-locking,
-indentation, Imenu, which-func, and navigation.
+*** New major mode 'c++-ts-mode'.
+An optional major mode based on the tree-sitter library for editing
+programs in the C++ language.
 
-** New major mode 'css-ts-mode'.
-A major mode based on the tree-sitter library for editing CSS
-(Cascading Style Sheets).  It includes support for font-locking,
-indentation, Imenu, which-func, and navigation.
+*** New major mode 'java-ts-mode'.
+An optional major mode based on the tree-sitter library for editing
+programs in the Java language.
 
-** New major mode 'json-ts-mode'.
-A major mode based on the tree-sitter library for editing programs
-in the JSON language.  It includes support for font-locking,
-indentation, Imenu, which-func, and navigation.
+*** New major mode 'python-ts-mode'.
+An optional major mode based on the tree-sitter library for editing
+programs in the Python language.
 
-** New major mode 'csharp-ts-mode'.
-A major mode based on the tree-sitter library for editing programs
-in the C# language.  It includes support for font-locking,
-indentation, Imenu, which-func, and navigation.
+*** New major mode 'css-ts-mode'.
+An optional major mode based on the tree-sitter library for editing
+CSS (Cascading Style Sheets).
 
-** New major mode 'csharp-mode'.
-A major mode based on CC Mode for editing programs in the C# language.
+*** New major mode 'json-ts-mode'.
+An optional major mode based on the tree-sitter library for editing
+programs in the JSON language.
+
+*** New major mode 'csharp-ts-mode'.
+An optional major mode based on the tree-sitter library for editing
+programs in the C# language.
 
-** New major mode 'bash-ts-mode'.
-A major mode based on the tree-sitter library for editing Bash shell
-scripts.  It includes support for font-locking, indentation, Imenu,
-which-func, and navigation.
+*** New major mode 'bash-ts-mode'.
+Am optional major mode based on the tree-sitter library for editing
+Bash shell scripts.
 
-** New major mode 'dockerfile-ts-mode'.
+*** New major mode 'dockerfile-ts-mode'.
 A major mode based on the tree-sitter library for editing
-Dockerfiles.  It includes support for font-locking, indentation, Imenu,
-and which-func.
+Dockerfiles.  This mode is auto-enabled for files which are named
+"Dockerfile", have the "Dockerfile." prefix, or have the ".dockerfile"
+extension.
 
-** New major mode 'cmake-ts-mode'.
+*** New major mode 'cmake-ts-mode'.
 A major mode based on the tree-sitter library for editing CMake files.
-It includes support for font-locking, indentation, Imenu, and
-which-func.
+It is auto-enabled for files whose name is "CMakeLists.txt" or whose
+extension is ".cmake".
+
+*** New major mode 'toml-ts-mode'.
+A major mode based on the tree-sitter library for editing files
+written in TOML, a format for writing configuration files.  It is
+auto-enabled for files with the ".toml" extension.
 
 
 * Incompatible Lisp Changes in Emacs 29.1
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index db54e0e130..8f0eedd2f8 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -783,6 +783,7 @@ name from the base name of DIR."
     (package-vc--unpack-1
      (package-desc-create
       :name (intern name)
+      :dir pkg-dir
       :kind 'vc)
      (file-name-as-directory pkg-dir))))
 
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index fa40f96818..249b3fcd4d 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -318,7 +318,7 @@ connection if a previous connection has died for some 
reason."
       (process-put p 'vector vec)
       (set-process-query-on-exit-flag p nil)))
 
-  ;; The following operations must be performed w/o
+  ;; The following operations must be performed without
   ;; `tramp-crypt-file-name-handler'.
   (let* (tramp-crypt-enabled
         ;; Don't check for a proper method.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index df5800f4e9..6087f16431 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3431,6 +3431,7 @@ implementation will be used."
             (signal (car err) (cdr err)))))
 
       ;; Impossible to copy.  Trigger `file-missing' error.
+      (delete-file tmpfile)
       (setq tmpfile nil))))
 
 (defun tramp-sh-handle-write-region
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index b13f6a5914..dd6d33009d 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1826,7 +1826,7 @@ with value CHAR in the region [FROM to)."
     '(or (looking-at
          "\\([;#]\\|\\'\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s$\\|\\s<\\|\\s>\\)"
          (let ((prop (c-get-char-property (point) 'syntax-table)))
-           (eq prop '(14)))))))                ; '(14) is generic comment 
delimiter.
+           (equal prop '(14))))))) ; '(14) is generic comment delimiter.
 
 
 (defsubst c-intersect-lists (list alist)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index e8ada9388e..319dc97e69 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -186,6 +186,7 @@ and a string describing how the process finished.")
                      face compilation-info
                      help-echo "Number of informational messages so far")
     "]"))
+(put 'compilation-mode-line-errors 'risky-local-variable t)
 
 ;; If you make any changes to `compilation-error-regexp-alist-alist',
 ;; be sure to run the ERT test in test/lisp/progmodes/compile-tests.el.
diff --git a/lisp/simple.el b/lisp/simple.el
index 893a43b03f..654b56a088 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9578,8 +9578,6 @@ makes it easier to edit it."
     (define-key map "\C-m" 'choose-completion)
     (define-key map "\e\e\e" 'delete-completion-window)
     (define-key map [remap keyboard-quit] #'delete-completion-window)
-    (define-key map [up] 'previous-line-completion)
-    (define-key map [down] 'next-line-completion)
     (define-key map [left] 'previous-completion)
     (define-key map [right] 'next-completion)
     (define-key map [?\t] 'next-completion)
@@ -9639,8 +9637,7 @@ Go to the window from which completion was requested."
 
 (defcustom completion-auto-wrap t
   "Non-nil means to wrap around when selecting completion options.
-This affects the commands `next-completion', `previous-completion',
-`next-line-completion' and `previous-line-completion'.
+This affects the commands `next-completion' and `previous-completion'.
 When `completion-auto-select' is t, it wraps through the minibuffer
 for the commands bound to the TAB key."
   :type 'boolean
@@ -9746,73 +9743,6 @@ Also see the `completion-auto-wrap' variable."
     (when (/= 0 n)
       (switch-to-minibuffer))))
 
-(defun previous-line-completion (&optional n)
-  "Move to the item on the previous line in the completion list.
-With prefix argument N, move back N items line-wise (negative N
-means move forward).
-
-Also see the `completion-auto-wrap' variable."
-  (interactive "p")
-  (next-line-completion (- n)))
-
-(defun next-line-completion (&optional n)
-  "Move to the item on the next line in the completion list.
-With prefix argument N, move N items line-wise (negative N
-means move backward).
-
-Also see the `completion-auto-wrap' variable."
-  (interactive "p")
-  (let ((column (current-column))
-        pos)
-    (catch 'bound
-      (while (> n 0)
-        (setq pos nil)
-        (save-excursion
-          (while (and (not pos) (not (eobp)))
-            (forward-line 1)
-            (when (and (not (eobp))
-                       (eq (move-to-column column) column)
-                       (get-text-property (point) 'mouse-face))
-              (setq pos (point)))))
-        (if pos (goto-char pos)
-          (when completion-auto-wrap
-            (save-excursion
-              (goto-char (point-min))
-              (when (and (eq (move-to-column column) column)
-                         (get-text-property (point) 'mouse-face))
-                (setq pos (point)))
-              (while (and (not pos) (not (eobp)))
-                (forward-line 1)
-                (when (and (eq (move-to-column column) column)
-                           (get-text-property (point) 'mouse-face))
-                  (setq pos (point)))))
-            (if pos (goto-char pos))))
-        (setq n (1- n)))
-
-      (while (< n 0)
-        (setq pos nil)
-        (save-excursion
-          (while (and (not pos) (not (bobp)))
-            (forward-line -1)
-            (when (and (not (bobp))
-                       (eq (move-to-column column) column)
-                       (get-text-property (point) 'mouse-face))
-              (setq pos (point)))))
-        (if pos (goto-char pos)
-          (when completion-auto-wrap
-            (save-excursion
-              (goto-char (point-max))
-              (when (and (eq (move-to-column column) column)
-                         (get-text-property (point) 'mouse-face))
-                (setq pos (point)))
-              (while (and (not pos) (not (bobp)))
-                (forward-line -1)
-                (when (and (eq (move-to-column column) column)
-                           (get-text-property (point) 'mouse-face))
-                  (setq pos (point)))))
-            (if pos (goto-char pos))))
-        (setq n (1+ n))))))
-
 (defun choose-completion (&optional event no-exit no-quit)
   "Choose the completion at point.
 If EVENT, use EVENT's position to determine the starting position.
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 162e63fe23..f040bc9786 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -416,7 +416,7 @@ at the mouse-down event to the position at mouse-up event."
   "S-<wheel-right>" #'tab-bar-move-tab)
 
 (global-set-key [tab-bar]
-                `(menu-item ,(purecopy "tab bar") ignore
+                `(menu-item ,(purecopy "tab bar") ,(make-sparse-keymap)
                             :filter tab-bar-make-keymap))
 
 (defun tab-bar-make-keymap (&optional _ignore)
@@ -844,8 +844,9 @@ Function gets one argument: a tab."
 
 (defcustom tab-bar-tab-group-format-function #'tab-bar-tab-group-format-default
   "Function to format a tab group name.
-Function gets two arguments, a tab with a group name and its number,
-and should return the formatted tab group name to display in the tab bar."
+Function gets three arguments, a tab with a group name, its number, and
+an optional value that is non-nil when the tab is from the current group.
+It should return the formatted tab group name to display in the tab bar."
   :type 'function
   :initialize 'custom-initialize-default
   :set (lambda (sym val)
@@ -854,11 +855,11 @@ and should return the formatted tab group name to display 
in the tab bar."
   :group 'tab-bar
   :version "28.1")
 
-(defun tab-bar-tab-group-format-default (tab i)
+(defun tab-bar-tab-group-format-default (tab i &optional current-p)
   (propertize
-   (concat (if tab-bar-tab-hints (format "%d " i) "")
+   (concat (if (and tab-bar-tab-hints (not current-p)) (format "%d " i) "")
            (funcall tab-bar-tab-group-function tab))
-   'face 'tab-bar-tab-group-inactive))
+   'face (if current-p 'tab-bar-tab-group-current 
'tab-bar-tab-group-inactive)))
 
 (defcustom tab-bar-tab-group-face-function #'tab-bar-tab-group-face-default
   "Function to define a tab group face.
@@ -882,8 +883,14 @@ when the tab is current.  Return the result as a keymap."
    `((,(intern (format "group-%i" i))
       menu-item
       ,(if current-p
-           (propertize (funcall tab-bar-tab-group-function tab)
-                       'face 'tab-bar-tab-group-current)
+           (condition-case nil
+               (funcall tab-bar-tab-group-format-function tab i current-p)
+             ;; We used to define tab-bar-tab-group-format-function as
+             ;; taking two arguments but after adding the third argument
+             ;; we need to provide backwards-compatibility.
+             (wrong-number-of-arguments
+              (propertize (funcall tab-bar-tab-group-function tab)
+                          'face 'tab-bar-tab-group-current)))
          (funcall tab-bar-tab-group-format-function tab i))
       ,(if current-p 'ignore
          (or
diff --git a/test/README b/test/README
index 17783a4bac..eb6314c74d 100644
--- a/test/README
+++ b/test/README
@@ -118,7 +118,7 @@ If the $EMACS_TEST_JUNIT_REPORT environment variable is set 
to a file
 name, a JUnit test report is generated under this name.
 
 Some of the tests require a remote temporary directory
-(autorevert-tests.el, dnd-tests.el, filenotify-tests.el,
+(autorevert-tests.el, dnd-tests.el, eglot-tests.el, filenotify-tests.el,
 shadowfile-tests.el and tramp-tests.el).  Per default, a mock-up
 connection method is used (this might not be possible when running on
 MS Windows).  If you want to test a real remote connection, set



reply via email to

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