help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with Smart Quotes and other special characters


From: Alan Stein
Subject: Problems with Smart Quotes and other special characters
Date: Sun, 22 Dec 2002 18:26:57 GMT
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Using emacs under the Terminal with OSX, I've found the display gets
messed up when I try to paste text from Microsoft Word with "Smart
Quotes" and other special characters like hyphens and formatting
instructions (like bold or italics) in them. I've found myself pasting
into TextEdit instead and removing the smart quotes and other
problematic characters I find. I know there should be a way of dealing
with them from within emacs. Anyone know how?
-- 
Alan Stein a.stein@snet.net

How long will we pretend Yasser Arafat isn't a terrorist?
>From help-gnu-emacs-bounces@gnu.org  Sun Dec 22 14:05:09 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsread.com!newsstand.netaxs.com!POSTED.monger.newsread.com!not-for-mail
Newsgroups: gnu.emacs.help
X-Newsreader: Gnus v5.8.8/Emacs 20.7.2 [Linux 2.2.16]
X-Home-Page: http://www.trollope.org
From: Michael Powe <michael+gnus@trollope.org>
Message-ID: <ulm2hc1zw.fsf@trollope.org>
Organization: The Hospice of the Mind
Lines: 56
Cache-Post-Path: 
gaspra.spiretech.com!unknown@slip-32-100-238-101.ca.us.prserv.net
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
Date: Sun, 22 Dec 2002 19:00:43 GMT
NNTP-Posting-Host: 207.173.200.229
X-Complaints-To: Abuse Role <abuse@spiretech.com>, We Care
        <abuse@newsread.com>
X-Trace: monger.newsread.com 1040583643 207.173.200.229 (Sun, 22 Dec 2002
        14:00:43 EST)
NNTP-Posting-Date: Sun, 22 Dec 2002 14:00:43 EST
Xref: shelby.stanford.edu gnu.emacs.help:108419
To: help-gnu-emacs@gnu.org
Subject: multi-line conditionals in elisp
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 22 Dec 2002 19:05:09 -0000

hello,

sorry for the dumb question, but i'm sure of the best way to do
this. i have emacs installed on several machines and would like to use
a single .emacs.  it's annoying to have to maintain different ones,
and i forget sometimes that one library is installed on one machine
but not on another.

my solution was to put a conditional in the .emacs to test for the
existence of a library before following its loading instructions.
what i'm having a problem with, is conditionals of this format:

if (true)
  do item one
  do item two
  do item three
  ...
else
  do item four

this is trivial in other languages, but not, it seems, in elisp.  (i
think it's just a case of, i don't really understand the language.)
here's what i did:

