all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Harry Putnam <reader@newsguy.com>
To: emacs-devel@gnu.org
Subject: abbrev table gets messed in cperl-mode repeatedly
Date: Fri, 21 May 2010 19:48:11 -0500	[thread overview]
Message-ID: <871vd4yd6c.fsf@newsguy.com> (raw)

GNU Emacs 24.0.50.1 (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
describe.

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;"
     nil
  "my $myscript;
  ($myscript = $0) =~ s/^.*\\///;\n")
  
  (define-skeleton hp-pdb
   "Insert a $pdb and print [...] for debuging"
    nil
  "$pdb and print \"hpdb "_"\\n\";")
  
  (define-skeleton hp-pdb1
   "Insert my $pdb = 1;\n for debuging"
    nil
  "my $pdb = 1;\n")
  
  (define-skeleton hp-pdbif
   "Insert  if($pdb){blah"
    nil
  " if ( $pdb ) {
       "_" 
  }")
  

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




                 reply	other threads:[~2010-05-22  0:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871vd4yd6c.fsf@newsguy.com \
    --to=reader@newsguy.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.