summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-langs.el3
-rw-r--r--lisp/progmodes/gdb-ui.el53
-rw-r--r--lisp/progmodes/perl-mode.el5
3 files changed, 35 insertions, 26 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index b02df16b4f5..8120094f606 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -267,7 +267,8 @@ the evaluated constant value at compile time."
["Hungry delete" c-toggle-hungry-state
:style toggle :selected c-hungry-delete-key]
["Subword mode" c-subword-mode
- :style toggle :selected c-subword-mode])))
+ :style toggle :selected (and (boundp 'c-subword-mode)
+ c-subword-mode)])))
;;; Syntax tables.
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 9f527d12f9f..d6854d091fe 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -417,7 +417,8 @@ With arg, use separate IO iff arg is positive."
(goto-char (point-min))
(when (search-forward "read in on demand:" nil t)
(while (re-search-forward gdb-source-file-regexp nil t)
- (push (or (match-string 1) (match-string 2)) gdb-source-file-list))
+ (push (file-name-nondirectory (or (match-string 1) (match-string 2)))
+ gdb-source-file-list))
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when (and buffer-file-name
@@ -524,6 +525,7 @@ With arg, use separate IO iff arg is positive."
gdb-frame-number nil
gdb-var-list nil
gdb-force-update t
+ gdb-main-file nil
gdb-first-post-prompt t
gdb-prompting nil
gdb-input-queue nil
@@ -580,8 +582,7 @@ With arg, use separate IO iff arg is positive."
(defun gdb-get-version ()
(goto-char (point-min))
- (if (and (re-search-forward gdb-error-regexp nil t)
- (string-match ".*(missing implementation)" (match-string 1)))
+ (if (re-search-forward "Undefined\\( mi\\)* command:" nil t)
(setq gdb-version "pre-6.4")
(setq gdb-version "6.4+"))
(gdb-init-2))
@@ -2746,7 +2747,11 @@ corresponding to the mode line clicked."
(switch-to-buffer
(if gud-last-last-frame
(gud-find-file (car gud-last-last-frame))
- (gud-find-file gdb-main-file)))
+ (if gdb-main-file
+ (gud-find-file gdb-main-file)
+ ;; Put buffer list in window if we
+ ;; can't find a source file.
+ (list-buffers-noselect))))
(when gdb-use-separate-io-buffer
(split-window-horizontally)
(other-window 1)
@@ -3139,19 +3144,18 @@ BUFFER nil or omitted means use the current buffer."
(if (re-search-forward "Stack level \\([0-9]+\\)" nil t)
(setq gdb-frame-number (match-string 1)))
(goto-char (point-min))
- (if (re-search-forward
- ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\) (\\(\\S-*?\\):[0-9]+?);? "
- nil t)
- (progn
- (setq gdb-selected-frame (match-string 2))
- (if (gdb-get-buffer 'gdb-locals-buffer)
- (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
- (setq mode-name (concat "Locals:" gdb-selected-frame))))
- (if (gdb-get-buffer 'gdb-assembler-buffer)
- (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
- (setq mode-name (concat "Machine:" gdb-selected-frame))))
- (setq gdb-frame-address (match-string 1))))
- (if gud-overlay-arrow-position
+ (when (re-search-forward ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-+?\\)\
+\\(?: (\\(\\S-+?\\):[0-9]+?)\\)*;? "
+ nil t)
+ (setq gdb-selected-frame (match-string 2))
+ (if (gdb-get-buffer 'gdb-locals-buffer)
+ (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
+ (setq mode-name (concat "Locals:" gdb-selected-frame))))
+ (if (gdb-get-buffer 'gdb-assembler-buffer)
+ (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
+ (setq mode-name (concat "Machine:" gdb-selected-frame))))
+ (setq gdb-frame-address (match-string 1))
+ (if (and (match-string 3) gud-overlay-arrow-position)
(let ((buffer (marker-buffer gud-overlay-arrow-position))
(position (marker-position gud-overlay-arrow-position)))
(when (and buffer (string-equal (buffer-name buffer) (match-string 3)))
@@ -3160,9 +3164,9 @@ BUFFER nil or omitted means use the current buffer."
(if (string-equal gdb-frame-number "0")
nil
'((overlay-arrow . hollow-right-triangle))))
- (set-marker gud-overlay-arrow-position position)))))
+ (set-marker gud-overlay-arrow-position position))))))
(goto-char (point-min))
- (if (re-search-forward " source language \\(\\S-*\\)\." nil t)
+ (if (re-search-forward " source language \\(\\S-+\\)\." nil t)
(setq gdb-current-language (match-string 1)))
(gdb-invalidate-assembler))
@@ -3281,11 +3285,12 @@ in_scope=\"\\(.*?\\)\".*?}")
gdb-pending-triggers))
(goto-char (point-min))
(if (re-search-forward gdb-error-regexp nil t)
- (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
- (let ((buffer-read-only nil))
- (erase-buffer)
- (insert (match-string 1))
- (goto-char (point-min))))
+ (let ((err (match-string 1)))
+ (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
+ (let ((buffer-read-only nil))
+ (erase-buffer)
+ (insert err)
+ (goto-char (point-min)))))
(let ((register-list (reverse gdb-register-names))
(register nil) (register-string nil) (register-values nil))
(goto-char (point-min))
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index d448aec47b8..43b33aa39ae 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -721,7 +721,10 @@ changed by, or (parse-state) if line starts in a quoted string."
(save-excursion
(forward-char 1)
(forward-sexp -1)
- (perl-indent-new-calculate 'virtual nil parse-start)))
+ (perl-indent-new-calculate
+ ;; Recalculate the parsing-start, since we may have jumped
+ ;; dangerously close (typically in the case of nested functions).
+ 'virtual nil (save-excursion (perl-beginning-of-function)))))
(and (and (= (following-char) ?{)
(save-excursion (forward-char) (perl-hanging-paren-p)))
(+ (or default (perl-calculate-indent parse-start))