GNU bug report logs - #30610
clarify linum-mode usage from Lisp

Previous Next

Package: emacs;

Reported by: John Shahid <jvshahid <at> gmail.com>

Date: Sun, 25 Feb 2018 23:26:02 UTC

Severity: minor

Fixed in version 27.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: John Shahid <jvshahid <at> gmail.com>
To: 30610 <at> debbugs.gnu.org
Subject: bug#30610: clarify linux-mode usage from Lisp
Date: Sun, 25 Feb 2018 14:55:53 -0500
[0001-clarifies-linum-mode-usage-from-Lisp.patch (text/x-diff, inline)]
From 04d261f836e5b000e8f6ed9e343417feaa8bc273 Mon Sep 17 00:00:00 2001
From: John Shahid <jvshahid <at> gmail.com>
Date: Sun, 25 Feb 2018 14:33:00 -0500
Subject: [PATCH] clarifies linum-mode usage from Lisp

---
 lisp/linum.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/linum.el b/lisp/linum.el
index 9df0c5d023..fa66d62bfe 100644
--- a/lisp/linum.el
+++ b/lisp/linum.el
@@ -76,8 +76,12 @@ linum-delay
 (define-minor-mode linum-mode
   "Toggle display of line numbers in the left margin (Linum mode).
 With a prefix argument ARG, enable Linum mode if ARG is positive,
-and disable it otherwise.  If called from Lisp, enable the mode
-if ARG is omitted or nil.
+and disable it otherwise.
+
+When called from Lisp, toggles the mode if the argument is
+`toggle', disables the mode if the argument is a non-positive
+integer, and enables the mode otherwise (including if the
+argument is omitted or nil or a positive integer).
 
 Linum mode is a buffer-local minor mode."
   :lighter ""                           ; for desktop.el
-- 
2.16.2

[Message part 2 (text/plain, inline)]
The attached patch fixes a bug in the docstring of linum-mode regarding
calling it from Lisp. It incorrectly state that calling the function
with no args or nil will enable the mode; this gives the impression that
any other value disables the mode, which isn't the case. The patches
copies the relevant section from define-minor-mode

cheers,

-js

This bug report was last modified 5 years and 332 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.