Skip to content

Better track call-interactively time #18

@lastquestion

Description

@lastquestion

In #14, I discovered the read* family of functions, which read and wait on input. One of the C functions that call those is call-interactively, which is currently not advised.

So, in reality, most cases require actual parameters, which means the minibuffer is activated or the echo area is, which means the command loop runs. So, everything works OK in normal use cases.

However, consider this case:

(defun a-blocking-guy ()
  (interactive)
  (sleep-for 5))

(call-interactively 'a-blocking-guy)

This causes explain-pause-mode to think that call-interactively (or rather, it's parent, in scratch that would be eval-print-last-sexp) to take 5 seconds, but it's really actually a-blocking-guy. call-interactively is implemented in C code, and depending on the interactive spec may or may not call out to minibuffer, read functions, etc.

It's not called from C code, so it can be straightforwardly advised. I'm leaning towards advising it, and wrapping the function to be called in a wrapper timer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas-reproHas a repro case

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions