emacsclient

Using Emacs server and emacsclient on other machines as other users

巧了我就是萌 提交于 2019-12-17 21:40:06
问题 I know that after I call (start-server) inside an existing Emacs session I can then use emacsclient -c (on the same computer) to create new frames that connect into that server, so that each new frame created by emacsclient has access to the same set of shared state (e.g. buffers). Most of the documentation I've found focuses on the "give me fast access to my local Emacs" use case, and so there are two things that I haven't seen any details of yet: Can emacsclient -c access Emacs servers

even when emacsclient is started in a terminal, window-system is non-nil

大兔子大兔子 提交于 2019-12-12 10:47:56
问题 I want to call some functions when I run emacsclient in a terminal emulator. The code I have works when Emacs is started in a text-only terminal. When I start Emacs in graphical mode and run emacsclient -t in a terminal, the functions do not run so I cannot use the mouse in the terminal emulator. Here is the code in question: (defun my-terminal-config (&optional frame) "Establish settings for the current terminal." (message (format "%s" window-system)) ;; "ns" (Mac OS X) when Emacs is started

How do I get my cocoa emacs on Mac OS X to load my .emacs visual customizations for new windows (any document opened after the first)?

老子叫甜甜 提交于 2019-12-11 05:24:51
问题 So I just downloaded emacs 23.1 for my new snow leopard macbook pro from http://emacsformacosx.com/ and it works like a charm, except... I have visual customizations in my .emacs, a few lines are extracted here: (set-background-color "black") (set-cursor-color "green") (set-default-font "- -Lucida Console-normal-r-normal-normal-18- -96-96-c-*-iso10646-1") I also have some key bindings set up, here are a few lines of those (global-set-key "\C-l" `goto-line) (global-set-key [(control ?%)]

OS X: how to make command-line script appear as helper application to handle mailto?

时光毁灭记忆、已成空白 提交于 2019-12-11 03:57:37
问题 I'm trying to configure Emacs as my preferred application when the user clicks on a mailto: link. Emacs has facilities for this: emacs 23 on OS X: mailto links & calling compose-mail? http://www.emacswiki.org/emacs/MailtoHandler and I'll do it by creating a shell script that then calls emacsclient ("emacs-mailto-handler" in the previous link). Unfortunately, when I go to Firefox, Preferences, Applications, it doesn't recognize shell scripts. Instead it wants an OS X application bundle (at

Emacs - connect to daemon (if it exists) without using emacsclient

孤街浪徒 提交于 2019-12-10 19:13:50
问题 If I have emacs running as a daemon on my system, I can connect to it easily using emacsclient. This I know. However, what I would like to know is, is there a way to tell emacs (not emacsclient) to behave like emacsclient if a daemon is already running? e.g. # emacs daemon is not running emacs # should start a new frame # ... # emacs daemon IS running emacs # should actually behave like emacsclient, i.e. connect to my daemon Is there anything I can do to my init.el to replicate this kind of

How can I set styling and positioning of a newly created emacsclient?

蹲街弑〆低调 提交于 2019-12-10 09:52:20
问题 I've recently switched to emacsclient for most text editing. I am trying to migrate some of my settings to the new (and slightly different) environment. In particular, in my .emacs file I have a function that sets the window size, and prepares some themes. However code in the .emacs file is not executed on each invocation of emacsclient, so the settings do not apply to these windows. Based on the question here, I added a hook to 'server-visit-hook that called a function which executed my

emacs-daemon startup freezes if file has auto-save data

丶灬走出姿态 提交于 2019-12-07 02:44:29
问题 I set up desktop.el so that emacs automatically reopens all files on startup that were left open last time I killed emacs. Now when I start emacs as a daemon and one of the reopened files has auto-save-data, the daemon displays the usual auto-save-data-message ("...file has auto save data...") and waits for confirmation - but does not continue the initialization. Without confirmation the daemon will stay in this state and new connections (eg via emacsclient -c ) are accepted but not processed

How can I set styling and positioning of a newly created emacsclient?

早过忘川 提交于 2019-12-06 00:35:34
I've recently switched to emacsclient for most text editing. I am trying to migrate some of my settings to the new (and slightly different) environment. In particular, in my .emacs file I have a function that sets the window size, and prepares some themes. However code in the .emacs file is not executed on each invocation of emacsclient, so the settings do not apply to these windows. Based on the question here , I added a hook to 'server-visit-hook that called a function which executed my settings. However, the settings are not being applied when I restart the server and invoke emacsclient.

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

喜欢而已 提交于 2019-12-05 15:58:00
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 application "Emacs.app" to activate' doesn't activate emacs.... I have no idea what is going on. I am happy to

emacs-daemon startup freezes if file has auto-save data

一世执手 提交于 2019-12-05 06:35:48
I set up desktop.el so that emacs automatically reopens all files on startup that were left open last time I killed emacs. Now when I start emacs as a daemon and one of the reopened files has auto-save-data, the daemon displays the usual auto-save-data-message ("...file has auto save data...") and waits for confirmation - but does not continue the initialization. Without confirmation the daemon will stay in this state and new connections (eg via emacsclient -c ) are accepted but not processed. Is there a way to disable confirmations during the daemons startup? edit: Updated to match Zarza's