GNU bug report logs - #13691
24.3.50; Problem with glyphs in unibyte buffers

Previous Next

Package: emacs;

Reported by: Eduardo Ochs <eduardoochs <at> gmail.com>

Date: Tue, 12 Feb 2013 01:42:02 UTC

Severity: normal

Found in version 24.3.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 13691 <at> debbugs.gnu.org (full text, mbox):

From: Eduardo Ochs <eduardoochs <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 13691 <at> debbugs.gnu.org
Subject: Re: bug#13691: 24.3.50; Problem with glyphs in unibyte buffers
Date: Tue, 12 Feb 2013 20:13:05 -0200
[Message part 1 (text/plain, inline)]
Hi Andreas,

On Tue, Feb 12, 2013 at 7:02 AM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>
> Unibyte characters are in the eight-bit charset, so you need to set the
> display of the corresponding character in that charset, eg. (make-char
> 'eight-bit 171).

Thanks, that worked!

Now for something slightly trickier... =|

Let's start by using several simple, low-level functions, one for
each range... a smarter function with `cond's can be left for
later. The code below makes the green guillemets work both in
unibyte and multibyte buffers,

  (defun eepitch-set-glyph (pos &optional char face)
    (aset standard-display-table pos
	  (if char (vector (make-glyph-code char face)))))

  (defun eepitch-set-glyph-8bit (pos &optional char face)
    (aset standard-display-table (make-char 'eight-bit pos)
	  (if char (vector (make-glyph-code char face)))))

  (if (not standard-display-table)
      (setq standard-display-table (make-display-table))
    )

  (defface eev-glyph-face-green '((t :foreground "green")) "")
  (eepitch-set-glyph      171 171 'eev-glyph-face-green)
  (eepitch-set-glyph-8bit 171 171 'eev-glyph-face-green)
  (eepitch-set-glyph      187 187 'eev-glyph-face-green)
  (eepitch-set-glyph-8bit 187 187 'eev-glyph-face-green)

but now suppose that we want the char 191 to be displayed as a
blue nabla (unicode: 8711). Running

  (defface eev-glyph-face-math  '((t :foreground "RoyalBlue2"
				     :background "gray20")) "")
  (eepitch-set-glyph      191 8711 'eev-glyph-face-math)
  (eepitch-set-glyph-8bit 191 8711 'eev-glyph-face-math)

_almost_ does the job, but look at the new screenshot - it seems
that the `char' argument in `eepitch-set-glyph-8bit' needs some
translation too... is that right? Which translation?

  Cheers, and thanks in advance again...
    Eduardo Ochs
    eduardoochs <at> gmail.com
    http://angg.twu.net/#eev
[glyph-bug-screenshot-2.png (image/png, attachment)]

This bug report was last modified 4 years and 144 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.