all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thibaut Verron <thibaut.verron@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: A TAB operation reform question.
Date: Tue, 11 Oct 2022 11:15:05 +0200	[thread overview]
Message-ID: <33111b02-476b-f2ff-33dc-4460ade2532d@gmail.com> (raw)
In-Reply-To: <87bkqjz0rj.fsf@dataswamp.org>

On 11/10/2022 02:01, Emanuel Berg wrote:
> Vladimir Nikishkin wrote:
>
>> In particular, could it be possible to make a "hard-switch"
>> variable "tab-always-inserts-tab", which would be the
>> opposite of "tab-always-indent", but simpler, and it would
>> be possible to override it in the major modes
> Not following 100% what you intend to happen but you can write
> a function and bind it to some keystroke (start with some
> other key than TAB perhaps) and when it works the way you want
> bind it to TAB globally or locally.
If I understand correctly, the point of the suggested change is to give 
a straightforward way for packages to implement their wanted behavior at 
the tab key, all while making it easy for users to prevent a complete 
hijack of the key.

A user-side configuration, or even a third-party package (there are 
several) don't really help with that: packages cannot be build on that 
facility, and for the user, the effort has to be repeated for each 
hijacking package.


> The challenge will be to make it transparently always fall
> back to the original bahvior when your special behavior isn't
> desired ...

That part is actually easier with your suggestion: just don't bind the 
function when the default behavior is what is wanted.

If you mean falling back to the original behavior when the special 
behavior is not possible, that is a bit more tricky but still not 
impossible.

It seems that a "run-hook-until-success" kind of function like the OP 
suggests is a straightforward solution to both cases.

Best wishes,

Thibaut






  reply	other threads:[~2022-10-11  9:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 15:03 A TAB operation reform question Vladimir Nikishkin
2022-10-10 15:49 ` Christopher Dimech
2022-10-11  0:01 ` Emanuel Berg
2022-10-11  9:15   ` Thibaut Verron [this message]
2022-10-11 10:25     ` Emanuel Berg
2022-10-11  2:37 ` Fwd: " Vladimir Nikishkin
2022-10-11  6:15   ` Emanuel Berg
2022-10-11 12:54   ` Stefan Monnier
2022-10-11 12:59     ` Vladimir Nikishkin
2022-10-11 13:48       ` Stefan Monnier
2022-10-12  6:57         ` Ihor Radchenko

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

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

  git send-email \
    --in-reply-to=33111b02-476b-f2ff-33dc-4460ade2532d@gmail.com \
    --to=thibaut.verron@gmail.com \
    --cc=emacs-devel@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.