From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@uni-duisburg.de (Kai =?iso-8859-1?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.help Subject: Re: Newbie Conditional Problem Date: Sat, 18 Jan 2003 18:36:08 +0100 Organization: University of Duisburg, Germany Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <84d6mu4ayf.fsf@lucy.is.informatik.uni-duisburg.de> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1042911596 22680 80.91.224.249 (18 Jan 2003 17:39:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 18 Jan 2003 17:39:56 +0000 (UTC) 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 18Zwwj-0005tX-00 for ; Sat, 18 Jan 2003 18:39:53 +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 18Zwxb-0000GM-09 for gnu-help-gnu-emacs@m.gmane.org; Sat, 18 Jan 2003 12:40:47 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!p508773fe.dip.t-dialin.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 17 Original-NNTP-Posting-Host: p508773fe.dip.t-dialin.net (80.135.115.254) Original-X-Trace: fu-berlin.de 1042911416 24916530 80.135.115.254 (16 [73968]) User-Agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.3.50 (i686-pc-linux-gnu) Cancel-Lock: sha1:Ag4sqTxOPCM2rNfFxrMfESVk2Y0= Original-Xref: shelby.stanford.edu gnu.emacs.help:109129 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:5656 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5656 "CarlC" writes: > (let ((line (current-line))) > (forward-word 1) > (if (> (current-line) line) ((goto-line line) (end-of-line)))) How about this: (let ((p (line-end-position))) (forward-word 1) (when (> (point) p) (goto-char p))) If your Emacs does not have the function line-end-position, you can write (save-excursion (end-of-line) (point)) instead. -- Ambibibentists unite!