aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d')
-rw-r--r--emacs/.emacs.d/lisp/my/my-emms.el2
-rw-r--r--emacs/.emacs.d/lisp/my/my-github.el4
-rw-r--r--emacs/.emacs.d/lisp/my/my-gitlab.el10
-rw-r--r--emacs/.emacs.d/lisp/my/my-web.el30
4 files changed, 34 insertions, 12 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-emms.el b/emacs/.emacs.d/lisp/my/my-emms.el
index e3e4d32..cdbe57a 100644
--- a/emacs/.emacs.d/lisp/my/my-emms.el
+++ b/emacs/.emacs.d/lisp/my/my-emms.el
@@ -387,7 +387,7 @@ artist/album/track."
(emms-playlist-current-select-next)
(if (string-equal (my-emms-current-album-name) current-album)
(emms-start)
- (my-emms-playlist-random-album nil))))
+ (my-emms-playlist-random-album))))
(defvar-local my-emms-albums-cache (vector))
diff --git a/emacs/.emacs.d/lisp/my/my-github.el b/emacs/.emacs.d/lisp/my/my-github.el
index 7caff57..e2d5f6a 100644
--- a/emacs/.emacs.d/lisp/my/my-github.el
+++ b/emacs/.emacs.d/lisp/my/my-github.el
@@ -25,7 +25,7 @@
;; Github client.
;;; Code:
-
+(require 'my-web)
(defun my-grok-github (url)
"get github info of a project.
@@ -93,7 +93,7 @@ License; name; description; homepage; created at"
)
(defvar my-github-project-info-specs
- `((html_url . "Clone")
+ `((html_url . ("URL" . my-forge-infobox-format-url))
(full_name . "Name")
(description . "Description")
(created_at . ("Created at" . my-gitlab-format-time-string))
diff --git a/emacs/.emacs.d/lisp/my/my-gitlab.el b/emacs/.emacs.d/lisp/my/my-gitlab.el
index 27f3344..56542c0 100644
--- a/emacs/.emacs.d/lisp/my/my-gitlab.el
+++ b/emacs/.emacs.d/lisp/my/my-gitlab.el
@@ -75,17 +75,9 @@
(require 'my-buffer)
(require 'my-web)
(require 'my-magit)
-(defun my-gitlab-format-url (url)
- (concat url
- " -- " (buttonize "clone"
- (lambda (_)
- (my-magit-clone url current-prefix-arg)))
- " " (buttonize "context"
- (lambda (_)
- (funcall my-url-context-function url)))))
(defvar my-gitlab-project-info-specs
- `((http_url_to_repo . ("URL" . my-gitlab-format-url))
+ `((http_url_to_repo . ("URL" . my-forge-infobox-format-url))
(name_with_namespace . "Name")
(description . "Description")
(created_at . ("Created at" . my-gitlab-format-time-string))
diff --git a/emacs/.emacs.d/lisp/my/my-web.el b/emacs/.emacs.d/lisp/my/my-web.el
index aeb5a6d..21b227d 100644
--- a/emacs/.emacs.d/lisp/my/my-web.el
+++ b/emacs/.emacs.d/lisp/my/my-web.el
@@ -202,5 +202,35 @@ https://emacs.stackexchange.com/questions/40887/in-org-mode-how-do-i-link-to-int
(setq files (delq var files)))))
(apply orig-fun files client args))
+(defvar my-firefox-profile-dir nil "Firefox profile dir")
+(defvar my-firefox-place-limit 1000 "Firefox urls result limit")
+
+(defun my-firefox-places (&optional query)
+ (let ((where
+ (mapconcat
+ (lambda (word) (format "(url LIKE '%%%s%%' OR title LIKE '%%%s%%')" word word))
+ (split-string (or query ""))
+ " AND ")))
+ (unless (string-empty-p where) (setq where (format "WHERE %s" where)))
+ (with-temp-buffer
+ (call-process "sqlite3" nil t nil
+ (format "file://%s/places.sqlite?immutable=1"
+ my-firefox-profile-dir)
+ (format
+ "SELECT url,title FROM moz_places %s ORDER BY visit_count desc limit %d"
+ where
+ my-firefox-place-limit))
+ (buffer-string)
+ )))
+
+(defun my-forge-infobox-format-url (url)
+ (concat url
+ " -- " (buttonize "clone"
+ (lambda (_)
+ (my-magit-clone url current-prefix-arg)))
+ " " (buttonize "context"
+ (lambda (_)
+ (funcall my-url-context-function url)))))
+
(provide 'my-web)
;;; my-web.el ends here