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: [External] : Any packages using ThingAtPointPlus for activation? Date: Mon, 2 Jan 2023 17:08:19 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33549"; mail-complaints-to="usenet@ciao.gmane.io" To: Jean Louis , Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 02 18:08:55 2023 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 1pCOIu-0008SQ-J7 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 02 Jan 2023 18:08:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCOIY-00009T-E0; Mon, 02 Jan 2023 12:08:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCOIW-000097-I0 for help-gnu-emacs@gnu.org; Mon, 02 Jan 2023 12:08:28 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCOIU-0007V8-Ar for help-gnu-emacs@gnu.org; Mon, 02 Jan 2023 12:08:28 -0500 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3021xLCH024585; Mon, 2 Jan 2023 17:08:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=+9nVvlGmYps+QqkKW6PyiPSVck90oEgc9NMeehBLy+4=; b=gCM/ek8pBQZY3pZbPYqShyRgFPc53XOF+GXmmKEL0cMcErFUentEbv03HdEUxJDqFzCL KlyVdQjyGl6qD5n9cUBBDuHcaNiDX2o2ldr5AbaIMET+QJ54Y5uMvXW6NqkOShwPRzbe tlrhXf3v83dyvX+LXtb+YIY/aliGZC9Pa6DfyLcXGMM2qTj8T1npRJWLfU9IYzuS3LlL ejn4LrYgMHLZWFKYJV8/YalXtJf6qmiv1yFz7i3Mb3gufRmEY4PYQTtCk4ewbR/iXvNj Wn8N3Ou96R9OgZzoVVmpbK9UH+M51LX0Jw/ARL41ZrhZ7sY5jtAl4ucxkUdIG3NAw/wU 2g== Original-Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mtbp0tmcy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 02 Jan 2023 17:08:21 +0000 Original-Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 302FuJgc032991; Mon, 2 Jan 2023 17:08:21 GMT Original-Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2047.outbound.protection.outlook.com [104.47.66.47]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mtbh3wkf5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 02 Jan 2023 17:08:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dHiU0W+sxVW8JDqvXx8/DKUTHtkbgiMGw7E5/liO36gZLT12qH6m6QBGf1jboMO9ihwlB/w969MbDkRITHmTxR+iLGE82mkD932R2XLpN/WhPkbvBxIf0ngjkHbdelv86FRYfLYypu4u5whU96qnxSNCzKEIzjBI7LEmvalnQLYyRTfm42XSOfClg4r5xL1nwCNd+QBDoAGByrCpEfBTEGz8TblhnKAKp00Ng74GEl/cImTIHLK230B9rSalF1vQtkawJU1Ms9ZW16B2BEY6jFYpttQcDDlmZhFZ8LlFx8She3N71ekodqsQiCMar5GGtSATc7Zrl28eEYetlyNytQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+9nVvlGmYps+QqkKW6PyiPSVck90oEgc9NMeehBLy+4=; b=V5adCsMhas3zHHzdBc4rzFs66iOmgUU0r3fz/PXUBTvioJxYTFziA8zNtAF2HKTWsl8w4ZQRGi9auXmVGVXI0fBJqLMy6VvwarAUoS71qeTHhCZF7SlxX8wFIxGizXIk10GZ09XwlcMPl7hqeHrP35w8A+sNu01SpfGGR48qEMI9QjjExmosdOvuxP21jSUgTBxg/PwQHxitMJuASbsrxSUY4v8oT3dGf6O7iqLrCpCQC/N2rzArIj1dXcp1dgFn9rHOJP7stPya/mdQsUtm/qzfTPrV5zXPBtR8HQZO6+3ZSLU2CojR1DHmtOQ0rt4ahYYKCtxhx3rWnCyFgHn/vA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+9nVvlGmYps+QqkKW6PyiPSVck90oEgc9NMeehBLy+4=; b=PmTR2Qnnkcy1beEByTXniTfDRsTs5o0tGFJDzau+NwVKMMjR4xmjNBRd1lLYovJwvW9aGWfhLBLELHdvmhbVLqv5KWeiFTSl8BT21PzSL8Ax9SWHjSg957SUvJ/aDcjwNoyK3hD86DyX/f+AAnJcLU/xVxHarr3uXTFIc8VGlt4= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by PH7PR10MB5879.namprd10.prod.outlook.com (2603:10b6:510:130::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Mon, 2 Jan 2023 17:08:19 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29%8]) with mapi id 15.20.5944.019; Mon, 2 Jan 2023 17:08:19 +0000 Thread-Topic: [External] : Any packages using ThingAtPointPlus for activation? Thread-Index: AQHZHpLBqTVpnOWr/ESyOkE1JHaTU66LTvZQ In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|PH7PR10MB5879:EE_ x-ms-office365-filtering-correlation-id: 28fc0b08-91d4-4fbd-1187-08daece3f232 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ueFkU2ieyqlCNB+rxJchpQblkLm5eaGUPhwRsnjUfZ2WC0S3+e3uH3yuQMej63XqkJMfWPuCAzbb6MKiDqXH21PshteGouc+4xj5E35MEyuctQ0k97gDT+TsUKLlp2LMFnjHvqu8gXhDheMsIeBj5IxtYIQuaXpiTvdftMu2K5Kv9nM/CIpmd1zaQEfn66ZYzGJMx+OKmWHx9udmi8Kt2+9R1EJ529ML1C6jY629KEsjyAuMSMTn1ENgqaczesTsqE6VgY78D9ZdhlTRPcBN6FDHqcPosFdnblAZR+RXkf7WiWPwA4p3xucSf1EusM4pJ7rXpHmONMJ13n2ht79NG0DJGh0Dz0EOdu7yS2uegC8eTuCf/c5ptV9/sGxtK+uyz3jXWWfKyNcnq5oHsDXq89IYTYhtOKOq4p11sJ4GgcRILrbU3xqQz4+mcVh+cBPQvA6QyrNawXK/txDhReQrPVQ2wla11YBFUZEHgKwcDzXG/pXy8ThJJ1XUfqGVu/ibXeD7upaMALpAIGjVup6c9GqeA1u8ysMJBqOOygPd7BEFKhgLCJK8bVwSSStSxpQCS6Uro/httiUiTbBFf5Cdc5P0k9TMJg/HmslWe3k0vX+cf6/QEsaDLt4bzJ3RjVKGpwYNbftjJ45qfb7U+LGffKgO4bSdmI2Yq2B3VNMfDAyVtH4WYlh6HjEiFj8Qgpj135Gl51wfug7yIPLodN7MUuBf84s19YCxpBV2MH3Gn3vDf1DoGGB9b+/Iz/mWr 7Hu x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(6029001)(396003)(366004)(136003)(376002)(346002)(39860400002)(451199015)(83380400001)(38070700005)(86362001)(122000001)(38100700002)(2906002)(52536014)(44832011)(8936002)(41300700001)(5660300002)(55016003)(478600001)(6506007)(7696005)(186003)(26005)(316002)(9686003)(64756008)(66446008)(66476007)(8676002)(66556008)(71200400001)(966005)(110136005)(66946007)(66899015)(76116006)(33656002)(22166006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oBK9ELUfO53zd17xqvM1lQWKffFR47hbUe8w+TZAaAr53/PUuJjB2TAaVkRj?= =?us-ascii?Q?XnE2T4FmkSpKMFZfju2yWwyLvJgDu03pifPlBXuBFZsd2+rzN+aerBDlJ4YF?= =?us-ascii?Q?6yDwauLJ5ouBkLfVrctJZytYtsz8AzaT6cuiG7iQ44KAOHLf51iz56qcK/c4?= =?us-ascii?Q?57cYivnFwIYWKf5MAF/Cx4Yc6BygiO8LBplcgsN7PsOTXmdzL44cp8qZy3mR?= =?us-ascii?Q?SNtTIljpLr1J8yY9yhMUR+9QIx/xeirOy5faQne04nqxS6iI6MPJdsw1O60L?= =?us-ascii?Q?g3rF2pjVK8Ss5LPcgdlFq2kfJXXe2JDtMT4EMewoJwXCMTOnR6g94PiKV9H1?= =?us-ascii?Q?gr9z0p6/hsxQf3d9HqpaVQ/mDzoLQiZjGxTdpWViK8MKcP/JRLZofuAdw0pK?= =?us-ascii?Q?aj5PNYtUY8YPnD+oq+IbMEI3ouOVf30e3F2xnYTt9xr1x3AWYxhA6e6WfNt/?= =?us-ascii?Q?onLx16R3Y6ScFq+2nAJCX7GsyUf4PaAyeapfhP6ng5V11ZDXphjTJiQCPvfV?= =?us-ascii?Q?T6HMX6elkMLmwDJ2RlAz1TVMScTqT5Ule13ztFlnz23YoFYylMZeHF4ulP+2?= =?us-ascii?Q?g4EaubHT+mew1Tz4yCULb/FjVzhl7d2/1YVW0N6rc/Bvt077s52YF03/Qlwa?= =?us-ascii?Q?im X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28fc0b08-91d4-4fbd-1187-08daece3f232 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jan 2023 17:08:19.1289 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: F54xwDvy2C14DM5/8g15neXuFygRrjK7jBzbLHlFzEwwQyhmqifV5RvJc7s3HXdwlAhFiNoJMI0ZOV+d0jxNLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB5879 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-02_10,2022-12-30_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 mlxscore=0 phishscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301020155 X-Proofpoint-GUID: EgtWhlSRPdf3bC1GzjQfCzw70Jl_Mukv X-Proofpoint-ORIG-GUID: EgtWhlSRPdf3bC1GzjQfCzw70Jl_Mukv Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142097 Archived-At: > Regarding your library `thingatpt+.el': >=20 > You probably know Hyperbole and how M-RET works in Hyperbole. Nope, sorry. I probably don't know about most things available with Emacs - many, anyway. > [I wish] to jump to various functions by using > thing-at-point plus. It gives me freedom to easier > define what I need, and if nothing found I can still > include Hyperbole function on the end. >=20 > The concept to "jump" based on some things at point,=20 > is useful. I jump faster to various pieces of information. >=20 > Here is the preliminary function that shows the concept: >=20 > (defun hyperscope-action-button (&optional prefix) > (interactive "p") > (cond ((thing-at-point 'uuid) (rcd-db-uuid-action (thing-at-point > 'uuid))) I suggest you don't invoke `thing-at-point' multiple times needlessly. Use `let', to do the work only once. > ((thing-at-point 'url)...) > ((thing-at-point 'email)...) > ((thing-at-point 'symbol) > (let ((symbol (intern (thing-at-point 'symbol)))) > (cond ((fboundp symbol) > (find-function symbol)) > ((boundp symbol) > (find-variable symbol)) > (t (rcd-warning-message "..."))))) > ... Don't use (`thing-at-point 'symbol) for this. Perhaps unfortunately, Emacs has that return text at point that has symbol syntax - in the current mode. It doesn't return a Lisp symbol name at point (unless you're in `emacs-lisp-mode'). Use `symbol-at-point' (or, if you want only currently defined Elisp symbols, `tap-symbol-at-point'). They return a Lisp symbol - no need to intern. If you want, instead of doing such a `cond' here, just define functions `lisp-function-at-point' and `lisp-var-at-point'. Then you can use those anytime you like, not just here. The code and Commentary in `thingatpt+.el' shows you how to do that. E.g., (defun lisp-function-at-point "Return a Lisp function at point, or nil." (tap-form-at-point 'symbol 'fboundp)) `tap-form-at-point' (and vanilla `form-at-point') returns a Lisp object corresponding the textual THING that's its first object, provided that that Lisp object satisfies the PREDICATE that is its second object. You can also define a function to give you the bounds (limits) of a thing, e.g., the bounds of the Lisp function named at point: (put 'lisp-function 'tap-bounds-of-thing-at-point 'tap-bounds-of-lisp-function-at-point) (defun tap-bounds-of-lisp-function-at-point () "Return bounds of the Lisp function at point. Return nil if none is found." (and (lisp-function-at-point) (tap-bounds-of-thing-at-point 'symbol))) > Do you know of any existing package(s), apart from Hyperbole, that > deal in similar way with action keys and jumping based on what is found > under the point? I'm the wrong person to ask about what packages are available for things. But the Emacs manual, node `Xref' tells you about ways to find the source code (definitions) for existing "identifiers", which can be any "syntactical subunit of [a] program: a function, a subroutine, a method, a class, a data type, a macro, etc." https://www.gnu.org/software/emacs/manual/html_node/emacs/Xref.html That may help to some extent. But you apparently want to jump to other kinds of things. Bookmarks do that - you can define a bookmark type for "jumping" to anything. That's the original purpose of Emacs bookmarks. And "jump" can mean whatever you like. You can use thing-at-point to get the name of a thing of a particular kind at point, and then jump to it using a bookmark. Hopefully others will have other suggestions.