emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-mode + xemacs + patch
@ 2006-05-09 14:23 chgreg692000
  2006-05-09 14:58 ` Carsten Dominik
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: chgreg692000 @ 2006-05-09 14:23 UTC (permalink / raw)
  To: emacs-orgmode

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


Hi all,

I've started to use wonderful org-mode in xemacs and found couple of
minor bugs:

1. Cycling headline on first line of the buffer gives "Before first
   heading" error.
2. org-insert-todo-heading uses outline-previous-heading that is not
   defined in xemacs outline mode.
3. Popup menu still shows outline menu and not org-mode menu.

Attached patch (against org-mode 4.27) fixes these bugs and (hopefully)
don't break anything in emacs version.

Patch also contains addon/enhancement to table editor. Only thing i
missed for org-mode tables is to use plain elisp for formulas. I added
ugly hack to achieve this. Now i can use '(elisp expression) as
formula. 

Regards, 

Greg Chernov


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org.xemacs.patch --]
[-- Type: text/x-patch, Size: 5167 bytes --]

--- org-orig.el	2006-05-09 10:51:58.000000000 +0300
+++ org.el	2006-05-09 10:48:33.000000000 +0300
@@ -2394,11 +2394,32 @@
 The following commands are available:
 
 \\{org-mode-map}"
+  
+  ;; Get rid of Outline menus, they are not needed
+  ;; Need to do this here because define-derived-mode sets up
+  ;; the keymap so late.
+  (if (featurep 'xemacs)
+      (progn
+	(if org-noutline-p
+	    (progn
+	      (easy-menu-remove outline-mode-menu-heading)
+	      (easy-menu-remove outline-mode-menu-show)
+	      (easy-menu-remove outline-mode-menu-hide))
+	  (delete-menu-item '("Headings"))
+	  (delete-menu-item '("Show"))
+	  (delete-menu-item '("Hide"))
+	  (set-menubar-dirty-flag)))
+    (define-key org-mode-map [menu-bar headings] 'undefined)
+    (define-key org-mode-map [menu-bar hide] 'undefined)
+    (define-key org-mode-map [menu-bar show] 'undefined))
+
   (easy-menu-add org-org-menu)
   (easy-menu-add org-tbl-menu)
   (org-install-agenda-files-menu)
   (if org-descriptive-links (org-add-to-invisibility-spec '(org-link)))
   (org-add-to-invisibility-spec '(org-cwidth))
+  (when (featurep 'xemacs)
+    (set (make-local-variable 'line-move-ignore-invisible) t))
   (setq outline-regexp "\\*+")
   ;;(setq outline-regexp "\\(?:\\*+\\|[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)")
   (setq outline-level 'org-outline-level)
@@ -2427,19 +2448,7 @@
 	   (= (point-min) (point-max)))
       (insert "    -*- mode: org -*-\n\n"))
 
-  ;; Get rid of Outline menus, they are not needed
-  ;; Need to do this here because define-derived-mode sets up
-  ;; the keymap so late.
-  (if (featurep 'xemacs)
-      (progn
-	(delete-menu-item '("Headings"))
-	(delete-menu-item '("Show"))
-	(delete-menu-item '("Hide"))
-	(set-menubar-dirty-flag))
-    (define-key org-mode-map [menu-bar headings] 'undefined)
-    (define-key org-mode-map [menu-bar hide] 'undefined)
-    (define-key org-mode-map [menu-bar show] 'undefined))
-
+  
   (unless org-inhibit-startup
     (if org-startup-align-all-tables
 	(org-table-map-tables 'org-table-align))
@@ -2926,7 +2935,8 @@
 			(get-char-property (1- (point)) 'invisible))
 	      (beginning-of-line 2)) (setq eol (point)))
 	  (outline-end-of-heading)   (setq eoh (point))
-	  (org-end-of-subtree t)     (setq eos (point))
+	  ;;(org-end-of-subtree t)     (setq eos (point))
+	  (outline-end-of-subtree)     (setq eos (point))
 	  (outline-next-heading))
 	;; Find out what to do next and set `this-command'
 	(cond
@@ -3190,7 +3200,9 @@
   (org-insert-heading)
   (save-excursion
     (org-back-to-heading)
-    (outline-previous-heading)
+    (if org-noutline-p
+	(outline-previous-heading)
+      (outline-previous-visible-heading 1))
     (looking-at org-todo-line-regexp))
   (if (or arg
 	  (not (match-beginning 2))
@@ -7917,9 +7929,9 @@
 	  (set-window-configuration org-window-config-before-follow-link)
 	  (save-excursion (set-buffer b) (goto-char p)
 	    (bibtex-url)))
-      (recenter 0)))  ; Move entry start to beginning of window
+      (recenter 0))  ; Move entry start to beginning of window
   ;; return t to indicate that the search is done.
