comparison lisp/x-menubar.el @ 278:90d73dddcdc4 r21-0b37

Import from CVS: tag r21-0b37
author cvs
date Mon, 13 Aug 2007 10:31:29 +0200
parents c5d627a313b1
children 7df0dd720c89
comparison
equal deleted inserted replaced
277:cfdf3ff11843 278:90d73dddcdc4
234 ["Face..." customize-face] 234 ["Face..." customize-face]
235 ["Saved..." customize-saved] 235 ["Saved..." customize-saved]
236 ["Set..." customize-customized] 236 ["Set..." customize-customized]
237 ["Apropos..." customize-apropos] 237 ["Apropos..." customize-apropos]
238 ["Browse..." customize-browse]) 238 ["Browse..." customize-browse])
239 ["Read Only" (toggle-read-only)
240 :style toggle :selected buffer-read-only]
241 ("Editing Options" 239 ("Editing Options"
242 ["Overstrike" (progn 240 ["Overstrike"
243 (overwrite-mode current-prefix-arg) 241 (progn
244 (setq-default overwrite-mode overwrite-mode)) 242 (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual))
243 (customize-set-variable 'overwrite-mode overwrite-mode))
245 :style toggle :selected overwrite-mode] 244 :style toggle :selected overwrite-mode]
246 ["Case Sensitive Search" (progn 245 ["Case Sensitive Search"
247 (setq case-fold-search 246 (customize-set-variable 'case-fold-search
248 (not case-fold-search)) 247 (setq case-fold-search (not case-fold-search)))
249 (setq-default case-fold-search
250 case-fold-search))
251 :style toggle :selected (not case-fold-search)] 248 :style toggle :selected (not case-fold-search)]
252 ["Case Matching Replace" (setq case-replace (not case-replace)) 249 ["Case Matching Replace"
250 (customize-set-variable 'case-replace (not case-replace))
253 :style toggle :selected case-replace] 251 :style toggle :selected case-replace]
254 ["Auto Delete Selection" (pending-delete-mode 252 ["Auto Delete Selection"
255 (if pending-delete-mode 0 1)) 253 (customize-set-variable 'pending-delete-mode (not pending-delete-mode))
256 :style toggle 254 :style toggle
257 :selected (and (boundp 'pending-delete-mode) pending-delete-mode) 255 :selected (and (boundp 'pending-delete-mode) pending-delete-mode)
258 :active (fboundp 'pending-delete-mode)] 256 :active (boundp 'pending-delete-mode)]
259 ["Active Regions" (setq zmacs-regions (not zmacs-regions)) 257 ["Active Regions"
258 (customize-set-variable 'zmacs-regions (not zmacs-regions))
260 :style toggle :selected zmacs-regions] 259 :style toggle :selected zmacs-regions]
261 ["Mouse Paste At Text Cursor" (setq mouse-yank-at-point 260 ["Mouse Paste At Text Cursor"
262 (not mouse-yank-at-point)) 261 (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point))
263 :style toggle :selected mouse-yank-at-point] 262 :style toggle :selected mouse-yank-at-point]
264 ["Require Newline At End" (setq require-final-newline 263 ("Newline at end of file..."
265 (or (eq require-final-newline 'ask) 264 ["Don't require"
266 (not require-final-newline))) 265 (customize-set-variable 'require-final-newline nil)
267 :style toggle :selected (eq require-final-newline 't)] 266 :style radio :selected (not require-final-newline)]
268 ["Add Newline When Moving Past End" (setq next-line-add-newlines 267 ["Require"
269 (not next-line-add-newlines)) 268 (customize-set-variable 'require-final-newline t)
269 :style radio :selected (eq require-final-newline t)]
270 ["Ask"
271 (customize-set-variable 'require-final-newline 'ask)
272 :style radio :selected (and require-final-newline
273 (not (eq require-final-newline t)))])
274 ["Add Newline When Moving Past End"
275 (customize-set-variable 'next-line-add-newlines
276 (not next-line-add-newlines))
270 :style toggle :selected next-line-add-newlines] 277 :style toggle :selected next-line-add-newlines]
271 ) 278 )
272 ("General Options" 279 ("General Options"
273 ["Teach Extended Commands" (setq teach-extended-commands-p 280 ["Teach Extended Commands"
274 (not teach-extended-commands-p)) 281 (customize-set-variable 'teach-extended-commands-p
282 (not teach-extended-commands-p))
275 :style toggle :selected teach-extended-commands-p] 283 :style toggle :selected teach-extended-commands-p]
276 ["Debug On Error" (setq debug-on-error (not debug-on-error)) 284 ["Debug On Error"
285 (customize-set-variable 'debug-on-error (not debug-on-error))
277 :style toggle :selected debug-on-error] 286 :style toggle :selected debug-on-error]
278 ["Debug On Quit" (setq debug-on-quit (not debug-on-quit)) 287 ["Debug On Quit"
288 (customize-set-variable 'debug-on-quit (not debug-on-quit))
279 :style toggle :selected debug-on-quit] 289 :style toggle :selected debug-on-quit]
280 ) 290 )
281 ("Printing Options" 291 ("Printing Options"
282 ["Command-Line Switches for `lpr'/`lp'..." 292 ["Command-Line Switches for `lpr'/`lp'..."
283 (setq lpr-switches 293 ;; better to directly open a customization buffer, since the value
284 (read-expression "Switches for `lpr'/`lp': " 294 ;; must be a list of strings, which is somewhat complex to prompt for.
285 (format "%S" lpr-switches))) 295 (customize-variable 'lpr-switches)
286 (boundp 'lpr-switches)] 296 (boundp 'lpr-switches)]
287 ("Pretty-Print Paper Size" 297 ("Pretty-Print Paper Size"
288 ["Letter" 298 ["Letter"
289 (setq ps-paper-type 'letter) 299 (customize-set-variable 'ps-paper-type 'letter)
290 :style radio 300 :style radio
291 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter)) 301 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter))
292 :active (fboundp 'ps-print-buffer)] 302 :active (boundp 'ps-paper-type)]
293 ["Letter-small" 303 ["Letter-small"
294 (setq ps-paper-type 'letter-small) 304 (customize-set-variable 'ps-paper-type 'letter-small)
295 :style radio 305 :style radio
296 :selected (and (boundp 'ps-paper-type) 306 :selected (and (boundp 'ps-paper-type)
297 (eq ps-paper-type 'letter-small)) 307 (eq ps-paper-type 'letter-small))
298 :active (fboundp 'ps-print-buffer)] 308 :active (boundp 'ps-paper-type)]
299 ["Legal" 309 ["Legal"
300 (setq ps-paper-type 'legal) 310 (customize-set-variable 'ps-paper-type 'legal)
301 :style radio 311 :style radio
302 :selected (and (boundp 'ps-paper-type) 312 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal))
303 (eq ps-paper-type 'legal)) 313 :active (boundp 'ps-paper-type)]
304 :active (fboundp 'ps-print-buffer)]
305 ["Statement" 314 ["Statement"
306 (setq ps-paper-type 'statement) 315 (customize-set-variable 'ps-paper-type 'statement)
307 :style radio 316 :style radio
308 :selected (and (boundp 'ps-paper-type) 317 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'statement))
309 (eq ps-paper-type 'statement)) 318 :active (boundp 'ps-paper-type)]
310 :active (fboundp 'ps-print-buffer)] 319 ["Executive"
311 ["Executive" 320 (customize-set-variable 'ps-paper-type 'executive)
312 (setq ps-paper-type 'executive)
313 :style radio 321 :style radio
314 :selected (and (boundp 'ps-paper-type) 322 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'executive))
315 (eq ps-paper-type 'executive)) 323 :active (boundp 'ps-paper-type)]
316 :active (fboundp 'ps-print-buffer)]
317 ["Tabloid" 324 ["Tabloid"
318 (setq ps-paper-type 'tabloid) 325 (customize-set-variable 'ps-paper-type 'tabloid)
319 :style radio 326 :style radio
320 :selected (and (boundp 'ps-paper-type) 327 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'tabloid))
321 (eq ps-paper-type 'tabloid)) 328 :active (boundp 'ps-paper-type)]
322 :active (fboundp 'ps-print-buffer)] 329 ["Ledger"
323 ["Ledger" 330 (customize-set-variable 'ps-paper-type 'ledger)
324 (setq ps-paper-type 'ledger)
325 :style radio 331 :style radio
326 :selected (and (boundp 'ps-paper-type) 332 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger))
327 (eq ps-paper-type 'ledger)) 333 :active (boundp 'ps-paper-type)]
328 :active (fboundp 'ps-print-buffer)]
329 ["A3" 334 ["A3"
330 (setq ps-paper-type 'a3) 335 (customize-set-variable 'ps-paper-type 'a3)
331 :style radio 336 :style radio
332 :selected (and (boundp 'ps-paper-type) 337 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3))
333 (eq ps-paper-type 'a3)) 338 :active (boundp 'ps-paper-type)]
334 :active (fboundp 'ps-print-buffer)] 339 ["A4"
335 ["A4" 340 (customize-set-variable 'ps-paper-type 'a4)
336 (setq ps-paper-type 'a4)
337 :style radio 341 :style radio
338 :selected (and (boundp 'ps-paper-type) 342 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4))
339 (eq ps-paper-type 'a4)) 343 :active (boundp 'ps-paper-type)]
340 :active (fboundp 'ps-print-buffer)] 344 ["A4small"
341 ["A4small" 345 (customize-set-variable 'ps-paper-type 'a4small)
342 (setq ps-paper-type 'a4small)
343 :style radio 346 :style radio
344 :selected (and (boundp 'ps-paper-type) 347 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small))
345 (eq ps-paper-type 'a4small)) 348 :active (boundp 'ps-paper-type)]
346 :active (fboundp 'ps-print-buffer)] 349 ["B4"
347 ["B4" 350 (customize-set-variable 'ps-paper-type 'b4)
348 (setq ps-paper-type 'b4)
349 :style radio 351 :style radio
350 :selected (and (boundp 'ps-paper-type) 352 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4))
351 (eq ps-paper-type 'b4)) 353 :active (boundp 'ps-paper-type)]
352 :active (fboundp 'ps-print-buffer)] 354 ["B5"
353 ["B5" 355 (customize-set-variable 'ps-paper-type 'b5)
354 (setq ps-paper-type 'b5)
355 :style radio 356 :style radio
356 :selected (and (boundp 'ps-paper-type) 357 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b5))
357 (eq ps-paper-type 'b5)) 358 :active (boundp 'ps-paper-type)]
358 :active (fboundp 'ps-print-buffer)]
359 ) 359 )
360 ["Color Printing" 360 ["Color Printing"
361 (when (boundp 'ps-print-color-p) 361 (cond (ps-print-color-p
362 (if ps-print-color-p 362 (customize-set-variable 'ps-print-color-p nil)
363 (progn 363 ;; I'm wondering whether all this muck is usefull.
364 (setq ps-print-color-p nil) 364 (and (boundp 'original-face-background)
365 (when (and (boundp 'original-face-background) 365 original-face-background
366 original-face-background) 366 (set-face-background 'default original-face-background)))
367 (set-face-background 'default original-face-background))) 367 (t
368 (setq original-face-background (face-background-instance 'default)) 368 (customize-set-variable 'ps-print-color-p t)
369 (set-face-background 'default "white") 369 (setq original-face-background
370 (setq ps-print-color-p t))) 370 (face-background-instance 'default))
371 :style toggle :selected (and (boundp 'ps-print-color-p) 371 (set-face-background 'default "white")))
372 ps-print-color-p) 372 :style toggle
373 :active (fboundp 'ps-print-buffer)]) 373 :selected (and (boundp 'ps-print-color-p) ps-print-color-p)
374 :active (boundp 'ps-print-color-p)])
374 ("\"Other Window\" Location" 375 ("\"Other Window\" Location"
375 ["Always in Same Frame" 376 ["Always in Same Frame"
376 (setq get-frame-for-buffer-default-instance-limit nil) 377 (customize-set-variable
378 'get-frame-for-buffer-default-instance-limit nil)
377 :style radio 379 :style radio
378 :selected (null get-frame-for-buffer-default-instance-limit)] 380 :selected (null get-frame-for-buffer-default-instance-limit)]
379 ["Other Frame (2 Frames Max)" 381 ["Other Frame (2 Frames Max)"
380 (setq get-frame-for-buffer-default-instance-limit 2) 382 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 2)
381 :style radio 383 :style radio
382 :selected (eq 2 get-frame-for-buffer-default-instance-limit)] 384 :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
383 ["Other Frame (3 Frames Max)" 385 ["Other Frame (3 Frames Max)"
384 (setq get-frame-for-buffer-default-instance-limit 3) 386 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 3)
385 :style radio 387 :style radio
386 :selected (eq 3 get-frame-for-buffer-default-instance-limit)] 388 :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
387 ["Other Frame (4 Frames Max)" 389 ["Other Frame (4 Frames Max)"
388 (setq get-frame-for-buffer-default-instance-limit 4) 390 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 4)
389 :style radio 391 :style radio
390 :selected (eq 4 get-frame-for-buffer-default-instance-limit)] 392 :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
391 ["Other Frame (5 Frames Max)" 393 ["Other Frame (5 Frames Max)"
392 (setq get-frame-for-buffer-default-instance-limit 5) 394 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 5)
393 :style radio 395 :style radio
394 :selected (eq 5 get-frame-for-buffer-default-instance-limit)] 396 :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
395 ["Always Create New Frame" 397 ["Always Create New Frame"
396 (setq get-frame-for-buffer-default-instance-limit 0) 398 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 0)
397 :style radio 399 :style radio
398 :selected (eq 0 get-frame-for-buffer-default-instance-limit)] 400 :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
399 "-----" 401 "-----"
400 ["Temp Buffers Always in Same Frame" 402 ["Temp Buffers Always in Same Frame"
401 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame) 403 (customize-set-variable 'temp-buffer-show-function
404 'show-temp-buffer-in-current-frame)
402 :style radio 405 :style radio
403 :selected (eq temp-buffer-show-function 406 :selected (eq temp-buffer-show-function
404 'show-temp-buffer-in-current-frame)] 407 'show-temp-buffer-in-current-frame)]
405 ["Temp Buffers Like Other Buffers" 408 ["Temp Buffers Like Other Buffers"
406 (setq temp-buffer-show-function nil) 409 (customize-set-variable 'temp-buffer-show-function nil)
407 :style radio 410 :style radio
408 :selected (null temp-buffer-show-function)] 411 :selected (null temp-buffer-show-function)]
409 "-----" 412 "-----"
410 ["Make current frame gnuserv target" 413 ["Make current frame gnuserv target"
411 (setq gnuserv-frame 414 (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil t))
412 (if (equal gnuserv-frame (selected-frame)) 415 :style toggle
413 'new 416 :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t))
414 (selected-frame))) 417 :active (boundp 'gnuserv-frame)]
415 :style radio
416 :selected (and (boundp 'gnuserv-frame)
417 (equal gnuserv-frame (selected-frame)))]
418 ) 418 )
419
420 "-----" 419 "-----"
421 ("Syntax Highlighting" 420 ("Syntax Highlighting"
422 ["In This Buffer" (font-lock-mode) 421 ["In This Buffer"
423 :style toggle :selected (and (boundp 'font-lock-mode) font-lock-mode) 422 (progn ;; becomes buffer local
424 :active (fboundp 'font-lock-mode)] 423 (font-lock-mode)
425 ["Automatic" (if (not (featurep 'font-lock)) 424 (customize-set-variable 'font-lock-mode font-lock-mode))
426 (progn 425 :style toggle
427 (setq font-lock-auto-fontify t) 426 :selected (and (boundp 'font-lock-mode) font-lock-mode)
428 (require 'font-lock)) 427 :active (boundp 'font-lock-mode)]
429 (setq font-lock-auto-fontify 428 ["Automatic"
430 (not font-lock-auto-fontify))) 429 (customize-set-variable 'font-lock-auto-fontify
430 (not font-lock-auto-fontify))
431 :style toggle 431 :style toggle
432 :selected (and (featurep 'font-lock) font-lock-auto-fontify) 432 :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify)
433 :active (fboundp 'font-lock-mode)] 433 :active (fboundp 'font-lock-mode)]
434 "-----" 434 "-----"
435 ["Fonts" (progn (require 'font-lock) 435 ["Fonts"
436 (font-lock-use-default-fonts) 436 (progn
437 (setq font-lock-use-fonts t 437 (require 'font-lock)
438 font-lock-use-colors nil) 438 (font-lock-use-default-fonts)
439 (font-lock-mode 1)) 439 (customize-set-variable 'font-lock-use-fonts t)
440 :style radio 440 (customize-set-variable 'font-lock-use-colors nil)
441 :selected (and (boundp 'font-lock-mode) 441 (font-lock-mode 1))
442 font-lock-mode 442 :style radio
443 font-lock-use-fonts) 443 :selected (and (boundp 'font-lock-use-fonts) font-lock-use-fonts)
444 :active (fboundp 'font-lock-mode)] 444 :active (fboundp 'font-lock-mode)]
445 ["Colors" (progn (require 'font-lock) 445 ["Colors"
446 (font-lock-use-default-colors) 446 (progn
447 (setq font-lock-use-colors t 447 (require 'font-lock)
448 font-lock-use-fonts nil) 448 (font-lock-use-default-colors)
449 (font-lock-mode 1)) 449 (customize-set-variable 'font-lock-use-colors t)
450 :style radio 450 (customize-set-variable 'font-lock-use-fonts nil)
451 :selected (and (boundp 'font-lock-mode) 451 (font-lock-mode 1))
452 font-lock-mode 452 :style radio
453 font-lock-use-colors) 453 :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors)
454 :active (fboundp 'font-lock-mode)] 454 :active (boundp 'font-lock-mode)]
455 "-----" 455 "-----"
456 ["Least" (if (or (and (not (integerp font-lock-maximum-decoration)) 456 ["Least"
457 (not (eq t font-lock-maximum-decoration))) 457 (progn
458 (and (integerp font-lock-maximum-decoration) 458 (require 'font-lock)
459 (<= font-lock-maximum-decoration 0))) 459 (if (or (and (not (integerp font-lock-maximum-decoration))
460 nil 460 (not (eq t font-lock-maximum-decoration)))
461 (setq font-lock-maximum-decoration nil) 461 (and (integerp font-lock-maximum-decoration)
462 (font-lock-recompute-variables)) 462 (<= font-lock-maximum-decoration 0)))
463 :style radio 463 nil
464 :active (and (boundp 'font-lock-mode) font-lock-mode) 464 (customize-set-variable 'font-lock-maximum-decoration nil)
465 :selected (and (boundp 'font-lock-mode) 465 (font-lock-recompute-variables)))
466 font-lock-mode 466 :style radio
467 :active (fboundp 'font-lock-mode)
468 :selected (and (boundp 'font-lock-maximium-decoration)
467 (or (and (not (integerp font-lock-maximum-decoration)) 469 (or (and (not (integerp font-lock-maximum-decoration))
468 (not (eq t font-lock-maximum-decoration))) 470 (not (eq t font-lock-maximum-decoration)))
469 (and (integerp font-lock-maximum-decoration) 471 (and (integerp font-lock-maximum-decoration)
470 (<= font-lock-maximum-decoration 0))))] 472 (<= font-lock-maximum-decoration 0))))]
471 ["More" (if (and (integerp font-lock-maximum-decoration) 473 ["More"
472 (= 1 font-lock-maximum-decoration)) 474 (progn
473 nil 475 (require 'font-lock)
474 (setq font-lock-maximum-decoration 1) 476 (if (and (integerp font-lock-maximum-decoration)
475 (font-lock-recompute-variables)) 477 (= 1 font-lock-maximum-decoration))
476 :style radio 478 nil
477 :active (and (boundp 'font-lock-mode) font-lock-mode) 479 (customize-set-variable 'font-lock-maximum-decoration 1)
478 :selected (and (boundp 'font-lock-mode) 480 (font-lock-recompute-variables)))
479 font-lock-mode 481 :style radio
482 :active (fboundp 'font-lock-mode)
483 :selected (and (boundp 'font-lock-maximium-decoration)
480 (integerp font-lock-maximum-decoration) 484 (integerp font-lock-maximum-decoration)
481 (= 1 font-lock-maximum-decoration))] 485 (= 1 font-lock-maximum-decoration))]
482 ["Even More" (if (and (integerp font-lock-maximum-decoration) 486 ["Even More"
483 (= 2 font-lock-maximum-decoration)) 487 (progn
484 nil 488 (require 'font-lock)
485 (setq font-lock-maximum-decoration 2) 489 (if (and (integerp font-lock-maximum-decoration)
486 (font-lock-recompute-variables)) 490 (= 2 font-lock-maximum-decoration))
487 :style radio 491 nil
488 :active (and (boundp 'font-lock-mode) font-lock-mode) 492 (customize-set-variable 'font-lock-maximum-decoration 2)
489 :selected (and (boundp 'font-lock-mode) 493 (font-lock-recompute-variables)))
490 font-lock-mode 494 :style radio
495 :active (fboundp 'font-lock-mode)
496 :selected (and (boundp 'font-lock-maximum-decoration)
491 (integerp font-lock-maximum-decoration) 497 (integerp font-lock-maximum-decoration)
492 (= 2 font-lock-maximum-decoration))] 498 (= 2 font-lock-maximum-decoration))]
493 ["Most" (if (or (eq font-lock-maximum-decoration t) 499 ["Most"
494 (and (integerp font-lock-maximum-decoration) 500 (progn
495 (>= font-lock-maximum-decoration 3))) 501 (require 'font-lock)
496 nil 502 (if (or (eq font-lock-maximum-decoration t)
497 (setq font-lock-maximum-decoration t) 503 (and (integerp font-lock-maximum-decoration)
498 (font-lock-recompute-variables)) 504 (>= font-lock-maximum-decoration 3)))
499 :style radio 505 nil
500 :active (and (boundp 'font-lock-mode) font-lock-mode) 506 (customize-set-variable 'font-lock-maximum-decoration t)
501 :selected (and (boundp 'font-lock-mode) 507 (font-lock-recompute-variables)))
502 font-lock-mode 508 :style radio
509 :active (fboundp 'font-lock-mode)
510 :selected (and (boundp 'font-lock-maximum-decoration)
503 (or (eq font-lock-maximum-decoration t) 511 (or (eq font-lock-maximum-decoration t)
504 (and (integerp font-lock-maximum-decoration) 512 (and (integerp font-lock-maximum-decoration)
505 (>= font-lock-maximum-decoration 3))))] 513 (>= font-lock-maximum-decoration 3))))]
506 "-----" 514 "-----"
507 ["Lazy" (progn (require 'lazy-shot) 515 ["Lazy"
508 (if (and (boundp 'lazy-shot-mode) lazy-shot-mode) 516 (progn ;; becomes buffer local
509 (progn 517 (lazy-shot-mode)
510 (lazy-shot-mode 0) 518 (customize-set-variable 'lazy-shot-mode lazy-shot-mode)
511 ;; this shouldn't be necessary so there has to 519 ;; this shouldn't be necessary so there has to
512 ;; be a redisplay bug lurking somewhere (or 520 ;; be a redisplay bug lurking somewhere (or
513 ;; possibly another event handler bug) 521 ;; possibly another event handler bug)
514 (redraw-modeline) 522 (redraw-modeline))
515 (remove-hook 'font-lock-mode-hook 523 :active (and (boundp 'font-lock-mode) (boundp 'lazy-shot-mode)
516 'turn-on-lazy-shot))
517 (if font-lock-mode
518 (progn
519 (lazy-shot-mode 1)
520 (redraw-modeline)
521 (add-hook 'font-lock-mode-hook
522 'turn-on-lazy-shot)))))
523 :active (and (boundp 'font-lock-mode)
524 (boundp 'lazy-shot-mode)
525 font-lock-mode) 524 font-lock-mode)
526 :style toggle 525 :style toggle
527 :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)] 526 :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)]
528 ["Caching" (progn (require 'fast-lock) 527 ["Caching"
529 (if fast-lock-mode 528 (progn ;; becomes buffer local
530 (progn 529 (fast-lock-mode)
531 (fast-lock-mode 0) 530 (customize-set-variable 'fast-lock-mode fast-lock-mode)
532 ;; this shouldn't be necessary so there has to 531 ;; this shouldn't be necessary so there has to
533 ;; be a redisplay bug lurking somewhere (or 532 ;; be a redisplay bug lurking somewhere (or
534 ;; possibly another event handler bug) 533 ;; possibly another event handler bug)
535 (redraw-modeline)) 534 (redraw-modeline))
536 (if font-lock-mode 535 :active (and (boundp 'font-lock-mode) (boundp 'fast-lock-mode)
537 (progn 536 font-lock-mode)
538 (fast-lock-mode 1)
539 (redraw-modeline)))))
540 :active (and (boundp 'font-lock-mode) font-lock-mode)
541 :style toggle 537 :style toggle
542 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)] 538 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
543 ) 539 )
544 ("Paren Highlighting" 540 ("Paren Highlighting"
545 ["None" (paren-set-mode -1) 541 ["None"
546 :style radio :selected (and (boundp 'paren-mode) (not paren-mode)) 542 (customize-set-variable 'paren-mode nil)
547 :active (fboundp 'paren-set-mode)] 543 :style radio
548 ["Blinking Paren" (paren-set-mode 'blink-paren) 544 :selected (and (boundp 'paren-mode) (not paren-mode))
549 :style radio :selected (and (boundp 'paren-mode) 545 :active (boundp 'paren-mode)]
550 (eq paren-mode 'blink-paren)) 546 ["Blinking Paren"
551 :active (fboundp 'paren-set-mode)] 547 (customize-set-variable 'paren-mode 'blink-paren)
552 ["Steady Paren" (paren-set-mode 'paren) 548 :style radio
553 :style radio :selected (and (boundp 'paren-mode) 549 :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren))
554 (eq paren-mode 'paren)) 550 :active (boundp 'paren-mode)]
555 :active (fboundp 'paren-set-mode)] 551 ["Steady Paren"
556 ["Expression" (paren-set-mode 'sexp) 552 (customize-set-variable 'paren-mode 'paren)
557 :style radio :selected (and (boundp 'paren-mode) 553 :style radio
558 (eq paren-mode 'sexp)) 554 :selected (and (boundp 'paren-mode) (eq paren-mode 'paren))
559 :active (fboundp 'paren-set-mode)] 555 :active (boundp 'paren-mode)]
560 ;;; ["Nested Shading" (paren-set-mode 'nested) 556 ["Expression"
561 ;;; :style radio :selected (eq paren-mode 'nested)] 557 (customize-set-variable 'paren-mode 'sexp)
558 :style radio
559 :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp))
560 :active (boundp 'paren-mode)]
561 ;; ["Nested Shading"
562 ;; (customize-set-variable 'paren-mode 'nested)
563 ;; :style radio
564 ;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested))
565 ;; :active (boundp 'paren-mode)]
562 ) 566 )
563 "-----" 567 "-----"
564 ("Frame Appearance" 568 ("Frame Appearance"
569 ["Frame-Local Font Menu"
570 (customize-set-variable 'font-menu-this-frame-only-p
571 (not font-menu-this-frame-only-p))
572 :style toggle
573 :selected (and (boundp 'font-menu-this-frame-only-p)
574 font-menu-this-frame-only-p)]
565 ,@(if (featurep 'scrollbar) 575 ,@(if (featurep 'scrollbar)
566 '(["Scrollbars" (if (= (specifier-instance scrollbar-width) 0) 576 '(["Scrollbars"
567 (progn 577 (customize-set-variable 'scrollbars-visible-p
568 (set-specifier scrollbar-width 15) 578 (not scrollbars-visible-p))
569 (set-specifier scrollbar-height 15)) 579 :style toggle
570 (set-specifier scrollbar-width 0) 580 :selected scrollbars-visible-p]))
571 (set-specifier scrollbar-height 0)) 581 ;; I don't think this is of any interest. - dverna apr. 98
572 :style toggle :selected (> (specifier-instance scrollbar-width) 0)])) 582 ;; ["3D Modeline"
573 ["3D Modeline" 583 ;; (progn
584 ;; (if (zerop (specifier-instance modeline-shadow-thickness))
585 ;; (set-specifier modeline-shadow-thickness 2)
586 ;; (set-specifier modeline-shadow-thickness 0))
587 ;; (redraw-modeline t))
588 ;; :style toggle
589 ;; :selected (let ((thickness
590 ;; (specifier-instance modeline-shadow-thickness)))
591 ;; (and (integerp thickness)
592 ;; (> thickness 0)))]
593 ["Truncate Lines"
594 (progn ;; becomes buffer-local
595 (setq truncate-lines (not truncate-lines))
596 (customize-set-variable 'truncate-lines truncate-lines))
597 :style toggle
598 :selected truncate-lines]
599 ["Blinking Cursor"
600 (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode))
601 :style toggle
602 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)
603 :active (boundp 'blink-cursor-mode)]
604 "-----"
605 ["Block cursor"
574 (progn 606 (progn
575 (if (zerop (specifier-instance modeline-shadow-thickness)) 607 (customize-set-variable 'bar-cursor nil)
576 (set-specifier modeline-shadow-thickness 2) 608 (force-cursor-redisplay))
577 (set-specifier modeline-shadow-thickness 0)) 609 :style radio
578 (redraw-modeline t)) 610 :selected (null bar-cursor)]
579 :style toggle :selected 611 ["Bar cursor (1 pixel)"
580 (let ((thickness 612 (progn
581 (specifier-instance modeline-shadow-thickness))) 613 (customize-set-variable 'bar-cursor t)
582 (and (integerp thickness) 614 (force-cursor-redisplay))
583 (> thickness 0)))] 615 :style radio
584 ["Truncate Lines" (progn 616 :selected (eq bar-cursor t)]
585 (setq truncate-lines (not truncate-lines)) 617 ["Bar cursor (2 pixels)"
586 (setq-default truncate-lines truncate-lines)) 618 (progn
587 :style toggle :selected truncate-lines] 619 (customize-set-variable 'bar-cursor 2)
588 ["Bar Cursor" (progn 620 (force-cursor-redisplay))
589 (setq bar-cursor 621 :style radio
590 (if (not bar-cursor) 2 nil)) 622 :selected (and bar-cursor (not (eq bar-cursor t)))]
591 (force-cursor-redisplay)) 623 "------"
592 :style toggle :selected bar-cursor] 624 ["Line Numbers"
593 ["Blinking Cursor" (blink-cursor-mode) 625 (progn
594 :style toggle 626 (customize-set-variable 'line-number-mode (not line-number-mode))
595 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)] 627 (redraw-modeline))
596 ["Frame-Local Font Menu" (setq font-menu-this-frame-only-p 628 :style toggle :selected line-number-mode]
597 (not font-menu-this-frame-only-p)) 629 ["Column Numbers"
598 :style toggle :selected (and (boundp 'font-menu-this-frame-only-p) 630 (progn
599 font-menu-this-frame-only-p)] 631 (customize-set-variable 'column-number-mode
600 ; ["Line Numbers" (line-number-mode nil) 632 (not column-number-mode))
601 ; :style toggle :selected line-number-mode] 633 (redraw-modeline))
634 :style toggle :selected column-number-mode]
602 ) 635 )
603 ("Menubar Appearance" 636 ("Menubar Appearance"
604 ["Buffers Menu Length..." 637 ["Buffers Menu Length..."
605 (progn 638 (customize-set-variable
606 (setq buffers-menu-max-size 639 'buffers-menu-max-size
640 ;; would it be better to open a customization buffer ?
641 (let ((val
607 (read-number 642 (read-number
608 "Enter number of buffers to display (or 0 for unlimited): ")) 643 "Enter number of buffers to display (or 0 for unlimited): ")))
609 (if (eq buffers-menu-max-size 0) (setq buffers-menu-max-size nil)))] 644 (if (eq val 0) nil val)))]
610 ["Multi-Operation Buffers Sub-Menus" 645 ["Multi-Operation Buffers Sub-Menus"
611 (setq complex-buffers-menu-p 646 (customize-set-variable 'complex-buffers-menu-p
612 (not complex-buffers-menu-p)) 647 (not complex-buffers-menu-p))
613 :style toggle :selected complex-buffers-menu-p] 648 :style toggle
649 :selected complex-buffers-menu-p]
614 ("Buffers Menu Sorting" 650 ("Buffers Menu Sorting"
615 ["Most Recently Used" 651 ["Most Recently Used"
616 (progn 652 (progn
617 (setq buffers-menu-sort-function nil) 653 (customize-set-variable 'buffers-menu-sort-function nil)
618 (setq buffers-menu-grouping-function nil)) 654 (customize-set-variable 'buffers-menu-grouping-function nil))
619 :style radio 655 :style radio
620 :selected (null buffers-menu-sort-function)] 656 :selected (null buffers-menu-sort-function)]
621 ["Alphabetically" 657 ["Alphabetically"
622 (progn 658 (progn
623 (setq buffers-menu-sort-function 659 (customize-set-variable 'buffers-menu-sort-function
624 'sort-buffers-menu-alphabetically) 660 'sort-buffers-menu-alphabetically)
625 (setq buffers-menu-grouping-function nil)) 661 (customize-set-variable 'buffers-menu-grouping-function nil))
626 :style radio 662 :style radio
627 :selected (eq 'sort-buffers-menu-alphabetically 663 :selected (eq 'sort-buffers-menu-alphabetically
628 buffers-menu-sort-function)] 664 buffers-menu-sort-function)]
629 ["By Major Mode, Then Alphabetically" 665 ["By Major Mode, Then Alphabetically"
630 (progn 666 (progn
631 (setq buffers-menu-sort-function 667 (customize-set-variable
632 'sort-buffers-menu-by-mode-then-alphabetically) 668 'buffers-menu-sort-function
633 (setq buffers-menu-grouping-function 669 'sort-buffers-menu-by-mode-then-alphabetically)
634 'group-buffers-menu-by-mode-then-alphabetically)) 670 (customize-set-variable
671 'buffers-menu-grouping-function
672 'group-buffers-menu-by-mode-then-alphabetically))
635 :style radio 673 :style radio
636 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically 674 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically
637 buffers-menu-sort-function)]) 675 buffers-menu-sort-function)])
638 ["Submenus for Buffer Groups" 676 ["Submenus for Buffer Groups"
639 (setq buffers-menu-submenus-for-groups-p 677 (customize-set-variable 'buffers-menu-submenus-for-groups-p
640 (not buffers-menu-submenus-for-groups-p)) 678 (not buffers-menu-submenus-for-groups-p))
641 :style toggle 679 :style toggle
642 :selected buffers-menu-submenus-for-groups-p 680 :selected buffers-menu-submenus-for-groups-p]
643 :active (not (null buffers-menu-grouping-function))]
644 "---" 681 "---"
645 ["Ignore Scaled Fonts" (setq font-menu-ignore-scaled-fonts 682 ["Ignore Scaled Fonts"
646 (not font-menu-ignore-scaled-fonts)) 683 (customize-set-variable 'font-menu-ignore-scaled-fonts
647 :style toggle :selected (and (boundp 'font-menu-ignore-scaled-fonts) 684 (not font-menu-ignore-scaled-fonts))
648 font-menu-ignore-scaled-fonts)] 685 :style toggle
686 :selected (and (boundp 'font-menu-ignore-scaled-fonts)
687 font-menu-ignore-scaled-fonts)]
649 ) 688 )
650 ,@(if (featurep 'toolbar) 689 ,@(if (featurep 'toolbar)
651 '(("Toolbar Appearance" 690 '(("Toolbar Appearance"
652 ["Visible" (set-specifier default-toolbar-visible-p 691 ["Visible"
653 (not (specifier-instance 692 (customize-set-variable 'toolbar-visible-p
654 default-toolbar-visible-p))) 693 (not toolbar-visible-p))
655 :style toggle 694 :style toggle
656 :selected (specifier-instance default-toolbar-visible-p)] 695 :selected toolbar-visible-p]
657 ["Captioned" (set-specifier toolbar-buttons-captioned-p 696 ["Captioned"
658 (not (specifier-instance 697 (customize-set-variable 'toolbar-captioned-p
659 toolbar-buttons-captioned-p))) 698 (not toolbar-captioned-p))
660 :style toggle 699 :style toggle
661 :selected 700 :selected toolbar-captioned-p]
662 (specifier-instance toolbar-buttons-captioned-p)]
663 ("Default Location" 701 ("Default Location"
664 ["Top" (set-default-toolbar-position 'top) 702 ["Top"
665 :style radio :selected (eq (default-toolbar-position) 'top)] 703 (customize-set-variable 'default-toolbar-position 'top)
666 ["Bottom" (set-default-toolbar-position 'bottom) 704 :style radio
667 :style radio :selected (eq (default-toolbar-position) 'bottom)] 705 :selected (eq default-toolbar-position 'top)]
668 ["Left" (set-default-toolbar-position 'left) 706 ["Bottom"
669 :style radio :selected (eq (default-toolbar-position) 'left)] 707 (customize-set-variable 'default-toolbar-position 'bottom)
670 ["Right" (set-default-toolbar-position 'right) 708 :style radio
671 :style radio :selected (eq (default-toolbar-position) 'right)] 709 :selected (eq default-toolbar-position 'bottom)]
710 ["Left"
711 (customize-set-variable 'default-toolbar-position 'left)
712 :style radio
713 :selected (eq default-toolbar-position 'left)]
714 ["Right"
715 (customize-set-variable 'default-toolbar-position 'right)
716 :style radio
717 :selected (eq default-toolbar-position 'right)]
672 ) 718 )
673 ))) 719 )))
674 ("Mouse" 720 ("Mouse"
675 ["Avoid-Text" 721 ["Avoid Text..."
676 (if (equal (device-type) 'x) 722 (customize-set-variable 'mouse-avoidance-mode
677 (if mouse-avoidance-mode 723 (if mouse-avoidance-mode nil 'banish))
678 (mouse-avoidance-mode 'none) 724 :style toggle
679 (mouse-avoidance-mode 'banish)) 725 :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode)
680 (beep) 726 :active (and (boundp 'mouse-avoidance-mode)
681 (message "This option requires a window system.")) 727 window-system (eq (device-type) 'x))]
682 :style toggle :selected (and (boundp 'mouse-avoidance-mode)
683 mouse-avoidance-mode
684 window-system)
685 :active (fboundp 'mouse-avoidance-mode)]
686 ["strokes-mode" 728 ["strokes-mode"
687 (if (equal (device-type) 'x) 729 (customize-set-variable 'strokes-mode (not strokes-mode))
688 (strokes-mode) 730 :style toggle
689 (beep) 731 :selected (and (boundp 'strokes-mode) strokes-mode)
690 (message "This option requires a window system.")) 732 :active (and (boundp 'strokes-mode)
691 :style toggle :selected (and (boundp 'strokes-mode) 733 window-system (eq (device-type) 'x))]
692 strokes-mode 734 )
693 window-system)
694 :active (fboundp 'strokes-mode)])
695 ("Open URLs With" 735 ("Open URLs With"
696 ["Emacs-W3" (setq browse-url-browser-function 'browse-url-w3) 736 ["Emacs-W3"
737 (customize-set-variable 'browse-url-browser-function 'browse-url-w3)
697 :style radio 738 :style radio
698 :selected (and (boundp 'browse-url-browser-function) 739 :selected (and (boundp 'browse-url-browser-function)
699 (eq browse-url-browser-function 'browse-url-w3)) 740 (eq browse-url-browser-function 'browse-url-w3))
700 :active (and (fboundp 'browse-url-w3) 741 :active (and (boundp 'browse-url-browser-function)
742 (fboundp 'browse-url-w3)
701 (fboundp 'w3-fetch))] 743 (fboundp 'w3-fetch))]
702 ["Netscape" (setq browse-url-browser-function 'browse-url-netscape) 744 ["Netscape"
745 (customize-set-variable 'browse-url-browser-function
746 'browse-url-netscape)
703 :style radio 747 :style radio
704 :selected (and (boundp 'browse-url-browser-function) 748 :selected (and (boundp 'browse-url-browser-function)
705 (eq browse-url-browser-function 'browse-url-netscape)) 749 (eq browse-url-browser-function 'browse-url-netscape))
706 :active (fboundp 'browse-url-netscape)] 750 :active (and (boundp 'browse-url-browser-function)
707 ["Mosaic" (setq browse-url-browser-function 'browse-url-mosaic) 751 (fboundp 'browse-url-netscape))]
752 ["Mosaic"
753 (customize-set-variable 'browse-url-browser-function
754 'browse-url-mosaic)
708 :style radio 755 :style radio
709 :selected (and (boundp 'browse-url-browser-function) 756 :selected (and (boundp 'browse-url-browser-function)
710 (eq browse-url-browser-function 'browse-url-mosaic)) 757 (eq browse-url-browser-function 'browse-url-mosaic))
711 :active (fboundp 'browse-url-mosaic)] 758 :active (and (boundp 'browse-url-browser-function)
712 ["Mosaic (CCI)" (setq browse-url-browser-function 'browse-url-cci) 759 (fboundp 'browse-url-mosaic))]
760 ["Mosaic (CCI)"
761 (customize-set-variable 'browse-url-browser-function 'browse-url-cci)
762 :style radio
763 :selected (and (boundp 'browse-url-browser-function)
764 (eq browse-url-browser-function 'browse-url-cci))
765 :active (and (boundp 'browse-url-browser-function)
766 (fboundp 'browse-url-cci))]
767 ["IXI Mosaic"
768 (customize-set-variable 'browse-url-browser-function
769 'browse-url-iximosaic)
713 :style radio 770 :style radio
714 :selected (and (boundp 'browse-url-browser-function) 771 :selected (and (boundp 'browse-url-browser-function)
715 (eq browse-url-browser-function 'browse-url-iximosaic)) 772 (eq browse-url-browser-function 'browse-url-iximosaic))
716 :active (fboundp 'browse-url-iximosaic)] 773 :active (and (boundp 'browse-url-browser-function)
717 ["IXI Mosaic" (setq browse-url-browser-function 'browse-url-iximosaic) 774 (fboundp 'browse-url-iximosaic))]
718 :style radio 775 ["Lynx (xterm)"
719 :selected (and (boundp 'browse-url-browser-function) 776 (customize-set-variable 'browse-url-browser-function
720 (eq browse-url-browser-function 'browse-url-iximosaic)) 777 'browse-url-lynx-xterm)
721 :active (fboundp 'browse-url-iximosaic)]
722 ["Lynx (xterm)" (setq browse-url-browser-function 'browse-url-lynx-xterm)
723 :style radio 778 :style radio
724 :selected (and (boundp 'browse-url-browser-function) 779 :selected (and (boundp 'browse-url-browser-function)
725 (eq browse-url-browser-function 'browse-url-lynx-xterm)) 780 (eq browse-url-browser-function 'browse-url-lynx-xterm))
726 :active (fboundp 'browse-url-lynx-xterm)] 781 :active (and (boundp 'browse-url-browser-function)
727 ["Lynx (xemacs)" (setq browse-url-browser-function 'browse-url-lynx-emacs) 782 (fboundp 'browse-url-lynx-xterm))]
783 ["Lynx (xemacs)"
784 (customize-set-variable 'browse-url-browser-function
785 'browse-url-lynx-emacs)
728 :style radio 786 :style radio
729 :selected (and (boundp 'browse-url-browser-function) 787 :selected (and (boundp 'browse-url-browser-function)
730 (eq browse-url-browser-function 'browse-url-lynx-emacs)) 788 (eq browse-url-browser-function 'browse-url-lynx-emacs))
731 :active (fboundp 'browse-url-lynx-emacs)] 789 :active (and (boundp 'browse-url-browser-function)
732 ["Grail" (setq browse-url-browser-function 'browse-url-grail) 790 (fboundp 'browse-url-lynx-emacs))]
791 ["Grail"
792 (customize-set-variable 'browse-url-browser-function
793 'browse-url-grail)
733 :style radio 794 :style radio
734 :selected (and (boundp 'browse-url-browser-function) 795 :selected (and (boundp 'browse-url-browser-function)
735 (eq browse-url-browser-function 'browse-url-grail)) 796 (eq browse-url-browser-function 'browse-url-grail))
736 :active (fboundp 'browse-url-grail)] 797 :active (and (boundp 'browse-url-browser-function)
798 (fboundp 'browse-url-grail))]
737 ) 799 )
738 "-----" 800 "-----"
739 ["Browse Faces..." (customize-face nil)] 801 ["Browse Faces..." (customize-face nil)]
740 ("Font" :filter font-menu-family-constructor) 802 ("Font" :filter font-menu-family-constructor)
741 ("Size" :filter font-menu-size-constructor) 803 ("Size" :filter font-menu-size-constructor)
742 ("Weight" :filter font-menu-weight-constructor) 804 ("Weight" :filter font-menu-weight-constructor)
743 "-----" 805 "-----"
744 ["Save Options" save-options-menu-settings] 806 ["Save Options" customize-save-customized]
745 ) 807 )
746 808
747 ("Buffers" 809 ("Buffers"
748 :filter buffers-menu-filter 810 :filter buffers-menu-filter
811 ["Read Only" (toggle-read-only)
812 :style toggle :selected buffer-read-only]
749 ["List All Buffers" list-buffers] 813 ["List All Buffers" list-buffers]
750 "--" 814 "--"
751 ) 815 )
752 816
753 ("Tools" 817 ("Tools"
1206 language-environment-list)) 1270 language-environment-list))
1207 1271
1208 1272
1209 ;;; The Options menu 1273 ;;; The Options menu
1210 1274
1275 ;; We'll keep those variables here for a while, in order to provide a
1276 ;; function for porting the old options file that a user may own to Custom.
1277
1211 (defvar options-save-faces nil 1278 (defvar options-save-faces nil
1212 "*Non-nil value means save-options will save information about faces. 1279 "*Non-nil value means save-options will save information about faces.
1213 A nil value means save-options will not save face information. 1280 A nil value means save-options will not save face information.
1214 Set this non-nil only if you use M-x edit-faces to change face 1281 Set this non-nil only if you use M-x edit-faces to change face
1215 settings. If you use M-x customize-face or the \"Browse Faces...\" 1282 settings. If you use M-x customize-face or the \"Browse Faces...\"
1217 can use to permanently save your face changes. 1284 can use to permanently save your face changes.
1218 1285
1219 M-x edit-faces is deprecated. Support for it and this variable will 1286 M-x edit-faces is deprecated. Support for it and this variable will
1220 be discontinued in a future release.") 1287 be discontinued in a future release.")
1221 1288
1222 (defconst options-menu-saved-forms
1223 ;; This is really quite a kludge, but it gets the job done.
1224 ;;
1225 ;; remember that we have to conditionalize on default features
1226 ;; both in the forms to evaluate and in the forms output to
1227 ;; .emacs, in case the .emacs is loaded into an XEmacs with
1228 ;; different features.
1229 (purecopy
1230 '(
1231 ;; Editing Options menu.
1232 ;; put case-fold-search first to defeat a bug in the backquote
1233 ;; processing mechanism. Feh!
1234 case-fold-search
1235 `(setq-default overwrite-mode ,(default-value 'overwrite-mode))
1236 (if (default-value 'overwrite-mode)
1237 '(overwrite-mode 1))
1238 `(setq-default case-fold-search ,(default-value 'case-fold-search))
1239 case-replace
1240 (if (and (boundp 'pending-delete-mode)
1241 pending-delete-mode)
1242 '(pending-delete-mode 1))
1243 zmacs-regions
1244 mouse-yank-at-point
1245 require-final-newline
1246 next-line-add-newlines
1247
1248 ;; General Options menu.
1249 teach-extended-commands-p
1250 ;; (#### not actually on Options menu)
1251 teach-extended-commands-timeout
1252 debug-on-error
1253 debug-on-quit
1254
1255 ;; Printing Options menu.
1256 lpr-switches
1257 ps-print-color-p
1258 ps-paper-type
1259
1260 ;; Other Window Location
1261 get-frame-for-buffer-default-instance-limit
1262 temp-buffer-show-function
1263 (if gnuserv-frame
1264 '(setq gnuserv-frame (selected-frame)))
1265
1266 ;; Syntax Highlighting
1267 font-lock-auto-fontify
1268 font-lock-use-fonts
1269 font-lock-use-colors
1270 font-lock-maximum-decoration
1271 font-lock-maximum-size
1272 ;; (#### the next two not on Options menu)
1273 font-lock-mode-enable-list
1274 font-lock-mode-disable-list
1275 ;; #### - this structure is clearly broken. There's no way to ever
1276 ;; un-require font-lock via the menus. --Stig
1277 (if (featurep 'font-lock)
1278 '(require 'font-lock))
1279 (if (and (boundp 'font-lock-mode-hook)
1280 (memq 'turn-on-fast-lock font-lock-mode-hook))
1281 '(add-hook 'font-lock-mode-hook 'turn-on-fast-lock)
1282 '(remove-hook 'font-lock-mode-hook 'turn-on-fast-lock))
1283 (if (and (boundp 'font-lock-mode-hook)
1284 (memq 'turn-on-lazy-shot font-lock-mode-hook))
1285 '(add-hook 'font-lock-mode-hook 'turn-on-lazy-shot)
1286 '(remove-hook 'font-lock-mode-hook 'turn-on-lazy-shot))
1287
1288 ;; Paren Highlighting
1289 (if paren-mode
1290 `(progn (require 'paren) (paren-set-mode ',paren-mode)))
1291
1292 ;; For specifiers, we only save global settings since the others
1293 ;; will belong to objects which only exist during this session.
1294
1295 ;; Frame Appearance
1296 (if (featurep 'scrollbar)
1297 `(if (featurep 'scrollbar)
1298 (progn
1299 (add-spec-list-to-specifier
1300 scrollbar-width
1301 ',(specifier-spec-list scrollbar-width 'global))
1302 (add-spec-list-to-specifier
1303 scrollbar-height
1304 ',(specifier-spec-list scrollbar-height 'global)))))
1305 `(add-spec-list-to-specifier
1306 modeline-shadow-thickness
1307 ',(specifier-spec-list modeline-shadow-thickness 'global))
1308 `(setq-default truncate-lines ,(default-value 'truncate-lines))
1309 bar-cursor
1310 (if (and (boundp 'blink-cursor-mode) blink-cursor-mode)
1311 '(blink-cursor-mode t))
1312
1313 ;; Menubar Appearance
1314 buffers-menu-max-size
1315 complex-buffers-menu-p
1316 buffers-menu-sort-function
1317 buffers-menu-grouping-function
1318 buffers-menu-submenus-for-groups-p
1319 font-menu-ignore-scaled-fonts
1320 font-menu-this-frame-only-p
1321
1322 ;; Toolbar Appearance
1323 (if (featurep 'toolbar)
1324 `(if (featurep 'toolbar)
1325 (progn
1326 (set-default-toolbar-position
1327 ',(default-toolbar-position))
1328 (add-spec-list-to-specifier
1329 default-toolbar-visible-p
1330 ',(specifier-spec-list default-toolbar-visible-p 'global))
1331 (add-spec-list-to-specifier
1332 toolbar-buttons-captioned-p
1333 ',(specifier-spec-list toolbar-buttons-captioned-p
1334 'global)))))
1335
1336 ;; mouse
1337 mouse-avoidance-mode
1338
1339 ;; Open URLs With
1340 browse-url-browser-function
1341
1342 ;; Now save all faces.
1343
1344 ;; Setting this in lisp conflicts with X resources. Bad move. --Stig
1345 ;; (list 'set-face-font ''default (face-font-name 'default))
1346 ;; (list 'set-face-font ''modeline (face-font-name 'modeline))
1347 (if options-save-faces
1348 (cons 'progn
1349 (mapcar #'(lambda (face)
1350 `(make-face ',face))
1351 (save-options-non-customized-face-list))))
1352
1353 (if options-save-faces
1354 (cons 'progn
1355 (apply 'nconc
1356 (mapcar
1357 #'(lambda (face)
1358 (delq nil
1359 (mapcar
1360 #'(lambda (property)
1361 (if (specifier-spec-list
1362 (face-property face property))
1363 `(add-spec-list-to-specifier
1364 (face-property ',face ',property)
1365 ',(save-options-specifier-spec-list
1366 face property))))
1367 (delq 'display-table
1368 (copy-sequence
1369 built-in-face-specifiers)))))
1370 (save-options-non-customized-face-list)))))
1371
1372 ;; Mule-specific:
1373 (if (featurep 'mule)
1374 `(if (featurep 'mule)
1375 (set-language-environment ',current-language-environment)))
1376 ))
1377 "The variables to save; or forms to evaluate to get forms to write out.
1378 This is used by `save-options-menu-settings' and should mirror the
1379 options listed in the Options menu.")
1380
1381 (defun save-options-non-customized-face-list ()
1382 "Return a list of all faces that have not been 'customized'."
1383 (delq nil (mapcar '(lambda (face)
1384 (unless (get face 'saved-face)
1385 face))
1386 (face-list))))
1387
1388 (defun save-options-specifier-spec-list (face property)
1389 (if (not (or (eq property 'font) (eq property 'color)))
1390 (specifier-spec-list (face-property face property) 'global)
1391 (let* ((retlist (specifier-spec-list (face-property face property)
1392 'global))
1393 (entry (cdr (car retlist)))
1394 item)
1395 (while entry
1396 (setq item (car entry))
1397 (if (eq property 'font)
1398 (if (font-instance-p (cdr item))
1399 (setcdr item (font-instance-name (cdr item))))
1400 (if (color-instance-p (cdr item))
1401 (setcdr item (color-instance-name (cdr item)))))
1402 (setq entry (cdr entry)))
1403 retlist)))
1404
1405 (defvar save-options-init-file nil 1289 (defvar save-options-init-file nil
1406 "File into which to save forms to load the options file (nil for .emacs). 1290 "File into which to save forms to load the options file (nil for .emacs).
1407 Normally this is nil, which means save into your .emacs file (the value 1291 Normally this is nil, which means save into your .emacs file (the value
1408 of `user-init-file'.") 1292 of `user-init-file'.")
1409 1293
1411 "File to save options into. 1295 "File to save options into.
1412 This file is loaded from your .emacs file. 1296 This file is loaded from your .emacs file.
1413 If this is a relative filename, it is put into the same directory as your 1297 If this is a relative filename, it is put into the same directory as your
1414 .emacs file.") 1298 .emacs file.")
1415 1299
1416 (defun save-options-menu-settings ()
1417 "Save the current settings of the `Options' menu to your `.emacs' file."
1418 (interactive)
1419 ;; we compute the actual filenames now because x-menubar is loaded
1420 ;; at dump time, when the identity of the user running XEmacs is not known.
1421 (let* ((actual-save-options-init-file
1422 (or save-options-init-file
1423 (and (not (equal user-init-file ""))
1424 user-init-file)
1425 (and (eq system-type 'ms-dos)
1426 (concat "~" (user-login-name) "/_emacs"))
1427 (concat "~" (user-login-name) "/.emacs")))
1428 (actual-save-options-file
1429 (abbreviate-file-name
1430 (expand-file-name
1431 save-options-file
1432 (file-name-directory actual-save-options-init-file))
1433 ;; Don't hack-homedir in abbreviate-file-name. This will
1434 ;; cause an incorrect expansion if the save-options variables
1435 ;; have ~ in them.
1436 ))
1437 (init-output-buffer (find-file-noselect
1438 actual-save-options-init-file))
1439 init-output-marker
1440 (options-output-buffer
1441 (find-file-noselect actual-save-options-file))
1442 options-output-marker)
1443
1444 (save-excursion
1445 (set-buffer options-output-buffer)
1446 (erase-buffer)
1447 (setq options-output-marker (point-marker)))
1448
1449 ;; run with current-buffer unchanged so that variables are evaluated in
1450 ;; the current context, instead of in the context of the ".emacs" buffer
1451 ;; or the ".xemacs-options" buffer.
1452
1453 ;; first write out .xemacs-options.
1454
1455 (let ((standard-output options-output-marker))
1456 (princ ";; -*- Mode: Emacs-Lisp -*-\n\n")
1457 (princ "(setq options-file-xemacs-version '(")
1458 (princ emacs-major-version)
1459 (princ " ")
1460 (princ emacs-minor-version)
1461 (princ "))\n")
1462 (let ((print-readably t)
1463 (print-escape-newlines t))
1464 (mapcar #'(lambda (var)
1465 (princ " ")
1466 (if (symbolp var)
1467 (prin1 (list 'setq-default var
1468 (let ((val (symbol-value var)))
1469 (if (or (memq val '(t nil))
1470 (and (not (symbolp val))
1471 (not (consp val))))
1472 val
1473 (list 'quote val)))))
1474 (setq var (eval var))
1475 (cond ((eq (car-safe var) 'progn)
1476 (while (setq var (cdr var))
1477 (prin1 (car var))
1478 (princ "\n")
1479 (if (cdr var) (princ " "))
1480 ))
1481 (var
1482 (prin1 var))))
1483 (if var (princ "\n")))
1484 options-menu-saved-forms)
1485 ))
1486 (set-marker options-output-marker nil)
1487 (save-excursion
1488 (set-buffer options-output-buffer)
1489 (save-buffer))
1490
1491 ;; then fix .emacs.
1492
1493 (save-excursion
1494 (set-buffer init-output-buffer)
1495 ;;
1496 ;; Find and delete the previously saved data, and position to write.
1497 ;;
1498 (goto-char (point-min))
1499 (if (re-search-forward "^;; Options Menu Settings *\n" nil 'move)
1500 (let ((p (match-beginning 0)))
1501 (goto-char p)
1502 (or (re-search-forward
1503 "^;; End of Options Menu Settings *\\(\n\\|\\'\\)"
1504 nil t)
1505 (error "can't find END of saved state in .emacs"))
1506 (delete-region p (match-end 0)))
1507 (goto-char (point-max))
1508 (insert "\n"))
1509 (setq init-output-marker (point-marker)))
1510
1511 (let ((standard-output init-output-marker))
1512 (princ ";; Options Menu Settings\n")
1513 (princ ";; =====================\n")
1514 (princ "(cond\n")
1515 (princ " ((and (string-match \"XEmacs\" emacs-version)\n")
1516 (princ " (boundp 'emacs-major-version)\n")
1517 (princ " (or (and\n")
1518 (princ " (= emacs-major-version 19)\n")
1519 (princ " (>= emacs-minor-version 14))\n")
1520 (princ " (= emacs-major-version 20))\n")
1521 (princ " (fboundp 'load-options-file))\n")
1522 (princ " (load-options-file \"")
1523 (princ actual-save-options-file)
1524 (princ "\")))\n")
1525 (princ ";; ============================\n")
1526 (princ ";; End of Options Menu Settings\n"))
1527
1528 (set-marker init-output-marker nil)
1529 (save-excursion
1530 (set-buffer init-output-buffer)
1531 (save-buffer))
1532 ))
1533 1300
1534 1301
1535 ;;; The Help menu 1302 ;;; The Help menu
1536 1303
1537 (if (featurep 'mule) 1304 (if (featurep 'mule)