From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thibaut Verron Newsgroups: gmane.emacs.devel Subject: Re: A TAB operation reform question. Date: Tue, 11 Oct 2022 11:15:05 +0200 Message-ID: <33111b02-476b-f2ff-33dc-4460ade2532d@gmail.com> References: <87tu4blmf0.fsf@laptop.lockywolf.net> <87bkqjz0rj.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29507"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 11 11:21:26 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oiBS1-0007YK-Rj for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 11:21:25 +0200 Original-Received: from localhost ([::1]:46436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiBS0-0003U5-DU for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 05:21:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiBM4-0000mj-Vm for emacs-devel@gnu.org; Tue, 11 Oct 2022 05:15:17 -0400 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:53962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oiBLz-00061R-UE for emacs-devel@gnu.org; Tue, 11 Oct 2022 05:15:16 -0400 Original-Received: by mail-wm1-x336.google.com with SMTP id e18so8184502wmq.3 for ; Tue, 11 Oct 2022 02:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Z6giMqqm0NIgu79jFfAiPAJJpLlC6x48H6znxvfe6L8=; b=o+3oEiF45VPB1ep5mqhrk/cSoB5DxQRZ3Ny5XikqWe0ReJvxca0Y+5rJ3WPTf4Aw/D W/uq0eX11iIRUMTxmPcnSCZgBSZMZCqSegIuP19B7IzSRnVH20CPX2UOtuoCaMAhtPr9 n6imCWXVcQ2feZDe+yQsaDUFezS3DltfgqP+b9iRufPedppH+MBJwq+AVR9bOsEO8cO9 z+3dXeGRaMOKGaZh82KHQ7bTTtfPpo+OuymZD8rbCfN11msEHkfagZw4dVXilfwER46K NWUPnyAPajwiaC8guOIc5Moxu4NJKGyobmMoGEwSknEh0wZeykj2VoGsmdV1kC3NUmZG v0IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z6giMqqm0NIgu79jFfAiPAJJpLlC6x48H6znxvfe6L8=; b=v1YCfzWjaEHXRhAGa+NovcglKq982gKq8lBGbvJW2c8YX3YzwHNPq3F//2ooDbsXwU XtK1dvVnF2nlIGtsW6sI5zvTptY8iNBOvKE3oNRax/tHsWLs7lqpSPvg1MVit9hMOfB4 Xjx4gGRmTImAqLrIfnse/dfc98T7I+2neH33MLq3YTuuM3daAni3bOBbsP40wGUNZySw SkZO+hyszxOKejEGTybWDy+T8k1iKjSF0Mm92OaYHIqAH5xLJc5UbpYmZ4rfOucamwaw Obe9N26dDo4oBSofhFuVNxlxHE/8xqWKOMGhm4BYhiFlahqJ407UddWbBSr3U4ejPbdx Hwmw== X-Gm-Message-State: ACrzQf3ZRMfVmZFb3sdnMqGJn9jZo7UjnRPk98ZgRoSD4VwTsf9s/ByR 0r7h8V9fO6cUXK2U4q7hmRNBz94uAIw= X-Google-Smtp-Source: AMsMyM72k3jnIhgnj5koaxH4404mEa32y+Jzn1rqIvEr11HhADe48pI2FKgkHplD7UPiKoe23QOHZQ== X-Received: by 2002:a1c:27c6:0:b0:3c2:e6df:c79b with SMTP id n189-20020a1c27c6000000b003c2e6dfc79bmr14310107wmn.14.1665479707483; Tue, 11 Oct 2022 02:15:07 -0700 (PDT) Original-Received: from ?IPV6:2001:628:2010:4094:442e:194c:e1be:9e66? ([2001:628:2010:4094:442e:194c:e1be:9e66]) by smtp.gmail.com with ESMTPSA id o18-20020a1c7512000000b003b492753826sm12002565wmc.43.2022.10.11.02.15.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Oct 2022 02:15:06 -0700 (PDT) Content-Language: en-US In-Reply-To: <87bkqjz0rj.fsf@dataswamp.org> Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=thibaut.verron@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-2.007, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297463 Archived-At: 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