When using visit file ('next-error) from my compilation buffer on a path formatted as <absolute path>:<line>:<column>, Emacs cannot find the file. It works perfectly if the column is not present but seems to interpret :<line> as part of the filename.
Example:
Imagine I get the following error:
at moxios.withMock (<absolute path>/<filename>:8:7)
Emacs recognizes the path (highlighted in my compilation buffer as follow).
at moxios.withMock ([red]<absolute path>/<filename>:8[/red]:[yellow]7[/yellow])
However, when I try to visit the link, Emacs seems to struggle with the path:line:column format.
I get prompted with an interractive buffer:
Find this error in (default <filename>:8): <an absolute path which is not the path of the file>/
./
../
[...]
Do you have any idea how to make sure Emacs recognizes the <filename>:<line>:<column> format correctly?
Related
Adding copy pasted absolute paths into VS Code editor such as "C:\Users\username\Desktop\filename.txt" does not work, it throws the 'The system cannot find the file specified.' error.
But instead "C:\\Users\\username\\Desktop\\filename.txt" does work. How can I make it read the copy pasted absolute path so I don't have to modify it every time?
I was trying to get yapf configured for a Python project, and so I created a .style.yapf file, which VSCode did not recognize by its extension. I thought it was in TOML format, but when I changed the file association for .style.yapf to TOML, the parser shows an error (because values aren't quoted). So I tried changing the name of the file (not really a solution, because the tool is looking for a file with that name), and found that if I change it to a name ending in .cfg, VSCode seems to parse and highlight it appropriately. Unfortunately, there doesn't seem to be anything in the list of file associations corresponding to this file mode.
I expected to find a cfg mode in the file associations list, but there wasn't an entry with that name, nor was there an entry that used the same gear icon displayed next to the open file name in its tab (which I have been assuming is an indicator of the mode that VSCode is using to display and format the file).
Is there any way for me to get VSCode to tell me what the current file mode is for an open file? Or give me a list of the default associations?
I'm more interested in understanding the tools in general than solving the one minor annoyance that sparked the question, but I'll settle for a solution to that problem, too.
Edit: Here's the content of the .style.yapf file in question:
[style]
based_on_style = google
If I rename the file to .yapf.cfg (or any other name ending in .cfg, I believe), it gets handled properly, but all of the file associations I've tried (including ini, Properties, and TOML) indicate an error because there are no quotes around google.
I'm using emacs 25.3.1 with Org mode version 9.1.9. I'm trying to ensure that the comments produced by the org-babel-tangle function and preceding the source block content in the tangled file contain the relative path to the original org file and not the absolute path. Although the documentation states that the org-babel-tangle-use-relative-file-links variable, which defaults to t, ensures this precise behaviour, I keep getting the absolute path in the links (e.g. # [[file:~/Projects/my_project/my_project.org::*setup.py][setup.py:1]]).
I tried setting this variable to nil but it didn't change anything. When manually changing the links with the relative path ( e.g. # [[file:../my_project.org::*setup.py][setup.py:1]]), invoking org-babel-detangle to integrate changes to the tangled file back to the original org file actually worked (with an additional interaction in the mini-buffer: No match - create this as a new heading? (y or n)).
Is there any way to get this relative path automatically from org-babel-tangle or is this a bug? This is a fairly important question if you think about projects with several contributors to a version controlled repository where
not everybody uses org-mode
obviously not everybody's working copy is located at the same absolute path on its own computer.
I've noticed a strange behavior of Matlab when accessing files. Say I have a path to a file like this:
path = '~/data/file'
If I run exist(path), the result is 2, i.e. the file exists. If I run
textread(path, '%s')
then I get an error message
Error using dataread
File not found or permission denied.
However, if I expand the tilde and run textread, it works fine:
path2 = '/home/username/data/file'
textread(path2, '%s')
Can you explain this behavior?
Yes, exist understands relative paths (as identified by the tilde), whereas textread does not.
Note that textscan is now the preferred way of reading data from a file - this accepts file identifiers so will work with relative paths.
If this is not an option, a good GetFullPath function can be found here.
When I open the file zenburn-theme.el from github.com/bbatsov/zenburn-emacs.git in Emacs 24.3, I get the following warning in a buffer:
Why? Also, why would it not be safe to open (not load or run) a file?
A file, even if opened and not loaded, might contain some configuration values to be applied. Some of them are considered unsafe and Emacs asks you about them unless told otherwise. See Local Variables in Files for details.