From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#61069: 30.0.50; comint-copy-old-input should include continuation lines Date: Mon, 30 Jan 2023 09:25:19 +0100 Message-ID: <87bkmgzaxc.fsf@gmail.com> References: <25553.55974.767552.842578@orion.rgrjr.com> <834jsdg4jh.fsf@gnu.org> <25554.11478.609268.317183@orion.rgrjr.com> <83o7qlemta.fsf@gnu.org> <25554.15392.580428.54160@orion.rgrjr.com> <83fsbxej3v.fsf@gnu.org> <25556.39517.23330.591366@orion.rgrjr.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7348"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61069@debbugs.gnu.org, Eli Zaretskii To: Bob Rogers Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 30 09:26:23 2023 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 1pMPUd-0001h7-J4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Jan 2023 09:26:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMPUJ-0002Cb-Qc; Mon, 30 Jan 2023 03:26:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMPUI-00029t-9K for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 03:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMPUH-0004pt-TC for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 03:26:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pMPUH-0005eZ-OD for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 03:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Jan 2023 08:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61069 X-GNU-PR-Package: emacs Original-Received: via spool by 61069-submit@debbugs.gnu.org id=B61069.167506712921690 (code B ref 61069); Mon, 30 Jan 2023 08:26:01 +0000 Original-Received: (at 61069) by debbugs.gnu.org; 30 Jan 2023 08:25:29 +0000 Original-Received: from localhost ([127.0.0.1]:46249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMPTk-0005dm-RZ for submit@debbugs.gnu.org; Mon, 30 Jan 2023 03:25:29 -0500 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:37691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMPTj-0005dV-Jy for 61069@debbugs.gnu.org; Mon, 30 Jan 2023 03:25:28 -0500 Original-Received: by mail-wm1-f46.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so9419357wmb.2 for <61069@debbugs.gnu.org>; Mon, 30 Jan 2023 00:25:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=gfnkkRjEm4oI8gZnT3w1LzLnMmTBQzqRVMw2pc/eTGY=; b=pgWb4YjOgTBK3ZAMAa5VUwh7HxFtdoGRNyaYYbjVQHdtWiEOApBrtyCnplbMXvX5ka uNbkgkYArOum/F/C84/6ZOVjT5+sBK48aZkWD7YJQ8SBWCNYMCHfeWDfn07ycUBGMh3+ O22BIqcEbztpdZflCX3lNbFRupH0MiQldiS0TF8v1fVepSrj9QOQVMmoFQZuXDMxYfE8 s1xFzX+0dUcNvlCktBeJwO1RX+C7GRw3rS+sWceJqodRqVrZh2HBaZ3brvr/dl3Y7fVa TX4IzhWWBDDcxBQtH/pofRYtsPmC20QuP2UuXNThMUri5FjcHmr81TciWoEJ2F4m9k97 2rSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gfnkkRjEm4oI8gZnT3w1LzLnMmTBQzqRVMw2pc/eTGY=; b=t9pff8o+Iz5IRVWT/mDFx18sk1cmr1Ty7R42kX3uF9ziFH8Wa6E0DCEbhjyxR2bJJN Dv4MkvG+9OMLabvDDBDXyKJqf7ljSNx2Cw0dArYy/oI+BRG6+26Dg/1sTGw6pNjgIxTP 6h7dGj7lBDps9LHeDzzVMpkWIFzCdyZrbRTX5hAMdNmnzmtedMh+1M62zZ8mPqmfdQ95 m/S5KhC0/tOCpoy/W5xrOKIhQddCAdM417lI5qB+OfX8+tAcIyigQWgBYFZO/0VMEUhI +i2GLMCju7O2LE4NzVrT/9T2NGByfxX6db0Gr5dfHJqbN/qLt/BwnkE+7DyALmawf7I/ gchw== X-Gm-Message-State: AFqh2kq3oxVyc8XnHkdT5MwHseZqLTkHbgL2399QeOWSuUM9K3yfaxX3 a6bnQLAFjeAN9e/ONpDVCP39xnp/l8A= X-Google-Smtp-Source: AMrXdXsJvZlmZJht41jek4OuWeC48ki5CyLqx3ySARbtAMI7eMjGiJr1Vo7PhRDxxZd+4h2enARiHA== X-Received: by 2002:a05:600c:538c:b0:3cf:6f4d:c259 with SMTP id hg12-20020a05600c538c00b003cf6f4dc259mr48498085wmb.39.1675067120851; Mon, 30 Jan 2023 00:25:20 -0800 (PST) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id 3-20020a05600c248300b003db0ad636d1sm4817331wms.28.2023.01.30.00.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 00:25:20 -0800 (PST) In-Reply-To: <25556.39517.23330.591366@orion.rgrjr.com> (Bob Rogers's message of "Fri, 27 Jan 2023 19:45:33 -0800") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254395 Archived-At: >>>>> On Fri, 27 Jan 2023 19:45:33 -0800, Bob Rogers said: Bob> Then the following should fit the bill. Given that this solution Bob> introduces a defcustom, I imagine it should also have a NEWS item as Bob> well . . . Yes. And a :version on the new defcustom itself. Bob> -- Bob Bob> * lisp/shell.el (shell-get-old-input-include-continuation-lines): New Bob> defcustom (default nil). Bob> (shell-get-old-input): Like comint-get-old-input-default but include Bob> all continuation lines if the above is true. Bob> (shell-mode): Install shell-get-old-input. (bug#61069) Two spaces after '.' Bob> +(defcustom shell-get-old-input-include-continuation-lines nil Bob> + "If non-nil, shell-get-old-input-default includes \"\\\" lines." Bob> + :type 'boolean Bob> + :group 'shell) Bob> + "Whether `shell-get-old-input-default' includes \"\\\" lines." Bob> +(defun shell-get-old-input () Bob> + "Default for `comint-get-old-input' in shell-mode. Bob> +If `comint-use-prompt-regexp' is nil, then either Bob> +return the current input field, if point is on an input field, or the Bob> +current line, if point is on an output field. Bob> +If `comint-use-prompt-regexp' is non-nil, then return Bob> +the current line with any initial string matching the regexp Bob> +`comint-prompt-regexp' removed. In either case, if Bob> +shell-get-old-input-include-continuation-lines is non-nil and the Bob> +current line ends with a backslash, the next line is also included and Bob> +examined for a backslash, ending with a final line without a backslash." Bob> + (let (field-prop bof) Bob> + (if (and (not comint-use-prompt-regexp) Bob> + ;; Make sure we're in an input rather than output field. Bob> + (not (setq field-prop (get-char-property Bob> + (setq bof (field-beginning)) 'field)))) Bob> + (field-string-no-properties bof) Emacs uses spaces only in elisp. We even have a .dir-locals.el enforcing that. Robert --