From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: process-file instead of call-process in proced.el? Date: Fri, 25 Mar 2022 13:31:52 +0300 Message-ID: <83v8w2b9wn.fsf@gnu.org> References: <835yo2cyj9.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9492"; mail-complaints-to="usenet@ciao.gmane.io" Cc: winkler@gnu.org, emacs-devel@gnu.org To: Filipp Gunbin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 25 11:34:18 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nXhGr-0002FM-As for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Mar 2022 11:34:17 +0100 Original-Received: from localhost ([::1]:56338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXhGp-0005Fk-TR for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Mar 2022 06:34:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXhEc-0003zL-6g for emacs-devel@gnu.org; Fri, 25 Mar 2022 06:31:58 -0400 Original-Received: from [2001:470:142:3::e] (port=47286 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXhEb-0006XQ-Su; Fri, 25 Mar 2022 06:31:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gNDoYeWkdBwxZx81hq6SRUmt3gzqjJzQdkSH4mYZPQo=; b=UOxEpnANiE2f ZEubB3VdHYP0hkEquq6eHPnpp/CRGbI7637sQVNc2bnSpy43zPcCyX+MgKDNm4qXK5h4u7TVP1DR5 BQtLhV4xHZl3SnCTbZq0HTh6lrKU1S2SryeAI4gDGEH/Ui1bKJasnk3+f4hHAuDVOne127MZ8vnAl oqzmJyipyy7IMJtOrOLl3dtxLNc1Po4lLrdUziCWH/kvqh8wufo7mOGNo892+zdKYcInSg5viRHk1 rcxQ92Fin1UF9ukvNqjzGjGEUm3KH0WG7gEmZo4oWSe3rQ18RjmiB0ndz9VM47Ez8+aB2B4OURnCS seZMIiRKp2wRDHV2UwSjwA==; Original-Received: from [87.69.77.57] (port=1942 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXhEb-00068B-7x; Fri, 25 Mar 2022 06:31:57 -0400 In-Reply-To: (message from Filipp Gunbin on Fri, 25 Mar 2022 13:24:10 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:287444 Archived-At: > From: Filipp Gunbin > Cc: emacs-devel@gnu.org, winkler@gnu.org > Date: Fri, 25 Mar 2022 13:24:10 +0300 > > On 25/03/2022 09:54 +0300, Eli Zaretskii wrote: > > >> From: Filipp Gunbin > >> Date: Fri, 25 Mar 2022 03:09:12 +0300 > >> Cc: winkler@gnu.org > >> > >> There's this TODO in proced.el: > >> > >> --8<---------------cut here---------------start------------->8--- > >> ;; - Allow "sudo kill PID", "sudo renice PID" > >> --8<---------------cut here---------------end--------------->8--- > >> > >> WDYT, can we just use process-file instead of call-process? Then, if > >> proced is opened from a /sudo:: (or su) buffer, and (setq > >> proced-signal-function "kill") is set, proced-send-signal "just works" > >> for processes owned by different user, with no special code in proced. > >> > >> The simple patch is below. > > > > Thanks, but this should be at least conditioned on systems that have > > these commands available. MS-Windows, for example, has neither 'kill' > > nor 'renice', and the equivalents of 'kill' that I know about don't > > accept a signal ID as a command-line argument. > > The patch only changes call-process to process-file, to support file > handlers. Setting "kill" into proced-signal-function is a user > customization. Sorry, from my POV fixing something means making it work as correctly as we can reasonably do. If it didn't work correctly before, we should fix that as well, as part of any work on the relevant code. I understand that, if the doing TRT is complicated, it could be left to a separate patch, but in this case it isn't complicated at all. So let's fix this part of proced to work on all supported platforms, okay?