GNU bug report logs - #73527
30.0.90; Comint rebinds C-d

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Augusto Stoffel <arstoffel@HIDDEN>; dated Sat, 28 Sep 2024 10:50:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 73527 <at> debbugs.gnu.org:


Received: (at 73527) by debbugs.gnu.org; 5 Oct 2024 14:33:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 05 10:33:44 2024
Received: from localhost ([127.0.0.1]:39370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sx5qq-0002vX-Le
	for submit <at> debbugs.gnu.org; Sat, 05 Oct 2024 10:33:44 -0400
Received: from mail-ej1-f44.google.com ([209.85.218.44]:59684)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arstoffel@HIDDEN>) id 1sx5qo-0002vO-UB
 for 73527 <at> debbugs.gnu.org; Sat, 05 Oct 2024 10:33:43 -0400
Received: by mail-ej1-f44.google.com with SMTP id
 a640c23a62f3a-a8d0d82e76aso503231766b.3
 for <73527 <at> debbugs.gnu.org>; Sat, 05 Oct 2024 07:33:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1728138757; x=1728743557; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=xG9xg1poPFdRsAj+TTVF4BUjkeyk57HrFlJVHipuMPs=;
 b=CItu0i3DiaI7H7J9FzYjwK7nSE2dtBsidJHZbCciLQG7tLl92GpE0Pja3i51nV8vqd
 PJlxgRZz/IwrgQdSGJe0HQbj52P3ZcTkcGXowSwjfmwCjA88Gx/7XEAHA3J+JduYOsph
 ZUHwNK4QKjTgoCzR3tXGzmpwdP5ledhBXIKUcnC6RLVmupu876xpVM9KIuoLS9zdgMdY
 3J1mDZBh47L9X1wqaaS/2FFBF7PGnzhcmFM281oE2jLfeH0PW1y5Ma94pyYTuK0wKmRu
 HMylArP+CNPvWe3MD9kjuEQX9QHn8Ga1bnYC3FC/GXIcAD/LExIjzEbdYKa6o5gVaojg
 6FzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728138757; x=1728743557;
 h=mime-version:user-agent: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=xG9xg1poPFdRsAj+TTVF4BUjkeyk57HrFlJVHipuMPs=;
 b=poC4B8UE0YbNfOjktnFBfna/g4gHat99KP5U45HxS87wNbm0tzZ1FkMzPzaMzTQ1mG
 ACayQT8oeekKx7RtBhVz6UmUF8B7mri0FzjDObvQsu6gSvgYD16BHJAttE9IoOo4Uvjc
 Xv7gpSWYhBpLSDF61+Nz7oSKL+CAoe8lkAK+bh7Q1+/TE8IlwXRYCDLDHJMJWLZcByX1
 A48dPMKRE85xtYbQBOPBK8rUwIQx+DIBlBoSNh0/V8Ab9T9soR6342Iaxp5b4AyAvH6D
 tVHB4IxeZOTroaocmyjTPixKFXZXdUKh9iJ4EpCAsvaawplD2M2DQvPYuLESdb9y0Cfs
 1Jfw==
X-Gm-Message-State: AOJu0Yw7tcM869NgZzu1UN1jc3LEGcN6yluzn9M8OeC9Gc38BDOsC5iD
 r7timDrqK+TVWCtHmi+x9qocR/uDqeU4L8ej15N/W0IalqwpVVokDcj8xg==
X-Google-Smtp-Source: AGHT+IHsNjYOLv9t36CVtMztQtHN4AWBHH/lh5YNfQTeZX1HInCogL6Fx1aisl+41dGQVg+VMEczIw==
X-Received: by 2002:a17:907:9728:b0:a86:8285:24a0 with SMTP id
 a640c23a62f3a-a991bd44c96mr706030566b.23.1728138756755; 
 Sat, 05 Oct 2024 07:32:36 -0700 (PDT)
