From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: want a file format easily edited and read by emacs that allows (multiple) pictures to be included Date: Sun, 3 Dec 2017 11:10:52 +0100 Message-ID: <20171203101052.GA29579@tuxteam.de> References: <87tvx99t3y.fsf@gmail.com> <87indo7s7o.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed X-Trace: blaine.gmane.org 1512295893 19200 195.159.176.226 (3 Dec 2017 10:11:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 3 Dec 2017 10:11:33 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 03 11:11:29 2017 Return-path: Envelope-to: geh-help-gnu-emacs@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 1eLRF9-0004Xf-Cj for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Dec 2017 11:11:27 +0100 Original-Received: from localhost ([::1]:38400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLRFD-00070h-KO for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Dec 2017 05:11:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLREp-00070a-C0 for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 05:11:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLREm-0004WB-6M for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 05:11:07 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:41798) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLREl-0004Ov-SR for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 05:11:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=20171004; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=1AfiKi7YfUuMVdjdoFLTJPvIandeLtcFGBr1YLUfLTw=; b=J08HVVkDRYNY1xUMntgU1Z3uQS8ye/Ly95auBR9G46DJtaLH+wNRtKQgdNAijrXOSCMN24sgBu1+t7XAOo8EEHwBCsB0PT1rVuOWljExu+eV/muco2129ne0/Pz9ci4U1sUA9vnUuAt4wyhm+m6BkfXvzUKgFqjhdLuOOLi5EH0mqIIs5mTVsWmrcfTQwoDdt7i6XtndEjxW2c1bF6pM5lOYKZbCC37774/6L3m2IWlHRd+cuicMk9v7RJwkDnh6++GRCQvyCDuNEPc6ZjxAXMeBX2Qxsab9HnQyPg1928P4eXwozW3OoKrDtIvquGTu9cFNdawx3uxg5Fht9eKJQw==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1eLREa-0007p4-2x for help-gnu-emacs@gnu.org; Sun, 03 Dec 2017 11:10:52 +0100 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115183 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, Dec 02, 2017 at 02:47:23PM -0800, Dan Hitt wrote: [...] > Hi Marcin, > > You are very nice, but what is a 'source block'? > > Is this like cdata in html? Yes and no :-) In org mode, a source block looks like #+BEGIN_SRC C void img_free(img *image) { if(image) { if(image->pixels) free(image->pixels); free(image); } } #+END_SRC Meaning: the code between this markup is C source code. Thus Org knows, for many languages: - how to highlight it and edit it, via the appropriate Emacs mode - how to "execute" it (and if you wish, insert the results into your buffer). Yes, for C, Org would call the compiler for you, for a snippet like the above pack some boilerplate around it with a main function calling into your func, and printing the return value, for org to collect the result (that's Org babel magic). There are many ways to pass parameters to source code blocks, which controls their behaviour. Definitely worth a look. Cheers - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlojzawACgkQBcgs9XrR2kYOgACePyLHE8ZGq7Wj5hm+FhhrlOR2 USYAnjpr6QvsU1xMAmuxRLPPDkaMlp8K =q2aB -----END PGP SIGNATURE-----