unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ELPA: New package: minibuffer-header
@ 2022-08-06 15:59 Nicolas P. Rougier (inria)
  2022-08-06 16:51 ` Jean Louis
  2022-08-06 22:03 ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2022-08-06 15:59 UTC (permalink / raw)
  To: emacs-devel


Dear all,

I would like to submit a new package to ELPA which is a minor-mode 
that display a header line in the minibuffer (and can optionally 
display messages as well).

The project is hosted at 
https://github.com/rougier/minibuffer-header and the
README shows what it looks like.

Best,
Nicolas

-- 
Nicolas P. Rougier — Institute of Neurodegenerative Diseases
University of Bordeaux — https://www.labri.fr/perso/nrougier



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-06 15:59 ELPA: New package: minibuffer-header Nicolas P. Rougier (inria)
@ 2022-08-06 16:51 ` Jean Louis
  2022-08-06 19:20   ` Nicolas P. Rougier (inria)
  2022-08-06 22:03 ` Stefan Monnier
  1 sibling, 1 reply; 11+ messages in thread
From: Jean Louis @ 2022-08-06 16:51 UTC (permalink / raw)
  To: Nicolas P. Rougier (inria); +Cc: emacs-devel

* Nicolas P. Rougier (inria) <nicolas.rougier@inria.fr> [2022-08-06 19:07]:
> I would like to submit a new package to ELPA which is a minor-mode that
> display a header line in the minibuffer (and can optionally display messages
> as well).
> 
> The project is hosted at
> https://github.com/rougier/minibuffer-header and the README shows
> what it looks like.

How do I practicaly use it with functions such as `read-from-string'?

-- 
Jean

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

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-06 16:51 ` Jean Louis
@ 2022-08-06 19:20   ` Nicolas P. Rougier (inria)
  2022-08-06 21:21     ` Jean Louis
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2022-08-06 19:20 UTC (permalink / raw)
  To: Jean Louis; +Cc: emacs-devel


Jean Louis [2022-08-06 at 19:51] wrote:
> How do I practicaly use it with functions such as 
> `read-from-string'?

Not sure to see the connection. How is it related to minibuffer?

Nicolas



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-06 19:20   ` Nicolas P. Rougier (inria)
@ 2022-08-06 21:21     ` Jean Louis
  2022-08-07  8:12       ` Nicolas P. Rougier (inria)
  0 siblings, 1 reply; 11+ messages in thread
From: Jean Louis @ 2022-08-06 21:21 UTC (permalink / raw)
  To: Nicolas P. Rougier (inria); +Cc: emacs-devel

* Nicolas P. Rougier (inria) <nicolas.rougier@inria.fr> [2022-08-06 22:21]:
> 
> Jean Louis [2022-08-06 at 19:51] wrote:
> > How do I practicaly use it with functions such as `read-from-string'?
> 
> Not sure to see the connection. How is it related to minibuffer?

Because such functions as `read-from-string' directly use
minibuffer. I have extensive use of such functions in my work and
other people use it as well. Heaving a header in minibuffer would help
my workers understand better what is meant with the input.

From manual:

The “minibuffer” is where Emacs commands read complicated arguments,
such as file names, buffer names, Emacs command names, or Lisp
expressions.  We call it the “minibuffer” because it’s a special-purpose
buffer with a small amount of screen space.  You can use the usual Emacs
editing commands in the minibuffer to edit the argument text.

