unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Small docstring improvements
@ 2016-08-19 19:26 Philipp Stephani
  2016-08-19 19:34 ` John Wiegley
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Philipp Stephani @ 2016-08-19 19:26 UTC (permalink / raw)
  To: Emacs developers


[-- Attachment #1.1: Type: text/plain, Size: 127 bytes --]

Hi,

here's a patch that clarifies some docstrings a bit. Please take a look.
I'll push to master if this is OK.

Thanks,
Phil

[-- Attachment #1.2: Type: text/html, Size: 214 bytes --]

[-- Attachment #2: 0001-Some-assorted-documentation-clarifications.patch --]
[-- Type: application/octet-stream, Size: 2671 bytes --]

From 75c2067eca12a784c57286c751b17cbf1bfda47e Mon Sep 17 00:00:00 2001
From: Philipp Stephani <phst@google.com>
Date: Fri, 19 Aug 2016 21:23:24 +0200
Subject: [PATCH] Some assorted documentation clarifications.

* src/fileio.c (Fwrite_region): Clarify that END is ignored if
START is nil.
* src/editfns.c (Fbuffer_size): Add short discussion about
narrowing.
* src/callproc.c (Fcall_process_region): Discuss behavior when
START and END are not buffer positions.
---
 src/callproc.c | 7 +++++++
 src/editfns.c  | 7 ++++++-
 src/fileio.c   | 3 ++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/callproc.c b/src/callproc.c
index 487115d..454ed6d 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1004,6 +1004,13 @@ create_temp_file (ptrdiff_t nargs, Lisp_Object *args,
 DEFUN ("call-process-region", Fcall_process_region, Scall_process_region,
        3, MANY, 0,
        doc: /* Send text from START to END to a synchronous process running PROGRAM.
+
+START and END are normally buffer positions specifying the part of the
+buffer to send to the process.
+If START is nil, that means to use the entire buffer contents; END is
+ignored.
+If START is a string, then send that string to the process
+instead of any buffer contents; END is ignored.
 The remaining arguments are optional.
 Delete the text if fourth arg DELETE is non-nil.
 
diff --git a/src/editfns.c b/src/editfns.c
index 732306a..4efb76b 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1065,7 +1065,12 @@ usage: (save-current-buffer &rest BODY)  */)
 \f
 DEFUN ("buffer-size", Fbuffer_size, Sbuffer_size, 0, 1, 0,
        doc: /* Return the number of characters in the current buffer.
-If BUFFER, return the number of characters in that buffer instead.  */)
+If BUFFER is not nil, return the number of characters in that buffer
+instead.
+
+This does not take narrowing into account; to count the number of
+characters in the accessible portion of the buffer, use
+‘(- (point-max) (point-min))’.  */)
   (Lisp_Object buffer)
 {
   if (NILP (buffer))
diff --git a/src/fileio.c b/src/fileio.c
index 37948bc..bf6bf62 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4654,7 +4654,8 @@ DEFUN ("write-region", Fwrite_region, Swrite_region, 3, 7,
 When called from a program, requires three arguments:
 START, END and FILENAME.  START and END are normally buffer positions
 specifying the part of the buffer to write.
-If START is nil, that means to use the entire buffer contents.
+If START is nil, that means to use the entire buffer contents; END is
+ignored.
 If START is a string, then output that string to the file
 instead of any buffer contents; END is ignored.
 
-- 
2.9.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-08-20 23:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19 19:26 Small docstring improvements Philipp Stephani
2016-08-19 19:34 ` John Wiegley
2016-08-19 20:34   ` Philipp Stephani
2016-08-19 21:12     ` John Wiegley
2016-08-19 22:04       ` Drew Adams
2016-08-20  0:24         ` John Wiegley
2016-08-20  7:10   ` Eli Zaretskii
2016-08-20 23:17     ` John Wiegley
2016-08-19 21:59 ` Dmitry Gutov
2016-08-20  7:08 ` Eli Zaretskii
2016-08-20 13:52   ` Philipp Stephani
2016-08-20 15:34     ` Eli Zaretskii
2016-08-20 15:59       ` Philipp Stephani
2016-08-20 16:11         ` Eli Zaretskii
2016-08-20 18:00           ` Philipp Stephani

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).