Re: question about a change to InsetBibtex::getKeys
On 17 Oct 2000, Lars Gullik Bjønnes wrote: > Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: > > | > "Baruch" == Baruch Even <[EMAIL PROTECTED]> writes: > | > | >> The effect of the Path p thing is a local chdir. It changes the > | >> current directory, and then restores it when p is deleted. Does > | >> this answer to your question? > | > | Baruch> It is a good idea then to document this unnoticeable side > | Baruch> effect. Adding the following line will do wonders to the > | Baruch> understanding of this code for later maintenance. > > Bllrtth... you are allowed to read the source... > > src/support/path.[Ch] Yes, but you mostly do that after you are bit by not understanding the side effects from the direct code in question. I won't bother reading and memorizing half of the LyX source code just to understand one module. I'd expect a normal thing to have good names or at least comments as to why something is done, especially if its done mostly for an obscure side-effect that is not apparent from the function name. And in this case its even more obscure since all that is "done" is creation of an object instance. -- Baruch Even http://techst02.technion.ac.il/~sbaruch/ (My Site) http://www.redrival.com/jindor/(My brothers AD&D site) " Learn to laugh ... it's the path to true love! " - The Angel in the movie Michael
Re: question about a change to InsetBibtex::getKeys
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: | > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: | | Angus> Certainly Path is not intuitive (and the source is not exactly | Angus> transparent!;-) | | At least, there should be documentation in path.h. I can't disagree on that. Lgb
Re: question about a change to InsetBibtex::getKeys
Angus Leeming <[EMAIL PROTECTED]> writes: | JMarc> The effect of the Path p thing is a local chdir. It changes the | JMarc> current directory, and then restores it when p is deleted. Does | JMarc> this answer to your question? | | [snip...] | | > Besides it is a bit more than a LocalChdir... | | No it's not! It does exactly what Jean-Marc says it does. Why not call it | TempChdir, suggesting that the directory change exists as long as the | variable remains in scope. jadda jadda bla bla | Certainly Path is not intuitive (and the source is not exactly | transparent!;-) If you had seen how it was doen before Path was introduced you would have said it was obvious and intuitive. :-) | I'd be happy to make the changes as it was me who raised the question in the | first place. Just say yeah or neah... Hey... that is one of my first babies using that idom. I have feelings you know. Dammit, why must everything be intuitive... Lgb
Re: question about a change to InsetBibtex::getKeys
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: Angus> Certainly Path is not intuitive (and the source is not exactly Angus> transparent!;-) At least, there should be documentation in path.h. JMarc
Re: question about a change to InsetBibtex::getKeys
JMarc> The effect of the Path p thing is a local chdir. It changes the JMarc> current directory, and then restores it when p is deleted. Does JMarc> this answer to your question? [snip...] > Besides it is a bit more than a LocalChdir... No it's not! It does exactly what Jean-Marc says it does. Why not call it TempChdir, suggesting that the directory change exists as long as the variable remains in scope. Certainly Path is not intuitive (and the source is not exactly transparent!;-) I'd be happy to make the changes as it was me who raised the question in the first place. Just say yeah or neah... A
Re: question about a change to InsetBibtex::getKeys
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: | > "Baruch" == Baruch Even <[EMAIL PROTECTED]> writes: | | >> The effect of the Path p thing is a local chdir. It changes the | >> current directory, and then restores it when p is deleted. Does | >> this answer to your question? | | Baruch> It is a good idea then to document this unnoticeable side | Baruch> effect. Adding the following line will do wonders to the | Baruch> understanding of this code for later maintenance. Bllrtth... you are allowed to read the source... src/support/path.[Ch] | | Baruch> // This will change the current directory for the duration of | Baruch> the method. | | Yes, but Path is used in a lot of places... I think the name of the | class could be changed to something more verbose like LocalChdir (or | something less stupid). :-) Are yo questioning my naming? Besides it is a bit more than a LocalChdir... Lgb
Re: question about a change to InsetBibtex::getKeys
> "Baruch" == Baruch Even <[EMAIL PROTECTED]> writes: >> The effect of the Path p thing is a local chdir. It changes the >> current directory, and then restores it when p is deleted. Does >> this answer to your question? Baruch> It is a good idea then to document this unnoticeable side Baruch> effect. Adding the following line will do wonders to the Baruch> understanding of this code for later maintenance. Baruch> // This will change the current directory for the duration of Baruch> the method. Yes, but Path is used in a lot of places... I think the name of the class could be changed to something more verbose like LocalChdir (or something less stupid). JMarc
Re: question about a change to InsetBibtex::getKeys
On 17 Oct 2000, Jean-Marc Lasgouttes wrote: > > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: > > Angus> I recently changed InsetBibtex::getKeys() so that it was passed > Angus> a Buffer *. It needed this so that it could set Path > Angus> p(buffer->filepath); without having to use > Angus> current_view->buffer. > > Angus> Looking at the code again, I see that "p" is not used to find > Angus> the file path anymore. I'm sure that this is a recent change > Angus> and I seem to remember reading some comments by Jean-Marc in > Angus> the original code about why it was needed. > > The effect of the Path p thing is a local chdir. It changes the > current directory, and then restores it when p is deleted. Does this > answer to your question? It is a good idea then to document this unnoticeable side effect. Adding the following line will do wonders to the understanding of this code for later maintenance. // This will change the current directory for the duration of the method. -- Baruch Even http://techst02.technion.ac.il/~sbaruch/ (My Site) http://www.redrival.com/jindor/(My brothers AD&D site) " Learn to laugh ... it's the path to true love! " - The Angel in the movie Michael
Re: question about a change to InsetBibtex::getKeys
On Tue, 17 Oct 2000, Jean-Marc Lasgouttes wrote: > > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: > > Angus> I recently changed InsetBibtex::getKeys() so that it was passed > Angus> a Buffer *. It needed this so that it could set Path > Angus> p(buffer->filepath); without having to use > Angus> current_view->buffer. > > Angus> Looking at the code again, I see that "p" is not used to find > Angus> the file path anymore. I'm sure that this is a recent change > Angus> and I seem to remember reading some comments by Jean-Marc in > Angus> the original code about why it was needed. > > The effect of the Path p thing is a local chdir. It changes the > current directory, and then restores it when p is deleted. Does this > answer to your question? Yes it does. Thanks, JMarc.
Re: question about a change to InsetBibtex::getKeys
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: Angus> I recently changed InsetBibtex::getKeys() so that it was passed Angus> a Buffer *. It needed this so that it could set Path Angus> p(buffer->filepath); without having to use Angus> current_view->buffer. Angus> Looking at the code again, I see that "p" is not used to find Angus> the file path anymore. I'm sure that this is a recent change Angus> and I seem to remember reading some comments by Jean-Marc in Angus> the original code about why it was needed. The effect of the Path p thing is a local chdir. It changes the current directory, and then restores it when p is deleted. Does this answer to your question? JMarc
