aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2007-06-20 08:51:31 +0000
committerAlan Mackenzie2007-06-20 08:51:31 +0000
commit7bcc6575094a342a232f96c6fd6797f4ce0782e8 (patch)
tree6a9b22757467d1e208b849002cd000d3c9db3c02
parent7e7db9fcc8b20b197fc37193e9dc598cb7464f2f (diff)
downloademacs-7bcc6575094a342a232f96c6fd6797f4ce0782e8.tar.gz
emacs-7bcc6575094a342a232f96c6fd6797f4ce0782e8.zip
(c-remove-any-local-eval-or-mode-variables): When removing lines, also
remove the \n. Correction of patch of 2007-04-21.
-rw-r--r--lisp/progmodes/cc-mode.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 390d49eaea4..dcbcc618dca 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -790,7 +790,8 @@ compatible with old code; callers should always specify it."
790 ;; If the buffer specifies `mode' or `eval' in its File Local Variable list 790 ;; If the buffer specifies `mode' or `eval' in its File Local Variable list
791 ;; or on the first line, remove all occurrences. See 791 ;; or on the first line, remove all occurrences. See
792 ;; `c-postprocess-file-styles' for justification. There is no need to save 792 ;; `c-postprocess-file-styles' for justification. There is no need to save
793 ;; point here, or even bother too much about the buffer contents. 793 ;; point here, or even bother too much about the buffer contents. However,
794 ;; DON'T mess up the kill-ring.
794 ;; 795 ;;
795 ;; Most of the code here is derived from Emacs 21.3's `hack-local-variables' 796 ;; Most of the code here is derived from Emacs 21.3's `hack-local-variables'
796 ;; in files.el. 797 ;; in files.el.
@@ -819,8 +820,8 @@ compatible with old code; callers should always specify it."
819 (regexp-quote suffix) 820 (regexp-quote suffix)
820 "$") 821 "$")
821 nil t) 822 nil t)
822 (beginning-of-line) 823 (forward-line 0)
823 (delete-region (point) (progn (end-of-line) (point))))) 824 (delete-region (point) (progn (forward-line) (point)))))
824 825
825 ;; Delete the first line, if we've got one, in case it contains a mode spec. 826 ;; Delete the first line, if we've got one, in case it contains a mode spec.
826 (unless (and lv-point 827 (unless (and lv-point
@@ -828,7 +829,8 @@ compatible with old code; callers should always specify it."
828 (forward-line 0) 829 (forward-line 0)
829 (bobp))) 830 (bobp)))
830 (goto-char (point-min)) 831 (goto-char (point-min))
831 (delete-region (point) (progn (end-of-line) (point)))))) 832 (unless (eobp)
833 (delete-region (point) (progn (forward-line) (point)))))))
832 834
833(defun c-postprocess-file-styles () 835(defun c-postprocess-file-styles ()
834 "Function that post processes relevant file local variables in CC Mode. 836 "Function that post processes relevant file local variables in CC Mode.