* decode-coding-region
@ 1998-09-03 14:56 Hrvoje Niksic
1998-09-03 20:44 ` decode-coding-region Lars Magne Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Hrvoje Niksic @ 1998-09-03 14:56 UTC (permalink / raw)
FYI, decode-coding-region and encode-coding-region also thrash the
extents under XEmacs. If you need a workaround for that, please let
me know.
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
By any chance, have you seen a summoned 9th order fire elemental
wandering around? No? Oh.. Tell me if you do.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: decode-coding-region
1998-09-03 14:56 decode-coding-region Hrvoje Niksic
@ 1998-09-03 20:44 ` Lars Magne Ingebrigtsen
1998-09-04 12:09 ` decode-coding-region Hrvoje Niksic
0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-09-03 20:44 UTC (permalink / raw)
Hrvoje Niksic <hniksic@srce.hr> writes:
> FYI, decode-coding-region and encode-coding-region also thrash the
> extents under XEmacs. If you need a workaround for that, please let
> me know.
It would be nice to preserve the extents.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: decode-coding-region
1998-09-03 20:44 ` decode-coding-region Lars Magne Ingebrigtsen
@ 1998-09-04 12:09 ` Hrvoje Niksic
1998-09-04 15:41 ` decode-coding-region Lars Magne Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Hrvoje Niksic @ 1998-09-04 12:09 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Hrvoje Niksic <hniksic@srce.hr> writes:
>
> > FYI, decode-coding-region and encode-coding-region also thrash the
> > extents under XEmacs. If you need a workaround for that, please let
> > me know.
>
> It would be nice to preserve the extents.
You might want to try something like this until we fix the primitives:
(defmacro gnus-xmas-preserve-extents (&rest body)
(let ((extents (gensym "extents-")))
`(let (,extents)
(map-extents (lambda (extent ignored)
(push (list extent
(extent-start-position extent)
(extent-end-position extent))
,extents)
(detach-extent extent)
nil)
buffer start end)
,@body
(dolist (extent ,extents)
(set-extent-endpoints (first extent) (second extent) (third extent))))))
(defun gnus-xmas-decode-coding-region (start end coding-system &optional buffer)
"Like decode-coding-region, but preserves extents."
(gnus-xmas-preserve-extents
(decode-coding-region start end coding-system buffer)))
(defun gnus-xmas-encode-coding-region (start end coding-system &optional buffer)
"Like encode-coding-region, but preserves extents."
(gnus-xmas-preserve-extents
(encode-coding-region start end coding-system buffer)))
However, this will fail to work correctly when the decoding changes
the number of characters, because the extent indices will not be
preserved correctly.
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Thou Who might be our Father Who perhaps may be in Heaven...
-- Roger Zelazny
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: decode-coding-region
1998-09-04 12:09 ` decode-coding-region Hrvoje Niksic
@ 1998-09-04 15:41 ` Lars Magne Ingebrigtsen
1998-09-04 16:49 ` decode-coding-region Hrvoje Niksic
0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-09-04 15:41 UTC (permalink / raw)
Hrvoje Niksic <hniksic@srce.hr> writes:
> However, this will fail to work correctly when the decoding changes
> the number of characters, because the extent indices will not be
> preserved correctly.
Decoding iso-2022-jp, for instance, will change the number of chars,
so I don't know how useful this approach is...
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: decode-coding-region
1998-09-04 15:41 ` decode-coding-region Lars Magne Ingebrigtsen
@ 1998-09-04 16:49 ` Hrvoje Niksic
0 siblings, 0 replies; 5+ messages in thread
From: Hrvoje Niksic @ 1998-09-04 16:49 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Hrvoje Niksic <hniksic@srce.hr> writes:
>
> > However, this will fail to work correctly when the decoding changes
> > the number of characters, because the extent indices will not be
> > preserved correctly.
>
> Decoding iso-2022-jp, for instance, will change the number of chars,
> so I don't know how useful this approach is...
Pretty useless I guess. I'll try to make the functions do the right
thing, then.
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
I luv the smell of nature in the morning. Smells like manure!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1998-09-04 16:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-03 14:56 decode-coding-region Hrvoje Niksic
1998-09-03 20:44 ` decode-coding-region Lars Magne Ingebrigtsen
1998-09-04 12:09 ` decode-coding-region Hrvoje Niksic
1998-09-04 15:41 ` decode-coding-region Lars Magne Ingebrigtsen
1998-09-04 16:49 ` decode-coding-region Hrvoje Niksic
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 NNTP newsgroup(s).