Emacs

311 readers
3 users here now

A community 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

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
476
3
Introducing elfeed-curate (bobonmedicaldevicesoftware.com)
submitted 1 year ago by [email protected] to c/[email protected]
477
 
 

Does anyone else have the same problem?

If I run sage-shell:run-sage to get a SageMath shell in Emacs, and run help(), I get the standard help message, which starts with "Welcome to Sage 10.1!".

But if I try help(diff) or any other specific function, Emacs hangs. Doing C-g allows me to use Emacs again, but the SageMath session is no longer responsive: trying to enter any other command results in hanging. Even C-c C-d no longer works, I have to try C-c C-\ and wait for the SageMath kernel to crash, or do M-x kill-process.

This all seemed to work before I upgraded Emacs and changed my package manager to straight.el.

I'm on Emacs 29.1, using sage-shell-mode v0.3.

I've covnfigured it as follows:

(use-package sage-shell-mode
  :straight t
  :defer t

  :custom
  (sage-shell:sage-executable (executable-find "sage"))
  (sage-shell:set-ipython-version-on-startup nil)
  (sage-shell:check-ipython-version-on-startup nil)
  (sage-shell:use-prompt-toolkit nil)
  (sage-shell:use-simple-prompt nil)

  )

(However, I find that the custom settings aren't being respected either ...)

I also use ob-sagemath, which allows me to use SageMath in org-src-blocks, which works fine as far as I can tell.

478
 
 

I have lsp mode breadcrumbs enabled and I have treemacs lsp installed as well. The icons used in the breadcrumbs and treemacs were really blurry so I installed treemacs nerd icons and now treemacs has icons that are much cleaner but lsp breadcrumbs still has the blurry icons.

Anyone know how to get a crisper icon in lsp mode breadcrumbs?

479
 
 

Hello Emacs users, I'm currently trying to re-do my own emacs configuration but after facing thousands of issues, indenting buffers is the one thing that's going to turn me bald in a matter of hours.

I'm trying to work with multiple languages, Go, Rust, Python, JS/TS, etc. The one thing I haven't figured out correctly is proper indentation without having to do keyboard gymnastics. I know that Emacs is more of a DIY thing, so any light shed here would be of great help.

I've already tried (add-hook …), using the :config section in my (use-package go-mode) declarations and more but none of them are having any visible effect.

Furthermore, I saw this issue with Go and I heavily suspect other programming languages won't come out as clean as I think.

Every time I edit a Go file, when adding a new line to anything that needs indentation (e.g: a function body, if, for, etc.) Two “4 spaces” tabs are inserted no matter what. Even when I press the `` key I have to backspace ALWAYS, also some closing delimiters like }) don't align properly, but I suspect that's another issue maybe fixed by puni.

The “best” thing I could do to prevent newlines from getting messed up on creation was turning off electric-indent, I've heard mixed opinions on that, some say it's great, some say it's terrible, I don't really know. Without electric-indent I don't have to backspace two tabs on a newline, but TAB still creates those two tabs, even when my modeline reports (TABx4). Here is a snippet of the important stuff in my configuration file.

(setq-default c-basic-offset 4
              tab-width 4
              indent-tabs-mode t
              standard-indent 4)

;; jsjsjsjs
(electric-pair-mode 1)

;; Disable electric-indent messing up my code >:(
(setq electric-indent-inhibit t
      electric-indent-mode nil)

If any of you could spare your elisp-fu powers to me, I would be extremely thankful. Thanks for your time in advance. :)

480
481
 
 

Hi, Gnu Emacs noob here. I'm having trouble debugging AUCTeX. When I run TeX-command-run-all with C-c C-a Biber is not run for some reason I can't figure out, and I must run it manually with C-c C-c Biber RET to have my citations properly compiled.

Does anyone know how I can forse C-c C-a to run Biber as well as the other commands?

My config is pretty vanilla and for AUCTeX is as follows:

