From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#21648: 25.0.50; [PATCH] Add ability to specify radix for the yanked number in calc-yank Date: Thu, 8 Oct 2015 12:19:35 -0400 Message-ID: References: <87oag9fim6.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d2cd6f4029705219a3c41 X-Trace: ger.gmane.org 1444321295 15066 80.91.229.3 (8 Oct 2015 16:21:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Oct 2015 16:21:35 +0000 (UTC) Cc: 21648@debbugs.gnu.org To: jay.p.belanger@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 08 18:21:27 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from eggs.gnu.org ([208.118.235.92]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZkDwW-0001NU-SU for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 18:21:21 +0200 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDwK-0005Pg-9Y for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 12:21:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_FONT_FACE_BAD,HTML_MESSAGE,T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDwK-0005OX-1W for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 12:21:08 -0400 Original-Received: from localhost ([::1]:35882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDwJ-0001Is-Qx for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 12:21:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDwF-0001Ij-DK for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:21:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDwE-0005Fa-7X for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:21:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDwE-0005FU-43 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZkDwD-0001wz-KD for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Oct 2015 16:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.14443212227438 (code B ref -1); Thu, 08 Oct 2015 16:21:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Oct 2015 16:20:22 +0000 Original-Received: from localhost ([127.0.0.1]:32845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkDvZ-0001vt-IS for submit@debbugs.gnu.org; Thu, 08 Oct 2015 12:20:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38832) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkDvX-0001vk-KT for submit@debbugs.gnu.org; Thu, 08 Oct 2015 12:20:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDvW-0004ta-5V for submit@debbugs.gnu.org; Thu, 08 Oct 2015 12:20:19 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDvW-0004tQ-3B for submit@debbugs.gnu.org; Thu, 08 Oct 2015 12:20:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDvU-0001Fg-TG for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:20:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDvT-0004sT-Px for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:20:16 -0400 Original-Received: from mail-oi0-x22b.google.com ([2607:f8b0:4003:c06::22b]:33444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDvT-0004sG-KX for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:20:15 -0400 Original-Received: by oixx17 with SMTP id x17so29805935oix.0 for ; Thu, 08 Oct 2015 09:20:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VswMNkCWjOj0owT66C50bvkigW195g4rI+CTyqjLMv4=; b=VqsJYEvNZt63ZupnkR6QY/WBlhB5Qo2WwXcne4QTzXFgxgnrdVt7hSZiwJxoKxi6rd oR1Ow/od7CIe0m1VsNv8Fm5y/eewI12HAryw+PdKlWQ6BJyIKSnXYGhtocUy4oDhAo0U HjXIbd1rTiy4q4e+uqkFIkQPDURWA1/aDIWhzkYDY/eyABckdx16knW3mJB1W0Dvwxz8 5wJkCWARJkyKeBkZYH2yFzQDcp2FBUG159zBAxl21yxbiFXKhwijafjVu+hihn34RjLC o8Ohu6r/8lwe/S3jB/1B6GeWId/CoYnEM36zlZf85hGRGMQSPkuWS8mLGdjifT8gp9lN YLEg== X-Received: by 10.202.211.10 with SMTP id k10mr4966319oig.34.1444321214855; Thu, 08 Oct 2015 09:20:14 -0700 (PDT) Original-Received: by 10.202.172.205 with HTTP; Thu, 8 Oct 2015 09:19:35 -0700 (PDT) In-Reply-To: <87oag9fim6.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 Xref: news.gmane.org gmane.emacs.bugs:107451 Archived-At: --001a113d2cd6f4029705219a3c41 Content-Type: text/plain; charset=UTF-8 Thanks for the review! I will work out these kinks by the time we can add in more features. I'll update this thread then. -- Kaushal Modi On Thu, Oct 8, 2015 at 12:08 PM, Jay Belanger wrote: > > Hi Kaushal, > > > I read this question of emacs.stackexchange > > ( http://emacs.stackexchange.com/q/13451/115) > > where the user needed to specify the radix of the number he was > > pasting in calc. > > > > If the calc default radix is decimal and if a user pastes 1000, it > > will be pasted as decimal 1000. But what if the user meant to paste > > binary 1000 (decimal 8)? > > > > My patch below enables doing that using numeric prefixes. > > > > Please advise if merging this patch to calc-yank is a good idea or if > > needs improvement/bug fixes before the merging. > > There's a feature freeze on right now, so it shouldn't be added to Emacs > right away. But it looks useful. > > With the patch, if the yanked number already has the radix prefix, there > is an error. It might make more sense to have Calc do an appropriate > conversion. Also, the number of radixes in the patch is less than Calc > allows. > It might make more sense to have calc-yank use the current Calc's > current radix rather than a prefix radix. > I don't recall the policy on using cl- functions, but cond could > easily be used instead of cl-case. > > But this should be brought up again after the feature freeze. > > Jay > > --001a113d2cd6f4029705219a3c41 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the review!
I will work out these kinks by the time we can = add in more features.
I'll update this thread then= .


= --
Kaushal Modi

On Thu, Oct 8, 2015 at 12:08 PM, Jay Belange= r <jay.p.belanger@gmail.com> wrote:

Hi Kaushal,

> I read this question of emacs.stackexchange
> ( http://emacs.stackexchange.com/q/13451/115)
> where the user needed to specify the radix of the number he was
> pasting in calc.
>
> If the calc default radix is decimal and if a user pastes 1000, it
> will be pasted as decimal 1000. But what if the user meant to paste > binary 1000 (decimal 8)?
>
> My patch below enables doing that using numeric prefixes.
>
> Please advise if merging this patch to calc-yank is a good idea or if<= br> > needs improvement/bug fixes before the merging.

There's a feature freeze on right now, so it shouldn't be ad= ded to Emacs
right away.=C2=A0 But it looks useful.

With the patch, if the yanked number already has the radix prefix, there is an error.=C2=A0 It might make more sense to have Calc do an appropriate<= br> conversion. Also, the number of radixes in the patch is less than Calc allo= ws.
It might make more sense to have calc-yank use the current Calc's
current radix rather than a prefix radix.
I don't recall the policy on using cl- functions, but cond could
easily be used instead of cl-case.

But this should be brought up again after the feature freeze.

Jay


--001a113d2cd6f4029705219a3c41--