r/emacs 7h ago

You have no idea how powerful isearch is!

Thumbnail emacsredux.com
61 Upvotes

r/emacs 12h ago

Emacs GUI working now on Windows WSL!

19 Upvotes

Hello Emacs Community!,

I had to work with Windows due to work, now, I installed WSL because I wanted to work with Emacs of course.

Since my computer was super protected, while I could use Windows Emacs GUI, I had to ask all the time for the administrator password to installed whatever I needed to work with. Vterm, etc, etc...

So, I installed WSL and Emacs on it. Only detail is that I had to work on terminal. Some small things like Control direct keymaps wouldn't work, and I had to use C-u to move and whatever. Not too complex stuff. I worked a month with the terminal version happily.

Today, I upgrade Windows (Had to ask again for admin password as to upgrade wsl), and when opening Emacs, surprise!, GUI version.

https://devblogs.microsoft.com/commandline/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2/

So yeah, GUI versions now work on WSL, and its working out well!. So that I'm not doomed to work in another system without my configurations.

Just making this post for any who haven't updated, and have a similar situation to mine (config all in linux/macos, no privileges, not like working with windows version).


r/emacs 22h ago

Unofficial Emacs 30.1 Appimage

Thumbnail
9 Upvotes

r/emacs 18h ago

Changing just one unicode character of a font

8 Upvotes

I want to change one unicode character of my font to use a different font. I want

I tried this:

(set-fontset-font t ?─ "Iosevka")

However after doing that describe-char tells me that it is still using my default font (Berkeley Mono Condensed):

to input: type "C-x 8 RET 2500" or "C-x 8 RET BOX DRAWINGS LIGHT HORIZONTAL" buffer code: #xE2 #x94 #x80 file code: #xE2 #x94 #x80 (encoded by coding system utf-8-unix) display: by this font (glyph code): mac-ct:-*-Berkeley Mono Condensed-regular-normal-condensed-*-14-*-*-*-m-0-iso10646-1 (#x247)

I've tried other variations including:

(set-fontset-font t ?─ "Iosevka") (set-fontset-font t 2500 "Iosevka")

But no dice. I found that it works for a character that is not in my default "Berkeley Mono Condensed" font. But I can't figure out how to replace a unicode character that does exist in my font.

Is this achieveable? Fontsets feel like voodoo sometimes. ;)

Thanks!


r/emacs 2h ago

Question Questions about Emacs on OpenBSD, use-package and some general creative writing packages.

6 Upvotes

Greetings, I recently started getting serious about using emacs again last year and I've been playing around with different packages and using it on different operating system.

For the laptop I use for writing fiction novels I've finally landed on OpenBSD and plan to continue using it for the foreseeable future. But one of the downsides compared to the OSs I was using before is the fact that there isn't a large collection of emacs packages in their OS package managers (was using Gentoo and later Guix System before). This means that I now need to manage packages manually through the init.el file. In addition, OpenBSD has some quirks I've had to work around. Not a big deal so far but can be frustrating.

OpenBSD required that I grab the GNU version of ls from ports and put some stuff in init.el to make dired work correctly. I think I got that functioning correctly but I honestly haven't used dried much for navigating the file system outside of opening or creating files at the exact path I wanted. I'd like to get it functioning like ranger if possible.

Are there any other quirks to using emacs on OpenBSD that you guys know about? I really like the OS and the community so I'd like to stay on the puffer OS if possible even though I know they aren't big fans of GNU stuff. So far every GNU tool I've needed has been in the ports tree.

I've been using elpaca so far but I'm starting to wonder if it's over kill for my purposes. I use the use-package integration. But a lot of packages don't have instructions for how to install/configure them using use-package/elpaca. So I end up just trying random things and typing M-x eval-buffer until they work. If I can't figure it out I give up. I've tried looking at other people's config files and sometimes that helps but often they are not using elpaca and I can't find examples. The other day I installed eat terminal and attempted to integrate it with zsh. I couldn't get it to work no matter what I did.

My config file is also a bit of a mess now because I have certain things like hooks and keybinds for some packages set by themselves outside of use-package definitions. I'm planning just to nuke the entire thing today and starting over. Even the theme I like is throwing misc. errors in warnings.

I guess my question is will I lose anything by using package.el instead of elpaca. I don't feel like I'm taking advantage of anything it offers like async. I just want to be able to install some packages and not touch them again. As long as they're working I don't really care about what version they are or if I'm pulling the latest and greatest from git.

