unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Info keybindings
@ 2004-05-24  9:55 Juri Linkov
  2004-05-24 17:35 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2004-05-24  9:55 UTC (permalink / raw)


Isn't `w' a better keybinding for `Info-copy-current-node-name'?

I often type `w' in Info mode, switch buffers and type `C-y'
to insert a copied Info node name, but then I finally realize
that no Info node name was actually copied.

The habit to type `w' to copy a name was formed by typing `w'
in Dired mode where it is bound to `dired-copy-filename-as-kill'.

Having two similar commands bound to different keys is too
inconsistent.  Perhaps it's not too late to change keybindings
because no Emacs release was made with `c' keybinding yet.

And by analogy with Dired mode `M-0 w' could copy something
more, for example, a whole command to find an Info node,
e.g. (info "(emacs)Top") which serves as a link in all modes
by typing `C-x C-e' on it.

`Info-copy-current-node-name' could also confirm that something
was actually copied into the kill ring by displaying a copied text
in the echo area like Dired already does that.

Index: lisp/info.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/info.el,v
retrieving revision 1.395
diff -u -r1.395 info.el
--- lisp/info.el	23 May 2004 20:53:42 -0000	1.395
+++ lisp/info.el	24 May 2004 06:43:34 -0000
@@ -2758,7 +2758,6 @@
   (define-key Info-mode-map "<" 'Info-top-node)
   (define-key Info-mode-map ">" 'Info-final-node)
   (define-key Info-mode-map "b" 'beginning-of-buffer)
-  (define-key Info-mode-map "c" 'Info-copy-current-node-name)
   (define-key Info-mode-map "d" 'Info-directory)
   (define-key Info-mode-map "e" 'Info-edit)
   (define-key Info-mode-map "f" 'Info-follow-reference)
@@ -2776,6 +2775,7 @@
   (define-key Info-mode-map "\M-n" 'clone-buffer)
   (define-key Info-mode-map "t" 'Info-top-node)
   (define-key Info-mode-map "u" 'Info-up)
+  (define-key Info-mode-map "w" 'Info-copy-current-node-name)
   (define-key Info-mode-map "," 'Info-index-next)
   (define-key Info-mode-map "\177" 'Info-scroll-down)
   (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
@@ -2920,20 +2920,23 @@
     (error (ding))))
 
 \f
-(defun Info-copy-current-node-name ()
+(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."
-  (interactive)
+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'."
+  (interactive "P")
   (unless Info-current-node
     (error "No current info node"))
-  (kill-new
-   (concat "("
-	   (file-name-nondirectory
-	    (if (stringp Info-current-file)
-		Info-current-file
-	      (or buffer-file-name "")))
-	   ")"
-	   Info-current-node)))
+  (let ((node (concat "(" (file-name-nondirectory
+                           (or (and (stringp Info-current-file)
+                                    Info-current-file)
+                               buffer-file-name
+                               ""))
+                      ")" Info-current-node)))
+    (if (zerop (prefix-numeric-value arg))
+        (setq node (concat "(info \"" node "\")")))
+    (kill-new node)
+    (message "%s" node)))
 
 \f
 ;; Info mode is suitable only for specially formatted data.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Info keybindings
  2004-05-24  9:55 Info keybindings Juri Linkov
@ 2004-05-24 17:35 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2004-05-24 17:35 UTC (permalink / raw)
  Cc: emacs-devel

    Isn't `w' a better keybinding for `Info-copy-current-node-name'?

This seems like a good change to me.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-24 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-24  9:55 Info keybindings Juri Linkov
2004-05-24 17:35 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).