From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Matthew Bauer Newsgroups: gmane.emacs.bugs Subject: bug#36034: [PATCH] Zsh extended_history shows up in comint input ring Date: Sat, 29 Jun 2019 17:35:19 -0400 Message-ID: <3761BF5D-AD36-4F7D-8518-CEFD3A3AC6E6@gmail.com> References: <87woi6e58r.fsf@gmail.com> <87E1A7E1-B0B3-45F9-9282-82A19DDB2516@gmail.com> <3FE84EF1-D1F2-4F8B-B89C-C147C922F32D@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3560.7\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_2DCFBCEE-AC5B-4EBD-B21F-34F6283C9E5D" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="128107"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36034@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 29 23:36:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hhL17-000XB8-Tv for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 23:36:18 +0200 Original-Received: from localhost ([::1]:42208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhL16-0003Pp-IE for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 17:36:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47198) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhL0t-0003Pe-Rh for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 17:36:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhL0s-0004YL-Sl for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 17:36:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hhL0s-0004Xu-NF for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 17:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hhL0s-00055s-Iu for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 17:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Bauer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jun 2019 21:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36034 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36034-submit@debbugs.gnu.org id=B36034.156184412919535 (code B ref 36034); Sat, 29 Jun 2019 21:36:02 +0000 Original-Received: (at 36034) by debbugs.gnu.org; 29 Jun 2019 21:35:29 +0000 Original-Received: from localhost ([127.0.0.1]:44972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhL0K-000551-Sf for submit@debbugs.gnu.org; Sat, 29 Jun 2019 17:35:29 -0400 Original-Received: from mail-qt1-f180.google.com ([209.85.160.180]:41235) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhL0I-00054o-Tt for 36034@debbugs.gnu.org; Sat, 29 Jun 2019 17:35:27 -0400 Original-Received: by mail-qt1-f180.google.com with SMTP id d17so10408314qtj.8 for <36034@debbugs.gnu.org>; Sat, 29 Jun 2019 14:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=iFXB/0gNsWCtEzVNZ1I3ix4MHp3mIx5WIVLB7EA1yZo=; b=mIXw17msTBdTycVHQFRlKQ0Tyyd3kn1t0YthkiXdBFIbhDK8hkcwYFsIViAltpAMCv R/MLYor1WngkSl1v9C4Ze909tLVdl4X1X3Po8ACktywcd1YvsNzfxG3S+SHlK4CQZyiV lRUzGVngCUbh2YvoxjpIa+b9OIsF8g++xW7hdfJAKcA0BvD6mBtkJSJd2wpY+oNbqZFx siLiSVBrs755ScIwdaMkq847G0o6MT7JgbrdJgcxEG/Bybz3ZjWM1HcsvlPsXwPq8kOx 1O83ZZV+ZRErx1kSqeoE12k3xx0gnyowqXdxLpyTei2sRrV2mwLLW7GU6dJsrKRUJjgU Mx2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=iFXB/0gNsWCtEzVNZ1I3ix4MHp3mIx5WIVLB7EA1yZo=; b=EYuFfCkw1JYAPrjQzID8LNaau9Pli6IQL2yJlc0WqIs8oUzqz7Px997K8fMIRQ0Oxh y/056YPv7KHXI3V8sENw7S3Em5dXq+FwNkF861Av+bs88nlxG+zcPtHxdMYffWhfVVpT TgvICo/MyTMHBX6wjWhLR9OgGbzbJmrgaHTEXQdDf4JU38jQjvKkzQivbzpZje8TsWTJ I4296UNvhO1MPkx6TDSZU8Z8Q7GE7YaWGF7uEJBfNip5ZeqjatbOatoDzEj3WBY0bjMr qfdPJ85uZkmgI+Ts9PS1QDzkIPPAhQ5e9j7Aa7Ikt0R4mJcbRhb+1+RDW3+CnJ7cZOml YhVA== X-Gm-Message-State: APjAAAUT99qdZ68Gb+3uHqh0DtbwppDs8EY5l9V6vAFFLHzUfRWTWEsv r+ZdJ4bSbB9wPlpnzfiP6mw= X-Google-Smtp-Source: APXvYqwrF5GXaE4Qt3GTpDhJZeRE/7rh2eELyZv1UNhK83YCuEhwq2U9v3RN22sPj8M4zI9hC+42QQ== X-Received: by 2002:a0c:b7a8:: with SMTP id l40mr14465944qve.142.1561844121088; Sat, 29 Jun 2019 14:35:21 -0700 (PDT) Original-Received: from matthewsmacbook.home (ool-457386fe.dyn.optonline.net. [69.115.134.254]) by smtp.gmail.com with ESMTPSA id o54sm3213235qtb.63.2019.06.29.14.35.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jun 2019 14:35:20 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3560.7) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161845 Archived-At: --Apple-Mail=_2DCFBCEE-AC5B-4EBD-B21F-34F6283C9E5D Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jun 25, 2019, at 7:05 AM, Lars Ingebrigtsen wrote: > This will make point end up at where (match-end 0) would be after the > looking-at, surely? > Ok yeah that simplified things a bit. Attached an updated version. --Apple-Mail=_2DCFBCEE-AC5B-4EBD-B21F-34F6283C9E5D Content-Disposition: attachment; filename=0001-Add-zsh-extended_history-handling-for-comint.el-inpu.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Add-zsh-extended_history-handling-for-comint.el-inpu.patch" Content-Transfer-Encoding: quoted-printable =46rom=20286ceba115b3deabfd90e589c3dbebf03a992e25=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Matthew=20Bauer=20=0A= Date:=20Sun,=2023=20Jun=202019=2018:08:32=20-0400=0ASubject:=20[PATCH]=20= Add=20zsh=20extended_history=20handling=20for=20comint.el=20input=20ring=0A= MIME-Version:=201.0=0AContent-Type:=20text/plain;=20charset=3DUTF-8=0A= Content-Transfer-Encoding:=208bit=0A=0AAdds=20handling=20of=20the=20Zsh=20= extended_history=20to=20comint.el=20input=0Aring.=20This=20means=20that=20= the=20timestamp=20doesn=E2=80=99t=20show=20up=20when=20reading=0Athrough=20= history=20from=20other=20shells.=20The=20lines=20look=20like=20this:=0A=0A= :=20:;=0A=0AThis=20patch=20= skips=20the=20part=20before=20=20when=20the=20=E2=80=98shell=E2=80= =99=20is=0Azsh.=20This=20is=20done=20through=20the=20= comint-input-ring-file-prefix=0Avariable.=20When=20set,=20this=20will=20= skip=20a=20prefix=20of=20the=20file=20when=20loading=0Ainto=20the=20= input=20ring.=20This=20matches=20the=20behavior=20of=20Zsh.=20Zsh=20= documents=0Ait=20here:=0A=0A= http://zsh.sourceforge.net/Doc/Release/Options.html#History=0A---=0A=20= lisp/comint.el=20|=2018=20++++++++++++++++--=0A=20lisp/shell.el=20=20|=20= =206=20+++++-=0A=202=20files=20changed,=2021=20insertions(+),=203=20= deletions(-)=0A=0Adiff=20--git=20a/lisp/comint.el=20b/lisp/comint.el=0A= index=2056e38e24ac..6d4293b722=20100644=0A---=20a/lisp/comint.el=0A+++=20= b/lisp/comint.el=0A@@=20-249,6=20+249,10=20@@=20to=20set=20this=20in=20a=20= mode=20hook,=20rather=20than=20customize=20the=20default=20value."=0A=20=09= =09=20file)=0A=20=20=20:group=20'comint)=0A=20=0A+(defvar=20= comint-input-ring-file-prefix=20nil=0A+=20=20"The=20prefix=20to=20skip=20= when=20parsing=20the=20input=20ring=20file.=0A+This=20is=20useful=20in=20= Zsh=20when=20the=20extended_history=20option=20is=20on.")=0A+=0A=20= (defcustom=20comint-scroll-to-bottom-on-input=20nil=0A=20=20=20"Controls=20= whether=20input=20to=20interpreter=20causes=20window=20to=20scroll.=0A=20= If=20nil,=20then=20do=20not=20scroll.=20=20If=20t=20or=20`all',=20scroll=20= all=20windows=20showing=20buffer.=0A@@=20-978,8=20+982,18=20@@=20See=20= also=20`comint-input-ignoredups'=20and=20`comint-write-input-ring'."=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20start=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (re-search-backward=20comint-input-ring-separator=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20nil=20t)=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (match-end=200)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(point-min)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(progn=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (when=20comint-input-ring-file-prefix=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Skip=20= zsh=20extended_history=20stamps=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(re-search-forward=20= comint-input-ring-file-prefix=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20nil=20t))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(match-end=20= 0))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(progn=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(goto-char=20(point-min))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= comint-input-ring-file-prefix=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(re-search-forward=20= comint-input-ring-file-prefix=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20nil=20t))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(point))))=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20history=20= (buffer-substring=20start=20end))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(goto-char=20start)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(when=20(and=20(not=20(string-match=20= comint-input-history-ignore=0Adiff=20--git=20a/lisp/shell.el=20= b/lisp/shell.el=0Aindex=20e30825cd66..25f6892d96=20100644=0A---=20= a/lisp/shell.el=0A+++=20b/lisp/shell.el=0A@@=20-600,7=20+600,11=20@@=20= buffer."=0A=20=20=20=20=20=20=20;;=20Bypass=20a=20bug=20in=20certain=20= versions=20of=20bash.=0A=20=20=20=20=20=20=20(when=20(string-equal=20= shell=20"bash")=0A=20=20=20=20=20=20=20=20=20(add-hook=20= 'comint-preoutput-filter-functions=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20'shell-filter-ctrl-a-ctrl-b=20nil=20t)))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20'shell-filter-ctrl-a-ctrl-b=20= nil=20t))=0A+=0A+=20=20=20=20=20=20;;=20Skip=20extended=20history=20for=20= zsh.=0A+=20=20=20=20=20=20(when=20(string-equal=20shell=20"zsh")=0A+=20=20= =20=20=20=20=20=20(setq-local=20comint-input-ring-file-prefix=20":=20= [[:digit:]]+:[[:digit:]]+;")))=0A=20=20=20=20=20(comint-read-input-ring=20= t)))=0A=20=0A=20(defun=20shell-apply-ansi-color=20(beg=20end=20face)=0A= --=20=0A2.22.0=0A=0A= --Apple-Mail=_2DCFBCEE-AC5B-4EBD-B21F-34F6283C9E5D--