[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Docstring updates around `delete[-forward|-backward]-char'.
From: |
Michal Nazarewicz |
Subject: |
[PATCH] Docstring updates around `delete[-forward|-backward]-char'. |
Date: |
Thu, 6 Feb 2014 15:57:38 +0100 |
From: Michal Nazarewicz <address@hidden>
* src/cmds.c (delete-char): Update docstring pointing out that the
function ignores `delete-active-region' and `overwrite-mode'.
Also remove recommendation to use `delete-forward-char' since the
default binding of C-d is `delete-char' rendering the
recommendation a bit hypocritical.
* lisp/simple.el (delete-backward-char): Point to `delete-char' in
docstring and point to differences between the two.
(delete-forward-char): Mark as interactive-only, point to
`delete-char' in docstring and point to differences between the
two.
---
lisp/ChangeLog | 8 ++++++++
lisp/simple.el | 13 +++++++++++--
src/ChangeLog | 8 ++++++++
src/cmds.c | 4 +++-
4 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ae9b774..b523c28 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2014-02-06 Michal Nazarewicz <address@hidden>
+
+ * simple.el (delete-backward-char): Point to `delete-char' in
+ docstring and point to differences between the two.
+ (delete-forward-char): Mark as interactive-only, point to
+ `delete-char' in docstring and point to differences between the
+ two.
+
2014-02-06 Michael Albinus <address@hidden>
* net/tramp-sh.el (tramp-sh-handle-start-file-process): Use "&&"
diff --git a/lisp/simple.el b/lisp/simple.el
index 2e924c8..058adbe 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -958,7 +958,11 @@ arg, and KILLFLAG is set if N is explicitly specified.
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.
+
+It is recommended to use `delete-char' instead of this function
+in Emacs lisp code, but note that `delete-char' ignores
+`delete-active-region' and `overwrite-mode'."
(interactive "p\nP")
(unless (integerp n)
(signal 'wrong-type-argument (list 'integerp n)))
@@ -991,7 +995,11 @@ To disable this, set variable `delete-active-region' to
nil.
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.
+
+It is recommended to use `delete-char' instead of this function
+in Emacs lisp code, but note that `delete-char' ignores
+`delete-active-region'."
(interactive "p\nP")
(unless (integerp n)
(signal 'wrong-type-argument (list 'integerp n)))
@@ -1005,6 +1013,7 @@ KILLFLAG is set if N was explicitly specified."
;; Otherwise, do simple deletion.
(t (delete-char n killflag))))
+(put 'delete-forward-char 'interactive-only 'delete-char)
(defun mark-whole-buffer ()
"Put point at beginning and mark at end of buffer.
diff --git a/src/ChangeLog b/src/ChangeLog
index 140d501..9fb7bbd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2014-02-06 Michal Nazarewicz <address@hidden>
+
+ * cmds.c (delete-char): Update docstring pointing out that the
+ function ignores `delete-active-region' and `overwrite-mode'.
+ Also remove recommendation to use `delete-forward-char' since the
+ default binding of C-d is `delete-char' rendering the
+ recommendation a bit hypocritical.
+
2014-02-06 Jan Djärv <address@hidden>
* nsterm.m (toggleFullScreen:): Hide menubar on secondary monitor
diff --git a/src/cmds.c b/src/cmds.c
index 8d61c19..98a5978 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.
-The command `delete-forward-char' is preferable for interactive use. */)
+In contrast to `delete-forward-char' and `delete-backward-char' functions,
+`delete-char' does not respect values of `delete-active-region' and
+`overwrite-mode'. */)
(Lisp_Object n, Lisp_Object killflag)
{
EMACS_INT pos;
--
1.8.5.3
- [PATCH] Docstring updates around `delete[-forward|-backward]-char'.,
Michal Nazarewicz <=