GNU bug report logs - #51869
[PATCH] Add emacs-vala-mode

Previous Next

Package: guix;

Reported by: Vivien Kraus <vivien <at> planete-kraus.eu>

Date: Mon, 15 Nov 2021 14:07:01 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51869 in the body.
You can then email your comments to 51869 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#51869; Package guix. (Mon, 15 Nov 2021 14:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vivien Kraus <vivien <at> planete-kraus.eu>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 15 Nov 2021 14:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: bug-guix <at> gnu.org
Subject: [PATCH] Add emacs-vala-mode
Date: Mon, 15 Nov 2021 14:05:46 +0000
[Message part 1 (text/plain, inline)]
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

[0001-gnu-Add-emacs-vala-mode.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#51869; Package guix. (Mon, 15 Nov 2021 19:43:01 GMT) Full text and rfc822 format available.

Message #8 received at 51869 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Vivien Kraus <vivien <at> planete-kraus.eu>, 51869 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add emacs-vala-mode
Date: Mon, 15 Nov 2021 20:42:16 +0100
Hi Vivien,

Am Montag, den 15.11.2021, 14:05 +0000 schrieb Vivien Kraus:
> Dear guix,
> 
> There’s a vala mode for emacs. It is not very useful
I'd beg to differ.  Not opening Vala files in fundamental-mode is very
useful.

> The project is not very well maintained
I've experienced the same.  I previously used the melpa importer, so as
to not pollute upstream with it, but given that a patch is needed, we
might as well add it properly.

> 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.

> +   (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"

Cheers





Information forwarded to bug-guix <at> gnu.org:
bug#51869; Package guix. (Mon, 15 Nov 2021 21:16:01 GMT) Full text and rfc822 format available.

Message #11 received at 51869 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 51869 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add emacs-vala-mode
Date: Mon, 15 Nov 2021 20:48:21 +0000
[Message part 1 (text/plain, inline)]
Hi!

Liliana Marie Prikler <liliana.prikler <at> 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

[0001-gnu-Add-emacs-vala-mode.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#51869; Package guix. (Tue, 16 Nov 2021 17:50:01 GMT) Full text and rfc822 format available.

Message #14 received at 51869 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Vivien Kraus <vivien <at> planete-kraus.eu>
Cc: 51869 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add emacs-vala-mode
Date: Tue, 16 Nov 2021 18:49:26 +0100
Hi,

Am Montag, den 15.11.2021, 20:48 +0000 schrieb Vivien Kraus:
> Liliana Marie Prikler <liliana.prikler <at> 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.
I investigated further and the thing at hand (multiline string support)
is currently buggy in CC-Mode anyway.  There are plans to support all
kinds of multiline strings with a new API in an upcoming version,
however vala-mode is not yet written with that in mind.  Given this
knowledge, I'd second your decision to disable multiline strings for
now.

> > > +   (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.
I'd use our emacs sexp substitution tools to erase these defconsts and
defcustoms rather than a patch.  Other than that LGTM.

Cheers





Information forwarded to bug-guix <at> gnu.org:
bug#51869; Package guix. (Tue, 16 Nov 2021 18:18:02 GMT) Full text and rfc822 format available.

Message #17 received at 51869 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 51869 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add emacs-vala-mode
Date: Tue, 16 Nov 2021 18:12:41 +0000
[Message part 1 (text/plain, inline)]
Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:
> I'd use our emacs sexp substitution tools to erase these defconsts and
> defcustoms rather than a patch.  Other than that LGTM.

I didn’t know about this great macro! Here is an updated version.

Vivien

[0001-gnu-Add-emacs-vala-mode.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#51869; Package guix. (Tue, 16 Nov 2021 19:42:02 GMT) Full text and rfc822 format available.

Message #20 received at 51869 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Vivien Kraus <vivien <at> planete-kraus.eu>
Cc: 51869 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add emacs-vala-mode
Date: Tue, 16 Nov 2021 20:41:13 +0100
Hi,

Am Dienstag, den 16.11.2021, 18:12 +0000 schrieb Vivien Kraus:
> +      (home-page "https://github.com/rrthomas/vala-mode")
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url home-page)
> +               (commit commit)))
Sorry, I didn't look close enough.  Please avoid pulling home-page up,
it's not meant to be used as git-reference url.

> +               (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 payload for just killing the entire sexp which
starts with leading-regexp would be (if I constructed this correctly,
untested):
    
    (progn (goto-char (point-min))
           (re-search-forward ,leading-regexp)
           (goto-char (match-beginning 0))
           (kill-sexp))

Don't forget to basic-save-buffer :)

Cheers





Information forwarded to bug-guix <at> gnu.org:
bug#51869; Package guix. (Tue, 16 Nov 2021 20:13:02 GMT) Full text and rfc822 format available.

Message #23 received at 51869 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 51869 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add emacs-vala-mode
Date: Tue, 16 Nov 2021 19:48:32 +0000
[Message part 1 (text/plain, inline)]
Liliana Marie Prikler <liliana.prikler <at> 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

[0001-gnu-Add-emacs-vala-mode-substitute-sexps.patch (text/x-patch, attachment)]
[0001-gnu-Add-emacs-vala-mode-batch-edit.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Reply sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
You have taken responsibility. (Wed, 17 Nov 2021 17:11:01 GMT) Full text and rfc822 format available.

Notification sent to Vivien Kraus <vivien <at> planete-kraus.eu>:
bug acknowledged by developer. (Wed, 17 Nov 2021 17:11:01 GMT) Full text and rfc822 format available.

Message #28 received at 51869-done <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Vivien Kraus <vivien <at> planete-kraus.eu>
Cc: 51869-done <at> debbugs.gnu.org
Subject: Re: [PATCH] Add emacs-vala-mode
Date: Wed, 17 Nov 2021 18:09:53 +0100
Hi,

Am Dienstag, den 16.11.2021, 19:48 +0000 schrieb Vivien Kraus:
> > > +               (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 ^^). 
That was too sneaky for me :P

> 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.
I'm pretty sure you can still use vala-multiline-strings inside a
custom-set-variables form, it will just do nothing as it ought to.  

> Anyway, Here are the two versions, you decide.
I rewrote your batch-edit version to be a little clearer and to leave
documented FIXMEs in the code.  I pushed the rewrite, so you should now
be able to use emacs-vala-mode, with or without lsp.

Cheers





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 16 Dec 2021 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 93 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.