I need to run scl enable devtoolset-7 bash before I compile with M-x compile.
How too doo this in emacs. Thank you.
Add it before the command you're passing to M-x compile. For example, if you're normally using make with M-x compile, try:
scl enable devtoolset-7 bash && make
Related
On Windows 10.
I did this:
pip install autopep8
and in vscode user settings I have
"python.linting.pep8Enabled": true,
"python.formatting.provider": "autopep8",
When I run format document, or explicitly invoke autopep8 from the command pallette, the error is:
Error: Command failed: autopep8 c:\tca-backend\lambdas\utilities\NetMenuAPIUtil.py
'autopep8' is not recognized as an internal or external command,
operable program or batch file.
Clearly, vsc wants to invoke autopep8.exe but there is no exe. Just py. So I created a autopep8.bat which works when I test from the command line, but when run from vsc, it inserts the content of the batch file into the top of the document. (Yes, that's as strange as it sounds.)
All other Python-related operations work ok, including the ESLint extension.
VS code Python extension supports source code formatting using either autopep8 (the default), black, or yapf so you don't need to install python formatting tools by yourself.
The way I use formatting is to set a shortcut in vs code.
Go to File -> Preferences -> Keyboard Shortcuts, then search format. Set the shortcut as ctrl + shift + p which is the same as the shortcut of autopep8 or you can set any combination you prefer.
Click the shortcuts in your .py files then you will get the formatted code.
Ref: https://code.visualstudio.com/docs/python/editing
Since you are using VSCode on Windows, please click on the Terminal Section and type
pip install pep8
This will start installing pep8.
for me, the autopep8 doc installation isn't enough, still seeing this error, I had to follow this https://pip.pypa.io/en/latest/user_guide/#user-installs. it works like a charm.
I'm on windows so I used this:
py -m pip install –-user autopep8
You need to add this as a PATH under System Environment Variables:
c:\users\<username>\appdata\roaming\python\python39\site-packages
Then close and restart VS Code. Type autopep8 at a terminal prompt and you should see this:
C:\Foobar>autopep8
usage: autopep8 [-h] [--version] [-v] [-d] [-i] [--global-config filename] [--ignore-local-config] [-r] [-j n] [-p n] [-a] [--experimental] [--exclude globs] [--list-fixes] [--ignore errors] [--select errors]
[--max-line-length n] [--line-range line line] [--hang-closing] [--exit-code]
[files ...]
autopep8: error: incorrect number of arguments
I encountered an error message while trying to do same and below was what I did (in my terminal):
Install or upgrade pep8:
pip install --upgrade autopep8
Navigate to the folder/directory where the file you need formatted is, then use the following command:
autopep8 --in-place file_name
There you have it!
I encountered this same error running WSL: Ubuntu-20.04, well this was my solution:
$ pip --version
This will make you verify that you have python3 pip installed correctly in your distribution, if that's not the case, it will pop up an error:
Command 'pip' not found, but can be installed with:
apt install python3-pip
Just run the indicated command to installed it and then after that, run:
$ python3 -m pip install autopep8
Now everything should be working as it should, including the formatting autpep8.
I have a 64-bit NASM exe written as a console app. I want to debug it using gdb in Emacs under Cygwin. I compiled and assembled using the following command strings:
nasm -f elf64 Prime_Number_EXE.asm
gcc -g -l cygwin Prime_Number_EXE.o -o Prime_Number_EXE.exe
After compiling and linking, I go to cygwin and start emacs. I open the nasm source file. Then I start gdb and switch to gdb-many-windows mode. But the source file showing in the source window is not my nasm code; it's a special C program that Cygwin inserts that says
/* libcmain.c
This file is part of Cygwin.
/* Allow apps which don't have a main to work, as long as they define WinMain */
So it doesn't show the nasm source code, and when I step through it, it will not stop at any breakpoints in the nasm source code.
How can I solve this?
Thanks for any help.
elf64 is NOT the structure of windows/cygwin program that is COFF,
You can not run elf64 on windows.
You are looking at the STUB gcc added to all the program.
For what you are trying to do you need a Unix/Linux system or
change to COFF structure.
In Emacs/Cider, how do I correctly add some clojure libraries that I want to try?
If I do it from the shell, I just start
$ lein try clj-time
But how do I do that from the Emacs/Cider?
The easiest way is to run lein try clj-time on the command line and then connect to that repl from emacs with M-x cider (use localhost and the port number printed to the console when you started lein-try).
I installed SML on Ubuntu 12.04.
Here is more info:
nazar_art#nazar-desctop:~$ sml -version
Standard ML of New Jersey v110.75 [built: Mon Sep 2 23:36:16 2013]
And added to emacs this package:
M x list-packages + Enter
find sml-mode and install by mouse click.
But when I tried write easy .sml file I want to open sml console at emacs.
I press C c + C s => I see SML command: sml and press Enter.
And see this message:
Searching for program: no such file or directory
Instead of opening sml console.
I couldn't figure out why this happen?
How to solve this trouble?
Update:
Here is my which sml:
/usr/local/SML/bin/sml
and emacs version - GNU Emacs 24.3.1
Installed from here but only for emacs24, not for emacs-snapshot.
Option 4: Eval the following with: C-M-: (setq exec-path (cons "/usr/local/SML/bin" exec-path)) return/enter or put it into $home/.emacs to make it persist over all sessions.
Your problem is that the sml executable isn't on the PATH that Emacs sees.
And you can launch sml from bash probably because you modify path
in ~/.bashrc.
Option 1: modify PATH
In ~/.profile (you'll need to log out once):
export PATH=$PATH:/usr/local/SML/bin/
Option 2: create link
sudo ln -s /usr/local/SML/bin/sml /usr/bin/sml
Option 3: apt installs for me sml to /usr/bin/ (Emacs knows this path)
sudo apt-get install smlnj
Just elaborating on the steps mentioned by the Bleeding fingers:
Step1: Launch emacs from terminal.
step2: Press ctrl+x+f.
step3: You will get something in the bottom saying "Find a file:~/" then there write "/.emacs".
step4: Paste this line "setq exec-path (cons "/usr/local/SML/bin" exec-path))" in that.
step5: Press Ctrx+x+s to save the changes and then restart the emacs.
I've recently switched over from using the Bash command prompt to Zsh on Mac OSX.
Problem I have using Zsh is that the command I would use to watch Sass files no longer works.
The script file I have is sass.sh and the content is...
#!/bin/sh
sass --style expanded --watch Assets/Styles/Sass:Assets/Styles --debug-info
exit 0
...but every time I run sh sass.sh I get the error...
/Users/<home-directory>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find sass (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/<home-directory>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/<home-directory>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb:1230:in `gem'
from /Users/<home-directory>/.rvm/gems/ruby-1.9.3-p125/bin/sass:18:in `<main>'
from /Users/<home-directory>/.rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/<home-directory>/.rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:14:in `<main>'
...and I don't know how to resolve this problem.
It looks like it just can't locate the Sass gem, but if I run gem list --local I can see sass (3.2.3, 3.2.1, 3.1.20, 3.1.17, 3.1.15) in the list of gems. BUT I do also get an error again displayed first...
Error loading RubyGems plugin "/Users/<home-directory>/.rvm/gems/ruby-1.9.3-p125/gems/rubygems-bundler-0.2.8/lib/rubygems_plugin.rb": cannot load such file -- rubygems_bundler/rubygems_bundler_installer (LoadError)
I've looked around on Google and SO and found miscellaneous references to similar issues but none that helped me and my specific issue.
Can any one tell me what I need to do to resolve this issue so I can continue to use Zsh and run my Sass script.
Well, seems the answer is very simple. When using Zsh you no longer use the sh command but the zsh command.
So instead of sh sass.sh I just needed to do zsh sass.sh