bug#28570: 27.0.50; [PATCH] Disable unhelpful default Extra: header in vc-dir

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#28570: 27.0.50; [PATCH] Disable unhelpful default Extra: header in vc-dir

Göktuğ Kayaalp

The function ‘vc-default-dir-extra-headers’ is implemented as a stub
function that prints in the vc-dir buffer a rather annoying and
unhelpful message advicing that the implementer of a VC backend should
create some backend specific headers and that doing this is easy.
vc-rcs doesn't implement any (and I doubt it needs), and thus whenever I
use vc-dir on an RCS repository, this message is shown.  Attached is a
patch that disables this behaviour by making the said function return
nil instead (the function as it is includes a comment that says to do so
before the ‘release’).




In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-09-23 built on alpha
Repository revision: c0af83b6ccf2dab9a515dd7f52eb9d4500275ae3
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
System Description: Ubuntu 17.04

Recent messages:
user-error: Beginning of history; no preceding item
Making completion list... [2 times]
You can run the command ‘eval-buffer’ with M-x ev-b RET
Please type y, n, or !: n [2 times]
Traversing directory /igk/documents/not/org/...
Traversing directory /igk/documents/not/org/Attic...
Traversing directory /igk/documents/not/org/Attic/old_rcs...
Traversing directory /igk/documents/not/org/img...
Traversing directory /igk/documents/not/org/mobile...
Traversing directory /igk/documents/not/org/...done

Configured using:
 'configure --prefix=/home/g/local --with-x-toolkit=gtk3 --with-modules
 --with-file-notification=yes --without-threads --with-gameuser=no
 --with-mailutils'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES LCMS2

Important settings:
  value of $LC_MESSAGES: en_GB.UTF-8
  value of $LC_MONETARY: tr_TR.UTF-8
  value of $LC_NUMERIC: tr_TR.UTF-8
  value of $LC_TIME: tr_TR.UTF-8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message subr-x puny format-spec rfc822
mml mml-sec password-cache epa epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils vc-filewise vc-rcs dired dired-loaddefs
vc-dir derived edmacro kmacro cl-seq cl-macs ewoc vc vc-dispatcher
vc-git diff-mode easymenu easy-mmode map seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib elec-pair time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 112482 13582)
 (symbols 48 21631 1)
 (miscs 40 59 266)
 (strings 32 32386 1218)
 (string-bytes 1 844152)
 (vectors 16 16604)
 (vector-slots 8 510732 9057)
 (floats 8 52 204)
 (intervals 56 513 29)
 (buffers 992 18))

--
İ. Göktuğ Kayaalp              http://www.gkayaalp.com/index.html
[hidden email]    🎀            PGP = 024C 30DD 597D 142B 49AC
Plaintext please!  {UTF8}  Fingerprint   40EB 465C D949 B101 2427

vc-default-dir-extra-headers.patch (712 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#28570: 27.0.50; [PATCH] Disable unhelpful default Extra: header in vc-dir

Dmitry Gutov
On 9/23/17 6:39 PM, Göktuğ Kayaalp wrote:

>
> The function ‘vc-default-dir-extra-headers’ is implemented as a stub
> function that prints in the vc-dir buffer a rather annoying and
> unhelpful message advicing that the implementer of a VC backend should
> create some backend specific headers and that doing this is easy.
> vc-rcs doesn't implement any (and I doubt it needs), and thus whenever I
> use vc-dir on an RCS repository, this message is shown.  Attached is a
> patch that disables this behaviour by making the said function return
> nil instead (the function as it is includes a comment that says to do so
> before the ‘release’).

Instead of changing the default, how about we create a RCS-specific
implementation that does nothing? Because it doesn't need to.



Reply | Threaded
Open this post in threaded view
|

bug#28570: 27.0.50; [PATCH] Disable unhelpful default Extra: header in vc-dir

Göktuğ Kayaalp
On 2017-09-25 03:24 +03, Dmitry Gutov <[hidden email]> wrote:

> On 9/23/17 6:39 PM, Göktuğ Kayaalp wrote:
>>
>> The function ‘vc-default-dir-extra-headers’ is implemented as a stub
>> function that prints in the vc-dir buffer a rather annoying and
>> unhelpful message advicing that the implementer of a VC backend should
>> create some backend specific headers and that doing this is easy.
>> vc-rcs doesn't implement any (and I doubt it needs), and thus whenever I
>> use vc-dir on an RCS repository, this message is shown.  Attached is a
>> patch that disables this behaviour by making the said function return
>> nil instead (the function as it is includes a comment that says to do so
>> before the ‘release’).
>
> Instead of changing the default, how about we create a RCS-specific
> implementation that does nothing? Because it doesn't need to.

That's fine with me, I'll try to write a new patch over the weekend.

--
İ. Göktuğ Kayaalp              http://www.gkayaalp.com/index.html
[hidden email]    🎀            PGP = 024C 30DD 597D 142B 49AC
Plaintext please!  {UTF8}  Fingerprint   40EB 465C D949 B101 2427



Reply | Threaded
Open this post in threaded view
|

bug#28570: 27.0.50; [PATCH] Disable unhelpful default Extra: header in vc-dir

Göktuğ Kayaalp
In reply to this post by Dmitry Gutov
On 2017-09-25 03:24 +03, Dmitry Gutov <[hidden email]> wrote:

> On 9/23/17 6:39 PM, Göktuğ Kayaalp wrote:
>>
>> The function ‘vc-default-dir-extra-headers’ is implemented as a stub
>> function that prints in the vc-dir buffer a rather annoying and
>> unhelpful message advicing that the implementer of a VC backend should
>> create some backend specific headers and that doing this is easy.
>> vc-rcs doesn't implement any (and I doubt it needs), and thus whenever I
>> use vc-dir on an RCS repository, this message is shown.  Attached is a
>> patch that disables this behaviour by making the said function return
>> nil instead (the function as it is includes a comment that says to do so
>> before the ‘release’).
>
> Instead of changing the default, how about we create a RCS-specific
> implementation that does nothing? Because it doesn't need to.
>
Hi, please find attached the patch I promised some time ago.  Sorry for
the latency.

--
İ. Göktuğ Kayaalp <http://www.gkayaalp.com/>
                        024C 30DD 597D 142B 49AC
                        40EB 465C D949 B101 2427


diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 9dffc144c6..0a10449763 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -177,6 +177,8 @@ vc-rcs-dir-status-files
   (push (list frel state) result))))
     (funcall update-function result)))
 
