From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Garreau\, Alexandre" Subject: org-email-link-description-format (Was: Re: org-store/insert-link truncating the full subject of mails) Date: Sun, 28 Oct 2018 20:23:58 +0100 Message-ID: <87y3ah7u41.fsf_-_@portable.galex-713.eu> References: <875zxpi8bn.fsf@portable.galex-713.eu> <87k1m4g1qk.fsf@nicolasgoaziou.fr> <87woq4pveb.fsf@portable.galex-713.eu> <874ld8fpqf.fsf@nicolasgoaziou.fr> <87in1ojntq.fsf@aminb.org> <87zhuzd9ih.fsf@nicolasgoaziou.fr> <871s8a6uau.fsf@aminb.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGqfK-0006ym-O6 for emacs-orgmode@gnu.org; Sun, 28 Oct 2018 15:24:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGqfJ-0007Bb-JD for emacs-orgmode@gnu.org; Sun, 28 Oct 2018 15:24:02 -0400 In-Reply-To: <871s8a6uau.fsf@aminb.org> (Amin Bandali's message of "Sun, 28 Oct 2018 10:05:13 -0400") 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" To: Amin Bandali Cc: emacs-org list , Nicolas Goaziou On 2018-10-28 at 10:05, Amin Bandali wrote: > That said, I still find the default a bit obtuse and frankly > unexpected. I don=E2=80=99t know, maybe a nice middle ground between the > current behaviour and completely removing the limit would be to > increase the limit from 30 to 78 characters, the recommended > maximum number of characters in a line according to RFC 2822 [0]. > That somehow feels less arbitrary, and would cover a larger > portion of subjects. > > [0]: https://tools.ietf.org/html/rfc2822#section-2.1.1 Okay, so I did not read carefully enough: this is a per line limit, however Gnus already include this limitation in fill-column so that to fold subject line in several lines that will be no more than 78 characters, there=E2=80=99s no need to limit to 78 characters, and indeed I sometimes end with subject lines of more than one line, and wouldn=E2=80=99t like to see my normal subject line truncated. The same way, org-mode will naturally see its paragraphs filled if wanted by the user (otherise there are no problems in long lines, except, afaik, by default, it disable truncating lines). On 2018-10-28 at 18:01, Garreau, Alexandre wrote: > Rather cutting it, I=E2=80=99d rather try to find the gnus function that = cut > subject lines so it does more semantically (like, removing the entire > Was: part if it doesn=E2=80=99t fit, rather than cutting it in the middle= ), but > 78 seems totally more reasonable, at worse, indeed: but maybe that > aforementioned gnus function does something related to it (maybe it does > cut when it exceed 78 chars?)? > > However I was unable to find it by el-searching for "was:?", so I=E2=80= =99ll ask > them directly, hoping they know and answer. So the function I was searching is `message-strip-subject-trailing-was', and only strip the was part, it doesn=E2=80=99t conditionally strip =E2=80= =9CWas=E2=80=9D if there were several, or if the subject line was too long. Yet it can be used for org-mode as the =E2=80=9CWas:=E2=80=9D trailing part is likely not= to be interesting at all for refering to a particular message, as anyway it will be found again when visiting the said article. What=E2=80=99s more interesting is it=E2=80=99s used in a function `message-simplify-subject', calling a customizable list of functions (`message-simplify-subject-functions'), that will simplify deeply the subject, removing also the =E2=80=9CRe:=E2=80=9D, the mailing-list part, en= coded parts, etc. Yet, as it currently only used for replying, it seems to, wrongly imo, add a =E2=80=9CRe:=E2=80=9D to the subject line (while this should be = its scope, imo). So this one is not usable as is. But `message-strip-subject-re' might be used per se itself, otherwise, as it seems to me the =E2=80=9CRe:=E2=80=9D might not be interesting as wel= l, though mailing-list part may be useful, as in `org-email-link-description-format' there is nothing to refer to the group (either the group name in gnus, or either content of =E2=80=9CNewsgro= ups=E2=80=9D header or mailing-list (content of =E2=80=9CList-id=E2=80=9D or =E2=80=9CLi= st-post=E2=80=9D, either address or human-readable part)), but not all mailing-list embed one, so it might bring inconsistency, and adding a said new format-specifier to `org-email-link-description-format' seems to me preferable (why not =E2=80= =9C%g=E2=80=9D for =E2=80=9Cgroup=E2=80=9D?). So may I suggest to change `org-email-link-description' and update `org-email-link-description-format', so that to support a "%g" specifier, to refer to the content of :group (or should we add something to refer List-ID/List-Post?), and a %S that=E2=80=99d return the subject, simplified by `message-strip-subject-trailing-was', `message-strip-subject-trailing-re', or, maybe rather, by all the functions inside `message-simplify-subject-functions' (waiting for `message-simplify-subject' to be corrected).