summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2016-07-07 20:35:18 +0200
committerAlan Pearce2016-07-07 20:35:18 +0200
commit4e3692216b416c7128ea7d580ffd87b61332487a (patch)
treed08aefcd4e7ea66bab90c32ae604eef8e885866a /tag-emacs
parenta7d0f41f8f9b676b7a9be4fe8cf760db8ed8ad47 (diff)
parent6afa8022aa833d2452cf16b4161f5258276b4688 (diff)
downloaddotfiles-4e3692216b416c7128ea7d580ffd87b61332487a.tar.lz
dotfiles-4e3692216b416c7128ea7d580ffd87b61332487a.tar.zst
dotfiles-4e3692216b416c7128ea7d580ffd87b61332487a.zip
Merge branch 'master' of git.alanpearce.uk:alan/dotfiles
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.org72
1 files changed, 51 insertions, 21 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 545b82a..4c0e259 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -36,6 +36,51 @@ the buffer to be empty.
 ** Use-package
 
 #+BEGIN_SRC emacs-lisp
+  (defvar melpa-include-packages '(minimal-theme
+                                   highlight-stages
+                                   relative-buffers
+                                   dired+
+                                   dired-subtree
+                                   dired-hacks-utils
+                                   dired-narrow
+                                   org-caldav
+                                   go-projectile
+                                   go-rename
+                                   go-guru
+                                   redshank
+                                   restclient
+                                   visual-regexp)
+    "Don't install any MELPA packages except these packages")
+
+  (defvar package-filter-function nil
+    "Optional predicate function used to internally filter packages used by package.el.
+
+  The function is called with the arguments PACKAGE VERSION ARCHIVE, where
+  PACKAGE is a symbol, VERSION is a vector as produced by `version-to-list', and
+  ARCHIVE is the string name of the package archive.")
+
+  ;; Don't take MELPA versions of certain packages
+  (setq package-filter-function
+        (lambda (package version archive)
+          (or (not (string-equal archive "melpa"))
+              ;; install package in whitelist
+              (memq package melpa-include-packages)
+              ;; use all color themes
+              (string-match (format "%s" package) "-theme"))))
+
+  (defadvice package--add-to-archive-contents
+      (around filter-packages (package archive) activate)
+    "Add filtering of available packages using `package-filter-function', if non-nil."
+    (when (or (null package-filter-function)
+              (funcall package-filter-function
+                       (car package)
+                       (funcall (if (fboundp 'package-desc-version)
+                                    'package--ac-desc-version
+                                  'package-desc-vers)
+                                (cdr package))
+                       archive))
+      ad-do-it))
+
   (eval-and-compile
     (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                              ("marmalade" . "http://marmalade-repo.org/packages/")
@@ -585,17 +630,6 @@ I only use this occasionally, but it’s nice for files outside of projects.
                (recentf-mode 1)))
 #+END_SRC
 
-** spotlight
-
-An awesome way to open files on OS X.
-
-#+BEGIN_SRC emacs-lisp
-  (use-package spotlight
-    :defer 10
-    :if (eq system-type 'darwin)
-    :config (setq spotlight-tmp-file "/tmp/.emacs-spotlight-tmp-file"))
-#+END_SRC
-
 ** Tramp
 
 Tramp is awesome.  It makes SSH feel Unix-y.  The proxy setup is so
@@ -1849,7 +1883,12 @@ it though
     :interpreter ("node" . js2-mode)
     :functions js2-next-error
     :config (progn
-              (unbind-key [menu-bar javascript] js2-mode-map)
+              (define-key js2-mode-map [menu-bar Javascript] nil)
+              (defun js2--imenu-around (do-it name)
+                "Don't create a menu from js2-mode"
+                (unless (string-equal name "IM-Javascript-IDE")
+                  (do-it name)))
+              (advice-add 'imenu-add-to-menubar :around #'js2--imenu-around)
               (setq js2-skip-preprocessor-directives t)
               (defun ap/javascript-setup ()
                 (auto-indent-mode -1))
@@ -2032,15 +2071,6 @@ nice, when I remember to use it.
 
 #+END_SRC
 
-#+BEGIN_SRC emacs-lisp
-  (with-eval-after-load 'eshell
-    (use-package esh-buf-stack
-      :init (progn
-              (add-hook 'eshell-load-hook (lambda ()
-                                            (setup-eshell-buf-stack)
-                                            (bind-key "M-q" #'eshell-push-command eshell-mode-map))))))
-#+END_SRC
-
 *** Shells
 
 #+BEGIN_SRC emacs-lisp