From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#55943: Cannot insert registers in calc Date: Tue, 14 Jun 2022 13:29:58 +0200 Message-ID: <87fsk71o09.fsf@web.de> References: <87tu8orgyd.fsf@debian-cf> <87h74or3xk.fsf@gnus.org> <87mtef1p5m.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20058"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Kuba Orlik , 55943@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 14 13:31:30 2022 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 1o14le-00056W-Nq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Jun 2022 13:31:30 +0200 Original-Received: from localhost ([::1]:33642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o14ld-00011k-Ca for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Jun 2022 07:31:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o14lD-0000iJ-Nu for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 07:31:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o14lC-0005Bt-1W for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 07:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o14lB-0006Tb-To for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 07:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2022 11:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55943 X-GNU-PR-Package: emacs Original-Received: via spool by 55943-submit@debbugs.gnu.org id=B55943.165520621021517 (code B ref 55943); Tue, 14 Jun 2022 11:31:01 +0000 Original-Received: (at 55943) by debbugs.gnu.org; 14 Jun 2022 11:30:10 +0000 Original-Received: from localhost ([127.0.0.1]:33127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o14kL-0005ae-Fp for submit@debbugs.gnu.org; Tue, 14 Jun 2022 07:30:09 -0400 Original-Received: from mout.web.de ([212.227.15.14]:34511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o14kH-0005Sb-V4 for 55943@debbugs.gnu.org; Tue, 14 Jun 2022 07:30:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1655206199; bh=5Ujvvo158TbqOHWCKACeogonE37nBeYnZyYKk/rVTFY=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=MiXKOZuafRYBzu9mztaxE8zeSCauf8l6I9yituhx1pYd4CWQKrS/iZfq/4giPIBk6 aANoX3Ta41ss+3sPPB5lWB+VL+/ziTW38j6O7H93mhiJGx77oifPd9Z95dk82fEVeh ux91ZtD6nrYJ8/G3ViwAA/4VZWEjoX1CRh4RprIU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([84.60.174.246]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MYLmo-1oEhrp0ID4-00VoFs; Tue, 14 Jun 2022 13:29:59 +0200 In-Reply-To: <87mtef1p5m.fsf@web.de> (Michael Heerdegen's message of "Tue, 14 Jun 2022 13:05:09 +0200") X-Provags-ID: V03:K1:tgMJIWZMz0lv8ZdUpelUSSl7MoZolekBRFHMjI8bt3T2xPmfTgg GE26whV09xaBr3O1N7mbIMeNF5fuKnhNEMal8n5VP9PQeI0k643Mhp6X/jkprbeW7av2An2 QbkQmFG9d6s8CloNjWoWGJWMEru5WSSznqHUE63bMoN9Nyt9FkY5SYbUwhHzWpctNhp9cXY 8HvuJLqT50Bp5lNQKJm3w== X-UI-Out-Filterresults: notjunk:1;V03:K0:Pw2P4Ahh2UY=:DfmCwN91KmMU7/dFLN469Z sFCZ6buzP39ycIQnp2ih5aG5CybnPz6C81Vs7gdDZ3Ml19Ws+rQbBO7K4FFDQMha+t3yhfzpr 7uaTgqwBUrBnQdbz6hEqxD4F0VO6oqkOaG+a+lz96K5w0+JlZNBQcng3t8/SvRjUwdvw3Q3WF ciewQHmzl/RrVOjzceFmYL/NG3tZKHfIHhYYCoy2kwI4fahuafePkVcfHhu3inhJC/tU7CuYO wY/Zk+FBBEnxxwkFzDzc9MLhr/BM9DR4U3lXT8+nAw0uIyw4wi119IVpiNRx+sZQhl23FM9le 4KD/8r2w2jYphJoig4FdEp9DjGH5ovuxFpYg3ilQfSQX22eznIeQ3BE5EAZXgJQVRIURFSwg7 gIKyaNuvw83d7I/T7GrKKJHRiTHZ4jKhyJ5DdAUCXUszfS4CvAseVnS6zZcgZS9G1kuxXluHV 33ayqxBMP2U42dwEsZKKefywns/gLfExqIziPwnnMIBxR0zCjckAFe7CNMmCAzLGtFRReav4e LWsjdVeTm9qx+o6EKbBdC/6EAOmkcCTsVynPdLxEpfhrxag7DldVPTXX6qLbWw7zh2dHpVUDq MM4Ry1TYB2/+vI4uUODwYsCuzHtRUmPHD2mADmMlaTq620bf0+9pI8PZdivp/lGHrK+9XCew5 K7SEMJt2/U3x7bP/4igJIzsowuI/Uow3E7ys+sqjEiOx32F98Nt+QmD9sRHBmibZ7qsQ2uIzD ZimB4Mz8h0/OXDozElIX4/+wLycdmA4i1MpMzFE0x0+uGkbZY1T4/UiwAlKu7dyN81EBwryZ 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:234475 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen writes: > Wouldn't it make sense to make "calc-insert-register" work with number > valued registers? This seems to work: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-WIP-Allow-number-register-value-insertion-in-Calc.patch Content-Transfer-Encoding: quoted-printable =46rom 3368ead9b62e822e7e3927149c67c09caf17d55f Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Tue, 14 Jun 2022 13:26:06 +0200 Subject: [PATCH] WIP: Allow number register value insertion in Calc =2D-- lisp/calc/calc-yank.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index e0ed098b70..8346061239 100644 =2D-- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -266,14 +266,16 @@ calc-get-register "Return the CALCVAL portion of the contents of the Calc register REG, unless the TEXT portion doesn't match the contents of the Emacs register = REG, in which case either return the contents of the Emacs register (if it is -text) or nil." +text or a number) or nil." (let ((cval (cdr (assq reg calc-register-alist))) (val (cdr (assq reg register-alist)))) - (if (stringp val) - (if (and (stringp (car cval)) - (string=3D (car cval) val)) - (cdr cval) - val)))) + (cond + ((stringp val) + (if (and (stringp (car cval)) + (string=3D (car cval) val)) + (cdr cval) + val)) + ((numberp val) (number-to-string val))))) (defun calc-copy-to-register (register start end &optional delete-flag) "Copy the lines in the region into register REGISTER. =2D- 2.30.2 --=-=-= Content-Type: text/plain Would this make sense? Are there any number values that could cause problems? Michael. --=-=-=--