- (if (string-match "\\`\\+[0-9]+\\'" arg)
- (setq lineno (read (substring arg 1)))
- (setq files
- (cons (list arg lineno)
- files))
- (setq lineno 1))))
- (server-visit-files files client)
+ (if (string-match "\\`-nowait" arg)
+ (setq nowait t)
+ (if (string-match "\\`\\+[0-9]+\\'" arg)
+ ;; ARG is a line number option.
+ (setq lineno (read (substring arg 1)))
+ ;; ARG is a file name.
+ ;; Collapse multiple slashes to single slashes.
+ (setq arg (command-line-normalize-file-name arg))
+ ;; Undo the quoting that emacsclient does
+ ;; for certain special characters.
+ (while (string-match "&." arg pos)
+ (setq pos (1+ (match-beginning 0)))
+ (let ((nextchar (aref arg pos)))
+ (cond ((= nextchar ?&)
+ (setq arg (replace-match "&" t t arg)))
+ ((= nextchar ?-)
+ (setq arg (replace-match "-" t t arg)))
+ (t
+ (setq arg (replace-match " " t t arg))))))
+ (setq files
+ (cons (list arg lineno)
+ files))
+ (setq lineno 1)))))
+ (server-visit-files files client nowait)