FUEL: Fix usings update when no newline at eof.

db4
Jose A. Ortega Ruiz 2009-01-12 02:34:39 +01:00
parent 28029404c3
commit 871a2bb745
2 changed files with 7 additions and 3 deletions

View 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>

View 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 @@
;;; 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))