unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58843: Print "decrypted" rot13 text is buffer is read-only
@ 2022-10-28 18:24 Philip Kaludercic
  2022-10-28 19:18 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2022-10-28 18:24 UTC (permalink / raw)
  To: 58843

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

Tags: patch


When someone sends you rot13'ed text but the buffer is read-only, it
seems the next best thing one can do is to print the decrypted text.  I
don't think it makes sense in general for `translate-region' to do the
same, so I just modified the code in rot13.el.


In GNU Emacs 29.0.50 (build 23, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.17.6) of 2022-10-22 built on rhea
Repository revision: ab283bddb2505e767bdf08b063c648b87d71d33a
Repository branch: feature/package+vc
System Description: Fedora Linux 36 (Workstation Edition)

Configured using:
 'configure --with-pgtk --with-imagemagick'


[-- Attachment #2: rot13.el --]
[-- Type: text/patch, Size: 4327 bytes --]

;;; rot13.el --- display a buffer in ROT13  -*- lexical-binding: t -*-

;; Copyright (C) 1988, 2001-2022 Free Software Foundation, Inc.

;; Author: Howard Gayle
;;         Simon Josefsson
;; Maintainer: emacs-devel@gnu.org

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;;   "ROT13 ('rotate by 13 places') is a simple letter substitution
;;   cipher that replaces a letter with the 13th letter after it in
;;   the alphabet.  ROT13 is a special case of the Caesar cipher
;;   which was developed in ancient Rome.
;;
;;   Because there are 26 letters (2×13) in the basic Latin
;;   alphabet, ROT13 is its own inverse; that is, to undo ROT13, the
;;   same algorithm is applied, so the same action can be used for
;;   encoding and decoding.  The algorithm provides virtually no
;;   cryptographic security, and is often cited as a canonical
;;   example of weak encryption.
;;
;;   ROT13 is used in online forums as a means of hiding spoilers,
;;   punchlines, puzzle solutions, and offensive materials from the
;;   casual glance."                      - Wikipedia article on ROT13
;;
;; The entry points, `rot13', `rot13-string', and `rot13-region' performs ROT13
;; encoding/decoding on buffers and strings.  The entry point
;; `rot13-other-window' performs a ROT13 encoding/decoding on the current
;; buffer and displays the result in another window.

;;; Code:

(defconst rot13-display-table
  (let ((table (make-display-table)))
    (dotimes (i 26)
      (aset table (+ i ?a) (vector (+ (% (+ i 13) 26) ?a)))
      (aset table (+ i ?A) (vector (+ (% (+ i 13) 26) ?A))))
    table)
  "Char table for ROT13 display.")

(put 'plain-char-table 'char-table-extra-slots 0)

(defconst rot13-translate-table
  (let ((table (make-char-table 'translation-table)))
    (dotimes (i 26)
      (aset table (+ i ?a) (+ (% (+ i 13) 26) ?a))
      (aset table (+ i ?A) (+ (% (+ i 13) 26) ?A)))
    table)
  "Char table for ROT13 translation.")

;;;###autoload
(defun rot13 (object &optional start end)
  "ROT13 encrypt OBJECT, a buffer or string.
If OBJECT is a buffer, encrypt the region between START and END.
If OBJECT is a string, encrypt it in its entirety, ignoring START
and END, and return the encrypted string."
  (if (bufferp object)
      (with-current-buffer object
	(rot13-region start end))
    (rot13-string object)))

;;;###autoload
(defun rot13-string (string)
  "Return ROT13 encryption of STRING."
  (with-temp-buffer
    (insert string)
    (rot13-region (point-min) (point-max))
    (buffer-string)))

;;;###autoload
(defun rot13-region (start end)
  "ROT13 encrypt the region between START and END in current buffer."
  (interactive "r")
  (translate-region start end rot13-translate-table))

;;;###autoload
(defun rot13-other-window ()
  "Display current buffer in ROT13 in another window.
The text itself is not modified, only the way it is displayed is affected.

To terminate the ROT13 display, delete that window.  As long as that window
is not deleted, any buffer displayed in it will become instantly encoded
in ROT13.

See also `toggle-rot13-mode'."
  (interactive)
  (let ((w (display-buffer (current-buffer) t)))
    (set-window-display-table w rot13-display-table)))

