unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 4bc9fe33af: Rename 'elisp-eval-buffer' to 'elisp-eval-region-or-buffer' (bug#59350)
       [not found] ` <20221120181108.02832C00613@vcs2.savannah.gnu.org>
@ 2022-11-20 18:52   ` Stefan Monnier
  2022-11-20 19:04     ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2022-11-20 18:52 UTC (permalink / raw)
  To: emacs-devel; +Cc: Juri Linkov

Juri Linkov [2022-11-20 13:11:07] wrote:
>     * lisp/progmodes/elisp-mode.el (elisp-eval-region-or-buffer):
>     Rename recently added command 'elisp-eval-buffer' to support active region.
>     (emacs-lisp-mode-map, lisp-interaction-mode-map): Rebind 'C-c C-e'
>     from elisp-eval-buffer to elisp-eval-region-or-buffer.

Could we make it do the `eval-sexp-add-defvars` dance when evaluating a region?


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master 4bc9fe33af: Rename 'elisp-eval-buffer' to 'elisp-eval-region-or-buffer' (bug#59350)
  2022-11-20 18:52   ` master 4bc9fe33af: Rename 'elisp-eval-buffer' to 'elisp-eval-region-or-buffer' (bug#59350) Stefan Monnier
@ 2022-11-20 19:04     ` Juri Linkov
  2022-11-20 20:04       ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2022-11-20 19:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

>>     * lisp/progmodes/elisp-mode.el (elisp-eval-region-or-buffer):
>>     Rename recently added command 'elisp-eval-buffer' to support active region.
>>     (emacs-lisp-mode-map, lisp-interaction-mode-map): Rebind 'C-c C-e'
>>     from elisp-eval-buffer to elisp-eval-region-or-buffer.
>
> Could we make it do the `eval-sexp-add-defvars` dance when evaluating a region?

Not sure how to do this on the region that might contain several expressions.
Currently it's used only on a single expression in elisp--eval-last-sexp
and elisp--eval-defun.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master 4bc9fe33af: Rename 'elisp-eval-buffer' to 'elisp-eval-region-or-buffer' (bug#59350)
  2022-11-20 19:04     ` Juri Linkov
@ 2022-11-20 20:04       ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2022-11-20 20:04 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

>>>     * lisp/progmodes/elisp-mode.el (elisp-eval-region-or-buffer):
>>>     Rename recently added command 'elisp-eval-buffer' to support active region.
>>>     (emacs-lisp-mode-map, lisp-interaction-mode-map): Rebind 'C-c C-e'
>>>     from elisp-eval-buffer to elisp-eval-region-or-buffer.
>>
>> Could we make it do the `eval-sexp-add-defvars` dance when evaluating a region?
>
> Not sure how to do this on the region that might contain several expressions.
> Currently it's used only on a single expression in elisp--eval-last-sexp
> and elisp--eval-defun.

I think the way to do that is to let `eval_region` take an initial
environment as argument (just like `eval`), and then populate this env
based on the `defvar`s found before the region.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-20 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <166896786767.14676.4958515969410235651@vcs2.savannah.gnu.org>
     [not found] ` <20221120181108.02832C00613@vcs2.savannah.gnu.org>
2022-11-20 18:52   ` master 4bc9fe33af: Rename 'elisp-eval-buffer' to 'elisp-eval-region-or-buffer' (bug#59350) Stefan Monnier
2022-11-20 19:04     ` Juri Linkov
2022-11-20 20:04       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).