Why can't I use the greek character for lambda in Guile?
Edit: I've discovered the reason I can't use λ
in Guile. It's because I can't use `λ` in Guile.
-----
Now, yes, the reason I'm having issues is I'm a Windows pleb who deserves it. I'm still getting around to fixing that, but please just understand that I'm asking from a complete beginner's perspective. (More about my emacs/guile builds, etc. at the bottom in case that helps.)
Regardless, I'm writing some Scheme code for fun and practice, and I realized that when I want to be a fancy pants Rich McGee over here and use λ
instead of lambda
, it doesn't work in emacs like it would in DrRacket -- which sucks because DrRacket is ugly and emacs is pretty. It really, really seems like it should work, especially since I'm inserting it with the geiser-provided geiser-insert-lambda
command (C-c \
or C-c C-\
).
Trying both in a *Geiser Guile REPL*
:
scheme@(guile-user)> ((lambda (n) ( n n)) 5)
$5 = 25
scheme@(guile-user)> ((λ (n) ( n n)) 5)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Unbound variable: n
Entering a new prompt. Type ,bt' for a backtrace or
,q' to continue.
And I've also tried evaluating definitions using each from a buffer in (Scheme Guile/A)
modes:
(define (add5 n) (+ n 5))
(define add5-lambda (lambda (n) (+ n 5)))
(define add5-greek (λ (n) (+ n 5)))
The first two just shoot => #<unspecified>
to *Messages*
-- I'm not sure what that means, except I've learned it means it's going to work fine in the REPL.
Compiling the third opens a *Geiser Debug*
buffer:
(define add5-greek (λ (n) (+ n 5)))
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Unbound variable: n
Debugging level: 1
I've found this problem fairly ungooglable since any combination of words like "lambda," "emacs," "guile," "greek character," etc. lead me to a lot of different stack overflow posts and manual pages about a lot of completely different problems.
This is really the only wrinkle I've had working with Guile so far. I tried Chicken first, which, after trying to build it from both MinGW64 and Chocolatey, I've found pretty much incompatible with Windows at the moment (unless I want to go poking around in batch files I don't fully understand). So, while my λust for λ
's is a very minor problem about a very small luxury that's missing, it's eating at me that this might be indicative of some other incompatibility I want to hunt down and smooth out.
Some setup-context, and I apologize because I'm not sure what's relevant here:
I'm running Windows 11
I installed/built Guile 3.0.9 and emacs both with MinGW64
For complete unambiguity, `(emacs-version)` is `GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) of 2023-06-16` (despite building with MinGW64 ??)
I'm also using geiser 0.30
and geiser-guile 0.28.1
, both installed with package-install
and without any other hiccups.
I'm going to keep my current emacs session going, as I'd especially appreciate any help poking around in there if there's no full-blown answer that's immediately clear here.
https://redd.it/1cwm8dd
@r_emacs
Can I create a math function in calc?
I have some complicated function which I want to plot in calc. I want to separate it to like f(x)=f1(x)*f2(x)
, and define f1(x)
and f2(x)
in advance. I tried f1(x):=sin(x)
or similar syntax for example, but they do not work. Could not find useful information in the manual. Is there a way to do this in calc?
https://redd.it/1cwk3ty
@r_emacs
Eglot multiple server for same file/buffer/project (texlab & eglot-ltex for LaTeX-mode)
Hi, is there a way to run two servers using eglot for the same file? I am writing LaTeX, where I have used texlab
as the main LSP using eglot
. However, I would like to use eglot-ltex
as well for the same buffer/project.
Unfortunately, either texlab
or eglot-ltex
is taking precedence depending on the order in my config.
I was wondering if there is a way to run both of them together for the same buffer. That would be really helpful. Thanks a lot.
https://redd.it/1cwg0sh
@r_emacs
CSS Variables Autocompletion?
Hello,
I've finally embarked on the emacs journey as of this year. So far, I'm loving it.. but I'm having some trouble with this specific problem. I'm using CSS modules for a client application, and am defining CSS Variables (--css-variable-name
) in global file. I'd like to be able to gain auto completion for these --css-variables
. I'm currently using cape / lsp for completion.
For reference, this is what I'm looking for: https://github.com/vunguyentuan/vscode-css-variables
https://redd.it/1cvz3m9
@r_emacs
i want some better config for build own emacs config by templates
https://redd.it/1cvklsd
@r_emacs
Best uses for xwidgets and xwidgets-webkit?
So, now that I have xwidgets running properly again for the first time in a couple years... What do people recommend?
I mostly just re-enabled it since I missed `org-roam-ui`.
https://redd.it/1cvdkxe
@r_emacs
packages for TTS?
I'll preface by saying I am posting this as I do the research and so if I find a good solution I will post that as well.
I'm looking for a TTS elisp package for use with Emacs. Primarily for speaking text from documents stored in Calibre via the calibredb package. It would be an awesome bonus if the TTS was not only able to speak regions but also generate audio files from documents and chapters of documents.
So far it looks like Piper is the most promising option for an offline TTS. I just need to find some integration points between it and Emacs.
thx!
https://redd.it/1cv56n9
@r_emacs
Why is Dashboard suddenly causing emacs to hang?
Four days ago emacs-dashboard started to cause emacs to hang on loading; this after using it for 6 months no problem. The dashboard code in my config.el is:
(use-package dashboard
:ensure t
:init
(setq initial-buffer-choice 'dashboard-open)
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(setq dashboard-banner-logo-title "Hi XXXXXXXX!")
(setq dashboard-startup-banner "\~/.config/emacs/images/Emacs_512-rescaled2.png")
(setq dashboard-center-content nil)
(setq dashboard-items '((recents . 10)
(agenda . 5)
(bookmarks . 5)
(projects . 3)
(registers . 5)))
:custom
(dashboard-modify-heading-icons '((recents . "file-text")
(bookmarks . "book")))
:config
(dashboard-setup-startup-hook))
I can find nothing wrong here and the code has been working fine previously. If I remove the dashboard code from my config emacs loads just fine. Updating packages has not solved the problem so far. Using 'pkill -USR2 emacs' I get the following backtrace:
https://preview.redd.it/m4lei83up71d1.png?width=937&format=png&auto=webp&s=e383788129fc48bf74a920b44e58fba95be102d3
I'm not sure what is going on here. Does anyone know how to solve? If not I will report it. Thx
System: Archlinux, Package manager: Elpaca, Emacs: 29.3
https://redd.it/1cv1sn0
@r_emacs
What is the coolest thing you do on eMacs if you are a hardware designer?
https://redd.it/1cur6e9
@r_emacs
emacs module OS license
I hesitate to even ask but if I released emacs module code for some of my bidnigs under say an MIT license and a readme that said "figuring out how to use this this code in emacs is YOUR problem" do you think I'd end up wishing I had just kept it to myself?
https://redd.it/1cunr6e
@r_emacs
Adding a new language to LSP-Mode
I'm tinkering with a home made toy LSP server I'm writing myself. I am trying to get it interacting with emacs and have been working with [This](https://emacs-lsp.github.io/lsp-mode/page/adding-new-language/) page from LSP-Mode's website. This is the code I've got in my init.el file.
Two small questions.
When I launch lsp in a buffer with a .T file lsp-log says command "my\_lsp is not present on path" The my\_lsp executable is in my .emacs.d/packages/ folder which is added to path at the top of my init file. It isn't advanced enough to require parameters yet. It also executes successfully if I type ./my\_lsp in a terminal. It produceses a log file to confirm this. Is that not the path it means? I tried adding it to my Linux path with a source command but it didn't change anything.
Second, does the fact that it's in fundamental mode matter if I'm using the regex syntax to add to lsp-language-id-config? By using regex I thought I understood that the mode didn't matter because I'm defining it by file extension instead. Any help clarifying this would be very helpful. Thanks
(with-eval-after-load 'lsp-mode
(add-to-list 'lsp-language-id-configuration
'(".*\\.T$" . "T"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "my_lsp")
:activation-fn (lsp-activate-on "T")
:server-id 'my_lsp)))
https://redd.it/1cu6k0m
@r_emacs
accidental font changes in EMACS
I'm on a laptop. The font changes outside of my conscious control.
It happens when I have the control-key pressed and I touch the mousepad.
I can't consistently figure out what I'm doing.
What are the keystrokes that is torturing me and how do I make it go away?
https://redd.it/1cu3oan
@r_emacs
Prompt for image with previews
I want a function to pick an image from my photos folder and insert a link to it in my current org mode note. This isn't too hard to do without even needing to write a function; C-c C-l
can do it well enough. The problem is, I also want:
1. The list of images to be sorted newest first; and
2. Make it possible to see a preview of the image.
Vertico previews don't seem to handle images and completing-read
ignores my sort order. I tried spawning a dired buffer and using dired-get-file-for-visit
, but this is clumsy and inconvenient; I can't find a way to do it that is as simple as "press keybinding, select file, link is inserted." Googling around gets me nothing. Is there anything else I can try?
https://redd.it/1ctt5ow
@r_emacs
How to tell if theme is light or dark?
I've been using Emacs for a very long time (back in the vt100 days even), but only starting to think about dark mode. VS Code must be infecting me or something. I see there's lots of work going on with Emacs theming these days.
I have lots of individually customized :background
color specs in my init file; should I just defconst theme-dark-p and use that everywhere to adjust my custom colors, or should I go all in and hook into the theming infrastructure rather than just (set-face-attribute ... nil :background #0d5)
?
https://redd.it/1ctoaap
@r_emacs
is there any alternative to CUA-mode on Windows?
VSCode and Emacs are both excellent editors, and I use them simultaneously on Windows. However, one annoying point is that the keybinding styles of these two editors are inconsistent.
For example, in VSCode:
- Ctrl-z -> undo
- Ctrl-x -> cut
- Ctrl-c -> copy
- Ctrl-v -> paste
While in Emacs, Ctrl-x and Ctrl-c keys are used as prefix keys (C-x
, C-c
) for most of Emacs' built-in commands.
One way to keep they consistent is to use CUA-mode, but its implementation is quite tricky (e.g., cua-prefix-override-inhibit-delay
= 0.2), so I'm not very keen on using it.
Are there any alternatives to CUA-Mode?
One possibility I can think of is the Windows Key.
For example,
- Use the Windows Key on the keyboard as Emacs' Control key, which means that the original C-x
prefix can be pressed by the Windows Key (you might say that "the prefix key C-x
" now is actually "prefix key s-x
", but keep in mind it is handled underhood);
- At the same time, use the Ctrl key on the keyboard as Emacs' Super Key, which means I can bind custom commands to the Super Key.
If this works, I can define a clean "cut operation" like:
(global-set-key (kbd "s-x") 'kill-region)
C-x
, because C-x
is now driven by the Windows key.Does anyone know if anything has happened with this project?
https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00175.html
https://redd.it/1cwi0y7
@r_emacs
ESS with conda
I use ESS for R and I'm very happy with it. One issue I'm having, though, is that there doesn't seem to be any obvious way to set up a specific R version/conda environment per project. I'm aware of the shell+ess-remote alternative, but it is very clunky. I often need to launch several R sessions per script, and it becomes very annoying.
Is there any way to tell ESS "for this project use R from this conda environment"?
https://redd.it/1cwb3bi
@r_emacs
Why does Magit do these seemingly contradictory things?
When typing a commit in Magit, if my commit message gets too long, the editor automatically line-wraps, causing the second line to be colored red.
https://preview.redd.it/cm7q3dubsg1d1.png?width=702&format=png&auto=webp&s=c5c80073b73d716d1ccac929481c5ff2b3903390
Then, if I try to commit with that message, I get a notification that "Second line is not empty. Commit anyway? (y or n)", since by convention Git messages should have an empty second line. It gets to the point where: If I want to continue writing my commit message, I have to backspace, then hit C-q SPACE
(since SPACE
on its own triggers the word wrap behavior), which is a really obnoxious way of typing.
So my question is: Why does Magit even bother putting the line break in there, if it's just going to complain about that same line break in ten seconds? And can I disable the automatic word wrap, since it's objectively making my commit messages worse and less correct?
https://redd.it/1cw1309
@r_emacs
Olivetti Mode cuts off Modeline
My modeline for gets cut off when olivetti mode is turned on. When it is turned off it returns to normal. But I cannot figure out how to avoid this problem while having olivetti mode turned on:
https://preview.redd.it/ge1eedwl5b1d1.png?width=290&format=png&auto=webp&s=d1b15a1e57b684b1e739b3128122cc5af2048dfc
But when I split the screen in olivetti mode, the modeline is no longer cutoff:
https://preview.redd.it/siw5wdpd6b1d1.png?width=1876&format=png&auto=webp&s=ac0d511eafa34de1db729c1cc8f4d9d95990db5c
The following is my code:
(use-package olivetti
:straight t
:config
(setq olivetti-min-body-width 50
olivetti-body-width 80
olivetti-style 'fancy ; fantastic new layout
olivetti-margin-width 12)
:hook
((olivetti-mode-on-hook . (lambda () (olivetti-set-width 85)))))
(add-hook 'olivetti-mode-on-hook (lambda () (olivetti-set-width 85)))
(defun me/org-mode ()
"My custom configuration for 'org-mode'."
(olivetti-mode)
(setq
olivetti-body-width 90
olivetti-style 'fancy ; fantastic new layout
olivetti-margin-width 10)
(olivetti-set-width 90)
)
(add-hook 'org-mode-hook 'me/org-mode)
(add-hook 'markdown-mode-hook 'me/org-mode)
(add-hook 'org-agenda-mode-hook 'me/org-mode)
(add-hook 'dashboard-mode-hook 'me/org-mode)
(add-hook 'delve-mode-hook 'me/org-mode)
(add-hook 'Info-mode-hook 'me/org-mode)
(custom-set-faces
'(olivetti-fringe ((t :background unspecified))))
;; Changes the colors on the sides of this page
(set-face-attribute 'fringe nil :background "#ececec")
https://redd.it/1cvfoy9
@r_emacs
Using xwidget-webkit-browse-url in an emacsclient started with systemd?
EDIT: Resolved. See my post in the comments section.
Hey everyone!
I have a systemd
service in .config/systemd/user/
where I start emacs from on boot. The important pieces from that are:
[Service]
Type=notify
ExecStart=/usr/local/bin/emacs --fg-daemon
[Install]
WantedBy=default.target
emacsclient
in a new frame when I want to open emacs and boom, it is up instantly.xwidget-webkit-browse-url
it shows a blank white screen. When I use emacs
directly (instead of through an emacsclient
from the instance started by systemd
), it works properly.systemctl --user status emacs
:May 18 21:30:31 work-dev emacs[3306]: ../../../../../gdk/x11/gdkwindow-x11.c:5653 drawable is not a native X11 window
May 18 21:30:31 work-dev emacs[3306]: ../../../../../gdk/x11/gdkwindow-x11.c:5653 drawable is not a native X11 window
May 18 21:30:31 work-dev WebKitWebProces[19150]: cannot open display:
$DISPLAY
wasn't set properly so I did M-x setenv
and set DISPLAY
to :1
(same as what I found from a terminal emulator) and no luck. I also tried WEBKIT_FORCE_SANDBOX=0
and GDK_BACKEND=x11
grid.el - library for organizing blocks of text horizontally and vertically
https://redd.it/1cv3l0b
@r_emacs
Save Options Doesn't Work
I am using Emacs 29.3 and I am unable to save options set in the top menu. I can reproduce the problem like this:
F10 > Options > Blink Cursor
F10 > Options > Show/Hide > Tool Bar > On the Top
F10 > Options > Show/Hide > Context Menus
F10 > Options > Show/Hide > Window Tab Line
F10 > Save Options
F10 > File > Quit
And finally when I start Emacs again, none of the setting persist. Deleting "/home/user/.emacs.d/personal/custom.el" and retrying the steps above doesn't help. How can I troubleshoot? Please advice?
https://redd.it/1cup2lw
@r_emacs
How to access Emacs top menu?
I want to transition from Libre Office Writer to Emacs Org-mode with my writing and pdf exporting needs. I am trying to learn Emacs and I struggle with the basics.
I am able to launch emacs from terminal by typing $ emacs -nw
I am able to close emacs by pressing Ctrl+X followed by Ctrl+C
I have also installed the prelude addons by bbatsov.
But could someone please tell me the basics for navigating in emacs?
When I launch emacs I can see a top menu (File, Edit, Options, etc.) How can I access those by mouse and by keyboard? In windows I would press the Alt key followed by the arrow keys.
Also what is the key for cancel? For example if I press Ctrl+X, how do I back up to the state before pressing those keys?
https://redd.it/1cucwtm
@r_emacs
Is there a good way to make emacs-plus downloaded through homebrew appear via spotlight search on mac?
https://redd.it/1cu82z8
@r_emacs
Org Agenda Fundamentals Volume 2: TODOs (Advanced)
https://youtu.be/FviVGzk-qHM?si=_wcHla_eNh5QOIxM
https://redd.it/1ctvjjg
@r_emacs
How to open pdf files from citar in evince?
I have been a long-time user of helm-bibtex
, where I could have a menu of actions on a given bibliographic entry. I keep hearing that citar
has many advantages, so I am starting to use it. After configuring citar
as:
(use-package citar
:straight t
:custom
(citar-bibliography my-bibliography)
(citar-library-paths `(,my-library-path))
(citar-notes-paths `(,my-notes-directory)))
(I have previously defined my-bibliography
, and the others) and runningM-x citar-open,
I can choose to open the pdf file, but it opens in Emacs. How could I add the option of opening the file in Evince? (I use Ubuntu).
https://redd.it/1ctsqxo
@r_emacs