all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#28010] [PATCH] gnu: Add emacs-engine-mode.
@ 2017-08-08 10:14 Oleg Pykhalov
  2017-08-10  9:38 ` Arun Isaac
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Pykhalov @ 2017-08-08 10:14 UTC (permalink / raw)
  To: 28010

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: [PATCH] gnu: Add emacs-engine-mode. --]
[-- Type: text/x-patch, Size: 2066 bytes --]

From 74039e61a71cae09fa0ae0f4a2debcdddb8f6118 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
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


[-- Attachment #2: Type: text/plain, Size: 817 bytes --]


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))))))

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-10 17:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-08 10:14 [bug#28010] [PATCH] gnu: Add emacs-engine-mode Oleg Pykhalov
2017-08-10  9:38 ` Arun Isaac
2017-08-10 11:09   ` Oleg Pykhalov
2017-08-10 12:07     ` Arun Isaac
2017-08-10 14:08       ` Oleg Pykhalov
2017-08-10 16:33         ` Arun Isaac
2017-08-10 17:08         ` bug#28010: " Arun Isaac

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.