From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Getting the operational value of a buffer variable Date: Fri, 02 Dec 2022 01:07:07 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8959"; mail-complaints-to="usenet@ciao.gmane.io" To: Heime via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 02 02:07:55 2022 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 1p0uWx-00027R-8k for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Dec 2022 02:07:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0uWY-0002zD-U8; Thu, 01 Dec 2022 20:07:30 -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 1p0uWW-0002yi-Hp for help-gnu-emacs@gnu.org; Thu, 01 Dec 2022 20:07:28 -0500 Original-Received: from mail-4318.protonmail.ch ([185.70.43.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p0uWU-0002KN-Mm for help-gnu-emacs@gnu.org; Thu, 01 Dec 2022 20:07:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1669943244; x=1670202444; bh=nKDkk8X4dS3atuLXrZrMy1XjcAJWQi2A4tNygB9sv9g=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=iZSkwFHo2kwmd6PdjYW+ZcOgWw/divkuVIetKJwEnuuh+QjxjWk01INaXR9g1t7ov 0DCfqw2Lvt8Y86CsWOTHRcwONPc39Nc+DytztDBZk/rm9zFQFyA4HvkCfEJVZNiEGA 6jhNVzfkLuJ3hJhlPXhlPYWjiUDJQSRhYMXv36zO9TSMPI+N8FCB6rHJwmmA4N24X0 I/edIatMPGROo9bjak9o5tXG8fuZuImrPA9TxQycmtJLSLT/TCWmo4ERZAqkk1mYiI QC3gpxmqTZIGs/XMcP9XTvp5covlHDHmDqBCn3xm+7IEu3rBu6t/0f60g9ODjm+MRX xBvQJTGuitVuQ== Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.43.18; envelope-from=heimeborgia@protonmail.com; helo=mail-4318.protonmail.ch 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, SPF_HELO_PASS=-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:141293 Archived-At: I want to get the operational value of a buffer variable. If the buffer ha= s a local value, one=20 cannot use the default-value implementation. And if the local value in nil= , I have to get the default-value. Would like a robust implementation that would not miss anything.=20 (defun operational-value (variable) "Get the operational value of a buffer variable." (cond ((equal (buffer-local-value variable) (default-value variable)) (buffer-local-value variable)) ((equal (buffer-local-value variable) nil) (default-value variable)) ))