emacs-devel
[Top][All Lists]
Advanced

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

Re: PCL-CVS: M-x cvs-update vs. key binding in *cvs* buffer


From: Reiner Steib
Subject: Re: PCL-CVS: M-x cvs-update vs. key binding in *cvs* buffer
Date: Wed, 22 Aug 2007 22:07:59 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

On Tue, Aug 21 2007, Stefan Monnier wrote:

>> It seems that `cvs-query-directory' tries to figure out if it was
>> called via M-x.  But I don't quite understand the purpose.
>
> I can't remember the original reason.  It may have been to preserve the
> original behavior which was to always prompt for a directory.
> But since C-u does the job as well we don't need that kind of hack.
> Feel free to remove it,

Like this (maybe someone could suggest a nicer doc string)?
Should it go to go to Emacs 22.2 as well?

--8<---------------cut here---------------start------------->8---
(defun cvs-query-directory (prompt)
  "Read directory name, prompting with PROMPT.
If in a *cvs* buffer, don't prompt unless a prefix argument is given."
  (if (and (cvs-buffer-p)
           (not current-prefix-arg))
      default-directory
    (read-directory-name prompt nil default-directory nil)))
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
--- pcvs.el     12 Aug 2007 18:07:07 -0000      1.98.2.7
+++ pcvs.el     22 Aug 2007 20:01:16 -0000
@@ -981,13 +981,13 @@
   (interactive)
   (cvs-examine default-directory t))
 
-(defun cvs-query-directory (msg)
-  ;; last-command-char = ?\r hints that the command was run via M-x
+(defun cvs-query-directory (prompt)
+  "Read directory name, prompting with PROMPT.
+If in a *cvs* buffer, don't prompt unless a prefix argument is given."
   (if (and (cvs-buffer-p)
-          (not current-prefix-arg)
-          (not (eq last-command-char ?\r)))
+          (not current-prefix-arg))
       default-directory
-    (read-directory-name msg nil default-directory nil)))
+    (read-directory-name prompt nil default-directory nil)))
 
 ;;;###autoload
 (defun cvs-quickdir (dir &optional flags noshow)
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

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