From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ingo Menger Newsgroups: gmane.emacs.help Subject: Re: Meta-Characters, Special Characters Date: 31 May 2007 02:25:58 -0700 Organization: http://groups.google.com Message-ID: <1180603558.683418.313690@q66g2000hsg.googlegroups.com> References: <5c2mbdF2ung8hU1@mid.individual.net> <1180481373.651591.253210@i38g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1180615757 18064 80.91.229.12 (31 May 2007 12:49:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 31 May 2007 12:49:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 31 14:49:11 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Htk5X-0003AZ-8k for geh-help-gnu-emacs@m.gmane.org; Thu, 31 May 2007 14:49:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Htk5W-0007VA-QN for geh-help-gnu-emacs@m.gmane.org; Thu, 31 May 2007 08:49:10 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q66g2000hsg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help, comp.emacs, comp.lang.perl.misc, comp.lang.java.programmer, comp.lang.lisp Original-Lines: 88 Original-NNTP-Posting-Host: 141.113.85.21 Original-X-Trace: posting.google.com 1180603559 25269 127.0.0.1 (31 May 2007 09:25:59 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 31 May 2007 09:25:59 +0000 (UTC) In-Reply-To: <1180481373.651591.253210@i38g2000prf.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; dcdev001; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: q66g2000hsg.googlegroups.com; posting-host=141.113.85.21; posting-account=gOG3PgwAAAAhtfauXPspEVJ7HnvQYTLj Original-Xref: shelby.stanford.edu gnu.emacs.help:148976 comp.emacs:94398 comp.lang.perl.misc:609757 comp.lang.java.programmer:785417 comp.lang.lisp:221444 X-Mailman-Approved-At: Thu, 31 May 2007 08:48:47 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44569 Archived-At: On 30 Mai, 01:29, x...@xahlee.org wrote: > Will (aka weber) wrote: > > =AB > [about the various ways to input or represent keystrokes and or non- > printable characters in Emacs] > > As far as I can see in all those situations entering meta-characters > is > addressed in a different way which I find confusing, e.g.: > a) _or_ C-q > b) C-q C-[, C-q C-m, C-q C-j, C-q C-i > c) \e, \r, \n, \t > d) (define-key [(meta c) (control c) (tab c)] "This is confusing!") > =BB > > None of this complexity is istrinsic. > > Will wrote: > > =ABa) _or_ C-q =BB > > The C-q (or, pressing the Control key down then type q) is the > keyboard shortcut to invoke the command quoted-insert. It is a > general a way to allow you to input any non-printable characters. This > facility usually don't exist in other text editors. In popular text > editor such as Microsoft Word or Mac's Application, you usally bring > up a window showing all the special characters, then press a button to > insert the char you want. > > =AB b) C-q C-[, C-q C-m, C-q C-j, C-q C-i=BB > > In this, the C-q is the keyboard shortcut to invoke the command quoted- > insert, which will insert a literal character of whatever character > you can type on your keyboard. So, for example, C-q followed by the > tab key will insert a the non-printable character tab. > > When speaking of non-printable characters, the context is a character > set standard. Implicitly, we are talking about ASCII, and this applies > to emacs. Now, in ASCII, there are about 30 non-printable characters. > Each of these is given a standard abbreviation, and several > representations for different purposes. For example, ASCII 13 is the > "Carriage return" character, with abbr code CR, and ^M as its control- > key-input representation. (M being the 13th of the English alphabet) > > For the full detail, look at the table here:http://en.wikipedia.org/wiki/= Ascii > > (Note: Emacs also have a general way to input non-printable characters > of the unicode standard. See > Emacs and Unicode Tipshttp://xahlee.org/emacs/emacs_n_unicode.html > ) > > =AB c) \e, \r, \n, \t =BB > > This is a ad-hoc set of input and display representation for a few non- > printable characters. This set is started by the motherfucking unix > tech geeking morons, and by its free and speedy nature as cigarette > given to children, today has spread to many languages (Perl, Java, C+ > +, C#, Python, JavaScript ...) and is a de facto standard. The damage > is to such a degree that the general concept of unprintable > characters, their representation, and their method of input, all > treated in one systematic, simple way, are not in the consciousness of > average industrial programers. At least not in yours, it seems. You do not understand, that \n is not a way to enter the newline character, but is a way to name the newline character without actually using it right mow. The difference between using a character and mentioning (i.e. speaking about) a character did not come to your mind yet, did it? > I do not know the history of these display representations. (hopefully > someone will) It is my guess, that part of the reason for these, is > that the unix text editor vi, doesn't have a general way to input non- Type Ctrl+V when vi is in input mode and then type the character you want. But note that, in most languages, the string literals "Xah Lee knows not much" and "Xah Lee\n knows not much" are very different. In fact, some languages will not even recognize the first one as string literal. This, again, has to do with the fact, that string literals are a way to *mention* charachters that the compiled programm will later *use*.