* bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23)
[not found] ` <handler.2878.B.123877206328398.ack@emacsbugs.donarmstrong.com>
@ 2009-04-03 16:01 ` Yee Keat Phuah
0 siblings, 0 replies; 3+ messages in thread
From: Yee Keat Phuah @ 2009-04-03 16:01 UTC (permalink / raw)
To: 2878
Hi,
snogglethorpe from #emacs have suggested this patch and it worked for
my elisp code
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index 4843e27..154bffe 100644
--- a/lisp/emacs-lisp/bindat.el
+++ b/lisp/emacs-lisp/bindat.el
@@ -609,9 +609,9 @@ Optional fourth arg BINDAT-IDX is the starting
offset into BINDAT-RAW."
(let ((no-return bindat-raw))
(unless bindat-idx (setq bindat-idx 0))
(unless bindat-raw
- (setq bindat-raw (make-vector (+ bindat-idx (bindat-length spec
struct)) 0)))
+ (setq bindat-raw (make-string (+ bindat-idx (bindat-length spec
struct)) 0)))
(bindat--pack-group struct spec)
- (if no-return nil (concat bindat-raw))))
+ (if no-return nil bindat-raw)))
On Fri, Apr 3, 2009 at 11:25 PM, Emacs bug Tracking System
<owner@emacsbugs.donarmstrong.com> wrote:
>
> Thank you for filing a new bug report with Emacs.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
> Emacs Bugs <bug-gnu-emacs@gnu.org>
>
> If you wish to submit further information on this problem, please
> send it to 2878@emacsbugs.donarmstrong.com, as before.
>
> Please do not send mail to owner@emacsbugs.donarmstrong.com unless you wish
> to report a problem with the Bug-tracking system.
>
>
> --
> 2878: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2878
> Emacs Bug Tracking System
> Contact owner@emacsbugs.donarmstrong.com with problems
>
--
Cheers,
Phuah Yee Keat
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23)
@ 2009-05-03 14:49 Chong Yidong
2009-05-03 22:28 ` Miles Bader
0 siblings, 1 reply; 3+ messages in thread
From: Chong Yidong @ 2009-05-03 14:49 UTC (permalink / raw)
To: Miles Bader; +Cc: Yee Keat Phuah, 2878
Miles, could I verify that this patch is correct, and should be checked
in?
> snogglethorpe from #emacs have suggested this patch and it worked for
> my elisp code
> --- a/lisp/emacs-lisp/bindat.el
> +++ b/lisp/emacs-lisp/bindat.el
> @@ -609,9 +609,9 @@ Optional fourth arg BINDAT-IDX is the starting
> offset into BINDAT-RAW."
> (let ((no-return bindat-raw))
> (unless bindat-idx (setq bindat-idx 0))
> (unless bindat-raw
> - (setq bindat-raw (make-vector (+ bindat-idx (bindat-length spec struct)) 0)))
> + (setq bindat-raw (make-string (+ bindat-idx (bindat-length spec struct)) 0)))
> (bindat--pack-group struct spec)
> - (if no-return nil (concat bindat-raw))))
> + (if no-return nil bindat-raw)))
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23)
2009-05-03 14:49 bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23) Chong Yidong
@ 2009-05-03 22:28 ` Miles Bader
0 siblings, 0 replies; 3+ messages in thread
From: Miles Bader @ 2009-05-03 22:28 UTC (permalink / raw)
To: Chong Yidong; +Cc: Yee Keat Phuah, 2878
2009/5/3 Chong Yidong <cyd@stupidchicken.com>:
> Miles, could I verify that this patch is correct, and should be checked
> in?
>
>> snogglethorpe from #emacs have suggested this patch and it worked for
>> my elisp code
>
>> --- a/lisp/emacs-lisp/bindat.el
>> +++ b/lisp/emacs-lisp/bindat.el
I think it should be checked in. I don't have intimate familiarity
with this code, but I did look at the problem and make the patch.
The other code in the file stores numerical values into the
`bindat-raw' using aset, and then wants to return the whole thing as a
unicode string containing those byte values. The old code made a
vector, stored into it, and turned the vector into a string using
`concat' -- however that ends up making a _multibyte_ string (I don't
know whether this is a bug in concat or not). The new method of
making a string initially and storing directly into it results in a
unibyte string, which is what is desired (this method is also more
efficient).
-Miles
--
Do not taunt Happy Fun Ball.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-03 22:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-03 14:49 bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23) Chong Yidong
2009-05-03 22:28 ` Miles Bader
-- strict thread matches above, loose matches on Subject: below --
2009-04-03 15:20 bug#2878: bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23 Yee Keat Phuah
[not found] ` <handler.2878.B.123877206328398.ack@emacsbugs.donarmstrong.com>
2009-04-03 16:01 ` bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23) Yee Keat Phuah
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.