Re: [patch] Small bugfix in widget.jl



Hi. Not urgent.

Chris, please fix this:
in (tooltip-split doc) in lisp/sawfish/gtk/widget.jl,
two appearances of "utf8-substring" should be plain "substring".
Let me explain:

(if (string-match "\n\n\\s*" doc)
   (cons (substring doc 0 (match-start))
         (substring doc (match-end)))
  ...

In rep, string is nothing more than a byte-sequence. Here, match is
done against \n = x0a, a bare char, so primitive "substring" counts
correctly. (Dunno what's matched for \s, but it works for several
languages, so must be ok for utf-8. Even if this doesn't work, it's
match for \s that should be corrected, not gtk/widget.jl .)

You can confirm it, with or without locale, by move/resize -> bottom 
item (number spinbutton).

Changelog:
------------------------------------------------------------------------
lisp/sawfish/gtk/widget.jl: correction on commit dd80f8.
------------------------------------------------------------------------

In general (maybe always?), string-match result should be extracted by
pure substring. utf8-substring is currently used to cut at *fixed
length* (20 letters):

(setq len 20)
  (if (> (utf8-string-length name) len)
     (concat (utf8-substring name 0 len) "...")

Thanks a lot,
Teika (Teika kazura)



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