From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: Re: process-file instead of call-process in proced.el? Date: Fri, 25 Mar 2022 13:24:10 +0300 Message-ID: References: <835yo2cyj9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6814"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: winkler@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 25 11:25:52 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 1nXh8f-0001W3-In for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Mar 2022 11:25:51 +0100 Original-Received: from localhost ([::1]:52162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXh8b-0001o0-W8 for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Mar 2022 06:25:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXh7A-00017q-Dy for emacs-devel@gnu.org; Fri, 25 Mar 2022 06:24:16 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37341) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXh78-0004s3-EM; Fri, 25 Mar 2022 06:24:16 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 35BAD5C0217; Fri, 25 Mar 2022 06:24:13 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 25 Mar 2022 06:24:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=dVIY0qyYQQod99McDV8WRdh5Rknz0bN1xGtfEj 1mFUc=; b=W+mXuccLyR+RXC/OkMGDt3p9a5IxEK/bYBR4mXp8ehe7AsCbGNIUgw NhwVsitRNTLjNHq/hHRgTnjxirws7zSkKaivpPLsLiCdkUg0ghUa1vW8MRr5dPN+ wiupwVLfcMe8fQy7lDoHb5IgCvCzHdaxuq4dWHR2KdlMqBh1FArnxMiVMbcy3wAu tTDvAMq/7jTVbhyH4C6svfWr+C0agCgvUzdUqXyZjVkqL/Tl51GCtl4AJYaQ3DKj p9hbIADiZXuWrUOLpzHqG8wy4YyOip5jN3r0g4o+KugYb0T1D36HmTRyorDVV8AJ VGYcaAvAivq32u3PzhvOPrP98ibZL+AA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=dVIY0qyYQQod99McD V8WRdh5Rknz0bN1xGtfEj1mFUc=; b=R1q1KsjMx0KrhEvHkNnjMKLSnZZztDpow AdyAUNUKsEls5cfxRChXe1XXDrxkpFA9kyIb1YTJ5NxnTpGf2tkSb6pquEjmvCRo Vh7nl4N4QIe+j93YReJrFp2yRwwY8k9g8jptL1ak3Myir+SnKuKYcx5qam3dufKH 1a2uSOjppc4CHvFqxEAQLmX3Pw6W1EUlMuDZuXgWaXOjliW/NHA/ZsjSjXT41jDF bz5JuNZq30ynEAzRZmk2+VxzQimtpcUyKjMMwURA/yIOOkEpnmCXBnFcfcwGYfgd 9dxgxXuN3i4YJJTk50zUtnd1C2Y4R35CZm0L18OfXlxNSKi4MTVGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudehuddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf grthhtvghrnhepvdevkeffvdeuvefhuddtjeehkedvueefveettddtveduudfgieffieev ieevhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epfhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 25 Mar 2022 06:24:12 -0400 (EDT) In-Reply-To: <835yo2cyj9.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 25 Mar 2022 09:54:34 +0300") Received-SPF: pass client-ip=66.111.4.28; envelope-from=fgunbin@fastmail.fm; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:287443 Archived-At: 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. Thanks.