{"id":2945,"date":"2014-09-01T07:46:37","date_gmt":"2014-09-01T11:46:37","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=2945"},"modified":"2014-09-01T07:46:38","modified_gmt":"2014-09-01T11:46:38","slug":"temporary-syntax-tables","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=2945","title":{"rendered":"Temporary Syntax Tables"},"content":{"rendered":"<p> Xah Lee has a nice post on <a href=\"http:\/\/ergoemacs.org\/emacs\/elisp_modify_syntax_table_temporarily.html\">how to temporarily modify a syntax table<\/a>. It&#8217;s not something you want to do everyday, of course, but the example Lee gives is a real-world case. <\/p>\n<p> It turns out that it&#8217;s pretty easy. Just use the <a href=\"http:\/\/www.gnu.org\/software\/emacs\/manual\/html_node\/elisp\/Syntax-Table-Functions.html#index-with_002dsyntax_002dtable-3409\">with-syntax-table<\/a> macro and you can change the syntax table in a way useful for the rest of the code in the macro&#8217;s body. When control exits the macro expansion, the old syntax table is restored. You can also use the macro to temporarily switch to a different syntax table. If the foregoing seems opaque, the example in Lee&#8217;s post will clear things up. <\/p>\n<p> I didn&#8217;t know about the <code>with-syntax-table<\/code> macro so this post is my way of writing it down so I won&#8217;t forget. I&#8217;m sure I won&#8217;t need it often but when I do, it&#8217;s just the thing. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Xah Lee has a nice post on how to temporarily modify a syntax table. It&#8217;s not something you want to do everyday, of course, but the example Lee gives is a real-world case. It turns out that it&#8217;s pretty easy. &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=2945\">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":[5],"tags":[18],"class_list":["post-2945","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2945","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=2945"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2945\/revisions"}],"predecessor-version":[{"id":2946,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2945\/revisions\/2946"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}