Function: info-lookup-guess-c-symbol
info-lookup-guess-c-symbol is a byte-compiled function defined in
info-look.el.gz.
Signature
(info-lookup-guess-c-symbol)
Documentation
Get the C symbol at point.
Source Code
;; Defined in /usr/src/emacs/lisp/info-look.el.gz
(defun info-lookup-guess-c-symbol ()
"Get the C symbol at point."
(condition-case nil
(progn
(skip-syntax-backward "w_")
(let ((start (point)) prefix name)
;; Test for a leading `struct', `union', or `enum' keyword
;; but ignore names like `foo_struct'.
(setq prefix (and (< (skip-chars-backward " \t\n") 0)
(< (skip-chars-backward "_a-zA-Z0-9") 0)
(looking-at "\\(struct\\|union\\|enum\\)\\s ")
(concat (match-string 1) " ")))
(goto-char start)
(and (looking-at "[_a-zA-Z][_a-zA-Z0-9]*")
(setq name (match-string 0)))
;; Caveat! Look forward if point is at `struct' etc.
(and (not prefix)
(or (string-equal name "struct")
(string-equal name "union")
(string-equal name "enum"))
(looking-at "[a-z]+\\s +\\([_a-zA-Z][_a-zA-Z0-9]*\\)")
(setq prefix (concat name " ")
name (match-string 1)))
(and (or prefix name)
(concat prefix name))))
(error nil)))