all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: best way to display alternate view of file
Date: Wed, 19 Apr 2017 11:01:11 -0400	[thread overview]
Message-ID: <jwvinm0v42x.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: CA+5B0FOLtXJ=HAOYafR52f6xUfvjomZ-Jv5H2oc=9kTg0_6eOQ@mail.gmail.com

> What's the idiomatic way to do a mode like this in Elisp?

I don't think there's one idiomatic way to do this.
- For HTML and Info we have commands that create (and display) a separate
  buffer containing the rendering.
- For doc-view-mode and hexl-mode we have commands we swap between the
  two views within the same buffer (usually using C-c C-c to go back to
  the "source", but it could probably be used more generally as "swap").
- In nhexl-mode, the user-view is similar to hexl-mode, but the buffer
  is not modified (the rendering is done via overlays and `display`
  text properties).
The first option is usually easier.


        Stefan




      parent reply	other threads:[~2017-04-19 15:01 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
2017-04-19 15:01 ` Stefan Monnier [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

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

  git send-email \
    --in-reply-to=jwvinm0v42x.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.