From 2aeb97a81e8e0c9522b117449aee7d1be2f86d04 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Wed, 26 Aug 2026 16:37:43 +0800
Subject: [PATCH] ol: Add new custom variable
 org-link-preview-include-descriptive

* lisp/ol.el (org-link-preview-include-descriptive): allow you to
toggle the internal variable `include-linked` in function
`org-link-preview`. So that user can globally enable descriptive links
previewing without always pressing [C-u 1] to toggle the function
parameter `include-linked`.
---
 doc/org-manual.org |  4 ++++
 etc/ORG-NEWS       |  6 ++++++
 lisp/ol.el         | 17 +++++++++++++----
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index be0e1180b..590b32789 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -11918,6 +11918,10 @@ current section, active region or at point with the following commands:
   specific buffer when opening it.  =#+STARTUP: nolinkpreviews= will
   disable previews on startup in the buffer.
 
+  #+vindex: org-link-preview-include-descriptive
+  Allow user to enable descriptive link previewing without manually
+  triggered by prefix with {{{kbd(C-u 1)}}}.
+
 - {{{kbd(C-c C-x C-M-v)}}} (~org-link-preview-refresh~) ::
 
   #+kindex: C-c C-x C-M-v
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index db6637135..d485e5135 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -406,6 +406,12 @@ The option can be customized either by
 1. setting the global variable ~org-html-base-directory~
 2. setting the file local keyword =HTML_BASE_DIRECTORY=
 
+*** New custom variable ~org-link-preview-include-descriptive~
+
+This option, nil by default, allow you to toggle the internal variable
+=include-linked= in function =org-link-preview=. So that user can
+globally enable descriptive links previewing without always pressing
+=[C-u 1]= to toggle the function parameter =include-linked=.
 
 ** New functions and changes in function arguments
 
diff --git a/lisp/ol.el b/lisp/ol.el
index 3d0e32bcc..17e251799 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -590,6 +590,14 @@ (defcustom org-link-preview-batch-size 6
   :type 'natnum
   :safe #'natnump)
 
+(defcustom org-link-preview-include-descriptive nil
+  "When non-nil, enable descriptive link previewing in `org-link-preview'.
+When nil, descriptive link previewing can be enabled on a per-call basis using 'C-u 1'."
+  :group 'org-link
+  :package-version '(Org . "10.0")
+  :type 'boolean
+  :safe #'booleanp)
+
 (defcustom org-display-remote-inline-images 'skip
   "How to display remote inline images.
 Possible values of this option are:
@@ -2177,10 +2185,11 @@ (defun org-link-preview (&optional arg beg end)
                        (list (region-beginning) (region-end))))
                org-mode)
   (let* ((include-linked
-          (cond
-           ((member arg '(nil (4) (16)) ) nil)
-           ((member arg '(1 11)) 'include-linked)
-           (t 'include-linked)))
+          (or (cond
+               ((member arg '(nil (4) (16)) ) nil)
+               ((member arg '(1 11)) 'include-linked)
+               (t 'include-linked))
+              org-link-preview-include-descriptive))
          (interactive? (called-interactively-p 'any))
          (toggle-previews
           (lambda (&optional beg end scope remove)
-- 
2.50.1 (Apple Git-155)

