emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Charles Sebold <csebold@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Org-mode version 6.32trans (release_6.32b.190.g1818); LAST_MOBILE_CHANGE line bumps local variable line
Date: Fri, 13 Nov 2009 00:51:49 +0100	[thread overview]
Message-ID: <58121DF2-2300-4E5F-9E75-5273E095FA02@gmail.com> (raw)
In-Reply-To: <87hbsz8x01.fsf@zancanda.staticcling.org>

Hi Charles,

good catch, thank you!

- Carsten

On Nov 12, 2009, at 6:28 PM, Charles Sebold wrote:

> In org-mobile-timestamp-buffer(), it tries to insert the
> LAST_MOBILE_CHANGE timestamp on the first line if there isn't already
> one.
>
> I think this should check first to see if the first line has local
> variables, for example:
>
> # -*- mode: org; coding: utf-8; -*-
>
> ...and it should skip past that line if it's there.  Any chance of
> changing that?
>
> (The workaround for the moment is to make sure that there is always a
> timestamp line present already, and that's fine, but this could  
> surprise
> somebody who wasn't expecting it - like me, until I tracked this  
> down.)
>
> Maybe it could be something like:
>
> --- a/lisp/org-mobile.el
> +++ b/lisp/org-mobile.el
> @@ -738,10 +738,13 @@ If BEG and END are given, only do this in that
> region."
>       (save-restriction
>       (widen)
>       (goto-char (point-min))
> -      (when (re-search-forward
> +      (if (re-search-forward
>              "^\\([ \t]*\\)#\\+LAST_MOBILE_CHANGE:.*\n?" nil t)
> -               (goto-char (match-end 1))
> -                 (delete-region (point) (match-end 0)))
> +                     (progn
> +              (goto-char (match-end 1))
> +                    (delete-region (point) (match-end 0)))
> +          (if (looking-at ".*-\\*-.*-\\*-")
> +              (forward-line 1)))
>               (insert "#+LAST_MOBILE_CHANGE: "
>                       (format-time-string "%Y-%m-%d %T") "\n")))))
>
> Emacs  : GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
> of 2009-11-11 on CT-SEBOLDCR-T4C
> Package: Org-mode version 6.32trans (release_6.32b.190.g1818)
> -- 
> Charles Sebold
> http://merbc.invigorated.org/
> http://triablogue.blogspot.com/
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

      reply	other threads:[~2009-11-12 23:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12 17:28 Org-mode version 6.32trans (release_6.32b.190.g1818); LAST_MOBILE_CHANGE line bumps local variable line Charles Sebold
2009-11-12 23:51 ` Carsten Dominik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58121DF2-2300-4E5F-9E75-5273E095FA02@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=csebold@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).