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

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

Re: Refresh display after changing variable


From: Ken Goldman
Subject: Re: Refresh display after changing variable
Date: Mon, 2 Aug 2021 15:36:01 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0

On 8/2/2021 1:03 PM, Eli Zaretskii wrote:
From: Ken Goldman <kgoldman@us.ibm.com>
Date: Mon, 2 Aug 2021 12:49:41 -0400

I have this to toggle a variable:

(defun kg-toggle-whitespace-line-column ()
    "Toggle whitespace line column between 80 and 101"
    (interactive)
    (setq whitespace-line-column (if (= whitespace-line-column 80) 101 80))
    (font-lock-fontify-buffer))
(global-set-key "\C-cw" 'kg-toggle-whitespace-line-column)

However, the buffer is not refreshed with the different colors.

I also tried (refresh-display) - no success

(revert-buffer) works but seems crude.

What's the correct function?

This:

   (defun kg-toggle-whitespace-line-column ()
      "Toggle whitespace line column between 80 and 101"
      (interactive)
      (setq whitespace-line-column (if (= whitespace-line-column 80) 101 80))
      (whitespace-mode 1))


That didn't work.  It seems that, once it's on, turning it on again doesn't
help.  I tried adding a nil first, but it doesn't help.  It
doesn't force redoing the fonts.

This is emacs 26.3 on ubuntu, of that matters.




reply via email to

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