[webkit-dev] New tool for Xcode (Emacs?) users: Copy WebKit Permalink

Charlie Turner cturner at igalia.com
Mon Aug 14 16:33:13 PDT 2017


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.


More information about the webkit-dev mailing list