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: Lars Ingebrigtsen
Subject: bug#32307: [feature request] Add standard hooks to toggle common features
Date: Sat, 13 Jul 2019 05:15:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Fu Yuan <casouri@gmail.com> writes:

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

You can use declare-function to tell the compiler about the functions.

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

I'm not quite sure I understand you here.  The vast majority of modes
can be called with an argument to turn them off or on.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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