;;;###autoload
(defun toggle-rot13-mode ()
  "Toggle the use of ROT13 encoding for the current window."
  (interactive)
  (if (eq (window-display-table) rot13-display-table)
      (set-window-display-table (selected-window) nil)
    (if (null (window-display-table))
	(set-window-display-table (selected-window) rot13-display-table))))

(provide 'rot13)

;;; rot13.el ends here

^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-28 18:24 bug#58843: Print "decrypted" rot13 text is buffer is read-only Philip Kaludercic
@ 2022-10-28 19:18 ` Eli Zaretskii
  2022-10-28 19:37   ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2022-10-28 19:18 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 58843

> From: Philip Kaludercic <philipk@posteo.net>
> Date: Fri, 28 Oct 2022 18:24:58 +0000
> 
> Tags: patch
> 
> 
> When someone sends you rot13'ed text but the buffer is read-only, it
> seems the next best thing one can do is to print the decrypted text.  I
> don't think it makes sense in general for `translate-region' to do the
> same, so I just modified the code in rot13.el.

Thanks, but I see no patch in your message.  I see a complete rot13.el
file.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-28 19:18 ` Eli Zaretskii
@ 2022-10-28 19:37   ` Philip Kaludercic
  2022-10-29  5:51     ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2022-10-28 19:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 58843

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Date: Fri, 28 Oct 2022 18:24:58 +0000
>> 
>> Tags: patch
>> 
>> 
>> When someone sends you rot13'ed text but the buffer is read-only, it
>> seems the next best thing one can do is to print the decrypted text.  I
>> don't think it makes sense in general for `translate-region' to do the
>> same, so I just modified the code in rot13.el.
>
> Thanks, but I see no patch in your message.  I see a complete rot13.el
> file.

Oops, I must have selected the wrong file.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-rot13.el-rot13-region-Add-fallback-if-buffer-is.patch --]
[-- Type: text/x-patch, Size: 1187 bytes --]

From f97a27dcd06bafcb3ec6beaaf0f4d3b044f9fa64 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Fri, 28 Oct 2022 19:44:47 +0200
Subject: [PATCH] * lisp/rot13.el (rot13-region): Add fallback if buffer is
 read-only

---
 lisp/rot13.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/rot13.el b/lisp/rot13.el
