home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / lucidem / bug / 545 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.4 KB  |  77 lines

  1. x-gateway: rodan.UU.NET from bug-lucid-emacs to alt.lucid-emacs.bug; Thu, 28 Jan 1993 21:47:37 EST
  2. Date: Fri, 29 Jan 1993 13:46:45 EST
  3. From: rwhitby%research.canon.oz.au@lucid.com (Rod Whitby)
  4. Message-ID: <9301290246.AA12074@bing.research.canon.oz.au>
  5. Subject: Patch to font_lock.c
  6. Newsgroups: alt.lucid-emacs.bug
  7. Path: sparky!uunet!wendy-fate.uu.net!bug-lucid-emacs
  8. Sender: bug-lucid-emacs-request@lucid.com
  9. Lines: 66
  10.  
  11. When calling find_context_start with a zero end parameter, point may
  12. be moved by the call to end_of_defun.  This means that point is not
  13. preserved across the call to buffer-syntactic-context.
  14.  
  15. Here is a patch to font_lock.c so point is preserved when calling
  16. buffer-syntactic-context.
  17.  
  18. *** lemacs-19.4/src/font_lock.c~    Wed Jan 20 20:42:39 1993
  19. --- lemacs-19.4/src/font_lock.c        Fri Jan 29 13:03:19 1993
  20. ***************
  21. *** 107,112 ****
  22. --- 107,113 ----
  23.   static void
  24.   find_context_start (int pt, int end)
  25.   {
  26. +   int npt;
  27.     int do_bod = (pt > context_cache.end_point ||
  28.           current_buffer != context_cache.buffer);
  29.   
  30. ***************
  31. *** 117,124 ****
  32.       {
  33.         /* We must start searching at the beginning of defun.
  34.          */
  35. !       pt = beginning_of_defun (pt);
  36. !       context_cache.start_point = pt;
  37.         context_cache.buffer = current_buffer;
  38.         context_cache.context = context_none;
  39.         context_cache.ccontext = ccontext_none;
  40. --- 118,125 ----
  41.       {
  42.         /* We must start searching at the beginning of defun.
  43.          */
  44. !       npt = beginning_of_defun (pt);
  45. !       context_cache.start_point = npt;
  46.         context_cache.buffer = current_buffer;
  47.         context_cache.context = context_none;
  48.         context_cache.ccontext = ccontext_none;
  49. ***************
  50. *** 127,136 ****
  51.   #endif
  52.         context_cache.scontext = '\000';
  53.         context_cache.depth = 0;
  54. !       context_cache.backslash_p = ((pt > 1) && (CHAR_AT (pt - 1) == '\\'));
  55.         if (end)
  56.       {
  57. !       if (end < pt) abort ();
  58.         context_cache.end_point = end;
  59.       }
  60.         else
  61. --- 128,137 ----
  62.   #endif
  63.         context_cache.scontext = '\000';
  64.         context_cache.depth = 0;
  65. !       context_cache.backslash_p = ((npt > 1) && (CHAR_AT (npt - 1) == '\\'));
  66.         if (end)
  67.       {
  68. !       if (end < npt) abort ();
  69.         context_cache.end_point = end;
  70.       }
  71.         else
  72.  
  73. --------------------------------------------- _--_|\  |
  74. Rod Whitby (rwhitby@research.canon.oz.au)    /      \ |
  75. Canon Information Systems Research Australia \_.--._/ |
  76. 1 Thomas Holt Drive, North Ryde, N.S.W., 2113.     v  |
  77.