<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">On Mar 4, 2019, at 3:42 PM, Robert Goldman <<a href="mailto:rpgoldman@sift.net" class="">rpgoldman@sift.net</a>> wrote:<br class=""><div><blockquote type="cite" class=""><span style="color: rgb(119, 119, 119); font-family: sans-serif;" class="">(The documentation says "For an approximate inverse of this, see ‘kbd’.”.   Your conclusion that key-description guarantees a certain format doesn’t follow, I would say, especially given that `kbd’ doesn’t nail down a representation either.)</span><br class=""><div class=""><div class=""><div style="font-family:sans-serif" class=""><div style="white-space:normal" class=""><p dir="auto" class="">That's true, but I think it's forgivable that the SLIME folks didn't expect this:<br class="">
<code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7" class=""><br class="">
(kbd (key-description (kbd "a")))<br class="">
"A"</code><br class=""></p></div></div></div></div></blockquote><div>Well, they’re abusing the API.</div><blockquote type="cite" class=""><div class=""><div class=""><div style="font-family:sans-serif" class=""><div style="white-space:normal" class=""><p dir="auto" class="">And there is <em class="">no</em> alternative function that they can use as the inverse of <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7" class="">kbd</code> (which is arguably a fault of Emacs itself).</p></div></div></div></div></blockquote><div>So, why don’t we write an alternative function, get that added to GNU Emacs, and then SLIME can use that function when available (and fall back to key-description if not)?</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div class=""><div style="font-family:sans-serif" class=""><div style="white-space:normal" class=""><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px" class=""><blockquote style="border-left:2px solid #777; color:#999; margin:0 0 5px; padding-left:5px; border-left-color:#999" class=""><p dir="auto" class="">key-description is defined in C, and doesn't have any obvious conditioning context (like a dynamically-scoped variable) that would change its interpretation of lower case characters.</p>
</blockquote><p dir="auto" class="">This could be added, and then one would patch SLIME if they were to accept such a patch.</p>
</blockquote><p dir="auto" class="">Would it be possible to do something like (note -- this is in C, so of course one would have to just write the <em class="">equivalent</em> of this):<br class="">
<code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7" class="">(defun key-description (key-or-seq &optional readable) ...)</code></p><p dir="auto" class="">And fall back to the original emacs code path if <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7" class="">readable</code> is true?</p></div></div></div></div></blockquote><div>I would rather define a new function that implements what they need.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div class=""><div style="font-family:sans-serif" class=""><div style="white-space:normal" class=""><p dir="auto" class="">Then we could patch with something like</p>

<pre style="background-color:#F7F7F7; border-radius:5px 5px 5px 5px; margin-left:15px; margin-right:15px; max-width:90vw; overflow-x:auto; padding:5px" bgcolor="#F7F7F7" class=""><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0" bgcolor="#F7F7F7" class="">(flet ((key-description (x) (if aquamacs-p (key-description x t) (key-description x)))) 
</code></pre></div></div></div></div></blockquote></div><div><br class=""></div><div>I’d rather they check for the presence of a function, and we make that function available in Aquamacs as well as in GNU Emacs, if there is such a use case.</div><div><br class=""></div><div>D</div><br class=""></body></html>