all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jay Belanger <jay.p.belanger@gmail.com>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: 21648@debbugs.gnu.org
Subject: bug#21648: 25.0.50; [PATCH] Add ability to specify radix for the yanked number in calc-yank
Date: Thu, 08 Oct 2015 20:04:06 -0500	[thread overview]
Message-ID: <87fv1k3la1.fsf@gmail.com> (raw)
In-Reply-To: <CAFyQvY1im4vtJZmQ6o_JKsNb5VFMQmGzi5q5K1+oZXJDF+3y+g@mail.gmail.com>


Hi!

> ​Done! I have implemented C-u C-y functionality which will prompt user to enter radix between 2 and 36.​
>
>> And perhaps some sort of message
>> if the entered radix isn't a number from 2 to 36 (the allowed radixes).
>
> Is that check needed in calc-yank? If I enter an invalid radix like
> 37, I get the generic error "Bad format in yanked data".​

But the data might be fine; the problem is with the radix.

>> ​Also, you probably want to make sure that calc-yank behaves
>> appropriately when a number isn't being yanked.
>
> Can you please provide feedback on how to incorporate that based on the below updated code?

To determine whether or not a string represents a number, you could have
Calc parse it, I suppose.  But that would be wasteful.
It might be better to add a function, maybe called
`math-numberstring-p', which returns t is the argument is a string
which represents a Calc number.  Then along with
  (or ((null radix)
      (string-match-p "\\`[0-9]+#" thing-raw)
      ...
you could add
      (not (math-numberstring-p thing-raw))

Oh, also, calc-yank can yank more than one line.  Currently, if

111
1111

is killed and yanked with C-8 C-y,
the result is

2:  73
1:  1111

and you'd probably want

2:  73
1:  585

Also, the message
  (message
  (concat "No radix is "
   "prepended for prefix "
  "value of %0d. Valid "
  "numeric prefixes are "
  "0, 2, 6, 8.")
   radix)
is a bit long.

> I can submit a PATCH once the new definition is confirmed.

I can commit this for you without a patch.

Jay





  reply	other threads:[~2015-10-09  1:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 15:07 bug#21648: 25.0.50; [PATCH] Add ability to specify radix for the yanked number in calc-yank Kaushal Modi
2015-10-08 16:08 ` Jay Belanger
2015-10-08 16:19   ` Kaushal Modi
2015-10-08 16:59     ` Kaushal Modi
2015-10-08 19:26       ` Jay Belanger
2015-10-08 20:35         ` Kaushal Modi
2015-10-09  1:04           ` Jay Belanger [this message]
2015-10-09  2:56             ` Kaushal Modi
     [not found]               ` <8737xk7nge.fsf@gmail.com>
     [not found]                 ` <CAFyQvY3YBu1x4wcib++K_mTGfRNLqBfPBaj90rYJriZAuk-9Gg@mail.gmail.com>
     [not found]                   ` <CAFyQvY04LqeGAwyWMGFFDpHDqkb1TbW+vfH9drHruq6+yhVRpw@mail.gmail.com>
     [not found]                     ` <87twq0dkqd.fsf@gmail.com>
     [not found]                       ` <CAFyQvY1-yu9QQhzaQLVv9MLLkBQmOxY=usidbguSJnr9xwKp6g@mail.gmail.com>
     [not found]                         ` <87vbael6ph.fsf@gmail.com>
     [not found]                           ` <CAFyQvY07v3P2bjUQ+PAJbvUQu_nXV=k+umVW-JeKK2r=uWS=_Q@mail.gmail.com>
     [not found]                             ` <87twpyuz1q.fsf@gmail.com>
     [not found]                               ` <CAFyQvY3BbgGimetANnnZ-P13KXvH54_QHqcYF3sAiPWFaz=NFA@mail.gmail.com>
     [not found]                                 ` <87vbaeib5o.fsf@gmail.com>
2015-10-12 13:16                                   ` Kaushal Modi
2015-10-08 16:30   ` Eli Zaretskii
2015-10-08 18:11     ` Jay Belanger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fv1k3la1.fsf@gmail.com \
    --to=jay.p.belanger@gmail.com \
    --cc=21648@debbugs.gnu.org \
    --cc=kaushal.modi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.