Sorry the quoting was all wrong! Gmail was behaving weirdly. I wanted to
quote the other message.

On Wed, Mar 14, 2012 at 03:59, Nick Dokos <nicholas.do...@hp.com> wrote:
> The case-fold-search problem is in
> org-src.el:org-edit-src-code. case-fold-search is let-bound to t, but
> the let form evaluates all the VARLIST forms before evaluating the
> body, so the very next varlist

>        (case-fold-search t)
>        (info (org-edit-src-find-region-and-lang))
>        ...

> fails because in its evaluation, case-fold-search is still nil.

> The solution is to use a let* form instead: just change the let on
> line 216 to a let*.


On Wed, Mar 14, 2012 at 09:41, suvayu ali <fatkasuv...@gmail.com> wrote:
> Yup, your analysis was spot on. :) Changing the let to let* and
> reevaluating the defun fixed the issue.
>
> I hadn't grasped this subtlety about let*, dependencies on preceding
> bindings hidden behind function calls!

I am attaching the changes as a patch. Let me know if it is okay.

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.
>From 48eb85df419c38a57d35808ca3a3bc9d86e05c33 Mon Sep 17 00:00:00 2001
From: Suvayu Ali <fatkasuvayu+li...@gmail.com>
Date: Wed, 14 Mar 2012 09:49:40 +0100
Subject: [PATCH] Change let bind to a let* in org-edit-src-code

	* org-src.el (org-edit-src-code): Change let bind to let*,
          e.g. if case-fold-search is bound to nil globally, the
          (case-fold-search t) doesn't work until we get to the body.

	  The fix and analysis was provided by Nick Dokos on this
          email message thread:
          <http://thread.gmane.org/gmane.emacs.orgmode/53335/focus=53342>

	  TINY CHANGE
---
 lisp/org-src.el |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index 9cd56d2..dfaa72d 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -213,16 +213,16 @@ (defun org-edit-src-code (&optional context code edit-buffer-name)
   (interactive)
   (unless (eq context 'save)
     (setq org-edit-src-saved-temp-window-config (current-window-configuration)))
-  (let ((mark (and (org-region-active-p) (mark)))
-	(case-fold-search t)
-	(info (org-edit-src-find-region-and-lang))
-	(full-info (org-babel-get-src-block-info 'light))
-	(org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
-	(beg (make-marker))
-	(end (make-marker))
-	(allow-write-back-p (null code))
-	block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
-	begline markline markcol line col transmitted-variables)
+  (let* ((mark (and (org-region-active-p) (mark)))
+	 (case-fold-search t)
+	 (info (org-edit-src-find-region-and-lang))
+	 (full-info (org-babel-get-src-block-info 'light))
+	 (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
+	 (beg (make-marker))
+	 (end (make-marker))
+	 (allow-write-back-p (null code))
+	 block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
+	 begline markline markcol line col transmitted-variables)
     (if (not info)
 	nil
       (setq beg (move-marker beg (nth 0 info))
-- 
1.7.7.6

Reply via email to