From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Niels Giesen Newsgroups: gmane.emacs.help Subject: Re: emacs in text mode terminal paste problem (SecureCRT / xterm ) Date: Sun, 23 Nov 2008 09:02:24 +0100 Organization: A noiseless patient Spider Message-ID: <87ej127tv3.fsf@gmail.com> References: <84tz9zbbf4@e6g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1227429646 9057 80.91.229.12 (23 Nov 2008 08:40:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Nov 2008 08:40:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 23 09:41:48 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 1L4AXM-0007js-LE for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Nov 2008 09:41:48 +0100 Original-Received: from localhost ([127.0.0.1]:33887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4AWD-0001GH-Fh for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Nov 2008 03:40:37 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news.motzarella.org!motzarella.org!news.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 72 Original-X-Trace: news.motzarella.org U2FsdGVkX1+EGADxPx4nDGBhx6aqcSel7Gh/GUt3gs9jPfy7ZNm3ftwl9qVoZZ3RoLQZKOKKWScXSpvjIKYru5ow/n7EDUZ8yO4ms0zS3o2gVW02bn4UpRklfU0mQAVwZGxWiRmtf3w= Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Sun, 23 Nov 2008 08:02:26 +0000 (UTC) X-Auth-Sender: U2FsdGVkX18HNyY5HZ3M/yBSDHLdaI8m Cancel-Lock: sha1:SpVX7dl8aGiDYbR/S8lTEm+gunc= sha1:5ce7jg39Rjy9g9dbjHOfFHW0UqA= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:164701 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:60033 Archived-At: emacsuser@invalid.org writes: > 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 window: > ------------------------------------------------------------------ > 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? Just a hunch: The apostrophe generated by word might be a true apostrophe somewhere higher up the Unicode ladder. Apostrophes, single opening and ending quotes and the sign for minutes are all input using the ' key on your keyboard but changed on the fly to their respective typographical forms. Even if the glyphs look the same (in case of a bad font), the character codes are different. If that is the case, try and paste other Unicode letters, to generalize the issue. It seems somewhere things get mangled (maybe control chars being sent to emacs). What happens if you paste it into a screen window not running emacs (e.g. pasting onto the command line)? Maybe a workaround is to convert the word document to plain text using antiword first. I think this is/can be present on cygwin. Another workaround, if possible (?), might be to turn off automatic apostrophe conversion in word. -- http://niels.kicks-ass.org