emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [correction]


From: Juan Manuel Macías
Subject: Re: [correction]
Date: Mon, 31 Oct 2022 21:01:39 +0000

Uwe Brauer writes:

> Don't worry, for the moment _@@  is fine for me

I think with font-lock-add-keywords it should work. I have put another
overlay on the tags, so that they are seen inside a box, separated by
":".

(defun overlay-dired-filetags (&optional lim)
  (when
      (re-search-forward "\\(_ftag_\\)\\(.+\\)" lim t)
    (let
        ((ov (make-overlay (match-beginning 1) (match-end 1)))
         (tag (propertize " ⚜ " 'face 'bold))
         (ov-2 (make-overlay (match-beginning 2) (match-end 2)))
         (tags (propertize (replace-regexp-in-string
                            "_"
                            ":"
                            (match-string 2))
                           'font-lock-face
                           '(:foreground "red" :box t))))
      (overlay-put ov 'overlay-tag t)
      (overlay-put ov 'display tag)
      (overlay-put ov-2 'overlay-tag-2 t)
      (overlay-put ov-2 'display tags))))

(font-lock-add-keywords
 'dired-mode
 '((overlay-dired-filetags (0  'font-lock-keyword-face t)))
 t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]