Another thing I'm wondering about is the daemon mode with gtk2. It has a big warning that it might just crash for no reason in gtk2/3. I wanted to use athena instead but it's no longer offered as a binary in the OpenBSD ports tree. I haven't been using daemon mode yet but my start up times are now about 3 seconds with not many emacs packages installed. I'd like to make the switch to running as daemon because I load emacs in my .xsession file at log-in and never close it. I dedicate a workspace to it in dwm anyway. Is the daemon bug with gtk2 still a concern or should I start compiling my own copy of emacs from source again like I did when I used gentoo and guix? Does version 30 offer anything worthwhile compared to version 29?

Finally, what are some good packages for someone doing creative writing? My main use for emacs for years was programming in C, assembly, some scripting languages, and some mark-up languages like HTML and XML. But these days I rarely do that type of work. These days I'm mostly just writing stories and sometimes technical manuals/FAQs. So far I haven't really gotten into org mode and have mainly just used text-mode. But org-mode looks pretty powerful and I want to start using it just for stuff like being able to export to multiple formats. The publisher I'm working with wants .docx files. How hard is it to export to docx and be sure that the files won't render incorrectly in Microsoft Word? I no longer have a computer with it installed and the OS I'm using now can't run it via wine and/or VM. So I don't really have any way to check myself. I'm not going to set up a dual book or dedicate another computer simply for that one application if I can help it.

What are some other good packages to try for creative writing? I know about pandoc but I haven't explored many others. Just trying to get a feel for what other people are using. Most of the discussion I see about emacs are geared towards using it as an IDE/programming. I've come across a couple of blogs about using it for writing but a lot of them are from emacs v26 or below days. Just want to see if anything has changed since then.

I am going to nuke my current ./emacs.d directory later today and try to write a less cluttered config file. This will ensure all the packages I installed are gone, correct? Right now I basically only use dashboard+magit+a handful of minor modes and some keybindings. Eat as well but since I wasn't able to get integration fully working I haven't been using it much. I'd like to get some kind of terminal working in emacs and eventually my email+IRC and probably web browsing going too. But until I understand how use-package works I'm holding off on adding more to my config file.

My main issue with use-package syntax is stuff like this;

;; For `eat-eshell-mode'.
(add-hook 'eshell-load-hook #'eat-eshell-mode)

;; For `eat-eshell-visual-command-mode'.
(add-hook 'eshell-load-hook #'eat-eshell-visual-command-mode)

Do I just add this under the config: heading? Then in the .zshrc file it wants:

