r_emacs | Unsorted

Telegram-канал r_emacs - /r/emacs

-

This channel is a feed for r/emacs. @r_channels @reddit2telegram

Subscribe to a channel

/r/emacs

eglot and tresitter in emacs 29

Hi,

I have a perfectly working setup in emacs 28 using eglot and tresitter. I am moving to emacs 29, and trying to figure out which parts of the configuration can be removed since both eglot and treesitter are part of emacs now. I know that treesitter-auto can do a lot of heavy lifting in emacs 29. The relevant config from the emacs 28 installation is:

(use-package eglot
:straight
:hook ((python-mode julia-mode) . eglot-ensure)
:config
(add-to-list 'eglot-server-programs
'(python-mode . ("python-lsp-server"))
'(julia-mode . ("eglot-jl"))))



(use-package tree-sitter
:straight t
:config
(global-tree-sitter-mode)
(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))

Any help/tips would be awesome. Thank you!

https://redd.it/1b08rhp
@r_emacs

Читать полностью…

/r/emacs

Problems using vscode language servers for eglot

So i want to use eglot to have autocompletion for html and css in Emacs (Windows). I installed eglot from melpa and installed the language servers using npm as shown in Github. When I run M - x eglot in any HTML file, I get the message "Enter program to execute'. When i enter vscode-html-language-server.cmd and enter, i get the error message:

[jsonrpc\] Server exited with status 1

>error in process sentinel: eglot--error: [eglot\] -1: Server died
>
>error in process sentinel: [eglot\] -1: Server died

When i enter vscodehtml-language-server.ps1 and enter, i get the error message:

>Searching for program: Permission denied, vscode-html-language-server.ps1

What might be the problem be with this? the language servers are in my path.

​

https://redd.it/1b01pr2
@r_emacs

Читать полностью…

/r/emacs

How to use consult-buffer-sources for an additional set of buffers

I would love to have the ephemeral buffers sorted in an extra category below the regular buffers when calling consult-buffer. The following definition doesn't work. It does sort them as wanted, but when I choose them, the buffer doesn't switch to *Messages* or *scratch*, it just stays as the current buffer. (The regular buffers can be chosen in the upper part of the consult-menu as usual.)

What did I do wrong?

(setq consult-buffer-sources
'(consult--source-hidden-buffer
consult--source-modified-buffer
consult--source-buffer
(:name "Ephemeral" :narrow 109
:category buffer :items
("Messages"
"scratch"
"Async-native-compile-log"
"Bookmark List"))))

(setq consult-buffer-filter
'("\` "
"\`\*Completions\*\\'"
"\`\*scratch\*\\'"
"\`\*Messages\*\\'"
"\`\*Bookmark List\*\\'"
"\`\*EMMS-Log\*\\'"
"\`\*Flymake log\*\\'"
"\`\*Semantic SymRef\*\\'"
"\`\*tramp/.\\\\'"))

I need to filter them, so they are not listed twice, but just in the extra category. And neither :category buffer nor :category 'buffer works.

I am grateful for any advice.

Edit: I am using Emacs 30.0.50 and Consult 1.3.

https://redd.it/1azvqbe
@r_emacs

Читать полностью…

/r/emacs

ELI5: Treesitter + elisp - what mode do I use?

I've used the tutorials and installed treesitter and it's working fine for everything but elisp, or at least I can't prove it's working for elisp.

I have installed and have libtree-sitter-elisp.so (and -lisp.so), but I am having trouble on which mode to use when editing .emacs or other elisp files. There's no lisp-ts-mode nor elisp-ts-mode that can be run interactively.

I'm sure it's user error, but what am I doing wrong? (And/or, where should I be searching for this, or what did I miss when searching here?)

https://redd.it/1azpt16
@r_emacs

Читать полностью…

/r/emacs

".authinfo" eagerly decryption on startup

Hello,

I'm starting to use .authinfo to save some encrypted information, that works pretty nice. The problem I'm facing is that Emacs tries to decrypt the authinfo.gpg file eagerly at startup which when running as daemon is kind of problematic.

Is there a way to delay the decryption of authinfo.gpg until it is needed?

https://redd.it/1aznp02
@r_emacs

Читать полностью…

/r/emacs

query-replace vs query-replace-regexp

I've recently discovered that `query-replace-regexp` can accept lisp expressions to effect changes on the matched text, which has still got my reeling in wonder days later.

​

