[implementations-list] The "{Saved, Deleted} N characters" messages gone with `yy'/`dd'
SSIA That's another minor annoyance I noticed. I'm pretty sure it used to work and I find the messages very useful. Štěpán
Date: Tue, 13 Apr 2010 17:09:46 +0200 From: [email protected] Subject: [implementations-list] The "{Saved, Deleted} N characters" messages gone with `yy'/`dd'
That's another minor annoyance I noticed. I'm pretty sure it used to work and I find the messages very useful.
This is intentional. Viper doesn't show the messages when the operator is applied to itself, and Vimpulse's operators are modeled on Viper's. Actually, this is something of a grey area since the messages do not occur in Vim. Then again, since it's clearly useful, I could add a customization option for enabling messages everywhere. Vegard _________________________________________________________________ Få nye Windows Live™ Messenger. http://download.live.com/messenger
On Tue, Apr 13, 2010 at 07:20:00PM +0000, Vegard Øye wrote:
Date: Tue, 13 Apr 2010 17:09:46 +0200 From: [email protected] Subject: [implementations-list] The "{Saved, Deleted} N characters" messages gone with `yy'/`dd'
That's another minor annoyance I noticed. I'm pretty sure it used to work and I find the messages very useful.
This is intentional. Viper doesn't show the messages when the operator is applied to itself, and Vimpulse's operators are modeled on Viper's. Actually, this is something of a grey area since the messages do not occur in Vim.
Then again, since it's clearly useful, I could add a customization option for enabling messages everywhere.
Perhaps. In any case it should be unified for the sake of consistency, i.e. either show the messages everywhere or nowhere (obviously, I'd prefer the first). Currently one might ask why `yw' does show a message while `yy' does not. Štěpán
Date: Tue, 13 Apr 2010 23:12:23 +0200 From: [email protected]
Currently one might ask why `yw' does show a message while `yy' does not.
This is governed by `viper-change-notification-threshold'. By default, messages are never shown for single-entity changes. To enable messages always, do (setq viper-change-notification-threshold 0) Check out the latest changeset as well. I've made the messages aware of whether you are affecting characters, lines or blocks. :) Vegard _________________________________________________________________ Windows 7: Se direkte-TV fra den bærbare PCen. Finn ut mer. http://windows.microsoft.com/windows-7
On Wed, Apr 14, 2010 at 03:11:35PM +0000, Vegard Øye wrote:
Date: Tue, 13 Apr 2010 23:12:23 +0200 From: [email protected]
Currently one might ask why `yw' does show a message while `yy' does not.
This is governed by `viper-change-notification-threshold'. By default, messages are never shown for single-entity changes. To enable messages always, do
(setq viper-change-notification-threshold 0)
Not really; even with this setting, `dd' showed no message; and even with the default `1', d2d or 2dd showed no message. It's fixed now, though. Thanks.
Check out the latest changeset as well. I've made the messages aware of whether you are affecting characters, lines or blocks. :)
Yeah; actually I liked the uniform "characters" better, but that's a matter of opinion (perhaps more importantly, one might ask whether such an improvement was worth the 50-line `vimpulse-operator-message' definition ;-). Štěpán
Date: Wed, 14 Apr 2010 18:27:37 +0200 From: [email protected]
(setq viper-change-notification-threshold 0)
Even with this setting, `dd' showed no message; and even with the default `1', d2d or 2dd showed no message. It's fixed now, though. Thanks.
Yeah, the original code just disabled the message when the motion type was `line'. This was a mistake, however, as vanilla Viper says "Saved 2 lines" when one types "2yy".
I've made the messages aware of whether you are affecting characters, lines or blocks. :)
Yeah; actually I liked the uniform "characters" better, but that's a matter of opinion (perhaps more importantly, one might ask whether such an improvement was worth the 50-line `vimpulse-operator-message' definition ;-).
I admit that Vimpulse is getting large. For what it's worth, I think the worst growth rates are behind us, both in absolute and relative terms. (Any tips on making that function shorter? :) Vegard _________________________________________________________________ Nye Windows 7: PCen som passer for deg. Finn ut mer. http://windows.microsoft.com/shop
On Wed, Apr 14, 2010 at 06:14:29PM +0000, Vegard Øye wrote:
(Any tips on making that function shorter? :)
(defun vimpulse-operator-message (template &optional beg end length type) "Echo a message like \"Deleted 2 characters\". TEMPLATE is a string like \"Deleted <N>\", where <N> is substituted with the amount of characters or lines. BEG and END are the range of text. If you specify LENGTH, they are ignored. This function respects `viper-change-notification-threshold'." (let* ((beg (or beg (vimpulse-visual-beginning) 1)) (end (or end (vimpulse-visual-end) 1)) (type (or type vimpulse-this-motion-type)) (length (case type (block (* (or vimpulse-visual-width 1) (or vimpulse-visual-height 1))) (line (or length (count-lines beg end))) (t (or length (abs (- end beg)))))) (template (replace-regexp-in-string "<N>" (apply 'format (append (if (eq type 'block) `("%sx%s character%s" ,(or vimpulse-visual-height 1) ,(or vimpulse-visual-width 1)) `(,(concat "%s " (if (eq type 'line) "line" "character") "%s") ,length)) (list (if (/= 1 (abs length)) "s" "")))) template))) (when (and (< viper-change-notification-threshold length) (not (viper-is-in-minibuffer))) (message template)))) http://tinyurl.com/ycxdzml
Date: Wed, 14 Apr 2010 23:40:18 +0200 From: [email protected]
Any tips on making that function shorter?
(defun vimpulse-operator-message ...)
That's a great improvement -- from 50 lines to 34, through clever use of the `apply' form. I've modified it a little (in changeset [2c87f791af]) so that the block message reads "1 row and 4 columns", rather than the cryptic "1×4 characters".
I am /not/ including them in Vimpulse's Acknowledgements :P Vegard _________________________________________________________________ Nye Windows 7: PCen som passer for deg. Finn ut mer. http://windows.microsoft.com/shop
On Thu, Apr 15, 2010 at 12:49:21PM +0000, Vegard Øye wrote:
Date: Wed, 14 Apr 2010 23:40:18 +0200 From: [email protected]
Any tips on making that function shorter?
(defun vimpulse-operator-message ...)
That's a great improvement -- from 50 lines to 34, through clever use of the `apply' form. I've modified it a little (in changeset [2c87f791af]) so that the block message reads "1 row and 4 columns", rather than the cryptic "1×4 characters".
I am /not/ including them in Vimpulse's Acknowledgements :P
Heh, oh well... It was more or less a joke, you know. If I was serious, I would send in a proper patch -- we have Git now! But I'm glad it did provide some inspiration ;-) Štěpán P.S.: In your original function, I noticed the use of U+00D7 MULTIPLICATION SIGN, which I intentionally replaced with 'x' in my version. Now it's gone for good, but in general I'd recommend against using non-ascii characters in the code, unless necessary. ...oh, and "changeset" is Hg-speak, in Git it's "commit" :P
Date: Thu, 15 Apr 2010 15:44:34 +0200 From: [email protected]
In your original function, I noticed the use of U+00D7 MULTIPLICATION SIGN, which I intentionally replaced with 'x' in my version.
Just curious: Did you use C-u C-x = (`what-cursor-position')? That function is /so/ useful. :)
Now it's gone for good, but in general I'd recommend against using non-ascii characters in the code, unless necessary.
Why? Vimpulse is UTF-8 as of 0.3.1. Emacs' Unicode support is fairly good (it wasn't always, but I'd say it is now). And × is included in ISO 8859-1 (Latin-1), so it should be quite safe anyway, Unicode or no Unicode. It just irks me to see "x" used instead, that's all :)
...oh, and "changeset" is Hg-speak, in Git it's "commit" :P
Subversion habit. Does "changeset" have a different meaning in Git, or is it not used at all? Vegard _________________________________________________________________ Windows Live™ Mail. Flere kontoer på ett sted. http://download.live.com/wlmail
On Thu, Apr 15, 2010 at 06:31:16PM +0000, Vegard Øye wrote:
Date: Thu, 15 Apr 2010 15:44:34 +0200 From: [email protected]
In your original function, I noticed the use of U+00D7 MULTIPLICATION SIGN, which I intentionally replaced with 'x' in my version.
Just curious: Did you use C-u C-x = (`what-cursor-position')? That function is /so/ useful. :)
No, I automatically used the `unicode' command-line utility, although I do also use C-u C-x = sometimes. Ah, I know why -- I was just looking at the `git log' output, so I was not even in Emacs at that time.
Now it's gone for good, but in general I'd recommend against using non-ascii characters in the code, unless necessary.
Why? Vimpulse is UTF-8 as of 0.3.1. Emacs' Unicode support is fairly good (it wasn't always, but I'd say it is now). And × is included in ISO 8859-1 (Latin-1), so it should be quite safe anyway, Unicode or no Unicode.
Heh, surely you jest? "Safe"? As if we weren't fighting with shitty software all the time. People are unfortunately still using all kinds of encodings, by far not only UTF-8 and ISO 8859-1 (e.g. in my country overwhelming majority of computer users still use the non-standard variation or ISO 8859-2 produced by certain non-free operating system vendor (see the advertisement after your signature)). And the nice advantage of UTF-8 is that it's ASCII-compatible -- i.e. as long as it does not contain codepoints above 127, problems never occur. So I really try to avoid using such characters when not necessary, which IMO this case was not (of course decent software will handle it just fine; I'm not suggesting strictly using ASCII just for the sake of shitty software possibly trying to display your code).
Subversion habit. Does "changeset" have a different meaning in Git, or is it not used at all?
It's not used at all. A nice place where all the Git termini technici are explained is the `gitglossary' man page (it's also available online on the Git website, in case your system doesn't have it). Štěpán
Date: Thu, 15 Apr 2010 21:28:33 +0200 From: [email protected]
× is included in ISO 8859-1 (Latin-1), so it should be quite safe anyway, Unicode or no Unicode.
"Safe"? As if we weren't fighting with shitty software all the time.
Emacs is not shitty software. :)
People are unfortunately still using all kinds of encodings,
Yeah, but not for /source code/. In general it's either US-ASCII ("pure" 7-bit), or Latin-1 (ISO 8859-1), or as of recently UTF-8. Compilers tend to be picky about these things.
In my country overwhelming majority of computer users still use the non-standard variation or ISO 8859-2 produced by [Microsoft].
I remember Windows-1252 from my Windows 98 days (I assume you refer to Windows-1250). It augmented Latin-1 with some extra punctuation (replacing control characters), which was wicked cool in the absence of Unicode support. Windows could interpret pure Latin-1 as Windows-1252 without problems, but the enhanced punctuation would be unreadable outside of Windows. Ah, memories. :) Of course, since × is punctuation, its position is less likely to vary than, say, Ø. Indeed, it's D7 in ISO 8859-1, ISO 8859-2, Windows-1250, Windows-1252 and UTF-8.
And the nice advantage of UTF-8 is that it's ASCII-compatible -- i.e. as long as it does not contain codepoints above 127, problems never occur.
I think that's nice too, but Asians complain because their characters are encoded as multi-byte all the way, increasing the file size. (Us Norwegians only encounter multi-byte with Ææ Øø Åå, so we get a much nicer deal. Of course, UTF-8 doesn't save us from the madness of the Norwegian QWERTY layout.)
Does "changeset" have a different meaning in Git, or is it not used at all?
It's not used at all. A nice place where all the Git termini technici are explained is the `gitglossary' man page (it's also available online on the Git website, in case your system doesn't have it).
Thanks for the tip. So I guess it's either "commit [2c87f791af]" or "revision [2c87f791af]". What sounds best? (The brackets are for consistency with Trac.) Vegard _________________________________________________________________ Windows Live™ Mail. Flere kontoer på ett sted. http://download.live.com/wlmail
On Thu, Apr 15, 2010 at 09:10:30PM +0000, Vegard Øye wrote:
Date: Thu, 15 Apr 2010 21:28:33 +0200 From: [email protected]
× is included in ISO 8859-1 (Latin-1), so it should be quite safe anyway, Unicode or no Unicode.
"Safe"? As if we weren't fighting with shitty software all the time.
Emacs is not shitty software. :)
Granted.
And the nice advantage of UTF-8 is that it's ASCII-compatible -- i.e. as long as it does not contain codepoints above 127, problems never occur.
I think that's nice too, but Asians complain because their characters are encoded as multi-byte all the way, increasing the file size. (Us Norwegians only encounter multi-byte with Ææ Øø Åå, so we get a much nicer deal. Of course, UTF-8 doesn't save us from the madness of the Norwegian QWERTY layout.)
Sure. And with UTF-16, you get two bytes for any character up to 0xFFFF, if I'm not mistaken. Plus the null char and byte order problems. But we're getting *really* off topic here :-)
Thanks for the tip. So I guess it's either "commit [2c87f791af]" or "revision [2c87f791af]". What sounds best? (The brackets are for consistency with Trac.)
From the mentioned man page:
The word "commit" is often used by git in the same places other revision control systems use the words "revision" or "version". And indeed, I don't remember even seeing "revision" being used at all on the Git mailing list or other gitly places. Štěpán
participants (2)
-
Vegard Øye -
Štěpán Němec