all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
@ 2011-06-05  3:36 Dove Young
  2011-07-06 17:14 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Dove Young @ 2011-06-05  3:36 UTC (permalink / raw)
  To: 8802

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

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

[-- Attachment #2: Type: text/html, Size: 2402 bytes --]

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

* bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
  2011-06-05  3:36 bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name Dove Young
@ 2011-07-06 17:14 ` Lars Magne Ingebrigtsen
  2011-07-06 18:15   ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-06 17:14 UTC (permalink / raw)
  To: Dove Young; +Cc: Chong Yidong, 8802

Dove Young <dove.young@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/





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

* bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
  2011-07-06 17:14 ` Lars Magne Ingebrigtsen
@ 2011-07-06 18:15   ` Stefan Monnier
  2011-07-06 18:21     ` Lars Magne Ingebrigtsen
  2020-11-19  5:19     ` Stefan Kangas
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-07-06 18:15 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: Dove Young, Chong Yidong, 8802

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





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

* bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
  2011-07-06 18:15   ` Stefan Monnier
@ 2011-07-06 18:21     ` Lars Magne Ingebrigtsen
  2011-07-06 19:35       ` Glenn Morris
  2020-11-19  5:19     ` Stefan Kangas
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-06 18:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Dove Young, Chong Yidong, 8802

Stefan Monnier <monnier@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/





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

* bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
  2011-07-06 18:21     ` Lars Magne Ingebrigtsen
@ 2011-07-06 19:35       ` Glenn Morris
  2011-07-06 19:51         ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2011-07-06 19:35 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: Dove Young, Chong Yidong, 8802

Lars Magne Ingebrigtsen wrote:

> Stefan Monnier <monnier@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.





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

* bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
  2011-07-06 19:35       ` Glenn Morris
@ 2011-07-06 19:51         ` Stefan Monnier
  2011-07-06 19:54           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2011-07-06 19:51 UTC (permalink / raw)
  To: Glenn Morris
  Cc: Dove Young, Lars Magne Ingebrigtsen, 8802, Chong Yidong,
	Ilya Zakharevich

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





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

* bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
  2011-07-06 19:51         ` Stefan Monnier
@ 2011-07-06 19:54           ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-06 19:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Chong Yidong, 8802, Ilya Zakharevich, Dove Young

Stefan Monnier <monnier@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/





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

* bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name
  2011-07-06 18:15   ` Stefan Monnier
  2011-07-06 18:21     ` Lars Magne Ingebrigtsen
@ 2020-11-19  5:19     ` Stefan Kangas
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-11-19  5:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Dove Young, Lars Magne Ingebrigtsen, 8802, Chong Yidong

tags 8802 + fixed
close 8802 28.1
thanks

Stefan Monnier <monnier@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.





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

end of thread, other threads:[~2020-11-19  5:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-05  3:36 bug#8802: cperl-write-tags function in cperl-mode.el hard coded tags-file-name Dove Young
2011-07-06 17:14 ` Lars Magne Ingebrigtsen
2011-07-06 18:15   ` Stefan Monnier
2011-07-06 18:21     ` Lars Magne Ingebrigtsen
2011-07-06 19:35       ` Glenn Morris
2011-07-06 19:51         ` Stefan Monnier
2011-07-06 19:54           ` Lars Magne Ingebrigtsen
2020-11-19  5:19     ` Stefan Kangas

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.