From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Adam Hardy Newsgroups: gmane.emacs.help Subject: Re: line length control setting Date: Fri, 07 Nov 2003 14:57:05 +0100 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3FABA4B1.1020308@cyberspaceroad.com> References: <3FAA9286.1000201@yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1068213652 16116 80.91.224.253 (7 Nov 2003 14:00:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2003 14:00:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 07 15:00:50 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AI7AP-0007Pi-00 for ; Fri, 07 Nov 2003 15:00:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AI78w-00059D-MP for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Nov 2003 08:59:18 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AI78E-00056R-SI for help-gnu-emacs@gnu.org; Fri, 07 Nov 2003 08:58:34 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AI77i-0004j8-1Q for help-gnu-emacs@gnu.org; Fri, 07 Nov 2003 08:58:33 -0500 Original-Received: from [212.227.126.184] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AI77h-0004hb-LL for help-gnu-emacs@gnu.org; Fri, 07 Nov 2003 08:58:01 -0500 Original-Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1AI77d-0006Xy-00 for help-gnu-emacs@gnu.org; Fri, 07 Nov 2003 14:57:57 +0100 Original-Received: from [80.128.20.146] (helo=cyberspaceroad.com) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1AI77c-0006VX-00 for help-gnu-emacs@gnu.org; Fri, 07 Nov 2003 14:57:56 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en, en-us, de-de Original-To: help-gnu-emacs@gnu.org In-Reply-To: <3FAA9286.1000201@yahoo.com> 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13897 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13897 On 11/06/2003 07:27 PM Kevin Rodgers wrote: >> I am using a brute force method of stopping myself from writing long >> lines of code, using this in my .emacs: >> >> (defun my-dont-insert-after-fill-column (&rest x) >> (when (> (current-column) >> fill-column) >> (delete-char -1) >> (beep))) >> >> (add-hook 'after-change-functions 'my-dont-insert-after-fill-column) >> >> Is there a way that I can adapt my function above to stop it applying >> to the command buffer? > > (when (and (not (eq major-mode 'shell-mode)) > > (> (current-column) fill-column)) Great. That hits the nail on the head. Thanx. Jesper - I do use auto-fill mode anyway! It is just too easy to type in a really long method call with no gaps and then find out at the end that I've gone over the fill-column but the auto-fill-mode does nothing to it, and even if it had done some wrapping, I would probably want to adjust it to make the code look prettier. If you follow me. Adam -- GNU Emacs 21.3.1 on Linux 2.4.20 RH9