Juanma Barranquero <
lekktu@gmai...> writes:
> Is there any reason for uses like this one from simple.el:
>
> (error (format "No further undo information%s"
> (if (and transient-mark-mode mark-active)
> " for region" "")))
>
> instead of simply:
>
> (error "No further undo information%s"
> (if (and transient-mark-mode mark-active)
> " for region" ""))
I'd probably be tempted to use
(error (concat "No further undo information"
(and transient-mark-mode mark-active
" for region")))
in this case. It shares the disadvantage of the original version
(when compared to yours) of being more likely to lead to accidental
format string vulnerabilities if a user takes this as starting code
for something with a variable string.
It is perhaps more educational to preferable follow (error ... with a
constant string.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu....
http://lists.gnu.org/mailman/listinfo/emacs-devel
opensubscriber is not affiliated with the authors of this message nor responsible for its content.