From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [POLL] Should Org tempo be enabled by default? (expand templates thru e.g. " References: <87lgd671k7.fsf@bzg.fr> <87o9i2p9qq.fsf@nicolasgoaziou.fr> <87k1sq6znz.fsf@bzg.fr> <871seyp6fr.fsf@nicolasgoaziou.fr> <874lju6tap.fsf@bzg.fr> <87bme1y7ft.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDXWr-0004bO-6r for emacs-orgmode@gnu.org; Tue, 01 May 2018 11:49:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDXWp-0002S8-OC for emacs-orgmode@gnu.org; Tue, 01 May 2018 11:49:21 -0400 In-Reply-To: <87bme1y7ft.fsf@gmail.com> 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: Tim Cross , Bastien Cc: emacs-orgmode@gnu.org, Rasmus , Nicolas Goaziou --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 2018ko apirilak 29an, Tim Cross-ek idatzi zuen: [...] > I think org itself should provide a very stable core and avoid > incorporating too many add on enhancements. It should be as stable as > possible to encourage others to develop and maintain such enhancements > and extensions.=20 As someone who has worked (in a small way) on org=CA=BCs development, I certainly agree with the above sentiment. Org is a many-headed hydra, and decreasing its surface area makes for a better org (since development efforts can be concentrated) as well as a better overall user experience (because users can rely on packages, like in this case yasnippet, that are better at doing something that Org tried to do). On the other hand, as an org user breaking changes are inconvenient. I have the impression that I can keep up with using org-mode only because I follow the development list. What=CA=BCs much worse, I feel like I should not advocate the use of org-mode to my colleagues (who are often quite computer-literate but value long-term stability of software they use), basically because of the potential problems Bastien listed in his message. This situation is also inconvenient for developers...I have in mind a change several years ago to the #+begin_src lines for shell code. We changed from #+begin_src shell to #+begin_src sh (or vice versa, I can=CA=BCt remember precisely). The result was that =E2=80=9Cbug=E2=80=9D = reports trickled in for over a year, all of which had to be answered with the advice to change to the new specification. At the time I paid close attention to babel-related bug reports because I was working on that code a lot. Answering these reports (or even just reading them to see that they had been answered by someone else) took away from my opportunity to do (what I saw as) interesting things with org=CA=BCs code. I can only imagine that for ML subscribers who were not as interested in babel bugs as I was, the distraction could only have been worse. As a general (idealized) principle, I think user-visible changes should be phased in over at least one org major version. I have no problem with =E2=80=9Cintrusive=E2=80=9D deprecation warnings, but abrupt changes i= n behavior should be avoided. Here=CA=BCs what I imagine that could look like in the org-tempo case: For org 9.X: - Introduce the new functions and machinery for org-tempo as well as the new C-c C-, keybinding - Enable org-tempo by default - Show a user warning whenever a =E2=80=9CFrom 012f8d0b71c76f5d255af6bdaeb2d9c83a47cf85 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Tue, 1 May 2018 15:32:36 +0100 Subject: [PATCH] Use minor-mode machinery for org-tempo * lisp/org-tempo.el (org-tempo-mode): (org-tempo-global-mode): New minor modes. (org-tempo-mode--activate-in-buffer): New function. --- lisp/org-tempo.el | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/lisp/org-tempo.el b/lisp/org-tempo.el index e1268b893..2feed24dc 100644 --- a/lisp/org-tempo.el +++ b/lisp/org-tempo.el @@ -170,17 +170,28 @@ didn't succeed." 'org-tempo-tags) -;;; Setup of Org Tempo -;; -;; Org Tempo is set up with each new Org buffer and potentially in the -;; current Org buffer. - -(add-hook 'org-mode-hook 'org-tempo-setup) -(add-hook 'org-tab-before-tab-emulation-hook 'org-tempo-complete-tag) - -;; Enable Org Tempo in all open Org buffers. -(dolist (b (org-buffer-list 'files)) - (with-current-buffer b (org-tempo-setup))) +;;; Org Tempo minor mode + +;;;###autoload +(define-minor-mode org-tempo-mode + "Expand \"