all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* diff-mode: kill various hunks at once, something like kill-region?
@ 2022-10-20 14:14 Uwe Brauer
  2022-10-20 15:19 ` [External] : " Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Brauer @ 2022-10-20 14:14 UTC (permalink / raw)
  To: help-gnu-emacs

Hi


Does somebody know about a package that would allow to kill serval hunk
in one go or even having something like kill-region in a diff buffer?


Regards

Uwe Brauer 
-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 




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

* RE: [External] : diff-mode: kill various hunks at once, something like kill-region?
  2022-10-20 14:14 diff-mode: kill various hunks at once, something like kill-region? Uwe Brauer
@ 2022-10-20 15:19 ` Drew Adams
  2022-10-20 16:32   ` Uwe Brauer
  2022-10-21 18:45   ` [SOLVED, sort of] (was: [External] : diff-mode: kill various hunks at once, something like kill-region?) Uwe Brauer
  0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2022-10-20 15:19 UTC (permalink / raw)
  To: Uwe Brauer, help-gnu-emacs@gnu.org

> Does somebody know about a package that would allow to kill serval hunk
> in one go or even having something like kill-region in a diff buffer?

If what you mean is kill/delete several stretches
of text at once, where you provide the limits of
each such stretch, then you can do that with an
iteration.  "At once" here would refer to the
overall effect, but maybe you have something else
in mind?
___

If you use library zones.el then you can use
`zz-do-zones', which just does such an iteration,
applying a function to a list of zones (start +
end positions).  But for this simple an operation
you can as easily use `dolist' over such a list.

https://elpa.gnu.org/packages/zones.html



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

* Re: [External] : diff-mode: kill various hunks at once, something like kill-region?
  2022-10-20 15:19 ` [External] : " Drew Adams
@ 2022-10-20 16:32   ` Uwe Brauer
  2022-10-21 18:45   ` [SOLVED, sort of] (was: [External] : diff-mode: kill various hunks at once, something like kill-region?) Uwe Brauer
  1 sibling, 0 replies; 4+ messages in thread
From: Uwe Brauer @ 2022-10-20 16:32 UTC (permalink / raw)
  To: Drew Adams; +Cc: Uwe Brauer, help-gnu-emacs@gnu.org

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

>>> "DA" == Drew Adams <drew.adams@oracle.com> writes:

>> Does somebody know about a package that would allow to kill serval hunk
>> in one go or even having something like kill-region in a diff buffer?

> If what you mean is kill/delete several stretches
> of text at once, where you provide the limits of
> each such stretch, then you can do that with an
> iteration.  "At once" here would refer to the
> overall effect, but maybe you have something else
> in mind?
> ___

Workflow and motivation:

I use HG (but for git the workflow is very similar)

    1. I call vc-dir

    2. I select the files I want to commit

    3. I use vc-diff

    4. In the diff file I manipulate hunks

    5. I either use

       1. commit-patch, a perl script that allows to submit
          the edit diff file as patch.

       2. Or the solution implemented by Dmitry which currently dwells
          in Emacs master


Now sometimes if the diff file is huge, I might only want to commit 2
out of say 20 hunks.

So instead of killing 18 hunks, I'd like to mark the hunks I would like
to delete and somehow delete them in one go (kill-region-hunk is not
implemented)

So what you propose, would serve this purpose?


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

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

* [SOLVED, sort of] (was: [External] : diff-mode: kill various hunks at once, something like kill-region?)
  2022-10-20 15:19 ` [External] : " Drew Adams
  2022-10-20 16:32   ` Uwe Brauer
@ 2022-10-21 18:45   ` Uwe Brauer
  1 sibling, 0 replies; 4+ messages in thread
From: Uwe Brauer @ 2022-10-21 18:45 UTC (permalink / raw)
  To: help-gnu-emacs

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

>>> "DA" == Drew Adams <drew.adams@oracle.com> writes:

>> Does somebody know about a package that would allow to kill serval hunk
>> in one go or even having something like kill-region in a diff buffer?

> If what you mean is kill/delete several stretches
> of text at once, where you provide the limits of
> each such stretch, then you can do that with an
> iteration.  "At once" here would refer to the
> overall effect, but maybe you have something else
> in mind?
> ___

Well, the diff buffer in diff-mode is read-only, but that as I learned
is not essential. So toggling read-only off and using kill-region, does
the job! 

Sometimes the simplest solutions are the best. 🙃


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

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

end of thread, other threads:[~2022-10-21 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 14:14 diff-mode: kill various hunks at once, something like kill-region? Uwe Brauer
2022-10-20 15:19 ` [External] : " Drew Adams
2022-10-20 16:32   ` Uwe Brauer
2022-10-21 18:45   ` [SOLVED, sort of] (was: [External] : diff-mode: kill various hunks at once, something like kill-region?) Uwe Brauer

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.