Recent

Author Topic: Lazarus & FPC documentation  (Read 4604 times)

AlexK

  • Full Member
  • ***
  • Posts: 101
Re: Lazarus & FPC documentation
« Reply #15 on: September 20, 2025, 03:18:50 am »
Just like I have suggested to the GNU Emacs Team to produce commercially available documentation on the Emacs system

Emacs is the best documented UX system in existence. "C-h r" to access main info system.
Emacs is fully introspective and discoverable, any keymap is a function that can be jumped to and debugged immediately.
Even those Emacs Lisp functions that are implemented in C can be jumped to if sources are installed, it opens a C file and points to a function that implements it.

I'm exploring a feasibility of extending Lazarus by a package that implements some Emacs(and some Vim) editing features instead of enhancing support for FPC in Emacs.

For example a simple command that scrolls screen so that a line where cursor is located ends up in the middle of the screen. It's how code in Emacs/Vim is read, moving cursor to a point of interest(not arrow keys) and centering that location on page.
Or the fact that Lazarus can't focus windows without mouse. Like moving focus to Code Explorer when focus is in Source Editor and then moving focus back to editor.(classic floating windows layout can use OS keymaps though)
« Last Edit: September 20, 2025, 03:20:23 am by AlexK »

dseligo

  • Hero Member
  • *****
  • Posts: 1653
Re: Lazarus & FPC documentation
« Reply #16 on: September 20, 2025, 09:25:45 am »
Or the fact that Lazarus can't focus windows without mouse.

Try pressing F11 and F12.

Quote
Like moving focus to Code Explorer when focus is in Source Editor and then moving focus back to editor.(classic floating windows layout can use OS keymaps though)

To focus Code explorer you can set desired key in Key Mappings (search for 'Toggle view Code Explorer').

AlexK

  • Full Member
  • ***
  • Posts: 101
Re: Lazarus & FPC documentation
« Reply #17 on: September 20, 2025, 05:18:45 pm »
Or the fact that Lazarus can't focus windows without mouse.
Try pressing F11 and F12.
To focus Code explorer you can set desired key in Key Mappings (search for 'Toggle view Code Explorer').

It doesn't work with "docking of IDE windows" enabled in Tools->Options->Docking/Anchordocking.
Keymaps for toggle commands in View menu are ignored, no-op.

Docking layout seems to be more ergonomic when debugging the IDE itself, easy to move second instance of IDE to other dekstop workspace, etc.
« Last Edit: September 20, 2025, 05:21:17 pm by AlexK »

n7800

  • Hero Member
  • *****
  • Posts: 606
  • Lazarus IDE contributor
    • GitLab profile
Re: Lazarus & FPC documentation
« Reply #18 on: September 20, 2025, 07:35:56 pm »
It doesn't work with "docking of IDE windows" enabled in Tools->Options->Docking/Anchordocking.
Keymaps for toggle commands in View menu are ignored, no-op.

Unfortunately, this is a long-standing issue. But it doesn't affect all windows.

Emacs is the best documented UX system in existence. "C-h r" to access main info system.
Emacs is fully introspective and discoverable, any keymap is a function that can be jumped to and debugged immediately.
Even those Emacs Lisp functions that are implemented in C can be jumped to if sources are installed, it opens a C file and points to a function that implements it.

I'm not sure what exactly you're talking about. Are you talking about documentation (on websites or the "docs" folder), hints in the IDE, or navigation in code?

To display function prototypes (and even descriptions from the documentation), simply hover the mouse over them. There are numerous options for this, and packages ("TurboPowerIProDsgn"). The Object Inspector also displays property help in the bottom panel.

During debugging, when the program is stopped, you can hover the mouse over any variable, and its current value will be shown. This also depends on many options and the specific debugger.

And to navigate through the code, simply right-click and select "Find declaration..." or many other commands.

For example a simple command that scrolls screen so that a line where cursor is located ends up in the middle of the screen. It's how code in Emacs/Vim is read, moving cursor to a point of interest(not arrow keys) and centering that location on page.

Window scrolling while navigating through the code is controlled by the options in the "CodeTools > General" category.

Or you can scroll the text "in place" using the [Ctrl+Up/Down] keys.



I hope this information helps. There are many more useful features.

If you have problems with these features, please create (read) separate threads, as they are off-topic.

AlexK

  • Full Member
  • ***
  • Posts: 101
Re: Lazarus & FPC documentation
« Reply #19 on: September 20, 2025, 09:05:43 pm »
I'm not sure what exactly you're talking about. Are you talking about documentation (on websites or the "docs" folder), hints in the IDE, or navigation in code?

Emacs docs as a big searchable catalog is always a part of Emacs interface.
Now about introspection in Emacs.
There's a feature in Emacs that prompts you to enter any keymap and it shows a help buffer with the info about a function that implements that keymap.
Any keymap In Emacs is implemented as an interactive function.
From that help buffer you can go directly to a file where that function is defined.
With a cursor inside that function's body you can press Ctrl-Alt-x and that function will be step-debugged when called.

