From: "Drew Adams" <drew.adams@oracle.com>
To: "'Eli Zaretskii'" <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: search files with conversion but fundamental mode, no handlers, no file-local vars
Date: Thu, 20 Dec 2012 14:01:05 -0800 [thread overview]
Message-ID: <F6DDF30CFA7140358779101C9A9F4326@us.oracle.com> (raw)
In-Reply-To: <83sj70mmoz.fsf@gnu.org>
> FWIW, I think most, if not all, things inhibited by
> mm-insert-file-contents are either not needed or incorrect.
>
> > (letf* ((format-alist nil)
> > (auto-mode-alist (if inhibit nil (mm-auto-mode-alist)))
>
> auto-mode-alist is not consulted by insert-file-contents, AFAIK.
>
> > ((default-value 'major-mode) 'fundamental-mode)
>
> Why? to protect from someone who overrides the default?
As I said, I don't have the source code for `insert-file-contents', so I don't
know what it does. Why does `mm-i-f-c' redefine `default-value' locally?
If `auto-mode-alist' is not used by `i-f-c', and file-local variables are not
used, then how would a mode other than fundamental be used by it?
I was gathering, from the `mm-i-f-c' code and doc, that `i-f-c' did _not_
protect these things. And unfortunately the doc for `i-f-c' says nothing about
any of these things specifically - unlike the doc of `mm-i-f-c'. Who knows what
`i-f-c' does or does not do, and how it is really different from `mm-i-f-c'?
> > (enable-local-variables nil)
>
> insert-file-contents does not evaluate file-local variables, AFAIK.
So why does `mm-i-f-c' make sure to bind it to ()?
> > (after-insert-file-functions nil)
>
> This decodes the file, which you do want.
What is "this"? `after-insert-file-functions'? Or binding that to ()? If the
latter, then I guess I need such a binding.
The doc for `mm-i-f-c' says that it does code conversion, which I understood to
include decoding. Doesn't that mean that this is not done via
`after-insert-file-functions', since that is bound to ()?
> > (enable-local-eval nil)
>
> See above.
What/where? What does `i-f-c' do wrt `enable-local-eval'?
> > (inhibit-file-name-operation (if inhibit
> > 'insert-file-contents
> >
> > inhibit-file-name-operation))
> > (inhibit-file-name-handlers
> > (if inhibit
> > (append mm-inhibit-file-name-handlers
> > inhibit-file-name-handlers)
> > inhibit-file-name-handlers))
>
> This is a bug, IMO, at least in the general case: why should any code
> like what you wanted to write be prevented from working on remote
> files?
What is the bug? Are you saying that `mm-i-f-c' should not include such a
binding?
In my case, I do not really want remote file handlers to kick in.
What does `i-f-c' do wrt remote files? For a workhorse function, its doc seems
quite paltry. About the only thing it is specific about is code conversion.
> > (ffh (if (boundp 'find-file-hook)
> > 'find-file-hook
> > 'find-file-hooks))
> > (val (symbol-value ffh)))
> > (set ffh nil)
>
> I don't think find-file-hook/hooks is relevant, as you don't invoke
> find-file here.
OK.
It's still not at all clear to me which I should use, I'm afraid. Starting with
the obvious question: Why, if `i-f-c' does all of what you say, are those
bindings needed in `mm-i-f-c'? And why does the `mm-i-f-c' doc make a point of
saying that it acts differently in regard to these particular things than does
`i-f-c'? You seem to be saying that they act the same (?).
Let me be clear: I am not arguing about what the case is or isn't - I'm not
arguing at all. I'm just asking, to learn, and (still) wondering what I should
use.
next prev parent reply other threads:[~2012-12-20 22:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-20 18:57 search files with conversion but fundamental mode, no handlers, no file-local vars Drew Adams
2012-12-20 19:04 ` Eli Zaretskii
2012-12-20 19:42 ` Drew Adams
2012-12-20 21:35 ` Eli Zaretskii
2012-12-20 22:01 ` Drew Adams [this message]
2012-12-21 8:51 ` Eli Zaretskii
2012-12-20 21:42 ` Stefan Monnier
2012-12-20 22:01 ` Drew Adams
2012-12-20 22:22 ` Stefan Monnier
2012-12-20 22:47 ` Drew Adams
2012-12-21 3:47 ` Stefan Monnier
2012-12-21 4:02 ` Drew Adams
2012-12-21 4:52 ` Stefan Monnier
2012-12-21 11:53 ` Eli Zaretskii
2012-12-21 16:13 ` Drew Adams
2012-12-21 8:54 ` Eli Zaretskii
2012-12-21 14:44 ` Stefan Monnier
2012-12-21 15:09 ` Eli Zaretskii
2012-12-22 16:00 ` Stefan Monnier
2012-12-21 16:12 ` Drew Adams
2012-12-21 8:39 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F6DDF30CFA7140358779101C9A9F4326@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@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 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.