Re: mcedit: Center current line in middle of screen

2021-01-21 Thread Sebastian Gniazdowski via mc
On Thu, 21 Jan 2021 at 12:51, Yury V. Zaytsev  wrote:

> On Thu, 21 Jan 2021, Sebastian Gniazdowski wrote:
>
> > I have made the wish list on the ticket system:
> > http://midnight-commander.org/ticket/4177
> >
> > Are there any interesting entries? Or: is the direction in them
> > compliant with the maintainer vision?
>
> Sorry, I've used up the time that I can make for mc for the coming months,
> but to make it short, I'd rather side with Andrew.
>
> I'm pretty averse to overloading mcedit with small hardly discoverable
> functions (however useful they are), and bolting on a questionable
> scripting engine on top of that.
>

There are two arguments in the paragraph:

1. Small hardly discoverable features:
2. Questionable scripting engine.

Ad. 1.

I think/I'm hoping that it's just a first impression that the wishlist has
made, mostly because of how long it is. I think that the entries in it are
of the following categories:

A. Small bugfixes.

Like the whitespace leaving on the divided line by the typewriter wrapping,
or the pasting onto an input's initial, faded text, or the find definition
goto-line instead of replacing the file with the same file, or the fix of
ParagraphFormat action, etc.

Such changes are fine as they are rather bugfixes than microchanges, and
bugs can be as small as they can get, because they're bugs that should be
just fixed.

B. New features that are narrow, but sensible.

