Skip to content

Commit

Permalink
make the pick-smallest-window functions work
Browse files Browse the repository at this point in the history
  • Loading branch information
jrockway committed Jun 29, 2011
1 parent 73e6b23 commit f853f10
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions eslide.el
Expand Up @@ -322,11 +322,18 @@ Argument END sdfasdf."
(with-current-buffer (eslide-show)
(text-scale-decrease 1)))

(defun eslide-minimize (list function)
"Return the element of LIST that FUNCTION makes smallest."
(caar (sort (mapcar (lambda (x) (cons x (funcall function x))) list)
(lambda (a b) (< (cdr a) (cdr b))))))

(defun eslide-narrowest-window (buffer)
(car (get-buffer-window-list buffer nil t))) ;;; XXX not really
(eslide-minimize (get-buffer-window-list buffer nil t)
#'window-width))

(defun eslide-shortest-window (buffer)
(car (get-buffer-window-list buffer nil t))) ;;; XXX not really
(eslide-minimize (get-buffer-window-list buffer nil t)
#'window-body-height))

(defun eslide-text-scale (size)
(text-scale-increase 0)
Expand Down

0 comments on commit f853f10

Please sign in to comment.