unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [patch] vc-annotate-toggle-annotation-visibility, almost
Date: Sun, 04 Nov 2007 10:43:28 +0100	[thread overview]
Message-ID: <878x5emjlr.fsf@ambire.localdomain> (raw)
In-Reply-To: <jwvfxzm674r.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 03 Nov 2007 23:13:29 -0400")

() Stefan Monnier <monnier@iro.umontreal.ca>
() Sat, 03 Nov 2007 23:13:29 -0400

   > "almost" because i don't see any change w/ `redisplay'
   > in `vc-annotate-toggle-annotation-visibility'; use of
   > `force-mode-line-update' is suboptimal.  still investigating.

   Use of force-mode-line-update doesn't seem particularly bad to me
   (assuming it works).

prior to `redisplay' being available, i would agree.  but not now.
that `redisplay' doesn't is bug that should be fixed, IMO.

   >   You can use the mode-specific menu to alter the time-span of the used
   >   colors.  See variable `vc-annotate-menu-elements' for customizing the
   >   menu items."
   > +   (setq buffer-invisibility-spec nil)
   >     (set (make-local-variable 'truncate-lines) t)
   >     (set (make-local-variable 'font-lock-defaults)
   >          '(vc-annotate-font-lock-keywords t))
   >     (view-mode 1))

the default buffer-invisibility-spec value is `t', so when
vc-annotate-get-time-set-line-props sets the text property `invisible' to a
non-nil value, the result is that the buffer is initially displayed w/
invisible annotations.  (you would need to toggle it once to see them.)

thanks for pointing this out.  upon review, i think there is a better way:

  ;; Frob buffer-invisibility-spec so that if it is originally a naked t,
  ;; it will become a list, to avoid initial annotations being invisible.
  (add-to-invisibility-spec 'foo)
  (remove-from-invisibility-spec 'foo)

   > +   (when (get-text-property (point) 'invisible)
   > +     (goto-char (next-single-property-change (point) 'invisible)))

   What is this for?

effect "edge-triggered intangible".  however, it's not necessary (and
in fact somtimes leaves point one further than expected).  removed.

   We could additionally put commands to print the (invisible) annotation
   in the echo-area, and also add a `help-echo' property to the whole
   buffer so as to get tooltips that display the (invisible) annotation.

yes, but that's outside the scope of this patch.

thi

      reply	other threads:[~2007-11-04  9:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-04  1:29 [patch] vc-annotate-toggle-annotation-visibility, almost Thien-Thi Nguyen
2007-11-04  3:13 ` Stefan Monnier
2007-11-04  9:43   ` Thien-Thi Nguyen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878x5emjlr.fsf@ambire.localdomain \
    --to=ttn@gnuvola.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).