aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/cpp.el
diff options
context:
space:
mode:
authorRichard M. Stallman1996-01-01 23:47:49 +0000
committerRichard M. Stallman1996-01-01 23:47:49 +0000
commit21590f63ea589bdd953f88a720b406a3b0513f52 (patch)
treef4629964a41846a64b13b6ee46e5fd91aeb43830 /lisp/progmodes/cpp.el
parent16b95d04f2928606b38fcc182b870da058b74b0b (diff)
downloademacs-21590f63ea589bdd953f88a720b406a3b0513f52.tar.gz
emacs-21590f63ea589bdd953f88a720b406a3b0513f52.zip
(cpp-config-file): New variable.
(cpp-edit-load): Use `cpp-config-file'. (cpp-edit-save): Use `cpp-config-file'.
Diffstat (limited to 'lisp/progmodes/cpp.el')
-rw-r--r--lisp/progmodes/cpp.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index 5ddb1739540..78a11ac532d 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -47,6 +47,9 @@
47 47
48;;; Customization: 48;;; Customization:
49 49
50(defvar cpp-config-file (convert-standard-filename ".cpp.el")
51 "*File name to save cpp configuration.")
52
50(defvar cpp-known-face 'invisible 53(defvar cpp-known-face 'invisible
51 "*Face used for known cpp symbols.") 54 "*Face used for known cpp symbols.")
52 55
@@ -506,10 +509,10 @@ You can also use the keyboard accelerators indicated like this: [K]ey."
506(defun cpp-edit-load () 509(defun cpp-edit-load ()
507 "Load cpp configuration." 510 "Load cpp configuration."
508 (interactive) 511 (interactive)
509 (cond ((file-readable-p ".cpp.el") 512 (cond ((file-readable-p cpp-config-file)
510 (load-file ".cpp.el")) 513 (load-file cpp-config-file))
511 ((file-readable-p "~/.cpp.el") 514 ((file-readable-p (concat "~/" cpp-config-file))
512 (load-file ".cpp.el"))) 515 (load-file cpp-config-file)))
513 (if (eq major-mode 'cpp-edit-mode) 516 (if (eq major-mode 'cpp-edit-mode)
514 (cpp-edit-reset))) 517 (cpp-edit-reset)))
515 518
@@ -519,7 +522,7 @@ You can also use the keyboard accelerators indicated like this: [K]ey."
519 (require 'pp) 522 (require 'pp)
520 (save-excursion 523 (save-excursion
521 (set-buffer cpp-edit-buffer) 524 (set-buffer cpp-edit-buffer)
522 (let ((buffer (find-file-noselect ".cpp.el"))) 525 (let ((buffer (find-file-noselect cpp-config-file)))
523 (set-buffer buffer) 526 (set-buffer buffer)
524 (erase-buffer) 527 (erase-buffer)
525 (pp (list 'setq 'cpp-known-face 528 (pp (list 'setq 'cpp-known-face
@@ -534,7 +537,7 @@ You can also use the keyboard accelerators indicated like this: [K]ey."
534 (list 'quote cpp-unknown-writable)) buffer) 537 (list 'quote cpp-unknown-writable)) buffer)
535 (pp (list 'setq 'cpp-edit-list 538 (pp (list 'setq 'cpp-edit-list
536 (list 'quote cpp-edit-list)) buffer) 539 (list 'quote cpp-edit-list)) buffer)
537 (write-file ".cpp.el")))) 540 (write-file cpp-config-file))))
538 541
539(defun cpp-edit-home () 542(defun cpp-edit-home ()
540 "Switch back to original buffer." 543 "Switch back to original buffer."