From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Barbier Newsgroups: gmane.emacs.help Subject: Re: help in writing function to pop indirect buffer Date: Sat, 28 Jan 2023 12:59:47 +0100 Message-ID: <63d50c2c.5d0a0220.cad7c.0cb0@mx.google.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39794"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs , Jean Louis To: Luca Ferrari Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 28 12:52:08 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 1pLjkd-000AA9-C8 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 28 Jan 2023 12:52:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLjjo-0007iM-7H; Sat, 28 Jan 2023 06:51:16 -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 1pLjjl-0007iB-QX for help-gnu-emacs@gnu.org; Sat, 28 Jan 2023 06:51:13 -0500 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLjjk-0002JK-8z for help-gnu-emacs@gnu.org; Sat, 28 Jan 2023 06:51:13 -0500 Original-Received: by mail-wr1-x434.google.com with SMTP id q5so7216148wrv.0 for ; Sat, 28 Jan 2023 03:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=jz3dSXJq8s7Z0bsuwafqjhR2RlSBq5wFK1pAxPGjd3Y=; b=EPzHofsLz86rEjS1hx05QTD7oBClur0p3bEXr/99tgTVbrZW4+/Hx6vNpMBUE0zzzU fx6pilrjuYBDhmAbMXc8rqvksZPVCXveO3WtPKZV/TKfoQtaT33Ut9rBW32/FtgEYfhX VW/McuiBq+FJSTAJLp27UnUTcNC3ewl7QOrS3jYQ9YsYCZSaOozDw28QMhJEQ6NpuQMe GiAk077/FfW2Vd+v8Y1q5KzGHrDJT6zSjFu+6vm29lsBTxo2pK17put7wkr9M+FwCGul 4UPAgada8U2uPqyzXg3bfozB1LxM75bULG8Bx9eN8EY7iKf66T/oVpGGeAE/Xlb/U/xw j+Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jz3dSXJq8s7Z0bsuwafqjhR2RlSBq5wFK1pAxPGjd3Y=; b=JSd9yj1iuBR/82/lCioMkmBrbuGYs0/0mL3ju8Ve7wF5fG+McK61p4S+q4Ibzstp+t 7uV+P8QXKsZpuWS0y76MvZvQfUTEvvnHhkhcwOH2nDY/2qYSORZEh8zj+u9G82utJxpr Yxu3SpQaNJ9hfrb1uQ3lFOWnSm6a+/LraeRaQz/hWPB6asS+eA5eBa9Sdc35ZpLbBBSD ixa4/EXp4jY8+dyaoMMcPLh4lrjk2tv0TjFhVCO133SSdPOvB12FhpX5Q9rz0Z55icR6 mwfJLalnb3t0uZRU4zqXks8AQd1DZYoqqDQe4Qoimh9LA6cF+JY8Dskp4btL96czuw2B ebiw== X-Gm-Message-State: AFqh2krFRuUPp65GI8DpJC8nhzNkG/7TxCEvfTSLTeP1t2KVl4HrRgLM GleQ7zFJqYnpSaEVjkL/6mk= X-Google-Smtp-Source: AMrXdXsf1c2QJOD9uzQ9FCZ3jvJWhqraifjrGtSC2s25XH5OZClLQ+ZMhCPXbuvDnQ2v03JypbC3KA== X-Received: by 2002:adf:dd41:0:b0:2be:d9e7:f39a with SMTP id u1-20020adfdd41000000b002bed9e7f39amr23357185wrm.43.1674906668828; Sat, 28 Jan 2023 03:51:08 -0800 (PST) Original-Received: from tosh-laptop ([2a01:e0a:505:3460:1a16:a0c4:3f89:c0d9]) by smtp.gmail.com with ESMTPSA id f6-20020a5d50c6000000b002bfc24e1c55sm6477047wrt.78.2023.01.28.03.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 03:51:08 -0800 (PST) Original-Received: by tosh-laptop (sSMTP sendmail emulation); Sat, 28 Jan 2023 12:59:47 +0100 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=brubar.cs@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:142546 Archived-At: Bruno Barbier writes: > I'm getting the same warning, but fontification seems to work and is > updated in both buffers. Playing with your idea with an org buffer, I discovered that I was wrong. It works only if the base buffer and the indirect buffer are in the same major mode (and, also, when forcing fontification of the invisible/undisplayed pieces of text after any change). In your use case, it might not be possible to use indirect buffers: the base buffer and the indirect buffer share the same text and its properties, and, syntax highlighting is mostly done using text properties. Org mode allows to edit pieces of text in any mode (using standard buffers). The lisp function doing most of the work is `org-edit-src-code'. Maybe you could call/reuse something from there. Bruno