unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Changing side margins in specific mode changes side margins for all buffers
Date: Tue, 16 Jun 2015 01:04:40 +0200	[thread overview]
Message-ID: <871thcpo8n.fsf@debian.uxu> (raw)
In-Reply-To: mailman.5065.1434407365.904.help-gnu-emacs@gnu.org

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	other threads:[~2015-06-15 23:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.5065.1434407365.904.help-gnu-emacs@gnu.org>
2015-06-15 23:04 ` Emanuel Berg [this message]
2015-06-16  1:13 ` Changing side margins in specific mode changes side margins for all buffers Stefan Monnier
2015-06-17  0:58   ` Emanuel Berg
2015-06-15 22:29 hack writer
2015-06-16 21:47 ` hack writer
     [not found] ` <mailman.5129.1434491234.904.help-gnu-emacs@gnu.org>
2015-06-16 22:35   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871thcpo8n.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).