+(defun vc-rcs-dir-extra-headers (&rest ignore))
+
 (defun vc-rcs-working-revision (file)
   "RCS-specific version of `vc-working-revision'."
   (or (and vc-consult-headers
Reply | Threaded
Open this post in threaded view
|

bug#28570: 27.0.50; [PATCH] Disable unhelpful default Extra: header in vc-dir

Dmitry Gutov
On 10/8/17 11:03 AM, Göktuğ Kayaalp wrote:

> Hi, please find attached the patch I promised some time ago.  Sorry for
> the latency.
>
>
> diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
> index 9dffc144c6..0a10449763 100644
> --- a/lisp/vc/vc-rcs.el
> +++ b/lisp/vc/vc-rcs.el
> @@ -177,6 +177,8 @@ vc-rcs-dir-status-files
>    (push (list frel state) result))))
>       (funcall update-function result)))
>  
> +(defun vc-rcs-dir-extra-headers (&rest ignore))
> +
>   (defun vc-rcs-working-revision (file)
>     "RCS-specific version of `vc-working-revision'."
>     (or (and vc-consult-headers

Please send a .patch file, with commit message and everything.

See the mention of 'git format-patch' in CONTRIBUTE.





Reply | Threaded
Open this post in threaded view
|

bug#28570: [PATCH] Implement ‘vc-default-dir-extra-headers’ for vc-rcs

Göktuğ Kayaalp
In reply to this post by Göktuğ Kayaalp
Add an implementation of this for vc-rcs that does nothing to suppress
the message the default function adds to the vc-dir buffer (Bug#28570).
* lisp/vc/vc-rcs.el (vc-rcs-dir-extra-headers): New function.
---
 lisp/vc/vc-rcs.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index db1addbecd..6e639f8d13 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -177,6 +177,8 @@ vc-rcs-dir-status-files
   (push (list frel state) result))))
     (funcall update-function result)))
 
+(defun vc-rcs-dir-extra-headers (&rest ignore))
+
 (defun vc-rcs-working-revision (file)
   "RCS-specific version of `vc-working-revision'."
   (or (and vc-consult-headers
--
2.11.0




Reply | Threaded
Open this post in threaded view
|

bug#28570: Added patch, pinging

Göktuğ Kayaalp
In reply to this post by Göktuğ Kayaalp
Hi, I have added a patch to this bug as was requested.  I'm just pinging
in case it went unnoticed as it seems to me that nothing has happened to
it in the past six days.  Anyways I guess I actually had to attach the
patch file from git-format-patch, so I'm doing that in this message.
Please excuse me for this mess, I'm quite ignorant of git, but I'll have
learned my lesson for my next patch.

Cheers!

--
İ. Göktuğ Kayaalp <http://www.gkayaalp.com/>
                         024C 30DD 597D 142B 49AC
                         40EB 465C D949 B101 2427


From 2936e254c12820cdfaa2683e1bd831a561ff1d15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=B0=2E=20G=C3=B6ktu=C4=9F=20Kayaalp?= <[hidden email]>
Date: Tue, 10 Oct 2017 01:43:30 +0300
Subject: [PATCH] =?UTF-8?q?Implement=20=E2=80=98vc-default-dir-extra-heade?=
 =?UTF-8?q?rs=E2=80=99=20for=20vc-rcs?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add an implementation of this for vc-rcs that does nothing to suppress
the message the default function adds to the vc-dir buffer (Bug#28570).
* lisp/vc/vc-rcs.el (vc-rcs-dir-extra-headers): New function.
---
 lisp/vc/vc-rcs.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index db1addbecd..6e639f8d13 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -177,6 +177,8 @@ vc-rcs-dir-status-files
   (push (list frel state) result))))
     (funcall update-function result)))
 
