Skip to content

Commit

Permalink
Fix compile warn
Browse files Browse the repository at this point in the history
  • Loading branch information
tumashu committed Feb 24, 2016
1 parent f83550f commit 19eece1
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions switch-window.el
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,19 @@ from-current-window is not nil"
(buf (get-buffer-create
(format " *%s: %s*" label (buffer-name (window-buffer win))))))
(with-current-buffer buf
;; increase to maximum switchw-increase
(when (fboundp 'text-scale-increase)
(text-scale-increase switchw-increase))
;; insert the label, with a hack to support ancient emacs
(if (fboundp 'text-scale-increase)
(insert label)
(insert (propertize label 'face
(list :height (* (* h switchw-increase)
(if (> w h) 2 1)))))))
(set-window-buffer win buf)
buf))
(let ((w (window-width win))
(h (window-body-height win)))
;; increase to maximum switchw-increase
(when (fboundp 'text-scale-increase)
(text-scale-increase switchw-increase))
;; insert the label, with a hack to support ancient emacs
(if (fboundp 'text-scale-increase)
(insert label)
(insert (propertize label 'face
(list :height (* (* h switchw-increase)
(if (> w h) 2 1)))))))
(set-window-buffer win buf)
buf)))

(defun switchw--apply-to-window-index (action n message-format)
"apply action to given window index, target is the place of the
Expand All @@ -181,7 +183,9 @@ from-current-window is not nil"
(defun switchw--restore-eobp (eobp-window-list)
"For each window in EOBP-WINDOW-LIST move the point to end of buffer."
(cl-loop for win in eobp-window-list
do (with-current-buffer (window-buffer win) (end-of-buffer))))
do (with-current-buffer
(window-buffer win)
(goto-char (point-max)))))

;;;###autoload
(defun switchw-delete-window ()
Expand Down Expand Up @@ -270,7 +274,7 @@ ask user for the window to select"
(unless (symbolp input)
(let* ((wchars (mapcar 'string-to-char
(switchw--enumerate)))
(pos (position input wchars)))
(pos (cl-position input wchars)))
(if pos
(setq key (1+ pos))
(progn
Expand Down

0 comments on commit 19eece1

Please sign in to comment.