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: Middle of the DOCUMENT? Date: Sun, 02 Mar 2003 13:05:26 +0100 Organization: University of Duisburg, Germany Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <84adgern21.fsf@lucy.is.informatik.uni-duisburg.de> References: <2ilm00rqgr.fsf@kite.ssc.wisc.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1046606802 15482 80.91.224.249 (2 Mar 2003 12:06:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 2 Mar 2003 12:06:42 +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 18pSEr-00041Z-00 for ; Sun, 02 Mar 2003 13:06:41 +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 18pSEJ-0003u2-04 for gnu-help-gnu-emacs@m.gmane.org; Sun, 02 Mar 2003 07:06:07 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!fu-berlin.de!uni-berlin.de!p50876bc0.dip.t-dialin.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 19 Original-NNTP-Posting-Host: p50876bc0.dip.t-dialin.net (80.135.107.192) Original-X-Trace: fu-berlin.de 1046606729 60058736 80.135.107.192 (16 [73968]) User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 (i686-pc-linux-gnu) Cancel-Lock: sha1:GRJye3Eblt/+KgaX4/vc1j2xj6Y= Original-Xref: shelby.stanford.edu gnu.emacs.help:110745 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:7246 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7246 Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes: > How do you define `middle of buffer'? WRT characters or to lines? > > (defun rs-middle-of-buffer-chars () > "Move point to middle of current buffer wrt characters." > (interactive) > (goto-char (/ (- (point-max) (point-min)) 2))) > > (defun rs-middle-of-buffer-lines () > "Move point to middle of current buffer wrt lines." > (interactive) > (goto-line (/ (count-lines (point-max) (point-min)) 2))) Another idea would be to go to the middle char, then to beginning of line. It seems kind of intuitive to move to the beginning of a line. But maybe it's just my strange thinking... ;-) -- A preposition is not a good thing to end a sentence with.