[O] how to add font-lock keywords

2011-08-23 Thread Le Wang
Hi all,

I wasn't able to google a clear examples of how to do this.  For
example, I'd like to highlight all text between double-quotes.

-- 
Le



Re: [O] how to add font-lock keywords

2011-08-23 Thread Le Wang
Thanks for the hint, I tried this, but all my beautiful salad bowl
colours went away.

(font-lock-add-keywords 'org-mode '((\\\(\\(?:.\\|\n\\)*?[^\\]\\)\
0 font-lock-string-face)))

Notice that I made a bad attempt to handle escaped quotation mark in
the string.  Does anyone know a better solution to handle escaped
characters in font-lock?

On Wed, Aug 24, 2011 at 9:17 AM, John Wiegley jwieg...@gmail.com wrote:
 John Wiegley jwieg...@gmail.com writes:

 Le Wang l26w...@gmail.com writes:
 I wasn't able to google a clear examples of how to do this.  For example,
 I'd like to highlight all text between double-quotes.

 Typically it looks something like this:

   (font-lock-add-keywords org-mode
 [...]

 Sorry, that should be 'org-mode, to name the symbol, not attempt to use its
 value.

 John






-- 
Le



[O] headline navigation and refiling.

2011-10-05 Thread Le Wang
Hi all,

I like using the org-refile interface to navigate.  It's very
intuitive to me.  But I want to navigate to headlines deeper than my
org-refile-target :max-level.  Is there anything to do other than
rolling my own?  I can see wouldn't be hard.

It feels headline navigation was just bolted onto org-refile.  Should
they really be the same command?

-- 
Le



Re: [O] headline navigation and refiling.

2011-10-05 Thread Le Wang
On Wed, Oct 5, 2011 at 10:31 PM, Carsten Dominik
carsten.domi...@gmail.com wrote:

 On 5.10.2011, at 12:05, Le Wang wrote:

 Hi all,

 I like using the org-refile interface to navigate.  It's very
 intuitive to me.  But I want to navigate to headlines deeper than my
 org-refile-target :max-level.  Is there anything to do other than
 rolling my own?  I can see wouldn't be hard.

 You can write a little wrapper and set a special value for the refile targets:

 (defun my-goto-with-refile ()
  (interactive)
  (let ((org-refile-targets '((nil . (:maxlevel . 10)
    (org-refile t)))

Yes, this is what I had in mind.

 It feels headline navigation was just bolted onto org-refile.

 THis is how this happened, historically.

Okay, that's fine.  But doesn't the fact that a user didn't know he
could navigate with org-refile speak laudly for refactoring it into
its own key-stroke?

The audience of org-mode is growing larger than just emacs hackers or
even emacs users, as I hear of people coming to Emacs just for
org-mode all the time.  So this universal arg bolt-on for such an
important piece of functionality should be up for discussion.

 - Carsten

-- 
Le



Re: [O] headline navigation and refiling.

2011-10-05 Thread Le Wang
On Wed, Oct 5, 2011 at 11:43 PM, Dave Abrahams d...@boostpro.com wrote:

 on Wed Oct 05 2011, Le Wang l26wang-AT-gmail.com wrote:

 But doesn't the fact that a user didn't know he could navigate with
 org-refile speak laudly for refactoring it into its own key-stroke?

 So... is anyone going to clue me in?

So sorry, I thought it was answered.  Use the C-u (universal prefix)
to `org-refile', i.e. C-u C-c C-w.


-- 
Le



[O] org-outline-completion-in-steps

2011-10-07 Thread Le Wang
Hi all,

So I've started Emacs 23.3 with -q option, and I've got an org document
open.  How do I go about completing in steps?

org-outline-path-complete-in-steps is a variable defined in `org.el'.
Its value is t

Documentation:
Non-nil means, complete the outline path in hierarchical steps.
When Org-mode uses the refile interface to select an outline path
(see variable `org-refile-use-outline-path'), the completion of
the path can be done is a single go, or if can be done in steps down
the headline hierarchy.  Going in steps is probably the best if you
do not use a special completion package like `ido' or `icicles'.
However, when using these packages, going in one step can be very
fast, while still showing the whole path to the entry.

You can customize this variable.

Maybe I'm missing something obvious, but it looks like I can only compete
against the top level, and when I press enter, it's selected.

-- 
Le


Re: [O] org-outline-completion-in-steps

2011-10-07 Thread Le Wang
On Fri, Oct 7, 2011 at 5:15 PM, Carsten Dominik
carsten.domi...@gmail.comwrote:

 To get deeper, you need to customize `org-refile-targets'.


What does in-steps mean here?  I thought that I'd have to complete top
level, then complete the next level, etc, etc.

I've evaled

(setq org-refile-targets '((nil :maxlevel . 3)))

Now the targets in the first 3 levels are available but all at once as bare
targets, is this expected?



 - Carsten




-- 
Le


[O] patch to org-refile for more accurate completing-read

2012-01-27 Thread Le Wang
Here: https://gist.github.com/1689071

When we are using using refile as navigation, require must-match regardless
of org-refile-allow-creating-parent-nodes.

-- 
Le


Re: [O] patch to org-refile for more accurate completing-read

2012-01-28 Thread Le Wang
Sure.

On Sat, Jan 28, 2012 at 7:42 AM, Bernt Hansen be...@norang.ca wrote:

 Le Wang l26w...@gmail.com writes:

  Here: https://gist.github.com/1689071
 
  When we are using using refile as navigation, require must-match
  regardless of org-refile-allow-creating-parent-nodes.

 Hi,

 I suggest you post the patch to the mailing list as an attachment so
  1) we can read it inline and comment on it without having to go find
 it on the web
  2) it will get automatically picked up by the patchwork patch tracker
 so it can be easily applied to the source
  3) it will forever be in the mailing list archive

 Regards,
 Bernt




-- 
Le


org.el.diff
Description: Binary data


[Orgmode] importing google docs document into org

2011-02-17 Thread Le Wang
Hi all,

Does anyone have a good workflow for doing this?  I keep a bunch of notes on
google docs with a plain outline structure of using styles Heading 1, etc,
bullets and hyperlinks.  All of this is easily doable in org-mode.  It would
be great if I import them into org.  Now that I find myself editing in Emacs
more and more, the editing features of Google docs just don't cut it any
more.  I'm using Windows with the cygwin tool stack.

As a side note, is there a way to paste rich content (hyperlinks) into emacs
on Windows?  I think an org screen cast where this worked on OS X.

Thanks.

-- 
Le
___
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


Re: [Orgmode] importing google docs document into org

2011-02-17 Thread Le Wang
Thanks.  I just got this working, and it's only imports google docs as text.
 I'm really after some way to import rich format (not so rich, heading tags,
bullets and hyperlinks).

I can get the information out of google docs easily enough as html, pdf,
word, etc.  But how do I get it into org-mode?

On Fri, Feb 18, 2011 at 2:41 AM, Puneeth Chaganti puncha...@gmail.comwrote:

 On Thu, Feb 17, 2011 at 9:13 PM, Le Wang l26w...@gmail.com wrote:
  Hi all,
  Does anyone have a good workflow for doing this?  I keep a bunch of notes
 on
  google docs with a plain outline structure of using styles Heading 1,
 etc,
  bullets and hyperlinks.  All of this is easily doable in org-mode.  It
 would
  be great if I import them into org.  Now that I find myself editing in
 Emacs
  more and more, the editing features of Google docs just don't cut it any
  more.  I'm using Windows with the cygwin tool stack.

 T V Raman's g-client package allows you to edit google docs from with
 in Emacs and it also has support for publishing from org. More
 information is available in this blog-post [0] that I came across.

 HTH,
 Puneeth

 [0]
 http://blog.vivekhaldar.com/post/1649745633/editing-google-docs-in-emacs




-- 
Le
___
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


Re: [Orgmode] importing google docs document into org

2011-02-19 Thread Le Wang
On Fri, Feb 18, 2011 at 8:57 PM, Puneeth Chaganti puncha...@gmail.com
 wrote:

 Actually, if you can describe the problems that you were faced with, I
 would be interested in spending some time and trying to fix those
 problems with Pandoc or atleast report issues and get them fixed. (I
 had contributed the original exporter, though my Haskell knowledge is
 negligible.)


Upon closer inspection of the google docs exported html, it appears that the
problems I had were not pandoc issues but google docs issues.

Thanks again.

-- 
Le
___
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


Re: [O] Release 7.5

2011-03-11 Thread Le Wang
Even though I stay at the shallow end of the org-mode pool, using it mostly
for note taking, I've already noticed some subtle improvements in usability.

My compliments to the chefs.

-- 
Le


[O] `session-jump-to-last-change' and org-mode

2011-03-16 Thread Le Wang
Hi,

One of my favorite key cords is C-xC-/, which is bound to
`session-jump-to-last-change' from session.el (
http://emacs-session.sourceforge.net/).  If I'm editing a large file, it
allows me to revisit all the locations that I've touched.  However, when
the related section is folded in org-mode, the point only moves to the
heading.

How hard would it be to have the section automatically expanded?

-- 
Le


Re: [O] `session-jump-to-last-change' and org-mode

2011-03-16 Thread Le Wang
Yes, I didn't know about `org-reveal'.  That could work.  But how do I
figure out if I need to expand the heading?  The last change could be to a
folded heading itself, in which case, it shouldn't be expanded.

Is there a org-goto-char type of function that always goes to that location
in the buffer, expanding sections along the way?



On Thu, Mar 17, 2011 at 12:13 AM, Samuel Wales samolog...@gmail.com wrote:

 You can defadvice it to do org-reveal in org buffers.

 Or wrap it.

 --
 AIDS 2.0 is here now:

 http://thekafkapandemic.blogspot.com/2010/12/welcome-to-kafka-pandemic-two-forces_9182.html
 I support the Whittemore-Peterson Institute (WPI)
 ===
 I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MRV
 paper.




-- 
Le


Re: [O] `session-jump-to-last-change' and org-mode

2011-03-17 Thread Le Wang
On Thu, Mar 17, 2011 at 12:27 AM, Le Wang l26w...@gmail.com wrote:

 Yes, I didn't know about `org-reveal'.  That could work.  But how do I
 figure out if I need to expand the heading?  The last change could be to a
 folded heading itself, in which case, it shouldn't be expanded.

 Is there a org-goto-char type of function that always goes to that location
 in the buffer, expanding sections along the way?


I've solved it by advising goto-char like so:

(defadvice goto-char (around org-expand activate compile)
  (if (eq major-mode 'org-mode)
  (progn
ad-do-it
(org-reveal)
ad-do-it)
ad-do-it))

Can anyone see any problems with advising such a fundamental function?

-- 
Le


Re: [O] `session-jump-to-last-change' and org-mode

2011-03-17 Thread Le Wang
On Thu, Mar 17, 2011 at 3:02 PM, Carsten Dominik
carsten.domi...@gmail.comwrote:

 (defadvice session-jump-to-last-change (after org-expand activate compile)
  Reveal hidden point after jumping.
  (when (and (eq major-mode 'org-mode)
 (outline-invisible-p))
(org-reveal)))


Thanks Carsten!  That's xactly what I wanted.  I'll coordinate with
session's author to get this change integrated.

-- 
Le


Re: [O] `session-jump-to-last-change' and org-mode

2011-03-17 Thread Le Wang
On Thu, Mar 17, 2011 at 10:27 PM, Nick Dokos nicholas.do...@hp.com wrote:

 Why would you need to coordinate with the session author about advising
 a function? It's your own personal advice and you can do whatever you
 want. Of course, as Carsten pointed out, there is good advice and there
 is bad advice, and you should only give good advice. But you are not
 requesting any changes to the session code. You just stick the advice in
 your .emacs and that's that.

 Am I missing something?


The defadvice is a hack until session can be changed to not need it.  I
assume I won't be the only one to ever find this useful.



-- 
Le


[O] C-0 C-c | throws emacs into infinite loop

2011-03-18 Thread Le Wang
The doc-string of `org-table-convert-region' doesn't specifically address 0
as SEPARATOR, but 0 is an integer.  It shouldn't hang in any case.  When I
C-g out of the loop, my undo limit was exceeded because the line filled with
hundreds of thousands of empty cells.

I think the correct behavior is to convert region into table using 0 spaces
as a separator -- so each character forms its own column.



-- 
Le


Org version 7.5
Emacs 24 Jan 2011 build


Re: [O] C-0 C-c | throws emacs into infinite loop

2011-03-19 Thread Le Wang
On Sat, Mar 19, 2011 at 2:43 PM, Carsten Dominik
carsten.domi...@gmail.comwrote:


 On 18.3.2011, at 15:29, Le Wang wrote:

  The doc-string of `org-table-convert-region' doesn't specifically address
 0 as SEPARATOR, but 0 is an integer.  It shouldn't hang in any case.  When I
 C-g out of the loop, my undo limit was exceeded because the line filled with
 hundreds of thousands of empty cells.
 
  I think the correct behavior is to convert region into table using 0
 spaces as a separator -- so each character forms its own column.

 While this might be nice, it is such a border case that, for now, I have
 only added an
 error message to prevent the converter from going into an infinite loop.

 Or do you have a *really* goo use case for this?


No, I don't have a use case for this.  IMO, a reasonable argument should
result in some reasonable non-surprising behaviour.  We can argue whether 0
is a reasonable argument, though.  I'm okay as long as it doesn't hang.



 - Carsten




-- 
Le


Re: [O] Re: org-src-fontify-natively makes things very, very slow

2011-03-19 Thread Le Wang
On Sun, Mar 20, 2011 at 4:34 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 yes, I used to use yasnippet a lot but I don't any longer.  I am
 actually in confusion as to which completion mechanism to use in Emacs
 these days and am going a little crazy... :(  I'm currently playing with
 auto-complete.

Why did you give up on yasnippet?


-- 
Le



Re: [O] Re: org-src-fontify-natively makes things very, very slow

2011-03-20 Thread Le Wang
On Mon, Mar 21, 2011 at 3:41 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 Le Wang l26w...@gmail.com writes:

 Why did you give up on yasnippet?

 Confusion amongst the key bindings, between org, yasnippet and the
 autocompletion tools I have been trying.  I want to be able to use TAB
 for completion.

 I may come back to yasnippet in due course so it's nothing to do with
 yasnippet per se.

I too had this issue of expansion confusion, especially when I
installed the premade yasnippet packs.

I solved it by adding moving yasnippet off the [tab] key, and adding
it to hippie-expand, which I map to (M-/):

(setq yas/trigger-key nil)
(add-to-list 'hippie-expand-try-functions-list 'yas/hippie-try-expand)


 --
 : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
 : using Org-mode version 7.5 (release_7.5.90.g1fb3.dirty)




-- 
Le



[O] Re: BUG: time entry window scrollbar always scrolls right

2011-03-20 Thread Le Wang
On Mon, Mar 21, 2011 at 6:19 AM, Bernt Hansen be...@norang.ca wrote:
 Le Wang l26w...@gmail.com writes:

 In the time entry prompt C-c !, when I press the up or down on the
 scroll-bar right scroll happens.

 Hi,

 I can reproduce this (after enabling the scroll bar which is normally
 off in my setup).  It seems scrolling always moves forwards in time.

 This may be a bug in the calendar code and not org-mode.  I can
 reproduce the same behaviour with

 M-x calendar

I filed an Emacs bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8305


-- 
Le



[O] Using org-mode for recipes (i.e. cooking)

2011-03-24 Thread Le Wang
Hi all,

I'm fairly new to org-mode, and I only use it as an outliner / note
taking tool.  It seems recipes, being a list of ingredients and a
series of steps is a perfect match for org-mode.

Out of the box, org already works pretty well for recipes, but I think
there are some areas for improved integration around timers.  I'm not
familiar with all the facilities of org-mode, maybe someone who uses
org-mode for scientific experiments or something similar will have
some hints.

Is it possible to inline count-down timers in a cooking step?  For
example 2. simmer sauce for 40 minutes on low heat.
start_timer_button, so there is a button at the end of the line
that starts a count-down timer.

Many timers from different steps can be started simultaneously, and
each timer should be able to be paused and restarted.  And there
should be an easy way to get an overview of of all ongoing timers from
the current document.

Is it possible to hack this together using existing org functionality?

Thanks.

-- 
Le



Re: [O] `session-jump-to-last-change' and org-mode

2011-04-12 Thread Le Wang
On Fri, Mar 18, 2011 at 4:13 AM, Carsten Dominik
carsten.domi...@gmail.com wrote:
 A good solution would be for session to provide a hook that we can use.

Christoph has submitted version 2.3a of session
http://sourceforge.net/projects/emacs-session/files/session/

The required hook has been added, maybe someone who knows org-mode can
add it to the appropriate file?

From my .emacs:

(add-hook 'session-after-jump-to-last-change-hook
  (lambda ()
(when (and (eq major-mode 'org-mode)
   (outline-invisible-p))
  (org-reveal


-- 
Le



[O] org-contacts and birthdays without year

2011-05-17 Thread Le Wang
Hi Julien,

I'm just starting with org-contacts, and my first step was translating
my %%(diary-anniversary... entries into contacts.  Maybe you can help
me with these issues.

It seems that an EMAIL property indicates the current heading is a
contact.  How can I store contacts that I don't have an e-mail for?
Again, this relates to my current task, so maybe a BIRTHDAY property
can also be made to indicate a contact?

Is it possible to specify birthdays without year?  I often want to jot
down someone's birthday so I'm not surprised next year, but don't want
to ask them how old they are.  :)


Thanks.

-- 
Le



Re: [O] org-contacts and birthdays without year

2011-05-18 Thread Le Wang
On Wed, May 18, 2011 at 12:00 AM, Julien Danjou jul...@danjou.info wrote:
 You change that rule. It's a defcustom, simply set it to be there's an
 EMAIL or a BIRTHDAY.

You mean `org-contacts-matcher'?  How does org-make-tags-matcher work?
 After googling and looking during some cursory investigation, it's
still not clear to me how to match EMAIL or BIRTHDAY.

 Is it possible to specify birthdays without year?  I often want to jot
 down someone's birthday so I'm not surprised next year, but don't want
 to ask them how old they are.  :)

 Not really :(

Fair enough.  I'll use 1900 as a place holder for now.

On a separate note, the capture example on the org-contacts website
(http://julien.danjou.info/org-contacts.html) breaks without gnus,
Others were bitten by this
http://lists.gnu.org/archive/html/emacs-orgmode/2011-04/msg00079.html.
 Maybe this can be fixed?


-- 
Le



Re: [O] org-contacts and birthdays without year

2011-05-19 Thread Le Wang
On Thu, May 19, 2011 at 1:46 PM, Le Wang l26w...@gmail.com wrote:
 You mean `org-contacts-matcher'?  How does org-make-tags-matcher work?
  After googling and looking during some cursory investigation, it's
 still not clear to me how to match EMAIL or BIRTHDAY.

Found the tags and properties matcher section in manual:
http://orgmode.org/manual/Matching-tags-and-properties.html

What I needed was: (setq org-contacts-matcher
EMAIL\\|BIRTHDAY\\|PHONE\\)


-- 
Le



Re: [O] org-contacts and dates before 1970

2011-05-22 Thread Le Wang
On Thu, May 19, 2011 at 1:46 PM, Le Wang l26w...@gmail.com wrote:
 Is it possible to specify birthdays without year?  I often want to jot
 down someone's birthday so I'm not surprised next year, but don't want
 to ask them how old they are.  :)

 Not really :(

 Fair enough.  I'll use 1900 as a place holder for now.

I'm seeing another issue now, where if any org contact has a birthday
pre 1970, I get the error Bad sexp at line xxx   Does this work
for anyone else?

I'm on Windows 7 runing native build of Emacs CVS and 23.2.1.  My
org-mode is less than a week old.

-- 
Le



Re: [O] org-contacts and dates before 1970

2011-05-23 Thread Le Wang
On Mon, May 23, 2011 at 2:03 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 Le Wang l26w...@gmail.com writes:

 On Thu, May 19, 2011 at 1:46 PM, Le Wang l26w...@gmail.com wrote:
 Is it possible to specify birthdays without year?  I often want to jot
 down someone's birthday so I'm not surprised next year, but don't want

 to ask them how old they are.  :)

 Not really :(

 Fair enough.  I'll use 1900 as a place holder for now.

 I'm seeing another issue now, where if any org contact has a birthday
 pre 1970, I get the error Bad sexp at line xxx   Does this work
 for anyone else?

 I'm on Windows 7 runing native build of Emacs CVS and 23.2.1.  My
 org-mode is less than a week old.

 This is probably related to the same problem as discussed in this
 thread:

 http://thread.gmane.org/gmane.emacs.orgmode/39206

 on the limitations of unix time (whether on Unix or not...).

Thanks for the pointer, Eric.  Most of that thread was over my head.
AFAIK, there is no 64 bit version of Emacs on Windows, so I guess I'm
SOL.

Just to clarify, diary-anniversary worked fine for my birthdays
pre-1970, but org-contacts can't?

-- 
Le



[O] bug: org-sort-list, `f'

2011-05-25 Thread Le Wang
patch fixes sorting lists with custom getkey-func.  Bug was trying to
evaluate getkey-func while setting it, so it was always nil.

-- 
Le


org-list.el.diff
Description: Binary data


[O] BUG: setting comment-use-syntax to nil causes problems in Emacs head

2012-10-06 Thread Le Wang
This value was changed from the default of 'undecided to nil in 4d00c5bf4 .

In turn, it exposes bug in Emacs HEAD, see:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12583

Is there a compelling reason for this change?

-- 
Le



[O] [patch] fix bug introduced in commit aba9e2b9

2012-10-28 Thread Le Wang
This commit broke editing any source section with blank lines.

Patch included.

-- 
Le


org-src.el.diff
Description: Binary data


[O] [PATCH] org-edit-special too much space if starting with empty block

2012-11-05 Thread Le Wang
Some tests:

Case 1:

Start with emacs -Q

I insert


#+begin_src javascript
#+end_src


with point before #+end_src, I press  C-c '  to start editing the source

I enter foobar into the source buffer and immediately exit with  C-c ' 

Case 2:

restart with


#+begin_src javascript

#+end_src


I've included a patch that fixes both issues.

-- 
Le


org-src.el.3.diff
Description: Binary data


Re: [O] [PATCH] org-edit-special too much space if starting with empty block

2012-11-08 Thread Le Wang
Can someone take a look at these test cases and if this patch or some
other fixes is appropriate?

I use org-mode to take lots of notes of source code and this is annoying.

On Mon, Nov 5, 2012 at 10:31 PM, Le Wang l26w...@gmail.com wrote:
 Some tests:

 Case 1:

 Start with emacs -Q

 I insert

 
 #+begin_src javascript
 #+end_src
 

 with point before #+end_src, I press  C-c '  to start editing the source

 I enter foobar into the source buffer and immediately exit with  C-c ' 

 Case 2:

 restart with

 
 #+begin_src javascript

 #+end_src
 

 I've included a patch that fixes both issues.

 --
 Le



-- 
Le



Re: [O] [PATCH] org-edit-special too much space if starting with empty block

2012-11-17 Thread Le Wang
On Fri, Nov 9, 2012 at 8:23 AM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Thank you for your patch.

 Would you mind adding comments in the function in order to explain the
 need for two pass. Also, you may want to reverse the if test in order to
 get rid of the progn.

I've refactored and added comments.

 Finally, could you provide the patch as git format-patch and add
 a changelog entry to it?

The patch is now in the requested format.  If the commit message and
inlined comments still aren't enough to explain the changes, please
let me know.

Thanks!


-- 
Le


org-src.el.patch
Description: Binary data


Re: [O] source code disappears

2012-11-17 Thread Le Wang
Hi all,

This is what my patch
http://www.mail-archive.com/emacs-orgmode@gnu.org/msg62256.html is
meant to fix. @Neil, can you confirm the fix?

On Sat, Nov 17, 2012 at 8:41 PM, Bastien b...@altern.org wrote:
 I will take care of this before the end of the pretest week.



-- 
Le



Re: [O] [PATCH] org-edit-special too much space if starting with empty block

2012-11-23 Thread Le Wang
Has anyone had a chance to check this out?  Others have run into this problem.

On Sun, Nov 18, 2012 at 1:49 PM, Le Wang l26w...@gmail.com wrote:
 On Fri, Nov 9, 2012 at 8:23 AM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Thank you for your patch.

 Would you mind adding comments in the function in order to explain the
 need for two pass. Also, you may want to reverse the if test in order to
 get rid of the progn.

 I've refactored and added comments.

 Finally, could you provide the patch as git format-patch and add
 a changelog entry to it?

 The patch is now in the requested format.  If the commit message and
 inlined comments still aren't enough to explain the changes, please
 let me know.

 Thanks!


 --
 Le



-- 
Le



Re: [O] [PATCH] org-edit-special too much space if starting with empty block

2012-12-13 Thread Le Wang
On Fri, Nov 30, 2012 at 9:23 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 I've pushed your changes. Thank you.

 Btw, have you signed the FSF papers for larger patches?


Thanks Nicolas.  I have signed assignment papers for Emacs.


-- 
Le



Re: [O] bug#12905: 24.2.50; org: edit source block causes data loss

2012-12-13 Thread Le Wang
On Thu, Dec 13, 2012 at 9:42 PM, Bernt Hansen be...@norang.ca wrote:
 I'll try this patch and report back later today.

That commit was from me, and I did not test against Emacs  24.2.  I
will submit another patch to add some tests.  Do tests get
automatically run on some kind of Travis CI setup?

In the mean time, I think my included patch (logic identically to
Bastien's) is more lisp-ly.


-- 
Le


org-src.el.le.patch
Description: Binary data


Re: [O] [PATCH] org-edit-special too much space if starting with empty block

2012-12-13 Thread Le Wang
On Thu, Dec 13, 2012 at 11:15 PM, Bastien b...@altern.org wrote:
 Nicolas Goaziou n.goaz...@gmail.com writes:

 Le Wang l26w...@gmail.com writes:

 Thanks Nicolas.  I have signed assignment papers for Emacs.

 Great. I have added you to the list of contributors, in Worg.

 Note: I did not received confirmation from the FSF yet.
 Le, did you receive it?   To be on the safe side, I try
 to add people on this list only with the FSF copyright
 clerk confirm the author status.  Just double-checking.

I'm not sure how to check, but I signed it and sent it back a while
ago and got a confirmation e-mail from Donald on Aug 9.  AFAIK
everything is sorted.


-- 
Le



Re: [O] bug#12905: 24.2.50; org: edit source block causes data loss

2012-12-13 Thread Le Wang
On Thu, Dec 13, 2012 at 11:17 PM, Bastien b...@altern.org wrote:
 Hi Le,

 No we don't.  If anyone knows how to set this up for our needs,
 please share.

I've only done this for projects hosted on github, others may have
more experience.  But having a continuous integration service is
definitely helpful.  For example, there were 10 failures when I ran
tests against master just now:

10 unexpected results:
   FAILED  ob-exp/exports-inline
   FAILED  ob-exp/noweb-strip-export-ensure-strips
   FAILED  test-ob/org-babel-remove-result--results-default
   FAILED  test-ob/org-babel-results-indented-wrap
   FAILED  test-org-babel/combining-scalar-and-raw-result-types
   FAILED  test-org-babel/inline-src-blocks
   FAILED  test-org-babel/inline-src_blk-default-results-replace-line-1
   FAILED  test-org-babel/just-one-results-block
   FAILED  test-org-babel/nested-code-block
   FAILED  test-org-babel/partial-nested-code-block

I haven't investigated further though.

 Whatever works -- we first need to make sure this fixes it and try
 to understand why ;)

I can confirm that copy-marker does not work as I've used it on Emacs 23.3.1.

 Thanks for taking care of this,

You're welcome.

I've attached 3 patches to fix this and another bug I found while writing tests.

-- 
Le


0001-don-t-use-copy-marker-nil-t-for-Emacs-23-compat.patch
Description: Binary data


0002-fix-org-edit-src-code-invoked-outside-src-block.patch
Description: Binary data


0003-add-tests-for-org-src-edit.patch
Description: Binary data


Re: [O] [PATCH] org-edit-special too much space if starting with empty block

2012-12-13 Thread Le Wang
On Fri, Dec 14, 2012 at 2:09 AM, Achim Gratz strom...@nexgo.de wrote:
 Le Wang writes:
 I'm not sure how to check, but I signed it and sent it back a while
 ago and got a confirmation e-mail from Donald on Aug 9.  AFAIK
 everything is sorted.

 Did you just get a confirmation of receipt or a confirmation of the
 papers having been signed and accepted?  If the latter, that email
 should have had a scan of those papers added as a PDF attachment.

I have a signed and accepted PDF.  Do you want me to do something with it?


-- 
Le



Re: [O] bug#12905: 24.2.50; org: edit source block causes data loss

2012-12-13 Thread Le Wang
On Fri, Dec 14, 2012 at 12:25 AM, Bastien b...@altern.org wrote:
 I superseded the first one with my patch, and just applied the
 third one.

 Can you explain the bug behind the second one?


If I press C-' before on a line BEFORE +begin_src ..., then doing
comparison with = with beg==nil and end==nil causes
wrong-type-argument error.

test-org-src/point-outside-block test case should fail, but because
wrong-type-argument is also an error, it is passing.  :(

I've changed (error ... to raise an org-src specific error to
facilitate testing.  Commits rebased to master are attached.

A note:

I did change this line:

(end (copy-marker (make-marker) t))

(make-marker) makes a temporary new marker that's never used.  ;)


-- 
Le


0001-don-t-use-copy-marker-nil-t-for-Emacs-23-compat.patch
Description: Binary data


0002-fix-org-edit-src-code-invoked-outside-src-block.patch
Description: Binary data


0003-test-org-src-checks-for-org-src-generated-error.patch
Description: Binary data


0004-add-org-src-error-error-condition.patch
Description: Binary data


0005-remove-extraneous-if-condition.patch
Description: Binary data


Re: [O] bug#12905: 24.2.50; org: edit source block causes data loss

2012-12-13 Thread Le Wang
... one more to fix misuse of signal

-- 
Le


0006-fix-mix-use-of-signal.patch
Description: Binary data


Re: [O] bug#12905: 24.2.50; org: edit source block causes data loss

2012-12-14 Thread Le Wang
On Fri, Dec 14, 2012 at 8:04 AM, Bernt Hansen be...@norang.ca wrote:
 I get the following error when doing C-c ' in a table

 --8---cut here---start-8---
 Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
   org-edit-src-code()
   org-edit-special()
   call-interactively(org-edit-special nil nil)
 --8---cut here---end---8---

I have repro of the issue.  I didn't take into account the full usage
org-edit-special.  I'll redo this with new tests within the next few
hours.

-- 
Le



Re: [O] bug#12905: 24.2.50; org: edit source block causes data loss

2012-12-16 Thread Le Wang
On Fri, Dec 14, 2012 at 5:39 PM, Bastien b...@altern.org wrote:
 Le Wang l26w...@gmail.com writes:

;; Move marker with inserted text for case when src block is
;; just one empty line, i.e. beg == end.
 -  (end (copy-marker (make-marker) t))
 +  (end (let ((marker (make-marker)))
 + (set-marker-insertion-type marker t)
 + marker))

 There is a (make-marker) in both case, the first one is okay.

Well in the first case two marker are made (make-marker, then
copy-marker), in the second one is made, IIUC of course; but it's not
a big deal.

I just had a chance to catch up on your changes.  Tests pass fine now
without structured error handling.  So I'm happy with the state of
things.


Thanks.

-- 
Le



[O] [PATCH] exiting source block edit without change should not change buffer-modified sttatus

2013-01-12 Thread Le Wang
Currently when I press C-c ', and immediately exit with C-c ', the
org buffer's modified flag is set, even though I didn't change
anything.

Code changes with testcases included.  I'm not sure if this can be
made generic for other types of special edit.

-- 
Le


0001-add-tests-for-round-trip-source-block-without-change.patch
Description: Binary data


0002-Fix-unmodified-source-blocking-editing-setting-buffe.patch
Description: Binary data


[O] using org-edit-special to edit javascript embeded in HTML

2012-02-05 Thread Le Wang
Hi,

I would like to use C-c ' to edit the current script tag contents in
another buffer in js2-mode like `org-edit-special', is this possible?
Maybe someone has done something similar in another context?

-- 
Le


Re: [O] using org-edit-special to edit javascript embeded in HTML

2012-02-13 Thread Le Wang
Hmmm.  I feel someone must have done this for HTML or some templating
language.  So no sample code for me to start investigating?

On Sun, Feb 5, 2012 at 5:09 PM, Le Wang l26w...@gmail.com wrote:

 Hi,

 I would like to use C-c ' to edit the current script tag contents in
 another buffer in js2-mode like `org-edit-special', is this possible?
 Maybe someone has done something similar in another context?

 --
 Le




-- 
Le


[O] org-edit-special is available to other buffers

2012-02-23 Thread Le Wang
Hi,

I asked about this a while ago on this list, but no one seemed interested.
So I've gone ahead and implemented this myself.

https://github.com/lewang/generic-edit-special

This allows you to define beginning/ending regexps with corresponding
language, and edit the region in between just like org-edit-special.
Currently, I use it for HTML/css/javascript/rails.

Any comments/bug reports welcome.

Cheers.

-- 
Le