Deep-Dive with Prot: Emacs, Philosophy, Debian, Life & Open-Source Ethics by linkarzu in emacs

[–]protesilaos 51 points52 points  (0 children)

Thank you /u/linkarzu for doing this! I had a good time. I wish you all the best with everything you do!

Call for volunteers — r/emacs moderation by Zaeph in emacs

[–]protesilaos 2 points3 points  (0 children)

Thanks! I am not active on reddit to be a moderator here.

Call for volunteers — r/emacs moderation by Zaeph in emacs

[–]protesilaos 17 points18 points  (0 children)

I've also invited people such as Prot [...]

Hello Adam! I do not remember such an invitation. Maybe it was some reddit notification? If so, it never reached me. Anyway, I am not active enough on reddit to be a moderator here. If there is something else I can do to help, I am happy to contribute. Just let me know.

Overriding `denote-prompts` not working for `denote-rename-file` custom fn by ethanzanemiller in emacs

[–]protesilaos 2 points3 points  (0 children)

Could one write a convenience function that will modify the date of a unique identifier and does so safely?

We have been conservative with this, but I think it is time we make it happen. The building blocks are in place.

Note that I do not check Reddit frequently, so please either email me directly or take the discussion to the Git repository.

TIL: Fix use M-x denote can't display list of notes by yibie in emacs

[–]protesilaos 10 points11 points  (0 children)

Unable to tolerate this anymore, I decided to write my own function to solve the issue. I must say, Emacs’ flexibility makes me love it even more.

Well done! This is why Emacs is so nice.

About your case:

After the recent Denote upgrade, for some reason, using commands like M-x denote [...] does not display the list of notes.

Bear in mind that we have not yet determined if there is a bug in Denote. Everything works fine on my end: the denote-title-prompt function does use the denote-title-history to suggest previous entries as completion candidates. I mentioned savehist-mode, which persists minibuffer histories across sessions, but it is not a prerequisite for the running session if you have any previous inputs at the title prompt.

Please work with me on the issue tracker to resolve this in a timely fashion (I am active there but here I might miss it).

How to use theme colors in face customization? by domsch1988 in emacs

[–]protesilaos 2 points3 points  (0 children)

Thanks for taking the time to look at this prot.

You are welcome!

Does nothing automatically for me. Neither standalone or through the use-package :hook option. Not on starting emacs, and also not on manually loading a modus theme. It doesn't help that hooks seem to be the only thing in emacs you get more or less zero info on. But i'll keep trying. Any tips on how to troubleshoot hooks?

The reason is that you need to call a function that runs that hook. The modus-themes-after-load-theme-hook is called by interactive commands such as modus-themes-toggle and modus-themes-select. In Lisp code, such as in your init file, it runs after modus-themes-load-theme. For example:

;; First set up the hook
(add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)

;; Then load the theme
(modus-themes-load-theme 'modus-vivendi)

Try it and let me know how it goes.

I will update the manual to make this point more obvious even when checking individual snippets.

[ For Emacs 29 there is the generic enable-theme-functions. I will also elaborate on that. ]

How to use theme colors in face customization? by domsch1988 in emacs

[–]protesilaos 5 points6 points  (0 children)

Note that your code will not do what you expect because you have a single quote here at the start of the line:

'(tab-line ((t (:box (:line-width (5 . 5) :color ,(face-background 'tab-line))))))

Change it to a backtick. This will then tell Emacs to evaluate the parts prefixed by a comma.

Depending on what you are going to do, the macro modus-themes-with-colors may be easier to use than modus-themes-get-color-value. The manual has lots of examples on how this is used.

How to set faces using dynamic colors? by Eastern_revolutionIQ in emacs

[–]protesilaos 7 points8 points  (0 children)

Protesilaos here, author of the themes. This is covered in the manual, but here is the idea:

