Guest User

Untitled

a guest
Oct 10th, 2018
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defun buffer-out ()
  2.   (interactive)
  3.   (let ((buffer (current-buffer))
  4.     (value (buffer-string)))
  5.     (kill-buffer buffer)
  6.     (setq s value)))
  7.  
  8. (defun edit-string (string)
  9.   (let ((buffer "*edit-string*"))
  10.     (get-buffer-create buffer)
  11.     (switch-to-buffer buffer)
  12.     (set-buffer buffer)
  13.     (let ((inhibit-read-only nil))
  14.       (insert string)
  15.       (fundamental-mode)
  16.       (local-set-key (kbd "C-c C-c") 'buffer-out))))
  17.  
  18. (setq ok (edit-string s))
RAW Paste Data