Code simplification
Simplified some code and calls, less `setq-local` delegated to `let*`
This commit is contained in:
parent
ea9637ff5a
commit
3e27453523
15
funcs.el
15
funcs.el
@ -73,10 +73,9 @@ table"
|
||||
none the word the cursor is over"
|
||||
(interactive)
|
||||
(let* ((beg (region-beginning))
|
||||
(end (region-end))
|
||||
(boundary-word (bounds-of-thing-at-point 'word)))
|
||||
(end (region-end)))
|
||||
(if (= beg end)
|
||||
boundary-word
|
||||
(bounds-of-thing-at-point 'word)
|
||||
(cons beg end))))
|
||||
|
||||
(defun conlanging//replace-char-by-table (t-correspondance-table)
|
||||
@ -87,12 +86,10 @@ second element of the pair the string it has to be replaced
|
||||
with."
|
||||
(let* ((cur-boundary (conlanging//get-boundary))
|
||||
(beg (car cur-boundary))
|
||||
(end (cdr cur-boundary)))
|
||||
(setq-local regionp
|
||||
(buffer-substring-no-properties beg end))
|
||||
(setq-local regionp
|
||||
(conlanging//replace-string-by-char regionp
|
||||
t-correspondance-table))
|
||||
(end (cdr cur-boundary))
|
||||
(regionp (buffer-substring-no-properties beg end))
|
||||
(new-regionp (conlanging//replace-string-by-char regionp
|
||||
t-correspondance-table)))
|
||||
(delete-region beg end)
|
||||
(goto-char beg)
|
||||
(insert regionp)))
|
||||
|
Reference in New Issue
Block a user