Skip to content

Commit

Permalink
avoid conflict with hydra's lv.el
Browse files Browse the repository at this point in the history
  • Loading branch information
edwintorok authored and syl20bnr committed May 28, 2015
1 parent 7f90d99 commit b06b52d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions core/core-micro-state.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(require 'lv)
(require 'corelv)

(defun spacemacs/defface-micro-state-faces ()
"Define faces for micro-states."
Expand Down Expand Up @@ -91,7 +91,7 @@ used."
(doc (spacemacs/mplist-get props :doc))
(persistent (plist-get props :persistent))
(disable-leader (plist-get props :disable-evil-leader))
(msg-func (if (plist-get props :use-minibuffer) 'message 'lv-message))
(msg-func (if (plist-get props :use-minibuffer) 'message 'corelv-message))
(exec-binding (plist-get props :execute-binding-on-enter))
(on-enter (spacemacs/mplist-get props :on-enter))
(on-exit (spacemacs/mplist-get props :on-exit))
Expand Down Expand Up @@ -241,9 +241,9 @@ pressed)."

(defun spacemacs//micro-state-close-window ()
"Close micro-state help window."
(when (window-live-p lv-wnd)
(let ((buf (window-buffer lv-wnd)))
(delete-window lv-wnd)
(when (window-live-p corelv-wnd)
(let ((buf (window-buffer corelv-wnd)))
(delete-window corelv-wnd)
(kill-buffer buf))))

(provide 'core-micro-state)
24 changes: 12 additions & 12 deletions core/libs/lv.el → core/libs/corelv.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;;; lv.el --- Other echo area
;;; corelv.el --- Other echo area

;; Copyright (C) 2015 Free Software Foundation, Inc.

Expand All @@ -21,7 +21,7 @@

;;; Commentary:
;;
;; This package provides `lv-message' intended to be used in place of
;; This package provides `corelv-message' intended to be used in place of
;; `message' when semi-permanent hints are needed, in order to not
;; interfere with Echo Area.
;;
Expand All @@ -33,16 +33,16 @@

;;; Code:

(defvar lv-wnd nil
(defvar corelv-wnd nil
"Holds the current LV window.")

(defun lv-window ()
(defun corelv-window ()
"Ensure that LV window is live and return it."
(if (window-live-p lv-wnd)
lv-wnd
(if (window-live-p corelv-wnd)
corelv-wnd
(let ((ori (selected-window))
buf)
(prog1 (setq lv-wnd
(prog1 (setq corelv-wnd
(select-window
(split-window
(frame-root-window) -1 'below)))
Expand All @@ -52,17 +52,17 @@
(setq truncate-lines nil)
(setq mode-line-format nil)
(setq cursor-type nil)
(set-window-dedicated-p lv-wnd t))
(set-window-dedicated-p corelv-wnd t))
(select-window ori)))))

(defun lv-message (format-string &rest args)
(defun corelv-message (format-string &rest args)
"Set LV window contents to (`format' FORMAT-STRING ARGS)."
(let ((ori (selected-window))
(str (apply #'format format-string args))
(golden-ratio (when (boundp 'golden-ratio-mode) golden-ratio-mode))
deactivate-mark)
(when (bound-and-true-p golden-ratio-mode) (golden-ratio-mode -1))
(select-window (lv-window))
(select-window (corelv-window))
(when golden-ratio (golden-ratio-mode))
(unless (string= (buffer-string) str)
(delete-region (point-min) (point-max))
Expand All @@ -71,6 +71,6 @@
(goto-char (point-min)) (end-of-line)
(select-window ori)))

(provide 'lv)
(provide 'corelv)

;;; lv.el ends here
;;; corelv.el ends here

0 comments on commit b06b52d

Please sign in to comment.