(format "Hard-coded value is 100\% and the variable is %s" "50\\%")
Returns
Debugger entered--Lisp error: (error "Invalid format operation %a")
format("Hard-coded value is 100% and the variable is %s" "50%")
eval((format "Hard-coded value is 100% and the variable is %s" "50%") nil)
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
(Note how in the debugger output, the command has the "%" escaped)
How in heaven can I use a string with a percentage in it?
%%
. – politza Jul 19 '17 at 22:16C-h i
, choosing the Elisp manual, andi format RET
. – Drew Jul 20 '17 at 21:53