GNU bug report logs - #70820
[PATCH] Editable grep buffers

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Tue, 7 May 2024 16:26:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 70820 <at> debbugs.gnu.org
Subject: bug#70820: [PATCH] Editable grep buffers
Date: Sat, 18 May 2024 12:28:24 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: 70820 <at> debbugs.gnu.org
> Date: Sun, 12 May 2024 10:15:33 +0530
> 
> [வியாழன் மே 09, 2024] Visuwesh wrote:
> 
> >>> > I don't think I understand this difficulty, either: with
> >>> > occur-edit-mode it is solved by making occur-edit-mode be derived from
> >>> > occur-mode.  Couldn't you do the same with your mode?
> >>> 
> >>> No because occur-mode makes occur-revert-arguments permanent-local so
> >>> `g' survives the major-mode changes.
> >>> 
> >>> For revert-buffer alone, compilation-arguments needs to be marked
> >>> permanent-local.  As it is a part of compile.el, I am not sure if
> >>> marking it as such is safe.  This is why I think having a minor-mode is
> >>> better.
> >>
> >> It sounds like a minor issue which shouldn't have such grave
> >> consequences.  Why do you think making compilation-arguments
> >> permanent-local would be a problem?  We could ask people who
> >> frequently contribute to compile.e land grep.el if they see any
> >> problem with doing that.
> >
> > It feels like a potential far-fetching change.  But in any case, I will
> > give a shot at recreating the required markers, etc. for
> > occur-after-change-function to work.  Will send a patch once I have a
> > working prototype.
> 
> OK, please find attached patch.  I am still not using a major-mode
> because of the change-major-mode-hook in compilation-setup:
> 
>     (add-hook 'change-major-mode-hook #'compilation--remove-properties nil t)
> 
> that strips off all the text-properties.  And there seem to be too many
> important local variables that is set up by both grep.el and compile.el
> so I think it is easier to use a minor-mode here.

Any reason not to modify compilation--remove-properties not to remove
all the text properties in this particular case?  AFAIU,
change-major-mode-hook is run by kill-all-local-variables, which the
major mode should call, so just before that you could remove
compilation--remove-properties from change-major-mode-hook, and that
would disable this face removal, no?

(I must admit that unconditionally removing the faces is not very
friendly on the part of compilation-mode.  Stefan, are there better
ways of doing that, perhaps?)




This bug report was last modified 305 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.