From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Schmidt Subject: Re: orgstruct in emacs -nw Date: Thu, 23 May 2013 13:46:12 +0100 (BST) Message-ID: <877giplv8y@ch.ristopher.com> References: <87a9nmj6yh.fsf@mean.albasani.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfUuU-000303-7w for emacs-orgmode@gnu.org; Thu, 23 May 2013 08:46:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfUuN-00044M-G9 for emacs-orgmode@gnu.org; Thu, 23 May 2013 08:46:22 -0400 Received: from ristopher.com ([146.185.21.93]:49236 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfUuN-00044A-7X for emacs-orgmode@gnu.org; Thu, 23 May 2013 08:46:15 -0400 In-Reply-To: <87a9nmj6yh.fsf@mean.albasani.net> (Memnon Anon's message of "Thu, 23 May 2013 11:47:40 +0000 (UTC)") 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain > I tried to use the orgstruct minor mode, but it didn't seem to do > anything, although I used exactly the same setup Bastien showed in his > interview[1]. > > After a while, I realized it was because I was using emacs in an > xterm. Steps to reproduce below.[2] Some bindings, such as M-TAB, C-n or C-p, should work fine. > Wrong setup, a bug or intentional? This is a bug. Can you please give this patch a try and see if it corrects the issue? Apply it on master (06cdb2d). Thanks! --=-=-= Content-Type: text/x-diff Content-Disposition: inline --- a/lisp/org.el +++ b/lisp/org.el @@ -8960,26 +8960,30 @@ buffer. It will also recognize item context in multiline items." (let ((f (or (car-safe cell) cell)) (disable-when-heading-prefix (cdr-safe cell))) (when (fboundp f) - (dolist (binding (nconc (where-is-internal f org-mode-map) - (where-is-internal f outline-mode-map))) - ;; TODO use local-function-key-map - (dolist (rep '(("" . "TAB") - ("" . "RET") - ("" . "ESC") - ("" . "DEL"))) - (setq binding (read-kbd-macro - (let ((case-fold-search)) - (replace-regexp-in-string - (regexp-quote (cdr rep)) - (car rep) - (key-description binding)))))) - (let ((key (lookup-key orgstruct-mode-map binding))) - (when (or (not key) (numberp key)) - (condition-case nil - (org-defkey orgstruct-mode-map - binding - (orgstruct-make-binding f binding disable-when-heading-prefix)) - (error nil)))))))) + (let ((new-bindings)) + (dolist (binding (nconc (where-is-internal f org-mode-map) + (where-is-internal f outline-mode-map))) + (push binding new-bindings) + ;; TODO use local-function-key-map + (dolist (rep '(("" . "TAB") + ("" . "RET") + ("" . "ESC") + ("" . "DEL"))) + (setq binding (read-kbd-macro + (let ((case-fold-search)) + (replace-regexp-in-string + (regexp-quote (cdr rep)) + (car rep) + (key-description binding))))) + (cl-pushnew binding new-bindings :test 'equal))) + (dolist (binding new-bindings) + (let ((key (lookup-key orgstruct-mode-map binding))) + (when (or (not key) (numberp key)) + (condition-case nil + (org-defkey orgstruct-mode-map + binding + (orgstruct-make-binding f binding disable-when-heading-prefix)) + (error nil))))))))) (run-hooks 'orgstruct-setup-hook)) (defun orgstruct-make-binding (fun key disable-when-heading-prefix) --=-=-= Content-Type: text/plain Christopher --=-=-=--