From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: FW: calc-yank.el Date: Wed, 11 Jan 2017 03:52:22 +0000 Message-ID: References: <20170103205239.GA5869@belanger-laptop> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c094646d8773f0545c987d8 X-Trace: blaine.gmane.org 1484106780 13380 195.159.176.226 (11 Jan 2017 03:53:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2017 03:53:00 +0000 (UTC) To: "Driscoll, Kevin R" , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 11 04:52:52 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cR9xm-0001RP-UR for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2017 04:52:39 +0100 Original-Received: from localhost ([::1]:51238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cR9xr-0000mm-6S for ged-emacs-devel@m.gmane.org; Tue, 10 Jan 2017 22:52:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cR9xk-0000fA-3j for emacs-devel@gnu.org; Tue, 10 Jan 2017 22:52:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cR9xi-0007z8-IL for emacs-devel@gnu.org; Tue, 10 Jan 2017 22:52:36 -0500 Original-Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]:33198) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cR9xi-0007yk-BE for emacs-devel@gnu.org; Tue, 10 Jan 2017 22:52:34 -0500 Original-Received: by mail-vk0-x233.google.com with SMTP id 137so372801884vkl.0 for ; Tue, 10 Jan 2017 19:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Gp4GnaF5veqmiZmsuljmlxVCd+UK28YTtSMzA+REeiw=; b=WFeYru37OAiwjB5GwN3Jlis21a0nYe1Sc+BPzb9R/XKO5USxR1T6KGXp3tXvLyBni6 NmKs0mLdVUjRNk7kQSOAL2x9crEISVIq1SJDTb4J40liNsuoRh2VRSfe+X1jT0raxPVU 4zZ7OcWIcLXshNJR3c32kzHM32DID0AleUKZxlWJRA6JJfApPiUldxMtyw7oPoSAlHWI FnJhB+eaOoklacDBuBId7Z1ydBGbUu6SmcyFY6p9N4ednmM4MQNoULGMFh5ETK+vMmiL 9uAPSIxGQscklOrljt/v1kzKmRIh6B2gUaI2uZo1ErVqFP7MnytZFJUitzM6JAedmTyP kWlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Gp4GnaF5veqmiZmsuljmlxVCd+UK28YTtSMzA+REeiw=; b=EpXYIVqf1kCgk4RDvgZQv2EucEkbkHAOk6BRpQSQwBVCM4F+yRMkknRydTZa9UfX1Z iRq1Xq6idTQjPrEkQ8Z17tpsjvOcUnTEHXJb0vD2uJ0pCEN61xRQQoXU0zgaWFHvDDy2 dRQqP+EYTlU5dSCAZu6/+41ietg4fwWvIB2xLn9O4KDHuJfkC7TbijNCUSKmIpTUd5xx WsDzBvVt4CJozFMYWW60lhGzEgDY3xP47AWrOQzZ4tZ90AYe247Lx7sQ2f9YqJ32gYQL LP0eWeho7HdKPI3ou5QRXe6T8CVKmDJZRTINmqWg9yLUgxlzQAoNHMH3WOKDe6HafTOS UttA== X-Gm-Message-State: AIkVDXJxmEwhxU/A8LEkWax5R8etFTpl1hNXlGfOXz/tQSWcNu50Sc+15g9l8wZi6F88KYKdOyjp5ZvngrTykw== X-Received: by 10.31.102.134 with SMTP id a128mr2641776vkc.104.1484106753405; Tue, 10 Jan 2017 19:52:33 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211188 Archived-At: --94eb2c094646d8773f0545c987d8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Kevin, Can you please provide a git formatted patch with respect to the master branch? I expanded the calc-yank function last year to support different radixes: http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3Dec0d4d24fd11b5040de= 9f7657b486c3b1e743071 On Tue, Jan 10, 2017, 10:36 PM Driscoll, Kevin R < kevin.driscoll@honeywell.com> wrote: > Contrary to the header of the calc-yank.el file, jay.p.belanger is no > longer the maintainer of calc-yank. > This should be updated. And, please consider my change suggestion below. > > -----Original Message----- > From: Jay Belanger [mailto:jay.p.belanger@gmail.com] > Sent: Tuesday, January 03, 2017 14:53 > To: Driscoll, Kevin R > Subject: Re: calc-yank.el > > Hi Kevin, > > I'm a little surprised that digit-grouped numbers aren't handled properly > already. But your solution looks well thought out. > However, I'm not using Emacs or maintaining Calc any more. > You should send this to emacs-devel@gnu.org, and they should make the > changes. > > Jay > > -----Original Message----- > To: Jay Belanger [mailto:jay.p.belanger@gmail.com] > From: Driscoll, Kevin R > Subject: Re: calc-yank.el > > Please consider the changes to calc-yank.el between the commented lines > below. This allows the yanking of digit-grouped numbers. It=E2=80=99s = a real > pain not having that capability, given that most large numbers to be > imported into calc from text are grouped. While this could interfere wit= h > yanking vectors, the grabs are actually simpler alternatives for vectors. > To minimize the impact of this change on the unsuspecting, a nil-default > calc-yank-grouped mode flag could be added and the =E2=80=98=E2=80=99calc= -group-digits=E2=80=99=E2=80=99 > below could be replaced with =E2=80=9Ccalc-yank-grouped=E2=80=9D or =E2= =80=9C(and calc-group-digits > calc-yank-grouped)=E2=80=9D. This doesn=E2=80=99t handle radix > 10; yan= king these are > very rare for grouped numbers and there=E2=80=99s not a standard format (= 16# vs 0x). > > (defun calc-yank () > (interactive) > (calc-wrapper > (calc-pop-push-record-list > 0 "yank" > (let ((thing (if (fboundp 'current-kill) > (current-kill 0 t) > (car kill-ring-yank-pointer)))) > (if (eq (car-safe calc-last-kill) thing) > (cdr calc-last-kill) > (if (stringp thing) > ; (let ((val (math-read-exprs (calc-clean-newlines > thing)))) > (let ((val (math-read-exprs > (calc-clean-newlines > (if calc-group-digits > (replace-regexp-in-string > (concat "\\([0-9]\\)" calc-group-char > "\\([0-9]\ > \)") > "\\1\\2" > thing) > thing))))) > ; > (if (eq (car-safe val) 'error) > (progn > (setq val (math-read-exprs thing)) > (if (eq (car-safe val) 'error) > (error "Bad format in > yanked > data") > val)) > val)))))))) > > -- > Kevin R. Driscoll, Engineering Fellow > Kevin.Driscoll@Honeywell.com > Phone: +1 763-954-6789 Cell: +1 612-801-9520 FAX: +1 > 763-954-5473 > Honeywell; MN10-122B; 1985 Douglas Dr. N.; Golden Valley; MN > 55422-3992; USA > --=20 Kaushal Modi --94eb2c094646d8773f0545c987d8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi Kevin,

