unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* locals.texi
@ 2006-06-28 22:49 Nick Roberts
  2006-06-29 17:57 ` locals.texi Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Roberts @ 2006-06-28 22:49 UTC (permalink / raw)



Here's an update to the list of buffer local variables.  Most are new to Emacs
22 (fill-prefix and font-lock-defaults are two exceptions.  I guess the notion
of standard is a bit arbitrary but I've roughly assumed if that if it's
mentioned in the manual then it's standard.  If some of the variables that
I've added aren't appropriate then I'll move then to the @ignore section at
the end so that, in future, everyone can see that their omission is deliberate.

To clarfiy the concept of buffer local variables for myself:

In gdb-ui.el (as in many other files, I often just copy current practice), I
have constructs like

  (set (make-local-variable 'font-lock-defaults)
       '(gdb-memory-font-lock-keywords))

but I could just do

  (setq font-lock-defaults '(gdb-memory-font-lock-keywords))

?

-- 
Nick                                           http://www.inet.net.nz/~nickrob


*** locals.texi	07 Feb 2006 10:14:44 +1300	1.23
--- locals.texi	29 Jun 2006 10:35:36 +1200	
*************** mode variables will not be listed here.
*** 65,70 ****
--- 65,73 ----
  @item buffer-offer-save
  @xref{Killing Buffers}.
  
+ @item buffer-save-without-query
+ @xref{Killing Buffers}.
+ 
  @item buffer-read-only
  @xref{Read Only Buffers}.
  
*************** mode variables will not be listed here.
*** 86,91 ****
--- 89,97 ----
  @item cursor-type
  @xref{Cursor Parameters}.
  
+ @item cursor-in-non-selected-windows
+ @xref{Basic Windows}.
+ 
  @item comment-column
  @xref{Comments,,, emacs, The GNU Emacs Manual}.
  
*************** Does not work yet.
*** 109,114 ****
--- 115,132 ----
  @item fill-column
  @xref{Margins}.
  
+ @item fill-prefix
+ @xref{Margins}.
+ 
+ @item font-lock-defaults
+ @xref{Font Lock Basics}.
+ 
+ @item fringe-cursor-alist
+ @xref{Fringe Cursors}.
+ 
+ @item fringe-indicator-alist
+ @xref{Fringe Indicators}.
+ 
  @item fringes-outside-margins
  @xref{Fringes}.
  
*************** Used for communication between mouse com
*** 172,177 ****
--- 190,198 ----
  @item right-margin-width
  @xref{Display Margins}.
  
+ @item save-buffer-coding-system
+ @xref{Encoding and I/O}.
+ 
  @item scroll-bar-width
  @xref{Scroll Bars}.
  
*************** Used for communication between mouse com
*** 195,202 ****
--- 216,238 ----
  
  @item vertical-scroll-bar
  @xref{Scroll Bars}.
+ 
+ @item window-size-fixed
+ @xref{Resizing Windows}.
+ 
+ @item write-contents-functions
+ @xref{Saving Buffers}.
  @end table
  
  @ignore
+ Buffer local variables mentioned in manual but not considered worth
+ mentioning here:
+ 
+ left-fringe-width
+ right-fringe-width
+ @end ignore
+ 
+ 
+ @ignore
     arch-tag: 6baae835-b667-4447-91e2-9829ae1cf543
  @end ignore

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

* Re: locals.texi
  2006-06-28 22:49 locals.texi Nick Roberts
@ 2006-06-29 17:57 ` Richard Stallman
  2006-07-04 16:31   ` locals.texi Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2006-06-29 17:57 UTC (permalink / raw)
  Cc: emacs-devel

    In gdb-ui.el (as in many other files, I often just copy current practice), I
    have constructs like

      (set (make-local-variable 'font-lock-defaults)
	   '(gdb-memory-font-lock-keywords))

1. It is always cleaner to use separate calls to make-local-variable
   and setq.

2. When the variable is automatically local, it is ok to
   delete the call to make-local-variable.  A major mode
   normally doesn't set any variable that isn't local.

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

* Re: locals.texi
  2006-06-29 17:57 ` locals.texi Richard Stallman
