From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Psionic K Newsgroups: gmane.emacs.devel Subject: Proposing elisp-eval-target for eval-last-sexp and related commands Date: Wed, 18 Aug 2021 00:11:01 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000fe4c8005c9c39011" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39687"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 17 18:40:25 2021 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 1mG28X-000A3Z-1h for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Aug 2021 18:40:25 +0200 Original-Received: from localhost ([::1]:54226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mG28V-0004uQ-Jy for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Aug 2021 12:40:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG1gK-0005AN-Bg for emacs-devel@gnu.org; Tue, 17 Aug 2021 12:11:16 -0400 Original-Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]:44009) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mG1gI-00026P-5l for emacs-devel@gnu.org; Tue, 17 Aug 2021 12:11:16 -0400 Original-Received: by mail-ot1-x330.google.com with SMTP id r16-20020a0568304190b02904f26cead745so25485965otu.10 for ; Tue, 17 Aug 2021 09:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=positron.solutions; s=google; h=mime-version:from:date:message-id:subject:to; bh=bqgVHkvbapYGZmZ4wpnH27hvgx6QYQi/NxjHy6Ae5/w=; b=LzZbvzcZJTs544RE/l+B3BSzd7cGfxJHf4dy29XBZGBIRQAjQCXbEN03Fh0bX5hVef V18BVkC/05zIuW08VbhVLifpAV1TrzfW+KtWda6nNWqTEuGH8c4PxaGKj0GHgL8Tzv1N YHnHjae3ZLNc4hfo95D4NCh5pwqpm9ASRgznV5y/cYRhDKrdb42qpbkLyd9osmWwrfHC k7HdicRd/otN9iJKx19ClMfGV5JAaqZ7iAJezlVI7F1jLHV4A5ECvmBmiovXkufoi0c1 595LS5fOFuHt0pvQ6+7JeTaluo7zvIs8VJNItRSL71CIfQmYDKDyfJqqxRmCnECGk6Hx 7QGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=bqgVHkvbapYGZmZ4wpnH27hvgx6QYQi/NxjHy6Ae5/w=; b=CchpvWpysb6H6kNqVgKwr6E/0BjLRyUihMeRoS5jfNidQmWFEBbEm+xTjIgPegLqwZ r7CdfNRusCNpDaXLZttsW7E1CndelF274BOF/tpbtEasbtQDnn+TpqNt75Gdz4TU6iA/ 5QY6iaeTPmSvumBOOJKGq0rrr5rzdhf+z/4S1gYIYvcQdv17naLAElAQkumPdMiMIPZA X490jV2cmbqixR8uz2ZRQimZV1xnFg54f5liJI6OZuqICt7W7pDOs4W4+xUkFCsmSQTV q254nuxUDqxQipZzFmbqdKB3CyepMkya9/ySxxgLicWBgnwRyN+atMsN8uhpAJAuy3EC Q2dw== X-Gm-Message-State: AOAM531D/qLF7TGWDDFWRoL+xWC5WpFCnb5eHSBONFhsBLvHToCpaLq1 qabdCkJkLJ+njWy0xXOmsj0tmBSeXdMxVKDl54T825fop8gBcLCb X-Google-Smtp-Source: ABdhPJwdEGnbiuEEzpZoC4hoTZrh4Jg3u2K/5xv6yTJSKw8dcZyrH5QXvSLAWwJ9VN+Q0YQCU5pZ9tjb5cBrk9a/Dw0= X-Received: by 2002:a9d:5603:: with SMTP id e3mr3180176oti.178.1629216671938; Tue, 17 Aug 2021 09:11:11 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=exec@positron.solutions; helo=mail-ot1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 17 Aug 2021 12:38:47 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:272501 Archived-At: --000000000000fe4c8005c9c39011 Content-Type: text/plain; charset="UTF-8" Proposing to patch the eslip module so that if a buffer-local `elisp-eval-target` has been set, `eval-last-sexp` and similar commands will execute lisp in the context of another buffer. The use case is when developing elisp to operate on non-elisp buffers, interacting with functionality for other languages such as when using LSP. This change would bring buffer-based development in line with ielm's `ielm-change-working-buffer` behavior. While the `eval-last-sexp` commands are very ergonomic, there is no way to direct them at another buffer without wrapping the last sexp in `with-current-buffer`. Advising deep into `eval-last-sexp` is difficult because we must call `set-buffer` after computing the elisp we want to evaluate. With this support available, the users can then update the buffer local in shortcut commands for buffer-based development of elisp for other modes. I intend to develop a patch. The main difficulty I can identify so far is setting the buffer at the correct points so that the setup for evaluation continues to occur in the correct context. -- Psionic K Software Engineer *Positron Solutions * --000000000000fe4c8005c9c39011 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Proposing to patch the eslip module so that if a buff= er-local `elisp-eval-target` has been set, `eval-last-sexp` and similar com= mands will execute lisp in the context of another buffer.

The use ca= se is when developing elisp to operate on non-elisp buffers,=20 interacting with functionality for other languages such as when using=20 LSP.

This change would bring buffer-based development in = line with ielm's `ielm-change-working-buffer` behavior.

While the `eval-last-sexp` commands are very ergonomic, there is no way = to direct them at another buffer without wrapping the last sexp in `with-cu= rrent-buffer`.=C2=A0 Advising deep into `eval-last-sexp` is difficult becau= se we must call `set-buffer` after computing the elisp we want to evaluate.=

With this support available, the users can then update t= he buffer local in shortcut commands for buffer-based development of elisp = for other modes.

I intend to develop a patch.=C2=A0 The main difficu= lty I can identify so=20 far is setting the buffer at the correct points so that the setup for=20 evaluation continues to occur in the correct context.

--=
<= div>Software Engineer
--000000000000fe4c8005c9c39011--