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

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

Re: Changing side margins in specific mode changes side margins for all


From: Emanuel Berg
Subject: Re: Changing side margins in specific mode changes side margins for all buffers
Date: Tue, 16 Jun 2015 01:04:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

hack writer <GNU@bookhacker.org> writes:

> (add-hook 'window-configuration-change-hook (lambda
> () (set-window-margins (car (get-buffer-window-list
> (current-buffer) nil t)) 29 29)))
>
> to set side margins in a specific emacs mode.
> But when I open further buffers, no matter what
> mode, all buffers use the same side margins.
> How I can achieve, that only my specific mode
> buffers use side margins but all other buffers not?
>
> (add-hook 'window-configuration-change-hook (lambda
> () (set-window-margins (car (get-buffer-window-list
> (current-buffer) nil t)) 29 29)) 'make-it-local)
>
> didn't work.

No - this whole idea isn't good. It will slow down the
interactive feel to test at each window configuration
change what mode it is. And the "slowing down" is
going in the wrong direction - something specific
(your mode) will slow down all of Emacs!

What kind of mode do you have? I think there is a much
better way to do this, but it is difficult to tell
without knowing what you want to do.

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

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