reshared this
Over the weekend I was messing around with ibuffer, integrating my custom ibuffer groups with @sanityinc's ibuffer-vc (recommended).
I was surprised to discover that documentation for ibuffer (in since 22.1?) is ... sparsely documented. But it was fun to get it working because the code (and Steve's add-on) is
PERFECTLY LIMPID
(the real story here is that I have been waiting a lifetime to drop the phrase "perfectly limpid" for internet points and here is my opportunity)
Let Emacs' ibuffer-mode group files by git project etc., and show file state - purcell/ibuffer-vcGitHub
James Endres Howell reshared this.
@jameshowell @sanityinc I also use Ibuffer but I am slightly annoyed that point changes on auto update (in contrast to Buffer-menu-mode). I would like to fix this sometimes.
@minad My annoyance with ibuffer:
The filter groups are defined as a list (of lists), which (per the definition of list) has an order.
That order determines the logic of which buffers get assigned to which groups. That order also determines the order in which those groups get displayed.
Sometimes I want those orderings to be different. Which would require two lists.
Each element already has a name string, so a display-order list could reference elements in the filter-order list. But that gets complicated when some of the elements are generated dynamically, like from ibuffer-vc.
This annoyance is probably not worthy of the effort to rewrite the package with a different abstraction. Especially not the effort to do so without introducing breaking changes.
A butler for your buffers. Group buffers into workspaces with programmable rules, and easily switch to and manipulate them. - alphapapa/bufler.elGitHub
Agreed. I think the point to stress here is that users can decide. Hydra, for example, always struck me as relatively bloated, buggy, and a little too idiosyncratic with respect to (at least my mental models of) Emacs internal and UI conventions. But obviously it was very popular! Let a thousand flowers bloom. Cherish the Four Freedoms 😀
@James Endres Howell @Steve Purcell @Bharath M. Palavalli @Philip @Daniel Mendler That's the beauty of Emacs: if you don't like it, it's infinitely customizable, and you can massage it into something you do like (assuming you're willing to do some digging).
There's also something to be said for an out-of-the-box solution that's close enough. I just prefer the former.
I have the same issue with @Tutanota : my emails never make it to some recipients. I’ve never sent a single spam on my life. The only factor I was able to isolate is that anything going to Gmail or a Google-managed address doesn’t make it, which I assume means it was caught in some spam filters. But it’s not the only factor. I just haven’t figured out what makes it so I can’t write to some other addresses.
It’s really a PITA, forcing me to keep another email.
@Celeste Ryder 🐾 🐀🏳️🌈 @Tuta The weird thing is that it works if I use any other client. I'm still trying to figure out what the problem is. When I find it in my spam box and I click "why is this marked as spam" it says that it's there because it resembles other messages that have been marked as spam.
In other words: we put it in spam because we thought it looked like spam, which is... unhelpful.
like this
reshared this
You might want to try Wanderlust -- I find it very useful for email handling.
On the other hand I must admit I never really liked GNUS, even for Usenet.
Is there a way in #emacs #org-mode to next quote blocks? The following doesn't seem to work.
#+begin_quote
This is a quote.
#+begin_quote
This is a quote within the quote.
#+end_quote
#+end_quoteEmacs is ignoreing the second #+begin_quote and just closing the quote block at the first #+end_quote.
Edit: So the solution I settled on was putting the nested quote in a drawer named :quote:. it's not an ideal solution, but for my purposes in this case it's... fine, I guess.
God help me if I ever need three levels of nesting.
Maybe this:
emacs.stackexchange.com/a/1703…
Is there a way to convince org-mode to export nested blocks as nested elements? This would be really cool to handle nested quotes in html emails with mu4e. #+BEGIN_QUOTE hey ho #+Emacs Stack Exchange
Does anyone happen to know if there's an easy way to get #emacs's nov.el package to display text using the #OpenDyslexic font? I was hoping there was a customization variable, but it seems not.
Perhaps I could run it in a terminal editor and change the terminal's font, but then I'd lose things like images.
I can hack something together if I really need to, I'd just rather not if there's a simpler solution available.
Edit: I was able to do this through M-x customize-face
reshared this
As it happens, I was changing font on #Emacs just yesterday. M-x menu-set-font will open a font browser and let you choose, and it works. You can also select this from the 'Options' menu.
This however isn't 'sticky' -- next time you start emacs it will have reverted.
I found that
(set-frame-font "OpenDyslexic")
in my init.el works to change it persistently.
Jonathan Lamothe likes this.
nov seems to use shr to render text, and that uses the variable-pitch face unless nov-variable-pitch is set to nil (in which case it just uses the default face.
So if you customize the variable-pitch face you should be in business!
So, I've started a new job. In said job, I'm editing a document which I've spent a couple hours working on. This is all being done in a browser.
I reach a point where I want to search backward through the text for a name, so my #emacs brain says, "Easy peasey, that's just C-r", which I press... reloading the page.
It's at this point I have a minor heart attack, and consider myself lucky that their web app frequently saves my work.
like this
Shannon Prickett reshared this.
(defun lambdamoo-tab-complete ()
"Complete user input using text from the buffer"
(interactive)
(when (memq (char-before) '(? ?\r ?\n ?\t ?\v))
(user-error "Point must follow non-whitespace character"))
(let (replace-start
(replace-end (point))
replace-text found-pos found-text)
(save-excursion
(backward-word)
(setq replace-start (point)
replace-text (buffer-substring replace-start replace-end))
(when (or (null lambdamoo--search-text)
(not (string-prefix-p lambdamoo--search-text replace-text t)))
(setq-local lambdamoo--search-text replace-text)
(set-marker lambdamoo--found-point (point)))
(goto-char lambdamoo--found-point)
(unless
(setq found-pos
(re-search-backward
(concat "\\b" (regexp-quote lambdamoo--search-text))
(point-min) t))
(setq-local lambdamoo--found-point (make-marker))
(user-error "No match found"))
(set-marker lambdamoo--found-point found-pos)
(forward-word)
(setq found-text (buffer-substring found-pos (point))))
(delete-region replace-start replace-end)
(insert found-text)))reshared this
@Omar Antolín Actually, looking more closely at it, it might just do the trick.
I love it when I spend hours re-writing code that essentially already exists. ;)
In the end, I wound up just binding tab to dabbrev-expand. 🙃
It might seem like I wasted a bunch of time writing that, but at least I learned a bunch along the way.
I'm certain I have reinvented a wheel here, but for the life of me I can't find it. Have I?
(defmacro jrl-extract-list (vars list &rest body)
"Split a list into indiviual variables"
(let ((list* (gensym)))
(append
`(let ,(cons (list list* list) vars))
(seq-map (lambda (var)
`(setq ,var (car ,list*)
,list* (cdr ,list*)))
vars)
body)))Edit: Of course it was pcase.
I just put a call to eval in my code and I feel dirty now.
The context went something like this:
(eval (cons 'concat (my-function arg1 arg2)))(concat . (my-function arg1 arg2))(concat my-function arg1 arg2)Is there a better way I could've written this?
#emacs #lisp #elisp
Edit: Got my answer. I wanted:
(apply 'concat (my-func arg1 arg2))Edit 2:
It turns out the code I really wanted was:
(string-join arg2 arg1)Edit 3:
Here's the actual code:
(defun lambdamoo-run-text-replacements (str)
"Perform text replacements on the string"
(dolist (vals lambdamoo-text-replacements)
(let* ((from (car vals))
(to (cdr vals))
(split (split-string str from)))
(setq str (string-join split to))))
str)like this
@Simon Brooke What I was looking to do was to call concat with the list returned by (my-function arg1 arg2) used as arguments.
As it turns out, all the functionality I was looking for was already supplied by the string-join function. I just didn't know it existed.
(catch :abort
;; do something
(when condition
(message "A bad thing happened")
(throw :abort nil))
;; do something else
)(progn
;; do something
(when condition
(user-error "A bad thing happened"))
;; do something else
)like this
#Elisp logic:
All interned symbols can be found in a lookup table. This table is bound to the obarray symbol.
Hang on a minute...
I can only assume that the underlying C code has its own pointer to this table and the obarray symbol is only provided as a convenience for elisp functions that can't see this pointer?
#emacs #lisp
No no, the obarray you see from elisp is the same one used by the reader. Elisp is an old-style Lisp here, and the obarray is a first-class thing: you can make a new one, rebind obarray, etc.
That's the sort of thing people don't do much anymore, but used to do. The documentation covers it reasonably well gnu.org/software/emacs/manual/…
Shannon Prickett reshared this.
(defmacro lambdamoo-chatter-interact
(func-name to msg docstring fmtstr &rest vals)
"Define a function for interacting with another player"
(let ((proc (gensym))
(str (gensym)))
`(defun ,func-name (,proc ,str)
,docstring
(let ((,to lambdamoo-chatter)
(,msg (substring-no-properties (lambdamoo-command-text ,str))))
(if ,to
(funcall lambdamoo-send-line ,proc
(format ,fmtstr . ,vals))
(message "No chatter specified"))))))
That's awesome. I need to hear my own advice, of course, but don't be inhibited to share something that isn't finished. It's the Fediverse! We're all anarchists! The kind sort, I mean.
Lisp macros are just so powerful.
Wait, how do you get the awesome code formatting? Anybody know how to configure this on fediscience.org?
AM I GOING TO HAVE TO SPIN UP MY OWN INSTANCE AGAIN
@James Endres Howell Frendica has a markdown add-on.
I just typed:
```lisp
...code...
```
I am dangerously close to unleashing my first #emacs package on the public. It's nothing fancy and still relatively niche, but I deem it potentially useful enough to be worth publishing.
There are a couple small features I want to add and a few things that still need some polish, but it's almost ready for a version 0.1 release.
It's not anything ground breaking or anything. I'm still pretty much an #elisp novice, but I'm proud of it anyway.
More details when it's released.
like this
@Álvaro R. At this point all I need to add is a README and two features (which will mostly reuse code I've already written just in a slightly different way).
Surprisingly enough, the hardest part of the whole project was getting it to display numbers with thousands separators. That code might exist in the bowels of the calc package, but it was easier to just roll my own.
Okay, my first #Emacs package is officially released. It was strongly inspired by @Soroban Exam Website's work, providing practice tools for the #soroban. This is the first Emacs package I've ever released. It's probably not perfect, but I welcome feedback on how it can be improved.
I wonder if there is an overlap of more than say five people who are both soroban and emacs users. 🙃
Anyhow, it can be found at: codeberg.org/jlamothe/soroban
reshared this
vim guy here. happy to see I inspire others...
May be you could post on our forum. Not sure you will get more users, though
@Soroban Exam Website Might as well. I wrote it mainly for myself, partly because I don't own a printer and this makes it easier to practice when working from a computer screen, but also just to see if I could.
Still, if someone else is going to find it useful, that's probably the place I'll find them.
May be you didn't see you that you can generate an interactive HTML output, on the site.
That was designed for people who don't want to print.
Should I make it more visible?
format to use a thousands separator? That'd be nifty, but it doesn't look like there is a way.
There's a simple way to first convert a number to a string with comas:
harryhaller likes this.
I've been playing around with keymaps. Apparently they can be used to create menus that give the user a visual list of options. The canonical way to make them is aparently with make-sparse-keymap to create the menu and define-key to add options to it, but this causes some confusing behaviour.
Take the following example:
(let ((menu (make-sparse-keymap "My menu")))
(define-key menu "a"
'(menu-item "Foo" foo))
(define-key menu "b"
'(menu-item "Bar" bar))
menu)(keymap (98 menu-item "Bar" bar) (97 menu-item "Foo" foo) "My menu")Now, I understand that the nature of lists in lisp make inserting an element at the top of the list less computationally expensive, but when you've already got to walk the whole list anyway to ensure the key binding isn't already present, this no longer feels like an adequate excuse.
Am I missing something?
like this
Wes reshared this.
Define key is my least favorite way to make a keymap.
I like defvar-keymap, bind-keys, if you've got a map create already. Like a sparce map.
General is nice too. But then you have to have that installed.
Jonathan Lamothe likes this.
M-x function calls because I had such a hard time finding key sequences that weren't used by something else. Since learning that C-c /[A-Za-z]/ is reserved for user-defined keybindings, I've gone mad with power.reshared this
C-z suspends Emacs and drops me back to the terminal until I issue the fg command to bring it back. I use this for issuing git commands. I could probably do this from within Emacs, but I haven't bothered to figure it out.
@Zenie That's an option, but my concern is that the reason they might be vague in the docs is because the specific error might change in future versions.
Perhaps I'm just being overly paranoid.
I think I've been able to pin down what it is that I like about #Emacs so much. When I first started using computers, I was using a TRS-80. If you didn't have a cartridge inserted, It'd boot directly into BASIC where you could program the machine directly. That wasn't a bug, it was a feature.
Modern computing seems to do its best to hide all that stuff away. Everything is treated more like a simple (albeit specialized) appliance, not a powerful machine that can be made to do literally anything you want. Instead, it's about what the various software vendors want it to do.
Emacs by contrast not only gives you all the tools you need to modify it in any way you want, but actively encourages you to do so. It feels a lot more like the computing systems of old. Perhaps that's not for everyone. There's a reason computers were so niche back in the early days. Most people just didn't care to learn what was going on under the hood, and that's valid. There's something to be said for a tool that just works effortlessly out of the box. Also, to be clear, you don't strictly speaking need to dig into the internals to use Emacs, but I prefer for my technology to serve me, and I'm willing to put the effort in to make that happen.
That's why it's a good fit for me.
reshared this
like this
screwlisp reshared this.
You could try package-build-create-recipe
It will need to be filled in, but if your headers are correct, with author, packages-required, version, etc.
Edit the recipe for your git. You'll be in recipe mode.
Saving it puts it in .../elpa/recipes/
Building it with C-c C-c will make a package and install it in your elpa..
That might teach you what you need.
It will automatically pick up .el and .texi files.
Not eld, but if you have some odd file, you can add the pattern to the recipe. I have an eld which is not in the list of automatic files.
See the contributing doc at GitHub Melpa.
Jonathan Lamothe likes this.
You want something like this?
See the link to elpa-deploy halfway down.
reshared this
Laurent Gatto reshared this.
Per the help doc for org-agenda
"If the current buffer is in Org mode and visiting a file, you can also
first press ‘<’ once to indicate that the agenda should be temporarily
(until the next use of ‘SPC o a’) restricted to the current file.
Pressing ‘<’ twice means to restrict to the current subtree or region
(if active).
"
In other words, execute org-agenda then press "<" before the command you want to run against the agenda.
@a world without cars I have a markdown plugin on my Friendica server. I just put it between backticks like this: `org-agenda-files`.
This wouldn't work on Mastodon though.
you could do something like this
```
(defun my/file-agenda ()
(interactive)
(when-let ((org-agenda-files (list (buffer-file-name (current-buffer)))))
(org-agenda)))
```
Quiou reshared this.
Jonathan Lamothe likes this.
Just spent a good half hour pulling my hair out trying to figure out why one of the #elisp functions I had just written was always returning nil when I tested it. Turns out, my test was mistakenly passing its inputs to the wrong (but similarly named) function (pivot-table-get-columns instead of pivot-table-get-body).
#Haskell's type system would've caught this. 🙃
C's type system would also have caught it, and it isn't worth a hill of beans.
By caught it what do we mean? This is not a case of some undetected error escaping your attention due to dynamic typing. You know you got a nil which is unexpected and wrong. It's in a test case which catches it.
The only thing a type system would change is that you would instead waste a half hour not understanding how your obviously correct function call can possibly have the wrong return type.
nil is about the least useful failure state there is.
like this
reshared this
Aggregate tables in Org mode. Contribute to tbanel/orgaggregate development by creating an account on GitHub.GitHub
Jonathan Lamothe likes this.
you might also be interested in mastodon.online/@hajovonta/114…
like this
@Alessio Vanni Yeah, it's just very magic number-ey.
Ah well, such is the way it is with legacy code sometimes. No way to change it without breaking about a billion other things.
like this
I like using org tables with org-babel like so:
#+NAME: test
| 1 | 4 |
| 2 | 5 |
| 3 | 6 |
#+begin src emacs-lisp :var test=test
(mapcar
'(lambda (r)
(mapcar '(lambda (x) (* x x)) r)) test)
#+RESULTS:
| 1 | 16 |
| 4 | 25 |
| 9 | 36 |
like this
Harald reshared this.
I have successfully built my first #Emacs package. I want to clean it up a bit before I consider releasing it though. Also, while I can build a simple (single file) package, buildig a multi-file one is still eluding me.
When I try to install it, I get the following (less than helpful) error message:Wrong type argument: stringp, nil
Is there a way I can get more detail on why this is failing?
reshared this
here’s a large project, still in one file:
Simple notes for Emacs with an efficient file-naming scheme - protesilaos/denoteGitHub
@🇺🇦 Myke Yes, it can be done that way as well.
That still doesn't negate the point that I want to know how to build a multi-file package.
Besides, sometimes I like to learn stuff just for the sake of learning it.
Dave Marquardt
in reply to Jonathan Lamothe • • •Jonathan Lamothe
in reply to Dave Marquardt • •superketchup
in reply to Jonathan Lamothe • • •Jonathan Lamothe
in reply to superketchup • •superketchup
in reply to Jonathan Lamothe • • •gnus/nnatom 5c0cf970799: Add nnatom.el
mail.gnu.orgDave Marquardt
in reply to superketchup • • •@superketchup Right, I started using nnatom in the past few weeks and noticed its part of Gnus now. I've also running Gnus v5.13. Maybe there was no version bump when they brought nnatom in?
I had problems getting nnatom to work. IIRC it does not want http:// or https:// when specifying the server, unlike nnrss.
Tonus
in reply to Jonathan Lamothe • • •