📄 00000027.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>发信人: althea (稻草人), 信区: Linux <BR>标 题: [part 1] emacsport.el <BR>发信站: BBS 水木清华站 (Fri Dec 29 23:40:40 2000) <BR> <BR>;;; emacsport.el --- run emacsport server to wait incoming requests <BR> <BR>;; Copyright (C) 2000 Free Software Foundation, Inc. <BR> <BR>;; Author: <<A HREF="mailto:pact@pact3.cs.pku.edu.cn>">pact@pact3.cs.pku.edu.cn></A> <BR>;; Keywords: convenience, frames, processes <BR> <BR>;; This file is free software; you can redistribute it and/or modify <BR>;; it under the terms of the GNU General Public License as published by <BR>;; the Free Software Foundation; either version 2, or (at your option) <BR>;; any later version. <BR> <BR>;; This file is distributed in the hope that it will be useful, <BR>;; but WITHOUT ANY WARRANTY; without even the implied warranty of <BR>;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <BR>;; GNU General Public License for more details. <BR> <BR>;; You should have received a copy of the GNU General Public License <BR>;; along with GNU Emacs; see the file COPYING. If not, write to <BR>;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, <BR>;; Boston, MA 02111-1307, USA. <BR> <BR>;;; Commentary: <BR> <BR>;; <BR> <BR>;;; Code: <BR> <BR>(defcustom ep-server-program "/usr/local/bin/epserver" <BR> "*The program to use as the emacsport server. <BR>Put these lines into your ~/.emacs.el: <BR> (require 'emacsport) <BR> (ep-server-start)" <BR> :group 'server <BR> :type 'string) <BR> <BR>(defvar ep-server-process nil <BR> "the current emacsport server process") <BR> <BR>(defvar ep-server-previous-string "") <BR> <BR>(defun ep-server-start () <BR> "" <BR> (interactive) <BR> ;; Kill it first <BR> (if ep-server-process <BR> (progn <BR> (condition-case () <BR> (delete-process ep-server-process) <BR> (error nil)))) <BR> <BR> (let ((euid (user-uid))) <BR> (condition-case () <BR> (delete-file (format "/tmp/ep-%d" euid)) <BR> (error nil))) <BR> <BR> (let ((process-connection-type nil)) <BR> (setq ep-server-process <BR> (start-process "epserver" nil ep-server-program))) <BR> (set-process-filter ep-server-process 'ep-server-process-filter) <BR> (set-process-coding-system ep-server-process 'raw-text 'raw-text)) <BR> <BR>(defun ep-server-process-filter (proc string) <BR> (setq string (concat ep-server-previous-string string)) <BR> (while (string-match "\n" string) <BR> (let ((request (substring string 0 (match-beginning 0)))) <BR> (setq string (substring string (match-end 0))) <BR> (condition-case () <BR> (make-frame-on-display request) <BR> (error nil)))) <BR> ;; Save for later any partial line that remains. <BR> (setq ep-server-previous-string string)) <BR> <BR>(provide 'emacsport) <BR> <BR>;;; emacsport.el ends here <BR> <BR>-- <BR>Look Ma, this man can twist his fingers as if they were made of rubber, <BR>isn't that amazing? -- Not really, he's been using emacs for years...! <BR> <BR> <BR>※ 来源:·BBS 水木清华站 smth.org·[FROM: 162.105.203.100] <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -