Subject: bug#78262: 30.1; comint-delchar-or-maybe-eof doesn't respect delete-active-region

From: Eli Zaretskii <[email-masked]>
Date: Sat, 10 May 2025 14:15:30 +0300

> Cc: [email-masked]
> From: Juri Linkov <[email-masked]>
> Date: Fri, 09 May 2025 09:52:02 +0300
> 
> > Comint and its derived modes override C-d 'delete-forward-char' with
> > 'comint-delchar-or-maybe-eof'.
> 
> Does the solution proposed by Augusto in bug#73527 fix your use case?
> 
> diff --git a/lisp/comint.el b/lisp/comint.el
> index 188989ff8a4..2189b10e826 100644
> --- a/lisp/comint.el
> +++ b/lisp/comint.el
> @@ -2796,7 +2796,7 @@ comint-delchar-or-maybe-eof
>    (let ((proc (get-buffer-process (current-buffer))))
>      (if (and (eobp) proc (= (point) (marker-position (process-mark proc))))
>  	(comint-send-eof)
> -      (delete-char arg))))
> +      (funcall-interactively (keymap-lookup global-map "C-d") arg))))
>  
>  (defun comint-send-eof ()
>    "Send an EOF to the current buffer's process."

This assumes that everyone will want the same command bound to C-d
globally to be invoked by C-d in comint-mode.  But is that assumption
necessarily true?

Stefan, WDYT?