Function: def-gdb-thread-buffer-command

def-gdb-thread-buffer-command is a macro defined in gdb-mi.el.gz.

Signature

(def-gdb-thread-buffer-command NAME CUSTOM-DEFUN &optional DOC)

Documentation

Define a NAME command which will act upon thread on the current line.

CUSTOM-DEFUN may use locally bound thread variable, which will be the value of gdb-thread property of the current line. If gdb-thread is nil, error is signaled.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gdb-mi.el.gz
(defmacro def-gdb-thread-buffer-command (name custom-defun &optional doc)
  "Define a NAME command which will act upon thread on the current line.

CUSTOM-DEFUN may use locally bound `thread' variable, which will
be the value of `gdb-thread' property of the current line.
If `gdb-thread' is nil, error is signaled."
  `(defun ,name (&optional event)
     ,(when doc doc)
     (interactive (list last-input-event))
     (if event (posn-set-point (event-end event)))
     (save-excursion
       (beginning-of-line)
       (let ((thread (get-text-property (point) 'gdb-thread)))
         (if thread
             ,custom-defun
           (error "Not recognized as thread line"))))))