emacs-devel
[Top][All Lists]
Advanced

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

Re: New Package: sticky-shell


From: Andrew De Angelis
Subject: Re: New Package: sticky-shell
Date: Mon, 12 Dec 2022 23:07:13 -0500

@Jean Louis, about
I have tested it, it does not work reliably.
Thanks for flagging this. What version of Emacs are you running, and do you have any special shell configuration?
I built Emacs from master last week, did "emacs -q" and sticky-shell works as expected.

@Stefan Monnier
Any chance we could simply add it to `shell.el`?

I wouldn't mind adding it to `shell.el`. Let me know what the process would be in that case.

@Philip Kaludercic
I assume you are referring to GNU ELPA (the only where contributors have
to sign the FSF CA?)
Yes.

And thanks for your suggestions/comments on the code. I will apply the changes and push them soon,  including adding the .elpaignore file.

I do have some questions about some of your comments:

+    ;; Perhaps you should pull this into a separate function, as the
+    ;; check appears quite often.  Another idea, as the pattern appease quite similar in general, you could also
I think part of this comment is missing? But yes I do agree a separate function is probably a good idea here.

@@ -129,23 +134,25 @@ macro-expands to:
  (upcase
   (funcall sticky-shell-get-prompt))
  \\='face \\='minibuffer-prompt)"
+  ;; The case distinction appears unnecessary (thread-first (foo)) is
+  ;; the same as (foo).
   (if sticky-shell-prompt-modifiers
       `(thread-first
          (funcall sticky-shell-get-prompt)
          ,@sticky-shell-prompt-modifiers)
+    ;; Perhaps it would be better/cleaner if
+    ;; `sticky-shell-prompt-modifiers' were a list of function that
+    ;; all get applied on the result of (funcall
+    ;; sticky-shell-get-prompt) in order?
     (funcall sticky-shell-get-prompt)))
Not sure what you mean by the first comment.
Regarding the second comment: this is essentially what thread-first does, with the added advantage that `sticky-shell-prompt-modifiers' can consist not only of functions, but also of forms with multiple arguments, and whose first argument will be the result of (funcall sticky-shell-get-prompt) at runtime. For example, if users wanted to `propertize' the header with particular properties, they wouldn't be able to do it if `sticky-shell-prompt-modifiers' was simply a list of functions operating on a single argument, because `propertize' requires multiple arguments. The solution would have to be to create a new function:
(defun propertize-my-way (string)
         (propertize string 'face 'minibuffer))
And add propertize-my-way to the list of prompt modifiers.
Using thread-first saves users time by allowing them to simply add '(propertize 'face 'minibuffer) to `sticky-shell-prompt-modifiers'.

On Mon, Dec 12, 2022 at 10:27 PM Jean Louis <bugs@gnu.support> wrote:
* Andrew De Angelis <bobodeangelis@gmail.com> [2022-12-12 06:24]:
> This is the git repo: https://github.com/andyjda/sticky-shell, with
> additional info in the README and in the code's documentation.

Just that the "sticky shell" does not reflect what it does.

I have tested it, it does not work reliably.

- it does not show which command generated error, I have for example:

$ youtube-dl -f18 "https://www.youtube.com/watch?v=PVsnbalE6Ig"
  C-c C-cTraceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/youtube_dl/extractor/__init__.py", line 4, in <module>
    from .lazy_extractors import *
ModuleNotFoundError: No module named 'youtube_dl.extractor.lazy_extractors'
...with more lines here below...

and that one is not shown.

- for this below it shows "dcon" instead of "dconf":

$ dconf
error: no command specified

Usage:
  dconf COMMAND [ARGS...]

Commands:
  help              Show this information
  read              Read the value of a key
  list              List the contents of a dir
  write             Change the value of a key
  reset             Reset the value of a key or dir
  compile           Compile a binary database from keyfiles
  update            Update the system databases
  watch             Watch a path for changes
  dump              Dump an entire subpath to stdout
  load              Populate a subpath from stdin

Use 'dconf help COMMAND' to get detailed help.


- for ls -lR it shows "ls -l"

I have got feeling that it works unreliably.

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/

reply via email to

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