unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* trouble writing small program
@ 2015-06-05 13:57 jenia mtl
  2015-06-05 17:38 ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: jenia mtl @ 2015-06-05 13:57 UTC (permalink / raw)
  To: help-gnu-emacs

Hello:

Using evil and ggtags, I want to be able to jump back, using C-o, to the
position where I execute
ggtags-find-tag-dwim.
I have wrote this small program:

  (defun ggtags-go-to-definition ()
    (interactive)
    (let ((current-pos (make-marker)))
      (add-to-list 'evil-jump-list current-pos)
      (ggtags-find-tag-dwim (thing-at-point 'symbol))))

But it gives me the error "Marker does not point anywhere".

Can someone please tell me, how do I write this program correctly? That
is, I want to store the position before executing `ggtags...` and then
be able to jump back (using "C-o" a.k.a "evil-jump-back").

Thanks in advance for your kind help.
Jenia


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

* Re: trouble writing small program
       [not found] <mailman.4382.1433518067.904.help-gnu-emacs@gnu.org>
@ 2015-06-05 15:35 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 3+ messages in thread
From: Pascal J. Bourguignon @ 2015-06-05 15:35 UTC (permalink / raw)
  To: help-gnu-emacs

jenia mtl <jenia.ivlev@gmail.com> writes:

> Hello:
>
> Using evil and ggtags, I want to be able to jump back, using C-o, to the
> position where I execute
> ggtags-find-tag-dwim.
> I have wrote this small program:
>
>   (defun ggtags-go-to-definition ()
>     (interactive)
>     (let ((current-pos (make-marker)))
>       (add-to-list 'evil-jump-list current-pos)
>       (ggtags-find-tag-dwim (thing-at-point 'symbol))))
>
> But it gives me the error "Marker does not point anywhere".
>
> Can someone please tell me, how do I write this program correctly?
> That is,
> I want to store the position before executing `ggtags...` 

You can store it using set-marker.

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* RE: trouble writing small program
  2015-06-05 13:57 trouble writing small program jenia mtl
@ 2015-06-05 17:38 ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2015-06-05 17:38 UTC (permalink / raw)
  To: jenia mtl, help-gnu-emacs

>   (defun ggtags-go-to-definition ()
>     (interactive)
>     (let ((current-pos (make-marker)))
>       (add-to-list 'evil-jump-list current-pos)
>       (ggtags-find-tag-dwim (thing-at-point 'symbol))))
> 
> But it gives me the error "Marker does not point anywhere".

User `(point-marker)' to get a marker at point.  `make-marker'
creates a marker that doesn't point anywhere.



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

end of thread, other threads:[~2015-06-05 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-05 13:57 trouble writing small program jenia mtl
2015-06-05 17:38 ` Drew Adams
     [not found] <mailman.4382.1433518067.904.help-gnu-emacs@gnu.org>
2015-06-05 15:35 ` Pascal J. Bourguignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).