Function: server-quote-arg

server-quote-arg is a byte-compiled function defined in server.el.gz.

Signature

(server-quote-arg ARG)

Documentation

In ARG, insert a & before each &, each space, each newline, and -.

Change spaces to underscores, too, so that the return value never contains a space.

See server-unquote-arg and server-process-filter.

Source Code

;; Defined in /usr/src/emacs/lisp/server.el.gz
(defun server-quote-arg (arg)
  "In ARG, insert a & before each &, each space, each newline, and -.
Change spaces to underscores, too, so that the return value never
contains a space.

See `server-unquote-arg' and `server-process-filter'."
  (replace-regexp-in-string
   "[-&\n ]" (lambda (s)
	       (pcase (aref s 0)
		 (?& "&&")
		 (?- "&-")
		 (?\n "&n")
		 (?\s "&_")))
   arg t t))