首页 > 中级, 其他 > GNU Emacs的终极扩展管理工具 — el-get

GNU Emacs的终极扩展管理工具 — el-get

2011年1月21日 ahei 发表评论 阅读评论

作者: Nick Qi

Let’s el-get together

通常我们在配置GNU Emacs的时候,都会安装一些第三方的lisp扩展来让GNU Emacs用起来更顺手,但是这些第三方lisp扩展的安装、升级和配置的方法各异,通常我们需要使用多种完全不同管理方式的lisp扩展(http直接下载,发行版包管理器下载,版本控制器下载等)。这样我们升级或者迁移的时候就可能会遇到各种麻烦。

GNU Emacs一直以来都缺少一个统一的第三方lisp扩展管理器,GNU XEmacs与GNU Emacs的一个区别就是它有一个统一的第三方包管理工具。这其中的原因主要是因为GNU Emacs是GNU Project的一个重要代表,它要求随它发行的所有lisp都要作者签名用GPL授权给FSF,但是并不是所有的作者都支持GPL,而且这个过程给第三方贡献增加了不少阻碍。所以当时就有一批开发者开发了GNU XEmacs。所以GNU Emacs一直到现在也没有引入官方的扩展管理工具(指的是当前的稳定版本,ELPA已经被合并到当前的开发分支了)。

当前第三方包管理方法

  • emacswiki有auto-install.el之类的管理工具
  • linux发行版的包管理(如debian的lisp包)
  • tromey写的package.el
  • 手工使用git之类的版本控制工具来管理lisp扩展
  • 直接下载

当前这些方法的不足之处

  • elpa可以管理当前大多数第三方扩展,但是仍然有很多不在里面
  • 手工管理,升级太麻烦,迁移也不方便
  • linux发行版的包管理,通常你用不了最新的扩展,而且迁移也挺麻烦
  • 开发分支的ELPA,不要认为GNU Emacs会放弃原来的授权方式,要进入官方ELPA估计和现在没有什么区别,仍然有很多作者不会把自己的代码交给FSF。不过也会有第三方ELPA。

el-get华丽登场

el-get简介

  • el-get能够透明的管理各种来源的第三方扩展(不管你是通过linux发行版获取,还是直接下载还是通过git等版本控制器获取的)
  • el-get能够安装,升级和移除它管理的第三方扩展
  • el-get支持安装后的初始化操作,支持hook操作
  • el-get支持扩展包man和info的安装,安装好后,你可以直接C-h i查看info
  • el-get的源描述文件(recipe)超级简单,可以轻松添加自己的扩展源
  • el-get支持异步和同步安装和初始化
  • el-get支持ELPA中的所有package安装,ELPA是它的一种安装方法。。。

安装el-get

el-get的作者参考和ELPA的package.el的做法,使得el-get的安装非常简单:

;; So the idea is that you copy/paste this code into your *scratch* buffer,
;; hit C-j, and you have a working el-get.
(url-retrieve
 "https://github.com/dimitri/el-get/raw/master/el-get-install.el"
 (lambda (s)
   (end-of-buffer)
   (eval-print-last-sexp)))

复制上面的代码到scratch中,移动光标到最后,按下C-j然后就可坐等安装完成了。

使用el-get

el-get的作者是debian developer,所以el-get有深深的apt-get烙印。其实我还觉得el-get很有gentoo portage的影子,直接描诉扩展包地址,然后直接下载安装。

安装扩展

接下来就是最激动人心的时刻了,让我们先用magitpackageauto-complete来演示el-get的几个功能。

对于el-get本身,你需要给它手动指定load-path,因为启动的时候需要先载入它的功能,然后才能通过它来安装和管理其他lisp扩展。

当然在你刚安装玩el-get还没有重启GNU Emacs之前,你是可以直接使用它的功能的。

(setq el-get-sources
      '(el-get
      package
      auto-complete
      (:name magit
      :after (lambda () (global-set-key (kbd "C-x C-z") 'magit-status))))
      )
(el-get)

复制上面的代码到scratchbuffer,光标移动到buffer最后,键入C-j执行lisp代码。这样el-get、package、auto-complete和magit就被安装到~/.emacs.d/el-get目录下了。而且magit包在安装好后还执行了一个按键绑定操作,同样你也可以在任何需要配置的扩展后面使用定制函数。

初始化扩展

el-get还可以帮助你方便的初始化GNU Emacs扩展,在每个source描诉的:after后面可以放上自己的初始化函数,就像上面的magit那样。

通常(el-get)是异步执行的,所以如果你的扩展之间有依赖关系,它的初始化过程可能就会失败,所以为了方便大家写扩展包的初始化函数,作者给(el-get)增加了两种同步
方式:

  • (el-get ’sync) 完全同步,初始化的顺序严格按照el-get-sources中的顺序完成
  • (el-get ‘wait) 初始化过程异步,可以多个source同时初始化,但会等待整个初始化完成
交互式命令接口
  • el-get-cd 用dired切换到指定package的文件夹
  • el-get-install 根据用户设定的el-get-sources变量中的package来指定安装其中一个
  • el-get-update 升级指定的package
  • el-get-update-all 升级el-get-sources中的所有package,慎用
  • el-get-remove 删除已经安装而且在el-get-sources中的某个package
  • 加上C-u前缀的时候,el-get-install和el-get-remove是可以操作仓库中的所有package
定制和贡献
  • el-get支持本地扩展包仓库,参考el-get-recipe-path变量
  • 参考package描述文件的文档,对仓库中的package进行定制,可以改变来源、构建命令、 初始化函数。。。
  • 参考el-get-methods的文档,给el-get增加更多的安装来源支持
  • 贡献package描述文件(package recipe),添加你喜欢的package
  • 使用并报告bug,或者要求增加新的特性
  • 让更多的人用上el-get

资源和链接

分享家:Addthis中国
GD Star Rating
loading...
GNU Emacs的终极扩展管理工具 -- el-get, 7.5 out of 10 based on 51 ratings 该日志未加标签。
分类: 中级, 其他
  1. 2016年4月6日16:02 | #1

    James H. Averill Jr., trustee, Janet W. Averill Trust, James H. Averill Trust, James H. Averill, estate, and James H. Averill Jr. personal representative, to Jennifer Milikowsky, 36 Clapp Road, $1,775,000. louis vuitton outlet The euro rose to $1. p coach bags
    If they do not provide access to services, research local career transition firms to find one that fits your needs. cheap oakleys The team gave up 42.
    LaGrand also lost a bid for the 29th District Senate seat to incumbent Bill Hardiman in 2006. michael kors outlet online There was a guard-rail post with suspected blood on it. d http://www.raybansunglassesebay.us.com
    You contacted me on my Facebook account (www. coach outlet He found the subject was deceased.
    v Antiquities smuggling is an attractive crime. Ancient sculptures don’t set off airport metal detectors or attract drug-sniffing dogs. And until recently, the penalties for trafficking artifacts were relatively minor. “The U.S. government looked at it as a white-collar crime, if a crime at all,” Davis said. “But it doesn’t start with art dealers and auction houses. It starts with very bad people like ISIS and the Khmer Rouge.” coach online store Exports dropped 2. http://www.raybansunglassesebay.us.com
    if not today, then tomorrow. ray ban sunglasses The defending Stanley Cup champions are in big trouble in the Western Conference finals, down 3-1 to the rolling Los Angeles Kings. http://www.michaelkorshandbagsbuy.us.com
    The rugged scenery and wild, uncultivated appeal of Cornwall evoke the feeling of approaching the end of the world (and many natives would say it’s exactly that). The last native speaker of the Cornish language probably died in the late 1700s, but local pride is still strong. The welcome sign at the county border is in that old Celtic language people used to speak around here (as well as English). And, locals claim, had the Scots said yes to their recent referendum for independence, there would have been rumbling for greater autonomy here in this proud corner of Britain. michael kors outlet online As far as you’re concerned, complaining is a red flag. h michael kors bags
    Bernie Sanders at a rally in Kalamazoo, Michigan, echoed his pledged to keep citizens safe from mass shootings, much like the incident that occurred in the city last month when an Uber driver was charged with fatally shooting six people and injuring two others. coach outlet online He had to adjust to new coach Gary Kubiak’s run-based offense, to unrelenting health issues, and to questions about his character on his way to winning his second Super Bowl title.
    Pyongyang gets particularly upset about the annual U. cheap jordan shoes Marco Rubio to discredit the billionaire businessman.
    “The concept is to bring a team of doctors to help patients and family members understand the new diagnosis, help answer any questions and develop a treatment plan,” he said. nfl jerseys Although I do wish you would have let me quit piano because all I could play was ‘Music Box Dancer’ after 7 years of lessons.
    She has been a committed Gavilan employee for over 10 years and handles challenging situations with grace, composure and professionalism. http://www.coachoutletstoreonline.me McClendon, 56, started out as a landman, someone who calls and knocks on the doors of mineral rights owners about letting oil and gas companies drill under their land.
    d “It’s more topping based (than regular pizza). louis vuitton outlet LIVERPOOL, England (AP) Leicester strengthened its position atop the Premier League without even playing on Wednesday, after its three main title rivals all lost to cap another unpredictable round in England’s top division.
    Busch Gardens Williamsburg in Virginia unveils a half-mile-long indoor-outdoor coaster called Verbolten. http://www.coachfactorysoutlet.com More to the point, the form is valid without such proof and Arizona cannot refuse to let those who use it vote. c http://o.storeonlinecc.com
    avnet. cheap louis vuitton bags The Lost Our Home Pet Foundation has numerous cats and dogs available for adoption.
    e The storm is expected to produce four to eight inches of rain over San Salvador and Rum Cay through Thursday morning. Isolated rainfall amounts of 12 inches are possible. michael kors handbags Create It With 3D printer hobbyist Alan Thomason, 5 p. e
    Adam Wollner, staff correspondent for National Journal Hotline, discussed the campaign with Capital Insider coach factory outlet 3 meeting. ray ban sunglasses
    Walter E. Gazda Jr. to Manasa LLC, 109 Church St., $270,000. louis vuitton outlet Second Friday Art Night with Lucky 13, 58 p. q http://www.cheapjordanshoes.us.org
    Vets say pups who have not been fully vaccinated or received regular booster shots should avoid other dogs, and especially dog parks. coach outlet store WarriorsChase Budinger, Pacers: 8 points, 2 rebounds and 1 assist in 13 minutes vs.
    — I’m comfortable saying this was the most complete offensive outing of Smart’s career. In the post, off the bounce, from the perimeter, he did it all for Boston. And he limited Westbrook. And he did this: cheap michael kors bags The television broadcast has also enticed some to attend the church in person and become members. t http://www.louisvuittonhandbags.us.org
    He’s in an insane asylum in California right now. michael kors outlet Arizona scored three runs in the fifth inning to break a 2-2 tie, highlighted by Castillo’s solo shot with two outs.

    [回复]

  2. 2016年4月7日08:28 | #2

    “These brand-awareness efforts appear to be helping, particularly with the brand’s reach to the younger generation.” michael kors bags The task was created by a scheduling quirk brought on by the Sun Belt’s 11team alignment this year. m michael kors outlet online
    Gallardo, who is 102-75 with a 3. http://www.michaelkorshandbagsbuy.us.com 8 per game.
    LAKELAND, Fla. — Justin Upton’s slow to start to spring may have just took a turn for the worse. coach outlet online FILE – In this April 23, 2010 photo, best-selling author Neil Gaiman, 49, poses in his writing gazebo at his home in western Wisconsin. s oakley glasses
    The CRTC does not prefer one approach over another. coach outlet store If we are going to make meaningful and effective changes to our education system, we need Doug as our next governor.
    v The outcome of the election, however, may have turned more on Vitter’s weaknesses than Edwards’ appeal. The senator’s years-old prostitution scandal and difficult relationships with several Republicans in the state proved to be too much to overcome. Vitter has had “high negatives” in political polling for years — meaning many voters have an unfavorable view of him — but that hadn’t kept him from winning campaigns — until now. http://www.michaelkorshandbagsoutletup.us.com “There it is!” someone shouted and a round of applause followed as the single pup came into the world on a large outcropping of rock amid a smattering of rain. coach outlet
    Mike Jackson, chairman and chief executive officer, AutoNation, Inc. michael kors bags Here on a flagship carrier is the best place to see it, because naval war today is largely air war based on these big fighting ladies. http://www.louisvuittonhandbagsbuy.co.uk
    They have an excellent resume, including two victories over teams from the upper level Football Bowl Subdivision. One was over Washington State, a Pac-12 bowl team. ray ban sunglasses outlet Gamble said she wasn’t sure she was near a tripledouble when she went to the bench with a 7549 lead. u michael kors outlet
    We hope the results will be informative to people and organizations who are concerned about the views and opinions of over 38 million African Americans represented by this statistically valid survey. coach handbags Starting in the 1950s, Saudi Arabia went through rapid industrialization and needed labor, said Nassar, the UA professor.
    “Are you awake, Edie?” “Well, I am now,” was the swift reply. ray ban sunglasses Global jitters send mortgage rates up
    The Yahoo Services is provided for informational purposes only, and no Content included in the Yahoo Services is intended for trading or investing purposes. http://www.coachhandbags.com.co Greg Furrier, with Picor, represented the landlord, and Jon Barger, with Tucson Business Investments, represented the tenant.
    A real simple change is to include more whole grains in our diets. http://www.michaelkors.us.org based think tank.
    e Melt the chocolate chips in a microwave safe bowl for 2 minutes on medium power, stirring every 30 seconds, until melted. http://www.cheapjordanshoes.us.org “Many left behind messages of their own on sheets of paper on long tables in a courtyard near the entrance.
    For the 21-and-older crowd, they can enjoy “Blue Milk” and “Yoda Tea” at the FatCats’ full service bar. coach outlet Why don t you like this ad ?It s offensive to meI keep seeing thisIt s not relevant to meSomething elseDoneTrendingClassic American restaurant chains are disappearing into oblivionBusiness InsiderPhotosPhotos of the day – March 6, 2016Yahoo NewsScientist Reveals A Major Lie About Heart HealthThank you for your feedbackWe ll review and make changes needed. f louis vuitton outlet
    I have a ruby red grapefruit tree in my patio. ray ban sunglasses outlet In the past 25 years, the non-profit organization has listed 234 sites.
    e On April 20, Run Warren Run is holding an event in New York featuring Harvard law professor Lawrence Lessig, Democratic activist Van Jones and Zephyr Teachout, who mounted a surprise challenge to New York Democratic Gov. Andrew Cuomo as a member of the Working Families Party. http://www.cheapjordanshoes.us.org As voters went to the polls Tuesday, Clinton spent the morning campaigning at Avalon International Breads in Detroit. b
    The panel will be monitored by Bruce Brockman, the head of theUniversity of Arizona Media and Theater School. http://www.coachfactorysoutlet.com TSO go-to guest pops conductor Albert-George Schram returns to the podium. oakley glasses
    The shows featured in the upcoming 2015-16 season are: coach outlet online “So are we declaring victory? Not even close. w coach outlet store
    But not one helped Green. michael kors bags “And I’m my own welcoming committee,” said De Grazia.
    Leach has two children with Avery, a stepson, and 11 grandchildren. coach outlet online Being smart about it e cheap louis vuitton bags
    A man and a woman were in the vehicle that was shot at by people in another vehicle who were attempting to get them to roll down the windows to talk, Lucas said. louis vuitton outlet Vice President should start from where the real crime is, which is the Israeli occupation and Israeli colonial settlement, because the beginning is here for those who want peace in the Middle East,” an Abbas aide, Nabil Shaath, told The Associated Press.

    [回复]

  3. 2017年3月30日12:04 | #3

    I’m excited to find this website. I need to to thank you for
    your time for this wonderful read!! I definitely really liked every bit of it and i also have you book-marked to see new things in your blog.

    [回复]

评论分页
1 2 3 41801
  1. 2013年9月28日12:48 | #1
:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: