unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Niels Giesen <niels.giesen@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: emacs in text mode terminal paste problem (SecureCRT / xterm )
Date: Sun, 23 Nov 2008 09:02:24 +0100	[thread overview]
Message-ID: <87ej127tv3.fsf@gmail.com> (raw)
In-Reply-To: 84tz9zbbf4@e6g2000prf.googlegroups.com

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


  reply	other threads:[~2008-11-23  8:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-22 23:14 emacs in text mode terminal paste problem (SecureCRT / xterm ) emacsuser
2008-11-23  8:02 ` Niels Giesen [this message]
2008-11-23 10:02 ` Peter Dyballa
2008-11-23 12:38 ` Xah Lee
2008-11-23 19:40   ` Phil Carmody
     [not found] ` <mailman.1058.1227434549.26697.help-gnu-emacs@gnu.org>
2008-11-23 20:59   ` emacsuser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ej127tv3.fsf@gmail.com \
    --to=niels.giesen@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).