home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.emacs.help
- Path: sparky!uunet!cs.utexas.edu!wupost!darwin.sura.net!gatech!psuvax1!liblit
- From: liblit@cs.psu.edu (Benjamin R. Liblit)
- Subject: bison-mode bugs/patches (was Re: Trying to use bison-mode... HELP)
- In-Reply-To: lele@itnsg1.cineca.it's message of Fri, 11 Sep 1992 14:03:40 GMT
- Message-ID: <BuJr0A.J39@cs.psu.edu>
- Sender: news@cs.psu.edu (Usenet)
- Nntp-Posting-Host: waldo.cs.psu.edu
- References: <1992Sep11.140340.12577@itnsg1.cineca.it>
- Date: Mon, 14 Sep 1992 03:31:16 GMT
- Lines: 49
-
- In article <1992Sep11.140340.12577@itnsg1.cineca.it> lele@itnsg1.cineca.it (Lele Gaifax) writes:
- >
- >Whenever I try to insert a code-block, Emacs says
- >"Wrong type argument: integer-or-marker-p, nil" in the minibuffer.
-
- The problem seems to be that a variable called "indent" is not being
- properly bound by a let statement. The original code contains two
- instances of:
-
- (let (indent) ...)
-
- It seems that this was actually intended to bind "indent" to some
- initial value. Assuming this initial value is 0, the code should
- really read:
-
- (let ((indent 0)) ...)
-
- To patch things up, you can replace all instances of "(indent)" with
- "((indent 0))". This will fix the two let statements and shouldn't
- match anything else.
-
- On the subject of bison-mode bugs, though, has anyone noticed that
- bison-edit-code-block changes the indentation of code blocks when you
- re-edit them? Specifically, my initial %{ ... %} block contains many
- "#include" and "#define" lines. Whenever I re-edit it, all of these
- directives are pushed right by two columns. Anyone have a patch?
-
- In the interests of fair exchange, here's a patch of my own. I use
- bison++, so the code fragments I'm putting in my grammar are C++, not
- C. I performed the following (manual) patch:
-
- - Use replace-string to change all "bison" to "bison++".
- This will also change "Bison" to "Bison++", which is neat.
-
- - Use query-replace-regexp to change all "\bc\b" to "c++"
- *except* where it is part of:
-
- - the copyright notice
- - a string literal used for keybinding, like "\C-c"
-
- Presto! You now have a bison++-mode of your very own. This assumes
- you're using Barry A. Warsaw <baw@cen.com>'s c++-mode of 1992; if
- you've instead got Dave Detlefs <dld@cs.cmu.edu>'s c++-mode of 1987,
- you also should leave the "\bc\b" in c-auto-newline, c-indent-level,
- and c-tab-always-indent untouched.
-
- --
- Ben Liblit ----- "Fais que tes reves soient plus longs que la nuit."
- liblit@cs.psu.edu -- brl102@psuvm.psu.edu -- brl102@psuvm.bitnet
-