diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-20 03:24:30 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-20 03:24:38 +0200 |
commit | 4d7390576b1fdc385e48ae9eab19f70c82643c0c (patch) | |
tree | ceb9066661daa03d6bcc02a54d3f418cfdc19f28 /lisp/progmodes | |
parent | 10411697468ebfcae93ffb48ca773d5321c8a5ec (diff) | |
download | emacs-4d7390576b1fdc385e48ae9eab19f70c82643c0c.tar.gz emacs-4d7390576b1fdc385e48ae9eab19f70c82643c0c.tar.bz2 emacs-4d7390576b1fdc385e48ae9eab19f70c82643c0c.zip |
Add a new command 'yank-in-context'
* lisp/simple.el (escaped-string-quote): New variable.
(yank-in-context): New command.
(yank-in-context--transform): Helper function.
* lisp/progmodes/sh-script.el (sh-mode): Set up an
escaped-string-quote function.
* lisp/progmodes/sql.el (sql-mode): Define escaped-string-quote.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/sh-script.el | 5 | ||||
-rw-r--r-- | lisp/progmodes/sql.el | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index e48fa0668b5..8205218ce11 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1543,6 +1543,11 @@ with your script for an edit-interpret-debug cycle." (add-hook 'completion-at-point-functions #'sh-completion-at-point-function nil t) (setq-local outline-regexp "###") + (setq-local escaped-string-quote + (lambda (terminator) + (if (eq terminator ?') + "'\\'" + "\\"))) ;; Parse or insert magic number for exec, and set all variables depending ;; on the shell thus determined. (sh-set-shell diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 7bb4fef0c09..8d259860901 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -4159,6 +4159,7 @@ must tell Emacs. Here's how to do that in your init file: (setq-local abbrev-all-caps 1) ;; Contains the name of database objects (setq-local sql-contains-names t) + (setq-local escaped-string-quote "'") (setq-local syntax-propertize-function (syntax-propertize-rules ;; Handle escaped apostrophes within strings. |