emacs-devel
[Top][All Lists]
Advanced

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

Re: Enhancements to options menu (was Re: Reveal mode)


From: Kim F. Storm
Subject: Re: Enhancements to options menu (was Re: Reveal mode)
Date: 07 May 2002 01:12:29 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

Richard Stallman <address@hidden> writes:

>     > I don't entirely understand this suggestion:
>     > 
>     >         [x] Abbreviation mode    [advanced]
>     >         [x] Revert mode          [advanced]
>     > 
>     > What does "advanced" mean here?
>     > 
>     > 
> 
>     It would enter the corresponding custiomize-group.
> 
> How is that different from what M-x customize-browse does?

Try this "dummy" preferences code to see what I'm suggesting:

(require 'wid-edit)
(require 'cus-edit)

(defun preferences ()
  "Create a buffer containing popular customization options."
  (interactive)
  (let ((name "*Preferences*"))
    (kill-buffer (get-buffer-create name))
    (pop-to-buffer (get-buffer-create name))
    (custom-mode)
    (buffer-disable-undo)

    (widget-insert "Display Options\n\n")

    (widget-create 'checkbox)
    (widget-insert " Auto Reveal hidden text\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Show trailing Whitespace\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Indicate Empty Lines\t\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Display Image files\t\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Highlight current line\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Blinking cursor\t\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Auto resize minibuffer\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-insert "\nEditing Options\n\n")

    (widget-create 'checkbox)
    (widget-insert " Auto Expand Abbreviations\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Auto Revert changed files\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Auto Save files\t\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n")

    (widget-create 'checkbox)
    (widget-insert " Auto Expand Abbreviations\t")
    (widget-create 'push-button :tag "Advanced")
    (widget-insert "\n\n")

    (widget-insert "         ")
    (widget-create 'push-button
                   :tag "Save"
                   :help-echo "\
Make your editing in this buffer take effect for future Emacs sessions."
                   :action (lambda (widget &optional event)
                             (Custom-save)))
    (widget-insert "   ")
    (widget-create 'push-button
                   :tag "Cancel"
                   :help-echo
                   (lambda (&rest ignore)
                     (cond
                      ((eq custom-buffer-done-function
                           'custom-bury-buffer)
                       "Bury this buffer")
                      ((eq custom-buffer-done-function 'kill-buffer)
                       "Kill this buffer")
                      (t "Finish with this buffer")))
                   :action #'Custom-buffer-done)
    (widget-insert "\n\n")
    (widget-setup)
    (buffer-enable-undo)
    (goto-char (point-min))))




reply via email to

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