On Thu, Nov 20, 2003 at 11:27:02AM -0500, Andrew J. Korty wrote:
> Is there a pre-defined way to switch to a given frame with a key-press?
> I'd like to number my frames and visit them by number (e.g., Alt-1
> through Alt-5).
For the stable version there should somewhere be a patch that adds
shortcuts. In the development branch it is quite easy to write a
few functions to implement the keys although there won't be any
extra frame decorations.
local bookmarks={}
function set_bookmark(bm, frame)
bookmarks[bm]=frame
end
local goto_bookmark(bm)
if bookmarks[bm] then
bookmarks[bm]:goto()
end
end
global_bindings{
submap(DEFAULT_MOD.."comma", {
kpress("1", function() goto_bookmark(1) end),
-- etc.
}),
}
genframe_bindings{
submap(DEFAULT_MOD.."period", {
kpress("1", function(frame) set_bookmark(1, frame) end),
-- etc.
}),
}
One could also write a loop to create all the bindings with less code.
I haven't tried the code, as usual.
--
Tuomo