From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Drawing to cairo context from within emacs module? Date: Thu, 05 Dec 2019 09:11:11 -0500 Message-ID: References: <87eexlb1d4.fsf@randomsample> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="120934"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eivind Fonn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 05 15:13:20 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 1icrsd-000VLR-6i for ged-emacs-devel@m.gmane.org; Thu, 05 Dec 2019 15:13:19 +0100 Original-Received: from localhost ([::1]:54952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icrsb-0005xC-Fb for ged-emacs-devel@m.gmane.org; Thu, 05 Dec 2019 09:13:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52958) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icrqh-0005tx-Kn for emacs-devel@gnu.org; Thu, 05 Dec 2019 09:11:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icrqf-0008KA-M9 for emacs-devel@gnu.org; Thu, 05 Dec 2019 09:11:18 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10832) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1icrqd-0008IX-Sx for emacs-devel@gnu.org; Thu, 05 Dec 2019 09:11:16 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3996B100473; Thu, 5 Dec 2019 09:11:14 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 62CB110033A; Thu, 5 Dec 2019 09:11:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1575555072; bh=43N6u3YUsv4CNZiYQe8hFGVjXYXQp6wzUyhpWLEWnRg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=TberO43leeFyE/On6ivUqxuwjl55n2aJdGtowxRp1lwlWlBIZMHS654+wetbCO8UU t5F6O1UXPzNSiEWsW83ynf1r2Y03FVjELfxk0o6qAMw00EBLxhBMN8HKOgPz/4D3VN 6HXkf3H2LCk6nATfuNdzQ0C32T8Z+3m77mGl5Nv9MoMlCfLTjho4mu0YdWzAzCtrZI DjaL9735QKLhB745B/Wzk/lRlKZmqeycmLaBJ1qu+fhQ9hWNl/IR/h6mWt7Lio1HD9 qLF5BpXZxjJ3bLajNVJDR+fAEyuYIh/qehXlIxdv3Du6M0n80AiHJIX4+PNe1Z1/8P S7r3W4ngiwddg== Original-Received: from pastel (unknown [45.72.228.205]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2977A120974; Thu, 5 Dec 2019 09:11:12 -0500 (EST) In-Reply-To: (Eivind Fonn's message of "Thu, 5 Dec 2019 14:42:58 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 132.204.25.50 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:243152 Archived-At: > A related but different question. Would it be possible to get access to > the raw buffer data from dynamic modules? (That is, pointer to the start, > length and gap information.) You might like to talk with Stephen Leake . IIUC he wrote a dynamic module which parses the buffer. AFAICT he didn't use such a "raw" access, so it'd be interesting to hear about his experience. > I'm only interested in read-only access, and I'd be happy to patch it > in myself if it's deemed generally acceptable. It would tend to expose internal data subject to change (and offer the ability to change this data in a way that can break some invariants), so it's definitely not in the style of the current module interface. But we may be able to provide a slightly less "raw" access that doesn't suffer in the same way. So details about your particular needs would be helpful to try and figure out what we can do (i.e. tell us the problems you face when using `char-after` or `buffer-substring`, which would be the main ways I can think of to access the buffer's content with the current module API). Stefan