/r/emacs

Photograph via snooOG

The extensible, customizable, self-documenting real-time display editor.

A sub-reddit for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Related Subreddits

Useful Emacs configuration files and distributions

Quick pain-saver tip

/r/emacs

73,092 Subscribers

24

A little fun lisp thing: "evaluatable pseudocode"

I was writing some text few minutes ago, and I made a small code snppet for illustration:

(let (|(some-var-I-want-to-remove ( ... ))
      (another-var nil)
      (more-var))
  ( ... ))

I usually use three dots to denote "uninteresting" content. But for some reason I got to think that dot is a valid character for identifiers in elisp. So '...' ought to be a valid identifier? Turns out it was. So is also the pipe symbol. So I can do this:

(defun ... (&rest _ignored)) 

and the above let-block can now be evaluated without errors.

It is not useful to evaluate code that does nothing, of course, but perhaps it can be typed into the source code without Emacs complaining. A carefully constructed pseudo-code where everything evaluates to nothing can be interleaved with real code as examples or something. I don't know, just a thought.

Edit: of course (defvar ... nil) should also work :-).

1 Comment
2024/11/03
00:38 UTC

4

Perspective not isolating buffers between workspaces

I have the following setup in my init.el file. However, when I use consult-buffer it displays all the buffers between both workspaces. Only if I use persp-list-buffers can I see the buffers in the current workspace. However, it is not easy to switch between buffers within the persp-list-buffers, so I was trying to figure out how to make consult-buffer only display buffers in the current perspective workspace:

(use-package perspective
  :straight t
  :bind
  ("C-x C-b" . persp-list-buffers)         ; or use a nicer switcher, see below
  :custom
  (persp-mode-prefix-key (kbd "C-c w"))  ; pick your own prefix key here
  :init
  (persp-mode))
(setq persp-state-default-file "~/.emacs.d/config/persp-save-state")
(add-hook 'kill-emacs-hook #'persp-state-save)
(persp-state-load persp-state-default-file)
0 Comments
2024/11/02
19:58 UTC

2

Xah Fly Keys not launching automatically when Emacs opens

hello people!

i try and use Xah Fly Keys, as im currently trying different emacs keymap layouts, and it does not want to launch on startup. i'd like to have xah-fly-keys be automatically activated as a minor mode whenever i open Emacs, but instead i consistently fall onto Fundamental mode.

the only packages i installed, alongside what vanilla emacs did install, are xclip and xah-fly-keys and devil-mode (and i do not actively use devil-mode, nor have added anything to devil-mode regarding init.el). all installed through M-x list-packages

i have uninstalled devil just now, and still the same problem.

only modification i have added to emacs was the .emacs.d/init.el file, which has the following :

(setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "WAITING" "|" "DONE" "CANCELED")))

(require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize)

(require 'xah-fly-keys) (xah-fly-keys-set-layout "azerty") ; or your preferred layout (xah-fly-keys 1) (xah-fly-command-mode-activate)

am i doing something wrong, or did i miss something? i had to apply the correct keyboard layout using functions INSIDE of emacs, so i feel like XFK is acting a bit weird. especially when i modified init.el for org-mode, and that worked very well.

hope everyone is doing well, cheers :)

2 Comments
2024/11/02
18:54 UTC

3

Franca IDL Support for Emacs?

Is anyone here familiar with Franca IDL? If yes, do you know why there isn't a native support for FIDL in emacs?

1 Comment
2024/11/02
18:15 UTC

3

How to save tab-line tabs and load them in a new frame/session?

I like to use tab-line-mode (note not tab-bar) to keep a set of "active" buffers for my current work. By the way, tab-line-mode is improved in Emacs 30 and I recommend giving it a try.

When I work on a remote machine through ssh, I have a Emacs daemon on it, and all buffers live there even after I disconnect. However, the tabs of tab-line-mode seem to associate with the frame, so each time I start a new frame I have to bring those tabs back manually.

I also want to have keep those tabs/buffers across sessions, as much as possible. There are several project/session management packages out there, but it seems only tab-bar-mode is mentioned. Is there a package which can do save and load tab-line tabs in different frames/sessions?

Thanks for reading this long question!

1 Comment
2024/11/02
18:11 UTC

