From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vladimir Nikishkin Newsgroups: gmane.emacs.help Subject: A TAB operation reform question. Date: Mon, 10 Oct 2022 23:03:00 +0800 Message-ID: <87tu4blmf0.fsf@laptop.lockywolf.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28095"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.6; emacs 29.0.50 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 10 17:46:54 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ohuzU-000762-23 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 Oct 2022 17:46:52 +0200 Original-Received: from localhost ([::1]:47438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohuzS-00078w-TT for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 Oct 2022 11:46:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohuqu-0002lS-Df for help-gnu-emacs@gnu.org; Mon, 10 Oct 2022 11:38:00 -0400 Original-Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:44886) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohuqr-0000DG-B8 for help-gnu-emacs@gnu.org; Mon, 10 Oct 2022 11:37:59 -0400 Original-Received: by mail-pj1-x102e.google.com with SMTP id t10-20020a17090a4e4a00b0020af4bcae10so10623146pjl.3 for ; Mon, 10 Oct 2022 08:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=aJO53+Lzuym0WA5arTr0aYylFT73TNFZAIZ+4MJIR74=; b=i89d/cp+6hibq6xzXcjuEK6tNbrXP+roIAu2yN5OJhcA8PUWYBgO12FZcJDDhO4lJe aIgJ6eCwqHtbmxMa7HH+U8jQOTW8qtOx6/5QeKM+o9y9Y/uKnyg96B6NZkYx/JskETRI Ww7n8YBRCohBlLFs8BBAf1XR/qD7j1bJ9Gp/ZOA0WtFDM9gvo38IfFX6gi9otUW6V9oM /Bfpd515eRtpcGwp7Cz5LRm4GLyH0u7H6QshfyU6ZK8TYvDNKf8dEu5/0H4tWYsOxczf gU+YicqaQFeCzpqYQvMc4VvUod/QCEo0jjaB/k/UKewbfdJqD1Gm6IwIPInOZpzTy+ny 35XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aJO53+Lzuym0WA5arTr0aYylFT73TNFZAIZ+4MJIR74=; b=JuHrSDwUvsnQ48sUcQg3sKqCGULiV9NdgUvLyKl6jmAB82P11in/t3bZTZQfwvVOrs vddKOVGNu4QEDyJ+/rvj+1P2Bj6xVzHM9HZ2T4ZufxAaOU/7w34JAtpuwOJyVESJ1uYq /r0lL+i16C6yMbYcjOZo7hf3Dp3fpnIM8Grs/3rQ8IizFJg600VqcKn8BNzbcOcR7UJ0 /iXp+XUyf1Z9xd/gddSNsTkt3INROjacL7uvrDgNHsv43RtMsDjTAcdYoYns8dCnW4RK N9OExpEe09K/+Lp0hQXHhiVFwn9EI7Zn4mgJCchb5Yc0uoRbv7XBYm77xh56FNGpLFzY h6RA== X-Gm-Message-State: ACrzQf2A3DgaP3uKS9KeFuY1YnTQCmZQtOV29GQDwJWvRVLNyfytKI/Y WFEwCZrLEgFqSKjnLTuLuEdoNEkoWnME9Q== X-Google-Smtp-Source: AMsMyM65H53BpkUhPB+JtUeoXbHkaqhbNXWHHL4c5NY4KzWcJ3lq15eYW4gNBgmx9rHVGgyoqm9THQ== X-Received: by 2002:a17:902:bf08:b0:178:90fb:8cda with SMTP id bi8-20020a170902bf0800b0017890fb8cdamr19753308plb.9.1665416275113; Mon, 10 Oct 2022 08:37:55 -0700 (PDT) Original-Received: from laptop.lockywolf.net ([2001:470:24:315::102]) by smtp.gmail.com with ESMTPSA id o67-20020a625a46000000b005628a30a500sm7063413pfb.41.2022.10.10.08.37.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 08:37:54 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=lockywolf@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139796 Archived-At: Hello, Emacs users and developers I would like to ask if a reform to the way TAB (C-i) works has been considered? And if "yes", then how hard would it be to implement it? The motivation is the following: The way TAB works at the moment is peculiar. There is this "indent-for-tab-command", which either indents, or inserts a tab-character, or completes... unless "tab-always-indent" is set to some special value, but there are mode-specific modename-tab-always-indent, but they are also sometimes ignored. Also, org-mode overrides it with "org-cycle", and perhaps, other modes do too. Also, "tab" is considered to be "the place somehow close to completion functions", so M-C-i==M-TAB is "ispell-complete-word", and a lot of other packages try to make their completion somehow close to TAB. This looks a bit like a mess, partly because TAB is almost universally seen as a "dwim" entry point, but it is not officially so in Emacs. Could there be an alternative protocol? Could TAB be make a DWIM entry point "officially"? 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, thus making "c-tab-always-indent" unnecessary. If tab-always-inserts-tab is set to nil, TAB (for example) would be looking in some customizable list of functions, say "tab-dwim-list-functions", and run each function until some does not return non-nil. The default list could be something like (indent-if-possible indent-comment-if-possible hs-fold-if-possible complete-if-possible insert-tab). Using TAB with a prefix-argument would always insert a TAB. (which would be an exception to the rule "default prefix argument is 4", but I think it would be understandable.). This way, instead of rebinding tab to org-cycle, org-mode could prepend "org-cycle" to this list, or make it the only member of the list, but this would still allow the users to plug in custom dwim functions further into the list, such as ispell-word (not completion), jump between table cells, and such. -- Your sincerely, Vladimir Nikishkin (MiEr, lockywolf) (Laptop)