From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Perry Smith Newsgroups: gmane.emacs.help Subject: Re: two more emacs questions Date: Fri, 17 Nov 2006 14:31:55 -0600 Message-ID: References: <009d01c70a7b$6731f190$6b01a8c0@dimalaptop> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: multipart/mixed; boundary="===============0555645732==" X-Trace: sea.gmane.org 1163795578 4619 80.91.229.2 (17 Nov 2006 20:32:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Nov 2006 20:32:58 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 17 21:32:54 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GlANm-0007M2-HK for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Nov 2006 21:32:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GlANm-0005Iz-1e for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Nov 2006 15:32:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GlANY-0005Hl-0I for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 15:32:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GlANW-0005GD-2y for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 15:32:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GlANV-0005Fv-L5 for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 15:32:01 -0500 Original-Received: from [64.192.143.210] (helo=easeserver.easesoftware.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GlANV-0002TZ-1b for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 15:32:01 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by easeserver.easesoftware.com (Postfix) with ESMTP id 5DAB0526500; Fri, 17 Nov 2006 14:32:00 -0600 (CST) Original-Received: from easeserver.easesoftware.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03255-03; Fri, 17 Nov 2006 14:31:56 -0600 (CST) Original-Received: from [64.192.143.210] (easeserver.easesoftware.com [64.192.143.210]) by easeserver.easesoftware.com (Postfix) with ESMTP id 94B495264D6; Fri, 17 Nov 2006 14:31:56 -0600 (CST) In-Reply-To: <009d01c70a7b$6731f190$6b01a8c0@dimalaptop> X-Priority: 3 Original-To: "Vadim Bendebury" X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: by amavisd-new at easesoftware.net 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:38782 Archived-At: --===============0555645732== Content-Type: multipart/alternative; boundary=Apple-Mail-30-804721967 --Apple-Mail-30-804721967 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Nov 17, 2006, at 1:05 PM, Vadim Bendebury wrote: > Say I want to search for other occurences of a word which the > cursor is ot. I hit C-s C-w C-s and off it goes. The problem is > when the word includes underscores - each C-w moves the mark to the > next underscore, nit to the end ofthe word. Is there a way to > configure emacs such that underscore is considered part of the word? I do this for C mode: (modify-syntax-entry 95 "w" c-mode-syntax-table) Two problems: 1) There are comments somewhere that explicitly say "don't do this!!!" but I never figured out why. I'd like to here from others why this is not recommended. 2) There are lots of syntax tables. Most major-modes have their own. Some minor-modes I think diddle with them too. Plus there is a global syntax table. So, you will need to explore and figure out which syntax tables you want to change. Then add the modification to the appropriate hook(s). I have this in my .emacs file: (custom-set-variables ... '(c-initialization-hook (function (lambda nil (modify-syntax-entry 95 "w" c-mode-syntax-table)))) ... ) Perry Smith ( pedz@easesoftware.com ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems --Apple-Mail-30-804721967 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1
On Nov 17, 2006, at = 1:05 PM, Vadim Bendebury wrote:

Say I want to search for other occurences of a word = which the cursor is ot. I hit C-s C-w C-s and off it goes. The problem = is when the word includes underscores - each C-w moves the mark to the = next underscore, nit to the end ofthe word. Is there a way to configure = emacs such that underscore is considered part of the = word?

I do this for C = mode:=A0(modify-syntax-entry 95 "w" c-mode-syntax-table)

Two problems:
=A0 = 1) There are comments somewhere that explicitly say "don't do this!!!" = but I never figured out why.=A0 I'd like to here from others why this is = not recommended.
=A0 2) There are lots of syntax tables.=A0 = Most major-modes have their own.=A0 Some minor-modes I think diddle with = them too.=A0 Plus there is a global syntax table.=A0 So, you will need = to explore and figure out which syntax tables you want to change.=A0 = Then add the modification to the appropriate hook(s).

I have this in my .emacs = file:

(custom-set-variables
=A0 =A0...
'(c-initialization-hook (function (lambda nil = (modify-syntax-entry 95 "w" c-mode-syntax-table))))
=A0 = =A0...=A0)


=
Perry Smith = (=A0pedz@easesoftware.com = )
Ease Software, Inc. (=A0http://www.easesoftware.com = )

Low = cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems

=

= --Apple-Mail-30-804721967-- --===============0555645732== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============0555645732==--