Emacs: usando emacsclient

Emacs: usando emacsclient

Siempre configuro emacs ejecutándose en modo servidor, y cada vez que actualizo Ubuntu, el procedimiento para hacerlo cambia.

Aunque tengo la misma configuración en mi /.bash_aliasesy /.emacs, no funcionará.

Tengo emacs 24.3.x (cualquiera que sea la versión más reciente), tengo AUCTeX cvs y TeX Live 2013 instalados.

En mi ./bash_aliasestengo

emacs = 'emacsclient -t --alternate-editor='

La información relevante en mi /.emacses

;; Start server and set directory                                               
(setq server-socket-dir (format "/tmp/emacs%d" (user-uid)))
(server-start)

(custom-set-variables
 '(TeX-PDF-mode t)
 '(TeX-show-compilation t)
 '(TeX-newline-function (quote newline-and-indent))
 '(TeX-source-correlate-method (quote synctex))
 '(TeX-source-correlate-mode t)
 '(TeX-source-correlate-start-server t))

Los problemas sólo ocurren al abrir archivos LaTeX. A veces dice que se está ejecutando otro servidor y otras veces dice:

dustin@dustin:~/Documents/NUPOC/NUPOCSoln$ emacs SolnNUPOC.tex 
emacsclient.emacs24: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
Warning: due to a long standing Gtk+ bug
http://bugzilla.gnome.org/show_bug.cgi?id=85715
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
("emacs")
Loading 00debian-vars...
Loading 00debian-vars...done
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Error while loading 50dictionaries-common: Symbol's value as variable is void: debian-aspell-only-dictionary-alist
Loading paren...
Loading paren...done
Warning: no abbrev-file found, customize `abbrev-file-name' in order to make mode-specific abbrevs work. 
Starting Emacs daemon.
Restarting server

leí en elmanualuna nota a pie de página que:


Algunos programas utilizan una variable de entorno diferente; por ejemplo, para hacer que TeX use 'emacsclient', establezca la variable de entorno TEXEDIT en 'emacsclient +%d %s'.


No hay ninguna mención (que pueda encontrar) sobre dónde y cómo configurar el entorno TEXEDIT.

  1. ¿Cómo configuro el entorno TEXEDIT? o
  2. ¿Cómo puedo configurar emacsclient para que funcione?

Esta configuración funcionó antes de tener que reinstalar todo.

Respuesta1

Pude hacer que el servidor se iniciara y funcionara synctex. Todavía emitirá este mensaje:

emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".

Warning: due to a long standing Gtk+ bug
http://bugzilla.gnome.org/show_bug.cgi?id=85715
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
Loading paren...
Loading paren...done
Loading server...
Loading server...done
Warning: no abbrev-file found, customize `abbrev-file-name' in order to make mode-specific abbrevs work. 
Starting Emacs daemon.
Restarting server
Emacs daemon should have started, trying to connect again

Lo que cambié fue mi /.bash_aliasesy /.emacs.

Si abre emacs primero sin especificar un archivo y luego abre un archivo, no recibirá la advertencia anterior. No tengo idea de por qué funciona perfectamente en ese orden en lugar de ir directamente a un archivo.

Para mis alias, ahora tengo:

# emacs aliases for server mode
alias emacs='emacsclient -t -s server --alternate-editor='

El -ses la abreviatura de --socket-name=; por lo tanto, -s serveres --socket-name=server.

Encontré esto para M-x describe-variableentonces server-socket-namey el nombre debería aparecer para usted. Además, podemos ubicar el directorio con el mismo M-xy luegoserver-socket-dir

En mi ~/.emacscambié:

;; Start server and set directory                
(setq server-socket-dir (format "/tmp/emacs1000" (user-uid)))
;(server-start)  has been commented out

En las variables del conjunto personalizado, agregué: '(server-mode t).

No sé si hay una diferencia entre (server-start)y las variables personalizadas '(server-mode t). Probaré usando uno u otro y ambos para ver qué pasa más adelante.

información relacionada