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: Thu, 13 Nov 2003 10:49:19 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

On 11/11/2003 02:47 PM Oliver Scholz wrote:
Adam Hardy <emacs@cyberspaceroad.com> writes:
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)

But I discovered this is also acting on the command buffer, so I
cannot add more than my fill column when doing simple file copies or
renames or text search & replaces.


Well, you could just check whether the current buffer is the
minibuffer:

(when (and (not (minibufferp))
           (> (current-column)
              fill-column))
  ...)
Hi Oliver,
emacs is choking on (minibufferp) - says it's a null-function. I presume it's saying it doesn't exist? I can't find any mention of it in the help.

Adam
--
GNU Emacs 21.3.1 on Linux 2.4.20 RH9





reply via email to

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