emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100178: * progmodes/cperl-mode.el (c


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100178: * progmodes/cperl-mode.el (cperl-mode-unload-function): New function.
Date: Fri, 07 May 2010 05:21:06 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100178
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Fri 2010-05-07 05:21:06 +0200
message:
  * progmodes/cperl-mode.el (cperl-mode-unload-function): New function.
modified:
  lisp/ChangeLog
  lisp/progmodes/cperl-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-05-07 03:11:56 +0000
+++ b/lisp/ChangeLog    2010-05-07 03:21:06 +0000
@@ -1,5 +1,7 @@
 2010-05-07  Juanma Barranquero  <address@hidden>
 
+       * progmodes/cperl-mode.el (cperl-mode-unload-function): New function.
+
        Fix use of `filter-buffer-substring' (4th arg NOPROPS removed).
        * emulation/cua-base.el (cua-repeat-replace-region):
        * emulation/cua-gmrk.el (cua-copy-region-to-global-mark)

=== modified file 'lisp/progmodes/cperl-mode.el'
--- a/lisp/progmodes/cperl-mode.el      2010-01-13 08:35:10 +0000
+++ b/lisp/progmodes/cperl-mode.el      2010-05-07 03:21:06 +0000
@@ -8980,6 +8980,18 @@
     (substring v (match-beginning 1) (match-end 1)))
   "Version of IZ-supported CPerl package this file is based on.")
 
+(defun cperl-mode-unload-function ()
+  "Unload the Cperl mode library."
+  (let ((new-mode (if (eq (symbol-function 'perl-mode) 'cperl-mode)
+                     'fundamental-mode
+                   'perl-mode)))
+    (dolist (buf (buffer-list))
+      (with-current-buffer buf
+       (when (eq major-mode 'cperl-mode)
+         (funcall new-mode)))))
+  ;; continue standard unloading
+  nil)
+
 (provide 'cperl-mode)
 
 ;; arch-tag: 42e5b19b-e187-4537-929f-1a7408980ce6


reply via email to

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