1

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.

2

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))))
  • 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. – Erik Sjöstrand Oct 2 '17 at 11:32

Your Answer

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

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