all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")
@ 2013-03-03 16:14 Jambunathan K
  2013-03-03 16:21 ` Jambunathan K
       [not found] ` <handler.13862.D13862.13623827429099.notifdone@debbugs.gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Jambunathan K @ 2013-03-03 16:14 UTC (permalink / raw)
  To: 13862

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]


1. emacs -Q 
2. Visit the attached patch file. (I have removed some hunks)

   Side Issue: shouldn't *.patch file open in diff mode.  Currently it
   opens in fundamental mode.

See the following error reported

,----
| File mode specification error: (error "Local variables entry is missing the 
| prefix")
| File local-variables error: (error "Local variables entry is missing the
| prefix")
`----

In GNU Emacs 24.3.50.10 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2013-03-03 on debian-6.05
Bzr revision: 111916 eggert@cs.ucla.edu-20130302183934-3d4pouz6i3qwkxs9
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
System Description:	Debian GNU/Linux 6.0.5 (squeeze)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-html.el-org-html-code-org-html-verbatim-Transcode.patch --]
[-- Type: text/x-diff, Size: 1155 bytes --]

From 75708cf644944d301e57bc343db8749b8fa3c242 Mon Sep 17 00:00:00 2001
From: Jambunathan K <kjambunathan@gmail.com>
Date: Sun, 3 Mar 2013 13:51:32 +0530
Subject: [PATCH 1/3] ox-html.el (org-html-code, org-html-verbatim): Transcode value

* lisp/ox-html.el (org-html-code, org-html-verbatim):
Transcode value.
---
 lisp/ox-html.el |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index a0f3f4f..3a4c0e7 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1899,7 +1899,7 @@ channel."
 CONTENTS is nil.  INFO is a plist holding contextual
 information."
   (format (or (cdr (assq 'code org-html-text-markup-alist)) "%s")
-	  (org-element-property :value code)))
+	  (org-html-plain-text (org-element-property :value code) info)))
 
 
 ;;;; Drawer
@@ -3029,7 +3029,7 @@ holding contextual information."
 CONTENTS is nil.  INFO is a plist holding contextual
 information."
   (format (or (cdr (assq 'verbatim org-html-text-markup-alist)) "%s")
-	  (org-element-property :value verbatim)))
+	  (org-html-plain-text (org-element-property :value verbatim) info)))
 
 
 ;;;; Verse Block
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")
  2013-03-03 16:14 bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix") Jambunathan K
@ 2013-03-03 16:21 ` Jambunathan K
  2013-03-04  0:17   ` Glenn Morris
       [not found] ` <handler.13862.D13862.13623827429099.notifdone@debbugs.gnu.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Jambunathan K @ 2013-03-03 16:21 UTC (permalink / raw)
  To: 13862

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

Jambunathan K <kjambunathan@gmail.com> writes:

> 1. emacs -Q 
> 2. Visit the attached patch file. (I have removed some hunks)

Sorry, wrong attachment.  Use this one instead.


[-- Attachment #2: 0002-Always-use-utf-8-encoding-for-HTML-export.patch --]
[-- Type: text/x-diff, Size: 7349 bytes --]

From c5d46d21b5a3f902cfd7b9d709660b493f67bd94 Mon Sep 17 00:00:00 2001
From: Jambunathan K <kjambunathan@gmail.com>
Date: Sun, 3 Mar 2013 20:15:10 +0530
Subject: [PATCH 2/3] Always use utf-8 encoding for HTML export

* ox-html.el (org-html-coding-system): Removed.  Always use
utf-8 for HTML export.
(org-html--build-meta-info, org-html-template)
(org-html-entity, org-html-export-to-html): Propagate above
change.
(org-html-table--table.el-table): Replace &nbsp; with it's
utf-8 equivalent.
(org-html-special-string-regexps, org-html--tags)
(org-html-format-headline, org-html--format-toc-headline)
(org-html-checkbox, org-html-table-cell, org-html-timestamp)
(org-html-verse-block): Replace numeric entities with their
utf-8 equivalent.

Mark ox-html.el as utf-8 encoded.
---
 lisp/ox-html.el |   55 +++++++++++++++++++++----------------------------------
 1 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 3a4c0e7..efd9b2f 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -136,10 +136,10 @@
 (defvar htmlize-buffer-places)  ; from htmlize.el
 
 (defconst org-html-special-string-regexps
-  '(("\\\\-" . "&#x00ad;")		; shy
-    ("---\\([^-]\\)" . "&#x2014;\\1")	; mdash
-    ("--\\([^-]\\)" . "&#x2013;\\1")	; ndash
-    ("\\.\\.\\." . "&#x2026;"))		; hellip
+  '(("\\\\-" . "­")		; shy
+    ("---\\([^-]\\)" . "—\\1")	; mdash
+    ("--\\([^-]\\)" . "–\\1")	; ndash
+    ("\\.\\.\\." . "…"))	; hellip
   "Regular expressions for special string conversion.")
 
 (defconst org-html-scripts
@@ -821,12 +821,6 @@ and corresponding declarations."
 		  (cons (string :tag "Extension")
 			(string :tag "Declaration")))))
 
