bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HOW CAN I STOP THIS NOVICE MODE STUFF?


From: Bruce Korb
Subject: Re: HOW CAN I STOP THIS NOVICE MODE STUFF?
Date: Wed, 02 Jan 2008 13:45:48 -0800
User-agent: Thunderbird 2.0.0.6 (X11/20070801)

Dan Nicolaescu wrote:
>   > /*
>   >  * Local Variables:
>   >  * .....
>   >  * user-approves-of-everything: bkorb
>   >  * End:
>   >  */
> 
> Can you please post the contents of the local variables section for the
> file that causes this?

It is not germane because I refer to any such variable,
but most especially to those that are unfixable and trigger
this ``Do you want to apply it?'' unsuppressable message.

Anyway, here you go:



(defun hack-local-variables-confirm (vars unsafe-vars risky-vars)
  (if noninteractive
      nil
    (let ((name (if buffer-file-name
                    (file-name-nondirectory buffer-file-name)
                  (concat "buffer " (buffer-name))))
          (offer-save (and (eq enable-local-variables t) unsafe-vars))
          prompt char)
      (save-window-excursion
        (let ((buf (get-buffer-create "*Local Variables*")))
          (pop-to-buffer buf)
          (set (make-local-variable 'cursor-type) nil)
          (erase-buffer)
          (if unsafe-vars
              (insert "The local variables list in " name
                      "\ncontains values that may not be safe (*)"
                      (if risky-vars
                          ", and variables that are risky (**)."
                        "."))
            (if risky-vars
                (insert "The local variables list in " name
                        "\ncontains variables that are risky (**).")
              (insert "A local variables list is specified in " name ".")))
          (insert "\n\nDo you want to apply it?  You can type
y  -- to apply the local variables list.
n  -- to ignore the local variables list.")
          (if offer-save
              (insert "
!  -- to apply the local variables list, and permanently mark these
      values (*) as safe (in the future, they will be set automatically.)\n\n")
            (insert "\n\n"))

Things to note:

1.  There is no convenient way to just hush the thing up and tell it,
    "I do not mess with untrustworthy files.  Leave me alone."

2.  Sometimes, even "offer-save" is false, so the possibility of
    saying "don't bother me with this any more" is not allowed.

What do you mean by, "not allowed"?  I know my wants and needs better
than any silly program.  Really.  I do.  Perhaps I should replace this:

(defun hack-local-variables-confirm (_v _uv _rv) #t)

Yes?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]