unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 31376@debbugs.gnu.org, schwab@linux-m68k.org, eller.helmut@gmail.com
Subject: bug#31376: 26.0.50; print-charset-text-property not honored
Date: Mon, 14 May 2018 19:34:52 +0300	[thread overview]
Message-ID: <837eo6kxg3.fsf@gnu.org> (raw)
In-Reply-To: <87o9hjjqb9.fsf@gmail.com> (message from Noam Postavsky on Sun, 13 May 2018 15:42:02 -0400)

> From: Noam Postavsky <npostavs@gmail.com>
> Cc: handa@gnu.org,  31376@debbugs.gnu.org,  schwab@linux-m68k.org,  eller.helmut@gmail.com
> Date: Sun, 13 May 2018 15:42:02 -0400
> 
> > We could mention this exception in the manual.
> 
> Yeah, I think we should.  Here's a new patch with updated manual and
> tests.

Thanks.

One minor comment about the tests:

> +(defun print-tests--prints-with-charset-p (ch odd-charset)
> +  "Return t if `prin1-to-string' prints CH with the `charset' property.
> +CH is propertized with a `charset' value according to
> +ODD-CHARSET: if nil, then use the one returned by `char-charset',
> +otherwise, use a different charset."
> +  (integerp
> +   (string-match
> +    "charset"
> +    (prin1-to-string
> +     (propertize (string ch)
> +                 'charset
> +                 (if odd-charset
> +                     (car (if (eq (char-charset ch) (car charset-list))
> +                              charset-list
> +                            (cdr charset-list)))
> +                   (char-charset ch)))))))

This seems to rely on some relationship between what char-charset
returns and the car of charset-list, is that right?  AFAIK, when
ODD-CHARSET is non-nil, you want to propertize with a charset that is
_different_ from what char-charset returns, but taking the first or
the second member of charset-list doesn't guarantee that.  It could
work with the particular characters you used for the tests, but if
this function is limited to such characters, we should document that
in the doc string or comments, lest someone will try to expand the
tests and will see strange failures.

Thanks, I have no other comments.





  reply	other threads:[~2018-05-14 16:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07  6:48 bug#31376: 26.0.50; print-charset-text-property not honored Helmut Eller
2018-05-07  7:58 ` Andreas Schwab
2018-05-07  8:38   ` Helmut Eller
2018-05-07 12:57     ` Noam Postavsky
2018-05-07 18:08       ` Helmut Eller
2018-05-11 13:31         ` Eli Zaretskii
2018-05-11 17:44           ` Noam Postavsky
2018-05-11 18:45             ` Eli Zaretskii
2018-05-12 20:02               ` Noam Postavsky
2018-05-13 15:29                 ` Eli Zaretskii
2018-05-13 18:29                   ` Noam Postavsky
2018-05-13 18:51                     ` Eli Zaretskii
2018-05-13 19:42                       ` Noam Postavsky
2018-05-14 16:34                         ` Eli Zaretskii [this message]
2018-05-14 23:15                           ` Noam Postavsky
2018-05-15 17:19                             ` Eli Zaretskii
2018-05-15 23:37                               ` Noam Postavsky
2018-05-23 23:12                                 ` Noam Postavsky
     [not found]             ` <<837eoani9b.fsf@gnu.org>
2018-05-11 19:58               ` Drew Adams
2018-05-12  6:10                 ` Eli Zaretskii
     [not found] <<m2zi1c6jvo.fsf@caladan>

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=837eo6kxg3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=31376@debbugs.gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=npostavs@gmail.com \
    --cc=schwab@linux-m68k.org \
    /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).