emacsclient

How can I set the port that the Emacs Server uses?

别来无恙 提交于 2020-01-03 08:21:30
问题 I use Emacs to do most of my development work, I'd like to be able to connect to the Emacs server running on my office workstation from home. I connect to my office network over a VPN, I think this is mostly safe. Anyway, I have a script that copies the server authentication file out, but it looks like the port changes every time. Our VPN is pretty locked down, I need to tell our sysadmin what ports I want open to which machines. Is there a way to set the port that the Emacs server listens on

How can I set the port that the Emacs Server uses?

江枫思渺然 提交于 2020-01-03 08:21:01
问题 I use Emacs to do most of my development work, I'd like to be able to connect to the Emacs server running on my office workstation from home. I connect to my office network over a VPN, I think this is mostly safe. Anyway, I have a script that copies the server authentication file out, but it looks like the port changes every time. Our VPN is pretty locked down, I need to tell our sysadmin what ports I want open to which machines. Is there a way to set the port that the Emacs server listens on

Emacsclient hook on kill

自古美人都是妖i 提交于 2020-01-01 09:28:10
问题 I am trying to find a hook in Emacs, which should fire right before emacs server graceful shutdown. I tried kill-emacs-query-functions, kill-emacs-hook, server-done-hook with elisp like : (add-hook 'server-done-hook '(lambda () (savehist-save) ) ) ... but none of them is called when OS shuts down, so history is not saved. Maybe someone could give a hint? P.S. I am on Gentoo Linux, emacs-vcs-23.2.9999 package, terminal only. For testing desired behaviour Emacs is stopped using start-stop

Evaluate emacs lisp expression on command line

孤街醉人 提交于 2020-01-01 05:08:17
问题 I'm a newbie to emacs. I'm working with emacs-24.1 on redhat linux, and trying to evaluate an elisp expression. What I want emacs to do is to evaluate the elisp expression without launching emacs itself. I'm trying different things emacs --eval '(+ 2 3)' I do not know if emacs is evaluating the expression, but the result is not shown on console and emacs window comes up. Next I tried this emacsclient --eval '(+ 2 3)' Emacs client is expecting a server. It could not find the server and hence

remote emacs client connects, but doesn't create new frame in terminal

心已入冬 提交于 2019-12-23 17:27:33
问题 I configured and started an emacs server in TCP mode: Added (setq server-host "10.16.184.33") and (setq server-use-tcp t) to .emacs ran emacs --daemon On the same host, running emacsclient -t brings up an emacs frame in the current terminal, and running emacsclient -c brings up a new graphical client frame, as expected. On a different host, running emacsclient -t -f ~/.emacs.d/server/server appears to successfully connect to the remote emacs server, but no frame is created in the terminal: $

how to check if emacs in frame or in terminal?

▼魔方 西西 提交于 2019-12-23 09:23:43
问题 Based on this question : How to set emacsclient background as Emacs background? I need background only for frames, not for terminal and not for console. Here is how I'm trying to add fix for console (when (display-graphic-p) (tool-bar-mode -1) (scroll-bar-mode t) (require 'nyan-mode) (nyan-mode) (nyan-start-animation) (mouse-wheel-mode t) (setq default-frame-alist '((background-color . "#101416") (foreground-color . "#f6f3e8")) ) ) But with that I don't get background on emacsclient (even for

Alias to make emacs open a file in a new buffer (NOT frame) and be activated/come to front?

有些话、适合烂在心里 提交于 2019-12-22 08:18:02
问题 What I have so far is alias em="open -a /Applications/Emacs.app "$@" && osascript -e 'tell application "Emacs.app" to activate'" But I am stumped. With that code, em file.txt will activate, but won't open the file . And I get '22:23: syntax error: Expected end of line but found unknown token. (-2741)' Doing alias em=open -a /Applications/Emacs.app "$@" Works fine and then it will open the file, but obviously not bring emacs to the front. And for some strange reason osascript -e 'tell

Using a single emacs instance from multiple (virtual) machines

丶灬走出姿态 提交于 2019-12-21 05:36:22
问题 I love emacsclient. It allows me to use a single Emacs frame for all my editing, also when programs want to open an editor (i.e. export EDITOR=emacsclient ). I'd like to have it work like this with virtual machines, too. I can use tramp to edit remote files with Emacs in my single-frame setup, and it works very well, but it's not enough. When I invoke git commit or sudoedit , I'll have to use the crappy terminal-based editor that happens to be installed on the remote machine. So, is there

How to remove the prompt for killing emacsclient buffers?

放肆的年华 提交于 2019-12-20 09:36:17
问题 After I open something with emacsclient, when I kill that buffer (C-x k) I get a confirmation dialog: Buffer `blah' still has clients; kill it? (yes or no) But when I kill buffers opened directly from Emacs I don't. Is there a way not to get them when emacsclient opened them? 回答1: This worked for me: (remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function) There's more information on Using Emacsclient blog entry. 回答2: The other option is to use the -n option with

emacsclient window focus

别说谁变了你拦得住时间么 提交于 2019-12-19 15:45:12
问题 How do I consistently control window focus after running emacsclient? Currently, focus depends on if I already have an emacs server running. When emacsclient invokes an alternative editor, focus is shifted to the new emacs window. When emacsclient connects to an existing emacs server, focus is not shifted (ie. it stays on my putty client). I would like to consistently focus on the emacs window, since I usually go to emacs after opening a file. Any help would be greatly appreciated! Notes