aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-12-26 20:53:54 +0000
committerRichard M. Stallman1996-12-26 20:53:54 +0000
commitf530ce274828aed540d41dd423fd91e6bd8e1019 (patch)
tree7e8ca1cfdc136683180de2f992ea563c8ef1bdde
parentf1017d552a2235bd6647531a60e6432bd8e611d2 (diff)
downloademacs-f530ce274828aed540d41dd423fd91e6bd8e1019.tar.gz
emacs-f530ce274828aed540d41dd423fd91e6bd8e1019.zip
(Fexpand_abbrev): Return the abbrev symbol, or nil if no expansion.
-rw-r--r--src/abbrev.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/abbrev.c b/src/abbrev.c
index 61f053b4d46..098d2863ef8 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -214,7 +214,7 @@ then ABBREV is looked up in that table only.")
214DEFUN ("expand-abbrev", Fexpand_abbrev, Sexpand_abbrev, 0, 0, "", 214DEFUN ("expand-abbrev", Fexpand_abbrev, Sexpand_abbrev, 0, 0, "",
215 "Expand the abbrev before point, if there is an abbrev there.\n\ 215 "Expand the abbrev before point, if there is an abbrev there.\n\
216Effective when explicitly called even when `abbrev-mode' is nil.\n\ 216Effective when explicitly called even when `abbrev-mode' is nil.\n\
217Returns t if expansion took place.") 217Returns the abbrev symbol, if expansion took place.")
218 () 218 ()
219{ 219{
220 register char *buffer, *p; 220 register char *buffer, *p;
@@ -226,15 +226,14 @@ Returns t if expansion took place.")
226 int oldmodiff = MODIFF; 226 int oldmodiff = MODIFF;
227 Lisp_Object value; 227 Lisp_Object value;
228 228
229 value = Qnil;
230
229 if (!NILP (Vrun_hooks)) 231 if (!NILP (Vrun_hooks))
230 call1 (Vrun_hooks, Qpre_abbrev_expand_hook); 232 call1 (Vrun_hooks, Qpre_abbrev_expand_hook);
231 /* If the hook changes the buffer, treat that as having "done an
232 expansion". */
233 value = (MODIFF != oldmodiff ? Qt : Qnil);
234 233
235 wordstart = 0; 234 wordstart = 0;
236 if (!(BUFFERP (Vabbrev_start_location_buffer) && 235 if (!(BUFFERP (Vabbrev_start_location_buffer)
237 XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) 236 && XBUFFER (Vabbrev_start_location_buffer) == current_buffer))
238 Vabbrev_start_location = Qnil; 237 Vabbrev_start_location = Qnil;
239 if (!NILP (Vabbrev_start_location)) 238 if (!NILP (Vabbrev_start_location))
240 { 239 {
@@ -297,6 +296,7 @@ Returns t if expansion took place.")
297 296
298 /* Now sym is the abbrev symbol. */ 297 /* Now sym is the abbrev symbol. */
299 Vlast_abbrev = sym; 298 Vlast_abbrev = sym;
299 value = sym;
300 last_abbrev_point = wordstart; 300 last_abbrev_point = wordstart;
301 301
302 if (INTEGERP (XSYMBOL (sym)->plist)) 302 if (INTEGERP (XSYMBOL (sym)->plist))
@@ -351,7 +351,7 @@ Returns t if expansion took place.")
351 if (!NILP (hook)) 351 if (!NILP (hook))
352 call0 (hook); 352 call0 (hook);
353 353
354 return Qt; 354 return value;
355} 355}
356 356
357DEFUN ("unexpand-abbrev", Funexpand_abbrev, Sunexpand_abbrev, 0, 0, "", 357DEFUN ("unexpand-abbrev", Funexpand_abbrev, Sunexpand_abbrev, 0, 0, "",