From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Leo Butler Newsgroups: gmane.emacs.help Subject: Re: etags - Word separators with xref-find-definitions Date: Mon, 26 Jul 2021 09:45:18 -0500 Message-ID: <87bl6pcewx.fsf@t14.reltub.ca> References: <874kciydpa.fsf@online.de> <83o8aqwkyh.fsf@gnu.org> <87im0ys2kl.fsf@online.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="29212"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Christian Barthel Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 26 16:51:29 2021 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 1m81x3-0007RO-AL for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 26 Jul 2021 16:51:29 +0200 Original-Received: from localhost ([::1]:42748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m81x2-0000qC-2q for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 26 Jul 2021 10:51:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m81w2-0000nE-P8 for help-gnu-emacs@gnu.org; Mon, 26 Jul 2021 10:50:27 -0400 Original-Received: from mail-to1can01on0728.outbound.protection.outlook.com ([2a01:111:f400:fe5d::728]:19552 helo=CAN01-TO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m81w0-0001as-37 for help-gnu-emacs@gnu.org; Mon, 26 Jul 2021 10:50:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MMbsbq+LBdc1UG5GWxqBl86OXL4gu4hczluXOTYre4+g5wAXEvPrbHTp3NUkIKGofDwLHb5LRZsGJrTo99m9FTOPZQPqXmr4sXHtENvC8F7Q8SBYI3BUmni6uYn4YfcOfzr7v4NPnamzcl8q/SObeim84r0KkcGpQqp0Ynss0ZdvadAO+Fvr8Wv1MHRpsO9si1/0c+am8vHMaKu6WIdRDyreYjUrzeVmXM15yUlATLSOEnQu0Nzk7K0Zj9NlXk2/jAS8yDdGPzaglTRUdvX3lWpNqvegMjDykY+cyuu8RXMA/AzaI2+vXYIhZBkFz5QkYtvA5AJStcFmzL6g/BotqQ== 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-SenderADCheck; bh=1lIQA8OQm420oLqYYwSIfsqAFZ/90qtLS4kWSFTbW98=; b=MJ3Y0Yc9W3KIdc+nr+AfA46QcaYZpovrgzlNg5+94WC8urKsf2Zy7N77DUmKsltAwVNfhu7nSJ8I0rOBsKxeyqmNA9zjbZ6P2AgNbOPebjryii1fkxfX4CKGFxq0ejrrbjUM1lqEj3yheF+W/corQNzkBRXxkca401f7KvX2VmF3A8P/WA/GdHYhKMqZBb039nObZdmZ0WcigfCTh7fltYkxSv56GrabucXiV5Yuv24lHdUr3oEkHj/5M1nCu8FVhVLqKnNsh69h0yK2NmPpitsTuiLy+LMJSCK2bmx1HjPE7OSmT0v5YvmvvrzkC5hmtF4yFIF7KWp4spW1I8ubzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=umanitoba.ca; dmarc=pass action=none header.from=umanitoba.ca; dkim=pass header.d=umanitoba.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umanitoba.onmicrosoft.com; s=selector2-umanitoba-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1lIQA8OQm420oLqYYwSIfsqAFZ/90qtLS4kWSFTbW98=; b=cObWAr67g2f3PrMDjfjfWkLWqccTd2MMkMRJw6Tm0fMG9T89vvBtvtkHAEL1lFLUlfBNItAfsDBxISBdnqqGirPIiDeSOIWe5yZM+Mw+L6P50ayvfFCYRWKiGumctCm5SUA+XGMlADyMjb2VbfgPeEcGLpsTE+j+7SWKSV0qLAw= Authentication-Results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=umanitoba.ca; Original-Received: from YTBPR01MB3053.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:21::31) by YT1PR01MB3148.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26; Mon, 26 Jul 2021 14:45:22 +0000 Original-Received: from YTBPR01MB3053.CANPRD01.PROD.OUTLOOK.COM ([fe80::b926:b079:6737:7770]) by YTBPR01MB3053.CANPRD01.PROD.OUTLOOK.COM ([fe80::b926:b079:6737:7770%5]) with mapi id 15.20.4352.031; Mon, 26 Jul 2021 14:45:22 +0000 In-Reply-To: <87im0ys2kl.fsf@online.de> (Christian Barthel's message of "Sun, 25 Jul 2021 19:52:58 +0200") X-ClientProxiedBy: MWHPR21CA0062.namprd21.prod.outlook.com (2603:10b6:300:db::24) To YTBPR01MB3053.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:21::31) X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from t14 (45.44.33.194) by MWHPR21CA0062.namprd21.prod.outlook.com (2603:10b6:300:db::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.2 via Frontend Transport; Mon, 26 Jul 2021 14:45:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 198475a0-204e-4fd8-6de1-08d95043fea1 X-MS-TrafficTypeDiagnostic: YT1PR01MB3148: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6OwNy1TiGfGBZvpv+I9tF2aqjpoi9M0PQUcZTIudkKOYu5UGSBuz2CYtjE+Eh8swtXgOYBlQSIvtLwRb3XMVFkNPtmfCk2P3r6b70g4udjoZOjtI705VwaThAbAdLeKB3dx4CecJ/oBwaHglPcfskFsxoJm/8W5resoWyHITBieE7mW2EHDElhBGw41mczd3vy/ZRTpOCOgd0evufeQj7uzLDJ+f5HowtpkXlTeNtGJNlrx7E/S3Owq8nNRKcNgyon6Vp6vRIaxi9klx3yXNLiqSNA2OtPIrW2UDLXZQPkZIthElk9ibKdxl4kF3YjdjieYbjKef/c5WJo9cgK3iaV9aPaz+9UFlPBKNVTjRHqHLBiz/OIUP+z95cxc1vp1BdvHV0qTZ6uGB49WWyM8b4ccW0xMwZkY/GxZL6CAVy5sSsdWcKQ5xwHoh/4kMCveOHsWSAj4hP5xO0MQKpcXWIYjCMKc7MdGWfTcmHoErumDF1TVCk7ikty81gLFWG9d9whoiWU4Hhp3fPsv3rar/qnsLgrHc8bDUibxQmgrgXO+ZaaQnGh8HgcHaadnqzZKPrrpdN+HOjCmQsy515f+DKE1/FUFYO6lHZotP9Sqp9NVpqn6LkeDI9HCtbt2ljaZJLy7n2FEWKWt1rSUrZcQCeblL6JYXmBHm9DalZ/ZKDL8EzP2iLQUF2jOvW2i+lUZo X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YTBPR01MB3053.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(376002)(396003)(136003)(346002)(366004)(39850400004)(66946007)(83380400001)(66476007)(66556008)(38100700002)(38350700002)(2906002)(786003)(52116002)(6496006)(5660300002)(9686003)(8936002)(8676002)(186003)(86362001)(26005)(316002)(6486002)(4326008)(6916009)(956004)(478600001)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N0Z4Mi9Tak5rdFJNNlFaaXhJa2RxVlRIOUFEVG5RQmNoYURzZ2VUZEd3RHZN?= =?utf-8?B?Vi85eFBDWm13d2c4V0JEMUNvaUxhNWtUUk5BbVBDS2thcm5mZzhEaWw5Vm9v?= =?utf-8?B?a0Yva1JBY1dPQnY1R1B1eXZ5S1ZQNGQ2VklidjlSbnRIOHhvM050MDJRTy9R?= =?utf-8?B?NTNwaW5jaGJySXJJVHJCcEhvVVRkZGQ2TlkzYmRIWiszN1dzUzdtaDJVRTc4?= =?utf-8?B?a3Z1UUxEUHNESUtIUzkySkFhbjlmNjdwM3laUzNVNTBmZ1dXdEdzVmFUME1L?= =?utf-8?B?NGlMRS9iSnN1YVhNNCtveHpEenVjYnZJNmRxOW5CUXV6UGd0RGxMYlM1MjFh?= =?utf-8?B?alZ4RDQySlFwbXZIbUVEYStVQUZ3Nk02K1ltbmdNRWMrSHhWcVlrUHdRTC9n?= =?utf-8?B?dGhpa3RyOXdiVVNHVkJlL1UwTmdSWTk2YW1acXhBWHZiTHZXci82MzYvUS9q?= =?utf-8?B?enJtRm9CdnJKYnVUNWJLUGVxUk9IZjR4VlBVUFNGYWU0aG16dlBhVFFJK25L?= =?utf-8?B?TGFDRGp3eDUwQVM4SlBiY2xXb0ltaW4veXI5NU9LNC9HWkZXRzZjdHJlRHA1?= =?utf-8?B?UXBwNStzazZMZ1BQK0dYRmY2cXhUK3FwOEQrbkJCc1J1NHFQcENWRlU4aHhY?= =?utf-8?B?LzhyZFAyaGtEU3YwTEFna1NzZElQaEo5RlJkSn X-OriginatorOrg: umanitoba.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 198475a0-204e-4fd8-6de1-08d95043fea1 X-MS-Exchange-CrossTenant-AuthSource: YTBPR01MB3053.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2021 14:45:21.9266 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4f80dd0b-338c-4e4c-8a14-90446962f7b8 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZwYgNmfUCouhk8BUxtvIwxXwtMRtR9OdtLgY/QxX4v4sVsJHuq5hOSHj1mkuCSA/u/FX4gPJV76KCxRgaozSlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB3148 Received-SPF: pass client-ip=2a01:111:f400:fe5d::728; envelope-from=Leo.Butler@umanitoba.ca; helo=CAN01-TO1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, MSGID_FROM_MTA_HEADER=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:132114 Archived-At: Christian Barthel writes: > On Sun, Jul 25 2021, Eli Zaretskii wrote: > >>> Is it possible to customize the xref function such that it >>> recognize =E2=80=98schema.objectname=E2=80=99? Are there any variables= to >>> control the behavior of M-. ? >> >> You need to customize the etags.el function that is used to guess the >> symbol at point. The function is this: >> >> (defun find-tag--default () >> (funcall (or find-tag-default-function >> (get major-mode 'find-tag-default-function) >> #'find-tag-default))) >> >> So either customizing find-tag-default-function to point to a function >> of your choice, or making such a function local to the SQL major mode >> by putting the property on the major-mode's symbol, should do the >> job. You will probably need to write the function itself, though. > > OK, thanks so far. My first draft for this looks something like > this: > > (defun find-sql-identifier () > (when (thing-at-point-looking-at > "\\([.a-zA-Z0-9]*\\)" 50) > (if (match-beginning 1) > (buffer-substring (match-beginning 1) (match-end 1)) > ""))) > (put major-mode 'find-tag-default-function 'find-sql-identifier) Thanks for these pointers, Eli and Christian. I was able to fix a similar problem I had with `xref-find-definitions' when trying to use it with latex-mode to look up bibtex citations. Leo