Function: semantic-symref-list-create-macro-on-open-hit

semantic-symref-list-create-macro-on-open-hit is an interactive and byte-compiled function defined in list.el.gz.

Signature

(semantic-symref-list-create-macro-on-open-hit)

Documentation

Record a keyboard macro at the location of the hit in the current list.

Under point should be one hit for the active keyword. Move cursor to the beginning of that symbol, then record a macro as if kmacro-start-macro was pressed. Use kmacro-end-macro,
{kmacro-end-macro} to end the macro, and return to the symbol found list.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/symref/list.el.gz
;;; Keyboard Macros on a Hit
;;
;; Record a macro on a hit, and store in a special way for execution later.
(defun semantic-symref-list-create-macro-on-open-hit ()
  "Record a keyboard macro at the location of the hit in the current list.
Under point should be one hit for the active keyword.  Move
cursor to the beginning of that symbol, then record a macro as if
`kmacro-start-macro' was pressed.  Use `kmacro-end-macro',
{kmacro-end-macro} to end the macro, and return to the symbol found list."
  (interactive)
  (let* ((oldsym (oref (oref semantic-symref-current-results
			    created-by)
		      searchfor))
	 (ol (save-excursion
	       (end-of-line)
	       (car (overlays-at (1- (point))))))
	 (tag (when ol (overlay-get ol 'tag)))
	 (line (when ol (overlay-get ol 'line))))
    (when (not line)
      (error "Cannot create macro on a non-hit line"))
    ;; Go there, and do something useful.
    (switch-to-buffer-other-window (semantic-tag-buffer tag))
    (goto-char (point-min))
    (forward-line (1- line))
    (when (not (re-search-forward (regexp-quote oldsym) (line-end-position) t))
      (error "Cannot find hit.  Cannot record macro"))
    (goto-char (match-beginning 0))
    ;; Cursor is now in the right location.  Start recording a macro.
    (kmacro-start-macro nil)
    ;; Notify the user
    (message "Complete with C-x ).  Use E in the symref buffer to call this macro.")))