瀏覽代碼

Fix bug in radio list export

Daniel Hackney writes:

> When attempting to use radio lists for exporting in LaTeX, I
> found that they didn't work. I am using the example file shown
> below:
>
> ---BEGIN_EXAMPLE---
>
> #+LaTeX: % BEGIN RECEIVE ORGLST programs
> #+LaTeX: % END RECEIVE ORGLST programs
>
> #+ORGLST: SEND programs org-list-to-latex
>   - Emacs text editor
>   - Ubuntu Linux
>   - Git version control system
>   - Firefox web browser
>   - Drupal content management system
>   - Subversion version control system
>   - Eclipse integrated development environment
>
> ---END_EXAMPLE---
>
> I eventually ran `org-list-send-list' manually on the list, and
> got the following error:
>
>  funcall: Wrong type argument: number-or-marker-p, (unordered
> #("Emacs text editor" [snip...]
>
> I started debugging `org-list-send-list' and found that the error
> occurred when calling (funcall transform list). Looking back, I
> saw that `transform' was assigned (in the let*) after
> `item-beginning'. Stepping through the execution, I saw that
> `transform' was being assigned a value of `-'. It turns out when
> assigning to `item-beginning', (org-list-item-beginning) is
> called, which runs a regular expression with a capture group,
> overwriting the previously matched capture group.
>
> Luckily, the fix is simple; all that needs be done is to switch
> the assignment to `transform' with `item-beginning' so the regex
> in (org-list-item-beginning) doesn't override the match-string
> data. I tried this fix out and it worked perfectly.
Carsten Dominik 15 年之前
父節點
當前提交
655c5eaeee
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-list.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-10-29  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-list.el (org-list-send-list): Fix bug related to match
+	data.
+
 	* org-latex.el (org-export-latex-fontify): Apply verbatim
 	emphasis.
 	(org-export-latex-make-header): Insert \obeylines if line breaks

+ 1 - 1
lisp/org-list.el

@@ -1186,8 +1186,8 @@ this list."
 	    (throw 'exit nil)
 	  (error "Don't know how to transform this list"))))
     (let* ((name (match-string 1))
-	   (item-beginning (org-list-item-beginning))
 	   (transform (intern (match-string 2)))
+	   (item-beginning (org-list-item-beginning))
 	   (txt (buffer-substring-no-properties
 		 (car item-beginning)
 		 (org-list-end (cdr item-beginning))))