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

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

Re: Using setq with global-mode-string


From: Decebal
Subject: Re: Using setq with global-mode-string
Date: Sat, 17 Jan 2009 03:30:18 -0800 (PST)
User-agent: G2/1.0

On Jan 17, 6:18 am, Barry Margolin <bar...@alum.mit.edu> wrote:
> >     (unless (memq 'buffer-count-lines global-mode-string)
> >       (add-to-list 'global-mode-string " Lines: "          t)
> >       (add-to-list 'global-mode-string 'buffer-count-lines t)
> >       (add-to-list 'global-mode-string " Words: "          t)
> >       (add-to-list 'global-mode-string 'buffer-count-words t)
> >       (add-to-list 'global-mode-string " Chars: "          t)
> >       (add-to-list 'global-mode-string 'buffer-count-chars t)
> >       (add-to-list 'global-mode-string "  "                t)
> >     ;  (setq global-mode-string
> >     ;      (list 'global-mode-string
> >     ;            " Lines: " 'buffer-count-lines
> >     ;            " Words: " 'buffer-count-words
> >     ;            " Chars: " 'buffer-count-chars
> >     ;            " "
> >     ;            )
> >     ;      )
> >       )
>
> > This works okay. But I would prefer to use the commented setq instead
> > of the seven add-to-list. I would think it does the same, but when
> > using setq instead of the add-to-list's, only ' Lines: ' is displayed
> > and nothing else. Why?
>
> Try:
>
> (setq global-mode-string
>       (append global-mode-string
>               '(" Lines: " buffer-count-lines
>                 " Words: " buffer-count-words
>                 " Chars: " buffer-count-chars
>                 " ")))

That works. Thanks.


reply via email to

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