unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: Eli Zaretskii <eliz@gnu.org>
Cc: arthur.miller@live.com, 50646@debbugs.gnu.org
Subject: bug#50646: 28.0.50; narrow-to-defun sometimes narrows to wrong defun
Date: Mon, 20 Sep 2021 00:53:48 +1200	[thread overview]
Message-ID: <23b323a6af5c91a665890b4cb5d3ba61@webmail.orcon.net.nz> (raw)
In-Reply-To: <83o88o4v53.fsf@gnu.org>

On 2021-09-20 00:17, Eli Zaretskii wrote:
> Then I suggest to mention insert-file-contents and other functions
> (if any) that do this explicitly.

Sounds sensible.  The pre-existing mention of `find-file-hook' means
(AFAIK) that we're already talking about more than just the two
'insert-file-contents*' functions.  The set of notable functions that
I know of are:

- find-file
- find-file-literally
- insert-file-contents
- insert-file-contents-literally
- insert-file
- insert-file-literally

The latter two are for interactive usage only (but analogous to the
insert-file-contents* functions, so maybe their docstrings should be
looked at too, for consistency).

For the `insert-file-contents-literally' docstring perhaps we just
need to add an explicit mention of `find-file'?


> Something like
>   This is contrary to other functions, like `insert-file-contents',
>   which may modify a buffer in several ways after ...

I now have this:

   "Like `insert-file-contents', but only reads in the file literally.
See `insert-file-contents' for an explanation of the parameters.

Insert after point the contents of file FILENAME as a sequence of
ASCII characters with no special encoding or conversion.

This is contrary to other functions, like `insert-file-contents' and
`find-file', which may modify a buffer in several ways after reading
into the buffer, due to Emacs features such as format decoding,
character code conversion, `find-file-hook', automatic uncompression,
etc.

Using `insert-file-contents-literally' ensures that none of these
modifications will take place."



I took "as a sequence of ASCII characters with no special encoding or
conversion" from (info "(emacs) Visiting") but I see that wording used
by `insert-file-literally' is "Insert contents of file FILENAME into
buffer after point with no conversion", and I figure the two should
probably use the same wording?  Is there a preference?


-Phil






  reply	other threads:[~2021-09-19 12:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 17:06 bug#50646: 28.0.50; narrow-to-defun sometimes narrows to wrong defun arthur.miller
2021-09-18 14:09 ` Lars Ingebrigtsen
2021-09-18 17:27   ` Arthur Miller
2021-09-18 18:34     ` Arthur Miller
2021-09-19  8:34   ` Arthur Miller
2021-09-19  3:41 ` Phil Sainty
2021-09-19  6:36   ` Arthur Miller
2021-09-19 10:56     ` Phil Sainty
2021-09-19 20:02       ` Arthur Miller
2021-09-19  8:33   ` Arthur Miller
2021-09-19 10:04     ` Phil Sainty
2021-09-19 12:01       ` Eli Zaretskii
2021-09-19 12:06         ` Phil Sainty
2021-09-19 12:17           ` Eli Zaretskii
2021-09-19 12:53             ` Phil Sainty [this message]
2021-09-19 13:43               ` Eli Zaretskii
2021-09-19 14:21                 ` Phil Sainty
2021-09-19 15:22                   ` Eli Zaretskii
2021-09-19 15:25             ` bug#50646: [External] : " Drew Adams
2021-09-19 19:57       ` Arthur Miller
2021-09-20  6:02         ` Lars Ingebrigtsen

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=23b323a6af5c91a665890b4cb5d3ba61@webmail.orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=50646@debbugs.gnu.org \
    --cc=arthur.miller@live.com \
    --cc=eliz@gnu.org \
    /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).