<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Some functions not shown in function list]]></title><description><![CDATA[<p dir="auto">Notepad++ v8.7.7   (64-bit)<br />
Build time : Feb  6 2025 - 03:19:13<br />
Path : C:\USERNAME\Editors\Notepad++\notepad++.exe<br />
Command Line : <a href="http://test.py" rel="nofollow ugc">test.py</a><br />
Admin mode : OFF<br />
Local Conf mode : ON<br />
Cloud Config : OFF<br />
Periodic Backup : ON<br />
Placeholders : OFF<br />
DirectWrite : OFF<br />
Multi-instance Mode : monoInst<br />
File Status Auto-Detection : cdEnabledNew (for current file/tab only)<br />
Dark Mode : OFF<br />
OS Name : Windows 10 Pro (64-bit)<br />
OS Version : 22H2<br />
OS Build : 19045.5854<br />
Current ANSI codepage : 1252<br />
Plugins :<br />
AutoSave (1.6.1)<br />
mimeTools (3.1)<br />
NppConverter (4.6)<br />
NppExport (0.4)<br />
NppSnippets (1.6)</p>
<p dir="auto">I use Notepad++ on Windows 10.</p>
<p dir="auto">In my main program “<a href="http://cntpidtype.py" rel="nofollow ugc">cntpidtype.py</a>” I have one function “readxppfileloop” that does not show up in the function list in a sidebar on the right side of Notepad++. Above that function is a function “make filenameprefix” which shows up in the function list. Below it is a function “readxpponefile” and that shows up.</p>
<ol>
<li>When I turn on to see all hidden characters I just see normal CRLF and nothing unusual before the problem function “readxppfileloop”.</li>
<li>I had this problem with an older version of NPP and updating it to a Feb 2025 version fixed it.</li>
<li>If I copy and paste into another file called “<a href="http://test.py" rel="nofollow ugc">test.py</a>” the problem function “readxppfileloop” does not appear either. This tells me something may be funky with “makefilenameprefix” but I don’t know what it is. Here’s my <code>test.py</code> file. This is missing imports so it will not run. The program actually runs fine.</li>
<li>I have also tried closing the file (and leaving NPP open) and reopening the file and the one function still does not appear in the function list.</li>
<li>I don’t have any problems with any other functions in any other .py files. So there is something funky about this file perhaps.</li>
<li>I have just used the NPP search to look for high ascii characters using regex and <code>[\x80-\xff]</code> and found none.</li>
</ol>
<p dir="auto">You can try and copy and paste this code into your own NPP and see if “readxppfileloop” appears in the function list.</p>
<pre><code>
#####################################################
def makefilenameprefix(options, filetype): 
    r'''Make filename prefix for error log and Excel files.
    In: options = global options
        ftype = text to put before anything else in filename.
    Out: Prefix of a filename not including any file extension. 
    '''
    procname = str(inspect.stack()[0][3]) + ":"
    
    fnout = os.path.join(options.donedir,filetype)

    return fnout
    
    
#####################################################

def readxppfileloop(options):
    
    r"""Loop through options.inputfilelist to read each XPP ascii file.
    """
    procname = str(inspect.stack()[0][3]) + ":"
    
    allfiles = [] # Contents of sys.argv[1]

    with open(options.inputfile, 'r') as file: # "file" is file handle object.
        allfiles = file.readlines() # Read all lines into a list. 
    cnt = len(allfiles)

    for filename in allfiles: 
        filename = filename.strip()
        if filename[:1] != '#': # Ignore comments
            readxpponefile(options, filename) # Read and process one XPP file.
    
    

#####################################################
def readxpponefile(options, filename):
    
    r""" Read one XPP file and count PID macros in it."""
    procname = str(inspect.stack()[0][3]) + ":"
    print(f"\nReading {filename}") # Print blank line.
    
    prlines = []
    lin = ''
    lpos = 0
    zpos = 0
    macroarr = [] # One macro split as a list.
    pidcode = '' # One PID code from macroarr[0].
    
    tstr = '|'.join(sorted(options.pidmacrolist))
    pidre = r'(&lt;(' + tstr + ');.+?&gt;)'

    # infile = options.pricefilename
    if not os.path.exists(filename):
        print(f"{procname} ERROR: Price file {infile} does not exist.")
        sys.exit(1)
        
</code></pre>
<p dir="auto">How can I fix this?<br />
What should I look for?</p>
<p dir="auto">Thank you.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26924/some-functions-not-shown-in-function-list</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 13:38:54 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26924.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 05 Jun 2025 10:37:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Some functions not shown in function list on Thu, 05 Jun 2025 14:12:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said in <a href="/post/101956">Some functions not shown in function list</a>:</p>
<blockquote>
<p dir="auto">There’s also a sample macro called “Trim Trailing Whitespace and Save” or something close to that, that conveniently does the action every time you save (well, every time you run the macro, which, if assigned to your favorite save-keycombo, e.g. Ctrl+s, will do it).</p>
</blockquote>
<p dir="auto">I used <code>Ctrl+S</code> remapped to <strong>Macros &gt; Trim Trailing and Save</strong> for years before starting to use editorconfig – and actually I <em>still</em> use that mapping, because I don’t have a <code>.editorconfig</code> file at the root directory of all my drives, so there are still times when the editorconfig plugin doesn’t know to trim trailing for me.  Since I almost exclusively use the keystroke vs the toolbar or menu command for my <strong>Save</strong>, I (almost) always get the trailing removed when I save.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101959</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101959</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 05 Jun 2025 14:12:24 GMT</pubDate></item><item><title><![CDATA[Reply to Some functions not shown in function list on Thu, 05 Jun 2025 14:20:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said in <a href="/post/101952">Some functions not shown in function list</a>:</p>
<blockquote>
<p dir="auto">I think the regex gurus need to take a look at this.</p>
</blockquote>
<p dir="auto">Actually, the python FunctionList definition regex is pretty simple:</p>
<ul>
<li><a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/e600c35ad2ff15c7889a50d9d9dd68faf1431823/PowerEditor/installer/functionList/python.xml#L33" rel="nofollow ugc">normal function</a>: <code>^(async )?def\x20\K.+?(?=(:$|,$|:\s*#))</code></li>
<li><a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/e600c35ad2ff15c7889a50d9d9dd68faf1431823/PowerEditor/installer/functionList/python.xml#L25" rel="nofollow ugc">function in class</a>: <code>\s(async )?def\x20\K.+?(?=(:$|,$|:\s*#))</code></li>
</ul>
<p dir="auto">The problem with both is that it requires the <code>:</code> or <code>,</code> to be the last character on the line (unless there’s a comment).  If both are edited so the final lookahead is <code>(?=(:\h*$|,\h*$|:\s*#))</code> (edit, save, exit NPP, restart NPP), then the original file, with the extra space, will work again.</p>
<p dir="auto">Analysis: It turns out, because functionlist defaults to doing a .-matches-newline search, it is actually matching from <code>def makefilenameprefix</code> all the way to the ending <code>:</code> on the <code>def readxppfileloop(options):</code> line: this is why the <code>makefilenameprefix</code> made it into the function list, but <code>readxppfileloop</code> did not.  (I think it actually means that there’s a multi-line string being sent to the FunctionList panel… but because it only <em>displays</em> one line per function, you don’t notice.)</p>
<p dir="auto">If there had been an <code>if xyz:</code> line (or any other control structure that ended with <code>:</code>-then-EOL) somewhere inside <code>makefilenameprefix()</code>, then <code>readxppfileloop</code> would show up, too.  So there was not only “bad luck” in having the space at the end of the line, and “bad luck” that whoever developed the original functionList regex for Python didn’t think to allow whitespace, but also “bad luck” that there wasn’t another control structure inside the function.  Don’t go to your local casino until you’ve broken your “bad luck” streak. ;-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101958</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101958</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 05 Jun 2025 14:20:06 GMT</pubDate></item><item><title><![CDATA[Reply to Some functions not shown in function list on Thu, 05 Jun 2025 13:20:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/25164">@C-Bacca</a> said:</p>
<blockquote>
<p dir="auto">I didn’t even see that space</p>
</blockquote>
<p dir="auto">And, that’s why it is best to have something in place that removes such things.</p>
<blockquote>
<p dir="auto">Is there an option to remove trailing whitespace in generic NPP?</p>
</blockquote>
<p dir="auto">Yes there is; on the <em>Edit</em> menu.<br />
There’s also a sample macro called “Trim Trailing Whitespace and Save” or something close to that, that conveniently does the action every time you save (well, every time you run the macro, which, if assigned to your favorite save-keycombo, e.g. Ctrl+s, will do it).</p>
<blockquote>
<p dir="auto">Can the author add that option to the generic NPP settings?</p>
</blockquote>
<p dir="auto">Well, the author <em>could</em>, but it is probably unlikely as the functionality already exists in a plugin as well as the sample macro.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101956</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101956</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 05 Jun 2025 13:20:42 GMT</pubDate></item><item><title><![CDATA[Reply to Some functions not shown in function list on Thu, 05 Jun 2025 11:36:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> Is there an option to remove trailing whitespace in generic NPP? I’m looking and haven’t found it yet.</p>
<p dir="auto">Can the author add that option to the generic NPP settings? There are 2 tabs for editor settings, “Editor 1” and “Editor 2”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101955</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101955</guid><dc:creator><![CDATA[C Bacca]]></dc:creator><pubDate>Thu, 05 Jun 2025 11:36:14 GMT</pubDate></item><item><title><![CDATA[Reply to Some functions not shown in function list on Thu, 05 Jun 2025 11:31:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> I can confirm, removing that last space fixes it. I didn’t even see that space or thought it would matter.</p>
<p dir="auto">There’s some regex in a settings file somewhere for NPP that searches for function names. Can this be fixed to allow trailing spaces in the next NPP update?</p>
<p dir="auto">I don’t know where that file is right now.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101954</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101954</guid><dc:creator><![CDATA[C Bacca]]></dc:creator><pubDate>Thu, 05 Jun 2025 11:31:07 GMT</pubDate></item><item><title><![CDATA[Reply to Some functions not shown in function list on Thu, 05 Jun 2025 11:16:47 GMT]]></title><description><![CDATA[<p dir="auto">FWIW, I would never see this problem, because I use the editorconfig plugin and set it to remove trailing spaces upon save.  I have it set to do this because I can’t think of a single reason that trailing spaces on lines are useful.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101953</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101953</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 05 Jun 2025 11:16:47 GMT</pubDate></item><item><title><![CDATA[Reply to Some functions not shown in function list on Thu, 05 Jun 2025 10:54:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/25164">@C-Bacca</a></p>
<p dir="auto">I do not have an solution but can confirm the behavior.</p>
<p dir="auto"><img src="/assets/uploads/files/1749120813077-12481c85-b476-4456-a1cc-b2d4fc1595cf-61c2c14c-37c3-4e8a-9c2e-76389065e260.png" alt="12481c85-b476-4456-a1cc-b2d4fc1595cf-{61C2C14C-37C3-4E8A-9C2E-76389065E260}.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Now deleting the space at the end of <code>makefilenameprefix</code> solves it for me.</p>
<p dir="auto"><img src="/assets/uploads/files/1749120860009-24216b70-4146-424a-873b-f79734b8f659-b8a132b1-2d68-48da-84c0-f4f578a1190d.png" alt="24216b70-4146-424a-873b-f79734b8f659-{B8A132B1-2D68-48DA-84C0-F4F578A1190D}.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I think the regex gurus need to take a look at this.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101952</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101952</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Jun 2025 10:54:58 GMT</pubDate></item></channel></rss>