all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard G Riley <rileyrgdev@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs into focus
Date: Sun, 10 Aug 2008 00:08:04 +0200	[thread overview]
Message-ID: <g7l4g6$78q$1@registered.motzarella.org> (raw)
In-Reply-To: g7e1l0$gi5$1@registered.motzarella.org

Richard G Riley <rileyrgdev@gmail.com> writes:

> Can someone recommend the best way to have emacs come to the foreground
> on a Linux desktop? I'm trying to get emacsclient wired up properly so I
> can handle mailto URLS from iceweasel (firefox) properly. I have tried:
>
> ,----
> | /usr/bin/emacsclient -e "(progn (raise-frame)(message-mail (substring \"$1\" 7) \"Subject\"  '((\"from\"  \"Richard Riley<rileyrgdev@gmail.com>\"))))"
> `----
>
> But raise-frame does not seem to work on my Gnome desktop.
>
> Replacing raise-frame with (bring-on-top)
>
> where
>
> ,----
> | (defun bring-on-top()
> |   (interactive)
> |    (x-send-client-message
> |     nil 0 nil "_NET_WM_STATE" 32 '(2 "_NET_WM_STATE_FULLSCREEN" 1))
> | )
> `----
>
> Does work but removes the WM border from the emacs frame.
>
> Does anyone have a cleaner solution?
>
> regards
>
> r.

In case this helps anyone else:

After digging around this was the best I came up with where (on Debian)
emacs.bash is a symbolic link to /usr/share/emacs/22.2/etc/emacs.bash

,---- gnus-mailto.sh ----
| #!/bin/sh
| wmctrl -a emacs22
| source ~/bin/emacs.bash
| edit --eval "(progn (johnsu01/mailto \"$1\"))" 
`----

and the necessary function to bring up posting styles I borrowed from
John Sullivans tips and added the gnus-alive-p check:

http://journal.wjsullivan.net/185095.html

,----
| (require 'gnus-util)
| 
| (defun johnsu01/mailto (url)
|   "Follow a mailto URL as passed from Iceweasel, prompting for a posting style."
|   (unless(gnus-alive-p)
|     (gnus))
| 
|   (message "Url is : %s" url)
| 
|   (let ((gnus-newsgroup-name
|          (completing-read "Use posting style of group: "
|                           gnus-active-hashtb nil
|                           (gnus-read-active-file-p))))
|     (setq url (url-unhex-string url))
|     (browse-url-mail url))
|   ;; message-mail does not do anything with the body argument, so we have to.
|   (if (string-match (regexp-quote "?") url)
|       (let* ((start (match-end 0))
|              (args (url-parse-query-string
|                     (substring url start nil)))
|              (body (cadr (assoc-string "body" args t))))
|         (when body
|           (switch-to-buffer (car (message-buffers)))
|           (save-excursion
|             (message-goto-body)
|             (insert body)))))
|   )
`----

On my debian system edit() does not actually start emacs if its not
already running but I think that might be a bug on my system at the
moment.



      parent reply	other threads:[~2008-08-09 22:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07  5:36 Emacs into focus Richard G Riley
2008-08-07  9:16 ` Tim X
2008-08-07  9:41 ` Joost Kremers
2008-08-07 11:01 ` Andrea Vettorello
2008-08-07 11:52 ` Chris Giroir
     [not found] ` <mailman.15986.1218106891.18990.help-gnu-emacs@gnu.org>
2008-08-07 14:33   ` Richard G Riley
2008-08-07 17:33     ` Andrea Vettorello
     [not found] ` <mailman.15993.1218120233.18990.help-gnu-emacs@gnu.org>
2008-08-07 14:53   ` Richard G Riley
2008-08-07 21:47     ` Bruce Stephens
2008-08-08  4:33       ` Tim X
2008-08-08  1:31 ` Ian Swainson
2008-08-09 22:08 ` Richard G Riley [this message]

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='g7l4g6$78q$1@registered.motzarella.org' \
    --to=rileyrgdev@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.