Hi,

Thanks for sharing that, thought it was useful so made an Emacs version
of it. Only works for the Git mirror and requires Magit as well, but
maybe of use to someone else with Emacs.

-----------------------8<----------------------------
(defun webkit-trac-url ()
  (interactive)
  (let ((git-svn-id-line
         (car (--filter (string-match-p "svn.webkit.org" it)
                        (magit-git-lines "log" "--format=%b" "-n 1"
"HEAD")))))
    (if (string-match "\\([A-z]+\\)@\\([[:digit:]]+\\)" git-svn-id-line)
        (let ((branch (match-string 1 git-svn-id-line))
              (revision (match-string 2 git-svn-id-line))
              (path (magit-file-relative-name)))
          (kill-new (concat "https://trac.webkit.org/browser/"; branch
                            "/" path
                            "?" revision
                            (if current-prefix-arg
                                "&annotate=blame" "")
                            "#L" (format-mode-line "%l")))
          (message "On your clipboard!")))))
----------------------->8----------------------------

That goes in your init.el.

DISCLAIMER: Not an Emacs expert!

~Charlie.
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to