emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Use (org-entry-properties) in a mode derived from org-mode
@ 2011-08-31 13:05 Stefan Reichör
  2011-09-01 12:15 ` Stefan Reichör
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Reichör @ 2011-08-31 13:05 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

I'd like to derive a mode from org-mode.

I do something like this:

(define-derived-mode derived-org-mode org-mode "dorg" "derived org-mode"
  (message "derived-org-mode activated")
  )

When I activate the derived-org-mode, M-: (org-entry-properties) does no longer work.

Using org-mode it works.

When I use derived-mode-p in org-mode-p everything works:


(defsubst org-mode-p ()
  "Check if the current buffer is in Org-mode or a derived mode."
  ;;(eq major-mode 'org-mode))
  (if (derived-mode-p 'org-mode) t nil))


I think changing org-mode-p should be the correct change to make
deriving from org-mode work.

Perhaps a (if (symbolp 'derived-mode-p) ...) is necessary to avoid
compatibility problems.

What do the org developers think of this improvement?


Stefan.

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

* Re: Use (org-entry-properties) in a mode derived from org-mode
  2011-08-31 13:05 Use (org-entry-properties) in a mode derived from org-mode Stefan Reichör
@ 2011-09-01 12:15 ` Stefan Reichör
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Reichör @ 2011-09-01 12:15 UTC (permalink / raw)
  To: emacs-orgmode

Hello again!

> Hi!
>
> I'd like to derive a mode from org-mode.
>
> I do something like this:
>
> (define-derived-mode derived-org-mode org-mode "dorg" "derived org-mode"
>   (message "derived-org-mode activated")
>   )
>
> When I activate the derived-org-mode, M-: (org-entry-properties) does no longer work.
>
> Using org-mode it works.
>
> When I use derived-mode-p in org-mode-p everything works:
>
>
> (defsubst org-mode-p ()
>   "Check if the current buffer is in Org-mode or a derived mode."
>   ;;(eq major-mode 'org-mode))
>   (if (derived-mode-p 'org-mode) t nil))
>
>
> I think changing org-mode-p should be the correct change to make
> deriving from org-mode work.
>
> Perhaps a (if (symbolp 'derived-mode-p) ...) is necessary to avoid
> compatibility problems.
>
> What do the org developers think of this improvement?
>


In function org-edit-src-code there is already support for derived modes from org-mode:
,----
|   (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))
| 	(org-mode-p (or (org-mode-p) (derived-mode-p 'org-mode)))
`----

(defun org-mode-or-derived-mode-p ()
  "Check if the current buffer is in Org-mode or a derived mode."
  (if (derived-mode-p 'org-mode) t nil))

Using org-mode-or-derived-mode-p would change the function like this:
,----
| In function org-edit-src-code
|   (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))
| 	(org-mode-p (org-mode-or-derived-mode-p))
`----

org-mode-p could be replaced step by step with org-mode-or-derived-mode-p to enhance the support for org-mode derived modes.

I need org-mode-or-derived-mode-p instead of org-mode-p in org-entry-properties.

It would be great if org-mode-or-derived-mode-p could be added!

Thanks,
  Stefan.

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

end of thread, other threads:[~2011-09-01 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-31 13:05 Use (org-entry-properties) in a mode derived from org-mode Stefan Reichör
2011-09-01 12:15 ` Stefan Reichör

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).