[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 2595b90 449/459: Revert "Tweak mode to not
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 2595b90 449/459: Revert "Tweak mode to not require tree-sitter packages" |
Date: |
Sun, 22 Aug 2021 14:00:20 -0400 (EDT) |
branch: externals/csharp-mode
commit 2595b901387e3f7eb5e8359ced65e6275f95e082
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Theodor Thornhill <theo@thornhill.no>
Revert "Tweak mode to not require tree-sitter packages"
This reverts commit 6988939c724d8109c51e78e5106fd0cd83de6fbe.
---
.gitignore | 4 ----
csharp-mode.el | 30 ++++++++++++++++++++----------
csharp-tree-sitter.el | 22 +++++-----------------
3 files changed, 25 insertions(+), 31 deletions(-)
diff --git a/.gitignore b/.gitignore
index 55c2d12..f3d8a8a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,10 +22,6 @@ tramp
/eshell/history
/eshell/lastdir
-# GNU ELPA generated files
-/csharp-mode-autoloads.el
-/csharp-mode-pkg.el
-
# elpa packages
/elpa/
diff --git a/csharp-mode.el b/csharp-mode.el
index f30c16c..6329290 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -8,7 +8,7 @@
;; Version : 0.11.0
;; Keywords : c# languages oop mode
;; X-URL : https://github.com/emacs-csharp/csharp-mode
-;; Package-Requires: ((emacs "26.1"))
+;; Package-Requires: ((emacs "26.1") (tree-sitter "0.15.1")
(tree-sitter-indent "0.1") (tree-sitter-langs "0.10.0"))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -27,6 +27,8 @@
;;; Code:
+(when (version< emacs-version "25.1")
+ (require 'cl))
(require 'cc-mode)
(require 'cc-langs)
@@ -67,11 +69,11 @@
(c-add-language 'csharp-mode 'java-mode))
(c-lang-defconst c-make-mode-syntax-table
- csharp (lambda ()
- (let ((table (make-syntax-table)))
- (c-populate-syntax-table table)
- (modify-syntax-entry ?@ "_" table)
- table)))
+ csharp `(lambda ()
+ (let ((table (make-syntax-table)))
+ (c-populate-syntax-table table)
+ (modify-syntax-entry ?@ "_" table)
+ table)))
(c-lang-defconst c-identifier-syntax-modifications
csharp (append '((?@ . "w"))
@@ -346,7 +348,8 @@ Should be one of the font lock faces, such as
Needs to be set before `csharp-mode' is loaded, because of
compilation and evaluation time conflicts."
- :type 'symbol)
+ :type 'symbol
+ :group 'csharp)
(defcustom csharp-font-lock-extra-types
(list csharp--regex-type-name)
@@ -399,7 +402,7 @@ compilation and evaluation time conflicts."
;;; Adding syntax constructs
(advice-add 'c-looking-at-inexpr-block
- :around #'csharp-looking-at-inexpr-block)
+ :around 'csharp-looking-at-inexpr-block)
(defun csharp-looking-at-inexpr-block (orig-fun &rest args)
(let ((res (csharp-at-lambda-header)))
@@ -419,7 +422,7 @@ compilation and evaluation time conflicts."
(cons 'inexpr (point))))))
(advice-add 'c-guess-basic-syntax
- :around #'csharp-guess-basic-syntax)
+ :around 'csharp-guess-basic-syntax)
(defun csharp-guess-basic-syntax (orig-fun &rest args)
(cond
@@ -543,6 +546,12 @@ compilation and evaluation time conflicts."
;; Custom variables
;;;###autoload
+(defcustom csharp-mode-hook nil
+ "*Hook called by `csharp-mode'."
+ :type 'hook
+ :group 'csharp)
+
+;;;###autoload
(define-derived-mode csharp-mode prog-mode "C#"
"Major mode for editing Csharp code.
@@ -552,8 +561,9 @@ Key bindings:
(c-initialize-cc-mode t)
(c-init-language-vars csharp-mode)
(c-common-init 'csharp-mode)
+ (easy-menu-add csharp-mode-menu)
(setq-local c-doc-comment-style '((csharp-mode . codedoc)))
- (run-mode-hooks 'c-mode-common-hook))
+ (c-run-mode-hooks 'c-mode-common-hook 'csharp-mode-hook))
(provide 'csharp-mode)
diff --git a/csharp-tree-sitter.el b/csharp-tree-sitter.el
index 3979f09..7fac9c4 100644
--- a/csharp-tree-sitter.el
+++ b/csharp-tree-sitter.el
@@ -29,22 +29,10 @@
(require 'cl-extra)
(require 'seq)
-(when t
- ;; In order for the package to be usable and installable (and hence
- ;; compilable) without tree-sitter, wrap the `require's within a dummy `when'
- ;; so they're only executed when loading this file but not when compiling it.
- (require 'tree-sitter)
- (require 'tree-sitter-hl)
- (require 'tree-sitter-indent)
- (require 'tree-sitter-langs))
-;; Vars and functions defined by the above packages:
-(defvar tree-sitter-major-mode-language-alist) ;From `tree-sitter-langs'.
-(declare-function tree-sitter-indent-mode "ext:tree-sitter-indent")
-(declare-function tree-sitter-indent-line "ext:tree-sitter-indent")
-(declare-function tree-sitter-hl-mode "ext:tree-sitter-hl")
-(declare-function tsc-node-end-position "ext:tree-sitter")
-(declare-function tsc-node-start-position "ext:tree-sitter")
-(declare-function tree-sitter-node-at-point "ext:tree-sitter")
+(require 'tree-sitter)
+(require 'tree-sitter-hl)
+(require 'tree-sitter-indent)
+(require 'tree-sitter-langs)
(require 'csharp-compilation)
@@ -53,7 +41,7 @@
;;; Tree-sitter
-(defconst csharp-mode-tree-sitter-patterns
+(setq csharp-mode-tree-sitter-patterns
[ ;; Various constructs
(comment) @comment
(modifier) @keyword
- [elpa] externals/csharp-mode 0e26b88 433/459: Update readme with :ensure t, (continued)
- [elpa] externals/csharp-mode 0e26b88 433/459: Update readme with :ensure t, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode cb2404f 434/459: Correctly handle implicit types in for_each_statement, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 09b4d57 437/459: Add comment-start-skip, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 254b91b 439/459: Fix parse and sigabort errors on latest tree-sitter, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 76428ef 444/459: Nested type params and using declaration fixes (#233), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6988939 448/459: Tweak mode to not require tree-sitter packages, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 33e3042 446/459: Change ci setup to purcell/nix-emacs-ci (#236), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 093f0f2 447/459: Add static as keyword in csharp-tree-sitter, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 96563d1 451/459: Add back in wrongly removed backtick, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 5f127e2 455/459: Add small notice about elpa in readme, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2595b90 449/459: Revert "Tweak mode to not require tree-sitter packages",
ELPA Syncer <=
- [elpa] externals/csharp-mode 166a5fb 340/459: Revert "Handle "nameof" entirely in c-basic-matchers-after.", ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1e7bf8a 358/459: Update build.yml, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a685c7f 359/459: Update build.yml, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode e2541a4 362/459: Update README.org, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c1489db 370/459: First small tree-sitter query, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2bf76fd 378/459: Fix csharp-mode initialization without forked tree-sitter, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7e7353a 133/459: Imenu fixes: methods with comments, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1de5644 227/459: using: Don't mess up alnums in indentifier-fontification., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8d43a70 229/459: Fix fontification of using-statements., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4da4c39 231/459: Fix fontification of namespaces to match using-statement rules., ELPA Syncer, 2021/08/22