comparison contrib/mercurial.el @ 2985:e75fdc37100c

mercurial.el: fix hg-chomp.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 22 Aug 2006 11:24:59 -0700
parents e1762867a734
children b6e6d2a9c5bc
comparison
equal deleted inserted replaced
2984:e1762867a734 2985:e75fdc37100c
287 (hg-replace-in-string (hg-replace-in-string str "[\r\n][ \t\r\n]*\\'" "") 287 (hg-replace-in-string (hg-replace-in-string str "[\r\n][ \t\r\n]*\\'" "")
288 "\\`[ \t\r\n]*[\r\n]" "")) 288 "\\`[ \t\r\n]*[\r\n]" ""))
289 289
290 (defsubst hg-chomp (str) 290 (defsubst hg-chomp (str)
291 "Strip trailing newlines from a string." 291 "Strip trailing newlines from a string."
292 (hg-replace-in-string str "[\r\n]+\'" "")) 292 (hg-replace-in-string str "[\r\n]+\\'" ""))
293 293
294 (defun hg-run-command (command &rest args) 294 (defun hg-run-command (command &rest args)
295 "Run the shell command COMMAND, returning (EXIT-CODE . COMMAND-OUTPUT). 295 "Run the shell command COMMAND, returning (EXIT-CODE . COMMAND-OUTPUT).
296 The list ARGS contains a list of arguments to pass to the command." 296 The list ARGS contains a list of arguments to pass to the command."
297 (let* (exit-code 297 (let* (exit-code