From: Andreas Gerler Date: Mon, 1 Feb 2016 10:53:43 +0000 (+0100) Subject: added helm-safari. X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=fa836e24d5ad55875ac56836df4264ad464646c3;p=emacsconfig.git added helm-safari. --- diff --git a/bba.org b/bba.org index f32487ca..9acddd2a 100644 --- a/bba.org +++ b/bba.org @@ -2166,6 +2166,8 @@ function to convert groups of spaces to hard tabs. (define-key bba/launcher "!" 'eshell-here) (define-key bba/launcher "b" 'browse-url-at-point) (define-key bba/launcher "B" 'eww) + (define-key bba/launcher "\C-b" 'helm-safari-bookmarks) + (define-key bba/launcher "\C-h" 'helm-safari-history) (define-key bba/launcher "c" 'helm-calcul-expression) (define-key bba/launcher "d" 'ediff-buffers) (define-key bba/launcher "e" 'elfeed) diff --git a/elpa/helm-safari-20160115.2334/helm-safari-autoloads.el b/elpa/helm-safari-20160115.2334/helm-safari-autoloads.el new file mode 100644 index 00000000..a0c38195 --- /dev/null +++ b/elpa/helm-safari-20160115.2334/helm-safari-autoloads.el @@ -0,0 +1,27 @@ +;;; helm-safari-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) + +;;;### (autoloads nil "helm-safari" "helm-safari.el" (22184 48066 +;;;;;; 0 0)) +;;; Generated autoloads from helm-safari.el + +(autoload 'helm-safari-bookmarks "helm-safari" "\ +Search Safari Bookmark using `helm'. + +\(fn)" t nil) + +(autoload 'helm-safari-history "helm-safari" "\ +Search Safari Bookmark using `helm'. + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; helm-safari-autoloads.el ends here diff --git a/elpa/helm-safari-20160115.2334/helm-safari-pkg.el b/elpa/helm-safari-20160115.2334/helm-safari-pkg.el new file mode 100644 index 00000000..eb3fce19 --- /dev/null +++ b/elpa/helm-safari-20160115.2334/helm-safari-pkg.el @@ -0,0 +1 @@ +(define-package "helm-safari" "20160115.2334" "Helm interface for Safari Bookmarks and History" '((helm "1.9.1") (emacs "24")) :keywords '("tools")) diff --git a/elpa/helm-safari-20160115.2334/helm-safari.el b/elpa/helm-safari-20160115.2334/helm-safari.el new file mode 100644 index 00000000..b12ea492 --- /dev/null +++ b/elpa/helm-safari-20160115.2334/helm-safari.el @@ -0,0 +1,94 @@ +;;; helm-safari.el --- Helm interface for Safari Bookmarks and History -*- lexical-binding: t; -*- + +;; Copyright (C) 2016 Chunyang Xu + +;; Author: Chunyang Xu +;; Package-Requires: ((helm "1.9.1") (emacs "24")) +;; Version: 0.1 +;; Package-Version: 20160115.2334 +;; Keywords: tools + +;; 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 of the License, 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, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'helm) + +(defgroup helm-safari nil + "Helm interface for Safari Bookmarks and History." + :group 'helm) + +(defun helm-safari-list-to-alist (list) + ;; '(1 2 3 4) ⇒ ((2 . 1) (4 . 3)) + (let* ((idx 0) + res) + (while (< idx (length list)) + (push (cons (nth (1+ idx) list) + (nth idx list)) + res) + (setq idx (+ idx 2))) + (nreverse res))) + +(defvar helm-safari-bookmarks-alist nil) +(defvar helm-source-safari-bookmarks + (helm-build-sync-source "Safari Bookmarks" + :init + (lambda () + (setq helm-safari-bookmarks-alist + (let ((bookmarks-list + (split-string + (shell-command-to-string + "plutil -p ~/Library/Safari/Bookmarks.plist | grep 'URLString\\|title' | sed 's/.* => \"\\(.*\\)\"/\\1/'") + "\n" t))) + (helm-safari-list-to-alist bookmarks-list)))) + :candidates 'helm-safari-bookmarks-alist + :action '(("Browse Url" . browse-url)))) + +;;;###autoload +(defun helm-safari-bookmarks () + "Search Safari Bookmark using `helm'." + (interactive) + (helm :sources 'helm-source-safari-bookmarks + :prompt "Find Bookmark: " + :buffer "*Helm Safari Bookmarks*")) + +(defvar helm-safari-history-alist nil) +(defvar helm-source-safari-history + (helm-build-sync-source "Safari History" + :init + (lambda () + (setq helm-safari-history-alist + (let ((history-list + (split-string + (shell-command-to-string + "plutil -p ~/Library/Safari/History.plist | grep '\"title\"\\|\"\" ' | sed 's/.* => \"\\(.*\\)\"$/\\1/'") + "\n" t))) + (helm-safari-list-to-alist history-list)))) + :candidates 'helm-safari-history-alist + :action '(("Browse Url" . browse-url)))) + +;;;###autoload +(defun helm-safari-history () + "Search Safari Bookmark using `helm'." + (interactive) + (helm :sources 'helm-source-safari-history + :prompt "Find Bookmark: " + :buffer "*Helm Safari History*")) + +(provide 'helm-safari) +;;; helm-safari.el ends here diff --git a/elpa/helm-safari-readme.txt b/elpa/helm-safari-readme.txt new file mode 100644 index 00000000..e69de29b