+(defun vc-rcs-dir-extra-headers (&rest ignore))
+
 (defun vc-rcs-working-revision (file)
   "RCS-specific version of `vc-working-revision'."
   (or (and vc-consult-headers
--
2.11.0

Reply | Threaded
Open this post in threaded view
|

bug#28570: Added patch, pinging

Noam Postavsky-2
Göktuğ Kayaalp <[hidden email]> writes:

> Hi, I have added a patch to this bug as was requested.  I'm just pinging
> in case it went unnoticed as it seems to me that nothing has happened to
> it in the past six days.  Anyways I guess I actually had to attach the
> patch file from git-format-patch, so I'm doing that in this message.
> Please excuse me for this mess, I'm quite ignorant of git, but I'll have
> learned my lesson for my next patch.

Both came through fine.  I do generally recommend sending as attachment
because it seems to work more reliably across different email clients.
Also, when sending a series of patches, it avoids getting them out of
order.

> Add an implementation of this for vc-rcs that does nothing to suppress
> the message the default function adds to the vc-dir buffer (Bug#28570).

Hmm, maybe reword as

    Add a do-nothing implementation for vc-rcs to suppress the message which
    the default function adds to the vc-dir buffer (Bug#28570).

Your version kind of reads to me as saying that the added vc-rcs
implementation doesn't suppress the message.

> +(defun vc-rcs-dir-extra-headers (&rest ignore))

You should use `_' (or `_ignore') instead of `ignore' to suppress this
compiler warning:

In toplevel form:
../../lisp/vc/vc-rcs.el:180:1:Warning: Unused lexical argument ‘ignore’




Reply | Threaded
Open this post in threaded view
|

bug#28570: Added patch, pinging

Dmitry Gutov
In reply to this post by Göktuğ Kayaalp
Version: 26.1

On 10/16/17 6:51 PM, Göktuğ Kayaalp wrote:
> Hi, I have added a patch to this bug as was requested.  I'm just pinging
> in case it went unnoticed as it seems to me that nothing has happened to
> it in the past six days.

That happens sometimes anyway. But yes, I was somewhat discouraged to
respond when I didn't see an attachment.

> Anyways I guess I actually had to attach the
> patch file from git-format-patch, so I'm doing that in this message.
> Please excuse me for this mess, I'm quite ignorant of git, but I'll have
> learned my lesson for my next patch.

Thanks!

Pushed, with Noam's corrections. I also removed the non-ascii stuff from
the summary.



Reply | Threaded
Open this post in threaded view
|

bug#28570: Added patch, pinging

Dmitry Gutov
In reply to this post by Noam Postavsky-2
On 10/17/17 3:49 AM, Noam Postavsky wrote:

> Both came through fine.  I do generally recommend sending as attachment
> because it seems to work more reliably across different email clients.
> Also, when sending a series of patches, it avoids getting them out of
> order.

A file is also trivial to feed to 'git am', and it's more reliable when
dealing with non-ASCII content.



Reply | Threaded
Open this post in threaded view
|

bug#28570: Added patch, pinging

Göktuğ Kayaalp
In reply to this post by Dmitry Gutov
On 2017-10-17 13:40 +03, Dmitry Gutov <[hidden email]> wrote:

> Version: 26.1
>
> On 10/16/17 6:51 PM, Göktuğ Kayaalp wrote:
>> Hi, I have added a patch to this bug as was requested.  I'm just pinging
>> in case it went unnoticed as it seems to me that nothing has happened to
>> it in the past six days.
>
> That happens sometimes anyway. But yes, I was somewhat discouraged to
> respond when I didn't see an attachment.
>
>> Anyways I guess I actually had to attach the
>> patch file from git-format-patch, so I'm doing that in this message.
>> Please excuse me for this mess, I'm quite ignorant of git, but I'll have
>> learned my lesson for my next patch.
>
> Thanks!

You're welcome, and sorry for not following the conventions.  It seems
to me that the CONTRIBUTE file has all the information and pointers,
I'll read it all before my next patch.

> Pushed, with Noam's corrections. I also removed the non-ascii stuff
> from the summary.
>

--
İ. Göktuğ Kayaalp <http://www.gkayaalp.com/>
                         024C 30DD 597D 142B 49AC
                         40EB 465C D949 B101 2427