3

Sometimes a function will make the display blink and stutter, due do things happening in the background while the function is running (visiting other buffers etc). Does anyone know if there's a function, or another way, to tell Emacs not to redisplay during the course of an sexp? I'm searching for something like this:

(defun my-automatic-todo ()
  (interactive)
  (no-redisplay
   (let ((org-capture-entry
          `("z" "Automatic todo" entry (file ,my-todo-file)
            ,(format "* TODO %s" (my-get-todo-text-function))
            :immediate-finish t)))
     (org-capture))))

In the example above, no-redisplay would run the body without updating the display (and probably update the display when exiting the body). The no-redisplay function doesn't exist though.

1 Answer 1

4

You can let-bind the variable inhibit-redisplay for this purpose, so:

(defun my-automatic-todo ()
  (interactive)
  (let ((inhibit-redisplay t))
    (let ((org-capture-entry
           `("z" "Automatic todo" entry (file ,my-todo-file)
             ,(format "* TODO %s" (my-get-todo-text-function))
             :immediate-finish t)))
      (org-capture))))
1
  • Thank you for this. Unfortunately it did not solve my problem, but I think that may be because of my use of EXWM and how it handles the display in X buffers. Commented Oct 2, 2017 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.