File 0011-Add-custom-to-always-copy-current-node-with-info-com.patch of Package emacs

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@thaodan.de>
Date: Wed, 15 Jan 2025 15:21:07 +0200
Subject: [PATCH] Add custom to always copy current node with info command

* lisp/info.el (Info-copy-current-node-name-always-info):
(Info-copy-current-node-name):
Add custom to always copy current node with info command.
Reverse meaning zero prefix arg if enabled.
---
 lisp/info.el | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lisp/info.el b/lisp/info.el
index 0ea7c49f03efb5688ff7b235687038ad310cad14..2b11c1ed1d9dfd08be0f5bac320b3fa418c1af8f 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -69,6 +69,12 @@ Info-history-skip-intermediate-nodes
   :type 'boolean
   :version "24.1")
 
+(defcustom Info-copy-current-node-name-always-info nil
+  "If non-nil always put node name inside a function to call info.
+This also reverse the zero prefix arg in `info-copy-current-node-name'."
+  :type 'boolean
+  :version "31.1")
+
 (defvar Info-enable-active-nodes nil
   "Non-nil allows Info to execute Lisp code associated with nodes.
 The Lisp code is executed when the node is selected.")
@@ -4464,7 +4470,8 @@ Info-menu-update
 (defun Info-copy-current-node-name (&optional arg)
   "Put the name of the current Info node into the kill ring.
 The name of the Info file is prepended to the node name in parentheses.
-With a zero prefix ARG, put the name inside a function call to `info'.
+With a zero prefix ARG, put the name inside a function call to `info';
+If `Info-copy-current-node-name-always-info' is t the meaning is reversed.
 If ARG is 4 put link to Info node from `Info-url-alist.' into the kill ring."
   (interactive "P" Info-mode)
   (unless Info-current-node
@@ -4474,7 +4481,11 @@ Info-copy-current-node-name
 			       (file-name-nondirectory Info-current-file))
 			  ") "
 			  Info-current-node))))
-    (if (zerop (prefix-numeric-value arg))
+    (if (or (and (not Info-copy-current-node-name-always-info)
+                 (zerop (prefix-numeric-value arg)))
+            (and Info-copy-current-node-name-always-info
+                 (not (zerop (prefix-numeric-value arg)))
+                 (not (equal (prefix-numeric-value arg) 4))))
         (setq node (concat "(info \"" node "\")")))
     (if (equal (prefix-numeric-value arg) 4)
         (let (filename)
openSUSE Build Service is sponsored by