Jump to content

Talk:CAT:TRACK

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

#include "eel.h"

command transpose_characters() on reg_tab[CTRL('T')] {

  int p = point;
  char c, d;
  if (p == size() || curchar() == '\n')
     p--;		/* switch last two at end of line */
  else if (p == 0 || character(point - 1) == '\n')
     p++;
  c = character(p);	/* store away current */
  d = character(p - 1);
  if (p > 0 && p < size() && c != '\n' && d != '\n') {
     replace(p, d);
     replace(p - 1, c);
  }
  iter = 0;
  point++;				/* OHL 11 Jul 1999: end up after the second */

}

transpose_areas(from1, to1, from2, to2) { /* requires from1 <= to1 <= from2 <= to2 */

  int t1, t2;
  if (from1 > to1 || to1 > from2 || from2 > to2)
     return;
  t1 = tmp_buf();
  t2 = tmp_buf();
  buf_xfer(t1, from1, to1);		/* copy areas */
  buf_xfer(t2, from2, to2);
  delete(from2, to2);
  delete(from1, to1);
  point = from1 + from2 - to1;		/* go to where second was */
  grab_buffer(t1);
  point = from1;			/* go where first was */
  grab_buffer(t2);			/* stay after first one */
  buf_delete(t1);
  buf_delete(t2);
  point = to2;				/* OHL 11 Jul 1999: end up after the second */

}

  1. define LEFTD "[({"
  2. define RIGHTD "])}"

command transpose_levels() on reg_tab[ALT(CTRL('t'))] {

  int from1, to1, from2, to2;
  int start = point;
  move_level(1, LEFTD, RIGHTD, 1);		/* these extra moves */
  if (!move_level(-1, LEFTD, RIGHTD, 1))	/* position us correctly */
     error("Nothing to transpose.");		/* when we're near one */
  if (!move_level(-1, LEFTD, RIGHTD, 1)) {	/* end of the buffer */
     move_level(1, LEFTD, RIGHTD, 1);
     if (!move_level(1, LEFTD, RIGHTD, 1))

error("Nothing to transpose.");

     move_level(-1, LEFTD, RIGHTD, 1);
     move_level(-1, LEFTD, RIGHTD, 1);
  }
  from1 = point;			/* now we're at start of first word */
  move_level(1, LEFTD, RIGHTD, 1);
  to1 = point;
  move_level(1, LEFTD, RIGHTD, 1);
  to2 = point;
  move_level(-1, LEFTD, RIGHTD, 1);
  transpose_areas(from1, to1, point, to2);
  iter = 0;

}

Phần mềm

[edit]

Phần mềm hỗ trợ hệ điều hành 2402:800:63A3:F81B:78C3:6FAE:CDE9:F7A1 (talk) 16:20, 10 December 2022 (UTC)[reply]

@2402:800:63A3:F81B:78C3:6FAE:CDE9:F7A1 upstairs Nomore 2607:FB91:162E:1606:594D:88F4:1D2F:8688 (talk) 15:02, 29 July 2023 (UTC)[reply]
@2402:800:63A3:F81B:78C3:6FAE:CDE9:F7A1 Get Rid Of The Upstairs 2607:FB91:162E:1606:594D:88F4:1D2F:8688 (talk) 15:02, 29 July 2023 (UTC)[reply]
leave wikipedia clear all link 59.103.221.216 (talk) 20:46, 18 February 2024 (UTC)[reply]