diff options
authorAkarsh Simha <[email protected]>2016-09-13 01:31:13 -0500
committerAkarsh Simha <[email protected]>2016-09-13 01:31:13 -0500
commit76d1b0af89f2265d774b3b73aee4aac7e584f971 (patch)
parente1e5481eb518bb6307303ba2c55cbd80893fabde (diff)
Simplify code using (beginning-of-defun) from c-mode
1 files changed, 3 insertions, 6 deletions
diff --git a/kde-emacs/kde-emacs-utils.el b/kde-emacs/kde-emacs-utils.el
index 0d45f99..6c3239c 100644
--- a/kde-emacs/kde-emacs-utils.el
+++ b/kde-emacs/kde-emacs-utils.el
@@ -368,16 +368,13 @@ This function does not do any hidden buffer changes."
;; returns the tag in the same file, not in the header file.So
;; we hack this by going to the function definition and then using
;; (semantic-idle-summary-current-symbol-info-context) etc.
- (let* ((tag (or (semantic-stickyfunc-tag-to-stick)
- (error "No known tag at point")))
- (pos (or (semantic-tag-start tag)
- (error "Tag definition not found")))
- (destpos nil)
+ (let* ((destpos nil)
(desttag nil)
(file nil))
- (goto-char pos)
+ (end-of-line) ; This ensures that being at the beginning of the line does not take us to the previous function's declaration
+ (beginning-of-defun)
(re-search-forward "(")
(forward-char -1)
(re-search-backward "\\S-")