From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?Windows-1252?Q?Vincent_Bela=EFche?= Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: =?Windows-1252?Q?RE:_info_URL_=AB_open_at_point_=BB_patch?= Date: Sun, 24 Jun 2018 20:30:04 +0000 Message-ID: References: , <86C481C5-D11D-4598-92CB-9DA98ADA03CC@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1529872123 8078 195.159.176.226 (24 Jun 2018 20:28:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2018 20:28:43 +0000 (UTC) Cc: "emacs-orgmode@gnu.org" , EMACS devel list To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 24 22:28:39 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXBck-00020v-Qg for ged-emacs-devel@m.gmane.org; Sun, 24 Jun 2018 22:28:39 +0200 Original-Received: from localhost ([::1]:43035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXBes-0000z4-0k for ged-emacs-devel@m.gmane.org; Sun, 24 Jun 2018 16:30:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXBeE-0000yx-E8 for emacs-devel@gnu.org; Sun, 24 Jun 2018 16:30:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXBeB-0006lO-9P for emacs-devel@gnu.org; Sun, 24 Jun 2018 16:30:10 -0400 Original-Received: from mail-oln040092064104.outbound.protection.outlook.com ([40.92.64.104]:50265 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fXBeA-0006kf-UC; Sun, 24 Jun 2018 16:30:07 -0400 Original-Received: from HE1EUR01FT042.eop-EUR01.prod.protection.outlook.com (10.152.0.60) by HE1EUR01HT021.eop-EUR01.prod.protection.outlook.com (10.152.0.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.906.15; Sun, 24 Jun 2018 20:30:04 +0000 Original-Received: from AM6PR10MB1957.EURPRD10.PROD.OUTLOOK.COM (10.152.0.58) by HE1EUR01FT042.mail.protection.outlook.com (10.152.0.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.906.15 via Frontend Transport; Sun, 24 Jun 2018 20:30:04 +0000 Original-Received: from AM6PR10MB1957.EURPRD10.PROD.OUTLOOK.COM ([fe80::dd8b:be8e:3ac9:f4f4]) by AM6PR10MB1957.EURPRD10.PROD.OUTLOOK.COM ([fe80::dd8b:be8e:3ac9:f4f4%4]) with mapi id 15.20.0884.024; Sun, 24 Jun 2018 20:30:04 +0000 Thread-Topic: =?Windows-1252?Q?info_URL_=AB_open_at_point_=BB_patch?= Thread-Index: AQHUC4irnDfXG0kiIkiW1qZfH5sKO6RvfTcAgAA8qV8= In-Reply-To: <86C481C5-D11D-4598-92CB-9DA98ADA03CC@gmail.com> Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:76DE9F9FB4A7EE108672C0E5BA159F0DEEFD26502DB19B548860B2A2B15DE377; UpperCasedChecksum:9DB6E73AEC2CE9C674312489CFBA3AFC06EDEF7625023DA7DD2469E60068014B; SizeAsReceived:7251; Count:47 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [NNFSyW3TW6T2RaCfosJ+QzCM0SX4AwDo] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1EUR01HT021; 7:ZGR8gcfLYndyg/yTClJIpFOZ5vFMD/XjUFbDBnG3mEwxa7Fql47H7Y0UzqpbvRK2Zt+T87D7OaKJ9+38b74R7EIUQR6b95ucv8mIkvvzIRMY71Ou1QQPE+UbEFUBe/hWui/93l5rtPt3XZ4eXiLto0EX7s1Zkut734hxmuh6eH+K1/DqFf+HTwosjTR5UC/Mm/xQzB6HLJiWNKPEy2QBm5mYZ9w91uTXKX8jppLb0kGEjLCkS+LV7+rLzcotGFUk x-incomingheadercount: 47 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125500)(1701031045); SRVR:HE1EUR01HT021; x-ms-traffictypediagnostic: HE1EUR01HT021: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:HE1EUR01HT021; BCL:0; PCL:0; RULEID:; SRVR:HE1EUR01HT021; x-forefront-prvs: 0713BC207F x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(199004)(189003)(51444003)(102836004)(6346003)(26005)(33656002)(3280700002)(81156014)(7696005)(3660700001)(8936002)(105586002)(106356001)(76176011)(6506007)(74316002)(305945005)(82202002)(229853002)(6436002)(9686003)(74482002)(97736004)(25786009)(73972006)(55016002)(104016004)(4326008)(6246003)(39060400002)(5660300001)(68736007)(6916009)(2900100001)(14454004)(5250100002)(86362001)(11346002)(54906003)(486006)(476003)(1411001)(446003)(99286004); DIR:OUT; SFP:1901; SCL:1; SRVR:HE1EUR01HT021; H:AM6PR10MB1957.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:; received-spf: None (protection.outlook.com: hotmail.fr does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=vincent.b.1@hotmail.fr; x-microsoft-antispam-message-info: CJ2niquFGQCoSbX8Gnx4HVgDJNMSlDjUi27frQ5g4kPb0BKDQX/r24fjMxWp33No05HuLXOc46hVn0xiYXp+BVpGqypCvouCAsFYzRDODWr0QkS/cx1nAL2L0uMFrbkDXcGddC1xc7DDsRh86M/gWrlY8I8bP2HgXTaiH4dPDiUk4qU5EHGuEjMOv96jyvu+XgFTi5zxe//zSvdN+1UKEuwxB3yjlj/fUhpmRPT1kME= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: dd759f05-a917-4aa0-a2f5-4cc35c50e0c8 X-MS-Exchange-CrossTenant-Network-Message-Id: e0fb74e4-e387-4054-2ad8-08d5da1144eb X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: dd759f05-a917-4aa0-a2f5-4cc35c50e0c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2018 20:30:04.7184 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR01HT021 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.64.104 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:226674 gmane.emacs.orgmode:120946 Archived-At: I generated the regexp with (regexp-opt '("ftp" "http" "https" "file")). I admit that the list of protocols is not clear from the regexp, but it was already done this way before my change, and I tried to minimize the change. More concerning in my opinion is how the Info-get-token is written. As some point of the code one can read the following statement: =A0=A0=A0=A0=A0 ;; First look for a match for START that goes across POS. =A0=A0=A0=A0=A0 (while (and (not (bobp)) (> (point) (- pos (length start))) =A0=A0=A0 (not (looking-at start))) =A0(forward-char -1)) Here start is a regexp, so (length start) is just the length of the string holding the regexp, not the max length over which the regexp match can span. For instance assume that aaaaaaaaaa is a new new protocol which you want Info-get-token to catch. This is 10 character long, but the typical regexp to catch it would be =AB=A0a\{10\}=A0=BB which= is only 7 character long. It would propably be cleaner to provide the value to be used instead of (length start) as a separate optional argument that would be set to (length start) if omitted. Another way would be to have some standard function max-matchable-length that given some regexp would compute the maximum length of its match (or output some special value like t if the maximum length is infinite), thus (length start) could be replaced by (max-matchable-length start) --- maybe this is already somthing existing. In the same vein there could be some standard function that given regexp re and some position pos-in would function position pos-out such that the following expression would be true: (save-excursion =A0 (goto-char pos-out) =A0 (and (<=3D pos-out pos-in) =A0=A0=A0=A0=A0=A0 (looking-at re) =A0=A0=A0=A0=A0=A0 (>=3D (match-end 0) pos-in))) I think that such standard function is already existing, but I can't remember the package name which provides it=85 =A0 V.=