unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: David Caldwell <david@porkrind.org>
To: Stefan Kangas <stefan@marxist.se>, Lars Ingebrigtsen <larsi@gnus.org>
Cc: 22874@debbugs.gnu.org
Subject: bug#22874: 25.0.91; whitespace.el documentation looks incorrect
Date: Sat, 15 Aug 2020 11:40:13 -0700	[thread overview]
Message-ID: <a01894f7-143f-2096-6abb-e4e6ff385be0@porkrind.org> (raw)
In-Reply-To: <CADwFkmkb_KZXnCsOoZoXFx60Q0S=mc-dT6eFk8t4hH-qtzcFkw@mail.gmail.com>

Hi,

On 8/14/20 9:32 PM, Stefan Kangas wrote:
> tags 22874 + moreinfo
> thanks
> 
> Hi David,
> 
> Lars Ingebrigtsen <larsi@gnus.org> writes:
> 
>> David Caldwell <david@porkrind.org> writes:
>>
>>> Hello,
>>>
>>> M-x describe-variable RET whitespace-style RET
>>>
>>> says:
>>>
>>> [snip]
>>>
>>>    indentation::tab     8 or more SPACEs at beginning of line are
>>>                         visualized via faces.
>>>                         It has effect only if ‘face’ (see above)
>>>                         is present in ‘whitespace-style’.
>>>
>>>    indentation::space   TABs at beginning of line are visualized via
>>>                         faces.
>>>                         It has effect only if ‘face’ (see above)
>>>                         is present in ‘whitespace-style’.
>>
>> I tried to reproduce this bug with the following file:
>>
>> But with either
>>
>> (setq whitespace-style '(face indentation::tab))
>> (setq whitespace-style '(face indentation::space))
>>
>> and then `M-x whitespace-mode'
>>
>> just the lines with leading spaces were fontified.
>>
>> So this either doesn't seem to work at all, or I'm just doing it wrong.
>
> We seem to be needing more info to make any progress here.  Could you
> take a look at the above and explain the issue you are seeing?

I just tested it in Emacs 27.1 and they both seem to work exactly as
documented.

I was initially confused because why would setting `indentation::tab`
show spaces at the beginning of a line and why would
`indentation::space` show tabs? I thought they just got switched around
in the docs, but I guess maybe it's supposed to act like an assertion?
`indentation::space` means "I expect my file to be indented with spaces
so please highlight any stray tab indents", and `indentation::tab` means
"I expect my file to be indented with tabs so highlight any `tab-width`
long runs of spaces".

Bottom line: I'm wrong, my patch is wrong, and the docs *are* correct.
Sorry to waste your time. :-)

-David





  reply	other threads:[~2020-08-15 18:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 19:04 bug#22874: 25.0.91; whitespace.el documentation looks incorrect David Caldwell
2019-07-29 13:34 ` Lars Ingebrigtsen
2020-08-15  4:32   ` Stefan Kangas
2020-08-15 18:40     ` David Caldwell [this message]
2020-08-15 19:52       ` Bhavin Gandhi

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=a01894f7-143f-2096-6abb-e4e6ff385be0@porkrind.org \
    --to=david@porkrind.org \
    --cc=22874@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=stefan@marxist.se \
    /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).