Function: info-lookup-guess-gdb-script-symbol

info-lookup-guess-gdb-script-symbol is a byte-compiled function defined in info-look.el.gz.

Signature

(info-lookup-guess-gdb-script-symbol)

Documentation

Get symbol at point in GDB script buffers.

Source Code

;; Defined in /usr/src/emacs/lisp/info-look.el.gz
(defun info-lookup-guess-gdb-script-symbol ()
  "Get symbol at point in GDB script buffers."
  (condition-case nil
      (save-excursion
        (back-to-indentation)
        ;; Try to find the current line's full command in the index;
        ;; and default to the longest subset that is found.
        (when (looking-at "[-a-z]+\\(\\s-[-a-z]+\\)*")
          (let ((str-list (split-string (match-string-no-properties 0)
                                        "\\s-+" t))
                (completions (info-lookup->completions 'symbol
                                                       'gdb-script-mode)))
            (catch 'result
              (while str-list
                (let ((str (string-join str-list " ")))
                  (when (assoc str completions)
                    (throw 'result str))
                  (nbutlast str-list)))))))
    (error nil)))