title: How can you modify two matching delimiters at once with Emacs?
body: <p>While this question concerns the formatting of LaTeX within Emacs (and maybe Auctex), I believe this can be applied to more general situations in Emacs concerning delimiters like parentheses, brackets, and braces. </p>
  
  <p>I am looking to be able to do the following with Emacs (and elisp), and don't know where to begin. Say I have:</p>
  
  <pre><code>(This is in parentheses)
  </code></pre>
  
  <p>With some keybinding in Emacs, I want Emacs to find the matching delimiter to whichever one is by my cursor (something I know Emacs can do since it can highlight matching delimiters in various modes) and be able to change both of them to</p>
  
  <pre><code>\left( This is in parentheses \right)
  </code></pre>
  
  <p>The delimiters I would like this to work with are: <code>(...)</code>, <code>[...]</code>, <code>\lvert ... \rvert</code>, <code>\langle ... \rangle</code>, <code>\{ ... \}</code>. What elisp would I need to accomplish this task?</p>
  
  <p>More general ways to handle matching delimiters are welcome.</p>