From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: sandipchitale@yahoo.com (Sandip Chitale) Newsgroups: gmane.emacs.help Subject: Re: word delimiter Date: 4 Mar 2003 18:01:53 -0800 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1046829937 361 80.91.224.249 (5 Mar 2003 02:05:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 5 Mar 2003 02:05:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 05 03:05:35 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18qOHn-00005c-00 for ; Wed, 05 Mar 2003 03:05:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18qOHn-0001RL-03 for gnu-help-gnu-emacs@m.gmane.org; Tue, 04 Mar 2003 21:05:35 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 76 Original-NNTP-Posting-Host: 208.135.53.4 Original-X-Trace: posting.google.com 1046829713 30920 127.0.0.1 (5 Mar 2003 02:01:53 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 5 Mar 2003 02:01:53 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:110829 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:7330 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7330 I see that people are suggesting modifying the syntax of '_' to word. It is related to the discussion if following thread: http://groups.google.com/groups?dq=&hl=en&lr=lang_en&ie=UTF-8&threadm=84bs0wpiim.fsf%40lucy.is.informatik.uni-duisburg.de&prev=/groups%3Fdq%3D%26num%3D25%26hl%3Den%26lr%3Dlang_en%26ie%3DUTF-8%26group%3Dgnu.emacs.help%26start%3D25 Someone else suggested that modifying the syntax may be too drastic because it will affect other commands. Instead you should define new defuns which do the work. Here is some defuns I defined along the lines of what you want: (defun forward-symbol () "Move forward over a symbol." (interactive) (forward-word 1) (while (eq (char-syntax (following-char)) ?\_) (forward-word 1) ) ) (defun backward-symbol () "Move backward over a symbol." (interactive) (backward-word 1) (while (eq (char-syntax (preceding-char)) ?\_) (backward-word 1) ) ) (defun forward-symbol-append () "" (interactive) (unless mark-active (set-mark (point))) (call-interactively 'forward-symbol) ) (defun backward-symbol-append () "" (interactive) (unless mark-active (set-mark (point))) (call-interactively 'backward-symbol) ) (defun select-symbol-at-point () "Select word at point." (interactive) (let ((syntax (char-syntax (following-char)))) (if (or (eq syntax ?\w) (eq syntax ?\_)) (progn (backward-symbol) (set-mark (point)) (forward-symbol-append) ) (progn (skip-syntax-backward (char-to-string syntax)) (set-mark (point)) (skip-syntax-forward (char-to-string syntax)) ) ) ) ) (global-set-key [(meta f)] 'forward-symbol) (global-set-key [(meta b)] 'backward-symbol) (global-set-key [C-S-right] 'forward-symbol-append) (global-set-key [C-S-left] 'backward-symbol-append) (global-set-key [(meta control w)] 'select-symbol-at-point) You should be able to adapt these for M-d. HTH, sandip