From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Bug: Store link to Wanderlust message fails when subject contains encoded characters [6.33trans (release_6.33f.173.g8f17)] Date: Sun, 3 Jan 2010 19:47:18 +0100 Message-ID: References: <87d41t1r7g.wl%maus.david@gmail.com> <08FF3DED-488D-46F5-871E-BE3E273103D1@gmail.com> <87skan9hz0.wl%maus.david@gmail.com> <8982A02B-40A8-47E4-8074-F273833895F9@gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRVUD-000422-TF for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 13:47:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRVU8-0003vr-Ec for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 13:47:33 -0500 Received: from [199.232.76.173] (port=37520 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRVU8-0003vf-7J for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 13:47:28 -0500 Received: from pony.ic.uva.nl ([145.18.40.181]:35799) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRVU7-0001cj-Pe for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 13:47:28 -0500 In-Reply-To: <8982A02B-40A8-47E4-8074-F273833895F9@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org 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 =20 > something > bad with properties because a format like "%.30s" is used to shorten =20= > 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 "1234567890aaaa" (propertize "12345678901234567890" 'xxx 25))) The problem only shows if the start of the propertized section is =20 already outsinde the width of the "%.10s" format field. The following works =20 fine (only change: make the unpropertized part in the concat shorter than =20 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 =20 > 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 >> >> --=20 >> OpenPGP... 0x99ADB83B5A4478E6 >> Jabber.... dmjena@jabber.org >> Email..... maus.david@gmail.com >> ICQ....... 241051416 >> >> Debugger entered--Lisp error: (args-out-of-range 30 45) >> format("%.30s" #("Online-Pornografie: China nimmt Tausende =20 >> Verd=E4chtige fest" 45 57 (charset latin-iso8859-1))) >> (setq rpl (format (concat ... "s") (cdr e))) >> (while (string-match re string) (setq rpl (format ... ...)) (setq =20 >> string (replace-match rpl t t string))) >> (while (setq e (pop table)) (setq re (concat "%-?[0-9.]*" ...)) =20 >> (while (string-match re string) (setq rpl ...) (setq string ...))) >> (let ((case-fold-search nil) e re rpl) (while (setq e ...) (setq =20 >> re ...) (while ... ... ...)) string) >> org-replace-escapes("Email from %f: %.30s" (("%c") ("%F" . "rss-=20 >> hash (SpiegelSchlagzeilen)") ("%f" . "SpiegelSchlagzeilen") ("%T") =20= >> ("%t" . "?") ("%s" . #("Online-Pornografie: China nimmt Tausende =20 >> Verd=E4chtige fest" 45 57 ...)) ("%m" . =20 >> ""))) >> (let* ((p org-store-link-plist) (to ...) (from ...) (table ...)) =20 >> (when (string-match "%c" fmt) (if ... ... ...)) (org-replace-=20 >> 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 ... =20 >> desc ...)) ((equal ... "*Org Edit Src Example*") =20 >> (let ... ... ... ... ... ... ... ...)) ((equal ... ...) =20 >> (let ... ...)) ((eq major-mode ...) (let ... ... ...)) ((eq major-=20 >> mode ...) (setq cpltxt ... link ...) (org-store-link-props :type =20 >> "w3" :url ...)) ((eq major-mode ...) (setq cpltxt ... link ...) =20 >> (org-store-link-props :type "w3m" :url ...)) ((setq search ...) =20 >> (setq link ...) (setq cpltxt ...)) ((eq major-mode ...) (setq =20 >> cpltxt ... link ...) (org-store-link-props :type "image" :file =20 >> buffer-file-name)) ((eq major-mode ...) (setq cpltxt ... link ...)) =20= >> ((and buffer-file-name ...) (setq custom-id ...) =20 >> (cond ... ... ...)) ((buffer-file-name ...) (setq cpltxt ...) =20 >> (when ... ... ...) (setq link ...)) ((interactive-p) (error "Cannot =20= >> link to a buffer which is not visiting a file")) (t (setq link nil))) >> (let ((outline-regexp ...) link cpltxt desc description search txt =20= >> custom-id) (cond (... ...) (... ...) (... ...) (... ...) =20 >> (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) =20 >> (... ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) =20= >> (setq cpltxt ... link ...)) (setq link (or link cpltxt) desc (or =20 >> desc cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... =20= >> link) (progn ... ... ...) (and link ...))) >> org-store-link(nil) >> call-interactively(org-store-link nil nil) > > - Carsten > > > - Carsten