One question that has come to mind though is whether anyone uses `query-replace` over `query-replace-regex` and if so why? What are the benefits that `query-replace` has over its regex alter ego, or conversely am I instead missing some drawbacks to always defaulting to the `regex` version?

​

For context, I've rebound `M-%` to use the `regex` version as it's already a bit of an awkward key bind, but am I struggling with Chesterton’s Fence in this case.

​

For more context, I discovered about the elisp powers via Shiny and new emacs 22 and Emacs query replace downcase

https://redd.it/1azo44q
@r_emacs

Читать полностью…

/r/emacs

Nearly halfed my config with new emacs 30

So now that treesitter and eglot come with emacs theres no need for all my plugins. Flycheck was giving wierd errors with LSP, replaced it with built in flymake and the errors reporting is spot on. It's also really quick now with native comp built in. Thanks to mickey for this guide. Actually didn't even need to build from source though I used homebrew as i'm on an M1.

I'm late to the party on this stuff as i've not been coding on emacs for a couple years now but this stuff is amazing, finaly emacs is coming out the box with the stuff!

https://redd.it/1azmh4j
@r_emacs

Читать полностью…

/r/emacs

Agda not loading depending of way of opening emacs

Hello everyone, my agda on emacs is loading correctly only if I open it from terminal/wofi, but not correctly if I open it via fuzzel/swaymsg "workspace 2; exec emacs" in terminal. I will now describe how I installed agda, then describe what is not working.

