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

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

Re: Insert text in command-log-mode buffer before logging


From: steve-humphreys
Subject: Re: Insert text in command-log-mode buffer before logging
Date: Mon, 3 May 2021 15:51:48 +0200

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
> >
> >
> >
> >
> >
> >
>
>



reply via email to

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