GNU bug report logs -
#73527
30.0.90; Comint rebinds C-d
Previous Next
Reported by: Augusto Stoffel <arstoffel <at> gmail.com>
Date: Sat, 28 Sep 2024 10:50:02 UTC
Severity: normal
Merged with 78262
Found in versions 30.1, 30.0.90
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73527 in the body.
You can then email your comments to 73527 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73527
; Package
emacs
.
(Sat, 28 Sep 2024 10:50:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Augusto Stoffel <arstoffel <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 28 Sep 2024 10:50:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73527
; Package
emacs
.
(Sun, 29 Sep 2024 16:12:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 73527 <at> debbugs.gnu.org (full text, mbox):
> 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 <at> gnu.org
:
bug#73527
; Package
emacs
.
(Sat, 05 Oct 2024 14:34:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 73527 <at> debbugs.gnu.org (full text, mbox):
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.
Forcibly Merged 73527 78262.
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Sun, 11 May 2025 06:54:03 GMT)
Full text and
rfc822 format available.
bug Marked as fixed in versions 31.0.50.
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Wed, 14 May 2025 06:12:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 31.0.50, send any further explanations to
78262 <at> debbugs.gnu.org and Sebastián Monía <sebastian <at> sebasmonia.com>
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Wed, 14 May 2025 06:12:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 11 Jun 2025 11:24:10 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.