Loading ...
Sorry, an error occurred while loading the content.
 

RE: [jasspa] Bug

Expand Messages
  • Phillips, Steven
    It does make sense but this is not the best way to do it. You should use magic mode and try the following: replace-string ^ hilight .hilight.css 1
    Message 1 of 4 , Apr 7, 2004
      It does make sense but this is not the best way to do it. You should use magic mode and try the following:

      replace-string "^" "hilight .hilight.css 1 \""
      beginning-of-buffer
      replace-string "$" "\" .scheme.keyword"

      This wraps the text around the keyword. However once you get a bit more familiar with magic mode (see the regex docs) you can easily do this in one step as follows:

      replace-string "\\(.+\\)" "hilight .hilight.css 1 \"\\1\" .scheme.keyword"

      (Note I have back-quoted to make this legitimate macro code, the search string is:
      \(.+\)
      And replace string is:
      hilight .hilight.css 1 "\1" .scheme.keyword

      See docs on regex groups '\(...\)' or play!

      As a side note, the line length limit is there for memory efficiency, each line is stored as a structure and this structure stores the length of a line as an unsigned short (2 bytes) giving an maximum length of 65535 chars, realistically if your lines are longer than this you are trying to edit a binary file in text mode, done something wrong (like your search-replace) or doing something very weird. So this limit has not been much of an issue to date.

      Steve

      > -----Original Message-----
      > From: first last [mailto:prelude_2_murder@...]
      > Sent: 07 April 2004 11:20
      > To: jasspa@yahoogroups.com
      > Subject: RE: [jasspa] Bug
      >
      >
      > Hi Jon,
      >
      > what I am trying to do is to change the format of a list of words. An
      > example of this is when I created the keyword list for the css mode:
      >
      > Using the command line I created a list of the keywords (then
      > into sort
      > and then into uniq), then I had a list like:
      >
      > keyword1
      > keyword2
      > keyword3
      > ....
      >
      > what I did was to replace (Esc-R)
      > '\n' with
      >
      > " .scheme.keyword hilight\n hilight .hilight.css 1
      > "
      >
      > so I got:
      >
      > hilight .hilight.css 1 "keyword1" .scheme.keyword
      > hilight .hilight.css 1 "keyword2" .scheme.keyword
      > hilight .hilight.css 1 "keyword3" .scheme.keyword
      >
      > Well, that is the theory. Because of the bug I just mentioned
      > I got the
      > expected result plus millions of extra lines like
      > hilight .hilight.css 1 "" .scheme.keyword
      >
      > If I do the same and I don't use a "\n" anywhere in the replacement
      > string I then get the "line too long" message.
      >
      > I normally use the latter to empty html files of all
      > whitespace so they
      > get smaller (/\n[ ]*/). I then end up with one long line that contains
      > the whole file (Dreamweaver is terrible, the pages get extremely
      > bloated with whitespace).
      >
      > Does it make sense now?
      >
      > Thanks
      >
      > Gabriel
      >
      > ______________________________________________________________
      > __________
      > Yahoo! Messenger - Communicate instantly..."Ping"
      > your friends today! Download Messenger Now
      > http://uk.messenger.yahoo.com/download/index.html
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      > ---------------------~-->
      > Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
      > Printer at MyInks.com. Free s/h on orders $50 or more to the
      > US & Canada.
      > http://www.c1tracking.com/l.asp?cid=5511
      > http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/89EolB/TM
      > --------------------------------------------------------------
      > -------~->
      >
      > ______________________________________________________________
      > ____________
      >
      > This is an unmoderated list. JASSPA is not responsible for
      > the content of
      > any material posted to this list.
      >
      > To unsubscribe, send a mail message to
      >
      > mailto:jasspa-unsubscribe@yahoogroups.com
      >
      > or visit http://groups.yahoo.com/group/jasspa and
      > modify your account settings manually.
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.