[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14436: 24.3.50; cscope + compilation-mode
From: |
Jambunathan K |
Subject: |
bug#14436: 24.3.50; cscope + compilation-mode |
Date: |
Sat, 25 May 2013 22:18:05 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Jambunathan K <kjambunathan@gmail.com> writes:
> Being a C programmer, I always missed not having support for cscope "out
> of the box" in my vanilla Emacs. It is unfortunate that xcscope.el is
> not part of Emacs proper.
Above statement is no longer true, now that cedet-cscope.el is part of
Emacs. Here is a small recipe to search for C symbols outside of cedet
framework.
(require 'cedet-cscope)
(defun cscope-find-c-symbol (&optional tag)
(interactive
(list (let ((tag (find-tag-default)))
(read-string (format "Search for (default \"%s\"): " (or tag ""))
nil nil tag))))
;; If "*CEDET CScope*" is put in `compilation-mode', `erase-buffer'
;; (called from within `cedet-cscope-search') may complain. Just
;; kill the results buffer before initiating a new search.
(let ((cscope-buffer "*CEDET CScope*"))
(when (get-buffer cscope-buffer)
(kill-buffer cscope-buffer)))
(with-current-buffer (cedet-cscope-search tag 'tagregexp 'line 'project)
;; FIXME: Add cscope pattern to `compilation-error-regexp-alist'
;; or `compilation-error-regexp-alist-alist'.
;; (compilation-mode)
(display-buffer (current-buffer))))