all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* FW: calc-yank.el
       [not found] ` <20170103205239.GA5869@belanger-laptop>
@ 2017-01-10 23:49   ` Driscoll, Kevin R
  2017-01-11  3:52     ` Kaushal Modi
  0 siblings, 1 reply; 3+ messages in thread
From: Driscoll, Kevin R @ 2017-01-10 23:49 UTC (permalink / raw)
  To: emacs-devel@gnu.org

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 <kevin.driscoll@honeywell.com>
Subject: Re: calc-yank.el

Hi Kevin,

I'm a little surprised that digit-grouped numbers aren't handled properly 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 <kevin.driscoll@honeywell.com>
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’s 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 with 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 ‘’calc-group-digits’’ below could be replaced with “calc-yank-grouped” or “(and calc-group-digits calc-yank-grouped)”.  This doesn’t handle radix > 10; yanking these are very rare for grouped numbers and there’s 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      Cell: +1 612-801-9520       FAX: +1 763-954-5473
Honeywell; MN10-122B; 1985 Douglas Dr. N.; Golden Valley; MN 
55422-3992; USA

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FW: calc-yank.el
  2017-01-10 23:49   ` FW: calc-yank.el Driscoll, Kevin R
@ 2017-01-11  3:52     ` Kaushal Modi
  2017-01-11  8:35       ` Bastian Beischer
  0 siblings, 1 reply; 3+ messages in thread
From: Kaushal Modi @ 2017-01-11  3:52 UTC (permalink / raw)
  To: Driscoll, Kevin R, emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 3675 bytes --]

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=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 <kevin.driscoll@honeywell.com>
> Subject: Re: calc-yank.el
>
> Hi Kevin,
>
> I'm a little surprised that digit-grouped numbers aren't handled properly
> 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 <kevin.driscoll@honeywell.com>
> 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’s 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 with
> 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 ‘’calc-group-digits’’
> below could be replaced with “calc-yank-grouped” or “(and calc-group-digits
> calc-yank-grouped)”.  This doesn’t handle radix > 10; yanking these are
> very rare for grouped numbers and there’s 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      Cell: +1 612-801-9520       FAX: +1
> 763-954-5473
> Honeywell; MN10-122B; 1985 Douglas Dr. N.; Golden Valley; MN
> 55422-3992; USA
>
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 6173 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FW: calc-yank.el
  2017-01-11  3:52     ` Kaushal Modi
@ 2017-01-11  8:35       ` Bastian Beischer
  0 siblings, 0 replies; 3+ messages in thread
From: Bastian Beischer @ 2017-01-11  8:35 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: emacs-devel@gnu.org, Driscoll, Kevin R

[-- Attachment #1: Type: text/plain, Size: 4454 bytes --]

Hello,

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

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23629

Cheers
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  different radixes:
> http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=
> 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 <kevin.driscoll@honeywell.com>
>> Subject: Re: calc-yank.el
>>
>> Hi Kevin,
>>
>> I'm a little surprised that digit-grouped numbers aren't handled properly
>> 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 <kevin.driscoll@honeywell.com>
>> 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’s 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 with
>> 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 ‘’calc-group-digits’’
>> below could be replaced with “calc-yank-grouped” or “(and calc-group-digits
>> calc-yank-grouped)”.  This doesn’t handle radix > 10; yanking these are
>> very rare for grouped numbers and there’s 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
>



-- 
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

[-- Attachment #2: Type: text/html, Size: 9898 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-11  8:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <DM2PR0701MB1311E97560FC2F28BCDA0917836E0@DM2PR0701MB1311.namprd07.prod.outlook.com>
     [not found] ` <20170103205239.GA5869@belanger-laptop>
2017-01-10 23:49   ` FW: calc-yank.el Driscoll, Kevin R
2017-01-11  3:52     ` Kaushal Modi
2017-01-11  8:35       ` Bastian Beischer

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.