unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org, Richard Stallman <rms@gnu.org>,
	Chong Yidong <cyd@stupidchicken.com>
Cc: David Koppelman <koppel@ece.lsu.edu>
Subject: Re: Changes to hi-lock before release.
Date: 24 Apr 2007 23:10:12 +0200	[thread overview]
Message-ID: <20070424223047.GA9455@muc.de> (raw)
In-Reply-To: <7wejmekgrd.fsf@ece.lsu.edu>

Hi, Richard, Chong and Emacs!

On Fri, Apr 20, 2007 at 02:06:14PM -0500, David Koppelman wrote:
> I believe the following changes should be made to hi-lock before
> release. The problem is that hi-lock can automatically add font-lock
> keywords when a buffer is loaded, allowing for some mischief.  The
> patch sets the loading of patterns from files off by default, but
> by setting a variable the user can be prompted or can provide
> a function to determine safety. The user can still add the patterns
> by using a key sequence.

> If font-lock-pattern safety-checking code becomes available later
> I'll use that instead of these changes.

Sorry to come into this thread so late.  I think there're serious
problems with the patched hi-lock-mode (I've just fired up the latest
pretest, 22.0.99): it treats users with less friendliness than they're
entitled to expect:

1: Start emacs -Q
2: Load the following file into Emacs with C-x C-f hilight-test.txt:
#########################################################################
Hi-lock: (("FIXME!!!" (0 (quote hi-yellow) t)))


This line contains a FIXME!!!
######################################################################### 
3: Do M-x hi-lock-mode

Nothing happens.  Zilch.  Sweet Fanny Adams.  What should happen is that
"FIXME!!!" become yellow.  It worked in Emacs 21.  At the very least,
the user should get something in the message area, such as "Hi-Lock:
auto highlighting of patterns disabled".  Surely?

I don't think it's reasonable to expect a normal user to go hunting
through the new Emacs manual or even the doc string (much less the
source code) to diagnose this absence of an informational message.  Many
of them are going to get angry, some of them are going to vent that
anger on help-gnu-emacs, and a fair number of them may feel like calling
us rude names - I, for one, wouldn't blame them.

The description of C-x w b (on page "Highlight Interactively") doesn't
seem to describe accurately what now happens when a file into which
patterns are written later gets visited.

The way I use hi-lock-mode is by having quite a lot of patterns at the
top of a personal log file which highlight things like dates, particular
filenames, "FIXME!!!", and so on.  I expect this kind of usage is quite
common, and have been used to it just working without hassle.  I think,
by contrast, that David (the writer of the patch) and most other people
here have been assuming that storing hi-lock patterns in a file is a
minor, barely used facility.

Why is the default for the new option `hi-lock-file-patterns-policy' set
to nil?  Surely it should be 'ask - MUST be 'ask, otherwise nobody will
know it's there.  Why isn't the value t effective for the variable?  Why
do I have to write

(defun return-t (arg) t)

, and set the hi-lock-file-patterns-policy to that instead?  Is this
some sort of security by obscurity?  I think that hi-lock-mode is one of
relatively few of Emacs's advanced features that will appeal
particularly to non-programmers, and they're going to be less well
equipped to start writing defuns than a typical hacker.  Why are we
imposing this pain on them?

In the doc string fragment "If 'ask, prompt when patterns found in
buffer", I think that "prompt", used as an intransitive verb, is a bad
way of saying "ask the user"; it seems to be an abbreviation of "prompt
the user to anwer a question", but the essence of this fuller version is
the "answer", not the "prompt".  "prompt" (intr) seems to be
subliminally insulting - "nudge you, because you're too thick to see
this on your own".  So I think that should be changed too.

I also think it imperative that the option be a customization variable -
it will be jarring indeed for this isolated option NOT to be
customisable - it might even look like the variable was thrown in in a
hurry at the last moment.  ;-)  However, I don't feel up to learning how
to write defcustoms so late in the evening, so would somebody else be
willing to do this?

I think this situation urgently needs fixing.  For the other things,
I've started writing a patch.  I hope to be able to post it in
emacs-devel in a little over 12 hours time (I'm not hacker enough to go
24 hours without sleep).

-- 
Alan Mackenzie (Ittersbach, Germany).

  parent reply	other threads:[~2007-04-24 21:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20 19:06 Changes to hi-lock before release David Koppelman
2007-04-20 19:29 ` Chong Yidong
2007-04-21  9:20   ` Eli Zaretskii
2007-04-21 10:12     ` Johan Bockgård
2007-04-21 18:25       ` Richard Stallman
2007-04-21 19:26         ` Chong Yidong
2007-04-22  3:13           ` Eli Zaretskii
     [not found] ` <E1HfGbN-0006PL-IH@fencepost.gnu.org>
2007-04-21 17:32   ` Chong Yidong
2007-04-22  0:46     ` Richard Stallman
2007-04-22  1:47       ` Glenn Morris
2007-04-23  3:48         ` Richard Stallman
2007-04-22  0:46     ` Richard Stallman
2007-04-22  2:45       ` Chong Yidong
2007-04-23  3:47         ` Richard Stallman
2007-04-23 14:39           ` Chong Yidong
2007-04-24 21:10 ` Alan Mackenzie [this message]
2007-04-24 21:34   ` David Koppelman
2007-04-25 11:53     ` Changes to hi-lock before release. PATCH Alan Mackenzie
2007-04-25 14:51     ` Changes to hi-lock before release Richard Stallman
2007-04-25 15:18       ` David Koppelman
2007-04-27  5:59         ` Richard Stallman

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=20070424223047.GA9455@muc.de \
    --to=acm@muc.de \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=koppel@ece.lsu.edu \
    --cc=rms@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.
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).