unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help
@ 2024-01-24 16:09 Spencer Baugh
  2024-01-24 16:11 ` Spencer Baugh
  2024-01-24 16:47 ` Juri Linkov
  0 siblings, 2 replies; 5+ messages in thread
From: Spencer Baugh @ 2024-01-24 16:09 UTC (permalink / raw)
  To: 68689


completion-show-help shows some useful help for new users.
However, it suggests suboptimal bindings when
minibuffer-visible-completions is on.  minibuffer-visible-completions
should change the help shown by completion-show-help.

A patch to do this will follow.


In GNU Emacs 30.0.50 (build 20, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw scroll bars) of 2023-12-27 built on
 igm-qws-u22796a
Repository revision: b9c0ce0a400f18e1bba4e3491c94994d73ef9405
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Rocky Linux 8.9 (Green Obsidian)

Configured using:
 'configure -C 'CFLAGS=-O0 -g3' --with-gif=ifavailable
 --with-x-toolkit=lucid'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM
XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty move-toolbar make-network-process emacs)

Memory information:
((conses 16 64909 12153) (symbols 48 9546 0) (strings 32 22818 1610)
 (string-bytes 1 676937) (vectors 16 10394)
 (vector-slots 8 158028 13136) (floats 8 40 19) (intervals 56 262 0)
 (buffers 984 10))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help
  2024-01-24 16:09 bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help Spencer Baugh
@ 2024-01-24 16:11 ` Spencer Baugh
  2024-01-24 16:47 ` Juri Linkov
  1 sibling, 0 replies; 5+ messages in thread
From: Spencer Baugh @ 2024-01-24 16:11 UTC (permalink / raw)
  To: 68689

[-- Attachment #1: Type: text/plain, Size: 15 bytes --]


Patch to fix


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Update-minibuffer-show-help-based-on-minibuffer-visi.patch --]
[-- Type: text/x-patch, Size: 2679 bytes --]

From c70736c52262cacb905ed1e564b2335a3c87f5b4 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@janestreet.com>
Date: Wed, 24 Jan 2024 11:10:40 -0500
Subject: [PATCH] Update minibuffer-show-help based on
 minibuffer-visible-completions

minibuffer-visible-completions makes some more convenient bindings
available, but the help shown by minibuffer-show-help wasn't
suggesting them.  Now it is.

* lisp/simple.el (completion-setup-function): Change help text when
minibuffer-visible-completions is non-nil. (bug#68689)
---
 lisp/simple.el | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 35fd76b8d1a..23019dd1138 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10232,13 +10232,27 @@ completion-setup-function
       ;; Maybe insert help string.
       (when completion-show-help
 	(goto-char (point-min))
-        (insert (substitute-command-keys
-	         (if (display-mouse-p)
-	             "Click or type \\[minibuffer-choose-completion] on a completion to select it.\n"
-                   "Type \\[minibuffer-choose-completion] on a completion to select it.\n")))
-        (insert (substitute-command-keys
-		 "Type \\[minibuffer-next-completion] or \\[minibuffer-previous-completion] \
-to move point between completions.\n\n"))))))
+        (if minibuffer-visible-completions
+            (let ((helps
+                   (with-current-buffer (window-buffer (active-minibuffer-window))
+                     (list
+                      (substitute-command-keys
+	               (if (display-mouse-p)
+	                   "Click or type \\[minibuffer-choose-completion-or-exit] on a completion to select it.\n"
+                         "Type \\[minibuffer-choose-completion-or-exit] on a completion to select it.\n"))
+                      (substitute-command-keys
+		       "Type \\[minibuffer-next-completion], \\[minibuffer-previous-completion], \
+\\[minibuffer-next-line-completion], \\[minibuffer-previous-line-completion] \
+to move point between completions.\n\n")))))
+              (dolist (help helps)
+                (insert help)))
+          (insert (substitute-command-keys
+	           (if (display-mouse-p)
+	               "Click or type \\[minibuffer-choose-completion] on a completion to select it.\n"
+                     "Type \\[minibuffer-choose-completion] on a completion to select it.\n")))
+          (insert (substitute-command-keys
+		   "Type \\[minibuffer-next-completion] or \\[minibuffer-previous-completion] \
+to move point between completions.\n\n")))))))
 
 (add-hook 'completion-setup-hook #'completion-setup-function)
 
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help
  2024-01-24 16:09 bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help Spencer Baugh
  2024-01-24 16:11 ` Spencer Baugh
@ 2024-01-24 16:47 ` Juri Linkov
  2024-01-24 17:22   ` Spencer Baugh
  1 sibling, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2024-01-24 16:47 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: 68689

> completion-show-help shows some useful help for new users.
> However, it suggests suboptimal bindings when
> minibuffer-visible-completions is on.  minibuffer-visible-completions
> should change the help shown by completion-show-help.
>
> A patch to do this will follow.

It's hard to see what your patch will output.
Could you please send the outputs of `emacs -Q`
to compare before and after your patch.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help
  2024-01-24 16:47 ` Juri Linkov
@ 2024-01-24 17:22   ` Spencer Baugh
  2024-01-25  7:50     ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Spencer Baugh @ 2024-01-24 17:22 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 68689

Juri Linkov <juri@linkov.net> writes:

>> completion-show-help shows some useful help for new users.
>> However, it suggests suboptimal bindings when
>> minibuffer-visible-completions is on.  minibuffer-visible-completions
>> should change the help shown by completion-show-help.
>>
>> A patch to do this will follow.
>
> It's hard to see what your patch will output.
> Could you please send the outputs of `emacs -Q`
> to compare before and after your patch.

With minibuffer-visible-completions=nil, there's no change.

With minibuffer-visible-completions=t, before my patch:

Click or type M-RET on a completion to select it.
Type M-<down> or M-<up> to move point between completions.

After my patch:

Click or type RET on a completion to select it.
Type <right>, <left>, <down>, <up> to move point between completions.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help
  2024-01-24 17:22   ` Spencer Baugh
@ 2024-01-25  7:50     ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2024-01-25  7:50 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: 68689

close 68689 30.0.50
thanks

> With minibuffer-visible-completions=nil, there's no change.
>
> With minibuffer-visible-completions=t, before my patch:
>
> Click or type M-RET on a completion to select it.
> Type M-<down> or M-<up> to move point between completions.
>
> After my patch:
>
> Click or type RET on a completion to select it.
> Type <right>, <left>, <down>, <up> to move point between completions.

Thanks, this looks nice.  Now pushed to master and closed.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-25  7:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 16:09 bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help Spencer Baugh
2024-01-24 16:11 ` Spencer Baugh
2024-01-24 16:47 ` Juri Linkov
2024-01-24 17:22   ` Spencer Baugh
2024-01-25  7:50     ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).