]> git.eshelyaron.com Git - emacs.git/commitdiff
* progmodes/gud.el (gdb-script-beginning-of-defun): New function.
authorMasatake YAMATO <jet@gyve.org>
Wed, 13 Oct 2004 16:32:42 +0000 (16:32 +0000)
committerMasatake YAMATO <jet@gyve.org>
Wed, 13 Oct 2004 16:32:42 +0000 (16:32 +0000)
  (gdb-script-end-of-defun): New function.
  (gdb-script-mode): Use `gdb-script-beginning-of-defun' and
  `gdb-script-end-of-defun' as *-of-defun-function.

lisp/ChangeLog
lisp/progmodes/gud.el

index 58d04cf1d6f11adb6ba5145d102b0bec1b3e7c99..dd331c1c457a0c8fc7790b870dfe55d7387676d5 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-14  Masatake YAMATO  <jet@gyve.org>
+
+       * progmodes/gud.el (gdb-script-beginning-of-defun): New function.
+       (gdb-script-end-of-defun): New function.
+       (gdb-script-mode): Use `gdb-script-beginning-of-defun' and
+       `gdb-script-end-of-defun' as *-of-defun-function.
+
 2004-10-12  Michael Albinus  <michael.albinus@gmx.de>
 
        Sync with Tramp 2.0.45.
index 4ea4fcb6ea25ed735acdaa1695301a6fbbd9fa5e..37fe13ce5854ba385cd48912d154cf809bcf26fb 100644 (file)
@@ -3027,6 +3027,27 @@ class of the file (using s to separate nested class ids)."
          (save-excursion (indent-line-to indent))
        (indent-line-to indent)))))
 
+;; Derived from cfengine.el.
+(defun gdb-script-beginning-of-defun ()
+  "`beginning-of-defun' function for Gdb script mode.
+Treats actions as defuns."
+  (unless (<= (current-column) (current-indentation))
+    (end-of-line))
+  (if (re-search-backward "^define \\|^document " nil t)
+      (beginning-of-line)
+    (goto-char (point-min)))
+  t)
+
+;; Derived from cfengine.el.
+(defun gdb-script-end-of-defun ()
+  "`end-of-defun' function for Gdb script mode.
+Treats actions as defuns."
+  (end-of-line)
+  (if (re-search-forward "^end" nil t)
+      (beginning-of-line)
+    (goto-char (point-max)))
+  t)
+
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("/\\.gdbinit" . gdb-script-mode))
 
@@ -3039,6 +3060,10 @@ class of the file (using s to separate nested class ids)."
   (set (make-local-variable 'imenu-generic-expression)
        '((nil "^define[ \t]+\\(\\w+\\)" 1)))
   (set (make-local-variable 'indent-line-function) 'gdb-script-indent-line)
+  (set (make-local-variable 'beginning-of-defun-function)
+       #'gdb-script-beginning-of-defun)
+  (set (make-local-variable 'end-of-defun-function)
+       #'gdb-script-end-of-defun)
   (set (make-local-variable 'font-lock-defaults)
        '(gdb-script-font-lock-keywords nil nil ((?_ . "w")) nil
         (font-lock-syntactic-keywords