* want to go to the 2345th byte, not character
@ 2005-06-22 17:20 Dan Jacobson
2005-06-23 4:44 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Dan Jacobson @ 2005-06-22 17:20 UTC (permalink / raw
I'm sitting in a unicode buffer and I want to go to the 2345th byte.
ESC 2 3 4 5 C-f will take me to the 2345th character, wide and narrow
included, but not the 2345th byte. Therefore there should be an
additional command that operates byte wise. No I don't want to leave
unicode mode.
So a C-f analog that counts in bytes would be good.
"byte-forward-char" sounds good but must be an unrelated variable.
P.S.
C-f runs the command forward-char
Move point right N characters (left if N is negative).
Perhaps that right and left stuff should be reworded in view of BIDI
(Arabic, Hebrew) languages? Just say forward and backward?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: want to go to the 2345th byte, not character
2005-06-22 17:20 want to go to the 2345th byte, not character Dan Jacobson
@ 2005-06-23 4:44 ` Eli Zaretskii
2005-06-23 15:56 ` Dan Jacobson
0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2005-06-23 4:44 UTC (permalink / raw
Cc: bug-gnu-emacs
> From: Dan Jacobson <jidanni@jidanni.org>
> Date: Thu, 23 Jun 2005 01:20:07 +0800
>
> I'm sitting in a unicode buffer and I want to go to the 2345th byte.
There are no original bytes in the Emacs buffer. Emacs decodes the
file when it reads it; the decoding process removes the original byte
sequences that stood for the encoded characters in the file, and in
their stead inserts the characters in the Emacs internal
representation, which is very different from what's in the file.
> ESC 2 3 4 5 C-f will take me to the 2345th character, wide and narrow
> included, but not the 2345th byte. Therefore there should be an
> additional command that operates byte wise.
Can you tell why you need that?
Anyway, if you want to treat the file as a stream of bytes, you need a
byte editing mode; use hexl-find-file for that.
> C-f runs the command forward-char
> Move point right N characters (left if N is negative).
>
> Perhaps that right and left stuff should be reworded in view of BIDI
> (Arabic, Hebrew) languages?
You assume that C-f in a right-to-left language will still move in the
logical (as opposed to visual) direction. That is not a given; when
we implement bidi support for Emacs, we will have to figure out what
is the best behavior here. Until then, there's no need to use
abstractions where none are required.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: want to go to the 2345th byte, not character
2005-06-23 4:44 ` Eli Zaretskii
@ 2005-06-23 15:56 ` Dan Jacobson
2005-06-23 21:05 ` Kevin Rodgers
2005-06-24 10:40 ` Eli Zaretskii
0 siblings, 2 replies; 6+ messages in thread
From: Dan Jacobson @ 2005-06-23 15:56 UTC (permalink / raw
Eli> Can you tell why you need that?
iconv said there was a problem at the 2345th character in that file
and I wanted to see what the file looked like around there.
Eli> use hexl-find-file for that.
But then I can't see it in the native language I bet.
OK, next time I'll try dd(1).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: want to go to the 2345th byte, not character
2005-06-23 15:56 ` Dan Jacobson
@ 2005-06-23 21:05 ` Kevin Rodgers
2005-06-24 10:40 ` Eli Zaretskii
1 sibling, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2005-06-23 21:05 UTC (permalink / raw
Dan Jacobson wrote:
> Eli> Can you tell why you need that?
>
> iconv said there was a problem at the 2345th character in that file
> and I wanted to see what the file looked like around there.
C-x RET c raw-text RET C-x C-f my_file.txt RET
> Eli> use hexl-find-file for that.
>
> But then I can't see it in the native language I bet.
Hexl mode displays each byte's corresponding character as well as its
2-digit hexadecimal value.
> OK, next time I'll try dd(1).
Yuck.
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: want to go to the 2345th byte, not character
2005-06-23 15:56 ` Dan Jacobson
2005-06-23 21:05 ` Kevin Rodgers
@ 2005-06-24 10:40 ` Eli Zaretskii
2005-06-26 5:11 ` hexl vs. non-ASCII Dan Jacobson
1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2005-06-24 10:40 UTC (permalink / raw
Cc: bug-gnu-emacs
> From: Dan Jacobson <jidanni@jidanni.org>
> Date: Thu, 23 Jun 2005 23:56:38 +0800
>
> Eli> Can you tell why you need that?
>
> iconv said there was a problem at the 2345th character in that file
> and I wanted to see what the file looked like around there.
I hope you filed a bug report with the iconv maintainers, asking them
to report the character number as well as the byte number. I don't
see why Emacs should fix the entire world out there.
> Eli> use hexl-find-file for that.
>
> But then I can't see it in the native language I bet.
If hexl doesn't show decoded non-ASCII characters alongside the hex
byte values (I don't remember whether it should), then perhaps you
should request a feature for it to do so.
^ permalink raw reply [flat|nested] 6+ messages in thread
* hexl vs. non-ASCII
2005-06-24 10:40 ` Eli Zaretskii
@ 2005-06-26 5:11 ` Dan Jacobson
0 siblings, 0 replies; 6+ messages in thread
From: Dan Jacobson @ 2005-06-26 5:11 UTC (permalink / raw
Eli> If hexl doesn't show decoded non-ASCII characters alongside the
Eli> hex byte values (I don't remember whether it should), then
Eli> perhaps you should request a feature for it to do so.
OK, hexl is apparently pure ASCII when it could also show wide
characters, so I hereby request a feature for it to do so, if you
insist :-)
Maybe it could show all three side by side, 4 bit, 8 bit, 16 bit &
more bit. Morbid.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-06-26 5:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-22 17:20 want to go to the 2345th byte, not character Dan Jacobson
2005-06-23 4:44 ` Eli Zaretskii
2005-06-23 15:56 ` Dan Jacobson
2005-06-23 21:05 ` Kevin Rodgers
2005-06-24 10:40 ` Eli Zaretskii
2005-06-26 5:11 ` hexl vs. non-ASCII Dan Jacobson
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).