* Re: displaying one character per line.
[not found] <mailman.311.1077514489.340.help-gnu-emacs@gnu.org>
@ 2004-02-23 6:21 ` Sandip Chitale
2004-02-23 9:40 ` Floyd Davidson
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Sandip Chitale @ 2004-02-23 6:21 UTC (permalink / raw)
M-x query-replace-regexp RET
\(.\) RET
\1C-q C-j RET
!
"Joe Corneli" <jcorneli@math.utexas.edu> wrote in message news:mailman.311.1077514489.340.help-gnu-emacs@gnu.org...
> What to do to get this to look like this:
>
> W
> h
> a
> t
>
> t
> o
>
> d
> o
>
> t
> o
>
> g
> e
> t
>
> t
> h
> i
> s
>
> t
> o
>
> l
> o
> o
> k
>
> l
> i
> k
> e
>
> t
> h
> i
> s
> :
>
> 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
> do
> to
> get
> this
> to
> look
> like
> this:
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: displaying one character per line.
[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
2004-02-23 12:23 ` Alan Mackenzie
2004-02-24 8:38 ` Kai Grossjohann
3 siblings, 0 replies; 6+ messages in thread
From: Floyd Davidson @ 2004-02-23 9:40 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: displaying one character per line.
[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
@ 2004-02-23 12:23 ` Alan Mackenzie
2004-02-24 8:38 ` Kai Grossjohann
3 siblings, 0 replies; 6+ messages in thread
From: Alan Mackenzie @ 2004-02-23 12:23 UTC (permalink / raw)
Joe Corneli <jcorneli@math.utexas.edu> wrote on Sun, 22 Feb 2004 23:33:24
-0600:
> What to do to get this to look like this:
> W
> h
> a
> t
> d
> o
> y
> o
> u
> g
> e
> t
> i
> f
> y
> o
> u
> m
> u
> l
> t
> i
> p
> l
> y
> s
> i
> x
> b
> y
> n
> i
> n
> e
> ?
> 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:
If it's not too intrusive a question, why? I mean, is it to satisfy an
"Emacs can do anything" challenge, or do you want to have 40 windows side
by side in a frame, or what?
Just wondering. :-)
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: displaying one character per line.
[not found] <mailman.311.1077514489.340.help-gnu-emacs@gnu.org>
` (2 preceding siblings ...)
2004-02-23 12:23 ` Alan Mackenzie
@ 2004-02-24 8:38 ` Kai Grossjohann
3 siblings, 0 replies; 6+ messages in thread
From: Kai Grossjohann @ 2004-02-24 8:38 UTC (permalink / raw)
Joe Corneli <jcorneli@math.utexas.edu> writes:
> 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:
You can add overlays to the buffer with :before-string or
:after-string properties. Not sure if this is also possible with text
properties, though. If you need to use overlays, then you need to
move the overlays when the buffer changes...
longlines.el uses a similar mechanism to show hard newlines with the ¶
symbol. But I didn't write it, so I don't know how it is done.
Kai
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: displaying one character per line.
@ 2004-02-23 19:47 Joe Corneli
0 siblings, 0 replies; 6+ messages in thread
From: Joe Corneli @ 2004-02-23 19:47 UTC (permalink / raw)
I want to be able to switch between different list views of a
document. For example, one might want to look at a text document as
a list of characters, a list of words, a list of phonemes, a list
(tree) of syntactic clauses, a list of sentences, or a list of topic
sentences that link to paragraphs, etc. Characters just happen to be
the simplest.
This is part of designing a mode I call todl-mode (for TODo List).
TODL is a variation on LISP specially designed for cyborgs :). The
idea is that if you can switch between different list views and add
hyperlinks to elements of each view, you will have a very powerful
tool for processing information.
I think of it as being somewhere in between lisp-mode,
emacs-wiki-mode, and something like outline-mode. It should be
possible to implement a TODL variant for any kind of code (so
todl-mode is also something like font-lock-mode).
^ permalink raw reply [flat|nested] 6+ messages in thread
* displaying one character per line.
@ 2004-02-23 5:33 Joe Corneli
0 siblings, 0 replies; 6+ messages in thread
From: Joe Corneli @ 2004-02-23 5:33 UTC (permalink / raw)
What to do to get this to look like this:
W
h
a
t
t
o
d
o
t
o
g
e
t
t
h
i
s
t
o
l
o
o
k
l
i
k
e
t
h
i
s
:
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
do
to
get
this
to
look
like
this:
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-02-24 8:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
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
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).