From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jinwoo Lee Newsgroups: gmane.emacs.bugs Subject: bug#44087: 27.1; Switching to term-char-mode appends newline Date: Mon, 19 Oct 2020 16:45:48 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000060563005b20eb7eb" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17583"; mail-complaints-to="usenet@ciao.gmane.io" To: 44087@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 20 01:50:12 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 1kUeup-0004VA-Sw for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Oct 2020 01:50:11 +0200 Original-Received: from localhost ([::1]:58550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUeuo-0000AG-Qo for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 19:50:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUeug-000082-F5 for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 19:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUeug-0004WS-42 for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 19:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUeug-0006p0-2G for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 19:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jinwoo Lee Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Oct 2020 23:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44087 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.160315137826183 (code B ref -1); Mon, 19 Oct 2020 23:50:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Oct 2020 23:49:38 +0000 Original-Received: from localhost ([127.0.0.1]:42748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUeuH-0006oE-Qa for submit@debbugs.gnu.org; Mon, 19 Oct 2020 19:49:38 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUequ-0006is-OJ for submit@debbugs.gnu.org; Mon, 19 Oct 2020 19:46:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUeqt-0006OY-Sy for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 19:46:08 -0400 Original-Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]:42791) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUeqp-0003l0-RR for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 19:46:07 -0400 Original-Received: by mail-il1-x136.google.com with SMTP id l16so2316178ilj.9 for ; Mon, 19 Oct 2020 16:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Tef89Nob3AeTGCz4I6vAulBwaglJWMxIoKScMdsDT5M=; b=cCf5hzr7tQw5AtrcLc4IVFhzDuiB5e2JEeDRP7IEHFhfUxxesJ6SwMgQnHFtzAVSty C6GDrM/FdVL/VN/+lbGMgbLnWPwOuzPGHlSaZZ564eHLd1DqJz4IwzK0RDTs3CyAPj4u kxQe0VBRli+GQorHneSS3A39RvrovjYulLuf2ED5inJIlT0YUCNTaqjXS/JB9kF19xJJ G9NvKTVkpFEUHv9yn3g6Osr8/60Uqvy5CVL8VTgX7PYUIgP1dPLNKlGs9D7fLGOOXjDX wvnVFz4gvAoZJXAdeE/gvtTqGQ6aus0MqjRwk6cY7nNuZ8i3I/Bbp7PM8gM/jd97gHlB x4tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Tef89Nob3AeTGCz4I6vAulBwaglJWMxIoKScMdsDT5M=; b=Sy5aPLdsrw89SDiOVT2ORwVXG3AOTs2LbPqKaCnV+FM9cwE0bQwHwd4aFN8vKVMYKi sPmOX1XYeY20hir94XSPGPRqNrKhDd1ADAA9ijx+mZOQN31ziHwpU5QU7hzH6Buv7hTK Qh6tR6KL8MlctUGEtaKFhq1/58TQY2xX7GA72FLE63R0tUM2AgzLlCQUGec+FAUMmT/w slhTMxU4/+DDpRhgZIQJQjtWebdjwH7uTT2dcKPpHr2unbAtaB7mv1xxxlWY1fDVqDij MhbnUbtwQJVCkY/dmAZBAAH79JbJMZAaDjSZKT+enRjoDXADbEkmPVdzoPq9qtokTK2a dCrQ== X-Gm-Message-State: AOAM531IY/Uf0QTRDO6pO46SJNTZWv0xgnuluEzsWkCLHf18+6RFChZ1 nw6cul1FoGe+lU7OV4A6+Pxk5j51l8nPP57k99pdIW61mME6tA== X-Google-Smtp-Source: ABdhPJz2zyVNy8Gu42UQ/mektSGv/0Kf1ChN4M3PnISKqSUZOAU08XrDTBmYaYcdbBP4SSk9L2LrA5nKEJPNrSP0cIw= X-Received: by 2002:a92:c850:: with SMTP id b16mr2058300ilq.93.1603151159381; Mon, 19 Oct 2020 16:45:59 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::136; envelope-from=jinwoo68@gmail.com; helo=mail-il1-x136.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 19 Oct 2020 19:49:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:191055 Archived-At: --00000000000060563005b20eb7eb Content-Type: text/plain; charset="UTF-8" In term-mode, when switching from line-mode (C-c C-j) to char-mode (C-c C-k), a newline is appended at the end, thus sending out the text that was previously entered in line-mode to the shell right away. Most of the time, that is not what I want. I usually want to edit further before sending the command to the shell. I looked at the 'term-char-mode' function and it seems to prevent the newline by temporarily overriding 'term-input-sender' with 'term-send-string', but it doesn't seem to work as intended somehow. This is the snippet of the code. (unwind-protect (progn (add-function :override term-input-sender #'term-send-string) (end-of-line) (term-send-input)) (remove-function term-input-sender #'term-send-string)))) I'm not sure why this doesn't work. And not sure whether this is new in 27.1 or pre-existing. In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20), modified by Debian Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Debian GNU/Linux rodete Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --build x86_64-linux-gnu --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/google-emacs:/usr/local/share/google-emacs/27.1+gg3+1.20200824.053401.rc115/site-lisp:/usr/local/share/google-emacs/site-lisp:/usr/share/google-emacs/27.1+gg3+1.20200824.053401.rc115/site-lisp:/usr/share/google-emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --program-prefix=google- --disable-build-details --disable-silent-rules --with-modules GOOGLE_VERSION=27.1+gg3+1.20200824.053401.rc115 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars build_alias=x86_64-linux-gnu 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/google-emacs-mI2SpO/google-emacs-27.1+gg3+1.20200824.053401.rc115=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' LDFLAGS=-Wl,-z,relro 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'OBJCFLAGS=-g -O2 -fdebug-prefix-map=/build/google-emacs-mI2SpO/google-emacs-27.1+gg3+1.20200824.053401.rc115=. -fstack-protector-strong -Wformat -Werror=format-security'' 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 LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils term disp-table easymenu comint ansi-color ehelp ring 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 50862 11535) (symbols 48 6786 1) (strings 32 17486 2323) (string-bytes 1 576575) (vectors 16 11421) (vector-slots 8 145518 16770) (floats 8 19 45) (intervals 56 248 0) (buffers 1000 12)) --00000000000060563005b20eb7eb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In term-mode, when switching from line-mode (C-c C-j) to c= har-mode (C-c
C-k), a newline is appended at the end, thus sending out t= he text that
was previously entered in line-mode to the shell right away= . Most of the
time, that is not what I want. I usually want to edit furt= her before
sending the command to the shell.