-  t)
+    t))
 
 ;; Finally add the functions to the right hooks.
 (add-hook 'org-create-file-search-functions 'org-create-file-search-in-bibtex)
@@ -10403,7 +10415,8 @@
 	(unless x (error "Invalid field specifier \"%s\""
 			 (match-string 0 form)))
 	(if (equal x "") (setq x "0"))
-	(setq form (replace-match (concat "(" x ")") t t form)))
+	;;(setq form (replace-match (concat "(" x ")") t t form)))
+	(setq form (replace-match x t t form)))
       ;; Insert ranges in current column
       (while (string-match "\\&[-I0-9]+" form)
 	(setq form (replace-match
@@ -10411,8 +10424,10 @@
 		       (org-table-get-vertical-vector (match-string 0 form)
 						      nil n0))
 		     t t form)))
-      (setq ev (calc-eval (cons form modes)
-			  (if org-table-formula-numbers-only 'num)))
+      (if (string-match "^'(.*)$" form)
+	  (setq ev (eval (eval (read form))))
+	(setq ev (calc-eval (cons form modes)
+			    (if org-table-formula-numbers-only 'num))))
 
       (when org-table-formula-debug
 	(with-output-to-temp-buffer "*Help*"
@@ -12999,6 +13014,9 @@
 (define-key org-mode-map "\C-c\C-x\M-w"   'org-copy-special)
 (define-key org-mode-map "\C-c\C-x\C-y"   'org-paste-special)
 
+(when (featurep 'xemacs) 
+  (define-key org-mode-map 'button3   'popup-mode-menu))
+
 (defsubst org-table-p () (org-at-table-p))
 
 (defun org-self-insert-command (N)
@@ -13772,7 +13790,8 @@
 Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
   (if org-noutline-p
       (outline-back-to-heading invisible-ok)
-    (if (and (memq (char-before) '(?\n ?\r))
+    (if (and (or (memq (char-before) '(?\n ?\r))
+		 (point-min))
              (looking-at outline-regexp))
 	t
       (if (re-search-backward (concat (if invisible-ok "\\([\r\n]\\|^\\)" "^")
@@ -13899,7 +13918,7 @@
   (save-excursion
     (org-back-to-heading t)
     (outline-flag-region
-     (1- (point))
+     (max 1 (1- (point)))
      (save-excursion
        (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move)
        (or (match-beginning 1) (point-max)))

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

_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: org-mode + xemacs + patch
  2006-05-09 14:23 org-mode + xemacs + patch chgreg692000
@ 2006-05-09 14:58 ` Carsten Dominik
  2006-05-10  7:40   ` chgreg692000
  2006-05-10 10:49 ` Carsten Dominik
  2006-05-11  3:58 ` Carsten Dominik
  2 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2006-05-09 14:58 UTC (permalink / raw)
  To: chgreg692000; +Cc: emacs-orgmode

Hi Greg,

thank you very much, I will take a look at your patch.

Can you give us a few examples on how you use the lisp expression in 
actual tables? What kind of applications do you have in mind?

- Carsten

On May 9, 2006, at 16:23, chgreg692000@yahoo.com wrote:

>
> Hi all,
>
> I've started to use wonderful org-mode in xemacs and found couple of
> minor bugs:
>
> 1. Cycling headline on first line of the buffer gives "Before first
>    heading" error.
> 2. org-insert-todo-heading uses outline-previous-heading that is not
>    defined in xemacs outline mode.
> 3. Popup menu still shows outline menu and not org-mode menu.
>
> Attached patch (against org-mode 4.27) fixes these bugs and (hopefully)
> don't break anything in emacs version.
>
> Patch also contains addon/enhancement to table editor. Only thing i
> missed for org-mode tables is to use plain elisp for formulas. I added
> ugly hack to achieve this. Now i can use '(elisp expression) as
> formula.
>
> Regards,
>
> Greg Chernov
>
> --- org-orig.el	2006-05-09 10:51:58.000000000 +0300
> +++ org.el	2006-05-09 10:48:33.000000000 +0300
> @@ -2394,11 +2394,32 @@
>  The following commands are available:
>
>  \\{org-mode-map}"
> +
> +  ;; Get rid of Outline menus, they are not needed
> +  ;; Need to do this here because define-derived-mode sets up
> +  ;; the keymap so late.
> +  (if (featurep 'xemacs)
> +      (progn
> +	(if org-noutline-p
> +	    (progn
> +	      (easy-menu-remove outline-mode-menu-heading)
> +	      (easy-menu-remove outline-mode-menu-show)
> +	      (easy-menu-remove outline-mode-menu-hide))
> +	  (delete-menu-item '("Headings"))
> +	  (delete-menu-item '("Show"))
> +	  (delete-menu-item '("Hide"))
> +	  (set-menubar-dirty-flag)))
> +    (define-key org-mode-map [menu-bar headings] 'undefined)
> +    (define-key org-mode-map [menu-bar hide] 'undefined)
> +    (define-key org-mode-map [menu-bar show] 'undefined))
> +
>    (easy-menu-add org-org-menu)
>    (easy-menu-add org-tbl-menu)
>    (org-install-agenda-files-menu)
>    (if org-descriptive-links (org-add-to-invisibility-spec 
> '(org-link)))
>    (org-add-to-invisibility-spec '(org-cwidth))
> +  (when (featurep 'xemacs)
> +    (set (make-local-variable 'line-move-ignore-invisible) t))
>    (setq outline-regexp "\\*+")
>    ;;(setq outline-regexp "\\(?:\\*+\\|[ 
> \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)")
>    (setq outline-level 'org-outline-level)
> @@ -2427,19 +2448,7 @@
>  	   (= (point-min) (point-max)))
>        (insert "    -*- mode: org -*-\n\n"))
>
> -  ;; Get rid of Outline menus, they are not needed
> -  ;; Need to do this here because define-derived-mode sets up
> -  ;; the keymap so late.
> -  (if (featurep 'xemacs)
> -      (progn
> -	(delete-menu-item '("Headings"))
> -	(delete-menu-item '("Show"))
> -	(delete-menu-item '("Hide"))
> -	(set-menubar-dirty-flag))
> -    (define-key org-mode-map [menu-bar headings] 'undefined)
> -    (define-key org-mode-map [menu-bar hide] 'undefined)
> -    (define-key org-mode-map [menu-bar show] 'undefined))
> -
> +
>    (unless org-inhibit-startup
>      (if org-startup-align-all-tables
>  	(org-table-map-tables 'org-table-align))
> @@ -2926,7 +2935,8 @@
>  			(get-char-property (1- (point)) 'invisible))
>  	      (beginning-of-line 2)) (setq eol (point)))
>  	  (outline-end-of-heading)   (setq eoh (point))
> -	  (org-end-of-subtree t)     (setq eos (point))
> +	  ;;(org-end-of-subtree t)     (setq eos (point))
> +	  (outline-end-of-subtree)     (setq eos (point))
>  	  (outline-next-heading))
>  	;; Find out what to do next and set `this-command'
>  	(cond
> @@ -3190,7 +3200,9 @@
>    (org-insert-heading)
>    (save-excursion
>      (org-back-to-heading)
> -    (outline-previous-heading)
> +    (if org-noutline-p
> +	(outline-previous-heading)
> +      (outline-previous-visible-heading 1))
>      (looking-at org-todo-line-regexp))
>    (if (or arg
>  	  (not (match-beginning 2))
> @@ -7917,9 +7929,9 @@
>  	  (set-window-configuration org-window-config-before-follow-link)
>  	  (save-excursion (set-buffer b) (goto-char p)
>  	    (bibtex-url)))
> -      (recenter 0)))  ; Move entry start to beginning of window
> +      (recenter 0))  ; Move entry start to beginning of window
>    ;; return t to indicate that the search is done.
> -  t)
> +    t))
>
>  ;; Finally add the functions to the right hooks.
>  (add-hook 'org-create-file-search-functions 
> 'org-create-file-search-in-bibtex)
> @@ -10403,7 +10415,8 @@
>  	(unless x (error "Invalid field specifier \"%s\""
>  			 (match-string 0 form)))
>  	(if (equal x "") (setq x "0"))
> -	(setq form (replace-match (concat "(" x ")") t t form)))
> +	;;(setq form (replace-match (concat "(" x ")") t t form)))
> +	(setq form (replace-match x t t form)))
>        ;; Insert ranges in current column
>        (while (string-match "\\&[-I0-9]+" form)
>  	(setq form (replace-match
> @@ -10411,8 +10424,10 @@
>  		       (org-table-get-vertical-vector (match-string 0 form)
>  						      nil n0))
>  		     t t form)))
> -      (setq ev (calc-eval (cons form modes)
> -			  (if org-table-formula-numbers-only 'num)))
> +      (if (string-match "^'(.*)$" form)
> +	  (setq ev (eval (eval (read form))))
> +	(setq ev (calc-eval (cons form modes)
> +			    (if org-table-formula-numbers-only 'num))))
>
>        (when org-table-formula-debug
>  	(with-output-to-temp-buffer "*Help*"
> @@ -12999,6 +13014,9 @@
>  (define-key org-mode-map "\C-c\C-x\M-w"   'org-copy-special)
>  (define-key org-mode-map "\C-c\C-x\C-y"   'org-paste-special)
>
> +(when (featurep 'xemacs)
> +  (define-key org-mode-map 'button3   'popup-mode-menu))
> +
>  (defsubst org-table-p () (org-at-table-p))
>
>  (defun org-self-insert-command (N)
> @@ -13772,7 +13790,8 @@
>  Only visible heading lines are considered, unless INVISIBLE-OK is 
> non-nil."
>    (if org-noutline-p
>        (outline-back-to-heading invisible-ok)
> -    (if (and (memq (char-before) '(?\n ?\r))
> +    (if (and (or (memq (char-before) '(?\n ?\r))
> +		 (point-min))
>               (looking-at outline-regexp))
>  	t
>        (if (re-search-backward (concat (if invisible-ok 
> "\\([\r\n]\\|^\\)" "^")
> @@ -13899,7 +13918,7 @@
>    (save-excursion
>      (org-back-to-heading t)
>      (outline-flag-region
> -     (1- (point))
> +     (max 1 (1- (point)))
>       (save-excursion
>         (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") 
> nil 'move)
>         (or (match-beginning 1) (point-max)))
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: org-mode + xemacs + patch
  2006-05-09 14:58 ` Carsten Dominik
@ 2006-05-10  7:40   ` chgreg692000
  2006-05-11  9:44     ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: chgreg692000 @ 2006-05-10  7:40 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, 9 May 2006, dominik@science.uva.nl wrote:

> Hi Greg,
> 
> thank you very much, I will take a look at your patch.
> 
> Can you give us a few examples on how you use the lisp expression in
> actual tables? What kind of applications do you have in mind?
> 

Lisp expression in tables can be used for string manipulations,
regexp, control structures. Maybe there is a way to do it with 
'calc-eval' but i didn't found it. 

Look at the following example:

|---+-------------------+---------+----------|
|   | scan              | scan_in | scan_out |
|   |                   |   witdh |    width |
|---+-------------------+---------+----------|
| ! |                   |       0 |        0 |
| # | "SCAN_IN0[12:0]"  |      13 |        0 |
| # | "SCAN_IN1[3:0]"   |      17 |        0 |
| # | "SCAN_OUT0[15:0]" |      17 |       16 |
| # | "SCAN_IN2[22:0]"  |      40 |       16 |
| # | "SCAN_OUT1[44:0]" |      40 |       61 |
| # | "SCAN_IN3[5:0]"   |      46 |       61 |
|---+-------------------+---------+----------|
#+TBLFM: $3='(number-to-string (if (string-match "SCAN_IN.*\\[\\([0-9]+\\):\\([0-9]+\\)\\]" $2) (+ (string-to-number (match-string 1 $2)) 1 &1) &1))::$4='(number-to-string (if (string-match "SCAN_OUT.*\\[\\([0-9]+\\):\\([0-9]+\\)\\]" $2) (+ (string-to-number (match-string 1 $2)) 1 &1) &1))


In this table inputs are names of scan_in and scan_out buses, outputs
are total width of scan_in bus and total width of scan_out bus.


> - Carsten

Regards,

Greg

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

* Re: org-mode + xemacs + patch
  2006-05-09 14:23 org-mode + xemacs + patch chgreg692000
  2006-05-09 14:58 ` Carsten Dominik
@ 2006-05-10 10:49 ` Carsten Dominik
       [not found]   ` <7u3bfit8ov.fsf@horizonsemi.com>
  2006-05-11  3:58 ` Carsten Dominik
  2 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2006-05-10 10:49 UTC (permalink / raw)
  To: chgreg692000; +Cc: emacs-orgmode

> +  ;; Get rid of Outline menus, they are not needed
> +  ;; Need to do this here because define-derived-mode sets up
> +  ;; the keymap so late.
> +  (if (featurep 'xemacs)
> +      (progn
> +	(if org-noutline-p


Are you trying to tell me that noutline have been ported to 
XEmacs?????????????

That would be fantastic, because programming for the old outline mode 
is a nightmare and org.el would get shorter if I would not need this 
double code.....

- Carsten

> +	    (progn
> +	      (easy-menu-remove outline-mode-menu-heading)
> +	      (easy-menu-remove outline-mode-menu-show)
> +	      (easy-menu-remove outline-mode-menu-hide))
> +	  (delete-menu-item '("Headings"))
> +	  (delete-menu-item '("Show"))
> +	  (delete-menu-item '("Hide"))
> +	  (set-menubar-dirty-flag)))
> +    (define-key org-mode-map [menu-bar headings] 'undefined)
> +    (define-key org-mode-map [menu-bar hide] 'undefined)
> +    (define-key org-mode-map [menu-bar show] 'undefined))
> +
>    (easy-menu-add org-org-menu)
>    (easy-menu-add org-tbl-menu)
>    (org-install-agenda-files-menu)
>    (if org-descriptive-links (org-add-to-invisibility-spec 
> '(org-link)))
>    (org-add-to-invisibility-spec '(org-cwidth))
> +  (when (featurep 'xemacs)
> +    (set (make-local-variable 'line-move-ignore-invisible) t))
>    (setq outline-regexp "\\*+")
>    ;;(setq outline-regexp "\\(?:\\*+\\|[ 
> \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)")
>    (setq outline-level 'org-outline-level)
> @@ -2427,19 +2448,7 @@
>  	   (= (point-min) (point-max)))
>        (insert "    -*- mode: org -*-\n\n"))
>
> -  ;; Get rid of Outline menus, they are not needed
> -  ;; Need to do this here because define-derived-mode sets up
> -  ;; the keymap so late.
> -  (if (featurep 'xemacs)
> -      (progn
> -	(delete-menu-item '("Headings"))
> -	(delete-menu-item '("Show"))
> -	(delete-menu-item '("Hide"))
> -	(set-menubar-dirty-flag))
> -    (define-key org-mode-map [menu-bar headings] 'undefined)
> -    (define-key org-mode-map [menu-bar hide] 'undefined)
> -    (define-key org-mode-map [menu-bar show] 'undefined))
> -
> +
>    (unless org-inhibit-startup
>      (if org-startup-align-all-tables
>  	(org-table-map-tables 'org-table-align))
> @@ -2926,7 +2935,8 @@
>  			(get-char-property (1- (point)) 'invisible))
>  	      (beginning-of-line 2)) (setq eol (point)))
>  	  (outline-end-of-heading)   (setq eoh (point))
> -	  (org-end-of-subtree t)     (setq eos (point))
> +	  ;;(org-end-of-subtree t)     (setq eos (point))
> +	  (outline-end-of-subtree)     (setq eos (point))
>  	  (outline-next-heading))
>  	;; Find out what to do next and set `this-command'
>  	(cond
> @@ -3190,7 +3200,9 @@
>    (org-insert-heading)
>    (save-excursion
>      (org-back-to-heading)
> -    (outline-previous-heading)
> +    (if org-noutline-p
> +	(outline-previous-heading)
> +      (outline-previous-visible-heading 1))
>      (looking-at org-todo-line-regexp))
>    (if (or arg
>  	  (not (match-beginning 2))
> @@ -7917,9 +7929,9 @@
>  	  (set-window-configuration org-window-config-before-follow-link)
>  	  (save-excursion (set-buffer b) (goto-char p)
>  	    (bibtex-url)))
> -      (recenter 0)))  ; Move entry start to beginning of window
> +      (recenter 0))  ; Move entry start to beginning of window
>    ;; return t to indicate that the search is done.
> -  t)
> +    t))
>
>  ;; Finally add the functions to the right hooks.
>  (add-hook 'org-create-file-search-functions 
> 'org-create-file-search-in-bibtex)
> @@ -10403,7 +10415,8 @@
>  	(unless x (error "Invalid field specifier \"%s\""
>  			 (match-string 0 form)))
>  	(if (equal x "") (setq x "0"))
> -	(setq form (replace-match (concat "(" x ")") t t form)))
> +	;;(setq form (replace-match (concat "(" x ")") t t form)))
> +	(setq form (replace-match x t t form)))
>        ;; Insert ranges in current column
>        (while (string-match "\\&[-I0-9]+" form)
>  	(setq form (replace-match
> @@ -10411,8 +10424,10 @@
>  		       (org-table-get-vertical-vector (match-string 0 form)
>  						      nil n0))
>  		     t t form)))
> -      (setq ev (calc-eval (cons form modes)
> -			  (if org-table-formula-numbers-only 'num)))
> +      (if (string-match "^'(.*)$" form)
> +	  (setq ev (eval (eval (read form))))
> +	(setq ev (calc-eval (cons form modes)
> +			    (if org-table-formula-numbers-only 'num))))
>
>        (when org-table-formula-debug
>  	(with-output-to-temp-buffer "*Help*"
> @@ -12999,6 +13014,9 @@
>  (define-key org-mode-map "\C-c\C-x\M-w"   'org-copy-special)
>  (define-key org-mode-map "\C-c\C-x\C-y"   'org-paste-special)
>
> +(when (featurep 'xemacs)
> +  (define-key org-mode-map 'button3   'popup-mode-menu))
> +
>  (defsubst org-table-p () (org-at-table-p))
>
>  (defun org-self-insert-command (N)
> @@ -13772,7 +13790,8 @@
>  Only visible heading lines are considered, unless INVISIBLE-OK is 
> non-nil."
>    (if org-noutline-p
>        (outline-back-to-heading invisible-ok)
> -    (if (and (memq (char-before) '(?\n ?\r))
> +    (if (and (or (memq (char-before) '(?\n ?\r))
> +		 (point-min))
>               (looking-at outline-regexp))
>  	t
>        (if (re-search-backward (concat (if invisible-ok 
> "\\([\r\n]\\|^\\)" "^")
> @@ -13899,7 +13918,7 @@
>    (save-excursion
>      (org-back-to-heading t)
>      (outline-flag-region
> -     (1- (point))
> +     (max 1 (1- (point)))
>       (save-excursion
>         (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") 
> nil 'move)
>         (or (match-beginning 1) (point-max)))
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: org-mode + xemacs + patch
       [not found]   ` <7u3bfit8ov.fsf@horizonsemi.com>
@ 2006-05-10 11:50     ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2006-05-10 11:50 UTC (permalink / raw)
  To: Gregory.Chernov; +Cc: emacs-orgmode

Certainly I am interested.  Can you mail it to me, please?


- Carsten

On May 10, 2006, at 13:34, Gregory.Chernov@horizonsemi.com wrote:

> On Wed, 10 May 2006, dominik@science.uva.nl wrote:
>
>>> +  ;; Get rid of Outline menus, they are not needed
>>> +  ;; Need to do this here because define-derived-mode sets up
>>> +  ;; the keymap so late.
>>> +  (if (featurep 'xemacs)
>>> +      (progn
>>> +	(if org-noutline-p
>>
>>
>> Are you trying to tell me that noutline have been ported to
>> XEmacs?????????????
>>
>
> I don't know if there is official xemacs port of noutline, but as i
> started to use org-mode i tried to port and use it. Looks like it
> works ok by now. I can mail/post it if somebody interested.
>
>
>> That would be fantastic, because programming for the old outline
>> mode is a nightmare and org.el would get shorter if I would not need
>> this double code.....
>>
>> - Carsten
>>
>
> Regards,
> Greg
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: org-mode + xemacs + patch
  2006-05-09 14:23 org-mode + xemacs + patch chgreg692000
  2006-05-09 14:58 ` Carsten Dominik
  2006-05-10 10:49 ` Carsten Dominik
@ 2006-05-11  3:58 ` Carsten Dominik
  2006-05-11  8:18   ` chgreg692000
  2 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2006-05-11  3:58 UTC (permalink / raw)
  To: chgreg692000; +Cc: emacs-orgmode

Hi Greg, I have looked at you patch and taken most of it.  However, I 
have a few questions:

>  \\{org-mode-map}"
> +
> +  ;; Get rid of Outline menus, they are not needed
> +  ;; Need to do this here because define-derived-mode sets up
> +  ;; the keymap so late.
> +  (if (featurep 'xemacs)
> +      (progn
> +	(if org-noutline-p
> +	    (progn
> +	      (easy-menu-remove outline-mode-menu-heading)
> +	      (easy-menu-remove outline-mode-menu-show)
> +	      (easy-menu-remove outline-mode-menu-hide))

This assumes that the future port of noutline will use easy-menu for 
its stuff.  OK if you get your version into XEmacs, problematic 
otherwise.  I have taken it anyway, because right now it does not break 
anything.

>  			(get-char-property (1- (point)) 'invisible))
>  	      (beginning-of-line 2)) (setq eol (point)))
>  	  (outline-end-of-heading)   (setq eoh (point))
> -	  (org-end-of-subtree t)     (setq eos (point))
> +	  ;;(org-end-of-subtree t)     (setq eos (point))
> +	  (outline-end-of-subtree)     (setq eos (point))
>  	  (outline-next-heading))

Why is the above change necessary?

>  	(if (equal x "") (setq x "0"))
> -	(setq form (replace-match (concat "(" x ")") t t form)))
> +	;;(setq form (replace-match (concat "(" x ")") t t form)))
> +	(setq form (replace-match x t t form)))

I guess you need this to get the value of variables directly into the 
list form.  I need the parenthesis, because fields in tables can be 
complex expressions, and in an equation precedence rule may pull this 
expression apart, which is not wanted.  We need to do this in a way 
that the parenthesis are only ignored for lisp expressions.

>
> +(when (featurep 'xemacs)
> +  (define-key org-mode-map 'button3   'popup-mode-menu))
> +
>  (defsubst org-table-p () (org-at-table-p))


Any other XEmacs users who object to this change?

> @@ -13772,7 +13790,8 @@
>  Only visible heading lines are considered, unless INVISIBLE-OK is 
> non-nil."
>    (if org-noutline-p
>        (outline-back-to-heading invisible-ok)
> -    (if (and (memq (char-before) '(?\n ?\r))
> +    (if (and (or (memq (char-before) '(?\n ?\r))
> +		 (point-min))
>               (looking-at outline-regexp))
>  	t

This one I don't understand.  Maybe you mean

     (if (and (or (bobp) (memq (char-before) '(?\n ?\r)))

????  Point-min is never nil, it is always just a number.



Thanks.

- Carsten



--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: org-mode + xemacs + patch
  2006-05-11  3:58 ` Carsten Dominik
@ 2006-05-11  8:18   ` chgreg692000
  2006-05-11  9:01     ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: chgreg692000 @ 2006-05-11  8:18 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode


On Thu, 11 May 2006, dominik@science.uva.nl wrote:

> Hi Greg, I have looked at you patch and taken most of it.  However,
> I have a few questions:
> 
>>  \\{org-mode-map}"
>> +
>> +  ;; Get rid of Outline menus, they are not needed
>> +  ;; Need to do this here because define-derived-mode sets up
>> +  ;; the keymap so late.
>> +  (if (featurep 'xemacs)
>> +      (progn
>> +	(if org-noutline-p
>> +	    (progn
>> +	      (easy-menu-remove outline-mode-menu-heading)
>> +	      (easy-menu-remove outline-mode-menu-show)
>> +	      (easy-menu-remove outline-mode-menu-hide))
> 
> This assumes that the future port of noutline will use easy-menu for
> its stuff.  OK if you get your version into XEmacs, problematic
> otherwise.  I have taken it anyway, because right now it does not
> break anything.
> 
>>  			(get-char-property (1- (point)) 'invisible))
>>  	      (beginning-of-line 2)) (setq eol (point)))
>>  	  (outline-end-of-heading)   (setq eoh (point))
>> -	  (org-end-of-subtree t)     (setq eos (point))
>> +	  ;;(org-end-of-subtree t)     (setq eos (point))
>> +	  (outline-end-of-subtree)     (setq eos (point))
>>  	  (outline-next-heading))
> 
> Why is the above change necessary?

Without this change 'org-cycle' gives error when
'org-cycle-include-plain-lists' is t.

> 
>>  	(if (equal x "") (setq x "0"))
>> -	(setq form (replace-match (concat "(" x ")") t t form)))
>> +	;;(setq form (replace-match (concat "(" x ")") t t form)))
>> +	(setq form (replace-match x t t form)))
> 
> I guess you need this to get the value of variables directly into
> the list form.  I need the parenthesis, because fields in tables can
> be complex expressions, and in an equation precedence rule may pull
> this expression apart, which is not wanted.  We need to do this in a
> way that the parenthesis are only ignored for lisp expressions.
> 
>>

I've suspected that you added these parenthesis for some reason, but
because my simple tests worked without them and because parenthesis
used only in row formulas and not used in column formulas i removed
them. I suppose it could be easy to add some if statement that will
ignore parenthesis for elisp only.

>> +(when (featurep 'xemacs)
>> +  (define-key org-mode-map 'button3   'popup-mode-menu))
>> +
>>  (defsubst org-table-p () (org-at-table-p))
> 
> 
> Any other XEmacs users who object to this change?
> 
>> @@ -13772,7 +13790,8 @@
>>  Only visible heading lines are considered, unless INVISIBLE-OK is
>> non-nil."
>>    (if org-noutline-p
>>        (outline-back-to-heading invisible-ok)
>> -    (if (and (memq (char-before) '(?\n ?\r))
>> +    (if (and (or (memq (char-before) '(?\n ?\r))
>> +		 (point-min))
>>               (looking-at outline-regexp))
>>  	t
> 
> This one I don't understand.  Maybe you mean
> 
>     (if (and (or (bobp) (memq (char-before) '(?\n ?\r)))
> 
> ????  Point-min is never nil, it is always just a number.
> 

This is a bug. It should be (bobp). Have no idea why it's worked with
(point-min). 

> 
> 
> Thanks.
> 
> - Carsten

Regards,
Greg

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

* Re: org-mode + xemacs + patch
  2006-05-11  8:18   ` chgreg692000
@ 2006-05-11  9:01     ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2006-05-11  9:01 UTC (permalink / raw)
  To: chgreg692000; +Cc: emacs-orgmode


On May 11, 2006, at 10:18, chgreg692000@yahoo.com wrote:
>>>  			(get-char-property (1- (point)) 'invisible))
>>>  	      (beginning-of-line 2)) (setq eol (point)))
>>>  	  (outline-end-of-heading)   (setq eoh (point))
>>> -	  (org-end-of-subtree t)     (setq eos (point))
>>> +	  ;;(org-end-of-subtree t)     (setq eos (point))
>>> +	  (outline-end-of-subtree)     (setq eos (point))
>>>  	  (outline-next-heading))
>>
>> Why is the above change necessary?
>
> Without this change 'org-cycle' gives error when
> 'org-cycle-include-plain-lists' is t.

This is in the not noutline section of the code, so I guess you fixed 
this before using your new noutline?

Anyway, yes, a bug, I fixed it (in a different way).  Thanks.

I really appreciate that you went through the trouble of actually 
providing a patch.

- Carsten

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

* Re: Re: org-mode + xemacs + patch
  2006-05-10  7:40   ` chgreg692000
@ 2006-05-11  9:44     ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2006-05-11  9:44 UTC (permalink / raw)
  To: chgreg692000; +Cc: emacs-orgmode


On May 10, 2006, at 9:40, chgreg692000@yahoo.com wrote:

> Look at the following example:
>
> |---+-------------------+---------+----------|
> |   | scan              | scan_in | scan_out |
> |   |                   |   witdh |    width |
> |---+-------------------+---------+----------|
> | ! |                   |       0 |        0 |
> | # | "SCAN_IN0[12:0]"  |      13 |        0 |
> | # | "SCAN_IN1[3:0]"   |      17 |        0 |
> | # | "SCAN_OUT0[15:0]" |      17 |       16 |
> | # | "SCAN_IN2[22:0]"  |      40 |       16 |
> | # | "SCAN_OUT1[44:0]" |      40 |       61 |
> | # | "SCAN_IN3[5:0]"   |      46 |       61 |
> |---+-------------------+---------+----------|
> #+TBLFM: $3='(number-to-string (if (string-match 
> "SCAN_IN.*\\[\\([0-9]+\\):\\([0-9]+\\)\\]" $2) (+ (string-to-number 
> (match-string 1 $2)) 1 &1) &1))::$4='(number-to-string (if 
> (string-match "SCAN_OUT.*\\[\\([0-9]+\\):\\([0-9]+\\)\\]" $2) (+ 
> (string-to-number (match-string 1 $2)) 1 &1) &1))
>

OK, I have also taken this part, this is a great new feature for the 
tables.  A few remarks:

- Note that you don't have to use "SCAN_IN3[5:0]" with quotes in the 
table field - you can leave off the quotes here and put them into the 
lisp form, like "$2".
- I am also allowing a lisp form to return a number - number-to-string 
will then be automatically applied.
- Finally, I am also allowing a format after a semicolon, just like in 
calc formulas.  So you can write  '(+ $1 15.3);%10.3f

Thanks again.

- Carsten

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

end of thread, other threads:[~2006-05-11  9:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-09 14:23 org-mode + xemacs + patch chgreg692000
2006-05-09 14:58 ` Carsten Dominik
2006-05-10  7:40   ` chgreg692000
2006-05-11  9:44     ` Carsten Dominik
2006-05-10 10:49 ` Carsten Dominik
     [not found]   ` <7u3bfit8ov.fsf@horizonsemi.com>
2006-05-10 11:50     ` Carsten Dominik
2006-05-11  3:58 ` Carsten Dominik
2006-05-11  8:18   ` chgreg692000
2006-05-11  9:01     ` 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).