From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.help Subject: Re: changing word boundaries Date: Sun, 01 Nov 2009 19:10:26 +0000 Message-ID: <87k4yacb8d.fsf@fx-laptop.ukfsn.org> References: <20091018162740.GA21146@doriath.local> <873a5gwguf.fsf@fh-trier.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1257142769 11992 80.91.229.12 (2 Nov 2009 06:19:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2009 06:19:29 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Ernest =?iso-8859-1?Q?Adrogu=E9?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 02 07:19:22 2009 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 1N4qG9-0000B9-Dh for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Nov 2009 07:19:21 +0100 Original-Received: from localhost ([127.0.0.1]:55697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4qG8-0006Lp-Tb for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Nov 2009 01:19:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4fpc-00042K-MN for help-gnu-emacs@gnu.org; Sun, 01 Nov 2009 14:11:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4fpc-00041u-6g for help-gnu-emacs@gnu.org; Sun, 01 Nov 2009 14:11:16 -0500 Original-Received: from [199.232.76.173] (port=33314 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4fpb-00041p-UK for help-gnu-emacs@gnu.org; Sun, 01 Nov 2009 14:11:15 -0500 Original-Received: from mail.ukfsn.org ([77.75.108.10]:59600) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N4fpb-0000AF-Kq for help-gnu-emacs@gnu.org; Sun, 01 Nov 2009 14:11:15 -0500 Original-Received: from localhost (smtp-filter.ukfsn.org [192.168.54.205]) by mail.ukfsn.org (Postfix) with ESMTP id 3C5CEDF1F7; Sun, 1 Nov 2009 19:11:15 +0000 (GMT) Original-Received: from mail.ukfsn.org ([192.168.54.25]) by localhost (smtp-filter.ukfsn.org [192.168.54.205]) (amavisd-new, port 10024) with ESMTP id MBzuf9oyYXWb; Sun, 1 Nov 2009 19:11:15 +0000 (GMT) Original-Received: from fx-laptop (unknown [84.45.211.153]) by mail.ukfsn.org (Postfix) with ESMTP id 0E616DF1F5; Sun, 1 Nov 2009 19:11:15 +0000 (GMT) Original-Received: from fx by fx-laptop with local (Exim 4.69) (envelope-from ) id 1N4fow-000159-Jd; Sun, 01 Nov 2009 19:10:34 +0000 X-Draft-From: ("gnu.emacs.help" 27956) User-Agent: Gnus/5.110011 (No Gnus v0.11) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Mon, 02 Nov 2009 01:14:34 -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:69382 Archived-At: Ernest Adrogu=E9 writes: > 18/10/09 @ 23:08 (+0200), thus spake Andreas Politz: >> You could use dynamic syntax-tables via font-lock. >>=20 >> (add-hook 'text-mode-hook >> (lambda nil >> (set (make-variable-buffer-local >> 'parse-sexp-lookup-properties) t) >> ;; get font-lock started >> (unless font-lock-defaults >> (setq font-lock-defaults '(nil t))) >> (add-to-list >> (make-variable-buffer-local >> 'font-lock-syntactic-keywords) >> ;; let ! between 2*a have word syntax >> '("a\\(!\\)a" 1 "w")))) >>=20 >>=20 >> Replace `a' and `!' with your characters and it'll work, >> hopefully. > > It does what I wanted. :) Well, it's a pretty odd way to do it. If you really only want to use the ligature in Text mode -- and not programming language comments, for instance -- just amend `text-mode-syntax-table'.