I looked at the '= ;term-char-mode' function and it seems to prevent the
newline by tem= porarily overriding 'term-input-sender' with
'term-send-stri= ng', but it doesn't seem to work as intended
somehow. This is th= e snippet of the code.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 (unwind-protect=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (add-function :override term-input-sender #'= ;term-send-string)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end= -of-line)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (term-send-in= put))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (remove-function term-input-sen= der #'term-send-string))))

I'm not sure why this doesn&= #39;t work.
And not sure whether this is new in 27.1 or pre-exist= ing.


In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Ver= sion 3.24.20), modified by Debian
Windowing system distributor 'The = X.Org Foundation', version 11.0.12008000
System Description: Debian = GNU/Linux rodete

Recent messages:
For information about GNU Emacs= and the GNU system, type C-h C-a.

Configured using:
=C2=A0'c= onfigure --build x86_64-linux-gnu --build x86_64-linux-gnu
=C2=A0--prefi= x=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib
=C2=A0--loc= alstatedir=3D/var/lib --infodir=3D/usr/share/info
=C2=A0--mandir=3D/usr/= share/man --enable-libsystemd --with-pop=3Dyes
=C2=A0--enable-locallispp= ath=3D/etc/google-emacs:/usr/local/share/google-emacs/27.1+gg3+1.20200824.0= 53401.rc115/site-lisp:/usr/local/share/google-emacs/site-lisp:/usr/share/go= ogle-emacs/27.1+gg3+1.20200824.053401.rc115/site-lisp:/usr/share/google-ema= cs/site-lisp
=C2=A0--with-sound=3Dalsa --without-gconf --with-mailutils<= br>=C2=A0--program-prefix=3Dgoogle- --disable-build-details --disable-silen= t-rules
=C2=A0--with-modules GOOGLE_VERSION=3D27.1+gg3+1.20200824.053401= .rc115
=C2=A0--with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scrol= l-bars
=C2=A0build_alias=3Dx86_64-linux-gnu 'CFLAGS=3D-g -O2
=C2= =A0-fdebug-prefix-map=3D/build/google-emacs-mI2SpO/google-emacs-27.1+gg3+1.= 20200824.053401.rc115=3D. -fstack-protector-strong
=C2=A0-Wformat -Werro= r=3Dformat-security -Wall' LDFLAGS=3D-Wl,-z,relro
=C2=A0'CPPFLAG= S=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' 'OBJCFLAGS=3D-g -O2
=C2= =A0-fdebug-prefix-map=3D/build/google-emacs-mI2SpO/google-emacs-27.1+gg3+1.= 20200824.053401.rc115=3D. -fstack-protector-strong
=C2=A0-Wformat -Werro= r=3Dformat-security''

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_SCROL= L_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON
PDUMPER LCMS2 G= MP

Important settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2= =A0 value of $XMODIFIERS: @im=3Dfcitx
=C2=A0 locale-coding-system: utf-8= -unix

Major mode: Lisp Interaction

Minor modes in effect:
= =C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 eldoc-mode:= t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2= =A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-= mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
= =C2=A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 au= to-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-num= ber-mode: t
=C2=A0 transient-mark-mode: t

Load-path shadows:
N= one found.

Features:
(shadow sort mail-extr emacsbug message rmc = puny dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache = epa derived epg epg-config
gnus-util rmail rmail-loaddefs text-property-= search time-date subr-x seq
byte-opt gv bytecomp byte-compile cconv mm-d= ecode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailhe= ader cl-loaddefs cl-lib
sendmail rfc2047 rfc2045 ietf-drums mm-util mail= -prsvr mail-utils term
disp-table easymenu comint ansi-color ehelp ring = tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwhe= el term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image reg= exp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode li= sp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch tim= er
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core<= br>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
cyri= llic chinese composite charscript charprop case-table epa-hook
jka-cmpr-= hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button fac= es cus-face macroexp files text-properties overlay sha1 md5
base64 forma= t env code-pages mule custom widget hashtable-print-readable
backquote t= hreads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-r= ender-setting move-toolbar gtk x-toolkit x
multi-tty make-network-proces= s emacs)

Memory information:
((conses 16 50862 11535)
=C2=A0(s= ymbols 48 6786 1)
=C2=A0(strings 32 17486 2323)
=C2=A0(string-bytes 1= 576575)
=C2=A0(vectors 16 11421)
=C2=A0(vector-slots 8 145518 16770)=
=C2=A0(floats 8 19 45)
=C2=A0(intervals 56 248 0)
=C2=A0(buf= fers 1000 12))

--00000000000060563005b20eb7eb--