Deleted Added
full compact
mark.c (1.6) mark.c (1.7)
1/*
1/*
2 * Copyright (C) 1984-2002 Mark Nudelman
2 * Copyright (C) 1984-2011 Mark Nudelman
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information about less, or for information on how to
8 * contact the author, see the README file.
9 */
10

--- 113 unchanged lines hidden (view full) ---

124 error("Mark not set", NULL_PARG);
125 return (NULL);
126 }
127 break;
128 }
129 return (m);
130}
131
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information about less, or for information on how to
8 * contact the author, see the README file.
9 */
10

--- 113 unchanged lines hidden (view full) ---

124 error("Mark not set", NULL_PARG);
125 return (NULL);
126 }
127 break;
128 }
129 return (m);
130}
131
132#ifndef SMALL_PROGRAM
132#if PIPEC
133/*
134 * Is a mark letter is invalid?
135 */
136 public int
137badmark(c)
138 int c;
139{
140 return (getmark(c) == NULL);
141}
133/*
134 * Is a mark letter is invalid?
135 */
136 public int
137badmark(c)
138 int c;
139{
140 return (getmark(c) == NULL);
141}
142#endif /* SMALL_PROGRAM */
142#endif
143
144/*
145 * Set a user-defined mark.
146 */
147 public void
148setmark(c)
149 int c;
150{

--- 11 unchanged lines hidden (view full) ---

162/*
163 * Set lmark (the mark named by the apostrophe).
164 */
165 public void
166lastmark()
167{
168 struct scrpos scrpos;
169
143
144/*
145 * Set a user-defined mark.
146 */
147 public void
148setmark(c)
149 int c;
150{

--- 11 unchanged lines hidden (view full) ---

162/*
163 * Set lmark (the mark named by the apostrophe).
164 */
165 public void
166lastmark()
167{
168 struct scrpos scrpos;
169
170 if (ch_getflags() & CH_HELPFILE)
171 return;
170 get_scrpos(&scrpos);
171 if (scrpos.pos == NULL_POSITION)
172 return;
173 marks[LASTMARK].m_scrpos = scrpos;
174 marks[LASTMARK].m_ifile = curr_ifile;
175}
176
177/*

--- 35 unchanged lines hidden (view full) ---

213 */
214 if (edit_ifile(m->m_ifile))
215 return;
216 }
217
218 jump_loc(scrpos.pos, scrpos.ln);
219}
220
172 get_scrpos(&scrpos);
173 if (scrpos.pos == NULL_POSITION)
174 return;
175 marks[LASTMARK].m_scrpos = scrpos;
176 marks[LASTMARK].m_ifile = curr_ifile;
177}
178
179/*

--- 35 unchanged lines hidden (view full) ---

215 */
216 if (edit_ifile(m->m_ifile))
217 return;
218 }
219
220 jump_loc(scrpos.pos, scrpos.ln);
221}
222
221#ifndef SMALL_PROGRAM
223#if PIPEC
222/*
223 * Return the position associated with a given mark letter.
224 *
225 * We don't return which screen line the position
226 * is associated with, but this doesn't matter much,
227 * because it's always the first non-blank line on the screen.
228 */
229 public POSITION

--- 8 unchanged lines hidden (view full) ---

238
239 if (m->m_ifile != curr_ifile)
240 {
241 error("Mark not in current file", NULL_PARG);
242 return (NULL_POSITION);
243 }
244 return (m->m_scrpos.pos);
245}
224/*
225 * Return the position associated with a given mark letter.
226 *
227 * We don't return which screen line the position
228 * is associated with, but this doesn't matter much,
229 * because it's always the first non-blank line on the screen.
230 */
231 public POSITION

--- 8 unchanged lines hidden (view full) ---

240
241 if (m->m_ifile != curr_ifile)
242 {
243 error("Mark not in current file", NULL_PARG);
244 return (NULL_POSITION);
245 }
246 return (m->m_scrpos.pos);
247}
246#endif /* SMALL_PROGRAM */
248#endif /* PIPEC */
247
248/*
249 * Clear the marks associated with a specified ifile.
250 */
251 public void
252unmark(ifile)
253 IFILE ifile;
254{
255 int i;
256
257 for (i = 0; i < NMARKS; i++)
258 if (marks[i].m_ifile == ifile)
259 marks[i].m_scrpos.pos = NULL_POSITION;
260}
249
250/*
251 * Clear the marks associated with a specified ifile.
252 */
253 public void
254unmark(ifile)
255 IFILE ifile;
256{
257 int i;
258
259 for (i = 0; i < NMARKS; i++)
260 if (marks[i].m_ifile == ifile)
261 marks[i].m_scrpos.pos = NULL_POSITION;
262}