From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#36034: [PATCH] Zsh extended_history shows up in comint input ring Date: Mon, 20 Jan 2020 20:43:51 +0100 Message-ID: <875zh5syko.fsf@marxist.se> References: <87woi6e58r.fsf@gmail.com> <87E1A7E1-B0B3-45F9-9282-82A19DDB2516@gmail.com> <3FE84EF1-D1F2-4F8B-B89C-C147C922F32D@gmail.com> <3761BF5D-AD36-4F7D-8518-CEFD3A3AC6E6@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="82049"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Matthew Bauer , 36034@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 20 20:44:18 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 1itcyA-000LAi-B1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Jan 2020 20:44:18 +0100 Original-Received: from localhost ([::1]:43478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itcy9-0006Zw-Au for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Jan 2020 14:44:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37791) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itcxv-0006Sg-Rt for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2020 14:44:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itcxu-0007Td-Qk for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2020 14:44:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itcxu-0007Sr-Fm for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2020 14:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1itcxu-0007tR-9H for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2020 14:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Jan 2020 19:44: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.157954944130328 (code B ref 36034); Mon, 20 Jan 2020 19:44:02 +0000 Original-Received: (at 36034) by debbugs.gnu.org; 20 Jan 2020 19:44:01 +0000 Original-Received: from localhost ([127.0.0.1]:46096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1itcxt-0007t5-Cg for submit@debbugs.gnu.org; Mon, 20 Jan 2020 14:44:01 -0500 Original-Received: from ted.gofardesign.uk ([67.225.143.91]:40346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1itcxr-0007sp-Ie for 36034@debbugs.gnu.org; Mon, 20 Jan 2020 14:44:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZfdwDzVqRrRBRt/mGKufT+ICLa/UeW6RZkEYRLQRnyw=; b=KONdHDQkDsKG2cRdzwofrrjx/Y vOaZLb5iiB9ZgRUP6PoPVX/nx69VAur+oDhSEJeDVzpOv8cFWiVfmsWvbcqDOozBMR1Ic1dSGY4E8 lrKsKH8Ww43ScMxNrQkapsXIJMQ1hHQE6hQajCzcrwQn3+ZOADutRzUV3JDUaOcZ7KJajDbtMD61T JYBR1e4JdYCntRu8QZdGeea6H7BmV83xxXbJDgaK7R+nf52SoFdwHDbkRDff4IdDgzyRV++StupzN jb7xID6exglyLOdtrnZ84xif0ZkYbesWFXBcYOq4prAzcjldymg9dib1mGXGi8veDiWCYqkIoDSOH 7ZDh4gkw==; Original-Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:36104 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1itcxl-0003vF-Cw; Mon, 20 Jan 2020 14:43:53 -0500 In-Reply-To: (Lars Ingebrigtsen's message of "Thu, 04 Jul 2019 15:37:29 +0200") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:174950 Archived-At: Lars Ingebrigtsen writes: > Matthew Bauer writes: > >> (setq start >> (if (re-search-backward comint-input-ring-separator >> nil t) >> - (match-end 0) >> - (point-min))) >> + (progn >> + (when comint-input-ring-file-prefix >> + ;; Skip zsh extended_history stamps >> + (re-search-forward comint-input-ring-file-prefix >> + nil t)) >> + (match-end 0)) > > Hm... I don't think this is right, either. If the re-search-forward > fails, then (match-end 0) will fail, too. And since (if I understood > correctly), the prefix will follow on directly from where point it, > using looking-at would be better, anyway... > >> ;; Bypass a bug in certain versions of bash. >> (when (string-equal shell "bash") >> (add-hook 'comint-preoutput-filter-functions >> - 'shell-filter-ctrl-a-ctrl-b nil t))) >> + 'shell-filter-ctrl-a-ctrl-b nil t)) >> + >> + ;; Skip extended history for zsh. >> + (when (string-equal shell "zsh") >> + (setq-local comint-input-ring-file-prefix ": [[:digit:]]+:[[:digit:]]+;"))) >> (comint-read-input-ring t))) > > And this bit didn't apply. That was 7 months ago. Did you have any time to look into the comments by Lars above? Thanks. Best regards, Stefan Kangas