Subject: Re: bug#40341: [PATCH] * doc/lispref/os.texi (Session Management): make example homoiconic

From: Noam Postavsky <[email-masked]>
Date: Tue, 14 Apr 2020 09:52:56 -0400

severity 40341 minor
quit

[email-masked] writes:

> --- a/doc/lispref/os.texi
> +++ b/doc/lispref/os.texi
> @@ -2675,10 +2675,10 @@ Emacs is restarted by the session manager.
>  
>  @group
>  (defun save-yourself-test ()
> -  (insert "(save-current-buffer
> -  (switch-to-buffer \"*scratch*\")
> -  (insert \"I am restored\"))")
> -  nil)
> +    (insert (format "%S" '(save-current-buffer
> +                           (switch-to-buffer "*scratch*")
> +                           (insert "I am restored"))))
> +    nil)

Shouldn't this example also be using set-buffer instead of
switch-to-buffer?  (Or rather, with-current-buffer instead of
save-current-buffer + switch-to-buffer.)