From 871a2bb7450d57f963e391d9916a7ce5302ca5df Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Mon, 12 Jan 2009 02:34:39 +0100 Subject: [PATCH] FUEL: Fix usings update when no newline at eof. --- misc/fuel/fuel-base.el | 2 +- misc/fuel/fuel-debug-uses.el | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/misc/fuel/fuel-base.el b/misc/fuel/fuel-base.el index f168cdf9b8..5e8364e3a7 100644 --- a/misc/fuel/fuel-base.el +++ b/misc/fuel/fuel-base.el @@ -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 diff --git a/misc/fuel/fuel-debug-uses.el b/misc/fuel/fuel-debug-uses.el index 7b90093c21..d37cf7b58d 100644 --- a/misc/fuel/fuel-debug-uses.el +++ b/misc/fuel/fuel-debug-uses.el @@ -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 @@ -32,6 +32,9 @@ ;;; 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))