bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in


From: Dmitry Gutov
Subject: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes
Date: Thu, 5 Dec 2019 22:44:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 05.12.2019 21:14, Alan Mackenzie wrote:

On Wed, Dec 04, 2019 at 23:04:27 +0200, Dmitry Gutov wrote:
On 04.12.2019 22:41, Alan Mackenzie wrote:
+(defvar c--unsafe-post-self-insert-hook-functions
+  '(smie-blink-matching-open
+    electric-pair-post-self-insert-function
+    blink-paren-post-self-insert-function
+    electric-indent-post-self-insert-function
+    electric-layout-post-self-insert-function
+    electric-quote-post-self-insert-function)
+    "Known unsafe functions when members of `post-self-insert-hook' in CC 
Mode")

I don't see how filtering out a bunch of popular consumers of
post-self-insert-hook can make it "act as per its contract again".

Think of it more as "filtering in" all functions on
post-self-insert-hook _except_ the ones mentioned, which are harmful in
CC Mode.

blink-paren is harmful for CC Mode? Or is it reimplemented, like other features (e.g. electric-*), inside CC Mode?

In the latter case, I think CC Mode should just disable the respective minor modes/variables locally and call it a day (the hook won't be used them, so no need for filtering).

Of course, ideally users of recent enough Emacs would be able to disable these built-in features and switch on the generic ones instead.





reply via email to

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