help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use Emacs to compose emails for Gmail web interface


From: Jorge
Subject: Re: Use Emacs to compose emails for Gmail web interface
Date: Wed, 18 Sep 2013 21:16:08 -0300

On Wed, Sep 18, 2013 at 9:03 PM, Jorge <address@hidden> wrote:
> I have eased the problem with some Emacs Lisp.  The following is in my .emacs:

I've made it more general:

(global-set-key "\C-xg" 'clipboard-get)
(global-set-key "\C-xp" 'clipboard-put)
(setq clipboard-temp-file (make-temp-file "clipboard_for_emacs"))
(defun clipboard-get ()
  "Visit clipboard-temp-file, delete all text in it, yank the X
clipboard, delete trailing whitespace, go to beginning of
buffer."
(interactive)
(find-file clipboard-temp-file)
(delete-region (point-min) (point-max))
(clipboard-yank)
(delete-trailing-whitespace)
(goto-char (point-min)))

(defun clipboard-put ()
"Copy the whole buffer to the X clipboard, kill it."
(interactive)
(clipboard-kill-ring-save (point-min) (point-max))
(save-buffer)
(kill-buffer))

Did I do anything wrong?

Regards



reply via email to

[Prev in Thread] Current Thread [Next in Thread]