From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gustavo Barros Newsgroups: gmane.emacs.bugs Subject: bug#48058: tab-width's docstring Date: Tue, 27 Apr 2021 12:14:50 -0300 Message-ID: <87tunrkbdi.fsf@gmail.com> References: <87a6pj50u6.fsf@gmail.com> <83eeevj0kt.fsf@gnu.org> <87wnsnkcz1.fsf@gmail.com> <8335vbixea.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34268"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 27.2 Cc: 48058@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 27 17:22:12 2021 Return-path: Envelope-to: geb-bug-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 1lbPXQ-0008o7-FE for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Apr 2021 17:22:12 +0200 Original-Received: from localhost ([::1]:51306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbPXP-0008N6-HM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Apr 2021 11:22:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbPRX-0002HQ-AO for bug-gnu-emacs@gnu.org; Tue, 27 Apr 2021 11:16:19 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbPRS-0004gN-Bx for bug-gnu-emacs@gnu.org; Tue, 27 Apr 2021 11:16:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lbPRS-0005Nc-7l for bug-gnu-emacs@gnu.org; Tue, 27 Apr 2021 11:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gustavo Barros Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Apr 2021 15:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48058 X-GNU-PR-Package: emacs Original-Received: via spool by 48058-submit@debbugs.gnu.org id=B48058.161953650320549 (code B ref 48058); Tue, 27 Apr 2021 15:16:02 +0000 Original-Received: (at 48058) by debbugs.gnu.org; 27 Apr 2021 15:15:03 +0000 Original-Received: from localhost ([127.0.0.1]:50548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lbPQU-0005L8-9f for submit@debbugs.gnu.org; Tue, 27 Apr 2021 11:15:02 -0400 Original-Received: from mail-qv1-f51.google.com ([209.85.219.51]:35708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lbPQR-0005Kc-Li for 48058@debbugs.gnu.org; Tue, 27 Apr 2021 11:15:00 -0400 Original-Received: by mail-qv1-f51.google.com with SMTP id x27so29173949qvd.2 for <48058@debbugs.gnu.org>; Tue, 27 Apr 2021 08:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to :message-id:date:mime-version; bh=DD3OrSVxb85s0orJtqZxZGJn5oEkdFYJ2+X8ki/1Mxo=; b=RN9K3vxIt61epKj8l7xJSaQbmrAx8VIhJPn7f86RqDcGvw83wSyrNJFsIBPCoKC/X9 rx5RCeqDfoqczyXGG+0iWHC0IS6aMyL18XVQn2r5YxVUQAD66lCPEws/o7nS8m6jb2MT Bea3osJd6SWdNDznAdPt5RbytZlDbeDnCEgz+JoxPVpB6vYz0k8gyaHHMimyBE/nSce+ 4pjZv7CGWvF+UBGFaIBCP3bl2BThv6BMvFi75EoJHuDtuiZk3gT1uHNfZ0EejIkkWIKU JpV+irVgA7iBl7BuQ9vWu7sdoFjOkuX8GI+WMmG06YXLQubluVxHkqnt1dO83WL5qgzQ onrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=DD3OrSVxb85s0orJtqZxZGJn5oEkdFYJ2+X8ki/1Mxo=; b=SM+1BgdmwRIOLtE2yqKRotgvY/Das1TCJTnQVLnZZBVkFmKVkDzB02E1gZEuMq9vp1 MaZmYUJMzvTABZ4qcvuyE6iwTLlaMgboCGo1EW9RKTu2fSHctCvRu44kvGM3aqSl9a98 vRr0L047/i2g9JhmSgpIqUV59MPhIX+nymTG3psXg4fIOGwuV5YrEg20nG6JKzBWgVZY q6y8Pqd156eszTxnC9TNqMPbBG5dTqc+5iFz7Tdg0gBNEtMzBmch177QMAemhylsPQw+ zrqdLGA2okVlvYQ+B8FwdrdNL/EyDZw9IGm0VLspofrL05qKqjft6M+7YghH1ZbhQTYN zbnA== X-Gm-Message-State: AOAM533zf2Sdd/4fsaQe6PUlLPDSEBvTXQoMqPU0ZmJBVgkiVui4xegA dy15IbOWJDzvlawNgAIdArfD1YqXVAjKaw== X-Google-Smtp-Source: ABdhPJxBfAinEpZB4FfLUkjB9TKJ8AOFEqm3lHzdPuSz+wK8glsvUY6xax7a1Cc+x3rDUuhvLiwkFQ== X-Received: by 2002:ad4:4523:: with SMTP id l3mr8442395qvu.57.1619536493905; Tue, 27 Apr 2021 08:14:53 -0700 (PDT) Original-Received: from gusbrs-laptop ([212.102.61.109]) by smtp.gmail.com with ESMTPSA id 1sm2922877qka.52.2021.04.27.08.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 08:14:53 -0700 (PDT) In-reply-to: <8335vbixea.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205025 Archived-At: On Tue, 27 Apr 2021 at 12:02, Eli Zaretskii wrote: >> From: Gustavo Barros >> Cc: 48058@debbugs.gnu.org >> Date: Tue, 27 Apr 2021 11:40:18 -0300 >> >> Let's say `emacs-lisp-mode', and let's say I've `indent-tabs-mode' >> set >> to nil. Calling `tab-to-tab-stop' will actually insert 8 spaces in >> my >> buffer, as per the default `tab-width'. If `tab-always-indent' is >> nil, >> this also extends to `indent-for-tab-command'. There is no "TAB >> character" involved, and also no issue about what is its "display >> width". As far as I understand it, what `tab-width' is determining >> is >> precisely the "indentation step". Or am I getting this wrong? > > This is major mode dependent. Try the same in C mode, for example, > and you will see the difference. The function that indents the line > is specific to the major mode. If you want to understand why you see > what you see in emacs-lisp-mode, look at lisp-indent-line. > > But even in emacs-lisp-mode, what did you expect to happen instead? > (indent-tabs-mode, btw, just uses spaces instead of TABs, but it still > inserts the amount of spaces equivalent to a TAB where otherwise a TAB > would have been inserted.) I didn't expect anything different to happen. It is just that `tab-width' is determining more than just the "display width of the TAB character": if you (or the major-mode for you) are indenting with spaces the content of the buffer is different according to `tab-width', it not just a matter of "display". But I see your point, and perhaps the docstring is clearer to someone more seasoned than myself, and avoids other pitfalls along the way which I do not even see. Hopefully, it will feel just as clear to me someday. ;-) Thanks for answering, and feel free to close. Best regards, Gustavo.