unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* fix bad link for explicit tags in *Tags List* buffer
@ 2011-09-28 12:23 Liang Wang
  2012-03-22  6:49 ` Liang Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Liang Wang @ 2011-09-28 12:23 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1651 bytes --]

Hi,

I use Emacs source tree as example.  Here is the way I create TAGS file.

$ etags src/*.[hc]

And then run M-x list-tags RET src/buffer.c RET to show buffer *Tags List*.
The first tag in it is current_buffer.  But when I press RET on it,
an error message shows up.  It's like

etags-goto-tag-location: Rerun etags: `^current_buffer' not found
in /home/liang/src/emacs/trunk/src/buffer.c

That's because etags-goto-tag-location wants implicit tag which starts from
 the beginning of the line, but current_buffer is an explicit tag.

To fix it, implicit tag must be used as link, but we can choose either
explicit tag
or implicit tag to show in *Tags List* buffer.

The following patch shows implicit tag.  OK for trunk?

Thanks,
Liang.


diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a8be1ba..032dbfd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-28  Liang Wang  <netcasper@gmail.com>
+
+	* progmodes/etags.el (etags-list-tags): Always use explicit tags.
+
 2011-09-21  Michael Albinus  <michael.albinus@gmx.de>

 	* net/tramp.el (tramp-handle-shell-command): Set process sentinel
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index d321e9c..f38af05 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1409,7 +1409,7 @@ hits the start of file."
 	  tag tag-info pt)
     (forward-line 1)
     (while (not (or (eobp) (looking-at "\f")))
-      (setq tag-info (save-excursion (funcall snarf-tag-function t))
+      (setq tag-info (save-excursion (funcall snarf-tag-function nil))
 	    tag (car tag-info)
 	    pt (with-current-buffer standard-output (point)))
       (princ tag)

[-- Attachment #2: etags-list-tags.patch --]
[-- Type: application/octet-stream, Size: 910 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a8be1ba..032dbfd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-28  Liang Wang  <netcasper@gmail.com>
+
+	* progmodes/etags.el (etags-list-tags): Always use explicit tags.
+
 2011-09-21  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp.el (tramp-handle-shell-command): Set process sentinel
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index d321e9c..f38af05 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1409,7 +1409,7 @@ hits the start of file."
 	  tag tag-info pt)
     (forward-line 1)
     (while (not (or (eobp) (looking-at "\f")))
-      (setq tag-info (save-excursion (funcall snarf-tag-function t))
+      (setq tag-info (save-excursion (funcall snarf-tag-function nil))
 	    tag (car tag-info)
 	    pt (with-current-buffer standard-output (point)))
       (princ tag)

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

* Re: fix bad link for explicit tags in *Tags List* buffer
  2011-09-28 12:23 fix bad link for explicit tags in *Tags List* buffer Liang Wang
@ 2012-03-22  6:49 ` Liang Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Liang Wang @ 2012-03-22  6:49 UTC (permalink / raw)
  To: emacs-devel

Hi,

Could this patch be in Emacs 24?  I reported it at
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9942.

Thanks.
Liang.

On Wed, Sep 28, 2011 at 8:23 PM, Liang Wang <netcasper@gmail.com> wrote:
> Hi,
>
> I use Emacs source tree as example.  Here is the way I create TAGS file.
>
> $ etags src/*.[hc]
>
> And then run M-x list-tags RET src/buffer.c RET to show buffer *Tags List*.
> The first tag in it is current_buffer.  But when I press RET on it,
> an error message shows up.  It's like
>
> etags-goto-tag-location: Rerun etags: `^current_buffer' not found
> in /home/liang/src/emacs/trunk/src/buffer.c
>
> That's because etags-goto-tag-location wants implicit tag which starts from
>  the beginning of the line, but current_buffer is an explicit tag.
>
> To fix it, implicit tag must be used as link, but we can choose either
> explicit tag
> or implicit tag to show in *Tags List* buffer.
>
> The following patch shows implicit tag.  OK for trunk?
>
> Thanks,
> Liang.
>
>
> diff --git a/lisp/ChangeLog b/lisp/ChangeLog
> index a8be1ba..032dbfd 100644
> --- a/lisp/ChangeLog
> +++ b/lisp/ChangeLog
> @@ -1,3 +1,7 @@
> +2011-09-28  Liang Wang  <netcasper@gmail.com>
> +
> +       * progmodes/etags.el (etags-list-tags): Always use explicit tags.
> +
>  2011-09-21  Michael Albinus  <michael.albinus@gmx.de>
>
>        * net/tramp.el (tramp-handle-shell-command): Set process sentinel
> diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
> index d321e9c..f38af05 100644
> --- a/lisp/progmodes/etags.el
> +++ b/lisp/progmodes/etags.el
> @@ -1409,7 +1409,7 @@ hits the start of file."
>          tag tag-info pt)
>     (forward-line 1)
>     (while (not (or (eobp) (looking-at "\f")))
> -      (setq tag-info (save-excursion (funcall snarf-tag-function t))
> +      (setq tag-info (save-excursion (funcall snarf-tag-function nil))
>            tag (car tag-info)
>            pt (with-current-buffer standard-output (point)))
>       (princ tag)



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

end of thread, other threads:[~2012-03-22  6:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-28 12:23 fix bad link for explicit tags in *Tags List* buffer Liang Wang
2012-03-22  6:49 ` Liang Wang

Code repositories for project(s) associated with this public inbox

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

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).