emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org dd4fd02995 2/3: Allow per-buffer setting of org-lin


From: ELPA Syncer
Subject: [elpa] externals/org dd4fd02995 2/3: Allow per-buffer setting of org-link-descriptive via #+STARTUP options
Date: Mon, 22 Jan 2024 09:58:30 -0500 (EST)

branch: externals/org
commit dd4fd02995ba69d0cdeb9a58b9c480892966a863
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    Allow per-buffer setting of org-link-descriptive via #+STARTUP options
    
    * lisp/org.el (org-startup-options): Add new startup options to set
    `org-link-descriptive'.
    (org-mode): Move #+startup keyword parsing before setting up link
    visibility.
    * doc/org-manual.org (Link Format):
    (Summary of In-Buffer Settings): Document the new startup option.
    * etc/ORG-NEWS (~org-link-descriptive~ can now be set per-buffer via
    =#+STARTUP= options): Announce the new feature.
    
    Link: https://orgmode.org/list/87bkst1nfl.fsf@ucl.ac.uk
---
 doc/org-manual.org | 14 +++++++++++++-
 etc/ORG-NEWS       |  8 ++++++++
 lisp/org.el        | 24 +++++++++++++-----------
 3 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 19aa981ed6..6c52858e6a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -3172,7 +3172,8 @@ precise behavior depends on how point arrived there---see
 incomplete and the internals are again displayed as plain text.
 Inserting the missing bracket hides the link internals again.  To show
 the internal structure of all links, use the menu: Org \rarr
-Hyperlinks \rarr Literal links.
+Hyperlinks \rarr Literal links, customize ~org-link-descriptive~, or use
+=literallinks= [[*Summary of In-Buffer Settings][startup option]].
 
 ** Internal Links
 :PROPERTIES:
@@ -20272,6 +20273,17 @@ changes.
   | =inlineimages=   | Show inline images.                   |
   | =noinlineimages= | Do not show inline images on startup. |
 
+  #+vindex: org-link-descriptive
+  Bracket links in Org buffers are displayed hiding the link path and
+  brackets.  For example, =[[https://orgmode.org][Org Website]]= is,
+  by default, displayed as "Org Website", hiding the link itself and
+  just displaying its description.  Alternatively, the links can be
+  displayed in full.  The corresponding variable is
+  ~org-link-descriptive~.
+
+  | =descriptivelinks= | Hide path and brackets in links. |
+  | =literallinks=     | Do not hide anything.            |
+
   #+vindex: org-log-done
   #+vindex: org-log-note-clock-out
   #+vindex: org-log-repeat
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 847ddf6145..e413622dd2 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -371,6 +371,14 @@ The change is breaking when ~org-use-property-inheritance~ 
is set to ~t~.
 
 The =TEST= parameter is better served by Emacs debugging tools.
 ** New and changed options
+*** ~org-link-descriptive~ can now be set per-buffer via =#+STARTUP= options
+
+In addition to ~org-link-descriptive~ custom option, link display can
+now be controlled per-buffer as:
+
+: #+STARTUP: literallinks
+: #+STARTUP: descriptivelinks
+
 *** New option ~org-fast-tag-selection-maximum-tags~
 
 You can now limit the total number of tags displayed in the fast tag
diff --git a/lisp/org.el b/lisp/org.el
index 1d53ee72e3..7e6d432c41 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4080,6 +4080,8 @@ After a match, the following groups carry important 
information:
     ("align" org-startup-align-all-tables t)
     ("noalign" org-startup-align-all-tables nil)
     ("shrink" org-startup-shrink-all-tables t)
+    ("descriptivelinks" org-link-descriptive t)
+    ("literallinks" org-link-descriptive nil)
     ("inlineimages" org-startup-with-inline-images t)
     ("noinlineimages" org-startup-with-inline-images nil)
     ("latexpreview" org-startup-with-latex-preview t)
@@ -4866,6 +4868,17 @@ The following commands are available:
   (org-load-modules-maybe)
   (when org-agenda-file-menu-enabled
     (org-install-agenda-files-menu))
+  (setq-local outline-regexp org-outline-regexp)
+  (setq-local outline-level 'org-outline-level)
+  ;; Initialize cache.
+  (org-element-cache-reset)
+  (when (and org-element-cache-persistent
+             org-element-use-cache)
+    (org-persist-load
+     `((elisp org-element--cache) (version ,org-element-cache-version))
+     (current-buffer)
+     'match-hash :read-related t))
+  (org-set-regexps-and-options)
   (when (and org-link-descriptive
              (eq org-fold-core-style 'overlays))
     (add-to-invisibility-spec '(org-link)))
@@ -4876,8 +4889,6 @@ The following commands are available:
   (if org-link-descriptive
       (org-fold-core-set-folding-spec-property (car 
org-link--link-folding-spec) :visible nil)
     (org-fold-core-set-folding-spec-property (car org-link--link-folding-spec) 
:visible t))
-  (setq-local outline-regexp org-outline-regexp)
-  (setq-local outline-level 'org-outline-level)
   (when (and (stringp org-ellipsis) (not (equal "" org-ellipsis)))
     (unless org-display-table
       (setq org-display-table (make-display-table)))
@@ -4886,15 +4897,6 @@ The following commands are available:
      (vconcat (mapcar (lambda (c) (make-glyph-code c 'org-ellipsis))
                      org-ellipsis)))
     (setq buffer-display-table org-display-table))
-  ;; Initialize cache.
-  (org-element-cache-reset)
-  (when (and org-element-cache-persistent
-             org-element-use-cache)
-    (org-persist-load
-     `((elisp org-element--cache) (version ,org-element-cache-version))
-     (current-buffer)
-     'match-hash :read-related t))
-  (org-set-regexps-and-options)
   (org-set-font-lock-defaults)
   (when (and org-tag-faces (not org-tags-special-faces-re))
     ;; tag faces set outside customize.... force initialization.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]