Can you please provide a git formatted patch with respect to= the master branch?

I expanded the calc-yank function last year to support=C2=A0= different radixes: http://git.savannah.g= nu.org/cgit/emacs.git/commit/?id=3Dec0d4d24fd11b5040de9f7657b486c3b1e743071=


On Tue, Jan 10, 2017, 10:36= PM Driscoll, Kevin R <k= evin.driscoll@honeywell.com> wrote:
Contrary to the header of the calc-yank.el file, jay.p.belanger is = no longer the maintainer of calc-yank.
This should be updated.=C2=A0 And, please consider my change suggestion bel= ow.

-----Original Message-----
From: Jay Belanger [mailto:jay.p.belanger@gmail.com]
Sent: Tuesday, January 03, 2017 14:53
To: Driscoll, Kevin R <kevin.driscoll@honeywell.com> Subject: Re: calc-yank.el

Hi Kevin,

I'm a little surprised that digit-grouped numbers aren't handled pr= operly already.=C2=A0 But your solution looks well thought out.
However, I'm not using Emacs or maintaining Calc any more.
You should send this to emacs-devel@gnu.org, and they should make the= changes.

Jay

-----Original Message-----
To: Jay Belanger [mailto:jay.p.belanger@gmail.com]
From: Driscoll, Kevin R <kevin.driscoll@honeywell.com>=
Subject: Re: calc-yank.el

Please consider the changes to calc-yank.el between the commented lines bel= ow.=C2=A0 =C2=A0This allows the yanking of digit-grouped numbers.=C2=A0 It= =E2=80=99s a real pain not having that capability, given that most large nu= mbers to be imported into calc from text are grouped.=C2=A0 While this coul= d interfere with yanking vectors, the grabs are actually simpler alternativ= es for vectors.=C2=A0 To minimize the impact of this change on the unsuspec= ting, a nil-default calc-yank-grouped mode flag could be added and the =E2= =80=98=E2=80=99calc-group-digits=E2=80=99=E2=80=99 below could be replaced = with =E2=80=9Ccalc-yank-grouped=E2=80=9D or =E2=80=9C(and calc-group-digits= calc-yank-grouped)=E2=80=9D.=C2=A0 This doesn=E2=80=99t handle radix > = 10; yanking these are very rare for grouped numbers and there=E2=80=99s not= a standard format (16# vs 0x).

(defun calc-yank ()
=C2=A0 (interactive)
=C2=A0 (calc-wrapper
=C2=A0 =C2=A0(calc-pop-push-record-list
=C2=A0 =C2=A0 0 "yank"
=C2=A0 =C2=A0 (let ((thing (if (fboundp 'current-kill)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(current-kill 0 = t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(car kill-ring-yank-poi= nter))))
=C2=A0 =C2=A0 =C2=A0 (if (eq (car-safe calc-last-kill) thing)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cdr calc-la= st-kill)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (stringp thing)=
;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let = ((val (math-read-exprs (calc-clean-newlines thing))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let = ((val (math-read-exprs
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (calc-clean-newlines
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(if calc-group-digits
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(replace-regexp-in-string
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat "\\([0-9]\\)" calc-group-= char
"\\([0-9]\
\)")
=C2=A0 =C2=A0 =C2=A0 =C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=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 val))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 val))))))))

--
Kevin R. Driscoll, Engineering Fellow=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0Kevin.Driscoll@Honeywell.com
Phone: +1 763-954-6789=C2=A0 =C2=A0 =C2=A0 Cell: +1 612-801-9520=C2=A0 =C2= =A0 =C2=A0 =C2=A0FAX: +1 763-954-5473
Honeywell; MN10-122B; 1985 Douglas Dr. N.; Golden Valley; MN
55422-3992; USA
--

Kaushal Modi

--94eb2c094646d8773f0545c987d8--