all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jorge <1gato0a@gmail.com>
To: Jorge <1gato0a@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Use Emacs to compose emails for Gmail web interface
Date: Wed, 18 Sep 2013 21:03:48 -0300	[thread overview]
Message-ID: <CAJR3Qndork0bG2ba_rMPnqzpty-zu_-om8jd7p_6vJdVD=Kf6g@mail.gmail.com> (raw)
In-Reply-To: <CAJR3QncGndPEMuGfZLC7vOfEwhgTfr9wLhjvE8gp-LCJNSW+wQ@mail.gmail.com>

On Wed, Sep 18, 2013 at 1:57 PM, Jorge <1gato0a@gmail.com> wrote:
> [...] every time I compose an email, I type `c' in Gmail (to open compose),
> then C-a (to select all), C-c , change focus to Emacs, C-M-y (which I have
> bound to clipboard-yank), M-x delete-trailing-whitespace, edit the email,
> C-x h, C-M-w (which I have bound to clipboard-kill-ring-save), change focus
> to gmail, C-v.

I have eased the problem with some Emacs Lisp.  The following is in my .emacs:

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

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

(defun gmail (prefix)
  "Without prefix argument: call gmail-enter.
With prefix argument: call gmail-leave"
  (interactive "P")
  (if prefix
      (gmail-leave)
    (gmail-enter)))

Did I do anything wrong?

Regards



  parent reply	other threads:[~2013-09-19  0:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 16:57 Use Emacs to compose emails for Gmail web interface Jorge
2013-09-18 18:07 ` James Freer
2013-09-19  0:03 ` Jorge [this message]
2013-09-19  0:16   ` Jorge
2013-10-20 11:48 ` Menelaos Maglis
2013-10-20 16:36   ` James Freer
     [not found] ` <mailman.4343.1382279379.10748.help-gnu-emacs@gnu.org>
2013-10-20 19:03   ` Emanuel Berg
2013-10-22 20:07     ` Menelaos Maglis
     [not found]     ` <mailman.4492.1382472445.10748.help-gnu-emacs@gnu.org>
2013-10-22 22:23       ` Emanuel Berg
     [not found] <mailman.2424.1379523442.10748.help-gnu-emacs@gnu.org>
2013-09-18 17:07 ` Dan Espen
2013-09-19 16:32   ` Jorge
2013-09-19 20:41     ` James Freer
2013-09-19 22:33     ` Suvayu Ali
     [not found]   ` <mailman.2526.1379608362.10748.help-gnu-emacs@gnu.org>
2013-09-19 16:37     ` Dan Espen

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

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

  git send-email \
    --in-reply-to='CAJR3Qndork0bG2ba_rMPnqzpty-zu_-om8jd7p_6vJdVD=Kf6g@mail.gmail.com' \
    --to=1gato0a@gmail.com \
    --cc=help-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 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.