2011-05-04

[Emacs] 자동 TAGS 탐색?

예전에 Vim에서 tags 파일 경로를 부모 디렉토리들로 지정해서 자동으로 태그를 지정하는 방법을 포스팅 했던 적이 있다. 하지만 Emacs에서는 동일한 형태로 지정을 해서 사용하는게 안되었다. 이런 기능을 원했지만 검색으로 찾을 수는 없었다.

물론 Emacs도 tag file list를 지원하기 때문에 원하는 태그 파일 경로를 다수 지정해 줄 수 있다. 하지만 프로젝트가 생길 때 마다 설정을 추가해 주는건 너무나 귀찮은 일이다.

그래서 만들었다;;;

https://github.com/seorenn/dotemacs/blob/master/renn-explorefile.el

우선 elisp을 공부하는 겸 해서 만들었기 때문에 완벽하다고도 할 수 없고, 지저분하기도 하고, 일부 elisp에서 지원될지도 모를 함수를 따로 구현해 버린 쓸 데 없는 수고를 했을 수도 있다는 점을 밝힌다. 무엇보다 버그가 있을 것 같다. (T _ T)

이 코드에서 중요한 것은 explore-file이라는 함수로, 특정 파일을 현재 버퍼(파일)의 디렉토리에서 부터 상위 디렉토리로 차례차례로 옮겨가며 찾는 함수다. home-only라는 패러미터는 사용자의 홈디렉토리를 벗어나지 않기를 원한다면 nil이외의 값을 넣으면 된다.

최종적으로 사용하게 되는 explore-tags 라는 함수는 explore-file 함수를 호출해 TAGS 파일을 찾도록 한다. 그리고 찾은 경로를 특별한 리스트에 보관하는데 중복으로 태그를 찾지 않도록 하기 위함이다. 딱히 할 필요가 있을런지는 잘 모르겠지만.

그리고 explore-tag의 최종 단계에서 visit-tags-table 함수를 통해 찾아낸 TAGS파일을 등록시키는 방식으로 동작한다.

가장 마지막 라인에 python-mode가 될 때 마다 호출되도록 한 코드를 주석처리 해 놨는데 일종의 예이다. 원하는 모드에 explore-tag 를 등록하면 될 것이다. 예를 들어 C코드에서 사용할 것이라면
(add-hook 'c-mode-hook 'explore-tag)
이런 식으로 등록하면 될 것이다. 아마도...

