[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

abbrev table gets messed in cperl-mode repeatedly

From: Harry Putnam
Subject: abbrev table gets messed in cperl-mode repeatedly
Date: Fri, 21 May 2010 19:48:11 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

GNU Emacs (i686-pc-linux-gnu, GTK+ Version 2.18.7) 
of 2010-03-14 on reader

I'm guessing what I'm seeing with the abbrev table is not a real bug
since in the last several thousand posts there have been no messages
with that kind of subject.  There have been a couple with subjects
including the string `abbrev' but not about what I'm about to try to

Before anyone tells me to submit a bug.  Please understand that I am
simply not sharp enough to know if this is likely to be a real bug,
and not (more likely) some kind of self inflicted wound.

I have a fairly extensive set of abbrevs, especially for cperl-mode

I add and subtract fairly often.  I've found in one particular area
shown here from the buffer shown with M-x edit-abbrevs.

What I see:

This is from cperl-mode table, and in this particular area I see a
recurring problem that renders one or more abbrevs useless.

This is a buffer where I've just edited pdbif  Pressed C-c C-c to
enable the edit, then C-x b to return to working perl script.


  "pbase"        4    ""                       hp-pbase
  "pdb"          13   ""                       hp-pdb
  "pdb1"         12   ""                       hp-pdb1
  "pdbif         0    ""                       hp-pdbif
  "pdie"         13   ""                       hp-pdie


Once back at my script.. I type `pdb1<spc>'  and the correct abbrev is
inserted: `my $pdb = 1;'

Now press `pdbif<spc>'  But nothing happens.

Ok, return to abbrevs table with M-x edit-abbrevs <ENTER>
This is what I see in that same area:


  "pbase"        4    ""                       hp-pbase
  "pdb"          13   ""                       hp-pdb
  "pdb1"         13   ""                       hp-pdb1
  "pdbif         0    " 0 pdie                 "         13   "
  "pfor"         8    ""                       hp-pfor


What could be causing this?  Where does this line come from?

  "pdbif         0    " 0 pdie                 "         13   "

Its not always the same line, but it is always one from that bunch, 

-------        ---------       ---=---       ---------      -------- 

As you may have noticed all the abbrevs in question are calls to home
made functions... actually skeletons, so I wondered if it may be one
or more of them at fault. So, have included the set from that area:

   (define-skeleton hp-pbase
    "Insert `\$myscript setup;"
  "my $myscript;
  ($myscript = $0) =~ s/^.*\\///;\n")
  (define-skeleton hp-pdb
   "Insert a $pdb and print [...] for debuging"
  "$pdb and print \"hpdb "_"\\n\";")
  (define-skeleton hp-pdb1
   "Insert my $pdb = 1;\n for debuging"
  "my $pdb = 1;\n")
  (define-skeleton hp-pdbif
   "Insert  if($pdb){blah"
  " if ( $pdb ) {

  (define-skeleton hp-pdie
   "Insert an `or die' section"
  " or die \"Can't open <$"_">: $!\";")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]