Skip to main content
14 events
when toggle format what by license comment
Mar 14, 2016 at 4:42 history edited Drew
edited tags
S Nov 22, 2015 at 7:58 history suggested user2699 CC BY-SA 3.0
More specific title, as this isn't about printing output in general.
Nov 22, 2015 at 0:17 review Suggested edits
S Nov 22, 2015 at 7:58
Nov 19, 2015 at 19:52 comment added user1552063 your code worked fine for me, although it seems a little odd to me that you have not made foo1 interactive.
S Nov 19, 2015 at 17:47 history suggested sds CC BY-SA 3.0
clarified output
Nov 19, 2015 at 16:59 review Suggested edits
S Nov 19, 2015 at 17:47
Nov 18, 2015 at 21:54 vote accept 147pm
Nov 18, 2015 at 21:29 answer added sds timeline score: 3
Nov 18, 2015 at 21:14 comment added 147pm . . . of course if I can get ISO 8601 format of UTC out of format-time-string I'm home free. . .
Nov 18, 2015 at 21:08 comment added 147pm (defun foo1 () (format "this is the date-time %S" (shell-command "date +\"%Y-%m-%dT%H:%M:%S\"" t))) is without the printf, but with the same bad results. The printf was only to avoid a newline. What exactly should I do with call-process?
Nov 18, 2015 at 21:01 comment added Drew You can use call-process or start-process, to get more control. Otherwise, the shell-command call you are using puts the output of the printf command in the current buffer, at point. You could wrap the call in with-current-buffer-window or similar (in which case you don't need the second arg), to recuperate the output.
Nov 18, 2015 at 20:57 comment added 147pm I want to use the output of that shell-command in the first function, i.e., not just any timestamp. Obviously I could just put the (shell-command ...) part in foo1, but it does the same thing AFAIK.
Nov 18, 2015 at 20:54 comment added Drew Is your question really about getting something from the shell process, to use in Emacs, or is it just about being able to display or return or insert a timestamp string in Emacs? If the latter, just use current-time-string or use current-time with format-time-string.
Nov 18, 2015 at 20:38 history asked 147pm CC BY-SA 3.0