-- 
Jean

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

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-06 15:59 ELPA: New package: minibuffer-header Nicolas P. Rougier (inria)
  2022-08-06 16:51 ` Jean Louis
@ 2022-08-06 22:03 ` Stefan Monnier
  2022-08-07  8:10   ` Nicolas P. Rougier (inria)
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2022-08-06 22:03 UTC (permalink / raw)
  To: Nicolas P. Rougier (inria); +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

Nicolas P. Rougier (inria) [2022-08-06 17:59:32] wrote:
> I would like to submit a new package to ELPA which is a minor-mode that
> display a header line in the minibuffer (and can optionally display messages
> as well).

I just added it to elpa.git, but it won't be released into GNU ELPA yet
because of the "Copyright" line in the file, which needs to be updated,
as in the patch below, which also tweaks the `.gitignore`.

After making those changes, you should be able to check the result at
https://elpa.gnu.org/devel/minibuffer-header.html
Once you're satisfied, you'll need to additionally bump the `Version:`
in order to tell GNU ELPA to build a release tarball.


        Stefan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: minibuffer-header.patch --]
[-- Type: text/x-diff, Size: 1279 bytes --]

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..33b35ed269
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.elc
+/minibuffer-header-autoloads.el
+/minibuffer-header-pkg.el
diff --git a/minibuffer-header.el b/minibuffer-header.el
index b511878710..bdba9b0303 100644
--- a/minibuffer-header.el
+++ b/minibuffer-header.el
@@ -1,6 +1,6 @@
 ;;; minibuffer-header.el --- Minibuffer header line -*- lexical-binding: t -*-
 
-;; Copyright (C) 2022 Nicolas P. Rougier
+;; Copyright (C) 2022  Free Software Foundation, Inc.
 
 ;; Maintainer: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
 ;; URL: https://github.com/rougier/minibuffer-header
@@ -173,7 +173,10 @@
                    'front-sticky t)))))))))
 
 
-(defun minibuffer-header--message-override (orig-fun &rest args)
+(defun minibuffer-header--message-override (_orig-fun &rest args)
+  ;; FIXME: Thje arglist looks wrong.  It's what I would expect for
+  ;; an `:around' advice, but not for an `:override' advice, which
+  ;; does not receive the `orig-fun'.
   "This advice is used to override the original message function"
 
   ;; Debug buffer (since we cannot use message for log)
@@ -182,7 +185,7 @@
   ;;  (insert (format "\n%s" args)))
   
   (let* ((msg (if (and (car args) (stringp (car ar

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-06 22:03 ` Stefan Monnier
@ 2022-08-07  8:10   ` Nicolas P. Rougier (inria)
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2022-08-07  8:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel


Stefan Monnier [2022-08-06 at 18:03] wrote:
> +  ;; FIXME: Thje arglist looks wrong.  It's what I would expect 
> for
> +  ;; an `:around' advice, but not for an `:override' advice, 
> which
> +  ;; does not receive the `orig-fun'.
>    "This advice is used to override the original message 
>    function"

Thanks, this helps me to identify a nasty bug when overriding the 
message function. I applied all the modifications.

Nicolas

-- 
Nicolas P. Rougier —— Research Director
Institute of Neurodegenerative Diseases
Bordeaux —— www.labri.fr/perso/nrougier



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-06 21:21     ` Jean Louis
@ 2022-08-07  8:12       ` Nicolas P. Rougier (inria)
  2022-08-07 14:15         ` Jean Louis
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2022-08-07  8:12 UTC (permalink / raw)
  To: Jean Louis; +Cc: emacs-devel


Jean Louis [2022-08-07 at 00:21] wrote:
> Because such functions as `read-from-string' directly use
> minibuffer. I have extensive use of such functions in my work 
> and
> other people use it as well. Heaving a header in minibuffer 
> would help
> my workers understand better what is meant with the input.

I think I'm missing a point here. Here is the 
signature/documentation I get from Emacs 28.2:

> read-from-string is a function defined in C source code.
>
> Signature
> (read-from-string STRING &optional START END)
>
> Documentation
> Read one Lisp expression which is represented as text by STRING.

While I understand your arguments for other minibuffer related 
function, I don't understand how this one makes use of minibuffer. 

Nicolas

-- 
Nicolas P. Rougier —— Research Director
Institute of Neurodegenerative Diseases
Bordeaux —— www.labri.fr/perso/nrougier



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-07  8:12       ` Nicolas P. Rougier (inria)
@ 2022-08-07 14:15         ` Jean Louis
  2022-08-07 15:55           ` Nicolas P. Rougier (inria)
  0 siblings, 1 reply; 11+ messages in thread
From: Jean Louis @ 2022-08-07 14:15 UTC (permalink / raw)
  To: Nicolas P. Rougier (inria); +Cc: emacs-devel

