[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


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.

(defun webkit-trac-url ()
  (let ((git-svn-id-line
         (car (--filter (string-match-p "svn.webkit.org" it)
                        (magit-git-lines "log" "--format=%b" "-n 1"
    (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!")))))

That goes in your init.el.

DISCLAIMER: Not an Emacs expert!


More information about the webkit-dev mailing list