That's how Lisp Machine works which Emacs is.
I'm exploring how to approach Lazarus, where things are defined.


Window scrolling while navigating through the code is controlled by the options in the "CodeTools > General" category.

Or you can scroll the text "in place" using the [Ctrl+Up/Down] keys.

It should be one keymap to position a line with cursor exactely in the middle of the screen.

In Emacs cursor is moved by Ctrl-f(forward), Ctrl-b(back), Ctrl-P(up), Ctrl-n(down). While moving cursor a line it is on currently can be centered on screen by Ctrl-l.
(and Ctrl on keyboard is usually mapped to Caps or a key below X(on the left of Space to press by thumb finger)
« Last Edit: September 20, 2025, 09:08:46 pm by AlexK »

n7800

  • Hero Member
  • *****
  • Posts: 606
  • Lazarus IDE contributor
    • GitLab profile
Re: Lazarus & FPC documentation
« Reply #20 on: September 20, 2025, 11:15:35 pm »
There's a feature in Emacs that prompts you to enter any keymap and it shows a help buffer with the info about a function that implements that keymap.

By "keymap" do you mean the keyboard combination (shortcut)? In the "Menu > Tools > Options" dialog there is a "Editor > Key Mappings" category, which lists all IDE Commands, and also lets you search by name and keyboard shortcut (both in the text and in a separate window).

It should be one keymap to position a line with cursor exactely in the middle of the screen.

In Emacs cursor is moved by Ctrl-f(forward), Ctrl-b(back), Ctrl-P(up), Ctrl-n(down). While moving cursor a line it is on currently can be centered on screen by Ctrl-l.

It's easy to implement! You can create a feature request on the bug tracker, or I can do it for you?

With a cursor inside that function's body you can press Ctrl-Alt-x and that function will be step-debugged when called.

I mentioned code navigation above (and the documentation in the "Lazarus\docs" folder and IDE code hints).



In any case, this is the "Lazarus & FPC documentation" thread. Please create another one if you'd like to discuss any other features.

AlexK

  • Full Member
  • ***
  • Posts: 101
Re: Lazarus & FPC documentation
« Reply #21 on: September 21, 2025, 12:19:17 am »
In any case, this is the "Lazarus & FPC documentation" thread. Please create another one if you'd like to discuss any other features.

That mentions Emacs and IMO a mistake about its documentation system.

I'm exploring Lazarus and docs with some purpose that I described and not discussing feature requests for a non-commercial project.
(besides that bug on gitlab regarding focus in IDE windows there's also crashing in Wayland session while debugging, at least).

dsiders

  • Hero Member
  • *****
  • Posts: 1525
Re: Lazarus & FPC documentation
« Reply #22 on: October 31, 2025, 07:09:22 pm »
Hello donsiders - you are Don Siders ?

I found you mentioned in the Lazarus Forum ...
And I was seeing that you take many Time efforts to documenting the FPC Project ...

I would ask you, if we can bring us together in write Documention ?
Because I had start a own Documentation Project, too.

The Goal is / was to translate the English Documentation to German for German speaking/writer/listener ...

It would be glad, if you can send a Feedback ...

First of all, my apologies for the delay in responding.

I focus on maintaing LCL and LazUtils docs. I have made a few, scattered contributions to RTL and FCL docs, but I cannot speak for the FPC side of things.

Currently, there is no infrastructure in place for maintaining translations for the Docs. Like separate directory trees and the production processes needed to output the CHM and HTML formats using language-specific content. It would also be a very time consuming effort. Currently, there are close to 26,000 individual generated topic files for LCL and LazUtils. For RTL and FCL, I'm sure that number would be exponentially higher. And, while automated translation tools are better than they have ever been, my experience with Russian to English tools show they are pretty limited for real world, hands-off usage.

The goal is worthwhile. But I don't what advice I can really offer. But if you have a any specific questions, I will try to answer as best I can.


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: Lazarus & FPC documentation
« Reply #23 on: October 31, 2025, 09:28:39 pm »
(IMHO that is for getting it all nice and generate several translation sets at once. If you just want to generate docs for your translated German fpdoc files, that is a day of hacking and then it is up. If you really want to, you can do a lot.

Basically just hunt down the strings in fpdoc and translate them, rename the existing XML dir, and put your own in place and run with existing infra. Lazarus has a somewhat nicer .lpr to build the docs, and the makefile mess of FPC is a bit harder on non unix, but roughly it is equivalent.

But this topic already came up at lazarusforum.de a few years ago, IMHO the manpower is simply not there. At that time the "Executing Programs" in the wiki was already 5+ years out of date. If translating the docs and more importantly, keeping the docs was realistic, such key topics in the wiki would be up to date.
)

 

TinyPortal © 2005-2018