unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: custom-set-minor-mode
Date: Sat, 9 Apr 2005 17:07:04 -0500 (CDT)	[thread overview]
Message-ID: <200504092207.j39M74D26179@raven.dms.auburn.edu> (raw)

Any non-nil value for a minor mode _variable_ is supposed to indicate
an enabled mode.  It would appear that this includes the value 0 and
negative values.  But currently, when set through Custom, such values
disable the mode.

I believe that it is definitely better to use `t' to enable a minor
mode by default through Custom than a random non-nil value like 0.
Otherwise Custom might get confused if something "simplifies" the
non-nil value to `t', as I believe `define-minor-mode' does.  On the
other hand, it is clearly documented that any non-nil value of the
variable indicates an enabled mode.

I can install the following patch, if we want to change this:

===File ~/custom.el-diff====================================
*** custom.el	05 Mar 2005 21:27:39 -0600	1.81
--- custom.el	08 Apr 2005 22:22:22 -0500	
***************
*** 841,848 ****
  this sets the local binding in that buffer instead."
    (if custom-local-buffer
        (with-current-buffer custom-local-buffer
! 	(funcall variable (or value 0)))
!     (funcall variable (or value 0))))
  
  (defun custom-quote (sexp)
    "Quote SEXP iff it is not self quoting."
--- 841,848 ----
  this sets the local binding in that buffer instead."
    (if custom-local-buffer
        (with-current-buffer custom-local-buffer
! 	(funcall variable (if value 1 0)))
!     (funcall variable (if value 1 0))))
  
  (defun custom-quote (sexp)
    "Quote SEXP iff it is not self quoting."
============================================================

             reply	other threads:[~2005-04-09 22:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-09 22:07 Luc Teirlinck [this message]
2005-04-10 16:48 ` custom-set-minor-mode Richard Stallman
2005-04-11  1:54   ` custom-set-minor-mode Luc Teirlinck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504092207.j39M74D26179@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).