From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Jun 2024 07:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 71374@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1717571670601 (code B ref -1); Wed, 05 Jun 2024 07:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jun 2024 07:14:30 +0000 Received: from localhost ([127.0.0.1]:36043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEkqq-00009Z-Tb for submit@debbugs.gnu.org; Wed, 05 Jun 2024 03:14:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:44344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEkqn-000095-3V for submit@debbugs.gnu.org; Wed, 05 Jun 2024 03:14:27 -0400 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 1sEkYs-0001Ah-00 for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 02:55:54 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEkYp-0005KB-0L for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 02:55:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2B590240027 for ; Wed, 5 Jun 2024 08:55:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1717570547; bh=lnig+xxjrkO8chI1zxJfJtoTYJvPltKjLOgq8MAl0Mc=; h=From:To:Subject:OpenPGP:Date:Message-ID:MIME-Version:Content-Type: From; b=Mr4E3ifeLPdB/CjSInIJ/AT9UGBZXkD0a8u8Q1iuWwkXsKIgwYAtaeRNdP6dDoeCL RThFkBfQqJROEGTGjA6XjPnybxHW6a1VuIr1ajo2BIQAsFXw3+h8qx3ATskTF94EiT FszR90xT+8SgZoEBF/x86tmQwK2GsHVilRSbwJJX3ed+goyNtmKnZIXXgh3viBDztW ZuhLPOghEvjBcC8utrdg6StOnaJDpv41Ke3UKw+XHjfLk/TTnPbKlaR8Eqchenkw5p t/3l6KfgWDozjqNO9uM6RRyVIPubvB2lMrqWafiLVuzA7AhKyVVPGVAp+DbNVuilHK rjtyMTmkRdAOA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VvJBp4Bfyz6txr for ; Wed, 5 Jun 2024 08:55:46 +0200 (CEST) From: Philip Kaludercic OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Wed, 05 Jun 2024 06:55:46 +0000 Message-ID: <87ikync1zh.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain The main issue with this patch is that it drops the syntax highlighting in the *string edit* buffer, but we could fix that in a second patch by adding support to specify a major mode to inherit from when editing a string. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Simplify-'help-enable-variable-value-editing'-usin.patch Content-Description: [PATCH] Simplify 'help-enable-variable-value-editing' using >From fa1fff88e295bee0380665d623a6266842f91af6 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 5 Jun 2024 08:26:37 +0200 Subject: [PATCH] Simplify 'help-enable-variable-value-editing' using 'string-edit' * lisp/help-fns.el (help-fns--edit-variable): Remove variable declaration, as 'string-edit' makes manually storing the variable name unnecessary. (help-fns-edit-variable): Use 'read-string-from-buffer' instead of custom major mode. (help-fns--edit-value-mode-map, help-fns--edit-value-mode) (help-fns-edit-mode-done, help-fns-edit-mode-cancel): Remove functionality provided by 'string-edit'. --- lisp/help-fns.el | 55 ++++++------------------------------------------ 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1ffe1b16588..8ea5b301684 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1502,60 +1502,19 @@ help-fns--editable-variable :parent button-map "e" #'help-fns-edit-variable))))) -(defvar help-fns--edit-variable) - (put 'help-fns-edit-variable 'disabled t) (defun help-fns-edit-variable () "Edit the variable under point." (declare (completion ignore)) (interactive) - (let ((var (get-text-property (point) 'help-fns--edit-variable))) - (unless var + (let* ((val (thing-at-point 'sexp)) + (var (get-text-property 0 'help-fns--edit-variable val))) + (unless val (error "No variable under point")) - (pop-to-buffer-same-window (format "*edit %s*" (nth 0 var))) - (prin1 (nth 1 var) (current-buffer)) - (pp-buffer) - (goto-char (point-min)) - (help-fns--edit-value-mode) - (insert (format ";; Edit the `%s' variable.\n" (nth 0 var)) - (substitute-command-keys - ";; `\\[help-fns-edit-mode-done]' to update the value and exit; \ -`\\[help-fns-edit-mode-cancel]' to cancel.\n\n")) - (setq-local help-fns--edit-variable var))) - -(defvar-keymap help-fns--edit-value-mode-map - "C-c C-c" #'help-fns-edit-mode-done - "C-c C-k" #'help-fns-edit-mode-cancel) - -(define-derived-mode help-fns--edit-value-mode emacs-lisp-mode "Elisp" - :interactive nil) - -(defun help-fns-edit-mode-done (&optional kill) - "Update the value of the variable being edited and kill the edit buffer. -If KILL (the prefix), don't update the value, but just kill the -current buffer." - (interactive "P" help-fns--edit-value-mode) - (unless help-fns--edit-variable - (error "Invalid buffer")) - (goto-char (point-min)) - (cl-destructuring-bind (variable _ buffer help-buffer) - help-fns--edit-variable - (unless (buffer-live-p buffer) - (error "Original buffer is gone; can't update")) - (unless kill - (let ((value (read (current-buffer)))) - (with-current-buffer buffer - (set variable value)))) - (kill-buffer (current-buffer)) - (when (buffer-live-p help-buffer) - (with-current-buffer help-buffer - (revert-buffer))))) - -(defun help-fns-edit-mode-cancel () - "Kill the edit buffer and cancel editing of the value. -This cancels value editing without updating the value." - (interactive nil help-fns--edit-value-mode) - (help-fns-edit-mode-done t)) + (let ((str (read-string-from-buffer + (format ";; Edit the `%s' variable." (nth 0 var)) + (prin1-to-string (nth 1 var))))) + (set (nth 0 var) (read str))))) (defun help-fns--run-describe-functions (functions &rest args) (with-current-buffer standard-output -- 2.45.1 --=-=-= Content-Type: text/plain -- Philip Kaludercic on peregrine --=-=-=-- From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Jun 2024 12:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Philip Kaludercic Cc: 71374@debbugs.gnu.org Received: via spool by 71374-submit@debbugs.gnu.org id=B71374.171759027213410 (code B ref 71374); Wed, 05 Jun 2024 12:25:03 +0000 Received: (at 71374) by debbugs.gnu.org; 5 Jun 2024 12:24:32 +0000 Received: from localhost ([127.0.0.1]:57509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEpgt-0003UB-Ho for submit@debbugs.gnu.org; Wed, 05 Jun 2024 08:24:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEpgp-0003TO-DT for 71374@debbugs.gnu.org; Wed, 05 Jun 2024 08:24:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEpcJ-0000Hq-P1; Wed, 05 Jun 2024 08:19:47 -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=8HjwwUj3ccXC9n+y8OxlR+V3A+KHU9xhbzdX7I/JUrs=; b=WQOZJE0fpOpJ IHJGiB31priRLQvY5GWyNHZgQ1c26WwWs5Un4JGfT1nUv7MTcDvG1eWqwyiesXhokbGWZFrWBQveR OTzN4qxLji5ypsQU/s7TPeuJqMJssuSwN7lMBnEutVJ7XRi4KjABbL3YtWZRhl67rCSza1TVthkvc dvp6dt6blP+4VFXiW+5wJX9futlPBI335g/t6pF6EeAgRVFl1vaV6kOmNqZ/PlCTxfq1KosLWrhPB dOwEw/xE4p70XgKUYqxJQINLM98LZoNMnDqHtl7Hg5RmymtelzO3/pyf8Os+x9RAD4Jn5ZwtM8aos MS8ffaBl1y+1/33TMr2v/w==; Date: Wed, 05 Jun 2024 15:19:39 +0300 Message-Id: <86frtrk2ec.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ikync1zh.fsf@posteo.net> (message from Philip Kaludercic on Wed, 05 Jun 2024 06:55:46 +0000) References: <87ikync1zh.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Date: Wed, 05 Jun 2024 06:55:46 +0000 > > The main issue with this patch is that it drops the syntax highlighting > in the *string edit* buffer, but we could fix that in a second patch by > adding support to specify a major mode to inherit from when editing a > string. Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong with the current implementation, right? If so, I'd prefer to wait with this until after the emacs-30 branch is cut. From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Jun 2024 06:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 71374@debbugs.gnu.org Received: via spool by 71374-submit@debbugs.gnu.org id=B71374.17176549983958 (code B ref 71374); Thu, 06 Jun 2024 06:24:02 +0000 Received: (at 71374) by debbugs.gnu.org; 6 Jun 2024 06:23:18 +0000 Received: from localhost ([127.0.0.1]:41674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sF6Wr-00011l-VU for submit@debbugs.gnu.org; Thu, 06 Jun 2024 02:23:18 -0400 Received: from mout01.posteo.de ([185.67.36.65]:60191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sF6Wp-00011D-FV for 71374@debbugs.gnu.org; Thu, 06 Jun 2024 02:23:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9A628240027 for <71374@debbugs.gnu.org>; Thu, 6 Jun 2024 08:22:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1717654974; bh=7DTtVQVYQbv3KLk4NRiNW73WXRwCdEqki61lGBPa+sw=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=UXb0+MDsOzCOj7aFcFQUtc2KRT96uDsJnvA3mVuCqzpQE/x43SmXIu4MHcpvQMep5 YQdJtvp36PStxTj/Sfl22XsU5lRkjv0OLsHLssYq+fd3/JCN3G0Wen+TQA/TkMjS68 853ooSbafeAcolUwGNSHnDug2wvrbJ0+1NGAmWFAjR2asPKehetyYlwHh2qsLkTBQ1 SSsB8fzMCdYKcKAp9I6jOyGaGKipayPY0Gb8gHYuf6YufpnS0T/oKURMtyTq9ugVvn DX/uKLD3R/K1ja8zk78WETfaSxnsoPauS6Us1pNYivsKiRSTjQ7SR4i3+qadXPjJ/0 veDVenXb7AdvQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VvvQQ0DYyz9rxM; Thu, 6 Jun 2024 08:22:54 +0200 (CEST) From: Philip Kaludercic In-Reply-To: <86frtrk2ec.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 05 Jun 2024 15:19:39 +0300") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Thu, 06 Jun 2024 06:22:53 +0000 Message-ID: <8734pqbneq.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Date: Wed, 05 Jun 2024 06:55:46 +0000 >> >> The main issue with this patch is that it drops the syntax highlighting >> in the *string edit* buffer, but we could fix that in a second patch by >> adding support to specify a major mode to inherit from when editing a >> string. > > Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong > with the current implementation, right? If so, I'd prefer to wait > with this until after the emacs-30 branch is cut. Right, it just seemed like the kind of thing where it would be natural to demonstrate string-edit. -- Philip Kaludercic on peregrine From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jun 2024 05:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Philip Kaludercic Cc: Eli Zaretskii , 71374@debbugs.gnu.org Received: via spool by 71374-submit@debbugs.gnu.org id=B71374.171972598515437 (code B ref 71374); Sun, 30 Jun 2024 05:40:01 +0000 Received: (at 71374) by debbugs.gnu.org; 30 Jun 2024 05:39:45 +0000 Received: from localhost ([127.0.0.1]:54503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNnHt-00040v-9b for submit@debbugs.gnu.org; Sun, 30 Jun 2024 01:39:45 -0400 Received: from mail-ed1-f54.google.com ([209.85.208.54]:49446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNnHq-00040m-Uk for 71374@debbugs.gnu.org; Sun, 30 Jun 2024 01:39:43 -0400 Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-585e6ad9dbcso2123613a12.3 for <71374@debbugs.gnu.org>; Sat, 29 Jun 2024 22:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719725922; x=1720330722; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=cIf0ls6ah4BmWTCkh/kmo0KKsohSAxWAjzvibjq5tUw=; b=LQB7Y3PQF4/SQyrNsbtz/AmdJ2iicEoXySq/6nw+dD4vSGsX8W7B4qnJGOR3O8mxUq mkfE1suGdFRnhIdNl9/K5HnTki9DnCHp9Z6jRWJStd0AYna2y34vWRgfPLqqlQB+Pjez Bl4Ec41BipoKbsBaGEJJIpIb9tnPd2fmMAUQz1nOw/oQT2iVqlx3mz4qFZeMflVPO667 8iuo2209+SRuvMyZPsti+ljclbLT8A952qaFDL4VC/8HezCPwijYoNqreYUgEp3wApBK nbdm2AmlwsNI3wjf4DRQS3oeKBT0yoP6uHKczL6VZ7ZBAOTdwnuRDk+0seSYe+tA37Cv nYow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719725922; x=1720330722; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cIf0ls6ah4BmWTCkh/kmo0KKsohSAxWAjzvibjq5tUw=; b=TBwTidurG0AQTCZqFufdfX9Eq1/5bbTo7tinfO2cbAPqWpVL8KNjGYsmhN9vP8vp1v Y2odJzjIJ31PPmFQ7dQSPc5us4RvwuArTJQSNSG9hfbYnY99i8FwWH/WI0ye3b+Z4Ckp zRAY1vPI7juoft64jSPSdTNCRKlq2ZKYzF37gOdO8fCwZNNiVAtdWiWHvnXrkxnwZc92 Ovg3rFPDFinwqBLBnxxSy107BykBFy2HNlsv+7iloIiXA3wd2CWX/XghzB5CVkjXSJS3 RybYNJqqJXU0ShcCetiVnliIUxZDmTlvNq7b1bNODr0ptJQh2zui6EAqTY4wYULdG0aG CP+A== X-Forwarded-Encrypted: i=1; AJvYcCWSDGR1K4TEyWONMY+53ApeZe/192X9OxXy0sAokC9TRTuG6B3ggoi1gPgE0QIa7pbyH+bJDrSKbFrBoiwhZVLc85uKyWQ= X-Gm-Message-State: AOJu0YwcWKUrhIoPhrxOEru8KEuMfJpoMOFmdEUfVu+UXfjuDFqbunCg zj4eX4z7u5MKDp8KPDCCZ7Pch8uANIQAp1eQ35HArJtFYTI61n+7yp0v1vRVuBSzNGmCho/6SE2 RjaP/Ab3zqBPr/BBuU+ADxUTrLy0= X-Google-Smtp-Source: AGHT+IFU8ezpyTdzm0KRZzmnhPTz43/VP16uN6m3Ku8Xzxzp3QKOf23byEWIZnsGyALLuxbfjYQqt/LQrYv9QbH4KcY= X-Received: by 2002:a05:6402:280a:b0:587:2dd0:93ec with SMTP id 4fb4d7f45d1cf-587a091a355mr1761441a12.30.1719725922377; Sat, 29 Jun 2024 22:38:42 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 29 Jun 2024 22:38:42 -0700 From: Stefan Kangas In-Reply-To: <8734pqbneq.fsf@posteo.net> (Philip Kaludercic's message of "Thu, 06 Jun 2024 06:22:53 +0000") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> <8734pqbneq.fsf@posteo.net> MIME-Version: 1.0 Date: Sat, 29 Jun 2024 22:38:42 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philip Kaludercic writes: > Eli Zaretskii writes: > >>> From: Philip Kaludercic >>> Date: Wed, 05 Jun 2024 06:55:46 +0000 >>> >>> The main issue with this patch is that it drops the syntax highlighting >>> in the *string edit* buffer, but we could fix that in a second patch by >>> adding support to specify a major mode to inherit from when editing a >>> string. >> >> Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong >> with the current implementation, right? If so, I'd prefer to wait >> with this until after the emacs-30 branch is cut. > > Right, it just seemed like the kind of thing where it would be natural > to demonstrate string-edit. Feel free to install on master now, thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 01:39:54 2024 Received: (at control) by debbugs.gnu.org; 30 Jun 2024 05:39:55 +0000 Received: from localhost ([127.0.0.1]:54506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNnI2-00041O-L1 for submit@debbugs.gnu.org; Sun, 30 Jun 2024 01:39:54 -0400 Received: from mail-lj1-f182.google.com ([209.85.208.182]:57690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNnI1-000417-5D for control@debbugs.gnu.org; Sun, 30 Jun 2024 01:39:53 -0400 Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2ebe40673d8so25115971fa.3 for ; Sat, 29 Jun 2024 22:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719725927; x=1720330727; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=NhSL3QggB0qZfh7WvckFmlpedDP2C0tFRl8FlFu0ysI=; b=eRL/a5DieTJ5eT3Ehq5f446BqSEpgHu2d0j5Kfn6dxGU4hTHpulEazUllTC4WfIpAT vHpVXxA/YggUW4FIS878inYUz1gm6Per2nIucYcUQLigs2gyU1XFXgxfIvj1Jej6G9mH LjywFrAmtFAbLanizO5Jft4NUmTFraYwq+gf6W6g2aP0KWzjmRahgt+6xnw76ZKKi6mC Q80qH40gqEpg3ZqFgcIwZ5sHzeW+JoIV9Cdbk3LYSHbMylAV4VENPRtLA4b2XFNXx2Pt MDIuhhelXyC70nQwsd+vHldyZb7v+45YXRCYsXRLBgG8yH0/jxxJCMA8E7DETrgtlg1D T3SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719725927; x=1720330727; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=NhSL3QggB0qZfh7WvckFmlpedDP2C0tFRl8FlFu0ysI=; b=kHAWv3vimdjIhETIxg9cE66Sw2O/bL4CLng1uA3WJ0JKTGR2eHe7yfI5ZtHwKGmW/v JzUafAEqZfM4JokmGmjquhaIZ/ffwf3kMDrAAlRNzlLXo6K4lKZLax3FDZtVc6P4A/eu vkaZA6pvFYGB12FIzH5SeF67Bk97d+thVUgAwYJaE7mSaj9zOJ8bPXUzJduGxVDxlVZx TnekZJnrsxF6ZEFCDdXYwi4y5DIthA+6+B9fzUt6wNRSv/tPFuLmylnMYGV4sgHBHbl0 JVcxvUCPn6C+HsBMarHgpTkfoT+M69SV0TQV/dOdCWZufgeNPU7XcmrKpypyTZgJXqQz MFXQ== X-Gm-Message-State: AOJu0YxbBpY+FdKBi4ZNiRu3bIpL09up+fTx96tTrDEMGPfJSfafTY1h 0gWVSBXIapcWw8S9B+vJkDmekEvZ/xtM9dEBbKxdXrFjRTrX+U85U3awyncdi6jQgkmYrHnKgEX 6qBhk5TJ2YWYjdOZ9oVe1jQVmTZDYT2tUefk= X-Google-Smtp-Source: AGHT+IFOnLc6Ajtv3orl8Dgs7lY3DYDleUT9X2XKlUVaba+uUZu5y6LrN+4lLRwifexFCwNqV0bniPvkynoVIANwHhc= X-Received: by 2002:a2e:701a:0:b0:2ec:5bb2:c236 with SMTP id 38308e7fff4ca-2ee5e4c7a66mr12980721fa.33.1719725927440; Sat, 29 Jun 2024 22:38:47 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 29 Jun 2024 22:38:47 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Sat, 29 Jun 2024 22:38:47 -0700 Message-ID: Subject: control message for bug #71374 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 71374 wishlist quit From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Jeremy Bryant Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jul 2024 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Kangas Cc: Philip Kaludercic , Eli Zaretskii , 71374@debbugs.gnu.org Received: via spool by 71374-submit@debbugs.gnu.org id=B71374.172090764222024 (code B ref 71374); Sat, 13 Jul 2024 21:55:01 +0000 Received: (at 71374) by debbugs.gnu.org; 13 Jul 2024 21:54:02 +0000 Received: from localhost ([127.0.0.1]:56905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSkgs-0005jA-Ae for submit@debbugs.gnu.org; Sat, 13 Jul 2024 17:54:02 -0400 Received: from out-186.mta1.migadu.com ([95.215.58.186]:23083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSkgp-0005if-Sj for 71374@debbugs.gnu.org; Sat, 13 Jul 2024 17:54:01 -0400 X-Envelope-To: 71374@debbugs.gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeremybryant.net; s=key1; t=1720907602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JOwl4EpBaLuf2V2bh8+DoRFAfy70l9xsByT6IHfkZEY=; b=E1GOeQ/Os28cOSuUn7PK98Yw18feW+Av1lOaFepHPq2wOrClczFfUZN8a7jktXus0PLGEy bxxRdnAmDQUCm1fWQpKrRjuAGMFmFwCvdoeYD96lb49pxjE/ifcg+VGJFbUxCQ0QCffUAc l5B7xYMS8t/PV2zhaCmeTsbtuPJb8tODSLOI3pdxelWKsTbRaHTLHK9wRgQk/UHehywKEi EIgaEXdHzRg8+SmmSLmhZygBK88PNRMvlTw2qvmZnZmvM9LVd0DxUNLUbVJyvA7DOFiSMg Fpljd5ms9CV811FXIOCWg9duNjrOWh+vMGs4upcFGl4ewS9nPO1JCrbstsCwpQ== X-Envelope-To: eliz@gnu.org X-Envelope-To: philipk@posteo.net X-Envelope-To: stefankangas@gmail.com X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Jeremy Bryant In-Reply-To: (Stefan Kangas's message of "Sat, 29 Jun 2024 22:38:42 -0700") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> <8734pqbneq.fsf@posteo.net> Date: Sat, 13 Jul 2024 22:53:20 +0100 Message-ID: <871q3xklgv.fsf@jeremybryant.net> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Stefan Kangas writes: > Philip Kaludercic writes: > >> Eli Zaretskii writes: >> >>>> From: Philip Kaludercic >>>> Date: Wed, 05 Jun 2024 06:55:46 +0000 >>>> >>>> The main issue with this patch is that it drops the syntax highlighting >>>> in the *string edit* buffer, but we could fix that in a second patch by >>>> adding support to specify a major mode to inherit from when editing a >>>> string. >>> >>> Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong >>> with the current implementation, right? If so, I'd prefer to wait >>> with this until after the emacs-30 branch is cut. >> >> Right, it just seemed like the kind of thing where it would be natural >> to demonstrate string-edit. > > Feel free to install on master now, thanks. Philip, has this been installed on master? Can the bug be closed? From unknown Sun Jun 22 04:31:33 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Philip Kaludercic Subject: bug#71374: closed (Re: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using) Message-ID: References: <87msm1pvsj.fsf@posteo.net> <87ikync1zh.fsf@posteo.net> X-Gnu-PR-Message: they-closed 71374 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 71374@debbugs.gnu.org Date: Sun, 28 Jul 2024 12:05:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1722168302-25710-1" This is a multi-part message in MIME format... ------------=_1722168302-25710-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #71374: [PATCH] Simplify 'help-enable-variable-value-editing' using which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 71374@debbugs.gnu.org. --=20 71374: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71374 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1722168302-25710-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 71374-done) by debbugs.gnu.org; 28 Jul 2024 12:04:49 +0000 Received: from localhost ([127.0.0.1]:42765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sY2dt-0006gG-58 for submit@debbugs.gnu.org; Sun, 28 Jul 2024 08:04:49 -0400 Received: from mout01.posteo.de ([185.67.36.65]:45759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sY2dr-0006g2-23 for 71374-done@debbugs.gnu.org; Sun, 28 Jul 2024 08:04:47 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1C350240028 for <71374-done@debbugs.gnu.org>; Sun, 28 Jul 2024 14:04:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1722168269; bh=5mK7Y2bs911Y6RLGaBZMAlLHdb989vEaMN+MbC5dgc0=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=eZCZY4YSqrmjehWj6kwkV28M2Z4oThCrFZIZG78fWNuS11LO9XNRVencz9nBK94Gm d1dU0T8XNP+wGDjLHkN1BzEr3NwhIUmjYBXoCC6UD3T6uAKVkXfUAuF+4Kc9UjK3lW FJCliXHqDD5HFFPixBSVvinGye2+Zxfmy3ekZMnY/b0OAxySy3rUecSis26ts7hKdC 6ZV9CveRcTKUHPoYVi5HXvZGrA5zF0DzMbGBI/oiPrkxcOZCHr40wEzGkNIknbG1aY eupn+Jo6iVqpdXCJHuD8veZpWkzyD2Gi0Cr58l60FKm2y9g47XlcB0pSMG8DhVPUPm vn5/rWxXM/NFw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WX0XX40Drz6tm8; Sun, 28 Jul 2024 14:04:28 +0200 (CEST) From: Philip Kaludercic To: Jeremy Bryant Subject: Re: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using In-Reply-To: <871q3xklgv.fsf@jeremybryant.net> (Jeremy Bryant's message of "Sat, 13 Jul 2024 22:53:20 +0100") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> <8734pqbneq.fsf@posteo.net> <871q3xklgv.fsf@jeremybryant.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Sun, 28 Jul 2024 12:04:28 +0000 Message-ID: <87msm1pvsj.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: 71374-done Cc: Eli Zaretskii , Stefan Kangas , 71374-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.6 (-) Jeremy Bryant writes: > Stefan Kangas writes: > >> Philip Kaludercic writes: >> >>> Eli Zaretskii writes: >>> >>>>> From: Philip Kaludercic >>>>> Date: Wed, 05 Jun 2024 06:55:46 +0000 >>>>> >>>>> The main issue with this patch is that it drops the syntax highlighting >>>>> in the *string edit* buffer, but we could fix that in a second patch by >>>>> adding support to specify a major mode to inherit from when editing a >>>>> string. >>>> >>>> Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong >>>> with the current implementation, right? If so, I'd prefer to wait >>>> with this until after the emacs-30 branch is cut. >>> >>> Right, it just seemed like the kind of thing where it would be natural >>> to demonstrate string-edit. >> >> Feel free to install on master now, thanks. > > Philip, has this been installed on master? Can the bug be closed? I hadn't pushed the change, have done so now. Closing the report. Thanks for the reminder. -- Philip Kaludercic on peregrine ------------=_1722168302-25710-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Jun 2024 07:14:30 +0000 Received: from localhost ([127.0.0.1]:36043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEkqq-00009Z-Tb for submit@debbugs.gnu.org; Wed, 05 Jun 2024 03:14:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:44344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEkqn-000095-3V for submit@debbugs.gnu.org; Wed, 05 Jun 2024 03:14:27 -0400 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 1sEkYs-0001Ah-00 for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 02:55:54 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEkYp-0005KB-0L for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 02:55:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2B590240027 for ; Wed, 5 Jun 2024 08:55:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1717570547; bh=lnig+xxjrkO8chI1zxJfJtoTYJvPltKjLOgq8MAl0Mc=; h=From:To:Subject:OpenPGP:Date:Message-ID:MIME-Version:Content-Type: From; b=Mr4E3ifeLPdB/CjSInIJ/AT9UGBZXkD0a8u8Q1iuWwkXsKIgwYAtaeRNdP6dDoeCL RThFkBfQqJROEGTGjA6XjPnybxHW6a1VuIr1ajo2BIQAsFXw3+h8qx3ATskTF94EiT FszR90xT+8SgZoEBF/x86tmQwK2GsHVilRSbwJJX3ed+goyNtmKnZIXXgh3viBDztW ZuhLPOghEvjBcC8utrdg6StOnaJDpv41Ke3UKw+XHjfLk/TTnPbKlaR8Eqchenkw5p t/3l6KfgWDozjqNO9uM6RRyVIPubvB2lMrqWafiLVuzA7AhKyVVPGVAp+DbNVuilHK rjtyMTmkRdAOA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VvJBp4Bfyz6txr for ; Wed, 5 Jun 2024 08:55:46 +0200 (CEST) From: Philip Kaludercic To: bug-gnu-emacs@gnu.org Subject: [PATCH] Simplify 'help-enable-variable-value-editing' using OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Wed, 05 Jun 2024 06:55:46 +0000 Message-ID: <87ikync1zh.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain The main issue with this patch is that it drops the syntax highlighting in the *string edit* buffer, but we could fix that in a second patch by adding support to specify a major mode to inherit from when editing a string. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Simplify-'help-enable-variable-value-editing'-usin.patch Content-Description: [PATCH] Simplify 'help-enable-variable-value-editing' using >From fa1fff88e295bee0380665d623a6266842f91af6 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 5 Jun 2024 08:26:37 +0200 Subject: [PATCH] Simplify 'help-enable-variable-value-editing' using 'string-edit' * lisp/help-fns.el (help-fns--edit-variable): Remove variable declaration, as 'string-edit' makes manually storing the variable name unnecessary. (help-fns-edit-variable): Use 'read-string-from-buffer' instead of custom major mode. (help-fns--edit-value-mode-map, help-fns--edit-value-mode) (help-fns-edit-mode-done, help-fns-edit-mode-cancel): Remove functionality provided by 'string-edit'. --- lisp/help-fns.el | 55 ++++++------------------------------------------ 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1ffe1b16588..8ea5b301684 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1502,60 +1502,19 @@ help-fns--editable-variable :parent button-map "e" #'help-fns-edit-variable))))) -(defvar help-fns--edit-variable) - (put 'help-fns-edit-variable 'disabled t) (defun help-fns-edit-variable () "Edit the variable under point." (declare (completion ignore)) (interactive) - (let ((var (get-text-property (point) 'help-fns--edit-variable))) - (unless var + (let* ((val (thing-at-point 'sexp)) + (var (get-text-property 0 'help-fns--edit-variable val))) + (unless val (error "No variable under point")) - (pop-to-buffer-same-window (format "*edit %s*" (nth 0 var))) - (prin1 (nth 1 var) (current-buffer)) - (pp-buffer) - (goto-char (point-min)) - (help-fns--edit-value-mode) - (insert (format ";; Edit the `%s' variable.\n" (nth 0 var)) - (substitute-command-keys - ";; `\\[help-fns-edit-mode-done]' to update the value and exit; \ -`\\[help-fns-edit-mode-cancel]' to cancel.\n\n")) - (setq-local help-fns--edit-variable var))) - -(defvar-keymap help-fns--edit-value-mode-map - "C-c C-c" #'help-fns-edit-mode-done - "C-c C-k" #'help-fns-edit-mode-cancel) - -(define-derived-mode help-fns--edit-value-mode emacs-lisp-mode "Elisp" - :interactive nil) - -(defun help-fns-edit-mode-done (&optional kill) - "Update the value of the variable being edited and kill the edit buffer. -If KILL (the prefix), don't update the value, but just kill the -current buffer." - (interactive "P" help-fns--edit-value-mode) - (unless help-fns--edit-variable - (error "Invalid buffer")) - (goto-char (point-min)) - (cl-destructuring-bind (variable _ buffer help-buffer) - help-fns--edit-variable - (unless (buffer-live-p buffer) - (error "Original buffer is gone; can't update")) - (unless kill - (let ((value (read (current-buffer)))) - (with-current-buffer buffer - (set variable value)))) - (kill-buffer (current-buffer)) - (when (buffer-live-p help-buffer) - (with-current-buffer help-buffer - (revert-buffer))))) - -(defun help-fns-edit-mode-cancel () - "Kill the edit buffer and cancel editing of the value. -This cancels value editing without updating the value." - (interactive nil help-fns--edit-value-mode) - (help-fns-edit-mode-done t)) + (let ((str (read-string-from-buffer + (format ";; Edit the `%s' variable." (nth 0 var)) + (prin1-to-string (nth 1 var))))) + (set (nth 0 var) (read str))))) (defun help-fns--run-describe-functions (functions &rest args) (with-current-buffer standard-output -- 2.45.1 --=-=-= Content-Type: text/plain -- Philip Kaludercic on peregrine --=-=-=-- ------------=_1722168302-25710-1-- From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Aug 2024 09:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 71374@debbugs.gnu.org Cc: philipk@posteo.net Received: via spool by 71374-submit@debbugs.gnu.org id=B71374.17225894506096 (code B ref 71374); Fri, 02 Aug 2024 09:05:02 +0000 Received: (at 71374) by debbugs.gnu.org; 2 Aug 2024 09:04:10 +0000 Received: from localhost ([127.0.0.1]:52467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZoCo-0001aF-0Z for submit@debbugs.gnu.org; Fri, 02 Aug 2024 05:04:10 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:33834 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZoCl-0001a4-Vo; Fri, 02 Aug 2024 05:04:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1722589429; bh=5HF+ho6KjVCVIfr9uDmaKRtCewv1lFnisTVzn/fkl7g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IZpJHqot0TZx+xfEiGV9GxSkAopmrfl/CWEci+j2t5siQm7Yy+ljrMMpzzB26adaT axyIFEYtoj350SLoDuGOiGVwCbu2rXrsBd2odFV6gkPY0ZTJ2C+EgROagbPvJ8Lnr3 YAVkKNcjBftmk16Mad6tmV8a7+LZJd0PPZCvBw1WsJdGWgTu/KCdrPeo2xCmLg16MG C15brXMMxormlsc9KIGmUL22aYZk77f7TJSci9vSLPVvFMFuZpu1kzEUUODCyJY1OM Rk52GZjNnl1EMEdpWepxvCvRKlih/vRh4dNfIYoaAA2Q/OAQB+Okx1SbKfoAQnCLyi KsALqftvvCExw== From: Eshel Yaron In-Reply-To: <87msm1pvsj.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 28 Jul 2024 12:04:28 +0000") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> <8734pqbneq.fsf@posteo.net> <871q3xklgv.fsf@jeremybryant.net> <87msm1pvsj.fsf@posteo.net> Date: Fri, 02 Aug 2024 11:03:46 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) reopen 71374 quit Hi Philip, Philip Kaludercic writes: > I hadn't pushed the change, have done so now. Closing the report. > Thanks for the reminder. I'm reopening this (hope you don't mind) to keep track of the minor regressions I mentioned here: https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html Thanks, Eshel From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Aug 2024 11:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eshel Yaron Cc: 71374@debbugs.gnu.org Received: via spool by 71374-submit@debbugs.gnu.org id=B71374.17234635346205 (code B ref 71374); Mon, 12 Aug 2024 11:53:01 +0000 Received: (at 71374) by debbugs.gnu.org; 12 Aug 2024 11:52:14 +0000 Received: from localhost ([127.0.0.1]:42551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdTaw-0001bx-AE for submit@debbugs.gnu.org; Mon, 12 Aug 2024 07:52:14 -0400 Received: from [185.67.36.65] (port=52189 helo=mout01.posteo.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdTas-0001bB-DJ for 71374@debbugs.gnu.org; Mon, 12 Aug 2024 07:52:12 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C1752240027 for <71374@debbugs.gnu.org>; Mon, 12 Aug 2024 13:51:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1723463480; bh=azGe+oCH4zVYx1QyfD5uso71kTVF3R6XTLYaUv+tVms=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=WI+YkX6HqwpTZp2L+H+Wn65fFqkCXsyMJBYa4ugdlqIuenEDjhEPsczSm8saz85Ji JVB5ngWyGVLgbU/ZzvCDxZpRAIL0hbwCuCyl0BValJCEtzlGy7kzpG6z7hiQIVhL/2 6gYiO21OV47aAosIECwZ8LEfj33FP12avZq5vZZ4EX1x+4nXsbkQWzEfAstZ5+NB+t hszF9j2bWkx4jjH7z3HRKah+1QKfZDr0uLkAeGZrvYP4Z+ibKY+cBVR67bUmu0017p yEx728ngrRoJOnJiiKhTfqBfnac7zTrOTBFXHUql8zx6Vg1i1dOVt4j95g/MhLNUnu viQsjzwEw1sBA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WjCXR6TScz6tm8; Mon, 12 Aug 2024 13:51:19 +0200 (CEST) From: Philip Kaludercic In-Reply-To: (Eshel Yaron's message of "Fri, 02 Aug 2024 11:03:46 +0200") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> <8734pqbneq.fsf@posteo.net> <871q3xklgv.fsf@jeremybryant.net> <87msm1pvsj.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Mon, 12 Aug 2024 11:51:18 +0000 Message-ID: <87y152j6x5.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -1.0 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) --=-=-= Content-Type: text/plain Eshel Yaron writes: > reopen 71374 > quit > > Hi Philip, > > Philip Kaludercic writes: > >> I hadn't pushed the change, have done so now. Closing the report. >> Thanks for the reminder. > > I'm reopening this (hope you don't mind) to keep track of the minor > regressions I mentioned here: > > https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html Thanks, and my apologies for the late reply. The issue seems to be that (thing-at-point 'sexp) returns nil if inside a s-expression looking at whitespace: (1 2 3 4 5) ^ M-: (thing-at-point 'sexp) ;=> nil One idea is to fall back on a defun at point, if no sexp is found: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 8ea5b301684..4d55ea8bbff 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1507,13 +1507,14 @@ help-fns-edit-variable "Edit the variable under point." (declare (completion ignore)) (interactive) - (let* ((val (thing-at-point 'sexp)) - (var (get-text-property 0 'help-fns--edit-variable val))) + (let ((val (or (thing-at-point 'sexp) + (thing-at-point 'defun)))) (unless val - (error "No variable under point")) - (let ((str (read-string-from-buffer - (format ";; Edit the `%s' variable." (nth 0 var)) - (prin1-to-string (nth 1 var))))) + (error "No value at point")) + (let* ((var (get-text-property 0 'help-fns--edit-variable val)) + (str (read-string-from-buffer + (format ";; Edit the `%s' variable." (nth 0 var)) + (prin1-to-string (nth 1 var))))) (set (nth 0 var) (read str))))) (defun help-fns--run-describe-functions (functions &rest args) --=-=-= Content-Type: text/plain Additionally, I moved the `get-text-property' after the check, to ensure that the indented error message is used. Comments? > > Thanks, > > Eshel -- Philip Kaludercic on peregrine --=-=-=-- From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Aug 2024 06:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Philip Kaludercic Cc: 71374@debbugs.gnu.org Received: via spool by 71374-submit@debbugs.gnu.org id=B71374.172352877917882 (code B ref 71374); Tue, 13 Aug 2024 06:00:03 +0000 Received: (at 71374) by debbugs.gnu.org; 13 Aug 2024 05:59:39 +0000 Received: from localhost ([127.0.0.1]:44337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdkZH-0004eL-0W for submit@debbugs.gnu.org; Tue, 13 Aug 2024 01:59:39 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:42656 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdkZE-0004eB-GI for 71374@debbugs.gnu.org; Tue, 13 Aug 2024 01:59:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1723528742; bh=I/Bk4WxwhDmSUt1h9IX82kDYwSp6PmxGTvKi+sJJTPU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ShdsthQ/KbgmctAEMeLwAEW7RhhuFFPUHEn60jnPGNPItXExzkkvg6a7mkIlz2d/j 8zr1tAWdbfDzYnUFEs/Pb9aEZsndTLwvs10yf3DrsDIiuLBcwDy8lwGU8R4eyzp4B9 O61EccliK6MEnQLn3YixVc4tgthAbn69flcy8vdUEv1PbxSPzHHFJofdLnugT5vLUc xHaTBW/XTWFZiIJRVys7DN0f3PSVg0ToZuWFAd/osgbg/4i3tE7ocRqAd5SQBwR0MW wAhBoZCi/IW70SvyfhZ4jtrd+TQEb3tKeh4YWIEXDcH6an+qHhAiciRrKhzd45N1U0 fhFHcypbtNuoQ== From: Eshel Yaron In-Reply-To: <87y152j6x5.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 12 Aug 2024 11:51:18 +0000") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> <8734pqbneq.fsf@posteo.net> <871q3xklgv.fsf@jeremybryant.net> <87msm1pvsj.fsf@posteo.net> <87y152j6x5.fsf@posteo.net> Date: Tue, 13 Aug 2024 07:59:00 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philip Kaludercic writes: > Eshel Yaron writes: > >> I'm reopening this (hope you don't mind) to keep track of the minor >> regressions I mentioned here: >> >> https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html > > Thanks, and my apologies for the late reply. No problem at all. > The issue seems to be that (thing-at-point 'sexp) returns nil if inside > a s-expression looking at whitespace: > > (1 2 3 4 5) > ^ > M-: (thing-at-point 'sexp) ;=> nil > > One idea is to fall back on a defun at point, if no sexp is found: > > diff --git a/lisp/help-fns.el b/lisp/help-fns.el > index 8ea5b301684..4d55ea8bbff 100644 > --- a/lisp/help-fns.el > +++ b/lisp/help-fns.el > @@ -1507,13 +1507,14 @@ help-fns-edit-variable > "Edit the variable under point." > (declare (completion ignore)) > (interactive) > - (let* ((val (thing-at-point 'sexp)) > - (var (get-text-property 0 'help-fns--edit-variable val))) > + (let ((val (or (thing-at-point 'sexp) > + (thing-at-point 'defun)))) > (unless val > - (error "No variable under point")) > - (let ((str (read-string-from-buffer > - (format ";; Edit the `%s' variable." (nth 0 var)) > - (prin1-to-string (nth 1 var))))) > + (error "No value at point")) > + (let* ((var (get-text-property 0 'help-fns--edit-variable val)) > + (str (read-string-from-buffer > + (format ";; Edit the `%s' variable." (nth 0 var)) > + (prin1-to-string (nth 1 var))))) > (set (nth 0 var) (read str))))) Maybe I'm missing something, but why are val and the thing-at-point call needed at all? Simply grabbing the help-fns--edit-variable property at point should be work as well, I think. Eshel From unknown Sun Jun 22 04:31:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Aug 2024 20:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eshel Yaron Cc: 71374@debbugs.gnu.org Received: via spool by 71374-submit@debbugs.gnu.org id=B71374.17247041211765 (code B ref 71374); Mon, 26 Aug 2024 20:29:01 +0000 Received: (at 71374) by debbugs.gnu.org; 26 Aug 2024 20:28:41 +0000 Received: from localhost ([127.0.0.1]:45277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sigKO-0000SP-RP for submit@debbugs.gnu.org; Mon, 26 Aug 2024 16:28:41 -0400 Received: from mout01.posteo.de ([185.67.36.65]:58097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sigKM-0000SB-5J for 71374@debbugs.gnu.org; Mon, 26 Aug 2024 16:28:39 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 90B42240029 for <71374@debbugs.gnu.org>; Mon, 26 Aug 2024 22:27:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1724704059; bh=6iWrFxS4IiuUYznExZdBw7k21baaI3OJ5p3bVVGi9cA=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=Omo8z03ltkg3aiQX4HZmzAnAn9WWzVfWhTOOKZhltWbBKk3RVd6tA+vgtEW7K+MAK Cj2Ruw1vrnlFKCdP04fziwAlBYzazigped7tAabR6LXYSZ38fae8knHhQWiLAmOJ+q Z8v/ng+pscoY4a10YnQ2lq/MqqFO2cZWoPtw0M2VMgqRwCbVsJN3uNhx8S4T+0PDWW C4p3jLYlSCK0uwc21zK5/rUota4Vcq4KvH8+amMWcCHdJzCIt5zIppCi5hfS0dCfkc 3qxezWq8lXe/pTQKT8e9ShHfH75+yXluy5eRyAVqrJZuEJtzo0Pv3XO+5i6ujQV8p1 Ao+PVd/DjAURw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wt2Kk6Pkdz6twG; Mon, 26 Aug 2024 22:27:38 +0200 (CEST) From: Philip Kaludercic In-Reply-To: (Eshel Yaron's message of "Tue, 13 Aug 2024 07:59:00 +0200") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> <8734pqbneq.fsf@posteo.net> <871q3xklgv.fsf@jeremybryant.net> <87msm1pvsj.fsf@posteo.net> <87y152j6x5.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Mon, 26 Aug 2024 20:27:38 +0000 Message-ID: <87ttf7do79.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Eshel Yaron writes: > Philip Kaludercic writes: > >> Eshel Yaron writes: >> >>> I'm reopening this (hope you don't mind) to keep track of the minor >>> regressions I mentioned here: >>> >>> https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html >> >> Thanks, and my apologies for the late reply. > > No problem at all. > >> The issue seems to be that (thing-at-point 'sexp) returns nil if inside >> a s-expression looking at whitespace: >> >> (1 2 3 4 5) >> ^ >> M-: (thing-at-point 'sexp) ;=> nil >> >> One idea is to fall back on a defun at point, if no sexp is found: >> >> diff --git a/lisp/help-fns.el b/lisp/help-fns.el >> index 8ea5b301684..4d55ea8bbff 100644 >> --- a/lisp/help-fns.el >> +++ b/lisp/help-fns.el >> @@ -1507,13 +1507,14 @@ help-fns-edit-variable >> "Edit the variable under point." >> (declare (completion ignore)) >> (interactive) >> - (let* ((val (thing-at-point 'sexp)) >> - (var (get-text-property 0 'help-fns--edit-variable val))) >> + (let ((val (or (thing-at-point 'sexp) >> + (thing-at-point 'defun)))) >> (unless val >> - (error "No variable under point")) >> - (let ((str (read-string-from-buffer >> - (format ";; Edit the `%s' variable." (nth 0 var)) >> - (prin1-to-string (nth 1 var))))) >> + (error "No value at point")) >> + (let* ((var (get-text-property 0 'help-fns--edit-variable val)) >> + (str (read-string-from-buffer >> + (format ";; Edit the `%s' variable." (nth 0 var)) >> + (prin1-to-string (nth 1 var))))) >> (set (nth 0 var) (read str))))) > > Maybe I'm missing something, but why are val and the thing-at-point call > needed at all? Simply grabbing the help-fns--edit-variable property at > point should be work as well, I think. No, I think you are right, we don't have to take the detour over 'thing-at-point', meaning that if I am not mistaken, the fix should reduce itself to: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 8a2ae79736f..97d054ce6db 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1507,9 +1507,8 @@ help-fns-edit-variable "Edit the variable under point." (declare (completion ignore)) (interactive) - (let* ((val (thing-at-point 'sexp)) - (var (get-text-property 0 'help-fns--edit-variable val))) - (unless val + (let ((var (get-text-property (point) 'help-fns--edit-variable))) + (unless var (error "No variable under point")) (let ((str (read-string-from-buffer (format ";; Edit the `%s' variable." (nth 0 var)) --=-=-= Content-Type: text/plain > Eshel -- Philip Kaludercic on peregrine --=-=-=-- From unknown Sun Jun 22 04:31:33 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Philip Kaludercic Subject: bug#71374: closed (Re: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using) Message-ID: References: <874j6xg4ga.fsf@posteo.net> <87ikync1zh.fsf@posteo.net> X-Gnu-PR-Message: they-closed 71374 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 71374@debbugs.gnu.org Date: Mon, 02 Sep 2024 20:58:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1725310682-22678-1" This is a multi-part message in MIME format... ------------=_1725310682-22678-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #71374: [PATCH] Simplify 'help-enable-variable-value-editing' using which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 71374@debbugs.gnu.org. --=20 71374: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71374 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1725310682-22678-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 71374-done) by debbugs.gnu.org; 2 Sep 2024 20:57:34 +0000 Received: from localhost ([127.0.0.1]:52760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slE7B-0005sn-KI for submit@debbugs.gnu.org; Mon, 02 Sep 2024 16:57:34 -0400 Received: from mout02.posteo.de ([185.67.36.66]:60115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slE78-0005sX-P4 for 71374-done@debbugs.gnu.org; Mon, 02 Sep 2024 16:57:32 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6B216240106 for <71374-done@debbugs.gnu.org>; Mon, 2 Sep 2024 22:56:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725310583; bh=bedcvIkPGvLqTKjR1os9J+aAw6/V2qkPLhdHFgj3v5M=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=Z8TndrEGj2GuXY3m6Nn9kfTyWvfpmPfFCp3fNMZZoA4o6LbzKJGGJPWDKWBXVS0ZX xJN2sSgQgQI5vGWfWNcdPoyHWfwWyMOqgaoPAQesbOhpvTpnFE9CwX8GMWIv01NzFr yOCUydRuLQVepBl7jUpi09/Log8oXS66S3zcvDp83+MP1zGEGdFxCihvy6/jF8rf4X x+RCiwtP/qM+xlaY8qD3m0HB1BPSn0aMSIoRNnbnA5ky6zeG0pauCMF1hPF+3qcx8c FzCqUtn0x+2vn2mKLcfgz4DnA36WNZ4NubFrLeGYP6rPy7UXwu491W3GOPzyVdG8qh 3jNs//GHGLIoA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WyLdf3HLRz9rxF; Mon, 2 Sep 2024 22:56:22 +0200 (CEST) From: Philip Kaludercic To: Eshel Yaron Subject: Re: bug#71374: [PATCH] Simplify 'help-enable-variable-value-editing' using In-Reply-To: <87ttf7do79.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 26 Aug 2024 20:27:38 +0000") References: <87ikync1zh.fsf@posteo.net> <86frtrk2ec.fsf@gnu.org> <8734pqbneq.fsf@posteo.net> <871q3xklgv.fsf@jeremybryant.net> <87msm1pvsj.fsf@posteo.net> <87y152j6x5.fsf@posteo.net> <87ttf7do79.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Mon, 02 Sep 2024 20:56:21 +0000 Message-ID: <874j6xg4ga.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71374-done Cc: 71374-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > Eshel Yaron writes: > >> Philip Kaludercic writes: >> >>> Eshel Yaron writes: >>> >>>> I'm reopening this (hope you don't mind) to keep track of the minor >>>> regressions I mentioned here: >>>> >>>> https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html >>> >>> Thanks, and my apologies for the late reply. >> >> No problem at all. >> >>> The issue seems to be that (thing-at-point 'sexp) returns nil if inside >>> a s-expression looking at whitespace: >>> >>> (1 2 3 4 5) >>> ^ >>> M-: (thing-at-point 'sexp) ;=> nil >>> >>> One idea is to fall back on a defun at point, if no sexp is found: >>> >>> diff --git a/lisp/help-fns.el b/lisp/help-fns.el >>> index 8ea5b301684..4d55ea8bbff 100644 >>> --- a/lisp/help-fns.el >>> +++ b/lisp/help-fns.el >>> @@ -1507,13 +1507,14 @@ help-fns-edit-variable >>> "Edit the variable under point." >>> (declare (completion ignore)) >>> (interactive) >>> - (let* ((val (thing-at-point 'sexp)) >>> - (var (get-text-property 0 'help-fns--edit-variable val))) >>> + (let ((val (or (thing-at-point 'sexp) >>> + (thing-at-point 'defun)))) >>> (unless val >>> - (error "No variable under point")) >>> - (let ((str (read-string-from-buffer >>> - (format ";; Edit the `%s' variable." (nth 0 var)) >>> - (prin1-to-string (nth 1 var))))) >>> + (error "No value at point")) >>> + (let* ((var (get-text-property 0 'help-fns--edit-variable val)) >>> + (str (read-string-from-buffer >>> + (format ";; Edit the `%s' variable." (nth 0 var)) >>> + (prin1-to-string (nth 1 var))))) >>> (set (nth 0 var) (read str))))) >> >> Maybe I'm missing something, but why are val and the thing-at-point call >> needed at all? Simply grabbing the help-fns--edit-variable property at >> point should be work as well, I think. > > No, I think you are right, we don't have to take the detour over > 'thing-at-point', meaning that if I am not mistaken, the fix should > reduce itself to: > > diff --git a/lisp/help-fns.el b/lisp/help-fns.el > index 8a2ae79736f..97d054ce6db 100644 > --- a/lisp/help-fns.el > +++ b/lisp/help-fns.el > @@ -1507,9 +1507,8 @@ help-fns-edit-variable > "Edit the variable under point." > (declare (completion ignore)) > (interactive) > - (let* ((val (thing-at-point 'sexp)) > - (var (get-text-property 0 'help-fns--edit-variable val))) > - (unless val > + (let ((var (get-text-property (point) 'help-fns--edit-variable))) > + (unless var > (error "No variable under point")) > (let ((str (read-string-from-buffer > (format ";; Edit the `%s' variable." (nth 0 var)) I have pushed this change and am closing the report. >> Eshel -- Philip Kaludercic on peregrine ------------=_1725310682-22678-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Jun 2024 07:14:30 +0000 Received: from localhost ([127.0.0.1]:36043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEkqq-00009Z-Tb for submit@debbugs.gnu.org; Wed, 05 Jun 2024 03:14:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:44344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEkqn-000095-3V for submit@debbugs.gnu.org; Wed, 05 Jun 2024 03:14:27 -0400 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 1sEkYs-0001Ah-00 for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 02:55:54 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEkYp-0005KB-0L for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 02:55:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2B590240027 for ; Wed, 5 Jun 2024 08:55:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1717570547; bh=lnig+xxjrkO8chI1zxJfJtoTYJvPltKjLOgq8MAl0Mc=; h=From:To:Subject:OpenPGP:Date:Message-ID:MIME-Version:Content-Type: From; b=Mr4E3ifeLPdB/CjSInIJ/AT9UGBZXkD0a8u8Q1iuWwkXsKIgwYAtaeRNdP6dDoeCL RThFkBfQqJROEGTGjA6XjPnybxHW6a1VuIr1ajo2BIQAsFXw3+h8qx3ATskTF94EiT FszR90xT+8SgZoEBF/x86tmQwK2GsHVilRSbwJJX3ed+goyNtmKnZIXXgh3viBDztW ZuhLPOghEvjBcC8utrdg6StOnaJDpv41Ke3UKw+XHjfLk/TTnPbKlaR8Eqchenkw5p t/3l6KfgWDozjqNO9uM6RRyVIPubvB2lMrqWafiLVuzA7AhKyVVPGVAp+DbNVuilHK rjtyMTmkRdAOA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VvJBp4Bfyz6txr for ; Wed, 5 Jun 2024 08:55:46 +0200 (CEST) From: Philip Kaludercic To: bug-gnu-emacs@gnu.org Subject: [PATCH] Simplify 'help-enable-variable-value-editing' using OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Wed, 05 Jun 2024 06:55:46 +0000 Message-ID: <87ikync1zh.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain The main issue with this patch is that it drops the syntax highlighting in the *string edit* buffer, but we could fix that in a second patch by adding support to specify a major mode to inherit from when editing a string. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Simplify-'help-enable-variable-value-editing'-usin.patch Content-Description: [PATCH] Simplify 'help-enable-variable-value-editing' using >From fa1fff88e295bee0380665d623a6266842f91af6 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 5 Jun 2024 08:26:37 +0200 Subject: [PATCH] Simplify 'help-enable-variable-value-editing' using 'string-edit' * lisp/help-fns.el (help-fns--edit-variable): Remove variable declaration, as 'string-edit' makes manually storing the variable name unnecessary. (help-fns-edit-variable): Use 'read-string-from-buffer' instead of custom major mode. (help-fns--edit-value-mode-map, help-fns--edit-value-mode) (help-fns-edit-mode-done, help-fns-edit-mode-cancel): Remove functionality provided by 'string-edit'. --- lisp/help-fns.el | 55 ++++++------------------------------------------ 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1ffe1b16588..8ea5b301684 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1502,60 +1502,19 @@ help-fns--editable-variable :parent button-map "e" #'help-fns-edit-variable))))) -(defvar help-fns--edit-variable) - (put 'help-fns-edit-variable 'disabled t) (defun help-fns-edit-variable () "Edit the variable under point." (declare (completion ignore)) (interactive) - (let ((var (get-text-property (point) 'help-fns--edit-variable))) - (unless var + (let* ((val (thing-at-point 'sexp)) + (var (get-text-property 0 'help-fns--edit-variable val))) + (unless val (error "No variable under point")) - (pop-to-buffer-same-window (format "*edit %s*" (nth 0 var))) - (prin1 (nth 1 var) (current-buffer)) - (pp-buffer) - (goto-char (point-min)) - (help-fns--edit-value-mode) - (insert (format ";; Edit the `%s' variable.\n" (nth 0 var)) - (substitute-command-keys - ";; `\\[help-fns-edit-mode-done]' to update the value and exit; \ -`\\[help-fns-edit-mode-cancel]' to cancel.\n\n")) - (setq-local help-fns--edit-variable var))) - -(defvar-keymap help-fns--edit-value-mode-map - "C-c C-c" #'help-fns-edit-mode-done - "C-c C-k" #'help-fns-edit-mode-cancel) - -(define-derived-mode help-fns--edit-value-mode emacs-lisp-mode "Elisp" - :interactive nil) - -(defun help-fns-edit-mode-done (&optional kill) - "Update the value of the variable being edited and kill the edit buffer. -If KILL (the prefix), don't update the value, but just kill the -current buffer." - (interactive "P" help-fns--edit-value-mode) - (unless help-fns--edit-variable - (error "Invalid buffer")) - (goto-char (point-min)) - (cl-destructuring-bind (variable _ buffer help-buffer) - help-fns--edit-variable - (unless (buffer-live-p buffer) - (error "Original buffer is gone; can't update")) - (unless kill - (let ((value (read (current-buffer)))) - (with-current-buffer buffer - (set variable value)))) - (kill-buffer (current-buffer)) - (when (buffer-live-p help-buffer) - (with-current-buffer help-buffer - (revert-buffer))))) - -(defun help-fns-edit-mode-cancel () - "Kill the edit buffer and cancel editing of the value. -This cancels value editing without updating the value." - (interactive nil help-fns--edit-value-mode) - (help-fns-edit-mode-done t)) + (let ((str (read-string-from-buffer + (format ";; Edit the `%s' variable." (nth 0 var)) + (prin1-to-string (nth 1 var))))) + (set (nth 0 var) (read str))))) (defun help-fns--run-describe-functions (functions &rest args) (with-current-buffer standard-output -- 2.45.1 --=-=-= Content-Type: text/plain -- Philip Kaludercic on peregrine --=-=-=-- ------------=_1725310682-22678-1--