ada-mode-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SPAM UNSURE] Re: [SPAM UNSURE] Re: AdaCore Ada_Language_Server via


From: Stephen Leake
Subject: Re: [SPAM UNSURE] Re: [SPAM UNSURE] Re: AdaCore Ada_Language_Server via eglot
Date: Sun, 27 Mar 2022 19:51:18 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt)

Troy Brown <brownts@troybrown.dev> writes:

> Most of the skeletons can just be avoided by not using their key binding to
> trigger them.  The one exception to this is during new file creation.  I've
> disabled that functionality by setting both "ada-skel-initial-string" and
> "gpr-skel-initial-string" to nil.  I didn't really see another obvious way
> in which to completely disable this auto-inserted skeleton here.  So, I
> just disable it with this method and then use "autoinsert" and "yasnippet"
> instead.

Ok, that seems reasonable.

> One of the reasons for not wanting the defaults was to support
> corporate headers in newly created files.  In this case, the supplied
> defaults are not sufficient.  I did look at what it might take to add
> support for a different header and copyright notice, but seemed like I'd
> need to modify "ada-skel-initial-string", add new copyright skeleton,
> override "ada-skel-header" as desired, and update the
> "ada-skel-token-alist" defconst to add new selection to the
> "copyright_license" list.  And even after doing all of this, I'd still have
> to select a copyright from a list rather than just auto-inserting the
> corporate one.  If I just wanted to insert the corporate header
> automatically I could have completely reworked these skeletons, but I
> didn't really want to keep crawling around inside of ada-mode and having to
> rework those parts, and instead thought it was easier to just disable them
> and use yasnippet instead.  Additionally, it seems the skeletons require
> the user to manually expand whereas the yasnippet would autoexpand.
> Anyway, the path of least resistance in my case seemed easier to just
> abandon the supplied skeletons in favor of a different approach.

This is definitely a good use case; it should be easier to change the
skeleton inserted in a newly created file. I'll put that on my list.

> I did run into a compatibility issue with "autoinsert" when used in an
> environment with a newer ada-mode.  From some investigation that I had done
> previously, it seemed like ada-mode used to use "autoinsert" with its
> skeletons, but at some point changed away from using "autoinsert".
> However, there is still an entry in "auto-insert-alist" which references
> ada-mode, and specifically an "ada-header" function.  This function no
> longer exists in newer versions of ada-mode.  This was a compatibility
> issue between the old version of ada-mode and the newer version and I'm not
> sure there was an easy way to fix it in Emacs versions prior to Emacs 27
> (where the old version ada-mode was still being shipped in the base
> installation).  Since Emacs 27, it's probably considered a bug at this
> point and likely should be fixed in the current version of autoinsert.el to
> remove this entry from "auto-insert-alist".

I'll look into this.

> An additional reason why I'd prefer a slimmed down ada-mode is because I
> don't like having to rebuild the parser each time I install a new version
> of the package.  Especially in a corporate environment where I'd likely
> have to obtain all of the necessary packages and then install autotools (or
> MSYS2 or Cygwin on a PC), these can be undesirable barriers to have to jump
> over.  Oftentimes I'll update all of my Emacs packages except for ada-mode
> because I don't want to have to go pull out my instructions I created for
> rebuilding it.

Yes, I get a lot of complaints about this.

I think the only solution is for someone (probably me, sigh) to provide
a download site with pre-built executables for various platforms.

What platform do you need, and would this work for you? Some corporate
environments forbid installing downloaded executables.

-- 
-- Stephe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]