From mboxrd@z Thu Jan 1 00:00:00 1970 From: chgreg692000@yahoo.com Subject: org-mode + xemacs + patch Date: Tue, 09 May 2006 17:23:02 +0300 Message-ID: <7uejz3tgzd.fsf@horizonsemi.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FdT7E-0002o6-Lt for emacs-orgmode@gnu.org; Tue, 09 May 2006 10:23:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FdT7C-0002ni-72 for emacs-orgmode@gnu.org; Tue, 09 May 2006 10:23:08 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FdT7B-0002nf-Vw for emacs-orgmode@gnu.org; Tue, 09 May 2006 10:23:06 -0400 Received: from [212.25.79.210] (helo=localhost.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FdT8G-000294-E4 for emacs-orgmode@gnu.org; Tue, 09 May 2006 10:24:12 -0400 Received: from localhost.localdomain (cs-lin-1 [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id k49EN2dE027205 for ; Tue, 9 May 2006 17:23:02 +0300 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=org.xemacs.patch --- 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))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--