disable or suspend flymake when visiting file with merge conflicts - emacs

When opening a file with unresolved merge conflicts in it, Emacs enable smerge-mode by default along with other modes (in this case Python mode + EGlot and friends). This triggers Flymake to run as well which complains about the merge conflict headers added by the source control or diff tool.
When disabling flymake the errors naturally disappears
However, when enabling flymake again, it shows no syntax errors. Just a 'Wait'.
Maybe flymake is aware of smerge-mode or similar after it has been enabled?
Have anyone configured their Emacs in such a way to disable flymake-mode when visiting a file with merge conflics (smerge-mode) and 'heavy' modes like eglot, or do you know if flymake is smart enough to detect this?
I have experimented with some elisp to detect smerge-mode on different hooks and disable flymake accordingly, but it leaves the buffer face 'dirty/damaged' with flymakes error marks around the text.

Related

When I edit a file with EMACS I get a strange error. How do I fix this?

This is what I am doing:
Make a file or use an existing file.
Emacs filename.txt.
Type some new text into the file.
Save file.
After step 2, I receive an error after the emacs editor window pops up.
Here is the error:
2022-01-19 22:11:53.935 Emacs-x86_64-10_14[33893:994906] It's not
legal to call -layoutSubtreeIfNeeded on a view which is already being
laid out. If you are implementing the view's -layout method, you can
call -[super layout] instead. Break on void
_NSDetectedLayoutRecursion(void) to debug. This will be logged only once. This may break in the future.
I have already tried updating emacs and that didn't help, and googling didn't give me an answer. Currently, I have GNU Emacs 27.1 version.
How do I fix this error?
As far as I know you shouldn't need to "fix" the error at all and it won't cause any problems while you're actually running Emacs. In fact I'm somewhat surprised you see it at all.
I was only able to see the error (in both Emacs 27 and in pretest-28.0.90) only by running the Emacs binary (eg. ./Emacs-27.app/Contents/MacOS/Emacs) directly from a terminal, which isn't the normal way of starting Emacs on macOS. If you just run Emacs by starting it from Finder, the Dock, or via the "open" utility then you shouldn't see the error at all, and it shouldn't cause any problems.
The whole point of keyboard interaction (and emacs in particular) is that there's no need to touch the mouse. It's possible to log in (using e.g. ssh) and edit remotely, with no gui (so no way to drag and drop), and this is the 'normal' way of invoking emacs. Run 'emacs --help' from the command line to see a bunch of options. In particular see 'emacs --no-window-system' which uses a raw terminal even when a gui is available (no error message appears when it's run this way).
The gui however adds font and image support, which can be useful if you're sitting at the machine. The error message you get when you invoke 'emacs' from the command line in its default mode, with no arguments, is a diagnostic describing a bug in the mac gui implementation.
The error's still there if you start emacs through the finder; you can see that by running (e.g.)
$ open /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14
which both opens an emacs gui and a terminal window containing the program's text output.
As it says in the message, 'this may break in the future'; it's not helpful to say 'you're using it wrong.'

Emacs auto-complete for slime not allowing pop-up selection

On Emacs 24.3.50.1 I have auto-complete mode up and running (by using source code and following their setup, plus other's added suggestions). Then I installed ac-slime from ELPA-land (Version: 20131005.1126), which puts it in ~/.emacs.d/elpa/ac-slime-20131005.1126. However, the .emacs usage code doesn't seem to make any specific note of where this directory is. I suspect I don't really have ac-slime working properly as I can't choose from pop-up suggestion list with return key. Any ideas how to get it working?

How can I run a function periodically in a specific mode?

I am writing a report in LaTeX, and am using Emacs for development. Having to periodically compile manually is somewhat annoying. Is there a way to have Emacs automatically compile periodically whenever the current buffer is a LaTeX buffer?
flymake is built into Emacs, and is the classic way to do such things.
See its user-manual at: C-hig (flymake) RET
flycheck is a more recent project, with the stated aim of being "flymake done right".
Running arbitrary processes (e.g. compilation) periodically is what these libraries are all about, so either one of them suits your use-case.

How to disable mode

I was wondering if there is a way to permanently remove a major mode let's say vhdl-mode from Emacs? I have already checked " How do I turn off vhdl-mode in emacs? " but I am wondering if I want to write my own distribution how can I removed some of these modes permanently from Emacs?
-- Experimental only and so no licensing issues or etc.
You can effectively disable a mode by removing it from the auto-mode-alist variable. Once removed, the mode will never be automatically chosen by emacs but it may still be started manually. This removes vhdl-mode:
(rassq-delete-all 'vhdl-mode auto-mode-alist)
All modes are available as files. On my machine, VHDL mode is at /usr/share/emacs/23.4/lisp/progmodes/vhdl-mode.el.gz. If you delete this file, there's no way to turn that on at all. If other modes depend on functionality implemented in this mode, they will suffer too.
Also, modes might be spread across mutliple files so you might have to remove more than one.

How do I get SLIME + Emacs set up?

According to this answer, Emacs + Slime already has much advanced functionality. So how can I get syntax coloring, auto-completion, and perhaps even version control management, set up and running in my copy of Lispbox?
If it's of any help, I have installed Lispbox on Mac OS Lion.
Syntax highlighting should already be working as soon as you load a lisp file in Emacs, regardless of whether you've got SLIME installed or not. If it's not, try doing M-x font-lock-mode and see if that turns it on.
Version control isn't provided by Emacs or SLIME, but Emacs can integrate with pretty much any version control system you care to use. I recommend Mercurial or Git. Emacs should start vc-mode automatically when you open a file that is in one of the supported version control systems. The manual includes extensive documentation, do M-: (info "(emacs)Version Control") to jump right to it.
Auto-completion is more complicated. There is more than one way to skin this cat, but for Lisp SLIME's default method should be good enough. Use M-TAB to complete the symbol at point.