GNU bug report logs - #65380
[PATCH] Add command to copy contents in a diff-mode buffer

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sat, 19 Aug 2023 09:55:01 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


Message #89 received at 65380 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 65380 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#65380: [PATCH] Add command to copy contents in a diff-mode
 buffer
Date: Sun, 18 Aug 2024 15:29:25 +0000
[Message part 1 (text/plain, inline)]
Philip Kaludercic <philipk <at> posteo.net> writes:

> +          ;; copy the text between hunks
> +          (let (start)
> +            (save-window-excursion
> +              (save-excursion
> +                (forward-line -1)
> +                (diff-goto-source)
> +                (forward-line +1)
> +                (setq start (point))))

One issue I still have here is that the `forwarad-line' might scroll the
window, which `save-window-excursion' doesn't restore.  To fix this I
have written a general macro for subr.el to restore the scroll position:

[0002-Add-new-macro-to-restore-the-scroll-position-of-a-wi.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
and updated the previous patch accordingly (+ some other minor
improvements):

[0001-Add-command-to-copy-contents-in-a-diff-mode-buffer.patch (text/x-patch, attachment)]
[Message part 5 (text/plain, inline)]
-- 
	Philip Kaludercic on peregrine

This bug report was last modified 273 days ago.

Previous Next


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