WorkWithEmacsclient
Pages 40
- Home
- Another way to handle the Gimp
- AwesomeModeLine
- Background
- Basic Concepts
- Billzimmerly
- Bugs
- CompilingSBCL
- Customize
- Debian Jessie and StumpWM
- Debugging reproducible crashing bugs or when crash StumpWM is likely to Crash
- EclPort
- EnscriptStumpWMCodePDF
- FAQ
- Frames and Windows
- Freezes
- Git
- GNUScreen
- GrabbedPointer
- HandlingTheGimp
- Modules
- Mounting Storage Devices
- NewLogo
- paste.lisp
- Setting Up a Desktop Environment
- SetUp
- StartUp
- StartUp: Kali Linux and GNOME and StumpWM
- StumpFriendlyTools
- StumpPatches
- StumpWM
- StumpWMAnticipatedInGNUManifesto
- StumpWMPackageGuidelines
- StumpWMStartScript
- SuggestedImprovements
- TipsAndTricks
- Ubuntu 12.04 and Gnome and StumpWM
- WhatIsLisp
- WorkWithEmacsclient
- Xubuntu XFCE AndStumpWM
- Show 25 more pages…
Clone this wiki locally
If Emacs is invoked by emacslient from a command line, raise the emacs window.
After press C-x #, the window turn auto back.
First: Add follow code to your .stumpwmrc
(defvar *es-win* nil
"to hold the windo called emacsclient")
(defun save-es-called-win ()
(setf *es-win* (current-window)))
(defun return-es-called-win (win)
(let* ((group (window-group win))
(frame (window-frame win))
(old-frame (tile-group-current-frame group)))
(frame-raise-window group frame win)
(focus-all win)
(unless (eq frame old-frame)
(show-frame-indicator group))))Second: In you .emacs you have to include
(add-hook 'after-init-hook 'server-start)
(setq server-raise-frame t)
(if window-system
(add-hook 'server-done-hook
(lambda () (shell-command "stumpish 'eval (stumpwm::return-es-called-win stumpwm::*es-win*)'"))))Third:
cat > ~/bin/es << EOF
#!/bin/sh
stumpish 'eval (stumpwm::save-es-called-win)' > /dev/null
emacsclient --alternate-editor=$ALTERNATE_EDITOR "$@"
EOFFor example: You edit or view a file with command $: es xxxx, the emacs will
raise up and after you finish with `C-x #' the window will turn back.
And you may set default editor to es.
export EDITOR=es
export ALTERNATE_EDITOR=vi
export VISUAL=esNote from Ejlflop (that's me!):
You may need to edit the es command (~/bin/es) and remove the backslash in "$@" Also, if you want to open a new emacs frame rather than reuse an existing one (which may involve a bit of tedious application switching, change "emacsclient" to "emacsclient -c".
If you are using the Firefox extension "ItsAllText", you may also want to set its editor to the "es" command -- it seemed to work fine when I did it.
Note: also, there is stumpmacs stumpwm module: https://gitorious.org/dss-project/stumpmacs/