bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25987: 25.2; support gcc fixit notes


From: Dmitry Gutov
Subject: bug#25987: 25.2; support gcc fixit notes
Date: Thu, 9 Mar 2017 18:18:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0

On 05.03.2017 23:47, Tom Tromey wrote:

* One way for this to work would be to display the buffer and
   show the proposed change as an overlay; and then use y-or-n-p
   to ask whether it should be applied.  I was thinking something like:

(defun compilation--fixit-make-overlay (start end text)
   (let ((overlay (make-overlay start end)))
     (overlay-put overlay 'face 'diff-removed)
     (overlay-put overlay 'after-string
                  (propertize text 'face 'diff-added))
     overlay))

   With this approach perhaps nothing could be done if the fixit was
   already visited, or if the buffer text already matches the
   replacement.

I'm not sure we want to tie this feature to compilation-mode. Many modes that derive from it don't support fix-its, e.g. those of them that run the test suites. And even for those that do, Compilation provides a very basic UI.

Even to find and apply all fix-its, we'd need to add some new buffer, to show the list.

On the other hand, this can be a quick-and-dirty way to try out the feature and how handy it is. Showing the "quick fix" buttons on top of the fix-it text can be it (not sure it that's the UI you had in mind).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]