@ 2006-07-04 16:31   ` Stefan Monnier
  2006-07-04 20:53     ` locals.texi Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2006-07-04 16:31 UTC (permalink / raw)
  Cc: Nick Roberts, emacs-devel

>       (set (make-local-variable 'font-lock-defaults)
> 	   '(gdb-memory-font-lock-keywords))

> 1. It is always cleaner to use separate calls to make-local-variable
>    and setq.

That's not true.  *You* may always find it cleaner, but it's far from
a general truth.  E.g. I strongly prefer to keep the two together (actually
I'd like to introduce a setq-local macro for it).


        Stefan

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

* Re: locals.texi
  2006-07-04 16:31   ` locals.texi Stefan Monnier
@ 2006-07-04 20:53     ` Richard Stallman
  2006-07-04 23:33       ` locals.texi Nick Roberts
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2006-07-04 20:53 UTC (permalink / raw)
  Cc: nickrob, emacs-devel

    > 1. It is always cleaner to use separate calls to make-local-variable
    >    and setq.

    That's not true.  *You* may always find it cleaner, but it's far from
    a general truth.

I think that separate calls are always cleaner.
You're entitled to your opinion, of course.

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

* Re: locals.texi
  2006-07-04 20:53     ` locals.texi Richard Stallman
@ 2006-07-04 23:33       ` Nick Roberts
  2006-07-05 17:01         ` locals.texi Richard Stallman
  2006-07-07  3:55         ` locals.texi Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Nick Roberts @ 2006-07-04 23:33 UTC (permalink / raw)
  Cc: Stefan Monnier, emacs-devel

Richard Stallman writes:
 >     > 1. It is always cleaner to use separate calls to make-local-variable
 >     >    and setq.
 > 
 >     That's not true.  *You* may always find it cleaner, but it's far from
 >     a general truth.
 > 
 > I think that separate calls are always cleaner.
 > You're entitled to your opinion, of course.

I guess if the make-local-variable and setq get separated then it might
not be immediately obvious that the variable is buffer-local.

However, my original question was that with a variable like
font-lock-defaults, that automatically becomes buffer-local in each buffer, I
presumably don't need to use make-local-variable at all?

-- 
Nick                                           http://www.inet.net.nz/~nickrob

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

* Re: locals.texi
  2006-07-04 23:33       ` locals.texi Nick Roberts
@ 2006-07-05 17:01         ` Richard Stallman
  2006-07-07  3:55         ` locals.texi Stefan Monnier
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2006-07-05 17:01 UTC (permalink / raw)
  Cc: monnier, emacs-devel

    However, my original question was that with a variable like
    font-lock-defaults, that automatically becomes buffer-local in each buffer, I
    presumably don't need to use make-local-variable at all?

Yes.

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

* Re: locals.texi
  2006-07-04 23:33       ` locals.texi Nick Roberts
  2006-07-05 17:01         ` locals.texi Richard Stallman
@ 2006-07-07  3:55         ` Stefan Monnier
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2006-07-07  3:55 UTC (permalink / raw)
  Cc: rms, emacs-devel

> However, my original question was that with a variable like
> font-lock-defaults, that automatically becomes buffer-local in each buffer, I
> presumably don't need to use make-local-variable at all?

That's only true if you're 100% sure that the call to
make-variable-buffer-local will always have been made before your code runs.

In the case of font-lock-defaults it's currently true (since it's in
font-core.el which is preloaded), but it wasn't true in older Emacsen.


        Stefan

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

end of thread, other threads:[~2006-07-07  3:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-28 22:49 locals.texi Nick Roberts
2006-06-29 17:57 ` locals.texi Richard Stallman
2006-07-04 16:31   ` locals.texi Stefan Monnier
2006-07-04 20:53     ` locals.texi Richard Stallman
2006-07-04 23:33       ` locals.texi Nick Roberts
2006-07-05 17:01         ` locals.texi Richard Stallman
2006-07-07  3:55         ` locals.texi Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).