all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* xcscope setup
@ 2015-05-20 12:11 Timur Aydin
  2015-05-20 13:23 ` Doug Lewan
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Timur Aydin @ 2015-05-20 12:11 UTC (permalink / raw
  To: help-gnu-emacs

Hello,

I am trying to get xcscope to work with emacs version (GNU Emacs
25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.6)
 of 2014-12-29 on mail))

I have first installed the xcscope from the ELPA. Then, according to the
package documentation, I have added (cscope-setup) into my .emacs.el

But when I do that, emacs fails to start up with this error:

Warning (initialization): An error occurred while loading
`/home/ta/.emacs.el':

Symbol's function definition is void: cscope-setup

I played around with this for a while and finally got it to work by
adding (cscope-setup) into a c-initialization-hook:

(defun my-c-initialization-hook ()
  (cscope-setup)
)

(add-hook 'c-initialization-hook 'my-c-initialization-hook)

This seems to work correctly, but I haven't seen it done this way
anywhere. So, why isn't it working according to the documentation? And
why is the hook method working? And is this the proper way of this this?

Cheers,

-- 
Timur Aydin



^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: xcscope setup
  2015-05-20 12:11 xcscope setup Timur Aydin
@ 2015-05-20 13:23 ` Doug Lewan
  2015-05-20 14:52   ` Timur Aydin
  2015-05-20 16:47 ` Dmitry Gutov
  2015-05-21  2:25 ` Vaidheeswaran C
  2 siblings, 1 reply; 12+ messages in thread
From: Doug Lewan @ 2015-05-20 13:23 UTC (permalink / raw
  To: Timur Aydin, help-gnu-emacs@gnu.org

Do you have (require 'cscope) or (load-library "cscope") in your .emacs?

-- 
,Doug
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224 or ext 4335

The human brain is the most complex thing known to man, according to the human brain.

> -----Original Message-----
> On
> Behalf Of Timur Aydin
> Subject: xcscope setup
> 
> Hello,
> 
> I am trying to get xcscope to work with emacs version (GNU Emacs
> 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.6)
>  of 2014-12-29 on mail))
> 
> I have first installed the xcscope from the ELPA. Then, according to
> the
> package documentation, I have added (cscope-setup) into my .emacs.el
> 
> But when I do that, emacs fails to start up with this error:
> 
> Warning (initialization): An error occurred while loading
> `/home/ta/.emacs.el':
> 
> Symbol's function definition is void: cscope-setup
> 
> I played around with this for a while and finally got it to work by
> adding (cscope-setup) into a c-initialization-hook:
> 
> (defun my-c-initialization-hook ()
>   (cscope-setup)
> )
> 
> (add-hook 'c-initialization-hook 'my-c-initialization-hook)
> 
> This seems to work correctly, but I haven't seen it done this way
> anywhere. So, why isn't it working according to the documentation? And
> why is the hook method working? And is this the proper way of this
> this?
> 
> Cheers,
> 
> --
> Timur Aydin


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 13:23 ` Doug Lewan
@ 2015-05-20 14:52   ` Timur Aydin
  2015-05-20 15:03     ` Eli Zaretskii
  2015-05-20 15:04     ` Michael Heerdegen
  0 siblings, 2 replies; 12+ messages in thread
From: Timur Aydin @ 2015-05-20 14:52 UTC (permalink / raw
  To: Doug Lewan, help-gnu-emacs@gnu.org


On 05/20/2015 04:23 PM, Doug Lewan wrote:
> Do you have (require 'cscope) or (load-library "cscope") in your .emacs?
>
The xcscope documentation says that it isn't necessary to put "(require
'cscope)" into .emacs.el if cscope was installed as an ELPA package. If
I put that into.emacs.el anyway, it issues the following error:

Warning (initialization): An error occurred while loading
`/home/ta/.emacs.el':

File error: Cannot open load file, no such file or directory, cscope

