emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#12223: closed (24.2; [PATCH] skeleton expansion in


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#12223: closed (24.2; [PATCH] skeleton expansion in sh-mode can fail by backward-delete-char-untabify-method)
Date: Mon, 27 Aug 2012 11:06:02 +0000

Your message dated Mon, 27 Aug 2012 19:04:17 +0800
with message-id <address@hidden>
and subject line Re: bug#12223: 24.2; [PATCH] skeleton expansion in sh-mode can 
fail by backward-delete-char-untabify-method
has caused the debbugs.gnu.org bug report #12223,
regarding 24.2; [PATCH] skeleton expansion in sh-mode can fail by 
backward-delete-char-untabify-method
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
12223: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12223
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.2; [PATCH] skeleton expansion in sh-mode can fail by backward-delete-char-untabify-method Date: Sat, 18 Aug 2012 21:12:23 +0800
Looks like defaulting skeleton-untabify to t is no longer a good idea.
There is no way in a skeleton to figure out how many chars are to be
deleted for the skeleton element -num.

So for example, skeletons in sh-scripts can behave abnormally if (setq
backward-delete-char-untabify-method 'hungry).

1. Emacs -q
2. (setq backward-delete-char-untabify-method 'hungry)
3. C-x C-f x.bash
4. C-c : and choose bash
5. C-c (

You should see the function template expanded incorrectly.

I think defaulting skeleton-untabify to nil is the right fix. Otherwise,
the idea that customising backward-delete-char-untabify-method can
implicitly change how skeleton does its work is scary.

A fix local to sh-script.el can be done too:

diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index f0dec93f..509b645d 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1512,6 +1512,7 @@ (define-derived-mode sh-mode prog-mode "Shell-script"
   (set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p)
   (set (make-local-variable 'skeleton-further-elements)
        '((< '(- (min sh-indentation (current-column))))))
+  (set (make-local-variable 'skeleton-untabify) nil)
   (set (make-local-variable 'skeleton-filter-function) 'sh-feature)
   (set (make-local-variable 'skeleton-newline-indent-rigidly) t)
   (set (make-local-variable 'sh-indent-supported-here) nil)


Leo



--- End Message ---
--- Begin Message --- Subject: Re: bug#12223: 24.2; [PATCH] skeleton expansion in sh-mode can fail by backward-delete-char-untabify-method Date: Mon, 27 Aug 2012 19:04:17 +0800 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (OS X 10.8.1)
Fixed in emacs-24



--- End Message ---

reply via email to

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