unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el
@ 2020-06-21 11:33 Theodor Thornhill
  2020-06-21 12:25 ` Basil L. Contovounesios
  0 siblings, 1 reply; 7+ messages in thread
From: Theodor Thornhill @ 2020-06-21 11:33 UTC (permalink / raw)
  To: 41977

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]


Hi!

I saw a little too late that the latest patch to 'project-eshell' didn't
apply correctly when compiling emacs.  As such you would get old
behavior until you eval 'project-eshell'.

A quick fix as far as I can tell is the below patch.

Theo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-project.el-eval-when-compile-eshell.patch --]
[-- Type: text/x-patch; name=0001-project.el-eval-when-compile-eshell.patch, Size: 807 bytes --]

From 4b3f83a4ea36252f7f7552b58529688f6b4c3c9f Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
Date: Sun, 21 Jun 2020 13:09:42 +0200
Subject: [PATCH] project.el - eval-when-compile eshell

* lisp/progmodes/project.el: eval-when-compile Eshell so we can use
'eshell-buffer-name' in 'project-eshell'
---
 lisp/progmodes/project.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 74495cf07a..b77317b98d 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -91,7 +91,9 @@
 ;;; Code:
 
 (require 'cl-generic)
-(eval-when-compile (require 'subr-x))
+(eval-when-compile
+  (require 'subr-x)
+  (require 'eshell))
 
 (defgroup project nil
   "Operations on the current project."
-- 
2.27.0


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

* bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el
  2020-06-21 11:33 bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el Theodor Thornhill
@ 2020-06-21 12:25 ` Basil L. Contovounesios
  2020-06-21 17:44   ` Theodor Thornhill
  0 siblings, 1 reply; 7+ messages in thread
From: Basil L. Contovounesios @ 2020-06-21 12:25 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: 41977

Theodor Thornhill <theo@thornhill.no> writes:

> From 4b3f83a4ea36252f7f7552b58529688f6b4c3c9f Mon Sep 17 00:00:00 2001
> From: Theodor Thornhill <theo@thornhill.no>
> Date: Sun, 21 Jun 2020 13:09:42 +0200
> Subject: [PATCH] project.el - eval-when-compile eshell
>
> * lisp/progmodes/project.el: eval-when-compile Eshell so we can use
> 'eshell-buffer-name' in 'project-eshell'

Since eshell-buffer-name is a variable, eval-when-compile is not the
right thing to do here.  Instead, there should be a
(defvar eshell-buffer-name) inside project-eshell declaring the symbol
as special.  Right?

Thanks,

-- 
Basil





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

* bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el
  2020-06-21 12:25 ` Basil L. Contovounesios
@ 2020-06-21 17:44   ` Theodor Thornhill
  2020-06-21 17:55     ` Basil L. Contovounesios
  0 siblings, 1 reply; 7+ messages in thread
From: Theodor Thornhill @ 2020-06-21 17:44 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 41977

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Since eshell-buffer-name is a variable, eval-when-compile is not the
> right thing to do here.  Instead, there should be a
> (defvar eshell-buffer-name) inside project-eshell declaring the symbol
> as special.  Right?

You are absolutely correct, and TIL - thanks :)

Below is another patch doing this. Works fine in emacs -Q


Theo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Forward-declare-eshell-buffer-name-in-project-eshell.patch --]
[-- Type: text/x-patch; name=0001-Forward-declare-eshell-buffer-name-in-project-eshell.patch, Size: 919 bytes --]

From 2c16ab87e369ab315d43d5e1d6965f1278c2c240 Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
Date: Sun, 21 Jun 2020 19:15:37 +0200
Subject: [PATCH] Forward declare eshell-buffer-name in project-eshell

* lisp/progmodes/project.el: Forward declares 'eshell-buffer-name' so
that 'project-eshell' can use the special variable in eshell.
---
 lisp/progmodes/project.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 74495cf07a..715f0480bb 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -740,6 +740,7 @@ project-eshell
 With \\[universal-argument] prefix, create a new Eshell buffer
 with uniquified name."
   (interactive)
+  (defvar eshell-buffer-name)
   (let* ((default-directory (project-root (project-current t)))
          (eshell-buffer-name
            (concat "*" (file-name-nondirectory
-- 
2.27.0


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

* bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el
  2020-06-21 17:44   ` Theodor Thornhill
@ 2020-06-21 17:55     ` Basil L. Contovounesios
  2020-06-21 22:52       ` Dmitry Gutov
  0 siblings, 1 reply; 7+ messages in thread
From: Basil L. Contovounesios @ 2020-06-21 17:55 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: 41977

Theodor Thornhill <theo@thornhill.no> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>> Since eshell-buffer-name is a variable, eval-when-compile is not the
>> right thing to do here.  Instead, there should be a
>> (defvar eshell-buffer-name) inside project-eshell declaring the symbol
>> as special.  Right?
>
> You are absolutely correct, and TIL - thanks :)
>
> Below is another patch doing this. Works fine in emacs -Q

Thanks, LGTM.

-- 
Basil





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

* bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el
  2020-06-21 17:55     ` Basil L. Contovounesios
@ 2020-06-21 22:52       ` Dmitry Gutov
  2020-06-21 23:02         ` Basil L. Contovounesios
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Gutov @ 2020-06-21 22:52 UTC (permalink / raw)
  To: Basil L. Contovounesios, Theodor Thornhill; +Cc: 41977-done

On 21.06.2020 20:55, Basil L. Contovounesios wrote:
>> You are absolutely correct, and TIL - thanks:)
>>
>> Below is another patch doing this. Works fine in emacs -Q
> Thanks, LGTM.

Thanks all!

Pushed (after rephrasing the commit message in the imperative mood).





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

* bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el
  2020-06-21 22:52       ` Dmitry Gutov
@ 2020-06-21 23:02         ` Basil L. Contovounesios
  2020-06-21 23:07           ` Dmitry Gutov
  0 siblings, 1 reply; 7+ messages in thread
From: Basil L. Contovounesios @ 2020-06-21 23:02 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Theodor Thornhill, 41977

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 21.06.2020 20:55, Basil L. Contovounesios wrote:
>>> You are absolutely correct, and TIL - thanks:)
>>>
>>> Below is another patch doing this. Works fine in emacs -Q
>> Thanks, LGTM.
>
> Thanks all!
>
> Pushed (after rephrasing the commit message in the imperative mood).

In the future it should also be rephrased to include a reference to the
bug#number.  ;)

(Sorry, I didn't notice either.)

Thanks,

-- 
Basil





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

* bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el
  2020-06-21 23:02         ` Basil L. Contovounesios
@ 2020-06-21 23:07           ` Dmitry Gutov
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Gutov @ 2020-06-21 23:07 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: Theodor Thornhill, 41977

On 22.06.2020 02:02, Basil L. Contovounesios wrote:
> In the future it should also be rephrased to include a reference to the
> bug#number.;)

Indeed.

I often forget to do this here, especially when working with debbugs. :-(





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

end of thread, other threads:[~2020-06-21 23:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-21 11:33 bug#41977: 28.0.50; [PATCH]: eval-when-compile eshell in project.el Theodor Thornhill
2020-06-21 12:25 ` Basil L. Contovounesios
2020-06-21 17:44   ` Theodor Thornhill
2020-06-21 17:55     ` Basil L. Contovounesios
2020-06-21 22:52       ` Dmitry Gutov
2020-06-21 23:02         ` Basil L. Contovounesios
2020-06-21 23:07           ` Dmitry Gutov

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).