aboutsummaryrefslogtreecommitdiffstats
path: root/src/abbrev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/abbrev.c')
-rw-r--r--src/abbrev.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/abbrev.c b/src/abbrev.c
index 403afdb99a..a58c4ecbfb 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -27,7 +27,7 @@ Boston, MA 02110-1301, USA. */
#include "commands.h"
#include "buffer.h"
#include "window.h"
-#include "charset.h"
+#include "character.h"
#include "syntax.h"
/* An abbrev table is an obarray.
@@ -198,7 +198,7 @@ abbrev_check_chars (abbrev, global)
{
/* Copied from SYNTAX in syntax.h, except using FOLLOW_PARENT. */
Lisp_Object syntax_temp
- = SYNTAX_ENTRY_FOLLOW_PARENT (Vstandard_syntax_table, c);
+ = CHAR_TABLE_REF (Vstandard_syntax_table, c);
if ( (CONSP (syntax_temp)
? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff)
: Swhitespace) != Sword ) badchars[nbad++] = c;
@@ -470,9 +470,15 @@ Returns the abbrev symbol, if expansion took place. */)
int pos = wordstart_byte;
/* Find the initial. */
- while (pos < PT_BYTE
- && SYNTAX (*BUF_BYTE_ADDRESS (current_buffer, pos)) != Sword)
- pos++;
+ if (multibyte)
+ while (pos < PT_BYTE
+ && SYNTAX (FETCH_MULTIBYTE_CHAR (pos)) != Sword)
+ INC_POS (pos);
+ else
+ while (pos < PT_BYTE
+ && (SYNTAX (*BUF_BYTE_ADDRESS (current_buffer, pos))
+ != Sword))
+ pos++;
/* Change just that. */
pos = BYTE_TO_CHAR (pos);
@@ -769,6 +775,9 @@ Calling `expand-abbrev' sets this to nil. */);
Trying to expand an abbrev in any other buffer clears `abbrev-start-location'. */);
Vabbrev_start_location_buffer = Qnil;
+ DEFVAR_PER_BUFFER ("local-abbrev-table", &current_buffer->abbrev_table, Qnil,
+ doc: /* Local (mode-specific) abbrev table of current buffer. */);
+
DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed,
doc: /* Set non-nil by defining or altering any word abbrevs.
This causes `save-some-buffers' to offer to save the abbrevs. */);