diff options
| author | Juanma Barranquero | 2004-05-07 01:06:20 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2004-05-07 01:06:20 +0000 |
| commit | a478f3e181bd9925ecb506abf4e49216d392124a (patch) | |
| tree | 9e44aa73f456e6b423e312713797279813bd0631 | |
| parent | 506b775323a723f91ae87e31580d881af3741d66 (diff) | |
| download | emacs-a478f3e181bd9925ecb506abf4e49216d392124a.tar.gz emacs-a478f3e181bd9925ecb506abf4e49216d392124a.zip | |
(lambda): Add arglist description to docstring.
(declare): Fix typo in docstring.
(open-network-stream): Fix docstring.
(process-kill-without-query): Fix docstring and add obsolescence info.
(last, butlast, nbutlast): Make arguments match their use in docstring.
(insert-buffer-substring-no-properties): Likewise.
(insert-buffer-substring-as-yank): Likewise.
(split-string): Fix docstring.
| -rw-r--r-- | lisp/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/subr.el | 71 |
2 files changed, 56 insertions, 33 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2b680d6aa71..a13e786365e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | |||
| 2 | 2004-05-07 Juanma Barranquero <lektu@terra.es> | ||
| 3 | |||
| 4 | * emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable): | ||
| 5 | Make argument names match their use in docstring. | ||
| 6 | |||
| 7 | * subr.el (lambda): Add arglist description to docstring. | ||
| 8 | (declare): Fix typo in docstring. | ||
| 9 | (open-network-stream): Fix docstring. | ||
| 10 | (process-kill-without-query): Fix docstring and add obsolescence | ||
| 11 | info. | ||
| 12 | (last, butlast, nbutlast): Make arguments match their use in docstring. | ||
| 13 | (insert-buffer-substring-no-properties): Likewise. | ||
| 14 | (insert-buffer-substring-as-yank): Likewise. | ||
| 15 | (split-string): Fix docstring. | ||
| 16 | |||
| 17 | * emacs-lisp/re-builder.el (reb-auto-update): Fix typo in docstring. | ||
| 18 | |||
| 1 | 2004-05-06 Nick Roberts <nickrob@gnu.org> | 19 | 2004-05-06 Nick Roberts <nickrob@gnu.org> |
| 2 | 20 | ||
| 3 | * progmodes/gdb-ui.el: Improve/extend documentation strings. | 21 | * progmodes/gdb-ui.el: Improve/extend documentation strings. |
diff --git a/lisp/subr.el b/lisp/subr.el index e81713ebf29..f90b5f774cb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -90,7 +90,9 @@ DOCSTRING is an optional documentation string. | |||
| 90 | But documentation strings are usually not useful in nameless functions. | 90 | But documentation strings are usually not useful in nameless functions. |
| 91 | INTERACTIVE should be a call to the function `interactive', which see. | 91 | INTERACTIVE should be a call to the function `interactive', which see. |
| 92 | It may also be omitted. | 92 | It may also be omitted. |
| 93 | BODY should be a list of Lisp expressions." | 93 | BODY should be a list of Lisp expressions. |
| 94 | |||
| 95 | \(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)" | ||
| 94 | ;; Note that this definition should not use backquotes; subr.el should not | 96 | ;; Note that this definition should not use backquotes; subr.el should not |
| 95 | ;; depend on backquote.el. | 97 | ;; depend on backquote.el. |
| 96 | (list 'function (cons 'lambda cdr))) | 98 | (list 'function (cons 'lambda cdr))) |
| @@ -161,7 +163,7 @@ the return value (nil if RESULT is omitted). | |||
| 161 | (defmacro declare (&rest specs) | 163 | (defmacro declare (&rest specs) |
| 162 | "Do not evaluate any arguments and return nil. | 164 | "Do not evaluate any arguments and return nil. |
| 163 | Treated as a declaration when used at the right place in a | 165 | Treated as a declaration when used at the right place in a |
| 164 | `defmacro' form. \(See Info anchor `(elisp)Definition of declare'." | 166 | `defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" |
| 165 | nil) | 167 | nil) |
| 166 | 168 | ||
| 167 | (defsubst caar (x) | 169 | (defsubst caar (x) |
| @@ -180,34 +182,34 @@ Treated as a declaration when used at the right place in a | |||
| 180 | "Return the cdr of the cdr of X." | 182 | "Return the cdr of the cdr of X." |
| 181 | (cdr (cdr x))) | 183 | (cdr (cdr x))) |
| 182 | 184 | ||
| 183 | (defun last (x &optional n) | 185 | (defun last (list &optional n) |
| 184 | "Return the last link of the list X. Its car is the last element. | 186 | "Return the last link of LIST. Its car is the last element. |
| 185 | If X is nil, return nil. | 187 | If LIST is nil, return nil. |
| 186 | If N is non-nil, return the Nth-to-last link of X. | 188 | If N is non-nil, return the Nth-to-last link of LIST. |
| 187 | If N is bigger than the length of X, return X." | 189 | If N is bigger than the length of LIST, return LIST." |
| 188 | (if n | 190 | (if n |
| 189 | (let ((m 0) (p x)) | 191 | (let ((m 0) (p list)) |
| 190 | (while (consp p) | 192 | (while (consp p) |
| 191 | (setq m (1+ m) p (cdr p))) | 193 | (setq m (1+ m) p (cdr p))) |
| 192 | (if (<= n 0) p | 194 | (if (<= n 0) p |
| 193 | (if (< n m) (nthcdr (- m n) x) x))) | 195 | (if (< n m) (nthcdr (- m n) list) list))) |
| 194 | (while (consp (cdr x)) | 196 | (while (consp (cdr list)) |
| 195 | (setq x (cdr x))) | 197 | (setq list (cdr list))) |
| 196 | x)) | 198 | list)) |
| 197 | 199 | ||
| 198 | (defun butlast (x &optional n) | 200 | (defun butlast (list &optional n) |
| 199 | "Returns a copy of LIST with the last N elements removed." | 201 | "Returns a copy of LIST with the last N elements removed." |
| 200 | (if (and n (<= n 0)) x | 202 | (if (and n (<= n 0)) list |
| 201 | (nbutlast (copy-sequence x) n))) | 203 | (nbutlast (copy-sequence list) n))) |
| 202 | 204 | ||
| 203 | (defun nbutlast (x &optional n) | 205 | (defun nbutlast (list &optional n) |
| 204 | "Modifies LIST to remove the last N elements." | 206 | "Modifies LIST to remove the last N elements." |
| 205 | (let ((m (length x))) | 207 | (let ((m (length list))) |
| 206 | (or n (setq n 1)) | 208 | (or n (setq n 1)) |
| 207 | (and (< n m) | 209 | (and (< n m) |
| 208 | (progn | 210 | (progn |
| 209 | (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil)) | 211 | (if (> n 0) (setcdr (nthcdr (- (1- m) n) list) nil)) |
| 210 | x)))) | 212 | list)))) |
| 211 | 213 | ||
| 212 | (defun delete-dups (list) | 214 | (defun delete-dups (list) |
| 213 | "Destructively remove `equal' duplicates from LIST. | 215 | "Destructively remove `equal' duplicates from LIST. |
| @@ -1114,6 +1116,7 @@ FILE should be the name of a library, with no directory name." | |||
| 1114 | "Open a TCP connection for a service to a host. | 1116 | "Open a TCP connection for a service to a host. |
| 1115 | Returns a subprocess-object to represent the connection. | 1117 | Returns a subprocess-object to represent the connection. |
| 1116 | Input and output work as for subprocesses; `delete-process' closes it. | 1118 | Input and output work as for subprocesses; `delete-process' closes it. |
| 1119 | |||
| 1117 | Args are NAME BUFFER HOST SERVICE. | 1120 | Args are NAME BUFFER HOST SERVICE. |
| 1118 | NAME is name for process. It is modified if necessary to make it unique. | 1121 | NAME is name for process. It is modified if necessary to make it unique. |
| 1119 | BUFFER is the buffer (or buffer-name) to associate with the process. | 1122 | BUFFER is the buffer (or buffer-name) to associate with the process. |
| @@ -1178,12 +1181,13 @@ does not use these function." | |||
| 1178 | 1181 | ||
| 1179 | ;; compatibility | 1182 | ;; compatibility |
| 1180 | 1183 | ||
| 1184 | (make-obsolete 'process-kill-without-query | ||
| 1185 | "use `process-query-on-exit-flag'\nor `set-process-query-on-exit-flag'." | ||
| 1186 | "21.5") | ||
| 1181 | (defun process-kill-without-query (process &optional flag) | 1187 | (defun process-kill-without-query (process &optional flag) |
| 1182 | "Say no query needed if PROCESS is running when Emacs is exited. | 1188 | "Say no query needed if PROCESS is running when Emacs is exited. |
| 1183 | Optional second argument if non-nil says to require a query. | 1189 | Optional second argument if non-nil says to require a query. |
| 1184 | Value is t if a query was formerly required. | 1190 | Value is t if a query was formerly required." |
| 1185 | New code should not use this function; use `process-query-on-exit-flag' | ||
| 1186 | or `set-process-query-on-exit-flag' instead." | ||
| 1187 | (let ((old (process-query-on-exit-flag process))) | 1191 | (let ((old (process-query-on-exit-flag process))) |
| 1188 | (set-process-query-on-exit-flag process nil) | 1192 | (set-process-query-on-exit-flag process nil) |
| 1189 | old)) | 1193 | old)) |
| @@ -1693,26 +1697,27 @@ If UNDO is present and non-nil, it is a function that will be called | |||
| 1693 | (if (nth 4 handler) ;; COMMAND | 1697 | (if (nth 4 handler) ;; COMMAND |
| 1694 | (setq this-command (nth 4 handler))))) | 1698 | (setq this-command (nth 4 handler))))) |
| 1695 | 1699 | ||
| 1696 | (defun insert-buffer-substring-no-properties (buf &optional start end) | 1700 | (defun insert-buffer-substring-no-properties (buffer &optional start end) |
| 1697 | "Insert before point a substring of buffer BUFFER, without text properties. | 1701 | "Insert before point a substring of BUFFER, without text properties. |
| 1698 | BUFFER may be a buffer or a buffer name. | 1702 | BUFFER may be a buffer or a buffer name. |
| 1699 | Arguments START and END are character numbers specifying the substring. | 1703 | Arguments START and END are character numbers specifying the substring. |
| 1700 | They default to the beginning and the end of BUFFER." | 1704 | They default to the beginning and the end of BUFFER." |
| 1701 | (let ((opoint (point))) | 1705 | (let ((opoint (point))) |
| 1702 | (insert-buffer-substring buf start end) | 1706 | (insert-buffer-substring buffer start end) |
| 1703 | (let ((inhibit-read-only t)) | 1707 | (let ((inhibit-read-only t)) |
| 1704 | (set-text-properties opoint (point) nil)))) | 1708 | (set-text-properties opoint (point) nil)))) |
| 1705 | 1709 | ||
| 1706 | (defun insert-buffer-substring-as-yank (buf &optional start end) | 1710 | (defun insert-buffer-substring-as-yank (buffer &optional start end) |
| 1707 | "Insert before point a part of buffer BUFFER, stripping some text properties. | 1711 | "Insert before point a part of BUFFER, stripping some text properties. |
| 1708 | BUFFER may be a buffer or a buffer name. Arguments START and END are | 1712 | BUFFER may be a buffer or a buffer name. |
| 1709 | character numbers specifying the substring. They default to the | 1713 | Arguments START and END are character numbers specifying the substring. |
| 1710 | beginning and the end of BUFFER. Strip text properties from the | 1714 | They default to the beginning and the end of BUFFER. |
| 1711 | inserted text according to `yank-excluded-properties'." | 1715 | Strip text properties from the inserted text according to |
| 1716 | `yank-excluded-properties'." | ||
| 1712 | ;; Since the buffer text should not normally have yank-handler properties, | 1717 | ;; Since the buffer text should not normally have yank-handler properties, |
| 1713 | ;; there is no need to handle them here. | 1718 | ;; there is no need to handle them here. |
| 1714 | (let ((opoint (point))) | 1719 | (let ((opoint (point))) |
| 1715 | (insert-buffer-substring buf start end) | 1720 | (insert-buffer-substring buffer start end) |
| 1716 | (remove-yank-excluded-properties opoint (point)))) | 1721 | (remove-yank-excluded-properties opoint (point)))) |
| 1717 | 1722 | ||
| 1718 | 1723 | ||
| @@ -2073,7 +2078,7 @@ which separates, but is not part of, the substrings. If nil it defaults to | |||
| 2073 | `split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and | 2078 | `split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and |
| 2074 | OMIT-NULLS is forced to t. | 2079 | OMIT-NULLS is forced to t. |
| 2075 | 2080 | ||
| 2076 | If OMIT-NULLs is t, zero-length substrings are omitted from the list \(so | 2081 | If OMIT-NULLS is t, zero-length substrings are omitted from the list \(so |
| 2077 | that for the default value of SEPARATORS leading and trailing whitespace | 2082 | that for the default value of SEPARATORS leading and trailing whitespace |
| 2078 | are effectively trimmed). If nil, all zero-length substrings are retained, | 2083 | are effectively trimmed). If nil, all zero-length substrings are retained, |
| 2079 | which correctly parses CSV format, for example. | 2084 | which correctly parses CSV format, for example. |