GNU bug report logs - #19627
25.0.50; eshell: only the first item from eshell-visual-options is honored

Previous Next

Package: emacs;

Reported by: Samer Masterson <nosefrog <at> gmail.com>

Date: Mon, 19 Jan 2015 11:29:02 UTC

Severity: minor

Found in version 25.0.50

Fixed in version 25.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #8 received at 19627 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Samer Masterson <nosefrog <at> gmail.com>
Cc: 19627 <at> debbugs.gnu.org
Subject: Re: 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
[Message part 1 (text/plain, inline)]
severity 19627 minor
quit

Samer Masterson <nosefrog <at> 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?

[v1-0001-Clarify-usage-of-eshell-visual-options.patch (text/x-diff, inline)]
From c51bb7b36ef7f0bbe3e69c8fe16abc6b2ca8a6c1 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> 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


This bug report was last modified 9 years and 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.