Re: highline.el and XEmacs

[email protected] Tue, 16 Aug 2005 21:18:38 +0200
Newsgroups gmane.emacs.xemacs.general
Organization Yow! I threw up on my window!
Message-ID <[email protected]>
>>>>> Regarding 'Re: highline.el and XEmacs'; Stephen J. Turnbull adds:
>>>>> "ignotus" == ignotus  <[email protected]> writes:

  ignotus> Unfortunately under XEmacs there is a missing feature: it
  ignotus> can't highlight a line till the window border,

  ignotus> How can I make it work in XEmacs?

  > As far as I know, to make it work generally you have to patch the
  > redisplay engine.  It's probably only a couple of lines of C code,
  > but I can't really promise that.  It's also unobvious what the API
  > to control the feature should be.

  > If you have a monospace font, the LISP code could temporarily stuff
  > whitespace into the end of the highlighted lines.

Fortunately I found a usable (but ugly) elisp solution, I put an extent
at the end of the line like this:

  (let ((ext (make-extent (line-beginning-position) (line-end-position)))
        ;; number of whitespaces
        (spacing-length (- (window-width (selected-window))
                           (save-excursion
                             (goto-char (line-end-position))
                             (current-column)))))
    (when (> spacing-length 0)
      (set-extent-property ext 'my-whitespace-extent t)
      (set-extent-property ext 'end-glyph
                           (make-glyph (make-string spacing-length ? )))
      (set-extent-property ext 'end-glyph-layout 'whitespace)))

It works perfectly, it never gets in the way.  I use a patched version
of stripes.el to read long texts, here is a demo shot:
http://ignotus.linuxforum.hu/stuff/xe-stripes.jpg

--
...sutongi tti olleh
                              Who lives without discipline dies without honor