From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Paul Edwards" Newsgroups: gmane.emacs.help Subject: Re: simple editor required Date: Fri, 20 Jun 2003 16:19:36 GMT Organization: BigPond Internet Services (http://www.bigpond.net.au) Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <8465nduadj.fsf@lucy.is.informatik.uni-duisburg.de> <5lfzmgbrio.fsf@rum.cs.yale.edu> <84el1zcze6.fsf@lucy.is.informatik.uni-duisburg.de> <841xxzto54.fsf@lucy.is.informatik.uni-duisburg.de> <5lu1aqcev2.fsf@rum.cs.yale.edu> <84n0git5vn.fsf@lucy.is.informatik.uni-duisburg.de> <844r2opsuy.fsf@lucy.is.informatik.uni-duisburg.de> <84r85ry9ft.fsf@lucy.is.informatik.uni-duisburg.de> <84vfv2ulf7.fsf@lucy.is.informatik.uni-duisburg.de> <84wufgke19.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1056126184 21199 80.91.224.249 (20 Jun 2003 16:23:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2003 16:23:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 20 18:23:00 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 19TOdc-0005L5-00 for ; Fri, 20 Jun 2003 18:21:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19TOcd-0007Jj-TL for gnu-help-gnu-emacs@m.gmane.org; Fri, 20 Jun 2003 12:20:19 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!chi1.webusenet.com!news.webusenet.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!out.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!news.moat.net!ken-transit.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 73 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Original-NNTP-Posting-Host: 144.132.167.28 Original-X-Complaints-To: abuse@bigpond.net.au Original-X-Trace: news-server.bigpond.net.au 1056125976 144.132.167.28 (Sat, 21 Jun 2003 02:19:36 EST) Original-NNTP-Posting-Date: Sat, 21 Jun 2003 02:19:36 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:114607 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:11099 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11099 "Kai Großjohann" wrote in message news:84wufgke19.fsf@lucy.is.informatik.uni-duisburg.de... > "Paul Edwards" writes: > > > If I am at the beginning of the "cccc" line and I hit enter, > > emacs is inspired to indent cccc to be under bbbb. I don't > > want that, I want cccc to stay where it is. If I wanted cccc > > to be indented I would do something, e.g. press tab or hit > > spaces. > > Okay, so if the previous line exists and is not blank, then indent > the new line to the previous line after RET. > Yeah, I'm afraid you'll have to write your own indentation function. Wow. How does everyone else cope with text mode? This is basic logical indentation, that comes with micro-emacs. There's no existing equivalent? > Maybe this one? > > (defun pe-indent-relative () > "Like `indent-relative' but don't indent after blank line." Actually, I don't mind it indenting after a blank line, micro-emacs does that. But micro-emacs won't indent the CURRENT line when I hit enter at the BEGINNING of the line. Emacs not only inserts a blank line (as I wanted), but is also inspired to indent the current line for no reason whatsoever. And when it is at the beginning of the file, and thus doesn't even have any previous line to match up with, it still forges ahead and decides I must want to indent the CURRENT line (with text on it) by 8 characters or 1 tab, as well as putting in the blank line. > (when (save-excursion > (and (zerop (forward-line -1)) > (not (looking-at "\s-*$")))) > (indent-relative-maybe))) > > (defun pe-text-setup () > (setq indent-line-function 'pe-indent-relative)) > > (add-hook 'text-mode-hook 'pe-text-setup) > > Maybe it works, but I haven't tested it. Thanks! I'll give it a go. So what about when you are editting text, and it is lined up in semi-paragraphs, e.g. My doctor's details are: Name = Fred Phone = 1234 My dentist's details are: Name = Mary Phone = 5678 And the cursor happens to be at the beginning of "My dentist's details" and you decide that you want an extra blank line to separate doctor from dentist, so you hit enter. You're not disturbed that emacs is inspired to not only insert a blank line, but also to indent "My dentist" in a couple of characters, to line up with "Phone = "? I wouldn't mind if I was ABOVE "my dentist" and it decided to indent a blank line a couple of characters in case I wanted to add more details, but moving "My dentist" from its current indentation level is definitely anti-social. BFN. Paul.