unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* default text-properties-at to use (point)
@ 2019-10-22  9:27 Robert Pluim
  2019-10-22  9:37 ` Andreas Schwab
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Robert Pluim @ 2019-10-22  9:27 UTC (permalink / raw)
  To: emacs-devel

'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)
 }
 \f
 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);
 



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-10-22 16:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-22  9:27 default text-properties-at to use (point) Robert Pluim
2019-10-22  9:37 ` Andreas Schwab
2019-10-22 12:22   ` Robert Pluim
2019-10-22  9:39 ` Lars Ingebrigtsen
2019-10-22  9:46   ` Andreas Schwab
2019-10-22 11:46     ` Robert Pluim
2019-10-22 14:13     ` Lars Ingebrigtsen
2019-10-22 14:41       ` Andreas Schwab
2019-10-22  9:50 ` Lars Ingebrigtsen
2019-10-22 10:48   ` Dmitry Gutov
2019-10-22 14:35 ` Eli Zaretskii
2019-10-22 14:38   ` Robert Pluim
2019-10-22 14:55     ` Lars Ingebrigtsen
2019-10-22 14:55     ` Lars Ingebrigtsen
2019-10-22 16:02     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).