[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 3b54997 130/459: Merge pull request #55 fro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 3b54997 130/459: Merge pull request #55 from josteink/derive-from-prog-mode |
Date: |
Sun, 22 Aug 2021 13:59:11 -0400 (EDT) |
branch: externals/csharp-mode
commit 3b54997d61d13c2b336332d0feba8cecffde879e
Merge: 73e7ed6 6e3cdc1
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Merge pull request #55 from josteink/derive-from-prog-mode
Derive from prog mode
---
csharp-mode-tests.el | 8 ++++++++
csharp-mode.el | 46 +++++++++++++++++-----------------------------
2 files changed, 25 insertions(+), 29 deletions(-)
diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 2393d40..0fb7661 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -178,6 +178,14 @@
(should (equal t (and csharp-hook1
csharp-hook2)))))
+(defvar c-mode-hook-run nil)
+(ert-deftest avoid-runing-c-mode-hook ()
+ (add-hook 'c-mode-hook (lambda () (setq c-mode-hook-run t)))
+
+ (with-temp-buffer
+ (csharp-mode)
+ (should-not c-mode-hook-run)))
+
(ert-deftest indentation-rules-should-be-as-specified-in-test-doc ()
(let* ((buffer (find-file "test-files/indentation-tests.cs"))
(orig-content)
diff --git a/csharp-mode.el b/csharp-mode.el
index 55df6bc..190d815 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -4177,18 +4177,9 @@ The return value is meaningless, and is ignored by
cc-mode.
))
-;;; The entry point into the mode
;;;###autoload
-(define-derived-mode csharp-mode c-mode "C#"
- "Major mode for editing C# code. This mode is derived from CC Mode to
-support C#.
-
-Normally, you'd want to autoload this mode by setting `auto-mode-alist' with
-an entry for csharp, in your .emacs file:
-
- (autoload 'csharp-mode \"csharp-mode\" \"Major mode for editing C# code.\"
t)
- (setq auto-mode-alist
- (append '((\"\\.cs$\" . csharp-mode)) auto-mode-alist))
+(define-derived-mode csharp-mode prog-mode "C#"
+ "Major mode for editing C# code.
The mode provides fontification and indent for C# syntax, as well
as some other handy features.
@@ -4212,15 +4203,15 @@ To run your own logic after csharp-mode starts, do this:
The function above is just a suggestion.
-IMenu Integraiton
+Imenu Integration
===============================
-Check the menubar for menu entries for Imenu; It is labelled
+Check the menubar for menu entries for Imenu; it is labelled
\"Index\".
The Imenu index gets computed when the file is .cs first opened and loaded.
This may take a moment or two. If you don't like this delay and don't
-use imenu, you can turn this off with the variable `csharp-want-imenu'.
+use Imenu, you can turn this off with the variable `csharp-want-imenu'.
@@ -4282,25 +4273,22 @@ Key bindings:
;; so I put it afterwards to make it stick.
(make-local-variable 'paragraph-separate)
- ;;(message "C#: set paragraph-separate")
-
;; Speedbar handling
- (if (fboundp 'speedbar-add-supported-extension)
- (speedbar-add-supported-extension '(".cs"))) ;; idempotent
+ (when (fboundp 'speedbar-add-supported-extension)
+ (speedbar-add-supported-extension '(".cs"))) ;; idempotent
(c-update-modeline)
;; maybe do imenu scan after hook returns
- (if csharp-want-imenu
- (progn
- ;; There are two ways to do imenu indexing. One is to provide a
- ;; function, via `imenu-create-index-function'. The other is to
- ;; provide imenu with a list of regexps via
- ;; `imenu-generic-expression'; imenu will do a "generic scan" for you.
- ;; csharp-mode uses the former method.
- ;;
- (setq imenu-create-index-function 'csharp-imenu-create-index)
- (imenu-add-menubar-index)))
+ (when csharp-want-imenu
+ ;; There are two ways to do imenu indexing. One is to provide a
+ ;; function, via `imenu-create-index-function'. The other is to
+ ;; provide imenu with a list of regexps via
+ ;; `imenu-generic-expression'; imenu will do a "generic scan" for you.
+ ;; csharp-mode uses the former method.
+
+ (setq imenu-create-index-function 'csharp-imenu-create-index)
+ (imenu-add-menubar-index))
;; The paragraph-separate variable was getting stomped by
;; other hooks, so it must reside here.
@@ -4308,7 +4296,7 @@ Key bindings:
"[ \t]*\\(//+\\|\\**\\)\\([ \t]+\\|[ \t]+<.+?>\\)$\\|^\f")
(setq beginning-of-defun-function 'csharp-move-back-to-beginning-of-defun)
- ;; end-of-defun-function can remain forward-sexp !!
+ ;; `end-of-defun-function' can remain forward-sexp !!
(set (make-local-variable 'comment-auto-fill-only-comments) t))
- [elpa] externals/csharp-mode 6289cfd 051/459: Fix broken byte-compile., (continued)
- [elpa] externals/csharp-mode 6289cfd 051/459: Fix broken byte-compile., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1f2fc21 055/459: Remove obsolete workarounds from README., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode d7ba765 063/459: Merge changes from devel., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ed628e6 075/459: Attempt fix compilation-mode regexps for both xbuild & msbuild., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3c2f942 087/459: Merge pull request #34 from binki/master, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 31eebb9 079/459: create separate compilation regexps for xbuild, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 42ca773 097/459: Fix runtime warnings about obsolete Emacs-functions., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0779fe4 107/459: Update changelog., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1f0465b 126/459: Fix comments, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6efd459 127/459: Stylistic fixes, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3b54997 130/459: Merge pull request #55 from josteink/derive-from-prog-mode,
ELPA Syncer <=
- [elpa] externals/csharp-mode a553430 146/459: Merge pull request #66 from shoover/explicit-interface-property, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 157299a 013/459: Update TFS module., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3651a40 119/459: Use cl-lib equivalent, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 91fff08 124/459: Fontify conversion operators definitions. Fontify base interfaces names for 'interface' and 'struct' declarations., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 9e78a26 128/459: Derive from prog-mode, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6e3cdc1 129/459: Add a regression test, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0a61f21 131/459: Bump version., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f367ef6 135/459: Cleanup test-code for imenu-fixes., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8ec64b4 136/459: Merge pull request #57 from josteink/imenu-fixes, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8c5bae2 139/459: Fixup, ELPA Syncer, 2021/08/22