-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protect both backquotes and tildes' special features unknown to the kernel from expansion #5251
Comments
If for example,
is called out, upon exiting the session, it would return a Of course! The message cannot be more accurate. The buffer was indeed modified. Hence raising up the issue as to what exactly, was modified |
I don't understand what you're doing. The backtick is the Kakoune command for "convert selections to lower-case", Are you selecting some text, pressing backtick to make it lower-case, then running a I do not understand your reference to escaping; backtick and
|
Think of it this way. And keep in mind that just as I said earlier, some changes ocurred along the way, that I can't pinpoint what version of kakoune may have been running at the time. But for references, this is with the latest head But think of it this way. What I've done with kakoune is mapping some keys to a given command which in turn runs the There have been a few commands mapped to some keys that basically behave as such. Returning the If I were to have in the configuration file something such as
you can probably shell out with the Now. The buffer filename does not necessarily have to have the extension assigned to the filename. Heck. I'm pretty sure you can run the above command on a markdown file for that matter. Alhtough it would interpret some characters differently and beyond that point will probably stall out mainly because it wouldn't match the programme of unescaped character strings and the like. But this is besides the point. So let's say you take for example the above. Sorry for redundancy and here and this is the most important part out of the whole diatribe. Fiddle out with both backquotes and tildes here
and teletype it to markdown the file |
OK, here's a test case of what I think you're talking about: $ echo "hello world" > test.txt
$ kak -n test.txt -e 'execute-keys "~~$true<ret>"; quit' (I don't happen to have TeX installed, and the specific command doesn't seem to be relevant to the problem you're describing) When I do the above steps, Kakoune fails to exit, with an error:
...which makes total sense, because the buffer has been modified by the That's what I expected would happen, but apparently it's not what you expected would happen? What result were you expecting? |
Then I'm at a loss there. I don't know. So, If you were to have
what changed? or for that matter,
Now. You've got an excellent point there.
|
You've added a backtick after
Now there's a backslash ("execute the next key with hooks disabled") and another backtick ("convert selection to lowercase") at the end. Buffer's still modified, Kakoune still refuses to quit. In fact, the
Your original message talks about "enclosing in backquotes to prevent expansion", but as far as I can tell nothing is being expanded, and even if it were, backquotes do not prevent any kind of expansion in Kakoune. |
at the current stage of development, unlike in prior commits, some changes have occurred along the way that I simply dismissed or failed to follow along but there have definitely been some modifications Take for example this before-and-after scenario before
after
the latter clearly indicating that some whitespaces and/or special characters are taken into consideration now, resulting for example in applying it over to the selection. But this wasn't always the case. It wasn't. In other words:
where Now. The documentation states the following and I'll quote it
Okie dokie then. Then. It would make more sense to say
than say
Correct? Unless the reason to say that running it on double quotes, as in with the prior examples you listed, is indeed the correct operation since the e.g.,
needs to be in single, followed by double quotes, but double quotes exert the changes on the editor, as opposed to single quotes there, or so it seems. If I say
matches the behavior I would expect the documentation is describing, rather than a superfluous/spurious double quote or another character/space that may have gone unescaped. Or so I think.
Right.
behaves almost the same as
but that's only as long as a space or any other character is not included between the double quotes As always. I appreciate the responses and feedback from you. |
When Kakoune executes a command, it splits the line on whitespace characters to produce a list of words. The first word is the command, the rest of the words are passed to the command for it to interpret. When
...all do the same thing. When
...both do the same thing. So yes, these two commands do exactly the same thing:
...since none of the characters within the quotes have any special meaning outside the quotes. These two commands also do exactly the same thing:
...for the same reason: none of the characters within the quotes have any special meaning outside the quotes. However, these two commands do not do the same thing:
...because the space character is significant outside the quotes. The first is equivalent to:
(without the space) because Kakoune splits on spaces, and
...replacing the quoted space character with the long key name. |
Protect both backquotes and tildes' special features unknown to the kernel from expansion
There had been some noticeable changes that somehow protect
$
and thus piping out each selection to a command given.And it all seems too good and dandy but it may not account for the fact that, (and this is from my understanding of the issue), that although say a tilde
~
is unknown to the kernel with its special feature, a given buffer is still modified, (hence unwanted behavior) even by enclosing it within bacvior) even by enclosing it within backquotes to prevent expansionBottom line here is that whenever I see a message on the kakoune session saying
modified buffer exist
it really really raises every sort of alarm imaginable to human kind. Why would a modified buffer exist in the + sfirst place without an apparent modification? This is of course, going b saby the POSIX standards.Allow me to turther explain it. On most terminals, if I were to map any given combination to run a command
or
it goes through without an issue. But it should return
modified buffers exist
and yet doesn't.In the teletype the same commands
return
modified buffers exist
even though it is not supposed to, for nothng was really modifiedIn the latter, no amount of ` will protect either the ~ from interpreting it and thus returning a
modified buffer exist
for that particular buffer.There may be other characters such as an _ that may prevent this from happening. Which in the case of the teletype, it does seem to do the trick. But I have to admit I don't quite understand the difference there, as opposed to the other two.
The text was updated successfully, but these errors were encountered: