Commit afeaed33 authored by Syohei YOSHIDA's avatar Syohei YOSHIDA

Merge branch 'master' into use-cl-lib

Conflicts:
	popup.el
parents 180516e0 a49ffd06
......@@ -789,6 +789,16 @@ KEYMAP is a keymap that will be put on the popup contents."
(setq hidden nil))))
hidden))
(defun popup-jump (popup cursor)
"Jump to a position specified by CURSOR of POPUP and draw."
(let ((scroll-top (popup-scroll-top popup)))
;; Do not change page as much as possible.
(unless (and (<= scroll-top cursor)
(< cursor (+ scroll-top (popup-height popup))))
(setf (popup-scroll-top popup) cursor))
(setf (popup-cursor popup) cursor)
(popup-draw popup)))
(defun popup-select (popup i)
"Select the item at I of POPUP and draw."
(setq i (+ i (popup-offset popup)))
......@@ -1238,6 +1248,7 @@ PROMPT is a prompt string when reading events during event loop."
symbol
parent
parent-offset
cursor
(keymap popup-menu-keymap)
(fallback 'popup-menu-fallback)
help-delay
......@@ -1304,7 +1315,9 @@ isearch canceled. The arguments is whole filtered list of items."
(unwind-protect
(progn
(popup-set-list menu list)
(popup-draw menu)
(if cursor
(popup-jump menu cursor)
(popup-draw menu))
(if nowait
menu
(popup-menu-event-loop menu keymap fallback
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment