mirror of
https://github.com/abo-abo/avy.git
synced 2026-02-04 06:42:26 +00:00
avy.el: Fix linum-related compile warnings
This commit is contained in:
27
avy.el
27
avy.el
@@ -1204,6 +1204,22 @@ Which one depends on variable `subword-mode'."
|
|||||||
(when (> (length str) 1)
|
(when (> (length str) 1)
|
||||||
(set-text-properties 0 1 '(face avy-lead-face-0) str))
|
(set-text-properties 0 1 '(face avy-lead-face-0) str))
|
||||||
(push str line-list))))
|
(push str line-list))))
|
||||||
|
(nreverse line-list)))
|
||||||
|
|
||||||
|
(defvar linum-available)
|
||||||
|
(defvar linum-overlays)
|
||||||
|
(defvar linum-format)
|
||||||
|
(declare-function linum--face-width "linum")
|
||||||
|
|
||||||
|
(define-minor-mode avy-linum-mode
|
||||||
|
"Minor mode that uses avy hints for `linum-mode'."
|
||||||
|
:group 'avy
|
||||||
|
(if avy-linum-mode
|
||||||
|
(progn
|
||||||
|
(require 'linum)
|
||||||
|
(advice-add 'linum-update-window :around 'avy--linum-update-window)
|
||||||
|
(linum-mode 1))
|
||||||
|
(advice-remove 'linum-update-window 'avy--linum-update-window)
|
||||||
(linum-mode -1)))
|
(linum-mode -1)))
|
||||||
|
|
||||||
(defun avy--linum-update-window (_ win)
|
(defun avy--linum-update-window (_ win)
|
||||||
@@ -1256,17 +1272,6 @@ Which one depends on variable `subword-mode'."
|
|||||||
(setq width (ceiling
|
(setq width (ceiling
|
||||||
(/ (* width 1.0 (linum--face-width 'linum))
|
(/ (* width 1.0 (linum--face-width 'linum))
|
||||||
(frame-char-width)))))
|
(frame-char-width)))))
|
||||||
(set-window-margins win width (cdr (window-margins win)))))
|
|
||||||
|
|
||||||
(define-minor-mode avy-linum-mode
|
|
||||||
"Minor mode that uses avy hints for `linum-mode'."
|
|
||||||
:group 'avy
|
|
||||||
(if avy-linum-mode
|
|
||||||
(progn
|
|
||||||
(require 'linum)
|
|
||||||
(advice-add 'linum-update-window :around 'avy--linum-update-window)
|
|
||||||
(linum-mode 1))
|
|
||||||
(advice-remove 'linum-update-window 'avy--linum-update-window)
|
|
||||||
(set-window-margins win width (cdr (window-margins win)))))
|
(set-window-margins win width (cdr (window-margins win)))))
|
||||||
|
|
||||||
(defun avy--line (&optional arg beg end)
|
(defun avy--line (&optional arg beg end)
|
||||||
|
|||||||
Reference in New Issue
Block a user