unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: insert-file-contents and format-decode
Date: Sat, 30 Jun 2007 20:30:30 -0400	[thread overview]
Message-ID: <E1I4nKg-0002mH-UD@fencepost.gnu.org> (raw)
In-Reply-To: <46863A77.4030106@gmx.at> (message from martin rudalics on Sat, 30 Jun 2007 13:11:51 +0200)

    I currently run this in `insert-file-contents' once around the entire
    call sequence for `format-decode' and `after-insert-file-functions'.

That is the right way.

    Do we want undo boundaries before and/or after the insertion?

An editing primitive such as `Finsert_file_contents' should not make
any undo boundaries.  An undo boundary is made by the main editor loop
and by an explicit call to `undo-boundary'.

    I suppose we do not want to disable the hooks for the "non-insert-file"
    case, for example, interactive uses of `format-decode-region'.  Hence,
    your suggestion to handle undo in `insert-file-contents' implies that we
    have to disable these hooks in `insert-file-contents' too.

Right.

    Finally, I'm completely uncertain what to do about `format-insert-file':
    That function explicitly prompts for a format and does `format-decode'
    after inserting the file and running any `after-insert-file-functions'.
    Shall we treat this is as a sequence of


    (insert-file-contents filename nil beg end)

    (let ((format-alist nil))
       (format-decode-region (point) (+ (point) size) format))

    with _two_ `buffer-undo-list' entries and `after-change-functions'
    calls?

No, I suggest making just one undo entry for the insertion
of the decoded text.  Just as `insert-file-contents' would do.

  reply	other threads:[~2007-07-01  0:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 14:06 insert-file-contents and format-decode martin rudalics
2007-06-08  7:12 ` Richard Stallman
2007-06-17 13:34   ` martin rudalics
2007-06-18 21:31     ` Richard Stallman
2007-06-19  7:50       ` martin rudalics
2007-06-23 18:26         ` Richard Stallman
2007-06-23 18:26         ` Richard Stallman
2007-06-24 10:30           ` martin rudalics
2007-06-25 13:19             ` Richard Stallman
2007-06-26  6:54               ` martin rudalics
2007-06-26 22:48                 ` Richard Stallman
2007-06-27  6:33                   ` martin rudalics
2007-06-27 19:50                     ` Richard Stallman
2007-06-30 11:11                       ` martin rudalics
2007-07-01  0:30                         ` Richard Stallman [this message]
2007-07-02  8:14                           ` martin rudalics
2007-07-03  4:24                             ` Richard Stallman
2007-07-03  6:47                               ` martin rudalics
2007-07-04  3:43                                 ` Richard Stallman
2007-06-26 22:48                 ` Richard Stallman
2007-06-27  6:34                   ` martin rudalics
2007-06-27 23:43                     ` Richard Stallman
2007-06-30 11:32                       ` martin rudalics
2007-07-01  0:30                         ` Richard Stallman
2007-07-02  8:27                           ` martin rudalics
2007-07-03  4:24                             ` Richard Stallman
2007-07-03  6:43                               ` martin rudalics
2007-08-06 14:22                                 ` Richard Stallman

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=E1I4nKg-0002mH-UD@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /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).