]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el: define setq-local and defvar-local unless defined
authorOleh Krehel <ohwoeowho@gmail.com>
Thu, 3 Mar 2016 11:06:33 +0000 (12:06 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Thu, 3 Mar 2016 11:06:33 +0000 (12:06 +0100)
Fixes #415

With this commit, ivy works on emacs-24.2.

counsel.el
ivy.el

index 6cca45c7d10308d63836de4115a6dfac6cd28156..0d062c1c2eb87a35632df9e133a893ae712fb02c 100644 (file)
@@ -1189,7 +1189,7 @@ INITIAL-INPUT can be given as the initial minibuffer input."
   "Format string to use in `cousel-ag-function' to construct the
 command. %S will be replaced by the regex string. The default is
 \"ag --vimgrep %S\"."
-  :type 'stringp
+  :type 'string
   :group 'ivy)
 
 (defun counsel-ag-function (string)
diff --git a/ivy.el b/ivy.el
index 9d79617c4f72e4880f43a14d08e0027a9842eaf6..60c20a6cdb81687c162584ed5c520bb68f7c990f 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -387,6 +387,18 @@ When non-nil, it should contain at least one %d.")
 
 (defvar Info-current-file)
 
+(eval-and-compile
+  (unless (fboundp 'defvar-local)
+    (defmacro defvar-local (var val &optional docstring)
+      "Define VAR as a buffer-local variable with default value VAL."
+      (declare (debug defvar) (doc-string 3))
+      (list 'progn (list 'defvar var val docstring)
+            (list 'make-variable-buffer-local (list 'quote var)))))
+  (unless (fboundp 'setq-local)
+    (defmacro setq-local (var val)
+      "Set variable VAR to value VAL in current buffer."
+      (list 'set (list 'make-local-variable (list 'quote var)) val))))
+
 (defmacro ivy-quit-and-run (&rest body)
   "Quit the minibuffer and run BODY afterwards."
   `(progn