Re: bash syntax does not handle bitwise left shift

2006-10-21 Thread A.J.Mechelynck

Olaf Hering wrote:

The shell syntax highlighting does not work for the bash 'left bitwise shifts'.
I have uploaded the example script and screen show to
http://www.aepfle.de/linux/vim/

The offending line is:

(( of_disk_addr = ( (of_disk_scsi_chan16) | (of_disk_scsi_id8) 
|  of_disk_scsi_lun ) )); #

If I change it to of_disk_scsi_chan16 or of_disk_scsi_chan16, it
looks better. 


How can this be fixed properly?
This is vim7, it did not work with older versions either.




1) Check whether ftp://ftp.vim.org/pub/vim/runtime/syntax/sh.vim isn't by any 
chance more recent than the $VIMRUNTIME/syntax/sh.vim you're using (check the 
Last Change date in the comments at the top of the script).


2) If it isn't, check whether by any chance there isn't a newer version at the 
HTTP address mentioned in the URL line in the comments at the top of the script;


3) If there isn't, explain your troubles to Dr. Chip (aka Charles E. Campbell, 
PhD) at the address obtained by removing the letters N,O,S,P,A and M from the 
address listed in the Maintainer line at the top of the syntax script.



Best regards,
Tony.


Re: insert-mode :map-alt-keys and 8-bit locales

2006-10-21 Thread Alexey I. Froloff
* A.J.Mechelynck antoine.mechelynck@ [061021 08:01]:
 IMHO, the way to configure it is not by hacking Vim but (at
 least in console Vim) by having a properly-built
 termcap/terminfo which tells Vim which codes correspond to
 which keys.
IIRC, only user can tell what will Meta+Key send and it has
nothing to do with term*.  I'm talking about convert-meta
(inputrc) and eightBitInput (xterm).

 but no program can discriminate between different keypresses
 which your keyboard driver translates to the same keycode (or
 keycode sequence).
Vim assumes that Meta+Key always generates (Key | 0x80).  Code:

/*
 * Try to include modifiers in the key.
 * Changes Shift-a to 'A', Alt-A to 0xc0, etc.
 */
int
extract_modifiers(key, modp)
int key;
int *modp;
{
...
if ((modifiers  MOD_MASK_ALT)  key  0x80
...
)
{
key |= 0x80;
modifiers = ~MOD_MASK_ALT; /* remove the META modifier */
}
...

Add extra condition, '8bitmeta' option checking (which is on by
default) for example.  However, this will not solve all problems,
I will look further.


P.S. Why am I doing all this?  latexsuite plugin imaps M-x keys
and this generates problems in ru_RU.KOI8-R locale (8bit).  This
can't be fixed without hacking into latexsuite code and this bug
happend only if (x | 0x80) means something in current locale.
One workaround is to switch to UTF-8 locale.

-- 
Regards,
Sir Raorn.


signature.asc
Description: Digital signature


Re: Paste as HTML

2006-10-21 Thread Bram Moolenaar

Igor Dvorkin wrote:

 Many windows apps support a clipboard pasting format of HTML. This is
 how you can copy code in Visual Studio 2005 and paste it into outlook
 and see syntax highlighting.
 
 I recommend something similar be done for VIM. Today, we have toHTML,
 that's reasonable, but ideally we'd able to yank as HTML. I've created
 a patch that can yank HTML to the clipboard as type HTML. I don't
 think this patch should be submitted, instead used by the person
 considering this feature request.
 
 
 Ideally this patch will be extended to allow the user to decide to :
 
 a) yank text , convert it to HTML, and have show up as type HTML.
 b) yank HTML, and have it have it show up as type HTML
 c) yank text, and have it show up as HTML
 
 My patch only implements 'b'
 
 Thoughts?

Your patch appears to mostly change indent...

With a simple script you can invoke 2html.vim on highlighted text and
yank the result into the clipboard.  What is the added value of marking
it as HTML on the clipboard?

-- 
hundred-and-one symptoms of being an internet addict:
86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: insert-mode :map-alt-keys and 8-bit locales

2006-10-21 Thread A.J.Mechelynck

Alexey I. Froloff wrote:

* A.J.Mechelynck antoine.mechelynck@ [061021 08:01]:

IMHO, the way to configure it is not by hacking Vim but (at
least in console Vim) by having a properly-built
termcap/terminfo which tells Vim which codes correspond to
which keys.

IIRC, only user can tell what will Meta+Key send and it has
nothing to do with term*.  I'm talking about convert-meta
(inputrc) and eightBitInput (xterm).


