From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: Vitalie Spinu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2012 13:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13248@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135609572116093 (code B ref -1); Fri, 21 Dec 2012 13:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2012 13:15:21 +0000 Received: from localhost ([127.0.0.1]:53612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm2Rb-0004BT-Pk for submit@debbugs.gnu.org; Fri, 21 Dec 2012 08:15:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38570) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm2RX-0004BI-JM for submit@debbugs.gnu.org; Fri, 21 Dec 2012 08:15:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm2RA-0001uP-Jm for submit@debbugs.gnu.org; Fri, 21 Dec 2012 08:15:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm2RA-0001uL-Gc for submit@debbugs.gnu.org; Fri, 21 Dec 2012 08:14:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm2R2-0007Ug-26 for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 08:14:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm2Qu-0001s8-CE for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 08:14:43 -0500 Received: from mail-ea0-f178.google.com ([209.85.215.178]:39719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm2Qu-0001rz-2o for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 08:14:36 -0500 Received: by mail-ea0-f178.google.com with SMTP id k11so1919578eaa.23 for ; Fri, 21 Dec 2012 05:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=s40aVUQyranEECoS+skoJ2Q+FjizuarsVcHY8jq1FuU=; b=cyoD8I9Vrhhtkt8VtPkgFgMCWF37y9bG6B5wHiSYjibIp2L7yViz3+komkcAvqnFJc NVjvX/tAlydVsN7GGOKsmMHKEumStCAtN+HAQpNiXlLI+qfveWFKOpQRH1LiNba45rCe Des49n+aMyawH91zXt7nf+yZUMpMGizveJjX4ybiz9IbcQMa0pFPS/+V5yeZsqBWzvsx p6/XxqkE6Zi2AzrI2ZKyKgSZ4nz+EFyE3y6HOEgiO+DfVuouvBteUhB4IEja2Ev0IguH QwDdHB6q5KgKF2rlssN9RJttq5Ir+xo1joNoyUEPZMTn5CAhUJwAHjEJP//6kfkYNaUm DjOg== X-Received: by 10.14.204.198 with SMTP id h46mr32213089eeo.1.1356095674638; Fri, 21 Dec 2012 05:14:34 -0800 (PST) Received: from localhost (i108036.upc-i.chello.nl. [62.195.108.36]) by mx.google.com with ESMTPS id l3sm21594481eem.14.2012.12.21.05.14.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 05:14:33 -0800 (PST) From: Vitalie Spinu Date: Fri, 21 Dec 2012 14:14:31 +0100 Message-ID: <87a9t7bl8o.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hi,=20 I am struggling with a-not-so-easily reproducible bug that occurs only with ESS when sending input from a buffer to a sub-process.=20 Whenever I send a string to a subprocess, the point in process buffer jumps to the middle of the buffer, instead of staying at the process-mark at eob, where it supposed to be. And this is not ESS problem. Here is what I found during my investigation. It happens with (select-window w) in the `comint-postoutput-scroll-to-bottom' (reproduced below). I was monitoring the value of the (point) just before and after it, and it looks like this: before (point):9943 after (point):8619 So the point is clearly moved in select-window. Moreover the (point) equals (window-end) just before select-window is called, so it is visible. Consequently, the following (comint-adjust-point selected) is completely screwed because it relies on point *not* being moved!=20=20 Here is a relevant piece of `comint-postoutput-scroll-to-bottom' =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2124 =E2=94=80 /home/vitoshka/TVC/emacs/lisp/comint.el =E2=94=80=E2= =94=80 =E2=94=82 (dolist (w (get-buffer-window-list current nil t)) =E2=94=82 (select-window w) =E2=94=82 (unwind-protect =E2=94=82 (progn =E2=94=82 (comint-adjust-point selected) =E2=94=82 ;; Optionally scroll to the bottom of the window. =E2=94=82 (and comint-scroll-show-maximum-output =E2=94=82 (eobp) =E2=94=82 (recenter (- -1 scroll-margin)))) =E2=94=82 (select-window selected)))))) =E2=94=82 (set-buffer current)))) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2134 =E2=94=80 The variable `comint-scroll-show-maximum-output' is the default t, this is why comint runs `comint-postoutput-scroll-to-bottom' in its `comint-output-filter-functions'. I can propose a patch for commit to reset the point, but it looks like there is something much more fundamental going on in here. Thanks,=20 Vitalie =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: sr-popviewer-mode: t TeX-PDF-mode: t rainbow-delimiters-mode: t global-auto-complete-mode: t auto-complete-mode: t diff-auto-refine-mode: t helm-match-plugin-mode: t shell-dirtrack-mode: t eldoc-mode: t show-paren-mode: t savehist-mode: t display-time-mode: t ido-everywhere: t global-auto-revert-mode: t global-subword-mode: t subword-mode: t tooltip-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 column-number-mode: t line-number-mode: t transient-mark-mode: t hs-minor-mode: t Recent input: C-p C-p C-u C-M-x C-n C-SPC=20 C-n C-n C-c C-r c c c C-o C-o M-> C-o =20 C-M-p C-p C-p C-p=20 C-p C-p C-p C-p C-SPC C-n C-n C-c C-r n n n n n n n=20 n n n n n n n n n n n n n n n n n n n n n n n n n n=20 n n n n n n n n n n n n n n n n n n n n n n n n n n=20 n n n n n n n C-p C-p C-SPC C-n C-n C-c C-r n n n n=20 n n n n n n n n n n n n n n n n n n n n n n n n n n=20 n n n n n n n n n n n n n n n n n n n n n n n n n n=20 n n n n n n n n n n n C-a C-p C-p C-p C-e=20 C-n C-n C-o C-x C-f ~ / t v e m a c =20 c o m i M-o s c r o l M-o=20 s c r o C-SPC o u t C-s M-k M-k M-k M-k M-k=20 M-k M-k C-n C-n C-n C-n C-n C-n C-n C-SPC C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n M-x k i l =20 C-x b C-g M-x e s s - v e r M-x v e r s =20 M-x b u g - r e s e n d=20 C-SPC b u g C-g M-x e m a c s C-SPC b u g Recent messages: Opening TLS connection to `imap.gmail.com'... Opening TLS connection with `gnutls-cli --insecure -p 993 imap.gmail.com'..= .failed Opening TLS connection with `gnutls-cli --insecure -p 993 imap.gmail.com --= protocols ssl3'...failed Opening TLS connection with `openssl s_client -connect imap.gmail.com:993 -= no_ssl2 -ign_eof'...done Opening TLS connection to `imap.gmail.com'...done Auto-saving... Mark set Quit ess-version : 12.09-1 [] GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.13) of 2012-11-15= on vitoshka-home Quit Load-path shadows: /home/vitoshka/Dropbox/ELPA/magit-20121030.2025/.dir-locals hides /home/vit= oshka/Dropbox/ELPA/sunrise-commander-20121117.2055/.dir-locals /home/vitoshka/Dropbox/ELPA/magit-20121030.2025/.dir-locals hides ~/VC/gnus= /.dir-locals ~/VC/gnus/lisp/lpath hides ~/VC/auctex/lpath /home/vitoshka/Dropbox/ELPA/popup-20121020.1203/popup hides ~/VC/popup-el/p= opup ~/VC/org-mode/lisp/org-remember hides /usr/local/share/emacs/24.2.50/lisp/o= rg/org-remember ~/VC/org-mode/lisp/org-protocol hides /usr/local/share/emacs/24.2.50/lisp/o= rg/org-protocol ~/VC/org-mode/lisp/ob-dot hides /usr/local/share/emacs/24.2.50/lisp/org/ob-= dot ~/VC/gnus/lisp/nnweb hides /usr/local/share/emacs/24.2.50/lisp/gnus/nnweb ~/VC/gnus/lisp/yenc hides /usr/local/share/emacs/24.2.50/lisp/gnus/yenc ~/VC/gnus/lisp/gnus-srvr hides /usr/local/share/emacs/24.2.50/lisp/gnus/gnu= s-srvr /home/vitoshka/Dropbox/ELPA/rebox2-20121113.2100/rebox2 hides /home/vitoshk= a/Dropbox/.emacs.d/site-lisp/rebox2/rebox2 Features: (shadow emacsbug edebug essddr helm-elisp helm-eval url-cache nnfolder bbdb-message sendmail flymake qp shr-color color shr url-http url-auth url-gw org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-info org-gnus org-docview org-bibtex bibtex org-bbdb wdired reftex-auc igrep tex-info texinfo two-column iso-transl vc-dispatcher vc-svn helm-mode url-handlers smiley gnus-cite flow-fill mm-archive mail-extr gnus-bcklg gnus-async gnus-ml gnus-topic utf-7 nndraft nnmh nnimap parse-time utf7 gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-cache bbdb-gnus gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig bbdb-mua bbdb-com netrc network-stream starttls tls gnus-notify gnus-demon nntp bbdb timezone supercite regi nnir gnus-sum gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus-load gnus gnus-ems gnus-compat nnheader mail-utils sunrise-x-popviewer sunrise-x-checkpoints bookmark sunrise-x-modeline sunrise-x-loop sunrise-x-tree sunrise-commander term ehelp electric hl-line find-dired esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-util esh-module esh-mode disp-table enriched desktop debug view magithub crm json magit-bisect magit-key-mode magit sort smex dabbrev skeleton helm-imenu misearch multi-isearch texmathp vc-git preview prv-emacs tex-buf reftex-dcr zotelo flyspell ispell font-latex latex tex-style tex dbus latexenc mule-util help-mode rainbow-delimiters helm-misc helm-files image-dired dired-x dired-aux helm-tags helm-bookmark helm-adaptative helm-info helm-net xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap helm-plugin helm-locate helm-help helm-external helm-buffers helm-grep helm-regexp grep helm-elscreen helm-utils ffap url-parse url-vars ob-latex ob-R appt diary-lib diary-loaddefs org-clock org-exp ob-exp org-agenda org ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs find-func cal-menu calendar cal-loaddefs iimage pos-tip ac-octave octave-inf octave-mod ac-math auto-complete-config auto-complete popup saveplace doc-view jka-compr image-mode reftex reftex-vars reftex-cite preview-latex tex-site auto-loads info-look psvn log-edit pcvs-util add-log diff-mode elp ediff-merg ediff-diff ediff-wind ediff-mult ediff-help ediff-init ediff-util dired xquery-mode generic rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok smart-operator rx rebox2 warnings slime-media slime-presentations slime-scratch slime-asdf slime-repl slime derived pp hyperspec menu-bar+ helm-descbinds helm-match-plugin helm helm-config mic-paren eldoc-eval adaptive-wrap-autoloads bbdb-autoloads bm-autoloads bookmark+-autoloads edit-server-autoloads eldoc-eval-autoloads esk-autoloads flex-isearch-autoloads fuzzy-autoloads fuzzy-match-autoloads git-blame-autoloads helm-autoloads helm-descbinds-autoloads htmlize-autoloads ido-load-library-autoloads ido-ubiquitous-autoloads ido-yes-or-no-autoloads igrep-autoloads jabber-autoloads js2-mode-autoloads lacarte-autoloads magit-gh-pulls-autoloads gh-autoloads logito-autoloads magit-push-remote-autoloads magithub-autoloads magit-autoloads markdown-mode+-autoloads markdown-mode-autoloads memory-usage-autoloads mic-paren-autoloads minimap-autoloads oauth2-autoloads persistent-soft-autoloads list-utils-autoloads pcache-autoloads finder-inf popup-autoloads rainbow-delimiters-autoloads rainbow-mode-autoloads rebox2-autoloads smex-autoloads stem-autoloads sunrise-commander-autoloads synonyms-autoloads w3m-autoloads zotelo-autoloads package tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cconv assoc gnus-util mm-util mail-prsvr password-cache tramp-loaddefs format-spec ess-toolbar ess-mouse mouseme thingatpt browse-url ess-menu ess-swv ess-noweb ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d ess-sas-l ess-sas-a shell pcomplete ess-arc-d ess-vst-d ess-xls-d ess-lsp-l ess-sta-d ess-sta-l cc-vars cc-defs make-regexp ess-sp6-d ess-sp5-d ess-sp3-d ess-julia ess-r-d ess-tracebug compile ess-roxy easy-mmode hideshow ess-help info reporter ess-developer ess-r-args eldoc ess-s-l speedbar sb-image ezimage dframe ess ess-inf comint ansi-color ring ess-mode ess-noweb-mode edmacro kmacro ess-utils ess-custom ess-compat ess-site ibuf-ext ibuffer recentf tree-widget wid-edit easymenu uniquify paren savehist time cus-start cus-load solarized-dark-theme solarized imenu-anywhere cl-macs gv imenu iflipb ido sh-script smie executable advice help-fns advice-preload autorevert subword server cl cl-lib time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2012 14:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vitalie Spinu Cc: 13248@debbugs.gnu.org Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.135609994622428 (code B ref 13248); Fri, 21 Dec 2012 14:26:02 +0000 Received: (at 13248) by debbugs.gnu.org; 21 Dec 2012 14:25:46 +0000 Received: from localhost ([127.0.0.1]:53672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm3XY-0005pQ-J1 for submit@debbugs.gnu.org; Fri, 21 Dec 2012 09:25:39 -0500 Received: from mout.gmx.net ([212.227.15.19]:54563) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm3XT-0005pF-G8 for 13248@debbugs.gnu.org; Fri, 21 Dec 2012 09:25:29 -0500 Received: from mailout-de.gmx.net ([10.1.76.19]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0LzEj9-1Szx0K0N6X-014Ur1 for <13248@debbugs.gnu.org>; Fri, 21 Dec 2012 15:25:13 +0100 Received: (qmail invoked by alias); 21 Dec 2012 14:25:12 -0000 Received: from 62-47-34-50.adsl.highway.telekom.at (EHLO [62.47.34.50]) [62.47.34.50] by mail.gmx.net (mp019) with SMTP; 21 Dec 2012 15:25:12 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+RzIoqxx+RINSnY/RR1s0mrIM80vakWfwwlAbfyH 5bE5+NOnK+dtYG Message-ID: <50D47143.40702@gmx.at> Date: Fri, 21 Dec 2012 15:25:07 +0100 From: martin rudalics MIME-Version: 1.0 References: <87a9t7bl8o.fsf@gmail.com> In-Reply-To: <87a9t7bl8o.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) > Here is what I found during my investigation. It happens with > (select-window w) in the `comint-postoutput-scroll-to-bottom' > (reproduced below). I was monitoring the value of the (point) just > before and after it, and it looks like this: > > before (point):9943 > after (point):8619 > > So the point is clearly moved in select-window. Moreover the (point) > equals (window-end) just before select-window is called, so it is > visible. Consequently, the following (comint-adjust-point selected) is= > completely screwed because it relies on point *not* being moved! > > Here is a relevant piece of `comint-postoutput-scroll-to-bottom' > > > =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80 #2124 =E2=94=80 /home/vitoshka/TVC/emacs/lisp/comint.el =E2=94=80= =E2=94=80 > =E2=94=82 (dolist (w (get-buffer-window-list current nil t)) > =E2=94=82 (select-window w) > =E2=94=82 (unwind-protect > =E2=94=82 (progn > =E2=94=82 (comint-adjust-point selected) > =E2=94=82 ;; Optionally scroll to the bottom of the window. > =E2=94=82 (and comint-scroll-show-maximum-output > =E2=94=82 (eobp) > =E2=94=82 (recenter (- -1 scroll-margin)))) > =E2=94=82 (select-window selected)))))) > =E2=94=82 (set-buffer current)))) > =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80 #2134 =E2=94=80 > > > The variable `comint-scroll-show-maximum-output' is the default t, thi= s > is why comint runs `comint-postoutput-scroll-to-bottom' in its > `comint-output-filter-functions'. > > I can propose a patch for commit to reset the point, but it looks like= > there is something much more fundamental going on in here. select_window (in window.c) has the following comment /* Go to the point recorded in the window. This is important when the buffer is in more than one window. It also matters when redisplay_window has altered point after scrolling, because it makes the change only in the window. */ Is it this behavior that bothers you? IIUC what you want in `comint-postoutput-scroll-to-bottom' is to `set-window-point' of the respective window. If you really want to move `point' in a buffer _and_ show the effect in a window, do it with that window selected. martin From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: Vitalie Spinu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2012 14:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: 13248@debbugs.gnu.org Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.135610075623583 (code B ref 13248); Fri, 21 Dec 2012 14:40:01 +0000 Received: (at 13248) by debbugs.gnu.org; 21 Dec 2012 14:39:16 +0000 Received: from localhost ([127.0.0.1]:53688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm3kp-00068J-4x for submit@debbugs.gnu.org; Fri, 21 Dec 2012 09:39:16 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:35649) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm3kn-00068B-Ot for 13248@debbugs.gnu.org; Fri, 21 Dec 2012 09:39:14 -0500 Received: by mail-ee0-f44.google.com with SMTP id b47so2412448eek.17 for <13248@debbugs.gnu.org>; Fri, 21 Dec 2012 06:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=tGkqCSmBccSpBjr5vmDwj63g3q7TfhtMJKHBY45YfIQ=; b=pB8xBwtmVG1g+AUUCo2S9qaq55/o80c0BTEomXgL3lu0xQGRKaNsGhhQu2FA7KnqMa BraGwiPIfchWO6PZgdmPg7EvOyh4JCa/2LvENz6Z1K0HHoQQndrGFPsolw5nUTY0HX/t d7TMoVeL8P+RyJK/qlQlr/TIetPHttyf4m9FL0lwwtd1cHFj+TT4sA4ZCTE7G5yvMvNN 6WWIy2aUIpzBykAttFLq+SCJ4qCStssvqMKyOo3OKDhPewjuLAiCTaR0q+zzuFFiB32U xwVfxeiTW1d7G/PjpfGNYnoA83koXEbXFnfldAYJssBi65xd+wW8ZywLoNV9ES1+LCJk uVZw== X-Received: by 10.14.202.3 with SMTP id c3mr32652596eeo.4.1356100738217; Fri, 21 Dec 2012 06:38:58 -0800 (PST) Received: from localhost (i108036.upc-i.chello.nl. [62.195.108.36]) by mx.google.com with ESMTPS id e2sm21989835eeo.8.2012.12.21.06.38.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 06:38:57 -0800 (PST) From: Vitalie Spinu Organization: EUR References: <87a9t7bl8o.fsf@gmail.com> <50D47143.40702@gmx.at> Date: Fri, 21 Dec 2012 15:38:55 +0100 In-Reply-To: <50D47143.40702@gmx.at> (martin rudalics's message of "Fri, 21 Dec 2012 15:25:07 +0100") Message-ID: <87623vbhc0.fsf@gmail.com> User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) >> martin rudalics >> on Fri, 21 Dec 2012 15:25:07 +0100 wrote: >> Here is what I found during my investigation. It happens with >> (select-window w) in the `comint-postoutput-scroll-to-bottom' >> (reproduced below). I was monitoring the value of the (point) just >> before and after it, and it looks like this: >> >> before (point):9943 >> after (point):8619 >> >> So the point is clearly moved in select-window. Moreover the (point) >> equals (window-end) just before select-window is called, so it is >> visible. Consequently, the following (comint-adjust-point selected) is >> completely screwed because it relies on point *not* being moved! >> > select_window (in window.c) has the following comment > /* Go to the point recorded in the window. > This is important when the buffer is in more > than one window. It also matters when > redisplay_window has altered point after scrolling, > because it makes the change only in the window. */ > Is it this behavior that bothers you? Yes, indeed this is precisely what happening. Thanks, it clarifies the problem. > IIUC what you want in `comint-postoutput-scroll-to-bottom' is to > `set-window-point' of the respective window. If you really want to move > `point' in a buffer _and_ show the effect in a window, do it with that > window selected. And this is what comint-postoutput-scroll-to-bottom fails to do. Vitalie From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: Vitalie Spinu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2012 14:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: 13248@debbugs.gnu.org Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.135610130124416 (code B ref 13248); Fri, 21 Dec 2012 14:49:02 +0000 Received: (at 13248) by debbugs.gnu.org; 21 Dec 2012 14:48:21 +0000 Received: from localhost ([127.0.0.1]:53696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm3tc-0006Ll-MR for submit@debbugs.gnu.org; Fri, 21 Dec 2012 09:48:20 -0500 Received: from mail-ea0-f179.google.com ([209.85.215.179]:49693) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm3ta-0006Lc-6v for 13248@debbugs.gnu.org; Fri, 21 Dec 2012 09:48:19 -0500 Received: by mail-ea0-f179.google.com with SMTP id i12so1890166eaa.10 for <13248@debbugs.gnu.org>; Fri, 21 Dec 2012 06:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=IhWuI+yu2Z7ocioVd/4rq2Myq80Rvp51p/Ump3A8tS0=; b=KbfLxWj0Mz3OlXHZ+M8JDdg6z7xBV9QZtqIXvN0VqNFbHMM7W9bxU295bSF2D/c9c0 r8i6YjLVhrlyA2kRFoV+gcZEqEVHmRk4weM6v0BM5Bzt4u1V2sSd6YMeCtMoXhFCLP3n LFwdiFpu42F7zmeOcw00/frUBkgNQRQkqdWrLk01t6CBVCffcb3lACAwEZ32y5fk1gvO RC2Q3Ad+X4I+T0Hg7AgtEM2F8wgmsetJnFhM0EfVh5C5BYHEmeCieht7Z1LcjYDyTV30 1NK+5Q+QIgaE4Fi41qHdDogCWgITY9NrdXbuAqy6mHXsCoOsKDUafA63Fg7J+chl5Aon AuKQ== X-Received: by 10.14.178.196 with SMTP id f44mr32600454eem.14.1356101283707; Fri, 21 Dec 2012 06:48:03 -0800 (PST) Received: from localhost (i108036.upc-i.chello.nl. [62.195.108.36]) by mx.google.com with ESMTPS id w3sm22080915eel.17.2012.12.21.06.48.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 06:48:02 -0800 (PST) From: Vitalie Spinu Organization: EUR References: <87a9t7bl8o.fsf@gmail.com> <50D47143.40702@gmx.at> Date: Fri, 21 Dec 2012 15:48:00 +0100 In-Reply-To: <50D47143.40702@gmx.at> (martin rudalics's message of "Fri, 21 Dec 2012 15:25:07 +0100") Message-ID: <871uejbgwv.fsf@gmail.com> User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) >> martin rudalics >> on Fri, 21 Dec 2012 15:25:07 +0100 wrote: [...] > select_window (in window.c) has the following comment > /* Go to the point recorded in the window. > This is important when the buffer is in more > than one window. It also matters when > redisplay_window has altered point after scrolling, > because it makes the change only in the window. */ Is "recorded point" the same as window-point? Why is this not in the docstring of select-window? Vitalie From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Dec 2012 10:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vitalie Spinu Cc: 13248@debbugs.gnu.org Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.135617157313853 (code B ref 13248); Sat, 22 Dec 2012 10:20:01 +0000 Received: (at 13248) by debbugs.gnu.org; 22 Dec 2012 10:19:33 +0000 Received: from localhost ([127.0.0.1]:55040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmMAq-0003bC-Ju for submit@debbugs.gnu.org; Sat, 22 Dec 2012 05:19:33 -0500 Received: from mout.gmx.net ([212.227.17.20]:64890) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmMAn-0003b4-S5 for 13248@debbugs.gnu.org; Sat, 22 Dec 2012 05:19:18 -0500 Received: from mailout-de.gmx.net ([10.1.76.41]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0Ld2ys-1TLr7a2eno-00iDUe for <13248@debbugs.gnu.org>; Sat, 22 Dec 2012 11:18:58 +0100 Received: (qmail invoked by alias); 22 Dec 2012 10:18:58 -0000 Received: from 62-47-46-229.adsl.highway.telekom.at (EHLO [62.47.46.229]) [62.47.46.229] by mail.gmx.net (mp041) with SMTP; 22 Dec 2012 11:18:58 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19xKLUJmUlxjONDggigfpgkSvjPvvj8Xj6JpcoHlv 3SyU+laG9vTpKI Message-ID: <50D5890C.3020403@gmx.at> Date: Sat, 22 Dec 2012 11:18:52 +0100 From: martin rudalics MIME-Version: 1.0 References: <87a9t7bl8o.fsf@gmail.com> <50D47143.40702@gmx.at> <871uejbgwv.fsf@gmail.com> In-Reply-To: <871uejbgwv.fsf@gmail.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > Is "recorded point" the same as window-point? Why is this not in the > docstring of select-window? I have updated both the doc-string and the documentation of `select-window' in revision 111058 of the release-branch. Kindly have a look. Thank you, martin From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: [PATCH] bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: Vitalie Spinu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Dec 2012 00:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: 13248@debbugs.gnu.org Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.13563947785369 (code B ref 13248); Tue, 25 Dec 2012 00:20:02 +0000 Received: (at 13248) by debbugs.gnu.org; 25 Dec 2012 00:19:38 +0000 Received: from localhost ([127.0.0.1]:58527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnIF7-0001OX-Rf for submit@debbugs.gnu.org; Mon, 24 Dec 2012 19:19:38 -0500 Received: from mail-we0-f176.google.com ([74.125.82.176]:55986) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnIF3-0001ON-GF for 13248@debbugs.gnu.org; Mon, 24 Dec 2012 19:19:35 -0500 Received: by mail-we0-f176.google.com with SMTP id r5so3360322wey.21 for <13248@debbugs.gnu.org>; Mon, 24 Dec 2012 16:18:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=I1+s6FCVas49lKYwh+jLiMYzfx3HDaFM66g8fBGbOJU=; b=gjmeaHDwvDVXwhhCoLsjWwoMS22ohx3mgOSng840LDAX9jifJbXBDTXu+49x4XCVIC fyyeMe8zWgcPxyPKuhNTiY/OnzPSYWJkOZhLabIwOY4ywLAR8bfRuK2pepkT++PtQIrz P4YwAAbcEVnRYOkEozl4CAn2BA8PaxzwSfznKpMmmoeiLj5m2r7EUP9KE53ObS8omWxa tObnZe/pc/LJEIMM7/gE9SOgCG8r0pI+bYNtq4ge7ChbVujsFXM7oBqGAN81dzEoEBCO RoTOvafnMzqyQepwzVFre0kgZzpAHufDMcJrPcJk1rir6HeyDUaFk7IORgaWP3v9N+V8 q1XQ== X-Received: by 10.180.72.146 with SMTP id d18mr28872539wiv.33.1356394739496; Mon, 24 Dec 2012 16:18:59 -0800 (PST) Received: from localhost (i108036.upc-i.chello.nl. [62.195.108.36]) by mx.google.com with ESMTPS id bd7sm35876165wib.8.2012.12.24.16.18.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 16:18:58 -0800 (PST) From: Vitalie Spinu Organization: EUR References: <87a9t7bl8o.fsf@gmail.com> <50D47143.40702@gmx.at> Date: Tue, 25 Dec 2012 01:18:56 +0100 In-Reply-To: <50D47143.40702@gmx.at> (martin rudalics's message of "Fri, 21 Dec 2012 15:25:07 +0100") Message-ID: <87pq1z7zm7.fsf_-_@gmail.com> User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain >> martin rudalics >> on Fri, 21 Dec 2012 15:25:07 +0100 wrote: [...] >> So the point is clearly moved in select-window. Moreover the (point) >> equals (window-end) just before select-window is called, so it is >> visible. Consequently, the following (comint-adjust-point selected) is >> completely screwed because it relies on point *not* being moved! [...] >> >> The variable `comint-scroll-show-maximum-output' is the default t, this >> is why comint runs `comint-postoutput-scroll-to-bottom' in its >> `comint-output-filter-functions'. >> >> I can propose a patch for commit to reset the point, [...] Here is a patch of the comint-postoutput-scroll-to-bottom to circumvent resetting the point on select-window. Thanks, Vitalie --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=comint-fix.patch diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6d5e77d..dc5a4be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-24 Vitalie Spinu + + * comint.el (comint-postoutput-scroll-to-bottom): Don't reset + buffer point on select-window (Bug#13248). + 2012-12-24 Dmitry Gutov * progmodes/ruby-mode.el: Bump the version to 1.2 (Bug#13200). diff --git a/lisp/comint.el b/lisp/comint.el index cff9afe..fa3764d 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2120,12 +2120,14 @@ This function should be in the list `comint-output-filter-functions'." ((bound-and-true-p follow-mode) (follow-comint-scroll-to-bottom)) (t - (let ((selected (selected-window))) + (let ((selected (selected-window)) + ;; select-window resets point; thus, save + (old-point (point))) (dolist (w (get-buffer-window-list current nil t)) (select-window w) (unwind-protect (progn - (comint-adjust-point selected) + (comint-adjust-point selected old-point) ;; Optionally scroll to the bottom of the window. (and comint-scroll-show-maximum-output (eobp) @@ -2133,9 +2135,12 @@ This function should be in the list `comint-output-filter-functions'." (select-window selected)))))) (set-buffer current)))) -(defun comint-adjust-point (selected) +(defun comint-adjust-point (selected &optional saved-point) "Move point in the selected window based on Comint settings. -SELECTED is the window that was originally selected." +SELECTED is the window that was originally selected. + +If SAVED-POINT is given, use it as reference instead of the +current point." (let ((process (get-buffer-process (current-buffer)))) (and (< (point) (process-mark process)) (or (memq comint-move-point-for-output '(t all)) @@ -2144,7 +2149,8 @@ SELECTED is the window that was originally selected." (if (eq (selected-window) selected) 'this 'others)) ;; If point was at the end, keep it at end. (and (marker-position comint-last-output-start) - (>= (point) comint-last-output-start))) + (>= (or saved-point (point)) + comint-last-output-start))) (goto-char (process-mark process))))) (defun comint-truncate-buffer (&optional _string) --=-=-=-- From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: [PATCH] bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Dec 2012 18:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vitalie Spinu Cc: 13248@debbugs.gnu.org Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.135645902918923 (code B ref 13248); Tue, 25 Dec 2012 18:11:02 +0000 Received: (at 13248) by debbugs.gnu.org; 25 Dec 2012 18:10:29 +0000 Received: from localhost ([127.0.0.1]:59551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnYxR-0004vA-19 for submit@debbugs.gnu.org; Tue, 25 Dec 2012 13:10:29 -0500 Received: from mout.gmx.net ([212.227.15.18]:59190) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnYxO-0004v2-A7 for 13248@debbugs.gnu.org; Tue, 25 Dec 2012 13:10:26 -0500 Received: from mailout-de.gmx.net ([10.1.76.36]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0MM1JK-1Ti4lk21Xg-007hQr for <13248@debbugs.gnu.org>; Tue, 25 Dec 2012 19:09:48 +0100 Received: (qmail invoked by alias); 25 Dec 2012 18:09:48 -0000 Received: from 62-47-45-198.adsl.highway.telekom.at (EHLO [62.47.45.198]) [62.47.45.198] by mail.gmx.net (mp036) with SMTP; 25 Dec 2012 19:09:48 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+VBDJzu0WVDHFRRUYNAg42iyoYhPCJ39t7o9sueE rEtW+x8PFbc7aq Message-ID: <50D9EBE2.5050609@gmx.at> Date: Tue, 25 Dec 2012 19:09:38 +0100 From: martin rudalics MIME-Version: 1.0 References: <87a9t7bl8o.fsf@gmail.com> <50D47143.40702@gmx.at> <87pq1z7zm7.fsf_-_@gmail.com> In-Reply-To: <87pq1z7zm7.fsf_-_@gmail.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) > Here is a patch of the comint-postoutput-scroll-to-bottom to circumvent > resetting the point on select-window. I'm too silly to understand what this is supposed to do. But the doc-string of `comint-adjust-point' says "Move point in the selected window based on Comint settings." which, together with the fact that you call this in a loop over all windows showing some buffer, indicates to use `set-window-point' rather than `goto-char'. So why can't you write something like (dolist (w (get-buffer-window-list current nil t)) (when (and (< (window-point) (process-mark process)) ...) (set-window-point w ...))) here? martin From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: [PATCH] bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: Vitalie Spinu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Dec 2012 22:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: 13248@debbugs.gnu.org Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.135647458217532 (code B ref 13248); Tue, 25 Dec 2012 22:30:02 +0000 Received: (at 13248) by debbugs.gnu.org; 25 Dec 2012 22:29:42 +0000 Received: from localhost ([127.0.0.1]:59704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tnd0H-0004Yj-FN for submit@debbugs.gnu.org; Tue, 25 Dec 2012 17:29:41 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:57156) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tnd0E-0004Yb-TB for 13248@debbugs.gnu.org; Tue, 25 Dec 2012 17:29:40 -0500 Received: by mail-wi0-f172.google.com with SMTP id o1so6849496wic.5 for <13248@debbugs.gnu.org>; Tue, 25 Dec 2012 14:29:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=bBIhkgdzG/58Q4A0fFrVqjK5+dpVJdGV1nqCYCke8cM=; b=pIJy8XPv4bo5jcMcfzzfY7KiNcFd0JDz/jHI7n7G4mr/IgcnadHpfmgQTVjcowWL8t 4Qvv0zRpY/+qJ0vQe5EreOTYFJ+4iGTvinNAMysqqdMIk17d753suaaewNLch7zTrJwP Hroz65+84js2o82wzFB400+shrVTHpezE8O6tOps1DFRnybeVpPjbfIWfkONFfeWfd37 6OEmFBiC4V7p0Coy6pXPw45uz6slwKyJBm/iSNLKWEZUMlneIlgLLoLtTKgrJ3x6qT/z ufskdmy0LSa+g5RGbJvn3RrF/zKL5Z2Ct/CKZV6Z7eSMCT8oOHvC77NEzgXb16P0npgs ZgeA== X-Received: by 10.194.93.40 with SMTP id cr8mr41448180wjb.16.1356474540022; Tue, 25 Dec 2012 14:29:00 -0800 (PST) Received: from localhost (i108036.upc-i.chello.nl. [62.195.108.36]) by mx.google.com with ESMTPS id dw4sm40919180wib.1.2012.12.25.14.28.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Dec 2012 14:28:58 -0800 (PST) From: Vitalie Spinu Organization: EUR References: <87a9t7bl8o.fsf@gmail.com> <50D47143.40702@gmx.at> <87pq1z7zm7.fsf_-_@gmail.com> <50D9EBE2.5050609@gmx.at> Date: Tue, 25 Dec 2012 23:28:56 +0100 In-Reply-To: <50D9EBE2.5050609@gmx.at> (martin rudalics's message of "Tue, 25 Dec 2012 19:09:38 +0100") Message-ID: <87fw2t22c7.fsf@gmail.com> User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> martin rudalics >> on Tue, 25 Dec 2012 19:09:38 +0100 wrote: >> Here is a patch of the comint-postoutput-scroll-to-bottom to circumvent >> resetting the point on select-window. > I'm too silly to understand what this is supposed to do. But the > doc-string of `comint-adjust-point' says "Move point in the selected > window based on Comint settings." which, together with the fact that you > call this in a loop over all windows showing some buffer, indicates to > use `set-window-point' rather than `goto-char'.=20=20 It is indeed tricky, I also was bothered by goto-char intricacy, but decided not to intrude too much. > So why can't you write something like > (dolist (w (get-buffer-window-list current nil t)) > (when (and (< (window-point) (process-mark process)) > ...) > (set-window-point w ...))) > here? Because of the recentering in this piece:=20 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2132 =E2=94=80 /home/vitoshka/TVC/emacs/lisp/comint.el =E2=94=80=E2= =94=80 =E2=94=82 (and comint-scroll-show-maximum-output =E2=94=82 (eobp) =E2=94=82 (recenter (- -1 scroll-margin)))) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2134 =E2=94=80 And this code: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2140 =E2=94=80 /home/vitoshka/TVC/emacs/lisp/comint.el =E2=94=80=E2= =94=80 =E2=94=82 (and (< (point) (process-mark process)) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2140 =E2=94=80 which implicitly relies on previous reseting of point by select-window. And this: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2144 =E2=94=80 /home/vitoshka/TVC/emacs/lisp/comint.el =E2=94=80=E2= =94=80 =E2=94=82 (if (eq (selected-window) selected) 'this 'others)) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2144 =E2=94=80 which compares current window with the original one.=20 Because of this "implicitness" this piece of code is very tricky. I have cleaned it up. Note that the internal function comint-adjust-point is no longer used anywhere in emacs. I left it in the code for backward compatibility. I think it is quite safe to remove it completely. It is very unlikely that it has been used outside of this specific context. Vitalie --=-=-= Content-Type: text/x-diff Content-Disposition: inline commit 1099eb540d2246836007a83d249db4bf2565c753 (refs/heads/comint-fix) Author: Vitalie Spinu Date: Tue Dec 25 00:22:55 2012 +0100 Cleanup comint-postoutput-scroll-to-bottom (Bug#13248) Modified lisp/ChangeLog diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6d5e77d..cf782e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-24 Vitalie Spinu + + * comint.el (comint-postoutput-scroll-to-bottom): Cleanup + comint-postoutput-scroll-to-bottom (Bug#13248). + 2012-12-24 Dmitry Gutov * progmodes/ruby-mode.el: Bump the version to 1.2 (Bug#13200). Modified lisp/comint.el diff --git a/lisp/comint.el b/lisp/comint.el index cff9afe..7530f24 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2120,19 +2120,31 @@ This function should be in the list `comint-output-filter-functions'." ((bound-and-true-p follow-mode) (follow-comint-scroll-to-bottom)) (t - (let ((selected (selected-window))) - (dolist (w (get-buffer-window-list current nil t)) - (select-window w) - (unwind-protect - (progn - (comint-adjust-point selected) - ;; Optionally scroll to the bottom of the window. - (and comint-scroll-show-maximum-output - (eobp) - (recenter (- -1 scroll-margin)))) - (select-window selected)))))) + (dolist (w (get-buffer-window-list current nil t)) + (comint-adjust-window-point w process) + ;; Optionally scroll to the bottom of the window. + (and comint-scroll-show-maximum-output + (eq (window-point w) (point-max)) + (with-selected-window w + (recenter (- -1 scroll-margin))))))) (set-buffer current)))) + +(defun comint-adjust-window-point (window process) + "Move point in WINDOW based on Comint settings. +For point adjustment use the process-mark of PROCESS." + (and (< (window-point window) (process-mark process)) + (or (memq comint-move-point-for-output '(t all)) + ;; Maybe user wants point to jump to end. + (eq comint-move-point-for-output + (if (eq (selected-window) window) 'this 'others)) + ;; If point was at the end, keep it at end. + (and (marker-position comint-last-output-start) + (>= (window-point window) comint-last-output-start))) + (set-window-point window (process-mark process)))) + + +;; this function is nowhere used (defun comint-adjust-point (selected) "Move point in the selected window based on Comint settings. SELECTED is the window that was originally selected." --=-=-=-- From unknown Sun Jun 22 11:48:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13248: [PATCH] bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2012 07:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vitalie Spinu Cc: 13248@debbugs.gnu.org Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.135659386532431 (code B ref 13248); Thu, 27 Dec 2012 07:38:02 +0000 Received: (at 13248) by debbugs.gnu.org; 27 Dec 2012 07:37:45 +0000 Received: from localhost ([127.0.0.1]:33063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1To82C-0008R1-68 for submit@debbugs.gnu.org; Thu, 27 Dec 2012 02:37:44 -0500 Received: from mout.gmx.net ([212.227.17.20]:50350) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1To828-0008Qs-SW for 13248@debbugs.gnu.org; Thu, 27 Dec 2012 02:37:42 -0500 Received: from mailout-de.gmx.net ([10.1.76.17]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MQbf1-1Tdqe30nRV-00U0JL for <13248@debbugs.gnu.org>; Thu, 27 Dec 2012 08:36:54 +0100 Received: (qmail invoked by alias); 27 Dec 2012 07:36:53 -0000 Received: from 62-47-60-126.adsl.highway.telekom.at (EHLO [62.47.60.126]) [62.47.60.126] by mail.gmx.net (mp017) with SMTP; 27 Dec 2012 08:36:53 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19SdRwEOL9SOddvQl/u12Yn5xgr+qNWY2oY13mtAK F+6pgmODkjso0n Message-ID: <50DBFA90.5030103@gmx.at> Date: Thu, 27 Dec 2012 08:36:48 +0100 From: martin rudalics MIME-Version: 1.0 References: <87a9t7bl8o.fsf@gmail.com> <50D47143.40702@gmx.at> <87pq1z7zm7.fsf_-_@gmail.com> <50D9EBE2.5050609@gmx.at> <87fw2t22c7.fsf@gmail.com> In-Reply-To: <87fw2t22c7.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > Because of this "implicitness" this piece of code is very tricky. I have > cleaned it up. Note that the internal function comint-adjust-point is no > longer used anywhere in emacs. I left it in the code for backward > compatibility. I think it is quite safe to remove it completely. It is > very unlikely that it has been used outside of this specific context. Installed as revision 111344 on trunk. Thank you, martin From unknown Sun Jun 22 11:48:07 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Vitalie Spinu Subject: bug#13248: closed (Re: bug#13248: [PATCH] bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom)) Message-ID: References: <50E3E9BD.7000201@gmx.at> <87a9t7bl8o.fsf@gmail.com> X-Gnu-PR-Message: they-closed 13248 X-Gnu-PR-Package: emacs Reply-To: 13248@debbugs.gnu.org Date: Wed, 02 Jan 2013 08:05:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1357113902-10838-1" This is a multi-part message in MIME format... ------------=_1357113902-10838-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-= bottom) which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13248@debbugs.gnu.org. --=20 13248: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13248 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1357113902-10838-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13248-done) by debbugs.gnu.org; 2 Jan 2013 08:04:36 +0000 Received: from localhost ([127.0.0.1]:39589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqJJT-0002np-6H for submit@debbugs.gnu.org; Wed, 02 Jan 2013 03:04:36 -0500 Received: from mout.gmx.net ([212.227.17.21]:62334) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqJJP-0002nh-SO for 13248-done@debbugs.gnu.org; Wed, 02 Jan 2013 03:04:32 -0500 Received: from mailout-de.gmx.net ([10.1.76.10]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0Lir0l-1TJzfu0KDN-00cxFA for <13248-done@debbugs.gnu.org>; Wed, 02 Jan 2013 09:03:11 +0100 Received: (qmail invoked by alias); 02 Jan 2013 08:03:10 -0000 Received: from 62-47-60-197.adsl.highway.telekom.at (EHLO [62.47.60.197]) [62.47.60.197] by mail.gmx.net (mp010) with SMTP; 02 Jan 2013 09:03:10 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+VvWgTNfOVWTvL74yJIqkPdu5AGPOM2lyb2j35+/ YgmbRFAGJ0Xy3C Message-ID: <50E3E9BD.7000201@gmx.at> Date: Wed, 02 Jan 2013 09:03:09 +0100 From: martin rudalics MIME-Version: 1.0 To: Vitalie Spinu Subject: Re: bug#13248: [PATCH] bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) References: <87a9t7bl8o.fsf@gmail.com> <50D47143.40702@gmx.at> <87pq1z7zm7.fsf_-_@gmail.com> <50D9EBE2.5050609@gmx.at> <87fw2t22c7.fsf@gmail.com> <50DBFA90.5030103@gmx.at> In-Reply-To: <50DBFA90.5030103@gmx.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13248-done Cc: 13248-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > Installed as revision 111344 on trunk. Bug closed. Thanks, martin ------------=_1357113902-10838-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Dec 2012 13:15:21 +0000 Received: from localhost ([127.0.0.1]:53612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm2Rb-0004BT-Pk for submit@debbugs.gnu.org; Fri, 21 Dec 2012 08:15:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38570) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm2RX-0004BI-JM for submit@debbugs.gnu.org; Fri, 21 Dec 2012 08:15:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm2RA-0001uP-Jm for submit@debbugs.gnu.org; Fri, 21 Dec 2012 08:15:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm2RA-0001uL-Gc for submit@debbugs.gnu.org; Fri, 21 Dec 2012 08:14:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm2R2-0007Ug-26 for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 08:14:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm2Qu-0001s8-CE for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 08:14:43 -0500 Received: from mail-ea0-f178.google.com ([209.85.215.178]:39719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm2Qu-0001rz-2o for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 08:14:36 -0500 Received: by mail-ea0-f178.google.com with SMTP id k11so1919578eaa.23 for ; Fri, 21 Dec 2012 05:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=s40aVUQyranEECoS+skoJ2Q+FjizuarsVcHY8jq1FuU=; b=cyoD8I9Vrhhtkt8VtPkgFgMCWF37y9bG6B5wHiSYjibIp2L7yViz3+komkcAvqnFJc NVjvX/tAlydVsN7GGOKsmMHKEumStCAtN+HAQpNiXlLI+qfveWFKOpQRH1LiNba45rCe Des49n+aMyawH91zXt7nf+yZUMpMGizveJjX4ybiz9IbcQMa0pFPS/+V5yeZsqBWzvsx p6/XxqkE6Zi2AzrI2ZKyKgSZ4nz+EFyE3y6HOEgiO+DfVuouvBteUhB4IEja2Ev0IguH QwDdHB6q5KgKF2rlssN9RJttq5Ir+xo1joNoyUEPZMTn5CAhUJwAHjEJP//6kfkYNaUm DjOg== X-Received: by 10.14.204.198 with SMTP id h46mr32213089eeo.1.1356095674638; Fri, 21 Dec 2012 05:14:34 -0800 (PST) Received: from localhost (i108036.upc-i.chello.nl. [62.195.108.36]) by mx.google.com with ESMTPS id l3sm21594481eem.14.2012.12.21.05.14.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 05:14:33 -0800 (PST) From: Vitalie Spinu To: bug-gnu-emacs@gnu.org Subject: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Date: Fri, 21 Dec 2012 14:14:31 +0100 Message-ID: <87a9t7bl8o.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hi,=20 I am struggling with a-not-so-easily reproducible bug that occurs only with ESS when sending input from a buffer to a sub-process.=20 Whenever I send a string to a subprocess, the point in process buffer jumps to the middle of the buffer, instead of staying at the process-mark at eob, where it supposed to be. And this is not ESS problem. Here is what I found during my investigation. It happens with (select-window w) in the `comint-postoutput-scroll-to-bottom' (reproduced below). I was monitoring the value of the (point) just before and after it, and it looks like this: before (point):9943 after (point):8619 So the point is clearly moved in select-window. Moreover the (point) equals (window-end) just before select-window is called, so it is visible. Consequently, the following (comint-adjust-point selected) is completely screwed because it relies on point *not* being moved!=20=20 Here is a relevant piece of `comint-postoutput-scroll-to-bottom' =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2124 =E2=94=80 /home/vitoshka/TVC/emacs/lisp/comint.el =E2=94=80=E2= =94=80 =E2=94=82 (dolist (w (get-buffer-window-list current nil t)) =E2=94=82 (select-window w) =E2=94=82 (unwind-protect =E2=94=82 (progn =E2=94=82 (comint-adjust-point selected) =E2=94=82 ;; Optionally scroll to the bottom of the window. =E2=94=82 (and comint-scroll-show-maximum-output =E2=94=82 (eobp) =E2=94=82 (recenter (- -1 scroll-margin)))) =E2=94=82 (select-window selected)))))) =E2=94=82 (set-buffer current)))) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #2134 =E2=94=80 The variable `comint-scroll-show-maximum-output' is the default t, this is why comint runs `comint-postoutput-scroll-to-bottom' in its `comint-output-filter-functions'. I can propose a patch for commit to reset the point, but it looks like there is something much more fundamental going on in here. Thanks,=20 Vitalie =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: sr-popviewer-mode: t TeX-PDF-mode: t rainbow-delimiters-mode: t global-auto-complete-mode: t auto-complete-mode: t diff-auto-refine-mode: t helm-match-plugin-mode: t shell-dirtrack-mode: t eldoc-mode: t show-paren-mode: t savehist-mode: t display-time-mode: t ido-everywhere: t global-auto-revert-mode: t global-subword-mode: t subword-mode: t tooltip-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 column-number-mode: t line-number-mode: t transient-mark-mode: t hs-minor-mode: t Recent input: C-p C-p C-u C-M-x C-n C-SPC=20 C-n C-n C-c C-r c c c C-o C-o M-> C-o =20 C-M-p C-p C-p C-p=20 C-p C-p C-p C-p C-SPC C-n C-n C-c C-r n n n n n n n=20 n n n n n n n n n n n n n n n n n n n n n n n n n n=20 n n n n n n n n n n n n n n n n n n n n n n n n n n=20 n n n n n n n C-p C-p C-SPC C-n C-n C-c C-r n n n n=20 n n n n n n n n n n n n n n n n n n n n n n n n n n=20 n n n n n n n n n n n n n n n n n n n n n n n n n n=20 n n n n n n n n n n n C-a C-p C-p C-p C-e=20 C-n C-n C-o C-x C-f ~ / t v e m a c =20 c o m i M-o s c r o l M-o=20 s c r o C-SPC o u t C-s M-k M-k M-k M-k M-k=20 M-k M-k C-n C-n C-n C-n C-n C-n C-n C-SPC C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n M-x k i l =20 C-x b C-g M-x e s s - v e r M-x v e r s =20 M-x b u g - r e s e n d=20 C-SPC b u g C-g M-x e m a c s C-SPC b u g Recent messages: Opening TLS connection to `imap.gmail.com'... Opening TLS connection with `gnutls-cli --insecure -p 993 imap.gmail.com'..= .failed Opening TLS connection with `gnutls-cli --insecure -p 993 imap.gmail.com --= protocols ssl3'...failed Opening TLS connection with `openssl s_client -connect imap.gmail.com:993 -= no_ssl2 -ign_eof'...done Opening TLS connection to `imap.gmail.com'...done Auto-saving... Mark set Quit ess-version : 12.09-1 [] GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.13) of 2012-11-15= on vitoshka-home Quit Load-path shadows: /home/vitoshka/Dropbox/ELPA/magit-20121030.2025/.dir-locals hides /home/vit= oshka/Dropbox/ELPA/sunrise-commander-20121117.2055/.dir-locals /home/vitoshka/Dropbox/ELPA/magit-20121030.2025/.dir-locals hides ~/VC/gnus= /.dir-locals ~/VC/gnus/lisp/lpath hides ~/VC/auctex/lpath /home/vitoshka/Dropbox/ELPA/popup-20121020.1203/popup hides ~/VC/popup-el/p= opup ~/VC/org-mode/lisp/org-remember hides /usr/local/share/emacs/24.2.50/lisp/o= rg/org-remember ~/VC/org-mode/lisp/org-protocol hides /usr/local/share/emacs/24.2.50/lisp/o= rg/org-protocol ~/VC/org-mode/lisp/ob-dot hides /usr/local/share/emacs/24.2.50/lisp/org/ob-= dot ~/VC/gnus/lisp/nnweb hides /usr/local/share/emacs/24.2.50/lisp/gnus/nnweb ~/VC/gnus/lisp/yenc hides /usr/local/share/emacs/24.2.50/lisp/gnus/yenc ~/VC/gnus/lisp/gnus-srvr hides /usr/local/share/emacs/24.2.50/lisp/gnus/gnu= s-srvr /home/vitoshka/Dropbox/ELPA/rebox2-20121113.2100/rebox2 hides /home/vitoshk= a/Dropbox/.emacs.d/site-lisp/rebox2/rebox2 Features: (shadow emacsbug edebug essddr helm-elisp helm-eval url-cache nnfolder bbdb-message sendmail flymake qp shr-color color shr url-http url-auth url-gw org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-info org-gnus org-docview org-bibtex bibtex org-bbdb wdired reftex-auc igrep tex-info texinfo two-column iso-transl vc-dispatcher vc-svn helm-mode url-handlers smiley gnus-cite flow-fill mm-archive mail-extr gnus-bcklg gnus-async gnus-ml gnus-topic utf-7 nndraft nnmh nnimap parse-time utf7 gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-cache bbdb-gnus gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig bbdb-mua bbdb-com netrc network-stream starttls tls gnus-notify gnus-demon nntp bbdb timezone supercite regi nnir gnus-sum gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus-load gnus gnus-ems gnus-compat nnheader mail-utils sunrise-x-popviewer sunrise-x-checkpoints bookmark sunrise-x-modeline sunrise-x-loop sunrise-x-tree sunrise-commander term ehelp electric hl-line find-dired esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-util esh-module esh-mode disp-table enriched desktop debug view magithub crm json magit-bisect magit-key-mode magit sort smex dabbrev skeleton helm-imenu misearch multi-isearch texmathp vc-git preview prv-emacs tex-buf reftex-dcr zotelo flyspell ispell font-latex latex tex-style tex dbus latexenc mule-util help-mode rainbow-delimiters helm-misc helm-files image-dired dired-x dired-aux helm-tags helm-bookmark helm-adaptative helm-info helm-net xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap helm-plugin helm-locate helm-help helm-external helm-buffers helm-grep helm-regexp grep helm-elscreen helm-utils ffap url-parse url-vars ob-latex ob-R appt diary-lib diary-loaddefs org-clock org-exp ob-exp org-agenda org ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs find-func cal-menu calendar cal-loaddefs iimage pos-tip ac-octave octave-inf octave-mod ac-math auto-complete-config auto-complete popup saveplace doc-view jka-compr image-mode reftex reftex-vars reftex-cite preview-latex tex-site auto-loads info-look psvn log-edit pcvs-util add-log diff-mode elp ediff-merg ediff-diff ediff-wind ediff-mult ediff-help ediff-init ediff-util dired xquery-mode generic rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok smart-operator rx rebox2 warnings slime-media slime-presentations slime-scratch slime-asdf slime-repl slime derived pp hyperspec menu-bar+ helm-descbinds helm-match-plugin helm helm-config mic-paren eldoc-eval adaptive-wrap-autoloads bbdb-autoloads bm-autoloads bookmark+-autoloads edit-server-autoloads eldoc-eval-autoloads esk-autoloads flex-isearch-autoloads fuzzy-autoloads fuzzy-match-autoloads git-blame-autoloads helm-autoloads helm-descbinds-autoloads htmlize-autoloads ido-load-library-autoloads ido-ubiquitous-autoloads ido-yes-or-no-autoloads igrep-autoloads jabber-autoloads js2-mode-autoloads lacarte-autoloads magit-gh-pulls-autoloads gh-autoloads logito-autoloads magit-push-remote-autoloads magithub-autoloads magit-autoloads markdown-mode+-autoloads markdown-mode-autoloads memory-usage-autoloads mic-paren-autoloads minimap-autoloads oauth2-autoloads persistent-soft-autoloads list-utils-autoloads pcache-autoloads finder-inf popup-autoloads rainbow-delimiters-autoloads rainbow-mode-autoloads rebox2-autoloads smex-autoloads stem-autoloads sunrise-commander-autoloads synonyms-autoloads w3m-autoloads zotelo-autoloads package tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cconv assoc gnus-util mm-util mail-prsvr password-cache tramp-loaddefs format-spec ess-toolbar ess-mouse mouseme thingatpt browse-url ess-menu ess-swv ess-noweb ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d ess-sas-l ess-sas-a shell pcomplete ess-arc-d ess-vst-d ess-xls-d ess-lsp-l ess-sta-d ess-sta-l cc-vars cc-defs make-regexp ess-sp6-d ess-sp5-d ess-sp3-d ess-julia ess-r-d ess-tracebug compile ess-roxy easy-mmode hideshow ess-help info reporter ess-developer ess-r-args eldoc ess-s-l speedbar sb-image ezimage dframe ess ess-inf comint ansi-color ring ess-mode ess-noweb-mode edmacro kmacro ess-utils ess-custom ess-compat ess-site ibuf-ext ibuffer recentf tree-widget wid-edit easymenu uniquify paren savehist time cus-start cus-load solarized-dark-theme solarized imenu-anywhere cl-macs gv imenu iflipb ido sh-script smie executable advice help-fns advice-preload autorevert subword server cl cl-lib time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) ------------=_1357113902-10838-1--