all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: 10934@debbugs.gnu.org
Subject: bug#10934: 24.0.94; cperl system abbrevs fix
Date: Sun, 04 Mar 2012 12:31:33 +0800	[thread overview]
Message-ID: <m1mx7xhtqy.fsf@gmail.com> (raw)

In cperl-mode it uses a hack to avoid having programmably-defined
abbrevs written to the abbrev file. This is not safe i.e. those abbrevs
can still be saved to disk, and users might be tricked to edit them but
lose their editing because they are redefined by cperl-mode.

I think the following patch is due.

commit 0d5a31c8fc9faf708e98bee32913bc2dfe31bf7d
Date:   Fri Apr 16 21:09:01 2010 +0100

    Fix cperl-mode abbrevs
    
    See http://permalink.gmane.org/gmane.emacs.devel/123752.
---
 lisp/progmodes/cperl-mode.el |   44 ++++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 23 deletions(-)

	Modified lisp/progmodes/cperl-mode.el
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index eb881d01..3a332b24 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1714,29 +1714,27 @@ (defun cperl-mode ()
 			  [(control c) (control h) f])))
   (setq major-mode cperl-use-major-mode)
   (setq mode-name "CPerl")
-  (let ((prev-a-c abbrevs-changed))
-    (define-abbrev-table 'cperl-mode-abbrev-table '(
-		("if" "if" cperl-electric-keyword 0)
-		("elsif" "elsif" cperl-electric-keyword 0)
-		("while" "while" cperl-electric-keyword 0)
-		("until" "until" cperl-electric-keyword 0)
-		("unless" "unless" cperl-electric-keyword 0)
-		("else" "else" cperl-electric-else 0)
-		("continue" "continue" cperl-electric-else 0)
-		("for" "for" cperl-electric-keyword 0)
-		("foreach" "foreach" cperl-electric-keyword 0)
-		("formy" "formy" cperl-electric-keyword 0)
-		("foreachmy" "foreachmy" cperl-electric-keyword 0)
-		("do" "do" cperl-electric-keyword 0)
-		("=pod" "=pod" cperl-electric-pod 0)
-		("=over" "=over" cperl-electric-pod 0)
-		("=head1" "=head1" cperl-electric-pod 0)
-		("=head2" "=head2" cperl-electric-pod 0)
-		("pod" "pod" cperl-electric-pod 0)
-		("over" "over" cperl-electric-pod 0)
-		("head1" "head1" cperl-electric-pod 0)
-		("head2" "head2" cperl-electric-pod 0)))
-	(setq abbrevs-changed prev-a-c))
+  (define-abbrev-table 'cperl-mode-abbrev-table
+    '(("if" "if" cperl-electric-keyword 0 t)
+      ("elsif" "elsif" cperl-electric-keyword 0 t)
+      ("while" "while" cperl-electric-keyword 0 t)
+      ("until" "until" cperl-electric-keyword 0 t)
+      ("unless" "unless" cperl-electric-keyword 0 t)
+      ("else" "else" cperl-electric-else 0 t)
+      ("continue" "continue" cperl-electric-else 0 t)
+      ("for" "for" cperl-electric-keyword 0 t)
+      ("foreach" "foreach" cperl-electric-keyword 0 t)
+      ("formy" "formy" cperl-electric-keyword 0 t)
+      ("foreachmy" "foreachmy" cperl-electric-keyword 0 t)
+      ("do" "do" cperl-electric-keyword 0 t)
+      ("=pod" "=pod" cperl-electric-pod 0 t)
+      ("=over" "=over" cperl-electric-pod 0 t)
+      ("=head1" "=head1" cperl-electric-pod 0 t)
+      ("=head2" "=head2" cperl-electric-pod 0 t)
+      ("pod" "pod" cperl-electric-pod 0 t)
+      ("over" "over" cperl-electric-pod 0 t)
+      ("head1" "head1" cperl-electric-pod 0 t)
+      ("head2" "head2" cperl-electric-pod 0 t)))
   (setq local-abbrev-table cperl-mode-abbrev-table)
   (if (cperl-val 'cperl-electric-keywords)
       (abbrev-mode 1))






             reply	other threads:[~2012-03-04  4:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-04  4:31 Leo [this message]
2012-03-04 14:48 ` bug#10934: 24.0.94; cperl system abbrevs fix Stefan Monnier
2012-03-15 10:55   ` Leo
2012-03-15 12:08     ` Stefan Monnier
2016-02-24  6:39       ` Lars Ingebrigtsen
2016-02-24  8:15         ` Leo Liu
2016-02-24 11:12           ` Ilya Zakharevich
2016-12-11  3:39             ` Glenn Morris
2016-02-24 13:02         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1mx7xhtqy.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=10934@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.