mixed-pitch icon indicating copy to clipboard operation
mixed-pitch copied to clipboard

Handle org lists

Open aaronjensen opened this issue 6 years ago • 8 comments

https://github.com/cadadr/elisp/blob/master/org-variable-pitch.el recently came up in reddit. Someone mentioned this mode, which I didn't know about. org-variable-pitch does a similar thing, but handles fewer modes. What it does do though that mixed-pitch doesn't is make list bullets fixed width so they line up properly.

Would you consider adding (or accepting a patch) to add that to this mode?

Thanks!

aaronjensen avatar Mar 30 '18 02:03 aaronjensen

Thanks for sharing, I hadn't seen that.

I'll look at it and see how org-variable-pitch.el handles lists. Perhaps I'll add that to mixed-pitch-mode.el, though it may be better to add a new face to org-mode itself (something like org-list-face).

On Thu 29 Mar 2018 at 21:46, Aaron Jensen [email protected] wrote:

https://github.com/cadadr/elisp/blob/master/org-variable-pitch.el recently came up in reddit. Someone mentioned this mode, which I didn't know about. org-variable-pitch does a similar thing, but handles fewer modes. What it does do though that mixed-pitch doesn't is make list bullets fixed width so they line up properly.

Would you consider adding (or accepting a patch) to add that to this mode?

Thanks!

jabranham avatar Mar 31 '18 16:03 jabranham

There already are org-list-dt and org-list-checkbox

Fuco1 avatar Apr 05 '18 10:04 Fuco1

@Fuco1 correct me if I'm wrong, but I don't believe either of those cover the actual bullets themselves.

aaronjensen avatar Apr 05 '18 13:04 aaronjensen

@aaronjensen correct, apparently I have this in my config. However the checkbox [ ] is covered.

(defun my-org-fontify-list-marker ()
  "Fontify the list marker at the beginning of line but not in source blocks."
  (unless (org-in-block-p '("SRC" "EXAMPLE"))
    (font-lock-prepend-text-property
     (match-beginning 1)
     (match-end 1)
     'face 'org-list-dt)
    nil))

(font-lock-add-keywords 'org-mode
                        `(
                          ;; Fontify list markers
                          ("^ *\\([-+]\\|[0-9]+[).]\\) " 1 (funcall 'my-org-fontify-list-marker))
                          )
                        'append)

¯\_(ツ)_/¯

Which reminds me I have actually added some code which does this same thing again, so I now do it twice :D Damn my 20000 line config...

Fuco1 avatar Apr 05 '18 13:04 Fuco1

I added org-list-checkbox. Perhaps org upstream would be interested in adding a face for lists? Does anyone have an interest in submitting a patch to them?

jabranham avatar Apr 05 '18 14:04 jabranham

I would love to but I every time I try interacting with mailing lists (be it emacs itself or org) it just doesn't work. I have given up on that :/ My time is more valuable than screwing around with arcane gnus setups lol.

Fuco1 avatar Apr 05 '18 14:04 Fuco1

That's really too bad... I've actually managed to successfully get some patches into emacs, but I agree it is way more trouble than it should be.

aaronjensen avatar Apr 05 '18 17:04 aaronjensen

I haven't found it to be too difficult, FWIW. Just make the commits in git, then call magit-status, W p. That generates a .patch file which you can attach to an email using whatever email client you usually use. No need to mess with gnus.

jabranham avatar Apr 05 '18 17:04 jabranham