As you told me recently, you don't know what you're talking about. Most 
nontechnical users don't know (and don't care) what binary keycodes their 
keyboard interface is sending to their program when they hit which key 
combination. Only the programmers of the keyboard interface (and the admins 
who write keyboard-interface configuration files) can decide which keycodes 
correspond to which keypresses, and it takes quite some technical expertise to 
find out with certainty what key combinations are sent by which keypresses on 
which systems for all possible combinations of modifier and other keys. It 
might be relatively straightforward (if not necessarily easy) for programs 
running only on Windows or only on X11 but Vim has to cater for not only 
Windows, X11 and Carbon but also tens of different text consoles and console 
emulators. Vim relies on such things as the termcap/terminfo libraries (both 
builtin and disk-resident) and the $TERM environment variable to tell it what 
terminal it is running on, which influences how it will interpret the keycodes 
sent to it by the keyboard interface. If the termcap is broken or $TERM set to 
a wrong value (both of which happen more often than you might think), Vim will 
misunderstand what the keyboard sends.





but no program can discriminate between different keypresses
which your keyboard driver translates to the same keycode (or
keycode sequence).

Vim assumes that Meta+Key always generates (Key | 0x80).  Code:

[snip]

What I'm saying, is that, if my (fr_BE) keyboard interface is sending the same 
keycode when I hit é (SMALL LATIN LETTER E WITH ACUTE ACCENT) and when I hit 
Alt-i (SMALL LATIN LETTER I with the Alt modifier), then Vim won't be able to 
see the difference between é and Alt-i, and in that case, if I use imap M-i 
{rhs} I'll get that {rhs} instead of an e-acute whenever I hit é in Insert 
mode. With such a keyboard interface I should avoid mapping Alt-keys in Insert 
mode if I want to be able to type French text: IOW, with that kind of keyboard 
interface, é and Alt-i are, как говорят Французы, белый колпак и колпак белый, 
или как говорят Англичане, шесть одного и полдюжина другого: /bonnet blanc et 
blanc bonnet/, or six of one and half a dozen of the other.



Regards,
Tony.


Re: Paste as HTML

2006-10-21 Thread Mathias Michaelis
Hello *

 What is the added value of marking
 it as HTML on the clipboard?
 
The added value is that you are able to paste the text into a word
processing program like AbiWord, MS Word or StarWriter in a way that
the HTML-Tags are not shown, but are interpreted by the word
processing program in order to format the text as it would be
formatted in a HTML browser.

To achieve this know, I only see one way: Convert your text to HTML,
then save it as HTML, open it with a web browser, copy it from here
into the clipboard and paste it into a word processing program.

With best regards

Mathias


Re: Paste as HTML

2006-10-21 Thread A.J.Mechelynck

Mathias Michaelis wrote:

Hello *


What is the added value of marking
it as HTML on the clipboard?


The added value is that you are able to paste the text into a word
processing program like AbiWord, MS Word or StarWriter in a way that
the HTML-Tags are not shown, but are interpreted by the word
processing program in order to format the text as it would be
formatted in a HTML browser.

To achieve this know, I only see one way: Convert your text to HTML,
then save it as HTML, open it with a web browser, copy it from here
into the clipboard and paste it into a word processing program.

With best regards

Mathias



What about opening the HTML file directly as RTF in a word processor?


Best regards,
Tony.


Re: Paste as HTML

2006-10-21 Thread Bram Moolenaar

Mathias Michaelis wrote:

  What is the added value of marking
  it as HTML on the clipboard?
  
 The added value is that you are able to paste the text into a word
 processing program like AbiWord, MS Word or StarWriter in a way that
 the HTML-Tags are not shown, but are interpreted by the word
 processing program in order to format the text as it would be
 formatted in a HTML browser.
 
 To achieve this know, I only see one way: Convert your text to HTML,
 then save it as HTML, open it with a web browser, copy it from here
 into the clipboard and paste it into a word processing program.

Why don't these programs offer the option paste as HTML?  I mean, the
user must have a choice if he wants the HTML as text or the resulting
markup.

-- 
From know your smileys:
 :}  You lie like Pinocchio

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Paste as HTML

2006-10-21 Thread Mathias Michaelis
Hello Tony

 To achieve this know, I only see one way: Convert your text to HTML,
 then save it as HTML, open it with a web browser, copy it from here
 into the clipboard and paste it into a word processing program.
 
 What about opening the HTML file directly as RTF in a word processor?

I guess the original poster wants to insert code snippets into an
already existing documentation.

Regards

Mathias


Re: insert-mode :map-alt-keys and 8-bit locales

2006-10-21 Thread Martin Stubenschrott
On Sun, Oct 22, 2006 at 01:31:09AM +0400, Alexey I. Froloff wrote:
  Vim should _support_ Meta-Sends-Escape mode which is A Must Have
  for non-ascii 8-bit locales
 Patch attached.
 
 New option - 'eightbitmeta' ('em'), default on.  If unset, two
 things happen:

I like the idea, but did not test the patch yet. I did not get alt-keys
work properly with the meta8 option in urxvt set.

--
Martin