help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: line length control setting


From: Adam Hardy
Subject: Re: line length control setting
Date: Fri, 07 Nov 2003 14:57:05 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]