|
34 | 34 |
|
35 | 35 | (eval-and-compile
|
36 | 36 | (unless (bound-and-true-p module-file-suffix)
|
37 |
| - (error "Dynamic modules are NOT supported in your build of Emacs")) |
| 37 | + (error "Dynamic modules are NOT supported in your build of Emacs"))) |
38 | 38 |
|
39 |
| - (let* ((default-directory (file-name-directory (or byte-compile-current-file load-file-name default-directory))) |
40 |
| - (required-module (concat "gdb-module" module-file-suffix)) |
41 |
| - (path-to-module (concat default-directory required-module))) |
| 39 | +(let* ((default-directory (file-name-directory (or load-file-name default-directory))) |
| 40 | + (required-module (concat "gdb-module" module-file-suffix)) |
| 41 | + (path-to-module (concat default-directory required-module))) |
42 | 42 |
|
43 |
| - (if (file-exists-p required-module) |
44 |
| - (require 'gdb-module path-to-module) |
| 43 | + (if (file-exists-p required-module) |
| 44 | + (require 'gdb-module path-to-module) |
45 | 45 |
|
46 |
| - (message "Compiling GDB dynamic module...") |
47 |
| - (with-current-buffer (compile (concat "make -k " required-module)) |
48 |
| - (add-hook 'compilation-finish-functions (lambda (_buffer _status) (require 'gdb-module path-to-module)) |
49 |
| - nil t))))) |
| 46 | + (message "Compiling GDB dynamic module...") |
| 47 | + (with-current-buffer (compile (concat "make -k " required-module)) |
| 48 | + (add-hook 'compilation-finish-functions |
| 49 | + (lambda (_buffer _status) (require 'gdb-module path-to-module)) nil t)))) |
50 | 50 |
|
51 | 51 | (declare-function gdb--handle-mi-output "ext:gdb-module")
|
52 | 52 |
|
@@ -1215,16 +1215,19 @@ stopped thread before running the command. If FORCE-STOPPED is
|
1215 | 1215 | (gdb--command "-exec-continue" nil stopped-thread)))))
|
1216 | 1216 |
|
1217 | 1217 | (defun gdb--comint-completion-at-point ()
|
1218 |
| - (let* ((real-beg (comint-line-beginning-position)) (end (point-max)) |
1219 |
| - (str (buffer-substring-no-properties real-beg end))) |
1220 |
| - (unless (= real-beg end) |
1221 |
| - (setq beg (string-match " [^ ]+" str) |
1222 |
| - beg (or (and beg (+ real-beg 1 beg)) real-beg)) |
1223 |
| - (list beg end |
1224 |
| - (completion-table-dynamic (lambda (_) |
1225 |
| - (let ((raw-list (gdb--get-console-data (concat "complete " str)))) |
1226 |
| - (cl-loop for item in raw-list |
1227 |
| - collect (substring item (- beg real-beg)))))))))) |
| 1218 | + (let* ((beg (comint-line-beginning-position)) (end (point-max)) |
| 1219 | + (str (buffer-substring-no-properties beg end)) |
| 1220 | + (relevant-index (string-match "\\( [^ .*]+\\|\\(\\.\\|\\*\\)[^ .]*\\)$" str))) |
| 1221 | + (unless (= beg end) |
| 1222 | + (when relevant-index |
| 1223 | + (setq relevant-index (1+ relevant-index) |
| 1224 | + beg (+ beg relevant-index))) |
| 1225 | + |
| 1226 | + (list beg end (completion-table-dynamic |
| 1227 | + (lambda (_) |
| 1228 | + (let ((raw-list (gdb--get-console-data (concat "complete " str)))) |
| 1229 | + (cl-loop for item in raw-list |
| 1230 | + collect (substring item relevant-index))))))))) |
1228 | 1231 |
|
1229 | 1232 |
|
1230 | 1233 | ;; ------------------------------------------------------------------------------------------
|
|
0 commit comments