Liliana Marie Prikler <liliana.prik...@gmail.com> writes:
> Please avoid pulling home-page up, it's not meant to be used as
> git-reference url.
OK.

>> +               (emacs-substitute-sexps "vala-mode.el"
>> +                 (";; Support multiline strings" 'disabled.)
>> +                 ("(defcustom vala-multiline-strings nil"
>> +                  "This variable is ignored.")))))))
> This inserts mostly bogus into the file rather than killing the sexps
> as it should.  

The first substitution fully kills the whole sexp (and inserts a comment
that reads "Support for multiline strings disabled." if you don’t read
too closely ^^). It’s true that the second does not kill the defcustom
expansion, but since it’s part of the intended public API, I’m not so
sure we should remove it altogether. I think it’s clearer for the user
that way, because the two modifications are kind of documented in the
source.

Also, it’s shorter.

Anyway, Here are the two versions, you decide.

Vivien

From c0726be413991eab7b16ca0bebf42cc8eab616e1 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <viv...@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/emacs-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 113471ae14..61d780c72b 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -29993,3 +29993,40 @@ (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))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/rrthomas/vala-mode";)
+               (commit commit)))
+         (sha256
+          (base32 "0g5pdq757z9d8rk489n5ilhqipdc4i4sfkjwwrxyvgjlapjc04c0"))))
+      (build-system emacs-build-system)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'disable-multiline-support
+             (lambda* (#:key inputs #:allow-other-keys)
+               (make-file-writable "vala-mode.el")
+               (emacs-substitute-sexps "vala-mode.el"
+                 (";; Support multiline strings" 'disabled.)
+                 ("(defcustom vala-multiline-strings nil"
+                  "This variable is ignored.")))))))
+      (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+))))
-- 
2.33.1

From f1d594081881e42a273dfd0d857f0af41615270d Mon Sep 17 00:00:00 2001
From: Vivien Kraus <viv...@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/emacs-xyz.scm | 43 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 113471ae14..9be6a306e1 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -29993,3 +29993,46 @@ (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))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/rrthomas/vala-mode";)
+               (commit commit)))
+         (sha256
+          (base32 "0g5pdq757z9d8rk489n5ilhqipdc4i4sfkjwwrxyvgjlapjc04c0"))))
+      (build-system emacs-build-system)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'disable-multiline-support
+             (lambda* (#:key inputs #:allow-other-keys)
+               (make-file-writable "vala-mode.el")
+               (emacs-batch-edit-file "vala-mode.el"
+                 '(progn
+                   (goto-char (point-min))
+                   (re-search-forward ";; Support multiline strings")
+                   (move-beginning-of-line 1)
+                   (kill-sexp)
+                   (re-search-forward "vala-multiline-strings")
+                   (backward-up-list)
+                   (kill-sexp)
+                   (basic-save-buffer))))))))
+      (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+))))
-- 
2.33.1

Attachment: signature.asc
Description: PGP signature

Reply via email to