bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19627: 25.0.50; eshell: only the first item from eshell-visual-optio


From: npostavs
Subject: bug#19627: 25.0.50; eshell: only the first item from eshell-visual-options is honored
Date: Sun, 03 Jul 2016 22:47:54 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux)

severity 19627 minor
quit

Samer Masterson <nosefrog@gmail.com> writes:

> 1. "emacs -Q"
> 2. M-x eshell
> 3. "git --help" prints the help text to the buffer
> 4. (add-to-list 'eshell-visual-options '("git" "--help"))
> 5. "git --help" brings up the term display (which is quickly killed,
> that is bug#18108)
> 6. (add-to-list 'eshell-visual-options '("git" "--help"))

I guess you actually meant "--version" rather than "--help" again here.

> 7. "git --help"
> bug:
> "git --help" prints the help text to the buffer.
> expected behavior:
> "git --help" should have brought up a term-mode buffer, as it's still
> part of eshell-visual-options.

eshell-visual-options is an alist (as mentioned in the docstring), so
the newest "git" entry decides which options are in force.  To get what
you want, you should do:

  (add-to-list 'eshell-visual-options '("git" "--help" "--version"))

or possibly

  (push "--version" (cdr (assoc "git" eshell-visual-options)))

Maybe the docs can be improved to explain this better.  Is it enough to
change the example usage to have 2 different options?

>From c51bb7b36ef7f0bbe3e69c8fe16abc6b2ca8a6c1 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Sun, 3 Jul 2016 22:41:48 -0400
Subject: [PATCH v1] Clarify usage of eshell-visual-options

* lisp/eshell/em-term.el (eshell-visual-options): Add second option to
example usage.
---
 lisp/eshell/em-term.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index 3e5de0c..208629c 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -102,10 +102,11 @@ eshell-visual-options
 of commands with options that present their output in a visual
 fashion.  For example, a sensible entry would be
 
-  (\"git\" \"--help\")
+  (\"git\" \"--help\" \"--paginate\")
 
 because \"git <command> --help\" shows the command's
-documentation with a pager.
+documentation with a pager and \"git --paginate <command>\"
+always uses a pager for output.
 
 See also `eshell-visual-commands' and `eshell-visual-subcommands'."
   :type '(repeat (cons (string :tag "Command")
-- 
2.8.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]