XPost: alt.comp.os.windows-10, alt.comp.software.firefox   
   From: marion@facts.com   
      
   On Wed, 15 Jan 2025 11:42:56 +0100, Herbert Kleebauer wrote :   
      
      
   >> b. What do I change to make that editing 1 step instead of 2 steps?   
   >   
   > about:config   
   >   
   > view_source.editor.external true   
   > view_source.editor.path C:\Windows\System32\notepad.exe   
   >   
   > In Firefox press -U to start the editor with the html source   
      
   Woo hoo! I think you (perhaps accidentally) answered BOTH questions!   
   It was the default gvim batch file which was BACKGROUNDING things!   
   Thanks!   
      
   Here's how I figured that out, based on what you suggested I do.   
   1. Check the configuration in Firefox   
    about:config   
    view_source.editor.external = false   
    view_source.editor.path =    
      
   2. Now change that to edit using Notepad (for test purposes).   
    C:\> where notepad   
    C:\Windows\System32\notepad.exe   
    about:config   
    view_source.editor.external = true   
    view_source.editor.path = C:\Windows\System32\notepad.exe   
    firefox firefox file:///C:/sys/myurls.html   
    Control+U   
    That works.   
      
   3. That works for notepad, but it does NOT work for gvim.   
    C:\> where gvim   
    C:\Windows\gvim.bat   
    about:config   
    view_source.editor.external = true   
    view_source.editor.path = C:\Windows\gvim.bat   
    firefox firefox file:///C:/sys/myurls.html   
    Control+U   
    That fails.   
      
   4. But if I use the full path to the gvim executable, it works:   
    C:\> where gvim.exe   
    INFO: Could not find files for the given pattern(s).   
    Hmm. That's how gvim installs. But I know the real path is   
    C:\bat\gvim\gvim.exe   
    about:config   
    view_source.editor.external = true   
    view_source.editor.path = C:\bat\gvim\gvim.exe   
    firefox firefox file:///C:/sys/myurls.html   
    Control+U   
    That works.   
      
   5. Notice once I realized (accidentally) that the path to gvim   
    was (by default) being found by the fact a batch file was   
    placed (by the gvim installer) in C:\Windows\gvim.bat, I then   
    surmized (correctly, it turns out) that the backgrounding was   
    being done by that gvim.bat file (and not by gvim.exe).   
      
   So, I solved that problem by amending the original steps to...   
      
   1. I created this HTML file for my one-click URLs   
    C:\sys\myurls.html   
   2. I can easily open that HTML file as HTML in Firefox on Windows   
    firefox file:///C:/sys/myurls.html   
    (which I can subsequently bookmark within Firefox)   
   3. That opens up the file inside of the Firefox browser with one click   
    (note that the default program for HTML files is Firefox)   
   4. I can also easily EDIT that HTML file in a single step inside Firefox   
    about:config   
    view_source.editor.external = true   
    view_source.editor.path = C:\bat\gvim\gvim.exe   
    firefox firefox file:///C:/sys/myurls.html   
    Control+U   
    That edits the HTML file in a single step! Woo hoo!   
      
   To edit that HTML file OUTSIDE of firefox is also a single step!   
      
   A. I created this registry key to point to a shortcut   
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\   
    gurl.exe = C:\sys\gurl.lnk   
    Where the TARGET for gurl.lnk does the actual editing:   
    TARGET=%comspec% /c C:\bat\gvim\gvim.exe C:\sys\myurls.html   
   B. I can execute that command using the Windows Runbox shortcut   
    Win+R > gurl (I never actually type this - as I use a runbox shortcut)   
   C. That opens the desired HTML file in the gvim text editor   
    (note that gvim is not the default program for HTML files)   
      
   All this works just fine in a single step now!   
   a. To edit the url file in Firefox, use "Control+U"   
   b. To edit the url file outside Firefox, use "Win+R > gurl"   
      
   The two specific questions have now been answered thanks to Herbert!   
   Q: Why doesn't the gvim editing window come up in the foreground?   
   A: Because the default gvim.bat file is causing it to be backgrounded!   
      
   Q: What do I change to make that editing 1 step instead of 2 steps?   
   A: Target the full path to the gvim.exe executable (not to the bat)!   
      
   Thanks Herbert.   
      
   This information should be generally useful to everyone because it allows   
   them to maintain a list of URLs that they can easily edit at any time.   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|