* On removing some obsolete code from subr and core
@ 2016-11-04 16:59 Mark Oteiza
2016-11-05 8:24 ` John Wiegley
` (4 more replies)
0 siblings, 5 replies; 30+ messages in thread
From: Mark Oteiza @ 2016-11-04 16:59 UTC (permalink / raw)
To: emacs-devel
Hi,
I was eyeing some code in subr.el that deprecated in 22, and was
wondering if there is any concern with ripping it out. In particular,
the bits included in the following patch.
The parts for buffer_defaults is incomplete of course, there are many
references to this structure. Just searching through, uses of
buffer_defaults look very easy to remove, but I may be missing something
subtle.
I removed references/uses of these functions/aliases/default-variables
in documentation and lisp in commit 2c6920a
diff --git a/lisp/subr.el b/lisp/subr.el
index fba43be..6a8911f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1290,13 +1290,6 @@ posn-object-width-height
\f
;;;; Obsolescent names for functions.
-(define-obsolete-function-alias 'window-dot 'window-point "22.1")
-(define-obsolete-function-alias 'set-window-dot 'set-window-point "22.1")
-(define-obsolete-function-alias 'read-input 'read-string "22.1")
-(define-obsolete-function-alias 'show-buffer 'set-window-buffer "22.1")
-(define-obsolete-function-alias 'eval-current-buffer 'eval-buffer "22.1")
-(define-obsolete-function-alias 'string-to-int 'string-to-number "22.1")
-
(make-obsolete 'forward-point "use (+ (point) N) instead." "23.1")
(make-obsolete 'buffer-has-markers-at nil "24.3")
@@ -1306,18 +1299,6 @@ 'string-to-int
(make-obsolete 'string-to-multibyte "use `decode-coding-string'." "25.2")
(make-obsolete 'string-as-multibyte "use `decode-coding-string'." "25.2")
-(defun insert-string (&rest args)
- "Mocklisp-compatibility insert function.
-Like the function `insert' except that any argument that is a number
-is converted into a string by expressing it in decimal."
- (declare (obsolete insert "22.1"))
- (dolist (el args)
- (insert (if (integerp el) (number-to-string el) el))))
-
-(defun makehash (&optional test)
- (declare (obsolete make-hash-table "22.1"))
- (make-hash-table :test (or test 'eql)))
-
(defun log10 (x)
"Return (log X 10), the log base 10 of X."
(declare (obsolete log "24.4"))
@@ -1319,45 +1319,6 @@ 'unfocus-frame
\f
;;;; Obsolescence declarations for variables, and aliases.
-;; Special "default-FOO" variables which contain the default value of
-;; the "FOO" variable are nasty. Their implementation is brittle, and
-;; slows down several unrelated variable operations; furthermore, they
-;; can lead to really odd behavior if you decide to make them
-;; buffer-local.
-
-;; Not used at all in Emacs, last time I checked:
-(make-obsolete-variable 'default-mode-line-format
- "use (setq-default mode-line-format) or (default-value mode-line-format) instead"
- "23.2")
-(make-obsolete-variable 'default-header-line-format 'header-line-format "23.2")
-(make-obsolete-variable 'default-line-spacing 'line-spacing "23.2")
-(make-obsolete-variable 'default-abbrev-mode 'abbrev-mode "23.2")
-(make-obsolete-variable 'default-ctl-arrow 'ctl-arrow "23.2")
-(make-obsolete-variable 'default-truncate-lines 'truncate-lines "23.2")
-(make-obsolete-variable 'default-left-margin 'left-margin "23.2")
-(make-obsolete-variable 'default-tab-width 'tab-width "23.2")
-(make-obsolete-variable 'default-case-fold-search 'case-fold-search "23.2")
-(make-obsolete-variable 'default-left-margin-width 'left-margin-width "23.2")
-(make-obsolete-variable 'default-right-margin-width 'right-margin-width "23.2")
-(make-obsolete-variable 'default-left-fringe-width 'left-fringe-width "23.2")
-(make-obsolete-variable 'default-right-fringe-width 'right-fringe-width "23.2")
-(make-obsolete-variable 'default-fringes-outside-margins 'fringes-outside-margins "23.2")
-(make-obsolete-variable 'default-scroll-bar-width 'scroll-bar-width "23.2")
-(make-obsolete-variable 'default-vertical-scroll-bar 'vertical-scroll-bar "23.2")
-(make-obsolete-variable 'default-indicate-empty-lines 'indicate-empty-lines "23.2")
-(make-obsolete-variable 'default-indicate-buffer-boundaries 'indicate-buffer-boundaries "23.2")
-(make-obsolete-variable 'default-fringe-indicator-alist 'fringe-indicator-alist "23.2")
-(make-obsolete-variable 'default-fringe-cursor-alist 'fringe-cursor-alist "23.2")
-(make-obsolete-variable 'default-scroll-up-aggressively 'scroll-up-aggressively "23.2")
-(make-obsolete-variable 'default-scroll-down-aggressively 'scroll-down-aggressively "23.2")
-(make-obsolete-variable 'default-fill-column 'fill-column "23.2")
-(make-obsolete-variable 'default-cursor-type 'cursor-type "23.2")
-(make-obsolete-variable 'default-cursor-in-non-selected-windows 'cursor-in-non-selected-windows "23.2")
-(make-obsolete-variable 'default-buffer-file-coding-system 'buffer-file-coding-system "23.2")
-(make-obsolete-variable 'default-major-mode 'major-mode "23.2")
-(make-obsolete-variable 'default-enable-multibyte-characters
- "use enable-multibyte-characters or set-buffer-multibyte instead" "23.2")
-
(make-obsolete-variable 'define-key-rebound-commands nil "23.2")
(make-obsolete-variable 'redisplay-end-trigger-functions 'jit-lock-register "23.1")
(make-obsolete-variable 'deferred-action-list 'post-command-hook "24.1")
diff --git a/src/buffer.c b/src/buffer.c
index 3d205bb..aa556b7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5413,144 +5413,6 @@ syms_of_buffer (void)
Fput (Qprotected_field, Qerror_message,
build_pure_c_string ("Attempt to modify a protected field"));
- DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format",
- mode_line_format,
- doc: /* Default value of `mode-line-format' for buffers that don't override it.
-This is the same as (default-value \\='mode-line-format). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-header-line-format",
- header_line_format,
- doc: /* Default value of `header-line-format' for buffers that don't override it.
-This is the same as (default-value \\='header-line-format). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-cursor-type", cursor_type,
- doc: /* Default value of `cursor-type' for buffers that don't override it.
-This is the same as (default-value \\='cursor-type). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-line-spacing",
- extra_line_spacing,
- doc: /* Default value of `line-spacing' for buffers that don't override it.
-This is the same as (default-value \\='line-spacing). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-cursor-in-non-selected-windows",
- cursor_in_non_selected_windows,
- doc: /* Default value of `cursor-in-non-selected-windows'.
-This is the same as (default-value \\='cursor-in-non-selected-windows). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-abbrev-mode",
- abbrev_mode,
- doc: /* Default value of `abbrev-mode' for buffers that do not override it.
-This is the same as (default-value \\='abbrev-mode). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-ctl-arrow",
- ctl_arrow,
- doc: /* Default value of `ctl-arrow' for buffers that do not override it.
-This is the same as (default-value \\='ctl-arrow). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-enable-multibyte-characters",
- enable_multibyte_characters,
- doc: /* Default value of `enable-multibyte-characters' for buffers not overriding it.
-This is the same as (default-value \\='enable-multibyte-characters). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-buffer-file-coding-system",
- buffer_file_coding_system,
- doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it.
-This is the same as (default-value \\='buffer-file-coding-system). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-truncate-lines",
- truncate_lines,
- doc: /* Default value of `truncate-lines' for buffers that do not override it.
-This is the same as (default-value \\='truncate-lines). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-fill-column",
- fill_column,
- doc: /* Default value of `fill-column' for buffers that do not override it.
-This is the same as (default-value \\='fill-column). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-left-margin",
- left_margin,
- doc: /* Default value of `left-margin' for buffers that do not override it.
-This is the same as (default-value \\='left-margin). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-tab-width",
- tab_width,
- doc: /* Default value of `tab-width' for buffers that do not override it.
-NOTE: This controls the display width of a TAB character, and not
-the size of an indentation step.
-This is the same as (default-value \\='tab-width). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-case-fold-search",
- case_fold_search,
- doc: /* Default value of `case-fold-search' for buffers that don't override it.
-This is the same as (default-value \\='case-fold-search). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-left-margin-width",
- left_margin_cols,
- doc: /* Default value of `left-margin-width' for buffers that don't override it.
-This is the same as (default-value \\='left-margin-width). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-right-margin-width",
- right_margin_cols,
- doc: /* Default value of `right-margin-width' for buffers that don't override it.
-This is the same as (default-value \\='right-margin-width). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-left-fringe-width",
- left_fringe_width,
- doc: /* Default value of `left-fringe-width' for buffers that don't override it.
-This is the same as (default-value \\='left-fringe-width). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-right-fringe-width",
- right_fringe_width,
- doc: /* Default value of `right-fringe-width' for buffers that don't override it.
-This is the same as (default-value \\='right-fringe-width). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-fringes-outside-margins",
- fringes_outside_margins,
- doc: /* Default value of `fringes-outside-margins' for buffers that don't override it.
-This is the same as (default-value \\='fringes-outside-margins). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-scroll-bar-width",
- scroll_bar_width,
- doc: /* Default value of `scroll-bar-width' for buffers that don't override it.
-This is the same as (default-value \\='scroll-bar-width). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-vertical-scroll-bar",
- vertical_scroll_bar_type,
- doc: /* Default value of `vertical-scroll-bar' for buffers that don't override it.
-This is the same as (default-value \\='vertical-scroll-bar). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-indicate-empty-lines",
- indicate_empty_lines,
- doc: /* Default value of `indicate-empty-lines' for buffers that don't override it.
-This is the same as (default-value \\='indicate-empty-lines). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-indicate-buffer-boundaries",
- indicate_buffer_boundaries,
- doc: /* Default value of `indicate-buffer-boundaries' for buffers that don't override it.
-This is the same as (default-value \\='indicate-buffer-boundaries). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-fringe-indicator-alist",
- fringe_indicator_alist,
- doc: /* Default value of `fringe-indicator-alist' for buffers that don't override it.
-This is the same as (default-value \\='fringe-indicator-alist). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-fringe-cursor-alist",
- fringe_cursor_alist,
- doc: /* Default value of `fringe-cursor-alist' for buffers that don't override it.
-This is the same as (default-value \\='fringe-cursor-alist). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-scroll-up-aggressively",
- scroll_up_aggressively,
- doc: /* Default value of `scroll-up-aggressively'.
-This value applies in buffers that don't have their own local values.
-This is the same as (default-value \\='scroll-up-aggressively). */);
-
- DEFVAR_BUFFER_DEFAULTS ("default-scroll-down-aggressively",
- scroll_down_aggressively,
- doc: /* Default value of `scroll-down-aggressively'.
-This value applies in buffers that don't have their own local values.
-This is the same as (default-value \\='scroll-down-aggressively). */);
-
DEFVAR_PER_BUFFER ("header-line-format",
&BVAR (current_buffer, header_line_format),
Qnil,
@@ -5621,9 +5483,6 @@ A string is printed verbatim in the mode line except for %-constructs:
%% -- print %. %- -- print infinitely many dashes.
Decimal digits after the % specify field width to which to pad. */);
- DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode,
- doc: /* Value of `major-mode' for new buffers. */);
-
DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode),
Qsymbolp,
doc: /* Symbol for current buffer's major mode.
diff --git a/src/lisp.h b/src/lisp.h
index 2e46592..aaa4423 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3035,12 +3035,6 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
defvar_int (&i_fwd, lname, &globals.f_ ## vname); \
} while (false)
-#define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \
- do { \
- static struct Lisp_Objfwd o_fwd; \
- defvar_lisp_nopro (&o_fwd, lname, &BVAR (&buffer_defaults, vname)); \
- } while (false)
-
#define DEFVAR_KBOARD(lname, vname, doc) \
do { \
static struct Lisp_Kboard_Objfwd ko_fwd; \
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-04 16:59 On removing some obsolete code from subr and core Mark Oteiza
@ 2016-11-05 8:24 ` John Wiegley
2016-11-05 8:34 ` Eli Zaretskii
` (3 subsequent siblings)
4 siblings, 0 replies; 30+ messages in thread
From: John Wiegley @ 2016-11-05 8:24 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
>>>>> "MO" == Mark Oteiza <mvoteiza@udel.edu> writes:
MO> I was eyeing some code in subr.el that deprecated in 22, and was
MO> wondering if there is any concern with ripping it out.
No concerns from me.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-04 16:59 On removing some obsolete code from subr and core Mark Oteiza
2016-11-05 8:24 ` John Wiegley
@ 2016-11-05 8:34 ` Eli Zaretskii
2016-11-05 13:50 ` Mark Oteiza
` (2 more replies)
2016-11-05 15:51 ` Clément Pit--Claudel
` (2 subsequent siblings)
4 siblings, 3 replies; 30+ messages in thread
From: Eli Zaretskii @ 2016-11-05 8:34 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
> From: Mark Oteiza <mvoteiza@udel.edu>
> Date: Fri, 04 Nov 2016 12:59:09 -0400
>
> I was eyeing some code in subr.el that deprecated in 22, and was
> wondering if there is any concern with ripping it out. In particular,
> the bits included in the following patch.
Removing obsolete stuff is an ungrateful job, as we need to brace for
complaints and have a Plan B for if/when they need to be brought back.
For removed symbols, bringing back the ones that are still needed is
easy. But what do we do with the default-FOO variables, once the
machinery for their generation is removed?
In any case, this needs a NEWS entry listing all the removed
variables.
> The parts for buffer_defaults is incomplete of course, there are many
> references to this structure. Just searching through, uses of
> buffer_defaults look very easy to remove, but I may be missing something
> subtle.
Why do we need to remove buffer_defaults? Once it is not exposed to
Lisp as variables, what's the harm?
Thanks.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 8:34 ` Eli Zaretskii
@ 2016-11-05 13:50 ` Mark Oteiza
2016-11-05 17:59 ` Eli Zaretskii
2016-11-05 17:50 ` Stefan Monnier
2016-11-07 0:32 ` Mark Oteiza
2 siblings, 1 reply; 30+ messages in thread
From: Mark Oteiza @ 2016-11-05 13:50 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]
On Nov 5, 2016 4:34 AM, "Eli Zaretskii" <eliz@gnu.org> wrote:
>
> > From: Mark Oteiza <mvoteiza@udel.edu>
> > Date: Fri, 04 Nov 2016 12:59:09 -0400
> >
> > I was eyeing some code in subr.el that deprecated in 22, and was
> > wondering if there is any concern with ripping it out. In particular,
> > the bits included in the following patch.
>
> Removing obsolete stuff is an ungrateful job, as we need to brace for
> complaints and have a Plan B for if/when they need to be brought back.
> For removed symbols, bringing back the ones that are still needed is
> easy. But what do we do with the default-FOO variables, once the
> machinery for their generation is removed?
>
> In any case, this needs a NEWS entry listing all the removed
> variables.
>
> > The parts for buffer_defaults is incomplete of course, there are many
> > references to this structure. Just searching through, uses of
> > buffer_defaults look very easy to remove, but I may be missing something
> > subtle.
>
> Why do we need to remove buffer_defaults? Once it is not exposed to
> Lisp as variables, what's the harm?
None aside from (presumably) dead code. Perhaps it will be removed someday,
but if leaving it there is fine with you then great!
I'll be sure to add a NEWS entry. Thanks
[-- Attachment #2: Type: text/html, Size: 1647 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 13:50 ` Mark Oteiza
@ 2016-11-05 17:59 ` Eli Zaretskii
2016-11-06 16:58 ` Mark Oteiza
0 siblings, 1 reply; 30+ messages in thread
From: Eli Zaretskii @ 2016-11-05 17:59 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
> From: Mark Oteiza <mvoteiza@udel.edu>
> Date: Sat, 5 Nov 2016 09:50:05 -0400
> Cc: Emacs-devel <emacs-devel@gnu.org>
>
> > Why do we need to remove buffer_defaults? Once it is not exposed to
> > Lisp as variables, what's the harm?
>
> None aside from (presumably) dead code.
It's not dead code at all. It's how Emacs knows the default value of
every variable that can become buffer-local, and that's how it can
initialize every new buffer with those default values. I don't see
how we could remove that.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 17:59 ` Eli Zaretskii
@ 2016-11-06 16:58 ` Mark Oteiza
0 siblings, 0 replies; 30+ messages in thread
From: Mark Oteiza @ 2016-11-06 16:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Mark Oteiza <mvoteiza@udel.edu>
>> Date: Sat, 5 Nov 2016 09:50:05 -0400
>> Cc: Emacs-devel <emacs-devel@gnu.org>
>>
>> > Why do we need to remove buffer_defaults? Once it is not exposed to
>> > Lisp as variables, what's the harm?
>>
>> None aside from (presumably) dead code.
>
> It's not dead code at all. It's how Emacs knows the default value of
> every variable that can become buffer-local, and that's how it can
> initialize every new buffer with those default values. I don't see
> how we could remove that.
Oops. Thanks for the correction.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 8:34 ` Eli Zaretskii
2016-11-05 13:50 ` Mark Oteiza
@ 2016-11-05 17:50 ` Stefan Monnier
2016-11-06 17:05 ` Mark Oteiza
2016-11-07 0:32 ` Mark Oteiza
2 siblings, 1 reply; 30+ messages in thread
From: Stefan Monnier @ 2016-11-05 17:50 UTC (permalink / raw)
To: emacs-devel
> easy. But what do we do with the default-FOO variables, once the
> machinery for their generation is removed?
BTW, the default-FOO vars were only deprecated in Emacs-23, not
Emacs-22, so maybe they can wait a little longer. Actually I think most
of them can be safely dropped (e.g. because they've never been used),
but some have been used fairly commonly and should stick around a bit
longer. Most obvious ones: default-major-mode and default-tab-width.
> Why do we need to remove buffer_defaults? Once it is not exposed to
> Lisp as variables, what's the harm?
AFAIK buffer_defaults is indeed still very much needed for
(default-value major-mode), (setq-default major-mode ...) and same for
all other variables which have their own field in the struct buffer.
OTOH, once all the DEFVAR_BUFFER_DEFAULTS are removed, we can remove the
hack in store_symval_forwarding.
Stefan
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 17:50 ` Stefan Monnier
@ 2016-11-06 17:05 ` Mark Oteiza
2016-11-06 22:32 ` Stefan Monnier
0 siblings, 1 reply; 30+ messages in thread
From: Mark Oteiza @ 2016-11-06 17:05 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> easy. But what do we do with the default-FOO variables, once the
>> machinery for their generation is removed?
>
> BTW, the default-FOO vars were only deprecated in Emacs-23, not
> Emacs-22, so maybe they can wait a little longer. Actually I think most
> of them can be safely dropped (e.g. because they've never been used),
> but some have been used fairly commonly and should stick around a bit
> longer. Most obvious ones: default-major-mode and default-tab-width.
Do you mean in 3rd party packages? Because AFAICT no use of them is
left in Emacs.
For the record, from my search, what remains is:
- a comment in fileio.c on default-buffer-file-coding-system
- a mention in edebug.el of default-cursor-in-non-selected-windows
and I think I only removed one default-foo in the recent 2c6920a
>> Why do we need to remove buffer_defaults? Once it is not exposed to
>> Lisp as variables, what's the harm?
>
> AFAIK buffer_defaults is indeed still very much needed for
> (default-value major-mode), (setq-default major-mode ...) and same for
> all other variables which have their own field in the struct buffer.
Oops, thanks.
> OTOH, once all the DEFVAR_BUFFER_DEFAULTS are removed, we can remove the
> hack in store_symval_forwarding.
P.S. Please Cc: me
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 8:34 ` Eli Zaretskii
2016-11-05 13:50 ` Mark Oteiza
2016-11-05 17:50 ` Stefan Monnier
@ 2016-11-07 0:32 ` Mark Oteiza
2016-11-07 3:35 ` Eli Zaretskii
2 siblings, 1 reply; 30+ messages in thread
From: Mark Oteiza @ 2016-11-07 0:32 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On 05/11/16 at 10:34am, Eli Zaretskii wrote:
> For removed symbols, bringing back the ones that are still needed is
> easy. But what do we do with the default-FOO variables, once the
> machinery for their generation is removed?
I am guessing this is referring to my erroneous comment on
buffer_defaults, as opposed to removing the DEFVAR_BUFFER_DEFAULTS
macro.
> In any case, this needs a NEWS entry listing all the removed
> variables.
Do you really want me to list them all in NEWS? I was inclined to
use--under the section for removed things--the old entry from
NEWS.23:
** All the default-FOO variables that hold the default value of the FOO
variable.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 0:32 ` Mark Oteiza
@ 2016-11-07 3:35 ` Eli Zaretskii
2016-11-07 4:24 ` Mark Oteiza
0 siblings, 1 reply; 30+ messages in thread
From: Eli Zaretskii @ 2016-11-07 3:35 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
> Date: Sun, 6 Nov 2016 19:32:35 -0500
> From: Mark Oteiza <mvoteiza@udel.edu>
> Cc: emacs-devel@gnu.org
>
> On 05/11/16 at 10:34am, Eli Zaretskii wrote:
> > For removed symbols, bringing back the ones that are still needed is
> > easy. But what do we do with the default-FOO variables, once the
> > machinery for their generation is removed?
>
> I am guessing this is referring to my erroneous comment on
> buffer_defaults, as opposed to removing the DEFVAR_BUFFER_DEFAULTS
> macro.
No, it referred to the DEFVAR_BUFFER_DEFAULTS macro and its users.
> > In any case, this needs a NEWS entry listing all the removed
> > variables.
>
> Do you really want me to list them all in NEWS? I was inclined to
> use--under the section for removed things--the old entry from
> NEWS.23:
>
> ** All the default-FOO variables that hold the default value of the FOO
> variable.
I think at least a few of them should be mentioned by name ("such as
..." etc.).
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 3:35 ` Eli Zaretskii
@ 2016-11-07 4:24 ` Mark Oteiza
2016-11-07 15:11 ` Eli Zaretskii
0 siblings, 1 reply; 30+ messages in thread
From: Mark Oteiza @ 2016-11-07 4:24 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On 07/11/16 at 05:35am, Eli Zaretskii wrote:
> > Date: Sun, 6 Nov 2016 19:32:35 -0500
> > From: Mark Oteiza <mvoteiza@udel.edu>
> > Cc: emacs-devel@gnu.org
> >
> > On 05/11/16 at 10:34am, Eli Zaretskii wrote:
> > > For removed symbols, bringing back the ones that are still needed is
> > > easy. But what do we do with the default-FOO variables, once the
> > > machinery for their generation is removed?
> >
> > I am guessing this is referring to my erroneous comment on
> > buffer_defaults, as opposed to removing the DEFVAR_BUFFER_DEFAULTS
> > macro.
>
> No, it referred to the DEFVAR_BUFFER_DEFAULTS macro and its users.
Ok, so we do nothing, then. The default-FOO variables go away. They
are the only users of DEFVAR_BUFFER_DEFAULTS, so that macro can also go.
> > > In any case, this needs a NEWS entry listing all the removed
> > > variables.
> >
> > Do you really want me to list them all in NEWS? I was inclined to
> > use--under the section for removed things--the old entry from
> > NEWS.23:
> >
> > ** All the default-FOO variables that hold the default value of the FOO
> > variable.
>
> I think at least a few of them should be mentioned by name ("such as
> ..." etc.).
Ok.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 4:24 ` Mark Oteiza
@ 2016-11-07 15:11 ` Eli Zaretskii
2016-11-07 20:08 ` Mark Oteiza
0 siblings, 1 reply; 30+ messages in thread
From: Eli Zaretskii @ 2016-11-07 15:11 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
> Date: Sun, 6 Nov 2016 23:24:15 -0500
> From: Mark Oteiza <mvoteiza@udel.edu>
> Cc: emacs-devel@gnu.org
>
> > > > For removed symbols, bringing back the ones that are still needed is
> > > > easy. But what do we do with the default-FOO variables, once the
> > > > machinery for their generation is removed?
> > >
> > > I am guessing this is referring to my erroneous comment on
> > > buffer_defaults, as opposed to removing the DEFVAR_BUFFER_DEFAULTS
> > > macro.
> >
> > No, it referred to the DEFVAR_BUFFER_DEFAULTS macro and its users.
>
> Ok, so we do nothing, then. The default-FOO variables go away. They
> are the only users of DEFVAR_BUFFER_DEFAULTS, so that macro can also go.
I meant what happens if we for some reason need to reinstate some of
them?
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 15:11 ` Eli Zaretskii
@ 2016-11-07 20:08 ` Mark Oteiza
2016-11-07 20:13 ` Eli Zaretskii
2016-11-07 20:31 ` Stefan Monnier
0 siblings, 2 replies; 30+ messages in thread
From: Mark Oteiza @ 2016-11-07 20:08 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On 07/11/16 at 05:11pm, Eli Zaretskii wrote:
> > Date: Sun, 6 Nov 2016 23:24:15 -0500
> > From: Mark Oteiza <mvoteiza@udel.edu>
> >
> > Ok, so we do nothing, then. The default-FOO variables go away. They
> > are the only users of DEFVAR_BUFFER_DEFAULTS, so that macro can also go.
>
> I meant what happens if we for some reason need to reinstate some of
> them?
Partially revert the commit I guess. Though, the getters and setters
for the default value of a variable have been around forever; perhaps
you or someone else know better why the default-FOO variables might be
needed again, or why they were implemented in the first place.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 20:08 ` Mark Oteiza
@ 2016-11-07 20:13 ` Eli Zaretskii
2016-11-07 20:25 ` Mark Oteiza
2016-11-07 20:31 ` Stefan Monnier
1 sibling, 1 reply; 30+ messages in thread
From: Eli Zaretskii @ 2016-11-07 20:13 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
> Date: Mon, 7 Nov 2016 15:08:28 -0500
> From: Mark Oteiza <mvoteiza@udel.edu>
> Cc: emacs-devel@gnu.org
>
> > I meant what happens if we for some reason need to reinstate some of
> > them?
>
> Partially revert the commit I guess.
Would it work to do in Lisp something like
(defvar default-FOO (default-value FOO))
?
> perhaps you or someone else know better why the default-FOO
> variables might be needed again, or why they were implemented in the
> first place.
I don't know, maybe someone else does.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 20:13 ` Eli Zaretskii
@ 2016-11-07 20:25 ` Mark Oteiza
2016-11-08 6:51 ` Noam Postavsky
0 siblings, 1 reply; 30+ messages in thread
From: Mark Oteiza @ 2016-11-07 20:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On 07/11/16 at 10:13pm, Eli Zaretskii wrote:
> > Date: Mon, 7 Nov 2016 15:08:28 -0500
> > From: Mark Oteiza <mvoteiza@udel.edu>
> > Cc: emacs-devel@gnu.org
> >
> > > I meant what happens if we for some reason need to reinstate some of
> > > them?
> >
> > Partially revert the commit I guess.
>
> Would it work to do in Lisp something like
>
> (defvar default-FOO (default-value FOO))
No, because default-FOO is tied to the default value of FOO, and
manipulating default-FOO created this way would have no effect on FOO's
default value.
Any user of the obsolete default-FOOs should be changing their code to:
(setq-default FOO bar) ;; setter
(set-default 'FOO bar) ;; setter
(default-value 'FOO) ;; getter
> > perhaps you or someone else know better why the default-FOO
> > variables might be needed again, or why they were implemented in the
> > first place.
>
> I don't know, maybe someone else does.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 20:25 ` Mark Oteiza
@ 2016-11-08 6:51 ` Noam Postavsky
0 siblings, 0 replies; 30+ messages in thread
From: Noam Postavsky @ 2016-11-08 6:51 UTC (permalink / raw)
To: Mark Oteiza; +Cc: Eli Zaretskii, Emacs developers
On Mon, Nov 7, 2016 at 3:25 PM, Mark Oteiza <mvoteiza@udel.edu> wrote:
> On 07/11/16 at 10:13pm, Eli Zaretskii wrote:
>> > Date: Mon, 7 Nov 2016 15:08:28 -0500
>> > From: Mark Oteiza <mvoteiza@udel.edu>
>> > Cc: emacs-devel@gnu.org
>> >
>> > > I meant what happens if we for some reason need to reinstate some of
>> > > them?
>> >
>> > Partially revert the commit I guess.
>>
>> Would it work to do in Lisp something like
>>
>> (defvar default-FOO (default-value FOO))
>
> No, because default-FOO is tied to the default value of FOO, and
> manipulating default-FOO created this way would have no effect on FOO's
> default value.
It would be possible to implement the tieing together using the
watchpoint feature (I haven't finished it yet, but I plan to post
something by the end of this week).
https://lists.nongnu.org/archive/html/emacs-devel/2015-11/msg02454.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 20:08 ` Mark Oteiza
2016-11-07 20:13 ` Eli Zaretskii
@ 2016-11-07 20:31 ` Stefan Monnier
2016-11-07 21:32 ` Johan Bockgård
1 sibling, 1 reply; 30+ messages in thread
From: Stefan Monnier @ 2016-11-07 20:31 UTC (permalink / raw)
To: emacs-devel
> 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. I don't know those
reasons, tho. My guess goes as follows:
- First there were normal vars, and buffer-local vars
(e.g. buffer-file-name, major-mode).
- The two sets were disjoint.
- There was no `default-value' nor `set-default'.
- For those buffer-local vars where a default value was needed/made
sense, a separate variable was introduced with the convention to name
it `default-FOO'.
Later on appeared `default-value`, `make-local-variable`,
`make-variable-buffer-local`, ... which blurred the line between those
two disjoint sets of variables, at which point the `default-FOO' vars
became redundant but they were kept for backward compatibility reasons
(also it's occasionally handy to let-bind `default-FOO', while doing the
same for (default-value 'FOO) requires something like `cl-letf').
Stefan
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-07 20:31 ` Stefan Monnier
@ 2016-11-07 21:32 ` Johan Bockgård
2016-11-08 13:00 ` Stefan Monnier
0 siblings, 1 reply; 30+ messages in thread
From: Johan Bockgård @ 2016-11-07 21:32 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> 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.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-04 16:59 On removing some obsolete code from subr and core Mark Oteiza
2016-11-05 8:24 ` John Wiegley
2016-11-05 8:34 ` Eli Zaretskii
@ 2016-11-05 15:51 ` Clément Pit--Claudel
2016-11-05 15:52 ` Clément Pit--Claudel
2016-11-05 15:57 ` Clément Pit--Claudel
4 siblings, 0 replies; 30+ messages in thread
From: Clément Pit--Claudel @ 2016-11-05 15:51 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1.1: Type: text/plain, Size: 14176 bytes --]
It would be nice if we could set up completion to stop offering obsolete functions; this might help prevent them from getting added to new code.
On 2016-11-04 12:59, Mark Oteiza wrote:
>
> Hi,
>
> I was eyeing some code in subr.el that deprecated in 22, and was
> wondering if there is any concern with ripping it out. In particular,
> the bits included in the following patch.
>
> The parts for buffer_defaults is incomplete of course, there are many
> references to this structure. Just searching through, uses of
> buffer_defaults look very easy to remove, but I may be missing something
> subtle.
>
> I removed references/uses of these functions/aliases/default-variables
> in documentation and lisp in commit 2c6920a
>
> diff --git a/lisp/subr.el b/lisp/subr.el
> index fba43be..6a8911f 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -1290,13 +1290,6 @@ posn-object-width-height
> \f
> ;;;; Obsolescent names for functions.
>
> -(define-obsolete-function-alias 'window-dot 'window-point "22.1")
> -(define-obsolete-function-alias 'set-window-dot 'set-window-point "22.1")
> -(define-obsolete-function-alias 'read-input 'read-string "22.1")
> -(define-obsolete-function-alias 'show-buffer 'set-window-buffer "22.1")
> -(define-obsolete-function-alias 'eval-current-buffer 'eval-buffer "22.1")
> -(define-obsolete-function-alias 'string-to-int 'string-to-number "22.1")
> -
> (make-obsolete 'forward-point "use (+ (point) N) instead." "23.1")
> (make-obsolete 'buffer-has-markers-at nil "24.3")
>
> @@ -1306,18 +1299,6 @@ 'string-to-int
> (make-obsolete 'string-to-multibyte "use `decode-coding-string'." "25.2")
> (make-obsolete 'string-as-multibyte "use `decode-coding-string'." "25.2")
>
> -(defun insert-string (&rest args)
> - "Mocklisp-compatibility insert function.
> -Like the function `insert' except that any argument that is a number
> -is converted into a string by expressing it in decimal."
> - (declare (obsolete insert "22.1"))
> - (dolist (el args)
> - (insert (if (integerp el) (number-to-string el) el))))
> -
> -(defun makehash (&optional test)
> - (declare (obsolete make-hash-table "22.1"))
> - (make-hash-table :test (or test 'eql)))
> -
> (defun log10 (x)
> "Return (log X 10), the log base 10 of X."
> (declare (obsolete log "24.4"))
> @@ -1319,45 +1319,6 @@ 'unfocus-frame
> \f
> ;;;; Obsolescence declarations for variables, and aliases.
>
> -;; Special "default-FOO" variables which contain the default value of
> -;; the "FOO" variable are nasty. Their implementation is brittle, and
> -;; slows down several unrelated variable operations; furthermore, they
> -;; can lead to really odd behavior if you decide to make them
> -;; buffer-local.
> -
> -;; Not used at all in Emacs, last time I checked:
> -(make-obsolete-variable 'default-mode-line-format
> - "use (setq-default mode-line-format) or (default-value mode-line-format) instead"
> - "23.2")
> -(make-obsolete-variable 'default-header-line-format 'header-line-format "23.2")
> -(make-obsolete-variable 'default-line-spacing 'line-spacing "23.2")
> -(make-obsolete-variable 'default-abbrev-mode 'abbrev-mode "23.2")
> -(make-obsolete-variable 'default-ctl-arrow 'ctl-arrow "23.2")
> -(make-obsolete-variable 'default-truncate-lines 'truncate-lines "23.2")
> -(make-obsolete-variable 'default-left-margin 'left-margin "23.2")
> -(make-obsolete-variable 'default-tab-width 'tab-width "23.2")
> -(make-obsolete-variable 'default-case-fold-search 'case-fold-search "23.2")
> -(make-obsolete-variable 'default-left-margin-width 'left-margin-width "23.2")
> -(make-obsolete-variable 'default-right-margin-width 'right-margin-width "23.2")
> -(make-obsolete-variable 'default-left-fringe-width 'left-fringe-width "23.2")
> -(make-obsolete-variable 'default-right-fringe-width 'right-fringe-width "23.2")
> -(make-obsolete-variable 'default-fringes-outside-margins 'fringes-outside-margins "23.2")
> -(make-obsolete-variable 'default-scroll-bar-width 'scroll-bar-width "23.2")
> -(make-obsolete-variable 'default-vertical-scroll-bar 'vertical-scroll-bar "23.2")
> -(make-obsolete-variable 'default-indicate-empty-lines 'indicate-empty-lines "23.2")
> -(make-obsolete-variable 'default-indicate-buffer-boundaries 'indicate-buffer-boundaries "23.2")
> -(make-obsolete-variable 'default-fringe-indicator-alist 'fringe-indicator-alist "23.2")
> -(make-obsolete-variable 'default-fringe-cursor-alist 'fringe-cursor-alist "23.2")
> -(make-obsolete-variable 'default-scroll-up-aggressively 'scroll-up-aggressively "23.2")
> -(make-obsolete-variable 'default-scroll-down-aggressively 'scroll-down-aggressively "23.2")
> -(make-obsolete-variable 'default-fill-column 'fill-column "23.2")
> -(make-obsolete-variable 'default-cursor-type 'cursor-type "23.2")
> -(make-obsolete-variable 'default-cursor-in-non-selected-windows 'cursor-in-non-selected-windows "23.2")
> -(make-obsolete-variable 'default-buffer-file-coding-system 'buffer-file-coding-system "23.2")
> -(make-obsolete-variable 'default-major-mode 'major-mode "23.2")
> -(make-obsolete-variable 'default-enable-multibyte-characters
> - "use enable-multibyte-characters or set-buffer-multibyte instead" "23.2")
> -
> (make-obsolete-variable 'define-key-rebound-commands nil "23.2")
> (make-obsolete-variable 'redisplay-end-trigger-functions 'jit-lock-register "23.1")
> (make-obsolete-variable 'deferred-action-list 'post-command-hook "24.1")
> diff --git a/src/buffer.c b/src/buffer.c
> index 3d205bb..aa556b7 100644
> --- a/src/buffer.c
> +++ b/src/buffer.c
> @@ -5413,144 +5413,6 @@ syms_of_buffer (void)
> Fput (Qprotected_field, Qerror_message,
> build_pure_c_string ("Attempt to modify a protected field"));
>
> - DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format",
> - mode_line_format,
> - doc: /* Default value of `mode-line-format' for buffers that don't override it.
> -This is the same as (default-value \\='mode-line-format). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-header-line-format",
> - header_line_format,
> - doc: /* Default value of `header-line-format' for buffers that don't override it.
> -This is the same as (default-value \\='header-line-format). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-cursor-type", cursor_type,
> - doc: /* Default value of `cursor-type' for buffers that don't override it.
> -This is the same as (default-value \\='cursor-type). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-line-spacing",
> - extra_line_spacing,
> - doc: /* Default value of `line-spacing' for buffers that don't override it.
> -This is the same as (default-value \\='line-spacing). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-cursor-in-non-selected-windows",
> - cursor_in_non_selected_windows,
> - doc: /* Default value of `cursor-in-non-selected-windows'.
> -This is the same as (default-value \\='cursor-in-non-selected-windows). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-abbrev-mode",
> - abbrev_mode,
> - doc: /* Default value of `abbrev-mode' for buffers that do not override it.
> -This is the same as (default-value \\='abbrev-mode). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-ctl-arrow",
> - ctl_arrow,
> - doc: /* Default value of `ctl-arrow' for buffers that do not override it.
> -This is the same as (default-value \\='ctl-arrow). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-enable-multibyte-characters",
> - enable_multibyte_characters,
> - doc: /* Default value of `enable-multibyte-characters' for buffers not overriding it.
> -This is the same as (default-value \\='enable-multibyte-characters). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-buffer-file-coding-system",
> - buffer_file_coding_system,
> - doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it.
> -This is the same as (default-value \\='buffer-file-coding-system). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-truncate-lines",
> - truncate_lines,
> - doc: /* Default value of `truncate-lines' for buffers that do not override it.
> -This is the same as (default-value \\='truncate-lines). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-fill-column",
> - fill_column,
> - doc: /* Default value of `fill-column' for buffers that do not override it.
> -This is the same as (default-value \\='fill-column). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-left-margin",
> - left_margin,
> - doc: /* Default value of `left-margin' for buffers that do not override it.
> -This is the same as (default-value \\='left-margin). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-tab-width",
> - tab_width,
> - doc: /* Default value of `tab-width' for buffers that do not override it.
> -NOTE: This controls the display width of a TAB character, and not
> -the size of an indentation step.
> -This is the same as (default-value \\='tab-width). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-case-fold-search",
> - case_fold_search,
> - doc: /* Default value of `case-fold-search' for buffers that don't override it.
> -This is the same as (default-value \\='case-fold-search). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-left-margin-width",
> - left_margin_cols,
> - doc: /* Default value of `left-margin-width' for buffers that don't override it.
> -This is the same as (default-value \\='left-margin-width). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-right-margin-width",
> - right_margin_cols,
> - doc: /* Default value of `right-margin-width' for buffers that don't override it.
> -This is the same as (default-value \\='right-margin-width). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-left-fringe-width",
> - left_fringe_width,
> - doc: /* Default value of `left-fringe-width' for buffers that don't override it.
> -This is the same as (default-value \\='left-fringe-width). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-right-fringe-width",
> - right_fringe_width,
> - doc: /* Default value of `right-fringe-width' for buffers that don't override it.
> -This is the same as (default-value \\='right-fringe-width). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-fringes-outside-margins",
> - fringes_outside_margins,
> - doc: /* Default value of `fringes-outside-margins' for buffers that don't override it.
> -This is the same as (default-value \\='fringes-outside-margins). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-scroll-bar-width",
> - scroll_bar_width,
> - doc: /* Default value of `scroll-bar-width' for buffers that don't override it.
> -This is the same as (default-value \\='scroll-bar-width). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-vertical-scroll-bar",
> - vertical_scroll_bar_type,
> - doc: /* Default value of `vertical-scroll-bar' for buffers that don't override it.
> -This is the same as (default-value \\='vertical-scroll-bar). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-indicate-empty-lines",
> - indicate_empty_lines,
> - doc: /* Default value of `indicate-empty-lines' for buffers that don't override it.
> -This is the same as (default-value \\='indicate-empty-lines). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-indicate-buffer-boundaries",
> - indicate_buffer_boundaries,
> - doc: /* Default value of `indicate-buffer-boundaries' for buffers that don't override it.
> -This is the same as (default-value \\='indicate-buffer-boundaries). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-fringe-indicator-alist",
> - fringe_indicator_alist,
> - doc: /* Default value of `fringe-indicator-alist' for buffers that don't override it.
> -This is the same as (default-value \\='fringe-indicator-alist). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-fringe-cursor-alist",
> - fringe_cursor_alist,
> - doc: /* Default value of `fringe-cursor-alist' for buffers that don't override it.
> -This is the same as (default-value \\='fringe-cursor-alist). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-scroll-up-aggressively",
> - scroll_up_aggressively,
> - doc: /* Default value of `scroll-up-aggressively'.
> -This value applies in buffers that don't have their own local values.
> -This is the same as (default-value \\='scroll-up-aggressively). */);
> -
> - DEFVAR_BUFFER_DEFAULTS ("default-scroll-down-aggressively",
> - scroll_down_aggressively,
> - doc: /* Default value of `scroll-down-aggressively'.
> -This value applies in buffers that don't have their own local values.
> -This is the same as (default-value \\='scroll-down-aggressively). */);
> -
> DEFVAR_PER_BUFFER ("header-line-format",
> &BVAR (current_buffer, header_line_format),
> Qnil,
> @@ -5621,9 +5483,6 @@ A string is printed verbatim in the mode line except for %-constructs:
> %% -- print %. %- -- print infinitely many dashes.
> Decimal digits after the % specify field width to which to pad. */);
>
> - DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode,
> - doc: /* Value of `major-mode' for new buffers. */);
> -
> DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode),
> Qsymbolp,
> doc: /* Symbol for current buffer's major mode.
> diff --git a/src/lisp.h b/src/lisp.h
> index 2e46592..aaa4423 100644
> --- a/src/lisp.h
> +++ b/src/lisp.h
> @@ -3035,12 +3035,6 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
> defvar_int (&i_fwd, lname, &globals.f_ ## vname); \
> } while (false)
>
> -#define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \
> - do { \
> - static struct Lisp_Objfwd o_fwd; \
> - defvar_lisp_nopro (&o_fwd, lname, &BVAR (&buffer_defaults, vname)); \
> - } while (false)
> -
> #define DEFVAR_KBOARD(lname, vname, doc) \
> do { \
> static struct Lisp_Kboard_Objfwd ko_fwd; \
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-04 16:59 On removing some obsolete code from subr and core Mark Oteiza
` (2 preceding siblings ...)
2016-11-05 15:51 ` Clément Pit--Claudel
@ 2016-11-05 15:52 ` Clément Pit--Claudel
2016-11-05 16:42 ` Dmitry Gutov
2016-11-05 15:57 ` Clément Pit--Claudel
4 siblings, 1 reply; 30+ messages in thread
From: Clément Pit--Claudel @ 2016-11-05 15:52 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1.1: Type: text/plain, Size: 463 bytes --]
On 2016-11-04 12:59, Mark Oteiza wrote:
> -(define-obsolete-function-alias 'string-to-int 'string-to-number "22.1")
I never understood this one. The name string-to-int suggests that you'll get an error if your string doesn't describe an int. string-to-number, OTOH, suggests that you'll get an int or a float.
How do you get a proper string-to-int behavior in Emacs Lisp? With (let ((v (string-to-number s))) (when (floatp v) (error …)))?
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 15:52 ` Clément Pit--Claudel
@ 2016-11-05 16:42 ` Dmitry Gutov
2016-11-05 17:23 ` Clément Pit--Claudel
0 siblings, 1 reply; 30+ messages in thread
From: Dmitry Gutov @ 2016-11-05 16:42 UTC (permalink / raw)
To: Clément Pit--Claudel, emacs-devel
On 05.11.2016 17:52, Clément Pit--Claudel wrote:
> I never understood this one. The name string-to-int suggests that you'll get an error if your string doesn't describe an int.
I'm just guessing, but that probably never happened. stirng-to-number
works like this:
ELISP> (string-to-number "abc")
0 (#o0, #x0, ?\C-@)
ELISP> (string-to-number "22.2abc")
22.2
> How do you get a proper string-to-int behavior in Emacs Lisp? With (let ((v (string-to-number s))) (when (floatp v) (error …)))?
By calling `floor' on the result of string-to-number, I guess.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 16:42 ` Dmitry Gutov
@ 2016-11-05 17:23 ` Clément Pit--Claudel
2016-11-05 17:31 ` Dmitry Gutov
0 siblings, 1 reply; 30+ messages in thread
From: Clément Pit--Claudel @ 2016-11-05 17:23 UTC (permalink / raw)
To: Dmitry Gutov, emacs-devel
[-- Attachment #1.1: Type: text/plain, Size: 921 bytes --]
On 2016-11-05 12:42, Dmitry Gutov wrote:
> On 05.11.2016 17:52, Clément Pit--Claudel wrote:
>
>> I never understood this one. The name string-to-int suggests that you'll get an error if your string doesn't describe an int.
>
> I'm just guessing, but that probably never happened. stirng-to-number works like this:
>
> ELISP> (string-to-number "abc")
> 0 (#o0, #x0, ?\C-@)
> ELISP> (string-to-number "22.2abc")
> 22.2
I know, I know :) (what is this fancy ELISP repl, btw?)
>> How do you get a proper string-to-int behavior in Emacs Lisp? With (let ((v (string-to-number s))) (when (floatp v) (error …)))?
>
> By calling `floor' on the result of string-to-number, I guess.
Hmm. I'd expect string-to-int to error on non-ints:
>>> int("1.3")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '1.3'
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-05 17:23 ` Clément Pit--Claudel
@ 2016-11-05 17:31 ` Dmitry Gutov
2016-11-05 18:03 ` Clément Pit--Claudel
0 siblings, 1 reply; 30+ messages in thread
From: Dmitry Gutov @ 2016-11-05 17:31 UTC (permalink / raw)
To: Clément Pit--Claudel, emacs-devel
On 05.11.2016 19:23, Clément Pit--Claudel wrote:
>> ELISP> (string-to-number "abc")
>> 0 (#o0, #x0, ?\C-@)
>> ELISP> (string-to-number "22.2abc")
>> 22.2
>
> I know, I know :) (what is this fancy ELISP repl, btw?)
M-x ielm. :)
> Hmm. I'd expect string-to-int to error on non-ints:
>
>>>> int("1.3")
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ValueError: invalid literal for int() with base 10: '1.3'
No so in Elisp. Or JavaScript:
> parseInt("123abc")
=> 123
¯\_(ツ)_/¯
If you really need to error, string-match-p is probably your best bet.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: On removing some obsolete code from subr and core
2016-11-04 16:59 On removing some obsolete code from subr and core Mark Oteiza
` (3 preceding siblings ...)
2016-11-05 15:52 ` Clément Pit--Claudel
@ 2016-11-05 15:57 ` Clément Pit--Claudel
2016-11-05 17:56 ` Stefan Monnier
4 siblings, 1 reply; 30+ messages in thread
From: Clément Pit--Claudel @ 2016-11-05 15:57 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1.1: Type: text/plain, Size: 327 bytes --]
On 2016-11-04 12:59, Mark Oteiza wrote:
> -(define-obsolete-function-alias 'string-to-int 'string-to-number "22.1")
I think we should keep this one: https://github.com/search?l=Emacs+Lisp&q=string-to-int&type=Code&utf8=%E2%9C%93 has 22k results.
Even better: we could make it do what it's name suggest :)
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2016-11-08 19:49 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 16:59 On removing some obsolete code from subr and core Mark Oteiza
2016-11-05 8:24 ` John Wiegley
2016-11-05 8:34 ` Eli Zaretskii
2016-11-05 13:50 ` Mark Oteiza
2016-11-05 17:59 ` Eli Zaretskii
2016-11-06 16:58 ` Mark Oteiza
2016-11-05 17:50 ` Stefan Monnier
2016-11-06 17:05 ` Mark Oteiza
2016-11-06 22:32 ` Stefan Monnier
2016-11-07 0:32 ` Mark Oteiza
2016-11-07 3:35 ` Eli Zaretskii
2016-11-07 4:24 ` Mark Oteiza
2016-11-07 15:11 ` Eli Zaretskii
2016-11-07 20:08 ` Mark Oteiza
2016-11-07 20:13 ` Eli Zaretskii
2016-11-07 20:25 ` Mark Oteiza
2016-11-08 6:51 ` Noam Postavsky
2016-11-07 20:31 ` Stefan Monnier
2016-11-07 21:32 ` Johan Bockgård
2016-11-08 13:00 ` Stefan Monnier
2016-11-08 19:49 ` John Wiegley
2016-11-05 15:51 ` Clément Pit--Claudel
2016-11-05 15:52 ` Clément Pit--Claudel
2016-11-05 16:42 ` Dmitry Gutov
2016-11-05 17:23 ` Clément Pit--Claudel
2016-11-05 17:31 ` Dmitry Gutov
2016-11-05 18:03 ` Clément Pit--Claudel
2016-11-05 15:57 ` Clément Pit--Claudel
2016-11-05 17:56 ` Stefan Monnier
2016-11-05 19:14 ` Clément Pit--Claudel
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.