From: Eduardo Ochs <eduardoochs@gmail.com>
To: Stefan Kangas <stefan@marxist.se>
Cc: Andreas Schwab <schwab@linux-m68k.org>, 13691@debbugs.gnu.org
Subject: bug#13691: 24.3.50; Problem with glyphs in unibyte buffers
Date: Mon, 31 Aug 2020 01:49:38 -0300 [thread overview]
Message-ID: <CADs++6hgQwW0vAqMTXnDrf4ZNvCKgjXrkU-EyC400FVKtuKbDg@mail.gmail.com> (raw)
In-Reply-To: <CADwFkmnukHR4hpNSwUkVWs=oX5_wA_t8=xTfOcHyOsZqdUxsxQ@mail.gmail.com>
It seems that the bug is solved in Emacs26. I don't have Emacs27
or git Emacs in this machine, but I will compile them tomorrow
and check.
The shell script that I used to do the test is below (for the sake of
completeness). It creates two very similar files that only differ in
their "coding:" lines and then opens them with "emacs26 -Q". After
opening each of them you will have to run `M-x eval-buffer' and then
do a `C-x C-e' after the `(insert ...)' line close to the end.
Just a curiosity... is there a standard(-ish) way to send a
script like this to a shell buffer? I use eev all the time and in
eev this is trivial - see:
http://angg.twu.net/eev-intros/find-eepitch-intro.html#1
but sometimes I need to send scripts and tests like this to
people that don't use eev...
Cheers, thanks, etc,
Eduardo Ochs
http://angg.twu.net/emacsconf2019.html
Here is the script...
cd /tmp/
rm -fv /tmp/glyph-bug*
cat > glyph-bug-raw-text <<'%%%%%%%%'
(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)
(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)
;; After doing an M-x eval-buffer,
;; run these tests "by hand" with C-x C-e:
;; (emacs-version)
;; (make-char 'eight-bit 191)
;; (insert "\n;; " 171 187 191)
;; Local Variables:
;; coding: raw-text-unix
;; mode: emacs-lisp
;; End:
%%%%%%%%
cat > glyph-bug-utf-8 <<'%%%%%%%%'
(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)
(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)
;; After doing an M-x eval-buffer,
;; run these tests "by hand" with C-x C-e:
;; (emacs-version)
;; (make-char 'eight-bit 191)
;; (insert "\n;; " 171 187 191)
;; Local Variables:
;; coding: utf-8-unix
;; mode: emacs-lisp
;; End:
%%%%%%%%
~/bigsrc/emacs26/src/emacs -Q -bg black -fg bisque /tmp/glyph-bug-raw-text
~/bigsrc/emacs26/src/emacs -Q -bg black -fg bisque /tmp/glyph-bug-utf-8
/usr/bin/emacs -Q -bg black -fg bisque /tmp/glyph-bug-raw-text
/usr/bin/emacs -Q -bg black -fg bisque /tmp/glyph-bug-utf-8
On Sun, 30 Aug 2020 at 23:32, Stefan Kangas <stefan@marxist.se> wrote:
>
> Hi Eduardo,
>
> You sent the below description to the Emacs bug list 7 years ago.
>
> The email you sent is quite long, and I'm not sure what exactly the
> issue is, or how to try to reproduce it.
>
> Can you reproduce the issue on a recent version of Emacs, such as the
> recently released version 27.1?
>
> If yes, could you please provide a minimal step-by-step recipe for
> reproducing it, starting from "emacs -Q"?
>
> If I don't hear back from you within a couple of weeks, I'll just
> close this bug as unreproducible.
>
> Thanks in advance.
>
> Best regards,
> Stefan Kangas
>
> Eduardo Ochs <eduardoochs@gmail.com> writes:
>
> > Hi Andreas,
> >
> > On Tue, Feb 12, 2013 at 7:02 AM, Andreas Schwab <schwab@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@gmail.com
> > http://angg.twu.net/#eev
next prev parent reply other threads:[~2020-08-31 4:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 1:37 bug#13691: 24.3.50; Problem with glyphs in unibyte buffers Eduardo Ochs
2013-02-12 9:02 ` Andreas Schwab
2013-02-12 22:13 ` Eduardo Ochs
2020-08-31 2:32 ` Stefan Kangas
2020-08-31 4:49 ` Eduardo Ochs [this message]
2020-08-31 21:23 ` Stefan Kangas
2020-11-25 10:03 ` Stefan Kangas
2021-01-01 18:45 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADs++6hgQwW0vAqMTXnDrf4ZNvCKgjXrkU-EyC400FVKtuKbDg@mail.gmail.com \
--to=eduardoochs@gmail.com \
--cc=13691@debbugs.gnu.org \
--cc=schwab@linux-m68k.org \
--cc=stefan@marxist.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).