From mboxrd@z Thu Jan  1 00:00:00 1970
Path: main.gmane.org!not-for-mail
From: Jesper Harder <harder@myrealbox.com>
Newsgroups: gmane.emacs.help
Subject: Re: what is the point of point-min?
Date: Thu, 28 Aug 2003 02:23:03 +0200
Organization: http://purl.org/harder/
Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org
Message-ID: <m3ad9ueil4.fsf@defun.localdomain>
References: <E19s71c-0005cn-KT@monty-python.gnu.org>
	<mailman.1156.1062027752.29551.help-gnu-emacs@gnu.org>
NNTP-Posting-Host: deer.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: sea.gmane.org 1062034085 2226 80.91.224.253 (28 Aug 2003 01:28:05 GMT)
X-Complaints-To: usenet@sea.gmane.org
NNTP-Posting-Date: Thu, 28 Aug 2003 01:28:05 +0000 (UTC)
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 28 03:28:04 2003
Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>
Original-Received: from monty-python.gnu.org ([199.232.76.173])
	by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian))
	id 19sBZz-00077P-00
	for <geh-help-gnu-emacs@m.gmane.org>; Thu, 28 Aug 2003 03:28:03 +0200
Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org)
	by monty-python.gnu.org with esmtp (Exim 4.22)
	id 19sBWe-0007kN-6q
	for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Aug 2003 21:24:36 -0400
Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.algonet.se!algonet!news.tele.dk!news.tele.dk!small.news.tele.dk!not-for-mail
Original-Newsgroups: gnu.emacs.help
X-Face: ^RrvqCr7c,P$zTR:QED"@h9+BTm-"fjZJJ-3=OU7.)i/K]<.J88}s>'Z_$r;
	<N5ksn~%wJ@2pjF}="tV; FBsdpFarSWA<oYkZsViGf:F^SD-KXhvFxh;
	~]?)SWm~+u}; 0=x}<vOm&5J+?]yB2d]q4x8\0g7SX
Mail-Copies-To: never
User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)
Cancel-Lock: sha1:lYCwULdwj1rP2kTfzWdIF51dhpM=
Original-Lines: 19
Original-NNTP-Posting-Host: 195.249.82.156
Original-X-Trace: 1062030311 dtext02.news.tele.dk 48906 195.249.82.156
Original-X-Complaints-To: abuse@post.tele.dk
Original-Xref: shelby.stanford.edu gnu.emacs.help:116189
Original-To: help-gnu-emacs@gnu.org
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: Users list for the GNU Emacs text editor  <help-gnu-emacs.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org
Xref: main.gmane.org gmane.emacs.help:12108
X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12108

Joe Corneli <jcorneli@math.utexas.edu> writes:

> and here is an alternative suggestion with one small change that I do
> not fully understand.  Why would this be better?
>
> (global-set-key [delete] 
> 	 (lambda () (interactive)
> 		   (if mark-active
> 		             (kill-region (point) (mark)) 
> 		     (delete-char (point-min)))))

No, using `point-min' is wrong.

`point-min' usually return 1, so you won't notice any difference.  But
if the buffer is narrowed, point-min returns a different number ...
making the effect of pressing delete quite unpredictable.

There's also the built-in `delete-selection-mode' which does something
similar.