From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bastian Beischer Newsgroups: gmane.emacs.devel Subject: Re: FW: calc-yank.el Date: Wed, 11 Jan 2017 09:35:35 +0100 Message-ID: References: <20170103205239.GA5869@belanger-laptop> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d0df618b9130545cd7c0c X-Trace: blaine.gmane.org 1484123798 10799 195.159.176.226 (11 Jan 2017 08:36:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2017 08:36:38 +0000 (UTC) Cc: "emacs-devel@gnu.org" , "Driscoll, Kevin R" To: Kaushal Modi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 11 09:36:32 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 1cREOG-0000qR-P3 for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2017 09:36:17 +0100 Original-Received: from localhost ([::1]:52226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cREOL-0003Fv-6c for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2017 03:36:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRENe-0002yd-PV for emacs-devel@gnu.org; Wed, 11 Jan 2017 03:35:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRENd-0003MY-4a for emacs-devel@gnu.org; Wed, 11 Jan 2017 03:35:38 -0500 Original-Received: from mail-ua0-x232.google.com ([2607:f8b0:400c:c08::232]:34485) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRENc-0003Lr-UA for emacs-devel@gnu.org; Wed, 11 Jan 2017 03:35:37 -0500 Original-Received: by mail-ua0-x232.google.com with SMTP id 35so71614234uak.1 for ; Wed, 11 Jan 2017 00:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=EqndQwKComaVGtsqqSq7w9ibNHlW7wjikVZkleg/Gnw=; b=P4hdEcAOA1758aYDziVBlBtezrohl0KOUsrwmGRS+stKJ53FmLeuiMDb2xwGCvLEpq mDn6/CSfnWlimXY5NmGKXF4nuy2ZyfocQHdcUIGsDwBiqfbJXnPBq4S3NPYJLUYt3A+e hVYxl/8Sw+hx6seOqMY2m3SRk21vfxbYdMY7vWjP3i/jbmMQEScKs5H13UwvTpjWlRcr bnBULbq7Emq/gsUZ/zwUzSBYt50jz0xrewKuNddHXxFF67R25nkby7/vwYAZ03Wb+JZW ZJLrodxs/ccbxjLyKeRfjyzjFgX+n4UglFJiG0lI4smIpBqZUwsif3JRzle0JIbnGjtK E3CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=EqndQwKComaVGtsqqSq7w9ibNHlW7wjikVZkleg/Gnw=; b=pemICleSDMIlXUt4YkIwqzaAPajXl4GgR/UpW0LZ2PVDoAMiSaH5LyMCXVT3Wgp8xt 35cVC8Q93QrnUS/wILy7SksGLO5rimIlQcVWTxceRbxepWUFfqlj1gPkU5ke+1j3TqXr sMgGkHnIPSxGCs3bJrXUHr+H9GK8ZsMcAAKdr3Oeko//nyAAdOJ/PkEOWoPpEvqtETrF qu1hD4a+OiaM6uh9TFfp0l5gD4MHxLwDe4CTLSxQEqylv6jEJfDzK4QNFvyuswajFFZc gjrWdHfAjWttDkk4WLcLe8OetWdQsbeAtg3+5TyAxygIXqVkOWsJJgFJHLsA7PkTkdPA d04w== X-Gm-Message-State: AIkVDXLbBXnvy4S2aNfa9salZpbbGcwJm4qxPnEkAnomfAsgZDbZFWQiyCoNlqD7ZKeFKm58yBzeSqr19EEP0w== X-Received: by 10.176.3.44 with SMTP id 41mr4114814uat.157.1484123736145; Wed, 11 Jan 2017 00:35:36 -0800 (PST) Original-Received: by 10.103.0.7 with HTTP; Wed, 11 Jan 2017 00:35:35 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: 2Z-RvpGohlrF8YULfeka_99lis4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c08::232 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:211190 Archived-At: --001a113d0df618b9130545cd7c0c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, on a related note, I would really appreciate some feedback on this bug report: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D23629 Cheers Bastian On Wed, Jan 11, 2017 at 4:52 AM, Kaushal Modi wrote: > 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=3D > ec0d4d24fd11b5040de9f7657b486c3b1e743071 > > 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 properl= y >> 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 wi= th >> 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=99cal= c-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; ya= nking 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 <+1%20763-954-6789> Cell: +1 612-801-9520 >> <+1%20612-801-9520> FAX: +1 763-954-5473 <+1%20763-954-5473> >> Honeywell; MN10-122B; 1985 Douglas Dr. N.; Golden Valley; MN >> 55422-3992; USA >> > -- > > Kaushal Modi > --=20 Bastian Beischer RWTH Aachen University of Technology @RWTH Aachen Office: 28 C 203 Phone: +49-241-80-27205 E-mail: beischer@physik.rwth-aachen.de Address: I. Physikalisches Institut B, Sommerfeldstr. 14, D-52074 Aachen @CERN Office: Bdg 32-4-B12 Phone: +41-22-76-75750 E-mail: bastian.beischer@cern.ch Address: CERN, CH-1211 Geneve 23 --001a113d0df618b9130545cd7c0c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello,

on a related note, I would = really appreciate some feedback on this bug report:


Chee= rs
Bastian

On Wed, Jan 11, 2017 at 4:52 AM, Kaushal Modi <= kaushal.modi@gmail.com> wrote:

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: htt= p://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3Dec0d4d24fd11= b5040de9f7657b486c3b1e743071


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.=C2=A0 And, please consider my change suggestion bel= ow.

-----Original Message-----
From: Jay Belanger [mailto:jay.p.belanger@gmai= l.com]
Sent: Tuesday, January 03, 2017 14:53
To: Driscoll, Kevin R <kevin.driscoll@h= oneywell.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, an= d 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 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "\\1\\2"
=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 thing)
=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=A0thing)))))
;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (if (eq (car-safe val) 'error)
=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 (progn
=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 (setq val (math-read-e= xprs thing))
=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 (if (eq (car-safe val)= 'error)
=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 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (error "Bad format in
yanked
data")
=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 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




--
Bastian= Beischer
RWTH Aachen University of Technology

@RWTH Aachen
Of= fice: 28 C 203
Phone: +49-241-80-27205
E-mail: beischer@physik.rwth-aachen.d= e
Address: I. Physikalisches Institut B, Sommerfeldstr. 14, D-52074 = Aachen

@CERN
Office: Bdg 32-4-B12
Phone: +41-22-76-75750
E-= mail: bastian= .beischer@cern.ch
Address: CERN, CH-1211 Geneve 23
--001a113d0df618b9130545cd7c0c--