]> git.neil.brown.name Git - edlib.git/commitdiff
emacs_findfile: use pane_attr_get instead of doc_attr.
authorNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 07:04:32 +0000 (18:04 +1100)
committerNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 07:04:32 +0000 (18:04 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
mode-emacs.c

index 3e7481ddaa10cbb1c187743501fc4fe73dbc5d00..237805c528078718665f9eb70ed852c071360850 100644 (file)
@@ -254,16 +254,15 @@ DEF_CMD(emacs_findfile)
                char *path = NULL;
                char buf[PATH_MAX];
 
-               if (ci->pointp) {
-                       path = doc_attr((*ci->pointp)->doc, NULL, 0, "filename");
-                       if (path) {
-                               strcpy(buf, path);
-                               path = strrchr(buf, '/');
-                               if (path)
-                                       path[1] = '\0';
-                               path = buf;
-                       }
+               path = pane_attr_get(ci->focus, "filename");
+               if (path) {
+                       strcpy(buf, path);
+                       path = strrchr(buf, '/');
+                       if (path)
+                               path[1] = '\0';
+                       path = buf;
                }
+
                if (!path)
                        path = realpath(".", buf);
                if (!path)