From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: default text-properties-at to use (point) Date: Tue, 22 Oct 2019 11:27:19 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="15587"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 22 11:27:33 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iMqRx-0003wM-2z for ged-emacs-devel@m.gmane.org; Tue, 22 Oct 2019 11:27:33 +0200 Original-Received: from localhost ([::1]:52158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqRv-0003Zr-PZ for ged-emacs-devel@m.gmane.org; Tue, 22 Oct 2019 05:27:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53947) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqRn-0003UA-K0 for emacs-devel@gnu.org; Tue, 22 Oct 2019 05:27:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqRm-0001uL-KN for emacs-devel@gnu.org; Tue, 22 Oct 2019 05:27:23 -0400 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:46464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMqRm-0001tc-Eb for emacs-devel@gnu.org; Tue, 22 Oct 2019 05:27:22 -0400 Original-Received: by mail-wr1-x42c.google.com with SMTP id n15so6401170wrw.13 for ; Tue, 22 Oct 2019 02:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:mail-copies-to:gmane-reply-to-list:date:message-id :mime-version:content-transfer-encoding; bh=86vOP4Sox0dnjgSyguLZrCTRQFVcwXsL54CVzTF7qXI=; b=ciO1ckFpP+Ug3vIwaNbGGVRgLcOd1/FYtyzGV6cx7E+rbDVg7m4lvdQbKhh/JO2D0p cS+TN05Fao8P7lwYdKeExGjezOoTda4xYBCfuzLsBly04jmIGnOhFdUID8UWtQAh809e wvPztZSA3IaN8bPSsyCXmjjZTrAPrU9MClSf6y7bNSiVG//B0MXSd0Ma9zX4emJTa9n7 kxrS+HURbpx4WIU65UoQLBtxusD/ZqZaCAaUec5Hsz2QY8cECOvTvmGHgzlg0CBWTLV2 vlMNcpeelH09pgOqUniSiqZVlT1h89JlBLnCnHnwbip/YtDlEdwbeNecC+NnoBrJoO4g zQoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:mail-copies-to :gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=86vOP4Sox0dnjgSyguLZrCTRQFVcwXsL54CVzTF7qXI=; b=Y6WwTdd5IspJoin1+uOHznQvatJsO9RqGH1kFyhQkBcIkzJNEt2aJHQ8wF2LOTb6n1 6VKCETx14X0EVK+mXfHZ5yEWwhg+sz1b0Hkq9LwQT4GPoOSYxd+Hx649vhTGVfe3zhGO +47MyVQoEGS3Z+BYOpYHY0BlwzgHXVTwLqEo7vOm/K8O+Ax4pZ4B0zKTOwcV8fjMLSzf mAKsZv/BIorDirvMk+qvuASmZc0jJ+LKW4VsldsxUyQrgKYa8J8YR2vf68+i+iibMxxV lxac5fc6nI7UGjQmpmwpXNsi961HoAd8NGurwXG2Jz4v/wHbamcCpyAMX2FexnQlo4qV KJsg== X-Gm-Message-State: APjAAAXGacs8hyERMze3qA7agvEJ5CKiZ4WN4HoB2/dfP+DNvayJ9hT+ c9c30RqsJipUjzU0Wuns/kF861e2 X-Google-Smtp-Source: APXvYqwMwzqK1VPrpPn4rjIqB8Y1rYT5fgohpn77CGg/hgL4jAHyIJ3F+3u8pn/nU7gfsSSwhyRLMA== X-Received: by 2002:adf:e512:: with SMTP id j18mr2436046wrm.291.1571736440800; Tue, 22 Oct 2019 02:27:20 -0700 (PDT) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id p21sm8447530wmc.25.2019.10.22.02.27.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 02:27:19 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:241327 Archived-At: 'text-properties-at' is somewhat annoying to use interactively, since it doesn=CA=BCt 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; =20 + if (NILP (position)) + position =3D Fpoint (); if (NILP (object)) XSETBUFFER (object, current_buffer); =20