[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quit and Error in org-export--dispatch-action

From: Takaaki Ishikawa
Subject: Re: Quit and Error in org-export--dispatch-action
Date: Thu, 5 Dec 2019 22:59:47 +0900

Dear Kyle and all,

Using user-error is another way, but it does not work for me
because user-error stops the org-export-dispatch.
I would like to keep the session to do an action after
the completing org-export-dispatch something like this:

  (defun my-org-export-dispatch (f ARG)
    (interactive "P")
    (if (< (frame-width) 160)
        (apply f ARG)
      (apply f ARG)
  (advice-add 'org-export-dispatch :around #'my-org-export-dispatch)

So I still prefer to replace the error function with a simple message function.
If you agree with this idea, I'll produce an appropriate patch for this
as you kindly instructed.


Takaaki ISHIKAWA <address@hidden>

2019年12月5日(木) 19:27 Kyle Meyer <address@hidden>:
> Hi Takaaki,
> Takaaki Ishikawa <address@hidden> writes:
> > The org-export provides a quitting option for user by typing `q`.
> > This is nice feature but it is implemented with an error function.
> > For me, it is not actually an error, it is one of the user actions,
> > and when `debug-on-error` is `t`, the Backtrace buffer will be
> > popped up every time. It is annoying.
> True, that shouldn't be treated as a plain error.
> > Please find a patch to replace error function with a simple message.
> > What do you think?
> >
> >[...]
> >
> > --- a/lisp/ox.el
> > +++ b/lisp/ox.el
> > @@ -6929,8 +6929,8 @@ options as CDR."
> >        (org-export--dispatch-ui options first-key expertp))
> >       ;; q key at first level aborts export.  At second level, cancel
> >       ;; first key instead.
> > -     ((eq key ?q) (if (not first-key) (error "Export aborted")
> > -                 (org-export--dispatch-ui options nil expertp)))
> > +     ((eq key ?q) (if first-key (org-export--dispatch-ui options nil 
> > expertp)
> > +                 (message "Export aborted") '(ignore)))
> Hmm, what about instead replacing the call to `error' with a call to
> `user-error'?  If that works for you, could you send an updated patch
> with a commit message?  (Org's commit message conventions are described
> at <https://orgmode.org/worg/org-contribute.html#commit-messages>.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]