emacs-devel
[Top][All Lists]
Advanced

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

default text-properties-at to use (point)


From: Robert Pluim
Subject: default text-properties-at to use (point)
Date: Tue, 22 Oct 2019 11:27:19 +0200

'text-properties-at' is somewhat annoying to use interactively, since
it doesnʼt default to point. How about the following (plus appropriate
doc/NEWS changes)?

diff --git a/src/textprop.c b/src/textprop.c
index 93d19754da..9741099dc4 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -556,8 +556,9 @@ interval_of (ptrdiff_t position, Lisp_Object object)
 }

 DEFUN ("text-properties-at", Ftext_properties_at,
-       Stext_properties_at, 1, 2, 0,
+       Stext_properties_at, 0, 2, 0,
        doc: /* Return the list of properties of the character at POSITION in 
OBJECT.
+Optional first arg POSITION nil means use the value of point.
 If the optional second argument OBJECT is a buffer (or nil, which means
 the current buffer), POSITION is a buffer position (integer or marker).
 If OBJECT is a string, POSITION is a 0-based index into it.
@@ -566,6 +567,8 @@ DEFUN ("text-properties-at", Ftext_properties_at,
 {
   register INTERVAL i;
 
+  if (NILP (position))
+      position = Fpoint ();
   if (NILP (object))
     XSETBUFFER (object, current_buffer);
 



reply via email to

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