emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Titus von der Malsburg <malsburg@posteo.de>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: A Microsoftesque detail in org
Date: Sat, 16 May 2015 10:26:00 -0700	[thread overview]
Message-ID: <87vbfs4eon.fsf@posteo.de> (raw)
In-Reply-To: <87mw14h788.fsf@gmx.us>

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


Hi Rasmus,

just tried the patch and while I still find it weird to change the
meaning of RET, this solution doesn’t get in my way as much as the
previous solution did.

One minor cosmetic issue:

* TODO foo bar 						       :test:

When I RET between foo and bar, the tag moves to the left.  I think it
would be nicer if it would stay where it was.

  Titus


On 2015-05-16 Sat 08:28, Rasmus wrote:
> Hi,
>
> Thanks for the comments.
>
> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>
>> "RET breaks headline text" may be more accurate.
>
> OK.
>
>>> +  (let* ((context (if org-return-follows-link (org-element-context)
>>> +		    (org-element-at-point)))
>>> +	 (type (org-element-type context)))
>>> +    (cond
>>> +     ;; At a headline
>>> +     ((and (eq type 'headline) (not (bolp)))
>>
>> You are removing an optimization here. 
>>
>> Checking if point is on a headline/inlinetask doesn't require to use
>> `org-element-at-point'/`org-element-context'. It is faster to simply
>> check for `org-outline-regexp' (or derived) at bol.
>>
>> This optimization is less important than it used to be, now that
>> properties drawers are at a fixed location. Nevertheless, it might be
>> worth keeping it in mind.
>
> I did it 'cause it's easier, I think, to read a single cond than first an
> if and then a cond.  The latter also seems easier to fix in the future.
>
>>> +      (org-show-entry)
>>> +      (let ((string ""))
>>> +	(unless (and (save-excursion
>>> +		       (beginning-of-line)
>>> +		       (looking-at org-complex-heading-regexp))
>>> +		     (or (and (match-beginning 3)
>>> +			      (< (point)
>>> +				 (save-excursion
>>> +				   (goto-char (match-beginning 4))
>>> +				   (skip-chars-backward " \t")
>>> +				   (point))))
>>> +			 (and (match-beginning 5)
>>> +			      (>= (point) (match-beginning 5)))))
>>> +	    ;; Point is on headline keywords, tags or cookies.  Do not break
>>> +	    ;; them: add a newline after the headline instead.
>>> +	  (setq string (delete-and-extract-region
>>> +			(point) (or (match-beginning 5)
>>> +				    (line-end-position))))
>>
>> The `setq' is not necessary here. Bind it within `let' instead.
>
> You are right.
>
>>> +	  (when (match-beginning 5)
>>> +	    (insert (make-string (length string) ?\ ))))
>>
>>   ?\  -> ?\s
>>   
>> If you add this feature, please augment `test-org/return' from
>> "test-org.el" accordingly.
>
> Done and and attached.
>
> Anybody against pushing this?
>
> —Rasmus


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2015-05-16 17:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15  9:35 A Microsoftesque detail in org Jarmo Hurri
2015-05-15  9:57 ` Rainer M Krug
2015-05-15 11:16 ` Doug Lewan
2015-05-15 11:27 ` Rasmus
2015-05-16  8:05   ` Nicolas Goaziou
2015-05-16 15:28     ` Rasmus
2015-05-16 17:26       ` Titus von der Malsburg [this message]
2015-05-16 19:00         ` Rasmus
2015-05-16 21:43           ` Titus von der Malsburg
2015-05-17 13:25         ` Rasmus
2015-05-17 20:24   ` Jarmo Hurri
2015-05-17 21:15     ` Rasmus
2015-05-18  0:39       ` Titus von der Malsburg
2015-05-18  3:40         ` Thomas S. Dye
2015-05-18 12:15         ` Jarmo Hurri
2015-05-18  8:33       ` Brett Witty
2015-05-18  9:02         ` Rainer M Krug
2015-05-18  9:48           ` Rasmus
2015-05-18 11:29             ` Rainer M Krug
2015-05-18 13:07         ` William Denton
2015-05-18 14:37         ` Suvayu Ali
2015-05-18 15:39           ` Rasmus
2015-05-19  9:39             ` Suvayu Ali
2015-05-20 23:04   ` Rasmus
2015-05-15 19:29 ` Titus von der Malsburg
2015-05-15 20:27   ` Thomas S. Dye
2015-05-16  3:43     ` Bob Newell

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=87vbfs4eon.fsf@posteo.de \
    --to=malsburg@posteo.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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).