From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jay Belanger 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, 08 Oct 2015 11:08:33 -0500 Message-ID: <87oag9fim6.fsf@gmail.com> References: Reply-To: jay.p.belanger@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444320966 9279 80.91.229.3 (8 Oct 2015 16:16:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Oct 2015 16:16:06 +0000 (UTC) Cc: 21648@debbugs.gnu.org To: Kaushal Modi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 08 18:15:56 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 1ZkDrG-0004q2-6R for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 18:15:54 +0200 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDqo-0006Ny-PC for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 12:15:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDqo-0006Ls-E6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 12:15:26 -0400 Original-Received: from localhost ([::1]:35847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDqo-0008Ev-9g for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 12:15:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDpU-0007iX-5H for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:15:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDoi-0002vz-Jq for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:14:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDob-0002nE-30 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:13:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZkDoU-0001kt-5O for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jay Belanger Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Oct 2015 16:13:02 +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: jay.p.belanger@gmail.com, "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.14443207256674 (code B ref -1); Thu, 08 Oct 2015 16:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Oct 2015 16:12:05 +0000 Original-Received: from localhost ([127.0.0.1]:32841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkDnZ-0001ja-AX for submit@debbugs.gnu.org; Thu, 08 Oct 2015 12:12:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39946) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkDnW-0001jS-TZ for submit@debbugs.gnu.org; Thu, 08 Oct 2015 12:12:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDnP-0006jh-5u for submit@debbugs.gnu.org; Thu, 08 Oct 2015 12:12:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDnP-0006jc-2O for submit@debbugs.gnu.org; Thu, 08 Oct 2015 12:11:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDnK-0005rK-Lj for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:11:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDme-0006HG-BP for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:11:50 -0400 Original-Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]:36740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDme-0006Gk-4r for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 12:11:08 -0400 Original-Received: by igcrk20 with SMTP id rk20so16486348igc.1 for ; Thu, 08 Oct 2015 09:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:reply-to:cc:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=kKtt/HIx/f6Dh7BhwCnqJvWMhaZwJfqG72sDnHmREz0=; b=p+O3eRaCYVGURf53DP8Fm6BDwALKsr2asFKxO/kjPogCrQ72tMihIBBHGDJxyjYmtZ 8aP9oWutQc5ZufAEr/yM0XpOCBDPWdRJvGHvpl5TumJVzi3Sn53WRwZmvH76J/l6XGwb hnVEFX9N83Sl73Nl4EubuFlCnnTcwLGfEodnkv6qFK50kRRY5sbEyzsFl06MQYxnnUC3 7qZFqgtfuSHfQMlG9rxal0myX7Qz5LVSTnUyqDU8k18jgWZo+aBzvLFlpoy4mrCENygy QH15h24avkwlSul6zSKARdvYrJ8U6TtxBBHNME9vFLdpxAXhBT+rjJjGlbY+xa6quNb2 j/wg== X-Received: by 10.50.30.233 with SMTP id v9mr5201291igh.5.1444320667198; Thu, 08 Oct 2015 09:11:07 -0700 (PDT) Original-Received: from vh213601 (vh213601.truman.edu. [150.243.162.59]) by smtp.gmail.com with ESMTPSA id hh9sm3820262igb.18.2015.10.08.09.11.05 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 08 Oct 2015 09:11:06 -0700 (PDT) In-Reply-To: (Kaushal Modi's message of "Thu, 8 Oct 2015 11:07:38 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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:107450 Archived-At: 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