;; Auctex
(require 'package)
(unless (package-installed-p 'auctex)
  (package-install 'auctex))

(require 'tex)

(push (list 'output-pdf "Skim") TeX-view-program-selection)

I'm running Emacs 29.1 downloaded from MacPorts on a MacBook Air m1.

thanks!

482
 
 

how to configure LSP (Language Server Protocol) for TypeScript with ESLint and Tailwind CSS in Emacs at the same time? am having difficulty please help am using lsp-mode

483
 
 

Hello!

I want to be able to expand/collapse my functions such like in the picture below.

https://preview.redd.it/yogs7dwo2irb1.png?width=1491&format=png&auto=webp&s=37f2ea9da455d523ca45e6f4c0af29fbc1ef86f7

These 3 dots; I want to be able to click them to open/close the code. I searched quite a bit and found nothing about having them open/close with mouse. If they can be opened/closed with keyboard as well even better, but mainly I want to with mouse.

The language I use is python.

Thank you!

484
 
 

The files have a relatively uncomplicated syntax. Plain statements ending with a semicolon, and blocks delimited by curly braces (see for example https://github.com/jtkristoff/junos/blob/master/firewall.conf).

I tried the junos-mode but it behaved rather weirdly.

Is there a programming language mode that will be suitable for this format?

If not, is there a mode which can do the following, or something close to these?

  • Backspace at whitespace indents properly with previous block
  • Ability to collapse and expand blocks depending on indent level or matching brace
  • spell check using words already used in the buffer

Will appreciate your help!

485
486
487
488
489
 
 
  • weary-traveler asked to add a new feature to Org publishing system.

    The use case is publishing using CI tasks, where a new, fresh image is created every time a web site is re-published. Such image does not preserve the original modification times of the source Org files, making Org publish re-generate everything every single time.

    The new suggested feature is (optionally) using last git commit time instead of file modification time.

    • Org already has somewhat similar functionality in a form of ={{{modification-time ...}}}= macro. See [[info:org#Macro Replacement][org#Macro Replacement]] section of Org manual.
    • Also, several other places in Org are relying on file modification time and might need to be considered.
    • Conclusion: the feature request is to be submitted to mailing list for more detailed discussion. (see https://orgmode.org/manual/Feedback.html#Feedback)
  • Tomas Volf asked where to start learning Org. Answer:

    1. Go to https://orgmode.org

    2. Click on "Worg" (Org wiki): https://orgmode.org/worg/

    3. Check out https://orgmode.org/worg/#learn

    4. I specifically recommend a short Org mode guide: https://orgmode.org/guide/index.html to get an overview of what is possible and https://orgmode.org/worg/org-tutorials/index.html with various use cases.

    5. Karl Voit later pointed to his usual suggestion to learn one thing at a time: https://karl-voit.at/2020/01/20/start-using-orgmode/

      • In short, Org is so large that it is useless to try learning everything. Just look quickly what is possible and use whatever is practically useful - small step at a time.
      • If nothing in Org is useful, do not use Org (yes, it is perfectly fine not to use Org ;])
  • As usual, a number of people use Org mode for a number of different things. This time, the participants mentioned

    • outlining documents and writing plain text notes
    • source blocks to run code from notes
    • note taking (sometimes on paper first, later copying to Org)
    • blogging
    • publishing to html
    • export to LaTeX
    • storing bookmarks from internet
    • working on HS/CS projects
    • People often start with one thing, but then it becomes convenient to re-use Org for more and more and ...
  • oatmeal described Emacs hanging when opening one specific Org file. Without further info, we could only offer generic tip to submit a bug report: https://orgmode.org/manual/Feedback.html#Feedback

  • William Denton asked about how yantar92 (me) uses Org mode to maintain Org mode :)

    Some highlights:

    • This setup is definitely not for beginners. Too many idiosyncratic things.
    • I use a single notes.org file for all the notes + a bunch of archive files for things I do not need to pop up in my searches (via org-ql).
    • Org mode maintenance involves dealing with a growing pile of bug reports, feature requests, patches, ideas, etc. I currently have over 1k (yes, over one thousand) actionable ideas recorded.
    • It is literally impossible for a single human to handle all these
    • So, I instead approach this using priority system
      • I collect everything Org-related (emails, github issues, reddit posts, blogs) into Org headings via https://github.com/yantar92/org-capture-ref
      • I categorize Org-related tasks into: (1) bugs; (2) feature requests; (3) maintenance tasks; (4) misc tasks; (5) specific non-trivial projects (task groups), like implementing new syntax or fixing particularly difficult bugs.
      • At any time, I limit my Org-related work to bugs, feature request, maintenance tasks, and a couple of projects (according to my free time).
        • I do it by setting todo keyword "NEXT" on active groups and "SOMEDAY"/"HOLD" on inactive groups
      • only active groups of tasks contribute to my agenda
      • I re-consider active groups every week during weekly review
      • More about my todo keywords: https://github.com/yantar92/emacs-config/blob/master/config.org#tasks
      • Inside each group, I only mark a couple (of several hundreds) of tasks as active (NEXT)
        • I only review non-active tasks when I run out of "active" (NEXT) tasks (and the area/project is thus "stuck")
        • Non-active tasks are marked with various levels of urgency, for easier review (I do not want to review all 300-500 tasks every time)
      • A/B/C priority
      • flagged/non-flagged
      • flagged "#A" tasks are the first to be marked "NEXT" during the review
      • Use https://github.com/yantar92/org-autosort
        • The active tasks are scattered across my multiple layers of agenda views: focused agenda (have to do today); normal agenda (do after I finish focused agenda); NEXT task list (tasks to consider if I finish everything that is actually scheduled for today)
      • More details at https://github.com/yantar92/emacs-config/blob/master/config.org#agenda--scheduling
    • As an aside, because of so many headings, I display many standard tags and todo keywords as UTF symbols: 🖂📎🏁📚🔔☐⯑☑✘▶👁⌛⏩⏸... for more compressed view
      • See https://github.com/yantar92/emacs-config/blob/master/config.org#items
      • Emacs allows to create you own non-standard symbols by combining multiple "glyphs" on top of each other: ~'(?🕒 (cc . cc) ?🚫)~ will draw 🕒 on top of 🚫, creating "prohibit clock" symbol. See help:reference-point-alist docstring more details about combining symbols in Emacs.
  • On working with large Org file

    • The key point when working with large Org files is ability to search things and narrow things down to the project/area you currently work on
    • One way is ~org-narrow-to-subtree~ and ~org-tree-to-indirect-buffer~ - it will limit Emacs buffer to specific subtree.
    • Sparse trees allow revealing specific headings in folded Org buffer - by todo keyword, by tag, by property, by regexp etc. See https://orgmode.org/manual/Sparse-Trees.html
    • One can even display Org buffer in a table form via https://orgmode.org/manual/Using-column-view.html
    • Org agenda, despite its name, is not limited to listing scheduled tasks. It is Editable search interface across multiple Org files. One can search for specific headings (via tag, property, scheduled, todo keyword, regexp, etc searches), see them as a list in agenda view, and edit by changing their todo keywords, scheduled, deadline, priority, etc See https://orgmode.org/manual/Matching-tags-and-properties.html
  • Tomas Volf asked about synchronizing Org files across multiple machines.

  • Karl Voit mentioned an alternative version of ~org-tree-to-indirect-buffer~: https://github.com/novoid/dot-emacs/blob/master/config.org#L7510

    • It allows multiple indirect buffers (built-in version needs customization for multiple indirect buffers; it kills previously existing indirect buffers by default)
    • It uses different naming scheme.
  • Karl Voit mentioned a convenient way to copy html markup to Org markup: https://github.com/kuanyui/copy-as-org-mode

  • Side track: why not using ChatGTP to implement new features? ... which does not work most of the time without manual editing :)

  • weary-traveler mentioned his alternative html export backend https://github.com/ox-tufte/ox-tufte

    • The highlight is ability to have side (margin) notes in the exported html.
    • Based on "tufte" CSS
  • weary-traveler showed a demo on using rst (reStructured text) tables inside Org files: https://weary-travelers.gitlab.io/posts/how-tos/overcome-org-syntactic-restrictions/guide.html

    • The idea is to create a source block backend, which executes exporting its code to whatever export backend is needed
    • This way, one can use complex rst tables with multi-row cells and complex cell layouts
    • The same idea can be used to embed alternative markups into Org (also, it is how Org's embedded LaTeX works under the hood)
    • Alternatively, Org mode supports =table.el= tables that allow multi-row cells.
  • Karl Voit briefly described his system to deal with "hard to finish" tasks

  • Org mode clocking can be used as website blocker

  • Hooks executed when clocking in/out: ~org-clock-in-hook~, ~org-clock-out-hook~ 😇

  • Tomas Volf asked about giant Emacs setup: whether the author (me) remembers everything that is going on there:

    • The answer is no, I don't remember: things that are of use are simply in muscle memory and do not require further tweaking.
    • Sometimes, config things feel so natural (after years of usage), that they are thought as Emacs built-in (to later surprise trying with emacs -Q)
      • Like =highlight-parenthesis-mode=, which is a package I use for many years
        • Unlike built-in, it highlights multiple levels of parentheses around point, not a single level.
  • Karl Voit uses major mode hydra as a personal version of cheat sheet for rarely used commands

    • Another approach is using =which-key= package that displays all the prefix bindings after delay
    • Or M-x describe-bindings
    • Or something like =C-c C-v C-h= (any prefix ending with =C-h=), which will display a summary of bindings starting from that prefix key
  • kickingvegas asked about agenda command to move to an event that is scheduled now (for example, it is 2pm and the event is 1pm-3pm)

490
 
 

In my init-File I have the cursor-type set to 'box. Still, when I open an org-file, the cursor is automatically set to 'bar. If I change the major mode to outline-mode, it is set to 'box, and when I change it back to org-mode, it is set to 'bar.

I tried region-evaluate on the line (setq cursor-type 'box) in an org-file, and the cursor changes to 'box. But I would like to have it set to box right away through init.el.

My theme is modus-operandi-tinted, and I looked there, but it just sets the color of the cursor, not its form. Could it be that setq cursor-type is not respected by org-mode?

(I use mixed-pitch mode.)

Thank you very much for any help!

491
492
493
 
 

The last meetup [1] turned out quite successful. Let's continue.

[1] https://list.orgmode.org/877cq38gdt.fsf@localhost/ (meetup notes)

URL: https://bbb.emacsverse.org/b/iho-h7r-qg8-led Time & Date: <2023-09-13 Wed 19:00-21:00 @+03,Europe/Istanbul> The room will be open half an hour before the official start.

During the meetup, we can:

  • Give advice to new users
  • Showcase Org configs or workflows
  • Demo/discuss interesting packages
  • Troubleshoot each-other's issues
  • Discuss "Org mode" section of Emacs news (https://sachachua.com/blog/)
  • Discuss anything else Org-related

Everyone is free to join the discussion/chat or lurk around silently, listening.

We will not do any recording by default.

494
495
 
 

Some time ago I mentioned a very peculiar type of TODOs I’d like to implement. These are things I’d like to do from time to time, but not necessarily on a regular basis...

496
497
498
499
500
view more: ‹ prev next ›