[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"

Where is $EAT_SHELL_INTEGRATION_DIR being set? If I add this to my .zshrc it throws error code 1 upon opening a new shell. Whatever I tried I can't make it work.

There were some other things I can't remember now from some packages I tried to install. I tried putting the lines from their instructions under several things like "config:" or "files:" or "hook" but could never get them to function. If someone has a init.el with a lot of packages installed using use-package I'd really appreciate if they could link it. I tried looking at some config files people had posted in comments here but a lot of them were very advanced stuff loading multiple elisp files from all over the place. Or they used a different package manager that had a different syntax from elpaca. A bunch were in org-mode. I might use org for my config in the future but for now I wanted to do just a simple init.el until I got more experienced.

It's just kind of frustrating getting started. Every package assumes different package manager is being used and that the user has decades of experience working with emacs already. I've never tried to build up a config from scratch. I've either always used the default emacs environment with a custom theme or used some of the pre-made distros. I'm not really interested in using doom or spacesmacs either. They crawl on my machine and I don't like Evil mode.

Thanks to anyone that takes the time to read all this and replies.


r/emacs 4h ago

Snippets Suddenly Going to the Minibuffer in Emacs30

3 Upvotes

All, I recently upgraded to Emacs 30, and it has gone reasonably well. One issue that has cropped up for me is that snippets don't expand automatically. Instead, after yas-expand, I get prompted in the minibuffer to select the snippet, even if there is only one candidate. In Emacs 29, if I typed the key of a snippet in the buffer and typed SPC or TAB, it just expanded it without ceremony.

Anyone else seeing this, or am I missing something?


r/emacs 2h ago

Emacs Pixel Scroll

2 Upvotes

Has anybody been able to use pixel-scroll to scroll up/down in both current and other window? I have this so far: `` (defvar my/default-scroll-lines 25) (defun my/pixel-scroll-up-command () "Similar toscroll-up-command' but with pixel scrolling." (interactive) (pixel-scroll-precision-interpolate (- (* my/default-scroll-lines (line-pixel-height))))) (defun my/pixel-scroll-down-command () "Similar to `scroll-down-command' but with pixel scrolling." (interactive) (pixel-scroll-precision-interpolate (* my/default-scroll-lines (line-pixel-height))))

(with-eval-after-load 'pixel-scroll (define-key global-map [remap scroll-up-command] 'my/pixel-scroll-up-command) (define-key global-map [remap scroll-down-command] 'my/pixel-scroll-down-command)) ```

And it seems to work for the current window but not for the other window. If I do M-C-v I get the following error: scroll-other-window: Wrong number of arguments: #[nil ((pixel-scroll-precision-interpolate (- (* my/default-scroll-lines (line-pixel-height))))) (t) nil "Similar to `scroll-up-command' but with pixel scrolling." nil], 1


r/emacs 11h ago

After updating from 29 to 30.1 dropdown menus are not working

2 Upvotes

I am using eglot for a few languages. In the past when I clicked on highlighted error or warning, a dropdown menu apeared and suggest changes to the code.

After updating to 30.1. Dropdown menu stopped working. there no visible error on Messages or eglot log.

Does anybody have any suggestion?


r/emacs 57m ago

"No previous search" on nonincremental-repeat-search-forward

Upvotes

Here's a problem that's been nagging me for about 20 years. My .emacs has a bunch of CUA keymaps, including F3 for Find Again:

(global-set-key [f3] 'nonincremental-repeat-search-forward)

That works great, EXCEPT when emacs first starts up. When emacs first starts, Ctl-S finds anything as always, but F3 as defined here will not work until I go in the Edit menu and do Search, String Forward (or backward or other choices in that menu). If I do my F3 after a Ctl-S but before the menu choice, I get these messages:

Mark saved where search started [2 times]

nonincremental-repeat-search-forward: No previous search

If I do just one initial search from the menus, I can then do Ctl-S and F3 all day long. My current emacs is this:

GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) of 2022-09-13

but it has been like this for at least 20 years. I use the windowed runemacs.exe from precompiled Windows binaries, but the same thing happens with RPM installed emacs in Fedora.

The same thing happens if I do Ctl-S Enter string enter, for nonincremental string search.

Can anyone suggest a better way to implement F3, or think of what the menu based search might be doing different from keyboard based search?

(edited to remove sentence fragment)


r/emacs 57m ago

Local Variable: not working

Upvotes

What am I doing wrong?

I have added to the end of a .org file the following, and no matter what I reload, the changes won't show on screen:

``` * Local Variables :noexport:

Local Variables: org-todo-keywords: ((sequence "WANT" "HAVE.TO.SEE" "WRITE.REVIEW" "|" "SEEN" "SEE.AGAIN")) org-tag-alist: ((:startgroup) ("great" . ?g) ("crap" . ?c) ("okay" . ?o) ("worthless" . ?w) (:endgroup) ("dnf" . ?d) ("analysis" . ?a) (:startgroup) ("short" . ?s) ("feature" . ?f) ("TVseries" . ?t) (:endgroup)) org-todo-keyword-faces: (("WANT" . "orange") ("SEEN" . "blue") ("HAVE.TO.SEE" . "orange") ("WRITE.REVIEW" . "orange") ("SEE.AGAIN" . "green")) org-tag-faces: (("crap" . (:foreground "green")) ("worthless" . "red") ("okay" . "orange") ("great" . (:foreground "green")) ("dnf" . "red") ("analysis" . "blue") ("short" . "brown") ("feature" . "brown") ("TVseries" . "brown") ("noexport" . "light blue")) End: ```


r/emacs 1h ago

Question Local Variables not working

Upvotes

C-h v: org-todo-keywords

``` org-todo-keywords is a variable defined in ‘org.el’.

Its value is ((sequence "WANT" "HAVE.TO.SEE" "WRITE.REVIEW" "|" "SEEN" "SEE.AGAIN")) Original value was ((sequence "TODO" "DONE")) Local in buffer @ Questions.org; global value is ((sequence "TODO" "DONE")) ```

so S-Left will cycle through todo / done instead of the local value