From e375517fdad3f03d36249207b447fa35588dd966 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Wed, 13 Oct 2004 16:32:42 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/gud.el | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58d04cf1d6f..dd331c1c457 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-10-14 Masatake YAMATO + + * 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 Sync with Tramp 2.0.45. diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 4ea4fcb6ea2..37fe13ce585 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -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 -- 2.39.5