Commit 94d11cb5 authored by Igor Kuzmin's avatar Igor Kuzmin Committed by Stefan Monnier
Browse files

* lisp/emacs-lisp/cconv.el: New file.

* lisp/emacs-lisp/bytecomp.el: Use cconv.
(byte-compile-file-form, byte-compile):
Call cconv-closure-convert-toplevel when requested.
* lisp/server.el:
* lisp/mpc.el:
* lisp/emacs-lisp/pcase.el:
* lisp/doc-view.el:
* lisp/dired.el: Use lexical-binding.
parent 8f1d2ef6
2011-02-10 Igor Kuzmin <kuzminig@iro.umontreal.ca>
* emacs-lisp/cconv.el: New file.
* emacs-lisp/bytecomp.el: Use cconv.
(byte-compile-file-form, byte-compile):
Call cconv-closure-convert-toplevel when requested.
* server.el:
* mpc.el:
* emacs-lisp/pcase.el:
* doc-view.el:
* dired.el: Use lexical-binding.
2010-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.
......
;;; -*- lexical-binding: t -*-
;;; dired.el --- directory-browsing commands
;; Copyright (C) 1985-1986, 1992-1997, 2000-2011
......
;;; -*- lexical-binding: t -*-
;;; doc-view.el --- View PDF/PostScript/DVI files in Emacs
;; Copyright (C) 2007-2011 Free Software Foundation, Inc.
......@@ -155,7 +156,7 @@
(defcustom doc-view-ghostscript-options
'("-dSAFER" ;; Avoid security problems when rendering files from untrusted
;; sources.
;; sources.
"-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4"
"-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET")
"A list of options to give to ghostscript."
......@@ -442,9 +443,7 @@ Can be `dvi', `pdf', or `ps'.")
doc-view-current-converter-processes)
;; The PNG file hasn't been generated yet.
(doc-view-pdf->png-1 doc-view-buffer-file-name file page
(lexical-let ((page page)
(win (selected-window))
(file file))
(let ((win (selected-window)))
(lambda ()
(and (eq (current-buffer) (window-buffer win))
;; If we changed page in the mean
......@@ -453,7 +452,7 @@ Can be `dvi', `pdf', or `ps'.")
;; Make sure we don't infloop.
(file-readable-p file)
(with-selected-window win
(doc-view-goto-page page))))))))
(doc-view-goto-page page))))))))
(overlay-put (doc-view-current-overlay)
'help-echo (doc-view-current-info))))
......@@ -713,8 +712,8 @@ Should be invoked when the cached images aren't up-to-date."
(if (and doc-view-dvipdf-program
(executable-find doc-view-dvipdf-program))
(doc-view-start-process "dvi->pdf" doc-view-dvipdf-program
(list dvi pdf)
callback)
(list dvi pdf)
callback)
(doc-view-start-process "dvi->pdf" doc-view-dvipdfm-program
(list "-o" pdf dvi)
callback)))
......@@ -735,7 +734,7 @@ is named like ODF with the extension turned to pdf."
(list (format "-r%d" (round doc-view-resolution))
(concat "-sOutputFile=" png)
pdf-ps))
(lexical-let ((resolution doc-view-resolution))
(let ((resolution doc-view-resolution))
(lambda ()
;; Only create the resolution file when it's all done, so it also
;; serves as a witness that the conversion is complete.
......@@ -780,7 +779,7 @@ Start by converting PAGES, and then the rest."
;; (almost) consecutive, but since in 99% of the cases, there'll be only
;; a single page anyway, and of the remaining 1%, few cases will have
;; consecutive pages, it's not worth the trouble.
(lexical-let ((pdf pdf) (png png) (rest (cdr pages)))
(let ((rest (cdr pages)))
(doc-view-pdf->png-1
pdf (format png (car pages)) (car pages)
(lambda ()
......@@ -793,8 +792,8 @@ Start by converting PAGES, and then the rest."
;; not sufficient.
(dolist (win (get-buffer-window-list (current-buffer) nil 'visible))
(with-selected-window win
(when (stringp (get-char-property (point-min) 'display))
(doc-view-goto-page (doc-view-current-page)))))
(when (stringp (get-char-property (point-min) 'display))
(doc-view-goto-page (doc-view-current-page)))))
;; Convert the rest of the pages.
(doc-view-pdf/ps->png pdf png)))))))
......@@ -816,10 +815,8 @@ Start by converting PAGES, and then the rest."
(ps
;; Doc is a PS, so convert it to PDF (which will be converted to
;; TXT thereafter).
(lexical-let ((pdf (expand-file-name "doc.pdf"
(doc-view-current-cache-dir)))
(txt txt)
(callback callback))
(let ((pdf (expand-file-name "doc.pdf"
(doc-view-current-cache-dir))))
(doc-view-ps->pdf doc-view-buffer-file-name pdf
(lambda () (doc-view-pdf->txt pdf txt callback)))))
(dvi
......@@ -873,9 +870,7 @@ Those files are saved in the directory given by the function
(dvi
;; DVI files have to be converted to PDF before Ghostscript can process
;; it.
(lexical-let
((pdf (expand-file-name "doc.pdf" doc-view-current-cache-dir))
(png-file png-file))
(let ((pdf (expand-file-name "doc.pdf" doc-view-current-cache-dir)))
(doc-view-dvi->pdf doc-view-buffer-file-name pdf
(lambda () (doc-view-pdf/ps->png pdf png-file)))))
(odf
......@@ -1026,8 +1021,8 @@ have the page we want to view."
(and (not (member pagefile prev-pages))
(member pagefile doc-view-current-files)))
(with-selected-window win
(assert (eq (current-buffer) buffer))
(doc-view-goto-page page))))))))
(assert (eq (current-buffer) buffer))
(doc-view-goto-page page))))))))
(defun doc-view-buffer-message ()
;; Only show this message initially, not when refreshing the buffer (in which
......@@ -1470,9 +1465,9 @@ See the command `doc-view-mode' for more information on this mode."
(when (not (eq major-mode 'doc-view-mode))
(doc-view-toggle-display))
(with-selected-window
(or (get-buffer-window (current-buffer) 0)
(selected-window))
(doc-view-goto-page page)))))
(or (get-buffer-window (current-buffer) 0)
(selected-window))
(doc-view-goto-page page)))))
(provide 'doc-view)
......
......@@ -119,6 +119,7 @@
(require 'backquote)
(require 'macroexp)
(require 'cconv)
(eval-when-compile (require 'cl))
(or (fboundp 'defsubst)
......@@ -2238,6 +2239,8 @@ list that represents a doc string reference.
(let ((byte-compile-current-form nil) ; close over this for warnings.
bytecomp-handler)
(setq form (macroexpand-all form byte-compile-macro-environment))
(if lexical-binding
(setq form (cconv-closure-convert-toplevel form)))
(cond ((not (consp form))
(byte-compile-keep-pending form))
((and (symbolp (car form))
......@@ -2585,9 +2588,11 @@ If FORM is a lambda or a macro, byte-compile it as a function."
(setq fun (cdr fun)))
(cond ((eq (car-safe fun) 'lambda)
;; expand macros
(setq fun
(macroexpand-all fun
byte-compile-initial-macro-environment))
(setq fun
(macroexpand-all fun
byte-compile-initial-macro-environment))
(if lexical-binding
(setq fun (cconv-closure-convert-toplevel fun)))
;; get rid of the `function' quote added by the `lambda' macro
(setq fun (cadr fun))
(setq fun (if macro
......
This diff is collapsed.
;;; -*- lexical-binding: t -*-
;;; pcase.el --- ML-style pattern-matching macro for Elisp
;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
......@@ -501,15 +502,14 @@ and otherwise defers to REST which is a list of branches of the form
;; `(PAT3 . PAT4)) which the programmer can easily rewrite
;; to the more efficient `(,(and PAT1 PAT3) . ,(and PAT2 PAT4))).
(pcase--u1 `((match ,sym . ,(cadr upat)))
(lexical-let ((rest rest))
;; FIXME: This codegen is not careful to share its
;; code if used several times: code blow up is likely.
(lambda (vars)
;; `vars' will likely contain bindings which are
;; not always available in other paths to
;; `rest', so there' no point trying to pass
;; them down.
(pcase--u rest)))
;; FIXME: This codegen is not careful to share its
;; code if used several times: code blow up is likely.
(lambda (vars)
;; `vars' will likely contain bindings which are
;; not always available in other paths to
;; `rest', so there' no point trying to pass
;; them down.
(pcase--u rest))
vars
(list `((and . ,matches) ,code . ,vars))))
(t (error "Unknown upattern `%s'" upat)))))
......
;;; -*- lexical-binding: t -*-
;;; mpc.el --- A client for the Music Player Daemon -*- coding: utf-8 -*-
;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
......@@ -341,9 +342,7 @@ CMD can be a string which is passed as-is to MPD or a list of strings
which will be concatenated with proper quoting before passing them to MPD."
(let ((proc (mpc-proc)))
(if (and callback (not (process-get proc 'ready)))
(lexical-let ((old (process-get proc 'callback))
(callback callback)
(cmd cmd))
(let ((old (process-get proc 'callback)))
(process-put proc 'callback
(lambda ()
(funcall old)
......@@ -359,8 +358,7 @@ which will be concatenated with proper quoting before passing them to MPD."
(mapconcat 'mpc--proc-quote-string cmd " "))
"\n")))
(if callback
(lexical-let ((buf (current-buffer))
(callback callback))
(let ((buf (current-buffer)))
(process-put proc 'callback
callback
;; (lambda ()
......@@ -402,8 +400,7 @@ which will be concatenated with proper quoting before passing them to MPD."
(defun mpc-proc-cmd-to-alist (cmd &optional callback)
(if callback
(lexical-let ((buf (current-buffer))
(callback callback))
(let ((buf (current-buffer)))
(mpc-proc-cmd cmd (lambda ()
(funcall callback (prog1 (mpc-proc-buf-to-alist
(current-buffer))
......@@ -522,7 +519,7 @@ to call FUN for any change whatsoever.")
(defun mpc-status-refresh (&optional callback)
"Refresh `mpc-status'."
(lexical-let ((cb callback))
(let ((cb callback))
(mpc-proc-cmd (mpc-proc-cmd-list '("status" "currentsong"))
(lambda ()
(mpc--status-callback)
......@@ -775,7 +772,7 @@ The songs are returned as alists."
(defun mpc-cmd-pause (&optional arg callback)
"Pause or resume playback of the queue of songs."
(lexical-let ((cb callback))
(let ((cb callback))
(mpc-proc-cmd (list "pause" arg)
(lambda () (mpc-status-refresh) (if cb (funcall cb))))
(unless callback (mpc-proc-sync))))
......@@ -839,7 +836,7 @@ If PLAYLIST is t or nil or missing, use the main playlist."
(puthash (cons 'Playlist playlist) nil mpc--find-memoize))))
(defun mpc-cmd-update (&optional arg callback)
(lexical-let ((cb callback))
(let ((cb callback))
(mpc-proc-cmd (if arg (list "update" arg) "update")
(lambda () (mpc-status-refresh) (if cb (funcall cb))))
(unless callback (mpc-proc-sync))))
......@@ -2351,8 +2348,7 @@ This is used so that they can be compared with `eq', which is needed for
(mpc-proc-cmd (list "seekid" songid time)
'mpc-status-refresh))))
(let ((status (mpc-cmd-status)))
(lexical-let* ((songid (cdr (assq 'songid status)))
(step step)
(let* ((songid (cdr (assq 'songid status)))
(time (if songid (string-to-number
(cdr (assq 'time status))))))
(let ((timer (run-with-timer
......@@ -2389,13 +2385,12 @@ This is used so that they can be compared with `eq', which is needed for
(if mpc--faster-toggle-timer
(mpc--faster-stop)
(mpc-status-refresh) (mpc-proc-sync)
(lexical-let* ((speedup speedup)
songid ;The ID of the currently ffwd/rewinding song.
songnb ;The position of that song in the playlist.
songduration ;The duration of that song.
songtime ;The time of the song last time we ran.
oldtime ;The timeoftheday last time we ran.
prevsongid) ;The song we're in the process leaving.
(let* (songid ;The ID of the currently ffwd/rewinding song.
songnb ;The position of that song in the playlist.
songduration ;The duration of that song.
songtime ;The time of the song last time we ran.
oldtime ;The timeoftheday last time we ran.
prevsongid) ;The song we're in the process leaving.
(let ((fun
(lambda ()
(let ((newsongid (cdr (assq 'songid mpc-status)))
......
;;; -*- lexical-binding: t -*-
;;; server.el --- Lisp code for GNU Emacs running as server process
;; Copyright (C) 1986-1987, 1992, 1994-2011 Free Software Foundation, Inc.
......@@ -335,9 +336,9 @@ If CLIENT is non-nil, add a description of it to the logged message."
(goto-char (point-max))
(insert (funcall server-log-time-function)
(cond
((null client) " ")
((listp client) (format " %s: " (car client)))
(t (format " %s: " client)))
((null client) " ")
((listp client) (format " %s: " (car client)))
(t (format " %s: " client)))
string)
(or (bolp) (newline)))))
......@@ -355,7 +356,7 @@ If CLIENT is non-nil, add a description of it to the logged message."
(and (process-contact proc :server)
(eq (process-status proc) 'closed)
(ignore-errors
(delete-file (process-get proc :server-file))))
(delete-file (process-get proc :server-file))))
(server-log (format "Status changed to %s: %s" (process-status proc) msg) proc)
(server-delete-client proc))
......@@ -410,10 +411,10 @@ If CLIENT is non-nil, add a description of it to the logged message."
proc
;; See if this is the last frame for this client.
(>= 1 (let ((frame-num 0))
(dolist (f (frame-list))
(when (eq proc (frame-parameter f 'client))
(setq frame-num (1+ frame-num))))
frame-num)))
(dolist (f (frame-list))
(when (eq proc (frame-parameter f 'client))
(setq frame-num (1+ frame-num))))
frame-num)))
(server-log (format "server-handle-delete-frame, frame %s" frame) proc)
(server-delete-client proc 'noframe)))) ; Let delete-frame delete the frame later.
......@@ -534,8 +535,8 @@ To force-start a server, do \\[server-force-delete] and then
(if (not (eq t (server-running-p server-name)))
;; Remove any leftover socket or authentication file
(ignore-errors
(let (delete-by-moving-to-trash)
(delete-file server-file)))
(let (delete-by-moving-to-trash)
(delete-file server-file)))
(setq server-mode nil) ;; already set by the minor mode code
(display-warning
'server
......@@ -590,11 +591,11 @@ server or call `M-x server-force-delete' to forcibly disconnect it.")
(when server-use-tcp
(let ((auth-key
(loop
;; The auth key is a 64-byte string of random chars in the
;; range `!'..`~'.
repeat 64
collect (+ 33 (random 94)) into auth
finally return (concat auth))))
;; The auth key is a 64-byte string of random chars in the
;; range `!'..`~'.
repeat 64
collect (+ 33 (random 94)) into auth
finally return (concat auth))))
(process-put server-process :auth-key auth-key)
(with-temp-file server-file
(set-buffer-multibyte nil)
......@@ -689,31 +690,31 @@ Server mode runs a process that accepts commands from the
(add-to-list 'frame-inherited-parameters 'client)
(let ((frame
(server-with-environment (process-get proc 'env)
'("LANG" "LC_CTYPE" "LC_ALL"
;; For tgetent(3); list according to ncurses(3).
"BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES"
"NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING"
"NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO"
"TERMINFO_DIRS" "TERMPATH"
;; rxvt wants these
"COLORFGBG" "COLORTERM")
(make-frame `((window-system . nil)
(tty . ,tty)
(tty-type . ,type)
;; Ignore nowait here; we always need to
;; clean up opened ttys when the client dies.
(client . ,proc)
;; This is a leftover from an earlier
;; attempt at making it possible for process
;; run in the server process to use the
;; environment of the client process.
;; It has no effect now and to make it work
;; we'd need to decide how to make
;; process-environment interact with client
;; envvars, and then to change the
;; C functions `child_setup' and
;; `getenv_internal' accordingly.
(environment . ,(process-get proc 'env)))))))
'("LANG" "LC_CTYPE" "LC_ALL"
;; For tgetent(3); list according to ncurses(3).
"BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES"
"NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING"
"NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO"
"TERMINFO_DIRS" "TERMPATH"
;; rxvt wants these
"COLORFGBG" "COLORTERM")
(make-frame `((window-system . nil)
(tty . ,tty)
(tty-type . ,type)
;; Ignore nowait here; we always need to
;; clean up opened ttys when the client dies.
(client . ,proc)
;; This is a leftover from an earlier
;; attempt at making it possible for process
;; run in the server process to use the
;; environment of the client process.
;; It has no effect now and to make it work
;; we'd need to decide how to make
;; process-environment interact with client
;; envvars, and then to change the
;; C functions `child_setup' and
;; `getenv_internal' accordingly.
(environment . ,(process-get proc 'env)))))))
;; ttys don't use the `display' parameter, but callproc.c does to set
;; the DISPLAY environment on subprocesses.
......@@ -777,8 +778,7 @@ Server mode runs a process that accepts commands from the
;; frame because input from that display will be blocked (until exiting
;; the minibuffer). Better exit this minibuffer right away.
;; Similarly with recursive-edits such as the splash screen.
(run-with-timer 0 nil (lexical-let ((proc proc))
(lambda () (server-execute-continuation proc))))
(run-with-timer 0 nil (lambda () (server-execute-continuation proc)))
(top-level)))
;; We use various special properties on process objects:
......@@ -944,119 +944,119 @@ The following commands are accepted by the client:
(setq command-line-args-left
(mapcar 'server-unquote-arg (split-string request " " t)))
(while (setq arg (pop command-line-args-left))
(cond
;; -version CLIENT-VERSION: obsolete at birth.
((and (equal "-version" arg) command-line-args-left)
(pop command-line-args-left))
;; -nowait: Emacsclient won't wait for a result.
((equal "-nowait" arg) (setq nowait t))
;; -current-frame: Don't create frames.
((equal "-current-frame" arg) (setq use-current-frame t))
;; -display DISPLAY:
;; Open X frames on the given display instead of the default.
((and (equal "-display" arg) command-line-args-left)
(setq display (pop command-line-args-left))
(if (zerop (length display)) (setq display nil)))
;; -parent-id ID:
;; Open X frame within window ID, via XEmbed.
((and (equal "-parent-id" arg) command-line-args-left)
(setq parent-id (pop command-line-args-left))
(if (zerop (length parent-id)) (setq parent-id nil)))
;; -window-system: Open a new X frame.
((equal "-window-system" arg)
(setq dontkill t)
(setq tty-name 'window-system))
;; -resume: Resume a suspended tty frame.
((equal "-resume" arg)
(lexical-let ((terminal (process-get proc 'terminal)))
(setq dontkill t)
(push (lambda ()
(when (eq (terminal-live-p terminal) t)
(resume-tty terminal)))
commands)))
;; -suspend: Suspend the client's frame. (In case we
;; get out of sync, and a C-z sends a SIGTSTP to
;; emacsclient.)
((equal "-suspend" arg)
(lexical-let ((terminal (process-get proc 'terminal)))
(setq dontkill t)
(push (lambda ()
(when (eq (terminal-live-p terminal) t)
(suspend-tty terminal)))
commands)))
;; -ignore COMMENT: Noop; useful for debugging emacsclient.
;; (The given comment appears in the server log.)
((and (equal "-ignore" arg) command-line-args-left
(cond
;; -version CLIENT-VERSION: obsolete at birth.
((and (equal "-version" arg) command-line-args-left)
(pop command-line-args-left))
;; -nowait: Emacsclient won't wait for a result.
((equal "-nowait" arg) (setq nowait t))
;; -current-frame: Don't create frames.
((equal "-current-frame" arg) (setq use-current-frame t))
;; -display DISPLAY:
;; Open X frames on the given display instead of the default.
((and (equal "-display" arg) command-line-args-left)
(setq display (pop command-line-args-left))
(if (zerop (length display)) (setq display nil)))
;; -parent-id ID:
;; Open X frame within window ID, via XEmbed.
((and (equal "-parent-id" arg) command-line-args-left)
(setq parent-id (pop command-line-args-left))
(if (zerop (length parent-id)) (setq parent-id nil)))
;; -window-system: Open a new X frame.
((equal "-window-system" arg)
(setq dontkill t)
(setq tty-name 'window-system))
;; -resume: Resume a suspended tty frame.
((equal "-resume" arg)
(let ((terminal (process-get proc 'terminal)))
(setq dontkill t)
(push (lambda ()
(when (eq (terminal-live-p terminal) t)
(resume-tty terminal)))
commands)))
;; -suspend: Suspend the client's frame. (In case we
;; get out of sync, and a C-z sends a SIGTSTP to
;; emacsclient.)
((equal "-suspend" arg)
(let ((terminal (process-get proc 'terminal)))
(setq dontkill t)
(pop command-line-args-left)))
;; -tty DEVICE-NAME TYPE: Open a new tty frame at the client.
((and (equal "-tty" arg)
(cdr command-line-args-left))
(setq tty-name (pop command-line-args-left)
tty-type (pop command-line-args-left)
dontkill (or dontkill
(not use-current-frame))))
;; -position LINE[:COLUMN]: Set point to the given
;; position in the next file.
((and (equal "-position" arg)
command-line-args-left
(string-match "\\+\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?"
(car command-line-args-left)))
(setq arg (pop command-line-args-left))
(setq filepos
(cons (string-to-number (match-string 1 arg))
(string-to-number (or (match-string 2 arg) "")))))
;; -file FILENAME: Load the given file.
((and (equal "-file" arg)
command-line-args-left)
(let ((file (pop command-line-args-left)))
(if coding-system
(setq file (decode-coding-string file coding-system)))
(setq file (expand-file-name file dir))
(push (cons file filepos) files)
(server-log (format "New file: %s %s"
file (or filepos "")) proc))
(setq filepos nil))
;; -eval EXPR: Evaluate a Lisp expression.
((and (equal "-eval" arg)
command-line-args-left)
(if use-current-frame
(setq use-current-frame 'always))
(lexical-let ((expr (pop command-line-args-left)))
(if coding-system
(setq expr (decode-coding-string expr coding-system)))
(push (lambda () (server-eval-and-print expr proc))
commands)
(setq filepos nil)))
;; -env NAME=VALUE: An environment variable.
((and (equal "-env" arg) command-line-args-left)
(let ((var (pop command-line-args-left)))
;; XXX Variables should be encoded as in getenv/setenv.
(process-put proc 'env
(cons var (process-get proc 'env)))))
;; -dir DIRNAME: The cwd of the emacsclient process.
((and (equal "-dir" arg) command-line-args-left)
(setq dir (pop command-line-args-left))
(push (lambda ()
(when (eq (terminal-live-p terminal) t)
(suspend-tty terminal)))
commands)))
;; -ignore COMMENT: Noop; useful for debugging emacsclient.
;; (The given comment appears in the server log.)
((and (equal "-ignore" arg) command-line-args-left
(setq dontkill t)
(pop command-line-args-left)))
;; -tty DEVICE-NAME TYPE: Open a new tty frame at the client.
((and (equal "-tty" arg)
(cdr command-line-args-left))
(setq tty-name (pop command-line-args-left)
tty-type (pop command-line-args-left)
dontkill (or dontkill
(not use-current-frame))))
;; -position LINE[:COLUMN]: Set point to the given
;; position in the next file.
((and (equal "-position" arg)
command-line-args-left
(string-match "\\+\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?"
(car command-line-args-left)))
(setq arg (pop command-line-args-left))
(setq filepos
(cons (string-to-number (match-string 1 arg))
(string-to-number (or (match-string 2 arg) "")))))
;; -file FILENAME: Load the given file.
((and (equal "-file" arg)
command-line-args-left)
(let ((file (pop command-line-args-left)))
(if coding-system
(setq dir (decode-coding-string dir coding-system)))
(setq dir (command-line-normalize-file-name dir)))
;; Unknown command.
(t (error "Unknown command: %s" arg))))
(setq file (decode-coding-string file coding-system)))
(setq file (expand-file-name file dir))
(push (cons file filepos) files)
(server-log (format "New file: %s %s"
file (or filepos "")) proc))
(setq filepos nil))
;; -eval EXPR: Evaluate a Lisp expression.
((and (equal "-eval" arg)
command-line-args-left)