I installed emacs wayland on arch linux and I installed ghcup by installing ghcup-hs-bin. Using ghcup tui I installed cabal and ghc. Then I installed agda according to agda installation guide. To describe precisely how I did that, I run cabal update
cabal install Agda, then agda mode setup, which added (load-file (let ((coding-system-for-read 'utf-8)) (shell-command-to-string "agda-mode locate"))) to my .emacs file and finally run agda-mode compile.

Now I will describe how agda is behaving. When I run emacs in fish shell or with wofi, everything is working and I can use C-c C-l to load .agda file like it is described in hello world example. The problem is, if I run emacs from fuzzel or run in fish swaymsg "workspace 2; exec emacs" which is command in sway to run emacs on startup, I got this error:

Warning (initialization): An error occurred while loading ‘/home/esnos/.emacs’:

File is missing: Cannot open load file, No such file or directory, /bin/bash: line 1: agda-mode: command not found


To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

And I don't know how to fix this. Do you know what to do?

Here are my $PATH and agda-mode locate and .emacs file if that helps:
❯ echo $PATH
/home/esnos/.cabal/bin /home/esnos/.ghcup/bin /home/esnos/.nix-profile/bin /home/esnos/.cabal/bin /home/esnos/.ghcup/bin /nix/var/nix/profiles/default/bin /usr/local/sbin /usr/local/bin /usr/bin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /home/esnos/.local/bin /home/esnos/.nix-profile/bin /home/esnos/.local/bin /home/esnos/.nix-profile/bin

❯ agda-mode locate
/home/esnos/.cabal/store/ghc-9.4.8/Agda-2.6.4.2-eabece16f139db93623853edaea423e91292299e5212c5d719ac9a29b5b1c0bc/share/emacs-mode/agda2.el


`.emacs`

https://redd.it/1azkdko
@r_emacs

Читать полностью…

/r/emacs

How to make project.el disregard .gitignore?

Title. I have projectA, and some of it files are .gitignored (for the purposes of version control), but i still would to be able to see in them in emacs when using project-find-file, etc.

Is there a way to make project.el disregard .gitignore?

I know i can "(project-find-file 'INCLUDE-ALL) ", but is there a way to set 1 one time so i can M-x project-find-file and it will just work (without any addtional flags.)

https://redd.it/1azcev6
@r_emacs

Читать полностью…

/r/emacs

native-lisp-file-inconsistent error with yes-or-no-p function

I hate to use this sub to look for help but I am at the end of the rope.

Since yesterday the execution of `(fset 'yes-or-no-p 'y-or-n-p)` leads to an error with the following backtrace

Debugger entered--Lisp error: (native-lisp-file-inconsistent "/home/xxxxxxx/.emacs.d/eln-cache/29.2-f682e022/subr...")
native-elisp-load("/home/xxxxxxx/.emacs.d/eln-cache/29.2-f682e022/subr...")
comp--native-compile((lambda (arg20 &optional) (let ((f #'yes-or-no-p)) (funcall f arg20))) nil "/home/xxxxxxx/.emacs.d/eln-cache/29.2-f682e022/subr--trampoline-7965732d6f722d6e6f2d70_yes_or_no_p_0.eln")
comp-trampoline-compile(yes-or-no-p)
comp-subr-trampoline-install(yes-or-no-p)
fset(yes-or-no-p y-or-n-p)
(progn (fset 'yes-or-no-p 'y-or-n-p))
elisp--eval-last-sexp(t)
eval-last-sexp(t)
eval-print-last-sexp(nil)
funcall-interactively(eval-print-last-sexp nil)
command-execute(eval-print-last-sexp)

This looks beyond my capability already at this point... it looks like the yes-or-no-p function gets compiled and reloaded after just one line of code and it is already "inconsistent" (like the loader does not like what the compiler just compiled)

I think this is the final surfacing of some incompatibility between the latest emacs versions (this is **emacs 29.2**) and my decrepit **Ubuntu 18.04** on my even older laptop.

This is emacs 29.2 installed by means of `snap install emacs --stable --classic`

This problem also is present when loading centaur-tabs and org-roam, and, more mysteriously, the first strange thing that happened that day is that **the emacs icon disappeared**. The latest made me think of disk failure, but SMART is OK and after removing an re-installing emacs the problem persisted. I also deleted the offending .eln file, which was promptly rebuilt at the next call to `(fset 'yes-or-no-p 'y-or-n-p)` just to give the same exact problem.

TL;DR I think this would be a bug, but only if my os and laptop were more recent, is my reading correct?

What can I further inspect or try, to dig deeper in this problem? Should I post a bug report to the emacs maintainers?

Thanks in advance.

https://redd.it/1ayxyz8
@r_emacs

Читать полностью…

/r/emacs

How to play media on Emacs (Linux and Android) using MPV

Hi all,

I have made a guide on how to play media (local and remote) using Emacs and MPV so it works with unified config across both Linux and Android.

To install and configure the GUI Emacs app on Android and see my unified configuration file you can check out my dotfiles on danijelcamdzic/dotemacs and also read about it in one of my previous posts - Sharing my Emacs workflow and dotfiles

Up until now, I wasn't able to get a working config which would allow me to play media through the MPV commands in my Android Emacs but I have figured it out and would like to share the steps for anyone who, like me, wishes to quickly check out their knowledge base, movie collection, song collection etc. in Emacs and quickly play them on your phone.

The steps are described in my README - MPV section and this is how it looks like when I try to play a video on my Emacs Android:

Android Emacs with MPV

​

https://redd.it/1az1l50
@r_emacs

Читать полностью…

/r/emacs

mu/mu4e release 1.12

Hi all!

As you may know, mu4e is an email client for emacs. It consists of a server program that scans your email messages and an emacs program talking to this server program, as well as a number of command-line utilities.

I'm happy to announce mu 1.12, a new stable release which has been in development for ca. 1 year since the 1.10.

Some highlights:

Significant speedups in both mu and mu4e
Reworked message composition, closer to its Gnus origins which adds many of its features
Overhauled the query parser; squashing a number of bugs/limitations, incl. dealing with CJK messages
Experimental folding of message threads
Better and faster indexing of HTML messages
Experimental search by (human) language wit CLD2

For all the news: https://github.com/djcb/mu/blob/master/NEWS.org and grab the code here: https://github.com/djcb/mu/releases/tag/v1.12.0

https://redd.it/1ayxhk6
@r_emacs

Читать полностью…

/r/emacs

justl-mode release v0.14

justl is a major mode for driving justfiles. Justfiles are a way to save and run project-specific commands. Think of them like Makefiles, but they are purely focused on running commands and processes, and not for a build system.

​

This mode gives the ability to execute just recipes from within the editor itself.

​

The new release with the changelog details here: https://github.com/psibi/justl.el/blob/master/Changelog.org#014

​

The major highlight in this release is support for per recipe buffer and a major rewrite from Steve Purcell.

​

Links with more details:

\- Emacs extension: https://github.com/psibi/justl.el

\- Just project: https://github.com/casey/just

https://redd.it/1aylndb
@r_emacs

Читать полностью…

/r/emacs

lsp-mode starting every lsp server I've ever used

This seems like really bizarre behavior to me, but when I enable lsp-mode in one project, it spawns lsp servers for every project I've used.

​

This seems like really bizarre behavior to me, and I'd really prefer it to only use the lsp server for the current project.

​

Anybody know how to get that working that way?

https://redd.it/1ayckf6
@r_emacs

Читать полностью…

/r/emacs

ELISA - ellama with Emacs knowledge
https://player.vimeo.com/video/916011595

https://redd.it/1ay4z0s
@r_emacs

Читать полностью…

/r/emacs

Have any of you here been able to get gpt4all working in emacs with the gptel package?

Greetings,

I'm having trouble getting this to work, linked below is the github issue, if any of you would like to take a look, thanks.

https://github.com/karthink/gptel/issues/222

https://github.com/karthink/gptel

https://redd.it/1b06xdz
@r_emacs

Читать полностью…

/r/emacs

Display behavior using Consult

I've been working on writing some wrapper functions in consult for my workflow, and for the life of me can't seem to figure out how to get a particular behavior in the consult menu.

The behavior I'm looking for is exemplified by consult-gh: https://github.com/armindarvish/consult-gh. If you take a look at the demo GIFs in the README, you'll see that when repos are searched for, it shows a list where each repo has multiple "columns:" one for the repo author/name, one for it being public or private, one for a date, and one for a description. Looking at the source code, I see that the author of this package in particular used propertize to get different faces for each part, but it's not clear to me how to get the column alignment looking nice. Suggestions on the column alignment would be most appreciated!

https://redd.it/1b007pl
@r_emacs

Читать полностью…

/r/emacs

Daemon behavior is truly bewildering

I'm pretty new to Emacs, so go easy on me if I'm missing something obvious, but I've read all of the documentation that I could find on running Emacs as a server and every time I think I've fixed the issue something strange happens again.

I am on version 29. Currently, the way I start the daemon is with systemd. I enable and start the service as the documentation shows.

The issue has to do with where the daemon creates the socket. Sometimes when I boot up my machine, everything works exactly as I expect it to: I can simply run `emacsclient -nc` and it pops right up. I can also set my shell environment variable EDITOR to emacsclient and open files easily that way. When things are working right, I note that the socket is in /run/user/userID/emacs/server.

Probably half the time I boot up, the socket is in \~/.emacs.d/server/server, which means I have to pass the path to the socket to emacsclient for it to work. This means I have to change the scripts bound to my keybindings, etc., every time this happens. Pain in the butt. And for some reason I don't understand, setting EDITOR=emacsclient -cn -s /path/to/server doesn't work the way I want it to. It opens up a new frame, but does not open a buffer with the current file.

So my questions more broadly are

1. How does Emacs determine where it creates the socket? You would think it just looks at server-socket-dir, but there's obviously more to it than that, because it changes it up on me regardless of whether I explicitly set that variable.
2. And does anybody have any hunches as to what could be causing it to seemingly randomly flip back and forth between socket locations?

https://redd.it/1azwz2b
@r_emacs

Читать полностью…

/r/emacs

Help with Emacs performance (font-lock-mode)

Hello, I need some help assessing the root of my performance problems when using Emacs, especially while using org mode.

If while writing an Org document I end up with a rather long paragraph (\~550 chars), editing becomes noticeably slow to the point of being pretty annoying and kinda frustrating.

I ran the profiler of Doom Emacs (https://imgur.com/a/nMYWLOz) and my results show that jit-lock, which IIRC is like a variant of font-lock, and more especifically jit-lock-fontify-keywords-region, is my main culprit here, or at least the most notable one.

After that, I disabled font-lock-mode in my buffer and the editing was snappy again, so I tried disabling some modes inside that same buffer but to no avail.

My hunch here is that either I'm facing an Emacs limitation or maybe it's just my hardware being too slow. I'm leaning more towards the latter, but I'm pretty new to Emacs so I just don't know (and can't reliably test this in my other, more powerful laptop).

So what do you think? What could I do to mitigate this while not sacrificing too much of the eye-candiness of Org?

Thanks in advance!

My PC specs:

* CPU: AMD Ryzen 3 3250U (2 cores, 4 threads @ 2.6 GHz) w/integrated GPU.
* RAM: 12 GB DDR4 @ 2400 MT/s
* Screen: 1920x1080p LCD LED

https://redd.it/1azrmul
@r_emacs

Читать полностью…

/r/emacs

Why has the define-package function been obsoleted in Emacs 29.1?

While doing some package maintenance, I've noticed that when visiting "circe-pkg.el" file, flycheck highlighted the `define-package` function as obsolete. So I went to the source and found the following, suggesting it has been obsoleted in Emacs 29.1 without a replacement to use:

(defun define-package ( _name-string _version-string
&optional _docstring _requirements
&rest _extra-properties)
"Define a new package. [...]"
(declare (obsolete nil "29.1") (indent defun))
(error "Don't call me!"))

I've checked the git blame output and found nothing useful in the commit message motivating this either:

ade7a212a882540178d9504e7e0bd3be3bf1fd41
Author: Stefan Kangas <stefankangas@gmail.com>
AuthorDate: Mon Jul 11 12:41:50 2022 +0200
Commit: Stefan Kangas <stefankangas@gmail.com>
CommitDate: Mon Jul 11 12:51:00 2022 +0200

Parent: c0ced4e4998 Prevent setting user time if the WM doesn't support it
Merged: emacs-25
Contained: master
Follows: emacs-28.1.90 (157359)
Precedes: emacs-29.0.90 (6898)

* lisp/emacs-lisp/package.el (define-package): Make obsolete.

No mention in the NEWS file either or on emacs-devel.

The best explanation I have for this is the following:

- You're not supposed to call the function, it merely acts as special
syntax for package.el to interpret.
- Outright removal of the function is a bad idea due to people looking
up its docstring.
- Before actually removing a function, it is obsoleted to detect
people still using it and give them ample time to adjust.

I still find obsoletion shows the wrong signal here. One is still supposed to use it [as seen in the elisp reference](https://www.gnu.org/software/emacs/manual/html_node/elisp/Multi_002dfile-Packages.html) and marking the function as obsolete only creates more confusion. What was the motivation to do that?

https://redd.it/1azpaei
@r_emacs

Читать полностью…

/r/emacs

Red Meat Friday: Is Emacs Dying?
https://irreal.org/blog/?p=11995

https://redd.it/1azmvvs
@r_emacs

Читать полностью…

/r/emacs

Change hjkl to jkl; evil mode
https://redd.it/1azi3zn
@r_emacs

Читать полностью…

/r/emacs

Handling old spread around notes as an org-roam user

I'm a big fan of org-roam and would like to add all of my old notes in there of course! These notes are spread over a lot of directories on my system and in different formats (.txt, .md, .doc). Migration to org-roam will make navigating through all of my notes much more comfortable and I already migrated most of my notes.

The last notes I want to migrate have a "directory context". For instance holiday notes in my pictures directory. I am considering to copy/paste these files to org-roam and add a tag to the directory and delete the old note. The downside is that this is kinda an org-roam lock in, because migrating these notes back could be a PITA. If I use a special tag in the roam-note to the original directory then it is possible to migrate the files back with a simple elisp script I guess but could break when directories are renamed in the future. Hopefully I am making myself clear .

Just before sending this to Reddit a light bulb went off. I could copy/paste the original note in the org-roam note in a code block and tangle it to this directory. I would prefer to not use a code block but something like this seems to be the way.

How are you guys dealing with old "directory context" notes?

https://redd.it/1azjjtb
@r_emacs

Читать полностью…

/r/emacs

How to edit root files on Android using Emacs app (not on Termux) ?

Anyone managed to get this working?

https://redd.it/1az83ju
@r_emacs

Читать полностью…

/r/emacs

DOOM EMACS EWW not spiting vertically

Hi, new to emacs world, been a vim user for years, wanted to try doom emacs, i was trying to read a wiki page using eww, and for some reason, it always spawns the window bottom, even if i tried to split that vertically, using c-w v. is there something I'm missing? or how do i solve this. I like to keep textbooks or wiki pages to the right side of code window. Thanks,

https://redd.it/1az0iab
@r_emacs

Читать полностью…

/r/emacs

Fix a gap in my elisp understanding

I need some help resolving a gap in my understanding of elisp. I have a hard time understanding what kinds of arguments a function expects. Here is an example with define-key, but happens to me with lots of functions. Basically, I can never tell if an argument needs to be quoted. Correct usage of define-key:

(define-key gnus-article-map (kbd "i") #'gnus-article-show-images)

I frequently make the error where I think I am supposed to quote the keymap. I have to look up some old code to see, oh yeah, you don't quote the keymap.

Then when I use use-package, I would write

(use-package gnus
:bind
(:map gnus-article-map
("i" . gnus-article-show-images)))

Now the function gnus-article-show-images is unquoted, I guess, because this is a macro? The structure of the arg list to :bind is unclear from the function documentation, so I just have to look up another example where I used :bind to figure out the format. Anther example, in general-define-key both keymap and function are quoted. Why?

What am I missing so that I can better understand whether args need to be quoted or not?

https://redd.it/1az0rjg
@r_emacs

Читать полностью…

/r/emacs

eglot + omnisharp-roslyn + tramp .net8 timeout

Hi,

do you have a working solution where the omnisharp-roslyn is working well with eglot and tramp ?

should it work well ?

https://redd.it/1ayra55
@r_emacs

Читать полностью…

/r/emacs

More UI progress - drag and drop tabs

I've settled on using tab-line for my tabbing because it fits my normal workflow. However I like my tabs to basically operate the same way as in the browser and terminal. After some work and references to the tab-bar implementation I finally have drag and drop tab movement working. The prerequisite is keeping the tabs in a fixed order (also a desired behavior) rather than relying on whatever happens to be the state of buffer-list as is the default.


(setq my-tab-line-buffer-list ())

;; Filter special buffers from tab-line while maintaining current order
(setq tab-line-tabs-function
(lambda ()
(let* ((current-tabs (--select (buffer-file-name it) (buffer-list)))
(intersect-tabs (--select (member it my-tab-current) my-tab-line-buffer-list))
(new-tabs (--select (not (member it my-tab-line-buffer-list)) my-tab-current)))
(setq my-tab-line-buffer-list (append intersect-tabs new-tabs)))))

(defun tab-line-mouse-move-tab (event)
"Move a tab to a different position on the tab line.
This command should be bound to a drag event. It moves the tab
at the mouse-down event to the position at mouse-up event."
(interactive "e")
(let* ((from-str (posn-string (event-start event)))
(to-str (posn-string (event-end event)))
(from-rowcol (posn-col-row (event-start event)))
(to-rowcol (posn-col-row (event-end event)))
(from (tab-line--get-tab-property 'tab (car from-str)))
(to (tab-line--get-tab-property 'tab (car to-str))))

;; (message "move %s p:%s to %s p:%s" from-str (car from-rowcol) to-str (car to-rowcol))

;; Only adjust if the two tabs are different
;; if going left to right add on the right and vice versa if going right to left
(unless (or (eq from to) (eq from t) (eq to t))
(setq my-tab-line-buffer-list
(reverse (let (value)
(dolist (elt my-tab-line-buffer-list value)
;; add the element in its new position moving leftwards
(if (and (equal elt (get-buffer to)) (> (car from-rowcol) (car to-rowcol)))
(setq value (cons (get-buffer from) value)))
;; add all other elements in old position
(if (not (equal elt (get-buffer from)))
(setq value (cons elt value)))
;; add the element in its new position moving rightwards
(if (and (equal elt (get-buffer to)) (>= (car to-rowcol) (car from-rowcol)))
(setq value (cons (get-buffer from) value)))
))))
(force-mode-line-update))))

;; Add on our extra key map for the drag event
(keymap-set tab-line-tab-map "<tab-line> <drag-mouse-1>" #'tab-line-mouse-move-tab)




demo video

https://redd.it/1ayec4v
@r_emacs

Читать полностью…

/r/emacs

Need guidance/learning on how list works with interactive

Hi Experts

&#x200B;

A very basic question. I am very new to emacs so please bear with me.

&#x200B;

I understand how to pass arguments to an elisp function.

&#x200B;

but not able to comprehend how to use it in conjunction with a list

for example

(interactive
(list
(read-shell-command (if shell-command-prompt-show-cwd
(format-message "Async shell command in %s': "
(abbreviate-file-name
default-directory))
"Async shell command: ")
nil nil
(let ((filename
(cond
(buffer-file-name)
((eq major-mode 'dired-mode)
(dired-get-filename nil t)))))
(and filename (file-relative-name filename))))
current-prefix-arg
shell-command-default-error-buffer
)
)

i can understand what this code does, but because i dont understand how/what arguments the list will take e.g. \
read-shell-command`/`current-prefix-arg`/`shell-command-default-error-buffer`/`read-string`

i am having a hard time creating one myself.

&#x200B;

Can someone please explain this to me in a simple way?

Also what all can i pass?

&#x200B;

i can think of command line arguments in couple of forms:

1. shell command
2. string
3. integer
4. file
5. buffers
6. perfix

etc.

I am guessing there will be a particular form of these commands i should use.

TIA

&#x200B;

https://redd.it/1ay9jij
@r_emacs

Читать полностью…

/r/emacs

Cycles all way down
https://coredumped.dev/2024/02/23/cycles-all-way-down/

https://redd.it/1ay2ydz
@r_emacs

Читать полностью…
Subscribe to a channel