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

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

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


From: Troy Brown
Subject: Re: [SPAM UNSURE] Re: AdaCore Ada_Language_Server via eglot
Date: Sun, 27 Mar 2022 15:23:51 -0400

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.

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.

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

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.

On Sat, Mar 26, 2022 at 8:33 PM Stephen Leake <stephen_leake@stephe-leake.org> wrote:
> One of the reasons I ask is that I often find myself disabling/overriding
> some features of the current ada-mode (e.g., skeletons in favor of
> YASnippet, require-final-newline setting, etc.) or not using them at
> all.

I'd be open to providing more ada-mode flags to turn some things off
more easily. Can you show what you do here?

I guess only loading ada-skel if requested, or if some other skeleton
package is not provided, might be easy to support.


reply via email to

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