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

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

bug#32307: [feature request] Add standard hooks to toggle common feature


From: Fu Yuan
Subject: bug#32307: [feature request] Add standard hooks to toggle common features
Date: Mon, 30 Jul 2018 00:52:14 +0000 (UTC)

By "standard features" I mean line numbering, format on save, auto-parens, etc.

The current situation have these downsides:

1. complexity in configuration.

Some of the packages that provide these features also provide toggling command,
e.g. toggle-line-number or autoparens-mode.
However, some __are not__, e.g. format on save.
Toggling such feature requires users to implement their own commands.
What's worse, they need to implement a toggling command
for __each and every__ language.

2. problem when other package needs to toggle

For example, I wrote a package that needs to temporarily disable auto-parens.
I have to write code that handles electric-pair-mode, autoparens and paredit.
Further more, byte compiler is not happy
because I was referring functions it doesn't know about.

Here is my thought about it:

Provide toggle commands and corresponding hook for each of these features.
Feature providers add their toggle function to the proper hook.
When user toggles on/off, the toggle command runs each function
in the hook with an aregument indicating that user is turning on or turning off,
maybe t and nil.

How do you think? Have there been similar discussions?



Sincerely, Yuan

reply via email to

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