emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Export buffer w/o filename to ASCII errors out (patch attached) [6.34trans (release_6.34c.221.gadb2)]
@ 2010-03-24 20:51 David Maus
  2010-03-25  7:36 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: David Maus @ 2010-03-24 20:51 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1.1: Type: text/plain, Size: 6027 bytes --]


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

When exporting a buffer without associated filename and no #+TITLE set
to ASCII using C-c C-e A Org errors out with "Wrong type argument:
stringp, nil".

The problem is that `org-export-as-ascii' tries to obtain the
document's title and falls back to (buffer-file-name) -- what is nil
for a buffer w/o associated file.

Steps to reproduce:

  - create shiny new buffer C-x b *test* RET

  - turn on Org M-x org-mode RET

  - maybe insert something

  - C-c C-e A

Attached patch fixes this by using (buffer-file-name) only if there is
one and falls back to UNTITLED.

 -- David

Emacs  : GNU Emacs 24.0.50.1 (i486-pc-linux-gnu, GTK+ Version 2.18.7)
 of 2010-03-11 on elegiac, modified by Debian
Package: Org-mode version 6.34trans (release_6.34c.221.gadb2)

current state:
==============
(setq
 org-log-done 'time
 org-wl-nntp-prefer-web-links t
 org-export-latex-default-class "scrartcl"
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-todo-keyword-faces '(("TODO" :foreground "red" :weight bold) ("MAYB" :foreground "orange red" :weight bold)
			  ("WAIT" :foreground "firebrick" :weight bold) ("DONE" :foreground "green")
			  ("IDEA" :foreground "gold" :weight bold) ("CANC" :foreground "LightSlateGrey"))
 org-wl-shimbun-prefer-web-links t
 org-agenda-custom-commands '(("R" "Refile new tasks and notes" tags "LEVEL=1+REFILE"))
 org-agenda-files '("~/org/" "~/org/priv/" "~/org/pg/" "~/org/tec/")
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-agenda-tags-column -120
 org-checklist-export-function 'org-export-as-ascii
 org-after-todo-state-change-hook '(org-clock-out-if-current org-checklist)
 org-agenda-todo-ignore-scheduled t
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-log-redeadline 'time
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tab-first-hook '(org-hide-block-toggle-maybe)
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-wl-link-remove-filter t
 org-todo-keywords '((sequence "TODO(t)" "WAIT(w)" "|" "DONE(D)") (sequence "IDEA(i)" "MAYB(m)" "|" "CANC(C)"))
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-default-notes-file "/home/david/org//bucket.org"
 org-directory "/home/david/org/"
 org-log-reschedule 'time
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines
		  org-optimize-window-after-visibility-change)
 org-export-latex-classes '(("scrartcl"
			     "\\documentclass[paper=a4,12pt]{scrartcl}\n       \\usepackage[utf8]{inputenc}\n       \\usepackage[T1]{fontenc}\n       \\usepackage[ngerman]{babel}\n       \\usepackage{graphicx}\n       \\usepackage{longtable}\n       \\usepackage{float}\n       \\usepackage{wrapfig}\n       \\usepackage{soul}\n       \\usepackage{amssymb}\n       \\usepackage{microtype}\n       \\usepackage{lmodern}\n       \\parskip 6pt\n       \\usepackage[autocite=footnote,style=authoryear]{biblatex}\n       \\usepackage{hyperref}"
			     ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
			     ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}")
			     ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
			    )
 org-publish-project-alist '(("ictsoc-web" :base-directory "~/www/ictsoc.de/" :base-extension "org" :publishing-directory
			      "~/www/ictsoc.de/" :publishing-function org-publish-org-to-html :author "David Maus" :email
			      "dmaus@ictsoc.de" :author-info t :creator-info t :timestamp nil :headline-levels 4
			      :section-numbers nil :recursive t)
			     ("ictsoc-feed" :base-directory "~/www/ictsoc.de/" :base-extension "org" :publishing-directory
			      "~/www/ictsoc.de/" :publishing-url "http://ictsoc.de/" :auto-index t :recursive t
			      :index-filename "feed.atom" :index-function org-atom-publish-feed-index :feed-map-entries
			      "LEVEL=1" :feed-id "109b1796-d619-424d-a339-596093767737")
			     ("ictsoc" :components ("ictsoc-web")))
 org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers)
 org-email-link-description-format "%m"
 org-mode-hook '((lambda nil
		  (org-add-hook (quote change-major-mode-hook) (quote org-show-block-all) (quote append) (quote local)))
		 )
 org-refile-targets '((org-agenda-files :maxlevel . 5))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-refile-use-outline-path 'file
 org-log-into-drawer "LOGBOOK"
 org-agenda-todo-ignore-with-date t
 org-enforce-todo-dependencies t
 org-refile-allow-creating-parent-nodes 'confirm
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
 org-tags-column -120
 org-remember-templates '(("todo" 116 "* TODO %^{Todo}\n  :PROPERTIES:\n  :Created: %u\n  :END:" "~/org/bucket.org" bottom
			   nil)
			  ("idea" 105 "* IDEA %^{Idea}\n  :PROPERTIES:\n  :Created: %u\n  :END:" "~/org/bucket.org" bottom
			   nil)
			  ("link" 119 "* %c :link:\n  :PROPERTIES:\n  :Created: %u\n  :END:\n%i" "~/org/bucket.org" bottom
			   nil)
			  ("appt" 97 "* %^{Appointment} :appt:\n  %^T\n  :PROPERTIES:\n  :Created: %u\n  :END:"
			   "~/org/bucket.org" bottom nil)
			  ("note" 110 "* %^{Note} :note:\n  :PROPERTIES:\n  :Created: %u\n  :END:" "~/org/bucket.org" bottom
			   nil)
			  )
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc org-beamer-auto-fragile-frames
			       org-beamer-place-default-actions-for-lists)
 )
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.1.2: org-ascii-untitled.diff --]
[-- Type: application/octet-stream, Size: 627 bytes --]

diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el
index 6c395b3..c8f3e2c 100644
--- a/lisp/org-ascii.el
+++ b/lisp/org-ascii.el
@@ -227,8 +227,10 @@ publishing directory."
 		    (and (not
 			  (plist-get opt-plist :skip-before-1st-heading))
 			 (org-export-grab-title-from-buffer))
-		    (file-name-sans-extension
-		     (file-name-nondirectory bfname))))
+		    (and (buffer-file-name)
+			 (file-name-sans-extension
+			  (file-name-nondirectory bfname)))
+		    "UNTITLED"))
 	 (email (plist-get opt-plist :email))
 	 (language (plist-get opt-plist :language))
 	 (quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Bug: Export buffer w/o filename to ASCII errors out (patch attached) [6.34trans (release_6.34c.221.gadb2)]
  2010-03-24 20:51 Bug: Export buffer w/o filename to ASCII errors out (patch attached) [6.34trans (release_6.34c.221.gadb2)] David Maus
@ 2010-03-25  7:36 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2010-03-25  7:36 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode

Applied, thanks.

- Carsten

On Mar 24, 2010, at 9:51 PM, David Maus wrote:

>
> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?   
> See
>
>     http://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org-mode mailing list.
> ------------------------------------------------------------------------
>
> When exporting a buffer without associated filename and no #+TITLE set
> to ASCII using C-c C-e A Org errors out with "Wrong type argument:
> stringp, nil".
>
> The problem is that `org-export-as-ascii' tries to obtain the
> document's title and falls back to (buffer-file-name) -- what is nil
> for a buffer w/o associated file.
>
> Steps to reproduce:
>
>  - create shiny new buffer C-x b *test* RET
>
>  - turn on Org M-x org-mode RET
>
>  - maybe insert something
>
>  - C-c C-e A
>
> Attached patch fixes this by using (buffer-file-name) only if there is
> one and falls back to UNTITLED.
>
> -- David
>
> Emacs  : GNU Emacs 24.0.50.1 (i486-pc-linux-gnu, GTK+ Version 2.18.7)
> of 2010-03-11 on elegiac, modified by Debian
> Package: Org-mode version 6.34trans (release_6.34c.221.gadb2)
>
> current state:
> ==============
> (setq
> org-log-done 'time
> org-wl-nntp-prefer-web-links t
> org-export-latex-default-class "scrartcl"
> org-export-latex-after-initial-vars-hook '(org-beamer-after-initial- 
> vars)
> org-todo-keyword-faces '(("TODO" :foreground "red" :weight bold)  
> ("MAYB" :foreground "orange red" :weight bold)
> 			  ("WAIT" :foreground "firebrick" :weight bold)  
> ("DONE" :foreground "green")
> 			  ("IDEA" :foreground "gold" :weight bold) ("CANC" :foreground  
> "LightSlateGrey"))
> org-wl-shimbun-prefer-web-links t
> org-agenda-custom-commands '(("R" "Refile new tasks and notes" tags  
> "LEVEL=1+REFILE"))
> org-agenda-files '("~/org/" "~/org/priv/" "~/org/pg/" "~/org/tec/")
> org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
> org-agenda-tags-column -120
> org-checklist-export-function 'org-export-as-ascii
> org-after-todo-state-change-hook '(org-clock-out-if-current org- 
> checklist)
> org-agenda-todo-ignore-scheduled t
> org-export-latex-format-toc-function 'org-export-latex-format-toc- 
> default
> org-log-redeadline 'time
> org-export-preprocess-hook '(org-export-blocks-preprocess)
> org-tab-first-hook '(org-hide-block-toggle-maybe)
> org-src-mode-hook '(org-src-mode-configure-edit-buffer)
> org-confirm-shell-link-function 'yes-or-no-p
> org-export-first-hook '(org-beamer-initialize-open-trackers)
> org-wl-link-remove-filter t
> org-todo-keywords '((sequence "TODO(t)" "WAIT(w)" "|" "DONE(D)")  
> (sequence "IDEA(i)" "MAYB(m)" "|" "CANC(C)"))
> org-agenda-before-write-hook '(org-agenda-add-entry-text)
> org-default-notes-file "/home/david/org//bucket.org"
> org-directory "/home/david/org/"
> org-log-reschedule 'time
> org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide- 
> drawers org-cycle-show-empty-lines
> 		  org-optimize-window-after-visibility-change)
> org-export-latex-classes '(("scrartcl"
> 			     "\\documentclass[paper=a4,12pt]{scrartcl}\n       \ 
> \usepackage[utf8]{inputenc}\n       \\usepackage[T1]{fontenc} 
> \n       \\usepackage[ngerman]{babel}\n       \\usepackage{graphicx} 
> \n       \\usepackage{longtable}\n       \\usepackage{float}\n        
> \\usepackage{wrapfig}\n       \\usepackage{soul}\n       \ 
> \usepackage{amssymb}\n       \\usepackage{microtype}\n       \ 
> \usepackage{lmodern}\n       \\parskip 6pt\n       \ 
> \usepackage[autocite=footnote,style=authoryear]{biblatex}\n       \ 
> \usepackage{hyperref}"
> 			     ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\ 
> \subsection*{%s}")
> 			     ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\ 
> \paragraph{%s}" . "\\paragraph*{%s}")
> 			     ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
> 			    )
> org-publish-project-alist '(("ictsoc-web" :base-directory "~/www/ 
> ictsoc.de/" :base-extension "org" :publishing-directory
> 			      "~/www/ictsoc.de/" :publishing-function org-publish-org-to- 
> html :author "David Maus" :email
> 			      "dmaus@ictsoc.de" :author-info t :creator-info t :timestamp  
> nil :headline-levels 4
> 			      :section-numbers nil :recursive t)
> 			     ("ictsoc-feed" :base-directory "~/www/ictsoc.de/" :base- 
> extension "org" :publishing-directory
> 			      "~/www/ictsoc.de/" :publishing-url "http:// 
> ictsoc.de/" :auto-index t :recursive t
> 			      :index-filename "feed.atom" :index-function org-atom- 
> publish-feed-index :feed-map-entries
> 			      "LEVEL=1" :feed-id "109b1796-d619-424d-a339-596093767737")
> 			     ("ictsoc" :components ("ictsoc-web")))
> org-export-preprocess-before-normalizing-links-hook '(org-remove- 
> file-link-modifiers)
> org-email-link-description-format "%m"
> org-mode-hook '((lambda nil
> 		  (org-add-hook (quote change-major-mode-hook) (quote org-show- 
> block-all) (quote append) (quote local)))
> 		 )
> org-refile-targets '((org-agenda-files :maxlevel . 5))
> org-confirm-elisp-link-function 'yes-or-no-p
> org-refile-use-outline-path 'file
> org-log-into-drawer "LOGBOOK"
> org-agenda-todo-ignore-with-date t
> org-enforce-todo-dependencies t
> org-refile-allow-creating-parent-nodes 'confirm
> org-occur-hook '(org-first-headline-recenter)
> org-export-preprocess-before-selecting-backend-code-hook '(org- 
> beamer-select-beamer-code)
> org-tags-column -120
> org-remember-templates '(("todo" 116 "* TODO %^{Todo}\n  :PROPERTIES: 
> \n  :Created: %u\n  :END:" "~/org/bucket.org" bottom
> 			   nil)
> 			  ("idea" 105 "* IDEA %^{Idea}\n  :PROPERTIES:\n  :Created: %u 
> \n  :END:" "~/org/bucket.org" bottom
> 			   nil)
> 			  ("link" 119 "* %c :link:\n  :PROPERTIES:\n  :Created: %u 
> \n  :END:\n%i" "~/org/bucket.org" bottom
> 			   nil)
> 			  ("appt" 97 "* %^{Appointment} :appt:\n  %^T\n  :PROPERTIES: 
> \n  :Created: %u\n  :END:"
> 			   "~/org/bucket.org" bottom nil)
> 			  ("note" 110 "* %^{Note} :note:\n  :PROPERTIES:\n  :Created: %u 
> \n  :END:" "~/org/bucket.org" bottom
> 			   nil)
> 			  )
> org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix- 
> toc org-beamer-auto-fragile-frames
> 			       org-beamer-place-default-actions-for-lists)
> )
> --
> OpenPGP... 0x99ADB83B5A4478E6
> Jabber.... dmjena@jabber.org
> Email..... dmaus@ictsoc.de
> <org-ascii- 
> untitled.diff>_______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

end of thread, other threads:[~2010-03-25  7:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-24 20:51 Bug: Export buffer w/o filename to ASCII errors out (patch attached) [6.34trans (release_6.34c.221.gadb2)] David Maus
2010-03-25  7:36 ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).