From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Omar Polo Newsgroups: gmane.emacs.help Subject: Re: don't understand setq-default Date: Sun, 18 Apr 2021 15:02:26 +0200 Message-ID: <87eef7ycd9.fsf@omarpolo.com> References: <87mttvx1lo.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22656"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 28.0.50 Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 18 15:03:35 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 1lY75K-0005nK-8K for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Apr 2021 15:03:34 +0200 Original-Received: from localhost ([::1]:45602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lY75J-0006pA-AN for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Apr 2021 09:03:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lY74i-0006p0-N3 for help-gnu-emacs@gnu.org; Sun, 18 Apr 2021 09:02:56 -0400 Original-Received: from mail.omarpolo.com ([144.91.116.244]:50635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lY74e-0005MQ-Um for help-gnu-emacs@gnu.org; Sun, 18 Apr 2021 09:02:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omarpolo.com; s=20200327; t=1618750958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dibmD7xmeaP1K4wzJuSfpUhWCYdgG+i7OrkS0tOwZJE=; b=LS78ZFbePJcfPs3PIE6NHtjsqCbtnR+sUUyWztbJnHBoH2pF7wCHaX0+i8Bs+JuhkBAm9V LiYiz9haV9x3OAIrbsGXXyf/9pdj/vlRQROai3BiMIwbHcQTdmu8JR4+jCXOtSyvwmpArk /rmIVW8uNwDhB7XY76fH+NUX/2akqdI= Original-Received: from localhost (host-87-2-232-216.retail.telecomitalia.it [87.2.232.216]) by mail.omarpolo.com (OpenSMTPD) with ESMTPSA id 521193f2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 18 Apr 2021 15:02:37 +0200 (CEST) Original-Received: from venera (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 4e78833c; Sun, 18 Apr 2021 15:02:26 +0200 (CEST) In-reply-to: <87mttvx1lo.fsf@zoho.eu> Received-SPF: pass client-ip=144.91.116.244; envelope-from=op@omarpolo.com; helo=mail.omarpolo.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, 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:129027 Archived-At: Emanuel Berg via Users list for the GNU Emacs text editor writes: > I don't understand `setq-default', maybe I never did, unsure. > > The docstring isn't good, it only describes how it will > happens which is intuitive at that (well, that's good that > it) but not how and why it is used. > > [...] buffer can have local version of some variables. In addition, some variables automatically becomes buffer-local when set (like `indent-tabs-mode' for instance.) The docstring seems pretty clear to me: > [...] > > (setq-default [VAR VALUE]...) > > Probably introduced at or before Emacs version 18. > > Set the default value of variable VAR to VALUE. > VAR, the variable name, is literal (not evaluated); > VALUE is an expression: it is evaluated and its value returned. > **The default value of a variable is seen in buffers > that do not have their own values for the variable.** (emphasis mine) So the question becomes: "when can a buffer have a non-default value for a variable?" (info "(elisp) Buffer-Local Variables") should have more information on the matter > [...]