mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-11 20:03:28 +00:00
Fix to work with Emacs 20.4.1 on Linux.
Estimated hours taken: 2
scripts/gud.el:
Fix to work with Emacs 20.4.1 on Linux.
There were several problems:
(1) The gud-redirect-io stuff was broken, since it relies on ttys,
and apparently Emacs now just uses pipes rather than ttys.
For now I've just disabled that by setting gud-redirect-io
to false (nil).
(2) There were some bugs in the code for the case where gud-redirect-io
was false (nil):
- I'd accidentally omitted the `progn' around the body of an
if-then-else, and thus accidentally written `if (...) A else B'
when I had intended to write `if (...) { A; B; }'.
- One part of the code was assuming that the gud-prog-buffer
variable was set, but this was only true for the case where
gud-redirect-io was true (t).
This commit is contained in:
@@ -1374,17 +1374,22 @@ and source-file directory for your debugger."
|
||||
(setq gud-menu-name "MDB")
|
||||
(setq gud-buffer-name-prefix "mdb")
|
||||
(setq gud-show-commands t)
|
||||
(setq gud-redirect-io t)
|
||||
;; Setting gud-redirect-io is broken in recent versions of
|
||||
;; GNU Emacs (e.g. 20.4.1), since Emacs apparently now uses
|
||||
;; pipes rather than ttys. So we don't enable this by
|
||||
;; default anymore.
|
||||
;; (setq gud-redirect-io t)
|
||||
|
||||
(gud-common-init command-line 'gud-mdb-massage-args
|
||||
'gud-mdb-marker-filter 'gud-mdb-find-file)
|
||||
|
||||
(gud-mdb-define-menu-entries)
|
||||
(gud-mdb-add-menu-entries)
|
||||
(save-excursion
|
||||
(set-buffer gud-prog-buffer)
|
||||
(display-buffer gud-prog-buffer)
|
||||
(gud-mdb-add-menu-entries))
|
||||
(if gud-prog-buffer
|
||||
(save-excursion
|
||||
(set-buffer gud-prog-buffer)
|
||||
(display-buffer gud-prog-buffer)
|
||||
(gud-mdb-add-menu-entries)))
|
||||
|
||||
(setq comint-prompt-regexp "^mdb> ")
|
||||
(setq paragraph-start comint-prompt-regexp)
|
||||
@@ -1593,8 +1598,9 @@ comint mode, which see."
|
||||
(apply 'make-comint prog-buf-name program nil
|
||||
(funcall massage-args file args))
|
||||
(if gud-redirect-io
|
||||
(setq gud-prog-buffer (concat "*" prog-buf-name "*"))
|
||||
(set-buffer debugger-buf)))
|
||||
(progn
|
||||
(setq gud-prog-buffer (concat "*" prog-buf-name "*"))
|
||||
(set-buffer debugger-buf))))
|
||||
|
||||
;; Since comint clobbered the mode, we don't set it until now.
|
||||
(gud-mode)
|
||||
|
||||
Reference in New Issue
Block a user