From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: making curly apostrophe part of a word Date: Wed, 11 Sep 2013 14:38:48 +0800 Message-ID: <87bo3zc16v.fsf@ericabrahamsen.net> References: <877geud5t6.fsf@ericabrahamsen.net> <5229A58D.7080600@easy-emacs.de> <87mwnq9sq5.fsf@ericabrahamsen.net> <5229B066.3020105@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1378881514 8632 80.91.229.3 (11 Sep 2013 06:38:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Sep 2013 06:38:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 11 08:38:36 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VJe4S-0004yw-Ap for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Sep 2013 08:38:36 +0200 Original-Received: from localhost ([::1]:33485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJe4R-0005bJ-Vs for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Sep 2013 02:38:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJe4B-0005aF-13 for help-gnu-emacs@gnu.org; Wed, 11 Sep 2013 02:38:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJe44-00075d-Ra for help-gnu-emacs@gnu.org; Wed, 11 Sep 2013 02:38:18 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJe44-00075U-KM for help-gnu-emacs@gnu.org; Wed, 11 Sep 2013 02:38:12 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VJe3z-0004NF-At for help-gnu-emacs@gnu.org; Wed, 11 Sep 2013 08:38:07 +0200 Original-Received: from 114.250.124.24 ([114.250.124.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Sep 2013 08:38:07 +0200 Original-Received: from eric by 114.250.124.24 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Sep 2013 08:38:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 63 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 114.250.124.24 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:AjAplIE5u/dz13Okp7TQon2xhEA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93324 Archived-At: Kevin Rodgers writes: > On 9/6/13 4:37 AM, Andreas Röhler wrote: >> Am 06.09.2013 11:58, schrieb Eric Abrahamsen: >>> Andreas Röhler writes: >>>> Am 06.09.2013 04:47, schrieb Eric Abrahamsen: >>>>> In certain modes (actually just certain files) I'd like the `’' >>>>> character to be treated the same as a `'' character with respect to word >>>>> movement: ie I'd like M-f to skip over the entirety of both "don't" and >>>>> "don’t". I'm editing externally-created files, and don't have the >>>>> liberty of changing this. >>>>> >>>>> I thought this would do it: >>>>> >>>>> (modify-syntax-entry ?’ "w") >>>>> >>>> >>>> Works for me in current buffer. `forward-word' passes as expected. >>>> Which command fails for you? >>> >>> `forward-word' fails... Hang on, I'll do the emacs -Q dance and see >>> what's going on. This was originally in an html-mode buffer, but I don't >>> see why that would matter as long as no third argument was passed to >>> `modify-syntax-entry'. >> >> It affects the current buffer only, not the mode in other buffers when done that >> way - maybe that's it? > > Not according to its doc string: > > The syntax is changed only for table SYNTAX-TABLE, which defaults to > the current buffer's syntax table. > > Different buffers in the same major mode usually share the same syntax table. Ugh, this is very weird. I started emacs -Q (emacs-version "24.3.1"), went into an empty buffer and turned it into text mode, then put in these lines: can’t bug&bear bug©bear All three of "’", "&", and "©" originally act as word boundaries: invoking M-f from the front of the word and M-b from the back stops once _before_ the symbol. The next invocation goes to the next whitespace. Then for each of those three symbols I call (modify-syntax-entry ?[char] "w"). Now "&" and "©" behave as expected: M-f and M-b jump all the way across. But "’" is different: after modifying its syntax, word-movement commands stop _twice_, once on each side of the character, before moving to the other end of the word. I wonder if I've somehow added "w" to its existing syntax definition, without "clearing" the existing definition, and that's why it's behaving strangely? No idea, E