home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8cde3f884065fc1da027d1f3c567f05d36d65756
parent baaa6b7c96f42581988fa360902b50e8002519b3
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Sat,  9 May 2020 16:02:53 +0200

Add lisp/{modus-themes,vorg} to load-path 📦

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mtools/emacs/init.el | 2++
Dtools/emacs/lisp/modus-operandi-theme.el | 2--
Dtools/emacs/lisp/modus-vivendi-theme.el | 2--
Dtools/emacs/lisp/ol-github.el | 67-------------------------------------------------------------------
Dtools/emacs/lisp/ol-gitlab.el | 78------------------------------------------------------------------------------
Dtools/emacs/lisp/ol-grep.el | 54------------------------------------------------------
Dtools/emacs/lisp/ol-ripgrep.el | 53-----------------------------------------------------
7 files changed, 2 insertions(+), 256 deletions(-)

diff --git a/tools/emacs/init.el b/tools/emacs/init.el @@ -188,6 +188,8 @@ ;; CfgLoad (add-to-list 'load-path (concat user-emacs-directory "lisp/")) +(add-to-list 'load-path (concat user-emacs-directory "lisp/modus-themes")) +(add-to-list 'load-path (concat user-emacs-directory "lisp/vorg")) (require 'init-func) (vde/el-load-dir (concat user-emacs-directory "/config/")) ;; -CfgLoad diff --git a/tools/emacs/lisp/modus-operandi-theme.el b/tools/emacs/lisp/modus-operandi-theme.el @@ -1 +0,0 @@ -modus-themes/modus-operandi-theme.el- \ No newline at end of file diff --git a/tools/emacs/lisp/modus-vivendi-theme.el b/tools/emacs/lisp/modus-vivendi-theme.el @@ -1 +0,0 @@ -modus-themes/modus-vivendi-theme.el- \ No newline at end of file diff --git a/tools/emacs/lisp/ol-github.el b/tools/emacs/lisp/ol-github.el @@ -1,67 +0,0 @@ -;;; ol-github.el --- Links to GitHub -*- lexical-binding: t; -*- - -;; Copyright (C) 2020 Vincent Demeester - -;; Author: Vincent Demeester <vincent@sbr.pm> -;; Keywords: org link github -;; -;; This file is not part of GNU Emacs. - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 3.0, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: - -;; This file implements links to GitHub from within Org mode. -;; gh:tektoncd/pipeline : project -;; gh:tektoncd/pipeline#1 : issue or pr #1 - -;;; Code: - -(require 'ol) - -;; Install the link type -(org-link-set-parameters "gh" - :follow #'org-github-follow-link - :export #'org-github-export - :face '(:foreground "DimGrey" :underline t)) - - -(defun org-github-export (link description format) - "Export a github page link from Org files." - (let ((path (org-github-get-url link)) - (desc (or description link))) - (cond - ((eq format 'html) (format "<a hrefl=\"_blank\" href=\"%s\">%s</a>" path desc)) - ((eq format 'latex) (format "\\href{%s}{%s}" path desc)) - ((eq format 'texinfo) (format "@uref{%s,%s}" path desc)) - ((eq format 'ascii) (format "%s (%s)" desc path)) - (t path)))) - -(defun org-github-follow-link (issue) - "Browse github issue/pr specified." - (browse-url (org-github-get-url issue))) - -(defun org-github-get-url (path) - "Translate org-mode link `gh:foo/bar#1' to github url." - (setq expressions (split-string path "#")) - (setq project (nth 0 expressions)) - (setq issue (nth 1 expressions)) - (if issue - (format "https://github.com/%s/issues/%s" project issue) - (format "https://github.com/%s" project))) - -(provide 'ol-github) -;;; ol-github.el ends here diff --git a/tools/emacs/lisp/ol-gitlab.el b/tools/emacs/lisp/ol-gitlab.el @@ -1,78 +0,0 @@ -;;; ol-gitlab.el --- Links to Gitlab -*- lexical-binding: t; -*- - -;; Copyright (C) 2020 Vincent Demeester - -;; Author: Vincent Demeester <vincent@sbr.pm> -;; Keywords: org link gitlab -;; -;; This file is not part of GNU Emacs. - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 3.0, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: - -;; This file implements links to Gitlab from within Org mode. -;; gl:vdemeester/emacs-config : project -;; gl:vdemeester/emacs-config#1 : issue #1 -;; gl:vdemeester/emacs-config##1 : merge-request #1 - -;;; Code: - -(require 'ol) - -;; Install the link type -(org-link-set-parameters "gl" - :follow #'org-gitlab-follow-link - :export #'org-gitlab-export - :face '(:foreground "DimGrey" :underline t)) - - -(defun org-gitlab-export (link description format) - "Export a gitlab page link from Org files." - (let ((path (org-gitlab-get-url link)) - (desc (or description link))) - (cond - ((eq format 'html) (format "<a hrefl=\"_blank\" href=\"%s\">%s</a>" path desc)) - ((eq format 'latex) (format "\\href{%s}{%s}" path desc)) - ((eq format 'texinfo) (format "@uref{%s,%s}" path desc)) - ((eq format 'ascii) (format "%s (%s)" desc path)) - (t path)))) - -(defun org-gitlab-follow-link (issue) - "Browse gitlab issue/pr specified." - (browse-url (org-gitlab-get-url issue))) - -(defun org-gitlab-get-url (path) - "Translate org-mode link `gh:foo/bar#1' to gitlab url." - (setq expressions (split-string path "#")) - (setq project (nth 0 expressions)) - (setq issue (nth 1 expressions)) - (setq mr (nth 2 expressions)) - (message (format "issue: %s" issue)) - (message (format "mr: %s" mr)) - (if (not (empty-string-p mr)) - (format "https://gitlab.com/%s/-/merge_requests/%s" project mr) - (if (not (empty-string-p issue)) - (format "https://gitlab.com/%s/-/issues/%s" project issue) - (format "https://gitlab.com/%s" project)))) - -(defun empty-string-p (string) - "Return true if the STRING is empty or nil. Expects string type." - (or (null string) - (zerop (length (string-trim string))))) - -(provide 'ol-gitlab) -;;; ol-gitlab.el ends here diff --git a/tools/emacs/lisp/ol-grep.el b/tools/emacs/lisp/ol-grep.el @@ -1,54 +0,0 @@ -;;; ol-grep.el --- Links to Grep -*- lexical-binding: t; -*- - -;; Copyright (C) 2020 Vincent Demeester - -;; Author: Vincent Demeester <vincent@sbr.pm> -;; Keywords: org link grep -;; -;; This file is not part of GNU Emacs. - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 3.0, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: - -;; This file implements links to Grep from within Org mode. -;; grep:orgmode : run grep on current working dir with orgmode expression -;; grep:orgmode:config/ : run grep on config/ dir with orgmode expression - -;;; Code: - -(require 'ol) - -;; Install the link type -(org-link-set-parameters "rg" - :follow #'org-grep-follow-link - :face '(:foreground "DarkRed" :underline t)) - -(defun org-grep-follow-link (issue) - "Run `rgrep' with REGEXP and FOLDER as argument, -like this : [[grep:REGEXP:FOLDER]]." - (setq expressions (split-string regexp ":")) - (setq exp (nth 0 expressions)) - (grep-compute-defaults) - (if (= (length expressions) 1) - (progn - (rgrep exp "*" (expand-file-name "./"))) - (progn - (setq folder (nth 1 expressions)) - (rgrep exp "*" (expand-file-name folder))))) - -(provide 'ol-grep) -;;; ol-grep.el ends here diff --git a/tools/emacs/lisp/ol-ripgrep.el b/tools/emacs/lisp/ol-ripgrep.el @@ -1,53 +0,0 @@ -;;; ol-ripgrep.el --- Links to Ripgrep -*- lexical-binding: t; -*- - -;; Copyright (C) 2020 Vincent Demeester - -;; Author: Vincent Demeester <vincent@sbr.pm> -;; Keywords: org link ripgrep -;; -;; This file is not part of GNU Emacs. - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 3.0, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: - -;; This file implements links to Ripgrep from within Org mode. -;; rg:orgmode : run ripgrep on current working dir with orgmode expression -;; rg:orgmode:config/ : run ripgrep on config/ dir with orgmode expression - -;;; Code: - -(require 'ol) - -;; Install the link type -(org-link-set-parameters "rg" - :follow #'org-ripgrep-follow-link - :face '(:foreground "DarkGreen" :underline t)) - -(defun org-ripgrep-follow-link (regexp) - "Run `ripgrep-regexp` with REXEP and FOLDER as argument, -like this : [[pt:REGEXP:FOLDER]]" - (setq expressions (split-string regexp ":")) - (setq exp (nth 0 expressions)) - (if (= (length expressions) 1) - (progn - (ripgrep-regexp exp (expand-file-name "./"))) - (progn - (setq folder (nth 1 expressions)) - (ripgrep-regexp exp (file-name-as-directory (expand-file-name folder)))))) - -(provide 'ol-ripgrep) -;;; ol-ripgrep.el ends here