emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115212: Export get_pos_property to Elisp.


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r115212: Export get_pos_property to Elisp.
Date: Sun, 24 Nov 2013 18:28:45 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115212
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sun 2013-11-24 13:28:33 -0500
message:
  Export get_pos_property to Elisp.
  * src/editfns.c (Fget_pos_property): Rename from get_pos_property.
  (syms_of_editfns): Export it to Elisp.
modified:
  etc/NEWS                       news-20100311060928-aoit31wvzf25yr1z-1
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/editfns.c                  editfns.c-20091113204419-o5vbwnq5f7feedwu-255
  src/intervals.c                intervals.c-20091113204419-o5vbwnq5f7feedwu-519
  src/intervals.h                intervals.h-20091113204419-o5vbwnq5f7feedwu-520
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2013-11-24 09:31:51 +0000
+++ b/etc/NEWS  2013-11-24 18:28:33 +0000
@@ -731,6 +731,8 @@
 
 * Lisp Changes in Emacs 24.4
 
+** New function get-pos-property.
+
 ** New hook `pre-redisplay-function'.
 
 +++

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-11-24 18:20:18 +0000
+++ b/src/ChangeLog     2013-11-24 18:28:33 +0000
@@ -1,5 +1,9 @@
 2013-11-24  Stefan Monnier  <address@hidden>
 
+       Export get_pos_property to Elisp.
+       * editfns.c (Fget_pos_property): Rename from get_pos_property.
+       (syms_of_editfns): Export it to Elisp.
+
        * data.c (Fmake_variable_buffer_local): Mention `permanent-local'.
 
 2013-11-23  Romain Francoise  <address@hidden>

=== modified file 'src/editfns.c'
--- a/src/editfns.c     2013-11-06 10:14:50 +0000
+++ b/src/editfns.c     2013-11-24 18:28:33 +0000
@@ -343,16 +343,15 @@
   return idx;
 }
 
-/* Return the value of property PROP, in OBJECT at POSITION.
-   It's the value of PROP that a char inserted at POSITION would get.
-   OBJECT is optional and defaults to the current buffer.
-   If OBJECT is a buffer, then overlay properties are considered as well as
-   text properties.
-   If OBJECT is a window, then that window's buffer is used, but
-   window-specific overlays are considered only if they are associated
-   with OBJECT. */
-Lisp_Object
-get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object 
object)
+DEFUN ("get-pos-property", Fget_pos_property, Sget_pos_property, 2, 3, 0,
+       doc: /* Return the value of POSITION's property PROP, in OBJECT.
+Almost identical to `get-char-property' except for the following difference:
+Whereas `get-char-property' returns the property of the char at (i.e. right
+after) POSITION, this pays attention to properties's stickiness and overlays's
+advancement settings, in order to find the property of POSITION itself,
+i.e. the property that a char would inherit if it were inserted
+at POSITION.  */)
+  (Lisp_Object position, register Lisp_Object prop, Lisp_Object object)
 {
   CHECK_NUMBER_COERCE_MARKER (position);
 
@@ -484,7 +483,7 @@
      specially.  */
   if (NILP (merge_at_boundary))
     {
-      Lisp_Object field = get_pos_property (pos, Qfield, Qnil);
+      Lisp_Object field = Fget_pos_property (pos, Qfield, Qnil);
       if (!EQ (field, after_field))
        at_field_end = 1;
       if (!EQ (field, before_field))
@@ -683,7 +682,7 @@
       && (!NILP (Fget_char_property (new_pos, Qfield, Qnil))
           || !NILP (Fget_char_property (old_pos, Qfield, Qnil))
           /* To recognize field boundaries, we must also look at the
-             previous positions; we could use `get_pos_property'
+             previous positions; we could use `Fget_pos_property'
              instead, but in itself that would fail inside non-sticky
              fields (like comint prompts).  */
           || (XFASTINT (new_pos) > BEGV
@@ -694,10 +693,12 @@
           /* Field boundaries are again a problem; but now we must
              decide the case exactly, so we need to call
              `get_pos_property' as well.  */
-          || (NILP (get_pos_property (old_pos, inhibit_capture_property, Qnil))
+          || (NILP (Fget_pos_property (old_pos, inhibit_capture_property, 
Qnil))
               && (XFASTINT (old_pos) <= BEGV
-                  || NILP (Fget_char_property (old_pos, 
inhibit_capture_property, Qnil))
-                  || NILP (Fget_char_property (prev_old, 
inhibit_capture_property, Qnil))))))
+                  || NILP (Fget_char_property
+                          (old_pos, inhibit_capture_property, Qnil))
+                  || NILP (Fget_char_property
+                          (prev_old, inhibit_capture_property, Qnil))))))
     /* It is possible that NEW_POS is not within the same field as
        OLD_POS; try to move NEW_POS so that it is.  */
     {
@@ -717,7 +718,7 @@
          /* NEW_POS should be constrained, but only if either
             ONLY_IN_LINE is nil (in which case any constraint is OK),
             or NEW_POS and FIELD_BOUND are on the same line (in which
-            case the constraint is OK even if ONLY_IN_LINE is non-nil). */
+            case the constraint is OK even if ONLY_IN_LINE is non-nil).  */
          && (NILP (only_in_line)
              /* This is the ONLY_IN_LINE case, check that NEW_POS and
                 FIELD_BOUND are on the same line by seeing whether
@@ -4836,6 +4837,7 @@
   defsubr (&Sbuffer_substring);
   defsubr (&Sbuffer_substring_no_properties);
   defsubr (&Sbuffer_string);
+  defsubr (&Sget_pos_property);
 
   defsubr (&Spoint_marker);
   defsubr (&Smark_marker);

=== modified file 'src/intervals.c'
--- a/src/intervals.c   2013-10-11 06:32:29 +0000
+++ b/src/intervals.c   2013-11-24 18:28:33 +0000
@@ -2232,7 +2232,7 @@
      editing a field with a `local-map' property, we want insertion at the end
      to obey the `local-map' property.  */
   if (NILP (prop))
-    prop = get_pos_property (lispy_position, type, lispy_buffer);
+    prop = Fget_pos_property (lispy_position, type, lispy_buffer);
 
   SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte);
   SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte);

