]> git.eshelyaron.com Git - emacs.git/commitdiff
ibuffer-do-toggle-read-only: Fix unused argument
authorTino Calancha <tino.calancha@gmail.com>
Sat, 17 Sep 2016 13:38:19 +0000 (22:38 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Sat, 17 Sep 2016 13:38:19 +0000 (22:38 +0900)
* lisp/ibuffer.el (ibuffer-do-toggle-read-only): Call
'read-only-mode' with ARG when its an integer.
Clarify the meaning of ARG in doc string.

lisp/ibuffer.el

index 8e246297ff760601a5c0d151833e3261d7801f7c..0336f1d41b1eaa6298f89825dd60c5f2e67e05c0 100644 (file)
@@ -1299,13 +1299,15 @@ a new window in the current frame, splitting vertically."
    :modifier-p t)
   (set-buffer-modified-p (not (buffer-modified-p))))
 
-(define-ibuffer-op ibuffer-do-toggle-read-only (&optional _arg);FIXME:arg unused!
+(define-ibuffer-op ibuffer-do-toggle-read-only (&optional arg)
   "Toggle read only status in marked buffers.
-With optional ARG, make read-only only if ARG is not negative."
+If optional ARG is a non-negative integer, make buffers read only.
+If ARG is a negative integer or 0, make buffers writable.
+Otherwise, toggle read only status."
   (:opstring "toggled read only status in"
    :interactive "P"
    :modifier-p t)
-  (read-only-mode 'toggle))
+  (read-only-mode (if (integerp arg) arg 'toggle)))
 
 (define-ibuffer-op ibuffer-do-delete ()
   "Kill marked buffers as with `kill-this-buffer'."