Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This command will do something like you want.</p> <pre><code>(defun annotate-todo () "put fringe marker on TODO: lines in the curent buffer" (interactive) (save-excursion (goto-char (point-min)) (while (re-search-forward "TODO:" nil t) (let ((overlay (make-overlay (- (point) 5) (point)))) (overlay-put overlay 'before-string (propertize "A" 'display '(left-fringe right-triangle))))))) </code></pre> <p>You can <a href="http://www.gnu.org/software/emacs/elisp/html_node/Customizing-Bitmaps.html#Customizing-Bitmaps" rel="noreferrer">customize the bitmap</a> as desired.</p> <p>To get this to apply to all files, you could add it to the <code>'find-file-hooks</code></p> <pre><code>(add-hook 'find-file-hooks 'annotate-todo) </code></pre> <p>Or, if you want it just for certain modes, you could add it to those mode hooks.</p> <p>See <a href="http://www.gnu.org/software/emacs/elisp/html_node/Fringes.html#Fringes" rel="noreferrer">Fringes</a>, <a href="http://www.gnu.org/software/emacs/elisp/html_node/Display-Property.html" rel="noreferrer">The 'display' Property</a>, <a href="http://www.gnu.org/s/emacs/manual/html_node/elisp/Overlays.html#Overlays" rel="noreferrer">Overlays</a>, and most importantly the <a href="http://www.gnu.org/s/emacs/manual/html_node/elisp/Overlay-Properties.html#Overlay-Properties" rel="noreferrer">before-string</a> property.</p> <p><em>Note:</em> The code was updated 27/02/2010 to use overlays instead of directly adding text properties to the current text.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload