From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#28066: eshell-tramp sudo ignores C-c Date: Mon, 21 Aug 2017 13:36:06 +0200 Message-ID: <87y3qdnoex.fsf@detlef> References: <87a833uahu.fsf@detlef> <87378mavhe.fsf@detlef> <837exyc9ok.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1503315432 17704 195.159.176.226 (21 Aug 2017 11:37:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 21 Aug 2017 11:37:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 28066@debbugs.gnu.org, rms@gnu.org, yegortimoshenko@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 21 13:37:05 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djl0z-0004Hw-5b for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Aug 2017 13:37:05 +0200 Original-Received: from localhost ([::1]:36441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djl15-0007In-LN for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Aug 2017 07:37:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djl0z-0007Hx-5R for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 07:37:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djl0w-00042a-I8 for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 07:37:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djl0w-00042W-EL for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 07:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1djl0w-0000ak-59 for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2017 07:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Aug 2017 11:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28066-submit@debbugs.gnu.org id=B28066.15033153782222 (code B ref 28066); Mon, 21 Aug 2017 11:37:02 +0000 Original-Received: (at 28066) by debbugs.gnu.org; 21 Aug 2017 11:36:18 +0000 Original-Received: from localhost ([127.0.0.1]:47355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djl0E-0000Zm-9J for submit@debbugs.gnu.org; Mon, 21 Aug 2017 07:36:18 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:51732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djl0C-0000Za-Kt for 28066@debbugs.gnu.org; Mon, 21 Aug 2017 07:36:17 -0400 Original-Received: from detlef.gmx.de ([213.220.149.52]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LtUHA-1dbsgW1DiG-010t09; Mon, 21 Aug 2017 13:36:08 +0200 In-Reply-To: <837exyc9ok.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Aug 2017 22:37:31 +0300") X-Provags-ID: V03:K0:d7JtkO/LnX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F16Xtoy 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: 208.118.235.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:135986 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: Hi Eli, > In such cases, we usually provide a variable whose value is a > function. The default value is a function that does whatever > interrupt-process is doing now, and Tramp can replace it with its own > function. > > Does this make sense in your case? What about the appended patch? Best regards, Michael. --=-=-= Content-Type: text/plain Content-Disposition: attachment diff --git a/src/process.c b/src/process.c index 1900951533..e7ee99ab3d 100644 --- a/src/process.c +++ b/src/process.c @@ -6677,6 +6677,18 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group, unblock_child_signal (&oldset); } +DEFUN ("internal-default-interrupt-process", + Finternal_default_interrupt_process, + Sinternal_default_interrupt_process, 0, 2, 0, + doc: /* Default function to interrupt process PROCESS. +It shall be the last element in list `interrupt-process-functions'. +See function `interrupt-process' for more details on usage. */) + (Lisp_Object process, Lisp_Object current_group) +{ + process_send_signal (process, SIGINT, current_group, 0); + return process; +} + DEFUN ("interrupt-process", Finterrupt_process, Sinterrupt_process, 0, 2, 0, doc: /* Interrupt process PROCESS. PROCESS may be a process, a buffer, or the name of a process or buffer. @@ -6688,11 +6700,14 @@ If the process is a shell, this means interrupt current subjob rather than the shell. If CURRENT-GROUP is `lambda', and if the shell owns the terminal, -don't send the signal. */) +don't send the signal. + +This function calls the functions of `interrupt-process-functions' in +the order of the list, until one of them returns non-`nil'. */) (Lisp_Object process, Lisp_Object current_group) { - process_send_signal (process, SIGINT, current_group, 0); - return process; + return CALLN (Frun_hook_with_args_until_success, Qinterrupt_process_functions, + process, current_group); } DEFUN ("kill-process", Fkill_process, Skill_process, 0, 2, 0, @@ -8176,6 +8191,17 @@ non-nil value means that the delay is not reset on write. The variable takes effect when `start-process' is called. */); Vprocess_adaptive_read_buffering = Qt; + DEFVAR_LISP ("interrupt-process-functions", Vinterrupt_process_functions, + doc: /* List of functions to be called for `interrupt-function'. +The arguments of the functions are the same as for `interrupt-function'. +These functions are called in the order of the list, until one of them +returns non-`nil'. */); + Vinterrupt_process_functions = list1 (Qinternal_default_interrupt_process); + + DEFSYM (Qinternal_default_interrupt_process, + "internal-default-interrupt-process"); + DEFSYM (Qinterrupt_process_functions, "interrupt-process-functions"); + defsubr (&Sprocessp); defsubr (&Sget_process); defsubr (&Sdelete_process); @@ -8218,6 +8244,7 @@ The variable takes effect when `start-process' is called. */); defsubr (&Saccept_process_output); defsubr (&Sprocess_send_region); defsubr (&Sprocess_send_string); + defsubr (&Sinternal_default_interrupt_process); defsubr (&Sinterrupt_process); defsubr (&Skill_process); defsubr (&Squit_process); --=-=-=--