From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43866: 26.3; italian postfix additions Date: Thu, 22 Oct 2020 15:59:52 +0300 Message-ID: <834kmmmn5j.fsf@gnu.org> References: <83tuv47vkn.fsf@gnu.org> <87ft6igdzi.fsf@mail.linkov.net> <837drt1qta.fsf@gnu.org> <874kmx443u.fsf@mail.linkov.net> <83k0vszw0e.fsf@gnu.org> <87d01kvbnj.fsf@mail.linkov.net> <83wnzsxln9.fsf@gnu.org> <87wnzmgd1f.fsf@mail.linkov.net> <83mu0hng0d.fsf@gnu.org> <87r1ps8xh4.fsf@mail.linkov.net> <831rhroexo.fsf@gnu.org> <87blgv60ug.fsf@mail.linkov.net> <83d01bmol5.fsf@gnu.org> <871rhr3057.fsf@mail.linkov.net> <83blgvmnpu.fsf@gnu.org> <87h7qn1i8z.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21503"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, 43866@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 22 15:00:16 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 1kVaCW-0005Ub-3B for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Oct 2020 15:00:16 +0200 Original-Received: from localhost ([::1]:42152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVaCU-0002Tf-R5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Oct 2020 09:00:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVaCJ-0002T4-7Y for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2020 09:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVaCI-00006y-Rr for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2020 09:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kVaCI-00077Z-PC for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2020 09:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Oct 2020 13:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43866 X-GNU-PR-Package: emacs Original-Received: via spool by 43866-submit@debbugs.gnu.org id=B43866.160337158927325 (code B ref 43866); Thu, 22 Oct 2020 13:00:02 +0000 Original-Received: (at 43866) by debbugs.gnu.org; 22 Oct 2020 12:59:49 +0000 Original-Received: from localhost ([127.0.0.1]:51778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVaC5-00076f-Gt for submit@debbugs.gnu.org; Thu, 22 Oct 2020 08:59:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVaC3-00076P-JU for 43866@debbugs.gnu.org; Thu, 22 Oct 2020 08:59:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42916) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVaBx-0008US-TE; Thu, 22 Oct 2020 08:59:42 -0400 Original-Received: from [176.228.60.248] (port=1083 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVaBx-0005cU-3z; Thu, 22 Oct 2020 08:59:41 -0400 In-Reply-To: <87h7qn1i8z.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 21 Oct 2020 22:39:08 +0300) 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:191263 Archived-At: > From: Juri Linkov > Cc: rpluim@gmail.com, 43866@debbugs.gnu.org > Date: Wed, 21 Oct 2020 22:39:08 +0300 > > However, do you think something like the following is a good idea? > > Let-binding a new variable 'print-integers-as-chars' to t: > > (let ((print-integers-as-chars t)) > (pp '(("'A" . [?Á]) > ("'E" . [?É]) > ("'I" . [?Í]) > ("'O" . [?Ó]) > ("'U" . [?Ú]) > ("'Y" . [?Ý])) > (current-buffer))) > > prints integers as characters: > > (("'A" . [?Á]) > ("'E" . [?É]) > ("'I" . [?Í]) > ("'O" . [?Ó]) > ("'U" . [?Ú]) > ("'Y" . [?Ý])) > > with this patch: The idea is fine, but I have a few comments about implementation: > case_Lisp_Int: > { > - int len = sprintf (buf, "%"pI"d", XFIXNUM (obj)); > - strout (buf, len, len, printcharfun); > + if (!NILP (Vprint_integers_as_chars) && CHARACTERP (obj)) ^^^^^^^^^^^^^^^^^^^^^^^^ If this is supposed to be a boolean variable, please use DEFVAR_BOOL, with all the consequences. > + int len = sprintf (buf, "%s", SDATA (call1 (intern ("prin1-char"), obj))); Do we really need to call Lisp? I thought we were quite capable of printing characters from C, aren't we? > @@ -2247,6 +2255,10 @@ syms_of_print (void) > that represents the number without losing information. */); > Vfloat_output_format = Qnil; > > + DEFVAR_LISP ("print-integers-as-chars", Vprint_integers_as_chars, > + doc: /* Print integers as characters. */); > + Vprint_integers_as_chars = Qnil; I wonder whether it wouldn't be cleaner to add another optional argument to prin1, and let it bind some internal variable so that print_object does this, instead of exposing this knob to Lisp. Because print_object is used all over the place, and who knows what will this do to other callers? Thanks.