Re: master 58fde63: * lisp/help-fns.el (describe-variable): Add quotes to symbol value of origval.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: master 58fde63: * lisp/help-fns.el (describe-variable): Add quotes to symbol value of origval.

Stefan Monnier
> -                      (cl-prin1 origval)
> +      (if (and (symbolp origval) (not (booleanp origval)))
> +  (let* ((rep (cl-prin1-to-string origval))
> + (print-rep (format-message "`%s'" rep)))
> +    (insert print-rep))
> + (cl-prin1 origval))

I'd recommend we add a ":" at the end of the preceding text instead.
Avoids any question about whether the quotes are actually part of the
value, and makes copy&paste easier.


        Stefan


Reply | Threaded
Open this post in threaded view
|

Re: master 58fde63: * lisp/help-fns.el (describe-variable): Add quotes to symbol value of origval.

Juri Linkov-2
>> -                      (cl-prin1 origval)
>> +      (if (and (symbolp origval) (not (booleanp origval)))
>> +  (let* ((rep (cl-prin1-to-string origval))
>> + (print-rep (format-message "`%s'" rep)))
>> +    (insert print-rep))
>> + (cl-prin1 origval))
>
> I'd recommend we add a ":" at the end of the preceding text instead.
> Avoids any question about whether the quotes are actually part of the
> value, and makes copy&paste easier.

The code for adding quotes for origval was copied from code
that outputs the new value.  Should they both use ":"?

Before fix:

  log-edit-confirm is a variable defined in ‘log-edit.el’.
  Its value is t
  Original value was changed

After fix:

  log-edit-confirm is a variable defined in ‘log-edit.el’.
  Its value is t
  Original value was ‘changed’

Should both values be changed now to use ":"?

  log-edit-confirm is a variable defined in ‘log-edit.el’.
  Its value is: t
  Original value was: changed

PS: t is not the best example for the new value because Help
doesn't add quotes for t and nil.  Here is a better example:

  (setq log-edit-confirm 'newvalue)

Current:

  log-edit-confirm is a variable defined in ‘log-edit.el’.
  Its value is ‘newvalue’
  Original value was ‘changed’

With ":":

  log-edit-confirm is a variable defined in ‘log-edit.el’.
  Its value is: newvalue
  Original value was: changed