I have a function to underline Chinese characters with zero width spaces in org-mode.

(defun ctext-uline-begin ()
  "Underscore with invisible space before for underlining Chinese texts."
  (insert "​_"))

(defun ctext-uline-end ()
    "Underscore with invisible space after for underlining Chinese texts."
  (insert "_​"))

(defun ctext-underline()
  (if (region-active-p)
          (goto-char (region-end))
          (goto-char (region-beginning))
    (read-event "Press Enter to Complete.")

The function wraps "_" with zero width spaces around the Chinese characters when region is active.

When no region is selected, I'd like it to insert uline-begin, wait for user to hit RET, then insert uline-end.

The above function almost did it.

How do we get the user to 'Press Enter to Continue' in Elisp?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.