all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rami A <rami.ammari@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Shortcut to compile "highlighted Text/Tag"
Date: Fri, 19 Apr 2013 21:36:27 -0700 (PDT)	[thread overview]
Message-ID: <c0755dd9-1cb4-4e4c-8d5c-06f10d366847@googlegroups.com> (raw)
In-Reply-To: <mailman.24358.1366430691.855.help-gnu-emacs@gnu.org>

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



  parent reply	other threads:[~2013-04-20  4:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17 17:37 Shortcut to compile "highlighted Text/Tag" Rami A
2013-04-17 19:47 ` Dan Espen
2013-04-18 13:28 ` Kevin Rodgers
     [not found] ` <mailman.24297.1366291667.855.help-gnu-emacs@gnu.org>
2013-04-19 20:46   ` Rami A
2013-04-19 21:07     ` Dan Espen
2013-04-19 21:19       ` Rami A
2013-04-19 21:29         ` Dan Espen
2013-04-19 21:47           ` Rami A
2013-04-19 22:12             ` Dan Espen
2013-04-19 22:24               ` Rami A
2013-04-20  4:04                 ` Bob Proulx
     [not found]                 ` <mailman.24358.1366430691.855.help-gnu-emacs@gnu.org>
2013-04-20  4:36                   ` Rami A [this message]
2013-04-20  5:10                     ` Bob Proulx
2013-04-19 23:25               ` Rami A
2013-04-19 23:49                 ` Dan Espen
2013-04-19 23:55                   ` Rami A
2013-04-20  0:10                     ` Dan Espen
2013-04-20  1:44                       ` Rami A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0755dd9-1cb4-4e4c-8d5c-06f10d366847@googlegroups.com \
    --to=rami.ammari@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.