Skip to content
Permalink
Browse files

Fix issue 1308. Add rtags-expand-auto to replace auto with its real

type when possible.
  • Loading branch information...
Andersbakken committed Apr 10, 2019
1 parent c0d9285 commit de17d52cb18ca2228d04a9dc8b1c0ed04009d9e7
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/rtags.el
@@ -2591,7 +2591,7 @@ of PREFIX or not, if doesn't contain one, one will be added."
(define-key map (kbd (concat prefix "I")) 'rtags-imenu)
(define-key map (kbd (concat prefix "T")) 'rtags-taglist)
(define-key map (kbd (concat prefix "h")) 'rtags-print-class-hierarchy)
(define-key map (kbd (concat prefix "a")) 'rtags-print-source-arguments)
(define-key map (kbd (concat prefix "a")) 'rtags-expand-auto)
(define-key map (kbd (concat prefix "A")) 'rtags-find-functions-called-by-this-function)
(define-key map (kbd (concat prefix "l")) 'rtags-list-results)
(define-key map (kbd (concat prefix "Z")) 'rtags-location-stack-visualize))
@@ -5330,6 +5330,16 @@ the user enter missing field manually."
(switch-to-buffer (process-buffer process)))
(t nil))))

(defun rtags-expand-auto ()
(interactive)
(let* ((symbolinfo (rtags-symbol-info-internal))
(auto (cdr (assoc 'auto symbolinfo)))
(type (and auto (cdr (assoc 'type symbolinfo)))))
(when type
(save-excursion
(when (re-search-backward "\\<auto\\>" nil t)
(kill-forward-chars 4)
(insert type))))))

(defcustom rtags-install-cmake-args nil
"Additional arguments to cmake when building rtags with rtags-install."

0 comments on commit de17d52

Please sign in to comment.
You can’t perform that action at this time.