comparison src/cmds.c @ 9405:b7f3059c308a

* cmds.c (Fforward_line): Call scan_buffer with new args. (Fend_of_line): Replace call to Fforward_line and search loop with call to find_before_next_newline.
author Jim Blandy <jimb@redhat.com>
date Sat, 08 Oct 1994 22:13:15 +0000
parents 1ff5359ac932
children cede2b87231a
comparison
equal deleted inserted replaced
9404:698990d4feca 9405:b7f3059c308a
104 CHECK_NUMBER (n, 0); 104 CHECK_NUMBER (n, 0);
105 count = XINT (n); 105 count = XINT (n);
106 } 106 }
107 107
108 negp = count <= 0; 108 negp = count <= 0;
109 pos = scan_buffer ('\n', pos2, count - negp, &shortage, 1); 109 pos = scan_buffer ('\n', pos2, 0, count - negp, &shortage, 1);
110 if (shortage > 0 110 if (shortage > 0
111 && (negp 111 && (negp
112 || (ZV > BEGV 112 || (ZV > BEGV
113 && pos != pos2 113 && pos != pos2
114 && FETCH_CHAR (pos - 1) != '\n'))) 114 && FETCH_CHAR (pos - 1) != '\n')))
148 if (NILP (n)) 148 if (NILP (n))
149 XSETFASTINT (n, 1); 149 XSETFASTINT (n, 1);
150 else 150 else
151 CHECK_NUMBER (n, 0); 151 CHECK_NUMBER (n, 0);
152 152
153 if (XINT (n) != 1) 153 SET_PT (find_before_next_newline (PT, 0, XINT (n) - (XINT (n) <= 0)));
154 Fforward_line (make_number (XINT (n) - 1));
155
156 pos = point;
157 stop = ZV;
158 while (pos < stop && FETCH_CHAR (pos) != '\n') pos++;
159 SET_PT (pos);
160 154
161 return Qnil; 155 return Qnil;
162 } 156 }
163 157
164 DEFUN ("delete-char", Fdelete_char, Sdelete_char, 1, 2, "p\nP", 158 DEFUN ("delete-char", Fdelete_char, Sdelete_char, 1, 2, "p\nP",