From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Message's text-properties in *Messages* Date: Wed, 30 May 2018 15:44:08 -0400 Message-ID: References: <20180521171019.GA5750@ACM> <83a7sqcmnw.fsf@gnu.org> <83603eckk6.fsf@gnu.org> <83tvqpgix5.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1527709391 26226 195.159.176.226 (30 May 2018 19:43:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 May 2018 19:43:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 30 21:43:07 2018 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 1fO6zy-0006gv-Lu for ged-emacs-devel@m.gmane.org; Wed, 30 May 2018 21:43:06 +0200 Original-Received: from localhost ([::1]:40501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO725-0002f4-Iq for ged-emacs-devel@m.gmane.org; Wed, 30 May 2018 15:45:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO712-0001mU-SU for emacs-devel@gnu.org; Wed, 30 May 2018 15:44:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fO70z-0000DB-RR for emacs-devel@gnu.org; Wed, 30 May 2018 15:44:12 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:53105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO70z-0000CT-KJ; Wed, 30 May 2018 15:44:09 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w4UJiVLD011648; Wed, 30 May 2018 15:44:31 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 110AD660C7; Wed, 30 May 2018 15:44:08 -0400 (EDT) In-Reply-To: <83tvqpgix5.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 30 May 2018 20:19:50 +0300") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6297=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6297> : inlines <6666> : streams <1788263> : uri <2649869> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:225831 Archived-At: >> I didn't mean to answer all of them yet, I will need some time to look >> at the code. > Sorry for the long delay in responding. Come on, it has barely been a week. >> - Why would arbitrary Lisp code be dangerous (I understand that message_dolog >> can be called from within redisplay, but redisplay runs Elisp code >> at several places, so "from redisplay" doesn't inherently imply you >> can't run Elisp code). > As I wrote previously, redisplay is not the issue here, as > message_dolog doesn't call any redisplay entry points. Hmm... indeed I'm not worried about message_dolog calling redisplay, instead I think the worry is about redisplay calling message_dolog (probably via `message` or some variant thereof). > . the new function message_dolog_lisp is safe because it accepts a > Lisp string, not a C 'char *' pointer If there's no risk of message_dolog(_lisp) being called *from* redisplay, then indeed message_dolog_lisp should be perfectly safe and could even skip the inhibit-*-hooks dance (tho we might want to be careful about those hooks calling `message` recursively). And in that case, we could also replace message_dolog with message_dolog_lisp (if needed, building a fresh new Lisp string from a char*). Stefan