GNU bug report logs - #31376
26.0.50; print-charset-text-property not honored

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Mon, 7 May 2018 06:50:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 26.0.50

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: handa <at> gnu.org, schwab <at> linux-m68k.org, 31376 <at> debbugs.gnu.org, eller.helmut <at> gmail.com
Subject: bug#31376: 26.0.50; print-charset-text-property not honored
Date: Fri, 11 May 2018 21:45:36 +0300
> From: Noam Postavsky <npostavs <at> gmail.com>
> Date: Fri, 11 May 2018 13:44:46 -0400
> Cc: Helmut Eller <eller.helmut <at> gmail.com>, Kenichi Handa <handa <at> gnu.org>, 31376 <at> debbugs.gnu.org, 
> 	Andreas Schwab <schwab <at> linux-m68k.org>
> 
> On 11 May 2018 at 09:31, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > Can someone see any difference between the value t and 'default', wrt
>                                                    ^
>                                                    nil
> > when/how the 'charset' property of strings is printed?
> 
> Assuming you meant nil, then no, I can't see any difference.

Mmm... yes, nil.

> As far as
> I can tell, setting to 'default' just makes Emacs do pointless extra
> checking for "unsafe" charsets even after it has found one.

You mean, setting it to nil makes it do pointless extra work, yes? ;-)

> It looks like the NILP (Vprint_charset_text_property) check is just in
> the wrong place, if I move it to print_prune_string_charset then it
> seems to work as documented.
> 
> --- i/src/print.c
> +++ w/src/print.c
> @@ -1317,8 +1317,7 @@ print_check_string_charset_prop (INTERVAL interval,
>           || CONSP (XCDR (XCDR (val))))
>         print_check_string_result |= PRINT_STRING_NON_CHARSET_FOUND;
>      }
> -  if (NILP (Vprint_charset_text_property)
> -      || ! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
> +  if (! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
>      {
>        int i, c;
>        ptrdiff_t charpos = interval->position;
> @@ -1348,7 +1347,8 @@ print_prune_string_charset (Lisp_Object string)
>    print_check_string_result = 0;
>    traverse_intervals (string_intervals (string), 0,
>                       print_check_string_charset_prop, string);
> -  if (! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
> +  if (NILP (Vprint_charset_text_property)
> +      || ! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))

Yes, that sounds right, thanks.  We should also mention in the doc
string that any non-nil, non-t value is treated as 'default'.

And this variable should be mentioned in the ELisp manual, in the node
"Output Variables".




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

Previous Next


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