From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: bounds-of-thing-at-point for paragraphs Date: Sun, 1 Nov 2020 14:10:28 -0800 (PST) Message-ID: <008364db-a1df-4d26-a516-da1890be3c6c@default> References: <568cb7cf-928b-4c5a-af3f-fd0d3d13f55a@default> <83zh40ev2o.fsf@gnu.org> <87h7q8bzc1.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29141"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Christopher Dimech , Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 01 23:11:11 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZLZ9-0007TC-Ic for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 23:11:11 +0100 Original-Received: from localhost ([::1]:44108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZLZ8-00050v-Lj for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 17:11:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZLYf-0004zY-5s for help-gnu-emacs@gnu.org; Sun, 01 Nov 2020 17:10:41 -0500 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:36864) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZLYd-0005SG-7m for help-gnu-emacs@gnu.org; Sun, 01 Nov 2020 17:10:40 -0500 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0A1MAZpt130826; Sun, 1 Nov 2020 22:10:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=+O6/ILkhQawiIzbS0hi9vkBlQnrNVjl8ssHfQkyHk9c=; b=xbeasPjGmKmFlwxoBSg3fPTEZC/veQqAMF/v7myeH5hrO7SuSkuTmfd/olRI/whp/N0E ldoNt0T9Eavs5wmVy3/uxaCbLLPLTKmygHa4Yt9af8r4u/KSwpKN7xqvjhWV860kuxrS W2ztjC4ORd/w2efxaG9EyIYmtmcd86X2C472CJ4+qqUHsrDAAMBREqD7e3nWFb47O6f1 fZQLVrGUrWqs+xWXydrkFJ/1eQnaP66KO97j0oJWbreI1vGHwa84/Y9JYFEq5M6KALQ3 23G3yvmTIh9AviqqJ9CvuF0gqXpue4LWg4tdPqb3asYhZMitS4wjf66nMGFvh/te9jSi XQ== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 34hhb1sh4x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 01 Nov 2020 22:10:34 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0A1MAXa2015849; Sun, 1 Nov 2020 22:10:34 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 34hw0ascq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 01 Nov 2020 22:10:34 +0000 Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0A1MAThO003742; Sun, 1 Nov 2020 22:10:29 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5056.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9792 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011010181 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9792 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 suspectscore=0 clxscore=1015 mlxlogscore=999 impostorscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 spamscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011010181 Received-SPF: pass client-ip=141.146.126.79; envelope-from=drew.adams@oracle.com; helo=aserp2130.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/01 16:46:08 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124925 Archived-At: > > I think for discoverability for non-Elisp-programmer Emacs users it > > would be nice at least if there was something that would dynamically > > generate a list for you. >=20 > Fully agree. A list is a beautiful thing. I use this, which is a straightforward definition from the thingatpt.el Commentary. (defun icicle-defined-thing-p (thing) "Return non-nil if THING is defined as a thing-at-point type. THING is normally a symbol, but it can also be a string that names a symbol or a cons whose car is such a string. This is so that the function can be used to filter completion candidates." (when (consp thing) (setq thing (car thing))) (when (stringp thing) (setq thing (intern thing))) (let ((forward-op (or (get thing 'forward-op) (intern-soft (format "forward-%s" thing)))) (beginning-op (get thing 'beginning-op)) (end-op (get thing 'end-op)) (bounds-fn (get thing 'bounds-of-thing-at-point)) (thing-fn (get thing 'thing-at-point))) (or (functionp forward-op) (and (functionp beginning-op) (functionp end-op)) (functionp bounds-fn) (functionp thing-fn)))) (defun icicle-things-alist () "Alist of most thing types currently defined. Each is a cons (STRING), where STRING names a type of text entity for which there is a either a corresponding `forward-'thing operation, or corresponding `beginning-of-'thing and `end-of-'thing operations. The list includes the names of the symbols that satisfy `icicle-defined-thing-p', but with these excluded: `thing', `buffer', `point'." (let ((types ())) (mapatoms (lambda (tt) (when (icicle-defined-thing-p tt) (push (symbol-name tt) types)))) ;; Remove types that don't make sense. (dolist (typ '("thing" "buffer" "point")) (setq types (delete typ types))) (setq types (sort types #'string-lessp)) (mapcar #'list types))) Remove the mapcar sexp in the latter definition, if you want just a list, not an alist, of names. Map `intern' over the list if you want symbols instead of strings.