unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: 57755@debbugs.gnu.org, dick.r.chiang@gmail.com
Subject: bug#57755: 29.0.50; [PATCH] Fallout 816106b
Date: Tue, 13 Sep 2022 14:56:23 +0300	[thread overview]
Message-ID: <83wna74heg.fsf@gnu.org> (raw)
In-Reply-To: <87leqn20gn.fsf@yahoo.com> (bug-gnu-emacs@gnu.org)

> Cc: 57755@debbugs.gnu.org
> Date: Tue, 13 Sep 2022 15:32:56 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> dick <dick.r.chiang@gmail.com> writes:
> 
> > +		   call2 (intern ("string-trim-right"), build_string (err->message),
> 
> What coding system is err->message?

That's a good question, but the same question applies to the original
code, because build_string is just a thin wrapper around make_string.

(My guess would be that the message is either US ASCII or UTF-8, given
its type in glib.  But if we want to be more defensive about that, it
should be a separate change.)

> And calling intern with a static string is IMHO an anti-pattern that
> should not be introduced further into our code.

I actually don't understand the rationale for calling
string-trim-right, not at all.  Why do we need such heavy artillery to
just remove one newline character?

As for replacing of g_clear_error with g_error_free: that's just
syntactic sugar, right?  It is not a mistake to use g_clear_error
there.  I see no reason to make such a replacement.

AFAIU, the useful part of this patch is that it avoids dereferencing
NULL.  That part should go in, but I don't think we want the rest.





  reply	other threads:[~2022-09-13 11:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 20:37 bug#57755: 29.0.50; [PATCH] Fallout 816106b dick
2022-09-12 21:16 ` dick
2022-09-13  7:32   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-13 11:56     ` Eli Zaretskii [this message]
2022-09-13 11:59     ` Lars Ingebrigtsen
2022-09-13 11:57   ` Lars Ingebrigtsen
2022-09-13 12:11     ` Eli Zaretskii
2022-09-13 12:35       ` Lars Ingebrigtsen
2022-09-13 12:48       ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=83wna74heg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=57755@debbugs.gnu.org \
    --cc=dick.r.chiang@gmail.com \
    --cc=luangruo@yahoo.com \
    /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).