On 2017-08-12, Jason <elect...@emypeople.net> wrote:
>
> On Thu, Aug 03, 2017 at 12:36:21PM -0500, Luis Mochan wrote:
>> On Wed, Aug 02, 2017 at 08:49:30PM -0700, Ian Zimmerman wrote:
>> > On 2017-08-02 21:47, Jason wrote:
>> > 
>> > > I am using emacs24 for my text editor with mutt (in a terminal).
>> > > How can I set it to automatically wrap the lines at a certain number
>> > > of characters?
>> > 
>> > "M-x auto-fill-mode" will do it in a new buffer, provided you set your
>> > fill-column variable.
>> 
>> If you have already opened your buffer, you can wrap the lines of a 
>> paragraph with M-q.
>> 
>> You can set the fill column to say, 72 with C-u 7 2 C-x f
> Thank you for both replies. I am new to emacs and while I know it can do many
> different things, right now I would just like it to automatically wrap lines
> when using for composing messages. "M-x auto-fill-mode" works in the buffer 
> but
> I would like it to startup in that mode. Here's what's in my config file:
>
> (custom-set-variables
>  ;; custom-set-variables was added by Custom.
>  ;; If you edit it by hand, you could mess it up, so be careful.
>  ;; Your init file should contain only one such instance.
>  ;; If there is more than one, they won't work right.
>  '(auto-fill-mode t)
>  '(fill-column 80)
>  '(fill-nobreak-predicate nil))
> (custom-set-faces
>  ;; custom-set-faces was added by Custom.
>  ;; If you edit it by hand, you could mess it up, so be careful.
>  ;; Your init file should contain only one such instance.
>  ;; If there is more than one, they won't work right.
>  )
>
> What am I missing?
> Thanks.

Is that your *whole* Emacs config?

As said above you need at least one hook.  In order to easily use
Emacs in programs such as mutt or slrn I recommend mutt-mode.  I
cannot find on the net anywhere any more so I put it here
http://drabczyk.org/mutt.el.  mutt-mode will add several nice
keybindings such as C-c C-c to automatically save a message and exit
the current buffer or C-c C-i to automatically jump to the signature,
it will also color quotation and will of course enable auto-fill-mode
automatically.  To enable mutt-mode automatically when writing a
message in mutt or slrn put mutt.el in your load-path and add
something like this to your Emacs startup file:

(defun mutt-mode-hook ()
  (when
      (and
       (file-exists-p (buffer-file-name))
       (stringp buffer-file-name)
       (or (string-match (concat ".*mutt-comp-[0-9\-]+$") buffer-file-name)
           (string-match ".followup" buffer-file-name)
           (string-match ".article" buffer-file-name))
       (mutt-mode)
       )))

(add-hook 'find-file-hook 'mutt-mode-hook)

Replace `comp' with your hostname as by default mutt uses the hostname
to create a message template in /tmp.
-- 
Arkadiusz Drabczyk <arkadi...@drabczyk.org>

Reply via email to