From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 8MkVHIJ7hWVWvwAAkFu2QA (envelope-from ) for ; Fri, 22 Dec 2023 13:05:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id yE4kFYJ7hWXOSQAAqHPOHw (envelope-from ) for ; Fri, 22 Dec 2023 13:05:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dkWhxaS+; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703246722; 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=Xw6Xt/QDp9vXK15bzsI8PcDi8bhSbIYIklWGM3UJ24k=; b=OeAQdD28Xgm0ZKRz09V4cHPZV6LnnNeXa09ZczosvJ1dAcAgl2M34zNf0GYwmizhmwKWVs Ii+NEvkZVGBTCSH5Tl6gd1Lc0phRoGQrtO9Rgk1N+wMXs/+srzKRqDll7vO6SsGuLKR1U4 0lgZwftC4Ix5zDxXBmGbRDAp03qIRq1LHoLWvCHX3o0GqczNTmm4SIwpSf+JoG5bO4iVI+ yc3iKjNfpXjCPWQxD31RhZUJepTQoElVfgq5OpYRUD0opsH8QAV6uu3/Cn3Mp8297/5ItE p+IuNTY1lVkushMf20TvkLxf2jmOdDLqtrqq7S6OSO4Os1XHcCy6cUsWSg2RdQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dkWhxaS+; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703246722; a=rsa-sha256; cv=none; b=cFNu138VboS/UjnIXweXnzW+OLemu6WtNmnl+sOQttBRdHtR9Gtoioc/RIt2HtCvPHNyZA 6hTqhX9eM1q46s1vNXcMkI7zmZ1KMb+hrHrzqQnfuNobdZ/PQI3BZ754wcvklTFSK9+uQt Lv6XGiUGLpc6l2HwuzF/g4ZC0DJGv4Vq1LJr/WqUqb7aJFoovuHrpQUP5p2DlBwxogH0hU q8/d/yETP/68m4nC8raf0GhulMBDmrqezktzYGXZ+HSO4P2WFS7wfNaeypZCMB/nVZfZtJ er0wnWfXi/TaniXtJECjgrkM8WtuX6fC3iO3wvZw8gJIVJOYK1RjrqpXTEntEA== 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 2DB6B3C224 for ; Fri, 22 Dec 2023 13:05:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGeGP-0002nJ-On; Fri, 22 Dec 2023 07:04:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGeGN-0002ma-TJ for emacs-orgmode@gnu.org; Fri, 22 Dec 2023 07:04:23 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGeGK-0001is-CD for emacs-orgmode@gnu.org; Fri, 22 Dec 2023 07:04:22 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 7A83D240028 for ; Fri, 22 Dec 2023 13:04:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703246657; bh=bkw9FdrAgMjoFCQbTEyd+KvF2WmbjsP3NPJw5EfHwbk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=dkWhxaS++XVPKu+gWmIBZc9/IcM00DUtvUnNMy5VFfDoOwaBltw4O/cKh9O+v4Ulh OtwQlqAjqtaP0+DiZZeqgmXecHnr7osS8Dsm3kB9y2qrly3MUUcTjtGOVQCzdSZ396 0JJ5qeF2l4ckwXHpetJypzkQm0VERKctsRbepTgjMAzZ5Tk0D1iETgDKXtC3yaH2Kb J7F8EtgoPLZVfWfLLjNYXSRS8i28cREet2DJx+Z1W4SubYKHmh+ym52NCbR6aUESV9 eJeMqdffgOUi65tz3UuZ353M5oCFfJJHKhOgchT4pUSWwOzq2VLqMzU3DRYQ70HQa/ FjVq7Z1ZLXD4A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SxQvN3dt9z9rxB; Fri, 22 Dec 2023 13:04:16 +0100 (CET) From: Ihor Radchenko To: "Fraga, Eric" Cc: Emacs Org mode mailing list Subject: [PATCH] Re: [feature request] startup variable for link display In-Reply-To: <87bkst1nfl.fsf@ucl.ac.uk> References: <87bkst1nfl.fsf@ucl.ac.uk> Date: Fri, 22 Dec 2023 12:07:29 +0000 Message-ID: <87a5q2l9tq.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -7.10 X-Spam-Score: -7.10 X-Migadu-Queue-Id: 2DB6B3C224 X-TUID: SDll8bd0Q/EO --=-=-= Content-Type: text/plain "Fraga, Eric" writes: > Assuming I have not missed something, is there a variable I can set on > visiting an org buffer/file that ensures that links are displayed fully? > > Once I've loaded an org file, I can > > M-x org-toggle-link-display RET. > > but I would like certain files to start up with links displayed. > > If not already possible, it would be nice to either set a file local > variable or have, say: > > #+startup: displaylinks I went with #+startup: showlinks and #+startup: compresslinks See the attached patch. Please test. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Allow-per-buffer-setting-of-org-link-descriptive-via.patch >From f180be291a81062a5c6344876c172282969d4c66 Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko Date: Fri, 22 Dec 2023 13:04:04 +0100 Subject: [PATCH] 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 cfa59ec37..da9d8c837 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -3172,7 +3172,8 @@ ** Link Format 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 +=showlinks= [[*Summary of In-Buffer Settings][startup option]]. ** Internal Links :PROPERTIES: @@ -20229,6 +20230,17 @@ ** Summary of In-Buffer Settings | =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~. + + | =compresslinks= | Hide path and brackets in links. | + | =showlinks= | 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 6c81221c1..9b3f83705 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -362,6 +362,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: showlinks +: #+STARTUP: compresslinks + *** New variable ~org-clock-out-removed-last-clock~ The variable is intended to be used by ~org-clock-out-hook~. It is a diff --git a/lisp/org.el b/lisp/org.el index 6e6e075b4..7f7bc3000 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4061,6 +4061,8 @@ (defconst org-startup-options ("align" org-startup-align-all-tables t) ("noalign" org-startup-align-all-tables nil) ("shrink" org-startup-shrink-all-tables t) + ("compresslinks" org-link-descriptive t) + ("showlinks" 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) @@ -4847,6 +4849,17 @@ (define-derived-mode org-mode outline-mode "Org" (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))) @@ -4857,8 +4870,6 @@ (define-derived-mode org-mode outline-mode "Org" (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))) @@ -4867,15 +4878,6 @@ (define-derived-mode org-mode outline-mode "Org" (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. -- 2.42.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--