summaryrefslogtreecommitdiff
path: root/helm-eshell.el
diff options
context:
space:
mode:
Diffstat (limited to 'helm-eshell.el')
-rw-r--r--helm-eshell.el29
1 files changed, 15 insertions, 14 deletions
diff --git a/helm-eshell.el b/helm-eshell.el
index 6c4e9756..359f5f50 100644
--- a/helm-eshell.el
+++ b/helm-eshell.el
@@ -1,6 +1,6 @@
;;; helm-eshell.el --- pcomplete and eshell completion for helm. -*- lexical-binding: t -*-
-;; Copyright (C) 2012 ~ 2019 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+;; Copyright (C) 2012 ~ 2020 Thierry Volpiatto <thierry.volpiatto@gmail.com>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -92,7 +92,7 @@ at point."
(lambda (x)
(cond ((string-match "\\`~/" helm-ec-target)
;; Strip out the first escape char added by
- ;; `comint-quote-filename' before "~" (Issue #1803).
+ ;; `comint-quote-filename' before "~" (Bug#1803).
(substring (comint-quote-filename (abbreviate-file-name x)) 1))
((string-match "\\`/" helm-ec-target)
(comint-quote-filename x))
@@ -154,15 +154,18 @@ at point."
with comps = (all-completions pcomplete-stub table)
unless comps return (prog1 nil
;; Don't add final space when
- ;; there is no completion (issue #1990).
+ ;; there is no completion (Bug#1990).
(setq helm-eshell--quit-flag t)
(message "No completions of %s" pcomplete-stub))
for i in comps
- ;; Transform the related names to abs names.
+ ;; Transform the relative names to abs names.
for file-cand = (and exp-entry
(if (file-remote-p i) i
(expand-file-name
- i (file-name-directory entry))))
+ i (file-name-directory
+ (if (directory-name-p pcomplete-stub)
+ entry
+ (directory-file-name entry))))))
;; Compare them to avoid dups.
for file-entry-p = (and (stringp exp-entry)
(stringp file-cand)
@@ -204,7 +207,11 @@ at point."
(lambda ()
(with-helm-current-buffer
(cl-loop for c from 0 to (ring-length eshell-history-ring)
- collect (eshell-get-history c)))))
+ for elm = (eshell-get-history c)
+ unless (and (member elm lst)
+ eshell-hist-ignoredups)
+ collect elm into lst
+ finally return lst))))
(nomark :initform t)
(multiline :initform t)
(keymap :initform helm-eshell-history-map)
@@ -219,7 +226,7 @@ at point."
(if (and (stringp last)
(not (string= last ""))
(not users-comp)
- ;; Fix completion on "../" see #1832.
+ ;; Fix completion on "../" see Bug#1832.
(or (file-exists-p last)
(helm-aand
(file-name-directory last)
@@ -318,7 +325,7 @@ at point."
;; global to pass it to `helm-quit-hook', this
;; space is added when point is just after
;; previous completion and there is no
- ;; more completion, see issue #1832.
+ ;; more completion, see Bug#1832.
(unless (or helm-eshell--quit-flag
(looking-back "/\\'" (1- (point))))
(prog1 t (insert " ")))
@@ -492,10 +499,4 @@ See `helm-eshell-prompts-list'."
(provide 'helm-eshell)
-;; Local Variables:
-;; byte-compile-warnings: (not obsolete)
-;; coding: utf-8
-;; indent-tabs-mode: nil
-;; End:
-
;;; helm-eshell ends here