{"id":3746,"date":"2015-03-03T07:54:00","date_gmt":"2015-03-03T12:54:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=3746"},"modified":"2015-03-03T07:54:17","modified_gmt":"2015-03-03T12:54:17","slug":"the-prin-family","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=3746","title":{"rendered":"The <code >prin*<\/code> Family"},"content":{"rendered":"<p> This is really a note to myself but I&#8217;ll bet many of you are in the same boat. When I want to print something in Elisp, I usually use <code>format<\/code> but sometimes one of the <code>prin*<\/code> functions is really what I need. The problem is that I can never remember exactly what they do. What, for example, is the difference between <code>princ<\/code>, <code>print<\/code>, and <code>prin1<\/code>? <\/p>\n<p> This post is meant to be a cheat sheet for the family. Although it&#8217;s not really part of the <code>prin*<\/code> family, I&#8217;ve included <code>pp<\/code> as well because I always forget about it. <\/p>\n<ul class=\"org-ul\">\n<li><code>prin1<\/code><br  \/>   Output a printed representation of the argument with quoting. Output will be <code>read<\/code>able if possible.\n<\/li>\n<li><code>prin1-char<\/code><br  \/>   Return a string representation of the argument, which must be a character.\n<\/li>\n<li><code>prin1-to-string<\/code><br  \/>   Return a string representation of the argument with quoting. Like <code>prin1<\/code> but returns the string rather than outputting it. Output will be <code>read<\/code>able if possible.\n<\/li>\n<li><code>princ<\/code><br  \/>   Output the printed representation of the argument without quoting.\n<\/li>\n<li><code>princ-list<\/code><br  \/>   Print all arguments with <code>princ<\/code> followed by a newline. <b>OBSOLETE<\/b>: Use <code>mapc<\/code> and <code>princ<\/code> instead.\n<\/li>\n<li><code>print<\/code><br  \/>   Output the printed representaton of the argument with newlines around it. Output will be quoted and <code>read<\/code>able if possible.\n<\/li>\n<li><code>print-buffer<\/code><br  \/>   Paginate and print buffer contents.\n<\/li>\n<li><code>print-diary-entries<\/code><br  \/>   Print a hard copy of the diary display.\n<\/li>\n<li><code>print-help-return-message<\/code><br  \/>   <b>OBSOLETE<\/b>: use <code>help-print-return-message<\/code> instead.\n<\/li>\n<li><code>print-region<\/code><br  \/>   Paginate and print the region contents.\n<\/li>\n<li><code>pp<\/code><br  \/>   Output a pretty-printed representation of the argument with quoting. Output will be <code>read<\/code>able if possible.\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This is really a note to myself but I&#8217;ll bet many of you are in the same boat. When I want to print something in Elisp, I usually use format but sometimes one of the prin* functions is really what &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=3746\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[18],"class_list":["post-3746","post","type-post","status-publish","format-standard","hentry","category-programming","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3746"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3746\/revisions"}],"predecessor-version":[{"id":3747,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3746\/revisions\/3747"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}