Like the line joining (vim's J command), character swapping (Ctrl-t in
readline), centering of view (vim's zz command), CapitalizeWord (vim's gUiw
command), LowercaseWord/Letter, ReloadFile action (vim's :edit), or the
to-open-paren indenting, etc.

I think that such changes are yes – narrow – however they're have a good
history in other editors, so it's fine to implement them. All of them
require only small coding.

C. Features by the big F – with big coding required by them.

Like the (30) alternate/updated WindowList command merging (but with a
separation) the entries of the open file list and the editor history, or
the clipboard history, (61) showing of current function in the window bar,
or the (10) word-delimited block paren-like matching (i.e.: MatchBracket
action), MultiSearch listbox filtering, etc.

Such changes are IMO little heavy and require acceptance of the maintainer,
however I strongly believe in them (not sure if all such wishes from the
list, however the above – yes) and I hope that I'll win maintainers
blessing on them.

D. Annoyance resolving changes.

Like the (52) WordRight to jump to the end of word, not to the beginning of
next word, or (41) repeating of Complete to move the selection in the list
to next item, or (46) opening of file without adding it to editor history,
or (53) explicit jumps to previous locations in the file, (56) saving and
restoring of the replaced buffer's undo history.

I think that such changes may be most difficult to convey to the
maintainer. On the other hand, SearchOppositeContinue has found its way to
mcview, and it is from this category – a narrow change to resolve an
annoying problem, so maybe there's hope.

E. Fancy changes.

Like (13) completion of file paths in buffer, (39) go-to filename under the
cursor, (40) repeating of all characters and commands from the last save,
(57) peek of the declaration of the function under the cursor, or the
terminal window support, or (18) bookmark listbox, (32) search results
listbox, etc.

Such changes can be perceived as controversial because of the fanciness and
size of the patches. I think that they need to be "pulled off", which makes
them open for a simple rejection.

F. Creative, eccentric changes.

Like the (17) preview of ExternalCommand, (14) tray with a set of Unicode
symbols,  (16) git support, (58) a tags aware window list.

Such changes are rather doomed for a fork fate. 17 and 14 – yes, maybe, but
the git support or 58 – no, rather no chances of acceptance of the
maintainer.

G. Long awaited changes.

Like (5) file browse widget for Edit/SaveFile,(15) "other file" .c ↔ .h
support, (11) CK_WindowCascade / CK_WindowTile, (29) scroll left/right.

Such changes are IMO problematic, because they're known for the maintainer
and fossilized. I however still have hopes for all of the above, especially
the last three.

H. Weird changes

Such changes might be the ones that you and Andrew have biggest objections
to, like 45, 36, 31, 4, 24, 47, etc. I've included them in the wishlist
just to stimulate the grey cells and new ideas. They and the ones from F.
may have caused the allergic reaction of Andrew… And also D., contributing
to the microchanges aura.

Ad.2. Questionable scripting.

Slang is a good language. It e.g.: allows inheritance of structures via,
e.g.:
   car = struct {x, y, z};   truck = struct {@car, t};

Slirp is a very reliable tool. Did maybe the kitchensink example scare you
off? Because it's the standard syntax used in such tools, it's virtually
identical to Swig, the main scripting integration 

Re: mcedit: Center current line in middle of screen

2021-01-21 Thread Yury V. Zaytsev

On Thu, 21 Jan 2021, Sebastian Gniazdowski wrote:

I have made the wish list on the ticket system: 
http://midnight-commander.org/ticket/4177


Are there any interesting entries? Or: is the direction in them 
compliant with the maintainer vision?


Sorry, I've used up the time that I can make for mc for the coming months, 
but to make it short, I'd rather side with Andrew.


I'm pretty averse to overloading mcedit with small hardly discoverable 
functions (however useful they are), and bolting on a questionable 
scripting engine on top of that.


There are enough fundamental problems with mc codebase, and my vision for 
it would have been to clean up the core, cover it with tests, and expose 
its API to an external engine, which provides a high level memory managed 
language. Everything beyond core could be pushed into this layer and left 
up to users and distributions...


This was pretty much what mc^2 was a prototype for, but very unfortunately 
we didn't have the capacity to integrate it :-(


--
Sincerely yours,
Yury V. Zaytsev
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mcedit: Center current line in middle of screen

2021-01-21 Thread bcurrey99 via mc
On number 5, the file dialog widget is needed for :Open file...Save as...Insert 
file...Copy to file...Adding this should close ticket #2937.I noticed your 
references to macro languages and Jed.  I used to use Brief and loved its macro 
language.  I still have a working copy that can run on linux with all my 
macros.  The macro language gave it tremendous power and flexibility. Bob 
Currey Sent from my Galaxy
 Original message From: Sebastian Gniazdowski via mc 
 Date: 1/20/21  5:27 PM  (GMT-06:00) To: "Yury V. Zaytsev" 
 Cc: mc@gnome.org Subject: Re: mcedit: Center current line in 
middle of screen Hi,I have made the wish list on the ticket system: 
http://midnight-commander.org/ticket/4177Are there any interesting entries? Or: 
is the direction in them compliant with the maintainer vision? -- Sebastian 
Gniazdowski
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mcedit: Center current line in middle of screen

2021-01-20 Thread Sebastian Gniazdowski via mc
Hi,
I have made the wish list on the ticket system:
http://midnight-commander.org/ticket/4177

Are there any interesting entries? Or: is the direction in them compliant
with the maintainer vision?

-- 
Sebastian Gniazdowski
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mcedit: Center current line in middle of screen

2021-01-16 Thread Martin Michel
Hi Sebastian,

thank you for sharing this!  In fact, I also digged into the source and
made a quick fix for my needs before I read your last message.  I was
surprised how well the API is crafted, so changing small things directly
in the C source code is probably the way to go for minor features like
this.

> I'm thinking that such feature has a minor drawback which can be
> additionally addressed – it is little offensive, IMO, to human brain
> to observe such jumps.

Personally, I have no need for moving the display slowly or gradually, I
think this adds complexity.  I am a fan of minimalism but fully respect
any efforts to make software more accessible.  So I am curious if you
come up with some changes here, would be interesting.

There is major difference in my patch however — and this is important for
my personal text editing experience:  I mostly feel the need to center
the current line when I am already at the bottom of the buffer, eg.
editing long text or code and the cursor line is both on the bottom of
the window and the buffer.  Therefore I made a hack to redraw the window
when I am in the bottom half of both window and buffer.

Btw, I was also long-time vim and emacs user, but got fed up with many
things in both editors, especially with the complexity and bloat which
came with third-party packages and extensions.  That is why I am still
looking for a replacement and mcedit is indeed on the very top of my
list.

Anyhow, I will upload my patch to your ticket, please feel free to
delete/reuse/modify it for your proposed changes.

Kind regards, 

Martin
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mcedit: Center current line in middle of screen

2021-01-15 Thread Sebastian Gniazdowski via mc
On Fri, 15 Jan 2021 at 10:58, Yury V. Zaytsev  wrote:
> Sebastian, if you are motivated and have time to do some serious work on
mc, maybe we should talk about a vision first?

Thanks for the invite! Yes I'm motivated, I find it very entertaining to
work on mc.

I wish someone had taken the time instead to integrate the Lua fork by
> mooffie. Unfortunately he wasn't up to maintaining his work of a genius
> (no kidding) and we don't have resources to take it over.


I think that he had one initial mistake, if I can say so – he scripted mc
and not mcedit. I think that it's an editor that can gain most of a
scripting engine, not a filemanager.


> In as far as S-Lang scripting is concerned, it's definitively easy to bolt
> it on, but I really wouldn't want to live with the resulting mess. Our
> code base is already in a shape bad enough...
>

I have a very pleasant experience with S-Lang. I've ran my first script
displaying a listbox from script after ~2 hours of hacking – thanks to
Slirp, the S-Lang version of Swig. It works very, surprisingly well! And it
has all the advanced features of Swig (take a look at
examples/kitchensink/slirprc if you have time). It looks solid.

Basically, to simply export a function to S-Lang, all that is required is
to run: slirp header.h, with the declaration in that file and to compile
and link the resulting header_glue.c (that slirp automatically creates)!

What concerns me about S-Lang is that it's not an object oriented language
and that it doesn't have a bool type. However, that might be a good thing,
as the engine and the vision will be light thanks to this, maybe…

It doesn't make sense to me for you invest your valuable time only to get
> your patches criticized or rejected or just rotting on the tracker without
> any feedback. If we can agree on a direction, then I think it will be good
> for all of us, if we can't - at least it will be good for you, because
> then you can spare your time arguing with us and directly setup a fork
> instead... :-)
>

