How can I correctly create a new file with org-roam-find-file? - org-mode

Somewhat new to emacs, org-mode, and org-roam, so I may be missing something here. I installed org-roam from MELPA and included the 'use-package' section from the documentation to my init file.
When I hit M-x and then type 'org-roam-find-file', I am prompted to enter the file name. I enter the name of a file that does not exist and the minibuffer response is:
Capture template 'd': Symbol's function definition is void: org-show-all
I tried entering the file name with and without the trailing '.org' and that didn't seem to make a difference.

Related

emacs as an external editor for other applications (Houdini, Joplin)

I am trying to use emacs as an editor with other applications which allow people to open text in an editor (Sublime in this case), save it, and see it updated in the application. For example, in Houdini, a 3D software, I can type code in an external editor (in this case, Sublime), modify, save... and see it update in the application (Houdini). When I use emacs, it doesn't work. As an example, here I am adding a line of text using Sublime in Houdini:
Once I save and close, the text is updated in Houdini, and I can continue working:
Try as I might, I can't get this to work in emacs. I am sure the file has the same name, and when I save, it confirms the right file path.
What am I missing? I have run into the same problem with an application called Joplin: Sublime works, emacs does not.
A wild guess: Emacs has different behaviour when saving files than Sublime, and Houdini gets confused by that.
When you save a file in Emacs, Emacs creates a backup of the previous contents of the file, suffixing the file name with a tilde. By default it does this by renaming the existing file to the backup name, and then writing the contents to the real filename, thereby creating a new file.
(You can observe this by running ls -i before and after: the backup file will have the inode number that the main file had previously. Note that Emacs doesn't make backups after the first save during the same editor session, so you might need to restart Emacs or kill the buffer with C-x k to see this.)
I suspect that Houdini keeps the file open while Emacs is editing it, and so when you save the file from Emacs, the file that Houdini has open is actually the backup file.
You can configure Emacs to make backups by copying instead of renaming by setting the variable backup-by-copying to t. Add this to your ~/.emacs file (creating it if it doesn't exist):
(setq backup-by-copying t)

telling Icicles to ignore matches when creating a file

I use Icicles for auto-completion when for example finding a file in emacs. However sometimes I need to create a file with a particular name filename.tex in a directory and the autcomplete automatically finds a file with a similar name filanem_another.tex in another directory (I'm guessing from history).
This is annoying as it prevents making new files using C-x C-f and instead finds a similar file.
How can I ignore Icicles's suggestions?
Please try to provide a step-by-step recipe of what you do. So far, I don't recognize the behavior you describe. What do you mean by "autocompletion" and "Icicles's suggestions", for example?
Also mention whether you have any
Icicles customizations. Best is a recipe that starts from emacs -Q (no init file), saying exactly what to do to reproduce the problem. And please mention your emacs-version.
By default, in Icicle mode C-x C-f is bound to icicle-file. You should be able to enter any file name you like at the prompt; you need not choose any of the completion candidates, and you need not even complete (TAB or S-TAB). (And completion does not complete against the history.) IOW, in these respects C-x C-f should behave the same as in vanilla Emacs.
[To those tempted to complain that this is a comment and not a real answer: I intend to answer the question here, when I get some more info about it.]

Emacs: Can't activate input method

My default input method has always been configured this way:
(setq default-input-method "russian-computer")
Something broke, and all I get is this message (on top of the execution stack, if I'm interpreting it right) as soon as I press C-\:
activate-input-method: Can't activate input method `russian-computer'
It used to work without a hitch. There has been no intervention that I'm aware of; I'd like to get some clues.
Emacs loads the input-methods it knows from a directory called "leim" (Library of Emacs Input Methods). The location of the code to load should be something like
/usr/share/emacs/<version>/leim/leim-list.el
(For the exact location, search for an entry containing the word "leim" in your load-path variable by typing C-h v load-path.)
If you inspect that file, you should see an entry
(register-input-method
"russian-computer" "Russian" 'quail-use-package
"RU" "ЙЦУКЕН Russian computer layout"
"quail/cyrillic")
which refers to a subdirectory of the "leim" directory called "quail".
Make sure that both the file leim-list.el and the sub-directory quail exist on your system. The quail directory is distributed separately from the Emacs source code, so if you installed from source, make sure you included the leim-list package. See here (scroll to bottom):
http://ftp.gnu.org/pub/gnu/emacs/
If the leim directory is empty, you might consider re-installing emacs.

How to make a link to external file line in Emacs org-mode

I have 2 files:
php file with code
org file with docs
How to create a link to a line in php file from org file? So clicking it will move the cursor to the appropriate line in php file.
Use this notation in the org mode to create a link:
[[/path/to/file.php::line][string-to-display]]
If you want the file name to be displayed, use just
[[/path/to/file.php::line]]
See Hyperlinks in the Org mode Info page for details and other ways to specify links.
If I understand the question right you can do it automatically with two org-mode commands:
Move the point to a line in a php file and M-x org-store-link.
Go to an org file and C-c C-l or M-x org-insert-link and follow the instructions in the minibuffer.
You are done, click the link or C-c C-o when the point is on it to open the link.
I have org-store-link on C-c l and org-insert-link on the default C-c C-l. This makes the process very convenient and fast to execute.
Have fun with org-mode.

What is the correct path to the C source files for Emacs?

So, way back in January, I went here:
http://emacsformacosx.com/
I downloaded Emacs and have been using it on my Mac and I like it. I've started trying to get into Elisp programming. To learn more, I'd like to look up some functions. So for instance I do:
C-h f
and then type "scroll-down"
This gives me the following text:
>scroll-down is an interactive built-in function in `window.c'.
>
>It is bound to <kp-prior>, <prior>, C-1, C-x C-1, M-v.
>
>(scroll-down &optional ARG)
>
>Scroll text of selected window down ARG lines.
>If ARG is omitted or nil, scroll down by a near full screen.
>A near full screen is `next-screen-context-lines' less than a full screen.
>Negative ARG means scroll upward.
>If ARG is the atom `-', scroll upward by nearly full screen.
>When calling from a program, supply as argument a number, nil, or `-'.
And the text "window.c" is a link. So I click on the link and I get:
find-function-C-source: The C source file window.c is not available
I'm getting this error a lot while doing a lot of different things. Where do I find the right path, and how do I tell Emacs what that path is?
I did just recently install some ELPA packages, so maybe one of them is causing some chaos?
The variable source-directory will point to the location where the C sources are. If you have a separately downloaded copy, you'll have to point this variable to that directory.
Most packagers don't include the sources, or split them off into a separate package. Install the sources (and maybe tweak an init script to tell Emacs where you put them, if it's not the default location. The pertinent variable is find-function-C-source-directory).
If you didn't manually build Emacs from the source code and patch the C source code, value of source-directory or find-function-C-source-directory would be wrong.
You can manually download Emacs source code, unpack it somewhere and set above two variables accordingly like following
(setq source-directory "/path/to/your-emacs-repo")
;; OR
(setq find-function-C-source-directory "/path/to/your-emacs-repo/src")
GNU Emacs source code and development is hosted on savannah.gnu.org. You can find all the tags here and download the one that matches your M-x emacs-version.