unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Fu Yuan <casouri@gmail.com>
To: 32307@debbugs.gnu.org
Subject: bug#32307: [feature request] Add standard hooks to toggle common features
Date: Mon, 30 Jul 2018 00:52:14 +0000 (UTC)	[thread overview]
Message-ID: <78B50EFACD052CCA.4A6DF615-D8E0-40FB-AF99-1698855A4EE9@mail.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]


  
  


  
  
  
    
    	
    	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
    
  

[-- Attachment #2: Type: text/html, Size: 7236 bytes --]

             reply	other threads:[~2018-07-30  0:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30  0:52 Fu Yuan [this message]
2019-07-13  3:15 ` bug#32307: [feature request] Add standard hooks to toggle common features Lars Ingebrigtsen
2019-09-27 16:35   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78B50EFACD052CCA.4A6DF615-D8E0-40FB-AF99-1698855A4EE9@mail.outlook.com \
    --to=casouri@gmail.com \
    --cc=32307@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).