From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: On removing some obsolete code from subr and core Date: Fri, 04 Nov 2016 12:59:09 -0400 Message-ID: <878tsznpuq.fsf@udel.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1478278772 5208 195.159.176.226 (4 Nov 2016 16:59:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 4 Nov 2016 16:59:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 04 17:59:28 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2hps-0000Sw-CX for ged-emacs-devel@m.gmane.org; Fri, 04 Nov 2016 17:59:24 +0100 Original-Received: from localhost ([::1]:39970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2hpv-0001hz-9k for ged-emacs-devel@m.gmane.org; Fri, 04 Nov 2016 12:59:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2hpl-0001ha-Dq for emacs-devel@gnu.org; Fri, 04 Nov 2016 12:59:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2hpi-0004HN-7J for emacs-devel@gnu.org; Fri, 04 Nov 2016 12:59:17 -0400 Original-Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:33208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2hph-0004FI-SG for emacs-devel@gnu.org; Fri, 04 Nov 2016 12:59:14 -0400 Original-Received: by mail-qt0-x236.google.com with SMTP id p16so51832281qta.0 for ; Fri, 04 Nov 2016 09:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=y6dKBOiULjt+cV5sq2lGS3Psb78MLZ5uF7bTto0XIvQ=; b=MeL8XakIZWli2f1MAknKJNsQv/sQC2nJ/cG4EQAdMNHJBiNx7l6PwbG9yoLFvGl91z UTXo6MJ4K/kJIFrfcwuJLyJLq5ktn9DGhUW/RRnr9CAX5Tuu/eE/8X5io+Ov8UG+hnFv odRRyo3P3MfR6d0fga48GTkoCknXvVlrPJVT36PhVD/gnkV9z1mVFihKk/gnikzLqstt bQvvoxAj9wYSK3H0iNsPzu9HsLEKtJA90718vWPp63hLVd54aQ9cEGgvMctZephBjG4U uASe8aRCKV01xCZ+X7hhlb7NiwIYAaAOs6DNa8g2U2G/I8mU/JoItjZ3fQHRkp8gpmUN wAdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=y6dKBOiULjt+cV5sq2lGS3Psb78MLZ5uF7bTto0XIvQ=; b=S7kHbc/AJ2yo+fPsNcksGu/PpWJLHj7u0x9ifPrGvax1MA/o/rzIW0R5b4U+zWVDi4 5osO+NxBOpYUct8kRXAO+BgZ1dP53RzAsoGlJrEbRgOJw7jzYKUgw+qnui2pZSI+uS2j LilK9lVjnNzhSsQTy591Du3YxQjkoXyWPmMkFP/L/5Cb0NCQZjGAb5AkETcxh/WtSL7g HKcZNMJP4+N3zWKqbyB1VVWqJ+8V5joMp+PKK54L4D5clwT+y/c+ZcPTCEYPxLrAZOo2 Csr8XZfngUbTCpEfFT/ivBCTaO011mb0iXZ31Nndx5DL0nNgBL0Y+p7Fzo0XIHiHazDK 8FHQ== X-Gm-Message-State: ABUngvcWBjoqL1Uqgqxdgjgy6lmxDqkXh+OrfscvnYg2kOJo3LoibXseC8yAyjxeGCE1W5xc X-Received: by 10.237.63.99 with SMTP id q32mr14687860qtf.156.1478278751428; Fri, 04 Nov 2016 09:59:11 -0700 (PDT) Original-Received: from holos.localdomain ([69.250.222.218]) by smtp.gmail.com with ESMTPSA id c2sm8014478qta.16.2016.11.04.09.59.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 09:59:10 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 8399E66231; Fri, 4 Nov 2016 12:59:09 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209156 Archived-At: 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 ;;;; 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 ;;;; 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; \