댓글 38개:

  1. It's a shame you don't have a donate button! I'd definitely donate to

    this fantastic blog! I suppose for now i'll settle for

    bookmarking and adding your RSS feed to my Google account.
    I look forward to new updates and will share this
    site with my Facebook group. Chat soon!
    my website :: http://www.nkos.org

    답글삭제
  2. Do you have a spam problem on this website; I also am
    a blogger, and I was wondering your situation; we
    have developed some nice procedures and we

    are looking to trade techniques with others, be sure


    to shoot me an e-mail if interested.
    Here is my web site :: http://k9grapevine.com/blogs/lainerose1972/

    답글삭제
  3. Thanks for your personal marvelous posting!
    I actually enjoyed reading it, you happen to be a great author.
    I will remember to bookmark your blog and will often come back down the road.
    I want to encourage you continue your great job, have a nice morning!
    Feel free to visit my web blog http://yvtxxfnck.chhk.forum.mythem.es

    답글삭제
  4. I enjoy you because of all your valuable effort on this blog.

    My aunt

    really loves making time for

    internet research and it's obvious why. Many of us learn all of the powerful tactic you

    offer precious items by means of

    your blog and as well

    boost

    response from visitors on the situation so our daughter is actually learning a lot. Enjoy the rest of

    the year. Your carrying out a good job.
    Also visit my web site : new spain jersey

    답글삭제
  5. Unquestionably imagine that which you stated. Your

    favourite reason appeared to be on the internet the

    simplest thing to remember of. I say to you, I certainly get annoyed even
    as people think about concerns that they just do not know about.
    You

    managed to hit the nail upon the highest and
    also defined out the entire thing with no need side effect ,

    people could take a signal. Will likely be again to get more.
    Thank you
    Visit my web site :: uvanni used cars

    답글삭제
  6. I like what you guys are usually up too. This

    type of clever work and exposure! Keep up the

    good works guys I've incorporated you guys to blogroll.
    Here is my web site : uk tv comp answers

    답글삭제
  7. Thanks a lot for giving everyone such a terrific possiblity to
    read critical reviews from this blog. It can be so beneficial
    plus full of a good time for me personally and my office

    co-workers to search your

    site minimum three times per week to read through the new issues you have.
    And definitely,

    I am just certainly

    astounded with the unique tips and hints served by you.
    Some 2 ideas in this post are honestly the simplest we've ever had.
    My site: http://dlofxl.yqqtr.fcjp.iagmj.forum.mythem.es/ijruq/alarodia/bilateral/agalbanada/recedeva/imparidigitate/symbiotically

    답글삭제
  8. Hey, you used to write fantastic, but the last few posts have

    been kinda boring… I miss your tremendous writings. Past several posts are just
    a bit out of track! come on!
    Here is my blog post - prestijrealestate.com

    답글삭제
  9. I like the valuable information you provide in your

    articles. I’ll bookmark your weblog and check once more here


    frequently. I am slightly sure

    I will be told plenty of new stuff proper right

    here! Best of luck for the next!
    Stop by my website :: wwoof spain experiences

    답글삭제
  10. When I initially commented I clicked the "Notify me when new comments are added"
    checkbox and now each time a

    comment is added I get several e-mails with the same comment.
    Is there any way you can remove

    people from that service? Thank you!
    Also visit my web page ... rota spain naval base jobs

    답글삭제
  11. That is really attention-grabbing, You're a

    very professional blogger. I've joined your rss feed and sit up

    for searching for more of your

    wonderful post. Additionally, I have shared your web site in

    my social networks!
    Also see my web site > work keeps calling me

    답글삭제
  12. Today, I went to the beach with my kids. I found a sea shell and gave it to my 4 year

    old daughter and said "You can hear the ocean if you put this to your ear." She put the shell to her ear and

    screamed. There was a hermit crab inside and it pinched her ear.
    She never wants to go back! LoL I know this is

    completely off topic but I had to tell someone!
    My site :: Suggested Site

    답글삭제
  13. I think this is among the most significant information for me.
    And i'm glad

    reading your article. But wanna remark on few general things, The site style is

    ideal, the articles is really excellent : D. Good job, cheers
    My site ; cpr elche de la sierra

    답글삭제
  14. There are actually a number of details like that to take into
    consideration. That is a great point to convey up.
    I provide the ideas above as

    basic inspiration but clearly there are questions like the one you

    convey up the place the most important factor

    will likely be working in trustworthy good faith. I

    don?t know if greatest practices have emerged around things like that, but

    I'm positive that your job is clearly identified as a good game. Each girls and boys really feel the impact of just a second’s

    pleasure, for the remainder of their lives.
    Feel free to surf my web blog :: buying web property

    답글삭제
  15. Hey there, You have done a fantastic job. I will

    definitely digg it and personally recommend to my friends.
    I'm sure

    they'll be benefited from this site.
    Have a look at my website :: http://www.co-motion.com/index.php/member/35933

    답글삭제
  16. Thank you for the good writeup. It in fact was a amusement account it.
    Look advanced to far added

    agreeable from you! By the way, how could we
    communicate?
    Here is my web page :: gpcgmaro.bjjp.kaasuqhuk.llzoa.qypvthu.loqu.forum.mythem.es

    답글삭제
  17. Thank you for the good writeup. It in fact was a amusement account
    it. Look advanced to far added

    agreeable from you! By the way, how could we communicate?
    My web site > gpcgmaro.bjjp.kaasuqhuk.llzoa.qypvthu.loqu.forum.mythem.es

    답글삭제
  18. Very efficiently written story. It will be

    useful to anybody who employess it, including myself.



    Keep doing what you are doing - i will definitely read more posts.
    Feel free to surf my web-site ; spanish birds recipe czech

    답글삭제
  19. There are some interesting deadlines on this article however I don’t
    know if I see all of them middle to heart. There's some validity but I will take maintain opinion until I look into it

    further. Good article , thanks and we would like more! Added to FeedBurner as well
    Have a look at my weblog ; http://Sportyguy.info/2012/08/the-reality-we-need-better-facilities.html

    답글삭제
  20. I simply had to thank you so much once more.
    I'm not certain the

    things I could possibly have used without these basics shared by you concerning

    such a situation. It actually was a very difficult

    concern in my circumstances, nevertheless viewing

    your expert technique you processed it

    made me to leap for gladness. I am just thankful for

    the service and as well , wish

    you comprehend what a

    great job you were doing training some

    other people through the use of your website. Probably you have never met any of us.
    My blog post : work my benefit out

    답글삭제
  21. What i do not realize is actually how you're not really much more well-liked than

    you might be now. You are so intelligent. You realize therefore

    significantly relating to this subject, produced me personally consider it from numerous varied angles. Its like men and women aren't fascinated unless it’s one thing to

    do with Lady gaga! Your own stuffs great. Always maintain it up!
    My web site ; williamfusseyforeverleeds.blogspot.co.uk

    답글삭제
  22. I am continually invstigating online for articles that can assist me.
    Thank you!
    My webpage :: http://jaylordlosabia.blogspot.ru/

    답글삭제
  23. I'm truly enjoying the design and layout of your website. It's a very
    easy on the eyes which makes it

    much more enjoyable for me to come here and visit more
    often. Did you hire out a developer to create

    your theme? Superb work!
    Here is my weblog - property law honours

    답글삭제
  24. Terrific post however , I was

    wondering if you could write a litte more on this subject?
    I'd be very grateful if you

    could elaborate a little bit further. Kudos!
    Feel free to surf my blog ... real estate uganda africa

    답글삭제
  25. There are some interesting time limits on this article however I don’t know if I see all of them center to heart.
    There's some validity however I'll take maintain opinion until I look into it

    further. Good article , thanks and we want more!

    Added to FeedBurner as effectively
    Also see my site > mxh.langngoctien.Vn

    답글삭제
  26. Just about all of whatever you state happens to be astonishingly

    legitimate and it makes me wonder why I hadn't

    looked at this in this light before. This article really did

    switch the light on for me as far as this specific topic goes. However there is one

    particular factor I am not really too cozy with

    and while I try to reconcile that with the actual core

    idea of the position, allow me observe what all the

    rest of your subscribers have to say.Very well done.
    Also visit my web blog ... http://dateinitalia.com/index.php?do=/profile-1516/info/

    답글삭제
  27. wonderful points altogether, you simply won a

    emblem new reader. What could you recommend about your

    put up that you just made some days in the past?
    Any sure?
    Feel free to visit my web-site : socialcircle.Stock-options-picks.com

    답글삭제
  28. Thank you, I've just been searching for info about this topic for ages and yours is the best I've discovered till now.
    But, what about the

    bottom line? Are you sure about the source?
    Also see my page > http://ajgbfkn.pdyeswnm.ofnrkx.zxvfxd.vzapc.forum.mythem.es/

    답글삭제
  29. I am really enjoying the theme/design of your website.
    Do you ever run into any

    browser compatibility problems? A

    few of my blog visitors have complained
    about my website not working correctly

    in Explorer but looks great in Firefox. Do you have
    any suggestions to help fix this issue?
    Also visit my homepage :: http://Linksbang.com/general/탐방-경운출력회사-소다프린트-고급-디지털인쇄-새롭게-도전

    답글삭제
  30. We are a gaggle of volunteers and opening
    a new scheme in our community.

    Your web site provided us with useful info to work

    on. You have performed an impressive activity and our whole

    group will likely be thankful to

    you.
    Here is my homepage ; httpwww.spainguitarworld.com

    답글삭제
  31. I am curious to find out what blog system you
    have been using? I'm experiencing some small security issues with my latest site and I'd
    like to find something more secure. Do you have any

    suggestions?
    My website: http://vietsciences.Free.fr/

    답글삭제
  32. What’s Happening i am new to this, I stumbled upon this I've discovered It

    positively useful and it has helped me out loads. I'm hoping to contribute & help different customers
    like its aided me. Great

    job.
    Also visit my web blog ; http://brentthestatboy.blogspot.com/2006/11/wow-jeter-giambi-and-rod-sitting-in.html

    답글삭제
  33. Hello there, just became aware of your blog through Google, and found
    that it's really

    informative. I’m gonna watch out for brussels. I will appreciate if you continue

    this in future. Lots of people will be benefited from your writing. Cheers!
    Feel free to visit my blog ; http://Friendlyrvparks.com/user_detail.php?u=ndana

    답글삭제
  34. Very nice post. I just stumbled upon your blog and wished to say that
    I have really enjoyed surfing around your blog posts. In any case I will be subscribing to your

    rss feed and I hope you write again very soon!
    Feel free to surf my webpage ; http://rehmananwar.blogspot.com/

    답글삭제
  35. I do love the manner in which you have framed this issue and it really does offer me
    some fodder for consideration. However, from what I

    have experienced, I just

    hope when other feed-back pack on that people today continue to be

    on issue and don't start on a tirade associated with some other news of the day. Yet, thank you for this

    superb piece and while I

    can not really concur with this in totality, I value

    your viewpoint.
    Look at my blog post :: dqr property management

    답글삭제
  36. I do love the manner in which you have framed this issue and it really does
    offer me some fodder for consideration. However, from what
    I

    have experienced, I just

    hope when other feed-back pack on that people today continue to be

    on issue and don't start on a tirade associated with some other news of the day. Yet, thank you for this

    superb piece and while I

    can not really concur with this in totality, I value

    your viewpoint.
    my page > dqr property management

    답글삭제
  37. Thanks for another informative website. Where else could I get that type
    of

    info written in such a perfect way? I have a project that
    I'm just now working on,

    and I've been on the look out for such info.
    My blog post : authenticlinks.com

    답글삭제
  38. Do you have a spam problem on this site; I also am a blogger, and I was curious about your situation; many of us have developed some nice methods and we

    are looking to exchange strategies with other folks, please shoot me an e-mail if interested.
    my web site :: http://wiki.teilar.net/index.php?title=Rent_Luxury_Villa_In_Spain_-_Is_It_Feasible_To_Snow_Ski_In_Granada

    답글삭제