emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: Paul Eggert <eggert@cs.ucla.edu>, emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas
Date: Fri, 11 Mar 2016 12:44:48 -0500	[thread overview]
Message-ID: <CAFyQvY0c8NFZBiYx9a3MQj2t_r2S2f1eyKow8wy8kmmb_ifV4g@mail.gmail.com> (raw)
In-Reply-To: <8737rxa97v.fsf@kyleam.com>


[-- Attachment #1.1: Type: text/plain, Size: 1537 bytes --]

Patch (after rebasing to 5a735b0) attached. I hope it works.

Git newbie question:

Making the changes in the maint version of these 4 files manually was a bit
of a pain. What's the right way of porting changes from one branch to
another? I am curious how the changes will be ported from the maint branch
to the master branch. What git command should I be looking at to do this in
future? (because I always use the master branch and if I need to submit a
patch in future, I would need to switch to maint branch and port changes
from my master.

Thanks.

--
Kaushal Modi

On Fri, Mar 11, 2016 at 12:12 AM, Kyle Meyer <kyle@kyleam.com> wrote:

> Kaushal Modi <kaushal.modi@gmail.com> writes:
>
> > About the patch not merging, I am surprised why that happened because I
> > first rebased to
> >
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e69e18dd71bdf0c9bae9546bf026a1123b9a8c53
> > and then created the patch. I redo the steps using git send-email
> tomorrow
> > and understand the difference.
>
> Please make the patch against the maint branch (currently 5a735b0b8)
> rather than master.  Also, you don't need to bother configuring git
> send-email; an attachment with the output of git format-patch is OK too.
>
> > About the org-contribute page, it is pointing to a different version of
> > emacs CONTRIBUTE, different from the one on emacs-25 branch (
> > http://git.savannah.gnu.org/cgit/emacs.git/tree/CONTRIBUTE ). Can you
> > please review that?
>
> Thanks for pointing that out.  I'll update the link.
>
> --
> Kyle
>

[-- Attachment #1.2: Type: text/html, Size: 2505 bytes --]

[-- Attachment #2: 0001-Display-quotes-in-key-bindings-as-straight-quotes.patch --]
[-- Type: application/octet-stream, Size: 5523 bytes --]

From fb7fbb2bca7e7448f25ae014a506311024095aac Mon Sep 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi@gmail.com>
Date: Fri, 11 Mar 2016 12:30:20 -0500
Subject: [PATCH] Display quotes in key-bindings as straight quotes

* lisp/org-agenda.el (org-agenda-show-the-flagging-note):
* lisp/org-footnote.el (org-footnote-goto-definition):
* lisp/org-table.el (org-table-edit-formulas): Fix straight quotes
  rendered as curvy quotes in echoes messages (in emacs 25.1).
* lisp/org-table.el (org-table-align): Fix straight quotes rendered as
  curvy quotes in help echo (in emacs 25.1).

* lisp/org-protocol.el (org-protocol-create-for-org):
* lisp/org-table.el (org-table-sum): Minor reformatting.

The below thread discusses why these changes were needed especially when
using emacs 25.1 or newer emacsen (that added support for rendering
back-quotes and straight quotes as left/right curvy quotes by default):
http://thread.gmane.org/gmane.emacs.orgmode/105594

Fix the quote style displayed when key-bindings are shown in
the echo via (message .. (substitute-command-keys ..)).

So below will render that single quote as curly.

(message "C-c '")

The fix (Reference:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00234.html)
is to print that quote verbatim using the "%s" modifier:

(message "%s" "C-c '")

Also an help-echo text property value was fixed in `org-table-align'.
`substitute-command-keys' should not be used in that.  Instead \\[COMMAND]
should be used directly in the string.
---
 lisp/org-agenda.el   |  5 +++--
 lisp/org-footnote.el |  7 +++----
 lisp/org-protocol.el |  2 +-
 lisp/org-table.el    | 17 +++++++----------
 4 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 19a4095..bf7fc34 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -10083,8 +10083,9 @@ tag and (if present) the flagging note."
 	(replace-match "\n" t t))
       (goto-char (point-min))
       (select-window win)
-      (message (substitute-command-keys "Flagging note pushed to kill ring.  \
-Press \\[org-agenda-show-the-flagging-note] again to remove tag and note")))))
+      (message "%s" (substitute-command-keys "Flagging note pushed to \
+kill ring.  Press \\[org-agenda-show-the-flagging-note] again to remove \
+tag and note")))))
 
 (defun org-agenda-remove-flag (marker)
   "Remove the FLAGGED tag and any flagging note in the entry."
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 800b5df..b83a7f7 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -391,10 +391,9 @@ value if point was successfully moved."
     (goto-char (match-end 0))
     (org-show-context 'link-search)
     (when (derived-mode-p 'org-mode)
-      (message
-       (substitute-command-keys
-	"Edit definition and go back with `\\[org-mark-ring-goto]' or, if \
-unique, with `\\[org-ctrl-c-ctrl-c]'.")))
+      (message "%s" (substitute-command-keys
+		     "Edit definition and go back with \
+`\\[org-mark-ring-goto]' or, if unique, with `\\[org-ctrl-c-ctrl-c]'.")))
     t))
 
 (defun org-footnote-goto-previous-reference (label)
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 2f2c54b..e5f8961 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -580,7 +580,7 @@ delegates most of the work to `org-protocol-create'."
   (require 'org-publish)
   (let ((all (or (org-publish-get-project-from-filename buffer-file-name))))
     (if all (org-protocol-create (cdr all))
-      (message "Not in an org-project.  Did mean %s?"
+      (message "Not in an org-project.  Did you mean `%s'?"
                (substitute-command-keys"\\[org-protocol-create]")))))
 
 (defun org-protocol-create (&optional project-plist)
diff --git a/lisp/org-table.el b/lisp/org-table.el
index e43f0f8..e21d386 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -795,9 +795,8 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
                    (org-add-props x nil
                      'help-echo
 		     (concat
-                      (substitute-command-keys
-                       "Clipped table field, use \\[org-table-edit-field] to \
-edit.  Full value is:\n")
+		      "Clipped table field, use `\\[org-table-edit-field]' to \
+edit.  Full value is:\n"
                       (substring-no-properties x)))
                    (let ((l (length x))
                          (f1 (min fmax
@@ -2136,11 +2135,10 @@ If NLAST is a number, only the NLAST fields will actually be summed."
 			   s diff)
 		     (format "%.0f:%02.0f:%02.0f" h m s))))
 	(kill-new sres)
-	(if (org-called-interactively-p 'interactive)
-	    (message "%s"
-		     (substitute-command-keys
-		      (format "Sum of %d items: %-20s     (\\[yank] will insert result into buffer)"
-			      (length numbers) sres))))
+	(when (org-called-interactively-p 'interactive)
+	    (message "%s" (substitute-command-keys
+			   (format "Sum of %d items: %-20s     \
+(\\[yank] will insert result into buffer)" (length numbers) sres))))
 	sres))))
 
 (defun org-table-get-number-for-summing (s)
@@ -3597,8 +3595,7 @@ Parameters get priority."
       (when (eq org-table-use-standard-references t)
 	(org-table-fedit-toggle-ref-type))
       (org-goto-line startline)
-      (message
-       (substitute-command-keys "\\<org-mode-map>\
+      (message "%s" (substitute-command-keys "\\<org-mode-map>\
 Edit formulas, finish with `\\[org-ctrl-c-ctrl-c]' or `\\[org-edit-special]'.  \
 See menu for more commands.")))))
 
-- 
2.6.0.rc0.24.gec371ff


  reply	other threads:[~2016-03-11 17:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 16:18 [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas Kaushal Modi
2016-03-10  9:25 ` Nicolas Goaziou
2016-03-10 15:33   ` Kaushal Modi
2016-03-10 16:05     ` Paul Eggert
2016-03-10 16:00   ` Kyle Meyer
2016-03-10 16:38 ` Kyle Meyer
2016-03-10 16:41   ` Kaushal Modi
2016-03-10 17:47     ` Kaushal Modi
2016-03-10 18:24       ` Kaushal Modi
2016-03-11  1:39       ` Paul Eggert
2016-03-11  3:22         ` Kaushal Modi
2016-03-11  4:30           ` Kyle Meyer
2016-03-11  4:55             ` Kaushal Modi
2016-03-11  5:12               ` Kyle Meyer
2016-03-11 17:44                 ` Kaushal Modi [this message]
2016-03-11 18:47                   ` Kyle Meyer
2016-03-11 19:16                     ` Kyle Meyer
2016-03-12  4:01                     ` Kyle Meyer
2016-03-12  4:57                       ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY0c8NFZBiYx9a3MQj2t_r2S2f1eyKow8wy8kmmb_ifV4g@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).