在 Linux Mint 上,如何在引导为正常用户时以服务器身份运行 emacs?

分享于 

分钟阅读

 
点击句子查看译文 显示原文      显示译文      双语对照    源址


Question :

i want to run the cmd :


#!/bin/bash 


emacs --daemon



to start emacs as server.i write it in a file myinit in etc/init.d and make a link S90myinit in etc/rcS.d, it works for root user, but login as normal user and run emacsclient, it doesn't work.

why? help,thanks!


Answer 1 :

Dont bother. Simply use the alternate editor option.my EDITOR is set ~/bin/edit where edit is a script containing the following: -


#!/bin/bash


# edit


export GDK_NATIVE_WINDOWS=1


exec emacsclient --alternate-editor="""$@"



This will start the daemon if its not already active.


Answer 2 :

You have to run Emacs as the user you want use Emacs.usually the best is to not run it at boot time but at login time using e.g. Gnome's autostart feature.

If you really want to run it at boot time use something like


 su -l your_user -c/some/script 



where you replace /some/script with the path of a shell script that starts Emacs and your_user with your user



Server  USE  BOO  引导  用户  Emacs