branch: scratch/editorconfig
commit 30c7f7bc7dd4c33562dc630321c68163fd8f25fd
Author: Stefan Monnier <monn...@iro.umontreal.ca>
Commit: Stefan Monnier <monn...@iro.umontreal.ca>

    Various fixes and comments
---
 editorconfig.el | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 329320b3de..57ceb51e9e 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -360,6 +360,9 @@ When variable `buffer-file-name' matches any of the 
regexps, then
 `editorconfig-mode-apply' will not do its work."
   :type '(repeat string))
 (with-eval-after-load 'recentf
+  ;; FIXME: This was added because of issue #240 which was a special
+  ;; case of issue #246.  Now that the general problem is fixed, I
+  ;; think this is not needed any more.
   (add-to-list 'editorconfig-exclude-regexps
                (rx-to-string '(seq string-start
                                    (eval (file-truename (expand-file-name 
recentf-save-file))))
@@ -898,7 +901,7 @@ F is that function, and FILENAME and ARGS are arguments 
passed to F."
              (not (editorconfig--disabled-for-filename buffer-file-name))
              (not (editorconfig--disabled-for-majormode major-mode)))
     ;; FIXME: Cache the result of `editorconfig-call-get-properties-function'?
-    (let ((props (editorconfig-call-get-properties-function filename))
+    (let ((props (editorconfig-call-get-properties-function buffer-file-name))
           (alist ()))
       (maphash
        (lambda (prop setting)
@@ -911,22 +914,24 @@ F is that function, and FILENAME and ARGS are arguments 
passed to F."
                    (cond
                     ((editorconfig-string-integer-p setting)
                      (string-to-number setting))
-                    ((equal size "tab")
+                    ((equal setting "tab")
                      (let ((tabsize (gethash 'tab_width props)))
-                      (if tabsize (string-to-number tabsize)
-                       tab-width))))))
+                       (if tabsize (string-to-number tabsize)
+                        tab-width))))))
               (when size
                 (setq alist (nconc (funcall editorconfig-indent-vars-function
-                                    size)
-                             alist)))))
-           ;; FIXME!!
+                                           size)
+                                  alist)))))
+           ;; FIXME: Add the other settings supported by
+           ;; `editorconfig-set-local-variables'!
            ))
        props)
       ;; FIXME: Actually, we should loop over the "editorconfig-core-handles"
       ;; since each one comes from a different directory.
       (cons
-       ¿DIRNAME? ;;FIXME)
-        alist))))
+       ;; FIXME: This should be the dir where we found the `.editorconfig' 
file.
+       (file-name-directory buffer-file-name)
+       alist))))
 
 ;;;###autoload
 (define-minor-mode editorconfig-mode

Reply via email to