- Subject: save buffer variables
- From: Joerg Sommer <joerg@xxxxxxxxxxxx>
- Date: Fri, 19 Nov 2004 11:27:06 +0000 (UTC)
Hi,
is it possible to save blocal variables in the file? Sometimes blocal
vars holds values needed across a session e.g. the output type of a latex
file (pdf, dvi, ps). Can Jed save this variables automaticly?
Currently I use the following _jed_save_buffer_before_hooks hook:
private define save_buf_before_hook(filename)
{
variable buf = latex_external->find_buf_of_file(filename);
if (buf == NULL)
buf = whatbuf();
setbuf(buf);
push_spot();
eob();
variable old_buf_flags;
(,,,old_buf_flags) = getbuf_info();
setbuf_info( getbuf_info() & ~0x20 );
% the buf should end with a newline
!if(bolp()) insert_char('\n');
% Fix me!
while ( andelse {up(1)} {bol(), looking_at_char('%')} ) {
skip_chars("% ");
if ( looking_at("LaTeX") ) {
bol();
push_mark();
eol();
()=right(1);
del_region();
}
}
% ()=down(1);
% !if (eobp()) { eol(); insert_char('\n'); }
eob();
foreach ( ["LaTeX_master_file", "LaTeX_output_format"] ) {
variable name = ();
if ( latex_external->exists_master_file_var(name) )
insert("% "+name+": "+latex_external->get_master_file_var(name)+"\n");
}
setbuf_info( getbuf_info() | (old_buf_flags&0x20) );
pop_spot();
}
This code is very simple to use for any other mode and I think there
similar applicabilities. Hence it makes sense to put this code in jed and
make blocal vars "exportable".
Bye, Joerg.
--
"Politics is for the moment, equations are forever"
-- Albert Einstein
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2004 date index]
[2004 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]