From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.devel Subject: [PATCHv2] Docstring updates around `delete[-forward|-backward]-char'. Date: Sat, 08 Feb 2014 00:40:39 +0100 Organization: http://mina86.com/ Message-ID: References: <1391698658-28084-1-git-send-email-mpn@google.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1391816488 24458 80.91.229.3 (7 Feb 2014 23:41:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Feb 2014 23:41:28 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 08 00:41:35 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WBv36-0000PK-DX for ged-emacs-devel@m.gmane.org; Sat, 08 Feb 2014 00:41:32 +0100 Original-Received: from localhost ([::1]:44219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBv36-0004Mb-0F for ged-emacs-devel@m.gmane.org; Fri, 07 Feb 2014 18:41:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBv2y-0004LN-9p for emacs-devel@gnu.org; Fri, 07 Feb 2014 18:41:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBv2t-0002Du-6m for emacs-devel@gnu.org; Fri, 07 Feb 2014 18:41:24 -0500 Original-Received: from mail-ea0-f172.google.com ([209.85.215.172]:55170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBv2s-0002Dm-T0 for emacs-devel@gnu.org; Fri, 07 Feb 2014 18:41:19 -0500 Original-Received: by mail-ea0-f172.google.com with SMTP id l9so1578816eaj.3 for ; Fri, 07 Feb 2014 15:40:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:organization:references :user-agent:face:date:message-id:mime-version:content-type :content-transfer-encoding; bh=PwBymDCe94oiKou/tet6uPw3XUwzfN0wnvg2S+m1vgM=; b=iiwuVRvZK/BSzTcAfsAQiu2Yo5T51nLxkAf/wl+uQEBIOMP28tZvBnc+v09UduUqsv AiAv6PbDiNOGbydePjeCn1pJ8VFjNm/kWNaniyMlottu8ywAvk55IcyYNKYs4TqyzYXo ZIlFJTyeppj+WbLhyKCGLD27diogdAOgLcH3lnNZpAoxn1jNhD+wE5lz1A76MPfZJqGT +xuIS2/07b5EKSqRi/p6eWt/M8px/ekIcjrq3mP+EnO8fLE6JzEEg/nFhC8uySZ0Smbz zUcRqXKOa4Od6TDblk3eUtKBoJIo3SZsqNprJWn5FLjQ+hMKR75U2sP16zPbYIyaF4tI MlvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to :organization:references:user-agent:face:date:message-id :mime-version:content-type:content-transfer-encoding; bh=PwBymDCe94oiKou/tet6uPw3XUwzfN0wnvg2S+m1vgM=; b=bdGoW1/UqU+reVJ2EbPVZ0bY9PKrlJHRRoY6IUv/w1+DP4GqRi3sbP0FdZFbStiBwr KnNnC+YvENic5VvAs/ulGYay8elynA3HQEuABp+MPSEg2Mao6CvT8u1NwuBLCfWwlF84 nu9WDviAtGzf6mhHOi015D08KQthr7XjSwbIXZr4CDZiFU0nVPWw7leIso+UTHXsUL3z HqRIU/oXSzfp2w66uhb17H43L0dvht4GwDKYlwnsYLXEBzkUJZkR18rTRBQYHjxgni0I i7iR9tF5HgPjF2SdAOV7XeNzfcWs13QEAj+pjEauZfxJ5kG/uj3b8WXk4/re354tpf3R N24A== X-Gm-Message-State: ALoCoQmiqLmBun8rhz5lAKxbocu7aPBnnaN3Q7WyIfEM91ztSdLaZg+GKrbzbO8mrjhzSWu/qU9zbbIBYRcFF7STU1z0qIQEuPTTluOvFP+9cQH2XvVGZVgX+OK+Kn5mwYyNbtN6IzFWBy/4NpNdnAj2fYRZAObH9TSba63izc476CDKwW46kVk2lEAiJpHLj1LOSDnbSySZ X-Received: by 10.15.42.136 with SMTP id u8mr19935234eev.52.1391816442853; Fri, 07 Feb 2014 15:40:42 -0800 (PST) Original-Received: from mpn-glaptop.roam.corp.google.com (159-205-221-55.adsl.inetia.pl. [159.205.221.55]) by mx.google.com with ESMTPSA id o45sm8575188eeb.18.2014.02.07.15.40.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 07 Feb 2014 15:40:41 -0800 (PST) In-Reply-To: User-Agent: Notmuch/0.17+15~gb65ca8e (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu) X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd; KFrfMCylc}gc??'U2j,!8%xdD Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR 4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:140207:cyd@stupidchicken.com::cmEsmPu79qs4Tt2b:00000000000000000000000000000000000000001Ao6 X-Hashcash: 1:20:140207:monnier@iro.umontreal.ca::5yVqIFjq/2F1al3u:00000000000000000000000000000000000001Zfn X-Hashcash: 1:20:140207:emacs-devel@gnu.org::bqO7hQvduhsOELRD:0000000000000000000000000000000000000000002eUi X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169477 Archived-At: * cmds.c (delete-char): Update docstring pointing out that the function ignores `delete-active-region' and `overwrite-mode'. * binding.el: Add comment describing why C-d binds to `delete-char'. * simple.el (delete-backward-char): Point to `delete-char' in docstring. (delete-forward-char): Mark as interactive-only and point to `delete-char' in docstring. --- Slightly updated patch. Feel free to ignore as I'm less convinced this change is actually useful than yesterday. ;) lisp/ChangeLog | 8 ++++++++ lisp/bindings.el | 3 +++ lisp/simple.el | 9 +++++++-- src/ChangeLog | 5 +++++ src/cmds.c | 4 +++- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ae9b774..989768d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2014-02-06 Michal Nazarewicz + + * binding.el: Add comment describing why C-d binds to `delete-char'. + * simple.el (delete-backward-char): Point to `delete-char' in + docstring. + (delete-forward-char): Mark as interactive-only and point to + `delete-char' in docstring. + 2014-02-06 Michael Albinus =20 * net/tramp-sh.el (tramp-sh-handle-start-file-process): Use "&&" diff --git a/lisp/bindings.el b/lisp/bindings.el index 7106c73..64751da 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -873,6 +873,9 @@ if `inhibit-field-text-motion' is non-nil." =20 ;; Update tutorial--default-keys if you change these. (define-key global-map "\177" 'delete-backward-char) +;; We explicitly want C-d to use `delete-char' instead of +;; `delete-forward-char' so that it ignores `delete-active-region'. +;; See commit message for revision 102001 of the repository. (define-key global-map "\C-d" 'delete-char) =20 (define-key global-map "\C-k" 'kill-line) diff --git a/lisp/simple.el b/lisp/simple.el index 2e924c8..bf940d2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -958,7 +958,9 @@ arg, and KILLFLAG is set if N is explicitly specified. =20 In Overwrite mode, single character backward deletion may replace tabs with spaces so as to back over columns, unless point is at -the end of the line." +the end of the line. + +`delete-char' is recommended instead of this function in Emacs Lisp code." (interactive "p\nP") (unless (integerp n) (signal 'wrong-type-argument (list 'integerp n))) @@ -991,7 +993,9 @@ To disable this, set variable `delete-active-region' to= nil. =20 Optional second arg KILLFLAG non-nil means to kill (save in kill ring) instead of delete. Interactively, N is the prefix arg, and -KILLFLAG is set if N was explicitly specified." +KILLFLAG is set if N was explicitly specified. + +`delete-char' is recommended instead of this function in Emacs Lisp code." (interactive "p\nP") (unless (integerp n) (signal 'wrong-type-argument (list 'integerp n))) @@ -1005,6 +1009,7 @@ KILLFLAG is set if N was explicitly specified." =20 ;; Otherwise, do simple deletion. (t (delete-char n killflag)))) +(put 'delete-forward-char 'interactive-only 'delete-char) =20 (defun mark-whole-buffer () "Put point at beginning and mark at end of buffer. diff --git a/src/ChangeLog b/src/ChangeLog index 140d501..9853fc6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-02-06 Michal Nazarewicz + + * cmds.c (delete-char): Update docstring pointing out that the + function ignores `delete-active-region' and `overwrite-mode'. + 2014-02-06 Jan Dj=C3=A4rv =20 * nsterm.m (toggleFullScreen:): Hide menubar on secondary monitor diff --git a/src/cmds.c b/src/cmds.c index 8d61c19..59cc7f8 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -229,7 +229,9 @@ Optional second arg KILLFLAG non-nil means kill instead= (save in kill ring). Interactively, N is the prefix arg, and KILLFLAG is set if N was explicitly specified. =20 -The command `delete-forward-char' is preferable for interactive use. */) +The command `delete-forward-char' is preferable for interactive use since +unlike `delete-forward-char' and `delete-backward-char', `delete-char' does +not respect values of `delete-active-region' and `overwrite-mode'. */) (Lisp_Object n, Lisp_Object killflag) { EMACS_INT pos; --=20 1.8.5.3