From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: Obsolescence warnings Date: Wed, 11 Jan 2017 15:25:06 +0100 Message-ID: <87h955r7wd.fsf@zigzag.favinet> References: <20161224023808.12868.71069@vcs.savannah.gnu.org> <20161224023808.9EE8D2201BC@vcs.savannah.gnu.org> Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1484144369 19042 195.159.176.226 (11 Jan 2017 14:19:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2017 14:19:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 11 15:19:23 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRJkJ-0004Qs-8C for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2017 15:19:23 +0100 Original-Received: from localhost ([::1]:54575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRJkN-0002Il-ED for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2017 09:19:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRJkH-0002Ig-Cs for emacs-devel@gnu.org; Wed, 11 Jan 2017 09:19:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRJkE-0001RC-2W for emacs-devel@gnu.org; Wed, 11 Jan 2017 09:19:21 -0500 Original-Received: from mail.agora-net.com ([67.59.132.6]:58814) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRJkD-0001R0-UQ for emacs-devel@gnu.org; Wed, 11 Jan 2017 09:19:18 -0500 Original-Received: from ttn by mail.agora-net.com with local (Exim 4.82) (envelope-from ) id 1cRJkC-0002HN-LP for emacs-devel@gnu.org; Wed, 11 Jan 2017 09:19:16 -0500 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1cRJpz-0004ty-J5 for emacs-devel@gnu.org; Wed, 11 Jan 2017 15:25:15 +0100 Mail-Followup-To: emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Sat, 24 Dec 2016 00:02:03 -0500") X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ttn@gnuvola.org X-SA-Exim-Scanned: No (on mail.agora-net.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 67.59.132.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211193 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () Stefan Monnier () Sat, 24 Dec 2016 00:02:03 -0500 To the extent that it affects the end-user and is caught during execution, this mechanism needs to be very careful not to get in the way, although it should be visible enough that we can reasonably expect that the user will likely see those messages. Here's an idea: (defun message-with-properties (plist fmt &rest args) "Like =E2=80=98message=E2=80=99 for FMT and ARGS, and also propertize w/ = PLIST. Return the propertized, formatted string." (with-current-buffer (get-buffer "*Messages*") (let* ((beg (goto-char (point-max))) (str (apply #'message fmt args)) (end (+ beg (length str) 1)) (inhibit-read-only t)) (add-text-properties beg end plist) (buffer-substring beg end)))) (message-with-properties '(face font-lock-warning-face) "obsolete: %S" 'obsolete-thing) We can then tell people to look for easily visible "obsolete" in *Messages*, and they can do that at their own convenience, or we can programmatically collect such blurbs for a more concentrated presentation, later. In the meantime, this can be tweaked a bit for other (ab)uses, such as =E2=80=98C-u C-h e=E2=80=99 doing filtering bas= ed on various properties, etc. WDYT? =2D-=20 Thien-Thi Nguyen ----------------------------------------------- (defun responsep (query) (pcase (context query) (`(technical mailing-list) t) ...)) 748E A0E8 1CB8 A748 9BFA =2D-------------------------------------- 6CE4 6703 2224 4C80 7502 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlh2QEUACgkQZwMiJEyAdQKjtwCgsaGduO7JPcxjnauy59XMoI2E hrsAoMAiRQ+sYumogwtDPJoaoFmxdR24 =4EOU -----END PGP SIGNATURE----- --=-=-=--