[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs into focus
Richard G Riley
Re: Emacs into focus
Sun, 10 Aug 2008 00:08:04 +0200
Emacs 22.2.1/No Gnus v0.11
Richard G Riley <address@hidden> 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<address@hidden>\"))))"
> But raise-frame does not seem to work on my Gnome desktop.
> Replacing raise-frame with (bring-on-top)
> | (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?
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 ----
| 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:
| (require 'gnus-util)
| (defun johnsu01/mailto (url)
| "Follow a mailto URL as passed from Iceweasel, prompting for a posting
| (message "Url is : %s" url)
| (let ((gnus-newsgroup-name
| (completing-read "Use posting style of group: "
| gnus-active-hashtb nil
| (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)))
| (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
- Re: Emacs into focus, (continued)
- Re: Emacs into focus, Ian Swainson, 2008/08/07
- Re: Emacs into focus,
Richard G Riley <=