Commit 79fe91d07e18

Vincent Demeester <vincent@sbr.pm>
2016-02-17 21:10:32
Add more org links :D
1 parent c02c0e6
Changed files (1)
.emacs.d
.emacs.d/emacs.org
@@ -2050,6 +2050,33 @@
                           path (or desc "video"))))))
     #+END_SRC
 
+    Let's define some for github.com sites.
+
+
+    #+BEGIN_SRC emacs-lisp
+      (org-add-link-type
+       "gh" 'my/follow-gh-link)
+      (defun my/follow-gh-link (issue)
+        "Browse github issue/pr specified"
+        (setq expressions (split-string issue "#"))
+        (setq project (nth 0 expressions))
+        (setq issue (nth 1 expressions))
+        (browse-url
+         (format "https://github.com/%s/issues/%s" project issue)))
+    #+END_SRC
+
+
+    Add some more abbreviation to links
+
+    #+BEGIN_SRC emacs-lisp
+      (setq org-link-abbrev-alist
+            '(("gmane" . "http://thread.gmane.org/%s")
+              ("google" . "https://www.google.com/search?q=%s")
+              ("github" . "http://github.com/%s")
+              ))
+    #+END_SRC
+
+
     And some for =org-mode= itself.
 
     #+BEGIN_SRC emacs-lisp