From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: unicode encoding and curly quotes [was: How to open a file in sh-mode] Date: Thu, 11 Sep 2008 15:58:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: <44043b4c-ffad-437e-a8d4-5b049fc4d136@v16g2000prc.googlegroups.com> References: <64d8ebaf-0c89-4e9d-9aee-86b4e9414449@o40g2000prn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1221176490 25487 80.91.229.12 (11 Sep 2008 23:41:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2008 23:41:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 12 01:42:25 2008 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 1Kdvnm-0001bQ-UY for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2008 01:42:19 +0200 Original-Received: from localhost ([127.0.0.1]:44316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kdvmm-0003GD-6n for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Sep 2008 19:41:16 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v16g2000prc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 152 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1221173912 2409 127.0.0.1 (11 Sep 2008 22:58:32 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 11 Sep 2008 22:58:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v16g2000prc.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:162112 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:57455 Archived-At: David Combs wrote: > Xah-- question about the characters in your posts: > > If I or someone sees eg a url in one of your posts, and > wants to go to that url (because you've suggested doing that, > maybe), it's a little difficult to just cut-n-paste your string, > what with all the extra control or whatever they are characters > mixed in. > > What is that stuff, why is it there, and is it really necessary > for you to include it. The summation sign =E2=80=9C=E2=88=91=E2=80=9D in my sig is my and my websi= te signet. in the end of my sig, there's this character =E2=80=9C=E2=98=84=E2=80=9D (u= nicode name =E2=80=9Ccomet=E2=80=9D). It is there so that it forces groups.google.com a= nd Apple Mail application into sending the message with unicode encoding. Otherwise, the heuristics'll typically pick Japanese encoding. (in google groups, last i checked about last year there's no way to set encoding. And in Apple Mail 2 years ago, there's no unicode encoding option... it is added now but last i checked there's no preference that can set encoding ... ) My use of curly quotes =E2=80=9C =E2=80=9D or other unicode chars are just = convenience and practical need. I have in my emacs various easy ways to type them. The need to quote is for example, seen throughout gnu's docs, but they used a ascii cludge of backtick for left curly single quote and straight quote for right curly single quote, e.g. =E2=80=9C`something'=E2= =80=9D. (quoting is needed for highlighting purporses or to make a phrase's semantic from normal interpretation in the sentence.) Since about 2006, i find emacs's support of unicode very roburst and i have no problem with these and other mathematical chars or chinese in emacs. In general, opensource langs and tools in e.g. linux world has much caught on and support unicode, and i think that is good. (commercial world long ago supported and use these chars in practice (e.g. Apple in early 1990s and Microsoft Windows since about WindowsNT 4 or Windows2000)) The OpenSource world typically has a lag of 5 to 10 years in catching up most desktop techs. Even today, there are still a few cave dwelling tech geekers you'll see occationally complaint about unicode in posts (e.g. Alan M here insists that newsgroup posts should be in ascii only!). But thankfully these days you'll often see others tech geekers follow up chiding about the complainer like =E2=80=9Cdude, get= a proper newsreader=E2=80=9D ... You FreeSoftware and OpenSource supporters really should move on and embrace unicode. I have made few suggestions here and elsewhere in the past 2 years including several private exchanges with Richard Stallman, about updating emacs doc (and in general all GNU docs convention) to to use =E2=80=9C=E2=80=9D and =E2=80=98=E2=80=99 in place of painful and ugly and = technically problematic and ambiguous ascii kludge `', among few other modernization issues... but in general it's met with extreme difficulty... i've been wanting to file a emacs bug report on this particular issue ... but with so many resistance and my =E2=80=9Ctroll=E2=80=9D person= a etc ... basically it's very disencouraging ... The problem with `' or ``'' is that: =E2=80=A2 it's just 1980's ascii kludge to get around the fact there were n= o matching quotes in ascii. In some technical sense, it's misuse and abuse of symbols. =E2=80=A2 it's ugly. =E2=80=A2 it's ambiguous. The straight quote has many meanings, and both straight quote and backtick also has special meanings in elisp lang and in function's inline doc string. =E2=80=A2 it is not possible to do a syntactical parse. (compare it to quot= ing with chars that are matching pairs.) If you think there's some merit in this suggestion, please file a bug report. (menu =E2=80=9CHelp=E2=80=A3Send Bug Report...=E2=80=9D) Xah =E2=88=91 http://xahlee.org/ =E2=98=84 > >----------------------------------- > >How Emacs Choose Modes > > >Emacs determines what mode to use primarily by 2 mechanisms, in order: > >(1) Check the first line in the file, using =E2=80=9Cmagic-mode-alist=E2= =80=9D. (2) > >Check the file name's suffix, using =E2=80=9Cauto-mode-alist=E2=80=9D. > > >The =E2=80=9Cmagic-mode-alist=E2=80=9D is a list that emacs use to match= the first > >line of a file with a mode. For example, if you want files that begin > >with the line =E2=80=9C >always use nxml-mode, then add the following to your =E2=80=9C.emacs=E2= =80=9D: > > >(add-to-list > > 'magic-mode-alist > > '(" > >The magic-mode-alist is a list. In the above example, the string with > >the =E2=80=9CDOCTYPE=E2=80=9D is a regex, used to match the first line o= f a file. > > >If emacs goes thru magic-mode-alist and didn't find any match, then > >it'll use auto-mode-alist to check on file name suffix. The =E2=80=9Caut= o-mode- > >alist=E2=80=9D associates a file name suffix with a mode. For example, i= f you > >want files ending in =E2=80=9C.js=E2=80=9D to always open with js2-mode,= then do: > > >(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) > > >Note: The double backslash in the string =E2=80=9C\\.js\\'=E2=80=9D is u= sed to escape > >the backslash. So, the regex engine just got =E2=80=9C\.js\'=E2=80=9D. T= he =E2=80=9C\.=E2=80=9D is to > >match a period. The =E2=80=9C\'=E2=80=9D is one of emacs special regex s= yntax, to > >match end of a string. (See also: Text Pattern Matching in Emacs) > > >Reference: Elisp Manual: Regexp-Backslash. > > >You can see what are the values of magic-mode-alist or auto-mode-alist > >by typing =E2=80=9CAlt+x describe-variable=E2=80=9D. > > >There are few minor details about how emacs determines what mode to > >load, but the above should cover vast majority of needs. For detail, > >see emacs manual. > > >Reference: (info "(emacs)Choosing Modes"). > > >-------------------------------------------- > >above from: > >http://xahlee.org/emacs/emacs_installing_packages.html > > > Xah > >=E2=88=91http://xahlee.org/ > > >=E2=98=84