From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0IgJL8RlKWN6XgEAbAwnHQ (envelope-from ) for ; Tue, 20 Sep 2022 09:03:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qAsYL8RlKWMcVgEA9RJhRA (envelope-from ) for ; Tue, 20 Sep 2022 09:03:32 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 02C2A26B9A for ; Tue, 20 Sep 2022 09:03:31 +0200 (CEST) Received: from localhost ([::1]:46020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaXI2-0001Fa-Bz for larch@yhetil.org; Tue, 20 Sep 2022 03:03:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaXF1-0001FQ-Dl for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 03:00:23 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:41937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaXEw-0003L7-Dd for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 03:00:23 -0400 Received: by mail-pf1-x42a.google.com with SMTP id l65so1862697pfl.8 for ; Tue, 20 Sep 2022 00:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=TtKZtrFFcNC7mDXtJxJWTwYNf0VQTk9tTtNlVQ01yVM=; b=Pendj8PBFjEekQv9/sLtG87EKQ0c+XKwSYTRB2khoFCwaNv4uGS8chQcLn8gh2uz6/ qVQDXdCbrPJwtNv7x2nSHKLzXUL1j6r31jKMK5jcgv9Ydor1C1C3jMFWkWXTI9kCkCpT ODg7H/wB0gttVmn6eZ3wBA01eqMKSsSFUjJl7lo2ioN3c7AuXWU9ogpCqrtePSBXz+DD XISVs5c3ZngRymCe6ZNNa5dkhQhCDVoBIO4DVRd+hZhdjpQj2cREdo5qfGrb+EiC0WUu acJmXmMHWTQgwKans+rnsmetbB46GIEQYjSTWegj8RZk01bF53lkeu2lx+T7pTatcV2w eT1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=TtKZtrFFcNC7mDXtJxJWTwYNf0VQTk9tTtNlVQ01yVM=; b=k8andAG1ZOWiD1Dm+47KiWzZs3xPJ0kAozSt/VwGB9obK3eWuAIh7SOGHT+TH+Gb/B k+KMcGIhUFQaOZdl9dHHjbpjO73HJTT/kST2pKZQ30Akv5b5AKnL3Dou7fsjAUlx7UDd MAgmANtCufyT9qTqjj6DdtwRNEAGNBMG+WMmp7gAZfAfRLrkPgGngHYkqn0h0rt18N79 Uqrl+FTmfd5X8Onn0cQ0jJ650QT5Fm6ZdVV+aNxqzzUSqDSeYWsP7Fkh0a4ROrhHo5Sp 9DNAawlssoFZWDXhHZorepLhbmAyV/mlEfOM94XEPw3wgRsiKKJLuOQNJEUllqD0a6A/ BZsA== X-Gm-Message-State: ACrzQf3dicpVoZJ1SXf+jpiwxmgOADCEmvW8rzr/rscgZDMu8lzvv0pi uB0K/9jyRo5jKoaU6plucFY= X-Google-Smtp-Source: AMsMyM4g2hfXBYTyKZMAbMLq7Hz6/4GofXVgRp12lkmNDfzw9cdqwMKZuW16qICxQ6SZ689q/BXzAg== X-Received: by 2002:a05:6a00:1a04:b0:52a:d4dc:5653 with SMTP id g4-20020a056a001a0400b0052ad4dc5653mr22178553pfv.69.1663657215182; Tue, 20 Sep 2022 00:00:15 -0700 (PDT) Received: from localhost ([1.83.154.224]) by smtp.gmail.com with ESMTPSA id n10-20020a170902d2ca00b00176ad86b213sm597396plc.259.2022.09.20.00.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 00:00:13 -0700 (PDT) From: Ihor Radchenko To: "Christopher M. Miles" Cc: emacs-orgmode@gnu.org Subject: [PATCH v6] Re: [PATCH 5] New: auto display inline images under subtree when `org-cycle'. In-Reply-To: <6322f5ad.c80a0220.5e936.823eSMTPIN_ADDED_BROKEN@mx.google.com> References: <631d472b.c80a0220.2b4b2.bf86SMTPIN_ADDED_BROKEN@mx.google.com> <87h71ew0m0.fsf@localhost> <631e92ee.050a0220.f9c18.92f5SMTPIN_ADDED_BROKEN@mx.google.com> <87y1uovp9w.fsf@localhost> <631fe1c9.050a0220.3ab2b.3f52SMTPIN_ADDED_BROKEN@mx.google.com> <87bkrhwc42.fsf@localhost> <6322b0a8.050a0220.59bb8.6923SMTPIN_ADDED_BROKEN@mx.google.com> <87y1uluir1.fsf@localhost> <6322f5ad.c80a0220.5e936.823eSMTPIN_ADDED_BROKEN@mx.google.com> Date: Tue, 20 Sep 2022 15:01:07 +0800 Message-ID: <878rmesf64.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=yantar92@gmail.com; helo=mail-pf1-x42a.google.com X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.999 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663657412; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=TtKZtrFFcNC7mDXtJxJWTwYNf0VQTk9tTtNlVQ01yVM=; b=K3+jLvRqHuukSETULmiotRfHotWZkG9TavD1n4FmupdajP1sTBlFob9VcvDMpFOcHjMnEZ tUsHfBsbcI99PQOwM26w1rJfCcFxKcGygmHYbC4Nc+usNF8M50AXWNo3+yckCDbuiHXuJ2 I04yLRmJFbhcYVj1nz18Lv5d5zIVluaMg0JGZsFz981C0l4PnrWrAqBQJxXJfRIjbk1V5T jCfzaisul/0kNLVig5+0YJTitPmJ18mczb28xIEzT1AWMH0KDUaUdoBLb41AR5LeB3TBlE N2VYAPm+RP6ZGottLVhwMBVYE6EpPn7JaVekDlY2QC9hjwKl5v11O//3z9z9IA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663657412; a=rsa-sha256; cv=none; b=maGhPwsae2gazOrWTDDh+G9ytSWS4NmS0iZf5knG02M4zzblCP338jTHj79wDRbHFFaxXH anIe8RWkdYszKgpmOXurlm+dMAeCg0f9TMWsSy/YRCy5/iey5HbdO25Pdqb4vsXkugppxy V0pH/EfjIhT9hQDIMu70Hdu0s3t1O9SsYWlHCBKsID4peB1huwHt4R5YwTMtb0fc33yKKO RSu4WhqxKAswmmzH5oTRtusdLpIDLuRQAkJoNkowBjgxWOVnVdmKgqa1+x2oZFv3KTBbXo 1VuXMPpRA6B8g079gNxgr2rV8HSvw+3lY9DBdbuKKfYIXOA5tk3STzu0N+DGxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Pendj8PB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Pendj8PB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 02C2A26B9A X-Spam-Score: -1.83 X-Migadu-Scanner: scn1.migadu.com X-TUID: Lavdpn/rUpxD --=-=-= Content-Type: text/plain "Christopher M. Miles" writes: > Ok, I will submit the first patch of new property at first. If you're > going to implement this cycling inline image display feature, > that's great! The changes to the manual are confusing after exporting. Note that #+vindex: org-image-actual-width will not be visible in html/pdf export. They only serve as info search nodes and do not appear in the actual text. I am attaching an alternative version of the patch. Let me know if you have any objections. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=v6-0001-org.el-Support-subtree-level-org-image-actual-wid.patch Content-Transfer-Encoding: quoted-printable >From 475c607f874e4e78c1e13d15e36ae894b121acad Mon Sep 17 00:00:00 2001 Message-Id: <475c607f874e4e78c1e13d15e36ae894b121acad.1663656903.git.yantar= 92@gmail.com> From: stardiviner Date: Thu, 15 Sep 2022 17:25:13 +0800 Subject: [PATCH v6] org.el: Support subtree-level org-image-actual-width overriding * lisp/org.el (org-display-inline-image--width): Support new property "ORG-IMAGE-ACTUAL-WIDTH" overriding global variable `org-image-actual-width'. --- doc/org-manual.org | 186 +++++++++++++++++++++++++-------------------- etc/ORG-NEWS | 4 + lisp/org.el | 90 +++++++++++----------- 3 files changed, 155 insertions(+), 125 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index a37b8390c..4c9c087a7 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -11314,6 +11314,24 @@ ** Images startup by configuring the variable ~org-startup-with-inline-images~[fn:119]. =20 + + #+vindex: org-image-actual-width + #+cindex: @samp{ORG-IMAGE-ACTUAL-WIDTH}, property + By default, Org mode displays inline images according to their actual wi= dth. + You can customize the displayed image width using ~org-image-actual-widt= h~ variable (globally) or =3DORG-IMAGE-ACTUAL-WIDTH=3D property (subtree-le= vel)[fn:120]. + Their value can be the following: + - (default) Non-nil, use the actual width of images when inlining them. + - When set to a number, use imagemagick (when available) to set the + image's width to this value. + - When set to a number in a list, try to get the width from any + =3D#+ATTR.*=3D keyword if it matches a width specification like: + #+begin_example + ,#+ATTR_HTML: :width 300px + #+end_example + and fall back on that number if none is found. + - When set to nil, try to get the width from an =3D#+ATTR.*=3D keyword + and fall back on the original width if none is found. + ** Captions :PROPERTIES: :DESCRIPTION: Describe tables, images... @@ -11404,7 +11422,7 @@ ** Creating Footnotes #+vindex: org-footnote-define-inline #+vindex: org-footnote-section Otherwise, create a new footnote. Depending on the variable - ~org-footnote-define-inline~[fn:120], the definition is placed right + ~org-footnote-define-inline~[fn:121], the definition is placed right into the text as part of the reference, or separately into the location determined by the variable ~org-footnote-section~. =20 @@ -11419,7 +11437,7 @@ ** Creating Footnotes | {{{kbd(d)}}} | Delete the footnote at point, including definition and = references. | =20 #+vindex: org-footnote-auto-adjust - Depending on the variable ~org-footnote-auto-adjust~[fn:121], + Depending on the variable ~org-footnote-auto-adjust~[fn:122], renumbering and sorting footnotes can be automatic after each insertion or deletion. =20 @@ -11609,7 +11627,7 @@ ** Export Settings =20 #+cindex: @samp{DATE}, keyword #+vindex: org-export-date-timestamp-format - A date or a time-stamp[fn:122]. + A date or a time-stamp[fn:123]. =20 - =3DEMAIL=3D :: =20 @@ -11624,7 +11642,7 @@ ** Export Settings Language to use for translating certain strings (~org-export-default-language~). With =3D#+LANGUAGE: fr=3D, for example, Org translates =3DTable of contents=3D to the French =3DTable d= es - mati=C3=A8res=3D[fn:123]. + mati=C3=A8res=3D[fn:124]. =20 - =3DSELECT_TAGS=3D :: =20 @@ -11901,7 +11919,7 @@ ** Table of Contents #+cindex: excluding entries from table of contents #+cindex: table of contents, exclude entries Org includes both numbered and unnumbered headlines in the table of -contents[fn:124]. If you need to exclude an unnumbered headline, +contents[fn:125]. If you need to exclude an unnumbered headline, along with all its children, set the =3DUNNUMBERED=3D property to =3Dnotoc= =3D value. =20 @@ -12020,7 +12038,7 @@ ** Include Files | =3D#+INCLUDE: "~/.emacs" :lines "10-"=3D | Include lines from 10 to EOF= | =20 Inclusions may specify a file-link to extract an object matched by -~org-link-search~[fn:125] (see [[*Search Options in File Links]]). The +~org-link-search~[fn:126] (see [[*Search Options in File Links]]). The ranges for =3D:lines=3D keyword are relative to the requested element. Therefore, =20 @@ -12060,7 +12078,7 @@ ** Macro Replacement : #+MACRO: name replacement text; $1, $2 are arguments =20 #+texinfo: @noindent -which can be referenced using =3D{{{name(arg1, arg2)}}}=3D[fn:126]. For +which can be referenced using =3D{{{name(arg1, arg2)}}}=3D[fn:127]. For example =20 #+begin_example @@ -12179,7 +12197,7 @@ ** Comment Lines Finally, a =3DCOMMENT=3D keyword at the beginning of an entry, but after any other keyword or priority cookie, comments out the entire subtree. In this case, the subtree is not exported and no code block within it -is executed either[fn:127]. The command below helps changing the +is executed either[fn:128]. The command below helps changing the comment status of a headline. =20 - {{{kbd(C-c ;)}}} (~org-toggle-comment~) :: @@ -12451,7 +12469,7 @@ *** Frames and Blocks in Beamer =20 - Org exports a Beamer frame's objects as block environments. Org can enforce wrapping in special block types when =3DBEAMER_ENV=3D property - is set[fn:128]. For valid values see + is set[fn:129]. For valid values see ~org-beamer-environments-default~. To add more values, see ~org-beamer-environments-extra~. #+vindex: org-beamer-environments-default @@ -13039,7 +13057,7 @@ *** Math formatting in HTML export #+vindex: org-html-mathjax-options~ LaTeX math snippets (see [[*LaTeX fragments]]) can be displayed in two different ways on HTML pages. The default is to use the [[https://www.mat= hjax.org][MathJax]], -which should work out of the box with Org[fn:129][fn:130]. Some MathJax +which should work out of the box with Org[fn:130][fn:131]. Some MathJax display options can be configured via ~org-html-mathjax-options~, or in the buffer. For example, with the following settings, =20 @@ -13051,7 +13069,7 @@ *** Math formatting in HTML export #+texinfo: @noindent equation labels are displayed on the left margin and equations are five em from the left margin. In addition, it loads the two MathJax -extensions =3Dcancel.js=3D and =3DnoErrors.js=3D[fn:131]. +extensions =3Dcancel.js=3D and =3DnoErrors.js=3D[fn:132]. =20 #+vindex: org-html-mathjax-template See the docstring of ~org-html-mathjax-options~ for all supported @@ -13114,7 +13132,7 @@ *** CSS support #+vindex: org-export-html-todo-kwd-class-prefix #+vindex: org-export-html-tag-class-prefix You can modify the CSS style definitions for the exported file. The -HTML exporter assigns the following special CSS classes[fn:132] to +HTML exporter assigns the following special CSS classes[fn:133] to appropriate parts of the document---your style specifications may change these, in addition to any of the standard classes like for headlines, tables, etc. @@ -13351,7 +13369,7 @@ *** LaTeX/PDF export commands Org file. See the docstring for the ~org-latex-default-packages-alist~ for loading packages with certain compilers. Also see ~org-latex-bibtex-compiler~ to set the -bibliography compiler[fn:133]. +bibliography compiler[fn:134]. =20 *** LaTeX specific export settings :PROPERTIES: @@ -13889,7 +13907,7 @@ *** Source blocks in LaTeX export packages for customization of that specific source block. In the example below, the =3D:options=3D are set for Engraved or Minted. Minted is a source code highlighting LaTeX package with many configurable -options[fn:134]. Both Minted and Engraved are built on [[https://www.ctan= .org/pkg/fvextra][fvextra]], and +options[fn:135]. Both Minted and Engraved are built on [[https://www.ctan= .org/pkg/fvextra][fvextra]], and so support many of the same options. =20 #+begin_example @@ -14142,7 +14160,7 @@ ** OpenDocument Text Export =20 The ODT export back-end handles creating of OpenDocument Text (ODT) format. Documents created by this exporter use the -{{{cite(OpenDocument-v1.2 specification)}}}[fn:135] and are compatible +{{{cite(OpenDocument-v1.2 specification)}}}[fn:136] and are compatible with LibreOffice 3.4. =20 *** Pre-requisites for ODT export @@ -14543,7 +14561,7 @@ **** LaTeX math snippets variables ~org-latex-to-mathml-convert-command~ and ~org-latex-to-mathml-jar-file~. =20 - If you prefer to use MathToWeb[fn:136] as your converter, you can + If you prefer to use MathToWeb[fn:137] as your converter, you can configure the above variables as shown below. =20 #+begin_src emacs-lisp @@ -14554,7 +14572,7 @@ **** LaTeX math snippets #+end_src =20 #+texinfo: @noindent - or, to use LaTeX=E2=80=8BML[fn:137] instead, + or, to use LaTeX=E2=80=8BML[fn:138] instead, =20 #+begin_src emacs-lisp (setq org-latex-to-mathml-convert-command @@ -14873,7 +14891,7 @@ **** Customizing tables in ODT export tables, see [[*Tables in ODT export]]. =20 This feature closely mimics the way table templates are defined in the -OpenDocument-v1.2 specification[fn:138]. +OpenDocument-v1.2 specification[fn:139]. =20 #+vindex: org-odt-table-styles For quick preview of this feature, install the settings below and export t= he @@ -14907,7 +14925,7 @@ **** Customizing tables in ODT export =20 To use this feature proceed as follows: =20 -1. Create a table template[fn:139]. +1. Create a table template[fn:140]. =20 A table template is set of =3Dtable-cell=3D and =3Dparagraph=3D styles = for each of the following table cell categories: @@ -14946,7 +14964,7 @@ **** Customizing tables in ODT export =3D=3D element of the content template file (see [[x-orgodtcontenttemplate-xml][Factory styles]]). =20 -2. Define a table style[fn:140]. +2. Define a table style[fn:141]. =20 #+vindex: org-odt-table-styles To define a table style, create an entry for the style in the @@ -16177,7 +16195,7 @@ *** Publishing action ~org-org-publish-to-org~. This produces =3Dfile.org=3D and puts it in the publishing directory. If you want a htmlized version of this file, set the parameter ~:htmlized-source~ to ~t~. It produces -=3Dfile.org.html=3D in the publishing directory[fn:141]. +=3Dfile.org.html=3D in the publishing directory[fn:142]. =20 Other files like images only need to be copied to the publishing destination; for this you can use ~org-publish-attachment~. For @@ -17795,13 +17813,13 @@ *** How to evaluate source code #+kindex: C-c C-v e #+findex: org-babel-execute-src-block Org provides many ways to execute code blocks. {{{kbd(C-c C-c)}}} or -{{{kbd(C-c C-v e)}}} with the point on a code block[fn:142] calls the +{{{kbd(C-c C-v e)}}} with the point on a code block[fn:143] calls the ~org-babel-execute-src-block~ function, which executes the code in the block, collects the results, and inserts them in the buffer. =20 #+cindex: @samp{CALL}, keyword #+vindex: org-babel-inline-result-wrap -By calling a named code block[fn:143] from an Org mode buffer or +By calling a named code block[fn:144] from an Org mode buffer or a table. Org can call the named code blocks from the current Org mode buffer or from the "Library of Babel" (see [[*Library of Babel]]). =20 @@ -18002,7 +18020,7 @@ *** Collection =20 - =3Dvalue=3D :: =20 - Default for most Babel libraries[fn:143]. Functional mode. Org + Default for most Babel libraries[fn:144]. Functional mode. Org gets the value by wrapping the code in a function definition in the language of the source block. That is why when using =3D:results value=3D, code should execute like a function and return a value. For @@ -18731,7 +18749,7 @@ ** Noweb Reference Syntax =20 #+cindex: @samp{noweb-ref}, header argument Source code blocks can include references to other source code blocks, -using a noweb[fn:144] style syntax: +using a noweb[fn:145] style syntax: =20 : <> =20 @@ -19259,7 +19277,7 @@ ** Structure Templates ~org-structure-template-alist~ and ~org-tempo-keywords-alist~. For example, {{{kbd(< s TAB)}}} creates a code block. Enable it by customizing ~org-modules~ or add =3D(require 'org-tempo)=3D to your Emacs -init file[fn:145]. +init file[fn:146]. =20 #+attr_texinfo: :columns 0.1 0.9 | {{{kbd(a)}}} | =3D#+BEGIN_EXPORT ascii=3D ... =3D#+END_EXPORT=3D | @@ -19339,7 +19357,7 @@ *** Org Indent Mode To display the buffer in the indented view, activate Org Indent minor mode, using {{{kbd(M-x org-indent-mode)}}}. Text lines that are not headlines are prefixed with virtual spaces to vertically align with -the headline text[fn:146]. +the headline text[fn:147]. =20 #+vindex: org-indent-indentation-per-level To make more horizontal space, the headlines are shifted by two @@ -19367,9 +19385,9 @@ *** Hard indentation =20 It is possible to use hard spaces to achieve the indentation instead, if the bare ASCII file should have the indented look also outside -Emacs[fn:147]. With Org's support, you have to indent all lines to +Emacs[fn:148]. With Org's support, you have to indent all lines to line up with the outline headers. You would use these -settings[fn:148]: +settings[fn:149]: =20 #+begin_src emacs-lisp (setq org-adapt-indentation t @@ -19640,7 +19658,7 @@ ** Summary of In-Buffer Settings =20 #+vindex: org-startup-indented Dynamic virtual indentation is controlled by the variable - ~org-startup-indented~[fn:149]. + ~org-startup-indented~[fn:150]. =20 | =3Dindent=3D | Start with Org Indent mode turned on. | | =3Dnoindent=3D | Start with Org Indent mode turned off. | @@ -20498,7 +20516,7 @@ *** Setting up the staging area =20 #+vindex: org-mobile-directory The mobile application needs access to a file directory on -a server[fn:150] to interact with Emacs. Pass its location through +a server[fn:151] to interact with Emacs. Pass its location through the ~org-mobile-directory~ variable. If you can mount that directory locally just set the variable to point to that directory: =20 @@ -20519,7 +20537,7 @@ *** Setting up the staging area requires OpenSSL installed on the local computer. To turn on encryption, set the same password in the mobile application and in Emacs. Set the password in the variable -~org-mobile-use-encryption~[fn:151]. Note that even after the mobile +~org-mobile-use-encryption~[fn:152]. Note that even after the mobile application encrypts the file contents, the file name remains visible on the file systems of the local computer, the server, and the mobile device. @@ -20535,15 +20553,15 @@ *** Pushing to the mobile application ~org-mobile-files~ into the staging area. Files include agenda files (as listed in ~org-agenda-files~). Customize ~org-mobile-files~ to add other files. File names are staged with paths relative to -~org-directory~, so all files should be inside this directory[fn:152]. +~org-directory~, so all files should be inside this directory[fn:153]. =20 Push creates a special Org file =3Dagendas.org=3D with custom agenda views -defined by the user[fn:153]. +defined by the user[fn:154]. =20 Finally, Org writes the file =3Dindex.org=3D, containing links to other files. The mobile application reads this file first from the server to determine what other files to download for agendas. For faster -downloads, it is expected to only read files whose checksums[fn:154] +downloads, it is expected to only read files whose checksums[fn:155] have changed. =20 *** Pulling from the mobile application @@ -20560,7 +20578,7 @@ *** Pulling from the mobile application =20 1. #+vindex: org-mobile-inbox-for-pull - Org moves all entries found in =3Dmobileorg.org=3D[fn:155] and appends + Org moves all entries found in =3Dmobileorg.org=3D[fn:156] and appends them to the file pointed to by the variable ~org-mobile-inbox-for-pull~. It should reside neither in the staging area nor on the server. Each captured entry and each @@ -20854,9 +20872,9 @@ *** A LaTeX example of radio tables #+cindex: @LaTeX{}, and Orgtbl mode =20 To wrap a source table in LaTeX, use the =3Dcomment=3D environment -provided by =3Dcomment.sty=3D[fn:156]. To activate it, put +provided by =3Dcomment.sty=3D[fn:157]. To activate it, put ~\usepackage{comment}~ in the document header. Orgtbl mode inserts -a radio table skeleton[fn:157] with the command {{{kbd(M-x +a radio table skeleton[fn:158] with the command {{{kbd(M-x orgtbl-insert-radio-table)}}}, which prompts for a table name. For example, if =3Dsalesfigures=3D is the name, the template inserts: =20 @@ -20875,7 +20893,7 @@ *** A LaTeX example of radio tables ~orgtbl-to-latex~ to convert the table to LaTeX format, then insert the table at the target (receive) location named =3Dsalesfigures=3D. Now the table is ready for data entry. It can even use spreadsheet -features[fn:158]: +features[fn:159]: =20 #+begin_example % BEGIN RECEIVE ORGTBL salesfigures @@ -21091,7 +21109,7 @@ ** Special Agenda Views #+vindex: org-agenda-skip-function #+vindex: org-agenda-skip-function-global Org provides a special hook to further limit items in agenda views: -~agenda~, ~agenda*~[fn:159], ~todo~, ~alltodo~, ~tags~, ~tags-todo~, +~agenda~, ~agenda*~[fn:160], ~todo~, ~alltodo~, ~tags~, ~tags-todo~, ~tags-tree~. Specify a custom function that tests inclusion of every matched item in the view. This function can also skip as much as is needed. @@ -21134,7 +21152,7 @@ ** Special Agenda Views #+vindex: org-agenda-skip-function Search for entries with a limit set on levels for the custom search. This is a general approach to creating custom searches in Org. To -include all levels, use =3DLEVEL>0=3D[fn:160]. Then to selectively pick +include all levels, use =3DLEVEL>0=3D[fn:161]. Then to selectively pick the matched entries, use ~org-agenda-skip-function~, which also accepts Lisp forms, such as ~org-agenda-skip-entry-if~ and ~org-agenda-skip-subtree-if~. For example: @@ -22258,6 +22276,7 @@ * Footnotes #+findex: org-anniversary #+findex: org-cyclic #+findex: org-block + [fn:60] When working with the standard diary expression functions, you need to be very careful with the order of the arguments. That order depends evilly on the variable ~calendar-date-style~. For example, to @@ -22496,140 +22515,143 @@ * Footnotes within a buffer with the =3DSTARTUP=3D options =3Dinlineimages=3D and =3Dnoinlineimages=3D. =20 -[fn:120] The corresponding in-buffer setting is: =3D#+STARTUP: fninline=3D +[fn:120] The width can be customized in Emacs >=3D 24.1, built with +imagemagick support.=20 + +[fn:121] The corresponding in-buffer setting is: =3D#+STARTUP: fninline=3D or =3D#+STARTUP: nofninline=3D. =20 -[fn:121] The corresponding in-buffer options are =3D#+STARTUP: fnadjust=3D +[fn:122] The corresponding in-buffer options are =3D#+STARTUP: fnadjust=3D and =3D#+STARTUP: nofnadjust=3D. =20 -[fn:122] The variable ~org-export-date-timestamp-format~ defines how +[fn:123] The variable ~org-export-date-timestamp-format~ defines how this timestamp are exported. =20 -[fn:123] For export to LaTeX format---or LaTeX-related formats such as +[fn:124] For export to LaTeX format---or LaTeX-related formats such as Beamer---, the =3Dorg-latex-package-alist=3D variable needs further configuration. See [[LaTeX specific export settings]]. =20 -[fn:124] At the moment, some export back-ends do not obey this +[fn:125] At the moment, some export back-ends do not obey this specification. For example, LaTeX export excludes every unnumbered headline from the table of contents. =20 -[fn:125] Note that ~org-link-search-must-match-exact-headline~ is +[fn:126] Note that ~org-link-search-must-match-exact-headline~ is locally bound to non-~nil~. Therefore, ~org-link-search~ only matches headlines and named elements. =20 -[fn:126] Since commas separate the arguments, commas within arguments +[fn:127] Since commas separate the arguments, commas within arguments have to be escaped with the backslash character. So only those backslash characters before a comma need escaping with another backslash character. =20 -[fn:127] For a less drastic behavior, consider using a select tag (see +[fn:128] For a less drastic behavior, consider using a select tag (see [[*Export Settings]]) instead. =20 -[fn:128] If =3DBEAMER_ENV=3D is set, Org export adds =3DB_environment=3D t= ag +[fn:129] If =3DBEAMER_ENV=3D is set, Org export adds =3DB_environment=3D t= ag to make it visible. The tag serves as a visual aid and has no semantic relevance. =20 -[fn:129] By default Org loads MathJax from [[https://cdnjs.com][cdnjs.com]= ] as recommended by +[fn:130] By default Org loads MathJax from [[https://cdnjs.com][cdnjs.com]= ] as recommended by [[https://www.mathjax.org][MathJax]]. =20 -[fn:130] Please note that exported formulas are part of an HTML +[fn:131] Please note that exported formulas are part of an HTML document, and that signs such as =3D<=3D, =3D>=3D, or =3D&=3D have special meanings. See [[http://docs.mathjax.org/en/latest/input/tex/html.html#tex= -and-latex-in-html-documents][MathJax TeX and LaTeX in HTML documents]]. =20 -[fn:131] See [[http://docs.mathjax.org/en/latest/input/tex/extensions.html= #tex-and-latex-extensions][TeX and LaTeX extensions]] in the [[http://docs.= mathjax.org][MathJax manual]] to learn +[fn:132] See [[http://docs.mathjax.org/en/latest/input/tex/extensions.html= #tex-and-latex-extensions][TeX and LaTeX extensions]] in the [[http://docs.= mathjax.org][MathJax manual]] to learn about extensions. =20 -[fn:132] If the classes on TODO keywords and tags lead to conflicts, +[fn:133] If the classes on TODO keywords and tags lead to conflicts, use the variables ~org-html-todo-kwd-class-prefix~ and ~org-html-tag-class-prefix~ to make them unique. =20 -[fn:133] This does not allow setting different bibliography compilers +[fn:134] This does not allow setting different bibliography compilers for different files. However, "smart" LaTeX compilation systems, such as latexmk, can select the correct bibliography compiler. =20 -[fn:134] Minted uses an external Python package for code highlighting, +[fn:135] Minted uses an external Python package for code highlighting, which requires the flag =3D-shell-escape=3D to be added to ~org-latex-pdf-process~. =20 -[fn:135] See [[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.ht= ml][Open Document Format for Office Applications +[fn:136] See [[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.ht= ml][Open Document Format for Office Applications (OpenDocument) Version 1.2]]. =20 -[fn:136] See [[http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl][MathToW= eb]]. +[fn:137] See [[http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl][MathToW= eb]]. =20 -[fn:137] See [[http://dlmf.nist.gov/LaTeXML/]]. +[fn:138] See [[http://dlmf.nist.gov/LaTeXML/]]. =20 -[fn:138] [[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html][= OpenDocument-v1.2 Specification]] +[fn:139] [[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html][= OpenDocument-v1.2 Specification]] =20 -[fn:139] See the =3D=3D element of the +[fn:140] See the =3D=3D element of the OpenDocument-v1.2 specification. =20 -[fn:140] See the attributes =3Dtable:template-name=3D, +[fn:141] See the attributes =3Dtable:template-name=3D, =3Dtable:use-first-row-styles=3D, =3Dtable:use-last-row-styles=3D, =3Dtable:use-first-column-styles=3D, =3Dtable:use-last-column-styles=3D, =3Dtable:use-banding-rows-styles=3D, and =3Dtable:use-banding-column-style= s=3D of the =3D=3D element in the OpenDocument-v1.2 specification. =20 -[fn:141] If the publishing directory is the same as the source +[fn:142] If the publishing directory is the same as the source directory, =3Dfile.org=3D is exported as =3Dfile.org.org=3D, so you probab= ly do not want to do this. =20 -[fn:142] The option ~org-babel-no-eval-on-ctrl-c-ctrl-c~ can be used +[fn:143] The option ~org-babel-no-eval-on-ctrl-c-ctrl-c~ can be used to remove code evaluation from the {{{kbd(C-c C-c)}}} key binding. =20 -[fn:143] Actually, the constructs =3Dcall_()=3D and =3Dsrc_{}= =3D +[fn:144] Actually, the constructs =3Dcall_()=3D and =3Dsrc_{}= =3D are not evaluated when they appear in a keyword (see [[*Summary of In-Buffer Settings]]). =20 -[fn:144] For noweb literate programming details, see +[fn:145] For noweb literate programming details, see http://www.cs.tufts.edu/~nr/noweb/. =20 -[fn:145] For more information, please refer to the commentary section +[fn:146] For more information, please refer to the commentary section in =3Dorg-tempo.el=3D. =20 -[fn:146] Org Indent mode also sets ~wrap-prefix~ correctly for +[fn:147] Org Indent mode also sets ~wrap-prefix~ correctly for indenting and wrapping long lines of headlines or text. This minor mode also handles Visual Line mode and directly applied settings through ~word-wrap~. =20 -[fn:147] This works, but requires extra effort. Org Indent mode is +[fn:148] This works, but requires extra effort. Org Indent mode is more convenient for most applications. =20 -[fn:148] ~org-adapt-indentation~ can also be set to =3D'headline-data=3D, +[fn:149] ~org-adapt-indentation~ can also be set to =3D'headline-data=3D, in which case only data lines below the headline will be indented. =20 -[fn:149] Note that Org Indent mode also sets the ~wrap-prefix~ +[fn:150] Note that Org Indent mode also sets the ~wrap-prefix~ property, such that Visual Line mode (or purely setting ~word-wrap~) wraps long lines, including headlines, correctly indented. =20 -[fn:150] For a server to host files, consider using a WebDAV server, +[fn:151] For a server to host files, consider using a WebDAV server, such as [[https://nextcloud.com][Nextcloud]]. Additional help is at this = [[https://orgmode.org/worg/org-faq.html#mobileorg_webdav][FAQ entry]]. =20 -[fn:151] If Emacs is configured for safe storing of passwords, then +[fn:152] If Emacs is configured for safe storing of passwords, then configure the variable ~org-mobile-encryption-password~; please read the docstring of that variable. =20 -[fn:152] Symbolic links in ~org-directory~ need to have the same name +[fn:153] Symbolic links in ~org-directory~ need to have the same name as their targets. =20 -[fn:153] While creating the agendas, Org mode forces =3DID=3D properties +[fn:154] While creating the agendas, Org mode forces =3DID=3D properties on all referenced entries, so that these entries can be uniquely identified if Org Mobile flags them for further action. To avoid setting properties configure the variable ~org-mobile-force-id-on-agenda-items~ to ~nil~. Org mode then relies on outline paths, assuming they are unique. =20 -[fn:154] Checksums are stored automatically in the file +[fn:155] Checksums are stored automatically in the file =3Dchecksums.dat=3D. =20 -[fn:155] The file will be empty after this operation. +[fn:156] The file will be empty after this operation. =20 -[fn:156] https://www.ctan.org/pkg/comment +[fn:157] https://www.ctan.org/pkg/comment =20 -[fn:157] By default this works only for LaTeX, HTML, and Texinfo. +[fn:158] By default this works only for LaTeX, HTML, and Texinfo. Configure the variable ~orgtbl-radio-table-templates~ to install templates for other modes. =20 -[fn:158] If the =3DTBLFM=3D keyword contains an odd number of dollar +[fn:159] If the =3DTBLFM=3D keyword contains an odd number of dollar characters, this may cause problems with Font Lock in LaTeX mode. As shown in the example you can fix this by adding an extra line inside the =3Dcomment=3D environment that is used to balance the dollar @@ -22637,9 +22659,9 @@ * Footnotes a much better solution is to add the =3Dcomment=3D environment to the variable ~LaTeX-verbatim-environments~. =20 -[fn:159] The ~agenda*~ view is the same as ~agenda~ except that it +[fn:160] The ~agenda*~ view is the same as ~agenda~ except that it only considers /appointments/, i.e., scheduled and deadline items that have a time specification =3D[h]h:mm=3D in their time-stamps. =20 -[fn:160] Note that, for ~org-odd-levels-only~, a level number +[fn:161] Note that, for ~org-odd-levels-only~, a level number corresponds to order in the hierarchy, not to the number of stars. diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index a7f32671e..d9b41515b 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -296,6 +296,10 @@ headings in HTML export. Use the header argument =3D:var x=3Dcode-block[]=3D or : #+CALL: fn(x=3Dcode-block[]) to pass the contents of a named code block as a string argument. +*** New property =3DORG-IMAGE-ACTUAL-WIDTH=3D for overriding global ~org-i= mage-actual-width~ + +The new property =3DORG-IMAGE-ACTUAL-WIDTH=3D can override the global +variable ~org-image-actual-width~ value for inline images display width. =20 ** New options *** New custom settings =3Dorg-icalendar-scheduled-summary-prefix=3D and = =3Dorg-icalendar-deadline-summary-prefix=3D diff --git a/lisp/org.el b/lisp/org.el index a50921519..bba1b5233 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12224,7 +12224,8 @@ (defconst org-default-properties "EXPORT_OPTIONS" "EXPORT_TEXT" "EXPORT_FILE_NAME" "EXPORT_TITLE" "EXPORT_AUTHOR" "EXPORT_DATE" "UNNUMBERED" "ORDERED" "NOBLOCKING" "COOKIE_DATA" "LOG_INTO_DRAWER" "REPEAT_TO_STAT= E" - "CLOCK_MODELINE_TOTAL" "STYLE" "HTML_CONTAINER_CLASS") + "CLOCK_MODELINE_TOTAL" "STYLE" "HTML_CONTAINER_CLASS" + "ORG-IMAGE-ACTUAL-WIDTH") "Some properties that are used by Org mode for various purposes. Being in this list makes sure that they are offered for completion.") =20 @@ -16255,48 +16256,51 @@ (defun org-display-inline-image--width (link) If the value is a float between 0 and 2, it interpreted as that proporti= on of the text width in the buffer." ;; Apply `org-image-actual-width' specifications. - (cond - ((eq org-image-actual-width t) nil) - ((listp org-image-actual-width) - (let* ((case-fold-search t) - (par (org-element-lineage link '(paragraph))) - (attr-re "^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)") - (par-end (org-element-property :post-affiliated par)) - ;; Try to find an attribute providing a :width. - (attr-width - (when (and par (org-with-point-at - (org-element-property :begin par) - (re-search-forward attr-re par-end t))) - (match-string 1))) - (width - (cond - ;; Treat :width t as if `org-image-actual-width' were t. - ((string=3D attr-width "t") nil) - ;; Fallback to `org-image-actual-width' if no interprable wid= th is given. - ((or (null attr-width) - (string-match-p "\\`[^0-9]" attr-width)) - (car org-image-actual-width)) - ;; Convert numeric widths to numbers, converting percentages. - ((string-match-p "\\`[0-9.]+%" attr-width) - (/ (string-to-number attr-width) 100.0)) - (t (string-to-number attr-width))))) - (if (and (floatp width) (<=3D 0.0 width 2.0)) - ;; A float in [0,2] should be interpereted as this portion of - ;; the text width in the window. This works well with cases like - ;; #+attr_latex: :width 0.X\{line,page,column,etc.}width, - ;; as the "0.X" is pulled out as a float. We use 2 as the upper - ;; bound as cases such as 1.2\linewidth are feasible. - (round (* width - (window-pixel-width) - (/ (or (and (bound-and-true-p visual-fill-column-mode) - (or visual-fill-column-width auto-fill-fun= ction)) - (when auto-fill-function fill-column) - (- (window-text-width) (line-number-display-wid= th))) - (float (window-total-width))))) - width))) - ((numberp org-image-actual-width) - org-image-actual-width) - (t nil))) + ;; Support subtree-level property "ORG-IMAGE-ACTUAL-WIDTH" specified + ;; width. + (let ((org-image-actual-width (org-property-or-variable-value 'org-image= -actual-width))) + (cond + ((eq org-image-actual-width t) nil) + ((listp org-image-actual-width) + (let* ((case-fold-search t) + (par (org-element-lineage link '(paragraph))) + (attr-re "^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)") + (par-end (org-element-property :post-affiliated par)) + ;; Try to find an attribute providing a :width. + (attr-width + (when (and par (org-with-point-at + (org-element-property :begin par) + (re-search-forward attr-re par-end t))) + (match-string 1))) + (width + (cond + ;; Treat :width t as if `org-image-actual-width' were t. + ((string=3D attr-width "t") nil) + ;; Fallback to `org-image-actual-width' if no interprable w= idth is given. + ((or (null attr-width) + (string-match-p "\\`[^0-9]" attr-width)) + (car org-image-actual-width)) + ;; Convert numeric widths to numbers, converting percentage= s. + ((string-match-p "\\`[0-9.]+%" attr-width) + (/ (string-to-number attr-width) 100.0)) + (t (string-to-number attr-width))))) + (if (and (floatp width) (<=3D 0.0 width 2.0)) + ;; A float in [0,2] should be interpereted as this portion of + ;; the text width in the window. This works well with cases l= ike + ;; #+attr_latex: :width 0.X\{line,page,column,etc.}width, + ;; as the "0.X" is pulled out as a float. We use 2 as the upp= er + ;; bound as cases such as 1.2\linewidth are feasible. + (round (* width + (window-pixel-width) + (/ (or (and (bound-and-true-p visual-fill-column-mod= e) + (or visual-fill-column-width auto-fill-f= unction)) + (when auto-fill-function fill-column) + (- (window-text-width) (line-number-display-w= idth))) + (float (window-total-width))))) + width))) + ((numberp org-image-actual-width) + org-image-actual-width) + (t nil)))) =20 (defun org-display-inline-remove-overlay (ov after _beg _end &optional _le= n) "Remove inline-display overlay if a corresponding region is modified." --=20 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92 --=-=-=--