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: Fri, 31 May 2019 16:30:44 -0400 Message-ID: <87woi6e58r.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="172422"; mail-complaints-to="usenet@blaine.gmane.org" To: 36034@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 31 22:43: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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hWoMs-000ig8-VJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 May 2019 22:43:15 +0200 Original-Received: from localhost ([127.0.0.1]:48897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWoMr-0002pY-VA for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 May 2019 16:43:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWoMj-0002oE-8u for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:43:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWoMg-0004sv-F1 for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:43:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51067) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWoMg-0004sl-As for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hWoMg-0003i9-7U for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:43: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: Fri, 31 May 2019 20:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36034 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155933533714159 (code B ref -1); Fri, 31 May 2019 20:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 May 2019 20:42:17 +0000 Original-Received: from localhost ([127.0.0.1]:36374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWoLw-0003gJ-GS for submit@debbugs.gnu.org; Fri, 31 May 2019 16:42:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWoLu-0003fq-CU for submit@debbugs.gnu.org; Fri, 31 May 2019 16:42:14 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46725) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWoLo-0004A7-Hn for submit@debbugs.gnu.org; Fri, 31 May 2019 16:42:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWoLn-0002D6-3t for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:42:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWoAp-0001ie-M3 for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:30:48 -0400 Original-Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:45343) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWoAp-0001hS-GD for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:30:47 -0400 Original-Received: by mail-qt1-x835.google.com with SMTP id t1so2458393qtc.12 for ; Fri, 31 May 2019 13:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=9Y2hjSvW9xZA5JZW2JUUiKaTBjyKRANbnn2CGI10tA4=; b=OEFtlda8z39eW29sKc7zqpbuD3FT8Do9OnCrfOjjZV+1Svn1etfJtnRI9nyVp1y3hR fU/oR3MKmoZG7pGqdZUw0DBRcShZGJym5BeW1NJ7Gh8fEHLtP/wOkaMIhozM8Hk7d83N VSL2UuylsSTsW4Riy86BBRDnfW/dw5QQS3k1YyfegOiYC6MkjVV/dVuKX9AjBvlYuTgG ePJ59Bmp9S0mksQ70wuNF6o9bwaN8mEdjOzDB13RncX+bUkM7/SCXqtxvbChX74cS+np hsNV6k8kj+kahWZtJQAgjSjwBT2W86ZNni5pFdXEGXudKtzaCx/S3KZHEBqdNPHddyoP 83fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=9Y2hjSvW9xZA5JZW2JUUiKaTBjyKRANbnn2CGI10tA4=; b=IxDKarRzarMHKvxK/dyroLLrbJFeENJ9rtVLF+9irJb5vJZmIcSaIFwOYdwlD1d7UD p3ugvTXz/oxb5q4D98FLRbR1AlnTdvtaZ6dtkuc4KQ7qNdK3lRNuIbO9i40v0zGm1GnN dydbqMiXtObLhikjj34c58ZqYlfnUSuaEg/bu2sO2hJhCkWlwzST0L/L/ZNSFMD4ShTn 0+T4gNubucyYtyW9XMPbdsX3AF6ZugYbMR8EJQekBb2BP3QMl89dgHHdWj7XHpamvhIg 9MTIoG7KmlUEqlV88XbCPWpnHacHvMRyewru6DjHF/mEyitFIKYQyNIa20hAUQMFzCx2 kFgA== X-Gm-Message-State: APjAAAWzWVi65AHth6QLp5DpauJbzyjXc1ay2N+tXXlyGHUYV9EP29XK ybO93v+6FkyqRmXDExhNh6l/c9/Iz9A= X-Google-Smtp-Source: APXvYqy6ZVMQrqZwhb1jG32jScBtXKBlkukkf95Q7aUBoyOmTY/M3er/rCmLJvty7JM4zvoye7jodA== X-Received: by 2002:ac8:2448:: with SMTP id d8mr11258319qtd.197.1559334645911; Fri, 31 May 2019 13:30:45 -0700 (PDT) Original-Received: from dellbook (static-108-30-103-121.nycmny.fios.verizon.net. [108.30.103.121]) by smtp.gmail.com with ESMTPSA id o71sm5831480qke.18.2019.05.31.13.30.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 May 2019 13:30:44 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:159980 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Currently, Zsh=E2=80=99s extended_history option is not handled well in Ema= cs. The comint buffer does not know to skip it when running comint-read-input-ring. The attached patch handles this. This behavior is described in the Zsh manual available at: http://zsh.sourceforge.net/Doc/Release/Options.html#History The format of this line looks like this: : :; This patch just skips those timestamp to get the part. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-Add-zsh-extended_history-handling-for-comint.el-inpu.patch Content-Transfer-Encoding: quoted-printable >From b8a8857cd686fae1ebbeca79f4469ce878837b90 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 31 May 2019 16:27:24 -0400 Subject: [PATCH] Add zsh extended_history handling for comint.el input ring MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Adds handling of the Zsh extended_history to comint.el input ring. This means that the timestamp doesn=E2=80=99t show up when reading through history from other shells. The lines look like this: : :; This patch skips the part before . Zsh documents it here: http://zsh.sourceforge.net/Doc/Release/Options.html#History --- lisp/comint.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/comint.el b/lisp/comint.el index 3dce1c9c8d..c5c0ad0f7b 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -976,7 +976,11 @@ See also `comint-input-ignoredups' and `comint-write-i= nput-ring'." (setq start (if (re-search-backward comint-input-ring-separator nil t) - (match-end 0) + (progn + ;; Skip zsh extended_history stamps + (re-search-forward ": [[:digit:]]+:[[:digit:]= ]+;" nil t) + + (match-end 0)) (point-min))) (setq history (buffer-substring start end)) (goto-char start) --=20 2.21.0 --=-=-=--