Skip to content

Instantly share code, notes, and snippets.

@mgallego
Created October 5, 2012 19:29
Show Gist options
  • Save mgallego/3841846 to your computer and use it in GitHub Desktop.
Save mgallego/3841846 to your computer and use it in GitHub Desktop.
Estado inicial de PHPDocumentor.el
(defun phpdoc ()
"print-the-php-documentor-block"
(interactive)
(search-backward " function")
(setq method-name (phpdoc-get-method-description))
(phpdoc-block-position)
(setq init-block-point (point))
(phpdoc-start-line)
(phpdoc-new-line method-name)
(phpdoc-new-line)
(phpdoc-end-line)
(indent-region inicio (point))
(goto-char init-block-point)
(message "PHPDocumentor block created")
)
(defun phpdoc-block-position ()
(previous-line)(beginning-of-line)(newline)
)
(defun phpdoc-new-line (&optional phpdoc-data)
(newline)
(insert (concat "* " phpdoc-data))
)
(defun phpdoc-end-line ()
(newline)
(insert "*/")
)
(defun phpdoc-start-line ()
(insert "/**")
)
(defun phpdoc-get-method-description ()
(search-forward " ")
(setq init-word (point))
(right-word)
(buffer-substring-no-properties init-word (point))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment