Spotted this with a general search for PickupSpell. It's in the SpellBookFrame.lua file from the new API files you can download from the wow site.
PickupSpellBookItem(slot, SpellBookFrame.bookType);
Here is the whole function in its entirety.
Code:
function SpellButton_OnModifiedClick(self, button)
local slot = SpellBook_GetSpellBookSlot(self);
if ( slot > MAX_SPELLS ) then
return;
end
if ( IsModifiedClick("CHATLINK") ) then
if ( MacroFrame and MacroFrame:IsShown() ) then
local spellName, subSpellName = GetSpellBookItemName(slot, SpellBookFrame.bookType);
if ( spellName and not IsPassiveSpell(slot, SpellBookFrame.bookType) ) then
if ( subSpellName and (strlen(subSpellName) > 0) ) then
ChatEdit_InsertLink(spellName.."("..subSpellName..")");
else
ChatEdit_InsertLink(spellName);
end
end
return;
else
local spellLink, tradeSkillLink = GetSpellLink(slot, SpellBookFrame.bookType);
if ( tradeSkillLink ) then
ChatEdit_InsertLink(tradeSkillLink);
elseif ( spellLink ) then
ChatEdit_InsertLink(spellLink);
end
return;
end
end
if ( IsModifiedClick("PICKUPACTION") ) then
PickupSpellBookItem(slot, SpellBookFrame.bookType);
return;
end
if ( IsModifiedClick("SELFCAST") ) then
CastSpell(slot, SpellBookFrame.bookType, true);
SpellButton_UpdateSelection(self);
return;
end
end