From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: OGAWA Hirofumi Newsgroups: gmane.emacs.bugs Subject: bug#32757: 27.0.50; icomplete-mode's M-TAB doesn't as documented Date: Tue, 18 Sep 2018 18:19:56 +0900 Message-ID: <87lg7ztb5v.fsf@mail.parknet.co.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp X-Trace: blaine.gmane.org 1537262357 12365 195.159.176.226 (18 Sep 2018 09:19:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2018 09:19:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 32757@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 18 11:19:13 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2CA4-00034G-Th for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Sep 2018 11:19:13 +0200 Original-Received: from localhost ([::1]:39236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2CCB-0003OS-B3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Sep 2018 05:21:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2CBz-0003N9-2H for bug-gnu-emacs@gnu.org; Tue, 18 Sep 2018 05:21:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2CBr-0002Un-AO for bug-gnu-emacs@gnu.org; Tue, 18 Sep 2018 05:21:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g2CBq-0002Tv-QI for bug-gnu-emacs@gnu.org; Tue, 18 Sep 2018 05:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g2CBq-0001OZ-Jc for bug-gnu-emacs@gnu.org; Tue, 18 Sep 2018 05:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: OGAWA Hirofumi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Sep 2018 09:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15372624265267 (code B ref -1); Tue, 18 Sep 2018 09:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Sep 2018 09:20:26 +0000 Original-Received: from localhost ([127.0.0.1]:43629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2CBG-0001Ms-93 for submit@debbugs.gnu.org; Tue, 18 Sep 2018 05:20:26 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2CBE-0001Md-8p for submit@debbugs.gnu.org; Tue, 18 Sep 2018 05:20:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2CB2-0001CS-MX for submit@debbugs.gnu.org; Tue, 18 Sep 2018 05:20:18 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g2CB2-0001CI-J2 for submit@debbugs.gnu.org; Tue, 18 Sep 2018 05:20:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2CB1-0002sm-19 for bug-gnu-emacs@gnu.org; Tue, 18 Sep 2018 05:20:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2CAw-0000yw-1t for bug-gnu-emacs@gnu.org; Tue, 18 Sep 2018 05:20:09 -0400 Original-Received: from mail.parknet.co.jp ([210.171.160.6]:58478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2CAs-0000uX-AV for bug-gnu-emacs@gnu.org; Tue, 18 Sep 2018 05:20:04 -0400 Original-Received: from ibmpc.myhome.or.jp (server.parknet.ne.jp [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTPSA id BD56A15AF4B for ; Tue, 18 Sep 2018 18:19:58 +0900 (JST) Original-Received: from devron.myhome.or.jp (foobar@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.15.2/8.15.2/Debian-11) with ESMTPS id w8I9JvNv027865 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 18 Sep 2018 18:19:58 +0900 Original-Received: from devron.myhome.or.jp (foobar@localhost [127.0.0.1]) by devron.myhome.or.jp (8.15.2/8.15.2/Debian-11) with ESMTPS id w8I9JvCl011666 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 18 Sep 2018 18:19:57 +0900 Original-Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.15.2/8.15.2/Submit) id w8I9Jv4N011665; Tue, 18 Sep 2018 18:19:57 +0900 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150393 Archived-At: Documentation of icomplete says: [‘M-’ will select the first completion in the list, like ‘C-j’ but without exiting the minibuffer, so you can edit it further. This is typically used when entering a file name, where ‘M-’ can be used a few times to descend in the hierarchy of directories.] But current implemetation doesn't work like it, and behavior is useless if completing file name. Step to reproduce, cd /path/to/emacs-src LANG=C emacs -Q (icomplete-mode) C-x C-f /path/to/emacs-src/{m4/ | nt/ | lib/ ... Choice "nt/" from list by repeating "C-.", then select "nt/" by "M-TAB" /path/to/emacs-src/nt/{lib/ | doc/ | etc/ ... Completion list is still showing under the /path/to/emacs-src, not /path/to/emacs-src/nt/, and we can't be used to descend in the hierarchy of directories. This is because `minibuffer-force-complete' enters cyclic mode to select from current completion list, so repeating "M-TAB" doesn't work as documented. Furthermore, in the case of icomplete mode, user already selected from list by "C-." or "C-,", so cyclic behavior of `minibuffer-force-complete' is useless IMO, especially for file name completion. To make changing behavior minimum, this patch just change in the case of file name completion only to work as documented. Thanks. --- lisp/icomplete.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff -puN lisp/icomplete.el~icomplete-completion-fix lisp/icomplete.el --- emacs/lisp/icomplete.el~icomplete-completion-fix 2018-09-18 17:52:07.848686039 +0900 +++ emacs-hirofumi/lisp/icomplete.el 2018-09-18 17:52:48.202692477 +0900 @@ -145,13 +145,23 @@ icompletion is occurring." (defvar icomplete-minibuffer-map (let ((map (make-sparse-keymap))) - (define-key map [?\M-\t] 'minibuffer-force-complete) + (define-key map [?\M-\t] 'icomplete-force-complete) (define-key map [?\C-j] 'icomplete-force-complete-and-exit) (define-key map [?\C-.] 'icomplete-forward-completions) (define-key map [?\C-,] 'icomplete-backward-completions) map) "Keymap used by `icomplete-mode' in the minibuffer.") +(defun icomplete-force-complete () + "Select the first completion in the list. +Repeated uses step through the possible completions if not +completing file name." + (interactive) + (call-interactively #'minibuffer-force-complete) + ;; Cycle may not be useful for icomplete, so this should be unconditional? + (when minibuffer-completing-file-name + (completion--flush-all-sorted-completions))) + (defun icomplete-force-complete-and-exit () "Complete the minibuffer and exit. Use the first of the matches if there are any displayed, and use _ In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-08-04 built on devron Repository revision: da0054c30729e58259c1e7251cb03c8ef13ff943 Windowing system distributor 'The X.Org Foundation', version 11.0.12001000 System Description: Debian GNU/Linux buster/sid Recent messages: Checking 205 files in /usr/local/share/emacs/27.0.50/lisp/gnus... Checking 57 files in /usr/local/share/emacs/27.0.50/lisp/eshell... Checking 71 files in /usr/local/share/emacs/27.0.50/lisp/erc... Checking 34 files in /usr/local/share/emacs/27.0.50/lisp/emulation... Checking 181 files in /usr/local/share/emacs/27.0.50/lisp/emacs-lisp... Checking 24 files in /usr/local/share/emacs/27.0.50/lisp/cedet... Checking 57 files in /usr/local/share/emacs/27.0.50/lisp/calendar... Checking 87 files in /usr/local/share/emacs/27.0.50/lisp/calc... Checking 107 files in /usr/local/share/emacs/27.0.50/lisp/obsolete... Checking for load-path shadows...done Configured using: 'configure --libexecdir=/usr/local/lib --with-x --with-x-toolkit=gtk3 --without-xim --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-dbus --with-wide-int --with-modules' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS JSON LCMS2 Important settings: value of $LANG: ja_JP.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Group Minor modes in effect: gnus-topic-mode: t gnus-undo-mode: t flycheck-pos-tip-mode: t global-flycheck-mode: t auto-insert-mode: t yas-global-mode: t yas-minor-mode: t global-company-mode: t company-mode: t savehist-mode: t eyebrowse-mode: t icomplete-mode: t show-paren-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t Load-path shadows: /usr/local/share/emacs/site-lisp/google-translate/features/support/env hides /usr/local/share/emacs/27.0.50/lisp/env Features: (shadow nnir emacsbug sendmail stem lookup-entry ndkks lookup-kanji lookup-kanji-mecab ndict ndeb ndeb-binary lookup-content lookup-vse lookup-text lookup-text-table lookup-package lookup lookup-types lookup-utils lookup-cache lookup-vars evi url-http url-gw url-auth url-cache jka-compr gnus-dup shr-color color mm-archive bbdb-gui bbdb-hooks gnus-notifications gnus-fun notifications dbus hl-line elfeed-show elfeed-search bookmark shr text-property-search svg dom elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db elfeed-lib avl-tree generator url-queue browse-url xml-query xml pp sort gnus-cite gnus-async gnus-bcklg qp gnus-ml disp-table gnus-topic utf-7 rfc2104 gnutls network-stream nsm nnfolder bbdb-gnus bbdb-snarf mail-extr nnnil spam spam-stat bbdb-com warnings bbdb timezone gnus-uu yenc gnus-demon gnus-delay gnus-draft gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum nndraft nnmh gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message rmc puny rfc822 mml mml-sec epa mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils wid-edit dircolors-faces ansi-color dired-x dired dired-loaddefs company-yasnippet flyspell ispell server generic-x multi-translate google-translate-smooth-ui google-translate google-translate-default-ui google-translate-core-ui ido google-translate-core google-translate-tk url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap magit-autoloads git-modes-autoloads flycheck-pos-tip pos-tip flycheck find-func autoinsert yasnippet elec-pair company-oddmuse company-keywords company-etags etags xref project ring company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-bbdb company edmacro kmacro bbdb-autoloads savehist browse-kill-ring cl eyebrowse-session desktop frameset eyebrowse format-spec dash icomplete paren mozc-im-indicater mozc-popup popup mozc-im advice mm-util mail-prsvr time-date mule-util mozc rx finder-inf package let-alist derived pcase cl-extra help-mode easymenu url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq byte-opt gv bytecomp byte-compile cconv epg epg-config subr-x cl-loaddefs cl-lib japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 703470 187252) (symbols 48 46081 549) (miscs 40 466 1661) (strings 32 347210 34028) (string-bytes 1 12772950) (vectors 16 133897) (vector-slots 8 2279431 111054) (floats 8 20418 3100) (intervals 56 3312 1331) (buffers 992 65)) -- OGAWA Hirofumi