Wrong type argument error in pst-node style of AUCTeX

Using AUCTeX 11.86 under Emacs 24.0.50.1. Activated pst-node style. Pressed C-c C-e to insert a psmatrix environment, entered nothing on “Options” and encountered the error:
let: Wrong type argument: char-or-string-p, (“”)

The “Options” can auto-complete with psmatrix options such as rowsep, colsep… Still didn’t work even if I entered something. Checked the pst-node.el under /emacs/site-lisp/auctex/style/:

;;; Environments
(defun LaTeX-pstnode-env-psmatrix (env)
  "Return psmatrix environment with arguments."
  (let ((opt (completing-read-multiple "Options: "
                                       LaTeX-pstnode-psmatrix-list)))
    (LaTeX-insert-environment env opt)))

completing-read-multiple comes from crm.el, which enables the multiple auto completion. The return value is a list instead of a string, so LaTeX-insert-environment won’t accept it. Fixed the code as follows to loop over the list and insert the option items with comma and square brackets. It doesn’t look neat but it works anyway.

;;; Environments
;;; Changed by James Lao
(defun LaTeX-pstnode-env-psmatrix (env)
  "Return psmatrix environment with arguments."
  (let ((opt (completing-read-multiple "Options: "
                                       LaTeX-pstnode-psmatrix-list)))
    (setq opto "")
    (while opt
      (if (string= opto "")
	  (setq opto (car opt))
      (setq opto (concat opto ", " (car opt))))
      (setq opt (cdr opt)))
    (LaTeX-insert-environment env (concat "[" opto "]"))))

I’ve never used the mailing list and would appreciate if someone could help me check with the development team…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.