From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#40896: 27.0.91; Moving point fails sometimes in shell-command Date: Mon, 27 Apr 2020 10:28:03 +0200 Message-ID: <877dy1miy4.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="80621"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tino Calancha To: 40896@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 27 10:36:38 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jSzFl-000Kpr-O1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Apr 2020 10:36:37 +0200 Original-Received: from localhost ([::1]:59296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzFk-0000l4-0S for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Apr 2020 04:36:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50014) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz8U-0005K3-Gj for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 04:29:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz8Q-0006KQ-BR for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 04:29:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSz8P-0006KK-Uk for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 04:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jSz8P-0000Ah-Q3 for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 04:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Apr 2020 08:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40896 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1587976098600 (code B ref -1); Mon, 27 Apr 2020 08:29:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Apr 2020 08:28:18 +0000 Original-Received: from localhost ([127.0.0.1]:35593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSz7h-00009c-T8 for submit@debbugs.gnu.org; Mon, 27 Apr 2020 04:28:18 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSz7f-00009U-Ua for submit@debbugs.gnu.org; Mon, 27 Apr 2020 04:28:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49854) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz7e-0003gN-Rz for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 04:28:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz7a-00068y-CO for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 04:28:14 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:56803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz7Z-00068n-Kn for bug-gnu-emacs@gnu.org; Mon, 27 Apr 2020 04:28:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1587976086; bh=hjDn1ldAru4EQnNza4iczgXXQib+TY5FlQXekfI6ZtI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=SC8RXMr1vaOCUShwXJFD8m3v6mYi6qGuJ9FFxjOiDMd7DOKELpOWjXvtyVWLolFzj 4zx9ln1AxsbLhpbpp4iifG80N9c9m4DDOaO4TJ1tRQSeII0t0NBazPeNnfQ6aiF7jY JmsoJDCNA/BFwo6IfOkDtX1QNew8ZO5MbOruR7U0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.86.61.231]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MbivG-1iuCXA1PHK-00dCjP; Mon, 27 Apr 2020 10:28:06 +0200 X-Provags-ID: V03:K1:hKeze9+mVkraO2HCcfPliIlTGFmB87dhSg/vz0dAr2mB2Y3e0Qk 7Fdov8Gf0tAz7XQxKr1rkunCz8uE46/Hnh1bAVTZcMwGfvvtiYfgg3HZp9mYnZXwNASQiQ9 HISMxppBWid+7AWzOGP+wcxcYMXe4HnQTWKQb3n/yZ6CBSStuig75PsXPGu/02l+yOMJHtc Bbk+r5VNHhl+ZB2Y2k7Eg== X-UI-Out-Filterresults: notjunk:1;V03:K0:khkILE2oX/g=:50WqCa8UgQWwBJzVhNNUcW 0YQ3N3YI9MZfO6H6ptSjk/HqIGWtvFZZZUV+6VW3O7Kuhhcs3MK/fm3nV9ijHThoHpQWXUlrh PjUOmiswRm48D0fjA5TRC5eii3jg5UOfQJ7zWj6lK3VxHrxBF1jxf1JnvTMBxp5sNKrzPzs8s xcOgxg4lMKLBueK3ocpQHeWGa+eh2IEiEvC/7uUsNbxiCrtw3mow4WofxLwlh+HMHHigyBGiS tan6TRZbnK4o+/72eorrYKYxXcEPwNxHvxTw0i2mD2NybyofkQOMBrqK2EDJA9Czwa6o+PTlz nKAcEjZFW/WhKcJTdVsH4p5Fgr7Sf2m7I7jq4Y5deXmz2xktfcsWufsIhWirX0XaPm1sPfTjA wA1KX8/DJzG+tuJGYJ3kXFuMyGeHjHM6pC+Cc+LknLz+94jjdDF7afGOUq4PK0pJcEzXbk6Or ZWlITm1WZnx1itEv2rwqlntb1QnrIy2G/906GN7LzLL4IxSqiMTq5P/EwVIii0zIgGG8H4vZr dAJiO8BR2CWmoLfF1BgakNcSLTO9l1wWVxW1a5O635+LrIhAfOjoC2ZgdUuBkR2gnzAcDcqJR g4GaZ3mZoDWTiXLdfdJTHIo6VusgDyAy22CZ7hW/meacK03rlAy15ecTMuM27xf8mmRw/Ioq+ OQmDD2zbW6kLmapQrdOdCl8aqQ+n4XPWiwONGnyk2DFZvlH68NbXF7Cq6aQe8WOb4SMcg7Ctt 14iyGw4lweTyO3DGt0e14Z87jMbTdO2pglW8EzHZqJt0Raccm4NO0IR76M+gFFgi2odGpQQ4 Received-SPF: pass client-ip=212.227.17.20; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 02:37:28 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179134 Archived-At: Hi, `shell-command' shall move the point after the output of the command, unless indicated otherwise by `shell-command-dont-erase-buffer'. This works almost, but not always. I have extracted three test cases which fail. --8<---------------cut here---------------start------------->8--- ;; Erase if buffer is the current one, but ;; `shell-command-dont-erase-buffer' is set to `erase'. ;; Move point to `point-max'. (let ((default-directory temporary-file-directory) (shell-command-dont-erase-buffer 'erase)) (with-temp-buffer (insert "bar") (cl-assert (string-equal "bar" (buffer-string))) (cl-assert (= (point) (point-max))) (shell-command "echo baz" (current-buffer)) (cl-assert (string-equal "baz\n" (buffer-string))) ;; Point is not moved after the inserted text. (cl-assert (= (point) (point-max)) 'show-args))) ;; Don't erase if the buffer is the current one and ;; `shell-command-dont-erase-buffer' is set to `end-last-out'. ;; Move point to `point-max'. (let ((default-directory temporary-file-directory) (shell-command-dont-erase-buffer 'end-last-out)) (with-temp-buffer (insert "bar") (cl-assert (string-equal "bar" (buffer-string))) (cl-assert (= (point) (point-max))) (shell-command "echo baz" (current-buffer)) (cl-assert (string-equal "barbaz\n" (buffer-string))) ;; Point is not moved after the inserted text. (cl-assert (= (point) (point-max)) 'show-args))) ;; Don't erase if the buffer is the current one and ;; `shell-command-dont-erase-buffer' is set to a random value. ;; Move point to `point-max'. (let ((default-directory temporary-file-directory) (shell-command-dont-erase-buffer 'random)) (with-temp-buffer (insert "bar") (cl-assert (string-equal "bar" (buffer-string))) (cl-assert (= (point) (point-max))) (shell-command "echo baz" (current-buffer)) (cl-assert (string-equal "barbaz\n" (buffer-string))) ;; Point is not moved after the inserted text. (cl-assert (= (point) (point-max)) 'show-args))) --8<---------------cut here---------------end--------------->8--- If it is undecided where point will be in the first and third case, this shall be documented at least. Best regards, Michael. In GNU Emacs 27.0.91 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.13) of 2020-04-26 built on gandalf Repository revision: 68f4a740a13ee6a1d98079ef655dd42924d24d41 Repository branch: emacs-27 Windowing system distributor 'Fedora Project', version 11.0.12006000 System Description: Fedora 31 (Workstation Edition) Recent messages: Reading active file from news via nntp... Opening nntp server on news...done Opening connection to imap.gmx.net via tls... Opening connection to imap.gmx.net...done Reading active file via nnml... Reading incoming mail from pop... nnml: Reading incoming mail (no new mail)...done Reading active file via nnml...done Reading active file via nndraft...done Checking new news...done Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS PDUMPER LCMS2 GMP Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8 Major mode: Group Minor modes in effect: gnus-undo-mode: t erc-notify-mode: t erc-notifications-mode: t display-time-mode: t shell-dirtrack-mode: t delete-selection-mode: t icomplete-mode: t show-paren-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-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 buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /home/albinus/src/tramp/lisp/tramp-sh hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-sh /home/albinus/src/tramp/lisp/tramp-compat hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-compat /home/albinus/src/tramp/lisp/tramp hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp /home/albinus/src/tramp/lisp/tramp-rclone hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-rclone /home/albinus/src/tramp/lisp/tramp-cmds hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-cmds /home/albinus/src/tramp/lisp/tramp-gvfs hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-gvfs /home/albinus/src/tramp/lisp/tramp-uu hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-uu /home/albinus/src/tramp/lisp/tramp-integration hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-integration /home/albinus/src/tramp/lisp/tramp-archive hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-archive /home/albinus/src/tramp/lisp/tramp-adb hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-adb /home/albinus/src/tramp/lisp/trampver hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/trampver /home/albinus/src/tramp/lisp/tramp-ftp hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-ftp /home/albinus/src/tramp/lisp/tramp-smb hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-smb /home/albinus/src/tramp/lisp/tramp-cache hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-cache /home/albinus/src/tramp/lisp/tramp-sudoedit hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-sudoedit /home/albinus/src/tramp/lisp/tramp-loaddefs hides /home/albinus/.emacs.d/elpa/tramp-2.4.3.3/tramp-loaddefs /home/albinus/src/elpa/packages/tramp-theme/tramp-theme-autoloads hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme-autoloads /home/albinus/src/elpa/packages/tramp-theme/tramp-theme hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme /home/albinus/src/elpa/packages/tramp-theme/tramp-theme-pkg hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme-pkg /home/albinus/src/tramp/lisp/tramp-sh hides /home/albinus/src/emacs-27/lisp/net/tramp-sh /home/albinus/src/tramp/lisp/tramp-cmds hides /home/albinus/src/emacs-27/lisp/net/tramp-cmds /home/albinus/src/tramp/lisp/tramp-gvfs hides /home/albinus/src/emacs-27/lisp/net/tramp-gvfs /home/albinus/src/tramp/lisp/tramp-ftp hides /home/albinus/src/emacs-27/lisp/net/tramp-ftp /home/albinus/src/tramp/lisp/tramp-adb hides /home/albinus/src/emacs-27/lisp/net/tramp-adb /home/albinus/src/tramp/lisp/tramp hides /home/albinus/src/emacs-27/lisp/net/tramp /home/albinus/src/tramp/lisp/tramp-cache hides /home/albinus/src/emacs-27/lisp/net/tramp-cache /home/albinus/src/tramp/lisp/tramp-rclone hides /home/albinus/src/emacs-27/lisp/net/tramp-rclone /home/albinus/src/tramp/lisp/tramp-compat hides /home/albinus/src/emacs-27/lisp/net/tramp-compat /home/albinus/src/tramp/lisp/tramp-integration hides /home/albinus/src/emacs-27/lisp/net/tramp-integration /home/albinus/src/tramp/lisp/tramp-archive hides /home/albinus/src/emacs-27/lisp/net/tramp-archive ~/lisp/dbus hides /home/albinus/src/emacs-27/lisp/net/dbus /home/albinus/src/tramp/lisp/tramp-sudoedit hides /home/albinus/src/emacs-27/lisp/net/tramp-sudoedit /home/albinus/src/tramp/lisp/tramp-loaddefs hides /home/albinus/src/emacs-27/lisp/net/tramp-loaddefs /home/albinus/src/tramp/lisp/tramp-uu hides /home/albinus/src/emacs-27/lisp/net/tramp-uu /home/albinus/src/tramp/lisp/tramp-smb hides /home/albinus/src/emacs-27/lisp/net/tramp-smb /home/albinus/src/tramp/lisp/trampver hides /home/albinus/src/emacs-27/lisp/net/trampver Features: (shadow sort mail-extr warnings emacsbug pop3 utf-7 nndraft nnmh nnml gnutls network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-cache gnus-sum url url-proxy url-privacy url-expand url-methods url-history mailcap shr url-cookie url-domsuf url-util svg dom nnnil smtpmail sendmail gnus-demon nntp gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc puny rfc822 mml mml-sec epa derived epg epg-config 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 text-property-search mail-utils mm-util mail-prsvr wid-edit eieio-opt cl-extra speedbar sb-image ezimage dframe help-fns radix-tree cl-print debug backtrace help-mode find-func vc vc-dispatcher erc-notify erc-networks erc-desktop-notifications erc-match notifications dbus xml erc-goodies erc erc-backend erc-compat thingatpt pp erc-loaddefs cperl-mode time tramp-sh vagrant-tramp dash term disp-table ehelp tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete comint ansi-color ring parse-time iso8601 time-date ls-lisp format-spec delsel ido jka-compr icomplete paren dired dired-loaddefs info package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib 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 tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu 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 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 212745 10654) (symbols 48 21733 1) (strings 32 66828 3046) (string-bytes 1 2267312) (vectors 16 31843) (vector-slots 8 397198 17284) (floats 8 253 37) (intervals 56 2268 0) (buffers 1000 24))