From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: john muhl Newsgroups: gmane.emacs.bugs Subject: bug#74235: [PATCH] ; Remove 'nil' from some 'lua-ts-mode' options Date: Sun, 10 Nov 2024 08:48:39 -0600 Message-ID: <87y11r87qw.fsf@pub.pink> References: <8734k4xdon.fsf@pub.pink> <87ses4vyzp.fsf@pub.pink> <86y11vr3e5.fsf@gnu.org> <87ldxtn57i.fsf@pub.pink> <86ses1oijv.fsf@gnu.org> <87ikswi0vc.fsf@pub.pink> <86r07jlk3j.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18820"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.1; emacs 31.0.50 Cc: 74235@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 10 15:49:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tA9Fi-0004iM-06 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Nov 2024 15:49:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tA9FU-0001sD-Cr; Sun, 10 Nov 2024 09:49:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tA9FP-0001s1-01 for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 09:49:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tA9FO-0007Tp-FL for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 09:49:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=NH9FK9nw2e7x7LQ/EEWxjg93zPlxd0sGNZZAh2fWy4w=; b=rxwzvex8nLJUS/UQff4gUgqwatC8WAXNb0mSgP1wcXSjSf1kCfsQ7o9G1yRscmBXXxoYzbTNRv600+FEV9QI1xld8oydHaECMXKdDdyGQtmHTYoc/dWtfWWs7f8VoXGlhphPLFkpddHn2bCjiShCXNOjAkbG/uNb+2rsgCKRnbRCYtsbqD6EW8inBFBdG2+I4ZySAE5DmjR/NVnUtbVTtVb+mMCpPDqZ6djsoYe7GVIRWn/jMgZ3zXttK4h545JcWY5J4l89mtD4X0rLZcivEh5HKiMx0nyelXMlY8QHOOeN/rRRsKe0ezIDtrx/pHBxGuXIeX17F14fwS1b0SMbJw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tA9FO-0005Wy-9r for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 09:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: john muhl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Nov 2024 14:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74235 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74235-submit@debbugs.gnu.org id=B74235.173125013021241 (code B ref 74235); Sun, 10 Nov 2024 14:49:02 +0000 Original-Received: (at 74235) by debbugs.gnu.org; 10 Nov 2024 14:48:50 +0000 Original-Received: from localhost ([127.0.0.1]:56277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tA9FB-0005WW-VJ for submit@debbugs.gnu.org; Sun, 10 Nov 2024 09:48:50 -0500 Original-Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]:58443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tA9F9-0005WF-6S for 74235@debbugs.gnu.org; Sun, 10 Nov 2024 09:48:48 -0500 Original-Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 67C8525400F2; Sun, 10 Nov 2024 09:48:41 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Sun, 10 Nov 2024 09:48:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1731250121; x=1731336521; bh=NH9FK9nw2e 7x7LQ/EEWxjg93zPlxd0sGNZZAh2fWy4w=; b=cSM85UjpqVzeaUVtRetNiXGJvR 9eH0jT7wHSPNPWhcNqJlF1W2TuRoCMvoFgcmtZ7Ms2uqbkxLiQ2EN/ypaBXgIenz SNUBhA5GP7j3r2pWHMgLTAmliuFHOyppxZQdrpOU2smjzK3eUpW1vRZiyWhPMSDh aiTw5CbG0jcRO9VzSh3vfINm0KZ3jnEOGtySY/VguCUmkk5u94H6oJsM48V6Sxo+ H9d6tf4S/V5vgS2bnjc11kSDuMMtnThT//1Ky9Ac2ofHYaySa5ypULUHdc9mFQOB OUWLWEktBlV7KPW1TsnzLwheI+Lq/QSZBKmn3Zi2eIYIoGFYfA/jB0gRJWSw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1731250121; x=1731336521; bh=NH9FK9nw2e7x7LQ/EEWxjg93zPlxd0sGNZZ Ah2fWy4w=; b=IFutub1iSdU5n26RZ+42Y41y9BOQJftle5o/FbAfleGGGbqzcUZ cmfbFLtPe5Lu9zqlNRlLajzEaOkwOabEKBT9W7Vuwuj13i8XmWyyxJRUyUarlUmB h1oxlkVm3wHnAwCQ/fCWBOxH7cJ3fPgaI4i3lDTr2PmkF+Ll/qcDe8AL8FRU+t8E qRw5e0tLYyH5jex9YTilDlIzzYOYmkSn0hrDO4Q76vtCrAQHIVtFCRihHQWd1P3e pKi7anIJxh9gUJuTxZoBFsa2VdNt+vUsRWdQ14nDJD0idqaZbHNKQYklDVXrUvK6 Z4vIzC9V0aQHr/2BsjUnRjrkamjREL/yH2w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufgjfhgffffkgggtsehmtderredtreejnecu hfhrohhmpehjohhhnhcumhhuhhhluceojhhmsehpuhgsrdhpihhnkheqnecuggftrfgrth htvghrnhepheekieduffevhfeileeuudelledvtdejvedtteeggfeilefhheeikeelfeff ffetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjh hmsehpuhgsrdhpihhnkhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhht pdhrtghpthhtohepjeegvdefheesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtth hopegvlhhiiiesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i74194916:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 10 Nov 2024 09:48:40 -0500 (EST) In-Reply-To: <86r07jlk3j.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 10 Nov 2024 07:43:28 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295189 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: john muhl >> Cc: 74235@debbugs.gnu.org >> Date: Sat, 09 Nov 2024 14:54:47 -0600 >>=20 >> + (if (or (not lua-ts-inferior-program) >> + (not (executable-find lua-ts-inferior-program))) >> + (user-error "You must set `lua-ts-inferior-program' to use this c= ommand") > > The text of user-error should say something about being unable to find > the program, not just about the variable being nil, since you use > executable-find. > > Otherwise, LGTM, thanks. I guess the executable-find check is redundant anyway since comint/process will tell you =E2=80=9CSearching for program: No such file or directory, luaz=E2=80=9D if you get it wrong. Thanks again. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-some-lua-ts-mode-options-Bug-74235.patch >From b170e406f834806842761726de47ca3afeb05cfe Mon Sep 17 00:00:00 2001 From: john muhl Date: Sat, 9 Nov 2024 11:01:45 -0600 Subject: [PATCH] ; Fix some 'lua-ts-mode' options (Bug#74235) * lisp/progmodes/lua-ts-mode.el (lua-ts-luacheck-program): (lua-ts-inferior-program): Switch to 'file' type and remove 'nil' as a choice. (lua-ts-inferior-lua): Ensure 'lua-ts-inferior-program' is set. --- lisp/progmodes/lua-ts-mode.el | 84 ++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 4ea453c9b65..a7763377177 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -72,7 +72,7 @@ lua-ts-indent-offset (defcustom lua-ts-luacheck-program "luacheck" "Location of the Luacheck program." - :type '(choice (const :tag "None" nil) string) + :type 'file :version "30.1") (defcustom lua-ts-inferior-buffer "*Lua*" @@ -83,7 +83,7 @@ lua-ts-inferior-buffer (defcustom lua-ts-inferior-program "lua" "Program to run in the inferior Lua process." - :type '(choice (const :tag "None" nil) string) + :type 'file :version "30.1") (defcustom lua-ts-inferior-options '("-i") @@ -632,47 +632,49 @@ lua-ts-flymake-luacheck (defun lua-ts-inferior-lua () "Run a Lua interpreter in an inferior process." (interactive) - (unless (comint-check-proc lua-ts-inferior-buffer) - (apply #'make-comint-in-buffer - (string-replace "*" "" lua-ts-inferior-buffer) - lua-ts-inferior-buffer - lua-ts-inferior-program - lua-ts-inferior-startfile - lua-ts-inferior-options) - (when lua-ts-inferior-history + (if (not lua-ts-inferior-program) + (user-error "You must set `lua-ts-inferior-program' to use this command") + (unless (comint-check-proc lua-ts-inferior-buffer) + (apply #'make-comint-in-buffer + (string-replace "*" "" lua-ts-inferior-buffer) + lua-ts-inferior-buffer + lua-ts-inferior-program + lua-ts-inferior-startfile + lua-ts-inferior-options) + (when lua-ts-inferior-history (set-process-sentinel (get-buffer-process lua-ts-inferior-buffer) 'lua-ts-inferior--write-history)) - (with-current-buffer lua-ts-inferior-buffer - (setq-local comint-input-ignoredups t - comint-input-ring-file-name lua-ts-inferior-history - comint-prompt-read-only t - comint-prompt-regexp (rx-to-string `(: bol - ,lua-ts-inferior-prompt - (1+ space)))) - (comint-read-input-ring t) - (add-hook 'comint-preoutput-filter-functions - (lambda (string) - (if (equal string (concat lua-ts-inferior-prompt-continue " ")) - string - (concat - ;; Filter out the extra prompt characters that - ;; accumulate in the output when sending regions - ;; to the inferior process. - (replace-regexp-in-string (rx-to-string - `(: bol - (* ,lua-ts-inferior-prompt - (? ,lua-ts-inferior-prompt) - (1+ space)) - (group (* nonl)))) - "\\1" string) - ;; Re-add the prompt for the next line. - lua-ts-inferior-prompt " "))) - nil t))) - (select-window (display-buffer lua-ts-inferior-buffer - '((display-buffer-reuse-window - display-buffer-pop-up-window) - (reusable-frames . t)))) - (get-buffer-process (current-buffer))) + (with-current-buffer lua-ts-inferior-buffer + (setq-local comint-input-ignoredups t + comint-input-ring-file-name lua-ts-inferior-history + comint-prompt-read-only t + comint-prompt-regexp (rx-to-string `(: bol + ,lua-ts-inferior-prompt + (1+ space)))) + (comint-read-input-ring t) + (add-hook 'comint-preoutput-filter-functions + (lambda (string) + (if (equal string (concat lua-ts-inferior-prompt-continue " ")) + string + (concat + ;; Filter out the extra prompt characters that + ;; accumulate in the output when sending regions + ;; to the inferior process. + (replace-regexp-in-string + (rx-to-string `(: bol + (* ,lua-ts-inferior-prompt + (? ,lua-ts-inferior-prompt) + (1+ space)) + (group (* nonl)))) + "\\1" string) + ;; Re-add the prompt for the next line. + lua-ts-inferior-prompt " "))) + nil t))) + (select-window (display-buffer lua-ts-inferior-buffer + '((display-buffer-reuse-window + display-buffer-pop-up-window) + (reusable-frames . t)))) + (get-buffer-process (current-buffer)))) (defun lua-ts-send-buffer () "Send current buffer to the inferior Lua process." -- 2.47.0 --=-=-=--