home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / lisp / mcl / 1089 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  1.9 KB

  1. Path: sparky!uunet!usc!sdd.hp.com!mips!apple!cambridge.apple.com!cornell@freya.cs.umass.edu
  2. From: cornell@freya.cs.umass.edu
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Knowing when a buffer is modified, when point is moved, ...
  5. Message-ID: <9207281737.AA03521@giane.cs.umass.edu>
  6. Date: 28 Jul 92 17:37:46 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 38
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Original-To: info-mcl@cambridge.apple.com
  11.  
  12. Howdy. I am building a mechanism that displays editable text and
  13. non-editable textual representations of objects in a FRED buffer. The
  14. non-text reps show in a different font to disginguish them from
  15. editable text. I have two issues:
  16.  
  17.  
  18. 1) To insert text in the proper style I thought I'd use
  19. buffer-insert-with-style, which takes a style vector. However, it
  20. seemst the only way to get a style is via buffer-get-style, which
  21. assumes I've already set the style! I'm now using buffer-set-font-spec
  22. then buffer-insert to simulate a buffer-insert-with-font-spec, which
  23. is really what I want. Would someone please tell me the accepted way
  24. to do this?
  25.  
  26.  
  27. 2) I need *general* ways to be informed when certain editing
  28. conditions take place:
  29.  
  30. a) when the cursor mark is moved within a non-editable
  31. range (which I know via start and end marks I create for each
  32. non-editable item) so I can extend the selection to cover the entire
  33. object.
  34.  
  35. b) when non-editable text is deleted so I can delete the
  36. internally-stored objects corresponding to the deleted text.
  37.  
  38. My question here is: Are there a few functions that I can tap that
  39. tell me when these conditions happen? I thought move-mark and
  40. buffer-delete might be them but they're non-generic functions so I'd
  41. have to advise them, which means my functions get called whenever they
  42. take place (often). I'm also thinking my start and end marks'
  43. positions might tell me if their text has been deleted. Anyone have
  44. a good solution?
  45.  
  46.  
  47. Sincerely,
  48.  
  49. matt
  50.