From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: What is a word? Date: Tue, 12 May 2015 23:01:25 +0300 Message-ID: <83617xlg4q.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1431460930 17267 80.91.229.3 (12 May 2015 20:02:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 May 2015 20:02:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 12 22:02:05 2015 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 1YsGNQ-000450-H1 for geh-help-gnu-emacs@m.gmane.org; Tue, 12 May 2015 22:02:04 +0200 Original-Received: from localhost ([::1]:44888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsGNP-0001qS-TQ for geh-help-gnu-emacs@m.gmane.org; Tue, 12 May 2015 16:02:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsGNG-0001qM-F9 for help-gnu-emacs@gnu.org; Tue, 12 May 2015 16:01:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsGNA-0004wG-MM for help-gnu-emacs@gnu.org; Tue, 12 May 2015 16:01:54 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:39872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsGNA-0004wC-Fc for help-gnu-emacs@gnu.org; Tue, 12 May 2015 16:01:48 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NO900000692LG00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Tue, 12 May 2015 23:01:34 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NO90005T6AK61C0@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Tue, 12 May 2015 23:01:34 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 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:104424 Archived-At: > From: Florian Lindner > Date: Tue, 12 May 2015 21:55:44 +0200 > > ofter I find it, that the emacs function acting on a word not behave like I > expect. > > I'm not sure if the definiton of a word is major-mode dependent? > > Talking about kill-word, forward-word and alike. > > Example, | represents cursor position, shell-script mode: > > cd $BASE| -> backward-kill-word cd $| > ;; what I expected > > cd $| -> backward-kill-word -> | > ;; not what I expected, rather expected only the $, with or without the > whitespace between cd, same for "cd .." Each major mode defines its own word-constituent characters. In general, any character that can appear in a symbol recognized by the programming language of the mode is a word-constituent character in that mode. So "word" has different meanings in different major modes. For example, the '-' character is word-constituent in Lisp, but not in C.