all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* zonk *log-edit-files* for RCS (or when there is only one file)
@ 2021-02-09 17:11 Thien-Thi Nguyen
  2021-02-09 17:30 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-02-09 19:40 ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Thien-Thi Nguyen @ 2021-02-09 17:11 UTC (permalink / raw)
  To: help-gnu-emacs

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


When i'm using RCS to version control a single file, ‘C-x v v’
(vc-next-action) shows a buffer *log-edit-files* with the name
of the file.  Since i use RCS typically on single files, this
information is unnecessary.  How can i disable *log-edit-files*
(but only for RCS)?  I suppose a related question would be how
to disable it under any VCS when there is only one file in play.

By "disable" i mean the buffer should not show up (i don't care
if it's generated and not discarded as long as i don't see it).

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)               ; (2021) Software Libero
   (pcase (context query)               ;       = Dissenso Etico
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 219 bytes --]

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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 17:11 zonk *log-edit-files* for RCS (or when there is only one file) Thien-Thi Nguyen
@ 2021-02-09 17:30 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-02-09 17:47   ` Thien-Thi Nguyen
  2021-02-09 19:40 ` Stefan Monnier
  1 sibling, 1 reply; 10+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-02-09 17:30 UTC (permalink / raw)
  To: help-gnu-emacs

Thien-Thi Nguyen wrote:

> When i'm using RCS to version control a single file, ‘C-x v v’
> (vc-next-action) shows a buffer *log-edit-files* with the name
> of the file.  Since i use RCS typically on single files, this
> information is unnecessary.  How can i disable *log-edit-files*
> (but only for RCS)?  I suppose a related question would be how
> to disable it under any VCS when there is only one file in play.
>
> By "disable" i mean the buffer should not show up (i don't care
> if it's generated and not discarded as long as i don't see
> it).

No idea, check out this perhaps?

  vc-delete-logbuf-window

Or a find a hook and kill it there?

  vc-bzr-log-view-mode-hook
  vc-hg-log-view-mode-hook 	
  vc-log-after-operation-hook

(more vc- hooks are available)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 17:30 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-02-09 17:47   ` Thien-Thi Nguyen
  2021-02-09 18:08     ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 10+ messages in thread
From: Thien-Thi Nguyen @ 2021-02-09 17:47 UTC (permalink / raw)
  To: help-gnu-emacs

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


() Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
() Tue, 09 Feb 2021 18:30:58 +0100

   No idea, check out this perhaps?

     vc-delete-logbuf-window

Looks like Emacs 27.1 does not have this function.

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)               ; (2021) Software Libero
   (pcase (context query)               ;       = Dissenso Etico
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 219 bytes --]

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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 17:47   ` Thien-Thi Nguyen
@ 2021-02-09 18:08     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-02-09 18:15       ` Thien-Thi Nguyen
  0 siblings, 1 reply; 10+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-02-09 18:08 UTC (permalink / raw)
  To: help-gnu-emacs

Thien-Thi Nguyen wrote:

>> No idea, check out this perhaps?
>>
>>   vc-delete-logbuf-window
>
> Looks like Emacs 27.1 does not have this function.

Variable!

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 18:08     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-02-09 18:15       ` Thien-Thi Nguyen
  2021-02-09 18:26         ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 10+ messages in thread
From: Thien-Thi Nguyen @ 2021-02-09 18:15 UTC (permalink / raw)
  To: help-gnu-emacs

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


() Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
() Tue, 09 Feb 2021 19:08:57 +0100

   Variable!

D'oh!  Thanks for the clue.

Well, i tried both values (t and nil) for this variable, but it
has no effect.

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)               ; (2021) Software Libero
   (pcase (context query)               ;       = Dissenso Etico
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 219 bytes --]

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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 18:15       ` Thien-Thi Nguyen
@ 2021-02-09 18:26         ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-02-09 19:06           ` Thien-Thi Nguyen
  0 siblings, 1 reply; 10+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-02-09 18:26 UTC (permalink / raw)
  To: help-gnu-emacs

Thien-Thi Nguyen wrote:

>> Variable!
>
> D'oh!  Thanks for the clue.
>
> Well, i tried both values (t and nil) for this variable, but it
> has no effect.

Well, then there is just one thing to do, use the
source, Luke!

The lisp/vc/log-edit.el file seems interesting.

