unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
Subject: Re: syntax highlighting
Date: Sun, 16 Nov 2014 22:04:18 -0700	[thread overview]
Message-ID: <20141116220147423535443@bob.proulx.com> (raw)
In-Reply-To: <87d28m1usd.fsf@robertthorpeconsulting.com>

Robert Thorpe wrote:
> M P writes:
> > Thanks, I had  (global-font-lock-mode) which worked previously,
> 
> Doing just M-x global-font-lock-mode toggles font-lock.  That means that
> if it's off it's turned on and vice-versa.  All of the global
> minor-modes work like that.  As I understand it, this behaviour was
> found to be confusing in lisp programs.  Anyway, now M-x global-xxx-mode
> still toggles, but in a lisp program (global-xxx-mode) now always means
> "turn function xxx on".

I rather dislike controls that toggle.  Whether they are programmatic
interfaces or physical buttons.  For programs is always the problem
that you must ensure that they are in a particular state before
toggling.  For physical buttons I always seem to fat-finger them and
hit them multiple times.  I much prefer set buttons such as off or on
that it doesn't matter if you have contact bounce that they will still
do exactly what you want regardless of the number of events or not.

However for font lock mode it takes an optional argument.

  (global-font-lock-mode 0)

The docs say:

  (global-font-lock-mode &optional ARG)

  Toggle Font-Lock mode in all buffers.
  With prefix ARG, enable Global-Font-Lock mode if ARG is positive;
  otherwise, disable it.  If called from Lisp, enable the mode if
  ARG is omitted or nil.

So giving it a 0 argument definitely turns it off and does not toggle
it.

Bob



  reply	other threads:[~2014-11-17  5:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-16  1:40 syntax highlighting mzp3769
2014-11-16  7:56 ` Emanuel Berg
2014-11-16 15:08   ` M P
2014-11-16 19:31     ` Bob Proulx
     [not found]     ` <mailman.13823.1416166289.1147.help-gnu-emacs@gnu.org>
2014-11-16 21:15       ` M P
2014-11-17  1:26         ` Robert Thorpe
2014-11-17  5:04           ` Bob Proulx [this message]
2014-11-17 14:53             ` Bruno Félix Rezende Ribeiro
2014-11-17 15:01               ` Stefan Monnier
2014-11-18  2:15                 ` Bob Proulx
2014-11-18  8:59                   ` Bruno Félix Rezende Ribeiro
2014-11-18 18:23                     ` Bob Proulx
     [not found]             ` <mailman.13882.1416236018.1147.help-gnu-emacs@gnu.org>
2014-11-18  2:10               ` Emanuel Berg
     [not found]           ` <mailman.13854.1416200675.1147.help-gnu-emacs@gnu.org>
2014-11-18  2:00             ` Emanuel Berg
2014-11-16 21:16     ` Emanuel Berg
2014-11-17  2:15 ` Robert Thorpe
  -- strict thread matches above, loose matches on Subject: below --
2015-03-16 17:39 Bostjan Vilfan
2015-03-15 21:31 Bostjan Vilfan
2015-03-16  2:55 ` Stefan Monnier
2003-01-28 16:02 Bingham, Jay
2003-01-28 12:42 Paul O'Donnell
2003-01-28 13:06 ` Christopher J. White
2003-01-28 13:07 ` David Kastrup
2003-01-28 15:11 ` Kester Clegg
2003-01-29  8:07 ` Lee Sau Dan
2002-11-20 22:26 Michael Mossey
2002-11-20 23:30 ` Michael Slass
2002-11-21  6:06   ` Eli Zaretskii

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=20141116220147423535443@bob.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).