<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body><div style="font-family: sans-serif;"><div class="markdown" style="white-space: normal;">
<p dir="auto">A quick follow-up because with the help of the sly developer, I have figured out what's wrong. It's both (a) simpler and (b) more puzzling.</p>
<p dir="auto">So it turns out that the completion mode is <em>not</em> broken!  Instead, what is broken is the <em>prompt</em> that goes in the minibuffer!</p>
<p dir="auto">On a normal emacs, as I said before, the buffer gives this prompt:</p>
<pre style="margin-left: 15px; margin-right: 15px; padding: 5px; background-color: #F7F7F7; border-radius: 5px 5px 5px 5px; overflow-x: auto; max-width: 90vw;"><code style="margin: 0 0; border-radius: 3px; background-color: #F7F7F7; padding: 0px;">"Use C-n and C-p to navigate completions...."
</code></pre>
<p dir="auto">But on Aquamacs I see:</p>
<pre style="margin-left: 15px; margin-right: 15px; padding: 5px; background-color: #F7F7F7; border-radius: 5px 5px 5px 5px; overflow-x: auto; max-width: 90vw;"><code style="margin: 0 0; border-radius: 3px; background-color: #F7F7F7; padding: 0px;">"Use <right> and <left> to navigate completions..."
</code></pre>
<p dir="auto">What's simple, but puzzling, is that if I use the keystrokes that are advertised normally (C-n and C-p), then the completion works properly.  I thought it was not working because if I use the keys that Aquamacs tells me to, completion doesn't work. But that's because Aquamacs is doing the right thing, but telling me the wrong thing: somehow it is writing an incorrect string into the minibuffer.</p>
<p dir="auto">AFAICT, the key bits of code in sly completion mode are the following.</p>
<p dir="auto">First, this defvar:</p>
<pre style="margin-left: 15px; margin-right: 15px; padding: 5px; background-color: #F7F7F7; border-radius: 5px 5px 5px 5px; overflow-x: auto; max-width: 90vw;"><code style="margin: 0 0; border-radius: 3px; background-color: #F7F7F7; padding: 0px;">(defvar sly--completion-explanation
  (concat
   "Use \\[sly-next-completion] and \\[sly-prev-completion] to navigate completions."
   " \\[sly-choose-completion] or [mouse-1] selects a completion."
   "\n\nAnnotation flags: (b)oundp (f)boundp (g)eneric-function (c)lass (m)acro (s)pecial-operator\n\n"
</code></pre>
<p dir="auto">And then this function call goes wrong:</p>
<pre style="margin-left: 15px; margin-right: 15px; padding: 5px; background-color: #F7F7F7; border-radius: 5px 5px 5px 5px; overflow-x: auto; max-width: 90vw;"><code style="margin: 0 0; border-radius: 3px; background-color: #F7F7F7; padding: 0px;">(substitute-command-keys
             sly--completion-explanation)
</code></pre>
<p dir="auto">So I was wondering: does Aquamacs do anything funky with <code style="margin: 0 0; padding: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">substitute-command-keys</code>? I have no idea why I am getting <code style="margin: 0 0; padding: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">"<right>"</code> and <code style="margin: 0 0; padding: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">"<left>"</code> instead of <code style="margin: 0 0; padding: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">"C-n"</code> and <code style="margin: 0 0; padding: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">"C-p"</code>.</p>
<p dir="auto">Thanks,<br>
R</p>
<p dir="auto">On 25 Nov 2022, at 9:51, Robert Goldman wrote:</p>
<blockquote style="margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #777777; color: #777777;">
<p dir="auto">I have been having an oddity with completion in the SLY (enhanced Common Lisp) mode.  Full details are <a href="https://github.com/joaotavora/sly/issues/547" style="color: #777777;">here</a>.  The issue persists when I start Aquamacs without customizations, so I suspect it is an interaction between SLY and some Aquamacs customization.  But I have not been able to find any customization of completion behavior in <code style="margin: 0 0; padding: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">/Applications/Aquamacs.app/Contents/Resources/lisp/</code></p>
<p dir="auto">Here's what happens:</p>
<ul>
<li>
<p dir="auto">Non-Aquamacs emacs: Press completion key. Minibuffer pops up with message "Use C-n and C-p to navigate completions...."  I <em>believe</em> that in this case also the cursor is left in the minibuffer (having a little trouble getting clarity from other users).</p>
</li>
<li>
<p dir="auto">Aquamacs emacs: Minibuffer pops up with message "Use <right> and <left> to navigate completions..." Cursor is left in the source buffer, <em>not</em> the completion minibuffer. This has the bad effect of causing me to press <right> and then find that the cursor moves in the source buffer and the completion minibuffer is dismissed, which is quite annoying. (The fix is to switch buffers to navigate the set of completions, but this is cumbersome and annoying).</p>
</li>
</ul>
<p dir="auto">Any idea where this customization could be happening?</p>
<p dir="auto">Thanks,<br>
R</p>
</blockquote>

</div>
</div>
</body>

</html>