unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Vivien Kraus via Bug reports for GNU Guix <bug-guix@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 51869@debbugs.gnu.org
Subject: bug#51869: [PATCH] Add emacs-vala-mode
Date: Mon, 15 Nov 2021 20:48:21 +0000	[thread overview]
Message-ID: <878rxp3yuk.fsf@planete-kraus.eu> (raw)
In-Reply-To: <93b000a9d4d893e23e7b55d306aa385eeca19c78.camel@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1380 bytes --]

Hi!

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
>> 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?
> Given my superior knowledge of Emacs Lisp (just kidding), I'd guess the
> order of declarations is wrong.  Pull the defcustom before the other
> thing and it ought to work.
Unfortunately, it does not. I tried it, but it gives the same error
message. I’m a bit surprised, but reading the help entry for
c-lang-defconst, I see there is a lot of information about when things
are evaluated, so maybe someone smart can parse it and understand why we
can’t use the custom variable value.

>> +   (version "20201218.2109")
>> +   (source
>> +    (origin
>> +      (method git-fetch)
>> +      (uri (git-reference
>> +            (url "https://github.com/rrthomas/vala-mode.git")
>> +            (commit "d696a8177e94c81ea557ad364a3b3dcc3abbc50f")))
> Use the (let ((revision ...) (commit ...)) (package ...)) convention,
> adding a note that upstream has no tagged release.  Base version
> appears to be "0.1"
I didn’t know that convention, so here is the updated patch, still
waiting for a convincing fix for the multiline strings issue.

Vivien


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Emacs vala mode, with packaging convention --]
[-- Type: text/x-patch, Size: 4610 bytes --]

From 2912a84d86372cac6944f7661a028b108484c556 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                    | 29 +++++++++++
 .../patches/emacs-vala-mode-fix.patch         | 48 +++++++++++++++++++
 3 files changed, 78 insertions(+)
 create mode 100644 gnu/packages/patches/emacs-vala-mode-fix.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5b21a6ee1b..4a73e7cee1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1033,6 +1033,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/emacs-source-date-epoch.patch		\
   %D%/packages/patches/emacs-telega-path-placeholder.patch	\
   %D%/packages/patches/emacs-telega-test-env.patch		\
+  %D%/packages/patches/emacs-vala-mode-fix.patch		\
   %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch	\
   %D%/packages/patches/enjarify-setup-py.patch			\
   %D%/packages/patches/enlightenment-fix-setuid-path.patch	\
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index ec0376442b..ff42b4d4d6 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -29989,3 +29989,32 @@ (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
+  ;; Upstream has no tagged release.
+  (let ((commit "d696a8177e94c81ea557ad364a3b3dcc3abbc50f")
+        (revision "0"))
+    (package
+      (name "emacs-vala-mode")
+      (version (git-version "0.1" revision commit))
+      (home-page "https://github.com/rrthomas/vala-mode")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url home-page)
+               (commit commit)))
+         (sha256
+          (base32 "0g5pdq757z9d8rk489n5ilhqipdc4i4sfkjwwrxyvgjlapjc04c0"))
+         (patches
+          (search-patches "emacs-vala-mode-fix.patch"))))
+      (build-system emacs-build-system)
+      (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/emacs-vala-mode-fix.patch b/gnu/packages/patches/emacs-vala-mode-fix.patch
new file mode 100644
index 0000000000..0a50b0e362
--- /dev/null
+++ b/gnu/packages/patches/emacs-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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

  reply	other threads:[~2021-11-15 21:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 14:05 bug#51869: [PATCH] Add emacs-vala-mode Vivien Kraus via Bug reports for GNU Guix
2021-11-15 19:42 ` Liliana Marie Prikler
2021-11-15 20:48   ` Vivien Kraus via Bug reports for GNU Guix [this message]
2021-11-16 17:49     ` Liliana Marie Prikler
2021-11-16 18:12       ` Vivien Kraus via Bug reports for GNU Guix
2021-11-16 19:41         ` Liliana Marie Prikler
2021-11-16 19:48           ` Vivien Kraus via Bug reports for GNU Guix
2021-11-17 17:09             ` Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rxp3yuk.fsf@planete-kraus.eu \
    --to=bug-guix@gnu.org \
    --cc=51869@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=vivien@planete-kraus.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).