all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* whitespace-mode deactivated at end of line
@ 2022-06-09 18:22 goncholden via Users list for the GNU Emacs text editor
  2022-06-09 19:31 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: goncholden via Users list for the GNU Emacs text editor @ 2022-06-09 18:22 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

I am visualising withspace with (global-whitespace-mode)

Trailing spaces are coloured in red, but when I put the cursor at the end of the line, the red whitespace
background is being modified to black for a black theme.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: whitespace-mode deactivated at end of line
  2022-06-09 18:22 whitespace-mode deactivated at end of line goncholden via Users list for the GNU Emacs text editor
@ 2022-06-09 19:31 ` Eli Zaretskii
  2022-06-11  3:03   ` goncholden
  2022-06-11  5:24   ` Emanuel Berg
  0 siblings, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-06-09 19:31 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 09 Jun 2022 18:22:36 +0000
> From:  goncholden via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
> 
> I am visualising withspace with (global-whitespace-mode)
> 
> Trailing spaces are coloured in red, but when I put the cursor at the end of the line, the red whitespace
> background is being modified to black for a black theme.

The red background that highlights trailing whitespace disappears when
the cursor is at the end of such a line, and that's feature: if Emacs
didn't behave like that, each time you type a space at the end of a
line you'd get it highlighted in red, which is an annoyance when you
type.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: whitespace-mode deactivated at end of line
  2022-06-09 19:31 ` Eli Zaretskii
@ 2022-06-11  3:03   ` goncholden
  2022-06-11  5:24   ` Emanuel Berg
  1 sibling, 0 replies; 9+ messages in thread
From: goncholden @ 2022-06-11  3:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs



------- Original Message -------
On Friday, June 10th, 2022 at 7:31 AM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Thu, 09 Jun 2022 18:22:36 +0000
> > From: goncholden via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org
> >
> > I am visualising withspace with (global-whitespace-mode)
> >
> > Trailing spaces are coloured in red, but when I put the cursor at the end of the line, the red whitespace
> > background is being modified to black for a black theme.
>
>
> The red background that highlights trailing whitespace disappears when
> the cursor is at the end of such a line, and that's feature: if Emacs
> didn't behave like that, each time you type a space at the end of a
> line you'd get it highlighted in red, which is an annoyance when you
> type.

I grasp that now.  Not really a problem.  Would like to ask for a function of two that can set the background colour used for the whitespace styles defined by the mode.  Additionally, how about improving the default background colour contrast with the background colour of the theme (whether light on dark).  For tabs, the contrast is quite low.  Can only see the tab-mark actually!






^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: whitespace-mode deactivated at end of line
  2022-06-09 19:31 ` Eli Zaretskii
  2022-06-11  3:03   ` goncholden
@ 2022-06-11  5:24   ` Emanuel Berg
  2022-06-11  8:15     ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Emanuel Berg @ 2022-06-11  5:24 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:

> The red background that highlights trailing whitespace

Also why isn't that removed automatically on save? Or are they
programming languages that have that semantically as well or
how ever was put?

(defun untab-all ()
  (unless (member major-mode '(makefile-gmake-mode
                               makefile-mode) ) ; exceptions
    (untabify (point-min) (point-max)))
  nil) ; "did not write buffer to disk"

;; (setq before-save-hook nil)
(defun before-save-hook-f ()
  (untab-all)
  (delete-trailing-whitespace) )
(add-hook 'before-save-hook #'before-save-hook-f)

I agree with the OP (original poster) in this particular issue
that configuration to make it make sense shouldn't be needed,
in much the same way I agree with the OP (other poster, this
refers to YT) that all basic math stuff should be implemented
and distributed as the official Emacs math library so not
everyone has to do that all over.

Then after math we can do - I don't know. But so we'd have
a super-library of all building blocks pretty soon. And then
one wouldn't have to post source on gmane.emacs.help all the
time to "own" them if you will.

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: whitespace-mode deactivated at end of line
  2022-06-11  5:24   ` Emanuel Berg
@ 2022-06-11  8:15     ` Eli Zaretskii
  2022-06-11  8:34       ` goncholden
                         ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-06-11  8:15 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Emanuel Berg <incal@dataswamp.org>
> Date: Sat, 11 Jun 2022 07:24:13 +0200
> 
> Eli Zaretskii wrote:
> 
> > The red background that highlights trailing whitespace
> 
> Also why isn't that removed automatically on save?

