all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Floyd Davidson <floyd@barrow.com>
Subject: Re: displaying one character per line.
Date: Mon, 23 Feb 2004 00:40:47 -0900	[thread overview]
Message-ID: <87d686uo9s.fld@barrow.com> (raw)
In-Reply-To: mailman.311.1077514489.340.help-gnu-emacs@gnu.org

Joe Corneli <jcorneli@math.utexas.edu> wrote:
>What to do to get this to look like this:
>
>W
>h
>a

...

>I don't mean just the search-and-replace solution: I am thinking
>that the buffer should have the same content as it does normally,
>just shown in this weird display mode.  I'd also like to be able to
>do a word-based version of the same thing:
>
>What
>to

If you replace each character in the current-display-table with
a string that is the same character plus a newline, you'll get
the first display.  The second is much shorter, as all that
needs replacing are spaces and tabs, each with a newline.

There's a slight difference between GNU Emacs and the latest
versions of XEmacs for setting the display table.

This function doesn't do what you are asking about, but it does
the same thing with other characters (extended ascii characters
that the fonts I use have no characters for).  You can pretty
much tell from this example how to do what you want.

;;;
;;;  Display various extended ascii characters
;;;
(defvar bdt (make-display-table))

(defun fld-fix-current-display-table ()
  "Change current-display-table to print various high bit
  extended ASCII characters  as regular ascii characters
  or a string.

   \\200 --> EUR    \\214 --> OE    \\227 --> ---
   \\202 --> ,      \\221 --> \`    \\226 --> --
   \\203 --> f      \\222 --> \'    \\230 --> ~
   \\204 --> ,,     \\223 --> \"    \\231 --> (TM)
   \\205 --> ...    \\224 --> \"    \\233 --> >
   \\213 --> <      \\225 --> *     \\234 --> oe"

  (interactive)
  (setq bdt (make-display-table))
  (aset bdt ?\200 [?E ?U ?R])           ;\200 = EUR
  (aset bdt ?\202 [?,])                 ;\202 = ,
  (aset bdt ?\203 [?f])                 ;\203 = f
  (aset bdt ?\204 [?, ?,])              ;\204 = ,,
  (aset bdt ?\205 [?. ?. ?.])           ;\205 = ...
  (aset bdt ?\213 [?<])                 ;\213 = <
  (aset bdt ?\214 [?O ?E])              ;\214 = OE
  (aset bdt ?\221 [?`])                 ;\221 = `
  (aset bdt ?\222 [?'])                 ;\222 = '
  (aset bdt ?\223 [?\"])                ;\223 = "
  (aset bdt ?\224 [?\"])                ;\224 = "
  (aset bdt ?\225 [?*])                 ;\225 = *
  (aset bdt ?\226 [?- ?-])              ;\226 = --
  (aset bdt ?\227 [?- ?- ?-])           ;\227 = ---
  (aset bdt ?\230 [?~])                 ;\230 = ~
  (aset bdt ?\231 [?( ?T ?m ?)])        ;\231 = (Tm)
  (aset bdt ?\233 [?>])                 ;\233 = >
  (aset bdt ?\234 [?o ?e])              ;\230 = oe

  ;; comment out this line for use with GNU Emacs
  (set-specifier current-display-table bdt))

  (setq buffer-display-table current-display-table))

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

  parent reply	other threads:[~2004-02-23  9:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.311.1077514489.340.help-gnu-emacs@gnu.org>
2004-02-23  6:21 ` displaying one character per line Sandip Chitale
2004-02-23  9:40 ` Floyd Davidson [this message]
2004-02-23 12:23 ` Alan Mackenzie
2004-02-24  8:38 ` Kai Grossjohann
2004-02-23 19:47 Joe Corneli
  -- strict thread matches above, loose matches on Subject: below --
2004-02-23  5:33 Joe Corneli

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=87d686uo9s.fld@barrow.com \
    --to=floyd@barrow.com \
    /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.