Re: [Orgmode] Bug: Store link to Wanderlust message fails when subject contains encoded characters [6.33trans (release_6.33f.173.g8f17)]
On Jan 3, 2010, at 10:25 PM, David Maus wrote: Hi Carsten, At Sun, 3 Jan 2010 19:47:18 +0100, Carsten Dominik wrote: Can I ask you to submit this as a bug report to Emacs? I'll certainly do that. Thanks. I also attached a patch for org-wl.el that removes all text properties of the subject string. I have applied the patch, thank you! - Carsten Regards -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. maus.da...@gmail.com ICQ... 241051416 0001-Remove-text-properties-of-subject-string-to-avoid-po.patch - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Bug: Store link to Wanderlust message fails when subject contains encoded characters [6.33trans (release_6.33f.173.g8f17)]
Hi David, could you please provide a full backtrace for this bug? Thanks! - Carsten On Jan 1, 2010, at 9:54 PM, David Maus wrote: Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. Storing a link to a Wanderlust message fails if the message's subject field contains an encoded character. For instance a message with the subject header field: , | Subject: Eine Meldung und ihre Geschichte: =?UTF-8?B?RsO8cg==?= zwei | Gutscheine an den Pranger ` Is returned by `wl-summary-line-subject' as a string with a text property that indicates that the last part of the string was (as far as I understood the elisp manual) converted to latin-iso8859-1 , | #(Eine Meldung und ihre Geschichte: Für zwei Gutscheine an den Pranger 35 68 (charset latin-iso8859-1)) ` Feeding this string to `org-email-link-description' causes `org-replace-escapes' to throw an error when setting the replace string rpl using format and concat *Messages* , | setq: Args out of range: 30, 35 ` A solution that obviously works is removing the text properties from the subject string before `org-email-link-description' is called. As the text property only tells us that the last part of the string was converted /to/ latin-iso-8859-1 this should cause no problems, should it? Regards, -- David Emacs : GNU Emacs 23.1.90.1 (i486-pc-linux-gnu, GTK+ Version 2.18.5) of 2009-12-17 on elegiac, modified by Debian Package: Org-mode version 6.33trans (release_6.33f.173.g8f17) -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. maus.da...@gmail.com ICQ... 241051416 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Bug: Store link to Wanderlust message fails when subject contains encoded characters [6.33trans (release_6.33f.173.g8f17)]
At Sun, 3 Jan 2010 14:40:58 +0100, Carsten Dominik wrote: Hi David, could you please provide a full backtrace for this bug? Backtrace attached. My first guess on why it happens was wrong, as expected: There are messages with encoded umlauts that do not cause this error. Regards -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. maus.da...@gmail.com ICQ... 241051416 Debugger entered--Lisp error: (args-out-of-range 30 45) format(%.30s #(Online-Pornografie: China nimmt Tausende Verdächtige fest 45 57 (charset latin-iso8859-1))) (setq rpl (format (concat ... s) (cdr e))) (while (string-match re string) (setq rpl (format ... ...)) (setq string (replace-match rpl t t string))) (while (setq e (pop table)) (setq re (concat %-?[0-9.]* ...)) (while (string-match re string) (setq rpl ...) (setq string ...))) (let ((case-fold-search nil) e re rpl) (while (setq e ...) (setq re ...) (while ... ... ...)) string) org-replace-escapes(Email from %f: %.30s ((%c) (%F . rss-hash (SpiegelSchlagzeilen)) (%f . SpiegelSchlagzeilen) (%T) (%t . ?) (%s . #(Online-Pornografie: China nimmt Tausende Verdächtige fest 45 57 ...)) (%m . c5870b37264417e9a721fc15fd537745.spiegelschlagzei...@rss-hash))) (let* ((p org-store-link-plist) (to ...) (from ...) (table ...)) (when (string-match %c fmt) (if ... ... ...)) (org-replace-escapes fmt table)) org-email-link-description() org-wl-store-link() run-hook-with-args-until-success(org-wl-store-link) (cond ((run-hook-with-args-until-success ...) (setq link ... desc ...)) ((equal ... *Org Edit Src Example*) (let ... ... ... ... ... ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...) (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type w3 :url ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type w3m :url ...)) ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type image :file buffer-file-name)) ((eq major-mode ...) (setq cpltxt ... link ...)) ((and buffer-file-name ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name ...) (setq cpltxt ...) (when ... ... ...) (setq link ...)) ((interactive-p) (error Cannot link to a buffer which is not visiting a file)) (t (setq link nil))) (let ((outline-regexp ...) link cpltxt desc description search txt custom-id) (cond (... ...) (... ...) (... ...) (... ...) (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (... ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc cpltxt)) (if (equal desc NONE) (setq desc nil)) (if (and ... link) (progn ... ... ...) (and link ...))) org-store-link(nil) call-interactively(org-store-link nil nil) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Bug: Store link to Wanderlust message fails when subject contains encoded characters [6.33trans (release_6.33f.173.g8f17)]
Hi David, this is a weird bug. I'd say it is a bug in `format', which does something bad with properties because a format like %.30s is used to shorten a string while properties in that string exist beyond that shortened part. On Jan 3, 2010, at 7:11 PM, David Maus wrote: At Sun, 3 Jan 2010 14:40:58 +0100, Carsten Dominik wrote: Hi David, could you please provide a full backtrace for this bug? Backtrace attached. My first guess on why it happens was wrong, as expected: There are messages with encoded umlauts that do not cause this error. This would fit with my observation, if the propertized part is not outside the part that gets formatted into the string. Would you like to try to make a patch which does remove the text properties for this case? - Carsten Regards -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. maus.da...@gmail.com ICQ... 241051416 Debugger entered--Lisp error: (args-out-of-range 30 45) format(%.30s #(Online-Pornografie: China nimmt Tausende Verdächtige fest 45 57 (charset latin-iso8859-1))) (setq rpl (format (concat ... s) (cdr e))) (while (string-match re string) (setq rpl (format ... ...)) (setq string (replace-match rpl t t string))) (while (setq e (pop table)) (setq re (concat %-?[0-9.]* ...)) (while (string-match re string) (setq rpl ...) (setq string ...))) (let ((case-fold-search nil) e re rpl) (while (setq e ...) (setq re ...) (while ... ... ...)) string) org-replace-escapes(Email from %f: %.30s ((%c) (%F . rss- hash (SpiegelSchlagzeilen)) (%f . SpiegelSchlagzeilen) (%T) (%t . ?) (%s . #(Online-Pornografie: China nimmt Tausende Verdächtige fest 45 57 ...)) (%m . c5870b37264417e9a721fc15fd537745.spiegelschlagzei...@rss-hash))) (let* ((p org-store-link-plist) (to ...) (from ...) (table ...)) (when (string-match %c fmt) (if ... ... ...)) (org-replace-escapes fmt table)) org-email-link-description() org-wl-store-link() run-hook-with-args-until-success(org-wl-store-link) (cond ((run-hook-with-args-until-success ...) (setq link ... desc ...)) ((equal ... *Org Edit Src Example*) (let ... ... ... ... ... ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...) (let ... ... ...)) ((eq major- mode ...) (setq cpltxt ... link ...) (org-store-link-props :type w3 :url ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org- store-link-props :type w3m :url ...)) ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type image :file buffer-file- name)) ((eq major-mode ...) (setq cpltxt ... link ...)) ((and buffer- file-name ...) (setq custom-id ...) (cond ... ... ...)) ((buffer- file-name ...) (setq cpltxt ...) (when ... ... ...) (setq link ...)) ((interactive-p) (error Cannot link to a buffer which is not visiting a file)) (t (setq link nil))) (let ((outline-regexp ...) link cpltxt desc description search txt custom-id) (cond (... ...) (... ...) (... ...) (... ...) (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (... ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc cpltxt)) (if (equal desc NONE) (setq desc nil)) (if (and ... link) (progn ... ... ...) (and link ...))) org-store-link(nil) call-interactively(org-store-link nil nil) - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Bug: Store link to Wanderlust message fails when subject contains encoded characters [6.33trans (release_6.33f.173.g8f17)]
On Jan 3, 2010, at 7:42 PM, Carsten Dominik wrote: Hi David, this is a weird bug. I'd say it is a bug in `format', which does something bad with properties because a format like %.30s is used to shorten a string while properties in that string exist beyond that shortened part. In fact, here is a simple test that reproduces this problem: (format %.10s (concat 1234567890 (propertize 12345678901234567890 'xxx 25))) The problem only shows if the start of the propertized section is already outsinde the width of the %.10s format field. The following works fine (only change: make the unpropertized part in the concat shorter than 10 characters: (format %.10s (concat 123456789 (propertize 12345678901234567890 'xxx 25))) Can I ask you to submit this as a bug report to Emacs? - Carsten On Jan 3, 2010, at 7:11 PM, David Maus wrote: At Sun, 3 Jan 2010 14:40:58 +0100, Carsten Dominik wrote: Hi David, could you please provide a full backtrace for this bug? Backtrace attached. My first guess on why it happens was wrong, as expected: There are messages with encoded umlauts that do not cause this error. This would fit with my observation, if the propertized part is not outside the part that gets formatted into the string. Would you like to try to make a patch which does remove the text properties for this case? - Carsten Regards -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. maus.da...@gmail.com ICQ... 241051416 Debugger entered--Lisp error: (args-out-of-range 30 45) format(%.30s #(Online-Pornografie: China nimmt Tausende Verdächtige fest 45 57 (charset latin-iso8859-1))) (setq rpl (format (concat ... s) (cdr e))) (while (string-match re string) (setq rpl (format ... ...)) (setq string (replace-match rpl t t string))) (while (setq e (pop table)) (setq re (concat %-?[0-9.]* ...)) (while (string-match re string) (setq rpl ...) (setq string ...))) (let ((case-fold-search nil) e re rpl) (while (setq e ...) (setq re ...) (while ... ... ...)) string) org-replace-escapes(Email from %f: %.30s ((%c) (%F . rss- hash (SpiegelSchlagzeilen)) (%f . SpiegelSchlagzeilen) (%T) (%t . ?) (%s . #(Online-Pornografie: China nimmt Tausende Verdächtige fest 45 57 ...)) (%m . c5870b37264417e9a721fc15fd537745.spiegelschlagzei...@rss-hash))) (let* ((p org-store-link-plist) (to ...) (from ...) (table ...)) (when (string-match %c fmt) (if ... ... ...)) (org-replace- escapes fmt table)) org-email-link-description() org-wl-store-link() run-hook-with-args-until-success(org-wl-store-link) (cond ((run-hook-with-args-until-success ...) (setq link ... desc ...)) ((equal ... *Org Edit Src Example*) (let ... ... ... ... ... ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...) (let ... ... ...)) ((eq major- mode ...) (setq cpltxt ... link ...) (org-store-link-props :type w3 :url ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type w3m :url ...)) ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type image :file buffer-file-name)) ((eq major-mode ...) (setq cpltxt ... link ...)) ((and buffer-file-name ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name ...) (setq cpltxt ...) (when ... ... ...) (setq link ...)) ((interactive-p) (error Cannot link to a buffer which is not visiting a file)) (t (setq link nil))) (let ((outline-regexp ...) link cpltxt desc description search txt custom-id) (cond (... ...) (... ...) (... ...) (... ...) (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (... ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc cpltxt)) (if (equal desc NONE) (setq desc nil)) (if (and ... link) (progn ... ... ...) (and link ...))) org-store-link(nil) call-interactively(org-store-link nil nil) - Carsten - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Bug: Store link to Wanderlust message fails when subject contains encoded characters [6.33trans (release_6.33f.173.g8f17)]
Hi Carsten, At Sun, 3 Jan 2010 19:47:18 +0100, Carsten Dominik wrote: Can I ask you to submit this as a bug report to Emacs? I'll certainly do that. I also attached a patch for org-wl.el that removes all text properties of the subject string. Regards -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. maus.da...@gmail.com ICQ... 241051416 0001-Remove-text-properties-of-subject-string-to-avoid-po.patch Description: Binary data pgpeTWmy8E7f1.pgp Description: PGP signature ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Bug: Store link to Wanderlust message fails when subject contains encoded characters [6.33trans (release_6.33f.173.g8f17)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. Storing a link to a Wanderlust message fails if the message's subject field contains an encoded character. For instance a message with the subject header field: , | Subject: Eine Meldung und ihre Geschichte: =?UTF-8?B?RsO8cg==?= zwei | Gutscheine an den Pranger ` Is returned by `wl-summary-line-subject' as a string with a text property that indicates that the last part of the string was (as far as I understood the elisp manual) converted to latin-iso8859-1 , | #(Eine Meldung und ihre Geschichte: Für zwei Gutscheine an den Pranger 35 68 (charset latin-iso8859-1)) ` Feeding this string to `org-email-link-description' causes `org-replace-escapes' to throw an error when setting the replace string rpl using format and concat *Messages* , | setq: Args out of range: 30, 35 ` A solution that obviously works is removing the text properties from the subject string before `org-email-link-description' is called. As the text property only tells us that the last part of the string was converted /to/ latin-iso-8859-1 this should cause no problems, should it? Regards, -- David Emacs : GNU Emacs 23.1.90.1 (i486-pc-linux-gnu, GTK+ Version 2.18.5) of 2009-12-17 on elegiac, modified by Debian Package: Org-mode version 6.33trans (release_6.33f.173.g8f17) -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. maus.da...@gmail.com ICQ... 241051416 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode