unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] trunk r116989: 2014-04-17 Daniel Colascione <dancol@dancol.org>
       [not found] <E1WahAO-0005QG-Ab@vcs.savannah.gnu.org>
@ 2014-04-17 12:52 ` Stefan Monnier
  2014-04-17 13:46   ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2014-04-17 12:52 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: emacs-devel

>   	* term/xterm.el (xterm-extra-capabilities): Fix bitrotted comment.
>   	(xterm-paste-ending-sequence): New constant.
>   	(xterm-paste): New command used for bracketed paste support.

Cool, thanks.  Didn't know about that feature of xterm.

> +                          (let ((event (read-event)))
> +                            (when (eql event ?\r)
> +                              (setf event ?\n))
> +                            (insert event)))

A better version would be:

                          (let ((event (read-event)))
                            (insert (if (when (eq event ?\r) ?\n event))))

Note that not only it's better for karma since you don't use setq/setf,
but it's also faster.


        Stefan



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

* Re: [Emacs-diffs] trunk r116989: 2014-04-17 Daniel Colascione <dancol@dancol.org>
  2014-04-17 12:52 ` [Emacs-diffs] trunk r116989: 2014-04-17 Daniel Colascione <dancol@dancol.org> Stefan Monnier
@ 2014-04-17 13:46   ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2014-04-17 13:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Daniel Colascione, emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

> A better version would be:
>
>                           (let ((event (read-event)))
>                             (insert (if (when (eq event ?\r) ?\n event))))

Except that you want to remove the extra when.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



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

end of thread, other threads:[~2014-04-17 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1WahAO-0005QG-Ab@vcs.savannah.gnu.org>
2014-04-17 12:52 ` [Emacs-diffs] trunk r116989: 2014-04-17 Daniel Colascione <dancol@dancol.org> Stefan Monnier
2014-04-17 13:46   ` Andreas Schwab

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).