- Subject: [jed-users] Re: edit binary file?
- From: Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 16 Oct 2016 09:44:46 +0200
On Sat 2016-10-15 (21:06), John E. Davis wrote:
> > getbuf_info();
> > setbuf_info(()|0x200);
>
> It might be a bit cleaner to replace the previous two lines by
>
> _set_buffer_flag(0x200);
I have these lines from binary.sl.
Perhaps you should change it there, too.
> > 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.
Ohh.. I have overlooked this! Thanks for the warning!
> 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
To clumsy to type in. Is there a do_before_fileread_hook or something
similar?
With this hook I could look at the command arguments, detect '--binary'
and then do automatically set_file_translation(1)
I have now:
root@fex:/sw/ubuntu-12.04/jed-0.99-20_116/bin# cat jedb
#!/bin/sh
exec jed -f 'set_file_translation(1)' "$@" --binary
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart E-Mail: horlacher@xxxxxxxxxxxxxxxxxxxx
Allmandring 30a Tel: ++49-711-68565868
70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
REF:<20161016010623.92CB2254A064@xxxxxxxxxxx>
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2016 date index]
[2016 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]