From: Eli Zaretskii <eliz@gnu.org>
To: "Aurélien Aptel" <aurelien.aptel+emacs@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: best way to display alternate view of file
Date: Wed, 19 Apr 2017 17:49:09 +0300 [thread overview]
Message-ID: <838tmwcv16.fsf@gnu.org> (raw)
In-Reply-To: <CA+5B0FOLtXJ=HAOYafR52f6xUfvjomZ-Jv5H2oc=9kTg0_6eOQ@mail.gmail.com> (message from Aurélien Aptel on Wed, 19 Apr 2017 15:45:08 +0200)
> From: Aurélien Aptel <aurelien.aptel+emacs@gmail.com>
> Date: Wed, 19 Apr 2017 15:45:08 +0200
>
> I would like to use the regular mechanism (add a cons to the auto-load
> list for .pcap files) but I don't actually want to display the raw
> file, I want to use my function to show an "alternate" view of the
> file.
>
> What's the idiomatic way to do a mode like this in Elisp?
I don't understand the nature of your difficulty. The mode function
can do anything with the buffer; Emacs won't display the buffer until
the mode function does its thing and exits. So if your mode function
produces an alternate view of the file, the raw view will never be
seen.
If the problem is that you want to produce the alternate view in
another buffer, you could use buffer-swap-text, like Rmail and Tar
mode do.
next prev parent reply other threads:[~2017-04-19 14:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 13:45 best way to display alternate view of file Aurélien Aptel
2017-04-19 13:49 ` Kaushal Modi
2017-04-19 14:49 ` Eli Zaretskii [this message]
2017-04-19 15:01 ` Stefan Monnier
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=838tmwcv16.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=aurelien.aptel+emacs@gmail.com \
--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.