Skip to content

Commit

Permalink
(defun erl-find-source-pattern-under-point(pattern)
Browse files Browse the repository at this point in the history
  "pattern can be a '#str','?str',means finding a record or macro  "

  also search current buffer ,not only the header file in current buffer
  • Loading branch information
jixiuf committed Sep 20, 2012
1 parent c57ddc4 commit af3b287
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion elisp/erlookup.el
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,13 @@ parameters is a list of found header files"
(defvar erl-erlookup-pattern nil "private variable")

(defun erl-find-source-pattern-under-point(pattern)
"pattern can be a '#str','?str',means finding a record or macro "
(ring-insert-at-beginning erl-find-history-ring (copy-marker (point-marker)))
(setq erl-erlookup-pattern pattern)
(let (buf buf-exists found tmp-result)
(setq found (catch 'found
(dolist (header-file (erl-extract-include-paths-from-buffer (current-buffer)))
(dolist (header-file (cons (buffer-file-name (current-buffer))
(erl-extract-include-paths-from-buffer (current-buffer))))
(setq tmp-result (erl-find-source-pattern-in-file pattern header-file))
(if (equal (caar tmp-result) 'ok)
(throw 'found `(,header-file ,(nth 1 (car tmp-result))))
Expand Down

0 comments on commit af3b287

Please sign in to comment.