index c063725de8..5d1c46e483 100644
--- a/lisp/rot13.el
+++ b/lisp/rot13.el
@@ -85,9 +85,16 @@ rot13-string
 
 ;;;###autoload
 (defun rot13-region (start end)
-  "ROT13 encrypt the region between START and END in current buffer."
+  "ROT13 encrypt the region between START and END in current buffer.
+If invoked interactively and the buffer is read-only, a message
+will be printed instead."
   (interactive "r")
-  (translate-region start end rot13-translate-table))
+  (condition-case nil
+      (translate-region start end rot13-translate-table)
+    (buffer-read-only
+     (when (called-interactively-p 'interactive)
+       (let ((dec (rot13-string (buffer-substring start end))))
+         (message "Buffer is read-only:\n%s" (string-trim dec)))))))
 
 ;;;###autoload
 (defun rot13-other-window ()
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-28 19:37   ` Philip Kaludercic
@ 2022-10-29  5:51     ` Eli Zaretskii
  2022-10-29  6:28       ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2022-10-29  5:51 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 58843

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: 58843@debbugs.gnu.org
> Date: Fri, 28 Oct 2022 19:37:28 +0000
> 
> >> When someone sends you rot13'ed text but the buffer is read-only, it
> >> seems the next best thing one can do is to print the decrypted text.  I
> >> don't think it makes sense in general for `translate-region' to do the
> >> same, so I just modified the code in rot13.el.
> >
> > Thanks, but I see no patch in your message.  I see a complete rot13.el
> > file.
> 
> Oops, I must have selected the wrong file.

Showing the result in the echo-area is a good idea, but echo-area is
not really suitable for displaying arbitrarily long text.  How about
popping a window with a temporary buffer instead?

This also needs a NEWS entry, I think.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29  5:51     ` Eli Zaretskii
@ 2022-10-29  6:28       ` Philip Kaludercic
  2022-10-29  7:08         ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2022-10-29  6:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 58843

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: 58843@debbugs.gnu.org
>> Date: Fri, 28 Oct 2022 19:37:28 +0000
>> 
>> >> When someone sends you rot13'ed text but the buffer is read-only, it
>> >> seems the next best thing one can do is to print the decrypted text.  I
>> >> don't think it makes sense in general for `translate-region' to do the
>> >> same, so I just modified the code in rot13.el.
>> >
>> > Thanks, but I see no patch in your message.  I see a complete rot13.el
>> > file.
>> 
>> Oops, I must have selected the wrong file.
>
> Showing the result in the echo-area is a good idea, but echo-area is
> not really suitable for displaying arbitrarily long text.  How about
> popping a window with a temporary buffer instead?

Is there a way to re-use shell-command's behaviour of displaying short
messages in the echo area and longer messages in a separate buffer?
Popping up a buffer just for one or two lines can be annoying,
especially if the information is not something you want to keep around.

> This also needs a NEWS entry, I think.

Will do.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29  6:28       ` Philip Kaludercic
@ 2022-10-29  7:08         ` Eli Zaretskii
  2022-10-29 15:32           ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2022-10-29  7:08 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 58843

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: 58843@debbugs.gnu.org
> Date: Sat, 29 Oct 2022 06:28:43 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Showing the result in the echo-area is a good idea, but echo-area is
> > not really suitable for displaying arbitrarily long text.  How about
> > popping a window with a temporary buffer instead?
> 
> Is there a way to re-use shell-command's behaviour of displaying short
> messages in the echo area and longer messages in a separate buffer?

It's a few lines in shell-command, so you could reuse them, or make a
utility function out of them.

> Popping up a buffer just for one or two lines can be annoying,
> especially if the information is not something you want to keep around.

Sure, that would be even better.  Although in that case we'd need to
change what the manual says about the command, because it explicitly
says we show the encoded text in another window.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29  7:08         ` Eli Zaretskii
@ 2022-10-29 15:32           ` Philip Kaludercic
  2022-10-29 15:50             ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2022-10-29 15:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 58843

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: 58843@debbugs.gnu.org
>> Date: Sat, 29 Oct 2022 06:28:43 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Showing the result in the echo-area is a good idea, but echo-area is
>> > not really suitable for displaying arbitrarily long text.  How about
>> > popping a window with a temporary buffer instead?
>> 
>> Is there a way to re-use shell-command's behaviour of displaying short
>> messages in the echo area and longer messages in a separate buffer?
>
> It's a few lines in shell-command, so you could reuse them, or make a
> utility function out of them.

Turns out there was a function that does just this,
`display-message-or-buffer'.

>> Popping up a buffer just for one or two lines can be annoying,
>> especially if the information is not something you want to keep around.
>
> Sure, that would be even better.  Although in that case we'd need to
> change what the manual says about the command, because it explicitly
> says we show the encoded text in another window.

How is this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Have-rot13-region-gracefully-handle-read-only-buffer.patch --]
[-- Type: text/x-patch, Size: 1964 bytes --]

From db7c83f864971ce457ac8319d02c4579f3b76e0a Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Sat, 29 Oct 2022 17:30:13 +0200
Subject: [PATCH] Have 'rot13-region' gracefully handle read-only buffers

* etc/NEWS: Mention new behaviour.
* lisp/rot13.el (rot13-region): Use 'display-message-or-buffer'
---
 etc/NEWS      |  4 ++++
 lisp/rot13.el | 14 ++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 19c9014116..750d9c76ba 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -828,6 +828,10 @@ wheel reports.  Unlike 'pixel-scroll-mode', this mode scrolls the
 display pixel-by-pixel, as opposed to only animating line-by-line
 scrolls.
 
+** 'rot13-region' handles read-only text
+If a buffer is read-only, 'rot13-region' will display the "decrypted"
+text in the echo area, or if necessary in a separate buffer.
+
 ** Terminal Emacs
 
 ---
diff --git a/lisp/rot13.el b/lisp/rot13.el
index c063725de8..ba27a3a074 100644
--- a/lisp/rot13.el
+++ b/lisp/rot13.el
@@ -85,9 +85,19 @@ rot13-string
 
 ;;;###autoload
 (defun rot13-region (start end)
-  "ROT13 encrypt the region between START and END in current buffer."
+  "ROT13 encrypt the region between START and END in current buffer.
+If invoked interactively and the buffer is read-only, the buffer
+is either displayed in a the echo area if the text is short
+enough (as determined by `resize-mini-windows' and
+`max-mini-window-height'), or in a separate buffer."
   (interactive "r")
-  (translate-region start end rot13-translate-table))
+  (condition-case nil
+      (translate-region start end rot13-translate-table)
+    (buffer-read-only
+     (when (called-interactively-p 'interactive)
+       (let* ((encrypted (buffer-substring-no-properties start end))
+              (decrypted (rot13-string encrypted)))
+         (display-message-or-buffer decrypted "*Rot 13*"))))))
 
 ;;;###autoload
 (defun rot13-other-window ()
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29 15:32           ` Philip Kaludercic
@ 2022-10-29 15:50             ` Eli Zaretskii
  2022-10-29 16:03               ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2022-10-29 15:50 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 58843

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: 58843@debbugs.gnu.org
> Date: Sat, 29 Oct 2022 15:32:10 +0000
> 
> > Sure, that would be even better.  Although in that case we'd need to
> > change what the manual says about the command, because it explicitly
> > says we show the encoded text in another window.
> 
> How is this:

LGTM, but what about the suitable change to the user manual?

Thanks.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29 15:50             ` Eli Zaretskii
@ 2022-10-29 16:03               ` Philip Kaludercic
  2022-10-29 16:12                 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2022-10-29 16:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 58843

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: 58843@debbugs.gnu.org
>> Date: Sat, 29 Oct 2022 15:32:10 +0000
>> 
>> > Sure, that would be even better.  Although in that case we'd need to
>> > change what the manual says about the command, because it explicitly
>> > says we show the encoded text in another window.
>> 
>> How is this:
>
> LGTM, but what about the suitable change to the user manual?

I can't appear to find anything in the manual mentioning rot13.  Are you
suggesting creating a new node?





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29 16:03               ` Philip Kaludercic
@ 2022-10-29 16:12                 ` Eli Zaretskii
  2022-10-29 16:25                   ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2022-10-29 16:12 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 58843

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: 58843@debbugs.gnu.org
> Date: Sat, 29 Oct 2022 16:03:39 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > LGTM, but what about the suitable change to the user manual?
> 
> I can't appear to find anything in the manual mentioning rot13.  Are you
> suggesting creating a new node?

No, this is described in the "Rmail Rot13" node.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29 16:12                 ` Eli Zaretskii
@ 2022-10-29 16:25                   ` Philip Kaludercic
  2022-10-29 16:45                     ` Eli Zaretskii
  2022-10-30 14:44                     ` Stefan Kangas
  0 siblings, 2 replies; 16+ messages in thread
From: Philip Kaludercic @ 2022-10-29 16:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 58843

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: 58843@debbugs.gnu.org
>> Date: Sat, 29 Oct 2022 16:03:39 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > LGTM, but what about the suitable change to the user manual?
>> 
>> I can't appear to find anything in the manual mentioning rot13.  Are you
>> suggesting creating a new node?
>
> No, this is described in the "Rmail Rot13" node.

Ah yes.  How does this look like:


[-- Attachment #2: Type: text/plain, Size: 718 bytes --]

diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index e38bde036a..4939f5597c 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -1409,6 +1409,13 @@ Rmail Rot13
 rot13-other-window}.  This displays the current buffer in another window
 which applies the code when displaying the text.
 
+@findex rot13-region
+  If you are only interested in a region, the command @kbd{M-x
+rot13-region} might be preferable.  This will decrypt the active
+region in place.  If the buffer is read-only, it will attempt to
+display the plain text in the echo area.  If the text is too long, a
+separate buffer will be used.
+
 @node Movemail
 @section @command{movemail} program
 @cindex @command{movemail} program

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29 16:25                   ` Philip Kaludercic
@ 2022-10-29 16:45                     ` Eli Zaretskii
  2022-10-30 14:17                       ` Philip Kaludercic
  2022-10-30 14:44                     ` Stefan Kangas
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2022-10-29 16:45 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 58843

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: 58843@debbugs.gnu.org
> Date: Sat, 29 Oct 2022 16:25:07 +0000
> 
> > No, this is described in the "Rmail Rot13" node.
> 
> Ah yes.  How does this look like:

OK, with two nits:

> +@findex rot13-region
> +  If you are only interested in a region, the command @kbd{M-x
> +rot13-region} might be preferable.  This will decrypt the active
> +region in place.  If the buffer is read-only, it will attempt to
          ^^^^^^^^
"in-place"

> +display the plain text in the echo area.  If the text is too long, a
> +separate buffer will be used.
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Passive voice alert!  Suggest to rephrase

  If the text is too long for the echo area, the command will pop up a
  temporary buffer with the decrypted text.

Btw, is it "decrypted" or "encrypted/decrypted"?

Thanks.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29 16:45                     ` Eli Zaretskii
@ 2022-10-30 14:17                       ` Philip Kaludercic
  2022-11-04 23:09                         ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2022-10-30 14:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 58843

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: 58843@debbugs.gnu.org
>> Date: Sat, 29 Oct 2022 16:25:07 +0000
>> 
>> > No, this is described in the "Rmail Rot13" node.
>> 
>> Ah yes.  How does this look like:
>
> OK, with two nits:
>
>> +@findex rot13-region
>> +  If you are only interested in a region, the command @kbd{M-x
>> +rot13-region} might be preferable.  This will decrypt the active
>> +region in place.  If the buffer is read-only, it will attempt to
>           ^^^^^^^^
> "in-place"
>
>> +display the plain text in the echo area.  If the text is too long, a
>> +separate buffer will be used.
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Passive voice alert!  Suggest to rephrase
>
>   If the text is too long for the echo area, the command will pop up a
>   temporary buffer with the decrypted text.

Done.

> Btw, is it "decrypted" or "encrypted/decrypted"?

I guess the latter makes more sense, though it is not that important.
I've adapted the change anyway.

> Thanks.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-29 16:25                   ` Philip Kaludercic
  2022-10-29 16:45                     ` Eli Zaretskii
@ 2022-10-30 14:44                     ` Stefan Kangas
  2022-10-30 14:52                       ` Philip Kaludercic
  1 sibling, 1 reply; 16+ messages in thread
From: Stefan Kangas @ 2022-10-30 14:44 UTC (permalink / raw)
  To: Philip Kaludercic, Eli Zaretskii; +Cc: 58843

Philip Kaludercic <philipk@posteo.net> writes:

>> No, this is described in the "Rmail Rot13" node.
>
> Ah yes.  How does this look like:

Do people use rot13 very much these days?  I've not seen it used in
practice in 20 years, but that's just anecdotal of course.

Would it make sense to exclude the `(emacs) Rmail Rot13' section from
the printed manual?  I don't know how frequently we do that, and maybe
the practice is frowned upon.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-30 14:44                     ` Stefan Kangas
@ 2022-10-30 14:52                       ` Philip Kaludercic
  0 siblings, 0 replies; 16+ messages in thread
From: Philip Kaludercic @ 2022-10-30 14:52 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Eli Zaretskii, 58843

Stefan Kangas <stefankangas@gmail.com> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>>> No, this is described in the "Rmail Rot13" node.
>>
>> Ah yes.  How does this look like:
>
> Do people use rot13 very much these days?  I've not seen it used in
> practice in 20 years, but that's just anecdotal of course.

The reason I am proposing this patch is because I have been using it for
the last few weeks as I am taking a cryptography course, and the
exercise hints are "encrypted" in rot13.

> Would it make sense to exclude the `(emacs) Rmail Rot13' section from
> the printed manual?  I don't know how frequently we do that, and maybe
> the practice is frowned upon.

I have no opinion on this.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#58843: Print "decrypted" rot13 text is buffer is read-only
  2022-10-30 14:17                       ` Philip Kaludercic
@ 2022-11-04 23:09                         ` Philip Kaludercic
  0 siblings, 0 replies; 16+ messages in thread
From: Philip Kaludercic @ 2022-11-04 23:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 58843-done

Philip Kaludercic <philipk@posteo.net> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Philip Kaludercic <philipk@posteo.net>
>>> Cc: 58843@debbugs.gnu.org
>>> Date: Sat, 29 Oct 2022 16:25:07 +0000
>>> 
>>> > No, this is described in the "Rmail Rot13" node.
>>> 
>>> Ah yes.  How does this look like:
>>
>> OK, with two nits:
>>
>>> +@findex rot13-region
>>> +  If you are only interested in a region, the command @kbd{M-x
>>> +rot13-region} might be preferable.  This will decrypt the active
>>> +region in place.  If the buffer is read-only, it will attempt to
>>           ^^^^^^^^
>> "in-place"
>>
>>> +display the plain text in the echo area.  If the text is too long, a
>>> +separate buffer will be used.
>>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> Passive voice alert!  Suggest to rephrase
>>
>>   If the text is too long for the echo area, the command will pop up a
>>   temporary buffer with the decrypted text.
>
> Done.
>
>> Btw, is it "decrypted" or "encrypted/decrypted"?
>
> I guess the latter makes more sense, though it is not that important.
> I've adapted the change anyway.
>
>> Thanks.

I have pushed the patch with these modifications, and am therefore
closing the report.





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-11-04 23:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 18:24 bug#58843: Print "decrypted" rot13 text is buffer is read-only Philip Kaludercic
2022-10-28 19:18 ` Eli Zaretskii
2022-10-28 19:37   ` Philip Kaludercic
2022-10-29  5:51     ` Eli Zaretskii
2022-10-29  6:28       ` Philip Kaludercic
2022-10-29  7:08         ` Eli Zaretskii
2022-10-29 15:32           ` Philip Kaludercic
2022-10-29 15:50             ` Eli Zaretskii
2022-10-29 16:03               ` Philip Kaludercic
2022-10-29 16:12                 ` Eli Zaretskii
2022-10-29 16:25                   ` Philip Kaludercic
2022-10-29 16:45                     ` Eli Zaretskii
2022-10-30 14:17                       ` Philip Kaludercic
2022-11-04 23:09                         ` Philip Kaludercic
2022-10-30 14:44                     ` Stefan Kangas
2022-10-30 14:52                       ` Philip Kaludercic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).