bugGNU Octave - Bugs: bug #66703, EDITOR not used by edit command...

 
 

bug #66703: EDITOR not used by edit command when running GUI

Submitter:  Dennis Cote <dennisc_hi>
Submitted:  Thu 23 Jan 2025 10:43:16 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Dennis Cote Open/Closed:  * Closed
Release:  * 9.3.0 Operating System:  * Any
Fixed Release:  9.4.0 Planned Release:  9.4.0
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Wed 29 Jan 2025 06:47:54 PM UTC, comment #5: 

I added some clarifying language to edit() and to EDITOR() in this changeset (http://hg.savanna ... /rev/dab5e4473dcc).

This will be a part of the 9.4 stable release which should happen in the next few weeks.

Rik <rik5>
Group administrator
Fri 24 Jan 2025 06:22:36 PM UTC, comment #4: 

comment #2:

> Note that `EDITOR()` is not taken into account while you are running the GUI. It only applies if you are using the CLI.
> Maybe, that could be clarified in the documentation.


I am running the GUI, which explains why it doesn't work.

I would say "should be" rather than "could be". :-)

I don't know how the documentation is generated or how to submit a patch, so I'll have to leave that to others.

Dennis Cote <dennisc_hi>
Fri 24 Jan 2025 05:09:38 PM UTC, comment #3: 

Re-titling and re-categorizing this report to be a documentation issue.  A patch to clarify would be useful.  It seems a mention should go in the documentation for both EDITOR() and for edit().

Rik <rik5>
Group administrator
Fri 24 Jan 2025 04:57:50 PM UTC, comment #2: 

Also works for me on Windows.

Note that `EDITOR()` is not taken into account while you are running the GUI. It only applies if you are using the CLI.
If you are running the GUI, you can opt for using an external editor by activating the respective option ("Use custom file editor") in the "Editor" tab of the "Preferences" dialog and setting the correct command line for launching that editor.

Maybe, that could be clarified in the documentation.
Patches are welcome.

Markus Mützel <mmuetzel>
Group administrator
Fri 24 Jan 2025 04:06:44 PM UTC, comment #1: 

This works for me on linux.

Since edit.m is an interpreted function, can you put a break point in it (e.g. "dbstop ('edit'); edit ('somefile.m')") and step through the execution to see what is going wrong?

Pantxo Diribarne <pantxo>
Group Member
Thu 23 Jan 2025 10:43:16 PM UTC, original submission:  

I have set the EDITOR value to "notepad++.exe" from both a .octaverc file and the command line. The correct value is displayed if I execute EDIOTR().

I verified can open a CMD window in the same current directory and type the command:

notepad++.exe bug1.m

and the file bug1.m is opened in notepad++. It also works if the ".exe" is dropped from the command.

If I type the command:

edit bug1.m

on the Octave command line, it opens the file bug1.m in the Octave editor window rather than notepad++. This is incorrect according to the documentation for the edit function which says: If edit is called with the name of a file or function as its argument it will be opened in the text editor defined by EDITOR.

I have tried this with the EDITOR set to both "notepad++" and "notepad++.exe" and I get the same result. It always opens the file in the Octave Editor window, contrary to the documentation.

I am reporting this in Octave 9.3.0 but I see the same behavior in a local build of Octave 10.0.0 with hgid 00671f5dbc55+.

Dennis Cote <dennisc_hi>

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 16MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by dennisc_hi (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    History

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-01-29 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 9.4.0
        Planned ReleaseNone 9.4.0
    2025-01-24 rik5 CategoryOctave Function Documentation
        Item GroupIncorrect Result Documentation
        StatusWorks For Me Need Info
        Operating SystemMicrosoft Windows Any
        SummaryEDITOR not used by edit command EDITOR not used by edit command when running GUI
    2025-01-24 pantxo StatusNone Works For Me

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code