From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.bugs Subject: bug#13691: 24.3.50; Problem with glyphs in unibyte buffers Date: Mon, 31 Aug 2020 01:49:38 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11060"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andreas Schwab , 13691@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 31 06:50:21 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCblt-0002kQ-0A for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Aug 2020 06:50:21 +0200 Original-Received: from localhost ([::1]:53240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCblr-0004Gj-Vo for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Aug 2020 00:50:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCbla-0004Ex-Ap for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 00:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCbla-0005hk-1V for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 00:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kCbla-0005yH-08 for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 00:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eduardo Ochs Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Aug 2020 04:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13691 X-GNU-PR-Package: emacs Original-Received: via spool by 13691-submit@debbugs.gnu.org id=B13691.159884939922938 (code B ref 13691); Mon, 31 Aug 2020 04:50:01 +0000 Original-Received: (at 13691) by debbugs.gnu.org; 31 Aug 2020 04:49:59 +0000 Original-Received: from localhost ([127.0.0.1]:51221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCblW-0005xt-Np for submit@debbugs.gnu.org; Mon, 31 Aug 2020 00:49:59 -0400 Original-Received: from mail-pf1-f172.google.com ([209.85.210.172]:46281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCblU-0005xg-Mo for 13691@debbugs.gnu.org; Mon, 31 Aug 2020 00:49:57 -0400 Original-Received: by mail-pf1-f172.google.com with SMTP id b124so2190274pfg.13 for <13691@debbugs.gnu.org>; Sun, 30 Aug 2020 21:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+RUwk9fUb/XrKyRdnOyIVtjrsAUZ1qEzpKWnAyrmWWs=; b=dSwoCCAnwAc4sdNwFviHU0luLzHqBP5ysXHmbxtYuBJXyLKzK+Kj+xD7Rr+2jAimzW C9CHhbjprTkafsO9bHPqizM6+H/d9O7eCpK3t3WrlQL80ehivreP5XbeG2A0aWxwiJ/X iAOMyO7USWsVWB2jooQJBbmKG98o8Uuue0Lpsgg8XM6kYYjRJdFr9B3hYjcUv35RhYrW jmVFhpFSPQLGGgvMSimxHaAzFdcnrWkAJGyESPK4NyUTQDfm85rHZmZIlBPpFqaqsUs8 a12yahaKrRie8558Vx4b1ZKY469zSeCjKiguFurxZ516V7hJegPKel0+uPz2xFybEiHY GgfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+RUwk9fUb/XrKyRdnOyIVtjrsAUZ1qEzpKWnAyrmWWs=; b=ukFkXOKNaGoxiNYlFbLp/BBxTKq93MiTyHmA6rCO941cvon+KAExQ/VsvOZGHzhcNw /KUYE8rkZ1VwbVbNcRE0LqhR550OHGBdLtfES3DRvoQcAI5juyAj9wJ5HWEXGJ7byyo/ gY+ruGOHcmDGyOBysC7EG1lCKPknDGYLPQgbek6X7YCkM+l0I5uABWLb5mivUwUE1cta 4C2Rd7t3+rGxSBDaJV6veZEm9820/rsKcH4WgUIPDaA8svLp0l8wRVPRGHyJ/vNcVBmM /eNg9kEoIoLTs4yxTndKt43+W1Sdxp32YsabSk1dU9QxPVLqQQFttE4P/Kxf5f8cVyAz xBEg== X-Gm-Message-State: AOAM532cUNLLsO9cB6A2W+WummZ9b3XtNX0LU76fvBZ0e3pak2213o+I Emf843CMOK2Mwq1fod+TtIOjggnU1Wnx9pqK1FcqYlU4I7Q= X-Google-Smtp-Source: ABdhPJwRF0AgisyM+U/t1hLyDNdUP9SNhzXf+uGvwsLNJTdi0RjOcuzbdbELwt1yRl5rI9gg7rW39ujvdg1gw89TiD8= X-Received: by 2002:a62:7a97:: with SMTP id v145mr1845430pfc.19.1598849390616; Sun, 30 Aug 2020 21:49:50 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186744 Archived-At: 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 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 writes: > > > Hi Andreas, > > > > On Tue, Feb 12, 2013 at 7:02 AM, Andreas Schwab 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