-(defcustom org-html-coding-system 'utf-8
-  "Coding system for HTML export.
-Use utf-8 as the default value."
-  :group 'org-export-html
-  :type 'coding-system)
-
 (defcustom org-html-divs '("preamble" "content" "postamble")
   "The name of the main divs for HTML export.
 This is a list of three strings, the first one for the preamble
@@ -1337,12 +1331,7 @@ INFO is a plist used as a communication channel."
 	 (keywords (plist-get info :keywords)))
     (concat
      (format "<title>%s</title>\n" title)
-     (format
-      "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/>\n"
-      (or (and org-html-coding-system
-	       (fboundp 'coding-system-get)
-	       (coding-system-get org-html-coding-system 'mime-charset))
-	  "iso-8859-1"))
+     "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/>\n"
      (format "<meta name=\"title\" content=\"%s\"/>\n" title)
      (format "<meta name=\"generator\" content=\"Org-mode\"/>\n")
      (and date (format "<meta name=\"generated\" content=\"%s\"/>\n" date))
@@ -1515,10 +1504,7 @@ holding export options."
 	(cdr (assoc "html" org-html-xml-declaration))
 
 	"")
-    (or (and org-html-coding-system
-	     (fboundp 'coding-system-get)
-	     (coding-system-get org-html-coding-system 'mime-charset))
-	"iso-8859-1"))
+    "utf-8")
    "\n"
    "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
 	       \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
@@ -1579,7 +1565,7 @@ INFO is a plist used as a communication channel."
 		       (concat org-html-tag-class-prefix
 			       (org-html-fix-class-name tag))
 		       tag))
-	     tags "&#xa0;"))))
+	     tags " "))))
 
 ;;;; Headline
 
@@ -1593,7 +1579,7 @@ INFO is a plist used as a communication channel."
 	(todo (org-html--todo todo))
 	(tags (org-html--tags tags)))
     (concat section-number todo (and todo " ") text
-	    (and tags "&#xa0;&#xa0;&#xa0;") tags)))
+	    (and tags "   ") tags)))
 
 ;;;; Src Code
 
@@ -1780,7 +1766,7 @@ INFO is a plist used as a communication channel."
 			(target . ignore))
 		      (org-export-backend-translate-table 'html))
 		     info)
-		    (and tags "&#xa0;&#xa0;&#xa0;") (org-html--tags tags)))))
+		    (and tags "   ") (org-html--tags tags)))))
 
 (defun org-html-list-of-listings (info)
   "Build a list of listings.
@@ -1932,7 +1918,7 @@ holding contextual information.  See `org-export-data'."
   "Transcode an ENTITY object from Org to HTML.
 CONTENTS are the definition itself.  INFO is a plist holding
 contextual information."
-  (org-element-property :html entity))
+  (org-element-property :utf-8 entity))
 
 
 ;;;; Example Block
@@ -2184,7 +2170,7 @@ contextual information."
 
 (defun org-html-checkbox (checkbox)
   (case checkbox (on "<code>[X]</code>")
-	(off "<code>[&#xa0;]</code>")
+	(off "<code>[ ]</code>")
 	(trans "<code>[-]</code>")
 	(t "")))
 
@@ -2856,7 +2842,7 @@ channel."
 			" align=\"%s\"" " class=\"%s\"")
 		    (org-export-table-cell-alignment table-cell info)))))
     (when (or (not contents) (string= "" (org-trim contents)))
-      (setq contents "&#xa0;"))
+      (setq contents " "))
     (cond
      ((and (org-export-table-has-header-p table info)
 	   (= 1 (org-export-table-row-group table-row info)))
@@ -2929,8 +2915,9 @@ communication channel."
 	(re-search-forward "^[ \t]*|[^|]" nil t)
 	(table-generate-source 'html outbuf))
       (with-current-buffer outbuf
-	(prog1 (org-trim (buffer-string))
-	  (kill-buffer) )))))
+	(prog1 (org-trim (replace-regexp-in-string
+			  "&nbsp;" " " (buffer-string) nil t))
+	  (kill-buffer))))))
 
 (defun org-html-table (table contents info)
   "Transcode a TABLE element from Org to HTML.
@@ -3009,7 +2996,7 @@ information."
   (let ((value (org-html-plain-text
 		(org-timestamp-translate timestamp) info)))
     (format "<span class=\"timestamp-wrapper\"><span class=\"timestamp\">%s</span></span>"
-	    (replace-regexp-in-string "--" "&#x2013;" value))))
+	    (replace-regexp-in-string "--" "–" value))))
 
 
 ;;;; Underline
@@ -3049,7 +3036,7 @@ contextual information."
   (while (string-match "^[ \t]+" contents)
     (let* ((num-ws (length (match-string 0 contents)))
 	   (ws (let (out) (dotimes (i num-ws out)
-			    (setq out (concat out "&#xa0;"))))))
+			    (setq out (concat out " "))))))
       (setq contents (replace-match ws nil t contents))))
   (format "<p class=\"verse\">\n%s</p>" contents))
 
@@ -3150,16 +3137,15 @@ file-local settings.
 Return output file's name."
   (interactive)
   (let* ((extension (concat "." org-html-extension))
-	 (file (org-export-output-file-name extension subtreep))
-	 (org-export-coding-system org-html-coding-system))
+	 (file (org-export-output-file-name extension subtreep)))
     (if async
 	(org-export-async-start
 	    (lambda (f) (org-export-add-to-stack f 'html))
-	  (let ((org-export-coding-system org-html-coding-system))
+	  (let ((org-export-coding-system 'utf-8))
 	    `(expand-file-name
 	      (org-export-to-file
 	       'html ,file ,subtreep ,visible-only ,body-only ',ext-plist))))
