all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Enable some modes in every buffer
@ 2009-02-19 20:22 TheLonelyStar
  2009-02-19 22:16 ` Tassilo Horn
  0 siblings, 1 reply; 4+ messages in thread
From: TheLonelyStar @ 2009-02-19 20:22 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi,

There are some modes (flyspell-mode, higlight-paranthese-mode) which I
always have to enable when I open a new buffer. I want them enabeld in EVERY
buffer.
I know, I can add them to specific buffer hooks (like cc-mode), but is can I
somehow enable them in every new buffer?

Thanks!
Nathan
-- 
View this message in context: http://www.nabble.com/Enable-some-modes-in-every-buffer-tp22108891p22108891.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: Enable some modes in every buffer
  2009-02-19 20:22 TheLonelyStar
@ 2009-02-19 22:16 ` Tassilo Horn
  0 siblings, 0 replies; 4+ messages in thread
From: Tassilo Horn @ 2009-02-19 22:16 UTC (permalink / raw)
  To: help-gnu-emacs

TheLonelyStar <nabble2@lonely-star.org> writes:

Hi!

> There are some modes (flyspell-mode, higlight-paranthese-mode) which I
> always have to enable when I open a new buffer. I want them enabeld in
> EVERY buffer.
> I know, I can add them to specific buffer hooks (like cc-mode), but is
> can I somehow enable them in every new buffer?

Try this hook.

,----[ C-h v after-change-major-mode-hook RET ]
| after-change-major-mode-hook is a variable defined in `subr.el'.
| Its value is 
| (global-auto-composition-mode-enable-in-buffers global-font-lock-mode-enable-in-buffers)
| 
| 
| Documentation:
| Normal hook run at the very end of major mode functions.
`----

Bye,
Tassilo





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

* Re: Enable some modes in every buffer
       [not found] <mailman.1211.1235074945.31690.help-gnu-emacs@gnu.org>
@ 2009-02-19 23:50 ` Chetan
  2009-02-20 10:16   ` Geralt
  0 siblings, 1 reply; 4+ messages in thread
From: Chetan @ 2009-02-19 23:50 UTC (permalink / raw)
  To: help-gnu-emacs

TheLonelyStar <nabble2@lonely-star.org> writes:

> Hi,
>
> There are some modes (flyspell-mode, higlight-paranthese-mode) which I
> always have to enable when I open a new buffer. I want them enabeld in EVERY
> buffer.
> I know, I can add them to specific buffer hooks (like cc-mode), but is can I
> somehow enable them in every new buffer?
>
> Thanks!
> Nathan

C-h f define-globalized-minor-mode?  
I don't use the modes that are mentioned, but looks like they could be
global - show-paren-mode is.


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

* Re: Enable some modes in every buffer
  2009-02-19 23:50 ` Enable some modes in every buffer Chetan
@ 2009-02-20 10:16   ` Geralt
  0 siblings, 0 replies; 4+ messages in thread
From: Geralt @ 2009-02-20 10:16 UTC (permalink / raw)
  To: help-gnu-emacs

You probably don't want to start flyspell in every major mode, there
are modes like dired or shell where it just makes no sense to have
flyspell enabled and then there are the programming major modes where
you have to call flyspell-prog-mode.
I'm currently calling the following function in my .emacs:

(defun hook-flyspell-mode ()
  "Adds flyspell mode to some major modes."
  (dolist (hook '(org-mode-hook))
    (add-hook hook (lambda () (flyspell-mode 1))))
  (dolist (hook '(c-mode-hook c++-mode-hook sh-mode-hook emacs-lisp-mode-hook))
    (add-hook hook (lambda () (flyspell-prog-mode)))))


And I just add all the major modes to it in which I really want flyspell mode.





Geralt.




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

end of thread, other threads:[~2009-02-20 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1211.1235074945.31690.help-gnu-emacs@gnu.org>
2009-02-19 23:50 ` Enable some modes in every buffer Chetan
2009-02-20 10:16   ` Geralt
2009-02-19 20:22 TheLonelyStar
2009-02-19 22:16 ` Tassilo Horn

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.