summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Leal-Cavazos <ramiroleal050@gmail.com>2021-04-11 12:31:32 -0700
committerGitHub <noreply@github.com>2021-04-11 21:31:32 +0200
commit38d15c98316359c7b0b190f2245a3b2e2bf62109 (patch)
tree3cad1fa51d92a1ed36d0a72987c759cc09a1c4df
parent9d959abd39cd787fa7b5d68327d19d3972fe888e (diff)
downloadpylint-git-38d15c98316359c7b0b190f2245a3b2e2bf62109.tar.gz
fix emacs pylint error when running with tramp (#4333)
* Fixed bug when accessing `tramp-file-name` localname field * Fixed emacs bug when getting localname of of remote files
-rw-r--r--CONTRIBUTORS.txt2
-rw-r--r--ChangeLog2
-rw-r--r--elisp/pylint.el3
3 files changed, 6 insertions, 1 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index e95ae4529..2160884db 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -470,3 +470,5 @@ contributors:
* Andreas Finkler: contributor
* Sebastian Müller: contributor
+
+* Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp
diff --git a/ChangeLog b/ChangeLog
index f35181c84..025b92794 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -88,6 +88,8 @@ Release date: Undefined
Closes #4320
+* Fix issue that caused emacs pylint to fail when used with tramp
+
What's New in Pylint 2.7.4?
===========================
diff --git a/elisp/pylint.el b/elisp/pylint.el
index d27a92b14..327da0fcb 100644
--- a/elisp/pylint.el
+++ b/elisp/pylint.el
@@ -202,8 +202,9 @@ output buffer, to go to the lines where pylint found matches.
(save-some-buffers (not pylint-ask-about-save) nil)
(let* ((filename (buffer-file-name))
+ (localname-offset (cl-struct-slot-offset 'tramp-file-name 'localname))
(filename (or (and (tramp-tramp-file-p filename)
- (aref (tramp-dissect-file-name filename) 3))
+ (elt (tramp-dissect-file-name filename) localname-offset))
filename))
(filename (shell-quote-argument filename))
(pylint-command (if arg