unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* copy and paste
@ 2009-01-07  5:35 锁住子
  0 siblings, 0 replies; 4+ messages in thread
From: 锁住子 @ 2009-01-07  5:35 UTC (permalink / raw)
  To: help-gnu-emacs

I found the functions below online somewhere, for easing the process
of copying and pasting between emacs and Mac OSX's clipboard. It
works, but doesn't seem to be encoding aware -- if I kill from a
unicode-encoded buffer and paste into a different osx application (eg
Mail), non-ASCII characters come out garbled. My language environment
is set to UTF-8, is there something I can add in the functions below
that will specify string encoding? I'm trying to achieve all Unicode,
all the time.

Thanks!

Eric


(defun copy-from-osx ()
 (shell-command-to-string "pbpaste"))

(defun paste-to-osx (text &optional push)
 (let ((process-connection-type nil))
   (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
     (process-send-string proc text)
     (process-send-eof proc))))

(setq interprogram-cut-function 'paste-to-osx)
(setq interprogram-paste-function 'copy-from-osx)


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <mailman.3198.1169037917.2155.help-gnu-emacs@gnu.org>]
* copy and paste
@ 2007-01-17 12:45 Roger Mason
  0 siblings, 0 replies; 4+ messages in thread
From: Roger Mason @ 2007-01-17 12:45 UTC (permalink / raw)


Hello,

I'm having trouble copying from other (X) applications into emacs:
whenever I use the middle mouse button I always get pasted the last
entry from the emacs kill ring.

I have the following set, as per the wiki:

x-select-enable-clipboard's value is t

interprogram-paste-function's value is
x-cut-buffer-or-selection-value

Thanks for any help,
Roger Mason

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

end of thread, other threads:[~2009-01-07  5:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07  5:35 copy and paste 锁住子
     [not found] <mailman.3198.1169037917.2155.help-gnu-emacs@gnu.org>
2007-01-18 12:39 ` Martin
2007-01-20 14:50   ` Roger Mason
  -- strict thread matches above, loose matches on Subject: below --
2007-01-17 12:45 Roger Mason

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