aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorJoakim Verona2012-03-13 08:23:14 +0100
committerJoakim Verona2012-03-13 08:23:14 +0100
commit4b2cea2874f3a699ebe96349ef34fb7206cc0fa5 (patch)
treebbd39cf660d9b79b2cff9e39ef6209af4cf9fb8b /lisp/progmodes
parent1de331c486475093aa6b75ef6c259f7164e7620c (diff)
parent6ea7151ba66df966974060711512b49b9059566e (diff)
downloademacs-4b2cea2874f3a699ebe96349ef34fb7206cc0fa5.tar.gz
emacs-4b2cea2874f3a699ebe96349ef34fb7206cc0fa5.zip
upstream
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-cmds.el27
-rw-r--r--lisp/progmodes/cc-engine.el4
-rw-r--r--lisp/progmodes/gdb-mi.el16
3 files changed, 38 insertions, 9 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 509bb203f78..55ab6c9981c 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1958,7 +1958,12 @@ with a brace block."
1958 1958
1959(defun c-mark-function () 1959(defun c-mark-function ()
1960 "Put mark at end of the current top-level declaration or macro, point at beginning. 1960 "Put mark at end of the current top-level declaration or macro, point at beginning.
1961If point is not inside any then the closest following one is chosen. 1961If point is not inside any then the closest following one is
1962chosen. Each successive call of this command extends the marked
1963region by one function.
1964
1965A mark is left where the command started, unless the region is already active
1966\(in Transient Mark mode).
1962 1967
1963As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this 1968As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this
1964function does not require the declaration to contain a brace block." 1969function does not require the declaration to contain a brace block."
@@ -1974,8 +1979,24 @@ function does not require the declaration to contain a brace block."
1974 1979
1975 (if (not decl-limits) 1980 (if (not decl-limits)
1976 (error "Cannot find any declaration") 1981 (error "Cannot find any declaration")
1977 (goto-char (car decl-limits)) 1982 (let* ((extend-region-p
1978 (push-mark (cdr decl-limits) nil t)))) 1983 (and (eq this-command 'c-mark-function)
1984 (eq last-command 'c-mark-function)))
1985 (push-mark-p (and (eq this-command 'c-mark-function)
1986 (not extend-region-p)
1987 (not (and transient-mark-mode mark-active)))))
1988 (if push-mark-p (push-mark (point)))
1989 (if extend-region-p
1990 (progn
1991 (exchange-point-and-mark)
1992 (setq decl-limits (c-declaration-limits t))
1993 (when (not decl-limits)
1994 (exchange-point-and-mark)
1995 (error "Cannot find any declaration"))
1996 (goto-char (cdr decl-limits))
1997 (exchange-point-and-mark))
1998 (goto-char (car decl-limits))
1999 (push-mark (cdr decl-limits) nil t))))))
1979 2000
1980(defun c-cpp-define-name () 2001(defun c-cpp-define-name ()
1981 "Return the name of the current CPP macro, or NIL if we're not in one." 2002 "Return the name of the current CPP macro, or NIL if we're not in one."
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 3b33ac894f2..f392971e7d1 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -236,7 +236,7 @@
236 236
237(defun c-invalidate-macro-cache (beg end) 237(defun c-invalidate-macro-cache (beg end)
238 ;; Called from a before-change function. If the change region is before or 238 ;; Called from a before-change function. If the change region is before or
239 ;; in the macro characterised by `c-macro-cache' etc., nullify it 239 ;; in the macro characterized by `c-macro-cache' etc., nullify it
240 ;; appropriately. BEG and END are the standard before-change-functions 240 ;; appropriately. BEG and END are the standard before-change-functions
241 ;; parameters. END isn't used. 241 ;; parameters. END isn't used.
242 (cond 242 (cond
@@ -2163,7 +2163,7 @@ comment at the start of cc-engine.el for more info."
2163(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit) 2163(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit)
2164;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is 2164;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is
2165;; reduced by buffer changes, and increased by invocations of 2165;; reduced by buffer changes, and increased by invocations of
2166;; `c-state-literal-at'. FIMXE!!! 2166;; `c-state-literal-at'. FIXME!!!
2167 2167
2168(defsubst c-state-pp-to-literal (from to) 2168(defsubst c-state-pp-to-literal (from to)
2169 ;; Do a parse-partial-sexp from FROM to TO, returning either 2169 ;; Do a parse-partial-sexp from FROM to TO, returning either
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 8ea255e49dd..89450cd2276 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -3269,8 +3269,12 @@ DOC is an optional documentation string."
3269 (let* ((frame (gdb-current-buffer-frame)) 3269 (let* ((frame (gdb-current-buffer-frame))
3270 (file (bindat-get-field frame 'fullname)) 3270 (file (bindat-get-field frame 'fullname))
3271 (line (bindat-get-field frame 'line))) 3271 (line (bindat-get-field frame 'line)))
3272 (when file 3272 (if file
3273 (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line))) 3273 (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line)
3274 ;; If we're unable to get a file name / line for $PC, simply
3275 ;; follow $PC, disassembling the next 10 (x ~15 (on IA) ==
3276 ;; 150 bytes) instructions.
3277 "-data-disassemble -s $pc -e \"$pc + 150\" -- 0"))
3274 gdb-disassembly-handler 3278 gdb-disassembly-handler
3275 ;; We update disassembly only after we have actual frame information 3279 ;; We update disassembly only after we have actual frame information
3276 ;; about all threads, so no there's `update' signal in this list 3280 ;; about all threads, so no there's `update' signal in this list
@@ -3329,8 +3333,12 @@ DOC is an optional documentation string."
3329 (gdb-table-add-row table 3333 (gdb-table-add-row table
3330 (list 3334 (list
3331 (bindat-get-field instr 'address) 3335 (bindat-get-field instr 'address)
3332 (apply #'format "<%s+%s>:" 3336 (let
3333 (gdb-get-many-fields instr 'func-name 'offset)) 3337 ((func-name (bindat-get-field instr 'func-name))
3338 (offset (bindat-get-field instr 'offset)))
3339 (if func-name
3340 (format "<%s+%s>:" func-name offset)
3341 ""))
3334 (bindat-get-field instr 'inst))) 3342 (bindat-get-field instr 'inst)))
3335 (when (string-equal (bindat-get-field instr 'address) 3343 (when (string-equal (bindat-get-field instr 'address)
3336 address) 3344 address)