diff options
| author | Andreas Schwab | 2012-03-11 18:53:07 +0100 |
|---|---|---|
| committer | Andreas Schwab | 2012-03-11 18:53:07 +0100 |
| commit | e29ab36b489e14bda49a2c0e61dac3a7e13e75f1 (patch) | |
| tree | 5f54f5bf289ebffa04cd6fb3d577a44cf64305a2 /lib-src | |
| parent | de5939bafc0d06ad65bfc13498b14a2dd1c82db4 (diff) | |
| download | emacs-e29ab36b489e14bda49a2c0e61dac3a7e13e75f1.tar.gz emacs-e29ab36b489e14bda49a2c0e61dac3a7e13e75f1.zip | |
Define -print-nonl client command
* lib-src/emacsclient.c (main): Handle -print-nonl command.
* lisp/server.el (server-msg-size): New constant.
(server-reply-print): New function.
(server-eval-and-print): Use it.
(server-eval-at): Use server-quote-arg and server-unquote-arg.
Handle -print-nonl.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 2 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 1478b3715f1..2384599caf2 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2012-03-11 Andreas Schwab <schwab@linux-m68k.org> | 1 | 2012-03-11 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 2 | ||
| 3 | * emacsclient.c (main): Handle -print-nonl command. | ||
| 4 | |||
| 3 | * emacsclient.c (main): Handle multiple messages in a single | 5 | * emacsclient.c (main): Handle multiple messages in a single |
| 4 | datagram. | 6 | datagram. |
| 5 | 7 | ||
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 97ae029751d..049886ed2ba 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -1812,6 +1812,14 @@ main (int argc, char **argv) | |||
| 1812 | printf ("%s", str); | 1812 | printf ("%s", str); |
| 1813 | needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; | 1813 | needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; |
| 1814 | } | 1814 | } |
| 1815 | else if (strprefix ("-print-nonl ", p)) | ||
| 1816 | { | ||
| 1817 | /* -print-nonl STRING: Print STRING on the terminal. | ||
| 1818 | Used to continue a preceding -print command. */ | ||
| 1819 | str = unquote_argument (p + strlen ("-print-nonl ")); | ||
| 1820 | printf ("%s", str); | ||
| 1821 | needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; | ||
| 1822 | } | ||
| 1815 | else if (strprefix ("-error ", p)) | 1823 | else if (strprefix ("-error ", p)) |
| 1816 | { | 1824 | { |
| 1817 | /* -error DESCRIPTION: Signal an error on the terminal. */ | 1825 | /* -error DESCRIPTION: Signal an error on the terminal. */ |