Vivien Kraus wrote 3 years ago
(address . bug-guix@gnu.org)
Dear guix,
There’s a vala mode for emacs. It is not very useful, but it registers a
major mode that is then used as a placeholder for the Emacs Language
Server Protocol client. In fact, it’s not possible to activate Vala
support for LSP on emacs without a vala mode, and this is the only
implementation I know.
This is the result of importing from MELPA. The project is not very well
maintained, so it fails to build on a recent emacs (see
https://github.com/rrthomas/vala-mode/issues/14).Since I don’t have a
solution to fix this issue, I went away and reverted the multiline
support. It builds and is useful enough for LSP to kick in, so I
consider it fixed.
What do you think? Do you have a better fix?
Best regards,
Vivien
From 7c382e721c74c319abadb65eb9f0942a7cfe24e1 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Mon, 15 Nov 2021 13:57:18 +0000
Subject: [PATCH] gnu: Add emacs-vala-mode.
* gnu/packages/emacs-xyz (emacs-vala-mode): New variable.
* gnu/packages/patches/vala-mode-fix.patch: Add a vala-mode patch to disable
multiline string support.
* gnu/local.mk (dist_patch_DATA): Register the patch to disable multiline
string support.
---
gnu/local.mk | 1 +
gnu/packages/emacs-xyz.scm | 25 ++++++++++++
gnu/packages/patches/vala-mode-fix.patch | 48 ++++++++++++++++++++++++
3 files changed, 74 insertions(+)
create mode 100644 gnu/packages/patches/vala-mode-fix.patch
Toggle diff (101 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 5b21a6ee1b..139325c10b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1886,6 +1886,7 @@ dist_patch_DATA = \
%D%/packages/patches/ustr-fix-build-with-gcc-5.patch \
%D%/packages/patches/util-linux-tests.patch \
%D%/packages/patches/upower-builddir.patch \
+ %D%/packages/patches/vala-mode-fix.patch \
%D%/packages/patches/valgrind-enable-arm.patch \
%D%/packages/patches/vboot-utils-fix-format-load-address.patch \
%D%/packages/patches/vboot-utils-fix-tests-show-contents.patch \
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index ec0376442b..ac15d412c5 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -29989,3 +29989,28 @@ (define-public emacs-global-tags
wraps GNU Global calls and integration to editor using this API with
project.el and xref.el.")
(license license:gpl3+))))
+
+(define-public emacs-vala-mode
+ (package
+ (name "emacs-vala-mode")
+ (version "20201218.2109")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rrthomas/vala-mode.git")
+ (commit "d696a8177e94c81ea557ad364a3b3dcc3abbc50f")))
+ (sha256
+ (base32 "0g5pdq757z9d8rk489n5ilhqipdc4i4sfkjwwrxyvgjlapjc04c0"))
+ (patches
+ (search-patches "vala-mode-fix.patch"))))
+ (build-system emacs-build-system)
+ (home-page "https://github.com/rrthomas/vala-mode")
+ (synopsis "Vala mode for Emacs")
+ (description
+ "This package provides a major mode for editing .vala and .vapi files in
+Emacs. See @url{http://live.gnome.org/Vala} for details about Vala language.
+
+This mode was based on Dylan Moonfire's @samp{csharp-mode}.
+")
+ (license license:gpl2+)))
diff --git a/gnu/packages/patches/vala-mode-fix.patch b/gnu/packages/patches/vala-mode-fix.patch
new file mode 100644
index 0000000000..0a50b0e362
--- /dev/null
+++ b/gnu/packages/patches/vala-mode-fix.patch
@@ -0,0 +1,48 @@
+From 68db3ae7410a7d89e606e1916240193b96ab335e Mon Sep 17 00:00:00 2001
+From: Vivien <vivien@pruneau.lan>
+Date: Mon, 15 Nov 2021 13:55:58 +0000
+Subject: [PATCH] Revert "vala-mode: support multiline strings"
+
+This reverts commit 671c287ba9cb81dcf6e9485e6ccc60bc2b7aba14.
+---
+ vala-mode.el | 17 -----------------
+ 1 file changed, 17 deletions(-)
+
+diff --git a/vala-mode.el b/vala-mode.el
+index 8c4da4c..22c6e49 100644
+--- a/vala-mode.el
++++ b/vala-mode.el
+@@ -259,14 +259,6 @@ casts and declarations are fontified. Used on level 2 and higher."
+ (c-lang-defconst c-opt-cpp-prefix
+ vala "\\s *#\\s *")
+
+-;; Support multiline strings
+-;;
+-;; FIXME: This allows any string to be multiline. Currently, c-mode only
+-;; supports a single-character prefix to denote a multiline string, so the
+-;; real fix will be harder.
+-(c-lang-defconst c-multiline-string-start-char
+- vala vala-multiline-strings)
+-
+ ;; Vala uses the following assignment operators
+ (c-lang-defconst c-assignment-operators
+ vala '("=" "*=" "/=" "%=" "+=" "-=" ">>=" "<<="
+@@ -428,15 +420,6 @@ casts and declarations are fontified. Used on level 2 and higher."
+ :type 'hook
+ :group 'c)
+
+-(defcustom vala-multiline-strings nil
+- "Whether to enable support for multiline strings.
+-
+-It can conflict with some other Emacs functionality, such as the
+-automatic insertion of closing quotes `electric-pair-mode'."
+- :type 'bool
+- :group 'vala)
+-
+-
+ ;;; The entry point into the mode
+ ;;;###autoload
+ (defun vala-mode ()
+--
+2.33.1
+
--
2.33.1
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCAAdFiEEq4yIHjMvkliPpwQnO7C8EjLYuCwFAmGSaToACgkQO7C8EjLY
uCz1AAwAndlr8i6KRkCD+9CK4Vb5FFVhdnyj9t8kQN0NYtX+Ov8PPab7imAj1pRV
NzBZ8Cfl6Az6n1bzpXb8cpaHL86JdRxXyejoBS7j9mGDMC6QAIbb8d5wb1o6AfnM
kwPs8BHsgtq5i4XnTvlmkAaXiLKmXhGaAHM9FOr5roukDuyvQ2sXUBdcAISGabRR
SLPVWjNMKqfgFcT1GhDNOQVyciHrxVzLVzKeGOJLrd8FmoaUfJm50SU496LMhPvC
lUMrltGst9byt/RW7n4U0OXjs2wkM3CV+oW0zEywWWAlt9bS6ODxXWbgsy25q/xf
XKy8HfaokU2DyPx/ox9dOURenYmwL9jdYpyupXCzP8QrCN1+J4Lks/+ZJTjgZSvA
jZyZ+hyfIgZ4fr28K0l3bQJbG76sD770HHZQQK51xK/2mvai6ux/nhT5kpzGoIJh
1KxXJmS0fn6iFP7r0EtC5lpv+nx5RO3lmBnV6GGbsRGkYeDSlTgYd9Ka7B/FwiAM
ntYTnMsg
=Zxjf
-----END PGP SIGNATURE-----