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: master ed84f24a21: Make `signal-process' allow completing over signal names Date: Mon, 27 Jun 2022 14:36:13 +0300 Message-ID: <83h7468hjm.fsf@gnu.org> References: <165627647702.21409.11158107897633930882@vcs2.savannah.gnu.org> <20220626204757.57AB1C01685@vcs2.savannah.gnu.org> <87ilomewbp.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38709"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, larsi@gnus.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 27 13:37:47 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 1o5n3r-0009us-At for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Jun 2022 13:37:47 +0200 Original-Received: from localhost ([::1]:37780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5n3q-0006UX-8j for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Jun 2022 07:37:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5n2L-0004uq-2Z for emacs-devel@gnu.org; Mon, 27 Jun 2022 07:36:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5n2K-0002g1-Kq; Mon, 27 Jun 2022 07:36:12 -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=bcusPO36JZeWyuXRJ5NH2WEyXMpc5HPysmk1tE5JxkI=; b=Uu0CRA1NO+5M C/2Gq+PpvMCM15TrPkwWOzEn5/SFzlnXq2ArOAfnH5UlnjiRVUyzm7RqIZYFEKmAdgmHdaTMa6BQt 9Dxwve+Rwo97jOj5GvU3FdpvDYwQkAeD2WyPN57xctuwtwgPTAMZpgneGgqxGBsA4fXrnEZCBmcSF 9y4GaPETdX8w4xaRnrNBzaiHk2Le2TD6zLfiL41sDCMZYLAzGATVThbt5jeWrs+Hto1UNLXhrUEsS 6I0Lk02/BpZjctbr0YopK6PgAxstraXkICoPl9M7QTqDzXkuYpW0EpkgydDQoiwd8zy3WB6JRJGct NF7eAJR4EtLVUuUwkIKZ6g==; Original-Received: from [87.69.77.57] (port=4364 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 1o5n2K-0000dz-3g; Mon, 27 Jun 2022 07:36:12 -0400 In-Reply-To: <87ilomewbp.fsf@yahoo.com> (message from Po Lu on Mon, 27 Jun 2022 09:20:26 +0800) 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:291656 Archived-At: > From: Po Lu > Cc: Lars Ingebrigtsen > Date: Mon, 27 Jun 2022 09:20:26 +0800 > > Lars Ingebrigtsen writes: > > > +DEFUN ("signal-names", Fsignal_names, Ssignal_names, 0, 0, 0, > > + doc: /* Return a list of known signal names on this system. */) > > + (void) > > +{ > > + char name[SIG2STR_MAX]; > > + Lisp_Object names = Qnil; > > + for (int i = 0; i < 255; ++i) > > + { > > + if (!sig2str (i, name)) > > + { > > + names = Fcons (build_string (name), names); > > + } > > + } > > + return names; > > +} > > + > > Shouldn't the "255" be NSIG instead? And what about systems where POSIX > signal handling doesn't really apply, such as MS Windows and MS-DOS? I admit that I don't understand the purpose and the intended uses of this new primitive. Is it there only for signal-process or more generally for read-signal-name or even more generally for providing the exhaustive list of names of all the signals known to the OS? If it's only for signal-process, then is it really useful to produce a completion table of 63 or 255 signal names, quite a few of which cannot be usefully delivered to another process? Perhaps it would be better to have a much shorter (system-dependent) list of signals that can be delivered to processes on each system? IOW, if this is supposed to be a convenience feature, then why not provide the user with a convenient short list of signals that he/she would reasonably consider delivering, and leave the rest to numbers?