X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgutter.el;h=a6dad1e62143bb97a0e22b5bd4813c5790055342;hb=6b6f8be0854598dbcdabe46e4d36b13f880361fe;hp=44df9a0443771213ad9fa3f5c27e34b061489a29;hpb=59eec5f21669e81977b5b1fe9bf717cab49cf7fb;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/gutter.el b/lisp/gutter.el index 44df9a0..a6dad1e 100644 --- a/lisp/gutter.el +++ b/lisp/gutter.el @@ -60,15 +60,15 @@ element in the gutter changes. The value of this variable may be buffer-local. The gutter element symbol is passed as an argument to the hook, as is the visibility flag.") -(defun set-gutter-element (gutter-specifier prop val &optional locale tag-set) - "Set GUTTER-SPECIFIER gutter element PROP to VAL in optional LOCALE. +(defun set-gutter-element (gutter-specifier prop value &optional locale tag-set) + "Set GUTTER-SPECIFIER gutter element PROP to VALUE in optional LOCALE. This is a convenience function for setting gutter elements. -VAL in general must be a string. If VAL is a glyph then a string will be -created to put the glyph into." - (let ((spec val)) - (when (glyphp val) +VALUE in general must be a string. If VALUE is a glyph then a string +will be created to put the glyph into." + (let ((spec value)) + (when (glyphp value) (setq spec (copy-sequence "\n")) - (set-extent-begin-glyph (make-extent 0 1 spec) val)) + (set-extent-begin-glyph (make-extent 0 1 spec) value)) (map-extents #'(lambda (extent arg) (set-extent-property extent 'duplicable t)) spec) (modify-specifier-instances gutter-specifier #'plist-put (list prop spec) @@ -108,6 +108,21 @@ non-nil if it is visible in optional DOMAIN." (or (and (listp spec) (memq 'buffers-tab spec)) spec))) +(defun set-gutter-dirty-p (gutter-or-location) + "Make GUTTER-OR-LOCATION dirty to force redisplay updates." + ;; set-glyph-image will not make the gutter dirty + (when (or (gutter-specifier-p gutter-or-location) + (eq gutter-or-location 'top) + (eq gutter-or-location 'bottom) + (eq gutter-or-location 'left) + (eq gutter-or-location 'right)) + (or (gutter-specifier-p gutter-or-location) + (setq gutter-or-location + (eval (intern (concat + (symbol-name gutter-or-location) + "-gutter"))))) + (set-specifier-dirty-flag gutter-or-location))) + (defun make-gutter-specifier (spec-list) "Return a new `gutter' specifier object with the given specification list. SPEC-LIST can be a list of specifications (each of which is a cons of a