-      (let ((org-export-coding-system org-html-coding-system))
+      (let ((org-export-coding-system 'utf-8))
 	(org-export-to-file
 	 'html file subtreep visible-only body-only ext-plist)))))
 
@@ -3199,6 +3185,7 @@ Return output file name."
 
 ;; Local variables:
 ;; generated-autoload-file: "org-loaddefs.el"
+;; coding: utf-8
 ;; End:
 
 ;;; ox-html.el ends here
-- 
1.7.2.5


[-- Attachment #3: Type: text/plain, Size: 663 bytes --]


>
>    Side Issue: shouldn't *.patch file open in diff mode.  Currently it
>    opens in fundamental mode.
>
> See the following error reported
>
> ,----
> | File mode specification error: (error "Local variables entry is missing the 
> | prefix")
> | File local-variables error: (error "Local variables entry is missing the
> | prefix")
> `----
>
> In GNU Emacs 24.3.50.10 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
>  of 2013-03-03 on debian-6.05
> Bzr revision: 111916 eggert@cs.ucla.edu-20130302183934-3d4pouz6i3qwkxs9
> Windowing system distributor `The X.Org Foundation', version 11.0.10707000
> System Description:	Debian GNU/Linux 6.0.5 (squeeze)

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")
  2013-03-03 16:21 ` Jambunathan K
@ 2013-03-04  0:17   ` Glenn Morris
  2013-03-04  3:38     ` Jambunathan K
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2013-03-04  0:17 UTC (permalink / raw)
  To: Jambunathan K; +Cc: 13862


Adding .diff and .patch to inhibit-local-variables-regexps would avoid this.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")
  2013-03-04  0:17   ` Glenn Morris
@ 2013-03-04  3:38     ` Jambunathan K
  2013-03-04  7:38       ` Glenn Morris
  2013-03-04 16:07       ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Jambunathan K @ 2013-03-04  3:38 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 13862

Glenn Morris <rgm@gnu.org> writes:

> Adding .diff and .patch to inhibit-local-variables-regexps would avoid
> this.

,----
|  ;; Local variables:
|  ;; generated-autoload-file: "org-loaddefs.el"
| +;; coding: utf-8
|  ;; End:
`----

The question is: 

Is there are any local variables in the patch?  There isn't any.  So why
should we inhibit something that is not there.

If `diff-mode' has no comment syntax defined, then by extension, it
cannot specify file local variables.

ps: I am not sure why *.patch files are visited in diff-mode?

Jambnathan K.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")
  2013-03-04  3:38     ` Jambunathan K
@ 2013-03-04  7:38       ` Glenn Morris
  2013-03-04 16:07       ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2013-03-04  7:38 UTC (permalink / raw)
  To: 13862-done

Version: 24.4

Jambunathan K wrote:

> Is there are any local variables in the patch?  There isn't any.  So why
> should we inhibit something that is not there.

Inhibit to prevent a false detection, exactly as in this case.

> If `diff-mode' has no comment syntax defined, then by extension, it
> cannot specify file local variables.

Err, you can specify file local variables without a prefix. Eg etc/NEWS.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#13862: closed (Re: bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix"))
       [not found] ` <handler.13862.D13862.13623827429099.notifdone@debbugs.gnu.org>
@ 2013-03-04  7:58   ` Jambunathan K
  2013-03-04 14:37     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Jambunathan K @ 2013-03-04  7:58 UTC (permalink / raw)
  To: 13862


help-debbugs@gnu.org (GNU bug Tracking System) writes:

>> Is there are any local variables in the patch?  There isn't any.  So why
>> should we inhibit something that is not there.
>
> Inhibit to prevent a false detection, exactly as in this case.
>
>> If `diff-mode' has no comment syntax defined, then by extension, it
>> cannot specify file local variables.
>
> Err, you can specify file local variables without a prefix. Eg
> etc/NEWS.

Seems to me that it is worth re-visiting the above decision.  Closing
the bug will only suppress further arguments surrounding this bug.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#13862: closed (Re: bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix"))
  2013-03-04  7:58   ` bug#13862: closed (Re: bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")) Jambunathan K
@ 2013-03-04 14:37     ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2013-03-04 14:37 UTC (permalink / raw)
  To: Jambunathan K; +Cc: 13862

>>> Is there are any local variables in the patch?  There isn't any.  So why
>>> should we inhibit something that is not there.
>> Inhibit to prevent a false detection, exactly as in this case.
>>> If `diff-mode' has no comment syntax defined, then by extension, it
>>> cannot specify file local variables.
>> Err, you can specify file local variables without a prefix. Eg
>> etc/NEWS.
> Seems to me that it is worth re-visiting the above decision.  Closing
> the bug will only suppress further arguments surrounding this bug.

I think we should start by turning the error into a warning.


        Stefan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")
  2013-03-04  3:38     ` Jambunathan K
  2013-03-04  7:38       ` Glenn Morris
@ 2013-03-04 16:07       ` Eli Zaretskii
  2013-03-04 16:47         ` Stefan Monnier
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2013-03-04 16:07 UTC (permalink / raw)
  To: Jambunathan K; +Cc: 13862

> From: Jambunathan K <kjambunathan@gmail.com>
> Date: Mon, 04 Mar 2013 09:08:54 +0530
> Cc: 13862@debbugs.gnu.org
> 
> Glenn Morris <rgm@gnu.org> writes:
> 
> > Adding .diff and .patch to inhibit-local-variables-regexps would avoid
> > this.
> 
> ,----
> |  ;; Local variables:
> |  ;; generated-autoload-file: "org-loaddefs.el"
> | +;; coding: utf-8
> |  ;; End:
> `----
> 
> The question is: 
> 
> Is there are any local variables in the patch?  There isn't any.  So why
> should we inhibit something that is not there.
> 
> If `diff-mode' has no comment syntax defined, then by extension, it
> cannot specify file local variables.

File local variables never had anything to do with comment syntax; you
won't find that neither in the code nor in the documentation.  Which
is a Good Thing: if file local variables were supported only for modes
which have comment syntax defined, we couldn't have used them in all
the modes that don't.  For example, Text mode, or the tutorials, or the
ChangeLog files.  You name it.

In modes that do have comment syntax defined, it makes sense to put
these variables into comments, so as not to confuse the translator.
But that's about all these variables have in common with comments.
You will see in the code that Emacs deduces the prefix and suffix
heuristically, and that is how this is documented.

So I think Glenn is right about the solution.  Diffs don't have
contents of their own (well, except for the hunk headers), so looking
up diffs for file-local variables doesn't make much sense.

> ps: I am not sure why *.patch files are visited in diff-mode?

What else?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")
  2013-03-04 16:07       ` Eli Zaretskii
@ 2013-03-04 16:47         ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2013-03-04 16:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Jambunathan K, 13862

> So I think Glenn is right about the solution.  Diffs don't have
> contents of their own (well, except for the hunk headers), so looking
> up diffs for file-local variables doesn't make much sense.

Actually, diff files can have any other text beside the diff itself, and
so you can very easily add file local variables in there.
But it's probably OK to inhibit them, because I don't think they're
often/ever used.


        Stefan





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-04 16:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-03 16:14 bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix") Jambunathan K
2013-03-03 16:21 ` Jambunathan K
2013-03-04  0:17   ` Glenn Morris
2013-03-04  3:38     ` Jambunathan K
2013-03-04  7:38       ` Glenn Morris
2013-03-04 16:07       ` Eli Zaretskii
2013-03-04 16:47         ` Stefan Monnier
     [not found] ` <handler.13862.D13862.13623827429099.notifdone@debbugs.gnu.org>
2013-03-04  7:58   ` bug#13862: closed (Re: bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")) Jambunathan K
2013-03-04 14:37     ` Stefan Monnier

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.