Hack: automatically installing the development version of org on new machine
This was useful for a few people I work with, so I'm posting it here for posterity. My job involves switching computers pretty frequently, and so I have everything set up with use-package
's :ensure
keyword so I can just clone my init.el
to a new machine, and Emacs will download all my packages automatically. In general, this works great; the exception is org.
Any kind of :ensure
form doesn't work with installing the latest revision of org (afaik), because the pre-installed version shadows it; use-package
uses package-installed-p
to decide if a package isn't installed and needs to be downloaded, and since org
is always installed, no download will ever trigger. This is fine, up until you want something from a later version of org.
A while back, I reported a bug that interfered with my org-agenda
use, and it was fixed on the development version of org, but not in any release. That's fine; M-x package-vc-install org
and I'm off to the races. However! Every time I switched computers, I always forget to do this, and after a few hours-to-days of working with org, I'd run into the bug and grumble grumble grumble
Turns out, you can sidestep the package-installed-p
problem with the built-in org by installing org under a different name! I was kind of suspicious of this, but it seems to work alright so far:
(use-package org-git
:vc (:url "https://git.savannah.gnu.org/git/emacs/org-mode.git"
:rev :newest
:lisp-dir "lisp"
:make "autoloads"))
The :make "autoloads"
is necessary; depending on architecture (I think?) I sometimes also need to go in and run make compile
in the org-git ELPA directory to avoid getting a mixed installation warning. I'd include that as part of the use-package
invocation just to cover my bases, but it looks like use-package
only accepts a string here, unlike the package-vc-install
it's trying to emulate?
But yeah, surprisingly, installing org under a differently named directory hasn't given me much trouble so far; really the only thing is that I can't use use-package
's :config
keyword for this block, since it expands to use eval-after-load 'org-git
, and the actual feature provided by the package is still org
, so the :config
block will never run.
Kind of a hack, but a few other Emacs users at my job found it helpful. If anyone knows of a cleaner way to do this (install the latest version of org automatically when on a fresh machine), let me know!
https://redd.it/1ehpwe3
@r_emacs
\`STARTED\` tag for active projects, this is ok from a convenience point of view. But the 'Backlog' is trickier. I see only two non ideal solutions:
* not adding any sub tasks for projects in the backlog,
* using a BACKLOG tag (about which I do not have a good feeling).
(EDIT: After trying this out, I realized it does not work for lower level tasks if the STARTED tag is inherited).
The main issue here I think is that I am not finding a way to differentiate between different types of dependencies. I have just found while editing this post that there exists an org-mode gantt chart module, I will read about it to see how they are handling it.
If anyone sees or is aware of a better way to achieve this, I would greatly appreciate it. I am looking fr something convenient, and not too error prone.
Thanks in advance for your help.
\[1\]: [https://www.projectmanager.com/blog/gantt-chart-dependencies](https://www.projectmanager.com/blog/gantt-chart-dependencies)
https://redd.it/1ehoveg
@r_emacs
(use-package yasnippet
:ensure t
:config
(setq yas-snippet-dirs '("~/.emacs.d/snippets/"))
(setq yas-triggers-in-field t)
(define-key yas-minor-mode-map (kbd "<tab>") nil)
(define-key yas-minor-mode-map (kbd "TAB") nil)
(define-key yas-minor-mode-map (kbd "C-c y") #'yas-expand)
(yas-global-mode 1))
Thank you before, for all helpful answers.
https://redd.it/1ehgxi3
@r_emacs
How to generate PDFs with clickable links/TOC from texinfo files in doc directory of Emacs' source repo
Whenever I build a new version of Emacs from source, I generate PDFs from the texinfo files located in the source repository's doc
directory to have up-to-date documentation that I can easily read from tablet or smartphone. I find it more convenient than the HTML versions.
This is done by running make pdf
.
However, these PDFs don't have clickable links or clickable TOC.
Only the major manuals released here, like the GNU Emacs Manual, the GNU Emacs Lisp Reference Manual and An Introduction to Programming in Emacs Lisp seem to offer that functionality.
Any idea how to get it done for all the other manuals?
https://redd.it/1ehdsi4
@r_emacs
Getting the Windows build shipped with libgccjit-0.dll work
During the closing of bug#71801 a Windows build was uploaded to the GNU FTP which was shipped with libgccjit-0.dll
. If that DLL is present, then Emacs will try to native compile the 3rd party packages. If it fails to do so then it will throw an error, and it will stop loading the 3rd party packages. One user complained on the mailing list about this, and a new release was uploaded to the GNU FTP without this DLL.
The issue is that the Windows package managers already downloaded and hashed the build with libgccjit-0.dll the first time it was uploaded. Winget had a hash mismatch, but should be fixed since then. Chocolatey does not know about the new file, and it will download the build with libgccjit-0.dll in it.
My personal issue is that the Windows package manager used by my employer also has the build which is shipped with libgccjit-0.dll
, and I do not have administrator privileges on my work laptop to simply remove that file. So I either need to get this build work or I need to do some shadow IT stuff until 29.5 or 30 is released.
So my challenge to Windows users is the following:
- Install the Chocolatey package manager
- Do choco install emacs.portable --version 29.4
- Check that the libgccjit-0.dll is present (C:\tools\emacs\bin\libgccjit-0.dll
by default)
- Get it to work so that 3rd party packages can be used. They do not need to get compiled, a working Emacs without any native compilation errors is fine.
Installing MSYS2 and getting the mingw-w64-x86_64-binutils
and mingw-w64-x86_64-gcc
packages got me to the following error message, but I cannot get any further. I cannot force ld
to find these otherwise existing object files:
ld: cannot find dllcrt2.o: No such file or directory
ld: cannot find crtbegin.o: No such file or directory
ld: cannot find crtend.o: No such file or directory
Custom eshell prompt and previous shell output deletable
I am excited to start using Eshell after reading about it on Mastering Emacs. Since I wasn't happy with default prompt, I installed the eshell-prompt-extras package like the article recommended. However, if I continue pressing backspace, my prompt and previous shell output can be deleted, which is not the correct behavior.
I understand eshell-prompt-regexp has to match the prompt and I think it does because C-a takes me to the correct place after the prompt. Since Eshell doesn't use comint-mode, I don't know of a function to make the prompt read-only. Is there any way to achieve the desired behavior?
My Eshell prompt customization settings are copied and pasted from https://github.com/zwild/eshell-prompt-extras:
(with-eval-after-load "esh-opt"
(autoload 'epe-theme-lambda "eshell-prompt-extras")
(setq eshell-highlight-prompt nil
eshell-prompt-function 'epe-theme-lambda))
https://redd.it/1eh08nw
@r_emacs
Where is this documentation coming from?
I recently started playing around with stuff to figure out how loading libraries/autoloading works (so this isn't for any practical purpose, just didactic), and I'm at the end of my rope trying to figure out where some documentation is coming from. For some reason, no matter what source files I change, inspecting autoloads with `symbol-function` returns documentation that seemingly isn't on my system anymore.
Here's the setup: start emacs with `emacs -Q`, and then immediately run:
(setq help-enable-completion-autoload nil
help-enable-autoload nil)
If you do `C-h f org-agenda`, you get the documentation for org-agenda, but if you then inspect `C-h v load-history`, you can see that nothing org-related has been loaded yet. Evaluating `(symbol-function 'org-agenda)` reveals how the documentation can exist without the file being loaded yet: the function definition is currently an autoload call, which had the documentation passed in as a parameter. On my system, it looks like the place it gets this autoload call is at `/usr/share/emacs/31.0.50/lisp/loaddefs.elc`. So, cool, if we change that there, the documentation we see before org is loaded should change to match...right?
Edit the `loaddefs.el` file, and change the org-agenda autoload to:
(autoload 'org-agenda "org-agenda" "wow, writing documentation is fun!" t)
...then byte-compile it. If you do `emacs -Q` and then `(symbol-function 'org-agenda)`, however, you should still see...the exact same thing! What?! The only autoloads/loaddefs file in `load-history` at this point are either common lisp, theme, and the file we changed. Where is this original documentation coming from?
sudo find / -regex ".*\.elc?" -exec grep -Hri 'dispatch agenda' {} \;
Okay, the only other place this string appears is in
/usr/share/emacs/31.0.50/lisp/loaddefs.el[c]
/usr/share/emacs/31.0.50/lisp/ldefs-boot.el
/usr/share/emacs/31.0.50/lisp/org/org-agenda.el[c]
...so make sure to change the docstring in all of those as well (surely *one* of them will have an effect) and byte-compile `loaddefs.el` and `org-agenda.el`. For good measure, I found an eln `loaddefs` file in `/usr/lib/emacs/31.0.50/native-lisp/31.0.50-7bc95ebe` and deleted that too. Still no dice. The documentation appears unaltered from how it was originally. The info page description for `loaddefs-generate` (found here `(info "(elisp) Autoload")`) mentions that `loaddefs.el` is loaded when Emacs is built, which suggests these autoloads might be written into the binary? But then, why isn't the documentation updated by the time the edited `/usr/share/emacs/31.0.50/lisp/loaddefs.elc` is in `load-history`?
https://redd.it/1egsa9g
@r_emacs
VS code like treemacs
I was wondering if there's a plugin which can do similar job like vs code file explorer where it automatically detects the depth of a file and shortens it to a single level.For example
if we have
com/example/activityit won't show the tree but it will shorten it to one level.
Difficulties working with narrowing buffers and indirect buffers
Given a frame with various windows in it, I want to be able to write text into them without them being associated with a file, and I don't want to spam buffers into the buffer list. I was thinking that having a single "log buffer" into which the messages would be written would prevent buffer spamming, and then I could just show the operator a different particular message in each window. Playing around with different things, trying to use indirect buffers with some sort of region narrowing seemed to be a good possible option.
I didn't have much luck with this though:
(let ((org-dates
(list "2020-04-05" "2023-08-02" "2021-09-08" "2019-08-04")))
(delete-other-windows)
(split-window-right)
(split-window-right)
(split-window-right)
(balance-windows)
(dolist (earlier-journal-entry org-dates)
(pop-to-buffer
(make-indirect-buffer
(get-buffer-create
"Org Roam Daily Reflection Log")
(generate-new-buffer-name "indirect")))
(let ((start (point))
(org-msg (concat "\n\n No daily journal entry for "
earlier-journal-entry ".")))
(insert org-msg)
;; (org-mode)
(narrow-to-region start (point)))))
In particular, the narrowing doesn't seem to work right. How should I be doing narrowing?
(If this is at all the right sort of approach to this task.)
https://redd.it/1egb37f
@r_emacs
'lsp-ui)`
`(add-hook 'lsp-mode-hook 'lsp-ui-mode)`
`;; Company mode`
`(require 'company)`
`(add-hook 'after-init-hook 'global-company-mode)`
`;; LSP integration with Company`
`(setq company-backends '(company-capf))`
`;; Yasnippet`
`(require 'yasnippet)`
`(require 'yasnippet-snippets)`
`(setq yas-snippet-dirs '(`
`"~/.emacs.d/snippets"`
`))`
`(yas-global-mode 1)`
`;; Optional: LSP-Treemacs integration`
`(require 'lsp-treemacs)`
`(lsp-treemacs-sync-mode 1)`
`;; HTML boilerplate snippet in Emmet mode`
`(add-hook 'web-mode-hook`
`(lambda ()`
`(setq emmet-expand-jsx-className? t)`
`(local-set-key (kbd "C-j") 'emmet-expand-line)))`
`;; Tide setup for TypeScript`
`(require 'tide)`
`(defun setup-tide-mode ()`
`"Setup function for tide mode."`
`(interactive)`
`(tide-setup)`
`(flycheck-mode +1)`
`(setq flycheck-check-syntax-automatically '(save mode-enabled))`
`(eldoc-mode +1)`
`(tide-hl-identifier-mode +1)`
`(company-mode +1))`
`;; aligns annotation to the right hand side`
`(setq company-tooltip-align-annotations t)`
`;; formats the buffer before saving`
`(add-hook 'before-save-hook 'tide-format-before-save)`
`;; setup javascript tide`
`(add-hook 'js-mode-hook #'setup-tide-mode)`
`(add-hook 'js2-mode-hook #'setup-tide-mode)`
`(add-hook 'web-mode-hook`
`(lambda ()`
`(when (or (string-equal "tsx" (file-name-extension buffer-file-name))`
`(string-equal "jsx" (file-name-extension buffer-file-name)))`
`(setup-tide-mode))))`
`;; setup typescript tide`
`(add-hook 'typescript-mode-hook #'setup-tide-mode)`
`(add-hook 'web-mode-hook`
`(lambda ()`
`(when (string-equal "ts" (file-name-extension buffer-file-name))`
`(setup-tide-mode))))`
`;; prettier-js`
`(require 'prettier)`
`(add-hook 'web-mode-hook #'prettier-mode)`
`(add-hook 'js2-mode-hook #'prettier-mode)`
`(add-hook 'typescript-mode-hook #'prettier-mode)`
`;; multi cursor (multi line editing)`
`(require 'multiple-cursors)`
`(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)`
`;; Auto-refresh dired on file change`
`(add-hook 'dired-mode-hook 'auto-revert-mode)`
`;; org mode`
`(require 'org)`
`(setq org-hide-emphasis-markers t)`
`;; list markers`
`(font-lock-add-keywords`
`'org-mode`
`'(("^ *\\([-]\\) "`
`(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))`
`(add-hook 'org-mode-hook #'visual-line-mode)`
https://redd.it/1efpfw2
@r_emacs
Why are some buffers highlighted in consult-buffer (Vertico + Marginalia)?
https://redd.it/1eg59he
@r_emacs
Is the GNU C Reference Manual available in Info format?
I'm referring to this manual -- not The GNU C Library Reference Manual, which does have an Info version. I'm guessing there are better, more up-to-date documents out there, but I just want to read this at the moment. I'm sure I can convert it manually, but just want to check that it isn't listed as something odd in the existing set of Info pages.
https://redd.it/1efl89a
@r_emacs
git.savannah.gnu.org is down
fatal: unable to access 'https://git.savannah.gnu.org/git/emacs/nongnu.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to git.savannah.gnu.org:443
[Return code: 128]
Magit over tramp halts
I'm not new to emacs but I'll confess I look under the hood much less than I think I should, so bear with me if I'm not giving enough details yet.
I'm connecting to a remote machine via SSH and Tramp, and I can edit files normally. But when I try to stage a file, emacs just hangs until I press Ctrl+G. If I stage through the command line and try to commit, *Messages* displays "condition-case: Wrong number of arguments: transient--emergency-exit, 1" and nothing happens in Magit.
How do I start debugging this one?
https://redd.it/1ef8v3p
@r_emacs
docker container name with slash
If docker name has /
in name, e.g. localhost/foo
.
With find-file
(C-x C-f /docker:localhost/foo:
), emacs doesn't try to connect to localhost/foo
instead it says that container with my machine name doesn't exist.
https://redd.it/1ehpzxg
@r_emacs
Anyone knows how to implement finish-to-start task dependency in org-mode ?
I have been scratching my head for a while now about how to handle task dependencies in Orgmode.
First off, I am aware of \`org-depend\` and \`org-edna\` as well as the \`ORDERED\` property. I am trying to find a way to make them work for a common, but specific type of dependency.
As defined in this \[blog page\]\[1\] from the 'projectmanager.com' website, a Gantt chart will define 4 types of dependency. I find two of them essential in my task management workflow.
The first one, and most commn I think, is the \*\*finish-to-finish dependency\*\* which is the one I believe is covered by org-mode; this is also the easiest to enforce (again imho) programatically with orgmode tools. Task A cannot be marked as \`DONE\` before task B and C are.
It is what \`org-enforce-todo-dependencies\` manages, and its info page defines it as a parent/children task relationship. This is how I use it, and how I understand the 'finish-to-finish' dependency in general.
The other tools I mentioned above all have the same definition of a task dependency, threfore address the 'finish-to-finish' handling. What they add is the possibility to define parent and children task relationships across different projects or files using a \`BLOCKER\` property instead of being limited to a linear, indented type of sub tasks defintion.
The other less common, but as important to me, dependency type I desperately need to implement in a practical way is the \*\*finish-to-start\*\* relationship. This one can be as much about planning and resource allocation as physical constraints.
For example, it is obvious that I need to get a permit from the city before starting construction work on my house, but, because my resources are limited I decided to start working on feauture request X only after I finished remodeling my kitchen, fixed bug Y and Z, and migrated my email accounts to Emacs.
I will certainly not remember I have to work on feature X after completing all those other tasks, so I need it to pop up on my task list when all those other tasks are completed; and I surely do not want it to unnecessarily clutter my task list in the meantime. Efficient and clear lists are supposed to be the basis for a happy GTD system after all, and I feel like org-mode was mostly built with GTD in my mind.
Using solutions like org-edna I could achieve something similar using a BLOCKER property. The problem I cannot seem to solve is: 'how do I differentiate those tasks from the tasks blocked using the \`ORDERED\` property, or the \`org-enforce-todo-dependencies\` variable in my agenda views ?'
Practically speaking, let's simplify a typical workflow, and say I have 3 task lists, or agenda views for that matter:
* the 'Active Projects' for all the projects I have already started,
* a 'Projects Backlog' for all the unhindered projects simply waiting to be started,
* and a self-explanatory 'Blocked Projects'.
Following the previous 'finish-to-start' example, let's consider I have already started working on my 'Kitchen Remodel' project, and my 'Bug Y' issue. Projects 'Bug Z' and 'Email To Emacs' are ready to be started, and I previously decided to start 'Feature X' only when everything else is done. My lists should look like the following:
* \*\*Active Projects\*\*
* 'Kitchen Remodel'
* 'Bug Y'
* \*\*Projects Backlog\*\*
* 'Bug Z'
* 'Email To Emacs'
* \*\*Blocked Projects\*\*
* 'Feature X'
Org-edna's \`BLOCKER\` property seems the way to go to send 'Feature X' to the 'Blocked Projects' list testing with \`org-entry-is-blocked-p\`. When the blocker tasks are \`DONE\`, it should automatically move to the 'Projects Backlog'.
The problem is that since I am using \`org-enforce-todo-dependencies\`, all the other projects with children tasks will also end up in 'Blocked Projects'.
I could check for the presence of the \`BLOCKER\` property, but since it is not removed by org-edna with blockers are done, it will defeat the purpose.
The only solution I am seeing so far is to use a
Problems with yasnippet and company-mode in latex
I have a next situation and question:
I use emacs 29.4 and mostly I use it for C, C++, LaTeX and planing use it for clojure, haskell and common-lisp. For first two I use clangd-lsp with next emacs packages:
1. lsp-mode
2. lsp-ui
3. company-mode
4. flycheck
As you understand above, I use only company for autocomplete. I want to provide in my emacs yasnippet, mostly because of latex. But for some reason, firstly, it wasn't working with company-mode: in company-autocomplete-box i didn't have any of my snippets, but autocomplete by keybinding, which I provide in yasnippet config part, have been working. It was in all modes which I using. I research all internet, and just find config in this discussion, which really help me. And all is working fine in c-mode and c++-mode, but not for latex. For latex I use next packages:
1. auctex
2. cdlatex
3. I don't use any latex lsps
Because I inserted this setting in my init.el file ((add-hook 'lsp-managed-mode-hook #'add-company-yasnippet)
), and it was helpful, I thought, that these settings must help:
(add-hook 'TeX-mode-hook #'add-company-yasnippet)
(add-hook 'LaTeX-mode-hook #'add-company-yasnippet)
But it was unsuccessful. I have changed 'company-backends
variable by next function (sorry for my terminology, I'm not expert in elisp and in lisp general) on this:
(defun add-company-yasnippet ()
(message "Running add-company-yasnippet")
(setq-local company-backends
'((company-capf :with company-yasnippet)
(company-files :with company-yasnippet)
company-dabbrev
company-yasnippet)))
But, as you understand, it hasn't changed nothing. Here is result of C-h v company-backends
in .tex-file buffer:
Value:
((company-capf :with company-yasnippet)
(company-files :with company-yasnippet)
company-dabbrev company-yasnippet)
Original value was
(company-bbdb company-semantic company-cmake company-capf company-clang company-files
(company-dabbrev-code company-gtags company-etags company-keywords)
company-oddmuse company-dabbrev)
Local in buffer 1.tex; global value is
(company-bbdb company-semantic company-cmake company-capf company-clang company-files
(company-dabbrev-code company-gtags company-etags company-keywords)
company-oddmuse company-dabbrev)
The most interesting thing, that when I run M-x company-yasnippet RET
, company show a box, just with all my defined for latex snippets.
All my configuration, which linked with this problem is below:
(defun add-company-yasnippet ()
(message "Running add-company-yasnippet")
(setq-local company-backends
'((company-capf :with company-yasnippet)
(company-files :with company-yasnippet)
company-dabbrev
company-yasnippet)))
(add-hook 'lsp-managed-mode-hook #'add-company-yasnippet)
(add-hook 'TeX-mode-hook #'add-company-yasnippet)
(add-hook 'LaTeX-mode-hook #'add-company-yasnippet)
(use-package lsp-mode
:ensure t
:hook
(c-mode . lsp)
(c++-mode . lsp)
:config
(add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-literate-mode-hook #'lsp))
(use-package lsp-ui
:ensure t
:after lsp-mode
:custom
(lsp-ui-doc-show-with-cursor t))
(use-package company
:ensure t
:init (global-company-mode)
:bind (:map company-active-map
("<tab>" . company-select-next)
("<backtab>" . company-select-previous))
:custom
(company-minimum-prefix-length 1)
(company-idle-delay 0.01))
(use-package flycheck
:ensure t
:init (global-flycheck-mode))
(use-package tex
:ensure auctex)
(use-package cdlatex
:ensure t
:hook (LaTeX-mode . turn-on-cdlatex))
Why Emacs show This window displayed thie file [Restore]
? How to prevent it?
https://preview.redd.it/y2dspg40t0gd1.png?width=677&format=png&auto=webp&s=e53fd721e6f68500a1a601cb33f2d04041f9588f
I previous displayed a file buffer in this window, then I switched to another tab-bar, when I come back I see this.
Why? What's this, How to prevent it. Is there some variable or function can control related behavior?
https://redd.it/1ehcau8
@r_emacs
Is there a way to ignore certain characters during src block evaluation?
I'd like to be able to prefix certain lines of shell src blocks w/ an "$ " which I would like to be ignored when I call org-babel-execute-src-block
. Is there currently a way to do this or an easy way to define something like this? Thanks.
Update
I did figure this out. It is possible to do. All I needed to do was advise the org-babel-execute:src
function. But, the more that I've thought about what I want to do, the less convinced I am that this is a good idea. I think a better way to approach my use case would be to define a latex export filter that joins my src blocks with their results in the tex code & something like a new keyword that would allow me to join consecutive shell environments.
https://redd.it/1eguo0t
@r_emacs
Testing Framework like neotest for neovim
Is there something like neotest for emacs? a way to run tests and get an icon or list of test functions and their status after being run?
neotest link
https://redd.it/1egv2ih
@r_emacs
Emacs: exclude directories in Denote's Org dynamic blocks
https://www.youtube.com/watch?v=RvKK5vLQiuQ
https://redd.it/1eglqya
@r_emacs
Weekly Tips, Tricks, &c. Thread
This is a thread for smaller, miscellaneous items that might not warrant a full post on their own.
See this search for previous "Weekly Tips, Tricks, &c." Threads.
Don't feel constrained in regards to what you post, just keep your post vaguely, generally on the topic of emacs.
https://redd.it/1eghspj
@r_emacs
Multilingual spellchecking. OMG, what a rabbit hole.
How's your day going? I just wasted hours! Effing Hours! And still couldn't figure this out. Oh-my-mothertyping-god. Why is this so needlessly complicated?
hunspell, ispell, aspell, nuspell, enchant, and the duck knows what else is out there for this shit.
So, I'm using minad/jinx, which is absolutely excellent, and if you're not using it, you're such a schlub, drop whatever you're doing right now and try it.
Now, jinx uses enchant, okay? And on my Linux machine it works beautifully. I don't remember how I did it, what exactly have I installed, but it just works. I would open a buffer with English text, it highlights things mistyped in English. I would open a buffer with Russian text - it highlights errors in Russian. Moreover, I can type things in the same buffer - in Russian, in English and in Spanish, and it highlights the friggin' errors.
After long hiatus now I'm having to work on a Mac. First thing that happened is that Emacs suddenly segfaulted and died. I wasted time blaming wrong things - first native-comp, then tree-sitter, then building Emacs from the HEAD, and none of that turned out to be the problem. Emacs kept dying because of enchant-2. Jinx calls it and it segfaults on Mac when the config is wonky. After pinpointing the culprit I kind of fixed the problem of segfaulting. But have gotten myself into a deeper rabbit hole. For the love of god now I can't figure out how to make enchant work just like it works on my Linux machine - I can't figure out multilingual enchant setup.
I have installed enchant and hunspell. I have set ~/.config/enchant/enchant.ordering file, I have downloaded dictionaries and placed them where I think they should be. `enchant-lsmod-2` shows this:
hunspell (Hunspell Provider)
AppleSpell (AppleSpell Provider)
Btw, to make it show it like that I had to ditch brew installed enchant and build it from the tarball. Otherwise it wouldn't even show hunspell there.
Now doing something like this:
hunspell -d ru_RU ~/foo.txt
works! And I would do the same with aspell:
aspell -l ru -c ~/foo.txt
and it too, works.
Yet, when I try to do the same thing with enchant:
enchant-2 -d ru_RU -l ~/foo.txt
# or just "ru" -> enchant-2 -d ru -l ~/foo.txt
No dictionary available for 'ru_RU'
lolwut? Why? Can someone please, please explain to me how enchant picks a backend. How do you folks set it on Mac so it properly works for multiple languages?
https://redd.it/1eg9hdg
@r_emacs
I'm a beginner struggling with setting Emacs up for web development
I feel like my init.el file is becoming all over the place and inefficient. Syntax highlighting doesnt work either for frontend programs. Does anyone know what I'm doing wrong?
`;; setup`
`(setq inhibit-splash-screen t)`
`(setq default-directory "w:/")`
`;; UI`
`(set-background-color "#101820") ;; schwarz`
`(set-cursor-color "#FEE715") ;;`
`(set-foreground-color "white")`
`(set-face-attribute 'default nil :font "JetBrains Mono-11")`
`(menu-bar-mode -1)`
`(tool-bar-mode -1)`
`(scroll-bar-mode -1)`
`(global-hl-line-mode 1)`
`(set-face-background 'hl-line "#4b5563")`
`;; Ausschalten der Glocke`
`(setq ring-bell-function 'ignore)`
`(setq visible-bell t)`
`;; Fenstergröße`
`(setq initial-frame-alist '((width . 150) (height . 35)))`
`(setq default-frame-alist '((width . 150) (height . 35)))`
`(defun my/frame-recenter (&optional frame)`
`"Center FRAME on the screen.`
`FRAME can be a frame name, a terminal name, or a frame.`
`If FRAME is omitted or nil, use currently selected frame."`
`(interactive)`
`(unless (eq 'maximised (frame-parameter nil 'fullscreen))`
`(modify-frame-parameters`
`frame '((user-position . t) (top . 0.5) (left . 0.5)))))`
`;; Funktionalität`
`(recentf-mode 1)`
`(setq recentf-max-menu-items 25)`
`(setq recentf-max-saved-items 25)`
`(global-set-key "\C-x\ \C-r" 'recentf-open-files)`
`(setq display-line-numbers-type 'relative)`
`(global-display-line-numbers-mode t)`
`(electric-pair-mode 1)`
`;; packages`
`(require 'package)`
`(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))`
`(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)`
`(package-initialize)`
`(unless package-archive-contents`
`(package-refresh-contents))`
`(dolist (package '(prettier web-mode markdown-mode emmet-mode js2-mode lsp-mode company yasnippet yasnippet-snippets lsp-ui lsp-treemacs php-mode go-mode tide flycheck typescript-mode multiple-cursors nov))`
`(unless (package-installed-p package)`
`(package-install package)))`
`;; Emmet-mode`
`(require 'emmet-mode)`
`(add-hook 'web-mode-hook 'emmet-mode)`
`;; Web mode`
`(require 'web-mode)`
`(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.scss\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.css\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.jsx\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))`
`(add-to-list 'auto-mode-alist '("\\.ts\\'" . web-mode))`
`;; Ensure that web-mode handles the appropriate file types`
`(setq web-mode-content-types-alist`
`'(("jsx" . "\\.js[x]?\\'")`
`("tsx" . "\\.ts[x]?\\'")`
`("javascript" . "\\.js\\'")`
`("typescript" . "\\.ts\\'")))`
`(defun my-web-mode-hook ()`
`"Hooks for Web mode."`
`(setq web-mode-markup-indent-offset 2)`
`(setq web-mode-css-indent-offset 2)`
`(setq web-mode-code-indent-offset 2)`
`(when (buffer-file-name)`
`(let ((ext (file-name-extension buffer-file-name)))`
`(when (string-equal ext "jsx")`
`(setq web-mode-enable-jsx t))`
`(when (string-equal ext "tsx")`
`(setq web-mode-enable-tsx t)))))`
`(add-hook 'web-mode-hook 'my-web-mode-hook)`
`;; LSP mode`
`(require 'lsp-mode)`
`(require 'go-mode)`
`(add-hook 'web-mode-hook #'lsp)`
`(add-hook 'js2-mode-hook #'lsp)`
`(add-hook 'c-mode-hook #'lsp)`
`(add-hook 'go-mode-hook #'lsp)`
`(add-hook 'before-save-hook 'gofmt-before-save)`
`;; LSP UI`
`(require
One semester of org-roam notes for my computer science degree
https://redd.it/1eg26sw
@r_emacs
how to make tabs in emacs just contain one large tab instead of multiple spaces?
I have tried doing(setq-default indent-tabs-mode t)
(setq-default tab-width 4)
(defvaralias 'c-basic-offset 'tab-width)
(setq ruby-indent-tabs-mode t)
(defvaralias 'ruby-indent-level 'tab-width)
(defvaralias 'sgml-basic-offset 'tab-width)
But it doesn't work. This leads to tabs just being composed of 4 spaces, not one tab. Similar to the neovim editor, I want tabs to be just tabs. One large block, instead of being packed with several tiny spaces. I need this for indentation. Relying on tabs to be just full of spaces is impossible for me. Can anyone help. I have tried several solutions, but they all are just solutions which means tabs will be filled with 'x' no of spaces. not tabs with TABS. I am new to Emacs, and I have heard this whole tab business is not very straightforward. So please do explain if I got something wrong
https://redd.it/1efqab8
@r_emacs
Is there a way to completely disable scrolling on a particular buffer?
I would like to not have this ability on dashboard buffers, but I haven't found any info on how to disable scrolling. Thank you.
https://redd.it/1eflnls
@r_emacs
Does tree sitter modes improve font locking performance?
Quick question, before I dive head first into tree sitter land.
I have a 2400loc file which is super laggy
Turning off font locking removes my performance issues, so I know it's an issue of font locking
Is switching to tree-sitter likely to fix my perf issues?
https://redd.it/1ef8twn
@r_emacs
Has someone used literate programming in a large code base? Literate programming vs documentation
I've seen some pretty and complex large code bases written in C++ for image manipulation and color space conversions and to the untrained eye they look like having a set of unrelated bunch of source code with same functionality spread between different files, but usually it makes sense due to the chosen of a complex architecture fitting to critical processing and low level access. It can take months to understand what its being done and the process usually feels like trying to take some random file reading it, trying to look its dependencies back and forth until you finally make some sense out of those. Could this process be eased if every file was accompanied by some org file? And could a master org file tell "Hey this is how you should begin reading the source code"
https://redd.it/1ef4pyw
@r_emacs