From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Mark `forward-point' as obsolete. Date: Thu, 19 Mar 2009 13:57:47 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1237467545 723 80.91.229.12 (19 Mar 2009 12:59:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Mar 2009 12:59:05 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 19 14:00:22 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LkHr8-0002IA-Dk for ged-emacs-devel@m.gmane.org; Thu, 19 Mar 2009 14:00:19 +0100 Original-Received: from localhost ([127.0.0.1]:53400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkHpm-000176-2K for ged-emacs-devel@m.gmane.org; Thu, 19 Mar 2009 08:58:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkHon-0000fZ-Ni for emacs-devel@gnu.org; Thu, 19 Mar 2009 08:57:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkHoj-0000d1-6f for emacs-devel@gnu.org; Thu, 19 Mar 2009 08:57:53 -0400 Original-Received: from [199.232.76.173] (port=48312 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkHoi-0000cr-OP for emacs-devel@gnu.org; Thu, 19 Mar 2009 08:57:48 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.191]:11322) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LkHoi-0005WO-41 for emacs-devel@gnu.org; Thu, 19 Mar 2009 08:57:48 -0400 Original-Received: by nf-out-0910.google.com with SMTP id 4so111188nfv.26 for ; Thu, 19 Mar 2009 05:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=6WyRVXEHtRXb+IZMvI7z1Re4LgaqFoC2lZUhwOg8fLU=; b=GyE5bU6PJZx0bCtam502b1Jnn3Hg8O94m+EQ3ZR9+ZUw6+y/2AJvIe06rwEKWxiDHK TulrDN7+5QfZ3yIcYo/Xos79wb44YJUBgrtbD3VXMomeS1thgm1ChcqidZXAOVwBkJne TwksOVwIkMq2mEvkRi7Yy5jmaW64K3bnCi9f4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=i+tYFI8H2WI9zdiAmWEgqu0MA8jdNsFAuiOF+sfEOgamg/yj2dEPsLD8cYe2KRCdVf k8woRTsI638YL4MbRyXDXZCr5DajEWtKOFh+GjTzu1ZHgggjFfOlVRWDVeOoFvzO9PsM lm26SJafinLFh5wMDKqFTviwfXi12bR+96cig= Original-Received: by 10.210.135.17 with SMTP id i17mr6375274ebd.12.1237467467331; Thu, 19 Mar 2009 05:57:47 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109692 Archived-At: It is OK to commit this patch? Not a bug fix, but trivial, and a new release is a good time to mark things obsolete (that's why I'm proposing it now instead of waiting after the release). `forward-point' is a remnant from multibyte changes back in 1997, and has been equivalent to (+ (point) N) since then (1997-12-29, to be precise). Also, it is the only forward-* function that does not actually move the point, so its name is misleading. In the Emacs sources, there are five uses of it in two files (plus two additional references in ps-def.el and eshell/em-rebind.el), versus 460 uses of +/- (point). Time to put the poor beast to rest. Juanma 2009-03-19 Juanma Barranquero * subr.el (forward-point): Add obsolescence declaration. * paren.el (show-paren-function): * simple.el (kill-forward-chars, kill-backward-chars): Use (+/- (point) N), instead of `forward-point'. Index: lisp/subr.el =================================================================== RCS file: /sources/emacs/emacs/lisp/subr.el,v retrieving revision 1.634 diff -u -2 -r1.634 subr.el --- lisp/subr.el 14 Feb 2009 09:06:56 -0000 1.634 +++ lisp/subr.el 19 Mar 2009 12:02:05 -0000 @@ -999,4 +999,5 @@ (make-obsolete 'char-bytes "now always returns 1." "20.4") +(make-obsolete 'forward-point "use (+ (point) N) instead." "23.1") (defun insert-string (&rest args) Index: lisp/paren.el =================================================================== RCS file: /sources/emacs/emacs/lisp/paren.el,v retrieving revision 1.79 diff -u -2 -r1.79 paren.el --- lisp/paren.el 5 Jan 2009 03:19:37 -0000 1.79 +++ lisp/paren.el 19 Mar 2009 12:29:06 -0000 @@ -213,7 +213,7 @@ (let ((from (if (= dir 1) (point) - (forward-point -1))) + (- (point) 1))) (to (if (= dir 1) - (forward-point 1) + (+ (point) 1) (point)))) (if show-paren-overlay-1 @@ -239,5 +239,5 @@ (save-excursion (goto-char pos) - (forward-point (- dir)))))) + (- (point) dir))))) (if show-paren-overlay (move-overlay show-paren-overlay from to (current-buffer)) Index: lisp/simple.el =================================================================== RCS file: /sources/emacs/emacs/lisp/simple.el,v retrieving revision 1.976 diff -u -2 -r1.976 simple.el --- lisp/simple.el 14 Mar 2009 17:43:16 -0000 1.976 +++ lisp/simple.el 19 Mar 2009 12:33:26 -0000 @@ -3104,5 +3104,5 @@ (if (listp arg) (setq arg (car arg))) (if (eq arg '-) (setq arg -1)) - (kill-region (point) (forward-point arg))) + (kill-region (point) (+ (point) arg))) ;; Internal subroutine of backward-delete-char @@ -3110,5 +3110,5 @@ (if (listp arg) (setq arg (car arg))) (if (eq arg '-) (setq arg -1)) - (kill-region (point) (forward-point (- arg)))) + (kill-region (point) (- (point) arg))) (defcustom backward-delete-char-untabify-method 'untabify