Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to edit and return string in Emacs Lisp? #21

Open
gnusupport opened this issue Oct 10, 2018 · 0 comments
Open

How to edit and return string in Emacs Lisp? #21

gnusupport opened this issue Oct 10, 2018 · 0 comments

Comments

@gnusupport
Copy link


(defun buffer-out ()
  (interactive)
  (let ((buffer (current-buffer))
	(value (buffer-string)))
    (kill-buffer buffer)))

(defun buffer-string-out ()
  (interactive)
  (buffer-string))

(defun edit-string (string)
  (interactive)
  (let ((buffer "*edit-string*"))
    (get-buffer-create buffer)
    (switch-to-buffer buffer)
    (set-buffer buffer)
    (let ((inhibit-read-only nil))
      (insert string)
      (fundamental-mode)
      (local-set-key (kbd "C-c C-c") 'buffer-out))))

;;      (add-hook 'kill-buffer-hook 'buffer-string-out))))

(setq ok (edit-string "OK"))

I am trying to get this work, could you point me to a solution to edit string, and return the string back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant