[GHC] #10989: :ctags and :etags command can receive haskell source files as a parameter

GHC ghc-devs at haskell.org
Tue Oct 20 02:21:43 UTC 2015


#10989: :ctags and :etags command can receive haskell source files as a parameter
-------------------------------------+-------------------------------------
           Reporter:  hugomg         |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  GHCi           |           Version:  7.10.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Documentation
  Unknown/Multiple                   |  bug
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 A friend of mine accidentally lost a bunch of uncomited code because he
 passed the name of his source file to ghci's ctags command

 {{{
 :ctags hisstuff.hs
 }}}

 He tought that the ctags parameter was the name of the file to create the
 ctags from. Instead, that parameter is actually for the name of the file
 to write the tags to. His Haskell source file was instantly overwritten by
 the tag info.

 The source of this confusion is that the the documentation from the
 `:help` command just says it takes a "file" parameter, without explicitly
 mentioning that its the name of the *output* file.

 {{{
 :ctags[!] [<file>]          create tags file for Vi (default: "tags")
                             (!: use regex instead of line number)

 :etags [<file>]             create tags file for Emacs (default: "TAGS")
 }}}

 I think it would be safer to use a more precise name here instead of
 `<file>`. Something like `<output>` or `<outputFile>`. It might also be a
 good idea to forbid the ctags and etags commands from overwriting existing
 "hs" and "lhs" source files. If a user types `:ctags something.hs` then
 its almost certainly a mistake with potentially destructive consequences.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list