GNU bug report logs - #32307
[feature request] Add standard hooks to toggle common features

Previous Next

Package: emacs;

Reported by: Fu Yuan <casouri <at> gmail.com>

Date: Mon, 30 Jul 2018 00:53:01 UTC

Severity: wishlist

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32307 in the body.
You can then email your comments to 32307 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32307; Package emacs. (Mon, 30 Jul 2018 00:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Fu Yuan <casouri <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 30 Jul 2018 00:53:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Fu Yuan <casouri <at> gmail.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: [feature request] Add standard hooks to toggle common features
Date: Mon, 30 Jul 2018 00:52:14 +0000 (UTC)
[Message part 1 (text/plain, inline)]
  
  


  
  
  
    
    	
    	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 commandfor __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 happybecause 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 functionin 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
    
  
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32307; Package emacs. (Sat, 13 Jul 2019 03:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 32307 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Fu Yuan <casouri <at> gmail.com>
Cc: 32307 <at> debbugs.gnu.org
Subject: Re: bug#32307: [feature request] Add standard hooks to toggle
 common features
Date: Sat, 13 Jul 2019 05:15:17 +0200
Fu Yuan <casouri <at> 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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 13 Jul 2019 03:16:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32307; Package emacs. (Fri, 27 Sep 2019 16:36:02 GMT) Full text and rfc822 format available.

Message #13 received at 32307 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Fu Yuan <casouri <at> gmail.com>
Cc: 32307 <at> debbugs.gnu.org
Subject: Re: bug#32307: [feature request] Add standard hooks to toggle
 common features
Date: Fri, 27 Sep 2019 18:35:28 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

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

More information was requested, but no response was given within a few
months, so I'm closing this bug report.  If the problem still exists,
please reopen this bug report.

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




bug closed, send any further explanations to 32307 <at> debbugs.gnu.org and Fu Yuan <casouri <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 27 Sep 2019 16:36:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 26 Oct 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.