From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Floyd Davidson Newsgroups: gmane.emacs.help Subject: Re: displaying one character per line. Date: Mon, 23 Feb 2004 00:40:47 -0900 Organization: __________ Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87d686uo9s.fld@barrow.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1077530580 22234 80.91.224.253 (23 Feb 2004 10:03:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2004 10:03:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 23 11:02:56 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvCvQ-0001qr-00 for ; Mon, 23 Feb 2004 11:02:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvCg1-0000qc-Hq for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Feb 2004 04:47:01 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newshosting.com!nx01.iad01.newshosting.com!66.150.105.61.MISMATCH!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!falcon.america.net!eagle.america.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.0 Cancel-Lock: sha1:qDJRw0NMMZiUdXP9Q9BqgDH0dsg= Original-Lines: 76 Original-NNTP-Posting-Host: 209.124.156.174 Original-X-Trace: eagle.america.net 1077529292 209.124.156.174 (Mon, 23 Feb 2004 04:41:32 EST) Original-NNTP-Posting-Date: Mon, 23 Feb 2004 04:41:32 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:121135 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:17086 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17086 Joe Corneli 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 Ukpeagvik (Barrow, Alaska) floyd@barrow.com