=== modified file 'src/intervals.h'
--- a/src/intervals.h   2013-09-20 15:34:36 +0000
+++ b/src/intervals.h   2013-11-24 18:28:33 +0000
@@ -296,8 +296,6 @@
                                            Lisp_Object, Lisp_Object*);
 extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos,
                                      Lisp_Object buffer);
-extern Lisp_Object get_pos_property (Lisp_Object pos, Lisp_Object prop,
-                                     Lisp_Object object);
 
 extern void syms_of_textprop (void);
 

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2013-11-14 17:43:49 +0000
+++ b/src/keyboard.c    2013-11-24 18:28:33 +0000
@@ -1771,8 +1771,8 @@
                    than skip both boundaries.  However, this code
                    also stops anywhere in a non-sticky text-property,
                    which breaks (e.g.) Org mode.  */
-                && (val = get_pos_property (make_number (end),
-                                            Qinvisible, Qnil),
+                && (val = Fget_pos_property (make_number (end),
+                                             Qinvisible, Qnil),
                     TEXT_PROP_MEANS_INVISIBLE (val))
 #endif
                 && !NILP (val = get_char_property_and_overlay
@@ -1789,8 +1789,8 @@
            }
          while (beg > BEGV
 #if 0
-                && (val = get_pos_property (make_number (beg),
-                                            Qinvisible, Qnil),
+                && (val = Fget_pos_property (make_number (beg),
+                                             Qinvisible, Qnil),
                     TEXT_PROP_MEANS_INVISIBLE (val))
 #endif
                 && !NILP (val = get_char_property_and_overlay
@@ -1843,12 +1843,12 @@
                   to the other end would mean moving backwards and thus
                   could lead to an infinite loop.  */
                ;
-             else if (val = get_pos_property (make_number (PT),
-                                              Qinvisible, Qnil),
+             else if (val = Fget_pos_property (make_number (PT),
+                                               Qinvisible, Qnil),
                       TEXT_PROP_MEANS_INVISIBLE (val)
-                      && (val = get_pos_property
-                          (make_number (PT == beg ? end : beg),
-                           Qinvisible, Qnil),
+                      && (val = (Fget_pos_property
+                                 (make_number (PT == beg ? end : beg),
+                                  Qinvisible, Qnil)),
                           !TEXT_PROP_MEANS_INVISIBLE (val)))
                (check_composition = check_display = 1,
                 SET_PT (PT == beg ? end : beg));

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2013-11-12 06:07:37 +0000
+++ b/src/xterm.c       2013-11-24 18:28:33 +0000
@@ -5774,7 +5774,7 @@
    *FINISH is X_EVENT_DROP if event should not be passed to the toolkit.
    *EVENT is unchanged unless we're processing KeyPress event.
 
-   We return the number of characters stored into the buffer. */
+   We return the number of characters stored into the buffer.  */
 
 static int
 handle_one_xevent (struct x_display_info *dpyinfo,


reply via email to

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