Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!talos!kjones From: kjones@talos.uucp (Kyle Jones) Newsgroups: comp.emacs Subject: Re: Question on truncate-lines Message-ID: <1989Oct5.161430.18234@talos.uucp> Date: 5 Oct 89 16:14:30 GMT References: <-285219997@hpcupt1.HP.COM> Reply-To: kjones@talos.uu.net Lines: 21 Mark Diekhans writes: > I would like to have a function to toggle the value of the truncate-lines > variable. Unfortunatly doiung a setq or set-variable within a function > does not cause the window to be redrawn the was doing a M-x set-variable > command. I am forced to use the following function, which redraws the > display after toggling the variable. I don't want to wait for the entire > screen to be redrawn. How do I force just the current window to be redrawn? > > (defun toggle-truncate-lines () > "Toggle the value of truncate-lines" > (interactive) > (setq truncate-lines (not truncate-lines)) > (redraw-display)) Change (redraw-display) to (scroll-up 0). This is voodoo, very much like the (set-buffer-modified-p (buffer-modified-p)) (switch-to-buffer (other-buffer)) incantation used to trick Emacs into updating mode lines.