Our work area start with /proj/. On trying to view any directory deep inside /proj , the emacs throws up this error:
ERROR: Opening input file: No such file or directory, /proj/.dir-locals.el
This is 'GNU Emacs 24.0.93.1' compiled from emacs-24.0.93.tar.gz 29-Jan-2012
So two questions:
1. What is the /proj special handling that emacs has. May be it's some nice feature !
2. How can i suppress the /proj special magic for my case ?
WORK AROUND FOUND
(set-variable 'enable-local-variables ())
Related
I am a hardcore vim user. With the introduction of evil mode and spacemacs, I am transitioning over to emacs from vim. I often edit my code in a dev server (for reasons that I cannot explain), and I have to run my editor in terminal mode. One thing, I am missing in Emacs (that is there in vim) is a gutter to display useful information like compile/lint errors, while coding. Emacs does have a fringe mode for GUI for this but not for terminals. Is there a particular reason for avoiding fringe mode in terminal in emacs?
My requirement is to view all the errors in one column (I am using flycheck), so that it is easy to glance through the code to find the lines that has errors. flycheck has three ways to highlight error (line/column/symbol). I would like the symbol in the line to be highlighted, but at the same time, I would like to see a column either on the left or right side of the code, that marks lines that has errors/warnings with some symbol. Flycheck does this when fringe mode is enabled, but there is no fringe mode for terminals. Is there a way to get this in terminals?
I think that you should use the function M-x flycheck-list-errorsthen you can see all the flycheck errors in a separate buffer:
I'm reading a ruby file that I use rubocop for lint error. If I use rubocop directly on terminal I get this:
$ cat dirty.rb
class Dirty
# This method smells of :reek:NestedIterators but ignores them
def awful(x, y, offset = 0, log = false)
puts #screen.title
#screen = widgets.map {|w| w.each {|key| key += 3}}
puts #screen.contents
end
end
if I get the errors with rubocop:
$ rubocop dirty.rb
Inspecting 1 file
W
Offenses:
dirty.rb:1:1: C: Style/Documentation: Missing top-level class documentation comment.
class Dirty
^^^^^
dirty.rb:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
class Dirty
^
...
...
...
1 file inspected, 13 offenses detected
Which is the same as in emacs:
Then I can check all the offenses with M-x flycheck-list-errors in a separate buffer:
This is a feature or function of flycheck, so you can use this to any code, that flycheck is getting the errors for you
I am trying to use flymake in emacs for my .tex file editing.
I've got it all up and running up until I type in an unbalanced brace { or }. When flymake kicks off, it comes back with the error:
Flymake: Configuration error has occurred while running (pdflatex -file-line-error -draftmode -interaction=nonstopmode /home/matt/test_flymake.tex). Flymake will be switched OFF.
For completeness, here is the relevant part of my .emacs file:
(defun flymake-get-tex-args (file-name)
(list "pdflatex"
(list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name)))
Looking at the flymake manual gives a hint of what is happening:
CFGERR : Syntax check process returned nonzero exit code, but no errors/warnings were reported. This indicates a possible configuration error (for example, no suitable error message patterns for the syntax check tool).
So, digging into the log (flymake-log-value = 3) I find that the issue is with running pdflatex in that the parser returns a non-zero exit code, but doesn't generate something that flymake recognizes as an error. Specifically:
parsed 'Runaway argument?', no line-err-info
parsed '{Conclusions \bibliographystyle {plain} \bibliography {ma\ETC.', no line-err-info
parsed '! File ended while scanning use of \#xdblarg.', no line-err-info
parsed '<inserted text> ', no line-err-info
parsed ' \par ', no line-err-info
parsed '<*> /home/matt/test_flymake.tex', no line-err-info
parsed ' ', no line-err-info
parsed '! Emergency stop.', no line-err-info
parsed '<*> /home/matt/test_flymake.tex', no line-err-info
parsed ' ', no line-err-info
parsed '! ==> Fatal error occurred, no output PDF file produced!', no line-err-info
So, pdflatex gets mad about my "runaway argument" but doesn't generate something that flymake recognizes as an error. Digging into the flymake.el file shows that flymake-err-line-patterns has this pattern in it:
("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1)
So... the final issue seems to be that flymake doesn't recognize Runaway argument? as an error message.
Now, my question is: Am I missing something? I can't be the first person to run into this problem but I was unable to find anything about it. I find it hard to believe that everyone just builds a custom solution to modify the error pattern, especially since I'm not doing anything unusual and am just trying to get this to work out of the box.
In case it matters, I am using emacs 24.3 on Ubuntu 12.04 and running pdflatex (pdftex) 2012.
What am I missing? Thanks all for any suggestions you can provide.
Well, I'm guessing 13 views in 3 days means it's unlikely I'll get an answer, so here is what ended up working for me...
Like most emacs issues, this can be fixed by editing your .emacs file. Add this block to your file:
(add-to-list
`flymake-err-line-patterns
'("Runaway argument?" nil nil nil)) ; fixes unbalanced braces in LaTeX files
and this should fix the issue for latex and pdflatex.
Note that (pdf)latex doesn't list give a line number when this error is produced (which is what the nil nil nil represents), so if this happens then flymake will tell you that the error is on the first line of your .tex file.
M-C-f (forward-sexp) and M-C-b (backward-sexp) will skip over balanced parentheses, letting you search for unmatched ones. source
Just for completeness, here is how flymake is checking my .tex files:
(defun flymake-get-tex-args (file-name)
(list "pdflatex"
(list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name)))
If your syntax checker is different, or produces a different error message, then swap out the "Runaway argument?" text with your checker's error message.
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.
i get the following error when trying to open a second instance of emacs:
File error: "Cannot open load file" , "cua"
I guess I don't HAVE to open another instance of emacs (that is the beauty after all), I was just trying to keep some things separated (specifically work - like code and debug - and play - like news).
Would there be any reason I could not open two instances of emacs if I use cua.el?
solved the problem, so i figured i should post in case anyone else is seeing the same thing.
it turns out, it has NOTHING to do with a second instance of emacs. i cant even open a SINGLE instance (i just had been running one instance since before i saw the problem i guess... only noticed this time because of a shutdown).
i changed the following and the problem disappeared. in my .emacs file:
(require 'cua)
(CUA-mode t)
TO
(load-file "cua.el") ;; or if you compiled it (load-file "cua.elc")
(CUA-mode t)
this did the trick for me... although i am not sure why.
thanks to all who commented.
PS - i am using emacs 21.3.1, so i do have an older version. if any readers have the option, justinhj's comment above (about upgrading) is probably the easiest answer. CUA is built into version 22 and above i believe.
I'm having a problem with an Emacs lisp package that I pulled down from the ubuntu distribution. The package is JDEE, and it complains of Args out of range: "63", 0, 4 in the mini buffer and the *Messages* buffer whenever I open a file. This bug appears to have been reported last September but no action has been taken. I'm not an emacs newbie, having written some Elisp code myself, but I've never attempted to debug anything like this. I would like to stop the file load in a debugger when this error happens to at least get an idea of where the problem is coming from. I've read section 18.1.1 of the Elisp manual on "Entering the debugger on error" but trying to load the file after playing with various combinations of values for debug-on-error, debug-ignored-errors, and debug-on-signal appears to have no effect. Has anybody got any suggestions for my next step?
If debug-on-error isn't working, I'd start with the source itself. Find the keybinding/event that is causing the problem, and locate the function.
C-h k <keystrokes>
M-x find-function <function-name-from-above>
Now, once you are at the source
M-x edebug-defun
And the next time you hit the key, you should be able to step through the program. At that point, you can see which portion causes an error - and drill down that way.
You can also try setting the variable 'stack-trace-on-error to see if you can find the culprit (though 'debug-on-error usually works for me, not sure why it doesn't for you).
As a last resort (if edebug-defun doesn't work), you can redefine the routine with a call to (debug) in it, sort of does the same.
I suppose JDEE is somehow inhibiting debug-on-error. Perhaps grep through its files for the error message "Args out of range". While debugging, make sure to load the uncompiled .el files, not the byte-compiled .elc files (you will notice it in the debugger if you are running byte-compiled code) by entering commands like (load "foo.el") instead of (load "foo").
I got the same error when using find-grep after accidentally redefining (current-time-string) in one of my own scripts.
Using the M-x edebug-defun tip posted above I managed to find the issue when I stepped through the code giving the error seeing the call to (current-time-string).
Not sure how helpful this is in your case.