- (when (looking-at (concat (regexp-quote tag)
- "[ \t]+\\([[:digit:]]+\\)"
- "[ \t]+\\([^ \t]+\\)"))
- (cons (expand-file-name (match-string 2))
- (string-to-number (match-string 1)))))))
+ (cl-loop while
+ (re-search-forward (concat
+ "^"
+ "\\([^ ]*\\)" ;; completion
+ "[ \t]+\\([[:digit:]]+\\)" ;; linum
+ "[ \t]+\\([^ \t]+\\)" ;; file
+ "[ \t]+\\(.*\\)" ;; definition
+ "$"
+ ) nil t)
+ collect
+ (propertize (match-string 1)
+ 'meta (match-string 4)
+ 'location (cons (expand-file-name (match-string 3))
+ (string-to-number (match-string 2)))
+ ))))))
+
+(defun company-gtags--annotation (arg)
+ (let ((meta (get-text-property 0 'meta arg)))
+ (when (string-match (concat arg "\\((.*)\\).*") meta)
+ (match-string 1 meta))))