- Subject: Re: [jed-users] edit binary file?
- From: jed@xxxxxxxxxxx (John E. Davis)
- Date: Sat, 15 Oct 2016 21:06:23 -0400
Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx> wrote:
> public define binary() {
> variable flags;
>
> no_mode();
> set_mode("binary",0);
> set_overwrite(1);
> getbuf_info();
> setbuf_info(()|0x200);
It might be a bit cleaner to replace the previous two lines by
_set_buffer_flag(0x200);
>}
>
> And can run: jed file.bin --binary
The problem with this is that your `binary' function will get executed
after the file has been read into the editor. By default, files are
read in as text files. You will need to call
`set_file_translation(1)' prior to reading the file into the editor
(see the implementation of `find_binary_file' in binary.sl), e.g.,
jed -f 'set_file_translation(1)' file.bin --binary
Good luck,
--John
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2016 date index]
[2016 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]