Subject: bug#67207: closed (Re: bug#67207: [PATCH] Add elixir-ts-mode-hook to elixir-ts-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 18 Nov 2023 10:05:02 +0000

Your bug report

#67207: [PATCH] Add elixir-ts-mode-hook to elixir-ts-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
67207: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67207
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#67207: [PATCH] Add elixir-ts-mode-hook to elixir-ts-mode
From: Eli Zaretskii <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 18 Nov 2023 12:03:55 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Stefan Monnier <[email-masked]>
> Cc: Wilhelm Kirschbaum <[email-masked]>,  [email-masked]
> Date: Wed, 15 Nov 2023 17:53:52 -0500
> 
> > Stefan, does this mean define-derived-mode has some deficiency?
> > Many/most modes defined using it don't have an explicit hook
> > definition, so should we now define a mode hook for all of them?
> 
> Usually we don't have good ideas of `:options` to provide for hook
> variables, so it's not very useful to expose them to Custom.
> 
> Also, it's not rare for hook variables to be modified by other packages,
> which again votes in favor of not exposing them to Custom.
> 
> But some mode maintainers do like to expose them to Custom for their
> users' convenience.  Usually I look at it as a hint that there's
> something missing elsewhere (for the patch at hand, maybe some kind of
> `global-eglot-mode` would be a better answer in the longer term).
> 
> We could try and extend `define-derived-mode` to allow it to expose the
> hook to Custom, with `:options` and whatnot, but it doesn't seem worth
> the trouble since the maintainer can use a separate explicit `defcustom`
> instead, as the OP's patch does.

Thanks, I installed the change and added a comment regarding the
reasons.

Closing.

Subject: [PATCH] Add elixir-ts-mode-hook to elixir-ts-mode
From: Wilhelm Kirschbaum <[email-masked]>
To: [email-masked]
Date: Wed, 15 Nov 2023 20:32:42 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

This change was requested by a user and seems to be useful.

I am also trying the `submit-emacs-patch` command, so hope I am 
doing it
right. 

In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.18.0) of 2023-11-14 built on _
Repository revision: 3074f4cfc2efc5a1d75186ad44790a21cecda3d3
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --with-sound=yes --with-json --with-pgtk
 --with-native-compilation=aot --with-xwidgets --with-imagemagick
 --with-tree-sitter'
>From 2ce080a17b7e89d63fb22826a91b931f987d8cf2 Mon Sep 17 00:00:00 2001
From: Wilhelm H Kirschbaum <[email-masked]>
Date: Wed, 15 Nov 2023 20:13:02 +0200
Subject: [PATCH] Add elixir-ts-mode-hook to elixir-ts-mode

* lisp/progmodes/elixir-ts-mode.el
(elixir-ts-mode-hook): Make hook available to customize.
---
 lisp/progmodes/elixir-ts-mode.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el
index 05edb4159a1..ad7c599edb1 100644
--- a/lisp/progmodes/elixir-ts-mode.el
+++ b/lisp/progmodes/elixir-ts-mode.el
@@ -74,6 +74,13 @@ elixir-ts-indent-offset
   :safe 'integerp
   :group 'elixir-ts)
 
+(defcustom elixir-ts-mode-hook nil
+  "Hook run after entering `elixir-ts-mode'."
+  :type 'hook
+  :options '(eglot-ensure)
+  :group 'elixir-ts
+  :version "30.1")
+
 (defface elixir-ts-font-comment-doc-identifier-face
   '((t (:inherit font-lock-doc-face)))
   "Face used for @comment.doc tags in Elixir files.")
-- 
2.42.1