jed-users mailing list

[2016 Date Index] [2016 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] edit binary file?


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]