emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ mode and c-beginning-of-current-token


From: martin rudalics
Subject: Re: C++ mode and c-beginning-of-current-token
Date: Thu, 17 May 2007 16:45:13 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Also, it is important to update the syntax-table only after making sure that
the new position is valid.  So I believe the patch below is what we want.


        Stefan


--- orig/src/syntax.c
+++ mod/src/syntax.c
@@ -1691,10 +1691,10 @@
                      p = GPT_ADDR;
                      stop = endp;
                    }
+                 UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
                  if (! fastmap[(int) SYNTAX (p[-1])])
                    break;
                  p--, pos--;
-                 UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
                }
          }
       }

Indeed, though I'd prefer the attached one.

BTW, did you look at the backward-word problem I mentioned in my previous mail?
*** syntax.c    Wed Jan 17 09:31:10 2007
--- syntax.c    Thu May 17 15:23:24 2007
***************
*** 1669,1678 ****
                      p = GPT_ADDR;
                      stop = endp;
                    }
-                 if (! fastmap[(int) SYNTAX (p[-1])])
-                   break;
                  p--, pos--;
!                 UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
                }
          }
        }
--- 1669,1681 ----
                      p = GPT_ADDR;
                      stop = endp;
                    }
                  p--, pos--;
!                 UPDATE_SYNTAX_TABLE_BACKWARD (pos);
!                 if (! fastmap[(int) SYNTAX (*p)])
!                   {
!                     p++, pos++;
!                     break;
!                   }
                }
          }
        }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]