comparison lisp/gud.el @ 30643:4a6ff467897e

(gud-gdb-complete-command): Use comint-line-beginning-position.
author Miles Bader <miles@gnu.org>
date Mon, 07 Aug 2000 14:54:35 +0000
parents c547172f003f
children 48d749ce74e4
comparison
equal deleted inserted replaced
30642:ae938744b6b1 30643:4a6ff467897e
409 "Perform completion on the GDB command preceding point. 409 "Perform completion on the GDB command preceding point.
410 This is implemented using the GDB `complete' command which isn't 410 This is implemented using the GDB `complete' command which isn't
411 available with older versions of GDB." 411 available with older versions of GDB."
412 (interactive) 412 (interactive)
413 (let* ((end (point)) 413 (let* ((end (point))
414 (command (save-excursion 414 (command (buffer-substring (comint-line-beginning-position) end))
415 (beginning-of-line)
416 (and (looking-at comint-prompt-regexp)
417 (goto-char (match-end 0)))
418 (buffer-substring (point) end)))
419 command-word) 415 command-word)
420 ;; Find the word break. This match will always succeed. 416 ;; Find the word break. This match will always succeed.
421 (string-match "\\(\\`\\| \\)\\([^ ]*\\)\\'" command) 417 (string-match "\\(\\`\\| \\)\\([^ ]*\\)\\'" command)
422 (setq gud-gdb-complete-break (match-beginning 2) 418 (setq gud-gdb-complete-break (match-beginning 2)
423 command-word (substring command gud-gdb-complete-break)) 419 command-word (substring command gud-gdb-complete-break))