From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Add/remove an element into/from a cons. Date: Tue, 26 Oct 2021 14:30:47 +0800 Message-ID: References: <875ytkqt4x.fsf@gnu.org> <87wnm0papx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37457"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 26 09:22:00 2021 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 1mfGmV-0009Wa-N1 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 26 Oct 2021 09:21:59 +0200 Original-Received: from localhost ([::1]:43114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfGmT-0001Hq-97 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 26 Oct 2021 03:21:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfFzD-0005gn-OG for help-gnu-emacs@gnu.org; Tue, 26 Oct 2021 02:31:10 -0400 Original-Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]:38722) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfFzA-0007CN-OO; Tue, 26 Oct 2021 02:31:02 -0400 Original-Received: by mail-ua1-x932.google.com with SMTP id o26so13155187uab.5; Mon, 25 Oct 2021 23:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6FZNtifr03+rs2GOLdjSFqtmWfvwwU+EP8iT1Ihrg60=; b=NBL231MSmydZxogSnftzRGSNRDxKl8hPdsAqVj0jy/hMDXN6rMW1pG39QNcEY4ZbyV tPX/Z4caOKZM3398h3nFXc8DMvnKdfiyAacJQU5hWFYx1S1u15SvWjQM70UjvgaymGtQ I0PelISK+DVVstke+2JlrF8eewjyYqzyOHZLqYlKHvK85jPvi4aQ38xlA6z3veN8xVPA g1CLcUd75QzfwmEkRx3Y8C3Ri2LA+xFV6WuMNvF6fWcVGGIzk1JAJzzuJASVkN416L7d dMac1Um/IjLax0hW0XOqKDBf8fHWJQu6D4BGnBqnqRa3v8JBbDV0P9aBJlqGsNssAvwh FFTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6FZNtifr03+rs2GOLdjSFqtmWfvwwU+EP8iT1Ihrg60=; b=x2WUQr8NmmCa+BpjVoyurYQXFPxWx1vf9YFY42hAxw/MyVUqKGrZT3oX8VLXbKFoQ8 8QvMpFw0wlqjsYdRUlreFRenSZId96ChJUm1q8Vsjg82R6EmXwAfdReJmcPfKkZyWcC+ +zcCfg91Ajd1roki1gRTsw0CP/YUp7knakIZnsqfWkbtCbA5UhfTnHm/APEgJmKNaEA2 tFKn/vLmFRHfWmzFuUTbOWJIW3IpvaVx5w2+y0R3kO1vicCALj2Zy3LRZincjzPO/o7H La8V68xlNvrOZJ1OcLrreYrkh0KEdCLGu3lKW+0ngfb5VEhbQUrqA541pDjpe+to4yEI N9UQ== X-Gm-Message-State: AOAM533E7vQ0qIFwuaN3Yya91A/NdXGkWstew0i8Q5Szrwb8zYqkXdzT HXl67ISAQ0ZeF7ubbKzcDttGw6JHYvBIxlaDIIvdjpu6ykYCzA== X-Google-Smtp-Source: ABdhPJw6kq0FlkWD9n237+yZIf+uam5mXH5pMZRwmSOSiqe/d4cTOEk96XUvylpo2SJhKzR5uMpMtTNerqxOPso3Q5o= X-Received: by 2002:a05:6102:3a4c:: with SMTP id c12mr6163126vsu.10.1635229858798; Mon, 25 Oct 2021 23:30:58 -0700 (PDT) In-Reply-To: <87wnm0papx.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::932; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x932.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, 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.23 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" Xref: news.gmane.io gmane.emacs.help:134186 Archived-At: On Tue, Oct 26, 2021 at 2:21 PM Tassilo Horn wrote: > > Hongyi Zhao writes: > > > (defun my-scratch-init () > > (with-current-buffer "*scratch*" > > (setq-local company-backends (let ((place (assoc 'company-tabnine > > company-backends))) > > (setf place (remove 'company-ispell place)))) > > )) > > setf returns the new value, so here you are setting company-backends to > the modified alist entry, not the alist itself. This should work: > > --8<---------------cut here---------------start------------->8--- > (defun my-scratch-init () > (with-current-buffer "*scratch*" > ;; Ensure it has a local variable. Not sure if it has by default... > (make-local-variable 'company-backends) > (let ((place (assoc 'company-tabnine company-backends))) > (setf place (remove 'company-ispell place))))) > --8<---------------cut here---------------end--------------->8--- It doesn't work. The variable hasn't been revised when I'm switch to scratch buffer.