all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: set margin width locally doesn't work
Date: Mon, 18 Aug 2008 23:00:46 +0200	[thread overview]
Message-ID: <871w0mjawx.fsf@hubble.informatimago.com> (raw)
In-Reply-To: 23b3c439-a944-42de-a958-8a4d2711efc3@x16g2000prn.googlegroups.com

Najja <yijun.gu@gmail.com> writes:
>> najja <sumnerbar...@gmail.com> writes:
>> > hi there,
>>
>> > I like having two blank margin flanking the text when I do my daily
>> > editing so I add this to my .emacs:
>>
>> > (setq default-left-margin-width 20)
>> > (setq default-right-margin-width 20)
>>
>
> I change my configuration to:
> (add-hook 'newsticker-treeview-list-mode-hook
>           '(lambda nil
> 	     (setq left-margin-width 0)
> 	     (setq right-margin-width 0)) nil t)
> (add-hook 'newsticker-start-hook
>           '(lambda nil
> 	     (setq left-margin-width 0)
> 	     (setq right-margin-width 0)) nil t)
> However, emacs still show two flanking blank margin when I shoot
> newsticker after restart.


Well, setting the default-left-margin-width et al. like this looks a
little strong.   I would have done the reverse, left the default at 0,
and added hooks to the modes I usually use AND I want to have margins
with.

Probably the problem you have is that newsticker uses actuall various
modes for its various buffers (I assume, it doesn't seem to do much
here), and it happens the buffer where it displays what you want are
in modes for which the hooks you defined are not executed.  You can
check the mode of a buffer by typing M-x major-mode RET in the buffer.



But consider doing the reverse, leave the default at 0, and set
left-margin-width and right-margin-width to 20 in hooks specific to
the modes you use for your daily editing (eg. text-mode-hook).



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.


  reply	other threads:[~2008-08-18 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-18  6:11 set margin width locally doesn't work najja
2008-08-18  6:30 ` Pascal J. Bourguignon
2008-08-18  9:33   ` Najja
2008-08-18 21:00     ` Pascal J. Bourguignon [this message]
2008-08-19  8:42       ` najja

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

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

  git send-email \
    --in-reply-to=871w0mjawx.fsf@hubble.informatimago.com \
    --to=pjb@informatimago.com \
    --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.
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.