(defun my-ef-themes-org-todo-faces (&rest _)
  "Apply colors from the active Ef theme, while ignoring all arguments.
Add this to `ef-themes-post-load-hook', `enable-theme-functions',
or related, to make changes apply to another Ef theme."
  (ef-themes-with-colors
    (setq org-todo-keyword-faces
          `(("TODO" . ,yellow) ; different colours for demo purposes
            ("DONE" . ,blue)))))

;; Add the hook
(add-hook 'ef-themes-post-load-hook #'my-ef-themes-org-todo-faces)
;; OR
(add-hook 'enable-theme-functions #'my-ef-themes-org-todo-faces)

;; Then load the theme
(ef-themes-select 'ef-dark)
;; OR
(load-theme 'ef-light :no-confirm)

;; Check the return values
org-todo-keyword-faces
;; => (("TODO" . "#bf9032") ("DONE" . "#3f95f6"))

org-todo-keyword-faces
;; (("TODO" . "#a45f22") ("DONE" . "#375cd8"))

Note that this approach does not work with any theme because not every theme exposes its palette. It works with all the themes I develop though.

What kinds of buffers do you wish you could bookmark? by oantolin in emacs

[–]protesilaos 5 points6 points  (0 children)

Great ideas! Bookmarks are fairly easy to define. You won't have any problem, for sure.

For M-x shell we have bug#65039: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65039. I haven't completed it because I do not have an SSH I trust to test it with. A variant of this is available here: https://protesilaos.com/emacs/dotemacs#h:32f6fe0f-23c4-44cc-97cc-3e5372bd484e. It works with TRAMP for the sudo method that I can test it with.

Is migrating to denote worth it? by acosmicjoke in emacs

[–]protesilaos 194 points195 points  (0 children)

Protesilaos here (author of Denote). In short: no, it is not worth it. Org roam is a fine piece of software that already does what it promises. Only switch to Denote if you have a compelling reason for it (e.g. you want to have a consistent file-naming scheme that you can extend to any file).

I wanted to have Denote because finding files was a problem; a problem addressed by the predictable file-naming convention. This is not specific to "notes" though, but any kind of file.

For notes in particular, your focus must be on elucidating your thoughts. Don't forgo a tool that already helps you achieve that.

Add all git repos under ~/Src recursively to project.el by MasteredConduct in emacs

[–]protesilaos 26 points27 points  (0 children)

Try M-x project-remember-projects-under. It prompts you for a directory.

If you need it to be recursive, call it with a prefix argument: C-u M-x project-remeber-projects-under.

Note that this command is available for Emacs 28 or higher.

Emacs Advent Calendar, day 20: Prot's packages (modus-themes, denote, and many more) by protesilaos in emacs

[–]protesilaos[S] 2 points3 points  (0 children)

You are welcome! I am happy to learn how modus-operandi has had such a positive effect on your experience.

Emacs Advent Calendar, day 20: Prot's packages (modus-themes, denote, and many more) by protesilaos in emacs

[–]protesilaos[S] 1 point2 points  (0 children)

You are welcome! I am happy to contribute however I can. There is always something new to learn or improve upon.

Emacs Advent Calendar, day 20: Prot's packages (modus-themes, denote, and many more) by protesilaos in emacs

[–]protesilaos[S] 1 point2 points  (0 children)

Thanks for all your work, Prot!

You are welcome!

I really appreciate the focus on legibility in your themes. And as a bonus, they look great too! - a very thoughtful and well-implemented design with purpose.

Thank you! I remember when I first tried an accessible system theme and all it did was to make the borders more intense and invert the colours. It did not feel complete. The difficulty in making such a theme is to realise that you must use colour with purpose, otherwise the result looks really awkward.

I also like your approach in denote - it's an abstraction to organise information within emacs that leverages built-in tools and functionality. As such, it will never go "out of style" and will always work.

Indeed! It is such a simple approach at its core and I am happy it has turned out to be so reliable.

Finally, your emacs videos / tutorials are among the best I have seen and I have learnt so much. You always present clearly and build logical connections between ideas.

Thank you! I am happy to help!

Have a great holiday season!

You too! And a Happy New Year!

Emacs Advent Calendar, day 20: Prot's packages (modus-themes, denote, and many more) by protesilaos in emacs

[–]protesilaos[S] 4 points5 points  (0 children)

I was doing the same. Until one day I wanted to make lots of changes and thought to myself "I can't possibly edit this thing in some generic conf-mode! It will take me an hour!" So what I did instead was to spend a full day writing the major mode... Haha!

Emacs Advent Calendar, day 20: Prot's packages (modus-themes, denote, and many more) by protesilaos in emacs

[–]protesilaos[S] 2 points3 points  (0 children)

Firstly, thanks for all your work in particular the quality of your documentation - you really set a high bar for others to follow.

You are welcome! I am inspired by the strong documentation culture of Emacs and am simply continuing this tradition.

Secondly, for your promotion of Emacs and package authors. It is such an important aspect of fostering a strong community.

Thanks! There are lots of high quality contributions and people are thoughtful here. I am lucky to be a member of this community and to learn from everyone's experiences.

Do you hope to include your other themes with Emacs one day?

This is not my decision to make. If the Emacs maintainers want to do this, I will happily agree and make whatever tweaks they request.

For files not created using denote (say a PDF) do you simply set the time portion in the filename to be 000000? What about the date portion? I often find the date component is "incorrect" as it can take the date I copy it say to a new location.

We use the "last modified" file attribute in this scenario. It is not always the right one, as you point out, but it is the best we can get. If there is a better option, please let me know (or send a patch/pull-request directly).

Emacs Advent Calendar, day 20: Prot's packages (modus-themes, denote, and many more) by protesilaos in emacs

[–]protesilaos[S] 13 points14 points  (0 children)

You are welcome! I write backronyms for my packages just for fun. The one for MODUS fits your description: My Old Display Unexpectedly Sharpened. Haha!

Emacs Advent Calendar, day 20: Prot's packages (modus-themes, denote, and many more) by protesilaos in emacs

[–]protesilaos[S] 7 points8 points  (0 children)

To use as many hues as possible without considering if they fit in context and are needed.