help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shortcut to compile "highlighted Text/Tag"


From: Rami A
Subject: Re: Shortcut to compile "highlighted Text/Tag"
Date: Fri, 19 Apr 2013 21:36:27 -0700 (PDT)
User-agent: G2/1.0

Hi Bob,
Thanks for taking the time responding to me thread.
Please see inline.
> 
> > I tried grep as you suggested and it did actually work.
> 
> > However, it is not as usable as gid.
> 
> > When using grep the results are shown as a non-interactive buffer.
> 
> 
> 
> Well...  It is grep, not gid.
Sure. I was pointing out why I am leaning towards using gid.
> 
> 
> 
> > When using gid and mkid method I get a buffer with all results,
> 
> > files the token is found in and line numbers. More, I can click on
> 
> > each results and it will take me to that file and line directly.
> 
> 
> 
> I am seeing some strange things in this thread.  Let me comment.
> 
> 
> 
>   Rami> Symbol's function definition is void: gid
> 
>   Dan> Sounds like you don't have gid.el installed.
> 
>   Rami> I agree, I have not installed gid.el.
> 
> 
> 
> That seems like a problem.  In order to use it you must install it.
> 
> You talked as if you had installed it.  You talked about binding it to
> 
> a function key.  We would assume that you had loaded it.
I disagree. I don't think I was talking as if I installed it.
All I did have in my dotemacs are the following lines:
(global-set-key [f4]        'compile)
(setq compile-command "gid ")

So when pressing F4 I would be able to type the tag I am looking for and it 
will compile and show me the results. "Of course after I have build the ID file 
using mkid".
I am not sure if my unix environment somehow grabbed gid.el
But I have no other subfolders that contain any *.el packages.
My intention was to always have everything self contained in the dotemacs file.


> 
> 
> 
> Dan really tried hard to help at that point.  
And I truly appreciate his help :)
>Since you didn't want to
> 
> use gid he offered an alternative.  He suggested C-u M-x grep.  Giving
> 
> grep an argument has it pre-fill in the word at that point.  I would
> 
> also point out M-x lgrep is similar but slightly different.  The lgrep
> 
> command prompts separately for the pattern to search for and the files
> 
> to search for and tries to be intelligent about defaulting to the
> 
> things you would want in the context called.  Try lgrep.
Will try it and study more about it.
> 
> 
> 
> But then after telling us yesterday that you didn't want to load gid
It was not about "loading gid" but more of including all the bits and pieces 
needed in my dotemacs file and not use a secondary set of files "*.el"
> 
> today you are back talking about how good it is.  If you want to use
> 
> gid then you *must* load it.  

Again I am very new to lisp and not sure how in the world it is been loaded.

>There is no alternative.  The bits will
> 
> not magically appear.  If you want to use it then you must load it.
> 
But quiet honestly. I don't think there is anything to load for what I am 
asking for to work.
If you added the lined I mentioned in your dotemacs file and executed "mkid" in 
the top level of the source code, you will be able to gid for these tokens you 
are searching for.
> 
> 
> And then there is Kevin Rodgers who yesterday made a great suggestion
> 
> and the voluteer of some lisp code to do what you wanted.  I think you
> 
> didn't see it.
> 
> 
> 
>   http://lists.gnu.org/archive/html/help-gnu-emacs/2013-04/msg00374.html
> 
> 
> 
> That code grabs the word at the point just as you asked for and then
> 
> calls the compile command.  It seems to me that it wouild be perfect.
> 
> (It would be nice if it used that word as the default and prompted
> 
> like C-u M-x grep does.  But I it was a nice gift as it is.)
> 
> 
> 
> Bob

I actually finally figured it out after staying late at work on a Friday night 
:/

In the code that I grabbed from gid.el and included in my dotemacs, I only 
changed the following line:

  (interactive (list (word-around-point)))

Now all works as intended.
I now have: 
(global-set-key [f4]        'gid)

Now when pressing F4, it will search for the token that the cursor is pointing 
at, without the need for confirmation.

R



reply via email to

[Prev in Thread] Current Thread [Next in Thread]