unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Adam Tack <adam.tack.513@gmail.com>
Cc: 28622@debbugs.gnu.org
Subject: bug#28622: 25.1; EasyPG conflicts with tar-mode
Date: Fri, 05 Feb 2021 11:19:40 +0100	[thread overview]
Message-ID: <87ft2ake9v.fsf@gnus.org> (raw)
In-Reply-To: <CAA+VxxHtfdUWQwdSO1QTDj7680OWxyojJLBinSs9kFSM=YWYqw@mail.gmail.com> (Adam Tack's message of "Sat, 7 Apr 2018 01:47:21 +0200")

Adam Tack <adam.tack.513@gmail.com> writes:

> The issue is also present in emacs 24.5.1 and 26.1 (latest from git -
> 5659b2fe843627aa4b6d450758f71920143ac173).
>
> I think that the problem is caused by the fact that
> `epa-file-write-region' (which is used when saving buffers
> corresponding to `.gpg' files), does not call any of the
> `write-region-annotate-functions', directly or indirectly.
>
> `tar-mode' normally uses `tar-write-region-annotate' (which is added
> to `write-region-annotate-functions') to select the tar data buffer
> instead of the buffer containing the file listing, when saving.

Indeed.

The documentation of `write-region-annotate-functions' is nice...

----

A list of functions to be called at the start of ‘write-region’.
Each is passed two arguments, START and END as for ‘write-region’.
These are usually two numbers but not always; see the documentation
for ‘write-region’.  The function should return a list of pairs
of the form (POSITION . STRING), consisting of strings to be effectively
inserted at the specified positions of the file being written (1 means to
insert before the first byte written).  The POSITIONs must be sorted into
increasing order.

If there are several annotation functions, the lists returned by these
functions are merged destructively.  As each annotation function runs,
the variable ‘write-region-annotations-so-far’ contains a list of all
annotations returned by previous annotation functions.

An annotation function can return with a different buffer current.
Doing so removes the annotations returned by previous functions, and
resets START and END to ‘point-min’ and ‘point-max’ of the new buffer.

----

... but the only implementation of this algorithm is in C, spread out
over build_annotations and a_write.  :-/

Exposing any of that to the Lisp level doesn't seem practical (after
looking at the code for a couple of minutes), so if this is to work for
epa, then a Lisp implementation has to be written.

Before embarking on that -- has anybody looked at this before?  And
hopefully have an implementation somewhere they've just forgotten to
push?  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      reply	other threads:[~2021-02-05 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 17:30 bug#28622: 25.1; EasyPG conflicts with tar-mode lawfullazy
2018-04-06 23:47 ` Adam Tack
2021-02-05 10:19   ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ft2ake9v.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=28622@debbugs.gnu.org \
    --cc=adam.tack.513@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).