[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On removing some obsolete code from subr and core

From: Johan Bockgård
Subject: Re: On removing some obsolete code from subr and core
Date: Mon, 07 Nov 2016 22:32:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> you or someone else know better why the default-FOO variables might be
>> needed again,
> The only reason would be backward compatibility.
>> or why they were implemented in the first place.
> I'm pretty sure it's for historical reasons.

NEWS.18 says this:

     ** Built-in per-buffer variables improved.

     Several built-in variables which in the past had a different value in
     each buffer now behave exactly as if `make-variable-buffer-local' had
     been done to them.

     These variables are `tab-width', `ctl-arrow', `truncate-lines',
     `fill-column', `left-margin', `mode-line-format', `abbrev-mode',
     `overwrite-mode', `case-fold-search', `auto-fill-hook',
     `selective-display', `selective-display-ellipses'.

     To be precise, each variable has a default value which shows through
     in most buffers and can be accessed with `default-value' and set with
     `set-default'.  Setting the variable with `setq' makes the variable
     local to the current buffer.  Changing the default value has retroactive
     effect on all buffers in which the variable is not local.

     The variables `default-case-fold-search', etc., are now obsolete.
     They now refer to the default value of the variable, which is not
     quite the same behavior as before, but it should enable old init files
     to continue to work.

and the old behavior was this, according to Emacs 17 Antinews:

    The function setq-default has been eliminated.  Use set-default and quote
    the variable name, as in

    (set-default 'variable value)

    Several built-in variables now are always local to all buffers.  These
    variables are tab-width, ctl-arrow, truncate-lines, fill-column,
    left-margin, mode-line-format, abbrev-mode, overwrite-mode,
    case-fold-search, auto-fill-hook, selective-display.  set-default does not
    work with these variables.  They do have defaults, but the defaults affect
    only buffers yet to be created.  The only way to set the default for
    variable foo is to set the variable named default-foo, such as
    default-case-fold-search and default-fill-column.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]