(if (locate-library "python-mode")
    (cond((autoload 'python-mode "python-mode" "Python editing mode" t)
          (setq auto-mode-alist
                (cons '("\\.py$" . python-mode) auto-mode-alist))))
  (message "python library not found"))

this seems to work. (just putting an extra pair of parens around the
multiple statements did not work.  i guess that would be the
equivalent of {} in C.)  but i'm not sure if it's the best or only
way.  after all, if i have more than two items in the first part of
the conditional, that means stringing along multiple conds.  an
example would be mailcrypt, which in one of my .emacs has 7 line
items, setting and loading variables.  i dunno, it seems clumsy to me
because i'd be invoking the cond not because i'm interested in its
outcome per se, but just to force execution of the next statement.

thanks for any help.

mp

nb. trivial note: on my main workstation, i maintain my dot-files in
rcs.  i noted yesterday that my oldest entry in the .emacs is from
january 30, 1998.  so, in a little over a month, it will be 5 years
old.  that's a lot of bits & bytes through the pipe.  and emacs is
still God's Own Editor(tm).  ;-)  Happy Holidays!

-- 
Michael Powe                                    Waterbury, CT
-------------------------------------------------------------
"The most likely way for the world to be destroyed, most experts
agree, is by accident.  That's where we come in.  We're computer
professionals.  We cause accidents."  -- Nathaniel Borenstein
>From help-gnu-emacs-bounces@gnu.org  Sun Dec 22 14:15:09 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!24.30.200.11!news-east.rr.com!news.stealth.net!news.stealth.net!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail
From: David Kastrup <David.Kastrup@t-online.de>
Newsgroups: gnu.emacs.help
Date: 22 Dec 2002 20:12:42 +0100
Organization: T-Online
Lines: 41
Sender: dak@lola.goethe.zz
Message-ID: <x5smwphnpx.fsf@lola.goethe.zz>
References: <ulm2hc1zw.fsf@trollope.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.t-online.com 1040584363 07 26506 eO6lEveGSJAdA0 021222 19:12:43
X-Complaints-To: abuse@t-online.com
X-Sender: 520018396234-0001@t-dialin.net
X-Face: 2FEFf>]>q>2iw=B6,xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl
        \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN;i";
        /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^
        Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50
Xref: shelby.stanford.edu gnu.emacs.help:108420
To: help-gnu-emacs@gnu.org
Subject: Re: multi-line conditionals in elisp
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 22 Dec 2002 19:15:09 -0000

Michael Powe <michael+gnus@trollope.org> writes:

> sorry for the dumb question, but i'm sure of the best way to do
> this. i have emacs installed on several machines and would like to use
> a single .emacs.  it's annoying to have to maintain different ones,
> and i forget sometimes that one library is installed on one machine
> but not on another.
> 
> my solution was to put a conditional in the .emacs to test for the
> existence of a library before following its loading instructions.
> what i'm having a problem with, is conditionals of this format:
> 
> if (true)
>   do item one
>   do item two
>   do item three
>   ...
> else
>   do item four
> 
> this is trivial in other languages, but not, it seems, in elisp.  (i
> think it's just a case of, i don't really understand the language.)
> here's what i did:
> 
> (if (locate-library "python-mode")
>     (cond((autoload 'python-mode "python-mode" "Python editing mode" t)
>         (setq auto-mode-alist
>               (cons '("\\.py$" . python-mode) auto-mode-alist))))
>   (message "python library not found"))

That is junk.  I recommend you look up progn.

> nb. trivial note: on my main workstation, i maintain my dot-files in
> rcs.  i noted yesterday that my oldest entry in the .emacs is from
> january 30, 1998.  so, in a little over a month, it will be 5 years
> old.  that's a lot of bits & bytes through the pipe.

5 years and you don't know progn.  That certainly _is_ impressive.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
>From help-gnu-emacs-bounces@gnu.org  Sun Dec 22 14:20:18 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news.stealth.net!news.stealth.net!newsread.com!newsprint.netaxs.com!207.8.186.120.MISMATCH!POSTED.monger.newsread.com!not-for-mail
Newsgroups: gnu.emacs.help
References: <m08yyodagg.fsf@bloombergREMOVETHISPART.com>
        <NqHL9.7$eB1.206@paloalto-snr1.gtei.net>
        <m0of7e70g4.fsf@bloombergREMOVETHISPART.com>
X-Newsreader: Gnus v5.8.8/Emacs 20.7.2 [Linux 2.2.16]
X-Home-Page: http://www.trollope.org
From: Michael Powe <michael+gnus@trollope.org>
Message-ID: <uisxlc1ba.fsf@trollope.org>
Organization: The Hospice of the Mind
Lines: 40
Cache-Post-Path: 
gaspra.spiretech.com!unknown@slip-32-100-238-101.ca.us.prserv.net
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
Date: Sun, 22 Dec 2002 19:15:21 GMT
NNTP-Posting-Host: 207.173.200.229
X-Complaints-To: Abuse Role <abuse@spiretech.com>, We Care
        <abuse@newsread.com>
X-Trace: monger.newsread.com 1040584521 207.173.200.229 (Sun, 22 Dec 2002
        14:15:21 EST)
NNTP-Posting-Date: Sun, 22 Dec 2002 14:15:21 EST
Xref: shelby.stanford.edu gnu.emacs.help:108421
To: help-gnu-emacs@gnu.org
Subject: Re: 1st character change in file takes forever
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 22 Dec 2002 19:20:18 -0000

>>>>> "David" == David Klein <dklein@bloombergREMOVETHISPART.com> writes:

    David> Barry Margolin <barmar@genuity.net> writes:
    >> In article <m08yyodagg.fsf@bloombergREMOVETHISPART.com>, David
    >> Klein <dklein@bloombergREMOVETHISPART.com> wrote: >When I first
    >> try to insert a character into a buffer that is >associated
    >> with a file on disk, the insert takes close to a minute!

    >> During that first change, Emacs checks whether someone else has
    >> modified the file, and also checks for a lock file.  For some
    >> reason, these checks are taking a long time.  Try doing a
    >> system call trace to see what it's doing during that time.

    David> Assuming by "a system call trace" you meant the strace
    David> function, I did the following:

    >> emacs junk1& strace -c -f -ff -o emacs_trace -q -r -t -T -p1238
    David> (1238 was the pid of emacs. After running the strace
    David> command, I pressed the spacebar once in emacs. When it
    David> finally inserted the space into the buffer, I ^C'ed the
    David> strace).
    >> cat emacs_trace
  
[ ... ]

    David> I have no idea how to continue, besides the fact that
    David> 255963 read syscalls seems slightly on the high side for
    David> inserting a single character. Any ideas how to continue?

are you on a network?  if so, does this behavior continue if you
disconnect the machine from the network?

mp

-- 
Michael Powe                                    Waterbury, CT
-------------------------------------------------------------
"The most likely way for the world to be destroyed, most experts
agree, is by accident.  That's where we come in.  We're computer
professionals.  We cause accidents."  -- Nathaniel Borenstein
>From p.galbraith@globetrotter.net Sun Dec 22 14:21:41 2002
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
        id 18QBfN-0005vR-00
        for help-gnu-emacs@gnu.org; Sun, 22 Dec 2002 14:21:37 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
        id 18QBf5-0005kl-00
        for help-gnu-emacs@gnu.org; Sun, 22 Dec 2002 14:21:20 -0500
Received: from adsl-66.110.147-253.globetrotter.net ([66.110.147.253]
        helo=mixed.dyndns.org)
        by monty-python.gnu.org with esmtp (Exim 4.10.13)       id 
18QBf3-0005jm-00
        for help-gnu-emacs@gnu.org; Sun, 22 Dec 2002 14:21:17 -0500
Received: from mixed.dyndns.org (localhost [127.0.0.1])
        by mixed.dyndns.org (Postfix) with ESMTP
        id A5245429E2; Sun, 22 Dec 2002 14:21:15 -0500 (EST)
To: Michael Powe <michael+gnus@trollope.org>
In-Reply-To: Message from Michael Powe <michael+gnus@trollope.org> 
   of "Sun, 22 Dec 2002 19:00:43 GMT." <ulm2hc1zw.fsf@trollope.org> 
References: <ulm2hc1zw.fsf@trollope.org> 
X-Mailer: MH-E 7.0+cvs; nmh 1.0.4+dev; Emacs 21.2
X-Face: "#bYm%*(4JuXAkouMxaLz|M2dbXUFnQ"IRX)zpsiM"(B}`#|_b548$VB}5L&VIck1F#FNc'
        rsASk0?-/gFp2qzM>0]`Jc}Qd<8[l)N7{8%qMN~{|DS.ME.$
Date: Sun, 22 Dec 2002 14:21:15 -0500
From: Peter S Galbraith <p.galbraith@globetrotter.net>
Message-Id: <20021222192115.A5245429E2@mixed.dyndns.org>
cc: help-gnu-emacs@gnu.org
Subject: Re: multi-line conditionals in elisp 
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 22 Dec 2002 19:21:42 -0000

Michael Powe <michael+gnus@trollope.org> wrote:

> this is trivial in other languages, but not, it seems, in elisp.  (i
> think it's just a case of, i don't really understand the language.)

The latter.

> (if (locate-library "python-mode")
>     (cond((autoload 'python-mode "python-mode" "Python editing mode" t)
>         (setq auto-mode-alist
>               (cons '("\\.py$" . python-mode) auto-mode-alist))))
>   (message "python library not found"))

(if (locate-library "python-mode")
    (progn
      (autoload 'python-mode "python-mode" "Python editing mode" t)
      (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)))
  (message "python library not found"))

or

(if (not (locate-library "python-mode"))
    (message "python library not found")
  (autoload 'python-mode "python-mode" "Python editing mode" t)
  (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)))

or forget the message:

(when (locate-library "python-mode")
  (autoload 'python-mode "python-mode" "Python editing mode" t)
  (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)))

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]