1

How to search by tags in the org-mode or org-roam?

I need to search by tag throught my **entire notes**. Why isn't there a simple, definitive answer? There's always "install this, set up that, add that hotkey, type that command first, and then..." or "add that itnto agenda"? What a bullshit. Why add it into agenda in order to search by tags?

9 Comments
2024/11/02
13:25 UTC

1

emacs crashing while editing cpp file

I'm not great with this stuff. Does anybody see anything obvious? This happens when lsp mode is turned off. I've never had an emacs lockup before and am not sure what to look for. It seems to be something wrong with projectile based on what its freezing at but why would it be having a problem with

this backgrace is the result of a pkill -SIGUSR2 emacs

Debugger entered--Lisp error: (minibuffer-quit)

#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_71>()

projectile-completing-read("Find file: " ("apps/app.cpp" "CMakeLists.txt" "README.md" "apps/CMakeLists.txt" "build/CMakeCache.txt" "build/CMakeDoxyfile.in" "build/CMakeDoxygenDefaults.cmake" "build/CMakeFiles/3.30.5/CMakeCCompiler.cmake" "build/CMakeFiles/3.30.5/CMakeCXXCompiler.cmake" "build/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_C.bin" "build/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_CXX.bin" "build/CMakeFiles/3.30.5/CMakeSystem.cmake" "build/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.c" "build/CMakeFiles/3.30.5/CompilerIdC/a.out" "build/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.cpp" "build/CMakeFiles/3.30.5/CompilerIdCXX/a.out" "build/CMakeFiles/CMakeConfigureLog.yaml" "build/CMakeFiles/CMakeDirectoryInformation.cmake" "build/CMakeFiles/CMakeRuleHashes.txt" "build/CMakeFiles/Continuous.dir/DependInfo.cmake" "build/CMakeFiles/Continuous.dir/build.make" "build/CMakeFiles/Continuous.dir/cmake_clean.cmake" "build/CMakeFiles/Continuous.dir/compiler_depend.make" "build/CMakeFiles/Continuous.dir/compiler_depend.ts" "build/CMakeFiles/Continuous.dir/progress.make" "build/CMakeFiles/ContinuousBuild.dir/DependInfo.cmake" "build/CMakeFiles/ContinuousBuild.dir/build.make" "build/CMakeFiles/ContinuousBuild.dir/cmake_clean.cmake" "build/CMakeFiles/ContinuousBuild.dir/compiler_depend.make" "build/CMakeFiles/ContinuousBuild.dir/compiler_depend.ts" "build/CMakeFiles/ContinuousBuild.dir/progress.make" "build/CMakeFiles/ContinuousConfigure.dir/DependInfo.cmake" "build/CMakeFiles/ContinuousConfigure.dir/build.make" "build/CMakeFiles/ContinuousConfigure.dir/cmake_clean.cmake" "build/CMakeFiles/ContinuousConfigure.dir/compiler_depend.make" "build/CMakeFiles/ContinuousConfigure.dir/compiler_depend.ts" "build/CMakeFiles/ContinuousConfigure.dir/progress.make" "build/CMakeFiles/ContinuousCoverage.dir/DependInfo.cmake" "build/CMakeFiles/ContinuousCoverage.dir/build.make" "build/CMakeFiles/ContinuousCoverage.dir/cmake_clean.cmake" "build/CMakeFiles/ContinuousCoverage.dir/compiler_depend.make" "build/CMakeFiles/ContinuousCoverage.dir/compiler_depend.ts" "build/CMakeFiles/ContinuousCoverage.dir/progress.make" "build/CMakeFiles/ContinuousMemCheck.dir/DependInfo.cmake" "build/CMakeFiles/ContinuousMemCheck.dir/build.make" "build/CMakeFiles/ContinuousMemCheck.dir/cmake_clean.cmake" "build/CMakeFiles/ContinuousMemCheck.dir/compiler_depend.make" "build/CMakeFiles/ContinuousMemCheck.dir/compiler_depend.ts" "build/CMakeFiles/ContinuousMemCheck.dir/progress.make" "build/CMakeFiles/ContinuousStart.dir/DependInfo.cmake" ...))

