GNU bug report logs - #8802
cperl-write-tags function in cperl-mode.el hard coded tags-file-name

Previous Next

Package: emacs;

Reported by: Dove Young <dove.young <at> gmail.com>

Date: Sun, 5 Jun 2011 12:31:02 UTC

Severity: minor

Tags: fixed

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8802 in the body.
You can then email your comments to 8802 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8802; Package emacs. (Sun, 05 Jun 2011 12:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dove Young <dove.young <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 05 Jun 2011 12:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dove Young <dove.young <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
Date: Sun, 5 Jun 2011 11:36:10 +0800
[Message part 1 (text/plain, inline)]
The original code reads like this


(defun cperl-write-tags (&optional file erase recurse dir inbuffer noxs
topdir)
  ;; If INBUFFER, do not select buffer, and do not save
  ;; If ERASE is `ignore', do not erase, and do not try to delete old info.
  (require 'etags)
  (if file nil
    (setq file (if dir default-directory (buffer-file-name)))
    (if (and (not dir) (buffer-modified-p)) (error "Save buffer first!")))
  (or topdir
      (setq topdir default-directory))
  (let ((tags-file-name "TAGS")
    (case-fold-search (eq system-type 'emx))
    xs rel tm)
... ... ... ...

This line (let ((tags-file-name "TAGS") hard coded the tags-file-name to
"TAGS".  This way is very bad. It prevents any users to customise their own
tags files. For example in my environment I have to customise tags file
names.

I use pde-mode (Perl Development Environment) in my daily work. it leverage
cperl-mode but would generate tags files base on Perl syntax. It is quite
different than what etags would do. This kind of tags file cannot be used in
any other features, such as speedbar, etc. So the reasonable way is to store
this kind of tags into separate files. But it cannot because of the hard
code in cperl-mode.el .


So would I suggest to re-factory cperl-mode.el and change "TAGS" to a
variable? Like following:

(defvar cperl-tags-file-name "TAGS" "TAGS file name"

(defun cperl-write-tags (&optional file erase recurse dir inbuffer noxs
topdir)
  ;; If INBUFFER, do not select buffer, and do not save
  ;; If ERASE is `ignore', do not erase, and do not try to delete old info.
  (require 'etags)
  (if file nil
    (setq file (if dir default-directory (buffer-file-name)))
    (if (and (not dir) (buffer-modified-p)) (error "Save buffer first!")))
  (or topdir
      (setq topdir default-directory))
  (let ((tags-file-name cperl-tags-file-name)
    (case-fold-search (eq system-type 'emx))
    xs rel tm)
... ... ... ...

In this way, I can customise it by set cperl-tags-file-name in other value
to avoid to break any other features:

(setq cperl-tags-file-name "PDE-TAGS")

-- 
M-x Thinks
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8802; Package emacs. (Wed, 06 Jul 2011 17:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 8802 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Dove Young <dove.young <at> gmail.com>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 8802 <at> debbugs.gnu.org,
	Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: cperl-write-tags function in cperl-mode.el hard coded
	tags-file-name
Date: Wed, 06 Jul 2011 19:14:59 +0200
Dove Young <dove.young <at> gmail.com> writes:

> So would I suggest to re-factory cperl-mode.el and change "TAGS" to a
> variable? Like following:
>
> (defvar cperl-tags-file-name "TAGS" "TAGS file name"

That sounds like a reasonable request to me, but Emacs is in a feature
freeze at the moment, and I'm not sure adding stuff like this is
"allowed" during the freeze.

Stefan, Chong?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8802; Package emacs. (Wed, 06 Jul 2011 18:17:02 GMT) Full text and rfc822 format available.

Message #11 received at 8802 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: Dove Young <dove.young <at> gmail.com>, Chong Yidong <cyd <at> stupidchicken.com>,
	8802 <at> debbugs.gnu.org
Subject: Re: cperl-write-tags function in cperl-mode.el hard coded
	tags-file-name
Date: Wed, 06 Jul 2011 14:15:55 -0400
>> So would I suggest to re-factory cperl-mode.el and change "TAGS" to a
>> variable? Like following:
>> (defvar cperl-tags-file-name "TAGS" "TAGS file name"

> That sounds like a reasonable request to me, but Emacs is in a feature
> freeze at the moment, and I'm not sure adding stuff like this is
> "allowed" during the freeze.

I'd rather that such a change be installed in Ilya's upstream
version first.  We already have plenty of merge problems because of
patches he rejected.  BTW, the recent change to use define-derived-mode
introduced a problem where the cperl-mode-hook gets called twice, so
I think we had better revert it.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8802; Package emacs. (Wed, 06 Jul 2011 18:22:01 GMT) Full text and rfc822 format available.

Message #14 received at 8802 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Dove Young <dove.young <at> gmail.com>, Chong Yidong <cyd <at> stupidchicken.com>,
	8802 <at> debbugs.gnu.org
Subject: Re: cperl-write-tags function in cperl-mode.el hard coded
	tags-file-name
Date: Wed, 06 Jul 2011 20:21:19 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> I'd rather that such a change be installed in Ilya's upstream
> version first.  We already have plenty of merge problems because of
> patches he rejected.

Right.  Would forwarding the report to Ilya and closing the bug report
in debbugs be the right thing to do?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8802; Package emacs. (Wed, 06 Jul 2011 19:36:01 GMT) Full text and rfc822 format available.

Message #17 received at 8802 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: Dove Young <dove.young <at> gmail.com>, Chong Yidong <cyd <at> stupidchicken.com>,
	8802 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#8802: cperl-write-tags function in cperl-mode.el hard coded
	tags-file-name
Date: Wed, 06 Jul 2011 15:35:42 -0400
Lars Magne Ingebrigtsen wrote:

> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>> I'd rather that such a change be installed in Ilya's upstream
>> version first.  We already have plenty of merge problems because of
>> patches he rejected.

This always makes me wonder: what is the point of having a file in Emacs
where modifying it is not allowed (or at least, is strongly
discouraged)? Why not move it to GNU ELPA? It's not like there isn't
another perl mode in Emacs, which is actually used by default.
	
> Right. Would forwarding the report to Ilya and closing the bug report
> in debbugs be the right thing to do?

Debbugs has the ability to mark a report as forwarded, see
http://debbugs.gnu.org/Developer.html#forward

Such reports are not usually closed.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8802; Package emacs. (Wed, 06 Jul 2011 19:53:02 GMT) Full text and rfc822 format available.

Message #20 received at 8802 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Dove Young <dove.young <at> gmail.com>, Lars Magne Ingebrigtsen <larsi <at> gnus.org>,
	8802 <at> debbugs.gnu.org, Chong Yidong <cyd <at> stupidchicken.com>,
	Ilya Zakharevich <ilyaz <at> cpan.org>
Subject: Re: bug#8802: cperl-write-tags function in cperl-mode.el hard coded
	tags-file-name
Date: Wed, 06 Jul 2011 15:51:54 -0400
>>> I'd rather that such a change be installed in Ilya's upstream
>>> version first.  We already have plenty of merge problems because of
>>> patches he rejected.
> This always makes me wonder: what is the point of having a file in Emacs
> where modifying it is not allowed (or at least, is strongly
> discouraged)? Why not move it to GNU ELPA? It's not like there isn't
> another perl mode in Emacs, which is actually used by default.

Good point.  But AFAIK it does have a fairly large number of users.
Chong, Ilya, what do you guys think?


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8802; Package emacs. (Wed, 06 Jul 2011 19:55:01 GMT) Full text and rfc822 format available.

Message #23 received at 8802 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, Chong Yidong <cyd <at> stupidchicken.com>,
	8802 <at> debbugs.gnu.org, Ilya Zakharevich <ilyaz <at> cpan.org>,
	Dove Young <dove.young <at> gmail.com>
Subject: Re: bug#8802: cperl-write-tags function in cperl-mode.el hard coded
	tags-file-name
Date: Wed, 06 Jul 2011 21:54:18 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Good point.  But AFAIK it does have a fairly large number of users.
> Chong, Ilya, what do you guys think?

cperl-mode has lots and lots of users, I think.  This would break their
Emacs 24 work flow significantly, in my opinion.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8802; Package emacs. (Thu, 19 Nov 2020 05:20:02 GMT) Full text and rfc822 format available.

Message #26 received at 8802 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Dove Young <dove.young <at> gmail.com>, Lars Magne Ingebrigtsen <larsi <at> gnus.org>,
 8802 <at> debbugs.gnu.org, Chong Yidong <cyd <at> stupidchicken.com>
Subject: Re: bug#8802: cperl-write-tags function in cperl-mode.el hard coded
 tags-file-name
Date: Wed, 18 Nov 2020 21:19:40 -0800
tags 8802 + fixed
close 8802 28.1
thanks

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>>> So would I suggest to re-factory cperl-mode.el and change "TAGS" to a
>>> variable? Like following:
>>> (defvar cperl-tags-file-name "TAGS" "TAGS file name"
>
>> That sounds like a reasonable request to me, but Emacs is in a feature
>> freeze at the moment, and I'm not sure adding stuff like this is
>> "allowed" during the freeze.
>
> I'd rather that such a change be installed in Ilya's upstream
> version first.  We already have plenty of merge problems because of
> patches he rejected.

So given that the above merge problems are no longer a concern, I've
now added such a variable on master.

I'm therefore also closing this bug report.




Added tag(s) fixed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 19 Nov 2020 05:20:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 8802 <at> debbugs.gnu.org and Dove Young <dove.young <at> gmail.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 19 Nov 2020 05:20:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 17 Dec 2020 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.