• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A bit off topic, Xemacs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A bit off topic, Xemacs?


  • Subject: Re: A bit off topic, Xemacs?
  • From: "Michael W. Fleming" <email@hidden>
  • Date: Thu, 13 Feb 2003 10:10:27 -0800

Dmytro Koval'ov wrote:
On Wed, 12 Feb 2003, "Michael" == Michael W. Fleming wrote:



Michael> I've got it installed (21.5.4-2) and it launches just fine Michael> and works well with standard files. But I've got a newbie Michael> question that I can't seem to get google or the xemacs docs Michael> to help me figure out. Whenever I edit an html file, the Michael> carriage-return characters show up as ^M. Ugly.

You are probably editing DOS-file (with CRLF instead of CR as in UNIX). Try to find such thisnas 'dos-mode' for emacs.

  Michael> Suggestions?


Alternatively I have this in my ~/.emacs:

;http://www.linuxgazette.com/issue10/lg_tips10.html#emacs
;Date: Thu, 05 Sep 1996 13:34:09 -0700 ;From: Earl Stutes <email@hidden>
;Subject: $.02 emacs tip


(defun dos-unix ()
  (interactive)
  (goto-char (point-min))
  (while (search-forward "\r" nil t) (replace-match "")))
(defun unix-dos ()
  (interactive)
  (goto-char (point-min))
  (while (search-forward "\n" nil t) (replace-match "\r\n")))


Any time I need to convert file between dos - unix I call either 'M-x dos-unix' or 'M-x unix-dos'


Cheers,
Dmytro.

You are correct. I was thrown off because the other editors I use on the Mac don't have a problem with the ^M's (including vanilla emacs). However, executing M-x dos-unix left the file without any newlines at all. I modified the replace-match to "\n" and everything seems to be as I want. To repeat, I am an emacs/xemacs newbie so if my modification is going to nail me in the future, you can save me some grief by warning me now.


Thanks for the replies Dmytro and Charles.

Michael
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: X11 xterm window initialization
  • Next by Date: Re: xterm dies if command is not PATH
  • Previous by thread: Re: A bit off topic, Xemacs?
  • Next by thread: Complete start over with X11
  • Index(es):
    • Date
    • Thread