# HG changeset patch # User Stefan Monnier # Date 1120331512 0 # Node ID 8c8961dafdc6c991e2c94936d462f51fb201e01b # Parent e9d1e6c37230b2e53a4424413956c9b628a6c819 (ff-which-function-are-we-in): Clean up. diff -r e9d1e6c37230 -r 8c8961dafdc6 lisp/find-file.el --- a/lisp/find-file.el Sat Jul 02 18:46:49 2005 +0000 +++ b/lisp/find-file.el Sat Jul 02 19:11:52 2005 +0000 @@ -946,18 +946,11 @@ (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 @@ (provide 'find-file) -;;; arch-tag: 5a2fc49e-3b0a-4708-9acf-fb14e471a97a +;; arch-tag: 5a2fc49e-3b0a-4708-9acf-fb14e471a97a ;;; find-file.el ends here