From mboxrd@z Thu Jan 1 00:00:00 1970 From: Titus von der Malsburg Subject: Re: A Microsoftesque detail in org Date: Sat, 16 May 2015 10:26:00 -0700 Message-ID: <87vbfs4eon.fsf@posteo.de> References: <87382yji8z.fsf@iki.fi> <87lhgqxeq0.fsf@gmx.us> <87k2w99cc0.fsf@nicolasgoaziou.fr> <87mw14h788.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtfrM-00026S-Hc for emacs-orgmode@gnu.org; Sat, 16 May 2015 13:26:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtfrH-00024v-HH for emacs-orgmode@gnu.org; Sat, 16 May 2015 13:26:48 -0400 Received: from mx02.posteo.de ([89.146.194.165]:59560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtfrH-00023Y-7M for emacs-orgmode@gnu.org; Sat, 16 May 2015 13:26:43 -0400 In-reply-to: <87mw14h788.fsf@gmx.us> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Rasmus, just tried the patch and while I still find it weird to change the meaning of RET, this solution doesn=E2=80=99t 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 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.=20 >> >> 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) >>> + (>=3D (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 >>=20=20=20 >> If you add this feature, please augment `test-org/return' from >> "test-org.el" accordingly. > > Done and and attached. > > Anybody against pushing this? > > =E2=80=94Rasmus --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVV32pAAoJEK40WfPGE2idJjUH/iM0VXuY05ynFlY+xd5h6mWC P+51SJRrn2Rz4ijttlzH24lRSZjXthuwL6aApZT+goXO+xms4zK5WGRRi9cmrLYk EbvmUFefxHVagJl5zzSjHWPt36itVsNTUfQHMKPnr4sMKCExvaLrEEUhmjsvu+NP KNXaj5VsoRML11ZIVf4DTIDfX3KALDDqtp9TbR+SCU/aSkHt0/H9guTVLfd51hIo S0FQhm1UUWSDvMyJDHla+/BF/Kh/lfk+DohZliBLPg/6RXA2pL85DVXK48mWZH68 AiGXGyyG2CUylzmIdWXwMhWQNJVqhzX1XxGBXbmMeSvEwQ2Q58xYJrPWbqQo6JI= =f1qd -----END PGP SIGNATURE----- --=-=-=--