From 15b17cec79d8141bcd43741efdd3e203b3a3cde4 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 27 Oct 2022 10:05:11 -0700 Subject: spw/gdbmacs-attach: simplify beginning of function slightly --- .emacs.d/init.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 49b29902..dbe06590 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -2287,14 +2287,13 @@ Called by '~/src/dotfiles/bin/emacsclient --spw/update-environment'." (defvar-local spw/gdbmacs-target-name nil) (defun spw/gdbmacs-attach (&optional name) + (require 'gdb-mi) (let (pid (arg (if name (concat "--fg-daemon=" name) "--fg-daemon")) - (proc (and (boundp 'gud-comint-buffer) - (get-buffer-process gud-comint-buffer)))) + (proc (get-buffer-process gud-comint-buffer))) (when (and proc (string= gdb-inferior-status "signal-received")) ;; Avoid wiping out useful info. (error "Possibly Emacs just crashed; not attaching for now")) - (require 'gdb-mi) (cl-flet ((run-or-continue () (gdb-wait-for-pending (lambda () -- cgit v1.2.3