From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22544: 25.0.90; Long history items cause surprising positioning of cursor in minibuffer Date: Wed, 03 Feb 2016 18:32:58 +0200 Message-ID: <83a8nhycsl.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1454517330 10792 80.91.229.3 (3 Feb 2016 16:35:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Feb 2016 16:35:30 +0000 (UTC) To: 22544@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 03 17:35:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aR0Ok-0007Ff-Fu for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Feb 2016 17:35:18 +0100 Original-Received: from localhost ([::1]:36161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR0Og-000137-F3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Feb 2016 11:35:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR0Nf-00085N-OW for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 11:34:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR0NW-0007up-KI for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 11:34:11 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR0NW-0007ul-H0 for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 11:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aR0NW-0004HW-D3 for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 11:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Feb 2016 16:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22544 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.145451721316420 (code B ref -1); Wed, 03 Feb 2016 16:34:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Feb 2016 16:33:33 +0000 Original-Received: from localhost ([127.0.0.1]:58273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aR0N2-0004Gm-UG for submit@debbugs.gnu.org; Wed, 03 Feb 2016 11:33:33 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60669) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aR0N1-0004GY-C0 for submit@debbugs.gnu.org; Wed, 03 Feb 2016 11:33:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR0Mu-0007mP-IW for submit@debbugs.gnu.org; Wed, 03 Feb 2016 11:33:26 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR0Mu-0007mL-FZ for submit@debbugs.gnu.org; Wed, 03 Feb 2016 11:33:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR0Mq-0006uv-1N for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 11:33:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR0Mm-0007kG-Mn for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 11:33:19 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:32945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR0Mm-0007kC-Is for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 11:33:16 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3155 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aR0Ml-0006J6-UI for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 11:33:16 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112347 Archived-At: emacs -Q Paste the following into *scratch* and evaluate it with "C-x C-e" after the closing parenthesis: (let ((default-file "~/rmail/FOO") (file-name-history '("~/rmail/FOOBAR" "~/foo/bar/very/long/file/name/that/overflows/minibuffer/window/line/when/displayed" "~/shorter/file/name"))) (read-file-name (concat "Output message to mail file (default " (file-name-nondirectory default-file) "): ") (file-name-directory default-file) (abbreviate-file-name default-file))) You should now see this in the minibuffer: Output message to mail file (default FOO): ~/rmail/! where ! shows the cursor position. Now press once. The result is as expected: Output message to mail file (default FOO): ~/rmail/FOOBAR! with the cursor at the end of the history item. Press one more time, which results in this: Output message to mail file (default FOO): ~/foo/bar/very/long/file/name/that/overflows/minibuffer/window/line/when/displayed! Still as expected. Press once more, resulting in: Output message to mail file (default FOO): ~/foo/ba!r/very/long/file/name/that/overflows/minibuffer/window/line/when/displayed This is somewhat unexpected, because the column of the cursor looks random -- it is neither the same as in previous display, nor related to anything else I can think of. Now press one more time, and observe this result: Output message to mail file (default FOO): ~/shorte!r/file/name This is even less expected -- why isn't the cursor at the end of the file name, even though it is short enough to display entirely on a single screen line? If the longish history item is removed before evaluating the above, then the behavior is as expected -- Emacs places the cursor at the end of each history item. Clearly, the bug is not a catastrophe, but it's quite annoying to see the cursor jump to these unexpected positions. The test case is synthesized, but it faithfully emulates what happens to me every time I use 'o' in Rmail to file a message in my archives. The archive folders are just mbox files, so the 'o' command in Rmail uses file-name-history, where I have long file names as well as short ones. In GNU Emacs 25.0.90.2 (i686-pc-mingw32) of 2016-01-31 built on HOME-C4E4A596F7 Windowing system distributor 'Microsoft Corp.', version 5.1.2600 Configured using: 'configure --prefix=/d/usr --enable-checking=yes,glyphs --with-wide-int --with-modules 'CFLAGS=-Og -gdwarf-4 -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: RMAIL Minor modes in effect: shell-dirtrack-mode: t diff-auto-refine-mode: t desktop-save-mode: t save-place-mode: t show-paren-mode: t display-time-mode: t tooltip-mode: t global-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 temp-buffer-resize-mode: t buffer-read-only: t line-number-mode: t Recent messages: Showing message 2138...done Showing message 2139...done Added to d:/usr/eli/rmail/GIT.rmail Showing message 2140...done Showing message 2141...done Showing message 2142...done Showing message 2143...done No following nondeleted message command-execute: Command attempted to use minibuffer while in minibuffer Mark set Load-path shadows: d:/usr/share/emacs/site-lisp/soap-inspect hides d:/usr/share/emacs/25.0.90/lisp/net/soap-inspect d:/usr/share/emacs/site-lisp/soap-client hides d:/usr/share/emacs/25.0.90/lisp/net/soap-client Features: (shadow emacsbug ruby-mode smie shell character-fold misearch multi-isearch rmailout url-util url-parse url-vars rfc2104 network-stream nsm starttls tls gnutls mail-extr smtpmail auth-source eieio eieio-core cl-macs password-cache dabbrev mailalias sendmail shr-color color shr dom subr-x browse-url cl-seq conf-mode arc-mode archive-mode vc-bzr org-element org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view image-mode org-bibtex bibtex org-bbdb org-w3m org advice org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint comint ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs bat-mode make-mode parse-time vc-cvs generic vc-svn texinfo jka-compr noutline outline bug-reference flyspell add-log info vc vc-dispatcher vc-git diff-mode easy-mmode map seq byte-opt gv bytecomp byte-compile cconv cl-extra qp rmailsum rmailmm message dired-x dired format-spec rfc822 mml mml-sec epg epg-config gnus-util mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse rfc2231 rmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode mail-prsvr mail-utils desktop frameset server filecache mairix cus-edit cus-start cus-load wid-edit saveplace midnight ispell generic-x cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs pcase cl-lib paren battery time time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core 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 charscript case-table epa-hook jka-cmpr-hook help simple abbrev 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 w32notify w32 multi-tty make-network-process emacs) Memory information: ((conses 16 1683542 243444) (symbols 56 41206 0) (miscs 48 3561 4743) (strings 16 113909 44473) (string-bytes 1 3147922) (vectors 16 41851) (vector-slots 8 1701426 256664) (floats 8 497 588) (intervals 40 326308 7211) (buffers 856 218))