* Re: vc-mode-line
2010-08-05 4:55 ` vc-mode-line Miles Bader
@ 2010-08-05 5:20 ` Dan Nicolaescu
2010-08-05 6:39 ` vc-mode-line Stephen J. Turnbull
` (2 subsequent siblings)
3 siblings, 0 replies; 24+ messages in thread
From: Dan Nicolaescu @ 2010-08-05 5:20 UTC (permalink / raw
To: Miles Bader; +Cc: Eli Zaretskii, emacs-devel
Miles Bader <miles@gnu.org> writes:
> If changing everything is OK, how about:
>
> ":" unmodified but already in repo
Flipping the meaning of : from modified to unmodified sounds like it
might generate confusion...
> "=" modified (emacs commonly associates "=" with "diff")
> "+" added, but not yet committed
> "-" deleted, but not yet committed
>
> If that's too radical a change, how about (avoids redefining old chars):
>
> "-" [existing] unmodified but already in repo
> "=" modified (emacs commonly associates "=" with "diff")
> "+" added, but not yet committed
> "#" deleted, but not yet committed
These sets are not complete, vc-default-mode-line-string has all the current uses:
(propertize
(cond ((or (eq state 'up-to-date)
(eq state 'needs-update))
(setq state-echo "Up to date file")
(concat backend-name "-" rev))
((stringp state)
(setq state-echo (concat "File locked by" state))
(concat backend-name ":" state ":" rev))
((eq state 'added)
(setq state-echo "Locally added file")
(concat backend-name "@" rev))
((eq state 'conflict)
(setq state-echo "File contains conflicts after the last merge")
(concat backend-name "!" rev))
((eq state 'removed)
(setq state-echo "File removed from the VC system")
(concat backend-name "!" rev))
((eq state 'missing)
(setq state-echo "File tracked by the VC system, but missing from the file system")
(concat backend-name "?" rev))
(t
(setq state-echo "Locally modified file")
(concat backend-name ":" rev)))
All possible states can be seen using C-h f vc-state RET.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-05 4:55 ` vc-mode-line Miles Bader
2010-08-05 5:20 ` vc-mode-line Dan Nicolaescu
@ 2010-08-05 6:39 ` Stephen J. Turnbull
2010-08-05 16:20 ` vc-mode-line David Kastrup
2010-08-05 14:57 ` vc-mode-line Eli Zaretskii
2010-08-05 18:54 ` vc-mode-line Dan Nicolaescu
3 siblings, 1 reply; 24+ messages in thread
From: Stephen J. Turnbull @ 2010-08-05 6:39 UTC (permalink / raw
To: Miles Bader; +Cc: Dan Nicolaescu, Eli Zaretskii, emacs-devel
Miles Bader writes:
> If changing everything is OK, how about:
>
> ":" unmodified but already in repo
> "=" modified (emacs commonly associates "=" with "diff")
I don't find that persuasive. Before I scrolled to see this part I
was already thinking "=" is unmodified, "*" is fine for modified since
that's what it means for buffers. If you think that the Emacs
association of "=" with diff is too strong (I don't have a problem
keeping those straight, actually; in modes where quick access to diff
is useful I pronounce "=" as "equalp", YMMV, but that's my mnemonic),
how about "#" for modified (looks like "not equal"), or "!"?
> "+" added, but not yet committed
> "-" deleted, but not yet committed
2 * (+1)
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-05 6:39 ` vc-mode-line Stephen J. Turnbull
@ 2010-08-05 16:20 ` David Kastrup
0 siblings, 0 replies; 24+ messages in thread
From: David Kastrup @ 2010-08-05 16:20 UTC (permalink / raw
To: emacs-devel
"Stephen J. Turnbull" <stephen@xemacs.org> writes:
> Miles Bader writes:
>
> > If changing everything is OK, how about:
> >
> > ":" unmodified but already in repo
> > "=" modified (emacs commonly associates "=" with "diff")
>
> I don't find that persuasive. Before I scrolled to see this part I
> was already thinking "=" is unmodified, "*" is fine for modified since
> that's what it means for buffers. If you think that the Emacs
> association of "=" with diff is too strong (I don't have a problem
> keeping those straight, actually; in modes where quick access to diff
> is useful I pronounce "=" as "equalp", YMMV, but that's my mnemonic),
> how about "#" for modified (looks like "not equal"), or "!"?
Is something like (if (char-displayable-p ?≠) "≠" "#") going to work
reliably? However, I am not sure I consider it appropriate since
equality is not the same as being unmodified.
--
David Kastrup
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-05 4:55 ` vc-mode-line Miles Bader
2010-08-05 5:20 ` vc-mode-line Dan Nicolaescu
2010-08-05 6:39 ` vc-mode-line Stephen J. Turnbull
@ 2010-08-05 14:57 ` Eli Zaretskii
2010-08-05 18:54 ` vc-mode-line Dan Nicolaescu
3 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2010-08-05 14:57 UTC (permalink / raw
To: Miles Bader; +Cc: dann, emacs-devel
> From: Miles Bader <miles@gnu.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> Date: Thu, 05 Aug 2010 13:55:39 +0900
>
> ":" unmodified but already in repo
> "=" modified (emacs commonly associates "=" with "diff")
> "+" added, but not yet committed
> "-" deleted, but not yet committed
FWIW, I like Dan's proposal better.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-05 4:55 ` vc-mode-line Miles Bader
` (2 preceding siblings ...)
2010-08-05 14:57 ` vc-mode-line Eli Zaretskii
@ 2010-08-05 18:54 ` Dan Nicolaescu
2010-08-06 2:41 ` vc-mode-line Miles Bader
3 siblings, 1 reply; 24+ messages in thread
From: Dan Nicolaescu @ 2010-08-05 18:54 UTC (permalink / raw
To: Miles Bader; +Cc: Eli Zaretskii, emacs-devel
Miles Bader <miles@gnu.org> writes:
> In particular, I think "*" might not be such a good choice, because
> using "*" for the VCS indicator would dilute the impact of the standard
> "buffer modified" indicator. Right now, the buffer-modified indicator
> stands out, as "*" is a fairly noticeable character; the more "*"s with
> _different_ meanings we add to the modeline, the less noticeable it
> becomes (and noticing whether the buffer is modified or not is important
> I think).
Given that the * would be placed close to the CVS/GIT/SVN/etc string,
IMO it would be quite clear that it refers to the VC context.
That seems better than a new context-free symbol...
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-05 18:54 ` vc-mode-line Dan Nicolaescu
@ 2010-08-06 2:41 ` Miles Bader
2010-08-06 3:38 ` vc-mode-line Óscar Fuentes
0 siblings, 1 reply; 24+ messages in thread
From: Miles Bader @ 2010-08-06 2:41 UTC (permalink / raw
To: emacs-devel
Dan Nicolaescu <dann@gnu.org> writes:
> Given that the * would be placed close to the CVS/GIT/SVN/etc string,
> IMO it would be quite clear that it refers to the VC context.
I'm not sure people generally look that hard at the mode-line, but
rather tend to glance at it. "*" stands out even at a glance, which is
good in some ways but bad in others...
I agree that the "-" vs. ":" is probably too subtle; arguably, "=" may
have the same problem. In my mind, it stands out because it's a little
"weird" (whereas "-"/":" are both totally natural separators that one
might not realize have any meaning at all), but I think Stephen noted it
could be confused for "equals the revision XX".
Anyway, there seems to be a preferences for "*" amongst responders so
far...
-Miles
--
Saa, shall we dance? (from a dance-class advertisement)
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 2:41 ` vc-mode-line Miles Bader
@ 2010-08-06 3:38 ` Óscar Fuentes
2010-08-06 4:59 ` vc-mode-line Óscar Fuentes
` (2 more replies)
0 siblings, 3 replies; 24+ messages in thread
From: Óscar Fuentes @ 2010-08-06 3:38 UTC (permalink / raw
To: emacs-devel
Miles Bader <miles@gnu.org> writes:
[snip]
> Anyway, there seems to be a preferences for "*" amongst responders so
> far...
Whatever you decide, please consider allowing for some colorized
clue. Associating background faces to VC states, for instance, so the
user can customize "green for unmodified, red for modified" etc.
I guess that asking for images would be too contentious ;-)
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 3:38 ` vc-mode-line Óscar Fuentes
@ 2010-08-06 4:59 ` Óscar Fuentes
2010-08-06 5:13 ` vc-mode-line Miles Bader
2010-08-06 5:12 ` vc-mode-line Miles Bader
2010-08-10 15:29 ` vc-mode-line David House
2 siblings, 1 reply; 24+ messages in thread
From: Óscar Fuentes @ 2010-08-06 4:59 UTC (permalink / raw
To: emacs-devel
Óscar Fuentes <ofv@wanadoo.es> writes:
> Whatever you decide, please consider allowing for some colorized
> clue. Associating background faces to VC states, for instance, so the
> user can customize "green for unmodified, red for modified" etc.
I experimented a bit assigning a face to the text inserted into the
modeline by vc-default-mode-line-string. The result is great, IMHO.
It's trivial to make a patch for adding a configurable face for each VC
state. The question is: should they default to the current face, so the
modeline looks the same way as it does now, or should I use some
imagination and choose some (possibly horrible) defaults?
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 4:59 ` vc-mode-line Óscar Fuentes
@ 2010-08-06 5:13 ` Miles Bader
2010-08-06 6:52 ` vc-mode-line Óscar Fuentes
0 siblings, 1 reply; 24+ messages in thread
From: Miles Bader @ 2010-08-06 5:13 UTC (permalink / raw
To: Óscar Fuentes; +Cc: emacs-devel
Óscar Fuentes <ofv@wanadoo.es> writes:
> It's trivial to make a patch for adding a configurable face for each VC
> state. The question is: should they default to the current face, so the
> modeline looks the same way as it does now, or should I use some
> imagination and choose some (possibly horrible) defaults?
I think a face for each state is excessive and not actually so flexible
(because it only allows the face to be customized).
Better just have a user-customizable alist that supports propertized strings.
-Miles
--
The secret to creativity is knowing how to hide your sources.
--Albert Einstein
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 5:13 ` vc-mode-line Miles Bader
@ 2010-08-06 6:52 ` Óscar Fuentes
2010-08-06 8:13 ` vc-mode-line Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Óscar Fuentes @ 2010-08-06 6:52 UTC (permalink / raw
To: emacs-devel
Miles Bader <miles@gnu.org> writes:
> Óscar Fuentes <ofv@wanadoo.es> writes:
>> It's trivial to make a patch for adding a configurable face for each VC
>> state. The question is: should they default to the current face, so the
>> modeline looks the same way as it does now, or should I use some
>> imagination and choose some (possibly horrible) defaults?
>
> I think a face for each state is excessive and not actually so flexible
> (because it only allows the face to be customized).
>
> Better just have a user-customizable alist that supports propertized strings.
What I have in mind is to apply the face to all the VC text on the
modeline ("Git-branchname" or "SVN:1020") not just to the state char, as
I pretended at first. Dunno how/if customizable propertized strings fits
that scenario.
OTOH it would be convenient to concentrate the user-visible info
associated to a VC state into a single function or list, instead of
being hard-coded into vc-default-mode-line-string:
(defun vc-info-for-state (state)
(cond ((eq state 'up-to-date)
'("Up to date" ":" vc-up-to-date-state-face))
...
This way if a backend FOO defines vc-FOO-mode-line-string it can use
that function for keeping consistentency with the other backends.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 6:52 ` vc-mode-line Óscar Fuentes
@ 2010-08-06 8:13 ` Eli Zaretskii
2010-08-06 14:23 ` vc-mode-line Óscar Fuentes
2010-08-06 16:33 ` vc-mode-line Óscar Fuentes
0 siblings, 2 replies; 24+ messages in thread
From: Eli Zaretskii @ 2010-08-06 8:13 UTC (permalink / raw
To: Óscar Fuentes; +Cc: emacs-devel
> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Fri, 06 Aug 2010 08:52:53 +0200
>
> What I have in mind is to apply the face to all the VC text on the
> modeline ("Git-branchname" or "SVN:1020") not just to the state char, as
> I pretended at first.
What would be displayed for the VC text, then?
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 8:13 ` vc-mode-line Eli Zaretskii
@ 2010-08-06 14:23 ` Óscar Fuentes
2010-08-06 16:33 ` vc-mode-line Óscar Fuentes
1 sibling, 0 replies; 24+ messages in thread
From: Óscar Fuentes @ 2010-08-06 14:23 UTC (permalink / raw
To: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> What I have in mind is to apply the face to all the VC text on the
>> modeline ("Git-branchname" or "SVN:1020") not just to the state char, as
>> I pretended at first.
>
> What would be displayed for the VC text, then?
Not sure I don't understand your question.
I'm talking about applying a face to the VC text, not about replacing it.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 8:13 ` vc-mode-line Eli Zaretskii
2010-08-06 14:23 ` vc-mode-line Óscar Fuentes
@ 2010-08-06 16:33 ` Óscar Fuentes
2010-08-06 18:12 ` vc-mode-line Eli Zaretskii
1 sibling, 1 reply; 24+ messages in thread
From: Óscar Fuentes @ 2010-08-06 16:33 UTC (permalink / raw
To: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> What I have in mind is to apply the face to all the VC text on the
>> modeline ("Git-branchname" or "SVN:1020") not just to the state char, as
>> I pretended at first.
>
> What would be displayed for the VC text, then?
Not sure I understand your question.
I'm talking about applying a face to the VC text, not about replacing it.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 16:33 ` vc-mode-line Óscar Fuentes
@ 2010-08-06 18:12 ` Eli Zaretskii
0 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2010-08-06 18:12 UTC (permalink / raw
To: Óscar Fuentes; +Cc: emacs-devel
> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Fri, 06 Aug 2010 18:33:29 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> What I have in mind is to apply the face to all the VC text on the
> >> modeline ("Git-branchname" or "SVN:1020") not just to the state char, as
> >> I pretended at first.
> >
> > What would be displayed for the VC text, then?
>
> Not sure I understand your question.
>
> I'm talking about applying a face to the VC text, not about replacing it.
I was asking how it will be displayed after applying the face(s).
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 3:38 ` vc-mode-line Óscar Fuentes
2010-08-06 4:59 ` vc-mode-line Óscar Fuentes
@ 2010-08-06 5:12 ` Miles Bader
2010-08-10 15:29 ` vc-mode-line David House
2 siblings, 0 replies; 24+ messages in thread
From: Miles Bader @ 2010-08-06 5:12 UTC (permalink / raw
To: Óscar Fuentes; +Cc: emacs-devel
Óscar Fuentes <ofv@wanadoo.es> writes:
>> Anyway, there seems to be a preferences for "*" amongst responders so
>> far...
>
> Whatever you decide, please consider allowing for some colorized
> clue. Associating background faces to VC states, for instance, so the
> user can customize "green for unmodified, red for modified" etc.
>
> I guess that asking for images would be too contentious ;-)
I suppose that having an user-customizable alist for the mapping would
be a good thing, and it could support propertized strings; lisp code
shouldn't be looking at the mode-line indicators anyway (it should look
at the actual state symbols).
-Miles
--
`Suppose Korea goes to the World Cup final against Japan and wins,' Moon said.
`All the past could be forgiven.' [NYT]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-06 3:38 ` vc-mode-line Óscar Fuentes
2010-08-06 4:59 ` vc-mode-line Óscar Fuentes
2010-08-06 5:12 ` vc-mode-line Miles Bader
@ 2010-08-10 15:29 ` David House
2010-08-10 15:43 ` vc-mode-line Óscar Fuentes
2 siblings, 1 reply; 24+ messages in thread
From: David House @ 2010-08-10 15:29 UTC (permalink / raw
To: Óscar Fuentes; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]
On 5 August 2010 23:38, Óscar Fuentes <ofv@wanadoo.es> wrote:
> Whatever you decide, please consider allowing for some colorized
> clue. Associating background faces to VC states, for instance, so the
> user can customize "green for unmodified, red for modified" etc.
>
> I guess that asking for images would be too contentious ;-)
For a while now, I've been using the following customization to
display a green circle for an unmodified file and an orange square for
a modified one (versus the repository, I mean):
(setq-default
mode-line-format
'(...
(vc-mode (:eval (vc-icon)))
...)
;; Display a coloured square indicating the vc status of the current file
(defun vc-icon ()
(let ((icon (if (vc-workfile-unchanged-p (buffer-file-name))
"in-vc.png"
"modified-vc.png"))
(bg (face-attribute 'mode-line :background)))
(propertize
" "
'display (find-image
`((:type png :file ,icon :ascent center :background ,bg))))))
It relies on the attached two PNG images (I presume sending
attachments to this mailing list works; if not, email me and I'll
place them on imgur or somewhere similar).
[-- Attachment #2: in-vc.png --]
[-- Type: image/png, Size: 725 bytes --]
[-- Attachment #3: modified-vc.png --]
[-- Type: image/png, Size: 433 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: vc-mode-line
2010-08-10 15:29 ` vc-mode-line David House
@ 2010-08-10 15:43 ` Óscar Fuentes
2010-08-12 13:08 ` vc-mode-line Ted Zlatanov
0 siblings, 1 reply; 24+ messages in thread
From: Óscar Fuentes @ 2010-08-10 15:43 UTC (permalink / raw
To: emacs-devel; +Cc: David House
David House <dmhouse@gmail.com> writes:
> On 5 August 2010 23:38, Óscar Fuentes <ofv@wanadoo.es> wrote:
>> Whatever you decide, please consider allowing for some colorized
>> clue. Associating background faces to VC states, for instance, so the
>> user can customize "green for unmodified, red for modified" etc.
>>
>> I guess that asking for images would be too contentious ;-)
>
> For a while now, I've been using the following customization to
> display a green circle for an unmodified file and an orange square for
> a modified one (versus the repository, I mean):
That's what psvn.el does. I prefer to colorize the VC text, as it is
more easily customizable and adaptable to more states (`conflict' is one
that specially interests me.)
> It relies on the attached two PNG images [snip].
psvn.el doesn't need external image files. It builds the icon with a few
lines of code. Look for svn-status-state-mark-modeline-dot on psvn.el
The file is available from here:
http://svn.apache.org/repos/asf/subversion/trunk/contrib/client-side/emacs/psvn.el
^ permalink raw reply [flat|nested] 24+ messages in thread