unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49005: 28.0.50; Not possible to jump to first or last completions entry in fido-vertical-mode
@ 2021-06-13 15:27 Simon Lang
  2021-06-30 19:27 ` Simon Lang
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Lang @ 2021-06-13 15:27 UTC (permalink / raw)
  To: 49005; +Cc: João Távora


[-- Attachment #1.1: Type: text/plain, Size: 3744 bytes --]


In the brand new fido-vertical mode, completions are not cycled in contrast to icomplete-vertical-mode.
There is not yet a function to jump to the first or last completions entry, which sometimes can be helpful.
This patch would proposes two simple helper functions for doing that.

Thank you!





In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.5.0, NS appkit-2022.50 Version 11.4 (Build 20F71))
 of 2021-06-06 built on Zwei.local
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.4

Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs-plus@28/28.0.50/share/info/emacs
 --prefix=/usr/local/Cellar/emacs-plus@28/28.0.50 --with-xml2
 --with-gnutls --with-native-compilation --without-dbus
 --with-imagemagick --with-modules --with-rsvg --with-ns
 --disable-ns-self-contained 'CFLAGS=-I/usr/local/opt/gcc/include
 -I/usr/local/opt/libgccjit/include -I/usr/local/opt/gmp/include
 -I/usr/local/opt/jpeg/include' 'LDFLAGS=-L/usr/local/lib/gcc/11
 -I/usr/local/opt/gcc/include -I/usr/local/opt/libgccjit/include
 -I/usr/local/opt/gmp/include -I/usr/local/opt/jpeg/include''

Configured features:
ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF
TOOLKIT_SCROLL_BARS XIM ZLIB

Important settings:
  value of $LANG: en_GB.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
  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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv 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
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-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 cl-generic 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 charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads kqueue cocoa ns lcms2
multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 67367 8465)
 (symbols 48 6527 0)
 (strings 32 18695 2230)
 (string-bytes 1 645512)
 (vectors 16 13390)
 (vector-slots 8 280721 11188)
 (floats 8 22 39)
 (intervals 56 226 0)
 (buffers 992 10))


[-- Attachment #1.2: Type: text/html, Size: 4702 bytes --]

[-- Attachment #2: 0001-icomplete-vertical-functions-to-go-to-first-or-last-.patch --]
[-- Type: application/octet-stream, Size: 2454 bytes --]

From 608a15a5c426261619aac4e6401d4f4e4900cf13 Mon Sep 17 00:00:00 2001
From: Simon lang <simon.lang@outlook.com>
Date: Sun, 13 Jun 2021 15:59:20 +0100
Subject: [PATCH] icomplete-vertical functions to go to first or last entry

These allow to go to the first or last completion entry
when icomplete-scroll is non-nil in fido-vertical-mode,
i.e. when cycling is deactivated
* lisp/icomplete.el (icomplete-vertical-goto-first,
icomplete-vertical-goto-last):
---
 lisp/icomplete.el | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 08b4ef2030..5cc82de359 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -276,6 +276,30 @@ Last entry becomes the first and can be selected with
            (setcdr last-but-one (cdr (cdr last-but-one)))))
     (completion--cache-all-sorted-completions beg end comps)))
 
+(defun icomplete-vertical-goto-first ()
+  "Go to first completions entry when `icomplete-scroll' is non-nil"
+  (interactive)
+  (let* ((beg (icomplete--field-beg))
+         (end (icomplete--field-end))
+         (comps (completion-all-sorted-completions beg end)))
+    (when icomplete-scroll
+      (while icomplete--scrolled-past
+        (push (pop icomplete--scrolled-past) comps)
+        (setq icomplete--scrolled-completions comps))
+      (completion--cache-all-sorted-completions beg end comps))))
+
+(defun icomplete-vertical-goto-last ()
+  "Go to last completions entry when `icomplete-scroll' is non-nil"
+  (interactive)
+  (let* ((beg (icomplete--field-beg))
+         (end (icomplete--field-end))
+         (comps (completion-all-sorted-completions beg end)))
+    (when icomplete-scroll
+      (while (consp (cdr comps))
+	(push (pop comps) icomplete--scrolled-past)
+	(setq icomplete--scrolled-completions comps)
+	(completion--cache-all-sorted-completions beg end comps)))))
+
 ;;; Helpers for `fido-mode' (or `ido-mode' emulation)
 ;;;
 (defun icomplete-fido-kill ()
@@ -600,6 +624,8 @@ Usually run by inclusion in `minibuffer-setup-hook'."
   (let ((map (make-sparse-keymap)))
     (define-key map (kbd "C-n") 'icomplete-forward-completions)
     (define-key map (kbd "C-p") 'icomplete-backward-completions)
+    (define-key map (kbd "C-M-<") 'icomplete-vertical-goto-first)
+    (define-key map (kbd "C-M->") 'icomplete-vertical-goto-last)
     map)
   "Keymap used by `icomplete-vertical-mode' in the minibuffer.")
 
-- 
2.30.1 (Apple Git-130)


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

end of thread, other threads:[~2021-09-06 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-13 15:27 bug#49005: 28.0.50; Not possible to jump to first or last completions entry in fido-vertical-mode Simon Lang
2021-06-30 19:27 ` Simon Lang
2021-06-30 20:08   ` João Távora
2021-08-17 12:00     ` João Távora
2021-09-06 16:24       ` Simon Lang
     [not found]   ` <ad80a840df59497f8128bc8a98ca7b05@DBAPR06MB7045.eurprd06.prod.outlook.com>
2021-07-01  8:16     ` Simon Lang
2021-08-17 12:09       ` João Távora

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).