;; Author: Stefan Monnier

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 18:26         ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-02-09 19:06           ` Thien-Thi Nguyen
  2021-02-09 19:53             ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 10+ messages in thread
From: Thien-Thi Nguyen @ 2021-02-09 19:06 UTC (permalink / raw)
  To: help-gnu-emacs

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


() Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
() Tue, 09 Feb 2021 19:26:02 +0100

   Well, then there is just one thing to do, use the
   source, Luke!

   The lisp/vc/log-edit.el file seems interesting.

Indeed.  Here's what i cooked up:

 (defun ttn-log-edit-show-files-maybe ()
   (unless (null (cdr (log-edit-files)))
     (log-edit-show-files)))
 
 (remove-hook 'log-edit-hook 'log-edit-show-files)
 
 (add-hook 'log-edit-hook 'ttn-log-edit-show-files-maybe t)

It works fine, although i suspect the moment i add it to my pile
of hacks, someone will check-in a more elegant method...  :-D

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)               ; (2021) Software Libero
   (pcase (context query)               ;       = Dissenso Etico
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 219 bytes --]

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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 17:11 zonk *log-edit-files* for RCS (or when there is only one file) Thien-Thi Nguyen
  2021-02-09 17:30 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-02-09 19:40 ` Stefan Monnier
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2021-02-09 19:40 UTC (permalink / raw)
  To: help-gnu-emacs

This buffer is displayed by `log-edit-show-files` which is called by
default via `log-edit-hook`.  It obtains the list of files by calling
`log-edit-files`.

It should be easy to tweak it so it only displays the result when the
list is longer than 1.


        Stefan




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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 19:06           ` Thien-Thi Nguyen
@ 2021-02-09 19:53             ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-02-09 20:46               ` Thien-Thi Nguyen
  0 siblings, 1 reply; 10+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-02-09 19:53 UTC (permalink / raw)
  To: help-gnu-emacs

Thien-Thi Nguyen wrote:

>  (defun ttn-log-edit-show-files-maybe ()
>    (unless (null (cdr (log-edit-files)))
>      (log-edit-show-files)))
>
> [...]
>
> It works fine, although i suspect the moment i add it to my
> pile of hacks, someone will check-in a more elegant
> method... :-D

On the contrary, that's so cool! I had to think and think and
think before I realized it is 0 or 1 file -> don't do it, but
2 or more files -> do it.

Only ... isn't `unless' and `null' = `when'?

(unless (null (cdr '()))    1) ; nil
(unless (null (cdr '(1)))   1) ; nil
(unless (null (cdr '(1 2))) 1) ; 1

(when         (cdr '())     1) ; nil
(when         (cdr '(1))    1) ; nil
(when         (cdr '(1 2))  1) ; 1

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




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

* Re: zonk *log-edit-files* for RCS (or when there is only one file)
  2021-02-09 19:53             ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-02-09 20:46               ` Thien-Thi Nguyen
  0 siblings, 0 replies; 10+ messages in thread
From: Thien-Thi Nguyen @ 2021-02-09 20:46 UTC (permalink / raw)
  To: help-gnu-emacs

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


() Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
() Tue, 09 Feb 2021 20:53:43 +0100

   On the contrary, that's so cool! I had to think and think and
   think before I realized it is 0 or 1 file -> don't do it, but
   2 or more files -> do it.

   Only ... isn't `unless' and `null' = `when'?

   (unless (null (cdr '()))    1) ; nil
   (unless (null (cdr '(1)))   1) ; nil
   (unless (null (cdr '(1 2))) 1) ; 1

   (when         (cdr '())     1) ; nil
   (when         (cdr '(1))    1) ; nil
   (when         (cdr '(1 2))  1) ; 1

Well, there you go -- more elegant by one funcall.  Congrats!

(I think i wrote it that way to make it clear to me since i
see/type/think ‘(null (cdr ...))’ more or less idiomatically.
If i use ‘when’, i would have to add a comment to myself.
Normally, i'm not against comments, but this time, meh... :-D)

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)               ; (2021) Software Libero
   (pcase (context query)               ;       = Dissenso Etico
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 219 bytes --]

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

end of thread, other threads:[~2021-02-09 20:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-09 17:11 zonk *log-edit-files* for RCS (or when there is only one file) Thien-Thi Nguyen
2021-02-09 17:30 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-09 17:47   ` Thien-Thi Nguyen
2021-02-09 18:08     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-09 18:15       ` Thien-Thi Nguyen
2021-02-09 18:26         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-09 19:06           ` Thien-Thi Nguyen
2021-02-09 19:53             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-09 20:46               ` Thien-Thi Nguyen
2021-02-09 19:40 ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.