[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#28010] [PATCH] gnu: Add emacs-engine-mode.
From: |
Oleg Pykhalov |
Subject: |
[bug#28010] [PATCH] gnu: Add emacs-engine-mode. |
Date: |
Tue, 08 Aug 2017 13:14:37 +0300 |
>From 74039e61a71cae09fa0ae0f4a2debcdddb8f6118 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <address@hidden>
Date: Tue, 8 Aug 2017 13:00:18 +0300
Subject: [PATCH] gnu: Add emacs-engine-mode.
* gnu/packages/emacs.scm (emacs-engine-mode): New variable.
---
gnu/packages/emacs.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 3821d18d4..427f3fc3e 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -5272,3 +5272,34 @@ user easy handle git-format patch without exit Emacs.
commit message for the current line. This uses the git-blame tool
internally.")
(license license:gpl3+)))
+
+(define-public emacs-engine-mode
+ (package
+ (name "emacs-engine-mode")
+ (version "2.0.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/hrs/engine-mode/archive/"
+ "v" version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1vm4p7pcp1vnwwxvps1bhm7i7hkabqqxl898knxf2hqvxys76684"))))
+ (build-system emacs-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'documents
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (documents (string-append out "/share/doc")))
+ (for-each (lambda (file)
+ (install-file file documents))
+ '("README.md" "doc/demo.gif")))
+ #t)))))
+ (synopsis "Minor mode for defining and querying search engines")
+ (description "@code{engine-mode} is a global minor mode for Emacs. It
+enables you to easily define search engines, bind them to keybindings, and
+query them from the comfort of your editor.")
+ (home-page "https://github.com/hrs/engine-mode")
+ (license license:gpl3+)))
--
2.14.0
Hello Guix, this is a config (inspired by Spacemacs) which I use to get
“M-x engine/search-wikipedia” like searches.
(use-package engine-mode
:init
(progn
(setq search-engine-alist
'((duck-duck-go
:name "Duck Duck Go"
:url "https://duckduckgo.com/?q=%s")
(wikipedia
:name "Wikipedia"
:url
"http://www.wikipedia.org/search-redirect.php?language=en&go=Go&search=%s")))
(dolist (engine search-engine-alist)
(let ((func (intern (format "engine/search-%S" (car engine)))))
(autoload func "engine-mode" nil 'interactive))))
:config
(progn
(engine-mode t)
(dolist (engine search-engine-alist)
(let* ((cur-engine (car engine))
(engine-url (plist-get (cdr engine) :url)))
(eval `(defengine ,cur-engine ,engine-url))))))
- [bug#28010] [PATCH] gnu: Add emacs-engine-mode.,
Oleg Pykhalov <=