Yes, I had such hunches too. So my intentions are:
– to make the gem, that mcedit is, more popular,
– to make it grow and flourish mainly by the light scripting engine, but
also by regular C work (like e.g.: the tags objects in listboxes patch –
really, I don't know how I was using the various Vim tags plugins for
years, as it's the mcedit's way – a simple listbox (which can be just built
in) – that is the right way to do tags :)
– then to utilize the scripting also in regular mc and see what ideas will
come up.

I'm constantly having ideas on mcedit improvements. I'm saving them to a
file… It had like 80 entries, but I've just accidentally deleted it hours
ago via a miserable rm -f **/*.#* glob (it expands to all files, not just
those with hash in them, so look out) :( however I have a backup that has
~50 entries, uf … So maybe I could do a wish list on the wiki out of it?

PS. This gives an idea for an improvement – a saving of the backup file to
a predefined directory outside the current tree… Could be done as a script
plugin, maybe.

-- 
> Sincerely yours,
> Yury V. Zaytsev
>


-- 
Sebastian Gniazdowski
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mcedit: Center current line in middle of screen

2021-01-15 Thread Yury V. Zaytsev

On Fri, 15 Jan 2021, Sebastian Gniazdowski via mc wrote:

I'm also working on adding a S-Lang scripting to it :) It already works 
on my machine. It was really simple, just invoking SLang_init_all() and 
that was it, as libslang is already linked :) I have a plugin in it that 
implements adding and subtracting from number under cursor, for example. 
When I improve the support (e.g.: add some more S-Lang interface 
functions that would allow e.g.: moving the vie`w) I submit the patch.


I wish someone had taken the time instead to integrate the Lua fork by 
mooffie. Unfortunately he wasn't up to maintaining his work of a genius 
(no kidding) and we don't have resources to take it over.


In as far as S-Lang scripting is concerned, it's definitively easy to bolt 
it on, but I really wouldn't want to live with the resulting mess. Our 
code base is already in a shape bad enough...


Sebastian, if you are motivated and have time to do some serious work on 
mc, maybe we should talk about a vision first?


It doesn't make sense to me for you invest your valuable time only to get 
your patches criticized or rejected or just rotting on the tracker without 
any feedback. If we can agree on a direction, then I think it will be good 
for all of us, if we can't - at least it will be good for you, because 
then you can spare your time arguing with us and directly setup a fork 
instead... :-)


--
Sincerely yours,
Yury V. Zaytsev
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mcedit: Center current line in middle of screen

2021-01-15 Thread Sebastian Gniazdowski via mc
I've finished coding the support, see
https://midnight-commander.org/ticket/4175 for a patch.

I'm thinking that such feature has a minor drawback which can be
additionally addressed – it is little offensive, IMO, to human brain to
observe such jumps. I feel this way basing on the relief that I've noticed
when I moved from Vim to MCEdit recently. I was doing "zz" command very
often there. I would guess that this has something to do with "rapidly
changing pictures" topic in neurobiology.

To address this, I propose an enhancement: to move display little slowly,
gradually, just to not rudely cut the states of before and after the move.
I could use the timers but I've noticed that timer.c has been removed
recently. Why?
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mcedit: Center current line in middle of screen

2021-01-15 Thread Sebastian Gniazdowski via mc
PS. There's one more patch that I hope will be accepted (after I improve it
according to style guide): https://midnight-commander.org/ticket/4160

On Fri, 15 Jan 2021 at 11:05, Sebastian Gniazdowski 
wrote:

> On Thu, 14 Jan 2021 at 15:24,  wrote:
>
>> Hi there,
>>
>> to me, mcedit is a hidden gem.
>
>
> For me too. It is so good that I've started to improve it recently. See my
> pending patches:
>
> - https://midnight-commander.org/ticket/4165
> - http://midnight-commander.org/ticket/4169
> - http://midnight-commander.org/ticket/4174
> - http://midnight-commander.org/ticket/4171
>
> I'm also working on adding a S-Lang scripting to it :) It already works on
> my machine. It was really simple, just invoking SLang_init_all() and that
> was it, as libslang is already linked :) I have a plugin in it that
> implements adding and subtracting from number under cursor, for example.
> When I improve the support (e.g.: add some more S-Lang interface functions
> that would allow e.g.: moving the view) I submit the patch.
>
> It struck the right balance between ease of use, advanced features and
>> simplicity.
>
>
> Exactly. And IMO with a light scripting engine it could shine even more
> and be able to compete with other main editors.
>
> However, I miss an important
>> function: The ability to center the current line in the middle of the
>> screen.  I could not find it anywhere, maybe someone from the community
>> can help?
>>
>
> This is one of the most missed features by me and it was one of the main
> things that drove me to contribute to mc. Seeing that someone shares my
> view, I'll not wait until the scripting engine will be ready and I'll
> implement the centering in C ("CenterView", perhaps, for the name of the
> command?). It'll be there soon :)
>
> --
> Sebastian Gniazdowski
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
> Blog: http://zdharma.org
>


-- 
Sebastian Gniazdowski
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mcedit: Center current line in middle of screen

2021-01-15 Thread Sebastian Gniazdowski via mc
On Thu, 14 Jan 2021 at 15:24,  wrote:

> Hi there,
>
> to me, mcedit is a hidden gem.


For me too. It is so good that I've started to improve it recently. See my
pending patches:

- https://midnight-commander.org/ticket/4165
- http://midnight-commander.org/ticket/4169
- http://midnight-commander.org/ticket/4174
- http://midnight-commander.org/ticket/4171

I'm also working on adding a S-Lang scripting to it :) It already works on
my machine. It was really simple, just invoking SLang_init_all() and that
was it, as libslang is already linked :) I have a plugin in it that
implements adding and subtracting from number under cursor, for example.
When I improve the support (e.g.: add some more S-Lang interface functions
that would allow e.g.: moving the view) I submit the patch.

It struck the right balance between ease of use, advanced features and
> simplicity.


Exactly. And IMO with a light scripting engine it could shine even more and
be able to compete with other main editors.

However, I miss an important
> function: The ability to center the current line in the middle of the
> screen.  I could not find it anywhere, maybe someone from the community
> can help?
>

This is one of the most missed features by me and it was one of the main
things that drove me to contribute to mc. Seeing that someone shares my
view, I'll not wait until the scripting engine will be ready and I'll
implement the centering in C ("CenterView", perhaps, for the name of the
command?). It'll be there soon :)

-- 
Sebastian Gniazdowski
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


mcedit: Center current line in middle of screen

2021-01-14 Thread martin
Hi there,

to me, mcedit is a hidden gem.  It struck the right balance between ease
of use, advanced features and simplicity.  However, I miss an important
function: The ability to center the current line in the middle of the
screen.  I could not find it anywhere, maybe someone from the community
can help?

I could image writing a work-around macro but before spending effort
on this I was wondering if there are best practices.  Also, the macro
would not be so simple because I could not find a directive or definition
to get the current line number.  Doing this externally via `tput` or
other tricks seems wrong and would it be even possible to combine
external commands with internal instructions?  

Both while programming or writing longer texts, I often want to "center"
my view and cursor and not being stuck on the last line of the screen. 
Most basic editors I know so far have this functionality on board (eg.
nano --> C-L).

Thank you for help on this in advance!

Kind regards,
Martin
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc