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

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

Re: set margin width locally doesn't work


From: Pascal J. Bourguignon
Subject: Re: set margin width locally doesn't work
Date: Mon, 18 Aug 2008 23:00:46 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.2 (gnu/linux)

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 via email to

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