I set break-point in function
(add-hook 'c-mode-common-hook
(function
(lambda nil
(if (or (string-match "llvm" buffer-file-name)
(string-match "nvvm" buffer-file-name))
(progn
(c-set-style "llvm.org"))))))
I am unable to remove the break-point. This code fragment is in *scratch*
buffer.
It is not a good idea to add a lambda to a hook if you want to debug this lambda. edebug
adds its own stuff so that you cannot easily remove or redefine the function. If you try you end up with two functions in the hook.
Rather define a function such as my-c-mode-common-hook-function
and instrument that one.
(defun my-c-mode-common-hook-function ()
"some useful documentation"
(if (or (string-match "llvm" buffer-file-name)
(string-match "nvvm" buffer-file-name))
(progn
(c-set-style "llvm.org"))))
(add-hook 'c-mode-common-hook #'my-c-mode-common-hook-function)
You can then easily instrument my-c-mode-common-hook-function
for debugging.
-
So essentially don't instrument a lambda hook with
edebug-defun
? Thanks. – vmiheer Jan 22 '16 at 13:13
edebug
-instrumentation. When debugging pressu
to delete a breakpoint previously set withb
. – Tobias Jan 20 '16 at 8:18u
gives message:No breakpoint here
. Reevaluate the form to remove the edebug-instrumentation I am pressing C-x C-e to reevaluate. That didn't help either. – vmiheer Jan 22 '16 at 11:34edebug-defun
but you instrument a function or a form for debugging in this way. Setting breakpoints works with pressingb
when you are in anedebug
session. And breakpoints set withb
can be deleted withu
. – Tobias Jan 22 '16 at 11:52