all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* howto suffix based fill-column?
@ 2003-08-07  5:48 Eike Kroemer
  2003-08-07  9:57 ` Joakim Hove
  2003-08-10 18:07 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Eike Kroemer @ 2003-08-07  5:48 UTC (permalink / raw)


Hi there,

can someone kind provide me with some code for my .emacs that will do
the following:

if (suffix-of-file == eml)
  enter text mode
  (setq fill-column 68)
else
  (setq fill-column 79)
end

Thanks in advance,
   Eike

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: howto suffix based fill-column?
  2003-08-07  5:48 howto suffix based fill-column? Eike Kroemer
@ 2003-08-07  9:57 ` Joakim Hove
  2003-08-07 10:10   ` Eike Kroemer
                     ` (2 more replies)
  2003-08-10 18:07 ` Stefan Monnier
  1 sibling, 3 replies; 6+ messages in thread
From: Joakim Hove @ 2003-08-07  9:57 UTC (permalink / raw)



Eike Kroemer <kroemer@atlas.de> writes:

> Hi there,
>
> can someone kind provide me with some code for my .emacs that will do
> the following:

Try this:

(defun set-fill-column ()
   (if (string-equal (file-name-extension (buffer-file-name)) "eml")
      (setq fill­column 68)
    (setq fill-column 79)))

(add-hook 'find-file-hooks 'set-fill-column)


Joakim


-- 
  /--------------------------------------------------------------------\
 / Joakim Hove  / hove@bccs.no  /  (55 5) 84076       |                 \
 | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
 | CMU                                                | 5231 Paradis    |
 \ Thormøhlensgt.55, 5020 Bergen.                     | 55 91 28 18     /
  \--------------------------------------------------------------------/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: howto suffix based fill-column?
  2003-08-07  9:57 ` Joakim Hove
@ 2003-08-07 10:10   ` Eike Kroemer
  2003-08-07 12:00   ` Reiner Steib
  2003-08-07 18:12   ` Kevin Rodgers
  2 siblings, 0 replies; 6+ messages in thread
From: Eike Kroemer @ 2003-08-07 10:10 UTC (permalink / raw)


Hi Joakim,

thanks for your answer, it' working great!

 Eike

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: howto suffix based fill-column?
  2003-08-07  9:57 ` Joakim Hove
  2003-08-07 10:10   ` Eike Kroemer
@ 2003-08-07 12:00   ` Reiner Steib
  2003-08-07 18:12   ` Kevin Rodgers
  2 siblings, 0 replies; 6+ messages in thread
From: Reiner Steib @ 2003-08-07 12:00 UTC (permalink / raw)


On Thu, Aug 07 2003, Joakim Hove wrote:

> (defun set-fill-column ()
>    (if (string-equal (file-name-extension (buffer-file-name)) "eml")
>       (setq fill­column 68)
                  ^ This is not a minus but `soft hyphen' from Latin-1

In case anyone will use C&P, it won't work as it should.  (I noticed
this because I was wondering why Gnus gives me a button for the second
but not for the first line.)

>     (setq fill-column 79)))

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: howto suffix based fill-column?
  2003-08-07  9:57 ` Joakim Hove
  2003-08-07 10:10   ` Eike Kroemer
  2003-08-07 12:00   ` Reiner Steib
@ 2003-08-07 18:12   ` Kevin Rodgers
  2 siblings, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2003-08-07 18:12 UTC (permalink / raw)


Joakim Hove wrote:

> (defun set-fill-column ()
>    (if (string-equal (file-name-extension (buffer-file-name)) "eml")
>       (setq fill­column 68)
>     (setq fill-column 79)))
> 
> (add-hook 'find-file-hooks 'set-fill-column)

What about the OP's request for text mode?


I think this is a little cleaner:


(setq auto-mode-alist
       (cons '("\\.eml\\'" . text-mode) auto-mode-alist))

(setq-default fill-column 79)

(add-hook 'text-mode-hook
	  (lambda ()
	    (if (string-equal (file-name-extension (buffer-file-name)) "eml")
		(setq fill-column 68))))

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: howto suffix based fill-column?
  2003-08-07  5:48 howto suffix based fill-column? Eike Kroemer
  2003-08-07  9:57 ` Joakim Hove
@ 2003-08-10 18:07 ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2003-08-10 18:07 UTC (permalink / raw)


>>>>> "Eike" == Eike Kroemer <kroemer@atlas.de> writes:
> can someone kind provide me with some code for my .emacs that will do
> the following:

> if (suffix-of-file == eml)
>   enter text mode
>   (setq fill-column 68)
> else
>   (setq fill-column 79)
> end

   (define-derived-mode eml-mode text-mode "EML"
     "Mode for EML files."
     ;; Add more EML-specific settings here.
     (set (make-local-variable 'fill-column) 68))
   
   ;; Make .eml files use eml-mode.
   (add-to-list 'auto-mode-alist '("\\.eml\\'" . eml-mode))

To set the rest to 79 column, try something like

   (setq-default fill-column 79)


        Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-08-10 18:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-07  5:48 howto suffix based fill-column? Eike Kroemer
2003-08-07  9:57 ` Joakim Hove
2003-08-07 10:10   ` Eike Kroemer
2003-08-07 12:00   ` Reiner Steib
2003-08-07 18:12   ` Kevin Rodgers
2003-08-10 18:07 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.