]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: Fix usings update when no newline at eof.
authorJose A. Ortega Ruiz <jao@gnu.org>
Mon, 12 Jan 2009 01:34:39 +0000 (02:34 +0100)
committerJose A. Ortega Ruiz <jao@gnu.org>
Mon, 12 Jan 2009 01:34:39 +0000 (02:34 +0100)
misc/fuel/fuel-base.el
misc/fuel/fuel-debug-uses.el

index f168cdf9b898413380551f4624ce863b972885de..5e8364e3a7e561cb3b35a370e705bfbead07eaf5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; fuel-base.el --- Basic FUEL support code
 
-;; Copyright (C) 2008  Jose Antonio Ortega Ruiz
+;; Copyright (C) 2008 Jose Antonio Ortega Ruiz
 ;; See http://factorcode.org/license.txt for BSD license.
 
 ;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
index 7b90093c21faa7dce14ddd6e03bb46ed6eb65a8d..d37cf7b58d90ac578f926f28cca763460c1545e2 100644 (file)
@@ -1,6 +1,6 @@
 ;;; fuel-debug-uses.el -- retrieving USING: stanzas
 
-;; Copyright (C) 2008 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2008, 2009 Jose Antonio Ortega Ruiz
 ;; See http://factorcode.org/license.txt for BSD license.
 
 ;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
@@ -32,6 +32,9 @@
 \f
 ;;; Utility functions:
 
+(defsubst fuel-debug--chomp (s)
+  (replace-regexp-in-string "[\n\r\f]" "" s))
+
 (defun fuel-debug--file-lines (file)
   (when (file-readable-p file)
     (with-current-buffer (find-file-noselect file)
@@ -40,7 +43,8 @@
         (let ((lines) (in-usings))
           (while (not (eobp))
             (when (looking-at "^USING: ") (setq in-usings t))
-            (let ((line (substring-no-properties (thing-at-point 'line) 0 -1)))
+            (let ((line (fuel-debug--chomp
+                         (substring-no-properties (thing-at-point 'line)))))
               (when in-usings (setq line (concat "! " line)))
               (push line lines))
             (when (and in-usings (looking-at ".*\\_<;\\_>")) (setq in-usings nil))