From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: emacs in text mode terminal paste problem (SecureCRT / xterm ) Date: Sun, 23 Nov 2008 04:38:23 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <84tz9zbbf4@e6g2000prf.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 1227481490 25153 80.91.229.12 (23 Nov 2008 23:04:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Nov 2008 23:04:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 24 00:05:52 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 1L4O1I-0001oc-0R for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Nov 2008 00:05:49 +0100 Original-Received: from localhost ([127.0.0.1]:38919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4O08-0004th-P5 for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Nov 2008 18:04:24 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!w24g2000prd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 112 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1227443903 4060 127.0.0.1 (23 Nov 2008 12:38:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 23 Nov 2008 12:38:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w24g2000prd.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.26.2 (KHTML, like Gecko) Version/3.2 Safari/525.26.12, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164705 X-Mailman-Approved-At: Sun, 23 Nov 2008 18:03:59 -0500 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:60041 Archived-At: Some general experience regard your problem. First of all, i like to note that SecureCRT is the ssh terminal of my choice in Windows platform, during the time when i was active in IT industry working on web stores, where Windows NT is used as company desktop, and Solaris are servers. This is during 1998 to 2002, i recall as a sys admin i ordered this software for all company to use. However, i haven't used Windows since about 2005. The general problem of copying and pasting thru different apps to server involves quite some complexities. In your example, when you copy a text, it first goes thru some munching from Window's system wide clipboard to your SecureCRT app, then from there thru telnet/ssh protocol. There in fact involves multiple instances of translations (at least 2 but i think more). When you copy a text from a Windows app to another, the copied text is in general not plain text, but involves possibly multiple versions such as rich text version and plain text version, and when you paste in another app, which version is pasted depends on the OS's clipboard system and the app. (for example, on the mac, you can copy text from Safari browser into Mac's TextEdit, the result is rich text that retains somewhat of the font and formatting (but not exactly), and when you paste into Apple Mail (with preference set to support html mail), the result also retains the formatting/font somewhat, but note that it has internally turned into html. And when you paste into, for example, Carbon Emacs or Aquamacs Emacs, you get plain text.) So, the point is that there are a lot conversions taking place. This conversions are not trivial. It depends on the OS's system of clipboard, and depends on what app you pasting it into. Also, line ending and text encoding may also have multated. Some app automatically convert line endings or text encoding. And when the copy/pasting involves telnet/ssh, it goes into another conversion because in general telnet as far as i knew in 2000, it basically support transmission using ascii. So, the only thing i can suggest is that given the above info, try to copy/paste so that it it goes thru minimal number of conversions, and find out where it went wrong, which character got wrong. Terminal app or telnet is especially problematic. Many of them simply don't support unicode or non-ascii chars, and some you need to experiment with its usually cryptic config/preference/options a lot in order to get it to work with a particular encoding. looking at your problem, i'm pretty sure SecureCRT tried to turn your unicode into some ascii with some control chars (esp sequences), of which emacs thinks you are pressing Meta. I'm not actually sure you can actually paste unicode thru terminal/telnet even today ... ... if you use another tunneling techonolgy, or some remote desktop technology, it may bypass all these telnet/ssh problems. Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Nov 22, 3:14 pm, emacsu...@invalid.org wrote: > Hi all! > > I've experienced problems pasting apostrophes or bullets originating > from rich text documents like Word into an emacs running in text mode > in a SecureCRT window. I run emacs 21.4.1 in text mode via ssh using > SecureCRT using xterm emulation. > > Problems pasting bullets from Word or Notepad into SecureCRT terminal win= dow: > ------------------------------------------------------------------ > When pasting text that includes bullet from word (that uses Windows > Symbol font), the paste generates an error in emacs; > Scan error: "Unbalanced parentheses", 1790, 1 > > I have no idea what emacs function the bullet is causing to run there. > > Problems pasting an apostrophe ' from Word into SecureCT terminal window: > ------------------------------------------------------------------------- > An apostrophe that get pasted appears to invoke "Regexp I-search backward= " somehow. > The search of course usually fails, because it can't find all of the > text that follows. > > For example, if I select and copy the following line in Word: > Bob's responsibilities include: > > And paste it into the securecrt window where emacs is running inside > of screen, emacs jumps the cursor backwards to where it finds the > first instance of the letter s followed by a space, and gives the > error: > > Failing regexp I-search backward: s responsibilities include: > > And the lines that follow the line that had the ' on it, end up > getting inserted into the middle of the rest of things depending on > where the search failed (usually after a word that ends in s followed > by a space). It generally ends up looking like a dog's breakfast. > > Interestingly, apostrophe's created, and copied from Notepad... no > problem. Apostrophes from Word, pasted into Notepad, copied from > notepad and then into the terminal window still exhibit the issue. > It's friggin weird. > > Also interestingly, these issues don't occur when using ssh in a > cygwin windows with the TERM set to vt220. Emacs -nw over ssh in > cygwin with the term set to cygwin is a complete catastrophe, but > that's an issue for another time. > > Ideas? Experiences? Workarounds? > > Bob