Specify line number with filename when launching rapidphp

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.

  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".

Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!

Specify line number with filename when launching rapidphp

Postby sootsnoot » Sun Feb 24, 2013 7:06 am

Although this feature is the subject of an existing entry in the support forum:
http://forums.blumentals.net/viewtopic.php?f=4&t=5621&hilit=command+line
that entry is just a question, not a feature request - and it got no reply.

I searched this forum for "command line" and found nothing relevant. After reading Karlis' feature request guidelines, I believe that this does not really violate them, so here goes. If the information is here somewhere and I missed it, I sincerely apologize.

The referenced question in the support forum has to do with supporting the use of rapidphp with firebug. My use case is different, but I believe it would be satisfied if the answer to the referenced question were "yes". When I saw that version 14 had external command line support, I expected that the answer might now be yes, but was quite disappointed to find that the support has only to do with invoking external command lines from within rapidphp as opposed to invoking rapidphp from external command lines...

My use case is that I have a Zend Framework web application that uses the gettext translation adapter for localized message text. And we use POEdit to specify the translation of each message to different languages. POEdit is "just" a GUI that sits on top of the GNU gettext suite of command-line tools; but it provides a *major* simplification in correctly coordinating the interactions between those separate tools, which are pretty unwieldy even to developers familiar with command-line tools. POEdit provides a big scrolling window of all the distinct message strings in the whole project, and for each distinct message text, there is a place to specify its translation, and a menu item that lists every place in the project's source code (file and line number) that issues the message. The intent is that you can click a location on the menu to bring up an editor or browser showing you the message in the context of the source code - sometimes the translation of a message may need to be different to best accommodate all uses, and sometimes different locations would be better-served by using different messages.

POEdit does include a source browser, but it is very limited. And it does not include an editor at all - instead it has a configuration hook allowing you to specify the editor of your choice. It's quite flexible in that you provide an sprintf-like format string for the configuration; and then when you click a location containing a message string of interest, POEdit runs a system() command consisting of that string with the filename substituted into %f and line number into %l.

When I first got RapidPHP (version 10), I verified that it could be invoked from the command line with a filename, and it had the very nice property that if it was already running the running instance would either open a new tab for the file, or just change focus to the tab for that file if it was already open. Sweet. But I could not devise any way to specify a line number - it seems that *all* characters on the command line following the whitespace after the command name itself get treated as a filename, embedded blanks don't need to be quoted... So I wound up using xemacs with gnuserv to provide similar functionality (emacs, like vi and other editors, accepts command line arguments "+n filename" to open filename at line n).

Given the popularity of Linux command-line tools on Windows, I'm really surprised that this hasn't come up. Or maybe there really is a way to do it and I just haven't found it.
sootsnoot
 
Posts: 26
Joined: Sun Feb 24, 2013 4:30 am

Re: Specify line number with filename when launching rapidph

Postby Aivars » Sun Feb 24, 2013 3:19 pm

So, basically, you want additional command line parameters for specifying line number to move the cursor to?
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Specify line number with filename when launching rapidph

Postby sootsnoot » Thu Aug 08, 2013 2:22 pm

Wow, I missed the fact that you replied to my post within a few hours! I'm not a frequent visitor, and am embarrassed to admit that I thought my post was unanswered.

Anyway, the answer to your question is yes, in addition to the filename add a parameter to specify the line number to move the cursor to. The exact syntax is not important in my use case because the program that will launch RapidPHP allows the user to specify the exact command line, with placeholders for the filename and line number. At least two popular editors, emacs and vi, use the same command line syntax for this aspect (they have many more command line options where they differ, but they agree on specifying the line number to place the cursor on). You specify the line number preceded by a "+" sign (no intervening space) as an option before the filename.

So for example the following two command lines both open file src/foo.c for editing with the cursor placed at the beginning of line 250:

Code: Select all
vi +350 src/foo.c
emacs +350 src/foo.c
sootsnoot
 
Posts: 26
Joined: Sun Feb 24, 2013 4:30 am

Re: Specify line number with filename when launching rapidph

Postby Aivars » Thu Aug 08, 2013 9:36 pm

This makes sense and I think could be implemented, I'll add to suggestions list.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Feature Requests

Who is online

Users browsing this forum: No registered users and 10 guests