{"id":570,"date":"2011-05-22T00:41:40","date_gmt":"2011-05-22T04:41:40","guid":{"rendered":"http:\/\/www.jlao.net\/?p=570"},"modified":"2019-07-22T17:03:41","modified_gmt":"2019-07-23T00:03:41","slug":"wrong-type-argument-error-in-pst-node-style-of-auctex","status":"publish","type":"post","link":"https:\/\/www.jlao.net\/en\/technology\/570\/","title":{"rendered":"Wrong type argument error in pst-node style of AUCTeX"},"content":{"rendered":"<p>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 &#8220;Options&#8221; and encountered the error:<br \/>\n<em>let: Wrong type argument: char-or-string-p, (&#8220;&#8221;)<\/em><\/p>\n<p>The &#8220;Options&#8221; can auto-complete with psmatrix options such as <code class=\"EnlighterJSRAW\">rowsep<\/code>, <code class=\"EnlighterJSRAW\">colsep<\/code>&#8230; Still didn&#8217;t work even if I entered something. Checked the pst-node.el under \/emacs\/site-lisp\/auctex\/style\/:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"lisp\">;;; Environments\n(defun LaTeX-pstnode-env-psmatrix (env)\n  \"Return psmatrix environment with arguments.\"\n  (let ((opt (completing-read-multiple \"Options: \"\n                                       LaTeX-pstnode-psmatrix-list)))\n    (LaTeX-insert-environment env opt)))<\/pre>\n<p><code class=\"EnlighterJSRAW\">completing-read-multiple<\/code> comes from crm.el, which enables the multiple auto completion. The return value is a list instead of a string, so <code class=\"EnlighterJSRAW\">LaTeX-insert-environment<\/code> won&#8217;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&#8217;t look neat but it works anyway.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"lisp\">;;; Environments\n;;; Changed by James Lao\n(defun LaTeX-pstnode-env-psmatrix (env)\n  \"Return psmatrix environment with arguments.\"\n  (let ((opt (completing-read-multiple \"Options: \"\n                                       LaTeX-pstnode-psmatrix-list)))\n    (setq opto \"\")\n    (while opt\n      (if (string= opto \"\")\n\t  (setq opto (car opt))\n      (setq opto (concat opto \", \" (car opt))))\n      (setq opt (cdr opt)))\n    (LaTeX-insert-environment env (concat \"[\" opto \"]\"))))<\/pre>\n<p>I&#8217;ve never used the mailing list and would appreciate if someone could help me check with the development team&#8230;<\/p>","protected":false},"excerpt":{"rendered":"<p>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 &#8220;Options&#8221; and encountered the error: let: Wrong type argument: char-or-string-p, (&#8220;&#8221;) The &#8220;Options&#8221; can auto-complete with psmatrix options such as rowsep, colsep&#8230; Still didn&#8217;t work even if I entered something. Checked the pst-node.el under \/emacs\/site-lisp\/auctex\/style\/: &hellip; <a href=\"https:\/\/www.jlao.net\/en\/technology\/570\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Wrong type argument error in pst-node style of AUCTeX<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[11,12,13,14,15],"class_list":["post-570","post","type-post","status-publish","format-standard","hentry","category-technology","tag-emacs","tag-auctex","tag-pstricks","tag-pst-node","tag-psmatrix"],"_links":{"self":[{"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/posts\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/comments?post=570"}],"version-history":[{"count":0,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/posts\/570\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/media?parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/categories?post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/tags?post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}