<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 4 Mar 2019, at 14:48, David Reitter wrote:</p>

</div>
<div style="white-space:normal"></div>
<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><div id="525A86AE-8EDF-443D-B791-63C183BE1B70"><div 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=""></div></div></blockquote>
<div style="white-space:normal">
<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
</blockquote></div>
<div style="white-space:normal">

<p dir="auto">I see the appeal of that method, but it seems like doubling the number of upstreams that would have to agree. I <em>might</em> be able to get the SLIME folks to accept a patch, but I have no idea how one goes about getting the FSF folks to do so.</p>

<p dir="auto">Best,<br>
R</p>

<p dir="auto">Robert P. Goldman<br>
Research Fellow<br>
Smart Information Flow Technologies (d/b/a SIFT, LLC)</p>

<p dir="auto">319 N. First Ave., Suite 400<br>
Minneapolis, MN 55401</p>

<p dir="auto">Voice:    (612) 326-3934<br>
Email:    <a href="mailto:rpgoldman@SIFT.net" style="color:#3983C4">rpgoldman@SIFT.net</a></p>
</div>
</div>
</body>
</html>