From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Possible bug: org-capture fails when emacs started as daemon Date: Wed, 16 Aug 2023 17:04:29 +0300 Message-ID: <83cyzn84nm.fsf@gnu.org> References: <87ttt3dkad.fsf@localhost> <87jztwdz7k.fsf@ice9.digital> <87o7j8p7k1.fsf@localhost> <83wmxw8776.fsf@gnu.org> <871qg3wcav.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26411"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, morgan@ice9.digital, emacs-devel@gnu.org To: inigoserna@gmx.com, Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 16 16:05:07 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 1qWH91-0006dz-Ge for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Aug 2023 16:05:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWH8O-00024f-EB; Wed, 16 Aug 2023 10:04:28 -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 1qWH8M-00024O-NS for emacs-devel@gnu.org; Wed, 16 Aug 2023 10:04:26 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWH8K-0007Gq-Ql; Wed, 16 Aug 2023 10:04:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=qayLbIGc+g1g+f1B7Db0t2hviwFcj8+dagw8QX2uWjI=; b=DTXtjnPAHdivhKPi9McH NsDFzNlHlJLE/j0L54G8mn7UtlkI6Fk/MUl79UPXsoQNvW+IzbCUcS9lkKyt2DAf+VnlAGV9HHM8F db+lPXo1+X+bp4dW+EDHtnNdvGiXtYI1qR6VySlDll5UnKJ8aLRIelrfT2QmCGDd5dacZ//Ft2R/R QBbjCjyQuQiHPzOL+iiv53Q1vz6To3z1+Z00o2MkAy9CCeW76QhkqCpXFJxrmWOX7j8sZqMvP9WkQ VChjtfUwmoqi2xBi3HsEpZH5XRxPquVLpwnKSIfZsg8IrUN51q9MevliGzfYZ9XqAMXqX6I6UalRw 4r9XXyiC7o01/Q==; In-Reply-To: <871qg3wcav.fsf@gmx.com> (message from =?utf-8?Q?I=C3=B1igo?= Serna on Wed, 16 Aug 2023 11:25:01 +0200) 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:308821 Archived-At: > From: IƱigo Serna > Cc: Ihor Radchenko , morgan@ice9.digital, > emacs-devel@gnu.org > Date: Wed, 16 Aug 2023 11:25:01 +0200 > > I've attached a simple case for the bug. > I can reproduce the issue with emacs v29 and master. Thanks. > In the example, there is a `minibuffer-setup-hook' to modify > minibuffer face, and a simple minor-mode which changes > `mode-line-active' face background color when enabled. AFAIU, the minibuffer-setup-hook part is not needed for this recipe to demonstrate the problem. > Then, when `test-mode' is enabled, `clone-indirect-buffer' fails. > > Steps: > 1. $ emacs -q -l test.el -> note minibuffer font size is bigger > 2. M-x test-mode -> note mode-line background color > changes > 3. M-x clone-indirect-buffer > => Error: "face-attrs--make-indirect-safe: Wrong type argument: > listp, test-modeline" > > > A complete backtrace: > > Debugger entered--Lisp error: (wrong-type-argument listp > test-modeline) > face-remap--copy-face((mode-line-active . test-modeline)) > face-attrs--make-indirect-safe() > clone-indirect-buffer(nil t) > funcall-interactively(clone-indirect-buffer nil t) > command-execute(clone-indirect-buffer record) > execute-extended-command(nil "clone-indirect-buffer" "clone-in") > funcall-interactively(execute-extended-command nil > "clone-indirect-buffer" "clone-in") > command-execute(execute-extended-command) Please see if the patch below gives good results. Stefan, any comments? You wrote the face-remap--copy-face stuff, AFAICT. diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 3ec271b..e86a292 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -70,6 +70,7 @@ internal-lisp-face-attributes :foreground :background :stipple :overline :strike-through :box :font :inherit :fontset :distant-foreground :extend :vector]) +(autoload 'cl-copy-list "cl-lib") (defun face-remap--copy-face (val) "Return a copy of the `face' property value VAL." ;; A `face' property can be either a face name (a symbol), or a face @@ -79,7 +80,10 @@ face-remap--copy-face ;; `add-face-text-property'. (if (or (not (listp val)) (keywordp (car val))) val - (copy-sequence val))) + ;; Handle association (foo . bar) from face-remapping-alist. + (if (not (proper-list-p val)) + (cl-copy-list val) + (copy-sequence val)))) (defun face-attrs--make-indirect-safe () "Deep-copy the buffer's `face-remapping-alist' upon cloning the buffer."