* Nicolas P. Rougier (inria) <nicolas.rougier@inria.fr> [2022-08-07 11:17]:
> While I understand your arguments for other minibuffer related function, I
> don't understand how this one makes use of minibuffer.

It is mistake, I was meaning `read-string`:

-- 
Jean

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

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-07 14:15         ` Jean Louis
@ 2022-08-07 15:55           ` Nicolas P. Rougier (inria)
  2022-08-08  5:54             ` Jean Louis
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2022-08-07 15:55 UTC (permalink / raw)
  To: Jean Louis; +Cc: emacs-devel


Jean Louis [2022-08-07 at 17:15] wrote:
> * Nicolas P. Rougier (inria) <nicolas.rougier@inria.fr> 
> [2022-08-07 11:17]:
> > While I understand your arguments for other minibuffer related 
> > function, I
> > don't understand how this one makes use of minibuffer.
> 
> It is mistake, I was meaning `read-string`:

Ok. Then with latest version, here is one way to do it:

#+begin_src emacs-lisp
(defun help () "Help\n > ")

(let ((minibuffer-header-format #'help))
  (read-string ">"))
#+end_src

Nicolas




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-07 15:55           ` Nicolas P. Rougier (inria)
@ 2022-08-08  5:54             ` Jean Louis
  2022-08-08 21:02               ` Nicolas P. Rougier (inria)
  0 siblings, 1 reply; 11+ messages in thread
From: Jean Louis @ 2022-08-08  5:54 UTC (permalink / raw)
  To: Nicolas P. Rougier (inria); +Cc: emacs-devel

* Nicolas P. Rougier (inria) <nicolas.rougier@inria.fr> [2022-08-07 18:58]:
> 
> Jean Louis [2022-08-07 at 17:15] wrote:
> > * Nicolas P. Rougier (inria) <nicolas.rougier@inria.fr> [2022-08-07
> > 11:17]:
> > > While I understand your arguments for other minibuffer related >
> > function, I
> > > don't understand how this one makes use of minibuffer.
> > 
> > It is mistake, I was meaning `read-string`:
> 
> Ok. Then with latest version, here is one way to do it:
> 
> #+begin_src emacs-lisp
> (defun help () "Help\n > ")
> 
> (let ((minibuffer-header-format #'help))
>  (read-string ">"))

I did git pull and cannot find that `minibufer-header-format' accepts
option.

And why would option need to be a function?

-- 
Jean

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

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ELPA: New package: minibuffer-header
  2022-08-08  5:54             ` Jean Louis
@ 2022-08-08 21:02               ` Nicolas P. Rougier (inria)
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas P. Rougier (inria) @ 2022-08-08 21:02 UTC (permalink / raw)
  To: Jean Louis; +Cc: emacs-devel


Jean Louis [2022-08-08 at 08:54] wrote:
> I did git pull and cannot find that `minibufer-header-format' 
> accepts
> option.
> 
> And why would option need to be a function?

Maybe I forgot to push. It's here: 
https://github.com/rougier/minibuffer-header/blob/master/minibuffer-header.el#L58

The format can be a string or a function if you want a dynamic 
header line. For example, you can hide the regular prompt and 
display it in the header line. You can also prefix the header line 
with minibuffer depth in case of recursive minibuffers, etc.

Nicolas

-- 
Nicolas P. Rougier —— www.labri.fr/perso/nrougier
Institute of Neurodegenerative Diseases, Bordeaux



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-08 21:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-06 15:59 ELPA: New package: minibuffer-header Nicolas P. Rougier (inria)
2022-08-06 16:51 ` Jean Louis
2022-08-06 19:20   ` Nicolas P. Rougier (inria)
2022-08-06 21:21     ` Jean Louis
2022-08-07  8:12       ` Nicolas P. Rougier (inria)
2022-08-07 14:15         ` Jean Louis
2022-08-07 15:55           ` Nicolas P. Rougier (inria)
2022-08-08  5:54             ` Jean Louis
2022-08-08 21:02               ` Nicolas P. Rougier (inria)
2022-08-06 22:03 ` Stefan Monnier
2022-08-07  8:10   ` Nicolas P. Rougier (inria)

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).