help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlight tabulated and trailing whitespace


From: steve-humphreys
Subject: Re: Highlight tabulated and trailing whitespace
Date: Mon, 28 Dec 2020 17:08:17 +0100

The error is

Debugger entered--Lisp error: (void-variable display-cycle-state)
  (let ((n display-cycle-state))

> I cannot understand why the following code is giving me a lisp error.
>
> (defun display-cycle ()
>   "Toggle Display-Line-Numbers mode in all buffers."
>   (interactive)
>
>   (let ((n display-cycle-state))
>
>     (pcase n
>       (1 (whitespace-mode)
>        (setq-local display-cycle-state 2))
>
>       (2 (ruler-mode 0)
>        (setq line-number-mode nil)
>        (setq column-number-mode nil)
>        (global-display-line-numbers-mode)
>        (setq-local display-cycle-state 3))
>
>       (_ (ruler-mode 1)
>        (setq line-number-mode t)
>        (setq column-number-mode t)
>        (global-display-line-numbers-mode)
>        (setq-local display-cycle-state 1))) ))
>
>
>
>
>
> > Sent: Monday, December 28, 2020 at 2:10 PM
> > From: steve-humphreys@gmx.com
> > To: moasenwood@zoho.eu
> > Cc: help-gnu-emacs@gnu.org
> > Subject: Re: Highlight tabulated and trailing whitespace
> >
> > Have tried the following two lines to no effect
> >
> > (require 'whitespace)
> > (whitespace-mode)
> >
> > But then if I use "H-k" to toggle, the command works.  What is happening???
> >
> > (global-set-key (kbd "H-k") 'whitespace-mode)
> >
> >
> >
> >
> > > Sent: Monday, December 28, 2020 at 1:11 PM
> > > From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
> > > <help-gnu-emacs@gnu.org>
> > > To: help-gnu-emacs@gnu.org
> > > Subject: Re: Highlight tabulated and trailing whitespace
> > >
> > > steve-humphreys wrote:
> > >
> > > > I have tried to show tab marks, but the following commands
> > > > are confusing me. One can use a backgrouund colour and
> > > > introduce a tab mark. But I have no idea how to
> > > > achieve them.
> > > >
> > > >   (setq whitespace-style '(face tabs))
> > >
> > > Then just set the `whitespace-tab' face, to some face other
> > > than what the default face has,
> > >
> > > (insert "\t <-- this is a tab")
> > >
> > > and enable the mode.
> > >
> > > --
> > > underground experts united
> > > http://user.it.uu.se/~embe8573
> > > https://dataswamp.org/~incal
> > >
> > >
> > >
> >
> >
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]