Received: from ars3 ([2a02:8109:8a87:ff00::d6f6])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a9943ea4936sm30933966b.174.2024.10.05.07.32.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 05 Oct 2024 07:32:36 -0700 (PDT)
From: Augusto Stoffel <arstoffel@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#73527: 30.0.90; Comint rebinds C-d
In-Reply-To: <86cykmla4s.fsf@HIDDEN> (Juri Linkov's message of "Sun, 
 29 Sep 2024 19:08:03 +0300")
References: <87y13cf3zu.fsf@HIDDEN> <86cykmla4s.fsf@HIDDEN>
Date: Sat, 05 Oct 2024 16:32:31 +0200
Message-ID: <87o73ymxhc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73527
Cc: 73527 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sun, 29 Sep 2024 at 19:08, Juri Linkov wrote:

> It would be nice to make such filter customizable.
>
> For example, currently I have to use:
>
>   (define-key shell-mode-map "\C-d" 'my-shell-c-d)
>   (defun my-shell-c-d (&optional arg)
> [...]

Good point.  How about replacing (delete-char arg) in
comint-delchar-or-maybe-eof with

  (call-interactively
    (lookup-key global-map <something appropriate>))

Not sure this could be made to work reliably.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73527; Package emacs. Full text available.

Message received at 73527 <at> debbugs.gnu.org:


Received: (at 73527) by debbugs.gnu.org; 29 Sep 2024 16:11:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 29 12:11:04 2024
Received: from localhost ([127.0.0.1]:40934 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1suwVk-0006mG-5y
	for submit <at> debbugs.gnu.org; Sun, 29 Sep 2024 12:11:04 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:50709)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1suwVi-0006lH-EZ
 for 73527 <at> debbugs.gnu.org; Sun, 29 Sep 2024 12:11:03 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 0402640003;
 Sun, 29 Sep 2024 16:10:03 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Augusto Stoffel <arstoffel@HIDDEN>
Subject: Re: bug#73527: 30.0.90; Comint rebinds C-d
In-Reply-To: <87y13cf3zu.fsf@HIDDEN> (Augusto Stoffel's message of "Sat, 28
 Sep 2024 12:48:37 +0200")
Organization: LINKOV.NET
References: <87y13cf3zu.fsf@HIDDEN>
Date: Sun, 29 Sep 2024 19:08:03 +0300
Message-ID: <86cykmla4s.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73527
Cc: 73527 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> comint-mode rebinds C-d (to `comint-delchar-or-maybe-eof') in a way that
> is supposed to fall back to the default C-d behavior unless point is on
> a blank input line.
>
> If the user rebinds C-d in the global map, e.g. to something sensible
> such as `delete-forward-char', this preference is overridden.
>
> Should a menu-item with :filter property be used instead in
> comint-mode-map?

It would be nice to make such filter customizable.

For example, currently I have to use:

  (define-key shell-mode-map "\C-d" 'my-shell-c-d)
  (defun my-shell-c-d (&optional arg)
    (interactive "p")
    (cond ((and (eobp)
                (save-excursion
                  (let ((inhibit-field-text-motion t))
                    (goto-char (line-beginning-position))
                    (looking-at-p "^iex.*>\s*$"))))
           (let ((process (get-buffer-process (current-buffer))))
             (process-send-string process ":init.stop()\n")))
          ((and (eobp)
                (save-excursion
                  (let ((inhibit-field-text-motion t))
                    (goto-char (line-beginning-position))
                    (looking-at-p "^[a-z:]*cljs\\..*=>\s*$"))))
           (let ((process (get-buffer-process (current-buffer))))
             (process-send-string process ":cljs/quit\n")))
          (t
           (comint-delchar-or-maybe-eof arg))))

But with a filter all these cases could be moved to the filter predicate,
along with its default value extracted from 'comint-delchar-or-maybe-eof':

    (if (and (eobp) proc (= (point) (marker-position (process-mark proc))))
	(comint-send-eof)
      (delete-char arg))

Then rebinding `C-d' from `delete-char' to `delete-forward-char'
will be handled automatically.

Also for the users of `delete-selection-mode' this will remove
the need to add more settings:

  (put 'comint-delchar-or-maybe-eof 'delete-selection 'supersede)
  (put 'my-shell-c-d 'delete-selection 'supersede)

according to this part of delsel.el:

  ;; delete-backward-char and delete-forward-char already delete the selection by
  ;; default, but not delete-char.
  (put 'delete-char 'delete-selection 'supersede)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73527; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Sep 2024 10:49:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 28 06:49:19 2024
Received: from localhost ([127.0.0.1]:51980 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1suV0p-0003xu-1t
	for submit <at> debbugs.gnu.org; Sat, 28 Sep 2024 06:49:19 -0400
Received: from lists.gnu.org ([209.51.188.17]:36634)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arstoffel@HIDDEN>) id 1suV0l-0003xj-Pw
 for submit <at> debbugs.gnu.org; Sat, 28 Sep 2024 06:49:17 -0400
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 <arstoffel@HIDDEN>)
 id 1suV0H-0004QH-MR
 for bug-gnu-emacs@HIDDEN; Sat, 28 Sep 2024 06:48:45 -0400
Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <arstoffel@HIDDEN>)
 id 1suV0G-0001J3-9u
 for bug-gnu-emacs@HIDDEN; Sat, 28 Sep 2024 06:48:45 -0400
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a90188ae58eso354631666b.1
 for <bug-gnu-emacs@HIDDEN>; Sat, 28 Sep 2024 03:48:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1727520522; x=1728125322; darn=gnu.org;
 h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc
 :subject:date:message-id:reply-to;
 bh=XPH0NLRgQvktkDMB+MoBm0uPYtiUDkt6YCZMewhluwA=;
 b=CQZYACwboi5YrPGpPapxvK6ZP2R/EEzhm1kCqQ5LUPxS8FRIXIgL/AWMLZKSKV3WqI
 1WAlciPPOSZD9yaT1zxcpRbhklEmk1ElkpprBiUakMskPdbfVwe59mqfCsCwNk3udnNZ
 IV3PMRTc5LJMM3HtUb6ap2kVekiqgyh3PSE/F/yXHrfxLud/syBiyZQ6XEbVGWvZ6ORK
 z68VCjBViH3uxem6BS+070YNUM7Dlk3ZZa2h6heCWKUxVvK6rahKMUszOzEBLAGwilQH
 5AsIhQPdxdaKtaIC7IAfb8QAwE5V58V4ThD22yCHrCuK7w82dVFSdv2d5/N5QdxO82XR
 X3IA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1727520522; x=1728125322;
 h=mime-version:user-agent:message-id:date:subject:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=XPH0NLRgQvktkDMB+MoBm0uPYtiUDkt6YCZMewhluwA=;
 b=gieTTPmLltXKkhQvqvj4xdgTGgQCfMCLAvvoZbqc6+nyCH+FJjY6RwEm1qHGHMFhCJ
 TQDrShFW4zCVxCWODuuqITM6nROi/Y6ToBohKobQPY5BtuH7XjMcEan8yApt4CfIWcgf
 xhMsHr0SI6z7x+xTxAr4yUQ6ONr208o09EbEj2aRork08hVma3cU7/7GFtCrN7qRyukR
 +MNiAvQFlmQIBZ/4o0el8+e+9IvyAtebiwg8mYq+EDYBgLkvPSFI40SYUazNpC6ZTWNM
 MSki/Yg59tUBJkZAEBUfPtfhNaxVQ92sloOSylwMJ7emmihjQiaoxr4TezrnW5yTvbPD
 RmYQ==
X-Gm-Message-State: AOJu0YzkZeX1xPyJahb6dBefMsGnBxdPFWUoQSvFvHgCXrxb1sUqNQF3
 dGVrxp9UGfoPV49y2Ih/07WotRSIvyoA1p605QRvmk9hvRyoCQtqANOTEQ==
X-Google-Smtp-Source: AGHT+IET/TNBN1xPifyPZql+5nneeLLnmwzXXAmmkysF2N2M2E1n+aIPegjjGzbYC0Sz6AfvJEWOIg==
X-Received: by 2002:a17:907:9812:b0:a91:1634:9e92 with SMTP id
 a640c23a62f3a-a93c4919832mr578128566b.21.1727520521761; 
 Sat, 28 Sep 2024 03:48:41 -0700 (PDT)
Received: from ars3 ([2a02:8109:8a87:ff00::d6f6])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c882405ce6sm2093093a12.13.2024.09.28.03.48.38
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 28 Sep 2024 03:48:40 -0700 (PDT)
From: Augusto Stoffel <arstoffel@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.90; Comint rebinds C-d
X-Debbugs-Cc: 
Date: Sat, 28 Sep 2024 12:48:37 +0200
Message-ID: <87y13cf3zu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::62a;
 envelope-from=arstoffel@HIDDEN; helo=mail-ej1-x62a.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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_FROM=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

comint-mode rebinds C-d (to `comint-delchar-or-maybe-eof') in a way that
is supposed to fall back to the default C-d behavior unless point is on
a blank input line.

If the user rebinds C-d in the global map, e.g. to something sensible
such as `delete-forward-char', this preference is overridden.

Should a menu-item with :filter property be used instead in
comint-mode-map?




Acknowledgement sent to Augusto Stoffel <arstoffel@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#73527; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.