'bomb' in new buffer is not set to global value

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

'bomb' in new buffer is not set to global value

A.J.Mechelynck
After ":setglobal bomb", opening a new buffer (e.g., using ":new" or
":enew") does not set 'bomb' for that buffer; rather, the default value
'nobomb' is used.

Bug or feature?

Using gvim 7.00aa.0104 for W32 with &enc == "utf-8"


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: 'bomb' in new buffer is not set to global value

Bram Moolenaar

Tony Mechelynck wrote:

> After ":setglobal bomb", opening a new buffer (e.g., using ":new" or
> ":enew") does not set 'bomb' for that buffer; rather, the default value
> 'nobomb' is used.
>
> Bug or feature?
>
> Using gvim 7.00aa.0104 for W32 with &enc == "utf-8"

Well, the 'binary' option is a bit similar, and for that one the global
value is used for a new buffer.  Thus I suppose it should happen for
'bomb' too.  Not for an option like 'buftype'.


*** option.c~ Mon Jul  4 15:53:23 2005
--- option.c Fri Jul  8 21:32:53 2005
***************
*** 8705,8710 ****
--- 8705,8711 ----
     buf->b_p_wm_nopaste = p_wm_nopaste;
     buf->b_p_wm_nobin = p_wm_nobin;
     buf->b_p_bin = p_bin;
+    buf->b_p_bomb = p_bomb;
     buf->b_p_et = p_et;
     buf->b_p_et_nobin = p_et_nobin;
     buf->b_p_ml = p_ml;

--
press CTRL-ALT-DEL for more information

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
Reply | Threaded
Open this post in threaded view
|

Re: 'bomb' in new buffer is not set to global value

A.J.Mechelynck
----- Original Message -----
From: "Bram Moolenaar" <[hidden email]>
To: "Tony Mechelynck" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, July 08, 2005 9:48 PM
Subject: Re: 'bomb' in new buffer is not set to global value


>
> Tony Mechelynck wrote:
>
>> After ":setglobal bomb", opening a new buffer (e.g., using ":new" or
>> ":enew") does not set 'bomb' for that buffer; rather, the default value
>> 'nobomb' is used.
>>
>> Bug or feature?
>>
>> Using gvim 7.00aa.0104 for W32 with &enc == "utf-8"
>
> Well, the 'binary' option is a bit similar, and for that one the global
> value is used for a new buffer.  Thus I suppose it should happen for
> 'bomb' too.  Not for an option like 'buftype'.

Thanks for the patch. I suppose it will be (or already has been) included
into the next snapshot?

My reasoning (after reading ":help local-options" and in particular the
paragraph starting at options.txt [7.00aa, 2005 Jul 04] line 221) was that I
should use ":setglobal bomb" if (and only if) I wanted newly created Unicode
files to start with a BOM.


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: 'bomb' in new buffer is not set to global value

Bram Moolenaar

Tony Mechelynck wrote:

> > Tony Mechelynck wrote:
> >
> >> After ":setglobal bomb", opening a new buffer (e.g., using ":new" or
> >> ":enew") does not set 'bomb' for that buffer; rather, the default value
> >> 'nobomb' is used.
> >>
> >> Bug or feature?
> >>
> >> Using gvim 7.00aa.0104 for W32 with &enc == "utf-8"
> >
> > Well, the 'binary' option is a bit similar, and for that one the global
> > value is used for a new buffer.  Thus I suppose it should happen for
> > 'bomb' too.  Not for an option like 'buftype'.
>
> Thanks for the patch. I suppose it will be (or already has been) included
> into the next snapshot?

Yes.

> My reasoning (after reading ":help local-options" and in particular
> the paragraph starting at options.txt [7.00aa, 2005 Jul 04] line 221)
> was that I should use ":setglobal bomb" if (and only if) I wanted
> newly created Unicode files to start with a BOM.

The global values are used when opening a new buffer, yes.  It sounds a
bit complicated but mostly this does what most people expect to happen.

--
       When danger reared its ugly head,
       He bravely turned his tail and fled
       Yes, Brave Sir Robin turned about
       And gallantly he chickened out
       Bravely taking to his feet
       He beat a very brave retreat
       Bravest of the brave Sir Robin
       Petrified of being dead
       Soiled his pants then brave Sir Robin
       Turned away and fled.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///