Function: speedbar-add-indicator

speedbar-add-indicator is a byte-compiled function defined in speedbar.el.gz.

Signature

(speedbar-add-indicator INDICATOR-STRING &optional REPLACE-THIS)

Documentation

Add INDICATOR-STRING to the end of this speedbar line.

If INDICATOR-STRING is space, and REPLACE-THIS is a character, then the existing indicator is removed. If there is already an indicator, then do not add a space.

Source Code

;; Defined in /usr/src/emacs/lisp/speedbar.el.gz
(defun speedbar-add-indicator (indicator-string &optional replace-this)
  "Add INDICATOR-STRING to the end of this speedbar line.
If INDICATOR-STRING is space, and REPLACE-THIS is a character,
then the existing indicator is removed.  If there is already an
indicator, then do not add a space."
  (beginning-of-line)
  ;; The nature of the beast: Assume we are in "the right place"
  (end-of-line)
  (skip-chars-backward (concat " " speedbar-vc-indicator
			       speedbar-object-read-only-indicator
			       (car speedbar-obj-indicator)
			       (cdr speedbar-obj-indicator)))
  (if (and (not (looking-at speedbar-indicator-regex))
	   (not (string= indicator-string " ")))
      (insert speedbar-indicator-separator))
  (speedbar-with-writable
    (save-excursion
      (if (and replace-this
	       (re-search-forward replace-this (line-end-position) t))
	  (delete-region (match-beginning 0) (match-end 0))))
    (end-of-line)
    (if (not (string= " " indicator-string))
	(let ((start (point)))
	  (insert indicator-string)
	  (speedbar-insert-image-button-maybe start (length indicator-string))
	  ))))