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 22:56:30 -0400 Message-ID: References: <87oag9fim6.fsf@gmail.com> <87wpux88mo.fsf@gmail.com> <87fv1k3la1.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d2cd6c10c4a0521a32286 X-Trace: ger.gmane.org 1444359525 27829 80.91.229.3 (9 Oct 2015 02:58:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 Oct 2015 02:58:45 +0000 (UTC) Cc: 21648@debbugs.gnu.org To: Jay Belanger Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 09 04:58:34 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 1ZkNtA-0003qV-UV for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Oct 2015 04:58:33 +0200 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkNss-0003ZI-1s for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 22:58:33 -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]:57159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkNsr-0003Wi-GA for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 22:58:13 -0400 Original-Received: from localhost ([::1]:38100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkNsr-0001lZ-C0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 22:58:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkNsl-0001lN-OY for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 22:58:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkNsi-0003M6-F1 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 22:58:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkNsi-0003Lx-Ah for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 22:58:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZkNsg-0004xF-ID for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 22:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Oct 2015 02:58: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 Original-Received: via spool by 21648-submit@debbugs.gnu.org id=B21648.144435943418984 (code B ref 21648); Fri, 09 Oct 2015 02:58:01 +0000 Original-Received: (at 21648) by debbugs.gnu.org; 9 Oct 2015 02:57:14 +0000 Original-Received: from localhost ([127.0.0.1]:33252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkNrt-0004w7-Br for submit@debbugs.gnu.org; Thu, 08 Oct 2015 22:57:14 -0400 Original-Received: from mail-oi0-f52.google.com ([209.85.218.52]:34673) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkNrq-0004vz-T0 for 21648@debbugs.gnu.org; Thu, 08 Oct 2015 22:57:11 -0400 Original-Received: by oiak8 with SMTP id k8so23449050oia.1 for <21648@debbugs.gnu.org>; Thu, 08 Oct 2015 19:57:10 -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=gyRoFdjAM2mjr19aIrNVx9TSbywvtbRiV2uUTWpT0Oo=; b=ZYLKVNRz6ozoiJYWPDVACGk1ZEGp5u8LBNbB0SaglXD+bGQ7o+G1aOzh2zbbFy2MM6 j11rRcPnj/jEIMji1Y/84Egz/CwNMMA3MtG8ft6RjbPTQoRtz7CxCciVycgwi8V6pMR8 6P9Lb8L40ZZkB8kb9ubKRnQEWO1FW/i2/pMM7e+yldoVRNODrjyiFDL6Jh3iipc5LvHI pkaAotXpbsa94OTKhl3ehi4DQhT5MdY84WfVt5Wq1OLZMYfl+2X8ysFyRtkVx3b5c1Du FXV0n8BpPHj1ZehevC9tci+8Ch89mJpohAWE0PJ9Ofq9v2tn3TC1XTwqfZqf/AEH/2sA ABrw== X-Received: by 10.202.211.10 with SMTP id k10mr6501556oig.34.1444359430007; Thu, 08 Oct 2015 19:57:10 -0700 (PDT) Original-Received: by 10.202.172.205 with HTTP; Thu, 8 Oct 2015 19:56:30 -0700 (PDT) In-Reply-To: <87fv1k3la1.fsf@gmail.com> 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:107476 Archived-At: --001a113d2cd6c10c4a0521a32286 Content-Type: text/plain; charset=UTF-8 Thanks for the feedback. The below code has every suggestion implemented except for the `math-numberstring-p`. I will need to thing more about how to implement that. Also the below condition might not be enough (even before we start thinking about math-numberstring-p): (or (null radix) (string-match-p "\\`[0-9]+#" thing-raw)) What if the user yanks the below string? 111 2#1111 In that case, the below code will generate the below if called using C-2 C-y 2#111 2#2#1111 The above case seems impractical. Or is it? Should we need to make the code foolproof against such unusual cases? If yes, then we need to ensure that either the radix prepending happens only if all yanked lines are pristine The below code has the following updated: - Support for negative numbers! - Error when user enters a non-integer or an integer <2 or >36 - Support for prepending the radix-notation to multiline yanks (assuming the yanks do not fit in the above mentioned strange case) - Made the referenced long message a bit concise. ====== (defun calc-yank (radix) "Yank a value into the Calculator buffer. Valid numeric prefixes for RADIX: 0, 2, 6, 8 No radix notation is prepended for any other numeric prefix. If RADIX is 2, prepend \"2#\" - Binary. If RADIX is 8, prepend \"8#\" - Octal. If RADIX is 0, prepend \"10#\" - Decimal. If RADIX is 6, prepend \"16#\" - Hexadecimal. If RADIX is a non-nil list (created using \\[universal-argument]), the user will be prompted to enter the radix in the minibuffer. If RADIX is nil or if the yanked string already has a calc radix prefix, the yanked string will be passed on directly to the Calculator buffer without any alteration." (interactive "P") (calc-wrapper (calc-pop-push-record-list 0 "yank" (let* (radix-num radix-notation (thing-raw (if (fboundp 'current-kill) (current-kill 0 t) (car kill-ring-yank-pointer))) (thing (if (or (null radix) (string-match-p "\\`\\-*[0-9]+#" thing-raw)) thing-raw (progn (setq radix-notation (if (listp radix) (progn (setq radix-num (read-number "Set radix for yanked number (2-36): ")) (if (and (integerp radix-num) (<= 2 radix-num) (>= 36 radix-num)) (concat (number-to-string radix-num) "#") (error (concat "The radix has to be an " "integer between 2 and 36.")))) (cond ((eq radix 2) "2#") ((eq radix 8) "8#") ((eq radix 0) "10#") ((eq radix 6) "16#") (t (progn (message (concat "No radix prepended " "for invalid numeric " "prefix %0d.") radix) ""))))) ;; Ensure that the radix-notation is prefixed ;; correctly even for multi-line yanks like ;; 111 ;; 1111 (replace-regexp-in-string "^\\(\\-*\\)\\(.*\\)" (concat "\\1" radix-notation "\\2") thing-raw))))) (if (eq (car-safe calc-last-kill) thing) (cdr calc-last-kill) (if (stringp thing) (let ((val (math-read-exprs (calc-clean-newlines 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)))))))) -- Kaushal Modi --001a113d2cd6c10c4a0521a32286 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the feedback.

The below code = has every suggestion implemented except for the `math-numberstring-p`.
I will need to thing more about how to implement= that.

A= lso the below condition might not be enough (even before we start thinking = about math-numberstring-p):

(or (null radix)
= =C2=A0 =C2=A0 =C2=A0(string-match-p= "\\`[0-9]+#" thing-raw))


<= br>
111
2#111= 1

In tha= t case, the below code will generate the below if called using C-2 C-y

2#111
2#2#1111

The above case seems impractical. Or is it? Should we nee= d to make the code foolproof against such unusual cases?
If yes, = then we need to ensure that either the radix prepending happens only if all= yanked lines are pristine=C2=A0

The below code ha= s the following updated:
- Support for negative numbers!
- Error when user enters a non-integer or an integer <2 or >36
- Support for prepending the radix-notation to multiline yanks (assum= ing the yanks do not fit in the above mentioned strange case)
- M= ade the referenced long message a bit concise.

=3D= =3D=3D=3D=3D=3D

(defun calc-yank (radix)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 "Yank a value into the Calculator buffer.

Valid numeric prefixes for RADIX: 0, 2, 6, 8
No radix notation is prepended for any other numeric prefix.

If RADIX is 2, prepend \"2#\"= ; =C2=A0- Binary.
If RADIX is 8, prepend \"8#\" = =C2=A0- Octal.
If RADIX is 0, prepend \"10#\" - = Decimal.
If RADIX is 6, prepend \"16#\" - Hexade= cimal.

If RADIX is a non-nil list (c= reated using \\[universal-argument]), the user
will be pro= mpted to enter the radix in the minibuffer.

If RADIX is nil or if the yanked string already has a calc radix pr= efix, the
yanked string will be passed on directly to the = Calculator buffer without any
alteration."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (interactive "P")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (calc-wrapper
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(calc-pop-push-record-list
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 "yank"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let* (radix-num<= /font>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0radix-notation
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(thing-raw (if (fboundp 'curre= nt-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 (curr= ent-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 (car = kill-ring-yank-pointer)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(thing (if (or (null radix)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 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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(concat &= quot;\\1" radix-notation "\\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 =C2=A0thing-raw)))))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =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-last-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 (mat= h-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 =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 (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 (setq val (math-read-exprs 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 (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 (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 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 val))))))))

--
Kaushal Modi

--001a113d2cd6c10c4a0521a32286--