unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log*
@ 2023-07-04  0:13 No Wayman
  2023-07-04 11:02 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: No Wayman @ 2023-07-04  0:13 UTC (permalink / raw)
  To: 64452

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


Unless there is good reason not to use special-mode, it'd be nice 
to have the typical special-mode bindings (quit-window especially) 
in these buffers.

Rough draft patch attached. 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-comp.el-use-special-mode-for-log-buffers.patch --]
[-- Type: text/x-patch, Size: 2023 bytes --]

From d2aad9faf904bfd197e0dd30a178f1bf05821c0c Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
Date: Mon, 3 Jul 2023 20:23:00 -0400
Subject: [PATCH] * comp.el: use special-mode for log buffers

(comp-log-to-buffer): ensure comp-log-buffer in special-mode
(comp-run-async-workers): ensure comp-async-buffer in special-mode
---
 lisp/emacs-lisp/comp.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 22fb08e4688..20aee2006fa 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1133,7 +1133,7 @@ comp-log-to-buffer
          (log-buffer
              (or (get-buffer comp-log-buffer-name)
                  (with-current-buffer (get-buffer-create comp-log-buffer-name)
-                   (setf buffer-read-only t)
+                   (unless (derived-mode-p 'special-mode) (special-mode))
                    (current-buffer))))
          (log-window (get-buffer-window log-buffer))
          (inhibit-read-only t)
@@ -4085,7 +4085,8 @@ comp-run-async-workers
                              :buffer (with-current-buffer
                                          (get-buffer-create
                                           comp-async-buffer-name)
-                                       (setf buffer-read-only t)
+                                       (unless (derived-mode-p 'special-mode)
+                                         (special-mode))
 			               (current-buffer))
                              :command (list
                                        (expand-file-name invocation-name
@@ -4119,6 +4120,7 @@ comp-run-async-workers
     (run-hooks 'native-comp-async-all-done-hook)
     (with-current-buffer (get-buffer-create comp-async-buffer-name)
       (save-excursion
+        (unless (derived-mode-p 'special-mode) (special-mode))
         (let ((inhibit-read-only t))
           (goto-char (point-max))
           (insert "Compilation finished.\n"))))
-- 
2.41.0


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

* bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log*
  2023-07-04  0:13 bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log* No Wayman
@ 2023-07-04 11:02 ` Eli Zaretskii
  2023-07-04 22:21   ` No Wayman
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2023-07-04 11:02 UTC (permalink / raw)
  To: No Wayman, Andrea Corallo, Stefan Monnier; +Cc: 64452

> From: No Wayman <iarchivedmywholelife@gmail.com>
> Date: Mon, 03 Jul 2023 20:13:23 -0400
> 
> Unless there is good reason not to use special-mode, it'd be nice 
> to have the typical special-mode bindings (quit-window especially) 
> in these buffers.
> 
> Rough draft patch attached. 

Thanks, but why not elisp-compile-mode, like we do in *Compile-log*
buffers for byte compilation?





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

* bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log*
  2023-07-04 11:02 ` Eli Zaretskii
@ 2023-07-04 22:21   ` No Wayman
  2023-07-05 11:25     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: No Wayman @ 2023-07-04 22:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64452, Andrea Corallo, Stefan Monnier

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


Eli Zaretskii <eliz@gnu.org> writes:

> Thanks, but why not elisp-compile-mode, like we do in 
> *Compile-log*
> buffers for byte compilation?

Works for me. Revision attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-comp.el-use-emacs-lisp-compilation-mode-for-log-buff.patch --]
[-- Type: text/x-patch, Size: 2193 bytes --]

From 9912e598354f877cb4ccf20ac68d7267d8c599c8 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
Date: Mon, 3 Jul 2023 20:23:00 -0400
Subject: [PATCH] * comp.el: use emacs-lisp-compilation-mode for log buffers

(comp-log-to-buffer): ensure comp-log-buffer in emacs-lisp-compilation-mode
(comp-run-async-workers): ensure comp-async-buffer in emacs-lisp-compilation-mode
---
 lisp/emacs-lisp/comp.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 22fb08e4688..5f42d10407f 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1133,7 +1133,8 @@ comp-log-to-buffer
          (log-buffer
              (or (get-buffer comp-log-buffer-name)
                  (with-current-buffer (get-buffer-create comp-log-buffer-name)
-                   (setf buffer-read-only t)
+                   (unless (derived-mode-p 'emacs-lisp-compilation-mode)
+                     (emacs-lisp-compilation-mode))
                    (current-buffer))))
          (log-window (get-buffer-window log-buffer))
          (inhibit-read-only t)
@@ -4085,7 +4086,8 @@ comp-run-async-workers
                              :buffer (with-current-buffer
                                          (get-buffer-create
                                           comp-async-buffer-name)
-                                       (setf buffer-read-only t)
+                                       (unless (derived-mode-p 'emacs-lisp-compilation-mode)
+                                         (emacs-lisp-compilation-mode))
 			               (current-buffer))
                              :command (list
                                        (expand-file-name invocation-name
@@ -4119,6 +4121,8 @@ comp-run-async-workers
     (run-hooks 'native-comp-async-all-done-hook)
     (with-current-buffer (get-buffer-create comp-async-buffer-name)
       (save-excursion
+        (unless (derived-mode-p 'emacs-lisp-compilation-mode)
+          (emacs-lisp-compilation-mode))
         (let ((inhibit-read-only t))
           (goto-char (point-max))
           (insert "Compilation finished.\n"))))
-- 
2.41.0


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

* bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log*
  2023-07-04 22:21   ` No Wayman
@ 2023-07-05 11:25     ` Eli Zaretskii
  2023-07-05 12:52       ` iarchivedmywholelife
  2023-07-05 14:47       ` Andrea Corallo
  0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2023-07-05 11:25 UTC (permalink / raw)
  To: No Wayman; +Cc: 64452, acorallo, monnier

> From: No Wayman <iarchivedmywholelife@gmail.com>
> Cc: Andrea Corallo <acorallo@gnu.org>, Stefan Monnier
>  <monnier@iro.umontreal.ca>, 64452@debbugs.gnu.org
> Date: Tue, 04 Jul 2023 18:21:00 -0400
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Thanks, but why not elisp-compile-mode, like we do in 
> > *Compile-log*
> > buffers for byte compilation?
> 
> Works for me. Revision attached.
> 
> diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
> index 22fb08e4688..5f42d10407f 100644
> --- a/lisp/emacs-lisp/comp.el
> +++ b/lisp/emacs-lisp/comp.el
> @@ -1133,7 +1133,8 @@ comp-log-to-buffer
>           (log-buffer
>               (or (get-buffer comp-log-buffer-name)
>                   (with-current-buffer (get-buffer-create comp-log-buffer-name)
> -                   (setf buffer-read-only t)
> +                   (unless (derived-mode-p 'emacs-lisp-compilation-mode)
> +                     (emacs-lisp-compilation-mode))

bytecomp.el uses

    (unless (derived-mode-p 'compilation-mode)
      (emacs-lisp-compilation-mode))

Isn't that better?

Also, do we really need to do this twice in comp-run-async-workers?

Andrea, any comments?





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

* bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log*
  2023-07-05 11:25     ` Eli Zaretskii
@ 2023-07-05 12:52       ` iarchivedmywholelife
  2023-07-05 14:47       ` Andrea Corallo
  1 sibling, 0 replies; 7+ messages in thread
From: iarchivedmywholelife @ 2023-07-05 12:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64452, acorallo, monnier

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

Feel free to alter the patch as you see fit.I have no more time to invest in it.
-------- Original message --------From: Eli Zaretskii <eliz@gnu.org> Date: 7/5/23  7:25 AM  (GMT-05:00) To: No Wayman <iarchivedmywholelife@gmail.com> Cc: acorallo@gnu.org, monnier@iro.umontreal.ca, 64452@debbugs.gnu.org Subject: Re: bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log* > From: No Wayman <iarchivedmywholelife@gmail.com>> Cc: Andrea Corallo <acorallo@gnu.org>, Stefan Monnier>  <monnier@iro.umontreal.ca>, 64452@debbugs.gnu.org> Date: Tue, 04 Jul 2023 18:21:00 -0400> > Eli Zaretskii <eliz@gnu.org> writes:> > > Thanks, but why not elisp-compile-mode, like we do in > > *Compile-log*> > buffers for byte compilation?> > Works for me. Revision attached.> > diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el> index 22fb08e4688..5f42d10407f 100644> --- a/lisp/emacs-lisp/comp.el> +++ b/lisp/emacs-lisp/comp.el> @@ -1133,7 +1133,8 @@ comp-log-to-buffer>           (log-buffer>               (or (get-buffer comp-log-buffer-name)>                   (with-current-buffer (get-buffer-create comp-log-buffer-name)> -                   (setf buffer-read-only t)> +                   (unless (derived-mode-p 'emacs-lisp-compilation-mode)> +                     (emacs-lisp-compilation-mode))bytecomp.el uses    (unless (derived-mode-p 'compilation-mode)      (emacs-lisp-compilation-mode))Isn't that better?Also, do we really need to do this twice in comp-run-async-workers?Andrea, any comments?

[-- Attachment #2: Type: text/html, Size: 2639 bytes --]

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

* bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log*
  2023-07-05 11:25     ` Eli Zaretskii
  2023-07-05 12:52       ` iarchivedmywholelife
@ 2023-07-05 14:47       ` Andrea Corallo
  2023-07-06  8:52         ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Andrea Corallo @ 2023-07-05 14:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64452, No Wayman, monnier

Eli Zaretskii <eliz@gnu.org> writes:

>> From: No Wayman <iarchivedmywholelife@gmail.com>
>> Cc: Andrea Corallo <acorallo@gnu.org>, Stefan Monnier
>>  <monnier@iro.umontreal.ca>, 64452@debbugs.gnu.org
>> Date: Tue, 04 Jul 2023 18:21:00 -0400
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Thanks, but why not elisp-compile-mode, like we do in 
>> > *Compile-log*
>> > buffers for byte compilation?
>> 
>> Works for me. Revision attached.
>> 
>> diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
>> index 22fb08e4688..5f42d10407f 100644
>> --- a/lisp/emacs-lisp/comp.el
>> +++ b/lisp/emacs-lisp/comp.el
>> @@ -1133,7 +1133,8 @@ comp-log-to-buffer
>>           (log-buffer
>>               (or (get-buffer comp-log-buffer-name)
>>                   (with-current-buffer (get-buffer-create comp-log-buffer-name)
>> -                   (setf buffer-read-only t)
>> +                   (unless (derived-mode-p 'emacs-lisp-compilation-mode)
>> +                     (emacs-lisp-compilation-mode))
>
> bytecomp.el uses
>
>     (unless (derived-mode-p 'compilation-mode)
>       (emacs-lisp-compilation-mode))
>
> Isn't that better?
>
> Also, do we really need to do this twice in comp-run-async-workers?
>
> Andrea, any comments?

No, haven't tried it but it LGTM form here.

Bests

  Andrea






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

* bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log*
  2023-07-05 14:47       ` Andrea Corallo
@ 2023-07-06  8:52         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2023-07-06  8:52 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: 64452-done, iarchivedmywholelife, monnier

> From: Andrea Corallo <acorallo@gnu.org>
> Cc: No Wayman <iarchivedmywholelife@gmail.com>,  monnier@iro.umontreal.ca,
>   64452@debbugs.gnu.org
> Date: Wed, 05 Jul 2023 10:47:47 -0400
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: No Wayman <iarchivedmywholelife@gmail.com>
> >> Cc: Andrea Corallo <acorallo@gnu.org>, Stefan Monnier
> >>  <monnier@iro.umontreal.ca>, 64452@debbugs.gnu.org
> >> Date: Tue, 04 Jul 2023 18:21:00 -0400
> >> 
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> 
> >> > Thanks, but why not elisp-compile-mode, like we do in 
> >> > *Compile-log*
> >> > buffers for byte compilation?
> >> 
> >> Works for me. Revision attached.
> >> 
> >> diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
> >> index 22fb08e4688..5f42d10407f 100644
> >> --- a/lisp/emacs-lisp/comp.el
> >> +++ b/lisp/emacs-lisp/comp.el
> >> @@ -1133,7 +1133,8 @@ comp-log-to-buffer
> >>           (log-buffer
> >>               (or (get-buffer comp-log-buffer-name)
> >>                   (with-current-buffer (get-buffer-create comp-log-buffer-name)
> >> -                   (setf buffer-read-only t)
> >> +                   (unless (derived-mode-p 'emacs-lisp-compilation-mode)
> >> +                     (emacs-lisp-compilation-mode))
> >
> > bytecomp.el uses
> >
> >     (unless (derived-mode-p 'compilation-mode)
> >       (emacs-lisp-compilation-mode))
> >
> > Isn't that better?
> >
> > Also, do we really need to do this twice in comp-run-async-workers?
> >
> > Andrea, any comments?
> 
> No, haven't tried it but it LGTM form here.

Thanks, installed on the master branch, and closing the bug.





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

end of thread, other threads:[~2023-07-06  8:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-04  0:13 bug#64452: [Wishlist/PATCH] Use special-mode for *Native-compile-log*, *Async-native-compile-log* No Wayman
2023-07-04 11:02 ` Eli Zaretskii
2023-07-04 22:21   ` No Wayman
2023-07-05 11:25     ` Eli Zaretskii
2023-07-05 12:52       ` iarchivedmywholelife
2023-07-05 14:47       ` Andrea Corallo
2023-07-06  8:52         ` Eli Zaretskii

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