Because it isn't any business of Emacs to second-guess the user's
intentions.  The user could, for example, be saving a partially
written file, or have any other valid reason for keeping the trailing
whitespace.

If you do want this automatic cleanup to be performed unconditionally,
customize the option whitespace-cleanup to do that.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: whitespace-mode deactivated at end of line
  2022-06-11  8:15     ` Eli Zaretskii
@ 2022-06-11  8:34       ` goncholden
  2022-06-11  9:07       ` Arash Esbati
  2022-06-12  8:58       ` Emanuel Berg
  2 siblings, 0 replies; 9+ messages in thread
From: goncholden @ 2022-06-11  8:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


------- Original Message -------
On Saturday, June 11th, 2022 at 8:15 PM, Eli Zaretskii <eliz@gnu.org> wrote:


> > From: Emanuel Berg incal@dataswamp.org
> > Date: Sat, 11 Jun 2022 07:24:13 +0200
> >
> > Eli Zaretskii wrote:
> >
> > > The red background that highlights trailing whitespace
> >
> > Also why isn't that removed automatically on save?
>
>
> Because it isn't any business of Emacs to second-guess the user's
> intentions. The user could, for example, be saving a partially
> written file, or have any other valid reason for keeping the trailing
> whitespace.
>
> If you do want this automatic cleanup to be performed unconditionally,
> customize the option whitespace-cleanup to do that.

I agree.  There are many reasons people want to keep the file intact.  Much good could be done scrutinising on some of my comments rather than expecting humility from some who bother
telling you about them.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: whitespace-mode deactivated at end of line
  2022-06-11  8:15     ` Eli Zaretskii
  2022-06-11  8:34       ` goncholden
@ 2022-06-11  9:07       ` Arash Esbati
  2022-06-11  9:58         ` Eli Zaretskii
  2022-06-12  8:58       ` Emanuel Berg
  2 siblings, 1 reply; 9+ messages in thread
From: Arash Esbati @ 2022-06-11  9:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> If you do want this automatic cleanup to be performed unconditionally,
> customize the option whitespace-cleanup to do that.

Did you mean the option `whitespace-action', by chance?

Best, Arash



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: whitespace-mode deactivated at end of line
  2022-06-11  9:07       ` Arash Esbati
@ 2022-06-11  9:58         ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-06-11  9:58 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Arash Esbati <arash@gnu.org>
> Cc: help-gnu-emacs@gnu.org
> Date: Sat, 11 Jun 2022 11:07:44 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > If you do want this automatic cleanup to be performed unconditionally,
> > customize the option whitespace-cleanup to do that.
> 
> Did you mean the option `whitespace-action', by chance?

Yes, sorry about the typo.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: whitespace-mode deactivated at end of line
  2022-06-11  8:15     ` Eli Zaretskii
  2022-06-11  8:34       ` goncholden
  2022-06-11  9:07       ` Arash Esbati
@ 2022-06-12  8:58       ` Emanuel Berg
  2 siblings, 0 replies; 9+ messages in thread
From: Emanuel Berg @ 2022-06-12  8:58 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:

>>> The red background that highlights trailing whitespace
>> 
>> Also why isn't that removed automatically on save?
>
> Because it isn't any business of Emacs to second-guess the
> user's intentions. The user could, for example, be saving
> a partially written file, or have any other valid reason for
> keeping the trailing whitespace.

Sounds more like someone falling asleep with the head on the
keyboard ... which can be really dangerous BTW.

> If you do want this automatic cleanup to be performed
> unconditionally, customize the option whitespace-cleanup to
> do that.

Okay, yes, better than the semi-manual method of having
a function in a hook, however I don't have that?

  GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+
  Version 3.24.24, cairo version 1.16.0) of 2022-05-28
  [commit 79ae40c8e4dac5898d68c92f26f625ac400b960c]

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-06-12  8:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-09 18:22 whitespace-mode deactivated at end of line goncholden via Users list for the GNU Emacs text editor
2022-06-09 19:31 ` Eli Zaretskii
2022-06-11  3:03   ` goncholden
2022-06-11  5:24   ` Emanuel Berg
2022-06-11  8:15     ` Eli Zaretskii
2022-06-11  8:34       ` goncholden
2022-06-11  9:07       ` Arash Esbati
2022-06-11  9:58         ` Eli Zaretskii
2022-06-12  8:58       ` Emanuel Berg

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.