From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Possible bug: org-capture fails when emacs started as daemon Date: Wed, 16 Aug 2023 11:00:21 -0400 Message-ID: References: <87ttt3dkad.fsf@localhost> <87jztwdz7k.fsf@ice9.digital> <87o7j8p7k1.fsf@localhost> <83wmxw8776.fsf@gnu.org> <871qg3wcav.fsf@gmx.com> <83cyzn84nm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39568"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: inigoserna@gmx.com, yantar92@posteo.net, morgan@ice9.digital, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 16 17:01:56 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qWI1z-000A2Z-Nh for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Aug 2023 17:01:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWI0q-0007PH-4b; Wed, 16 Aug 2023 11:00:45 -0400 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 1qWI0a-00079e-JE for emacs-devel@gnu.org; Wed, 16 Aug 2023 11:00:34 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWI0X-0003d6-6r; Wed, 16 Aug 2023 11:00:27 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6854E442875; Wed, 16 Aug 2023 11:00:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1692198021; bh=sd39r+Kn7JJQlK2im+LhfpL8yZQA7nznQX8p2QV4KzM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DWcLi7z3IJXw9a5wiErDDv+1CU19yTQde2dWeSVg3q1aJx1Oh0Rs2ed523wjs48Fm HvjlC/6GRxnAxBfjzwGHZsmt2QlvmDULn0ltu0AWZBhPu++9u2eoFL0/ikO1AGEcMp C+QZPWKnhhgk8MndHBpqGctj30KltESFzgDo5ZY4FTt/Xnc6FseFyJ/x2FQYfHU2D4 t1UoiKwhUcjEd/+K1mEXhkUams0iu3zn/EK+ibwxKig/qpISAMOkI9wprmt8KIlDAF 0QGcEdU5nzmKaaladrP/590+Sxu2GLuE3Uk13E3VQ3bEL1av7u+ICchgqA3W0kSTDc HlWQrtB/aX0xA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DB3A744287A; Wed, 16 Aug 2023 11:00:21 -0400 (EDT) Original-Received: from pastel (unknown [45.72.228.154]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AB8AB120208; Wed, 16 Aug 2023 11:00:21 -0400 (EDT) In-Reply-To: <83cyzn84nm.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Aug 2023 17:04:29 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308825 Archived-At: > Stefan, any comments? You wrote the face-remap--copy-face stuff, > AFAICT. Not sure how I ended up with that code, which is fundamentally wrong: `face-remap--copy-face` should take a face value but we pass it elements of `face-remap-alist` which are not facevalues but are cons cells (FACENAME . FACEVALUE) instead. If we want to preserve the "careful" approach in the current code, then the patch below should fix it. If we want to make the code simpler, then we should throw away `face-remap--copy-face` and use `copy-tree` instead. Stefan diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 3ec271b67a4..ae4e9853ad3 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -79,12 +79,13 @@ face-remap--copy-face ;; `add-face-text-property'. (if (or (not (listp val)) (keywordp (car val))) val - (copy-sequence val))) + (mapcar #'face-remap--copy-face val))) (defun face-attrs--make-indirect-safe () "Deep-copy the buffer's `face-remapping-alist' upon cloning the buffer." (setq-local face-remapping-alist - (mapcar #'face-remap--copy-face face-remapping-alist))) + (mapcar (lambda (x) (cons (car x) (face-remap--copy-face (cdr x)))) + face-remapping-alist))) (add-hook 'clone-indirect-buffer-hook #'face-attrs--make-indirect-safe)