(let* ((project-root (projectile-acquire-root)) (file (projectile-completing-read "Find file: " (projectile-project-files project-root))) (ff (or ff-variant #'find-file))) (if file (progn (funcall ff (expand-file-name file project-root)) (run-hooks 'projectile-find-file-hook))))

projectile--find-file(nil)

projectile-find-file()

funcall(projectile-find-file)

(let ((projectile-project-name (funcall projectile-project-name-function project-to-switch))) (funcall switch-project-action) (current-buffer))

(progn (hack-dir-local-variables-non-file-buffer) (let ((projectile-project-name (funcall projectile-project-name-function project-to-switch))) (funcall switch-project-action) (current-buffer)))

(unwind-protect (progn (hack-dir-local-variables-non-file-buffer) (let ((projectile-project-name (funcall projectile-project-name-function project-to-switch))) (funcall switch-project-action) (current-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))

(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (hack-dir-local-variables-non-file-buffer) (let ((projectile-project-name (funcall projectile-project-name-function project-to-switch))) (funcall switch-project-action) (current-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))

(let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (hack-dir-local-variables-non-file-buffer) (let ((projectile-project-name (funcall projectile-project-name-function project-to-switch))) (funcall switch-project-action) (current-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))

(let* ((default-directory project-to-switch) (switched-buffer (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (hack-dir-local-variables-non-file-buffer) (let ... ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))) (if (buffer-live-p switched-buffer) (progn (switch-to-buffer switched-buffer))))

(let ((switch-project-action (if arg 'projectile-commander projectile-switch-project-action))) (run-hooks 'projectile-before-switch-project-hook) (let* ((default-directory project-to-switch) (switched-buffer (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ...) (and ... ...)))))) (if (buffer-live-p switched-buffer) (progn (switch-to-buffer switched-buffer)))) (run-hooks 'projectile-after-switch-project-hook))

projectile-switch-project-by-name("~/Programming/cpp_dev/vulkan_tut/")

(if consult-projectile-use-projectile-switch-project (projectile-switch-project-by-name dir) (consult-projectile--file dir))

consult-projectile--source-projectile-project-action("~/Programming/cpp_dev/vulkan_tut/")

funcall(consult-projectile--source-projectile-project-action "~/Programming/cpp_dev/vulkan_tut/")

#f(lambda (dir) [t] (funcall consult-projectile-source-projectile-project-action dir))("~/Programming/cpp_dev/vulkan_tut/")

consult--multi((consult-projectile--source-projectile-project) :prompt "Switch to: " :history consult-projectile--project-history :sort nil)

(and t (consult--multi (or sources consult-projectile-sources) :prompt "Switch to: " :history 'consult-projectile--project-history :sort nil))

(let* ((buffer (and t (consult--multi (or sources consult-projectile-sources) :prompt "Switch to: " :history 'consult-projectile--project-history :sort nil)))) (if buffer (if (cdr buffer) nil (funcall consult--buffer-display (car buffer))) nil))

consult-projectile((consult-projectile--source-projectile-project))

funcall-interactively(consult-projectile (consult-projectile--source-projectile-project))

consult-projectile-switch-project()

funcall-interactively(consult-projectile-switch-project)

command-execute(consult-projectile-switch-project)

2 Comments
2024/11/02
14:26 UTC

2

Strange displays of </bold> and </italic>

My emacs config was working perfectly well and I was trying to setup nano-emacs. I have no idea how all this happened, but some of my init.el contains these strange </bold> and </italic> text in various places which did not appear before.

EDIT: I am certain that his has something to do with nano-emacs now. I removed everything and I noticed that nano-emacs is somehow responsible for these strange tags continuously being placed inside my config.org file:

<bold><italic>* Nano Emacs</italic></bold>

<bold><italic>#+begin_src emacs-lisp
</italic></bold><bold><italic>(straight-use-package
  '(nano-emacs <bold><italic>:type</italic></bold> git <bold><italic>:host</italic></bold> github <bold><italic>:repo</italic></bold> <bold><italic>"rougier/nano-emacs"</italic></bold>))

                 (<bold><italic>setq</italic></bold> nano-font-size 14)
    (<bold><italic>setq</italic></bold> nano-font-family-monospaced <bold><italic>"Roboto Mono"</italic></bold>)
    (<bold><italic>setq</italic></bold> nano-font-family-proportional nil)

  (<bold><italic>require</italic></bold> '<bold><italic>nano-faces</italic></bold>)
        (<bold><italic>require</italic></bold> '<bold><italic>nano</italic></bold>)
        (<bold><italic>require</italic></bold> '<bold><italic>nano-layout</italic></bold>)

  (<bold><italic>require</italic></bold> '<bold><italic>nano-colors</italic></bold>)

  (<bold><italic>require</italic></bold> '<bold><italic>nano-modeline</italic></bold>)

  (<bold><italic>require</italic></bold> '<bold><italic>nano-theme</italic></bold>)

  (nano-toggle-theme)

</italic></bold><bold><italic>#+end_src

Everytime I try to remove all these tags, they are put back in my init.el file cause everything to mess up:

#+begin_src emacs-lisp
(use-package svg-tag-mode
  :straight t)
(use-package svg-lib
  :straight t)
;;(global-svg-tag-mode t)
(defun enable-svg-tag-mode-for-agenda ()
  "Enable svg-tag-mode only for agenda.org."
  (when (string-equal (buffer-file-name)
                      (expand-file-name "~/Dropbox/Documents/Orgzly/agenda.org"))
    (svg-tag-mode t)))
(add-hook 'find-file-hook 'enable-svg-tag-mode-for-agenda)
(defconst date-re "[0-9]\\{<x-color><param>sienna</param><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic>4\\</italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></x-color>}-[0-9]\\{<x-color><param>sienna</param><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic>2\\</italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></x-color>}-[0-9]\\{<x-color><param>sienna</param><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic><bold><italic>2\\</italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></italic></bold></x-color>}")
2 Comments
2024/11/02
04:29 UTC

3

How can I persist data/variables across org-babel blocks? Using Sly and SBCL for Common-Lisp and SBCL

I am trying to learn supercollider and cl-collider.

If I execute this

(require 'cl-collider)

(in-package :sc-user)
(named-readtables:in-readtable :sc)

(setf *s* (make-external-server "localhost" :port 48800))
(server-boot *s*)

(server-quit *s*)

in a buffer, using sly-eval-buffer, it works fine.

But if I use org and org-babel and define *s* in a separate block, it doesn't work:

** Setup =supercollider=
#+name: sesh
#+begin_src lisp :session mysession
(require 'cl-collider)

(in-package :sc-user)

(named-readtables:in-readtable :sc)
  (setf *s* (make-external-server "localhost" :port 48800))
  (server-boot *s*)
#+end_src


** Free =supercollider=
#+name: sesh
#+begin_src lisp :session mysession :results output
  ;; (free *synth*)
  (server-quit *s*)
#+end_src

Likewise, this also does not work:

** Define a variable

#+name: sesh
#+begin_src lisp :session mysession
  (let ((abcd "hello, world!")))
#+end_src

#+name: sesh
#+begin_src lisp :session mysession
  (message "testing %s" abcd)
#+end_src

I just get

The variable ABCD is unbound.
   [Condition of type UNBOUND-VARIABLE]

Restarts:
 0: [CONTINUE] Retry using ABCD.
 1: [USE-VALUE] Use specified value.
 2: [STORE-VALUE] Set specified value and use it.
 3: [RETRY] Retry SLY evaluation request.
 4: [*ABORT] Return to SLY's top level.
 5: [ABORT] abort thread (#<THREAD tid=12575 "slynk-worker" RUNNING {7012109443}>)

Backtrace:
 0: ((LAMBDA ()))
 1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LET ((*DEFAULT-PATHNAME-DEFAULTS* #P"/Users/vitor/Projects/music/")) (MESSAGE "opa %s" ABCD)) #<NULL-LEXENV>)
 2: (EVAL (LET ((*DEFAULT-PATHNAME-DEFAULTS* #P"/Users/vitor/Projects/music/")) (MESSAGE "opa %s" ABCD)))
 3: ((LAMBDA NIL :IN SLYNK:EVAL-AND-GRAB-OUTPUT))
 --more--

in the sly repl.

Is it even possible? There are not a lot of info on this online. https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lisp.html says interactive sessions are the default for Common Lisp.

I also have

(setq inferior-lisp-program (executable-find "sbcl"))
(setq org-babel-lisp-eval-fn 'sly-eval)

Thanks.

7 Comments
2024/11/02
02:27 UTC

21

Announcing auto-tab-groups: Effortless Tab Group Management for Emacs

Hello everyone, I'm excited to announce my first simple emacs package: auto-tab-groups. Inspired by the excellent project-tab-groups by Fritz Grabo, this package simplifies and generalizes tab group management in Emacs.

https://preview.redd.it/35yptkk7fhyd1.png?width=835&format=png&auto=webp&s=1109ce770818d2abe24255499f1400f9d0b63611

auto-tab-groups allows you to link any command (or list of commands) to specific tab groups. When a linked command is executed, the package intelligently switches to the associated tab group if it exists, or creates a new one if needed. This makes organizing your Emacs workflow incredibly flexible and easy. You can manage projects, mails, news-feed, file management tasks effortlessly in differnet tabs, and automatically close them when done.

Here's a quick example:

  (use-package auto-tab-groups
    :straight (:host github :repo "Marpogaus/auto-tab-groups")
    :after tab-bar project
    :custom
    ;; Automatically create tabs for projects, denote and dirvish buffers
    (auto-tab-groups-create-commands
     '(((project-prompt-project-dir project-switch-to-buffer) . auto-tab-groups-group-name-project)
       ((denote-create-note denote-menu-list-notes consult-denote-find consult-denote-grep) . "denote")
       ((dirvish dirvish-fd) . "dirvish")))
    ;; Close the project tabs when the project buffers are killed
    (auto-tab-groups-close-commands
     '((project-kill-buffers . auto-tab-groups-group-name-project)
       (dirvish-quit . "dirvish")))
    ;; Enable the "eyecandy-mode" for modern tab bars.
    (auto-tab-groups-eyecandy-mode t)
    ;; Define tab group icons (requires nerd-icons)
    (auto-tab-groups-eyecandy-icons
     '(("HOME"                                   . "")
       ("dirvish"                                . "")
       ("denote"                                 . "󱓩")
       (auto-tab-groups-eyecandy-name-is-project . auto-tab-groups-eyecandy-group-icon-project)))
    :init
    (auto-tab-groups-mode))

In addition, there's an optional "eye candy" mode (auto-tab-groups-eyecandy-mode) for customizing the look of your tab bar, including setting icons for individual groups.

Check out the project on GitHub for more details and documentation: https://github.com/MArpogaus/auto-tab-groups

I'd love to hear your feedback and suggestions!

Thanks again to Fritz Grabo for the inspiration.

6 Comments
2024/11/01
23:55 UTC

4

what are the recommended foreground and background colours for emacs that also provide good contrast with hl-mode and function highlighting, marking text etc?

I use white text on black background and would like to know what others use for setting fg/bg colours? Something that works with hl-mode, marked regions and function highlighting. I suppose, it'd would mean setting the colours for hl-mode and other bits too. I'm not too keen on themes unless it's builtin and preferably white on black.

what colours do you use?

23 Comments
2024/11/01
14:49 UTC

4

Ergonomic (as in primarily hand comfort) keybinds and packages close to Vanilla keybinding ?

hello everyone,

loving emacs and starting to get the hang of it, but i notice my left pinky is quite sensitive and easily hurts after a bit. i find myself having to extend my fingers a good amount when doing C-etc commands, as i have to use the left pinky to press Ctrl most of the time.

obviously, if that's the only problem i have with emacs keybindings and i can just use the arrow keys to navigate (as i find the keyboard shortcut navigations too spread out to be usable easily), then i can just take the time to remap keybindings and have the uncomfortable modkeys be bound to more accessible keys i otherwise don't use (Caps Lock for example), all good.

but that got me thinking and after doing some research, where i found ergoemacs-mode and fly-keys, i wanted to know if anyone found some specific re-bindings or any packages such as these minor modes to being effective in having better hand health overall : no over-extending the fingers, no encouraging an Emacs Pinky, and so on...

i notice that fly-keys works modally, like vi / vim, but I (at least in theory) prefer being able to stay with the vanilla Emacs keybindings of just invoking commands and being able to insert text at anytime, i feel less (mental) friction doing it that way. so i wonder if anyone got to find ergo keybinds (that have been made by you, and whether it is a minimal change or a complete remapping of the keys) or entire packages such as minor modes, that get to both be better for your hands and stay close to the Emacs way of doing keymaps.

PS : i'm aware that the most important stuff to have healthy hands is a good quality mechanical keyboard and layout, but until i get to have that i was wondering about how you RSI-conscious people thought of fixing the issue :)

TL;DR

looking for tips and packages, no matter how big or small, that you have applied or find to be particularly useful, in order to have less or no RSI symptoms when using Emacs and lessen / alleviate the issue of Emacs pinky.

cheers everyone!

14 Comments
2024/11/01
09:23 UTC

37

muu - Emacs turned into a music player!

Hi, I have configured Emacs into a dedicated music player program which I've named "muu", it can be found here: https://codeberg.org/Heathcliff/muu

muu is a music player built on GNU Emacs and EMMS (Emacs Multimedia System). I'm putting it up in the hope that it will be helpful for other users, raise interest in the EMMS framework ... and maybe someone will like it and use it!

I created this because I did not find that there existed any good keyboard-driven, filesystem-oriented music player out there. The closest alternative would be the music player MOC, which muu is heavily inspired by (essentially, the goal of muu is to be a clone of MOC).

muu is intended to be a standalone program (a separate Emacs-process). The rationale for this is to achieve a tightly integrated music player program, with quick single-key keyboard shortcuts among other things.

More information, installation guide et.c. can be found on https://codeberg.org/Heathcliff/muu

14 Comments
2024/11/01
08:27 UTC

24

PSA: Emacs NEWS (= etc/NEWS or C-h n) changes and ORG-NEWS changes has started appearing in /r/planetemacs and https://planet.emacslife.com/

Thanks to Sacha Chua

7 Comments
2024/11/01
07:24 UTC

10

Are they any DAP gurus here? Need help viewing "locals".

https://preview.redd.it/9v2qssxk18yd1.png?width=554&format=png&auto=webp&s=1f41612fee3bef9227b815efd88c0d6a453b055c

I'm using dap-dlv-go in dap mode. But when my program stops at a break point I can't see the full set of local data. Just the beginning of the variables/value followed by `...` like the image below. The same version of dlv and Go work in VSCode flawlessly so I'm sure it's my configuration. I know there are some config options for VSCode like `maxVariableRecurse` and `maxArrayValues` is it possible to set those in emacs somehow? and Where? Please and thanks.

7 Comments
2024/11/01
04:56 UTC

2

How do I quick save when this happens?

Some times my c-x c-s shoprtcut acticates this function and it wont let me save with this shortcut. I dont know what to do. How can I set the autosave again to ve c-x c-s?

https://preview.redd.it/2fzwwu3ml5yd1.png?width=1920&format=png&auto=webp&s=959b91d6a853ebf476d8dd684fd5f79a8d65ca1f

7 Comments
2024/10/31
20:26 UTC

12

What happened to the weekly tips and tricks thread? I'm not seeing it anymore.

5 Comments
2024/10/31
18:43 UTC

3

Isn't there a symbol used to represent the list of a functions parameters?

I believe there is, but I've forgotten because I never had a cause to use it, though I suspect it must be quite simple.

1 Comment
2024/10/31
18:41 UTC

1

Changing default window size when invoking M-x `run-python`

Hi all,

When working on python files, often times I need to run the interpreter with M-x run-python. However, this splits the window in half everytime.

Is there a way to reduce the size of this window to say about 20% of the entire frame? And also to specify to make a vertical split regardless of the total area of the frame? Thanks.

5 Comments
2024/10/31
14:42 UTC

12

What's the best way to work in other people's projects?

I have my Emacs (Doom Emacs) set up with LSP, format on save, etc., and this is working for me.

Recently I cloned a project from GitHub, and I made some changes and realzed my settings are rewriting the whole file, and I don't want _all_ my rules applying to other people's projects.

I need a way to tell Emacs that a project is mine or someone else's. I was thinking if I can have a flag set at the project level which will disable some settings project-wide instead of having to create a .dir-locals.el each time.

10 Comments
2024/10/31
13:40 UTC

1

Execute a shell src block with a given command

On a supercomputer, people usually submit a job with sbatch runfile.sh. I am wondering if there is an option to run a particular command on a shell source block in Org mode, but instead of running the script with bash.

Thanks.

4 Comments
2024/10/31
12:58 UTC

6

Unified way to toggle input methods in X11 and Emacs

I made a small dirty hack to allow the same keybinding to switch X11 keyboard layouts and input methods in Emacs. I think I got the idea somewhere on the Internet long ago and incorporated it into my self-written window manager, but now I think it would be nice to have a separate utility - https://codeberg.org/algor512/eswitch

I presume it may not work with large desktop environments, but hopefully you can use their own tools for that.

I don’t know whether it will be helpful for someone else; at least I'm happy using it :)

9 Comments
2024/10/31
12:32 UTC

13

Basic Obsidian Dataview functionality unlocked

Been doing mad research and trying different solutions the past few days to unlock basic functionality from similar to the Obsidian plugin Dataview.

The solution, after lots of googling consists of using a modified org-ql dynamic block function.
See the function posted by hrehfeld on https://github.com/alphapapa/org-ql/pull/239#issuecomment-1213052966

I've tried it with custom file and it works perfectly.

Valid parameters include:
 :scope    The scope to consider for the Org QL query. This can
            be one of the following:
            `buffer'              the current buffer
            `org-agenda-files'    all agenda files
            `org-directory'       all org files
            `(\"path\" ...)'      list of buffer names or file paths
            `all'                 all agenda files, and org-mode buffers

The query

#+BEGIN: my-org-ql :scope ("~/org/contacts.org") :query (property "position") :columns (heading ((property "position") "Position") ((property "organization") "Organization")) :sort nil  
#+END

contacts.org consists of headings where each heading is a contact with metadata.

* Name LastName
:PROPERTIES:
:type: person
:context: work
:organization: [[id:96b109ff][Some org]]
:position: Developer
:tel_work:
:tel_home:
:tel_mobile:
:ID: 4fab8b24-f51a-4598-91e3-012743e2f62f
:ROAM_ALIASES: name
:END:
6 Comments
2024/10/31
10:35 UTC

0

How to truncate in a C file

So i just wondering how to do it, cause i read the helping guide and i search everything and i cant make it truncate by default, i check state of the variables and all i can wonder.

Here is the part of my config.org, that changes the truncate

** Toggle truncate lines.
#+begin_src emacs-lisp
;; (setq truncate-lines nil)
(setq-default truncate-lines t)
(setq-default global-visual-line-mode t)
(add-hook 'c-mode-hook (lambda () (setq truncate-lines t)))
(add-hook 'latex-mode-hook (lambda () (setq truncate-lines t)))
#+end_src
11 Comments
2024/10/31
08:39 UTC

0

eshell prompt shows incorrect working directory on a TRAMP remote host

Running emacs -Q for emacs 29.4 (build 2, x86_64-w64-mingw32):

~/.ssh $ cd /sshx:oracle-root:/

/sshx:oracle-root:~/ $ pwd
/sshx:oracle-root:/home/opc/
/sshx:oracle-root:~/ $ /bin/pwd
/

There should be no tilde before / on the second line and the `pwd` command (which is eshell's own `pwd` written in elisp) on the second line should not report .../home/opc/ but rather /sshx:oracle-root: like below.

Running emacs -Q for emacs 27.2 (build 1, ....redhat):

~/.ssh $ cd /ssh:oracle-root:/

/ssh:oracle-root: $ pwd
/ssh:oracle-root:
/ssh:oracle-root: $ /bin/pwd
/

So what gives?

2 Comments
2024/10/31
08:08 UTC

4

Read only src block org mode

Is there any way to make src blocks readonly by default and only editable with org-edit-special?

4 Comments
2024/10/31
04:05 UTC

8

Why can't I remember this command? xD

_# org-roam joke incoming 😉

Like... look at the convoluted process I've resorted to.

M-x org-roam-node-find    
Node: line-wrap

:PROPERTIES:
:ID:       <id>
:END:
#+title: line-wrap

M-x visual-line-mode
3 Comments
2024/10/31
03:58 UTC

Back To Top