unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Christopher Dimech <dimech@gmx.com>
To: Jean Louis <bugs@gnu.support>
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Insert text in command-log-mode buffer before logging
Date: Mon, 3 May 2021 22:40:39 +0200	[thread overview]
Message-ID: <trinity-869ba0b7-5359-49f1-b729-ded113388ec8-1620074439905@3c-app-mailcom-bs06> (raw)
In-Reply-To: <trinity-975501e4-685f-4163-88ab-0dcd920873ef-1620049908215@3c-app-mailcom-bs06>

Hi Jean, could you help out with this.  It is quite minor but have not
got a solution to it yet.

The code is here
https://github.com/lewang/command-log-mode/blob/master/command-log-mode.el

The user wants to add some text at the start of the logging window.  I tend
to agree that the text has to be inserted in "clm/open-command-log-buffer"
but cannot quite see how that could be made to work.

Regards
Christopher


> Sent: Tuesday, May 04, 2021 at 1:51 AM
> From: steve-humphreys@gmx.com
> To: steve-humphreys@gmx.com
> Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: Re: Insert text in command-log-mode buffer before logging
>
> How is it that I cannot call (insert "test" clm-command-log-buffer)
> to print something to tho command log buffer?
>
> Seems quite more complicated to do than I initially thought.
>
> (defun clm-open-command-log-buffer (&optional arg)
>   "Opens (and creates, if non-existant) a buffer used for logging keyboard commands.
> If ARG is non-nil, the existing command log buffer is cleared."
>   (interactive "P")
>   (with-current-buffer
>       (setq clm-command-log-buffer
>             (get-buffer-create " *command-log*"))
>     (text-scale-set 1))
>   (when arg
>     (with-current-buffer clm-command-log-buffer
>       (erase-buffer)))
>   (let ((new-win (split-window-horizontally
>                   (- 0 command-log-mode-window-size))))
>     (set-window-buffer new-win clm-command-log-buffer)
>     (set-window-dedicated-p new-win t)))
>
>
> > Sent: Tuesday, May 04, 2021 at 12:24 AM
> > From: steve-humphreys@gmx.com
> > To: steve-humphreys@gmx.com
> > Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> > Subject: Re: Insert text in command-log-mode buffer before logging
> >
> > Have tried inserting text in the following function but it is not being
> > displayed.  I think the buffer is not available at that point.
> >
> > (defun clm/open-command-log-buffer (&optional arg)
> >
> > On the other hand "clm/log-command (&optional cmd)" intercepts command activation
> > but I do not want my text to appear every time there is command activation.
> >
> >
> >
> >
> > > Sent: Monday, May 03, 2021 at 3:26 PM
> > > From: steve-humphreys@gmx.com
> > > To: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> > > Subject: Insert text in command-log-mode buffer before logging
> > >
> > > I am using "command-log-mode" and want to insert some text after
> > > the log buffer is opened, but before logging starts.
> > >
> > > I am struggling to figure out where and how I should do this.
> > >
> > > Steve
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>

---------------------
Christopher Dimech
General Administrator - Naiad Informatics - GNU Project (Geocomputation)
- Geophysical Simulation
- Geological Subsurface Mapping
- Disaster Preparedness and Mitigation
- Natural Resource Exploration and Production
- Free Software Advocacy



  reply	other threads:[~2021-05-03 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03  3:26 Insert text in command-log-mode buffer before logging steve-humphreys
2021-05-03 12:24 ` steve-humphreys
2021-05-03 13:51   ` steve-humphreys
2021-05-03 20:40     ` Christopher Dimech [this message]
2021-05-03 21:45       ` Jean Louis
2021-05-03 21:54         ` Christopher Dimech

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-869ba0b7-5359-49f1-b729-ded113388ec8-1620074439905@3c-app-mailcom-bs06 \
    --to=dimech@gmx.com \
    --cc=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).