all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* set margin width locally doesn't work
@ 2008-08-18  6:11 najja
  2008-08-18  6:30 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 5+ messages in thread
From: najja @ 2008-08-18  6:11 UTC (permalink / raw)
  To: help-gnu-emacs

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)

However, now I want to extend my emacs usage to other fields such as
email and rss reading. However, this margin setting will create a
blank margin in gnus and newsticker buffer just like in others. I have
tried to add the following settings to .emacs.

(add-hook 'newsticker-treeview-list-mode-hook
	     (setq left-margin-width 0)
	     (setq right-margin-width 0)))

but it doesn't help. Obviously setting margin width doesn't take
effect immediately. Is there any way to set margin width to a buffer
locally and effectively?


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

* Re: set margin width locally doesn't work
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Pascal J. Bourguignon @ 2008-08-18  6:30 UTC (permalink / raw)
  To: help-gnu-emacs

najja <sumnerbarney@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)
>
> However, now I want to extend my emacs usage to other fields such as
> email and rss reading. However, this margin setting will create a
> blank margin in gnus and newsticker buffer just like in others. I have
> tried to add the following settings to .emacs.
>
> (add-hook 'newsticker-treeview-list-mode-hook
> 	     (setq left-margin-width 0)
> 	     (setq right-margin-width 0)))
>
> but it doesn't help. Obviously setting margin width doesn't take
> effect immediately. Is there any way to set margin width to a buffer
> locally and effectively?

C-h f add-hook RET and read it closely.


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

"What is this talk of "release"?  Klingons do not make software
"releases".  Our software "escapes" leaving a bloody trail of
designers and quality assurance people in its wake."


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

* Re: set margin width locally doesn't work
  2008-08-18  6:30 ` Pascal J. Bourguignon
@ 2008-08-18  9:33   ` Najja
  2008-08-18 21:00     ` Pascal J. Bourguignon
  0 siblings, 1 reply; 5+ messages in thread
From: Najja @ 2008-08-18  9:33 UTC (permalink / raw)
  To: help-gnu-emacs

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.


On Aug 18, 2:30 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> 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)
>
> > However, now I want to extend my emacs usage to other fields such as
> > email and rss reading. However, this margin setting will create a
> > blank margin in gnus and newsticker buffer just like in others. I have
> > tried to add the following settings to .emacs.
>
> > (add-hook 'newsticker-treeview-list-mode-hook
> >         (setq left-margin-width 0)
> >         (setq right-margin-width 0)))
>
> > but it doesn't help. Obviously setting margin width doesn't take
> > effect immediately. Is there any way to set margin width to a buffer
> > locally and effectively?
>
> C-h f add-hook RET and read it closely.
>
> --
> __Pascal Bourguignon__                    http://www.informatimago.com/
>
> "What is this talk of "release"?  Klingons do not make software
> "releases".  Our software "escapes" leaving a bloody trail of
> designers and quality assurance people in its wake."



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

* Re: set margin width locally doesn't work
  2008-08-18  9:33   ` Najja
@ 2008-08-18 21:00     ` Pascal J. Bourguignon
  2008-08-19  8:42       ` najja
  0 siblings, 1 reply; 5+ messages in thread
From: Pascal J. Bourguignon @ 2008-08-18 21:00 UTC (permalink / raw)
  To: help-gnu-emacs

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.


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

* Re: set margin width locally doesn't work
  2008-08-18 21:00     ` Pascal J. Bourguignon
@ 2008-08-19  8:42       ` najja
  0 siblings, 0 replies; 5+ messages in thread
From: najja @ 2008-08-19  8:42 UTC (permalink / raw)
  To: help-gnu-emacs

You are right. It's better to reverse it and make zero margin default.
Thanks.

btw: major-mode is a variable instead of a function. :-)

On Aug 19, 5:00 am, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> Najja <yijun...@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.



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

end of thread, other threads:[~2008-08-19  8:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2008-08-19  8:42       ` najja

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.