unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: bug#6635: mouse-yank-primary/secondary and unicode from other apps.
Date: Wed, 14 Jul 2010 23:29:11 -0600	[thread overview]
Message-ID: <i1m6b9$gvt$1@dough.gmane.org> (raw)
In-Reply-To: <4C3E5873.9090909@harpegolden.net>

David De La Harpe Golden wrote:
> mouse-yank-primary and mouse-yank-secondary don't like
> inserting non-ascii chars from other apps.
> 
> They need to use the slightly higher-level
> (x-selection-value 'PRIMARY)
> 
> or at least give a 'TEXT arg to their
> (x-get-selection 'PRIMARY 'TEXT),
> 
> so that the proper kinds of selection type are tried
> as e.g. attached.
...
-  (let ((primary (x-get-selection 'PRIMARY)))
+  (let ((primary (x-selection-value 'PRIMARY)))
      (if primary
-        (insert (x-get-selection 'PRIMARY))
+        (insert (x-selection-value 'PRIMARY))
        (error "No primary selection"))))
...
-  (let ((secondary (x-get-selection 'SECONDARY)))
+  (let ((secondary (x-selection-value 'SECONDARY)))
      (if secondary
-        (insert (x-get-selection 'SECONDARY))
+        (insert (x-selection-value 'SECONDARY))
        (error "No secondary selection"))))

Can someone explain why the result of x-get-selection/x-selection-value
is bound to a variable, but instead of referencing the variable in the
insert function call the expression is evaluated again?  I.e. why not
change it to:

  (let ((primary (x-selection-value 'PRIMARY)))
    (if primary
        (insert primary)
      (error "No primary selection"))))
...
  (let ((secondary (x-selection-value 'SECONDARY)))
    (if secondary
        (insert secondary)
      (error "No secondary selection"))))

Thanks,

-- 
Kevin Rodgers
Denver, Colorado, USA






  reply	other threads:[~2010-07-15  5:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15  0:38 bug#6635: mouse-yank-primary/secondary and unicode from other apps David De La Harpe Golden
2010-07-15  5:29 ` Kevin Rodgers [this message]
2010-07-18 16:39   ` David De La Harpe Golden
2011-10-06 21:42 ` Glenn Morris
2011-10-06 23:17   ` David De La Harpe Golden

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='i1m6b9$gvt$1@dough.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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 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).