summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-09-13 06:31:13 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-09-13 06:31:13 (GMT)
commit76d1b0af89f2265d774b3b73aee4aac7e584f971 (patch)
treeca453e9c21bb14ff513073cb349f14c3eb0beb03
parente1e5481eb518bb6307303ba2c55cbd80893fabde (diff)
Simplify code using (beginning-of-defun) from c-mode
-rw-r--r--kde-emacs/kde-emacs-utils.el9
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))
(push-mark)
(save-excursion
- (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-")