diff options
| author | Lars Ingebrigtsen | 2019-08-17 14:52:15 -0700 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-08-17 16:35:59 -0700 |
| commit | 669599b0f4b59029fd977609be02f754a3b075eb (patch) | |
| tree | e82a0bed9f7ad258cb53a698f3e7d9f78878f635 | |
| parent | c90a420779448fecf1941f063da3e8276dc3d0d7 (diff) | |
| download | emacs-669599b0f4b59029fd977609be02f754a3b075eb.tar.gz emacs-669599b0f4b59029fd977609be02f754a3b075eb.zip | |
Doc clarification in two comment-* functions
* lisp/newcomment.el (comment-padright, comment-padleft): Note
that `comment-normalize-vars' must be called first (bug#11944).
| -rw-r--r-- | lisp/newcomment.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index ac706b949ba..027c20430cc 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -825,7 +825,9 @@ If STR already contains padding, the corresponding amount is | |||
| 825 | ignored from `comment-padding'. | 825 | ignored from `comment-padding'. |
| 826 | N defaults to 0. | 826 | N defaults to 0. |
| 827 | If N is `re', a regexp is returned instead, that would match | 827 | If N is `re', a regexp is returned instead, that would match |
| 828 | the string for any N." | 828 | the string for any N. |
| 829 | |||
| 830 | Ensure that `comment-normalize-vars' has been called before you use this." | ||
| 829 | (setq n (or n 0)) | 831 | (setq n (or n 0)) |
| 830 | (when (and (stringp str) (string-match "\\S-" str)) | 832 | (when (and (stringp str) (string-match "\\S-" str)) |
| 831 | ;; Separate the actual string from any leading/trailing padding | 833 | ;; Separate the actual string from any leading/trailing padding |
| @@ -860,8 +862,10 @@ It also adds N copies of the first non-whitespace chars of STR. | |||
| 860 | If STR already contains padding, the corresponding amount is | 862 | If STR already contains padding, the corresponding amount is |
| 861 | ignored from `comment-padding'. | 863 | ignored from `comment-padding'. |
| 862 | N defaults to 0. | 864 | N defaults to 0. |
| 863 | If N is `re', a regexp is returned instead, that would match | 865 | If N is `re', a regexp is returned instead, that would match the |
| 864 | the string for any N." | 866 | string for any N. |
| 867 | |||
| 868 | Ensure that `comment-normalize-vars' has been called before you use this." | ||
| 865 | (setq n (or n 0)) | 869 | (setq n (or n 0)) |
| 866 | (when (and (stringp str) (not (string= "" str))) | 870 | (when (and (stringp str) (not (string= "" str))) |
| 867 | ;; Only separate the left pad because we assume there is no right pad. | 871 | ;; Only separate the left pad because we assume there is no right pad. |