summaryrefslogtreecommitdiff
path: root/lisp/find-file.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-07-02 19:11:52 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-07-02 19:11:52 +0000
commitc7c7f94a05a6611cf9a6a7a54c3c7bf08a624a03 (patch)
treee007455056710a1532c9988d492bc0c09f7a7660 /lisp/find-file.el
parentb1f71b43ead7385fd275c70820b61c8df9511767 (diff)
downloademacs-c7c7f94a05a6611cf9a6a7a54c3c7bf08a624a03.tar.gz
(ff-which-function-are-we-in): Clean up.
Diffstat (limited to 'lisp/find-file.el')
-rw-r--r--lisp/find-file.el19
1 files changed, 6 insertions, 13 deletions
diff --git a/lisp/find-file.el b/lisp/find-file.el
index 26c5cccf8e5..69cafbc75b1 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -946,18 +946,11 @@ and the name of the file passed in."
(defun ff-which-function-are-we-in ()
"Return the name of the function whose definition/declaration point is in.
Also remember that name in `ff-function-name'."
-
- (setq ff-function-name nil)
-
- (save-excursion
- (if (re-search-backward ada-procedure-start-regexp nil t)
- (setq ff-function-name (buffer-substring (match-beginning 0)
- (match-end 0)))
- ; we didn't find a procedure start, perhaps there is a package
- (if (re-search-backward ada-package-start-regexp nil t)
- (setq ff-function-name (buffer-substring (match-beginning 0)
- (match-end 0)))
- ))))
+ (setq ff-function-name
+ (save-excursion
+ (if (or (re-search-backward ada-procedure-start-regexp nil t)
+ (re-search-backward ada-package-start-regexp nil t))
+ (match-string 0)))))
;; bind with (setq ff-post-load-hook 'ff-set-point-accordingly)
;;
@@ -971,5 +964,5 @@ That name was previously determined by `ff-which-function-are-we-in'."
(provide 'find-file)
-;;; arch-tag: 5a2fc49e-3b0a-4708-9acf-fb14e471a97a
+;; arch-tag: 5a2fc49e-3b0a-4708-9acf-fb14e471a97a
;;; find-file.el ends here