-- 
Timur



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 14:52   ` Timur Aydin
@ 2015-05-20 15:03     ` Eli Zaretskii
  2015-05-20 16:38       ` Timur Aydin
  2015-05-20 15:04     ` Michael Heerdegen
  1 sibling, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2015-05-20 15:03 UTC (permalink / raw
  To: help-gnu-emacs

> Date: Wed, 20 May 2015 17:52:46 +0300
> From: Timur Aydin <ta@taydin.org>
> 
> 
> On 05/20/2015 04:23 PM, Doug Lewan wrote:
> > Do you have (require 'cscope) or (load-library "cscope") in your .emacs?
> >
> The xcscope documentation says that it isn't necessary to put "(require
> 'cscope)" into .emacs.el if cscope was installed as an ELPA package.

So that probably means you didn't install the package correctly.  A
correct installation should take care of 2 things that are necessary
for you to be able to call any function inside a package:

  . it should add the package directory to load-path
  . it should load the package, either by 'require' or by an explicit
    'load' (in the latter case, if it uses an absolute file name, it
    can avoid adding the directoy to load-path)

> If I put that into.emacs.el anyway, it issues the following error:
> 
> Warning (initialization): An error occurred while loading
> `/home/ta/.emacs.el':
> 
> File error: Cannot open load file, no such file or directory, cscope

Which probably means your load-path doesn't include the package's
directory.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 14:52   ` Timur Aydin
  2015-05-20 15:03     ` Eli Zaretskii
@ 2015-05-20 15:04     ` Michael Heerdegen
  2015-05-20 16:40       ` Timur Aydin
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2015-05-20 15:04 UTC (permalink / raw
  To: help-gnu-emacs

Timur Aydin <ta@taydin.org> writes:

> File error: Cannot open load file, no such file or directory, cscope

Do you call `package-initialize' in your config (it's mandatory when you
want to use any of your installed packages)?

Michael.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 15:03     ` Eli Zaretskii
@ 2015-05-20 16:38       ` Timur Aydin
  0 siblings, 0 replies; 12+ messages in thread
From: Timur Aydin @ 2015-05-20 16:38 UTC (permalink / raw
  To: help-gnu-emacs


On 05/20/2015 06:03 PM, Eli Zaretskii wrote:
> So that probably means you didn't install the package correctly. A
> correct installation should take care of 2 things that are necessary
> for you to be able to call any function inside a package: . it should
> add the package directory to load-path . it should load the package,
> either by 'require' or by an explicit 'load' (in the latter case, if
> it uses an absolute file name, it can avoid adding the directoy to
> load-path) 

I understand that I need to add the package path into load-path and
"require" it in .emacs.el when I want to use a package that is located
on some directory in the filesystem. But I have used ELPA to install
this package. Are these steps still necessary when using ELPA? Or maybe
for some packages? Because I remember installing magit using ELPA and it
just worked without adding anything to the load-path and without
requiring the package in .emacs.el ...

>> If I put that into.emacs.el anyway, it issues the following error:
>>
>> Warning (initialization): An error occurred while loading
>> `/home/ta/.emacs.el':
>>
>> File error: Cannot open load file, no such file or directory, cscope
> Which probably means your load-path doesn't include the package's
> directory.
>




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 15:04     ` Michael Heerdegen
@ 2015-05-20 16:40       ` Timur Aydin
  2015-05-20 16:51         ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Timur Aydin @ 2015-05-20 16:40 UTC (permalink / raw
  To: help-gnu-emacs



On 05/20/2015 06:04 PM, Michael Heerdegen wrote:
> Do you call `package-initialize' in your config (it's mandatory when
> you want to use any of your installed packages)? Michael. 

I don't call (package-initialize) in my .emacs.el. Is that necessary
when using ELPA?

-- 
Timur



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 12:11 xcscope setup Timur Aydin
  2015-05-20 13:23 ` Doug Lewan
@ 2015-05-20 16:47 ` Dmitry Gutov
  2015-05-21  2:25 ` Vaidheeswaran C
  2 siblings, 0 replies; 12+ messages in thread
From: Dmitry Gutov @ 2015-05-20 16:47 UTC (permalink / raw
  To: Timur Aydin, help-gnu-emacs

On 05/20/2015 03:11 PM, Timur Aydin wrote:

> (defun my-c-initialization-hook ()
>    (cscope-setup)
> )

That's not ideal. Not harmful exactly, but cscope-setup only needs to be 
called once, not once per C file.

> This seems to work correctly, but I haven't seen it done this way
> anywhere. So, why isn't it working according to the documentation? And
> why is the hook method working? And is this the proper way of this this?

Try (add-hook 'after-init-hook 'cscope-setup) instead.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 16:40       ` Timur Aydin
@ 2015-05-20 16:51         ` Michael Heerdegen
  2015-05-20 17:14           ` Timur Aydin
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2015-05-20 16:51 UTC (permalink / raw
  To: help-gnu-emacs

Timur Aydin <ta@taydin.org> writes:

> I don't call (package-initialize) in my .emacs.el. Is that necessary
> when using ELPA?

I think so.

Michael.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 16:51         ` Michael Heerdegen
@ 2015-05-20 17:14           ` Timur Aydin
  0 siblings, 0 replies; 12+ messages in thread
From: Timur Aydin @ 2015-05-20 17:14 UTC (permalink / raw
  To: help-gnu-emacs

On 05/20/2015 07:51 PM, Michael Heerdegen wrote:
> Timur Aydin <ta@taydin.org> writes:
>
>> I don't call (package-initialize) in my .emacs.el. Is that necessary
>> when using ELPA?
> I think so.

Thanks for the tip Michael. I have added a call to (package-initialize)
to the very beginning of .emacs.el and now (cscope-setup) in the
.emacs.el doesn't issue any error.

BTW: I have done a git pull on my local emacs repo and rebuilt emacs. In
the current git version, the package manager adds the
(package-initialize) to .emacs.el automatically.

-- 
Timur



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-20 12:11 xcscope setup Timur Aydin
  2015-05-20 13:23 ` Doug Lewan
  2015-05-20 16:47 ` Dmitry Gutov
@ 2015-05-21  2:25 ` Vaidheeswaran C
  2015-05-21 16:14   ` Timur Aydin
  2 siblings, 1 reply; 12+ messages in thread
From: Vaidheeswaran C @ 2015-05-21  2:25 UTC (permalink / raw
  To: help-gnu-emacs

On Wednesday 20 May 2015 05:41 PM, Timur Aydin wrote:
> Hello,
>
> I am trying to get xcscope to work with emacs version (GNU Emacs
> 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.6)
>  of 2014-12-29 on mail))
>
> I have first installed the xcscope from the ELPA. Then, according to the
> package documentation, I have added (cscope-setup) into my .emacs.el
>
> But when I do that, emacs fails to start up with this error:
>
> Warning (initialization): An error occurred while loading
> `/home/ta/.emacs.el':
>
> Symbol's function definition is void: cscope-setup
>
> I played around with this for a while and finally got it to work by
> adding (cscope-setup) into a c-initialization-hook:
>
> (defun my-c-initialization-hook ()
>   (cscope-setup)
> )
>
> (add-hook 'c-initialization-hook 'my-c-initialization-hook)
>
> This seems to work correctly, but I haven't seen it done this way
> anywhere. So, why isn't it working according to the documentation? And
> why is the hook method working? And is this the proper way of this this?
>
> Cheers,
>

CEDET (bundled with stock GNU Emacs) ships with an interface to
cscope.  You may want to try it out instead.  The advantage with this
is that you longer have to depend on an external dependency.  YMMV
though.

lisp/cedet/cedet-cscope.el
lisp/cedet/semantic/symref/cscope.el






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: xcscope setup
  2015-05-21  2:25 ` Vaidheeswaran C
@ 2015-05-21 16:14   ` Timur Aydin
  0 siblings, 0 replies; 12+ messages in thread
From: Timur Aydin @ 2015-05-21 16:14 UTC (permalink / raw
  To: help-gnu-emacs

On 5/21/2015 5:25 AM, Vaidheeswaran C wrote:
> CEDET (bundled with stock GNU Emacs) ships with an interface to
> cscope.  You may want to try it out instead.  The advantage with this
> is that you longer have to depend on an external dependency.  YMMV
> though.
>
> lisp/cedet/cedet-cscope.el
> lisp/cedet/semantic/symref/cscope.el
>

Thanks for the tip. I occasionally try CEDEC with emacs, but it seems to 
me that CEDEC is for advanced emacs users. I always got stuck at some 
point and give up.

I will try again, see how it goes :)

-- 
Timur



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-05-21 16:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20 12:11 xcscope setup Timur Aydin
2015-05-20 13:23 ` Doug Lewan
2015-05-20 14:52   ` Timur Aydin
2015-05-20 15:03     ` Eli Zaretskii
2015-05-20 16:38       ` Timur Aydin
2015-05-20 15:04     ` Michael Heerdegen
2015-05-20 16:40       ` Timur Aydin
2015-05-20 16:51         ` Michael Heerdegen
2015-05-20 17:14           ` Timur Aydin
2015-05-20 16:47 ` Dmitry Gutov
2015-05-21  2:25 ` Vaidheeswaran C
2015-05-21 16:14   ` Timur Aydin

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.