home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / emacs / help / 4113 < prev    next >
Encoding:
Text File  |  1992-09-13  |  2.5 KB  |  62 lines

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