Fuco  committed 6a8563d

Added save-kill-ring macro

  • Participants
  • Parent commits 2fd9177
  • Branches default

Comments (0)

Files changed (1)

File files/defuns.el

         (when (file-exists-p (concat personal ".el"))
           (load personal))))))
+(defmacro save-kill-ring (&rest body)
+  "Save the kill ring and execute the BODY.  After BODY is
+executed, the kill-ring value is restored to the state before
+BODY was executed"
+  (declare (indent 0))
+  ;; initialize new binding for the ,@body.  It starts with the global
+  ;; original value.  After ,@body is executed, the new binding is
+  ;; thrown away!
+  `(let ((kill-ring kill-ring))
+     ,@body))
+(font-lock-add-keywords 'emacs-lisp-mode '(("\\<save-kill-ring\\>" . font-lock-keyword-face)) 'append)
 ;; Quickly jump back and forth between matching parens/brackets
 (defun match-paren (arg)
   "Go to the matching parenthesis if on parenthesis."
   (query-replace-regexp "\\\\emph{ }" "")
+  (replace-string "'' ``" "''\n\n``")
+  (beginning-of-buffer)
   (replace-regexp "