aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-11-24 13:28:33 -0500
committerStefan Monnier2013-11-24 13:28:33 -0500
commit740bcff0c1de06859c8139dd8e23e82aa28401a0 (patch)
tree66c858ec57977e7990229fee72af43a96d5bcbb1
parent450533b07a9adf8a1d19d3ce7142f946f04e76ac (diff)
downloademacs-740bcff0c1de06859c8139dd8e23e82aa28401a0.tar.gz
emacs-740bcff0c1de06859c8139dd8e23e82aa28401a0.zip
Export get_pos_property to Elisp.
* src/editfns.c (Fget_pos_property): Rename from get_pos_property. (syms_of_editfns): Export it to Elisp.
-rw-r--r--etc/NEWS2
-rw-r--r--src/ChangeLog4
-rw-r--r--src/editfns.c34
-rw-r--r--src/intervals.c2
-rw-r--r--src/intervals.h2
-rw-r--r--src/keyboard.c18
-rw-r--r--src/xterm.c2
7 files changed, 35 insertions, 29 deletions
diff --git a/etc/NEWS b/etc/NEWS
index de541fdb951..dcb2e614d46 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -731,6 +731,8 @@ for something (not just adding elements to it), it ought not to affect you.
731 731
732* Lisp Changes in Emacs 24.4 732* Lisp Changes in Emacs 24.4
733 733
734** New function get-pos-property.
735
734** New hook `pre-redisplay-function'. 736** New hook `pre-redisplay-function'.
735 737
736+++ 738+++
diff --git a/src/ChangeLog b/src/ChangeLog
index c3062d0fc0a..0818cb01156 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12013-11-24 Stefan Monnier <monnier@iro.umontreal.ca> 12013-11-24 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 Export get_pos_property to Elisp.
4 * editfns.c (Fget_pos_property): Rename from get_pos_property.
5 (syms_of_editfns): Export it to Elisp.
6
3 * data.c (Fmake_variable_buffer_local): Mention `permanent-local'. 7 * data.c (Fmake_variable_buffer_local): Mention `permanent-local'.
4 8
52013-11-23 Romain Francoise <romain@orebokech.com> 92013-11-23 Romain Francoise <romain@orebokech.com>
diff --git a/src/editfns.c b/src/editfns.c
index 277e5b60704..c5267d1e038 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -343,16 +343,15 @@ overlays_around (EMACS_INT pos, Lisp_Object *vec, ptrdiff_t len)
343 return idx; 343 return idx;
344} 344}
345 345
346/* Return the value of property PROP, in OBJECT at POSITION. 346DEFUN ("get-pos-property", Fget_pos_property, Sget_pos_property, 2, 3, 0,
347 It's the value of PROP that a char inserted at POSITION would get. 347 doc: /* Return the value of POSITION's property PROP, in OBJECT.
348 OBJECT is optional and defaults to the current buffer. 348Almost identical to `get-char-property' except for the following difference:
349 If OBJECT is a buffer, then overlay properties are considered as well as 349Whereas `get-char-property' returns the property of the char at (i.e. right
350 text properties. 350after) POSITION, this pays attention to properties's stickiness and overlays's
351 If OBJECT is a window, then that window's buffer is used, but 351advancement settings, in order to find the property of POSITION itself,
352 window-specific overlays are considered only if they are associated 352i.e. the property that a char would inherit if it were inserted
353 with OBJECT. */ 353at POSITION. */)
354Lisp_Object 354 (Lisp_Object position, register Lisp_Object prop, Lisp_Object object)
355get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object object)
356{ 355{
357 CHECK_NUMBER_COERCE_MARKER (position); 356 CHECK_NUMBER_COERCE_MARKER (position);
358 357
@@ -484,7 +483,7 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
484 specially. */ 483 specially. */
485 if (NILP (merge_at_boundary)) 484 if (NILP (merge_at_boundary))
486 { 485 {
487 Lisp_Object field = get_pos_property (pos, Qfield, Qnil); 486 Lisp_Object field = Fget_pos_property (pos, Qfield, Qnil);
488 if (!EQ (field, after_field)) 487 if (!EQ (field, after_field))
489 at_field_end = 1; 488 at_field_end = 1;
490 if (!EQ (field, before_field)) 489 if (!EQ (field, before_field))
@@ -683,7 +682,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
683 && (!NILP (Fget_char_property (new_pos, Qfield, Qnil)) 682 && (!NILP (Fget_char_property (new_pos, Qfield, Qnil))
684 || !NILP (Fget_char_property (old_pos, Qfield, Qnil)) 683 || !NILP (Fget_char_property (old_pos, Qfield, Qnil))
685 /* To recognize field boundaries, we must also look at the 684 /* To recognize field boundaries, we must also look at the
686 previous positions; we could use `get_pos_property' 685 previous positions; we could use `Fget_pos_property'
687 instead, but in itself that would fail inside non-sticky 686 instead, but in itself that would fail inside non-sticky
688 fields (like comint prompts). */ 687 fields (like comint prompts). */
689 || (XFASTINT (new_pos) > BEGV 688 || (XFASTINT (new_pos) > BEGV
@@ -694,10 +693,12 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
694 /* Field boundaries are again a problem; but now we must 693 /* Field boundaries are again a problem; but now we must
695 decide the case exactly, so we need to call 694 decide the case exactly, so we need to call
696 `get_pos_property' as well. */ 695 `get_pos_property' as well. */
697 || (NILP (get_pos_property (old_pos, inhibit_capture_property, Qnil)) 696 || (NILP (Fget_pos_property (old_pos, inhibit_capture_property, Qnil))
698 && (XFASTINT (old_pos) <= BEGV 697 && (XFASTINT (old_pos) <= BEGV
699 || NILP (Fget_char_property (old_pos, inhibit_capture_property, Qnil)) 698 || NILP (Fget_char_property
700 || NILP (Fget_char_property (prev_old, inhibit_capture_property, Qnil)))))) 699 (old_pos, inhibit_capture_property, Qnil))
700 || NILP (Fget_char_property
701 (prev_old, inhibit_capture_property, Qnil))))))
701 /* It is possible that NEW_POS is not within the same field as 702 /* It is possible that NEW_POS is not within the same field as
702 OLD_POS; try to move NEW_POS so that it is. */ 703 OLD_POS; try to move NEW_POS so that it is. */
703 { 704 {
@@ -717,7 +718,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
717 /* NEW_POS should be constrained, but only if either 718 /* NEW_POS should be constrained, but only if either
718 ONLY_IN_LINE is nil (in which case any constraint is OK), 719 ONLY_IN_LINE is nil (in which case any constraint is OK),
719 or NEW_POS and FIELD_BOUND are on the same line (in which 720 or NEW_POS and FIELD_BOUND are on the same line (in which
720 case the constraint is OK even if ONLY_IN_LINE is non-nil). */ 721 case the constraint is OK even if ONLY_IN_LINE is non-nil). */
721 && (NILP (only_in_line) 722 && (NILP (only_in_line)
722 /* This is the ONLY_IN_LINE case, check that NEW_POS and 723 /* This is the ONLY_IN_LINE case, check that NEW_POS and
723 FIELD_BOUND are on the same line by seeing whether 724 FIELD_BOUND are on the same line by seeing whether
@@ -4836,6 +4837,7 @@ functions if all the text being accessed has this property. */);
4836 defsubr (&Sbuffer_substring); 4837 defsubr (&Sbuffer_substring);
4837 defsubr (&Sbuffer_substring_no_properties); 4838 defsubr (&Sbuffer_substring_no_properties);
4838 defsubr (&Sbuffer_string); 4839 defsubr (&Sbuffer_string);
4840 defsubr (&Sget_pos_property);
4839 4841
4840 defsubr (&Spoint_marker); 4842 defsubr (&Spoint_marker);
4841 defsubr (&Smark_marker); 4843 defsubr (&Smark_marker);
diff --git a/src/intervals.c b/src/intervals.c
index 5aa68a359d6..0e3b684f570 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -2232,7 +2232,7 @@ get_local_map (ptrdiff_t position, struct buffer *buffer, Lisp_Object type)
2232 editing a field with a `local-map' property, we want insertion at the end 2232 editing a field with a `local-map' property, we want insertion at the end
2233 to obey the `local-map' property. */ 2233 to obey the `local-map' property. */
2234 if (NILP (prop)) 2234 if (NILP (prop))
2235 prop = get_pos_property (lispy_position, type, lispy_buffer); 2235 prop = Fget_pos_property (lispy_position, type, lispy_buffer);
2236 2236
2237 SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte); 2237 SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte);
2238 SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte); 2238 SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte);
diff --git a/src/intervals.h b/src/intervals.h
index 51dfa09c5c4..40f32645ba0 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -296,8 +296,6 @@ Lisp_Object get_char_property_and_overlay (Lisp_Object, Lisp_Object,
296 Lisp_Object, Lisp_Object*); 296 Lisp_Object, Lisp_Object*);
297extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos, 297extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos,
298 Lisp_Object buffer); 298 Lisp_Object buffer);
299extern Lisp_Object get_pos_property (Lisp_Object pos, Lisp_Object prop,
300 Lisp_Object object);
301 299
302extern void syms_of_textprop (void); 300extern void syms_of_textprop (void);
303 301
diff --git a/src/keyboard.c b/src/keyboard.c
index 450592a07b6..be863adcb96 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1771,8 +1771,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
1771 than skip both boundaries. However, this code 1771 than skip both boundaries. However, this code
1772 also stops anywhere in a non-sticky text-property, 1772 also stops anywhere in a non-sticky text-property,
1773 which breaks (e.g.) Org mode. */ 1773 which breaks (e.g.) Org mode. */
1774 && (val = get_pos_property (make_number (end), 1774 && (val = Fget_pos_property (make_number (end),
1775 Qinvisible, Qnil), 1775 Qinvisible, Qnil),
1776 TEXT_PROP_MEANS_INVISIBLE (val)) 1776 TEXT_PROP_MEANS_INVISIBLE (val))
1777#endif 1777#endif
1778 && !NILP (val = get_char_property_and_overlay 1778 && !NILP (val = get_char_property_and_overlay
@@ -1789,8 +1789,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
1789 } 1789 }
1790 while (beg > BEGV 1790 while (beg > BEGV
1791#if 0 1791#if 0
1792 && (val = get_pos_property (make_number (beg), 1792 && (val = Fget_pos_property (make_number (beg),
1793 Qinvisible, Qnil), 1793 Qinvisible, Qnil),
1794 TEXT_PROP_MEANS_INVISIBLE (val)) 1794 TEXT_PROP_MEANS_INVISIBLE (val))
1795#endif 1795#endif
1796 && !NILP (val = get_char_property_and_overlay 1796 && !NILP (val = get_char_property_and_overlay
@@ -1843,12 +1843,12 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
1843 to the other end would mean moving backwards and thus 1843 to the other end would mean moving backwards and thus
1844 could lead to an infinite loop. */ 1844 could lead to an infinite loop. */
1845 ; 1845 ;
1846 else if (val = get_pos_property (make_number (PT), 1846 else if (val = Fget_pos_property (make_number (PT),
1847 Qinvisible, Qnil), 1847 Qinvisible, Qnil),
1848 TEXT_PROP_MEANS_INVISIBLE (val) 1848 TEXT_PROP_MEANS_INVISIBLE (val)
1849 && (val = get_pos_property 1849 && (val = (Fget_pos_property
1850 (make_number (PT == beg ? end : beg), 1850 (make_number (PT == beg ? end : beg),
1851 Qinvisible, Qnil), 1851 Qinvisible, Qnil)),
1852 !TEXT_PROP_MEANS_INVISIBLE (val))) 1852 !TEXT_PROP_MEANS_INVISIBLE (val)))
1853 (check_composition = check_display = 1, 1853 (check_composition = check_display = 1,
1854 SET_PT (PT == beg ? end : beg)); 1854 SET_PT (PT == beg ? end : beg));
diff --git a/src/xterm.c b/src/xterm.c
index 446b2cf1e45..8be25646577 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5774,7 +5774,7 @@ static void xembed_send_message (struct frame *f, Time,
5774 *FINISH is X_EVENT_DROP if event should not be passed to the toolkit. 5774 *FINISH is X_EVENT_DROP if event should not be passed to the toolkit.
5775 *EVENT is unchanged unless we're processing KeyPress event. 5775 *EVENT is unchanged unless we're processing KeyPress event.
5776 5776
5777 We return the number of characters stored into the buffer. */ 5777 We return the number of characters stored into the buffer. */
5778 5778
5779static int 5779static int
5780handle_one_xevent (struct x_display_info *dpyinfo, 5780handle_one_xevent (struct x_display_info *dpyinfo,